web-speech-cognitive-services 7.1.4-master.9e026d9 → 8.0.0-main.478b2e9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/web-speech-cognitive-services.d.mts +186 -0
- package/dist/web-speech-cognitive-services.d.ts +186 -0
- package/dist/web-speech-cognitive-services.development.js +25677 -0
- package/dist/web-speech-cognitive-services.development.js.map +1 -0
- package/dist/web-speech-cognitive-services.js +1267 -0
- package/dist/web-speech-cognitive-services.js.map +1 -0
- package/dist/web-speech-cognitive-services.mjs +1232 -0
- package/dist/web-speech-cognitive-services.mjs.map +1 -0
- package/dist/web-speech-cognitive-services.production.min.js +31 -0
- package/dist/web-speech-cognitive-services.production.min.js.map +1 -0
- package/package.json +54 -40
- package/CHANGELOG.md +0 -372
- package/lib/BingSpeech/SpeechToText/SpeechGrammarList.js +0 -94
- package/lib/BingSpeech/SpeechToText/SpeechGrammarList.js.map +0 -1
- package/lib/BingSpeech/SpeechToText/createSpeechRecognitionPonyfill.js +0 -483
- package/lib/BingSpeech/SpeechToText/createSpeechRecognitionPonyfill.js.map +0 -1
- package/lib/BingSpeech/SpeechToText.js +0 -14
- package/lib/BingSpeech/SpeechToText.js.map +0 -1
- package/lib/BingSpeech/TextToSpeech/AudioContextConsumer.js +0 -122
- package/lib/BingSpeech/TextToSpeech/AudioContextConsumer.js.map +0 -1
- package/lib/BingSpeech/TextToSpeech/AudioContextQueue.js +0 -104
- package/lib/BingSpeech/TextToSpeech/AudioContextQueue.js.map +0 -1
- package/lib/BingSpeech/TextToSpeech/SpeechSynthesisUtterance.js +0 -264
- package/lib/BingSpeech/TextToSpeech/SpeechSynthesisUtterance.js.map +0 -1
- package/lib/BingSpeech/TextToSpeech/SpeechSynthesisVoice.js +0 -61
- package/lib/BingSpeech/TextToSpeech/SpeechSynthesisVoice.js.map +0 -1
- package/lib/BingSpeech/TextToSpeech/buildSSML.js +0 -32
- package/lib/BingSpeech/TextToSpeech/buildSSML.js.map +0 -1
- package/lib/BingSpeech/TextToSpeech/createSpeechSynthesisPonyfill.js +0 -220
- package/lib/BingSpeech/TextToSpeech/createSpeechSynthesisPonyfill.js.map +0 -1
- package/lib/BingSpeech/TextToSpeech/fetchSpeechData.js +0 -74
- package/lib/BingSpeech/TextToSpeech/fetchSpeechData.js.map +0 -1
- package/lib/BingSpeech/TextToSpeech/fetchVoices.js +0 -335
- package/lib/BingSpeech/TextToSpeech/fetchVoices.js.map +0 -1
- package/lib/BingSpeech/TextToSpeech/isSSML.js +0 -13
- package/lib/BingSpeech/TextToSpeech/isSSML.js.map +0 -1
- package/lib/BingSpeech/TextToSpeech/subscribeEvent.js +0 -14
- package/lib/BingSpeech/TextToSpeech/subscribeEvent.js.map +0 -1
- package/lib/BingSpeech/TextToSpeech.js +0 -14
- package/lib/BingSpeech/TextToSpeech.js.map +0 -1
- package/lib/BingSpeech/Util/DOMEventEmitter.js +0 -61
- package/lib/BingSpeech/Util/DOMEventEmitter.js.map +0 -1
- package/lib/BingSpeech/Util/createFetchTokenUsingSubscriptionKey.js +0 -41
- package/lib/BingSpeech/Util/createFetchTokenUsingSubscriptionKey.js.map +0 -1
- package/lib/BingSpeech/fetchAuthorizationToken.js +0 -57
- package/lib/BingSpeech/fetchAuthorizationToken.js.map +0 -1
- package/lib/BingSpeech/index.js +0 -84
- package/lib/BingSpeech/index.js.map +0 -1
- package/lib/SpeechServices/SpeechSDK.js +0 -19
- package/lib/SpeechServices/SpeechSDK.js.map +0 -1
- package/lib/SpeechServices/SpeechToText/SpeechGrammarList.js +0 -45
- package/lib/SpeechServices/SpeechToText/SpeechGrammarList.js.map +0 -1
- package/lib/SpeechServices/SpeechToText/cognitiveServiceEventResultToWebSpeechRecognitionResultList.js +0 -56
- package/lib/SpeechServices/SpeechToText/cognitiveServiceEventResultToWebSpeechRecognitionResultList.js.map +0 -1
- package/lib/SpeechServices/SpeechToText/createSpeechRecognitionPonyfill.js +0 -984
- package/lib/SpeechServices/SpeechToText/createSpeechRecognitionPonyfill.js.map +0 -1
- package/lib/SpeechServices/SpeechToText.js +0 -24
- package/lib/SpeechServices/SpeechToText.js.map +0 -1
- package/lib/SpeechServices/TextToSpeech/AudioContextConsumer.js +0 -92
- package/lib/SpeechServices/TextToSpeech/AudioContextConsumer.js.map +0 -1
- package/lib/SpeechServices/TextToSpeech/AudioContextQueue.js +0 -111
- package/lib/SpeechServices/TextToSpeech/AudioContextQueue.js.map +0 -1
- package/lib/SpeechServices/TextToSpeech/SpeechSynthesisEvent.js +0 -40
- package/lib/SpeechServices/TextToSpeech/SpeechSynthesisEvent.js.map +0 -1
- package/lib/SpeechServices/TextToSpeech/SpeechSynthesisUtterance.js +0 -283
- package/lib/SpeechServices/TextToSpeech/SpeechSynthesisUtterance.js.map +0 -1
- package/lib/SpeechServices/TextToSpeech/SpeechSynthesisVoice.js +0 -63
- package/lib/SpeechServices/TextToSpeech/SpeechSynthesisVoice.js.map +0 -1
- package/lib/SpeechServices/TextToSpeech/buildSSML.js +0 -32
- package/lib/SpeechServices/TextToSpeech/buildSSML.js.map +0 -1
- package/lib/SpeechServices/TextToSpeech/createSpeechSynthesisPonyfill.js +0 -282
- package/lib/SpeechServices/TextToSpeech/createSpeechSynthesisPonyfill.js.map +0 -1
- package/lib/SpeechServices/TextToSpeech/fetchCustomVoices.js +0 -110
- package/lib/SpeechServices/TextToSpeech/fetchCustomVoices.js.map +0 -1
- package/lib/SpeechServices/TextToSpeech/fetchSpeechData.js +0 -127
- package/lib/SpeechServices/TextToSpeech/fetchSpeechData.js.map +0 -1
- package/lib/SpeechServices/TextToSpeech/fetchVoices.js +0 -87
- package/lib/SpeechServices/TextToSpeech/fetchVoices.js.map +0 -1
- package/lib/SpeechServices/TextToSpeech/isSSML.js +0 -13
- package/lib/SpeechServices/TextToSpeech/isSSML.js.map +0 -1
- package/lib/SpeechServices/TextToSpeech/subscribeEvent.js +0 -14
- package/lib/SpeechServices/TextToSpeech/subscribeEvent.js.map +0 -1
- package/lib/SpeechServices/TextToSpeech.js +0 -14
- package/lib/SpeechServices/TextToSpeech.js.map +0 -1
- package/lib/SpeechServices/fetchAuthorizationToken.js +0 -58
- package/lib/SpeechServices/fetchAuthorizationToken.js.map +0 -1
- package/lib/SpeechServices/patchOptions.js +0 -213
- package/lib/SpeechServices/patchOptions.js.map +0 -1
- package/lib/SpeechServices/resolveFunctionOrReturnValue.js +0 -11
- package/lib/SpeechServices/resolveFunctionOrReturnValue.js.map +0 -1
- package/lib/SpeechServices.js +0 -73
- package/lib/SpeechServices.js.map +0 -1
- package/lib/Util/arrayToMap.js +0 -28
- package/lib/Util/arrayToMap.js.map +0 -1
- package/lib/Util/createPromiseQueue.js +0 -40
- package/lib/Util/createPromiseQueue.js.map +0 -1
- package/lib/index.js +0 -14
- package/lib/index.js.map +0 -1
- package/umd/web-speech-cognitive-services.development.js +0 -4740
- package/umd/web-speech-cognitive-services.production.min.js +0 -2
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
/*! For license information please see web-speech-cognitive-services.production.min.js.LICENSE.txt */
|
|
2
|
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.WebSpeechCognitiveServices=t():e.WebSpeechCognitiveServices=t()}(self,(function(){return function(){var e={583:function(e,t,r){"use strict";var n=r(8625),o=r(8942);Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"createSpeechRecognitionPonyfill",{enumerable:!0,get:function(){return s.default}}),Object.defineProperty(t,"createSpeechRecognitionPonyfillFromRecognizer",{enumerable:!0,get:function(){return s.createSpeechRecognitionPonyfillFromRecognizer}}),Object.defineProperty(t,"createSpeechSynthesisPonyfill",{enumerable:!0,get:function(){return a.default}}),t.default=function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];var o=l(l({},s.default.apply(void 0,[e].concat(r))),a.default.apply(void 0,[e].concat(r)));return l(l({},o),{},{then:function(e){console.warn("web-speech-cognitive-services: This function no longer need to be called in an asynchronous fashion. Please update your code. We will remove this Promise.then function on or after 2020-08-10."),e(o)}})},Object.defineProperty(t,"fetchAuthorizationToken",{enumerable:!0,get:function(){return c.default}});var i=n(r(5470)),s=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!==o(e)&&"function"!=typeof e)return{default:e};var r=u(t);if(r&&r.has(e))return r.get(e);var n={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in e)if("default"!==s&&Object.prototype.hasOwnProperty.call(e,s)){var a=i?Object.getOwnPropertyDescriptor(e,s):null;a&&(a.get||a.set)?Object.defineProperty(n,s,a):n[s]=e[s]}return n.default=e,r&&r.set(e,n),n}(r(6094)),a=n(r(2758)),c=n(r(3651));function u(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(u=function(e){return e?r:t})(e)}function p(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function l(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?p(Object(r),!0).forEach((function(t){(0,i.default)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):p(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var f=document.createElement("meta");f.setAttribute("name","web-speech-cognitive-services"),f.setAttribute("content","version=".concat("7.1.4-master.9e026d9")),document.head.appendChild(f)},4507:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=r(4287),o={AudioConfig:n.AudioConfig,OutputFormat:n.OutputFormat,ResultReason:n.ResultReason,SpeechConfig:n.SpeechConfig,SpeechRecognizer:n.SpeechRecognizer};t.default=o},6094:function(e,t,r){"use strict";var n=r(8942);Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"createSpeechRecognitionPonyfillFromRecognizer",{enumerable:!0,get:function(){return o.createSpeechRecognitionPonyfillFromRecognizer}}),t.default=void 0;var o=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!==n(e)&&"function"!=typeof e)return{default:e};var r=i(t);if(r&&r.has(e))return r.get(e);var o={},s=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var c=s?Object.getOwnPropertyDescriptor(e,a):null;c&&(c.get||c.set)?Object.defineProperty(o,a,c):o[a]=e[a]}return o.default=e,r&&r.set(e,o),o}(r(1347));function i(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(i=function(e){return e?r:t})(e)}var s=o.default;t.default=s},4682:function(e,t,r){"use strict";var n=r(8625);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(r(432)),i=n(r(4430)),s=function(){function e(){(0,o.default)(this,e),this._phrases=[]}return(0,i.default)(e,[{key:"addFromString",value:function(){throw new Error("JSGF is not supported")}},{key:"phrases",get:function(){return this._phrases},set:function(e){if(Array.isArray(e))this._phrases=e;else{if("string"!=typeof e)throw new Error("The provided value is not an array or of type 'string'");this._phrases=[e]}}}]),e}();t.default=s},2081:function(e,t,r){"use strict";var n=r(8625);Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.maxAlternatives,n=void 0===r?1/0:r,i=t.textNormalization,c=void 0===i?"display":i;if(e.reason===s||e.reason===a&&!e.json.NBest){var u=[{confidence:.5,transcript:e.text}];return e.reason===a&&(u.isFinal=!0),u}if(e.reason===a){var p=(0,o.default)((e.json.NBest||[]).slice(0,n).map((function(e){var t=e.Confidence,r=e.Display,n=e.ITN,o=e.Lexical,i=e.MaskedITN;return{confidence:t,transcript:"itn"===c?n:"lexical"===c?o:"maskeditn"===c?i:r}})),{isFinal:!0});return p}return[]};var o=n(r(8159)),i=n(r(4507)).default.ResultReason,s=i.RecognizingSpeech,a=i.RecognizedSpeech},1347:function(e,t,r){"use strict";var n=r(8625);Object.defineProperty(t,"__esModule",{value:!0}),t.createSpeechRecognitionPonyfillFromRecognizer=j,t.default=void 0;var o=n(r(347)),i=n(r(2427)),s=n(r(5470)),a=n(r(5663)),c=n(r(4430)),u=n(r(432)),p=n(r(9090)),l=n(r(3382)),f=n(r(6228)),h=r(9997),v=n(r(2081)),d=n(r(1113)),y=n(r(7301)),g=n(r(4682)),m=n(r(4507));function b(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function S(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?b(Object(r),!0).forEach((function(t){(0,s.default)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):b(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function P(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=(0,f.default)(e);if(t){var o=(0,f.default)(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return(0,l.default)(this,r)}}var C=m.default.AudioConfig,w=m.default.OutputFormat,O=m.default.ResultReason,R=m.default.SpeechConfig,I=m.default.SpeechRecognizer;function E(e){var t=e.duration,r=e.errorDetails,n=e.json,o=e.offset,i=e.properties,s=e.reason,a=e.resultId,c=e.text;return{duration:t,errorDetails:r,json:JSON.parse(n),offset:o,properties:i,reason:s,resultId:a,text:c}}function _(e){return function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return new Promise((function(t,n){return e.apply(void 0,r.concat([t,n]))}))}}var A=function(e){(0,p.default)(r,e);var t=P(r);function r(e){var n,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=o.data,s=o.emma,a=o.interpretation,c=o.resultIndex,p=o.results;return(0,u.default)(this,r),(n=t.call(this,e)).data=i,n.emma=s,n.interpretation=a,n.resultIndex=c,n.results=p,n}return(0,c.default)(r)}(h.Event);function T(e){var t,r,n=e.attach,i=e.attach.bind(e);return e.attach=(0,a.default)(o.default.mark((function n(){var s;return o.default.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,i();case 2:return s=n.sent,n.abrupt("return",S(S({},s),{},{read:function(){var n=(0,a.default)(o.default.mark((function n(){var i;return o.default.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,s.read();case 2:if(i=n.sent,!t&&(o=i.buffer,void 0,a=new Int16Array(o),[].reduce.call(a,(function(e,t){return e+Math.abs(t)}),0)/a.length>150)&&(e.events.onEvent({name:"FirstAudibleChunk"}),t=!0),!r){n.next=6;break}return n.abrupt("return",{buffer:new ArrayBuffer(0),isEnd:!0,timeReceived:Date.now()});case 6:return n.abrupt("return",i);case 7:case"end":return n.stop()}var o,a}),n)})));return function(){return n.apply(this,arguments)}}()}));case 4:case"end":return n.stop()}}),n)}))),{audioConfig:e,pause:function(){r=!0},unprepare:function(){e.attach=n}}}function j(e){var t=e.createRecognizer,r=e.enableTelemetry,n=e.looseEvents,s=e.referenceGrammars,l=e.textNormalization;I.enableTelemetry(!1!==r);var f=function(e){(0,p.default)(y,e);var r,f=P(y);function y(){var e;return(0,u.default)(this,y),(e=f.call(this))._continuous=!1,e._interimResults=!1,e._lang="undefined"!=typeof window?window.document.documentElement.getAttribute("lang")||window.navigator.language:"en-US",e._grammars=new g.default,e._maxAlternatives=1,e}return(0,c.default)(y,[{key:"emitCognitiveServices",value:function(e,t){this.dispatchEvent(new A("cognitiveservices",{data:S(S({},t),{},{type:e})}))}},{key:"continuous",get:function(){return this._continuous},set:function(e){this._continuous=e}},{key:"grammars",get:function(){return this._grammars},set:function(e){if(!(e instanceof g.default))throw new Error("The provided value is not of type 'SpeechGrammarList'");this._grammars=e}},{key:"interimResults",get:function(){return this._interimResults},set:function(e){this._interimResults=e}},{key:"maxAlternatives",get:function(){return this._maxAlternatives},set:function(e){this._maxAlternatives=e}},{key:"lang",get:function(){return this._lang},set:function(e){this._lang=e}},{key:"onaudioend",get:function(){return(0,h.getEventAttributeValue)(this,"audioend")},set:function(e){(0,h.setEventAttributeValue)(this,"audioend",e)}},{key:"onaudiostart",get:function(){return(0,h.getEventAttributeValue)(this,"audiostart")},set:function(e){(0,h.setEventAttributeValue)(this,"audiostart",e)}},{key:"oncognitiveservices",get:function(){return(0,h.getEventAttributeValue)(this,"cognitiveservices")},set:function(e){(0,h.setEventAttributeValue)(this,"cognitiveservices",e)}},{key:"onend",get:function(){return(0,h.getEventAttributeValue)(this,"end")},set:function(e){(0,h.setEventAttributeValue)(this,"end",e)}},{key:"onerror",get:function(){return(0,h.getEventAttributeValue)(this,"error")},set:function(e){(0,h.setEventAttributeValue)(this,"error",e)}},{key:"onresult",get:function(){return(0,h.getEventAttributeValue)(this,"result")},set:function(e){(0,h.setEventAttributeValue)(this,"result",e)}},{key:"onsoundend",get:function(){return(0,h.getEventAttributeValue)(this,"soundend")},set:function(e){(0,h.setEventAttributeValue)(this,"soundend",e)}},{key:"onsoundstart",get:function(){return(0,h.getEventAttributeValue)(this,"soundstart")},set:function(e){(0,h.setEventAttributeValue)(this,"soundstart",e)}},{key:"onspeechend",get:function(){return(0,h.getEventAttributeValue)(this,"speechend")},set:function(e){(0,h.setEventAttributeValue)(this,"speechend",e)}},{key:"onspeechstart",get:function(){return(0,h.getEventAttributeValue)(this,"speechstart")},set:function(e){(0,h.setEventAttributeValue)(this,"speechstart",e)}},{key:"onstart",get:function(){return(0,h.getEventAttributeValue)(this,"start")},set:function(e){(0,h.setEventAttributeValue)(this,"start",e)}},{key:"start",value:function(){var e=this;this._startOnce().catch((function(t){e.dispatchEvent(new ErrorEvent("error",{error:t,message:t&&(t.stack||t.message)}))}))}},{key:"_startOnce",value:(r=(0,a.default)(o.default.mark((function e(){var r,a,c,u,p,f,h,y,g,m,b,S,P,C,w,R,I,j=this;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t(this.lang);case 2:return r=e.sent,a=T(r.audioConfig),c=a.pause,u=a.unprepare,e.prev=4,p=(0,d.default)(),g=r.audioConfig.events.attach((function(e){var t=e.name;"AudioSourceReadyEvent"===t?p.push({audioSourceReady:{}}):"AudioSourceOffEvent"===t?p.push({audioSourceOff:{}}):"FirstAudibleChunk"===t&&p.push({firstAudibleChunk:{}})})),m=g.detach,r.canceled=function(e,t){var r=t.errorDetails,n=t.offset,o=t.reason,i=t.sessionId;p.push({canceled:{errorDetails:r,offset:n,reason:o,sessionId:i}})},r.recognized=function(e,t){var r=t.offset,n=t.result,o=t.sessionId;p.push({recognized:{offset:r,result:E(n),sessionId:o}})},r.recognizing=function(e,t){var r=t.offset,n=t.result,o=t.sessionId;p.push({recognizing:{offset:r,result:E(n),sessionId:o}})},r.sessionStarted=function(e,t){var r=t.sessionId;p.push({sessionStarted:{sessionId:r}})},r.sessionStopped=function(e,t){var r=t.sessionId;p.push({sessionStopped:{sessionId:r}})},r.speechStartDetected=function(e,t){var r=t.offset,n=t.sessionId;p.push({speechStartDetected:{offset:r,sessionId:n}})},r.speechEndDetected=function(e,t){var r=t.sessionId;p.push({speechEndDetected:{sessionId:r}})},b=this.grammars.phrases,S=r.privReco.dynamicGrammar,s&&s.length&&S.addReferenceGrammar(s),b&&b.length&&S.addPhrase(b),e.next=20,_(r.startContinuousRecognitionAsync.bind(r))();case 20:r.stopContinuousRecognitionAsync?(this.abort=function(){return p.push({abort:{}})},this.stop=function(){return p.push({stop:{}})}):this.abort=this.stop=void 0,w=[],R=o.default.mark((function e(t){var s,a,u,d,g,m,b,S,R,I,E,T;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,p.shift();case 2:if(s=e.sent,a=s.abort,u=s.audioSourceOff,d=s.audioSourceReady,g=s.canceled,m=s.firstAudibleChunk,b=s.recognized,S=s.recognizing,R=s.stop,Object.keys(s).forEach((function(e){return j.emitCognitiveServices(e,s[e])})),I=g&&g.errorDetails,!/Permission[\t-\r \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF]denied/.test(I||"")){e.next=9;break}return C={error:"not-allowed",type:"error"},e.abrupt("return","break");case 9:if(t||j.dispatchEvent(new A("start")),!I){e.next=15;break}return/1006/.test(I)?(P||(j.dispatchEvent(new A("audiostart")),j.dispatchEvent(new A("audioend"))),C={error:"network",type:"error"}):C={error:"unknown",type:"error"},e.abrupt("return","break");case 15:if(!a&&!R){e.next=22;break}if(a?(C={error:"aborted",type:"error"},y="abort"):(c(),y="stop"),!a||!r.stopContinuousRecognitionAsync){e.next=20;break}return e.next=20,_(r.stopContinuousRecognitionAsync.bind(r))();case 20:e.next=61;break;case 22:if(!d){e.next=27;break}j.dispatchEvent(new A("audiostart")),P=!0,e.next=61;break;case 27:if(!m){e.next=32;break}j.dispatchEvent(new A("soundstart")),f=!0,e.next=61;break;case 32:if(!u){e.next=40;break}return h&&j.dispatchEvent(new A("speechend")),f&&j.dispatchEvent(new A("soundend")),P&&j.dispatchEvent(new A("audioend")),P=f=h=!1,e.abrupt("return","break");case 40:if("abort"===y){e.next=61;break}if(!b||!b.result||b.result.reason!==O.NoMatch){e.next=45;break}C={error:"no-speech",type:"error"},e.next=61;break;case 45:if(!b&&!S){e.next=61;break}if(P||(j.dispatchEvent(new A("audiostart")),P=!0),f||(j.dispatchEvent(new A("soundstart")),f=!0),h||(j.dispatchEvent(new A("speechstart")),h=!0),!b){e.next=60;break}if(E=(0,v.default)(b.result,{maxAlternatives:j.maxAlternatives,textNormalization:l}),(T=!!E[0].transcript)&&(w=[].concat((0,i.default)(w),[E]),j.continuous&&j.dispatchEvent(new A("result",{results:w}))),C=j.continuous&&T?null:{results:w,type:"result"},j.continuous||!r.stopContinuousRecognitionAsync){e.next=57;break}return e.next=57,_(r.stopContinuousRecognitionAsync.bind(r))();case 57:n&&C&&T&&(j.dispatchEvent(new A(C.type,C)),C=null),e.next=61;break;case 60:S&&j.interimResults&&j.dispatchEvent(new A("result",{results:[].concat((0,i.default)(w),[(0,v.default)(S.result,{maxAlternatives:j.maxAlternatives,textNormalization:l})])}));case 61:case"end":return e.stop()}}),e)})),I=0;case 24:if(y&&!P){e.next=32;break}return e.delegateYield(R(I),"t0",26);case 26:if("break"!==e.t0){e.next=29;break}return e.abrupt("break",32);case 29:I++,e.next=24;break;case 32:h&&this.dispatchEvent(new A("speechend")),f&&this.dispatchEvent(new A("soundend")),P&&this.dispatchEvent(new A("audioend")),C&&("result"!==C.type||C.results.length||(C={error:"no-speech",type:"error"}),"error"===C.type?this.dispatchEvent(new ErrorEvent("error",C)):this.dispatchEvent(new A(C.type,C))),this.dispatchEvent(new A("end")),m(),e.next=44;break;case 40:throw e.prev=40,e.t1=e.catch(4),console.error(e.t1),e.t1;case 44:return e.prev=44,u(),r.dispose(),e.finish(44);case 48:case"end":return e.stop()}}),e,this,[[4,40,44,48]])}))),function(){return r.apply(this,arguments)})}]),y}(h.EventTarget);return{SpeechGrammarList:g.default,SpeechRecognition:f,SpeechRecognitionEvent:A}}t.default=function(e){var t=(0,y.default)(e),r=t.audioConfig,n=void 0===r?C.fromDefaultMicrophoneInput():r,i=t.enableTelemetry,s=void 0===i||i,c=t.fetchCredentials,u=t.looseEvents,p=t.referenceGrammars,l=t.speechRecognitionEndpointId,f=t.textNormalization,h=void 0===f?"display":f;if(!(n||window.navigator.mediaDevices&&window.navigator.mediaDevices.getUserMedia))return console.warn("web-speech-cognitive-services: This browser does not support WebRTC and it will not work with Cognitive Services Speech Services."),{};var v=function(){var e=(0,a.default)(o.default.mark((function e(t){var r,i,s,a,u,p,f;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,c();case 2:return r=e.sent,i=r.authorizationToken,s=r.region,a=r.speechRecognitionHostname,u=r.subscriptionKey,a?(f={hostname:a,port:443,protocol:"wss:"},i?(p=R.fromHost(f)).authorizationToken=i:p=R.fromHost(f,u)):p=i?R.fromAuthorizationToken(i,s):R.fromSubscription(u,s),l&&(p.endpointId=l),p.outputFormat=w.Detailed,p.speechRecognitionLanguage=t||"en-US",e.abrupt("return",new I(p,n));case 12:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();return j({audioConfig:n,createRecognizer:v,enableTelemetry:s,looseEvents:u,referenceGrammars:p,textNormalization:h})}},2758:function(e,t,r){"use strict";var n=r(8625);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(r(808)).default;t.default=o},7140:function(e,t,r){"use strict";var n=r(8625);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(r(347)),i=n(r(5663)),s=n(r(432)),a=n(r(4430)),c=function(){function e(t){(0,s.default)(this,e),this.audioContext=t}var t;return(0,a.default)(e,[{key:"pause",value:function(){this.audioContext&&this.audioContext.suspend(),this.playingUtterance&&this.playingUtterance.dispatchEvent(new CustomEvent("pause"))}},{key:"resume",value:function(){this.audioContext&&this.audioContext.resume(),this.playingUtterance&&this.playingUtterance.dispatchEvent(new CustomEvent("resume"))}},{key:"start",value:(t=(0,i.default)(o.default.mark((function e(t){var r;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(r=t.shift())){e.next=7;break}return this.playingUtterance=r,e.next=4,r.play(this.audioContext);case 4:this.playingUtterance=null,e.next=0;break;case 7:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})},{key:"stop",value:function(){this.playingUtterance&&this.playingUtterance.stop(),"suspended"===this.audioContext.state&&this.audioContext.resume()}}]),e}();t.default=c},3419:function(e,t,r){"use strict";var n=r(8625);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(r(347)),i=n(r(5663)),s=n(r(432)),a=n(r(4430)),c=n(r(5803)),u=n(r(7140)),p=function(){function e(t){var r=t.audioContext,n=t.ponyfill;(0,s.default)(this,e),this.consumer=null,this.paused=!1,this.queue=[],this.getAudioContext=(0,c.default)((function(){return r||new n.AudioContext}))}var t;return(0,a.default)(e,[{key:"pause",value:function(){this.paused=!0,this.consumer&&this.consumer.pause()}},{key:"push",value:function(e){this.queue.push(e),this.startConsumer()}},{key:"resume",value:function(){this.paused=!1,this.consumer?this.consumer.resume():this.startConsumer()}},{key:"speaking",get:function(){return!!this.consumer}},{key:"startConsumer",value:(t=(0,i.default)(o.default.mark((function e(){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.paused||!this.queue.length||this.consumer){e.next=7;break}return this.consumer=new u.default(this.getAudioContext()),e.next=4,this.consumer.start(this.queue);case 4:this.consumer=null,e.next=0;break;case 7:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"stop",value:function(){this.queue.splice(0),this.consumer&&this.consumer.stop()}}]),e}();t.default=p},3517:function(e,t,r){"use strict";var n=r(8625);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(r(4430)),i=n(r(432)),s=n(r(9090)),a=n(r(3382)),c=n(r(6228));var u=function(e){(0,s.default)(u,e);var t,r,n=(t=u,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,n=(0,c.default)(t);if(r){var o=(0,c.default)(this).constructor;e=Reflect.construct(n,arguments,o)}else e=n.apply(this,arguments);return(0,a.default)(this,e)});function u(e){return(0,i.default)(this,u),n.call(this,e)}return(0,o.default)(u)}(r(9997).Event);t.default=u},3831:function(e,t,r){"use strict";var n=r(8625);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(r(347)),i=n(r(5663)),s=n(r(432)),a=n(r(4430)),c=n(r(9090)),u=n(r(3382)),p=n(r(6228)),l=r(9997),f=n(r(4787)),h=n(r(1377)),v=n(r(3517)),d=n(r(4280));function y(e,t){return new Promise((function(r,n){var o=e.decodeAudioData(t,r,n);o&&"function"==typeof o.then&&r(o)}))}function g(e,t,r){return new Promise((function(n,o){var i=new f.default,s=new f.default,a=(0,d.default)(e,"statechange",(function(e){return"closed"===e.target.state&&i.eventListener()}));try{r.buffer=t,r.onended=s.eventListener,r.connect(e.destination),r.start(0),Promise.race([i.upcoming(),s.upcoming()]).then(n)}catch(e){o(e)}finally{a()}}))}var m=function(e){(0,c.default)(d,e);var t,r,n,f=(r=d,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=(0,p.default)(r);if(n){var o=(0,p.default)(this).constructor;e=Reflect.construct(t,arguments,o)}else e=t.apply(this,arguments);return(0,u.default)(this,e)});function d(e){var t;return(0,s.default)(this,d),(t=f.call(this))._lang=null,t._pitch=1,t._rate=1,t._voice=null,t._volume=1,t.text=e,t.onboundary=null,t.onend=null,t.onerror=null,t.onmark=null,t.onpause=null,t.onresume=null,t.onstart=null,t}return(0,a.default)(d,[{key:"lang",get:function(){return this._lang},set:function(e){this._lang=e}},{key:"onboundary",get:function(){return(0,l.getEventAttributeValue)(this,"boundary")},set:function(e){(0,l.setEventAttributeValue)(this,"boundary",e)}},{key:"onend",get:function(){return(0,l.getEventAttributeValue)(this,"end")},set:function(e){(0,l.setEventAttributeValue)(this,"end",e)}},{key:"onerror",get:function(){return(0,l.getEventAttributeValue)(this,"error")},set:function(e){(0,l.setEventAttributeValue)(this,"error",e)}},{key:"onmark",get:function(){return(0,l.getEventAttributeValue)(this,"mark")},set:function(e){(0,l.setEventAttributeValue)(this,"mark",e)}},{key:"onpause",get:function(){return(0,l.getEventAttributeValue)(this,"pause")},set:function(e){(0,l.setEventAttributeValue)(this,"pause",e)}},{key:"onresume",get:function(){return(0,l.getEventAttributeValue)(this,"resume")},set:function(e){(0,l.setEventAttributeValue)(this,"resume",e)}},{key:"onstart",get:function(){return(0,l.getEventAttributeValue)(this,"start")},set:function(e){(0,l.setEventAttributeValue)(this,"start",e)}},{key:"pitch",get:function(){return this._pitch},set:function(e){this._pitch=e}},{key:"rate",get:function(){return this._rate},set:function(e){this._rate=e}},{key:"voice",get:function(){return this._voice},set:function(e){this._voice=e}},{key:"volume",get:function(){return this._volume},set:function(e){this._volume=e}},{key:"preload",value:function(e){var t=e.deploymentId,r=e.fetchCredentials,n=e.outputFormat;this.arrayBufferPromise=(0,h.default)({fetchCredentials:r,deploymentId:t,lang:this.lang||window.navigator.language,outputFormat:n,pitch:this.pitch,rate:this.rate,text:this.text,voice:this.voice&&this.voice.voiceURI,volume:this.volume}),this.arrayBufferPromise.catch()}},{key:"play",value:(t=(0,i.default)(o.default.mark((function e(t){var r,n;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,this.dispatchEvent(new v.default("start")),r=t.createBufferSource(),e.t0=y,e.t1=t,e.next=7,this.arrayBufferPromise;case 7:return e.t2=e.sent,e.next=10,(0,e.t0)(e.t1,e.t2);case 10:return n=e.sent,this._playingSource=r,e.next=14,g(t,n,r);case 14:this._playingSource=null,this.dispatchEvent(new v.default("end")),e.next=21;break;case 18:e.prev=18,e.t3=e.catch(0),this.dispatchEvent(new ErrorEvent("error",{error:"synthesis-failed",message:e.t3.stack}));case 21:case"end":return e.stop()}}),e,this,[[0,18]])}))),function(e){return t.apply(this,arguments)})},{key:"stop",value:function(){this._playingSource&&this._playingSource.stop()}}]),d}(l.EventTarget),b=m;t.default=b},4532:function(e,t,r){"use strict";var n=r(8625);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(r(432)),i=n(r(4430)),s=function(){function e(t){var r=t.gender,n=t.lang,i=t.voiceURI;(0,o.default)(this,e),this._default=!1,this._gender=r,this._lang=n,this._localService=!1,this._name=i,this._voiceURI=i}return(0,i.default)(e,[{key:"default",get:function(){return this._default}},{key:"gender",get:function(){return this._gender}},{key:"lang",get:function(){return this._lang}},{key:"localService",get:function(){return this._localService}},{key:"name",get:function(){return this._name}},{key:"voiceURI",get:function(){return this._voiceURI}}]),e}();t.default=s},9419:function(e,t){"use strict";function r(e){var t=Math.round(100*(e-1));return t>=0&&(t="+"+t),t+"%"}Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t=e.lang,n=e.pitch,o=void 0===n?1:n,i=e.rate,s=void 0===i?1:i,a=e.text,c=e.voice,u=e.volume;return'<speak version="1.0" xml:lang="'.concat(t,'">\n <voice xml:lang="').concat(t,'" name="').concat(c,'">\n <prosody pitch="').concat(r(o),'" rate="').concat(r(s),'" volume="').concat(r(u),'">\n ').concat(a,"\n </prosody>\n </voice>\n</speak>")}},808:function(e,t,r){"use strict";var n=r(8625);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(r(347)),i=n(r(5663)),s=n(r(432)),a=n(r(4430)),c=n(r(9090)),u=n(r(3382)),p=n(r(6228)),l=r(9997),f=n(r(8892)),h=n(r(567)),v=n(r(3419)),d=n(r(6589)),y=n(r(2633)),g=n(r(7301)),m=n(r(3517)),b=n(r(3831));var S=[];t.default=function(e){var t=(0,g.default)(e),r=t.audioContext,n=t.fetchCredentials,P=t.ponyfill,C=void 0===P?{AudioContext:window.AudioContext||window.webkitAudioContext}:P,w=t.speechSynthesisDeploymentId,O=t.speechSynthesisOutputFormat,R=void 0===O?"audio-24khz-160kbitrate-mono-mp3":O;if(!r&&!C.AudioContext)return console.warn("web-speech-cognitive-services: This browser does not support Web Audio and it will not work with Cognitive Services Speech Services."),{};var I=function(e){(0,c.default)(I,e);var t,g,P,O=(g=I,P=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=(0,p.default)(g);if(P){var r=(0,p.default)(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return(0,u.default)(this,e)});function I(){var e;return(0,s.default)(this,I),(e=O.call(this)).queue=new v.default({audioContext:r,ponyfill:C}),e.updateVoices(),e}return(0,a.default)(I,[{key:"cancel",value:function(){this.queue.stop()}},{key:"getVoices",value:function(){return S}},{key:"onvoiceschanged",get:function(){return(0,l.getEventAttributeValue)(this,"voiceschanged")},set:function(e){(0,l.setEventAttributeValue)(this,"voiceschanged",e)}},{key:"pause",value:function(){this.queue.pause()}},{key:"resume",value:function(){this.queue.resume()}},{key:"speak",value:function(e){if(!(e instanceof b.default))throw new Error("invalid utterance");var t=(0,f.default)(),r=t.reject,o=t.resolve,i=t.promise,s=function(e){var t=e.error,n=e.message,o=new Error(t);o.stack=n,r(o)};return e.addEventListener("end",o),e.addEventListener("error",s),e.preload({deploymentId:w,fetchCredentials:n,outputFormat:R}),this.queue.push(e),i.finally((function(){e.removeEventListener("end",o),e.removeEventListener("error",s)}))}},{key:"speaking",get:function(){return this.queue.speaking}},{key:"updateVoices",value:(t=(0,i.default)(o.default.mark((function e(){var t,r,s,a,c,u=this;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,n();case 2:if(t=e.sent,r=t.customVoiceHostname,s=t.region,a=t.speechSynthesisHostname,c=t.subscriptionKey,!w){e.next=14;break}if(!c){e.next=12;break}return console.warn("web-speech-cognitive-services: Listing of custom voice models are only available when using subscription key."),e.next=12,(0,h.default)((0,i.default)(o.default.mark((function e(){var t;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,d.default)({customVoiceHostname:r,deploymentId:w,region:s,speechSynthesisHostname:a,subscriptionKey:c});case 2:t=e.sent,u.getVoices=function(){return t};case 4:case"end":return e.stop()}}),e)}))));case 12:e.next=16;break;case 14:return e.next=16,(0,h.default)((0,i.default)(o.default.mark((function e(){var t;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.t0=y.default,e.next=3,n();case 3:return e.t1=e.sent,e.next=6,(0,e.t0)(e.t1);case 6:t=e.sent,u.getVoices=function(){return t};case 8:case"end":return e.stop()}}),e)}))));case 16:this.dispatchEvent(new m.default("voiceschanged"));case 17:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})}]),I}(l.EventTarget);return{speechSynthesis:new I,SpeechSynthesisEvent:m.default,SpeechSynthesisUtterance:b.default}}},6589:function(e,t,r){"use strict";var n=r(8625);Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return u.apply(this,arguments)};var o=n(r(347)),i=n(r(5663)),s=n(r(4532));function a(e){return c.apply(this,arguments)}function c(){return(c=(0,i.default)(o.default.mark((function e(t){var r,n,i,s,a,c;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.customVoiceHostname,n=t.deploymentId,i=t.region,s=t.subscriptionKey,a=r||"".concat(i,".customvoice.api.speech.microsoft.com"),e.next=4,fetch("https://".concat(encodeURI(a),"/api/texttospeech/v2.0/endpoints/").concat(encodeURIComponent(n)),{headers:{accept:"application/json","ocp-apim-subscription-key":s}});case 4:if((c=e.sent).ok){e.next=7;break}throw new Error("Failed to fetch custom voices");case 7:return e.abrupt("return",c.json());case 8:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function u(){return(u=(0,i.default)(o.default.mark((function e(t){var r,n,i,c,u,p;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.customVoiceHostname,n=t.deploymentId,i=t.region,c=t.subscriptionKey,e.next=3,a({customVoiceHostname:r,deploymentId:n,region:i,subscriptionKey:c});case 3:return u=e.sent,p=u.models,e.abrupt("return",p.map((function(e){var t=e.properties.Gender,r=e.locale,n=e.name;return new s.default({gender:t,lang:r,voiceURI:n})})).sort((function(e,t){var r=e.name,n=t.name;return r>n?1:r<n?-1:0})));case 6:case"end":return e.stop()}}),e)})))).apply(this,arguments)}},1377:function(e,t,r){"use strict";var n=r(8625);Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return y.apply(this,arguments)};var o=n(r(347)),i=n(r(5470)),s=n(r(5663)),a=r(9704),c=n(r(9419)),u=n(r(2993));function p(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function l(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?p(Object(r),!0).forEach((function(t){(0,i.default)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):p(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var f="en-US",h="riff-16khz-16bit-mono-pcm",v="Microsoft Server Speech Text to Speech Voice (en-US, AriaNeural)",d="SUQzBAAAAAAAI1RTU0UAAAAPAAADTGF2ZjU3LjU2LjEwMQAAAAAAAAAAAAAA//tAwAAAAAAAAAAAAAAAAAAAAAAASW5mbwAAAA8AAAACAAABhgC7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7//////////////////////////////////////////////////////////////////8AAAAATGF2YzU3LjY0AAAAAAAAAAAAAAAAJAUHAAAAAAAAAYYoRBqpAAAAAAD/+xDEAAPAAAGkAAAAIAAANIAAAARMQU1FMy45OS41VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVf/7EMQpg8AAAaQAAAAgAAA0gAAABFVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV";function y(){return(y=(0,s.default)(o.default.mark((function e(t){var r,n,i,s,p,y,g,m,b,S,P,C,w,O,R,I,E,_,A,T,j,x;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.deploymentId,n=t.fetchCredentials,i=t.lang,s=void 0===i?f:i,p=t.outputFormat,y=void 0===p?h:p,g=t.pitch,m=t.rate,b=t.text,S=t.voice,P=void 0===S?v:S,C=t.volume,b){e.next=3;break}return e.abrupt("return",(0,a.decode)(d));case 3:return e.next=5,n();case 5:if(w=e.sent,O=w.authorizationToken,R=w.region,I=w.speechSynthesisHostname,E=w.subscriptionKey,!(O&&E||!O&&!E)){e.next=14;break}throw new Error('Only "authorizationToken" or "subscriptionKey" should be set.');case 14:if(!(R&&I||!R&&!I)){e.next=16;break}throw new Error('Only "region" or "speechSynthesisHostnamename" should be set.');case 16:return _=(0,u.default)(b)?b:(0,c.default)({lang:s,pitch:g,rate:m,text:b,voice:P,volume:C}),A=I||"".concat(encodeURI(R),r?".voice.speech.microsoft.com":".tts.speech.microsoft.com"),T=r?"?deploymentId=".concat(encodeURI(r)):"",j="https://".concat(A,"/cognitiveservices/v1").concat(T),e.next=22,fetch(j,{headers:l({"Content-Type":"application/ssml+xml","X-Microsoft-OutputFormat":y},O?{Authorization:"Bearer ".concat(O)}:{"Ocp-Apim-Subscription-Key":E}),method:"POST",body:_});case 22:if((x=e.sent).ok){e.next=25;break}throw new Error("web-speech-cognitive-services: Failed to syntheis speech, server returned ".concat(x.status));case 25:return e.abrupt("return",x.arrayBuffer());case 26:case"end":return e.stop()}}),e)})))).apply(this,arguments)}},2633:function(e,t,r){"use strict";var n=r(8625);Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return p.apply(this,arguments)};var o=n(r(347)),i=n(r(5470)),s=n(r(5663)),a=n(r(4532));function c(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function u(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?c(Object(r),!0).forEach((function(t){(0,i.default)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):c(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function p(){return(p=(0,s.default)(o.default.mark((function e(t){var r,n,i,s,c,p,l;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.authorizationToken,n=t.region,i=t.speechSynthesisHostname,s=t.subscriptionKey,c=i||"".concat(encodeURI(n),".tts.speech.microsoft.com"),e.next=4,fetch("https://".concat(c,"/cognitiveservices/voices/list"),{headers:u({"content-type":"application/json"},r?{authorization:"Bearer ".concat(r)}:{"Ocp-Apim-Subscription-Key":s})});case 4:if((p=e.sent).ok){e.next=7;break}throw new Error("Failed to fetch voices");case 7:return e.next=9,p.json();case 9:return l=e.sent,e.abrupt("return",l.map((function(e){var t=e.Gender,r=e.Locale,n=e.Name;return new a.default({gender:t,lang:r,voiceURI:n})})).sort((function(e,t){var r=e.name,n=t.name;return r>n?1:r<n?-1:0})));case 11:case"end":return e.stop()}}),e)})))).apply(this,arguments)}},2993:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return r.test(e)||n.test(e)};var r=/^[\t-\r \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF]*<speak([\t-\r \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF]|\/?>)/,n=/^[\t-\r \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF]*<\?xml[\t-\r \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF]/},4280:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,r){return e.addEventListener(t,r),function(){return e.removeEventListener(t,r)}}},3651:function(e,t,r){"use strict";var n=r(8625);Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return a.apply(this,arguments)};var o=n(r(347)),i=n(r(5663)),s="https://{region}.api.cognitive.microsoft.com/sts/v1.0/issueToken";function a(){return(a=(0,i.default)(o.default.mark((function e(t){var r,n,i;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.region,n=t.subscriptionKey,e.next=3,fetch(s.replace(/\{region\}/,r),{headers:{"Ocp-Apim-Subscription-Key":n},method:"POST"});case 3:if((i=e.sent).ok){e.next=6;break}throw new Error("Failed to fetch authorization token, server returned ".concat(i.status));case 6:return e.abrupt("return",i.text());case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)}},7301:function(e,t,r){"use strict";var n=r(8625);Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=t.authorizationToken,n=t.credentials,i=t.looseEvent,p=t.looseEvents,h=t.region,v=void 0===h?"westus":h,d=t.subscriptionKey,y=(0,a.default)(t,u);if(void 0!==i&&(console.warn('web-speech-cognitive-services: The option "looseEvent" should be named as "looseEvents".'),p=i),!n){if(!r&&!d)throw new Error("web-speech-cognitive-services: Credentials must be specified.");console.warn("web-speech-cognitive-services: We are deprecating authorizationToken, region, and subscriptionKey. Please use credentials instead. The deprecated option will be removed on or after 2020-11-14."),n=function(){var e=(0,s.default)(o.default.mark((function e(){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!r){e.next=8;break}return e.next=3,(0,c.default)(r);case 3:e.t1=e.sent,e.t2=v,e.t0={authorizationToken:e.t1,region:e.t2},e.next=13;break;case 8:return e.t3=v,e.next=11,(0,c.default)(d);case 11:e.t4=e.sent,e.t0={region:e.t3,subscriptionKey:e.t4};case 13:return e.abrupt("return",e.t0);case 14:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}()}return l(l({},y),{},{fetchCredentials:(e=(0,s.default)(o.default.mark((function e(){var t,r,i,s,a,u,p,l;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,c.default)(n);case 2:if(t=e.sent,r=t.authorizationToken,i=t.customVoiceHostname,s=t.region,a=t.speechRecognitionHostname,u=t.speechSynthesisHostname,p=t.subscriptionKey,!(!r&&!p||r&&p)){e.next=13;break}throw new Error('web-speech-cognitive-services: Either "authorizationToken" or "subscriptionKey" must be provided.');case 13:if(s||a&&u){e.next=17;break}throw new Error('web-speech-cognitive-services: Either "region" or "speechRecognitionHostname" and "speechSynthesisHostname" must be set.');case 17:if(!s||!(i||a||u)){e.next=21;break}throw new Error('web-speech-cognitive-services: Only either "region" or "customVoiceHostname", "speechRecognitionHostname" and "speechSynthesisHostname" can be set.');case 21:if(!r){e.next=26;break}if("string"==typeof r){e.next=24;break}throw new Error('web-speech-cognitive-services: "authorizationToken" must be a string.');case 24:e.next=28;break;case 26:if("string"==typeof p){e.next=28;break}throw new Error('web-speech-cognitive-services: "subscriptionKey" must be a string.');case 28:return f&&p&&(console.warn("web-speech-cognitive-services: In production environment, subscription key should not be used, authorization token should be used instead."),f=!1),l=r?{authorizationToken:r}:{subscriptionKey:p},s?l.region=s:(l.customVoiceHostname=i,l.speechRecognitionHostname=a,l.speechSynthesisHostname=u),e.abrupt("return",l);case 32:case"end":return e.stop()}}),e)}))),function(){return e.apply(this,arguments)}),looseEvents:p})};var o=n(r(347)),i=n(r(5470)),s=n(r(5663)),a=n(r(7817)),c=n(r(2284)),u=["authorizationToken","credentials","looseEvent","looseEvents","region","subscriptionKey"];function p(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function l(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?p(Object(r),!0).forEach((function(t){(0,i.default)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):p(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var f=!0},2284:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return"function"==typeof e?e():e}},8159:function(e,t,r){"use strict";var n=r(8625);Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){var r=s(s(s({},[].reduce.call(e,(function(e,t,r){return e[r]=t,e}),{})),t),{},(0,o.default)({length:e.length},Symbol.iterator,(function(){return[].slice.call(r)[Symbol.iterator]()})));return r};var o=n(r(5470));function i(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function s(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?i(Object(r),!0).forEach((function(t){(0,o.default)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):i(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}},1113:function(e,t,r){"use strict";var n=r(8625);Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){var e,t=[];return{push:function(r){if(e){var n=e.resolve;e=null,n(r)}else t.push(r)},shift:function(){return t.length?Promise.resolve(t.shift()):(e||(e=(0,o.default)())).promise}}};var o=n(r(8892))},9704:function(e,t,r){"use strict";r.r(t),r.d(t,{decode:function(){return a},encode:function(){return s}});for(var n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o="undefined"==typeof Uint8Array?[]:new Uint8Array(256),i=0;i<n.length;i++)o[n.charCodeAt(i)]=i;var s=function(e){var t,r=new Uint8Array(e),o=r.length,i="";for(t=0;t<o;t+=3)i+=n[r[t]>>2],i+=n[(3&r[t])<<4|r[t+1]>>4],i+=n[(15&r[t+1])<<2|r[t+2]>>6],i+=n[63&r[t+2]];return o%3==2?i=i.substring(0,i.length-1)+"=":o%3==1&&(i=i.substring(0,i.length-2)+"=="),i},a=function(e){var t,r,n,i,s,a=.75*e.length,c=e.length,u=0;"="===e[e.length-1]&&(a--,"="===e[e.length-2]&&a--);var p=new ArrayBuffer(a),l=new Uint8Array(p);for(t=0;t<c;t+=4)r=o[e.charCodeAt(t)],n=o[e.charCodeAt(t+1)],i=o[e.charCodeAt(t+2)],s=o[e.charCodeAt(t+3)],l[u++]=r<<2|n>>4,l[u++]=(15&n)<<4|i>>2,l[u++]=(3&i)<<6|63&s;return p}},3248:function(e,t,r){r(7202),r(5192),r(6562),r(648),r(6777),r(6429),r(5305),r(675);var n=r(8080);e.exports=n.Promise},497:function(e,t,r){var n=r(6288),o=r(5377),i=TypeError;e.exports=function(e){if(n(e))return e;throw i(o(e)+" is not a function")}},8921:function(e,t,r){var n=r(1863),o=r(5377),i=TypeError;e.exports=function(e){if(n(e))return e;throw i(o(e)+" is not a constructor")}},3658:function(e,t,r){var n=r(6288),o=String,i=TypeError;e.exports=function(e){if("object"==typeof e||n(e))return e;throw i("Can't set "+o(e)+" as a prototype")}},8556:function(e){e.exports=function(){}},8856:function(e,t,r){var n=r(2802),o=TypeError;e.exports=function(e,t){if(n(t,e))return e;throw o("Incorrect invocation")}},9519:function(e,t,r){var n=r(3570),o=String,i=TypeError;e.exports=function(e){if(n(e))return e;throw i(o(e)+" is not an object")}},4207:function(e,t,r){var n=r(2973),o=r(7005),i=r(9952),s=function(e){return function(t,r,s){var a,c=n(t),u=i(c),p=o(s,u);if(e&&r!=r){for(;u>p;)if((a=c[p++])!=a)return!0}else for(;u>p;p++)if((e||p in c)&&c[p]===r)return e||p||0;return!e&&-1}};e.exports={includes:s(!0),indexOf:s(!1)}},967:function(e,t,r){var n=r(5088);e.exports=n([].slice)},8255:function(e,t,r){var n=r(6761)("iterator"),o=!1;try{var i=0,s={next:function(){return{done:!!i++}},return:function(){o=!0}};s[n]=function(){return this},Array.from(s,(function(){throw 2}))}catch(e){}e.exports=function(e,t){if(!t&&!o)return!1;var r=!1;try{var i={};i[n]=function(){return{next:function(){return{done:r=!0}}}},e(i)}catch(e){}return r}},7655:function(e,t,r){var n=r(5088),o=n({}.toString),i=n("".slice);e.exports=function(e){return i(o(e),8,-1)}},7322:function(e,t,r){var n=r(6141),o=r(6288),i=r(7655),s=r(6761)("toStringTag"),a=Object,c="Arguments"==i(function(){return arguments}());e.exports=n?i:function(e){var t,r,n;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(r=function(e,t){try{return e[t]}catch(e){}}(t=a(e),s))?r:c?i(t):"Object"==(n=i(t))&&o(t.callee)?"Arguments":n}},1603:function(e,t,r){var n=r(5370),o=r(6658),i=r(5602),s=r(585);e.exports=function(e,t,r){for(var a=o(t),c=s.f,u=i.f,p=0;p<a.length;p++){var l=a[p];n(e,l)||r&&n(r,l)||c(e,l,u(t,l))}}},4557:function(e,t,r){var n=r(5152);e.exports=!n((function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}))},5207:function(e){e.exports=function(e,t){return{value:e,done:t}}},3989:function(e,t,r){var n=r(4526),o=r(585),i=r(4004);e.exports=n?function(e,t,r){return o.f(e,t,i(1,r))}:function(e,t,r){return e[t]=r,e}},4004:function(e){e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},4588:function(e,t,r){var n=r(3989);e.exports=function(e,t,r,o){return o&&o.enumerable?e[t]=r:n(e,t,r),e}},7899:function(e,t,r){var n=r(6411),o=Object.defineProperty;e.exports=function(e,t){try{o(n,e,{value:t,configurable:!0,writable:!0})}catch(r){n[e]=t}return t}},4526:function(e,t,r){var n=r(5152);e.exports=!n((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]}))},6352:function(e){var t="object"==typeof document&&document.all,r=void 0===t&&void 0!==t;e.exports={all:t,IS_HTMLDDA:r}},4358:function(e,t,r){var n=r(6411),o=r(3570),i=n.document,s=o(i)&&o(i.createElement);e.exports=function(e){return s?i.createElement(e):{}}},9671:function(e){e.exports={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}},5365:function(e,t,r){var n=r(8706),o=r(488);e.exports=!n&&!o&&"object"==typeof window&&"object"==typeof document},8706:function(e){e.exports="object"==typeof Deno&&Deno&&"object"==typeof Deno.version},704:function(e,t,r){var n=r(5509),o=r(6411);e.exports=/ipad|iphone|ipod/i.test(n)&&void 0!==o.Pebble},2499:function(e,t,r){var n=r(5509);e.exports=/(?:ipad|iphone|ipod).*applewebkit/i.test(n)},488:function(e,t,r){var n=r(7655),o=r(6411);e.exports="process"==n(o.process)},3034:function(e,t,r){var n=r(5509);e.exports=/web0s(?!.*chrome)/i.test(n)},5509:function(e,t,r){var n=r(4405);e.exports=n("navigator","userAgent")||""},6540:function(e,t,r){var n,o,i=r(6411),s=r(5509),a=i.process,c=i.Deno,u=a&&a.versions||c&&c.version,p=u&&u.v8;p&&(o=(n=p.split("."))[0]>0&&n[0]<4?1:+(n[0]+n[1])),!o&&s&&(!(n=s.match(/Edge\/(\d+)/))||n[1]>=74)&&(n=s.match(/Chrome\/(\d+)/))&&(o=+n[1]),e.exports=o},8795:function(e){e.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},9978:function(e,t,r){var n=r(5088),o=Error,i=n("".replace),s=String(o("zxcasd").stack),a=/\n\s*at [^:]*:[^\n]*/,c=a.test(s);e.exports=function(e,t){if(c&&"string"==typeof e&&!o.prepareStackTrace)for(;t--;)e=i(e,a,"");return e}},4845:function(e,t,r){var n=r(5152),o=r(4004);e.exports=!n((function(){var e=Error("a");return!("stack"in e)||(Object.defineProperty(e,"stack",o(1,7)),7!==e.stack)}))},7275:function(e,t,r){"use strict";var n=r(6411),o=r(5361),i=r(5088),s=r(6288),a=r(5602).f,c=r(4899),u=r(8080),p=r(3193),l=r(3989),f=r(5370),h=function(e){var t=function(r,n,i){if(this instanceof t){switch(arguments.length){case 0:return new e;case 1:return new e(r);case 2:return new e(r,n)}return new e(r,n,i)}return o(e,this,arguments)};return t.prototype=e.prototype,t};e.exports=function(e,t){var r,o,v,d,y,g,m,b,S=e.target,P=e.global,C=e.stat,w=e.proto,O=P?n:C?n[S]:(n[S]||{}).prototype,R=P?u:u[S]||l(u,S,{})[S],I=R.prototype;for(v in t)r=!c(P?v:S+(C?".":"#")+v,e.forced)&&O&&f(O,v),y=R[v],r&&(g=e.dontCallGetSet?(b=a(O,v))&&b.value:O[v]),d=r&&g?g:t[v],r&&typeof y==typeof d||(m=e.bind&&r?p(d,n):e.wrap&&r?h(d):w&&s(d)?i(d):d,(e.sham||d&&d.sham||y&&y.sham)&&l(m,"sham",!0),l(R,v,m),w&&(f(u,o=S+"Prototype")||l(u,o,{}),l(u[o],v,d),e.real&&I&&!I[v]&&l(I,v,d)))}},5152:function(e){e.exports=function(e){try{return!!e()}catch(e){return!0}}},5361:function(e,t,r){var n=r(9253),o=Function.prototype,i=o.apply,s=o.call;e.exports="object"==typeof Reflect&&Reflect.apply||(n?s.bind(i):function(){return s.apply(i,arguments)})},3193:function(e,t,r){var n=r(5088),o=r(497),i=r(9253),s=n(n.bind);e.exports=function(e,t){return o(e),void 0===t?e:i?s(e,t):function(){return e.apply(t,arguments)}}},9253:function(e,t,r){var n=r(5152);e.exports=!n((function(){var e=function(){}.bind();return"function"!=typeof e||e.hasOwnProperty("prototype")}))},4300:function(e,t,r){var n=r(9253),o=Function.prototype.call;e.exports=n?o.bind(o):function(){return o.apply(o,arguments)}},4018:function(e,t,r){var n=r(4526),o=r(5370),i=Function.prototype,s=n&&Object.getOwnPropertyDescriptor,a=o(i,"name"),c=a&&"something"===function(){}.name,u=a&&(!n||n&&s(i,"name").configurable);e.exports={EXISTS:a,PROPER:c,CONFIGURABLE:u}},5088:function(e,t,r){var n=r(9253),o=Function.prototype,i=o.bind,s=o.call,a=n&&i.bind(s,s);e.exports=n?function(e){return e&&a(e)}:function(e){return e&&function(){return s.apply(e,arguments)}}},4405:function(e,t,r){var n=r(8080),o=r(6411),i=r(6288),s=function(e){return i(e)?e:void 0};e.exports=function(e,t){return arguments.length<2?s(n[e])||s(o[e]):n[e]&&n[e][t]||o[e]&&o[e][t]}},170:function(e,t,r){var n=r(7322),o=r(65),i=r(4974),s=r(5993),a=r(6761)("iterator");e.exports=function(e){if(!i(e))return o(e,a)||o(e,"@@iterator")||s[n(e)]}},509:function(e,t,r){var n=r(4300),o=r(497),i=r(9519),s=r(5377),a=r(170),c=TypeError;e.exports=function(e,t){var r=arguments.length<2?a(e):t;if(o(r))return i(n(r,e));throw c(s(e)+" is not iterable")}},65:function(e,t,r){var n=r(497),o=r(4974);e.exports=function(e,t){var r=e[t];return o(r)?void 0:n(r)}},6411:function(e,t,r){var n=function(e){return e&&e.Math==Math&&e};e.exports=n("object"==typeof globalThis&&globalThis)||n("object"==typeof window&&window)||n("object"==typeof self&&self)||n("object"==typeof r.g&&r.g)||function(){return this}()||Function("return this")()},5370:function(e,t,r){var n=r(5088),o=r(7131),i=n({}.hasOwnProperty);e.exports=Object.hasOwn||function(e,t){return i(o(e),t)}},3363:function(e){e.exports={}},1558:function(e,t,r){var n=r(6411);e.exports=function(e,t){var r=n.console;r&&r.error&&(1==arguments.length?r.error(e):r.error(e,t))}},9876:function(e,t,r){var n=r(4405);e.exports=n("document","documentElement")},3991:function(e,t,r){var n=r(4526),o=r(5152),i=r(4358);e.exports=!n&&!o((function(){return 7!=Object.defineProperty(i("div"),"a",{get:function(){return 7}}).a}))},1088:function(e,t,r){var n=r(5088),o=r(5152),i=r(7655),s=Object,a=n("".split);e.exports=o((function(){return!s("z").propertyIsEnumerable(0)}))?function(e){return"String"==i(e)?a(e,""):s(e)}:s},3913:function(e,t,r){var n=r(5088),o=r(6288),i=r(5119),s=n(Function.toString);o(i.inspectSource)||(i.inspectSource=function(e){return s(e)}),e.exports=i.inspectSource},5605:function(e,t,r){var n=r(3570),o=r(3989);e.exports=function(e,t){n(t)&&"cause"in t&&o(e,"cause",t.cause)}},4983:function(e,t,r){var n,o,i,s=r(7506),a=r(6411),c=r(5088),u=r(3570),p=r(3989),l=r(5370),f=r(5119),h=r(9575),v=r(3363),d="Object already initialized",y=a.TypeError,g=a.WeakMap;if(s||f.state){var m=f.state||(f.state=new g),b=c(m.get),S=c(m.has),P=c(m.set);n=function(e,t){if(S(m,e))throw y(d);return t.facade=e,P(m,e,t),t},o=function(e){return b(m,e)||{}},i=function(e){return S(m,e)}}else{var C=h("state");v[C]=!0,n=function(e,t){if(l(e,C))throw y(d);return t.facade=e,p(e,C,t),t},o=function(e){return l(e,C)?e[C]:{}},i=function(e){return l(e,C)}}e.exports={set:n,get:o,has:i,enforce:function(e){return i(e)?o(e):n(e,{})},getterFor:function(e){return function(t){var r;if(!u(t)||(r=o(t)).type!==e)throw y("Incompatible receiver, "+e+" required");return r}}}},8695:function(e,t,r){var n=r(6761),o=r(5993),i=n("iterator"),s=Array.prototype;e.exports=function(e){return void 0!==e&&(o.Array===e||s[i]===e)}},6288:function(e,t,r){var n=r(6352),o=n.all;e.exports=n.IS_HTMLDDA?function(e){return"function"==typeof e||e===o}:function(e){return"function"==typeof e}},1863:function(e,t,r){var n=r(5088),o=r(5152),i=r(6288),s=r(7322),a=r(4405),c=r(3913),u=function(){},p=[],l=a("Reflect","construct"),f=/^\s*(?:class|function)\b/,h=n(f.exec),v=!f.exec(u),d=function(e){if(!i(e))return!1;try{return l(u,p,e),!0}catch(e){return!1}},y=function(e){if(!i(e))return!1;switch(s(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return v||!!h(f,c(e))}catch(e){return!0}};y.sham=!0,e.exports=!l||o((function(){var e;return d(d.call)||!d(Object)||!d((function(){e=!0}))||e}))?y:d},4899:function(e,t,r){var n=r(5152),o=r(6288),i=/#|\.prototype\./,s=function(e,t){var r=c[a(e)];return r==p||r!=u&&(o(t)?n(t):!!t)},a=s.normalize=function(e){return String(e).replace(i,".").toLowerCase()},c=s.data={},u=s.NATIVE="N",p=s.POLYFILL="P";e.exports=s},4974:function(e){e.exports=function(e){return null==e}},3570:function(e,t,r){var n=r(6288),o=r(6352),i=o.all;e.exports=o.IS_HTMLDDA?function(e){return"object"==typeof e?null!==e:n(e)||e===i}:function(e){return"object"==typeof e?null!==e:n(e)}},2258:function(e){e.exports=!0},257:function(e,t,r){var n=r(4405),o=r(6288),i=r(2802),s=r(669),a=Object;e.exports=s?function(e){return"symbol"==typeof e}:function(e){var t=n("Symbol");return o(t)&&i(t.prototype,a(e))}},3476:function(e,t,r){var n=r(3193),o=r(4300),i=r(9519),s=r(5377),a=r(8695),c=r(9952),u=r(2802),p=r(509),l=r(170),f=r(9230),h=TypeError,v=function(e,t){this.stopped=e,this.result=t},d=v.prototype;e.exports=function(e,t,r){var y,g,m,b,S,P,C,w=r&&r.that,O=!(!r||!r.AS_ENTRIES),R=!(!r||!r.IS_RECORD),I=!(!r||!r.IS_ITERATOR),E=!(!r||!r.INTERRUPTED),_=n(t,w),A=function(e){return y&&f(y,"normal",e),new v(!0,e)},T=function(e){return O?(i(e),E?_(e[0],e[1],A):_(e[0],e[1])):E?_(e,A):_(e)};if(R)y=e.iterator;else if(I)y=e;else{if(!(g=l(e)))throw h(s(e)+" is not iterable");if(a(g)){for(m=0,b=c(e);b>m;m++)if((S=T(e[m]))&&u(d,S))return S;return new v(!1)}y=p(e,g)}for(P=R?e.next:y.next;!(C=o(P,y)).done;){try{S=T(C.value)}catch(e){f(y,"throw",e)}if("object"==typeof S&&S&&u(d,S))return S}return new v(!1)}},9230:function(e,t,r){var n=r(4300),o=r(9519),i=r(65);e.exports=function(e,t,r){var s,a;o(e);try{if(!(s=i(e,"return"))){if("throw"===t)throw r;return r}s=n(s,e)}catch(e){a=!0,s=e}if("throw"===t)throw r;if(a)throw s;return o(s),r}},9825:function(e,t,r){"use strict";var n=r(5414).IteratorPrototype,o=r(9027),i=r(4004),s=r(8442),a=r(5993),c=function(){return this};e.exports=function(e,t,r,u){var p=t+" Iterator";return e.prototype=o(n,{next:i(+!u,r)}),s(e,p,!1,!0),a[p]=c,e}},1378:function(e,t,r){"use strict";var n=r(7275),o=r(4300),i=r(2258),s=r(4018),a=r(6288),c=r(9825),u=r(1455),p=r(6608),l=r(8442),f=r(3989),h=r(4588),v=r(6761),d=r(5993),y=r(5414),g=s.PROPER,m=s.CONFIGURABLE,b=y.IteratorPrototype,S=y.BUGGY_SAFARI_ITERATORS,P=v("iterator"),C="keys",w="values",O="entries",R=function(){return this};e.exports=function(e,t,r,s,v,y,I){c(r,t,s);var E,_,A,T=function(e){if(e===v&&D)return D;if(!S&&e in k)return k[e];switch(e){case C:case w:case O:return function(){return new r(this,e)}}return function(){return new r(this)}},j=t+" Iterator",x=!1,k=e.prototype,M=k[P]||k["@@iterator"]||v&&k[v],D=!S&&M||T(v),N="Array"==t&&k.entries||M;if(N&&(E=u(N.call(new e)))!==Object.prototype&&E.next&&(i||u(E)===b||(p?p(E,b):a(E[P])||h(E,P,R)),l(E,j,!0,!0),i&&(d[j]=R)),g&&v==w&&M&&M.name!==w&&(!i&&m?f(k,"name",w):(x=!0,D=function(){return o(M,this)})),v)if(_={values:T(w),keys:y?D:T(C),entries:T(O)},I)for(A in _)(S||x||!(A in k))&&h(k,A,_[A]);else n({target:t,proto:!0,forced:S||x},_);return i&&!I||k[P]===D||h(k,P,D,{name:v}),d[t]=D,_}},5414:function(e,t,r){"use strict";var n,o,i,s=r(5152),a=r(6288),c=r(3570),u=r(9027),p=r(1455),l=r(4588),f=r(6761),h=r(2258),v=f("iterator"),d=!1;[].keys&&("next"in(i=[].keys())?(o=p(p(i)))!==Object.prototype&&(n=o):d=!0),!c(n)||s((function(){var e={};return n[v].call(e)!==e}))?n={}:h&&(n=u(n)),a(n[v])||l(n,v,(function(){return this})),e.exports={IteratorPrototype:n,BUGGY_SAFARI_ITERATORS:d}},5993:function(e){e.exports={}},9952:function(e,t,r){var n=r(6133);e.exports=function(e){return n(e.length)}},7276:function(e){var t=Math.ceil,r=Math.floor;e.exports=Math.trunc||function(e){var n=+e;return(n>0?r:t)(n)}},7242:function(e,t,r){var n,o,i,s,a,c,u,p,l=r(6411),f=r(3193),h=r(5602).f,v=r(8674).set,d=r(2499),y=r(704),g=r(3034),m=r(488),b=l.MutationObserver||l.WebKitMutationObserver,S=l.document,P=l.process,C=l.Promise,w=h(l,"queueMicrotask"),O=w&&w.value;O||(n=function(){var e,t;for(m&&(e=P.domain)&&e.exit();o;){t=o.fn,o=o.next;try{t()}catch(e){throw o?s():i=void 0,e}}i=void 0,e&&e.enter()},d||m||g||!b||!S?!y&&C&&C.resolve?((u=C.resolve(void 0)).constructor=C,p=f(u.then,u),s=function(){p(n)}):m?s=function(){P.nextTick(n)}:(v=f(v,l),s=function(){v(n)}):(a=!0,c=S.createTextNode(""),new b(n).observe(c,{characterData:!0}),s=function(){c.data=a=!a})),e.exports=O||function(e){var t={fn:e,next:void 0};i&&(i.next=t),o||(o=t,s()),i=t}},1218:function(e,t,r){"use strict";var n=r(497),o=TypeError,i=function(e){var t,r;this.promise=new e((function(e,n){if(void 0!==t||void 0!==r)throw o("Bad Promise constructor");t=e,r=n})),this.resolve=n(t),this.reject=n(r)};e.exports.f=function(e){return new i(e)}},6272:function(e,t,r){var n=r(5165);e.exports=function(e,t){return void 0===e?arguments.length<2?"":t:n(e)}},9027:function(e,t,r){var n,o=r(9519),i=r(2438),s=r(8795),a=r(3363),c=r(9876),u=r(4358),p=r(9575)("IE_PROTO"),l=function(){},f=function(e){return"<script>"+e+"<\/script>"},h=function(e){e.write(f("")),e.close();var t=e.parentWindow.Object;return e=null,t},v=function(){try{n=new ActiveXObject("htmlfile")}catch(e){}var e,t;v="undefined"!=typeof document?document.domain&&n?h(n):((t=u("iframe")).style.display="none",c.appendChild(t),t.src=String("javascript:"),(e=t.contentWindow.document).open(),e.write(f("document.F=Object")),e.close(),e.F):h(n);for(var r=s.length;r--;)delete v.prototype[s[r]];return v()};a[p]=!0,e.exports=Object.create||function(e,t){var r;return null!==e?(l.prototype=o(e),r=new l,l.prototype=null,r[p]=e):r=v(),void 0===t?r:i.f(r,t)}},2438:function(e,t,r){var n=r(4526),o=r(7855),i=r(585),s=r(9519),a=r(2973),c=r(2023);t.f=n&&!o?Object.defineProperties:function(e,t){s(e);for(var r,n=a(t),o=c(t),u=o.length,p=0;u>p;)i.f(e,r=o[p++],n[r]);return e}},585:function(e,t,r){var n=r(4526),o=r(3991),i=r(7855),s=r(9519),a=r(3164),c=TypeError,u=Object.defineProperty,p=Object.getOwnPropertyDescriptor;t.f=n?i?function(e,t,r){if(s(e),t=a(t),s(r),"function"==typeof e&&"prototype"===t&&"value"in r&&"writable"in r&&!r.writable){var n=p(e,t);n&&n.writable&&(e[t]=r.value,r={configurable:"configurable"in r?r.configurable:n.configurable,enumerable:"enumerable"in r?r.enumerable:n.enumerable,writable:!1})}return u(e,t,r)}:u:function(e,t,r){if(s(e),t=a(t),s(r),o)try{return u(e,t,r)}catch(e){}if("get"in r||"set"in r)throw c("Accessors not supported");return"value"in r&&(e[t]=r.value),e}},5602:function(e,t,r){var n=r(4526),o=r(4300),i=r(651),s=r(4004),a=r(2973),c=r(3164),u=r(5370),p=r(3991),l=Object.getOwnPropertyDescriptor;t.f=n?l:function(e,t){if(e=a(e),t=c(t),p)try{return l(e,t)}catch(e){}if(u(e,t))return s(!o(i.f,e,t),e[t])}},3116:function(e,t,r){var n=r(9064),o=r(8795).concat("length","prototype");t.f=Object.getOwnPropertyNames||function(e){return n(e,o)}},1274:function(e,t){t.f=Object.getOwnPropertySymbols},1455:function(e,t,r){var n=r(5370),o=r(6288),i=r(7131),s=r(9575),a=r(4557),c=s("IE_PROTO"),u=Object,p=u.prototype;e.exports=a?u.getPrototypeOf:function(e){var t=i(e);if(n(t,c))return t[c];var r=t.constructor;return o(r)&&t instanceof r?r.prototype:t instanceof u?p:null}},2802:function(e,t,r){var n=r(5088);e.exports=n({}.isPrototypeOf)},9064:function(e,t,r){var n=r(5088),o=r(5370),i=r(2973),s=r(4207).indexOf,a=r(3363),c=n([].push);e.exports=function(e,t){var r,n=i(e),u=0,p=[];for(r in n)!o(a,r)&&o(n,r)&&c(p,r);for(;t.length>u;)o(n,r=t[u++])&&(~s(p,r)||c(p,r));return p}},2023:function(e,t,r){var n=r(9064),o=r(8795);e.exports=Object.keys||function(e){return n(e,o)}},651:function(e,t){"use strict";var r={}.propertyIsEnumerable,n=Object.getOwnPropertyDescriptor,o=n&&!r.call({1:2},1);t.f=o?function(e){var t=n(this,e);return!!t&&t.enumerable}:r},6608:function(e,t,r){var n=r(5088),o=r(9519),i=r(3658);e.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,r={};try{(e=n(Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set))(r,[]),t=r instanceof Array}catch(e){}return function(r,n){return o(r),i(n),t?e(r,n):r.__proto__=n,r}}():void 0)},1701:function(e,t,r){"use strict";var n=r(6141),o=r(7322);e.exports=n?{}.toString:function(){return"[object "+o(this)+"]"}},9898:function(e,t,r){var n=r(4300),o=r(6288),i=r(3570),s=TypeError;e.exports=function(e,t){var r,a;if("string"===t&&o(r=e.toString)&&!i(a=n(r,e)))return a;if(o(r=e.valueOf)&&!i(a=n(r,e)))return a;if("string"!==t&&o(r=e.toString)&&!i(a=n(r,e)))return a;throw s("Can't convert object to primitive value")}},6658:function(e,t,r){var n=r(4405),o=r(5088),i=r(3116),s=r(1274),a=r(9519),c=o([].concat);e.exports=n("Reflect","ownKeys")||function(e){var t=i.f(a(e)),r=s.f;return r?c(t,r(e)):t}},8080:function(e){e.exports={}},5254:function(e){e.exports=function(e){try{return{error:!1,value:e()}}catch(e){return{error:!0,value:e}}}},807:function(e,t,r){var n=r(6411),o=r(5445),i=r(6288),s=r(4899),a=r(3913),c=r(6761),u=r(5365),p=r(8706),l=r(2258),f=r(6540),h=o&&o.prototype,v=c("species"),d=!1,y=i(n.PromiseRejectionEvent),g=s("Promise",(function(){var e=a(o),t=e!==String(o);if(!t&&66===f)return!0;if(l&&(!h.catch||!h.finally))return!0;if(!f||f<51||!/native code/.test(e)){var r=new o((function(e){e(1)})),n=function(e){e((function(){}),(function(){}))};if((r.constructor={})[v]=n,!(d=r.then((function(){}))instanceof n))return!0}return!t&&(u||p)&&!y}));e.exports={CONSTRUCTOR:g,REJECTION_EVENT:y,SUBCLASSING:d}},5445:function(e,t,r){var n=r(6411);e.exports=n.Promise},6444:function(e,t,r){var n=r(9519),o=r(3570),i=r(1218);e.exports=function(e,t){if(n(e),o(t)&&t.constructor===e)return t;var r=i.f(e);return(0,r.resolve)(t),r.promise}},1950:function(e,t,r){var n=r(5445),o=r(8255),i=r(807).CONSTRUCTOR;e.exports=i||!o((function(e){n.all(e).then(void 0,(function(){}))}))},6026:function(e){var t=function(){this.head=null,this.tail=null};t.prototype={add:function(e){var t={item:e,next:null};this.head?this.tail.next=t:this.head=t,this.tail=t},get:function(){var e=this.head;if(e)return this.head=e.next,this.tail===e&&(this.tail=null),e.item}},e.exports=t},9917:function(e,t,r){var n=r(4974),o=TypeError;e.exports=function(e){if(n(e))throw o("Can't call method on "+e);return e}},7489:function(e,t,r){"use strict";var n=r(4405),o=r(585),i=r(6761),s=r(4526),a=i("species");e.exports=function(e){var t=n(e),r=o.f;s&&t&&!t[a]&&r(t,a,{configurable:!0,get:function(){return this}})}},8442:function(e,t,r){var n=r(6141),o=r(585).f,i=r(3989),s=r(5370),a=r(1701),c=r(6761)("toStringTag");e.exports=function(e,t,r,u){if(e){var p=r?e:e.prototype;s(p,c)||o(p,c,{configurable:!0,value:t}),u&&!n&&i(p,"toString",a)}}},9575:function(e,t,r){var n=r(3608),o=r(5999),i=n("keys");e.exports=function(e){return i[e]||(i[e]=o(e))}},5119:function(e,t,r){var n=r(6411),o=r(7899),i="__core-js_shared__",s=n[i]||o(i,{});e.exports=s},3608:function(e,t,r){var n=r(2258),o=r(5119);(e.exports=function(e,t){return o[e]||(o[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.25.3",mode:n?"pure":"global",copyright:"© 2014-2022 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.25.3/LICENSE",source:"https://github.com/zloirock/core-js"})},5389:function(e,t,r){var n=r(9519),o=r(8921),i=r(4974),s=r(6761)("species");e.exports=function(e,t){var r,a=n(e).constructor;return void 0===a||i(r=n(a)[s])?t:o(r)}},7042:function(e,t,r){var n=r(5088),o=r(5970),i=r(5165),s=r(9917),a=n("".charAt),c=n("".charCodeAt),u=n("".slice),p=function(e){return function(t,r){var n,p,l=i(s(t)),f=o(r),h=l.length;return f<0||f>=h?e?"":void 0:(n=c(l,f))<55296||n>56319||f+1===h||(p=c(l,f+1))<56320||p>57343?e?a(l,f):n:e?u(l,f,f+2):p-56320+(n-55296<<10)+65536}};e.exports={codeAt:p(!1),charAt:p(!0)}},8719:function(e,t,r){var n=r(6540),o=r(5152);e.exports=!!Object.getOwnPropertySymbols&&!o((function(){var e=Symbol();return!String(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&n&&n<41}))},8674:function(e,t,r){var n,o,i,s,a=r(6411),c=r(5361),u=r(3193),p=r(6288),l=r(5370),f=r(5152),h=r(9876),v=r(967),d=r(4358),y=r(2291),g=r(2499),m=r(488),b=a.setImmediate,S=a.clearImmediate,P=a.process,C=a.Dispatch,w=a.Function,O=a.MessageChannel,R=a.String,I=0,E={};try{n=a.location}catch(e){}var _=function(e){if(l(E,e)){var t=E[e];delete E[e],t()}},A=function(e){return function(){_(e)}},T=function(e){_(e.data)},j=function(e){a.postMessage(R(e),n.protocol+"//"+n.host)};b&&S||(b=function(e){y(arguments.length,1);var t=p(e)?e:w(e),r=v(arguments,1);return E[++I]=function(){c(t,void 0,r)},o(I),I},S=function(e){delete E[e]},m?o=function(e){P.nextTick(A(e))}:C&&C.now?o=function(e){C.now(A(e))}:O&&!g?(s=(i=new O).port2,i.port1.onmessage=T,o=u(s.postMessage,s)):a.addEventListener&&p(a.postMessage)&&!a.importScripts&&n&&"file:"!==n.protocol&&!f(j)?(o=j,a.addEventListener("message",T,!1)):o="onreadystatechange"in d("script")?function(e){h.appendChild(d("script")).onreadystatechange=function(){h.removeChild(this),_(e)}}:function(e){setTimeout(A(e),0)}),e.exports={set:b,clear:S}},7005:function(e,t,r){var n=r(5970),o=Math.max,i=Math.min;e.exports=function(e,t){var r=n(e);return r<0?o(r+t,0):i(r,t)}},2973:function(e,t,r){var n=r(1088),o=r(9917);e.exports=function(e){return n(o(e))}},5970:function(e,t,r){var n=r(7276);e.exports=function(e){var t=+e;return t!=t||0===t?0:n(t)}},6133:function(e,t,r){var n=r(5970),o=Math.min;e.exports=function(e){return e>0?o(n(e),9007199254740991):0}},7131:function(e,t,r){var n=r(9917),o=Object;e.exports=function(e){return o(n(e))}},8652:function(e,t,r){var n=r(4300),o=r(3570),i=r(257),s=r(65),a=r(9898),c=r(6761),u=TypeError,p=c("toPrimitive");e.exports=function(e,t){if(!o(e)||i(e))return e;var r,c=s(e,p);if(c){if(void 0===t&&(t="default"),r=n(c,e,t),!o(r)||i(r))return r;throw u("Can't convert object to primitive value")}return void 0===t&&(t="number"),a(e,t)}},3164:function(e,t,r){var n=r(8652),o=r(257);e.exports=function(e){var t=n(e,"string");return o(t)?t:t+""}},6141:function(e,t,r){var n={};n[r(6761)("toStringTag")]="z",e.exports="[object z]"===String(n)},5165:function(e,t,r){var n=r(7322),o=String;e.exports=function(e){if("Symbol"===n(e))throw TypeError("Cannot convert a Symbol value to a string");return o(e)}},5377:function(e){var t=String;e.exports=function(e){try{return t(e)}catch(e){return"Object"}}},5999:function(e,t,r){var n=r(5088),o=0,i=Math.random(),s=n(1..toString);e.exports=function(e){return"Symbol("+(void 0===e?"":e)+")_"+s(++o+i,36)}},669:function(e,t,r){var n=r(8719);e.exports=n&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},7855:function(e,t,r){var n=r(4526),o=r(5152);e.exports=n&&o((function(){return 42!=Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype}))},2291:function(e){var t=TypeError;e.exports=function(e,r){if(e<r)throw t("Not enough arguments");return e}},7506:function(e,t,r){var n=r(6411),o=r(6288),i=n.WeakMap;e.exports=o(i)&&/native code/.test(String(i))},6761:function(e,t,r){var n=r(6411),o=r(3608),i=r(5370),s=r(5999),a=r(8719),c=r(669),u=o("wks"),p=n.Symbol,l=p&&p.for,f=c?p:p&&p.withoutSetter||s;e.exports=function(e){if(!i(u,e)||!a&&"string"!=typeof u[e]){var t="Symbol."+e;a&&i(p,e)?u[e]=p[e]:u[e]=c&&l?l(t):f(t)}return u[e]}},763:function(e,t,r){"use strict";var n=r(7275),o=r(2802),i=r(1455),s=r(6608),a=r(1603),c=r(9027),u=r(3989),p=r(4004),l=r(9978),f=r(5605),h=r(3476),v=r(6272),d=r(6761),y=r(4845),g=d("toStringTag"),m=Error,b=[].push,S=function(e,t){var r,n=arguments.length>2?arguments[2]:void 0,a=o(P,this);s?r=s(m(),a?i(this):P):(r=a?this:c(P),u(r,g,"Error")),void 0!==t&&u(r,"message",v(t)),y&&u(r,"stack",l(r.stack,1)),f(r,n);var p=[];return h(e,b,{that:p}),u(r,"errors",p),r};s?s(S,m):a(S,m,{name:!0});var P=S.prototype=c(m.prototype,{constructor:p(1,S),message:p(1,""),name:p(1,"AggregateError")});n({global:!0,constructor:!0,arity:2},{AggregateError:S})},7202:function(e,t,r){r(763)},5192:function(e,t,r){"use strict";var n=r(2973),o=r(8556),i=r(5993),s=r(4983),a=r(585).f,c=r(1378),u=r(5207),p=r(2258),l=r(4526),f="Array Iterator",h=s.set,v=s.getterFor(f);e.exports=c(Array,"Array",(function(e,t){h(this,{type:f,target:n(e),index:0,kind:t})}),(function(){var e=v(this),t=e.target,r=e.kind,n=e.index++;return!t||n>=t.length?(e.target=void 0,u(void 0,!0)):u("keys"==r?n:"values"==r?t[n]:[n,t[n]],!1)}),"values");var d=i.Arguments=i.Array;if(o("keys"),o("values"),o("entries"),!p&&l&&"values"!==d.name)try{a(d,"name",{value:"values"})}catch(e){}},6562:function(){},6777:function(e,t,r){"use strict";var n=r(7275),o=r(4300),i=r(497),s=r(1218),a=r(5254),c=r(3476);n({target:"Promise",stat:!0},{allSettled:function(e){var t=this,r=s.f(t),n=r.resolve,u=r.reject,p=a((function(){var r=i(t.resolve),s=[],a=0,u=1;c(e,(function(e){var i=a++,c=!1;u++,o(r,t,e).then((function(e){c||(c=!0,s[i]={status:"fulfilled",value:e},--u||n(s))}),(function(e){c||(c=!0,s[i]={status:"rejected",reason:e},--u||n(s))}))})),--u||n(s)}));return p.error&&u(p.value),r.promise}})},4139:function(e,t,r){"use strict";var n=r(7275),o=r(4300),i=r(497),s=r(1218),a=r(5254),c=r(3476);n({target:"Promise",stat:!0,forced:r(1950)},{all:function(e){var t=this,r=s.f(t),n=r.resolve,u=r.reject,p=a((function(){var r=i(t.resolve),s=[],a=0,p=1;c(e,(function(e){var i=a++,c=!1;p++,o(r,t,e).then((function(e){c||(c=!0,s[i]=e,--p||n(s))}),u)})),--p||n(s)}));return p.error&&u(p.value),r.promise}})},6429:function(e,t,r){"use strict";var n=r(7275),o=r(4300),i=r(497),s=r(4405),a=r(1218),c=r(5254),u=r(3476),p="No one promise resolved";n({target:"Promise",stat:!0},{any:function(e){var t=this,r=s("AggregateError"),n=a.f(t),l=n.resolve,f=n.reject,h=c((function(){var n=i(t.resolve),s=[],a=0,c=1,h=!1;u(e,(function(e){var i=a++,u=!1;c++,o(n,t,e).then((function(e){u||h||(h=!0,l(e))}),(function(e){u||h||(u=!0,s[i]=e,--c||f(new r(s,p)))}))})),--c||f(new r(s,p))}));return h.error&&f(h.value),n.promise}})},4252:function(e,t,r){"use strict";var n=r(7275),o=r(2258),i=r(807).CONSTRUCTOR,s=r(5445),a=r(4405),c=r(6288),u=r(4588),p=s&&s.prototype;if(n({target:"Promise",proto:!0,forced:i,real:!0},{catch:function(e){return this.then(void 0,e)}}),!o&&c(s)){var l=a("Promise").prototype.catch;p.catch!==l&&u(p,"catch",l,{unsafe:!0})}},8325:function(e,t,r){"use strict";var n,o,i,s=r(7275),a=r(2258),c=r(488),u=r(6411),p=r(4300),l=r(4588),f=r(6608),h=r(8442),v=r(7489),d=r(497),y=r(6288),g=r(3570),m=r(8856),b=r(5389),S=r(8674).set,P=r(7242),C=r(1558),w=r(5254),O=r(6026),R=r(4983),I=r(5445),E=r(807),_=r(1218),A="Promise",T=E.CONSTRUCTOR,j=E.REJECTION_EVENT,x=E.SUBCLASSING,k=R.getterFor(A),M=R.set,D=I&&I.prototype,N=I,z=D,L=u.TypeError,F=u.document,B=u.process,V=_.f,U=V,q=!!(F&&F.createEvent&&u.dispatchEvent),H="unhandledrejection",W=function(e){var t;return!(!g(e)||!y(t=e.then))&&t},K=function(e,t){var r,n,o,i=t.value,s=1==t.state,a=s?e.ok:e.fail,c=e.resolve,u=e.reject,l=e.domain;try{a?(s||(2===t.rejection&&Y(t),t.rejection=1),!0===a?r=i:(l&&l.enter(),r=a(i),l&&(l.exit(),o=!0)),r===e.promise?u(L("Promise-chain cycle")):(n=W(r))?p(n,r,c,u):c(r)):u(i)}catch(e){l&&!o&&l.exit(),u(e)}},G=function(e,t){e.notified||(e.notified=!0,P((function(){for(var r,n=e.reactions;r=n.get();)K(r,e);e.notified=!1,t&&!e.rejection&&Q(e)})))},J=function(e,t,r){var n,o;q?((n=F.createEvent("Event")).promise=t,n.reason=r,n.initEvent(e,!1,!0),u.dispatchEvent(n)):n={promise:t,reason:r},!j&&(o=u["on"+e])?o(n):e===H&&C("Unhandled promise rejection",r)},Q=function(e){p(S,u,(function(){var t,r=e.facade,n=e.value;if(X(e)&&(t=w((function(){c?B.emit("unhandledRejection",n,r):J(H,r,n)})),e.rejection=c||X(e)?2:1,t.error))throw t.value}))},X=function(e){return 1!==e.rejection&&!e.parent},Y=function(e){p(S,u,(function(){var t=e.facade;c?B.emit("rejectionHandled",t):J("rejectionhandled",t,e.value)}))},Z=function(e,t,r){return function(n){e(t,n,r)}},$=function(e,t,r){e.done||(e.done=!0,r&&(e=r),e.value=t,e.state=2,G(e,!0))},ee=function(e,t,r){if(!e.done){e.done=!0,r&&(e=r);try{if(e.facade===t)throw L("Promise can't be resolved itself");var n=W(t);n?P((function(){var r={done:!1};try{p(n,t,Z(ee,r,e),Z($,r,e))}catch(t){$(r,t,e)}})):(e.value=t,e.state=1,G(e,!1))}catch(t){$({done:!1},t,e)}}};if(T&&(z=(N=function(e){m(this,z),d(e),p(n,this);var t=k(this);try{e(Z(ee,t),Z($,t))}catch(e){$(t,e)}}).prototype,(n=function(e){M(this,{type:A,done:!1,notified:!1,parent:!1,reactions:new O,rejection:!1,state:0,value:void 0})}).prototype=l(z,"then",(function(e,t){var r=k(this),n=V(b(this,N));return r.parent=!0,n.ok=!y(e)||e,n.fail=y(t)&&t,n.domain=c?B.domain:void 0,0==r.state?r.reactions.add(n):P((function(){K(n,r)})),n.promise})),o=function(){var e=new n,t=k(e);this.promise=e,this.resolve=Z(ee,t),this.reject=Z($,t)},_.f=V=function(e){return e===N||void 0===e?new o(e):U(e)},!a&&y(I)&&D!==Object.prototype)){i=D.then,x||l(D,"then",(function(e,t){var r=this;return new N((function(e,t){p(i,r,e,t)})).then(e,t)}),{unsafe:!0});try{delete D.constructor}catch(e){}f&&f(D,z)}s({global:!0,constructor:!0,wrap:!0,forced:T},{Promise:N}),h(N,A,!1,!0),v(A)},5305:function(e,t,r){"use strict";var n=r(7275),o=r(2258),i=r(5445),s=r(5152),a=r(4405),c=r(6288),u=r(5389),p=r(6444),l=r(4588),f=i&&i.prototype;if(n({target:"Promise",proto:!0,real:!0,forced:!!i&&s((function(){f.finally.call({then:function(){}},(function(){}))}))},{finally:function(e){var t=u(this,a("Promise")),r=c(e);return this.then(r?function(r){return p(t,e()).then((function(){return r}))}:e,r?function(r){return p(t,e()).then((function(){throw r}))}:e)}}),!o&&c(i)){var h=a("Promise").prototype.finally;f.finally!==h&&l(f,"finally",h,{unsafe:!0})}},648:function(e,t,r){r(8325),r(4139),r(4252),r(4086),r(9954),r(5900)},4086:function(e,t,r){"use strict";var n=r(7275),o=r(4300),i=r(497),s=r(1218),a=r(5254),c=r(3476);n({target:"Promise",stat:!0,forced:r(1950)},{race:function(e){var t=this,r=s.f(t),n=r.reject,u=a((function(){var s=i(t.resolve);c(e,(function(e){o(s,t,e).then(r.resolve,n)}))}));return u.error&&n(u.value),r.promise}})},9954:function(e,t,r){"use strict";var n=r(7275),o=r(4300),i=r(1218);n({target:"Promise",stat:!0,forced:r(807).CONSTRUCTOR},{reject:function(e){var t=i.f(this);return o(t.reject,void 0,e),t.promise}})},5900:function(e,t,r){"use strict";var n=r(7275),o=r(4405),i=r(2258),s=r(5445),a=r(807).CONSTRUCTOR,c=r(6444),u=o("Promise"),p=i&&!a;n({target:"Promise",stat:!0,forced:i||a},{resolve:function(e){return c(p&&this===u?s:this,e)}})},675:function(e,t,r){"use strict";var n=r(7042).charAt,o=r(5165),i=r(4983),s=r(1378),a=r(5207),c="String Iterator",u=i.set,p=i.getterFor(c);s(String,"String",(function(e){u(this,{type:c,string:o(e),index:0})}),(function(){var e,t=p(this),r=t.string,o=t.index;return o>=r.length?a(void 0,!0):(e=n(r,o),t.index+=e.length,a(e,!1))}))},2350:function(e,t,r){r(5192);var n=r(9671),o=r(6411),i=r(7322),s=r(3989),a=r(5993),c=r(6761)("toStringTag");for(var u in n){var p=o[u],l=p&&p.prototype;l&&i(l)!==c&&s(l,c,u),a[u]=a.Array}},9439:function(e,t,r){var n=r(3248);r(2350),e.exports=n},3894:function(e){"use strict";e.exports=function(){var e={};return e.promise=new Promise((function(t,r){e.resolve=t,e.reject=r})),e}},4787:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n,o=(n=r(3894))&&n.__esModule?n:{default:n};function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var a=function(){function e(){var t=this,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};i(this,e),this.defers=[],this.upcomingDeferred=null,this.eventListener=this.eventListener.bind(this),this.options=r,this.one=this.one.bind(this),this.upcoming=this.upcoming.bind(this),this[Symbol.iterator]=function(){return{next:function(){return{done:!1,value:t.upcoming()}}}}}var t,r;return t=e,r=[{key:"eventListener",value:function(e){var t=this.defers.shift(),r=this.options.array?[].slice.call(arguments):e;t&&t.resolve(r),this.upcomingDeferred&&(this.upcomingDeferred.resolve(r),this.upcomingDeferred=null)}},{key:"one",value:function(){var e=(0,o.default)();return this.defers.push(e),e.promise}},{key:"upcoming",value:function(){return this.upcomingDeferred||(this.upcomingDeferred=(0,o.default)()),this.upcomingDeferred.promise}}],r&&s(t.prototype,r),e}();t.default=a,e.exports=t.default,e.exports.default=t.default},9997:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(2427),o=r(746),i=r(3992),s=r(3065),a=r(9090),c=r(3382),u=r(6228),p=r(5124),l=r(5470),f=r(432),h=r(4430),v=r(8942);function d(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var y,g=d(n),m=d(o),b=d(i),S=d(s),P=d(a),C=d(c),w=d(u),O=d(p),R=d(l),I=d(f),E=d(h),_=d(v);function A(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=w.default(e);if(t){var o=w.default(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return C.default(this,r)}}function T(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function j(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?T(Object(r),!0).forEach((function(t){R.default(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):T(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function x(e,t){if(!e){for(var r=arguments.length,n=new Array(r>2?r-2:0),o=2;o<r;o++)n[o-2]=arguments[o];throw new TypeError(k(t,n))}}function k(e,t){var r=0;return e.replace(/%[os]/g,(function(){return M(t[r++])}))}function M(e){return"object"!==_.default(e)||null===e?String(e):Object.prototype.toString.call(e)}var D,N="undefined"!=typeof window?window:"undefined"!=typeof self?self:void 0!==r.g?r.g:"undefined"!=typeof globalThis?globalThis:void 0,z=function(){function e(t,r){I.default(this,e),this.code=t,this.message=r}return E.default(e,[{key:"warn",value:function(){var e;try{for(var t,r=arguments.length,n=new Array(r),o=0;o<r;o++)n[o]=arguments[o];if(D)return void D(j(j({},this),{},{args:n}));var i=(null!==(e=(new Error).stack)&&void 0!==e?e:"").replace(/^(?:(?:[\0-\t\x0B\f\x0E-\u2027\u202A-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+?\n){2}/g,"\n");(t=console).warn.apply(t,[this.message].concat(n,[i]))}catch(e){}}}]),e}(),L=new z("W01","Unable to initialize event under dispatching."),F=new z("W02","Assigning any falsy value to 'cancelBubble' property has no effect."),B=new z("W03","Assigning any truthy value to 'returnValue' property has no effect."),V=new z("W04","Unable to preventDefault on non-cancelable events."),U=new z("W05","Unable to preventDefault inside passive event listener invocation."),q=new z("W06","An event listener wasn't added because it has been added already: %o, %o"),H=new z("W07","The %o option value was abandoned because the event listener wasn't added as duplicated."),W=new z("W08","The 'callback' argument must be a function or an object that has 'handleEvent' method: %o"),K=new z("W09","Event attribute handler must be a function: %o"),G=function(){function e(t,r){I.default(this,e),Object.defineProperty(this,"isTrusted",{value:!1,enumerable:!0});var n=null!=r?r:{};Z.set(this,{type:String(t),bubbles:Boolean(n.bubbles),cancelable:Boolean(n.cancelable),composed:Boolean(n.composed),target:null,currentTarget:null,stopPropagationFlag:!1,stopImmediatePropagationFlag:!1,canceledFlag:!1,inPassiveListenerFlag:!1,dispatchFlag:!1,timeStamp:Date.now()})}return E.default(e,null,[{key:"NONE",get:function(){return J}},{key:"CAPTURING_PHASE",get:function(){return Q}},{key:"AT_TARGET",get:function(){return X}},{key:"BUBBLING_PHASE",get:function(){return Y}}]),E.default(e,[{key:"composedPath",value:function(){var e=$(this).currentTarget;return e?[e]:[]}},{key:"stopPropagation",value:function(){$(this).stopPropagationFlag=!0}},{key:"stopImmediatePropagation",value:function(){var e=$(this);e.stopPropagationFlag=e.stopImmediatePropagationFlag=!0}},{key:"preventDefault",value:function(){ee($(this))}},{key:"initEvent",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=$(this);n.dispatchFlag?L.warn():Z.set(this,j(j({},n),{},{type:String(e),bubbles:Boolean(t),cancelable:Boolean(r),target:null,currentTarget:null,stopPropagationFlag:!1,stopImmediatePropagationFlag:!1,canceledFlag:!1}))}},{key:"type",get:function(){return $(this).type}},{key:"target",get:function(){return $(this).target}},{key:"srcElement",get:function(){return $(this).target}},{key:"currentTarget",get:function(){return $(this).currentTarget}},{key:"NONE",get:function(){return J}},{key:"CAPTURING_PHASE",get:function(){return Q}},{key:"AT_TARGET",get:function(){return X}},{key:"BUBBLING_PHASE",get:function(){return Y}},{key:"eventPhase",get:function(){return $(this).dispatchFlag?2:0}},{key:"cancelBubble",get:function(){return $(this).stopPropagationFlag},set:function(e){e?$(this).stopPropagationFlag=!0:F.warn()}},{key:"bubbles",get:function(){return $(this).bubbles}},{key:"cancelable",get:function(){return $(this).cancelable}},{key:"returnValue",get:function(){return!$(this).canceledFlag},set:function(e){e?B.warn():ee($(this))}},{key:"defaultPrevented",get:function(){return $(this).canceledFlag}},{key:"composed",get:function(){return $(this).composed}},{key:"isTrusted",get:function(){return!1}},{key:"timeStamp",get:function(){return $(this).timeStamp}}]),e}(),J=0,Q=1,X=2,Y=3,Z=new WeakMap;function $(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"this",r=Z.get(e);return x(null!=r,"'%s' must be an object that Event constructor created, but got another one: %o",t,e),r}function ee(e){e.inPassiveListenerFlag?U.warn():e.cancelable?e.canceledFlag=!0:V.warn()}Object.defineProperty(G,"NONE",{enumerable:!0}),Object.defineProperty(G,"CAPTURING_PHASE",{enumerable:!0}),Object.defineProperty(G,"AT_TARGET",{enumerable:!0}),Object.defineProperty(G,"BUBBLING_PHASE",{enumerable:!0});for(var te,re=Object.getOwnPropertyNames(G.prototype),ne=0;ne<re.length;++ne)"constructor"!==re[ne]&&Object.defineProperty(G.prototype,re[ne],{enumerable:!0});void 0!==N&&void 0!==N.Event&&Object.setPrototypeOf(G.prototype,N.Event.prototype);var oe={INDEX_SIZE_ERR:1,DOMSTRING_SIZE_ERR:2,HIERARCHY_REQUEST_ERR:3,WRONG_DOCUMENT_ERR:4,INVALID_CHARACTER_ERR:5,NO_DATA_ALLOWED_ERR:6,NO_MODIFICATION_ALLOWED_ERR:7,NOT_FOUND_ERR:8,NOT_SUPPORTED_ERR:9,INUSE_ATTRIBUTE_ERR:10,INVALID_STATE_ERR:11,SYNTAX_ERR:12,INVALID_MODIFICATION_ERR:13,NAMESPACE_ERR:14,INVALID_ACCESS_ERR:15,VALIDATION_ERR:16,TYPE_MISMATCH_ERR:17,SECURITY_ERR:18,NETWORK_ERR:19,ABORT_ERR:20,URL_MISMATCH_ERR:21,QUOTA_EXCEEDED_ERR:22,TIMEOUT_ERR:23,INVALID_NODE_TYPE_ERR:24,DATA_CLONE_ERR:25};function ie(e){for(var t=Object.keys(oe),r=function(r){var n=t[r],o=oe[n];Object.defineProperty(e,n,{get:function(){return o},configurable:!0,enumerable:!0})},n=0;n<t.length;++n)r(n)}var se=function(e){P.default(r,e);var t=A(r);function r(e){var n,o,i;I.default(this,r),i=t.call(this,e.type,{bubbles:e.bubbles,cancelable:e.cancelable,composed:e.composed}),e.cancelBubble&&b.default((n=S.default(i),w.default(r.prototype)),"stopPropagation",n).call(n),e.defaultPrevented&&b.default((o=S.default(i),w.default(r.prototype)),"preventDefault",o).call(o),ae.set(S.default(i),{original:e});for(var s=Object.keys(e),a=0;a<s.length;++a){var c=s[a];c in S.default(i)||Object.defineProperty(S.default(i),c,le(e,c))}return i}return E.default(r,null,[{key:"wrap",value:function(e){return new(pe(e))(e)}}]),E.default(r,[{key:"stopPropagation",value:function(){b.default(w.default(r.prototype),"stopPropagation",this).call(this);var e=ce(this).original;"stopPropagation"in e&&e.stopPropagation()}},{key:"stopImmediatePropagation",value:function(){b.default(w.default(r.prototype),"stopImmediatePropagation",this).call(this);var e=ce(this).original;"stopImmediatePropagation"in e&&e.stopImmediatePropagation()}},{key:"preventDefault",value:function(){b.default(w.default(r.prototype),"preventDefault",this).call(this);var e=ce(this).original;"preventDefault"in e&&e.preventDefault()}},{key:"cancelBubble",get:function(){return b.default(w.default(r.prototype),"cancelBubble",this)},set:function(e){m.default(w.default(r.prototype),"cancelBubble",e,this,!0);var t=ce(this).original;"cancelBubble"in t&&(t.cancelBubble=e)}},{key:"returnValue",get:function(){return b.default(w.default(r.prototype),"returnValue",this)},set:function(e){m.default(w.default(r.prototype),"returnValue",e,this,!0);var t=ce(this).original;"returnValue"in t&&(t.returnValue=e)}},{key:"timeStamp",get:function(){var e=ce(this).original;return"timeStamp"in e?e.timeStamp:b.default(w.default(r.prototype),"timeStamp",this)}}]),r}(G),ae=new WeakMap;function ce(e){var t=ae.get(e);return x(null!=t,"'this' is expected an Event object, but got",e),t}var ue=new WeakMap;function pe(e){var t=Object.getPrototypeOf(e);if(null==t)return se;var r=ue.get(t);return null==r&&(r=function(e,t){for(var r=function(e){P.default(r,e);var t=A(r);function r(){return I.default(this,r),t.apply(this,arguments)}return r}(e),n=Object.keys(t),o=0;o<n.length;++o)Object.defineProperty(r.prototype,n[o],le(t,n[o]));return r}(pe(t),t),ue.set(t,r)),r}function le(e,t){var r=Object.getOwnPropertyDescriptor(e,t);return{get:function(){var e=ce(this).original,r=e[t];return"function"==typeof r?r.bind(e):r},set:function(e){ce(this).original[t]=e},configurable:r.configurable,enumerable:r.enumerable}}function fe(e){e.flags|=8}function he(e){return 1==(1&e.flags)}function ve(e){return 2==(2&e.flags)}function de(e){return 4==(4&e.flags)}function ye(e){return 8==(8&e.flags)}function ge(e,t,r){var n=e.callback;try{"function"==typeof n?n.call(t,r):"function"==typeof n.handleEvent&&n.handleEvent(r)}catch(e){!function(e){try{var t=e instanceof Error?e:new Error(M(e));if(y)return void y(t);if("function"==typeof dispatchEvent&&"function"==typeof ErrorEvent)dispatchEvent(new ErrorEvent("error",{error:t,message:t.message}));else if("undefined"!=typeof process&&"function"==typeof process.emit)return void process.emit("uncaughtException",t);console.error(t)}catch(e){}}(e)}}function me(e,t,r){for(var n=e.listeners,o=0;o<n.length;++o)if(n[o].callback===t&&he(n[o])===r)return o;return-1}function be(e,t,r,n,o,i){var s;i&&(s=Se.bind(null,e,t,r),i.addEventListener("abort",s));var a=function(e,t,r,n,o,i){return{callback:e,flags:(t?1:0)|(r?2:0)|(n?4:0),signal:o,signalListener:i}}(t,r,n,o,i,s);return e.cow?(e.cow=!1,e.listeners=[].concat(g.default(e.listeners),[a])):e.listeners.push(a),a}function Se(e,t,r){var n=me(e,t,r);return-1!==n&&Pe(e,n)}function Pe(e,t){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=e.listeners[t];return fe(n),n.signal&&n.signal.removeEventListener("abort",n.signalListener),e.cow&&!r?(e.cow=!1,e.listeners=e.listeners.filter((function(e,r){return r!==t})),!1):(e.listeners.splice(t,1),!0)}function Ce(e,t){var r;return null!==(r=e[t])&&void 0!==r?r:e[t]={attrCallback:void 0,attrListener:void 0,cow:!1,listeners:[]}}ue.set(Object.prototype,se),void 0!==N&&void 0!==N.Event&&ue.set(N.Event.prototype,se);var we=function(){function e(){I.default(this,e),Oe.set(this,Object.create(null))}return E.default(e,[{key:"addEventListener",value:function(e,t,r){var n=Re(this),o=function(e,t,r){var n;return Ie(t),"object"===_.default(r)&&null!==r?{type:String(e),callback:null!=t?t:void 0,capture:Boolean(r.capture),passive:Boolean(r.passive),once:Boolean(r.once),signal:null!==(n=r.signal)&&void 0!==n?n:void 0}:{type:String(e),callback:null!=t?t:void 0,capture:Boolean(r),passive:!1,once:!1,signal:void 0}}(e,t,r),i=o.callback,s=o.capture,a=o.once,c=o.passive,u=o.signal,p=o.type;if(null!=i&&!(null==u?void 0:u.aborted)){var l=Ce(n,p),f=me(l,i,s);-1===f?be(l,i,s,c,a,u):function(e,t,r,n){q.warn(he(e)?"capture":"bubble",e.callback),ve(e)!==t&&H.warn("passive"),de(e)!==r&&H.warn("once"),e.signal!==n&&H.warn("signal")}(l.listeners[f],c,a,u)}}},{key:"removeEventListener",value:function(e,t,r){var n=Re(this),o=function(e,t,r){return Ie(t),"object"===_.default(r)&&null!==r?{type:String(e),callback:null!=t?t:void 0,capture:Boolean(r.capture)}:{type:String(e),callback:null!=t?t:void 0,capture:Boolean(r)}}(e,t,r),i=o.callback,s=o.capture,a=n[o.type];null!=i&&a&&Se(a,i,s)}},{key:"dispatchEvent",value:function(e){var t=Re(this)[String(e.type)];if(null==t)return!0;var r,n=e instanceof G?e:se.wrap(e),o=$(n,"event");if(o.dispatchFlag)throw r="This event has been in dispatching.",N.DOMException?new N.DOMException(r,"InvalidStateError"):(null==te&&(te=function(e){P.default(r,e);var t=A(r);function r(e){var n;return I.default(this,r),n=t.call(this,e),Error.captureStackTrace&&Error.captureStackTrace(S.default(n),r),n}return E.default(r,[{key:"code",get:function(){return 11}},{key:"name",get:function(){return"InvalidStateError"}}]),r}(O.default(Error)),Object.defineProperties(te.prototype,{code:{enumerable:!0},name:{enumerable:!0}}),ie(te),ie(te.prototype)),new te(r));if(o.dispatchFlag=!0,o.target=o.currentTarget=this,!o.stopPropagationFlag){var i=t.cow,s=t.listeners;t.cow=!0;for(var a=0;a<s.length;++a){var c=s[a];if(!ye(c)&&(de(c)&&Pe(t,a,!i)&&(a-=1),o.inPassiveListenerFlag=ve(c),ge(c,this,n),o.inPassiveListenerFlag=!1,o.stopImmediatePropagationFlag))break}i||(t.cow=!1)}return o.target=null,o.currentTarget=null,o.stopImmediatePropagationFlag=!1,o.stopPropagationFlag=!1,o.dispatchFlag=!1,!o.canceledFlag}}]),e}(),Oe=new WeakMap;function Re(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"this",r=Oe.get(e);return x(null!=r,"'%s' must be an object that EventTarget constructor created, but got another one: %o",t,e),r}function Ie(e){if("function"!=typeof e&&("object"!==_.default(e)||null===e||"function"!=typeof e.handleEvent)){if(null!=e&&"object"!==_.default(e))throw new TypeError(k(W.message,[e]));W.warn(e)}}for(var Ee=Object.getOwnPropertyNames(we.prototype),_e=0;_e<Ee.length;++_e)"constructor"!==Ee[_e]&&Object.defineProperty(we.prototype,Ee[_e],{enumerable:!0});function Ae(e,t){var r,n;return null!==(n=null===(r=Re(e,"target")[t])||void 0===r?void 0:r.attrCallback)&&void 0!==n?n:null}function Te(e,t,r){null!=r&&"function"!=typeof r&&K.warn(r),"function"==typeof r||"object"===_.default(r)&&null!==r?function(e,t,r){var n=Ce(Re(e,"target"),String(t));n.attrCallback=r,null==n.attrListener&&(n.attrListener=be(n,function(e){return function(t){var r=e.attrCallback;"function"==typeof r&&r.call(this,t)}}(n),!1,!1,!1,void 0))}(e,t,r):function(e,t){var r=Re(e,"target")[String(t)];r&&r.attrListener&&(Se(r,r.attrListener.callback,!1),r.attrCallback=r.attrListener=void 0)}(e,t)}function je(e,t,r){Object.defineProperty(e,"on".concat(t),{get:function(){return Ae(this,t)},set:function(e){Te(this,t,e)},configurable:!0,enumerable:!0})}void 0!==N&&void 0!==N.EventTarget&&Object.setPrototypeOf(we.prototype,N.EventTarget.prototype),t.Event=G,t.EventTarget=we,t.default=we,t.defineCustomEventTarget=function(){for(var e=function(e){P.default(r,e);var t=A(r);function r(){return I.default(this,r),t.apply(this,arguments)}return r}(we),t=0;t<arguments.length;++t)je(e.prototype,t<0||arguments.length<=t?void 0:arguments[t]);return e},t.defineEventAttribute=je,t.getEventAttributeValue=Ae,t.setErrorHandler=function(e){x("function"==typeof e||void 0===e,"The error handler must be a function or undefined, but got %o.",e),y=e},t.setEventAttributeValue=Te,t.setWarningHandler=function(e){x("function"==typeof e||void 0===e,"The warning handler must be a function or undefined, but got %o.",e),D=e}},5803:function(e,t,r){"use strict";r.r(t),r.d(t,{default:function(){return i}});var n=Number.isNaN||function(e){return"number"==typeof e&&e!=e};function o(e,t){if(e.length!==t.length)return!1;for(var r=0;r<e.length;r++)if(!((o=e[r])===(i=t[r])||n(o)&&n(i)))return!1;var o,i;return!0}function i(e,t){void 0===t&&(t=o);var r=null;function n(){for(var n=[],o=0;o<arguments.length;o++)n[o]=arguments[o];if(r&&r.lastThis===this&&t(n,r.lastArgs))return r.lastResult;var i=e.apply(this,n);return r={lastResult:i,lastArgs:n,lastThis:this},i}return n.clear=function(){r=null},n}},4287:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||t.hasOwnProperty(r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0});var i=r(6340);r(2370).Events.instance.attachListener(new i.ConsoleLoggingListener),o(r(9480),t)},8109:function(e,t,r){"use strict";var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},n.apply(this,arguments)},o=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.hasOwnProperty.call(e,r)&&o(t,e,r);return i(t,e),t},a=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function s(e){try{c(n.next(e))}catch(e){i(e)}}function a(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))},c=this&&this.__generator||function(e,t){var r,n,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,n=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},u=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.CertCheckAgent=void 0;var p=s(r(5779)),l=s(r(1869)),f=s(r(1556)),h=r(2370),v=u(r(5733)),d=u(r(9240)),y=u(r(6482)),g=s(r(4822)),m=r(4562),b=function(){function e(t){t&&(this.privProxyInfo=t),e.privDiskCache||(e.privDiskCache=new d.default("microsoft-cognitiveservices-speech-sdk-cache",{supportBuffer:!0,location:"undefined"!=typeof process&&process.env.SPEECH_OCSP_CACHE_ROOT?process.env.SPEECH_OCSP_CACHE_ROOT:void 0}))}return e.forceReinitDiskCache=function(){e.privDiskCache=void 0,e.privMemCache={}},e.prototype.GetAgent=function(e){var t=new v.default.Agent(this.CreateConnection);return void 0!==this.privProxyInfo&&void 0!==this.privProxyInfo.HostName&&this.privProxyInfo.Port>0&&(t.privProxyInfo=this.privProxyInfo),t},e.GetProxyAgent=function(e){var t={host:e.HostName,port:e.Port};return e.UserName?t.headers={"Proxy-Authentication":"Basic "+new Buffer(e.UserName+":"+(void 0===e.Password)?"":e.Password).toString("base64")}:t.headers={},t.headers.requestOCSP="true",new y.default(t)},e.OCSPCheck=function(t,r){return a(this,void 0,void 0,(function(){var n,o,i,s,u,p=this;return c(this,(function(l){switch(l.label){case 0:return i=!1,[4,t];case 1:return(s=l.sent()).cork(),u=s,[2,new Promise((function(t,l){s.on("OCSPResponse",(function(e){e&&(p.onEvent(new h.OCSPStapleReceivedEvent),o=e)})),s.on("error",(function(e){i||(i=!0,s.destroy(),l(e))})),u.on("secure",(function(){return a(p,void 0,void 0,(function(){var a,p,h,v,d;return c(this,(function(c){switch(c.label){case 0:a=u.getPeerCertificate(!0),c.label=1;case 1:return c.trys.push([1,6,,7]),[4,this.GetIssuer(a)];case 2:return p=c.sent(),n=f.request.generate(a.raw,p.raw),h=n.id.toString("hex"),o?[3,4]:[4,e.GetResponseFromCache(h,n,r)];case 3:v=c.sent(),o=v,c.label=4;case 4:return[4,this.VerifyOCSPResponse(o,n,r)];case 5:return c.sent(),s.uncork(),i=!0,t(s),[3,7];case 6:return d=c.sent(),s.destroy(),i=!0,l(d),[3,7];case 7:return[2]}}))}))}))}))]}}))}))},e.GetIssuer=function(e){return e.issuerCertificate?Promise.resolve(e.issuerCertificate):new Promise((function(t,r){new f.Agent({}).fetchIssuer(e,null,(function(e,n){e?r(e):t(n)}))}))},e.GetResponseFromCache=function(t,r,n){return a(this,void 0,void 0,(function(){var o,i,s,a,u,p,l,v=this;return c(this,(function(c){switch(c.label){case 0:if((o=e.privMemCache[t])&&this.onEvent(new h.OCSPMemoryCacheHitEvent(t)),o)return[3,4];c.label=1;case 1:return c.trys.push([1,3,,4]),[4,e.privDiskCache.get(t)];case 2:return(i=c.sent()).isCached&&(e.onEvent(new h.OCSPDiskCacheHitEvent(t)),e.StoreMemoryCacheEntry(t,i.value),o=i.value),[3,4];case 3:return c.sent(),o=null,[3,4];case 4:if(!o)return[2,o];try{if(s=f.utils.parseResponse(o),(a=s.value.tbsResponseData).responses.length<1)return this.onEvent(new h.OCSPCacheFetchErrorEvent(t,"Not enough data in cached response")),[2];u=a.responses[0].thisUpdate,(p=a.responses[0].nextUpdate)<Date.now()+this.testTimeOffset-6e4?(this.onEvent(new h.OCSPCacheEntryExpiredEvent(t,p)),o=null):(l=Math.min(864e5,(p-u)/2),p-(Date.now()+this.testTimeOffset)<l?(this.onEvent(new h.OCSPCacheEntryNeedsRefreshEvent(t,u,p)),this.UpdateCache(r,n).catch((function(e){v.onEvent(new m.OCSPCacheUpdateErrorEvent(t,e.toString()))}))):this.onEvent(new h.OCSPCacheHitEvent(t,u,p)))}catch(e){this.onEvent(new h.OCSPCacheFetchErrorEvent(t,e)),o=null}return o||this.onEvent(new h.OCSPCacheMissEvent(t)),[2,o]}}))}))},e.VerifyOCSPResponse=function(t,r,n){return a(this,void 0,void 0,(function(){var o,i=this;return c(this,(function(s){switch(s.label){case 0:return o=t,r.certID.toString("hex"),o?[3,2]:[4,e.GetOCSPResponse(r,n)];case 1:o=s.sent(),s.label=2;case 2:return[2,new Promise((function(s,a){f.verify({request:r,response:o},(function(c,u){c?(e.onEvent(new h.OCSPVerificationFailedEvent(r.id.toString("hex"),c)),t?i.VerifyOCSPResponse(null,r,n).then((function(){s()}),(function(e){a(e)})):a(c)):(t||e.StoreCacheEntry(r.id.toString("hex"),o),s())}))}))]}}))}))},e.UpdateCache=function(e,t){return a(this,void 0,void 0,(function(){var r,n;return c(this,(function(o){switch(o.label){case 0:return r=e.id.toString("hex"),this.onEvent(new h.OCSPCacheUpdateNeededEvent(r)),[4,this.GetOCSPResponse(e,t)];case 1:return n=o.sent(),this.StoreCacheEntry(r,n),this.onEvent(new h.OCSPCacheUpdatehCompleteEvent(e.id.toString("hex"))),[2]}}))}))},e.StoreCacheEntry=function(e,t){this.StoreMemoryCacheEntry(e,t),this.StoreDiskCacheEntry(e,t)},e.StoreMemoryCacheEntry=function(e,t){this.privMemCache[e]=t,this.onEvent(new h.OCSPMemoryCacheStoreEvent(e))},e.StoreDiskCacheEntry=function(e,t){var r=this;this.privDiskCache.set(e,t).then((function(){r.onEvent(new h.OCSPDiskCacheStoreEvent(e))}))},e.GetOCSPResponse=function(t,r){var o=this,i={};if(r){var s=e.GetProxyAgent(r);i.agent=s}return new Promise((function(e,r){f.utils.getAuthorityInfo(t.cert,"1.3.6.1.5.5.7.48.1",(function(s,a){if(s)r(s);else{var c=l.default(a);c.path=c.pathname,i=n(n({},i),c),f.utils.getResponse(i,t.data,(function(n,i){n?r(n):(o.onEvent(new h.OCSPResponseRetrievedEvent(t.certID.toString("hex"))),e(i))}))}}))}))},e.prototype.CreateConnection=function(t,r){var o,i="undefined"!=typeof process&&"0"!==process.env.NODE_TLS_REJECT_UNAUTHORIZED&&"0"!==process.env.SPEECH_CONDUCT_OCSP_CHECK&&r.secureEndpoint;if(r=n(n({},r),{requestOCSP:!e.forceDisableOCSPStapling,servername:r.host}),this.privProxyInfo){var s=e.GetProxyAgent(this.privProxyInfo);o=new Promise((function(e,n){s.callback(t,r,(function(t,r){t?n(t):e(r)}))}))}else o=r.secureEndpoint?Promise.resolve(p.connect(r)):Promise.resolve(g.connect(r));return i?e.OCSPCheck(o,this.privProxyInfo):o},e.testTimeOffset=0,e.forceDisableOCSPStapling=!1,e.privMemCache={},e.onEvent=function(e){h.Events.instance.onEvent(e)},e}();t.CertCheckAgent=b},3172:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ConsoleLoggingListener=void 0;var n=r(2370);t.ConsoleLoggingListener=function(e){var t=this;void 0===e&&(e=n.EventType.Warning),this.onEvent=function(e){if(e.eventType>=t.privLogLevelFilter){var r=t.toString(e);switch(e.eventType){case n.EventType.Debug:console.debug(r);break;case n.EventType.Info:console.info(r);break;case n.EventType.Warning:console.warn(r);break;case n.EventType.Error:console.error(r);break;default:console.log(r)}}},this.toString=function(e){var t=[""+e.EventTime,""+e.Name];for(var r in e)if(r&&e.hasOwnProperty(r)&&"eventTime"!==r&&"eventType"!==r&&"eventId"!==r&&"name"!==r&&"constructor"!==r){var n=e[r],o="<NULL>";null!=n&&(o="number"==typeof n||"string"==typeof n?n.toString():JSON.stringify(n)),t.push(r+": "+o)}return t.join(" | ")},this.privLogLevelFilter=e}},6340:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||t.hasOwnProperty(r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),o(r(3172),t),o(r(5021),t),o(r(9161),t),o(r(2804),t),o(r(9e3),t),o(r(784),t),o(r(8333),t),o(r(7850),t),o(r(6850),t),o(r(1297),t),o(r(5597),t)},2804:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function s(e){try{c(n.next(e))}catch(e){i(e)}}function a(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var r,n,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,n=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.FileAudioSource=void 0;var i=r(21),s=r(2370),a=r(1891),c=function(){function e(e,t,r){var i=this;this.privStreams={},this.privHeaderEnd=44,this.turnOn=function(){if(i.privFilename.lastIndexOf(".wav")!==i.privFilename.length-4){var e=i.privFilename+" is not supported. Only WAVE files are allowed at the moment.";return i.onEvent(new s.AudioSourceErrorEvent(e,"")),Promise.reject(e)}i.onEvent(new s.AudioSourceInitializingEvent(i.privId)),i.onEvent(new s.AudioSourceReadyEvent(i.privId))},this.id=function(){return i.privId},this.attach=function(e){return n(i,void 0,void 0,(function(){var t,r=this;return o(this,(function(i){switch(i.label){case 0:return this.onEvent(new s.AudioStreamNodeAttachingEvent(this.privId,e)),[4,this.upload(e)];case 1:return t=i.sent(),this.onEvent(new s.AudioStreamNodeAttachedEvent(this.privId,e)),[2,Promise.resolve({detach:function(){return n(r,void 0,void 0,(function(){return o(this,(function(r){switch(r.label){case 0:return t.readEnded(),delete this.privStreams[e],this.onEvent(new s.AudioStreamNodeDetachedEvent(this.privId,e)),[4,this.turnOff()];case 1:return r.sent(),[2]}}))}))},id:function(){return e},read:function(){return t.read()}})]}}))}))},this.detach=function(e){e&&i.privStreams[e]&&(i.privStreams[e].close(),delete i.privStreams[e],i.onEvent(new s.AudioStreamNodeDetachedEvent(i.privId,e)))},this.turnOff=function(){for(var e in i.privStreams)if(e){var t=i.privStreams[e];t&&!t.isClosed&&t.close()}return i.onEvent(new s.AudioSourceOffEvent(i.privId)),Promise.resolve()},this.onEvent=function(e){i.privEvents.onEvent(e),s.Events.instance.onEvent(e)},this.privId=r||s.createNoDashGuid(),this.privEvents=new s.EventSource,this.privSource=e,"undefined"!=typeof window&&"undefined"!=typeof Blob&&this.privSource instanceof Blob?this.privFilename=e.name:this.privFilename=t||"unknown.wav",this.privAudioFormatPromise=this.readHeader()}return Object.defineProperty(e.prototype,"format",{get:function(){return this.privAudioFormatPromise},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"blob",{get:function(){return Promise.resolve(this.privSource)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"events",{get:function(){return this.privEvents},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"deviceInfo",{get:function(){return this.privAudioFormatPromise.then((function(e){return Promise.resolve({bitspersample:e.bitsPerSample,channelcount:e.channels,connectivity:i.connectivity.Unknown,manufacturer:"Speech SDK",model:"File",samplerate:e.samplesPerSec,type:i.type.File})}))},enumerable:!1,configurable:!0}),e.prototype.readHeader=function(){var e=this,t=this.privSource.slice(0,512),r=new s.Deferred,n=function(t){var n=new DataView(t),o=function(e){return String.fromCharCode(n.getUint8(e),n.getUint8(e+1),n.getUint8(e+2),n.getUint8(e+3))};if("RIFF"===o(0))if("WAVE"===o(8)&&"fmt "===o(12)){for(var i=n.getInt32(16,!0),s=n.getUint16(22,!0),c=n.getUint32(24,!0),u=n.getUint16(34,!0),p=36+Math.max(i-16,0);"data"!==o(p);p+=2)if(p>504)return void r.reject("Invalid WAV header in file, data block was not found");e.privHeaderEnd=p+8,r.resolve(a.AudioStreamFormat.getWaveFormatPCM(c,u,s))}else r.reject("Invalid WAV header in file, WAVEfmt was not found");else r.reject("Invalid WAV header in file, RIFF was not found")};if("undefined"!=typeof window&&"undefined"!=typeof Blob&&t instanceof Blob){var o=new FileReader;o.onload=function(e){var t=e.target.result;n(t)},o.readAsArrayBuffer(t)}else{var i=t;n(i.buffer.slice(i.byteOffset,i.byteOffset+i.byteLength))}return r.promise},e.prototype.upload=function(e){return n(this,void 0,void 0,(function(){var t,r,n,i,a,c,u,p,l=this;return o(this,(function(o){switch(o.label){case 0:t=function(t){var r="Error occurred while processing '"+l.privFilename+"'. "+t;throw l.onEvent(new s.AudioStreamNodeErrorEvent(l.privId,e,r)),new Error(r)},o.label=1;case 1:return o.trys.push([1,4,,5]),[4,this.turnOn()];case 2:return o.sent(),[4,this.privAudioFormatPromise];case 3:return r=o.sent(),n=new s.ChunkedArrayBufferStream(r.avgBytesPerSec/10,e),this.privStreams[e]=n,i=this.privSource.slice(this.privHeaderEnd),a=function(e){n.isClosed||(n.writeStreamChunk({buffer:e,isEnd:!1,timeReceived:Date.now()}),n.close())},"undefined"!=typeof window&&"undefined"!=typeof Blob&&i instanceof Blob?((c=new FileReader).onerror=function(e){t(e.toString())},c.onload=function(e){var t=e.target.result;a(t)},c.readAsArrayBuffer(i)):a((u=i).buffer.slice(u.byteOffset,u.byteOffset+u.byteLength)),[2,n];case 4:return p=o.sent(),t(p),[3,5];case 5:return[2]}}))}))},e}();t.FileAudioSource=c},5021:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},9161:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function s(e){try{c(n.next(e))}catch(e){i(e)}}function a(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var r,n,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,n=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.MicAudioSource=t.AudioWorkletSourceURLPropertyName=void 0;var i=r(21),s=r(2370),a=r(1891);t.AudioWorkletSourceURLPropertyName="MICROPHONE-WorkletSourceUrl";var c=function(){function e(t,r,i,c){var u=this;this.privRecorder=t,this.deviceId=r,this.privStreams={},this.turnOn=function(){if(u.privInitializeDeferral)return u.privInitializeDeferral.promise;u.privInitializeDeferral=new s.Deferred;try{u.createAudioContext()}catch(t){if(t instanceof Error){var e=t;u.privInitializeDeferral.reject(e.name+": "+e.message)}else u.privInitializeDeferral.reject(t);return u.privInitializeDeferral.promise}var t=window.navigator,r=t.getUserMedia||t.webkitGetUserMedia||t.mozGetUserMedia||t.msGetUserMedia;if(t.mediaDevices&&(r=function(e,r,n){t.mediaDevices.getUserMedia(e).then(r).catch(n)}),r){var n=function(){u.onEvent(new s.AudioSourceInitializingEvent(u.privId)),u.privMediaStream&&u.privMediaStream.active?(u.onEvent(new s.AudioSourceReadyEvent(u.privId)),u.privInitializeDeferral.resolve()):r({audio:!u.deviceId||{deviceId:u.deviceId},video:!1},(function(e){u.privMediaStream=e,u.onEvent(new s.AudioSourceReadyEvent(u.privId)),u.privInitializeDeferral.resolve()}),(function(e){var t="Error occurred during microphone initialization: "+e;u.privInitializeDeferral.reject(t),u.onEvent(new s.AudioSourceErrorEvent(u.privId,t))}))};"suspended"===u.privContext.state?u.privContext.resume().then(n).catch((function(e){u.privInitializeDeferral.reject("Failed to initialize audio context: "+e)})):n()}else{var o="Browser does not support getUserMedia.";u.privInitializeDeferral.reject(o),u.onEvent(new s.AudioSourceErrorEvent(o,""))}return u.privInitializeDeferral.promise},this.id=function(){return u.privId},this.attach=function(e){return u.onEvent(new s.AudioStreamNodeAttachingEvent(u.privId,e)),u.listen(e).then((function(t){return u.onEvent(new s.AudioStreamNodeAttachedEvent(u.privId,e)),{detach:function(){return n(u,void 0,void 0,(function(){return o(this,(function(r){return t.readEnded(),delete this.privStreams[e],this.onEvent(new s.AudioStreamNodeDetachedEvent(this.privId,e)),[2,this.turnOff()]}))}))},id:function(){return e},read:function(){return t.read()}}}))},this.detach=function(e){e&&u.privStreams[e]&&(u.privStreams[e].close(),delete u.privStreams[e],u.onEvent(new s.AudioStreamNodeDetachedEvent(u.privId,e)))},this.listen=function(e){return n(u,void 0,void 0,(function(){var t;return o(this,(function(r){switch(r.label){case 0:return[4,this.turnOn()];case 1:r.sent(),t=new s.ChunkedArrayBufferStream(this.privOutputChunkSize,e),this.privStreams[e]=t;try{this.privRecorder.record(this.privContext,this.privMediaStream,t)}catch(t){throw this.onEvent(new s.AudioStreamNodeErrorEvent(this.privId,e,t)),t}return[2,t]}}))}))},this.onEvent=function(e){u.privEvents.onEvent(e),s.Events.instance.onEvent(e)},this.createAudioContext=function(){u.privContext||(u.privContext=a.AudioStreamFormatImpl.getAudioContext(e.AUDIOFORMAT.samplesPerSec))},this.privOutputChunkSize=e.AUDIOFORMAT.avgBytesPerSec/10,this.privId=i||s.createNoDashGuid(),this.privEvents=new s.EventSource,this.privMediaStream=c||null}return Object.defineProperty(e.prototype,"format",{get:function(){return Promise.resolve(e.AUDIOFORMAT)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"blob",{get:function(){return Promise.reject("Not implemented for Mic input")},enumerable:!1,configurable:!0}),e.prototype.turnOff=function(){return n(this,void 0,void 0,(function(){var e,t;return o(this,(function(r){switch(r.label){case 0:for(e in this.privStreams)e&&(t=this.privStreams[e])&&t.close();return this.onEvent(new s.AudioSourceOffEvent(this.privId)),this.privInitializeDeferral?[4,this.privInitializeDeferral]:[3,2];case 1:r.sent(),this.privInitializeDeferral=null,r.label=2;case 2:return[4,this.destroyAudioContext()];case 3:return r.sent(),[2]}}))}))},Object.defineProperty(e.prototype,"events",{get:function(){return this.privEvents},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"deviceInfo",{get:function(){return this.getMicrophoneLabel().then((function(t){return{bitspersample:e.AUDIOFORMAT.bitsPerSample,channelcount:e.AUDIOFORMAT.channels,connectivity:i.connectivity.Unknown,manufacturer:"Speech SDK",model:t,samplerate:e.AUDIOFORMAT.samplesPerSec,type:i.type.Microphones}}))},enumerable:!1,configurable:!0}),e.prototype.setProperty=function(e,r){if(e!==t.AudioWorkletSourceURLPropertyName)throw new Error("Property '"+e+"' is not supported on Microphone.");this.privRecorder.setWorkletUrl(r)},e.prototype.getMicrophoneLabel=function(){var e=this,t="microphone";if(void 0!==this.privMicrophoneLabel)return Promise.resolve(this.privMicrophoneLabel);if(void 0===this.privMediaStream||!this.privMediaStream.active)return Promise.resolve(t);this.privMicrophoneLabel=t;var r=this.privMediaStream.getTracks()[0].getSettings().deviceId;if(void 0===r)return Promise.resolve(this.privMicrophoneLabel);var n=new s.Deferred;return navigator.mediaDevices.enumerateDevices().then((function(t){for(var o=0,i=t;o<i.length;o++){var s=i[o];if(s.deviceId===r){e.privMicrophoneLabel=s.label;break}}n.resolve(e.privMicrophoneLabel)}),(function(){return n.resolve(e.privMicrophoneLabel)})),n.promise},e.prototype.destroyAudioContext=function(){return n(this,void 0,void 0,(function(){var e;return o(this,(function(t){switch(t.label){case 0:return this.privContext?(this.privRecorder.releaseMediaResources(this.privContext),e=!1,"close"in this.privContext&&(e=!0),e?[4,this.privContext.close()]:[3,2]):[2];case 1:return t.sent(),this.privContext=null,[3,4];case 2:return null===this.privContext||"running"!==this.privContext.state?[3,4]:[4,this.privContext.suspend()];case 3:t.sent(),t.label=4;case 4:return[2]}}))}))},e.AUDIOFORMAT=a.AudioStreamFormat.getDefaultInputFormat(),e}();t.MicAudioSource=c},9e3:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PcmRecorder=void 0;var n=r(2370),o=function(){function e(){var e=this;this.record=function(t,r,o){var i=function(){var e=0;try{return t.createScriptProcessor(e,1,1)}catch(n){e=2048;for(var r=t.sampleRate;e<16384&&r>=32e3;)e<<=1,r>>=1;return t.createScriptProcessor(e,1,1)}}(),s=new n.RiffPcmEncoder(t.sampleRate,16e3);i.onaudioprocess=function(e){var t=e.inputBuffer.getChannelData(0);if(o&&!o.isClosed){var r=s.encode(t);r&&o.writeStreamChunk({buffer:r,isEnd:!1,timeReceived:Date.now()})}};var a=t.createMediaStreamSource(r);e.privSpeechProcessorScript&&t.audioWorklet?t.audioWorklet.addModule(e.privSpeechProcessorScript).then((function(){var n=new AudioWorkletNode(t,"speech-processor");n.port.onmessage=function(e){var t=e.data;if(o&&!o.isClosed){var r=s.encode(t);r&&o.writeStreamChunk({buffer:r,isEnd:!1,timeReceived:Date.now()})}},a.connect(n),n.connect(t.destination),e.privMediaResources={scriptProcessorNode:n,source:a,stream:r}})).catch((function(){a.connect(i),i.connect(t.destination),e.privMediaResources={scriptProcessorNode:i,source:a,stream:r}})):(a.connect(i),i.connect(t.destination),e.privMediaResources={scriptProcessorNode:i,source:a,stream:r})},this.releaseMediaResources=function(t){e.privMediaResources&&(e.privMediaResources.scriptProcessorNode&&(e.privMediaResources.scriptProcessorNode.disconnect(t.destination),e.privMediaResources.scriptProcessorNode=null),e.privMediaResources.source&&(e.privMediaResources.source.disconnect(),e.privMediaResources.stream.getTracks().forEach((function(e){return e.stop()})),e.privMediaResources.source=null))}}return e.prototype.setWorkletUrl=function(e){this.privSpeechProcessorScript=e},e}();t.PcmRecorder=o},6850:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ProxyInfo=void 0;var n=r(9480),o=function(){function e(e,t,r,n){this.privProxyHostName=e,this.privProxyPort=t,this.privProxyUserName=r,this.privProxyPassword=n}return e.fromParameters=function(t){return new e(t.getProperty(n.PropertyId.SpeechServiceConnection_ProxyHostName),parseInt(t.getProperty(n.PropertyId.SpeechServiceConnection_ProxyPort),10),t.getProperty(n.PropertyId.SpeechServiceConnection_ProxyUserName),t.getProperty(n.PropertyId.SpeechServiceConnection_ProxyPassword))},e.fromRecognizerConfig=function(e){return this.fromParameters(e.parameters)},Object.defineProperty(e.prototype,"HostName",{get:function(){return this.privProxyHostName},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"Port",{get:function(){return this.privProxyPort},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"UserName",{get:function(){return this.privProxyUserName},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"Password",{get:function(){return this.privProxyPassword},enumerable:!1,configurable:!0}),e}();t.ProxyInfo=o},7850:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ReplayableAudioNode=void 0;var r=function(){function e(e,t){var r=this;this.privBuffers=[],this.privReplayOffset=0,this.privLastShrinkOffset=0,this.privBufferStartOffset=0,this.privBufferSerial=0,this.privBufferedBytes=0,this.privReplay=!1,this.privLastChunkAcquiredTime=0,this.id=function(){return r.privAudioNode.id()},this.privAudioNode=e,this.privBytesPerSecond=t}return e.prototype.read=function(){var e=this;if(this.privReplay&&0!==this.privBuffers.length){var t=this.privReplayOffset-this.privBufferStartOffset,r=Math.round(t*this.privBytesPerSecond*1e-7);0!=r%2&&r++;for(var o=0;o<this.privBuffers.length&&r>=this.privBuffers[o].chunk.buffer.byteLength;)r-=this.privBuffers[o++].chunk.buffer.byteLength;if(o<this.privBuffers.length){var i=this.privBuffers[o].chunk.buffer.slice(r);return this.privReplayOffset+=i.byteLength/this.privBytesPerSecond*1e7,o===this.privBuffers.length-1&&(this.privReplay=!1),Promise.resolve({buffer:i,isEnd:!1,timeReceived:this.privBuffers[o].chunk.timeReceived})}}return this.privAudioNode.read().then((function(t){return t&&t.buffer&&(e.privBuffers.push(new n(t,e.privBufferSerial++,e.privBufferedBytes)),e.privBufferedBytes+=t.buffer.byteLength),t}))},e.prototype.detach=function(){return this.privBuffers=void 0,this.privAudioNode.detach()},e.prototype.replay=function(){this.privBuffers&&0!==this.privBuffers.length&&(this.privReplay=!0,this.privReplayOffset=this.privLastShrinkOffset)},e.prototype.shrinkBuffers=function(e){if(void 0!==this.privBuffers&&0!==this.privBuffers.length){this.privLastShrinkOffset=e;for(var t=e-this.privBufferStartOffset,r=Math.round(t*this.privBytesPerSecond*1e-7),n=0;n<this.privBuffers.length&&r>=this.privBuffers[n].chunk.buffer.byteLength;)r-=this.privBuffers[n++].chunk.buffer.byteLength;this.privBufferStartOffset=Math.round(e-r/this.privBytesPerSecond*1e7),this.privBuffers=this.privBuffers.slice(n)}},e.prototype.findTimeAtOffset=function(e){if(e<this.privBufferStartOffset||void 0===this.privBuffers)return 0;for(var t=0,r=this.privBuffers;t<r.length;t++){var n=r[t],o=n.byteOffset/this.privBytesPerSecond*1e7,i=o+n.chunk.buffer.byteLength/this.privBytesPerSecond*1e7;if(e>=o&&e<=i)return n.chunk.timeReceived}return 0},e}();t.ReplayableAudioNode=r;var n=function(e,t,r){this.chunk=e,this.serial=t,this.byteOffset=r}},5597:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RestConfigBase=void 0;var r=function(){function e(){}return Object.defineProperty(e,"requestOptions",{get:function(){return e.privDefaultRequestOptions},enumerable:!1,configurable:!0}),Object.defineProperty(e,"configParams",{get:function(){return e.privDefaultParams},enumerable:!1,configurable:!0}),Object.defineProperty(e,"restErrors",{get:function(){return e.privRestErrors},enumerable:!1,configurable:!0}),e.privDefaultRequestOptions={headers:{Accept:"application/json"},ignoreCache:!1,timeout:1e4},e.privRestErrors={authInvalidSubscriptionKey:"You must specify either an authentication token to use, or a Cognitive Speech subscription key.",authInvalidSubscriptionRegion:"You must specify the Cognitive Speech region to use.",invalidArgs:"Required input not found: {arg}.",invalidCreateJoinConversationResponse:"Creating/Joining conversation failed with HTTP {status}.",invalidParticipantRequest:"The requested participant was not found.",permissionDeniedConnect:"Required credentials not found.",permissionDeniedConversation:"Invalid operation: only the host can {command} the conversation.",permissionDeniedParticipant:"Invalid operation: only the host can {command} a participant.",permissionDeniedSend:"Invalid operation: the conversation is not in a connected state.",permissionDeniedStart:"Invalid operation: there is already an active conversation."},e.privDefaultParams={apiVersion:"api-version",authorization:"Authorization",clientAppId:"X-ClientAppId",contentTypeKey:"Content-Type",correlationId:"X-CorrelationId",languageCode:"language",nickname:"nickname",profanity:"profanity",requestId:"X-RequestId",roomId:"roomid",sessionToken:"token",subscriptionKey:"Ocp-Apim-Subscription-Key",subscriptionRegion:"Ocp-Apim-Subscription-Region",token:"X-CapitoToken"},e}();t.RestConfigBase=r},1297:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.hasOwnProperty.call(e,r)&&n(t,e,r);return o(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.RestMessageAdapter=t.RestRequestType=void 0;var s,a=r(2370),c=i(r(4715));!function(e){e.Get="get",e.Post="post",e.Delete="delete",e.File="file"}(s=t.RestRequestType||(t.RestRequestType={}));var u=function(){function e(e,t){if(!e)throw new a.ArgumentNullError("configParams");this.privHeaders=e.headers,this.privTimeout=e.timeout,this.privIgnoreCache=e.ignoreCache}return e.prototype.setHeaders=function(e,t){this.privHeaders[e]=t},e.prototype.request=function(e,t,r,n,o){var i=this;void 0===r&&(r={}),void 0===n&&(n=null),void 0===o&&(o=null);var u,p=new a.Deferred;u="undefined"==typeof XMLHttpRequest?new c.XMLHttpRequest:new XMLHttpRequest;var l=e===s.File?"post":e;return u.open(l,this.withQuery(t,r),!0),this.privHeaders&&Object.keys(this.privHeaders).forEach((function(e){return u.setRequestHeader(e,i.privHeaders[e])})),this.privIgnoreCache&&u.setRequestHeader("Cache-Control","no-cache"),u.timeout=this.privTimeout,u.onload=function(){p.resolve(i.parseXHRResult(u))},u.onerror=function(){p.resolve(i.errorResponse(u,"Failed to make request."))},u.ontimeout=function(){p.resolve(i.errorResponse(u,"Request took longer than expected."))},e===s.File&&o?(u.setRequestHeader("Content-Type","multipart/form-data"),u.send(o)):e===s.Post&&n?(u.setRequestHeader("Content-Type","application/json"),u.send(JSON.stringify(n))):u.send(),p.promise},e.prototype.parseXHRResult=function(e){return{data:e.responseText,headers:e.getAllResponseHeaders(),json:function(){return JSON.parse(e.responseText)},ok:e.status>=200&&e.status<300,status:e.status,statusText:e.statusText}},e.prototype.errorResponse=function(e,t){return void 0===t&&(t=null),{data:t||e.statusText,headers:e.getAllResponseHeaders(),json:function(){return JSON.parse(t||'"'+e.statusText+'"')},ok:!1,status:e.status,statusText:e.statusText}},e.prototype.withQuery=function(e,t){void 0===t&&(t={});var r=this.queryParams(t);return r?e+(-1===e.indexOf("?")?"?":"&")+r:e},e.prototype.queryParams=function(e){return void 0===e&&(e={}),Object.keys(e).map((function(t){return encodeURIComponent(t)+"="+encodeURIComponent(e[t])})).join("&")},e}();t.RestMessageAdapter=u},784:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function s(e){try{c(n.next(e))}catch(e){i(e)}}function a(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var r,n,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,n=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.WebsocketConnection=void 0;var i=r(2370),s=r(8333),a=function(){function e(e,t,r,n,o,a,c){var u=this;if(void 0===a&&(a=!1),this.privIsDisposed=!1,this.isDisposed=function(){return u.privIsDisposed},this.state=function(){return u.privConnectionMessageAdapter.state},this.open=function(){return u.privConnectionMessageAdapter.open()},this.send=function(e){return u.privConnectionMessageAdapter.send(e)},this.read=function(){return u.privConnectionMessageAdapter.read()},!e)throw new i.ArgumentNullError("uri");if(!n)throw new i.ArgumentNullError("messageFormatter");this.privMessageFormatter=n;var p="",l=0;if(t)for(var f in t)f&&(p+=0===l&&-1===e.indexOf("?")?"?":"&",p+=f+"="+encodeURIComponent(t[f]),l++);if(r)for(var h in r)h&&(p+=0===l&&-1===e.indexOf("?")?"?":"&",p+=h+"="+encodeURIComponent(r[h]),l++);this.privUri=e+p,this.privId=c||i.createNoDashGuid(),this.privConnectionMessageAdapter=new s.WebsocketMessageAdapter(this.privUri,this.id,this.privMessageFormatter,o,r,a)}return e.prototype.dispose=function(){return n(this,void 0,void 0,(function(){return o(this,(function(e){switch(e.label){case 0:return this.privIsDisposed=!0,this.privConnectionMessageAdapter?[4,this.privConnectionMessageAdapter.close()]:[3,2];case 1:e.sent(),e.label=2;case 2:return[2]}}))}))},Object.defineProperty(e.prototype,"id",{get:function(){return this.privId},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"events",{get:function(){return this.privConnectionMessageAdapter.events},enumerable:!1,configurable:!0}),e}();t.WebsocketConnection=a},8333:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function s(e){try{c(n.next(e))}catch(e){i(e)}}function a(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var r,n,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,n=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.WebsocketMessageAdapter=void 0;var s=r(1562),a=r(2370),c=i(r(8018)),u=r(8109),p=function(){function e(t,r,n,o,i,p){var l=this;if(this.open=function(){if(l.privConnectionState===a.ConnectionState.Disconnected)return Promise.reject("Cannot open a connection that is in "+l.privConnectionState+" state");if(l.privConnectionEstablishDeferral)return l.privConnectionEstablishDeferral.promise;l.privConnectionEstablishDeferral=new a.Deferred,l.privCertificateValidatedDeferral=new a.Deferred,l.privConnectionState=a.ConnectionState.Connecting;try{if("undefined"==typeof WebSocket||e.forceNpmWebSocket){var t={headers:l.privHeaders,perMessageDeflate:l.privEnableCompression};l.privCertificateValidatedDeferral.resolve();var r=new u.CertCheckAgent(l.proxyInfo);t.agent=r.GetAgent(),l.privWebsocketClient=new c.default(l.privUri,t)}else l.privCertificateValidatedDeferral.resolve(),l.privWebsocketClient=new WebSocket(l.privUri);l.privWebsocketClient.binaryType="arraybuffer",l.privReceivingMessageQueue=new a.Queue,l.privDisconnectDeferral=new a.Deferred,l.privSendMessageQueue=new a.Queue,l.processSendQueue().catch((function(e){a.Events.instance.onEvent(new a.BackgroundEvent(e))}))}catch(e){return l.privConnectionEstablishDeferral.resolve(new a.ConnectionOpenResponse(500,e)),l.privConnectionEstablishDeferral.promise}return l.onEvent(new a.ConnectionStartEvent(l.privConnectionId,l.privUri)),l.privWebsocketClient.onopen=function(e){l.privCertificateValidatedDeferral.promise.then((function(){l.privConnectionState=a.ConnectionState.Connected,l.onEvent(new a.ConnectionEstablishedEvent(l.privConnectionId)),l.privConnectionEstablishDeferral.resolve(new a.ConnectionOpenResponse(200,""))}),(function(e){l.privConnectionEstablishDeferral.reject(e)}))},l.privWebsocketClient.onerror=function(e){l.onEvent(new a.ConnectionErrorEvent(l.privConnectionId,e.message,e.type)),l.privLastErrorReceived=e.message},l.privWebsocketClient.onclose=function(e){l.privConnectionState===a.ConnectionState.Connecting?(l.privConnectionState=a.ConnectionState.Disconnected,l.privConnectionEstablishDeferral.resolve(new a.ConnectionOpenResponse(e.code,e.reason+" "+l.privLastErrorReceived))):(l.privConnectionState=a.ConnectionState.Disconnected,l.privWebsocketClient=null,l.onEvent(new a.ConnectionClosedEvent(l.privConnectionId,e.code,e.reason))),l.onClose(e.code,e.reason).catch((function(e){a.Events.instance.onEvent(new a.BackgroundEvent(e))}))},l.privWebsocketClient.onmessage=function(e){var t=(new Date).toISOString();if(l.privConnectionState===a.ConnectionState.Connected){var r=new a.Deferred;if(l.privReceivingMessageQueue.enqueueFromPromise(r.promise),e.data instanceof ArrayBuffer){var n=new a.RawWebsocketMessage(a.MessageType.Binary,e.data);l.privMessageFormatter.toConnectionMessage(n).then((function(e){l.onEvent(new a.ConnectionMessageReceivedEvent(l.privConnectionId,t,e)),r.resolve(e)}),(function(e){r.reject("Invalid binary message format. Error: "+e)}))}else n=new a.RawWebsocketMessage(a.MessageType.Text,e.data),l.privMessageFormatter.toConnectionMessage(n).then((function(e){l.onEvent(new a.ConnectionMessageReceivedEvent(l.privConnectionId,t,e)),r.resolve(e)}),(function(e){r.reject("Invalid text message format. Error: "+e)}))}},l.privConnectionEstablishDeferral.promise},this.send=function(e){if(l.privConnectionState!==a.ConnectionState.Connected)return Promise.reject("Cannot send on connection that is in "+a.ConnectionState[l.privConnectionState]+" state");var t=new a.Deferred,r=new a.Deferred;return l.privSendMessageQueue.enqueueFromPromise(r.promise),l.privMessageFormatter.fromConnectionMessage(e).then((function(n){r.resolve({Message:e,RawWebsocketMessage:n,sendStatusDeferral:t})}),(function(e){r.reject("Error formatting the message. "+e)})),t.promise},this.read=function(){return l.privConnectionState!==a.ConnectionState.Connected?Promise.reject("Cannot read on connection that is in "+l.privConnectionState+" state"):l.privReceivingMessageQueue.dequeue()},this.close=function(e){return l.privWebsocketClient?(l.privConnectionState!==a.ConnectionState.Disconnected&&l.privWebsocketClient.close(1e3,e||"Normal closure by client"),l.privDisconnectDeferral.promise):Promise.resolve()},this.sendRawMessage=function(e){try{return e?(l.onEvent(new a.ConnectionMessageSentEvent(l.privConnectionId,(new Date).toISOString(),e.Message)),l.isWebsocketOpen?(l.privWebsocketClient.send(e.RawWebsocketMessage.payload),Promise.resolve()):Promise.reject("websocket send error: Websocket not ready "+l.privConnectionId+" "+e.Message.id+" "+(new Error).stack)):Promise.resolve()}catch(e){return Promise.reject("websocket send error: "+e)}},this.onEvent=function(e){l.privConnectionEvents.onEvent(e),a.Events.instance.onEvent(e)},!t)throw new a.ArgumentNullError("uri");if(!n)throw new a.ArgumentNullError("messageFormatter");this.proxyInfo=o,this.privConnectionEvents=new a.EventSource,this.privConnectionId=r,this.privMessageFormatter=n,this.privConnectionState=a.ConnectionState.None,this.privUri=t,this.privHeaders=i,this.privEnableCompression=p,this.privHeaders[s.HeaderNames.ConnectionId]=this.privConnectionId,this.privLastErrorReceived=""}return Object.defineProperty(e.prototype,"state",{get:function(){return this.privConnectionState},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"events",{get:function(){return this.privConnectionEvents},enumerable:!1,configurable:!0}),e.prototype.onClose=function(e,t){return n(this,void 0,void 0,(function(){var r;return o(this,(function(n){switch(n.label){case 0:return r="Connection closed. "+e+": "+t,this.privConnectionState=a.ConnectionState.Disconnected,this.privDisconnectDeferral.resolve(),[4,this.privReceivingMessageQueue.drainAndDispose((function(e){}),r)];case 1:return n.sent(),[4,this.privSendMessageQueue.drainAndDispose((function(e){e.sendStatusDeferral.reject(r)}),r)];case 2:return n.sent(),[2]}}))}))},e.prototype.processSendQueue=function(){return n(this,void 0,void 0,(function(){var e,t;return o(this,(function(r){switch(r.label){case 0:return[4,this.privSendMessageQueue.dequeue()];case 1:if(!(e=r.sent()))return[2];r.label=2;case 2:return r.trys.push([2,4,,5]),[4,this.sendRawMessage(e)];case 3:return r.sent(),e.sendStatusDeferral.resolve(),[3,5];case 4:return t=r.sent(),e.sendStatusDeferral.reject(t),[3,5];case 5:return[3,0];case 6:return[2]}}))}))},Object.defineProperty(e.prototype,"isWebsocketOpen",{get:function(){return this.privWebsocketClient&&this.privWebsocketClient.readyState===this.privWebsocketClient.OPEN},enumerable:!1,configurable:!0}),e.forceNpmWebSocket=!1,e}();t.WebsocketMessageAdapter=p},6500:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AddedLmIntent=void 0;t.AddedLmIntent=function(e,t){this.modelImpl=e,this.intentName=t}},9636:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AgentConfig=void 0;var r=function(){function e(){}return e.prototype.toJsonString=function(){return JSON.stringify(this.iPrivConfig)},e.prototype.get=function(){return this.iPrivConfig},e.prototype.set=function(e){this.iPrivConfig=e},e}();t.AgentConfig=r},5505:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CognitiveSubscriptionKeyAuthentication=void 0;var n=r(2370),o=r(1562),i=r(2483);t.CognitiveSubscriptionKeyAuthentication=function(e){var t=this;if(this.fetch=function(e){return Promise.resolve(t.privAuthInfo)},this.fetchOnExpiry=function(e){return Promise.resolve(t.privAuthInfo)},!e)throw new n.ArgumentNullError("subscriptionKey");this.privAuthInfo=new i.AuthInfo(o.HeaderNames.AuthKey,e)}},7835:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CognitiveTokenAuthentication=void 0;var n=r(2370),o=r(2483),i="Authorization";t.CognitiveTokenAuthentication=function(e,t){var r=this;if(this.fetch=function(e){return r.privFetchCallback(e).then((function(e){return new o.AuthInfo(i,e)}))},this.fetchOnExpiry=function(e){return r.privFetchOnExpiryCallback(e).then((function(e){return new o.AuthInfo(i,e)}))},!e)throw new n.ArgumentNullError("fetchCallback");if(!t)throw new n.ArgumentNullError("fetchOnExpiryCallback");this.privFetchCallback=e,this.privFetchOnExpiryCallback=t}},4216:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ConnectionFactoryBase=void 0;var n=r(21),o=r(9480),i=r(9291),s=function(){function e(){}return e.prototype.setCommonUrlParams=function(e,t,r){this.setUrlParameter(o.PropertyId.SpeechServiceConnection_EnableAudioLogging,i.QueryParameterNames.EnableAudioLogging,e,t,r),this.setUrlParameter(o.PropertyId.SpeechServiceResponse_RequestWordLevelTimestamps,i.QueryParameterNames.EnableWordLevelTimestamps,e,t,r),this.setUrlParameter(o.PropertyId.SpeechServiceResponse_ProfanityOption,i.QueryParameterNames.Profanity,e,t,r),this.setUrlParameter(o.PropertyId.SpeechServiceConnection_InitialSilenceTimeoutMs,i.QueryParameterNames.InitialSilenceTimeoutMs,e,t,r),this.setUrlParameter(o.PropertyId.SpeechServiceConnection_EndSilenceTimeoutMs,i.QueryParameterNames.EndSilenceTimeoutMs,e,t,r),this.setUrlParameter(o.PropertyId.SpeechServiceResponse_StablePartialResultThreshold,i.QueryParameterNames.StableIntermediateThreshold,e,t,r);var s=JSON.parse(e.parameters.getProperty(n.ServicePropertiesPropertyName,"{}"));Object.keys(s).forEach((function(e,r,n){t[e]=s[e]}))},e.prototype.setUrlParameter=function(e,t,r,n,o){var i=r.parameters.getProperty(e,void 0);!i||o&&-1!==o.search(t)||(n[t]=i.toLocaleLowerCase())},e}();t.ConnectionFactoryBase=s},7589:function(e,t,r){"use strict";var n,o=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},n(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.DialogConnectionFactory=void 0;var i=r(6340),s=r(21),a=r(9480),c=r(4216),u=r(21),p=r(1562),l=r(9291),f=function(e){function t(){var r=null!==e&&e.apply(this,arguments)||this;return r.create=function(e,n,o){var c=e.parameters.getProperty(a.PropertyId.Conversation_ApplicationId,""),f=e.parameters.getProperty(a.PropertyId.Conversation_DialogType),h=e.parameters.getProperty(a.PropertyId.SpeechServiceConnection_Region),v=e.parameters.getProperty(a.PropertyId.SpeechServiceConnection_RecoLanguage,"en-US"),d=e.parameters.getProperty(a.PropertyId.Conversation_Request_Bot_Status_Messages,"true"),y={};y[p.HeaderNames.ConnectionId]=o,y[l.QueryParameterNames.Format]=e.parameters.getProperty(s.OutputFormatPropertyName,a.OutputFormat[a.OutputFormat.Simple]).toLowerCase(),y[l.QueryParameterNames.Language]=v,y[l.QueryParameterNames.RequestBotStatusMessages]=d,c&&(y[l.QueryParameterNames.BotId]=c,f===a.DialogServiceConfig.DialogTypes.CustomCommands&&(y[p.HeaderNames.CustomCommandsAppId]=c));var g=f===a.DialogServiceConfig.DialogTypes.CustomCommands?"commands/":"",m=f===a.DialogServiceConfig.DialogTypes.CustomCommands?"v1":f===a.DialogServiceConfig.DialogTypes.BotFramework?"v3":"v0",b={};null!=n.token&&""!==n.token&&(b[n.headerName]=n.token);var S=e.parameters.getProperty(a.PropertyId.SpeechServiceConnection_Endpoint,"");if(!S){var P=h&&h.toLowerCase().startsWith("china")?".azure.cn":".microsoft.com",C=e.parameters.getProperty(a.PropertyId.SpeechServiceConnection_Host,"wss://"+h+"."+t.Constants.BaseUrl+P);S=""+(C.endsWith("/")?C:C+"/")+g+t.Constants.ApiKey+"/"+m}r.setCommonUrlParams(e,y,S);var w="true"===e.parameters.getProperty("SPEECH-EnableWebsocketCompression","false");return new i.WebsocketConnection(S,y,b,new u.WebsocketMessageFormatter,i.ProxyInfo.fromRecognizerConfig(e),w,o)},r}var r;return o(t,e),t.Constants=((r=function(){}).ApiKey="api",r.BaseUrl="convai.speech",r),t}(c.ConnectionFactoryBase);t.DialogConnectionFactory=f},7244:function(e,t,r){"use strict";var n,o=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},n(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),i=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function s(e){try{c(n.next(e))}catch(e){i(e)}}function a(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))},s=this&&this.__generator||function(e,t){var r,n,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,n=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.DialogServiceAdapter=void 0;var a=r(6340),c=r(7748),u=r(2370),p=r(5019),l=r(9480),f=r(7563),h=r(21),v=r(6498),d=r(4921),y=function(e){function t(t,r,n,o,a){var h=e.call(this,t,r,n,o,a)||this;return h.sendAgentConfig=function(e){if(h.agentConfig&&!h.agentConfigSent){if(h.privRecognizerConfig.parameters.getProperty(l.PropertyId.Conversation_DialogType)===l.DialogServiceConfig.DialogTypes.CustomCommands){var t=h.agentConfig.get();t.botInfo.commandsCulture=h.privRecognizerConfig.parameters.getProperty(l.PropertyId.SpeechServiceConnection_RecoLanguage,"en-us"),h.agentConfig.set(t)}h.onEvent(new c.SendingAgentContextMessageEvent(h.agentConfig));var r=h.agentConfig.toJsonString();return h.agentConfigSent=!0,e.send(new d.SpeechConnectionMessage(u.MessageType.Text,"agent.config",h.privRequestSession.requestId,"application/json",r))}},h.sendAgentContext=function(e){var t=u.createGuid(),r=h.privDialogServiceConnector.properties.getProperty(l.PropertyId.Conversation_Speech_Activity_Template),n={channelData:"",context:{interactionId:t},messagePayload:void 0===typeof r?void 0:r,version:.5},o=JSON.stringify(n);return e.send(new d.SpeechConnectionMessage(u.MessageType.Text,"speech.agent.context",h.privRequestSession.requestId,"application/json",o))},h.handleResponseMessage=function(e){var t=JSON.parse(e.textBody);switch(t.messageType.toLowerCase()){case"message":var r=e.requestId.toUpperCase(),n=v.ActivityPayloadResponse.fromJSON(e.textBody),o=h.privTurnStateManager.GetTurn(r);if(n.conversationId){var i=h.agentConfig.get();i.botInfo.conversationId=n.conversationId,h.agentConfig.set(i)}var s=o.processActivityPayload(n,p.AudioOutputFormatImpl.fromSpeechSynthesisOutputFormatString(h.privDialogServiceConnector.properties.getProperty(l.PropertyId.SpeechServiceConnection_SynthOutputFormat,void 0))),a=new l.ActivityReceivedEventArgs(n.messagePayload,s);if(h.privDialogServiceConnector.activityReceived)try{h.privDialogServiceConnector.activityReceived(h.privDialogServiceConnector,a)}catch(e){}break;case"messagestatus":if(h.privDialogServiceConnector.turnStatusReceived)try{h.privDialogServiceConnector.turnStatusReceived(h.privDialogServiceConnector,new l.TurnStatusReceivedEventArgs(e.textBody))}catch(e){}break;default:u.Events.instance.onEvent(new u.BackgroundEvent("Unexpected response of type "+t.messageType+". Ignoring."))}},h.privEvents=new u.EventSource,h.privDialogServiceConnector=a,h.receiveMessageOverride=h.receiveDialogMessageOverride,h.privTurnStateManager=new f.DialogServiceTurnStateManager,h.recognizeOverride=h.listenOnce,h.postConnectImplOverride=h.dialogConnectImpl,h.configConnectionOverride=h.configConnection,h.disconnectOverride=h.privDisconnect,h.privDialogAudioSource=n,h.agentConfigSent=!1,h.privLastResult=null,h.connectionEvents.attach((function(e){return i(h,void 0,void 0,(function(){return s(this,(function(t){return"ConnectionClosedEvent"===e.name&&(this.terminateMessageLoop=!0),[2]}))}))})),h}return o(t,e),t.prototype.sendMessage=function(e){return i(this,void 0,void 0,(function(){var t,r,n,o;return s(this,(function(i){switch(i.label){case 0:return t=u.createGuid(),r=u.createNoDashGuid(),n={context:{interactionId:t},messagePayload:JSON.parse(e),version:.5},o=JSON.stringify(n),[4,this.fetchConnection()];case 1:return[4,i.sent().send(new d.SpeechConnectionMessage(u.MessageType.Text,"agent",r,"application/json",o))];case 2:return i.sent(),[2]}}))}))},t.prototype.privDisconnect=function(){return i(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.cancelRecognition(this.privRequestSession.sessionId,this.privRequestSession.requestId,l.CancellationReason.Error,l.CancellationErrorCode.NoError,"Disconnecting")];case 1:return e.sent(),this.terminateMessageLoop=!0,this.agentConfigSent=!1,[2]}}))}))},t.prototype.processTypeSpecificMessages=function(e){return i(this,void 0,void 0,(function(){var t,r,n,o,i,a,c,p,f,v,d,y;return s(this,(function(s){switch(t=new l.PropertyCollection,e.messageType===u.MessageType.Text&&t.setProperty(l.PropertyId.SpeechServiceResponse_JsonResult,e.textBody),e.path.toLowerCase()){case"speech.phrase":if(o=h.SimpleSpeechPhrase.fromJSON(e.textBody),this.privRequestSession.onPhraseRecognized(this.privRequestSession.currentTurnAudioOffset+o.Offset+o.Duration),o.RecognitionStatus!==h.RecognitionStatus.TooManyRequests&&o.RecognitionStatus!==h.RecognitionStatus.Error&&(i=this.fireEventForResult(o,t),this.privLastResult=i.result,this.privDialogServiceConnector.recognized))try{this.privDialogServiceConnector.recognized(this.privDialogServiceConnector,i)}catch(e){}n=!0;break;case"speech.hypothesis":if(a=h.SpeechHypothesis.fromJSON(e.textBody),c=a.Offset+this.privRequestSession.currentTurnAudioOffset,r=new l.SpeechRecognitionResult(this.privRequestSession.requestId,l.ResultReason.RecognizingSpeech,a.Text,a.Duration,c,a.Language,a.LanguageDetectionConfidence,void 0,void 0,e.textBody,t),this.privRequestSession.onHypothesis(c),p=new l.SpeechRecognitionEventArgs(r,a.Duration,this.privRequestSession.sessionId),this.privDialogServiceConnector.recognizing)try{this.privDialogServiceConnector.recognizing(this.privDialogServiceConnector,p)}catch(e){}n=!0;break;case"speech.keyword":if(f=h.SpeechKeyword.fromJSON(e.textBody),r=new l.SpeechRecognitionResult(this.privRequestSession.requestId,"Accepted"===f.Status?l.ResultReason.RecognizedKeyword:l.ResultReason.NoMatch,f.Text,f.Duration,f.Offset,void 0,void 0,void 0,void 0,e.textBody,t),"Accepted"!==f.Status&&(this.privLastResult=r),v=new l.SpeechRecognitionEventArgs(r,r.duration,r.resultId),this.privDialogServiceConnector.recognized)try{this.privDialogServiceConnector.recognized(this.privDialogServiceConnector,v)}catch(e){}n=!0;break;case"audio":d=e.requestId.toUpperCase(),y=this.privTurnStateManager.GetTurn(d);try{e.binaryBody?y.audioStream.write(e.binaryBody):y.endAudioStream()}catch(e){}n=!0;break;case"response":this.handleResponseMessage(e),n=!0}return[2,n]}))}))},t.prototype.cancelRecognition=function(e,t,r,n,o){return i(this,void 0,void 0,(function(){var t,i,a;return s(this,(function(s){switch(s.label){case 0:return this.terminateMessageLoop=!0,this.privRequestSession.isRecognizing?[4,this.privRequestSession.onStopRecognizing()]:[3,2];case 1:s.sent(),s.label=2;case 2:if(this.privDialogServiceConnector.canceled){(t=new l.PropertyCollection).setProperty(h.CancellationErrorCodePropertyName,l.CancellationErrorCode[n]),i=new l.SpeechRecognitionCanceledEventArgs(r,o,n,void 0,e);try{this.privDialogServiceConnector.canceled(this.privDialogServiceConnector,i)}catch(e){}if(this.privSuccessCallback){a=new l.SpeechRecognitionResult(void 0,l.ResultReason.Canceled,void 0,void 0,void 0,void 0,void 0,void 0,o,void 0,t);try{this.privSuccessCallback(a),this.privSuccessCallback=void 0}catch(e){}}}return[2]}}))}))},t.prototype.listenOnce=function(e,t,r){return i(this,void 0,void 0,(function(){var n,o,c,u,p,f,h,v,d=this;return s(this,(function(y){switch(y.label){case 0:return this.privRecognizerConfig.recognitionMode=e,this.privSuccessCallback=t,this.privErrorCallback=r,this.privRequestSession.startNewRecognition(),this.privRequestSession.listenForServiceTelemetry(this.privDialogAudioSource.events),this.privRecognizerConfig.parameters.setProperty(l.PropertyId.Speech_SessionId,this.privRequestSession.sessionId),n=this.connectImpl(),o=this.sendPreAudioMessages(),[4,this.privDialogAudioSource.attach(this.privRequestSession.audioNodeId)];case 1:return c=y.sent(),[4,this.privDialogAudioSource.format];case 2:return u=y.sent(),[4,this.privDialogAudioSource.deviceInfo];case 3:return p=y.sent(),f=new a.ReplayableAudioNode(c,u.avgBytesPerSec),[4,this.privRequestSession.onAudioSourceAttachCompleted(f,!1)];case 4:y.sent(),this.privRecognizerConfig.SpeechServiceConfig.Context.audio={source:p},y.label=5;case 5:return y.trys.push([5,8,,10]),[4,n];case 6:return y.sent(),[4,o];case 7:return y.sent(),[3,10];case 8:return h=y.sent(),[4,this.cancelRecognition(this.privRequestSession.sessionId,this.privRequestSession.requestId,l.CancellationReason.Error,l.CancellationErrorCode.ConnectionFailure,h)];case 9:return y.sent(),[2,Promise.resolve()];case 10:return v=new l.SessionEventArgs(this.privRequestSession.sessionId),this.privRecognizer.sessionStarted&&this.privRecognizer.sessionStarted(this.privRecognizer,v),this.sendAudio(f).then((function(){}),(function(e){return i(d,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.cancelRecognition(this.privRequestSession.sessionId,this.privRequestSession.requestId,l.CancellationReason.Error,l.CancellationErrorCode.RuntimeError,e)];case 1:return t.sent(),[2]}}))}))})),[2]}}))}))},t.prototype.dialogConnectImpl=function(e){return this.privConnectionLoop=this.startMessageLoop(),e},t.prototype.receiveDialogMessageOverride=function(){var e=this,t=new u.Deferred,r=function(){return i(e,void 0,void 0,(function(){var e,n,o,i,a,c,p,f,v,y,g,m,b;return s(this,(function(s){switch(s.label){case 0:return s.trys.push([0,12,,13]),e=this.isDisposed(),n=!this.isDisposed()&&this.terminateMessageLoop,e||n?(t.resolve(void 0),[2]):[4,this.fetchConnection()];case 1:return[4,s.sent().read()];case 2:if(!(o=s.sent()))return[2,r()];switch((i=d.SpeechConnectionMessage.fromConnectionMessage(o)).path.toLowerCase()){case"turn.start":return[3,3];case"speech.startdetected":return[3,4];case"speech.enddetected":return[3,5];case"turn.end":return[3,6]}return[3,10];case 3:return a=i.requestId.toUpperCase(),m=this.privRequestSession.requestId.toUpperCase(),a!==m?this.privTurnStateManager.StartTurn(a):this.privRequestSession.onServiceTurnStartResponse(),[3,11];case 4:return c=h.SpeechDetected.fromJSON(i.textBody),p=new l.RecognitionEventArgs(c.Offset,this.privRequestSession.sessionId),this.privRecognizer.speechStartDetected&&this.privRecognizer.speechStartDetected(this.privRecognizer,p),[3,11];case 5:return void 0,f=i.textBody.length>0?i.textBody:"{ Offset: 0 }",v=h.SpeechDetected.fromJSON(f),this.privRequestSession.onServiceRecognized(v.Offset+this.privRequestSession.currentTurnAudioOffset),y=new l.RecognitionEventArgs(v.Offset+this.privRequestSession.currentTurnAudioOffset,this.privRequestSession.sessionId),this.privRecognizer.speechEndDetected&&this.privRecognizer.speechEndDetected(this.privRecognizer,y),[3,11];case 6:return g=i.requestId.toUpperCase(),m=this.privRequestSession.requestId.toUpperCase(),g===m?[3,7]:(this.privTurnStateManager.CompleteTurn(g),[3,9]);case 7:return b=new l.SessionEventArgs(this.privRequestSession.sessionId),[4,this.privRequestSession.onServiceTurnEndResponse(!1)];case 8:if(s.sent(),this.privRecognizerConfig.isContinuousRecognition&&!this.privRequestSession.isSpeechEnded&&this.privRequestSession.isRecognizing||this.privRecognizer.sessionStopped&&this.privRecognizer.sessionStopped(this.privRecognizer,b),this.privSuccessCallback&&this.privLastResult){try{this.privSuccessCallback(this.privLastResult),this.privLastResult=null}catch(e){this.privErrorCallback&&this.privErrorCallback(e)}this.privSuccessCallback=void 0,this.privErrorCallback=void 0}s.label=9;case 9:return[3,11];case 10:this.processTypeSpecificMessages(i)||this.serviceEvents&&this.serviceEvents.onEvent(new u.ServiceEvent(i.path.toLowerCase(),i.textBody)),s.label=11;case 11:return[2,r()];case 12:return s.sent(),this.terminateMessageLoop=!0,t.resolve(),[3,13];case 13:return[2]}}))}))};return r().catch((function(e){u.Events.instance.onEvent(new u.BackgroundEvent(e))})),t.promise},t.prototype.startMessageLoop=function(){return i(this,void 0,void 0,(function(){var e;return s(this,(function(t){switch(t.label){case 0:this.terminateMessageLoop=!1,t.label=1;case 1:return t.trys.push([1,3,,5]),[4,this.receiveDialogMessageOverride()];case 2:return t.sent(),[3,5];case 3:return e=t.sent(),[4,this.cancelRecognition(this.privRequestSession.sessionId,this.privRequestSession.requestId,l.CancellationReason.Error,l.CancellationErrorCode.RuntimeError,e)];case 4:return t.sent(),[3,5];case 5:return[2,Promise.resolve()]}}))}))},t.prototype.configConnection=function(e){return i(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return this.terminateMessageLoop?(this.terminateMessageLoop=!1,[2,Promise.reject("Connection to service terminated.")]):[4,this.sendSpeechServiceConfig(e,this.privRequestSession,this.privRecognizerConfig.SpeechServiceConfig.serialize())];case 1:return t.sent(),[4,this.sendAgentConfig(e)];case 2:return t.sent(),[2,e]}}))}))},t.prototype.sendPreAudioMessages=function(){return i(this,void 0,void 0,(function(){var e;return s(this,(function(t){switch(t.label){case 0:return[4,this.fetchConnection()];case 1:return e=t.sent(),this.addKeywordContextData(),[4,this.sendSpeechContext(e)];case 2:return t.sent(),[4,this.sendAgentContext(e)];case 3:return t.sent(),[4,this.sendWaveHeader(e)];case 4:return t.sent(),[2]}}))}))},t.prototype.fireEventForResult=function(e,t){var r=h.EnumTranslation.implTranslateRecognitionResult(e.RecognitionStatus),n=e.Offset+this.privRequestSession.currentTurnAudioOffset,o=new l.SpeechRecognitionResult(this.privRequestSession.requestId,r,e.DisplayText,e.Duration,n,e.Language,e.LanguageDetectionConfidence,void 0,void 0,JSON.stringify(e),t);return new l.SpeechRecognitionEventArgs(o,n,this.privRequestSession.sessionId)},t.prototype.onEvent=function(e){this.privEvents.onEvent(e),u.Events.instance.onEvent(e)},t.prototype.addKeywordContextData=function(){var e=this.privRecognizerConfig.parameters.getProperty("SPEECH-KeywordsToDetect");if(void 0!==e){for(var t=this.privRecognizerConfig.parameters.getProperty("SPEECH-KeywordsToDetect-Offsets"),r=this.privRecognizerConfig.parameters.getProperty("SPEECH-KeywordsToDetect-Durations"),n=e.split(";"),o=void 0===t?[]:t.split(";"),i=void 0===r?[]:r.split(";"),s=[],a=0;a<n.length;a++){var c={};c.text=n[a],a<o.length&&(c.offset=Number(o[a])),a<i.length&&(c.duration=Number(i[a])),s.push(c)}this.speechContext.setSection("invocationSource","VoiceActivationWithKeyword"),this.speechContext.setSection("keywordDetection",[{clientDetectedKeywords:s,onReject:{action:"EndOfTurn"},type:"startTrigger"}])}},t}(h.ServiceRecognizerBase);t.DialogServiceAdapter=y},3015:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DialogServiceTurnState=void 0;var n=r(5019),o=r(5149),i=r(6498),s=function(){function e(e,t){this.privRequestId=t,this.privIsCompleted=!1,this.privAudioStream=null,this.privTurnManager=e,this.resetTurnEndTimeout()}return Object.defineProperty(e.prototype,"audioStream",{get:function(){return this.resetTurnEndTimeout(),this.privAudioStream},enumerable:!1,configurable:!0}),e.prototype.processActivityPayload=function(e,t){return e.messageDataStreamType===i.MessageDataStreamType.TextToSpeechAudio&&(this.privAudioStream=o.AudioOutputStream.createPullStream(),this.privAudioStream.format=void 0!==t?t:n.AudioOutputFormatImpl.getDefaultOutputFormat()),this.privAudioStream},e.prototype.endAudioStream=function(){null===this.privAudioStream||this.privAudioStream.isClosed||this.privAudioStream.close()},e.prototype.complete=function(){void 0!==this.privTimeoutToken&&clearTimeout(this.privTimeoutToken),this.endAudioStream()},e.prototype.resetTurnEndTimeout=function(){var e=this;void 0!==this.privTimeoutToken&&clearTimeout(this.privTimeoutToken),this.privTimeoutToken=setTimeout((function(){e.privTurnManager.CompleteTurn(e.privRequestId)}),2e3)},e}();t.DialogServiceTurnState=s},7563:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DialogServiceTurnStateManager=void 0;var n=r(128),o=r(3015),i=function(){function e(){this.privTurnMap=new Map}return e.prototype.StartTurn=function(e){if(this.privTurnMap.has(e))throw new n.InvalidOperationError("Service error: There is already a turn with id:"+e);var t=new o.DialogServiceTurnState(this,e);return this.privTurnMap.set(e,t),this.privTurnMap.get(e)},e.prototype.GetTurn=function(e){return this.privTurnMap.get(e)},e.prototype.CompleteTurn=function(e){if(!this.privTurnMap.has(e))throw new n.InvalidOperationError("Service error: Received turn end for an unknown turn id:"+e);var t=this.privTurnMap.get(e);return t.complete(),this.privTurnMap.delete(e),t},e}();t.DialogServiceTurnStateManager=i},4023:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DynamicGrammarBuilder=void 0;var r=function(){function e(){}return e.prototype.addPhrase=function(e){this.privPhrases||(this.privPhrases=[]),e instanceof Array?this.privPhrases=this.privPhrases.concat(e):this.privPhrases.push(e)},e.prototype.clearPhrases=function(){this.privPhrases=void 0},e.prototype.addReferenceGrammar=function(e){this.privGrammars||(this.privGrammars=[]),e instanceof Array?this.privGrammars=this.privGrammars.concat(e):this.privGrammars.push(e)},e.prototype.clearGrammars=function(){this.privGrammars=void 0},e.prototype.generateGrammarObject=function(){if(void 0!==this.privGrammars||void 0!==this.privPhrases){var e={};if(e.ReferenceGrammars=this.privGrammars,void 0!==this.privPhrases&&0!==this.privPhrases.length){var t=[];this.privPhrases.forEach((function(e,r,n){t.push({Text:e})})),e.Groups=[{Type:"Generic",Items:t}]}return e}},e}();t.DynamicGrammarBuilder=r},1039:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},1156:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EnumTranslation=void 0;var n=r(9480),o=r(21),i=function(){function e(){}return e.implTranslateRecognitionResult=function(e){var t=n.ResultReason.Canceled;switch(e){case o.RecognitionStatus.Success:t=n.ResultReason.RecognizedSpeech;break;case o.RecognitionStatus.NoMatch:case o.RecognitionStatus.InitialSilenceTimeout:case o.RecognitionStatus.BabbleTimeout:case o.RecognitionStatus.EndOfDictation:t=n.ResultReason.NoMatch;break;case o.RecognitionStatus.Error:default:t=n.ResultReason.Canceled}return t},e.implTranslateCancelResult=function(e){var t=n.CancellationReason.EndOfStream;switch(e){case o.RecognitionStatus.Success:case o.RecognitionStatus.EndOfDictation:case o.RecognitionStatus.NoMatch:t=n.CancellationReason.EndOfStream;break;case o.RecognitionStatus.InitialSilenceTimeout:case o.RecognitionStatus.BabbleTimeout:case o.RecognitionStatus.Error:default:t=n.CancellationReason.Error}return t},e.implTranslateCancelErrorCode=function(e){var t=n.CancellationErrorCode.NoError;switch(e){case o.RecognitionStatus.Error:t=n.CancellationErrorCode.ServiceError;break;case o.RecognitionStatus.TooManyRequests:t=n.CancellationErrorCode.TooManyRequests;break;default:t=n.CancellationErrorCode.NoError}return t},e}();t.EnumTranslation=i},21:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||t.hasOwnProperty(r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),t.AutoDetectSourceLanguagesOpenRangeOptionName=t.ForceDictationPropertyName=t.ServicePropertiesPropertyName=t.CancellationErrorCodePropertyName=t.OutputFormatPropertyName=void 0,o(r(5505),t),o(r(7835),t),o(r(2483),t),o(r(8961),t),o(r(7038),t),o(r(2546),t),o(r(7903),t),o(r(3257),t),o(r(2663),t),o(r(7534),t),o(r(5652),t),o(r(9266),t),o(r(5399),t),o(r(9195),t),o(r(1708),t),o(r(1156),t),o(r(5989),t),o(r(1550),t),o(r(6082),t),o(r(7814),t),o(r(5266),t),o(r(6147),t),o(r(8395),t),o(r(9257),t),o(r(6247),t),o(r(9358),t),o(r(2640),t),o(r(4168),t),o(r(6500),t),o(r(3358),t),o(r(3789),t),o(r(7959),t),o(r(9843),t),o(r(4023),t),o(r(1039),t),o(r(7244),t),o(r(9636),t),o(r(3603),t),o(r(6969),t),o(r(3990),t),o(r(7147),t),o(r(6113),t),o(r(2464),t),o(r(6725),t),o(r(3750),t),t.OutputFormatPropertyName="OutputFormat",t.CancellationErrorCodePropertyName="CancellationErrorCode",t.ServicePropertiesPropertyName="ServiceProperties",t.ForceDictationPropertyName="ForceDictation",t.AutoDetectSourceLanguagesOpenRangeOptionName="OpenRange"},1562:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.HeaderNames=void 0;var r=function(){function e(){}return e.AuthKey="Ocp-Apim-Subscription-Key",e.ConnectionId="X-ConnectionId",e.ContentType="Content-Type",e.CustomCommandsAppId="X-CommandsAppId",e.Path="Path",e.RequestId="X-RequestId",e.RequestStreamId="X-StreamId",e.RequestTimestamp="X-Timestamp",e}();t.HeaderNames=r},2483:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AuthInfo=void 0;var r=function(){function e(e,t){this.privHeaderName=e,this.privToken=t}return Object.defineProperty(e.prototype,"headerName",{get:function(){return this.privHeaderName},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"token",{get:function(){return this.privToken},enumerable:!1,configurable:!0}),e}();t.AuthInfo=r},8961:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},7038:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},2546:function(e,t,r){"use strict";var n,o=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},n(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.IntentConnectionFactory=void 0;var i=r(6340),s=r(9480),a=r(4216),c=r(21),u=r(1562),p=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.create=function(e,r,n){var o=e.parameters.getProperty(s.PropertyId.SpeechServiceConnection_Endpoint);if(!o){var a=e.parameters.getProperty(s.PropertyId.SpeechServiceConnection_IntentRegion),p=a&&a.toLowerCase().startsWith("china")?".azure.cn":".microsoft.com";o=e.parameters.getProperty(s.PropertyId.SpeechServiceConnection_Host,"wss://"+a+".sr.speech"+p)+"/speech/recognition/interactive/cognitiveservices/v1"}var l={format:"simple",language:e.parameters.getProperty(s.PropertyId.SpeechServiceConnection_RecoLanguage)};t.setCommonUrlParams(e,l,o);var f={};void 0!==r.token&&""!==r.token&&(f[r.headerName]=r.token),f[u.HeaderNames.ConnectionId]=n,e.parameters.setProperty(s.PropertyId.SpeechServiceConnection_Url,o);var h="true"===e.parameters.getProperty("SPEECH-EnableWebsocketCompression","false");return new i.WebsocketConnection(o,l,f,new c.WebsocketMessageFormatter,i.ProxyInfo.fromRecognizerConfig(e),h,n)},t}return o(t,e),t.prototype.getSpeechRegionFromIntentRegion=function(e){switch(e){case"West US":case"US West":case"westus":return"uswest";case"West US 2":case"US West 2":case"westus2":return"uswest2";case"South Central US":case"US South Central":case"southcentralus":return"ussouthcentral";case"West Central US":case"US West Central":case"westcentralus":return"uswestcentral";case"East US":case"US East":case"eastus":return"useast";case"East US 2":case"US East 2":case"eastus2":return"useast2";case"West Europe":case"Europe West":case"westeurope":return"europewest";case"North Europe":case"Europe North":case"northeurope":return"europenorth";case"Brazil South":case"South Brazil":case"southbrazil":return"brazilsouth";case"Australia East":case"East Australia":case"eastaustralia":return"australiaeast";case"Southeast Asia":case"Asia Southeast":case"southeastasia":return"asiasoutheast";case"East Asia":case"Asia East":case"eastasia":return"asiaeast";default:return e}},t}(a.ConnectionFactoryBase);t.IntentConnectionFactory=p},3358:function(e,t,r){"use strict";var n,o=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},n(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),i=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function s(e){try{c(n.next(e))}catch(e){i(e)}}function a(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))},s=this&&this.__generator||function(e,t){var r,n,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,n=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.IntentServiceRecognizer=void 0;var a=r(2370),c=r(9480),u=r(21),p=function(e){function t(t,r,n,o,i){var s=e.call(this,t,r,n,o,i)||this;return s.privIntentRecognizer=i,s.privIntentDataSent=!1,s}return o(t,e),t.prototype.setIntents=function(e,t){this.privAddedLmIntents=e,this.privUmbrellaIntent=t,this.privIntentDataSent=!0},t.prototype.processTypeSpecificMessages=function(e){return i(this,void 0,void 0,(function(){var t,r,n,o,i,p,l,f,h,v,d,y,g=this;return s(this,(function(s){switch(n=!1,o=new c.PropertyCollection,e.messageType===a.MessageType.Text&&o.setProperty(c.PropertyId.SpeechServiceResponse_JsonResult,e.textBody),e.path.toLowerCase()){case"speech.hypothesis":if(i=u.SpeechHypothesis.fromJSON(e.textBody),t=new c.IntentRecognitionResult(void 0,this.privRequestSession.requestId,c.ResultReason.RecognizingIntent,i.Text,i.Duration,i.Offset+this.privRequestSession.currentTurnAudioOffset,i.Language,i.LanguageDetectionConfidence,void 0,e.textBody,o),this.privRequestSession.onHypothesis(t.offset),r=new c.IntentRecognitionEventArgs(t,i.Offset+this.privRequestSession.currentTurnAudioOffset,this.privRequestSession.sessionId),this.privIntentRecognizer.recognizing)try{this.privIntentRecognizer.recognizing(this.privIntentRecognizer,r)}catch(e){}n=!0;break;case"speech.phrase":p=u.SimpleSpeechPhrase.fromJSON(e.textBody),t=new c.IntentRecognitionResult(void 0,this.privRequestSession.requestId,u.EnumTranslation.implTranslateRecognitionResult(p.RecognitionStatus),p.DisplayText,p.Duration,p.Offset+this.privRequestSession.currentTurnAudioOffset,p.Language,p.LanguageDetectionConfidence,void 0,e.textBody,o),r=new c.IntentRecognitionEventArgs(t,t.offset,this.privRequestSession.sessionId),l=function(){if(g.privIntentRecognizer.recognized)try{g.privIntentRecognizer.recognized(g.privIntentRecognizer,r)}catch(e){}if(g.privSuccessCallback){try{g.privSuccessCallback(t)}catch(e){g.privErrorCallback&&g.privErrorCallback(e)}g.privSuccessCallback=void 0,g.privErrorCallback=void 0}},!1===this.privIntentDataSent||c.ResultReason.NoMatch===r.result.reason?(this.privRequestSession.onPhraseRecognized(r.offset+r.result.duration),l()):this.privPendingIntentArgs=r,n=!0;break;case"response":if(r=this.privPendingIntentArgs,this.privPendingIntentArgs=void 0,void 0===r){if(""===e.textBody)return[2];r=new c.IntentRecognitionEventArgs(new c.IntentRecognitionResult,0,this.privRequestSession.sessionId)}if(f=u.IntentResponse.fromJSON(e.textBody),h=this.privAddedLmIntents[f.topScoringIntent.intent],void 0!==this.privUmbrellaIntent&&(h=this.privUmbrellaIntent),null!==f&&void 0!==h&&(v=void 0===h.intentName?f.topScoringIntent.intent:h.intentName,d=r.result.reason,void 0!==v&&(d=c.ResultReason.RecognizedIntent),(y=void 0!==r.result.properties?r.result.properties:new c.PropertyCollection).setProperty(c.PropertyId.LanguageUnderstandingServiceResponse_JsonResult,e.textBody),r=new c.IntentRecognitionEventArgs(new c.IntentRecognitionResult(v,r.result.resultId,d,r.result.text,r.result.duration,r.result.offset,void 0,void 0,r.result.errorDetails,r.result.json,y),r.offset,r.sessionId)),this.privRequestSession.onPhraseRecognized(r.offset+r.result.duration),this.privIntentRecognizer.recognized)try{this.privIntentRecognizer.recognized(this.privIntentRecognizer,r)}catch(e){}if(this.privSuccessCallback){try{this.privSuccessCallback(r.result)}catch(e){this.privErrorCallback&&this.privErrorCallback(e)}this.privSuccessCallback=void 0,this.privErrorCallback=void 0}n=!0}return[2,n]}))}))},t.prototype.cancelRecognition=function(e,t,r,n,o){var i=new c.PropertyCollection;if(i.setProperty(u.CancellationErrorCodePropertyName,c.CancellationErrorCode[n]),this.privIntentRecognizer.canceled){var s=new c.IntentRecognitionCanceledEventArgs(r,o,n,void 0,void 0,e);try{this.privIntentRecognizer.canceled(this.privIntentRecognizer,s)}catch(e){}}if(this.privSuccessCallback){var a=new c.IntentRecognitionResult(void 0,t,c.ResultReason.Canceled,void 0,void 0,void 0,void 0,void 0,o,void 0,i);try{this.privSuccessCallback(a),this.privSuccessCallback=void 0}catch(e){}}},t}(u.ServiceRecognizerBase);t.IntentServiceRecognizer=p},9291:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.QueryParameterNames=void 0;var r=function(){function e(){}return e.BotId="botid",e.CustomSpeechDeploymentId="cid",e.CustomVoiceDeploymentId="deploymentId",e.EnableAudioLogging="storeAudio",e.EnableLanguageId="lidEnabled",e.EnableWordLevelTimestamps="wordLevelTimestamps",e.EndSilenceTimeoutMs="endSilenceTimeoutMs",e.Format="format",e.InitialSilenceTimeoutMs="initialSilenceTimeoutMs",e.Language="language",e.Profanity="profanity",e.RequestBotStatusMessages="enableBotMessageStatus",e.StableIntermediateThreshold="stableIntermediateThreshold",e.StableTranslation="stableTranslation",e.TestHooks="testhooks",e}();t.QueryParameterNames=r},7903:function(e,t,r){"use strict";var n,o=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},n(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.RecognitionEndedEvent=t.RecognitionCompletionStatus=t.RecognitionStartedEvent=t.ConnectingToServiceEvent=t.ListeningStartedEvent=t.RecognitionTriggeredEvent=t.SpeechRecognitionEvent=void 0;var i=r(2370),s=function(e){function t(t,r,n,o){void 0===o&&(o=i.EventType.Info);var s=e.call(this,t,o)||this;return s.privRequestId=r,s.privSessionId=n,s}return o(t,e),Object.defineProperty(t.prototype,"requestId",{get:function(){return this.privRequestId},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"sessionId",{get:function(){return this.privSessionId},enumerable:!1,configurable:!0}),t}(i.PlatformEvent);t.SpeechRecognitionEvent=s;var a=function(e){function t(t,r,n,o){var i=e.call(this,"RecognitionTriggeredEvent",t,r)||this;return i.privAudioSourceId=n,i.privAudioNodeId=o,i}return o(t,e),Object.defineProperty(t.prototype,"audioSourceId",{get:function(){return this.privAudioSourceId},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"audioNodeId",{get:function(){return this.privAudioNodeId},enumerable:!1,configurable:!0}),t}(s);t.RecognitionTriggeredEvent=a;var c=function(e){function t(t,r,n,o){var i=e.call(this,"ListeningStartedEvent",t,r)||this;return i.privAudioSourceId=n,i.privAudioNodeId=o,i}return o(t,e),Object.defineProperty(t.prototype,"audioSourceId",{get:function(){return this.privAudioSourceId},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"audioNodeId",{get:function(){return this.privAudioNodeId},enumerable:!1,configurable:!0}),t}(s);t.ListeningStartedEvent=c;var u=function(e){function t(t,r,n){var o=e.call(this,"ConnectingToServiceEvent",t,n)||this;return o.privAuthFetchEventid=r,o}return o(t,e),Object.defineProperty(t.prototype,"authFetchEventid",{get:function(){return this.privAuthFetchEventid},enumerable:!1,configurable:!0}),t}(s);t.ConnectingToServiceEvent=u;var p,l=function(e){function t(t,r,n,o,i){var s=e.call(this,"RecognitionStartedEvent",t,i)||this;return s.privAudioSourceId=r,s.privAudioNodeId=n,s.privAuthFetchEventId=o,s}return o(t,e),Object.defineProperty(t.prototype,"audioSourceId",{get:function(){return this.privAudioSourceId},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"audioNodeId",{get:function(){return this.privAudioNodeId},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"authFetchEventId",{get:function(){return this.privAuthFetchEventId},enumerable:!1,configurable:!0}),t}(s);t.RecognitionStartedEvent=l,function(e){e[e.Success=0]="Success",e[e.AudioSourceError=1]="AudioSourceError",e[e.AudioSourceTimeout=2]="AudioSourceTimeout",e[e.AuthTokenFetchError=3]="AuthTokenFetchError",e[e.AuthTokenFetchTimeout=4]="AuthTokenFetchTimeout",e[e.UnAuthorized=5]="UnAuthorized",e[e.ConnectTimeout=6]="ConnectTimeout",e[e.ConnectError=7]="ConnectError",e[e.ClientRecognitionActivityTimeout=8]="ClientRecognitionActivityTimeout",e[e.UnknownError=9]="UnknownError"}(p=t.RecognitionCompletionStatus||(t.RecognitionCompletionStatus={}));var f=function(e){function t(t,r,n,o,s,a,c,u){var l=e.call(this,"RecognitionEndedEvent",t,s,c===p.Success?i.EventType.Info:i.EventType.Error)||this;return l.privAudioSourceId=r,l.privAudioNodeId=n,l.privAuthFetchEventId=o,l.privStatus=c,l.privError=u,l.privServiceTag=a,l}return o(t,e),Object.defineProperty(t.prototype,"audioSourceId",{get:function(){return this.privAudioSourceId},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"audioNodeId",{get:function(){return this.privAudioNodeId},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"authFetchEventId",{get:function(){return this.privAuthFetchEventId},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"serviceTag",{get:function(){return this.privServiceTag},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"status",{get:function(){return this.privStatus},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"error",{get:function(){return this.privError},enumerable:!1,configurable:!0}),t}(s);t.RecognitionEndedEvent=f},2663:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.type=t.connectivity=t.Device=t.OS=t.System=t.Context=t.SpeechServiceConfig=t.RecognizerConfig=t.SpeechResultFormat=t.RecognitionMode=void 0;var n,o,i=r(9480);!function(e){e[e.Interactive=0]="Interactive",e[e.Conversation=1]="Conversation",e[e.Dictation=2]="Dictation"}(n=t.RecognitionMode||(t.RecognitionMode={})),(o=t.SpeechResultFormat||(t.SpeechResultFormat={}))[o.Simple=0]="Simple",o[o.Detailed=1]="Detailed";var s=function(){function e(e,t){this.privRecognitionMode=n.Interactive,this.privSpeechServiceConfig=e||new a(new c(null)),this.privParameters=t,this.privMaxRetryCount=parseInt(t.getProperty("SPEECH-Error-MaxRetryCount","4"),10)}return Object.defineProperty(e.prototype,"parameters",{get:function(){return this.privParameters},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"recognitionMode",{get:function(){return this.privRecognitionMode},set:function(e){this.privRecognitionMode=e,this.privRecognitionActivityTimeout=e===n.Interactive?8e3:25e3,this.privSpeechServiceConfig.Recognition=n[e]},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"SpeechServiceConfig",{get:function(){return this.privSpeechServiceConfig},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"recognitionActivityTimeout",{get:function(){return this.privRecognitionActivityTimeout},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isContinuousRecognition",{get:function(){return this.privRecognitionMode!==n.Interactive},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"autoDetectSourceLanguages",{get:function(){return this.parameters.getProperty(i.PropertyId.SpeechServiceConnection_AutoDetectSourceLanguages,void 0)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"maxRetryCount",{get:function(){return this.privMaxRetryCount},enumerable:!1,configurable:!0}),e}();t.RecognizerConfig=s;var a=function(){function e(e){var t=this;this.serialize=function(){return JSON.stringify(t,(function(e,t){if(t&&"object"==typeof t){var r={};for(var n in t)Object.hasOwnProperty.call(t,n)&&(r[n&&n.charAt(0).toLowerCase()+n.substring(1)]=t[n]);return r}return t}))},this.context=e}return Object.defineProperty(e.prototype,"Context",{get:function(){return this.context},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"Recognition",{get:function(){return this.recognition},set:function(e){this.recognition=e.toLowerCase()},enumerable:!1,configurable:!0}),e}();t.SpeechServiceConfig=a;var c=function(e){this.system=new u,this.os=e};t.Context=c;var u=function(){this.name="SpeechSDK",this.version="1.17.0",this.build="JavaScript",this.lang="JavaScript"};t.System=u;t.OS=function(e,t,r){this.platform=e,this.name=t,this.version=r};var p,l;t.Device=function(e,t,r){this.manufacturer=e,this.model=t,this.version=r},(l=t.connectivity||(t.connectivity={})).Bluetooth="Bluetooth",l.Wired="Wired",l.WiFi="WiFi",l.Cellular="Cellular",l.InBuilt="InBuilt",l.Unknown="Unknown",(p=t.type||(t.type={})).Phone="Phone",p.Speaker="Speaker",p.Car="Car",p.Headset="Headset",p.Thermostat="Thermostat",p.Microphones="Microphones",p.Deskphone="Deskphone",p.RemoteControl="RemoteControl",p.Unknown="Unknown",p.File="File",p.Stream="Stream"},7959:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function s(e){try{c(n.next(e))}catch(e){i(e)}}function a(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var r,n,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,n=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.RequestSession=void 0;var i=r(2370),s=r(7903),a=r(914),c=function(){function e(e){var t=this;this.privIsDisposed=!1,this.privDetachables=new Array,this.privIsAudioNodeDetached=!1,this.privIsRecognizing=!1,this.privIsSpeechEnded=!1,this.privTurnStartAudioOffset=0,this.privLastRecoOffset=0,this.privHypothesisReceived=!1,this.privBytesSent=0,this.privRecogNumber=0,this.privInTurn=!1,this.privConnectionAttempts=0,this.onPreConnectionStart=function(e,r){t.privAuthFetchEventId=e,t.privSessionId=r,t.onEvent(new s.ConnectingToServiceEvent(t.privRequestId,t.privAuthFetchEventId,t.privSessionId))},this.onServiceTurnStartResponse=function(){t.privTurnDeferral&&t.privInTurn&&(t.privTurnDeferral.reject("Another turn started before current completed."),t.privTurnDeferral.promise.then().catch((function(){}))),t.privInTurn=!0,t.privTurnDeferral=new i.Deferred},this.getTelemetry=function(){return t.privServiceTelemetryListener.hasTelemetry?t.privServiceTelemetryListener.getTelemetry():null},this.onEvent=function(e){t.privServiceTelemetryListener&&t.privServiceTelemetryListener.onEvent(e),i.Events.instance.onEvent(e)},this.privAudioSourceId=e,this.privRequestId=i.createNoDashGuid(),this.privAudioNodeId=i.createNoDashGuid(),this.privTurnDeferral=new i.Deferred,this.privTurnDeferral.resolve()}return Object.defineProperty(e.prototype,"sessionId",{get:function(){return this.privSessionId},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"requestId",{get:function(){return this.privRequestId},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"audioNodeId",{get:function(){return this.privAudioNodeId},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"turnCompletionPromise",{get:function(){return this.privTurnDeferral.promise},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isSpeechEnded",{get:function(){return this.privIsSpeechEnded},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isRecognizing",{get:function(){return this.privIsRecognizing},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"currentTurnAudioOffset",{get:function(){return this.privTurnStartAudioOffset},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"recogNumber",{get:function(){return this.privRecogNumber},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"numConnectionAttempts",{get:function(){return this.privConnectionAttempts},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"bytesSent",{get:function(){return this.privBytesSent},enumerable:!1,configurable:!0}),e.prototype.listenForServiceTelemetry=function(e){this.privServiceTelemetryListener&&this.privDetachables.push(e.attachListener(this.privServiceTelemetryListener))},e.prototype.startNewRecognition=function(){this.privIsSpeechEnded=!1,this.privIsRecognizing=!0,this.privTurnStartAudioOffset=0,this.privLastRecoOffset=0,this.privRequestId=i.createNoDashGuid(),this.privRecogNumber++,this.privServiceTelemetryListener=new a.ServiceTelemetryListener(this.privRequestId,this.privAudioSourceId,this.privAudioNodeId),this.onEvent(new s.RecognitionTriggeredEvent(this.requestId,this.privSessionId,this.privAudioSourceId,this.privAudioNodeId))},e.prototype.onAudioSourceAttachCompleted=function(e,t,r){return n(this,void 0,void 0,(function(){return o(this,(function(r){switch(r.label){case 0:return this.privAudioNode=e,this.privIsAudioNodeDetached=!1,t?[4,this.onComplete()]:[3,2];case 1:return r.sent(),[3,3];case 2:this.onEvent(new s.ListeningStartedEvent(this.privRequestId,this.privSessionId,this.privAudioSourceId,this.privAudioNodeId)),r.label=3;case 3:return[2]}}))}))},e.prototype.onAuthCompleted=function(e,t){return n(this,void 0,void 0,(function(){return o(this,(function(t){switch(t.label){case 0:return e?[4,this.onComplete()]:[3,2];case 1:t.sent(),t.label=2;case 2:return[2]}}))}))},e.prototype.onConnectionEstablishCompleted=function(e,t){return n(this,void 0,void 0,(function(){return o(this,(function(t){switch(t.label){case 0:return 200!==e?[3,1]:(this.onEvent(new s.RecognitionStartedEvent(this.requestId,this.privAudioSourceId,this.privAudioNodeId,this.privAuthFetchEventId,this.privSessionId)),this.privAudioNode&&this.privAudioNode.replay(),this.privTurnStartAudioOffset=this.privLastRecoOffset,this.privBytesSent=0,[2]);case 1:return 403!==e?[3,3]:[4,this.onComplete()];case 2:t.sent(),t.label=3;case 3:return[2]}}))}))},e.prototype.onServiceTurnEndResponse=function(e){return n(this,void 0,void 0,(function(){return o(this,(function(t){switch(t.label){case 0:return this.privTurnDeferral.resolve(),e&&!this.isSpeechEnded?[3,2]:[4,this.onComplete()];case 1:return t.sent(),this.privInTurn=!1,[3,3];case 2:this.privTurnStartAudioOffset=this.privLastRecoOffset,this.privRequestId=i.createNoDashGuid(),this.privAudioNode.replay(),t.label=3;case 3:return[2]}}))}))},e.prototype.onHypothesis=function(e){this.privHypothesisReceived||(this.privHypothesisReceived=!0,this.privServiceTelemetryListener.hypothesisReceived(this.privAudioNode.findTimeAtOffset(e)))},e.prototype.onPhraseRecognized=function(e){this.privServiceTelemetryListener.phraseReceived(this.privAudioNode.findTimeAtOffset(e)),this.onServiceRecognized(e)},e.prototype.onServiceRecognized=function(e){this.privLastRecoOffset=e,this.privHypothesisReceived=!1,this.privAudioNode.shrinkBuffers(e),this.privConnectionAttempts=0},e.prototype.onAudioSent=function(e){this.privBytesSent+=e},e.prototype.onRetryConnection=function(){this.privConnectionAttempts++},e.prototype.dispose=function(e){return n(this,void 0,void 0,(function(){var e,t;return o(this,(function(r){switch(r.label){case 0:if(this.privIsDisposed)return[3,5];this.privIsDisposed=!0,e=0,t=this.privDetachables,r.label=1;case 1:return e<t.length?[4,t[e].detach()]:[3,4];case 2:r.sent(),r.label=3;case 3:return e++,[3,1];case 4:this.privServiceTelemetryListener.dispose(),this.privIsRecognizing=!1,r.label=5;case 5:return[2]}}))}))},e.prototype.onStopRecognizing=function(){return n(this,void 0,void 0,(function(){return o(this,(function(e){switch(e.label){case 0:return[4,this.onComplete()];case 1:return e.sent(),[2]}}))}))},e.prototype.onSpeechEnded=function(){this.privIsSpeechEnded=!0},e.prototype.onComplete=function(){return n(this,void 0,void 0,(function(){return o(this,(function(e){switch(e.label){case 0:return this.privIsRecognizing?(this.privIsRecognizing=!1,[4,this.detachAudioNode()]):[3,2];case 1:e.sent(),e.label=2;case 2:return[2]}}))}))},e.prototype.detachAudioNode=function(){return n(this,void 0,void 0,(function(){return o(this,(function(e){switch(e.label){case 0:return this.privIsAudioNodeDetached?[3,2]:(this.privIsAudioNodeDetached=!0,this.privAudioNode?[4,this.privAudioNode.detach()]:[3,2]);case 1:e.sent(),e.label=2;case 2:return[2]}}))}))},e}();t.RequestSession=c},6498:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MessageDataStreamType=t.ActivityPayloadResponse=void 0;var r,n=function(){function e(e){this.privActivityResponse=JSON.parse(e)}return e.fromJSON=function(t){return new e(t)},Object.defineProperty(e.prototype,"conversationId",{get:function(){return this.privActivityResponse.conversationId},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"messageDataStreamType",{get:function(){return this.privActivityResponse.messageDataStreamType},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"messagePayload",{get:function(){return this.privActivityResponse.messagePayload},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"version",{get:function(){return this.privActivityResponse.version},enumerable:!1,configurable:!0}),e}();t.ActivityPayloadResponse=n,(r=t.MessageDataStreamType||(t.MessageDataStreamType={}))[r.None=0]="None",r[r.TextToSpeechAudio=1]="TextToSpeechAudio"},2640:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DetailedSpeechPhrase=void 0;var n=r(21),o=function(){function e(e){this.privDetailedSpeechPhrase=JSON.parse(e),this.privDetailedSpeechPhrase.RecognitionStatus=n.RecognitionStatus[this.privDetailedSpeechPhrase.RecognitionStatus]}return e.fromJSON=function(t){return new e(t)},Object.defineProperty(e.prototype,"RecognitionStatus",{get:function(){return this.privDetailedSpeechPhrase.RecognitionStatus},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"NBest",{get:function(){return this.privDetailedSpeechPhrase.NBest},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"Duration",{get:function(){return this.privDetailedSpeechPhrase.Duration},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"Offset",{get:function(){return this.privDetailedSpeechPhrase.Offset},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"Language",{get:function(){return void 0===this.privDetailedSpeechPhrase.PrimaryLanguage?void 0:this.privDetailedSpeechPhrase.PrimaryLanguage.Language},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"LanguageDetectionConfidence",{get:function(){return void 0===this.privDetailedSpeechPhrase.PrimaryLanguage?void 0:this.privDetailedSpeechPhrase.PrimaryLanguage.Confidence},enumerable:!1,configurable:!0}),e}();t.DetailedSpeechPhrase=o},5989:function(e,t){"use strict";var r,n;Object.defineProperty(t,"__esModule",{value:!0}),t.RecognitionStatus=t.SynthesisStatus=void 0,(n=t.SynthesisStatus||(t.SynthesisStatus={}))[n.Success=0]="Success",n[n.SynthesisEnd=1]="SynthesisEnd",n[n.Error=2]="Error",(r=t.RecognitionStatus||(t.RecognitionStatus={}))[r.Success=0]="Success",r[r.NoMatch=1]="NoMatch",r[r.InitialSilenceTimeout=2]="InitialSilenceTimeout",r[r.BabbleTimeout=3]="BabbleTimeout",r[r.Error=4]="Error",r[r.EndOfDictation=5]="EndOfDictation",r[r.TooManyRequests=6]="TooManyRequests"},3789:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IntentResponse=void 0;var r=function(){function e(e){this.privIntentResponse=JSON.parse(e)}return e.fromJSON=function(t){return new e(t)},Object.defineProperty(e.prototype,"query",{get:function(){return this.privIntentResponse.query},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"topScoringIntent",{get:function(){return this.privIntentResponse.topScoringIntent},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"entities",{get:function(){return this.privIntentResponse.entities},enumerable:!1,configurable:!0}),e}();t.IntentResponse=r},4168:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SimpleSpeechPhrase=void 0;var n=r(21),o=function(){function e(e){this.privSimpleSpeechPhrase=JSON.parse(e),this.privSimpleSpeechPhrase.RecognitionStatus=n.RecognitionStatus[this.privSimpleSpeechPhrase.RecognitionStatus]}return e.fromJSON=function(t){return new e(t)},Object.defineProperty(e.prototype,"RecognitionStatus",{get:function(){return this.privSimpleSpeechPhrase.RecognitionStatus},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"DisplayText",{get:function(){return this.privSimpleSpeechPhrase.DisplayText},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"Offset",{get:function(){return this.privSimpleSpeechPhrase.Offset},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"Duration",{get:function(){return this.privSimpleSpeechPhrase.Duration},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"Language",{get:function(){return void 0===this.privSimpleSpeechPhrase.PrimaryLanguage?void 0:this.privSimpleSpeechPhrase.PrimaryLanguage.Language},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"LanguageDetectionConfidence",{get:function(){return void 0===this.privSimpleSpeechPhrase.PrimaryLanguage?void 0:this.privSimpleSpeechPhrase.PrimaryLanguage.Confidence},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"SpeakerId",{get:function(){return this.privSimpleSpeechPhrase.SpeakerId},enumerable:!1,configurable:!0}),e}();t.SimpleSpeechPhrase=o},6147:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SpeechDetected=void 0;var r=function(){function e(e){this.privSpeechStartDetected=JSON.parse(e)}return e.fromJSON=function(t){return new e(t)},Object.defineProperty(e.prototype,"Offset",{get:function(){return this.privSpeechStartDetected.Offset},enumerable:!1,configurable:!0}),e}();t.SpeechDetected=r},8395:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SpeechHypothesis=void 0;var r=function(){function e(e){this.privSpeechHypothesis=JSON.parse(e)}return e.fromJSON=function(t){return new e(t)},Object.defineProperty(e.prototype,"Text",{get:function(){return this.privSpeechHypothesis.Text},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"Offset",{get:function(){return this.privSpeechHypothesis.Offset},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"Duration",{get:function(){return this.privSpeechHypothesis.Duration},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"Language",{get:function(){return void 0===this.privSpeechHypothesis.PrimaryLanguage?void 0:this.privSpeechHypothesis.PrimaryLanguage.Language},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"LanguageDetectionConfidence",{get:function(){return void 0===this.privSpeechHypothesis.PrimaryLanguage?void 0:this.privSpeechHypothesis.PrimaryLanguage.Confidence},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"SpeakerId",{get:function(){return this.privSpeechHypothesis.SpeakerId},enumerable:!1,configurable:!0}),e}();t.SpeechHypothesis=r},9257:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SpeechKeyword=void 0;var r=function(){function e(e){this.privSpeechKeyword=JSON.parse(e)}return e.fromJSON=function(t){return new e(t)},Object.defineProperty(e.prototype,"Status",{get:function(){return this.privSpeechKeyword.Status},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"Text",{get:function(){return this.privSpeechKeyword.Text},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"Offset",{get:function(){return this.privSpeechKeyword.Offset},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"Duration",{get:function(){return this.privSpeechKeyword.Duration},enumerable:!1,configurable:!0}),e}();t.SpeechKeyword=r},6969:function(e,t){"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.SynthesisAudioMetadata=t.MetadataType=void 0,(r=t.MetadataType||(t.MetadataType={})).WordBoundary="WordBoundary",r.Bookmark="Bookmark",r.Viseme="Viseme";var n=function(){function e(e){this.privSynthesisAudioMetadata=JSON.parse(e)}return e.fromJSON=function(t){return new e(t)},Object.defineProperty(e.prototype,"Metadata",{get:function(){return this.privSynthesisAudioMetadata.Metadata},enumerable:!1,configurable:!0}),e}();t.SynthesisAudioMetadata=n},6082:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TranslationHypothesis=void 0;var n=r(9307),o=function(){function e(e){this.privTranslationHypothesis=JSON.parse(e),this.privTranslationHypothesis.Translation.TranslationStatus=n.TranslationStatus[this.privTranslationHypothesis.Translation.TranslationStatus]}return e.fromJSON=function(t){return new e(t)},Object.defineProperty(e.prototype,"Duration",{get:function(){return this.privTranslationHypothesis.Duration},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"Offset",{get:function(){return this.privTranslationHypothesis.Offset},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"Text",{get:function(){return this.privTranslationHypothesis.Text},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"Translation",{get:function(){return this.privTranslationHypothesis.Translation},enumerable:!1,configurable:!0}),e}();t.TranslationHypothesis=o},7814:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TranslationPhrase=void 0;var n=r(21),o=r(9307),i=function(){function e(e){this.privTranslationPhrase=JSON.parse(e),this.privTranslationPhrase.RecognitionStatus=n.RecognitionStatus[this.privTranslationPhrase.RecognitionStatus],void 0!==this.privTranslationPhrase.Translation&&(this.privTranslationPhrase.Translation.TranslationStatus=o.TranslationStatus[this.privTranslationPhrase.Translation.TranslationStatus])}return e.fromJSON=function(t){return new e(t)},Object.defineProperty(e.prototype,"RecognitionStatus",{get:function(){return this.privTranslationPhrase.RecognitionStatus},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"Offset",{get:function(){return this.privTranslationPhrase.Offset},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"Duration",{get:function(){return this.privTranslationPhrase.Duration},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"Text",{get:function(){return this.privTranslationPhrase.Text},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"Translation",{get:function(){return this.privTranslationPhrase.Translation},enumerable:!1,configurable:!0}),e}();t.TranslationPhrase=i},1550:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TranslationSynthesisEnd=void 0;var n=r(21),o=function(){function e(e){this.privSynthesisEnd=JSON.parse(e),this.privSynthesisEnd.SynthesisStatus=n.SynthesisStatus[this.privSynthesisEnd.SynthesisStatus]}return e.fromJSON=function(t){return new e(t)},Object.defineProperty(e.prototype,"SynthesisStatus",{get:function(){return this.privSynthesisEnd.SynthesisStatus},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"FailureReason",{get:function(){return this.privSynthesisEnd.FailureReason},enumerable:!1,configurable:!0}),e}();t.TranslationSynthesisEnd=o},6597:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TurnStatusResponsePayload=void 0;var r=function(){function e(e){this.privMessageStatusResponse=JSON.parse(e)}return e.fromJSON=function(t){return new e(t)},Object.defineProperty(e.prototype,"interactionId",{get:function(){return this.privMessageStatusResponse.interactionId},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"conversationId",{get:function(){return this.privMessageStatusResponse.conversationId},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"statusCode",{get:function(){switch(this.privMessageStatusResponse.statusCode){case"Success":return 200;case"Failed":return 400;case"TimedOut":return 429;default:return this.privMessageStatusResponse.statusCode}},enumerable:!1,configurable:!0}),e}();t.TurnStatusResponsePayload=r},3257:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function s(e){try{c(n.next(e))}catch(e){i(e)}}function a(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var r,n,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,n=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.ServiceRecognizerBase=void 0;var i=r(6340),s=r(2370),a=r(9480),c=r(21),u=r(4921),p=function(){function e(t,r,i,p,l){var f=this;if(this.privSetTimeout=setTimeout,this.privIsLiveAudio=!1,this.recognizeOverride=void 0,this.disconnectOverride=void 0,this.receiveMessageOverride=void 0,this.sendSpeechContext=function(e){var t=f.speechContext.toJSON();if(t)return e.send(new u.SpeechConnectionMessage(s.MessageType.Text,"speech.context",f.privRequestSession.requestId,"application/json",t))},this.sendPrePayloadJSONOverride=void 0,this.postConnectImplOverride=void 0,this.configConnectionOverride=void 0,this.sendSpeechServiceConfig=function(t,r,n){if(!0!==e.telemetryDataEnabled){var o={context:{system:JSON.parse(n).context.system}};n=JSON.stringify(o)}if("true"===f.privRecognizerConfig.parameters.getProperty("TranscriptionService_SingleChannel","false").toLowerCase()){var i=JSON.parse(n);i.context.DisableReferenceChannel="True",i.context.MicSpec="1_0_0",n=JSON.stringify(i)}if(n)return t.send(new u.SpeechConnectionMessage(s.MessageType.Text,"speech.config",r.requestId,"application/json",n))},!t)throw new s.ArgumentNullError("authentication");if(!r)throw new s.ArgumentNullError("connectionFactory");if(!i)throw new s.ArgumentNullError("audioSource");if(!p)throw new s.ArgumentNullError("recognizerConfig");this.privMustReportEndOfStream=!1,this.privAuthentication=t,this.privConnectionFactory=r,this.privAudioSource=i,this.privRecognizerConfig=p,this.privIsDisposed=!1,this.privRecognizer=l,this.privRequestSession=new c.RequestSession(this.privAudioSource.id()),this.privConnectionEvents=new s.EventSource,this.privServiceEvents=new s.EventSource,this.privDynamicGrammar=new c.DynamicGrammarBuilder,this.privSpeechContext=new c.SpeechContext(this.privDynamicGrammar),this.privAgentConfig=new c.AgentConfig,"undefined"!=typeof Blob&&"undefined"!=typeof Worker&&(this.privSetTimeout=s.Timeout.setTimeout),this.connectionEvents.attach((function(e){return n(f,void 0,void 0,(function(){var t;return o(this,(function(r){switch(r.label){case 0:return"ConnectionClosedEvent"!==e.name?[3,2]:1003===(t=e).statusCode||1007===t.statusCode||1002===t.statusCode||4e3===t.statusCode||this.privRequestSession.numConnectionAttempts>this.privRecognizerConfig.maxRetryCount?[4,this.cancelRecognitionLocal(a.CancellationReason.Error,1007===t.statusCode?a.CancellationErrorCode.BadRequestParameters:a.CancellationErrorCode.ConnectionFailure,t.reason+" websocket error code: "+t.statusCode)]:[3,2];case 1:r.sent(),r.label=2;case 2:return[2]}}))}))}))}return Object.defineProperty(e.prototype,"audioSource",{get:function(){return this.privAudioSource},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"speechContext",{get:function(){return this.privSpeechContext},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"dynamicGrammar",{get:function(){return this.privDynamicGrammar},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"agentConfig",{get:function(){return this.privAgentConfig},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"conversationTranslatorToken",{set:function(e){this.privRecognizerConfig.parameters.setProperty(a.PropertyId.ConversationTranslator_Token,e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"authentication",{set:function(e){this.privAuthentication=this.authentication},enumerable:!1,configurable:!0}),e.prototype.isDisposed=function(){return this.privIsDisposed},e.prototype.dispose=function(e){return n(this,void 0,void 0,(function(){return o(this,(function(t){switch(t.label){case 0:if(this.privIsDisposed=!0,!this.privConnectionConfigurationPromise)return[3,5];t.label=1;case 1:return t.trys.push([1,4,,5]),[4,this.privConnectionConfigurationPromise];case 2:return[4,t.sent().dispose(e)];case 3:return t.sent(),[3,5];case 4:return t.sent(),[2];case 5:return[2]}}))}))},Object.defineProperty(e.prototype,"connectionEvents",{get:function(){return this.privConnectionEvents},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"serviceEvents",{get:function(){return this.privServiceEvents},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"recognitionMode",{get:function(){return this.privRecognizerConfig.recognitionMode},enumerable:!1,configurable:!0}),e.prototype.recognize=function(e,t,r){return n(this,void 0,void 0,(function(){var s,u,p,l,f,h,v,d,y=this;return o(this,(function(g){switch(g.label){case 0:if(void 0!==this.recognizeOverride)return[2,this.recognizeOverride(e,t,r)];this.privConnectionConfigurationPromise=null,this.privRecognizerConfig.recognitionMode=e,this.privSuccessCallback=t,this.privErrorCallback=r,this.privRequestSession.startNewRecognition(),this.privRequestSession.listenForServiceTelemetry(this.privAudioSource.events),s=this.connectImpl(),g.label=1;case 1:return g.trys.push([1,6,,8]),[4,this.audioSource.attach(this.privRequestSession.audioNodeId)];case 2:return p=g.sent(),[4,this.audioSource.format];case 3:return l=g.sent(),[4,this.audioSource.deviceInfo];case 4:return f=g.sent(),this.privIsLiveAudio=f.type&&f.type===c.type.Microphones,u=new i.ReplayableAudioNode(p,l.avgBytesPerSec),[4,this.privRequestSession.onAudioSourceAttachCompleted(u,!1)];case 5:return g.sent(),this.privRecognizerConfig.SpeechServiceConfig.Context.audio={source:f},[3,8];case 6:return h=g.sent(),[4,this.privRequestSession.onStopRecognizing()];case 7:throw g.sent(),h;case 8:return g.trys.push([8,10,,12]),[4,s];case 9:return g.sent(),[3,12];case 10:return v=g.sent(),[4,this.cancelRecognitionLocal(a.CancellationReason.Error,a.CancellationErrorCode.ConnectionFailure,v)];case 11:return g.sent(),[2];case 12:return d=new a.SessionEventArgs(this.privRequestSession.sessionId),this.privRecognizer.sessionStarted&&this.privRecognizer.sessionStarted(this.privRecognizer,d),this.receiveMessage(),this.sendAudio(u).catch((function(e){return n(y,void 0,void 0,(function(){return o(this,(function(t){switch(t.label){case 0:return[4,this.cancelRecognitionLocal(a.CancellationReason.Error,a.CancellationErrorCode.RuntimeError,e)];case 1:return t.sent(),[2]}}))}))})),[2]}}))}))},e.prototype.stopRecognizing=function(){return n(this,void 0,void 0,(function(){return o(this,(function(e){switch(e.label){case 0:if(!this.privRequestSession.isRecognizing)return[3,8];e.label=1;case 1:return e.trys.push([1,,6,8]),[4,this.audioSource.turnOff()];case 2:return e.sent(),[4,this.sendFinalAudio()];case 3:return e.sent(),[4,this.privRequestSession.onStopRecognizing()];case 4:return e.sent(),[4,this.privRequestSession.turnCompletionPromise];case 5:return e.sent(),[3,8];case 6:return[4,this.privRequestSession.dispose()];case 7:return e.sent(),[7];case 8:return[2]}}))}))},e.prototype.connect=function(){return n(this,void 0,void 0,(function(){return o(this,(function(e){switch(e.label){case 0:return[4,this.connectImpl()];case 1:return e.sent(),[2,Promise.resolve()]}}))}))},e.prototype.connectAsync=function(e,t){this.connectImpl().then((function(r){try{e&&e()}catch(e){t&&t(e)}}),(function(e){try{t&&t(e)}catch(e){}}))},e.prototype.disconnect=function(){return n(this,void 0,void 0,(function(){return o(this,(function(e){switch(e.label){case 0:return[4,this.cancelRecognitionLocal(a.CancellationReason.Error,a.CancellationErrorCode.NoError,"Disconnecting")];case 1:return e.sent(),void 0===this.disconnectOverride?[3,3]:[4,this.disconnectOverride()];case 2:e.sent(),e.label=3;case 3:return e.trys.push([3,6,,7]),[4,this.privConnectionPromise];case 4:return[4,e.sent().dispose()];case 5:case 6:return e.sent(),[3,7];case 7:return this.privConnectionPromise=null,[2]}}))}))},e.prototype.sendMessage=function(e){},e.prototype.sendNetworkMessage=function(e,t){return n(this,void 0,void 0,(function(){var r,n;return o(this,(function(o){switch(o.label){case 0:return r="string"==typeof t?s.MessageType.Text:s.MessageType.Binary,n="string"==typeof t?"application/json":"",[4,this.fetchConnection()];case 1:return[2,o.sent().send(new u.SpeechConnectionMessage(r,e,this.privRequestSession.requestId,n,t))]}}))}))},Object.defineProperty(e.prototype,"activityTemplate",{get:function(){return this.privActivityTemplate},set:function(e){this.privActivityTemplate=e},enumerable:!1,configurable:!0}),e.prototype.sendTelemetryData=function(){return n(this,void 0,void 0,(function(){var t;return o(this,(function(r){switch(r.label){case 0:if(t=this.privRequestSession.getTelemetry(),!0!==e.telemetryDataEnabled||this.privIsDisposed||null===t)return[2];if(e.telemetryData)try{e.telemetryData(t)}catch(e){}return[4,this.fetchConnection()];case 1:return[4,r.sent().send(new u.SpeechConnectionMessage(s.MessageType.Text,"telemetry",this.privRequestSession.requestId,"application/json",t))];case 2:return r.sent(),[2]}}))}))},e.prototype.cancelRecognitionLocal=function(e,t,r){return n(this,void 0,void 0,(function(){return o(this,(function(n){switch(n.label){case 0:return this.privRequestSession.isRecognizing?[4,this.privRequestSession.onStopRecognizing()]:[3,2];case 1:n.sent(),this.cancelRecognition(this.privRequestSession.sessionId,this.privRequestSession.requestId,e,t,r),n.label=2;case 2:return[2]}}))}))},e.prototype.receiveMessage=function(){return n(this,void 0,void 0,(function(){var e,t,r,n,i,p,l,f,h;return o(this,(function(o){switch(o.label){case 0:return o.trys.push([0,18,,19]),this.privIsDisposed?[2]:[4,this.fetchConnection()];case 1:return[4,(e=o.sent()).read()];case 2:if(t=o.sent(),void 0!==this.receiveMessageOverride)return[2,this.receiveMessageOverride()];if(!t)return this.privRequestSession.isRecognizing?[2,this.receiveMessage()]:[2];if(this.privServiceHasSentMessage=!0,(r=u.SpeechConnectionMessage.fromConnectionMessage(t)).requestId.toLowerCase()!==this.privRequestSession.requestId.toLowerCase())return[3,17];switch(r.path.toLowerCase()){case"turn.start":return[3,3];case"speech.startdetected":return[3,4];case"speech.enddetected":return[3,5];case"turn.end":return[3,6]}return[3,15];case 3:return this.privMustReportEndOfStream=!0,this.privRequestSession.onServiceTurnStartResponse(),[3,17];case 4:return n=c.SpeechDetected.fromJSON(r.textBody),i=new a.RecognitionEventArgs(n.Offset,this.privRequestSession.sessionId),this.privRecognizer.speechStartDetected&&this.privRecognizer.speechStartDetected(this.privRecognizer,i),[3,17];case 5:return void 0,p=r.textBody.length>0?r.textBody:"{ Offset: 0 }",l=c.SpeechDetected.fromJSON(p),this.privRecognizerConfig.isContinuousRecognition&&this.privRequestSession.onServiceRecognized(l.Offset+this.privRequestSession.currentTurnAudioOffset),f=new a.RecognitionEventArgs(l.Offset+this.privRequestSession.currentTurnAudioOffset,this.privRequestSession.sessionId),this.privRecognizer.speechEndDetected&&this.privRecognizer.speechEndDetected(this.privRecognizer,f),[3,17];case 6:return[4,this.sendTelemetryData()];case 7:return o.sent(),this.privRequestSession.isSpeechEnded&&this.privMustReportEndOfStream?(this.privMustReportEndOfStream=!1,[4,this.cancelRecognitionLocal(a.CancellationReason.EndOfStream,a.CancellationErrorCode.NoError,void 0)]):[3,9];case 8:o.sent(),o.label=9;case 9:return h=new a.SessionEventArgs(this.privRequestSession.sessionId),[4,this.privRequestSession.onServiceTurnEndResponse(this.privRecognizerConfig.isContinuousRecognition)];case 10:return o.sent(),this.privRecognizerConfig.isContinuousRecognition&&!this.privRequestSession.isSpeechEnded&&this.privRequestSession.isRecognizing?[3,11]:(this.privRecognizer.sessionStopped&&this.privRecognizer.sessionStopped(this.privRecognizer,h),[2]);case 11:return[4,this.fetchConnection()];case 12:return e=o.sent(),[4,this.sendPrePayloadJSON(e)];case 13:o.sent(),o.label=14;case 14:return[3,17];case 15:return[4,this.processTypeSpecificMessages(r)];case 16:o.sent()||this.privServiceEvents&&this.serviceEvents.onEvent(new s.ServiceEvent(r.path.toLowerCase(),r.textBody)),o.label=17;case 17:return[2,this.receiveMessage()];case 18:return o.sent(),[2,null];case 19:return[2]}}))}))},e.prototype.sendPrePayloadJSON=function(e){return n(this,void 0,void 0,(function(){return o(this,(function(t){switch(t.label){case 0:return void 0!==this.sendPrePayloadJSONOverride?[2,this.sendPrePayloadJSONOverride(e)]:[4,this.sendSpeechContext(e)];case 1:return t.sent(),[4,this.sendWaveHeader(e)];case 2:return t.sent(),[2]}}))}))},e.prototype.sendWaveHeader=function(e){return n(this,void 0,void 0,(function(){var t;return o(this,(function(r){switch(r.label){case 0:return[4,this.audioSource.format];case 1:return t=r.sent(),[2,e.send(new u.SpeechConnectionMessage(s.MessageType.Binary,"audio",this.privRequestSession.requestId,"audio/x-wav",t.header))]}}))}))},e.prototype.connectImpl=function(){var e=this;return this.privConnectionPromise?this.privConnectionPromise.then((function(t){return t.state()===s.ConnectionState.Disconnected?(e.privConnectionId=null,e.privConnectionPromise=null,e.privServiceHasSentMessage=!1,e.connectImpl()):e.privConnectionPromise}),(function(t){return e.privConnectionId=null,e.privConnectionPromise=null,e.privServiceHasSentMessage=!1,e.connectImpl()})):(this.privConnectionPromise=this.retryableConnect(),this.privConnectionPromise.catch((function(){})),void 0!==this.postConnectImplOverride?this.postConnectImplOverride(this.privConnectionPromise):this.privConnectionPromise)},e.prototype.fetchConnection=function(){return n(this,void 0,void 0,(function(){var e=this;return o(this,(function(t){switch(t.label){case 0:return this.privConnectionConfigurationPromise?[2,this.privConnectionConfigurationPromise.then((function(t){return t.state()===s.ConnectionState.Disconnected?(e.privConnectionId=null,e.privConnectionConfigurationPromise=null,e.privServiceHasSentMessage=!1,e.fetchConnection()):e.privConnectionConfigurationPromise}),(function(t){return e.privConnectionId=null,e.privConnectionConfigurationPromise=null,e.privServiceHasSentMessage=!1,e.fetchConnection()}))]:(this.privConnectionConfigurationPromise=this.configureConnection(),[4,this.privConnectionConfigurationPromise]);case 1:return[2,t.sent()]}}))}))},e.prototype.sendAudio=function(e){return n(this,void 0,void 0,(function(){var t,r,i,a,c,p,l=this;return o(this,(function(f){switch(f.label){case 0:return[4,this.audioSource.format];case 1:return t=f.sent(),r=Date.now(),i=this.privRecognizerConfig.parameters.getProperty("SPEECH-TransmitLengthBeforThrottleMs","5000"),a=t.avgBytesPerSec/1e3*parseInt(i,10),c=this.privRequestSession.recogNumber,p=function(){return n(l,void 0,void 0,(function(){var n,i,l,f,h=this;return o(this,(function(o){switch(o.label){case 0:return this.privIsDisposed||this.privRequestSession.isSpeechEnded||!this.privRequestSession.isRecognizing||this.privRequestSession.recogNumber!==c?[3,5]:[4,this.fetchConnection()];case 1:return n=o.sent(),[4,e.read()];case 2:return i=o.sent(),this.privRequestSession.isSpeechEnded?[2]:(l=void 0,f=void 0,!i||i.isEnd?(l=null,f=0):(l=i.buffer,this.privRequestSession.onAudioSent(l.byteLength),f=a>=this.privRequestSession.bytesSent?0:Math.max(0,r-Date.now())),0===f?[3,4]:[4,this.delay(f)]);case 3:o.sent(),o.label=4;case 4:if(null!==l&&(r=Date.now()+1e3*l.byteLength/(2*t.avgBytesPerSec)),!this.privIsDisposed&&!this.privRequestSession.isSpeechEnded&&this.privRequestSession.isRecognizing&&this.privRequestSession.recogNumber===c){if(n.send(new u.SpeechConnectionMessage(s.MessageType.Binary,"audio",this.privRequestSession.requestId,null,l)).catch((function(){h.privRequestSession.onServiceTurnEndResponse(h.privRecognizerConfig.isContinuousRecognition).catch((function(){}))})),!(null==i?void 0:i.isEnd))return[2,p()];this.privIsLiveAudio||this.privRequestSession.onSpeechEnded()}o.label=5;case 5:return[2]}}))}))},[2,p()]}}))}))},e.prototype.retryableConnect=function(){return n(this,void 0,void 0,(function(){var e,t,r,n,i,c,u,p=this;return o(this,(function(o){switch(o.label){case 0:e=!1,this.privAuthFetchEventId=s.createNoDashGuid(),t=this.privRequestSession.sessionId,this.privConnectionId=void 0!==t?t:s.createNoDashGuid(),this.privRequestSession.onPreConnectionStart(this.privAuthFetchEventId,this.privConnectionId),r=0,n="",o.label=1;case 1:return this.privRequestSession.numConnectionAttempts<=this.privRecognizerConfig.maxRetryCount?[4,e?this.privAuthentication.fetchOnExpiry(this.privAuthFetchEventId):this.privAuthentication.fetch(this.privAuthFetchEventId)]:[3,8];case 2:return i=o.sent(),[4,this.privRequestSession.onAuthCompleted(!1)];case 3:return o.sent(),c=this.privConnectionFactory.create(this.privRecognizerConfig,i,this.privConnectionId),this.privRequestSession.listenForServiceTelemetry(c.events),c.events.attach((function(e){p.connectionEvents.onEvent(e)})),[4,c.open()];case 4:return 200!==(u=o.sent()).statusCode?[3,6]:[4,this.privRequestSession.onConnectionEstablishCompleted(u.statusCode)];case 5:return o.sent(),[2,Promise.resolve(c)];case 6:1006===u.statusCode&&(e=!0),o.label=7;case 7:return r=u.statusCode,n=u.reason,this.privRequestSession.onRetryConnection(),[3,1];case 8:return[4,this.privRequestSession.onConnectionEstablishCompleted(r,n)];case 9:return o.sent(),[2,Promise.reject("Unable to contact server. StatusCode: "+r+", "+this.privRecognizerConfig.parameters.getProperty(a.PropertyId.SpeechServiceConnection_Endpoint)+" Reason: "+n)]}}))}))},e.prototype.delay=function(e){var t=this;return new Promise((function(r,n){t.privSetTimeout(r,e)}))},e.prototype.writeBufferToConsole=function(e){var t="Buffer Size: ";if(null===e)t+="null";else{var r=new Uint8Array(e);t+=e.byteLength+"\r\n";for(var n=0;n<e.byteLength;n++)t+=r[n].toString(16).padStart(2,"0")+" "}console.info(t)},e.prototype.sendFinalAudio=function(){return n(this,void 0,void 0,(function(){return o(this,(function(e){switch(e.label){case 0:return[4,this.fetchConnection()];case 1:return[4,e.sent().send(new u.SpeechConnectionMessage(s.MessageType.Binary,"audio",this.privRequestSession.requestId,null,null))];case 2:return e.sent(),[2]}}))}))},e.prototype.configureConnection=function(){return n(this,void 0,void 0,(function(){var e;return o(this,(function(t){switch(t.label){case 0:return[4,this.connectImpl()];case 1:return e=t.sent(),void 0!==this.configConnectionOverride?[2,this.configConnectionOverride(e)]:[4,this.sendSpeechServiceConfig(e,this.privRequestSession,this.privRecognizerConfig.SpeechServiceConfig.serialize())];case 2:return t.sent(),[4,this.sendPrePayloadJSON(e)];case 3:return t.sent(),[2,e]}}))}))},e.telemetryDataEnabled=!0,e}();t.ServiceRecognizerBase=p},914:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ServiceTelemetryListener=void 0;var n=r(2370),o=r(7903),i=function(){function e(e,t,r){var i=this;this.privIsDisposed=!1,this.privListeningTriggerMetric=null,this.privMicMetric=null,this.privConnectionEstablishMetric=null,this.onEvent=function(e){i.privIsDisposed||(e instanceof o.RecognitionTriggeredEvent&&e.requestId===i.privRequestId&&(i.privListeningTriggerMetric={End:e.eventTime,Name:"ListeningTrigger",Start:e.eventTime}),e instanceof n.AudioStreamNodeAttachingEvent&&e.audioSourceId===i.privAudioSourceId&&e.audioNodeId===i.privAudioNodeId&&(i.privMicStartTime=e.eventTime),e instanceof n.AudioStreamNodeAttachedEvent&&e.audioSourceId===i.privAudioSourceId&&e.audioNodeId===i.privAudioNodeId&&(i.privMicStartTime=e.eventTime),e instanceof n.AudioSourceErrorEvent&&e.audioSourceId===i.privAudioSourceId&&(i.privMicMetric||(i.privMicMetric={End:e.eventTime,Error:e.error,Name:"Microphone",Start:i.privMicStartTime})),e instanceof n.AudioStreamNodeErrorEvent&&e.audioSourceId===i.privAudioSourceId&&e.audioNodeId===i.privAudioNodeId&&(i.privMicMetric||(i.privMicMetric={End:e.eventTime,Error:e.error,Name:"Microphone",Start:i.privMicStartTime})),e instanceof n.AudioStreamNodeDetachedEvent&&e.audioSourceId===i.privAudioSourceId&&e.audioNodeId===i.privAudioNodeId&&(i.privMicMetric||(i.privMicMetric={End:e.eventTime,Name:"Microphone",Start:i.privMicStartTime})),e instanceof o.ConnectingToServiceEvent&&e.requestId===i.privRequestId&&(i.privConnectionId=e.sessionId),e instanceof n.ConnectionStartEvent&&e.connectionId===i.privConnectionId&&(i.privConnectionStartTime=e.eventTime),e instanceof n.ConnectionEstablishedEvent&&e.connectionId===i.privConnectionId&&(i.privConnectionEstablishMetric||(i.privConnectionEstablishMetric={End:e.eventTime,Id:i.privConnectionId,Name:"Connection",Start:i.privConnectionStartTime})),e instanceof n.ConnectionEstablishErrorEvent&&e.connectionId===i.privConnectionId&&(i.privConnectionEstablishMetric||(i.privConnectionEstablishMetric={End:e.eventTime,Error:i.getConnectionError(e.statusCode),Id:i.privConnectionId,Name:"Connection",Start:i.privConnectionStartTime})),e instanceof n.ConnectionMessageReceivedEvent&&e.connectionId===i.privConnectionId&&e.message&&e.message.headers&&e.message.headers.path&&(i.privReceivedMessages[e.message.headers.path]||(i.privReceivedMessages[e.message.headers.path]=new Array),i.privReceivedMessages[e.message.headers.path].push(e.networkReceivedTime)))},this.getTelemetry=function(){var e=new Array;i.privListeningTriggerMetric&&e.push(i.privListeningTriggerMetric),i.privMicMetric&&e.push(i.privMicMetric),i.privConnectionEstablishMetric&&e.push(i.privConnectionEstablishMetric),i.privPhraseLatencies.length>0&&e.push({PhraseLatencyMs:i.privPhraseLatencies}),i.privHypothesisLatencies.length>0&&e.push({FirstHypothesisLatencyMs:i.privHypothesisLatencies});var t={Metrics:e,ReceivedMessages:i.privReceivedMessages},r=JSON.stringify(t);return i.privReceivedMessages={},i.privListeningTriggerMetric=null,i.privMicMetric=null,i.privConnectionEstablishMetric=null,i.privPhraseLatencies=[],i.privHypothesisLatencies=[],r},this.dispose=function(){i.privIsDisposed=!0},this.getConnectionError=function(e){switch(e){case 400:case 1002:case 1003:case 1005:case 1007:case 1008:case 1009:return"BadRequest";case 401:return"Unauthorized";case 403:return"Forbidden";case 503:case 1001:return"ServerUnavailable";case 500:case 1011:return"ServerError";case 408:case 504:return"Timeout";default:return"statuscode:"+e.toString()}},this.privRequestId=e,this.privAudioSourceId=t,this.privAudioNodeId=r,this.privReceivedMessages={},this.privPhraseLatencies=[],this.privHypothesisLatencies=[]}return e.prototype.phraseReceived=function(e){e>0&&this.privPhraseLatencies.push(Date.now()-e)},e.prototype.hypothesisReceived=function(e){e>0&&this.privHypothesisLatencies.push(Date.now()-e)},Object.defineProperty(e.prototype,"hasTelemetry",{get:function(){return 0!==Object.keys(this.privReceivedMessages).length||null!==this.privListeningTriggerMetric||null!==this.privMicMetric||null!==this.privConnectionEstablishMetric||0!==this.privPhraseLatencies.length||0!==this.privHypothesisLatencies.length},enumerable:!1,configurable:!0}),e}();t.ServiceTelemetryListener=i},3750:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function s(e){try{c(n.next(e))}catch(e){i(e)}}function a(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var r,n,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,n=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.SpeakerIdMessageAdapter=void 0;var i=r(6340),s=r(9480),a=function(){function e(e){var t=e.parameters.getProperty(s.PropertyId.SpeechServiceConnection_Endpoint,void 0);if(!t){var r=e.parameters.getProperty(s.PropertyId.SpeechServiceConnection_Region,"westus"),n=r&&r.toLowerCase().startsWith("china")?".azure.cn":".microsoft.com";t=e.parameters.getProperty(s.PropertyId.SpeechServiceConnection_Host,"https://"+r+".api.cognitive"+n+"/speaker/{mode}/v2.0/{dependency}")+"/profiles"}this.privUri=t;var o=i.RestConfigBase.requestOptions;o.headers[i.RestConfigBase.configParams.subscriptionKey]=e.parameters.getProperty(s.PropertyId.SpeechServiceConnection_Key,void 0),this.privRestAdapter=new i.RestMessageAdapter(o)}return e.prototype.createProfile=function(e,t){var r=this.getOperationUri(e);return this.privRestAdapter.setHeaders(i.RestConfigBase.configParams.contentTypeKey,"application/json"),this.privRestAdapter.request(i.RestRequestType.Post,r,{},{locale:t})},e.prototype.createEnrollment=function(e,t){var r=this;this.privRestAdapter.setHeaders(i.RestConfigBase.configParams.contentTypeKey,"multipart/form-data");var n=this.getOperationUri(e.profileType)+"/"+e.profileId+"/enrollments";return t.blob.then((function(e){return r.privRestAdapter.request(i.RestRequestType.File,n,{ignoreMinLength:"true"},null,e)}))},e.prototype.verifySpeaker=function(e,t){return n(this,void 0,void 0,(function(){var r,n,s;return o(this,(function(o){switch(o.label){case 0:this.privRestAdapter.setHeaders(i.RestConfigBase.configParams.contentTypeKey,"multipart/form-data"),r=this.getOperationUri(e.voiceProfile.profileType)+"/"+e.voiceProfile.profileId+"/verify",o.label=1;case 1:return o.trys.push([1,3,,4]),[4,t.blob];case 2:return n=o.sent(),[2,this.privRestAdapter.request(i.RestRequestType.File,r,{ignoreMinLength:"true"},null,n)];case 3:return s=o.sent(),[2,Promise.resolve({data:s})];case 4:return[2]}}))}))},e.prototype.identifySpeaker=function(e,t){return n(this,void 0,void 0,(function(){var r,n,a;return o(this,(function(o){switch(o.label){case 0:this.privRestAdapter.setHeaders(i.RestConfigBase.configParams.contentTypeKey,"multipart/form-data"),r=this.getOperationUri(s.VoiceProfileType.TextIndependentIdentification)+"/identifySingleSpeaker",o.label=1;case 1:return o.trys.push([1,3,,4]),[4,t.blob];case 2:return n=o.sent(),[2,this.privRestAdapter.request(i.RestRequestType.File,r,{profileIds:e.voiceProfileIds,ignoreMinLength:"true"},null,n)];case 3:return a=o.sent(),[2,Promise.resolve({data:a})];case 4:return[2]}}))}))},e.prototype.getProfileStatus=function(e){var t=this.getOperationUri(e.profileType)+"/"+e.profileId;return this.privRestAdapter.request(i.RestRequestType.Get,t,{})},e.prototype.getProfiles=function(e){var t=this.getOperationUri(e);return this.privRestAdapter.request(i.RestRequestType.Get,t,{})},e.prototype.getAuthorizationPhrases=function(e){var t=(""+this.getOperationUri(s.VoiceProfileType.TextDependentVerification)).replace("profiles","phrases")+"/"+e;return this.privRestAdapter.request(i.RestRequestType.Get,t,{})},e.prototype.deleteProfile=function(e){var t=this.getOperationUri(e.profileType)+"/"+e.profileId;return this.privRestAdapter.request(i.RestRequestType.Delete,t,{})},e.prototype.resetProfile=function(e){var t=this.getOperationUri(e.profileType)+"/"+e.profileId+"/reset";return this.privRestAdapter.request(i.RestRequestType.Post,t,{})},e.prototype.getOperationUri=function(e){var t=e===s.VoiceProfileType.TextIndependentIdentification?"identification":"verification",r=e===s.VoiceProfileType.TextDependentVerification?"text-dependent":"text-independent";return this.privUri.replace("{mode}",t).replace("{dependency}",r)},e}();t.SpeakerIdMessageAdapter=a},6725:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SpeakerRecognitionConfig=void 0;var n=r(21),o=function(){function e(e,t){this.privContext=e||new n.Context(null),this.privParameters=t}return Object.defineProperty(e.prototype,"parameters",{get:function(){return this.privParameters},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"Context",{get:function(){return this.privContext},enumerable:!1,configurable:!0}),e}();t.SpeakerRecognitionConfig=o},9266:function(e,t,r){"use strict";var n,o=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},n(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.SpeechConnectionFactory=void 0;var i=r(6340),s=r(21),a=r(9480),c=r(4216),u=r(21),p=r(1562),l=r(9291),f=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.interactiveRelativeUri="/speech/recognition/interactive/cognitiveservices/v1",t.conversationRelativeUri="/speech/recognition/conversation/cognitiveservices/v1",t.dictationRelativeUri="/speech/recognition/dictation/cognitiveservices/v1",t.create=function(e,r,n){var o=e.parameters.getProperty(a.PropertyId.SpeechServiceConnection_Endpoint,void 0),c=e.parameters.getProperty(a.PropertyId.SpeechServiceConnection_Region,void 0),f=c&&c.toLowerCase().startsWith("china")?".azure.cn":".microsoft.com",h=e.parameters.getProperty(a.PropertyId.SpeechServiceConnection_Host,"wss://"+c+".stt.speech"+f),v={},d=e.parameters.getProperty(a.PropertyId.SpeechServiceConnection_EndpointId,void 0),y=e.parameters.getProperty(a.PropertyId.SpeechServiceConnection_RecoLanguage,void 0);if(d?o&&-1!==o.search(l.QueryParameterNames.CustomSpeechDeploymentId)||(v[l.QueryParameterNames.CustomSpeechDeploymentId]=d):y&&(o&&-1!==o.search(l.QueryParameterNames.Language)||(v[l.QueryParameterNames.Language]=y)),o&&-1!==o.search(l.QueryParameterNames.Format)||(v[l.QueryParameterNames.Format]=e.parameters.getProperty(s.OutputFormatPropertyName,a.OutputFormat[a.OutputFormat.Simple]).toLowerCase()),void 0!==e.autoDetectSourceLanguages&&(v[l.QueryParameterNames.EnableLanguageId]="true"),t.setCommonUrlParams(e,v,o),!o)switch(e.recognitionMode){case u.RecognitionMode.Conversation:o="true"===e.parameters.getProperty(s.ForceDictationPropertyName,"false")?h+t.dictationRelativeUri:h+t.conversationRelativeUri;break;case u.RecognitionMode.Dictation:o=h+t.dictationRelativeUri;break;default:o=h+t.interactiveRelativeUri}var g={};void 0!==r.token&&""!==r.token&&(g[r.headerName]=r.token),g[p.HeaderNames.ConnectionId]=n,e.parameters.setProperty(a.PropertyId.SpeechServiceConnection_Url,o);var m="true"===e.parameters.getProperty("SPEECH-EnableWebsocketCompression","false");return new i.WebsocketConnection(o,v,g,new u.WebsocketMessageFormatter,i.ProxyInfo.fromRecognizerConfig(e),m,n)},t}return o(t,e),t}(c.ConnectionFactoryBase);t.SpeechConnectionFactory=f},4921:function(e,t,r){"use strict";var n,o=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},n(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.SpeechConnectionMessage=void 0;var i=r(2370),s=r(1562),a=function(e){function t(t,r,n,o,a,c,u,p){var l=this;if(!r)throw new i.ArgumentNullError("path");if(!n)throw new i.ArgumentNullError("requestId");var f={};if(f[s.HeaderNames.Path]=r,f[s.HeaderNames.RequestId]=n,f[s.HeaderNames.RequestTimestamp]=(new Date).toISOString(),o&&(f[s.HeaderNames.ContentType]=o),c&&(f[s.HeaderNames.RequestStreamId]=c),u)for(var h in u)h&&(f[h]=u[h]);return(l=p?e.call(this,t,a,f,p)||this:e.call(this,t,a,f)||this).privPath=r,l.privRequestId=n,l.privContentType=o,l.privStreamId=c,l.privAdditionalHeaders=u,l}return o(t,e),Object.defineProperty(t.prototype,"path",{get:function(){return this.privPath},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"requestId",{get:function(){return this.privRequestId},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"contentType",{get:function(){return this.privContentType},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"streamId",{get:function(){return this.privStreamId},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"additionalHeaders",{get:function(){return this.privAdditionalHeaders},enumerable:!1,configurable:!0}),t.fromConnectionMessage=function(e){var r=null,n=null,o=null,i=null,a={};if(e.headers)for(var c in e.headers)c&&(c.toLowerCase()===s.HeaderNames.Path.toLowerCase()?r=e.headers[c]:c.toLowerCase()===s.HeaderNames.RequestId.toLowerCase()?n=e.headers[c]:c.toLowerCase()===s.HeaderNames.RequestTimestamp.toLowerCase()?e.headers[c]:c.toLowerCase()===s.HeaderNames.ContentType.toLowerCase()?o=e.headers[c]:c.toLowerCase()===s.HeaderNames.RequestStreamId.toLowerCase()?i=e.headers[c]:a[c]=e.headers[c]);return new t(e.messageType,r,n,o,e.body,i,a,e.id)},t}(i.ConnectionMessage);t.SpeechConnectionMessage=a},9843:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SpeechContext=void 0;var r=function(){function e(e){this.privContext={},this.privDynamicGrammar=e}return e.prototype.setSection=function(e,t){this.privContext[e]=t},e.prototype.setPronunciationAssessmentParams=function(e){void 0===this.privContext.phraseDetection&&(this.privContext.phraseDetection={enrichment:{pronunciationAssessment:{}}}),this.privContext.phraseDetection.enrichment.pronunciationAssessment=JSON.parse(e),void 0===this.privContext.phraseOutput&&(this.privContext.phraseOutput={detailed:{options:[]},format:{}}),this.privContext.phraseOutput.format="Detailed",this.privContext.phraseOutput.detailed.options.push("PronunciationAssessment"),-1===this.privContext.phraseOutput.detailed.options.indexOf("WordTimings")&&this.privContext.phraseOutput.detailed.options.push("WordTimings")},e.prototype.toJSON=function(){var e=this.privDynamicGrammar.generateGrammarObject();return this.setSection("dgi",e),JSON.stringify(this.privContext)},e}();t.SpeechContext=r},7534:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},6247:function(e,t,r){"use strict";var n,o=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},n(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),i=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function s(e){try{c(n.next(e))}catch(e){i(e)}}function a(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))},s=this&&this.__generator||function(e,t){var r,n,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,n=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.SpeechServiceRecognizer=void 0;var a=r(9480),c=r(21),u=function(e){function t(t,r,n,o,i){var s=e.call(this,t,r,n,o,i)||this;if(s.privSpeechRecognizer=i,void 0!==o.autoDetectSourceLanguages){var a=o.autoDetectSourceLanguages.split(",");s.privSpeechContext.setSection("languageId",{languages:a,onSuccess:{action:"Recognize"},onUnknown:{action:"None"}}),s.privSpeechContext.setSection("phraseOutput",{interimResults:{resultType:"Auto"},phraseResults:{resultType:"Always"}})}return s}return o(t,e),t.prototype.processTypeSpecificMessages=function(e){return i(this,void 0,void 0,(function(){var t,r,n,o,i,u,p,l,f,h,v;return s(this,(function(s){switch(s.label){case 0:switch((r=new a.PropertyCollection).setProperty(a.PropertyId.SpeechServiceResponse_JsonResult,e.textBody),n=!1,e.path.toLowerCase()){case"speech.hypothesis":case"speech.fragment":return[3,1];case"speech.phrase":return[3,2]}return[3,6];case 1:if(o=c.SpeechHypothesis.fromJSON(e.textBody),i=o.Offset+this.privRequestSession.currentTurnAudioOffset,t=new a.SpeechRecognitionResult(this.privRequestSession.requestId,a.ResultReason.RecognizingSpeech,o.Text,o.Duration,i,o.Language,o.LanguageDetectionConfidence,void 0,void 0,e.textBody,r),this.privRequestSession.onHypothesis(i),u=new a.SpeechRecognitionEventArgs(t,o.Duration,this.privRequestSession.sessionId),this.privSpeechRecognizer.recognizing)try{this.privSpeechRecognizer.recognizing(this.privSpeechRecognizer,u)}catch(e){}return n=!0,[3,7];case 2:return p=c.SimpleSpeechPhrase.fromJSON(e.textBody),l=c.EnumTranslation.implTranslateRecognitionResult(p.RecognitionStatus),this.privRequestSession.onPhraseRecognized(this.privRequestSession.currentTurnAudioOffset+p.Offset+p.Duration),a.ResultReason.Canceled!==l?[3,4]:(f=c.EnumTranslation.implTranslateCancelResult(p.RecognitionStatus),[4,this.cancelRecognitionLocal(f,c.EnumTranslation.implTranslateCancelErrorCode(p.RecognitionStatus),void 0)]);case 3:return s.sent(),[3,5];case 4:if((!this.privRequestSession.isSpeechEnded||l!==a.ResultReason.NoMatch||p.RecognitionStatus===c.RecognitionStatus.InitialSilenceTimeout)&&(this.privRecognizerConfig.parameters.getProperty(c.OutputFormatPropertyName)===a.OutputFormat[a.OutputFormat.Simple]?t=new a.SpeechRecognitionResult(this.privRequestSession.requestId,l,p.DisplayText,p.Duration,p.Offset+this.privRequestSession.currentTurnAudioOffset,p.Language,p.LanguageDetectionConfidence,void 0,void 0,e.textBody,r):(h=c.DetailedSpeechPhrase.fromJSON(e.textBody),t=new a.SpeechRecognitionResult(this.privRequestSession.requestId,l,h.RecognitionStatus===c.RecognitionStatus.Success?h.NBest[0].Display:void 0,h.Duration,h.Offset+this.privRequestSession.currentTurnAudioOffset,h.Language,h.LanguageDetectionConfidence,void 0,void 0,e.textBody,r)),v=new a.SpeechRecognitionEventArgs(t,t.offset,this.privRequestSession.sessionId),this.privSpeechRecognizer.recognized))try{this.privSpeechRecognizer.recognized(this.privSpeechRecognizer,v)}catch(e){}if(this.privSuccessCallback){try{this.privSuccessCallback(t)}catch(e){this.privErrorCallback&&this.privErrorCallback(e)}this.privSuccessCallback=void 0,this.privErrorCallback=void 0}s.label=5;case 5:return n=!0,[3,7];case 6:return[3,7];case 7:return[2,n]}}))}))},t.prototype.cancelRecognition=function(e,t,r,n,o){var i=new a.PropertyCollection;if(i.setProperty(c.CancellationErrorCodePropertyName,a.CancellationErrorCode[n]),this.privSpeechRecognizer.canceled){var s=new a.SpeechRecognitionCanceledEventArgs(r,o,n,void 0,e);try{this.privSpeechRecognizer.canceled(this.privSpeechRecognizer,s)}catch(e){}}if(this.privSuccessCallback){var u=new a.SpeechRecognitionResult(t,a.ResultReason.Canceled,void 0,void 0,void 0,void 0,void 0,void 0,o,void 0,i);try{this.privSuccessCallback(u),this.privSuccessCallback=void 0}catch(e){}}},t}(c.ServiceRecognizerBase);t.SpeechServiceRecognizer=u},1708:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SpeechSynthesisConnectionFactory=void 0;var n=r(6340),o=r(9480),i=r(21),s=r(1562),a=r(9291);t.SpeechSynthesisConnectionFactory=function(){var e=this;this.synthesisUri="/cognitiveservices/websocket/v1",this.create=function(t,r,c){var u=t.parameters.getProperty(o.PropertyId.SpeechServiceConnection_Endpoint,void 0),p=t.parameters.getProperty(o.PropertyId.SpeechServiceConnection_Region,void 0),l=p&&p.toLowerCase().startsWith("china")?".azure.cn":".microsoft.com",f=t.parameters.getProperty(o.PropertyId.SpeechServiceConnection_EndpointId,void 0),h=void 0===f?"tts":"voice",v=t.parameters.getProperty(o.PropertyId.SpeechServiceConnection_Host,"wss://"+p+"."+h+".speech"+l);u||(u=v+e.synthesisUri);var d={};void 0!==r.token&&""!==r.token&&(d[r.headerName]=r.token),d[s.HeaderNames.ConnectionId]=c,void 0!==f&&(d[a.QueryParameterNames.CustomVoiceDeploymentId]=f),t.parameters.setProperty(o.PropertyId.SpeechServiceConnection_Url,u);var y="true"===t.parameters.getProperty("SPEECH-EnableWebsocketCompression","false");return new n.WebsocketConnection(u,{},d,new i.WebsocketMessageFormatter,n.ProxyInfo.fromParameters(t.parameters),y,c)}}},7147:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function s(e){try{c(n.next(e))}catch(e){i(e)}}function a(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var r,n,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,n=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.SynthesisAdapterBase=void 0;var i=r(2370),s=r(9480),a=r(21),c=r(4921),u=function(){function e(e,t,r,n,o){var u=this;if(this.speakOverride=void 0,this.receiveMessageOverride=void 0,this.connectImplOverride=void 0,this.configConnectionOverride=void 0,this.sendSynthesisContext=function(e){var t=u.synthesisContext.toJSON();if(t)return e.send(new c.SpeechConnectionMessage(i.MessageType.Text,"synthesis.context",u.privSynthesisTurn.requestId,"application/json",t))},this.sendSpeechServiceConfig=function(e,t){if(t)return e.send(new c.SpeechConnectionMessage(i.MessageType.Text,"speech.config",u.privSynthesisTurn.requestId,"application/json",t))},this.sendSsmlMessage=function(e,t,r){return e.send(new c.SpeechConnectionMessage(i.MessageType.Text,"ssml",r,"application/ssml+xml",t))},!e)throw new i.ArgumentNullError("authentication");if(!t)throw new i.ArgumentNullError("connectionFactory");if(!r)throw new i.ArgumentNullError("synthesizerConfig");this.privAuthentication=e,this.privConnectionFactory=t,this.privSynthesizerConfig=r,this.privIsDisposed=!1,this.privSpeechSynthesizer=n,this.privSessionAudioDestination=o,this.privSynthesisTurn=new a.SynthesisTurn,this.privConnectionEvents=new i.EventSource,this.privServiceEvents=new i.EventSource,this.privSynthesisContext=new a.SynthesisContext(this.privSpeechSynthesizer),this.privAgentConfig=new a.AgentConfig,this.connectionEvents.attach((function(e){if("ConnectionClosedEvent"===e.name){var t=e;1e3!==t.statusCode&&u.cancelSynthesisLocal(s.CancellationReason.Error,1007===t.statusCode?s.CancellationErrorCode.BadRequestParameters:s.CancellationErrorCode.ConnectionFailure,t.reason+" websocket error code: "+t.statusCode)}}))}return Object.defineProperty(e.prototype,"synthesisContext",{get:function(){return this.privSynthesisContext},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"agentConfig",{get:function(){return this.privAgentConfig},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"connectionEvents",{get:function(){return this.privConnectionEvents},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"serviceEvents",{get:function(){return this.privServiceEvents},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"activityTemplate",{get:function(){return this.privActivityTemplate},set:function(e){this.privActivityTemplate=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"audioOutputFormat",{set:function(e){this.privAudioOutputFormat=e,this.privSynthesisTurn.audioOutputFormat=e,void 0!==this.privSessionAudioDestination&&(this.privSessionAudioDestination.format=e),void 0!==this.synthesisContext&&(this.synthesisContext.audioOutputFormat=e)},enumerable:!1,configurable:!0}),e.addHeader=function(e,t){if(!t.hasHeader)return e;t.updateHeader(e.byteLength);var r=new Uint8Array(e.byteLength+t.header.byteLength);return r.set(new Uint8Array(t.header),0),r.set(new Uint8Array(e),t.header.byteLength),r.buffer},e.prototype.isDisposed=function(){return this.privIsDisposed},e.prototype.dispose=function(e){return n(this,void 0,void 0,(function(){return o(this,(function(t){switch(t.label){case 0:return this.privIsDisposed=!0,void 0!==this.privSessionAudioDestination&&this.privSessionAudioDestination.close(),this.privConnectionConfigurationPromise?[4,this.privConnectionConfigurationPromise]:[3,3];case 1:return[4,t.sent().dispose(e)];case 2:t.sent(),t.label=3;case 3:return[2]}}))}))},e.prototype.connect=function(){return n(this,void 0,void 0,(function(){return o(this,(function(e){switch(e.label){case 0:return[4,this.connectImpl()];case 1:return e.sent(),[2]}}))}))},e.prototype.sendNetworkMessage=function(e,t){return n(this,void 0,void 0,(function(){var r,n;return o(this,(function(o){switch(o.label){case 0:return r="string"==typeof t?i.MessageType.Text:i.MessageType.Binary,n="string"==typeof t?"application/json":"",[4,this.fetchConnection()];case 1:return[2,o.sent().send(new c.SpeechConnectionMessage(r,e,this.privSynthesisTurn.requestId,n,t))]}}))}))},e.prototype.Speak=function(e,t,r,i,a,c){return n(this,void 0,void 0,(function(){var n,u,p,l;return o(this,(function(o){switch(o.label){case 0:if(n=t?e:this.privSpeechSynthesizer.buildSsml(e),void 0!==this.speakOverride)return[2,this.speakOverride(n,r,i,a)];this.privSuccessCallback=i,this.privErrorCallback=a,this.privSynthesisTurn.startNewSynthesis(r,e,t,c),o.label=1;case 1:return o.trys.push([1,6,,7]),[4,this.connectImpl()];case 2:return o.sent(),[4,this.fetchConnection()];case 3:return u=o.sent(),[4,this.sendSynthesisContext(u)];case 4:return o.sent(),[4,this.sendSsmlMessage(u,n,r)];case 5:return o.sent(),p=new s.SpeechSynthesisEventArgs(new s.SpeechSynthesisResult(r,s.ResultReason.SynthesizingAudioStarted)),this.privSpeechSynthesizer.synthesisStarted&&this.privSpeechSynthesizer.synthesisStarted(this.privSpeechSynthesizer,p),this.receiveMessage(),[3,7];case 6:return l=o.sent(),this.cancelSynthesisLocal(s.CancellationReason.Error,s.CancellationErrorCode.ConnectionFailure,l),[2,Promise.reject(l)];case 7:return[2]}}))}))},e.prototype.cancelSynthesis=function(e,t,r,n){var o=new s.PropertyCollection;o.setProperty(a.CancellationErrorCodePropertyName,s.CancellationErrorCode[r]);var i=new s.SpeechSynthesisResult(e,s.ResultReason.Canceled,void 0,n,o);if(this.privSpeechSynthesizer.SynthesisCanceled){var c=new s.SpeechSynthesisEventArgs(i);try{this.privSpeechSynthesizer.SynthesisCanceled(this.privSpeechSynthesizer,c)}catch(e){}}if(this.privSuccessCallback)try{this.privSuccessCallback(i)}catch(e){}},e.prototype.cancelSynthesisLocal=function(e,t,r){this.privSynthesisTurn.isSynthesizing&&(this.privSynthesisTurn.onStopSynthesizing(),this.cancelSynthesis(this.privSynthesisTurn.requestId,e,t,r))},e.prototype.processTypeSpecificMessages=function(e,t,r){return!0},e.prototype.receiveMessage=function(){return n(this,void 0,void 0,(function(){var t,r,n,u,p,l,f,h,v,d,y,g,m,b;return o(this,(function(o){switch(o.label){case 0:return o.trys.push([0,14,,15]),[4,this.fetchConnection()];case 1:return[4,o.sent().read()];case 2:if(t=o.sent(),void 0!==this.receiveMessageOverride)return[2,this.receiveMessageOverride()];if(this.privIsDisposed)return[2];if(!t)return this.privSynthesisTurn.isSynthesizing?[2,this.receiveMessage()]:[2];if(this.privServiceHasSentMessage=!0,(r=c.SpeechConnectionMessage.fromConnectionMessage(t)).requestId.toLowerCase()!==this.privSynthesisTurn.requestId.toLowerCase())return[3,13];switch(r.path.toLowerCase()){case"turn.start":return[3,3];case"response":return[3,4];case"audio":return[3,5];case"audio.metadata":return[3,6];case"turn.end":return[3,7]}return[3,12];case 3:return this.privSynthesisTurn.onServiceTurnStartResponse(),[3,13];case 4:return this.privSynthesisTurn.onServiceResponseMessage(r.textBody),[3,13];case 5:if(this.privSynthesisTurn.streamId.toLowerCase()===r.streamId.toLowerCase()&&r.binaryBody){if(this.privSynthesisTurn.onAudioChunkReceived(r.binaryBody),this.privSpeechSynthesizer.synthesizing)try{n=e.addHeader(r.binaryBody,this.privSynthesisTurn.audioOutputFormat),u=new s.SpeechSynthesisEventArgs(new s.SpeechSynthesisResult(this.privSynthesisTurn.requestId,s.ResultReason.SynthesizingAudio,n)),this.privSpeechSynthesizer.synthesizing(this.privSpeechSynthesizer,u)}catch(e){}void 0!==this.privSessionAudioDestination&&this.privSessionAudioDestination.write(r.binaryBody)}return[3,13];case 6:for(p=a.SynthesisAudioMetadata.fromJSON(r.textBody).Metadata,l=0,f=p;l<f.length;l++)switch((h=f[l]).Type){case a.MetadataType.WordBoundary:if(this.privSynthesisTurn.onWordBoundaryEvent(h.Data.text.Text),v=new s.SpeechSynthesisWordBoundaryEventArgs(h.Data.Offset,h.Data.text.Text,h.Data.text.Length,this.privSynthesisTurn.currentTextOffset),this.privSpeechSynthesizer.wordBoundary)try{this.privSpeechSynthesizer.wordBoundary(this.privSpeechSynthesizer,v)}catch(e){}break;case a.MetadataType.Bookmark:if(d=new s.SpeechSynthesisBookmarkEventArgs(h.Data.Offset,h.Data.Bookmark),this.privSpeechSynthesizer.bookmarkReached)try{this.privSpeechSynthesizer.bookmarkReached(this.privSpeechSynthesizer,d)}catch(e){}break;case a.MetadataType.Viseme:if(this.privSynthesisTurn.onVisemeMetadataReceived(h),h.Data.IsLastAnimation&&(y=new s.SpeechSynthesisVisemeEventArgs(h.Data.Offset,h.Data.VisemeId,this.privSynthesisTurn.getAndClearVisemeAnimation()),this.privSpeechSynthesizer.visemeReceived))try{this.privSpeechSynthesizer.visemeReceived(this.privSpeechSynthesizer,y)}catch(e){}}return[3,13];case 7:this.privSynthesisTurn.onServiceTurnEndResponse(),g=void 0,o.label=8;case 8:return o.trys.push([8,10,,11]),[4,this.privSynthesisTurn.getAllReceivedAudioWithHeader()];case 9:return m=o.sent(),g=new s.SpeechSynthesisResult(this.privSynthesisTurn.requestId,s.ResultReason.SynthesizingAudioCompleted,m),this.privSuccessCallback&&this.privSuccessCallback(g),[3,11];case 10:return b=o.sent(),this.privErrorCallback&&this.privErrorCallback(b),[3,11];case 11:if(this.privSpeechSynthesizer.synthesisCompleted)try{this.privSpeechSynthesizer.synthesisCompleted(this.privSpeechSynthesizer,new s.SpeechSynthesisEventArgs(g))}catch(e){}return[3,13];case 12:this.processTypeSpecificMessages(r)||this.privServiceEvents&&this.serviceEvents.onEvent(new i.ServiceEvent(r.path.toLowerCase(),r.textBody)),o.label=13;case 13:return[2,this.receiveMessage()];case 14:return o.sent(),[3,15];case 15:return[2]}}))}))},e.prototype.connectImpl=function(e){var t=this;if(void 0===e&&(e=!1),this.privConnectionPromise)return this.privConnectionPromise.then((function(e){return e.state()===i.ConnectionState.Disconnected?(t.privConnectionId=null,t.privConnectionPromise=null,t.privServiceHasSentMessage=!1,t.connectImpl()):t.privConnectionPromise}),(function(e){return t.privConnectionId=null,t.privConnectionPromise=null,t.privServiceHasSentMessage=!1,t.connectImpl()}));this.privAuthFetchEventId=i.createNoDashGuid(),this.privConnectionId=i.createNoDashGuid(),this.privSynthesisTurn.onPreConnectionStart(this.privAuthFetchEventId,this.privConnectionId);var r=e?this.privAuthentication.fetchOnExpiry(this.privAuthFetchEventId):this.privAuthentication.fetch(this.privAuthFetchEventId);return this.privConnectionPromise=r.then((function(r){return n(t,void 0,void 0,(function(){var t,n,i=this;return o(this,(function(o){switch(o.label){case 0:return[4,this.privSynthesisTurn.onAuthCompleted(!1)];case 1:return o.sent(),(t=this.privConnectionFactory.create(this.privSynthesizerConfig,r,this.privConnectionId)).events.attach((function(e){i.connectionEvents.onEvent(e)})),[4,t.open()];case 2:return 200!==(n=o.sent()).statusCode?[3,4]:[4,this.privSynthesisTurn.onConnectionEstablishCompleted(n.statusCode)];case 3:return o.sent(),[2,Promise.resolve(t)];case 4:return 403!==n.statusCode||e?[3,5]:[2,this.connectImpl(!0)];case 5:return[4,this.privSynthesisTurn.onConnectionEstablishCompleted(n.statusCode,n.reason)];case 6:return o.sent(),[2,Promise.reject("Unable to contact server. StatusCode: "+n.statusCode+", "+this.privSynthesizerConfig.parameters.getProperty(s.PropertyId.SpeechServiceConnection_Endpoint)+" Reason: "+n.reason)]}}))}))}),(function(e){return n(t,void 0,void 0,(function(){return o(this,(function(t){switch(t.label){case 0:return[4,this.privSynthesisTurn.onAuthCompleted(!0,e)];case 1:throw t.sent(),new Error(e)}}))}))})),this.privConnectionPromise.catch((function(){})),this.privConnectionPromise},e.prototype.fetchConnection=function(){return n(this,void 0,void 0,(function(){var e=this;return o(this,(function(t){switch(t.label){case 0:return this.privConnectionConfigurationPromise?[2,this.privConnectionConfigurationPromise.then((function(t){return t.state()===i.ConnectionState.Disconnected?(e.privConnectionId=null,e.privConnectionConfigurationPromise=null,e.privServiceHasSentMessage=!1,e.fetchConnection()):e.privConnectionConfigurationPromise}),(function(t){return e.privConnectionId=null,e.privConnectionConfigurationPromise=null,e.privServiceHasSentMessage=!1,e.fetchConnection()}))]:(this.privConnectionConfigurationPromise=this.configureConnection(),[4,this.privConnectionConfigurationPromise]);case 1:return[2,t.sent()]}}))}))},e.prototype.configureConnection=function(){return n(this,void 0,void 0,(function(){var e;return o(this,(function(t){switch(t.label){case 0:return[4,this.connectImpl()];case 1:return e=t.sent(),void 0!==this.configConnectionOverride?[2,this.configConnectionOverride(e)]:[4,this.sendSpeechServiceConfig(e,this.privSynthesizerConfig.SpeechServiceConfig.serialize())];case 2:return t.sent(),[2,e]}}))}))},e.telemetryDataEnabled=!0,e}();t.SynthesisAdapterBase=u},2464:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SynthesisContext=void 0;var r=function(){function e(e){this.privContext={},this.privSpeechSynthesizer=e}return e.prototype.setSection=function(e,t){this.privContext[e]=t},Object.defineProperty(e.prototype,"audioOutputFormat",{set:function(e){this.privAudioOutputFormat=e},enumerable:!1,configurable:!0}),e.prototype.toJSON=function(){var e=this.buildSynthesisContext();return this.setSection("synthesis",e),JSON.stringify(this.privContext)},e.prototype.buildSynthesisContext=function(){return{audio:{metadataOptions:{bookmarkEnabled:!!this.privSpeechSynthesizer.bookmarkReached,sentenceBoundaryEnabled:!1,visemeEnabled:!!this.privSpeechSynthesizer.visemeReceived,wordBoundaryEnabled:!!this.privSpeechSynthesizer.wordBoundary},outputFormat:this.privAudioOutputFormat.requestAudioFormatString},language:{autoDetection:this.privSpeechSynthesizer.autoDetectSourceLanguage}}},e}();t.SynthesisContext=r},3384:function(e,t,r){"use strict";var n,o=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},n(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.SynthesisStartedEvent=t.ConnectingToSynthesisServiceEvent=t.SynthesisTriggeredEvent=t.SpeechSynthesisEvent=void 0;var i=r(2370),s=function(e){function t(t,r,n){void 0===n&&(n=i.EventType.Info);var o=e.call(this,t,n)||this;return o.privRequestId=r,o}return o(t,e),Object.defineProperty(t.prototype,"requestId",{get:function(){return this.privRequestId},enumerable:!1,configurable:!0}),t}(i.PlatformEvent);t.SpeechSynthesisEvent=s;var a=function(e){function t(t,r,n){var o=e.call(this,"SynthesisTriggeredEvent",t)||this;return o.privSessionAudioDestinationId=r,o.privTurnAudioDestinationId=n,o}return o(t,e),Object.defineProperty(t.prototype,"audioSessionDestinationId",{get:function(){return this.privSessionAudioDestinationId},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"audioTurnDestinationId",{get:function(){return this.privTurnAudioDestinationId},enumerable:!1,configurable:!0}),t}(s);t.SynthesisTriggeredEvent=a;var c=function(e){function t(t,r){var n=e.call(this,"ConnectingToSynthesisServiceEvent",t)||this;return n.privAuthFetchEventId=r,n}return o(t,e),Object.defineProperty(t.prototype,"authFetchEventId",{get:function(){return this.privAuthFetchEventId},enumerable:!1,configurable:!0}),t}(s);t.ConnectingToSynthesisServiceEvent=c;var u=function(e){function t(t,r){var n=e.call(this,"SynthesisStartedEvent",t)||this;return n.privAuthFetchEventId=r,n}return o(t,e),Object.defineProperty(t.prototype,"authFetchEventId",{get:function(){return this.privAuthFetchEventId},enumerable:!1,configurable:!0}),t}(s);t.SynthesisStartedEvent=u},3990:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function s(e){try{c(n.next(e))}catch(e){i(e)}}function a(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var r,n,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,n=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.SynthesisTurn=void 0;var i=r(2370),s=r(5149),a=r(7147),c=r(3384),u=function(){function e(){var e=this;this.privIsDisposed=!1,this.privIsSynthesizing=!1,this.privIsSynthesisEnded=!1,this.privBytesReceived=0,this.privInTurn=!1,this.privTextOffset=0,this.privNextSearchTextIndex=0,this.onPreConnectionStart=function(t,r){e.privAuthFetchEventId=t,e.onEvent(new c.ConnectingToSynthesisServiceEvent(e.privRequestId,e.privAuthFetchEventId))},this.onAuthCompleted=function(t,r){t&&e.onComplete()},this.onConnectionEstablishCompleted=function(t,r){if(200===t)return e.onEvent(new c.SynthesisStartedEvent(e.requestId,e.privAuthFetchEventId)),void(e.privBytesReceived=0);403===t&&e.onComplete()},this.onServiceResponseMessage=function(t){var r=JSON.parse(t);e.streamId=r.audio.streamId},this.onServiceTurnEndResponse=function(){e.privInTurn=!1,e.privTurnDeferral.resolve(),e.onComplete()},this.onServiceTurnStartResponse=function(){e.privTurnDeferral&&e.privInTurn&&(e.privTurnDeferral.reject("Another turn started before current completed."),e.privTurnDeferral.promise.then().catch((function(){}))),e.privInTurn=!0,e.privTurnDeferral=new i.Deferred},this.dispose=function(t){e.privIsDisposed||(e.privIsDisposed=!0)},this.onEvent=function(e){i.Events.instance.onEvent(e)},this.onComplete=function(){e.privIsSynthesizing&&(e.privIsSynthesizing=!1,e.privIsSynthesisEnded=!0,e.privAudioOutputStream.close(),e.privInTurn=!1,void 0!==e.privTurnAudioDestination&&(e.privTurnAudioDestination.close(),e.privTurnAudioDestination=void 0))},this.privRequestId=i.createNoDashGuid(),this.privTurnDeferral=new i.Deferred,this.privTurnDeferral.resolve()}return Object.defineProperty(e.prototype,"requestId",{get:function(){return this.privRequestId},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"streamId",{get:function(){return this.privStreamId},set:function(e){this.privStreamId=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"audioOutputFormat",{get:function(){return this.privAudioOutputFormat},set:function(e){this.privAudioOutputFormat=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"turnCompletionPromise",{get:function(){return this.privTurnDeferral.promise},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isSynthesisEnded",{get:function(){return this.privIsSynthesisEnded},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isSynthesizing",{get:function(){return this.privIsSynthesizing},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"currentTextOffset",{get:function(){return this.privTextOffset},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"bytesReceived",{get:function(){return this.privBytesReceived},enumerable:!1,configurable:!0}),e.prototype.getAllReceivedAudio=function(){return n(this,void 0,void 0,(function(){return o(this,(function(e){switch(e.label){case 0:return this.privReceivedAudio?[2,Promise.resolve(this.privReceivedAudio)]:this.privIsSynthesisEnded?[4,this.readAllAudioFromStream()]:[2,null];case 1:return e.sent(),[2,Promise.resolve(this.privReceivedAudio)]}}))}))},e.prototype.getAllReceivedAudioWithHeader=function(){return n(this,void 0,void 0,(function(){var e;return o(this,(function(t){switch(t.label){case 0:return this.privReceivedAudioWithHeader?[2,this.privReceivedAudioWithHeader]:this.privIsSynthesisEnded?this.audioOutputFormat.hasHeader?[4,this.getAllReceivedAudio()]:[3,2]:[2,null];case 1:return e=t.sent(),this.privReceivedAudioWithHeader=a.SynthesisAdapterBase.addHeader(e,this.audioOutputFormat),[2,this.privReceivedAudioWithHeader];case 2:return[2,this.getAllReceivedAudio()]}}))}))},e.prototype.startNewSynthesis=function(e,t,r,n){this.privIsSynthesisEnded=!1,this.privIsSynthesizing=!0,this.privRequestId=e,this.privRawText=t,this.privIsSSML=r,this.privAudioOutputStream=new s.PullAudioOutputStreamImpl,this.privAudioOutputStream.format=this.privAudioOutputFormat,this.privReceivedAudio=null,this.privReceivedAudioWithHeader=null,this.privBytesReceived=0,this.privTextOffset=0,this.privNextSearchTextIndex=0,this.privPartialVisemeAnimation="",void 0!==n&&(this.privTurnAudioDestination=n,this.privTurnAudioDestination.format=this.privAudioOutputFormat),this.onEvent(new c.SynthesisTriggeredEvent(this.requestId,void 0,void 0===n?void 0:n.id()))},e.prototype.onAudioChunkReceived=function(e){this.isSynthesizing&&(this.privAudioOutputStream.write(e),this.privBytesReceived+=e.byteLength,void 0!==this.privTurnAudioDestination&&this.privTurnAudioDestination.write(e))},e.prototype.onWordBoundaryEvent=function(e){this.updateTextOffset(e)},e.prototype.onVisemeMetadataReceived=function(e){void 0!==e.Data.AnimationChunk&&(this.privPartialVisemeAnimation+=e.Data.AnimationChunk)},e.prototype.onStopSynthesizing=function(){this.onComplete()},e.prototype.getAndClearVisemeAnimation=function(){var e=this.privPartialVisemeAnimation;return this.privPartialVisemeAnimation="",e},e.prototype.updateTextOffset=function(e){this.privTextOffset>=0&&(this.privTextOffset=this.privRawText.indexOf(e,this.privNextSearchTextIndex),this.privTextOffset>=0&&(this.privNextSearchTextIndex=this.privTextOffset+e.length),this.privIsSSML&&this.privRawText.indexOf("<",this.privTextOffset+1)>this.privRawText.indexOf(">",this.privTextOffset+1)&&this.updateTextOffset(e))},e.prototype.readAllAudioFromStream=function(){return n(this,void 0,void 0,(function(){return o(this,(function(e){switch(e.label){case 0:if(!this.privIsSynthesisEnded)return[3,4];this.privReceivedAudio=new ArrayBuffer(this.bytesReceived),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,this.privAudioOutputStream.read(this.privReceivedAudio)];case 2:return e.sent(),[3,4];case 3:return e.sent(),this.privReceivedAudio=new ArrayBuffer(0),[3,4];case 4:return[2]}}))}))},e}();t.SynthesisTurn=u},6113:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SynthesizerConfig=t.SynthesisServiceType=void 0;var n,o=r(21);!function(e){e[e.Standard=0]="Standard",e[e.Custom=1]="Custom"}(n=t.SynthesisServiceType||(t.SynthesisServiceType={}));var i=function(){function e(e,t){this.privSynthesisServiceType=n.Standard,this.privSpeechServiceConfig=e||new o.SpeechServiceConfig(new o.Context(null)),this.privParameters=t}return Object.defineProperty(e.prototype,"parameters",{get:function(){return this.privParameters},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"synthesisServiceType",{get:function(){return this.privSynthesisServiceType},set:function(e){this.privSynthesisServiceType=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"SpeechServiceConfig",{get:function(){return this.privSpeechServiceConfig},enumerable:!1,configurable:!0}),e}();t.SynthesizerConfig=i},5399:function(e,t,r){"use strict";var n,o=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},n(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.TranscriberConnectionFactory=void 0;var i=r(6340),s=r(9480),a=r(4216),c=r(21),u=r(1562),p=r(9291),l=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.multiaudioRelativeUri="/speech/recognition/multiaudio",t.create=function(e,r,n){var o=e.parameters.getProperty(s.PropertyId.SpeechServiceConnection_Endpoint,void 0),a=e.parameters.getProperty(s.PropertyId.SpeechServiceConnection_Region,"centralus"),l=a&&a.toLowerCase().startsWith("china")?".azure.cn":".microsoft.com",f="wss://transcribe."+a+".cts.speech"+l+t.multiaudioRelativeUri,h=e.parameters.getProperty(s.PropertyId.SpeechServiceConnection_Host,f),v={},d=e.parameters.getProperty(s.PropertyId.SpeechServiceConnection_EndpointId,void 0),y=e.parameters.getProperty(s.PropertyId.SpeechServiceConnection_RecoLanguage,void 0);d?o&&-1!==o.search(p.QueryParameterNames.CustomSpeechDeploymentId)||(v[p.QueryParameterNames.CustomSpeechDeploymentId]=d):y&&(o&&-1!==o.search(p.QueryParameterNames.Language)||(v[p.QueryParameterNames.Language]=y)),t.setCommonUrlParams(e,v,o),o||(o=h);var g={};void 0!==r.token&&""!==r.token&&(g[r.headerName]=r.token),g[u.HeaderNames.ConnectionId]=n,e.parameters.setProperty(s.PropertyId.SpeechServiceConnection_Url,o);var m="true"===e.parameters.getProperty("SPEECH-EnableWebsocketCompression","false");return new i.WebsocketConnection(o,v,g,new c.WebsocketMessageFormatter,i.ProxyInfo.fromRecognizerConfig(e),m,n)},t}return o(t,e),t}(a.ConnectionFactoryBase);t.TranscriberConnectionFactory=l},6515:function(e,t,r){"use strict";var n,o=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},n(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.ConversationConnectionConfig=void 0;var i=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o(t,e),Object.defineProperty(t,"host",{get:function(){return t.privHost},enumerable:!1,configurable:!0}),Object.defineProperty(t,"apiVersion",{get:function(){return t.privApiVersion},enumerable:!1,configurable:!0}),Object.defineProperty(t,"clientAppId",{get:function(){return t.privClientAppId},enumerable:!1,configurable:!0}),Object.defineProperty(t,"defaultLanguageCode",{get:function(){return t.privDefaultLanguageCode},enumerable:!1,configurable:!0}),Object.defineProperty(t,"restPath",{get:function(){return t.privRestPath},enumerable:!1,configurable:!0}),Object.defineProperty(t,"webSocketPath",{get:function(){return t.privWebSocketPath},enumerable:!1,configurable:!0}),Object.defineProperty(t,"speechHost",{get:function(){return t.privSpeechHost},enumerable:!1,configurable:!0}),Object.defineProperty(t,"speechPath",{get:function(){return t.privSpeechPath},enumerable:!1,configurable:!0}),Object.defineProperty(t,"transcriptionEventKeys",{get:function(){return t.privTranscriptionEventKeys},enumerable:!1,configurable:!0}),t.privHost="dev.microsofttranslator.com",t.privRestPath="/capito/room",t.privApiVersion="2.0",t.privDefaultLanguageCode="en-US",t.privClientAppId="FC539C22-1767-4F1F-84BC-B4D811114F15",t.privWebSocketPath="/capito/translate",t.privSpeechHost="{region}.s2s.speech.microsoft.com",t.privSpeechPath="/speech/translation/cognitiveservices/v1",t.privTranscriptionEventKeys=["iCalUid","callId","organizer","FLAC","MTUri","DifferenciateGuestSpeakers","audiorecording","Threadid","OrganizerMri","OrganizerTenantId","UserToken"],t}(r(5597).RestConfigBase);t.ConversationConnectionConfig=i},876:function(e,t,r){"use strict";var n,o=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},n(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.ConversationConnectionFactory=void 0;var i=r(6340),s=r(2370),a=r(7348),c=r(9480),u=r(4216),p=r(6515),l=r(654),f=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o(t,e),t.prototype.create=function(e,t,r){var n=e.parameters.getProperty(c.PropertyId.ConversationTranslator_Host,p.ConversationConnectionConfig.host),o=e.parameters.getProperty(c.PropertyId.ConversationTranslator_CorrelationId,s.createGuid()),u="wss://"+n+p.ConversationConnectionConfig.webSocketPath,f=e.parameters.getProperty(c.PropertyId.ConversationTranslator_Token,void 0);a.Contracts.throwIfNullOrUndefined(f,"token");var h={};h[p.ConversationConnectionConfig.configParams.apiVersion]=p.ConversationConnectionConfig.apiVersion,h[p.ConversationConnectionConfig.configParams.token]=f,h[p.ConversationConnectionConfig.configParams.correlationId]=o;var v="true"===e.parameters.getProperty("SPEECH-EnableWebsocketCompression","false");return new i.WebsocketConnection(u,h,{},new l.ConversationWebsocketMessageFormatter,i.ProxyInfo.fromRecognizerConfig(e),v,r)},t}(u.ConnectionFactoryBase);t.ConversationConnectionFactory=f},558:function(e,t,r){"use strict";var n,o=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},n(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.ConversationConnectionMessage=void 0;var i=function(e){function t(t,r,n,o){var i=e.call(this,t,r,n,o)||this,s=JSON.parse(i.textBody);return void 0!==s.type&&(i.privConversationMessageType=s.type),i}return o(t,e),Object.defineProperty(t.prototype,"conversationMessageType",{get:function(){return this.privConversationMessageType},enumerable:!1,configurable:!0}),t}(r(2370).ConnectionMessage);t.ConversationConnectionMessage=i},1256:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ConversationManager=void 0;var n=r(7348),o=r(9480),i=r(6515),s=r(2907),a=function(){function e(){this.privRequestParams=i.ConversationConnectionConfig.configParams,this.privErrors=i.ConversationConnectionConfig.restErrors,this.privHost=i.ConversationConnectionConfig.host,this.privApiVersion=i.ConversationConnectionConfig.apiVersion,this.privRestPath=i.ConversationConnectionConfig.restPath}return e.prototype.createOrJoin=function(e,t,r,a){var c=this;try{n.Contracts.throwIfNullOrUndefined(e,"args");var u=e.getProperty(o.PropertyId.SpeechServiceConnection_RecoLanguage,i.ConversationConnectionConfig.defaultLanguageCode),p=e.getProperty(o.PropertyId.ConversationTranslator_Name),l=e.getProperty(o.PropertyId.ConversationTranslator_Host,this.privHost),f=e.getProperty(o.PropertyId.ConversationTranslator_CorrelationId),h=e.getProperty(o.PropertyId.SpeechServiceConnection_Key),v=e.getProperty(o.PropertyId.SpeechServiceConnection_Region),d=e.getProperty(o.PropertyId.SpeechServiceAuthorization_Token);n.Contracts.throwIfNullOrWhitespace(u,"languageCode"),n.Contracts.throwIfNullOrWhitespace(p,"nickname"),n.Contracts.throwIfNullOrWhitespace(l,"endpointHost");var y={};y[this.privRequestParams.apiVersion]=this.privApiVersion,y[this.privRequestParams.languageCode]=u,y[this.privRequestParams.nickname]=p;var g={};f&&(g[this.privRequestParams.correlationId]=f),g[this.privRequestParams.clientAppId]=i.ConversationConnectionConfig.clientAppId,void 0!==t?y[this.privRequestParams.roomId]=t:(n.Contracts.throwIfNullOrUndefined(v,this.privErrors.authInvalidSubscriptionRegion),g[this.privRequestParams.subscriptionRegion]=v,h?g[this.privRequestParams.subscriptionKey]=h:d?g[this.privRequestParams.authorization]="Bearer "+d:n.Contracts.throwIfNullOrUndefined(h,this.privErrors.authInvalidSubscriptionKey));var m={};m.headers=g;var b="https://"+l+this.privRestPath;s.request("post",b,y,null,m,(function(e){var t=s.extractHeaderValue(c.privRequestParams.requestId,e.headers);if(e.ok){var n=JSON.parse(e.data);if(n&&(n.requestId=t),r){try{r(n)}catch(e){a&&a(e)}r=void 0}}else if(a){var o=c.privErrors.invalidCreateJoinConversationResponse.replace("{status}",e.status.toString()),i=void 0;try{o+=" ["+(i=JSON.parse(e.data)).error.code+": "+i.error.message+"]"}catch(t){o+=" ["+e.data+"]"}t&&(o+=" "+t),a(o)}}))}catch(e){if(a)if(e instanceof Error){var S=e;a(S.name+": "+S.message)}else a(e)}},e.prototype.leave=function(e,t){var r=this;return new Promise((function(i,a){try{n.Contracts.throwIfNullOrUndefined(e,r.privErrors.invalidArgs.replace("{arg}","config")),n.Contracts.throwIfNullOrWhitespace(t,r.privErrors.invalidArgs.replace("{arg}","token"));var c=e.getProperty(o.PropertyId.ConversationTranslator_Host,r.privHost),u=e.getProperty(o.PropertyId.ConversationTranslator_CorrelationId),p={};p[r.privRequestParams.apiVersion]=r.privApiVersion,p[r.privRequestParams.sessionToken]=t;var l={};u&&(l[r.privRequestParams.correlationId]=u);var f={};f.headers=l;var h="https://"+c+r.privRestPath;s.request("delete",h,p,null,f,(function(e){e.ok,i()}))}catch(e){if(e instanceof Error){var v=e;a(v.name+": "+v.message)}else a(e)}}))},e}();t.ConversationManager=a},4238:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function s(e){try{c(n.next(e))}catch(e){i(e)}}function a(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var r,n,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,n=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.ConversationRequestSession=void 0;var i=r(2370),s=function(){function e(e){var t=this;this.privIsDisposed=!1,this.privDetachables=new Array,this.onPreConnectionStart=function(e,r){t.privSessionId=r},this.onAuthCompleted=function(e,r){e&&t.onComplete()},this.onConnectionEstablishCompleted=function(e,r){200!==e&&403===e&&t.onComplete()},this.onServiceTurnEndResponse=function(e){e?t.privRequestId=i.createNoDashGuid():t.onComplete()},this.onComplete=function(){},this.privSessionId=e,this.privRequestId=i.createNoDashGuid(),this.privRequestCompletionDeferral=new i.Deferred}return Object.defineProperty(e.prototype,"sessionId",{get:function(){return this.privSessionId},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"requestId",{get:function(){return this.privRequestId},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"completionPromise",{get:function(){return this.privRequestCompletionDeferral.promise},enumerable:!1,configurable:!0}),e.prototype.dispose=function(e){return n(this,void 0,void 0,(function(){var e,t;return o(this,(function(r){switch(r.label){case 0:if(this.privIsDisposed)return[3,4];this.privIsDisposed=!0,e=0,t=this.privDetachables,r.label=1;case 1:return e<t.length?[4,t[e].detach()]:[3,4];case 2:r.sent(),r.label=3;case 3:return e++,[3,1];case 4:return[2]}}))}))},e}();t.ConversationRequestSession=s},9982:function(e,t,r){"use strict";var n,o=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},n(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),i=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function s(e){try{c(n.next(e))}catch(e){i(e)}}function a(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))},s=this&&this.__generator||function(e,t){var r,n,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,n=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.ConversationServiceAdapter=void 0;var a=r(2370),c=r(9480),u=r(21),p=r(558),l=r(4238),f=r(7324),h=r(4618),v=r(2136),d=function(e){function t(t,r,n,o,i){var s=e.call(this,t,r,n,o,i)||this;return s.privLastPartialUtteranceId="",s.noOp=function(){},s.privConversationServiceConnector=i,s.privConversationAuthentication=t,s.receiveMessageOverride=s.receiveConversationMessageOverride,s.recognizeOverride=s.noOp,s.postConnectImplOverride=s.conversationConnectImpl,s.configConnectionOverride=s.configConnection,s.disconnectOverride=s.privDisconnect,s.privConversationRequestSession=new l.ConversationRequestSession(a.createNoDashGuid()),s.privConversationConnectionFactory=r,s.privConversationIsDisposed=!1,s}return o(t,e),t.prototype.isDisposed=function(){return e.prototype.isDisposed.call(this)||this.privConversationIsDisposed},t.prototype.dispose=function(t){return i(this,void 0,void 0,(function(){return s(this,(function(r){switch(r.label){case 0:return this.privConversationIsDisposed=!0,this.privConnectionConfigPromise?[4,this.privConnectionConfigPromise]:[3,3];case 1:return[4,r.sent().dispose(t)];case 2:r.sent(),r.label=3;case 3:return[4,e.prototype.dispose.call(this,t)];case 4:return r.sent(),[2]}}))}))},t.prototype.sendMessage=function(e){return i(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.fetchConnection()];case 1:return[2,t.sent().send(new p.ConversationConnectionMessage(a.MessageType.Text,e))]}}))}))},t.prototype.sendMessageAsync=function(e){return i(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return new a.Deferred,[4,this.fetchConnection()];case 1:return[4,t.sent().send(new p.ConversationConnectionMessage(a.MessageType.Text,e))];case 2:return t.sent(),[2]}}))}))},t.prototype.privDisconnect=function(){if(!this.terminateMessageLoop)return this.cancelRecognition(this.privConversationRequestSession.sessionId,this.privConversationRequestSession.requestId,c.CancellationReason.Error,c.CancellationErrorCode.NoError,"Disconnecting"),this.terminateMessageLoop=!0,Promise.resolve()},t.prototype.processTypeSpecificMessages=function(e,t,r){return i(this,void 0,void 0,(function(){return s(this,(function(e){return[2,!0]}))}))},t.prototype.cancelRecognition=function(e,t,r,n,o){this.terminateMessageLoop=!0;var i=new c.ConversationTranslationCanceledEventArgs(r,o,n,void 0,e);try{this.privConversationServiceConnector.canceled&&this.privConversationServiceConnector.canceled(this.privConversationServiceConnector,i)}catch(e){}},t.prototype.conversationConnectImpl=function(e){return i(this,void 0,void 0,(function(){return s(this,(function(t){return this.privConnectionLoop=this.startMessageLoop(),[2,e]}))}))},t.prototype.receiveConversationMessageOverride=function(){return i(this,void 0,void 0,(function(){var e,t,r,n,o,i,u,p,l,d,y,g,m,b;return s(this,(function(s){switch(s.label){case 0:if(this.isDisposed()||this.terminateMessageLoop)return[2,Promise.resolve()];e=new a.Deferred,s.label=1;case 1:return s.trys.push([1,4,,5]),[4,this.fetchConnection()];case 2:return[4,s.sent().read()];case 3:if(t=s.sent(),this.isDisposed()||this.terminateMessageLoop)return e.resolve(),[2,Promise.resolve()];if(!t)return[2,this.receiveConversationMessageOverride()];r=this.privConversationRequestSession.sessionId,n=!1;try{switch(t.conversationMessageType.toLowerCase()){case"info":case"participant_command":case"command":switch((o=v.CommandResponsePayload.fromJSON(t.textBody)).command.toLowerCase()){case"participantlist":i=v.ParticipantsListPayloadResponse.fromJSON(t.textBody),u=i.participants.map((function(e){return{avatar:e.avatar,displayName:e.nickname,id:e.participantId,isHost:e.ishost,isMuted:e.ismuted,isUsingTts:e.usetts,preferredLanguage:e.locale}})),this.privConversationServiceConnector.participantsListReceived&&this.privConversationServiceConnector.participantsListReceived(this.privConversationServiceConnector,new f.ParticipantsListEventArgs(i.roomid,i.token,i.translateTo,i.profanityFilter,i.roomProfanityFilter,i.roomLocked,i.muteAll,u,r));break;case"settranslatetolanguages":this.privConversationServiceConnector.participantUpdateCommandReceived&&this.privConversationServiceConnector.participantUpdateCommandReceived(this.privConversationServiceConnector,new f.ParticipantAttributeEventArgs(o.participantId,h.ConversationTranslatorCommandTypes.setTranslateToLanguages,o.value,r));break;case"setprofanityfiltering":this.privConversationServiceConnector.participantUpdateCommandReceived&&this.privConversationServiceConnector.participantUpdateCommandReceived(this.privConversationServiceConnector,new f.ParticipantAttributeEventArgs(o.participantId,h.ConversationTranslatorCommandTypes.setProfanityFiltering,o.value,r));break;case"setmute":this.privConversationServiceConnector.participantUpdateCommandReceived&&this.privConversationServiceConnector.participantUpdateCommandReceived(this.privConversationServiceConnector,new f.ParticipantAttributeEventArgs(o.participantId,h.ConversationTranslatorCommandTypes.setMute,o.value,r));break;case"setmuteall":this.privConversationServiceConnector.muteAllCommandReceived&&this.privConversationServiceConnector.muteAllCommandReceived(this.privConversationServiceConnector,new f.MuteAllEventArgs(o.value,r));break;case"roomexpirationwarning":this.privConversationServiceConnector.conversationExpiration&&this.privConversationServiceConnector.conversationExpiration(this.privConversationServiceConnector,new c.ConversationExpirationEventArgs(o.value,this.privConversationRequestSession.sessionId));break;case"setusetts":this.privConversationServiceConnector.participantUpdateCommandReceived&&this.privConversationServiceConnector.participantUpdateCommandReceived(this.privConversationServiceConnector,new f.ParticipantAttributeEventArgs(o.participantId,h.ConversationTranslatorCommandTypes.setUseTTS,o.value,r));break;case"setlockstate":this.privConversationServiceConnector.lockRoomCommandReceived&&this.privConversationServiceConnector.lockRoomCommandReceived(this.privConversationServiceConnector,new f.LockRoomEventArgs(o.value,r));break;case"changenickname":this.privConversationServiceConnector.participantUpdateCommandReceived&&this.privConversationServiceConnector.participantUpdateCommandReceived(this.privConversationServiceConnector,new f.ParticipantAttributeEventArgs(o.participantId,h.ConversationTranslatorCommandTypes.changeNickname,o.nickname,r));break;case"joinsession":p=v.ParticipantPayloadResponse.fromJSON(t.textBody),l={avatar:p.avatar,displayName:p.nickname,id:p.participantId,isHost:p.ishost,isMuted:p.ismuted,isUsingTts:p.usetts,preferredLanguage:p.locale},this.privConversationServiceConnector.participantJoinCommandReceived&&this.privConversationServiceConnector.participantJoinCommandReceived(this.privConversationServiceConnector,new f.ParticipantEventArgs(l,r));break;case"leavesession":d={id:o.participantId},this.privConversationServiceConnector.participantLeaveCommandReceived&&this.privConversationServiceConnector.participantLeaveCommandReceived(this.privConversationServiceConnector,new f.ParticipantEventArgs(d,r));break;case"disconnectsession":o.participantId}break;case"partial":case"final":y=v.SpeechResponsePayload.fromJSON(t.textBody),g=new c.ConversationTranslationResult(y.participantId,this.getTranslations(y.translations),y.language,void 0,void 0,y.recognition,void 0,void 0,t.textBody,void 0),y.isFinal?((void 0!==g.text&&g.text.length>0||y.id===this.privLastPartialUtteranceId)&&(n=!0),n&&this.privConversationServiceConnector.translationReceived&&this.privConversationServiceConnector.translationReceived(this.privConversationServiceConnector,new f.ConversationReceivedTranslationEventArgs(h.ConversationTranslatorMessageTypes.final,g,r))):void 0!==g.text&&(this.privLastPartialUtteranceId=y.id,this.privConversationServiceConnector.translationReceived&&this.privConversationServiceConnector.translationReceived(this.privConversationServiceConnector,new f.ConversationReceivedTranslationEventArgs(h.ConversationTranslatorMessageTypes.partial,g,r)));break;case"translated_message":m=v.TextResponsePayload.fromJSON(t.textBody),b=new c.ConversationTranslationResult(m.participantId,this.getTranslations(m.translations),m.language,void 0,void 0,m.originalText,void 0,void 0,void 0,t.textBody,void 0),this.privConversationServiceConnector.translationReceived&&this.privConversationServiceConnector.translationReceived(this.privConversationServiceConnector,new f.ConversationReceivedTranslationEventArgs(h.ConversationTranslatorMessageTypes.instantMessage,b,r))}}catch(e){}return[2,this.receiveConversationMessageOverride()];case 4:return s.sent(),this.terminateMessageLoop=!0,[3,5];case 5:return[2,e.promise]}}))}))},t.prototype.startMessageLoop=function(){return i(this,void 0,void 0,(function(){var e,t;return s(this,(function(r){switch(r.label){case 0:if(this.isDisposed())return[2,Promise.resolve()];this.terminateMessageLoop=!1,e=this.receiveConversationMessageOverride(),r.label=1;case 1:return r.trys.push([1,3,,4]),[4,e];case 2:return[2,r.sent()];case 3:return t=r.sent(),this.cancelRecognition(this.privRequestSession?this.privRequestSession.sessionId:"",this.privRequestSession?this.privRequestSession.requestId:"",c.CancellationReason.Error,c.CancellationErrorCode.RuntimeError,t),[2,null];case 4:return[2]}}))}))},t.prototype.configConnection=function(){var e=this;return this.isDisposed()?Promise.resolve(void 0):this.privConnectionConfigPromise?this.privConnectionConfigPromise.then((function(t){return t.state()===a.ConnectionState.Disconnected?(e.privConnectionId=null,e.privConnectionConfigPromise=null,e.configConnection()):e.privConnectionConfigPromise}),(function(t){return e.privConnectionId=null,e.privConnectionConfigPromise=null,e.configConnection()})):this.terminateMessageLoop?Promise.resolve(void 0):(this.privConnectionConfigPromise=this.connectImpl().then((function(e){return e})),this.privConnectionConfigPromise)},t.prototype.getTranslations=function(e){var t;if(void 0!==e){t=new c.Translations;for(var r=0,n=e;r<n.length;r++){var o=n[r];t.set(o.lang,o.translation)}}return t},t}(u.ServiceRecognizerBase);t.ConversationServiceAdapter=d},7324:function(e,t,r){"use strict";var n,o=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},n(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.ConversationReceivedTranslationEventArgs=t.ParticipantsListEventArgs=t.ParticipantAttributeEventArgs=t.ParticipantEventArgs=t.LockRoomEventArgs=t.MuteAllEventArgs=void 0;var i=r(9480),s=function(e){function t(t,r){var n=e.call(this,r)||this;return n.privIsMuted=t,n}return o(t,e),Object.defineProperty(t.prototype,"isMuted",{get:function(){return this.privIsMuted},enumerable:!1,configurable:!0}),t}(i.SessionEventArgs);t.MuteAllEventArgs=s;var a=function(e){function t(t,r){var n=e.call(this,r)||this;return n.privIsLocked=t,n}return o(t,e),Object.defineProperty(t.prototype,"isMuted",{get:function(){return this.privIsLocked},enumerable:!1,configurable:!0}),t}(i.SessionEventArgs);t.LockRoomEventArgs=a;var c=function(e){function t(t,r){var n=e.call(this,r)||this;return n.privParticipant=t,n}return o(t,e),Object.defineProperty(t.prototype,"participant",{get:function(){return this.privParticipant},enumerable:!1,configurable:!0}),t}(i.SessionEventArgs);t.ParticipantEventArgs=c;var u=function(e){function t(t,r,n,o){var i=e.call(this,o)||this;return i.privKey=r,i.privValue=n,i.privParticipantId=t,i}return o(t,e),Object.defineProperty(t.prototype,"value",{get:function(){return this.privValue},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"key",{get:function(){return this.privKey},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"id",{get:function(){return this.privParticipantId},enumerable:!1,configurable:!0}),t}(i.SessionEventArgs);t.ParticipantAttributeEventArgs=u;var p=function(e){function t(t,r,n,o,i,s,a,c,u){var p=e.call(this,u)||this;return p.privRoomId=t,p.privSessionToken=r,p.privTranslateTo=n,p.privProfanityFilter=o,p.privRoomProfanityFilter=i,p.privIsRoomLocked=s,p.privIsRoomLocked=a,p.privParticipants=c,p}return o(t,e),Object.defineProperty(t.prototype,"sessionToken",{get:function(){return this.privSessionToken},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"conversationId",{get:function(){return this.privRoomId},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"translateTo",{get:function(){return this.privTranslateTo},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"profanityFilter",{get:function(){return this.privProfanityFilter},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"roomProfanityFilter",{get:function(){return this.privRoomProfanityFilter},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isRoomLocked",{get:function(){return this.privIsRoomLocked},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isMuteAll",{get:function(){return this.privIsMuteAll},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"participants",{get:function(){return this.privParticipants},enumerable:!1,configurable:!0}),t}(i.SessionEventArgs);t.ParticipantsListEventArgs=p;var l=function(){function e(e,t,r){this.privPayload=t,this.privCommand=e,this.privSessionId=r}return Object.defineProperty(e.prototype,"payload",{get:function(){return this.privPayload},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"command",{get:function(){return this.privCommand},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"sessionId",{get:function(){return this.privSessionId},enumerable:!1,configurable:!0}),e}();t.ConversationReceivedTranslationEventArgs=l},4618:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ConversationTranslatorCommandTypes=t.ConversationTranslatorMessageTypes=t.InternalParticipants=void 0;var r=function(){function e(e,t){void 0===e&&(e=[]),this.participants=e,this.meId=t}return e.prototype.addOrUpdateParticipant=function(e){if(void 0!==e){var t=this.getParticipantIndex(e.id);return t>-1?this.participants.splice(t,1,e):this.participants.push(e),this.getParticipant(e.id)}},e.prototype.getParticipantIndex=function(e){return this.participants.findIndex((function(t){return t.id===e}))},e.prototype.getParticipant=function(e){return this.participants.find((function(t){return t.id===e}))},e.prototype.deleteParticipant=function(e){this.participants=this.participants.filter((function(t){return t.id!==e}))},Object.defineProperty(e.prototype,"host",{get:function(){return this.participants.find((function(e){return!0===e.isHost}))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"me",{get:function(){return this.getParticipant(this.meId)},enumerable:!1,configurable:!0}),e}();t.InternalParticipants=r,t.ConversationTranslatorMessageTypes={command:"command",final:"final",info:"info",instantMessage:"instant_message",partial:"partial",participantCommand:"participant_command",translatedMessage:"translated_message"},t.ConversationTranslatorCommandTypes={changeNickname:"ChangeNickname",disconnectSession:"DisconnectSession",ejectParticipant:"EjectParticipant",instant_message:"instant_message",joinSession:"JoinSession",leaveSession:"LeaveSession",participantList:"ParticipantList",roomExpirationWarning:"RoomExpirationWarning",setLockState:"SetLockState",setMute:"SetMute",setMuteAll:"SetMuteAll",setProfanityFiltering:"SetProfanityFiltering",setTranslateToLanguages:"SetTranslateToLanguages",setUseTTS:"SetUseTTS"}},6491:function(e,t,r){"use strict";var n,o=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},n(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),i=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function s(e){try{c(n.next(e))}catch(e){i(e)}}function a(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))},s=this&&this.__generator||function(e,t){var r,n,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,n=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.ConversationTranslatorRecognizer=t.ConversationRecognizerFactory=void 0;var a=r(21),c=r(2370),u=r(7348),p=r(9480),l=r(876),f=r(9982),h=r(2907),v=function(){function e(){}return e.fromConfig=function(e,t){return new d(e,t)},e}();t.ConversationRecognizerFactory=v;var d=function(e){function t(t,r){var n=this,o=t;return u.Contracts.throwIfNull(o,"speechConfig"),(n=e.call(this,r,o.properties,new l.ConversationConnectionFactory)||this).privIsDisposed=!1,n.privProperties=o.properties.clone(),n.privConnection=p.Connection.fromRecognizer(n),n}return o(t,e),Object.defineProperty(t.prototype,"connected",{set:function(e){this.privConnection.connected=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"disconnected",{set:function(e){this.privConnection.disconnected=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"speechRecognitionLanguage",{get:function(){return this.privSpeechRecognitionLanguage},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"properties",{get:function(){return this.privProperties},enumerable:!1,configurable:!0}),t.prototype.isDisposed=function(){return this.privIsDisposed},t.prototype.connect=function(e,t,r){try{u.Contracts.throwIfDisposed(this.privIsDisposed),u.Contracts.throwIfNullOrWhitespace(e,"token"),this.privReco.conversationTranslatorToken=e,this.privReco.connectAsync(t,r)}catch(e){if(r)if(e instanceof Error){var n=e;r(n.name+": "+n.message)}else r(e)}},t.prototype.disconnect=function(e,t){try{u.Contracts.throwIfDisposed(this.privIsDisposed),this.privReco.disconnect().then((function(){e&&e()}),(function(e){t&&t(e)}))}catch(e){if(t)if(e instanceof Error){var r=e;t(r.name+": "+r.message)}else t(e);this.dispose(!0).catch((function(e){c.Events.instance.onEvent(new c.BackgroundEvent(e))}))}},t.prototype.sendRequest=function(e,t,r){try{u.Contracts.throwIfDisposed(this.privIsDisposed),this.sendMessage(e,t,r)}catch(e){if(r)if(e instanceof Error){var n=e;r(n.name+": "+n.message)}else r(e);this.dispose(!0).catch((function(e){c.Events.instance.onEvent(new c.BackgroundEvent(e))}))}},t.prototype.close=function(){var e,t;return i(this,void 0,void 0,(function(){return s(this,(function(r){switch(r.label){case 0:return u.Contracts.throwIfDisposed(this.privIsDisposed),null===(e=this.privConnection)||void 0===e||e.closeConnection(),null===(t=this.privConnection)||void 0===t||t.close(),this.privConnection=void 0,[4,this.dispose(!0)];case 1:return r.sent(),[2]}}))}))},t.prototype.dispose=function(t){return i(this,void 0,void 0,(function(){return s(this,(function(r){switch(r.label){case 0:return this.privIsDisposed?[2]:t?(this.privIsDisposed=!0,this.privConnection&&(this.privConnection.closeConnection(),this.privConnection.close(),this.privConnection=void 0),[4,e.prototype.dispose.call(this,t)]):[3,2];case 1:r.sent(),r.label=2;case 2:return[2]}}))}))},t.prototype.createRecognizerConfig=function(e){return new a.RecognizerConfig(e,this.privProperties)},t.prototype.createServiceRecognizer=function(e,t,r,n){var o=r;return new f.ConversationServiceAdapter(e,t,o,n,this)},t.prototype.sendMessage=function(e,t,r){var n=this.privReco;h.PromiseToEmptyCallback(n.sendMessageAsync(e),t,r)},t}(p.Recognizer);t.ConversationTranslatorRecognizer=d},2907:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.hasOwnProperty.call(e,r)&&n(t,e,r);return o(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.PromiseToEmptyCallback=t.request=t.extractHeaderValue=void 0;var s=r(5597),a=i(r(2002));function c(e,t){return void 0===t&&(t=null),{data:t||e.statusText,headers:e.getAllResponseHeaders(),json:function(){return JSON.parse(t||'"'+e.statusText+'"')},ok:!1,status:e.status,statusText:e.statusText}}t.extractHeaderValue=function(e,t){var r="";try{var n=t.trim().split(/[\r\n]+/),o={};n.forEach((function(e){var t=e.split(": "),r=t.shift().toLowerCase(),n=t.join(": ");o[r]=n})),r=o[e.toLowerCase()]}catch(e){}return r},t.request=function(e,t,r,n,o,i){void 0===r&&(r={}),void 0===n&&(n=null),void 0===o&&(o={});var u,p=s.RestConfigBase.requestOptions,l=o.ignoreCache||p.ignoreCache,f=o.headers||p.headers,h=o.timeout||p.timeout;(u="undefined"==typeof window?new a.XMLHttpRequest:new XMLHttpRequest).open(e,function(e,t){void 0===t&&(t={});var r=function(e){return void 0===e&&(e={}),Object.keys(e).map((function(t){return encodeURIComponent(t)+"="+encodeURIComponent(e[t])})).join("&")}(t);return r?e+(-1===e.indexOf("?")?"?":"&")+r:e}(t,r),!0),f&&Object.keys(f).forEach((function(e){return u.setRequestHeader(e,f[e])})),l&&u.setRequestHeader("Cache-Control","no-cache"),u.timeout=h,u.onload=function(e){i(function(e){return{data:e.responseText,headers:e.getAllResponseHeaders(),json:function(){return JSON.parse(e.responseText)},ok:e.status>=200&&e.status<300,status:e.status,statusText:e.statusText}}(u))},u.onerror=function(e){i(c(u,"Failed to make request."))},u.ontimeout=function(e){i(c(u,"Request took longer than expected."))},"post"===e&&n?(u.setRequestHeader("Content-Type","application/json"),u.send(JSON.stringify(n))):u.send()},t.PromiseToEmptyCallback=function(e,t,r){e?e.then((function(e){try{t&&t()}catch(e){r&&r("'Unhandled error on promise callback: "+e+"'")}}),(function(e){try{r&&r(e)}catch(e){}})):r&&r("Null promise")}},654:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ConversationWebsocketMessageFormatter=void 0;var n=r(2370),o=r(558);t.ConversationWebsocketMessageFormatter=function(){this.toConnectionMessage=function(e){var t=new n.Deferred;try{if(e.messageType===n.MessageType.Text){var r=new o.ConversationConnectionMessage(e.messageType,e.textContent,{},e.id);t.resolve(r)}else e.messageType===n.MessageType.Binary&&t.resolve(new o.ConversationConnectionMessage(e.messageType,e.binaryContent,void 0,e.id))}catch(e){t.reject("Error formatting the message. Error: "+e)}return t.promise},this.fromConnectionMessage=function(e){var t=new n.Deferred;try{if(e.messageType===n.MessageType.Text){var r=""+(e.textBody?e.textBody:"");t.resolve(new n.RawWebsocketMessage(n.MessageType.Text,r,e.id))}}catch(e){t.reject("Error formatting the message. "+e)}return t.promise}}},3603:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(1256);Object.defineProperty(t,"ConversationManager",{enumerable:!0,get:function(){return n.ConversationManager}});var o=r(6515);Object.defineProperty(t,"ConversationConnectionConfig",{enumerable:!0,get:function(){return o.ConversationConnectionConfig}});var i=r(6491);Object.defineProperty(t,"ConversationRecognizerFactory",{enumerable:!0,get:function(){return i.ConversationRecognizerFactory}});var s=r(3542);Object.defineProperty(t,"TranscriberRecognizer",{enumerable:!0,get:function(){return s.TranscriberRecognizer}});var a=r(7324);Object.defineProperty(t,"ConversationReceivedTranslationEventArgs",{enumerable:!0,get:function(){return a.ConversationReceivedTranslationEventArgs}}),Object.defineProperty(t,"LockRoomEventArgs",{enumerable:!0,get:function(){return a.LockRoomEventArgs}}),Object.defineProperty(t,"MuteAllEventArgs",{enumerable:!0,get:function(){return a.MuteAllEventArgs}}),Object.defineProperty(t,"ParticipantAttributeEventArgs",{enumerable:!0,get:function(){return a.ParticipantAttributeEventArgs}}),Object.defineProperty(t,"ParticipantEventArgs",{enumerable:!0,get:function(){return a.ParticipantEventArgs}}),Object.defineProperty(t,"ParticipantsListEventArgs",{enumerable:!0,get:function(){return a.ParticipantsListEventArgs}});var c=r(4618);Object.defineProperty(t,"ConversationTranslatorCommandTypes",{enumerable:!0,get:function(){return c.ConversationTranslatorCommandTypes}}),Object.defineProperty(t,"ConversationTranslatorMessageTypes",{enumerable:!0,get:function(){return c.ConversationTranslatorMessageTypes}}),Object.defineProperty(t,"InternalParticipants",{enumerable:!0,get:function(){return c.InternalParticipants}})},4132:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CommandResponsePayload=void 0;var r=function(){function e(e){this.privCommandResponse=JSON.parse(e)}return e.fromJSON=function(t){return new e(t)},Object.defineProperty(e.prototype,"type",{get:function(){return this.privCommandResponse.type},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"command",{get:function(){return this.privCommandResponse.command},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"id",{get:function(){return this.privCommandResponse.id},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"nickname",{get:function(){return this.privCommandResponse.nickname},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"participantId",{get:function(){return this.privCommandResponse.participantId},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"roomid",{get:function(){return this.privCommandResponse.roomid},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"value",{get:function(){return this.privCommandResponse.value},enumerable:!1,configurable:!0}),e}();t.CommandResponsePayload=r},2136:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(4132);Object.defineProperty(t,"CommandResponsePayload",{enumerable:!0,get:function(){return n.CommandResponsePayload}});var o=r(6198);Object.defineProperty(t,"ParticipantsListPayloadResponse",{enumerable:!0,get:function(){return o.ParticipantsListPayloadResponse}}),Object.defineProperty(t,"ParticipantPayloadResponse",{enumerable:!0,get:function(){return o.ParticipantPayloadResponse}});var i=r(6255);Object.defineProperty(t,"SpeechResponsePayload",{enumerable:!0,get:function(){return i.SpeechResponsePayload}}),Object.defineProperty(t,"TextResponsePayload",{enumerable:!0,get:function(){return i.TextResponsePayload}})},6198:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ParticipantPayloadResponse=t.ParticipantsListPayloadResponse=void 0;var r=function(){function e(e){this.privParticipantsPayloadResponse=JSON.parse(e)}return e.fromJSON=function(t){return new e(t)},Object.defineProperty(e.prototype,"roomid",{get:function(){return this.privParticipantsPayloadResponse.roomid},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"id",{get:function(){return this.privParticipantsPayloadResponse.id},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"command",{get:function(){return this.privParticipantsPayloadResponse.command},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"participants",{get:function(){return this.privParticipantsPayloadResponse.participants},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"token",{get:function(){return this.privParticipantsPayloadResponse.token},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"translateTo",{get:function(){return this.privParticipantsPayloadResponse.translateTo},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"profanityFilter",{get:function(){return this.privParticipantsPayloadResponse.profanityFilter},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"roomProfanityFilter",{get:function(){return this.privParticipantsPayloadResponse.roomProfanityFilter},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"roomLocked",{get:function(){return this.privParticipantsPayloadResponse.roomLocked},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"muteAll",{get:function(){return this.privParticipantsPayloadResponse.muteAll},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"type",{get:function(){return this.privParticipantsPayloadResponse.type},enumerable:!1,configurable:!0}),e}();t.ParticipantsListPayloadResponse=r;var n=function(){function e(e){this.privParticipantPayloadResponse=JSON.parse(e)}return e.fromJSON=function(t){return new e(t)},Object.defineProperty(e.prototype,"nickname",{get:function(){return this.privParticipantPayloadResponse.nickname},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"locale",{get:function(){return this.privParticipantPayloadResponse.locale},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"usetts",{get:function(){return this.privParticipantPayloadResponse.usetts},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"ismuted",{get:function(){return this.privParticipantPayloadResponse.ismuted},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"ishost",{get:function(){return this.privParticipantPayloadResponse.ishost},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"participantId",{get:function(){return this.privParticipantPayloadResponse.participantId},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"avatar",{get:function(){return this.privParticipantPayloadResponse.avatar},enumerable:!1,configurable:!0}),e}();t.ParticipantPayloadResponse=n},6255:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TextResponsePayload=t.SpeechResponsePayload=void 0;var r=function(){function e(e){this.privSpeechResponse=JSON.parse(e)}return e.fromJSON=function(t){return new e(t)},Object.defineProperty(e.prototype,"recognition",{get:function(){return this.privSpeechResponse.recognition},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"translations",{get:function(){return this.privSpeechResponse.translations},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"id",{get:function(){return this.privSpeechResponse.id},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"language",{get:function(){return this.privSpeechResponse.language},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"nickname",{get:function(){return this.privSpeechResponse.nickname},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"participantId",{get:function(){return this.privSpeechResponse.participantId},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"roomid",{get:function(){return this.privSpeechResponse.roomid},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"timestamp",{get:function(){return this.privSpeechResponse.timestamp},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"type",{get:function(){return this.privSpeechResponse.type},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isFinal",{get:function(){return"final"===this.privSpeechResponse.type},enumerable:!1,configurable:!0}),e}();t.SpeechResponsePayload=r;var n=function(){function e(e){this.privTextResponse=JSON.parse(e)}return e.fromJSON=function(t){return new e(t)},Object.defineProperty(e.prototype,"originalText",{get:function(){return this.privTextResponse.originalText},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"translations",{get:function(){return this.privTextResponse.translations},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"id",{get:function(){return this.privTextResponse.id},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"language",{get:function(){return this.privTextResponse.language},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"nickname",{get:function(){return this.privTextResponse.nickname},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"participantId",{get:function(){return this.privTextResponse.participantId},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"roomid",{get:function(){return this.privTextResponse.roomid},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"timestamp",{get:function(){return this.privTextResponse.timestamp},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"type",{get:function(){return this.privTextResponse.type},enumerable:!1,configurable:!0}),e}();t.TextResponsePayload=n},3542:function(e,t,r){"use strict";var n,o=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},n(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),i=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function s(e){try{c(n.next(e))}catch(e){i(e)}}function a(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))},s=this&&this.__generator||function(e,t){var r,n,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,n=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.TranscriberRecognizer=void 0;var a=r(2370),c=r(7348),u=r(9480),p=r(21),l=function(e){function t(t,r){var n=this,o=t;return c.Contracts.throwIfNull(o,"speechTranslationConfig"),c.Contracts.throwIfNullOrWhitespace(o.speechRecognitionLanguage,u.PropertyId[u.PropertyId.SpeechServiceConnection_RecoLanguage]),(n=e.call(this,r,o.properties,new p.TranscriberConnectionFactory)||this).privDisposedRecognizer=!1,n}return o(t,e),t.prototype.getConversationInfo=function(){return c.Contracts.throwIfNullOrUndefined(this.privConversation,"Conversation"),this.privConversation.conversationInfo},Object.defineProperty(t.prototype,"authorizationToken",{get:function(){return this.properties.getProperty(u.PropertyId.SpeechServiceAuthorization_Token)},set:function(e){c.Contracts.throwIfNullOrWhitespace(e,"token"),this.properties.setProperty(u.PropertyId.SpeechServiceAuthorization_Token,e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"conversation",{set:function(e){c.Contracts.throwIfNullOrUndefined(e,"Conversation"),this.privConversation=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"speechRecognitionLanguage",{get:function(){return c.Contracts.throwIfDisposed(this.privDisposedRecognizer),this.properties.getProperty(u.PropertyId.SpeechServiceConnection_RecoLanguage)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"properties",{get:function(){return this.privProperties},enumerable:!1,configurable:!0}),t.prototype.startContinuousRecognitionAsync=function(e,t){a.marshalPromiseToCallbacks(this.startContinuousRecognitionAsyncImpl(p.RecognitionMode.Conversation),e,t)},t.prototype.stopContinuousRecognitionAsync=function(e,t){a.marshalPromiseToCallbacks(this.stopContinuousRecognitionAsyncImpl(),e,t)},t.prototype.close=function(){return i(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return c.Contracts.throwIfDisposed(this.privDisposedRecognizer),[4,this.dispose(!0)];case 1:return e.sent(),[2]}}))}))},t.prototype.pushConversationEvent=function(e,t){return i(this,void 0,void 0,(function(){var r;return s(this,(function(n){switch(n.label){case 0:return r=this.privReco,c.Contracts.throwIfNullOrUndefined(r,"serviceRecognizer"),[4,r.sendSpeechEventAsync(e,t)];case 1:return n.sent(),[2]}}))}))},t.prototype.connectCallbacks=function(e){this.canceled=function(t,r){e.canceled&&e.canceled(e,r)},this.recognizing=function(t,r){e.transcribing&&e.transcribing(e,r)},this.recognized=function(t,r){e.transcribed&&e.transcribed(e,r)},this.sessionStarted=function(t,r){e.sessionStarted&&e.sessionStarted(e,r)},this.sessionStopped=function(t,r){e.sessionStopped&&e.sessionStopped(e,r)}},t.prototype.disconnectCallbacks=function(){this.canceled=void 0,this.recognizing=void 0,this.recognized=void 0,this.sessionStarted=void 0,this.sessionStopped=void 0},t.prototype.dispose=function(t){return i(this,void 0,void 0,(function(){return s(this,(function(r){switch(r.label){case 0:return this.privDisposedRecognizer?[2]:t?(this.privDisposedRecognizer=!0,[4,this.implRecognizerStop()]):[3,2];case 1:r.sent(),r.label=2;case 2:return[4,e.prototype.dispose.call(this,t)];case 3:return r.sent(),[2]}}))}))},t.prototype.createRecognizerConfig=function(e){return new p.RecognizerConfig(e,this.properties)},t.prototype.createServiceRecognizer=function(e,t,r,n){var o=r;return new p.TranscriptionServiceRecognizer(e,t,o,n,this)},t}(u.Recognizer);t.TranscriberRecognizer=l},9358:function(e,t,r){"use strict";var n,o=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},n(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),i=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function s(e){try{c(n.next(e))}catch(e){i(e)}}function a(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))},s=this&&this.__generator||function(e,t){var r,n,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,n=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.TranscriptionServiceRecognizer=void 0;var a=r(2370),c=r(9480),u=r(21),p=r(4921),l=function(e){function t(t,r,n,o,i){var s=e.call(this,t,r,n,o,i)||this;return s.sendSpeechEvent=function(e,t){var r=JSON.stringify(t);if(r)return e.send(new p.SpeechConnectionMessage(a.MessageType.Text,"speech.event",s.privRequestSession.requestId,"application/json",r))},s.privTranscriberRecognizer=i,s.sendPrePayloadJSONOverride=s.sendTranscriptionStartJSON,s}return o(t,e),t.prototype.sendSpeechEventAsync=function(e,t){return i(this,void 0,void 0,(function(){var r;return s(this,(function(n){switch(n.label){case 0:return this.privRequestSession.isRecognizing?[4,this.fetchConnection()]:[3,3];case 1:return r=n.sent(),[4,this.sendSpeechEvent(r,this.createSpeechEventPayload(e,t))];case 2:n.sent(),n.label=3;case 3:return[2]}}))}))},t.prototype.processTypeSpecificMessages=function(e){return i(this,void 0,void 0,(function(){var t,r,n,o,i,a,p,l,f,h,v;return s(this,(function(s){switch(s.label){case 0:switch((r=new c.PropertyCollection).setProperty(c.PropertyId.SpeechServiceResponse_JsonResult,e.textBody),n=!1,e.path.toLowerCase()){case"speech.hypothesis":case"speech.fragment":return[3,1];case"speech.phrase":return[3,2]}return[3,6];case 1:if(o=u.SpeechHypothesis.fromJSON(e.textBody),i=o.Offset+this.privRequestSession.currentTurnAudioOffset,t=new c.SpeechRecognitionResult(this.privRequestSession.requestId,c.ResultReason.RecognizingSpeech,o.Text,o.Duration,i,o.Language,o.LanguageDetectionConfidence,o.SpeakerId,void 0,e.textBody,r),this.privRequestSession.onHypothesis(i),a=new c.SpeechRecognitionEventArgs(t,o.Duration,this.privRequestSession.sessionId),this.privTranscriberRecognizer.recognizing)try{this.privTranscriberRecognizer.recognizing(this.privTranscriberRecognizer,a)}catch(e){}return n=!0,[3,7];case 2:return p=u.SimpleSpeechPhrase.fromJSON(e.textBody),l=u.EnumTranslation.implTranslateRecognitionResult(p.RecognitionStatus),this.privRequestSession.onPhraseRecognized(this.privRequestSession.currentTurnAudioOffset+p.Offset+p.Duration),c.ResultReason.Canceled!==l?[3,4]:(f=u.EnumTranslation.implTranslateCancelResult(p.RecognitionStatus),[4,this.cancelRecognitionLocal(f,u.EnumTranslation.implTranslateCancelErrorCode(p.RecognitionStatus),void 0)]);case 3:return s.sent(),[3,5];case 4:if((!this.privRequestSession.isSpeechEnded||l!==c.ResultReason.NoMatch||p.RecognitionStatus===u.RecognitionStatus.InitialSilenceTimeout)&&(this.privRecognizerConfig.parameters.getProperty(u.OutputFormatPropertyName)===c.OutputFormat[c.OutputFormat.Simple]?t=new c.SpeechRecognitionResult(this.privRequestSession.requestId,l,p.DisplayText,p.Duration,p.Offset+this.privRequestSession.currentTurnAudioOffset,p.Language,p.LanguageDetectionConfidence,p.SpeakerId,void 0,e.textBody,r):(h=u.DetailedSpeechPhrase.fromJSON(e.textBody),t=new c.SpeechRecognitionResult(this.privRequestSession.requestId,l,h.RecognitionStatus===u.RecognitionStatus.Success?h.NBest[0].Display:void 0,h.Duration,h.Offset+this.privRequestSession.currentTurnAudioOffset,h.Language,h.LanguageDetectionConfidence,void 0,void 0,e.textBody,r)),v=new c.SpeechRecognitionEventArgs(t,t.offset,this.privRequestSession.sessionId),this.privTranscriberRecognizer.recognized))try{this.privTranscriberRecognizer.recognized(this.privTranscriberRecognizer,v)}catch(e){}if(this.privSuccessCallback){try{this.privSuccessCallback(t)}catch(e){this.privErrorCallback&&this.privErrorCallback(e)}this.privSuccessCallback=void 0,this.privErrorCallback=void 0}s.label=5;case 5:return n=!0,[3,7];case 6:return[3,7];case 7:return[2,n]}}))}))},t.prototype.cancelRecognition=function(e,t,r,n,o){var i=new c.PropertyCollection;if(i.setProperty(u.CancellationErrorCodePropertyName,c.CancellationErrorCode[n]),this.privTranscriberRecognizer.canceled){var s=new c.ConversationTranscriptionCanceledEventArgs(r,o,n,void 0,e);try{this.privTranscriberRecognizer.canceled(this.privTranscriberRecognizer,s)}catch(e){}}if(this.privSuccessCallback){var a=new c.SpeechRecognitionResult(t,c.ResultReason.Canceled,void 0,void 0,void 0,void 0,void 0,void 0,o,void 0,i);try{this.privSuccessCallback(a),this.privSuccessCallback=void 0}catch(e){}}},t.prototype.sendTranscriptionStartJSON=function(e){return i(this,void 0,void 0,(function(){var t,r;return s(this,(function(n){switch(n.label){case 0:return[4,this.sendSpeechContext(e)];case 1:return n.sent(),t=this.privTranscriberRecognizer.getConversationInfo(),r=this.createSpeechEventPayload(t,"start"),[4,this.sendSpeechEvent(e,r)];case 2:return n.sent(),[4,this.sendWaveHeader(e)];case 3:return n.sent(),[2]}}))}))},t.prototype.createSpeechEventPayload=function(e,t){var r={id:"meeting",name:t,meeting:e.conversationProperties};return r.meeting.id=e.id,r.meeting.attendees=e.participants,r.meeting.record="on"===e.conversationProperties.audiorecording?"true":"false",r},t}(u.ServiceRecognizerBase);t.TranscriptionServiceRecognizer=l},9195:function(e,t,r){"use strict";var n,o=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},n(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.TranslationConnectionFactory=void 0;var i=r(6340),s=r(9480),a=r(4216),c=r(21),u=r(1562),p=r(9291),l=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.create=function(e,r,n){var o=e.parameters.getProperty(s.PropertyId.SpeechServiceConnection_Endpoint,void 0);if(!o){var a=e.parameters.getProperty(s.PropertyId.SpeechServiceConnection_Region,void 0),l=a&&a.toLowerCase().startsWith("china")?".azure.cn":".microsoft.com";o=e.parameters.getProperty(s.PropertyId.SpeechServiceConnection_Host,"wss://"+a+".s2s.speech"+l)+"/speech/translation/cognitiveservices/v1"}var f={from:e.parameters.getProperty(s.PropertyId.SpeechServiceConnection_RecoLanguage),to:e.parameters.getProperty(s.PropertyId.SpeechServiceConnection_TranslationToLanguages)};t.setCommonUrlParams(e,f,o),t.setUrlParameter(s.PropertyId.SpeechServiceResponse_TranslationRequestStablePartialResult,p.QueryParameterNames.StableTranslation,e,f,o),void 0!==e.parameters.getProperty(s.PropertyId.SpeechServiceConnection_TranslationVoice,void 0)&&(f.voice=e.parameters.getProperty(s.PropertyId.SpeechServiceConnection_TranslationVoice),f.features="texttospeech");var h={};void 0!==r.token&&""!==r.token&&(h[r.headerName]=r.token),h[u.HeaderNames.ConnectionId]=n,e.parameters.setProperty(s.PropertyId.SpeechServiceConnection_Url,o);var v="true"===e.parameters.getProperty("SPEECH-EnableWebsocketCompression","false");return new i.WebsocketConnection(o,f,h,new c.WebsocketMessageFormatter,i.ProxyInfo.fromRecognizerConfig(e),v,n)},t}return o(t,e),t}(a.ConnectionFactoryBase);t.TranslationConnectionFactory=l},5266:function(e,t,r){"use strict";var n,o=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},n(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),i=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function s(e){try{c(n.next(e))}catch(e){i(e)}}function a(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))},s=this&&this.__generator||function(e,t){var r,n,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,n=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.TranslationServiceRecognizer=void 0;var a=r(2370),c=r(9480),u=r(21),p=function(e){function t(t,r,n,o,a){var c=e.call(this,t,r,n,o,a)||this;return c.privTranslationRecognizer=a,c.connectionEvents.attach((function(e){return i(c,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return"ConnectionEstablishedEvent"!==e.name?[3,1]:(this.privTranslationRecognizer.onConnection(),[3,3]);case 1:return"ConnectionClosedEvent"!==e.name?[3,3]:[4,this.privTranslationRecognizer.onDisconnection()];case 2:t.sent(),t.label=3;case 3:return[2]}}))}))})),c}return o(t,e),t.prototype.processTypeSpecificMessages=function(e){return i(this,void 0,void 0,(function(){var t,r,n,o,i,p,l,f,h,v,d,y,g;return s(this,(function(s){switch(s.label){case 0:switch(t=new c.PropertyCollection,r=!1,e.messageType===a.MessageType.Text&&t.setProperty(c.PropertyId.SpeechServiceResponse_JsonResult,e.textBody),e.path.toLowerCase()){case"translation.hypothesis":return[3,1];case"translation.phrase":return[3,2];case"translation.synthesis":return[3,7];case"translation.synthesis.end":return[3,8]}return[3,9];case 1:if(n=this.fireEventForResult(u.TranslationHypothesis.fromJSON(e.textBody),t),this.privRequestSession.onHypothesis(this.privRequestSession.currentTurnAudioOffset+n.offset),this.privTranslationRecognizer.recognizing)try{this.privTranslationRecognizer.recognizing(this.privTranslationRecognizer,n)}catch(e){}return r=!0,[3,10];case 2:if(o=u.TranslationPhrase.fromJSON(e.textBody),this.privRequestSession.onPhraseRecognized(this.privRequestSession.currentTurnAudioOffset+o.Offset+o.Duration),o.RecognitionStatus!==u.RecognitionStatus.Success)return[3,3];if(i=this.fireEventForResult(o,t),this.privTranslationRecognizer.recognized)try{this.privTranslationRecognizer.recognized(this.privTranslationRecognizer,i)}catch(e){}if(this.privSuccessCallback){try{this.privSuccessCallback(i.result)}catch(e){this.privErrorCallback&&this.privErrorCallback(e)}this.privSuccessCallback=void 0,this.privErrorCallback=void 0}return[3,10];case 3:return p=u.EnumTranslation.implTranslateRecognitionResult(o.RecognitionStatus),l=new c.TranslationRecognitionResult(void 0,this.privRequestSession.requestId,p,o.Text,o.Duration,this.privRequestSession.currentTurnAudioOffset+o.Offset,void 0,e.textBody,t),p!==c.ResultReason.Canceled?[3,5]:(f=u.EnumTranslation.implTranslateCancelResult(o.RecognitionStatus),[4,this.cancelRecognitionLocal(f,u.EnumTranslation.implTranslateCancelErrorCode(o.RecognitionStatus),void 0)]);case 4:return s.sent(),[3,6];case 5:if((!this.privRequestSession.isSpeechEnded||p!==c.ResultReason.NoMatch||o.RecognitionStatus===u.RecognitionStatus.InitialSilenceTimeout)&&(h=new c.TranslationRecognitionEventArgs(l,l.offset,this.privRequestSession.sessionId),this.privTranslationRecognizer.recognized))try{this.privTranslationRecognizer.recognized(this.privTranslationRecognizer,h)}catch(e){}if(this.privSuccessCallback){try{this.privSuccessCallback(l)}catch(e){this.privErrorCallback&&this.privErrorCallback(e)}this.privSuccessCallback=void 0,this.privErrorCallback=void 0}s.label=6;case 6:return r=!0,[3,10];case 7:return this.sendSynthesisAudio(e.binaryBody,this.privRequestSession.sessionId),r=!0,[3,10];case 8:switch((v=u.TranslationSynthesisEnd.fromJSON(e.textBody)).SynthesisStatus){case u.SynthesisStatus.Error:if(this.privTranslationRecognizer.synthesizing){d=new c.TranslationSynthesisResult(c.ResultReason.Canceled,void 0),y=new c.TranslationSynthesisEventArgs(d,this.privRequestSession.sessionId);try{this.privTranslationRecognizer.synthesizing(this.privTranslationRecognizer,y)}catch(e){}}if(this.privTranslationRecognizer.canceled){g=new c.TranslationRecognitionCanceledEventArgs(this.privRequestSession.sessionId,c.CancellationReason.Error,v.FailureReason,c.CancellationErrorCode.ServiceError,null);try{this.privTranslationRecognizer.canceled(this.privTranslationRecognizer,g)}catch(e){}}break;case u.SynthesisStatus.Success:this.sendSynthesisAudio(void 0,this.privRequestSession.sessionId)}return r=!0,[3,10];case 9:return[3,10];case 10:return[2,r]}}))}))},t.prototype.cancelRecognition=function(e,t,r,n,o){var i=new c.PropertyCollection;if(i.setProperty(u.CancellationErrorCodePropertyName,c.CancellationErrorCode[n]),this.privTranslationRecognizer.canceled){var s=new c.TranslationRecognitionCanceledEventArgs(e,r,o,n,void 0);try{this.privTranslationRecognizer.canceled(this.privTranslationRecognizer,s)}catch(e){}}if(this.privSuccessCallback){var a=new c.TranslationRecognitionResult(void 0,t,c.ResultReason.Canceled,void 0,void 0,void 0,o,void 0,i);try{this.privSuccessCallback(a),this.privSuccessCallback=void 0}catch(e){}}},t.prototype.fireEventForResult=function(e,t){var r,n;if(void 0!==e.Translation.Translations){r=new c.Translations;for(var o=0,i=e.Translation.Translations;o<i.length;o++){var s=i[o];r.set(s.Language,s.Text)}}n=e instanceof u.TranslationPhrase?e.Translation.TranslationStatus===a.TranslationStatus.Success?c.ResultReason.TranslatedSpeech:c.ResultReason.RecognizedSpeech:c.ResultReason.TranslatingSpeech;var p=e.Offset+this.privRequestSession.currentTurnAudioOffset,l=new c.TranslationRecognitionResult(r,this.privRequestSession.requestId,n,e.Text,e.Duration,p,e.Translation.FailureReason,JSON.stringify(e),t);return new c.TranslationRecognitionEventArgs(l,p,this.privRequestSession.sessionId)},t.prototype.sendSynthesisAudio=function(e,t){var r=void 0===e?c.ResultReason.SynthesizingAudioCompleted:c.ResultReason.SynthesizingAudio,n=new c.TranslationSynthesisResult(r,e),o=new c.TranslationSynthesisEventArgs(n,t);if(this.privTranslationRecognizer.synthesizing)try{this.privTranslationRecognizer.synthesizing(this.privTranslationRecognizer,o)}catch(e){}},t}(u.ServiceRecognizerBase);t.TranslationServiceRecognizer=p},9307:function(e,t){"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.TranslationStatus=void 0,(r=t.TranslationStatus||(t.TranslationStatus={}))[r.Success=0]="Success",r[r.Error=1]="Error"},5652:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WebsocketMessageFormatter=void 0;var n=r(2370);t.WebsocketMessageFormatter=function(){var e=this;this.toConnectionMessage=function(t){var r=new n.Deferred;try{if(t.messageType===n.MessageType.Text){var o=t.textContent,i={},s=null;if(o){var a=o.split("\r\n\r\n");a&&a.length>0&&(i=e.parseHeaders(a[0]),a.length>1&&(s=a[1]))}r.resolve(new n.ConnectionMessage(t.messageType,s,i,t.id))}else if(t.messageType===n.MessageType.Binary){var c=t.binaryContent;if(i={},s=null,!c||c.byteLength<2)throw new Error("Invalid binary message format. Header length missing.");var u=new DataView(c),p=u.getInt16(0);if(c.byteLength<p+2)throw new Error("Invalid binary message format. Header content missing.");for(var l="",f=0;f<p;f++)l+=String.fromCharCode(u.getInt8(f+2));i=e.parseHeaders(l),c.byteLength>p+2&&(s=c.slice(2+p)),r.resolve(new n.ConnectionMessage(t.messageType,s,i,t.id))}}catch(e){r.reject("Error formatting the message. Error: "+e)}return r.promise},this.fromConnectionMessage=function(t){var r=new n.Deferred;try{if(t.messageType===n.MessageType.Text){var o=e.makeHeaders(t)+"\r\n"+(t.textBody?t.textBody:"");r.resolve(new n.RawWebsocketMessage(n.MessageType.Text,o,t.id))}else if(t.messageType===n.MessageType.Binary){var i=e.makeHeaders(t),s=t.binaryBody,a=e.stringToArrayBuffer(i),c=new Int8Array(a),u=c.byteLength,p=new Int8Array(2+u+(s?s.byteLength:0));if(p[0]=u>>8&255,p[1]=255&u,p.set(c,2),s){var l=new Int8Array(s);p.set(l,2+u)}o=p.buffer,r.resolve(new n.RawWebsocketMessage(n.MessageType.Binary,o,t.id))}}catch(e){r.reject("Error formatting the message. "+e)}return r.promise},this.makeHeaders=function(e){var t="";if(e.headers)for(var r in e.headers)r&&(t+=r+": "+e.headers[r]+"\r\n");return t},this.parseHeaders=function(e){var t={};if(e){var r=e.match(/[^\r\n]+/g);if(t)for(var n=0,o=r;n<o.length;n++){var i=o[n];if(i){var s=i.indexOf(":"),a=s>0?i.substr(0,s).trim().toLowerCase():i,c=s>0&&i.length>s+1?i.substr(s+1).trim():"";t[a]=c}}}return t},this.stringToArrayBuffer=function(e){for(var t=new ArrayBuffer(e.length),r=new DataView(t),n=0;n<e.length;n++)r.setUint8(n,e.charCodeAt(n));return t}}},7791:function(e,t,r){"use strict";var n,o=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},n(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.AudioStreamNodeErrorEvent=t.AudioStreamNodeDetachedEvent=t.AudioStreamNodeAttachedEvent=t.AudioStreamNodeAttachingEvent=t.AudioStreamNodeEvent=t.AudioSourceErrorEvent=t.AudioSourceOffEvent=t.AudioSourceReadyEvent=t.AudioSourceInitializingEvent=t.AudioSourceEvent=void 0;var i=r(6314),s=function(e){function t(t,r,n){void 0===n&&(n=i.EventType.Info);var o=e.call(this,t,n)||this;return o.privAudioSourceId=r,o}return o(t,e),Object.defineProperty(t.prototype,"audioSourceId",{get:function(){return this.privAudioSourceId},enumerable:!1,configurable:!0}),t}(i.PlatformEvent);t.AudioSourceEvent=s;var a=function(e){function t(t){return e.call(this,"AudioSourceInitializingEvent",t)||this}return o(t,e),t}(s);t.AudioSourceInitializingEvent=a;var c=function(e){function t(t){return e.call(this,"AudioSourceReadyEvent",t)||this}return o(t,e),t}(s);t.AudioSourceReadyEvent=c;var u=function(e){function t(t){return e.call(this,"AudioSourceOffEvent",t)||this}return o(t,e),t}(s);t.AudioSourceOffEvent=u;var p=function(e){function t(t,r){var n=e.call(this,"AudioSourceErrorEvent",t,i.EventType.Error)||this;return n.privError=r,n}return o(t,e),Object.defineProperty(t.prototype,"error",{get:function(){return this.privError},enumerable:!1,configurable:!0}),t}(s);t.AudioSourceErrorEvent=p;var l=function(e){function t(t,r,n){var o=e.call(this,t,r)||this;return o.privAudioNodeId=n,o}return o(t,e),Object.defineProperty(t.prototype,"audioNodeId",{get:function(){return this.privAudioNodeId},enumerable:!1,configurable:!0}),t}(s);t.AudioStreamNodeEvent=l;var f=function(e){function t(t,r){return e.call(this,"AudioStreamNodeAttachingEvent",t,r)||this}return o(t,e),t}(l);t.AudioStreamNodeAttachingEvent=f;var h=function(e){function t(t,r){return e.call(this,"AudioStreamNodeAttachedEvent",t,r)||this}return o(t,e),t}(l);t.AudioStreamNodeAttachedEvent=h;var v=function(e){function t(t,r){return e.call(this,"AudioStreamNodeDetachedEvent",t,r)||this}return o(t,e),t}(l);t.AudioStreamNodeDetachedEvent=v;var d=function(e){function t(t,r,n){var o=e.call(this,"AudioStreamNodeErrorEvent",t,r)||this;return o.privError=n,o}return o(t,e),Object.defineProperty(t.prototype,"error",{get:function(){return this.privError},enumerable:!1,configurable:!0}),t}(l);t.AudioStreamNodeErrorEvent=d},1072:function(e,t,r){"use strict";var n,o=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},n(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.BackgroundEvent=void 0;var i=r(2370),s=function(e){function t(t){var r=e.call(this,"BackgroundEvent",i.EventType.Error)||this;return r.privError=t,r}return o(t,e),Object.defineProperty(t.prototype,"error",{get:function(){return this.privError},enumerable:!1,configurable:!0}),t}(i.PlatformEvent);t.BackgroundEvent=s},5916:function(e,t,r){"use strict";var n,o=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},n(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.ChunkedArrayBufferStream=void 0;var i=function(e){function t(t,r){var n=e.call(this,r)||this;return n.privTargetChunkSize=t,n.privNextBufferReadyBytes=0,n}return o(t,e),t.prototype.writeStreamChunk=function(t){if(t.isEnd||0===this.privNextBufferReadyBytes&&t.buffer.byteLength===this.privTargetChunkSize)e.prototype.writeStreamChunk.call(this,t);else for(var r=0;r<t.buffer.byteLength;){void 0===this.privNextBufferToWrite&&(this.privNextBufferToWrite=new ArrayBuffer(this.privTargetChunkSize),this.privNextBufferStartTime=t.timeReceived);var n=Math.min(t.buffer.byteLength-r,this.privTargetChunkSize-this.privNextBufferReadyBytes),o=new Uint8Array(this.privNextBufferToWrite),i=new Uint8Array(t.buffer.slice(r,n+r));o.set(i,this.privNextBufferReadyBytes),this.privNextBufferReadyBytes+=n,r+=n,this.privNextBufferReadyBytes===this.privTargetChunkSize&&(e.prototype.writeStreamChunk.call(this,{buffer:this.privNextBufferToWrite,isEnd:!1,timeReceived:this.privNextBufferStartTime}),this.privNextBufferReadyBytes=0,this.privNextBufferToWrite=void 0)}},t.prototype.close=function(){0===this.privNextBufferReadyBytes||this.isClosed||e.prototype.writeStreamChunk.call(this,{buffer:this.privNextBufferToWrite.slice(0,this.privNextBufferReadyBytes),isEnd:!1,timeReceived:this.privNextBufferStartTime}),e.prototype.close.call(this)},t}(r(2370).Stream);t.ChunkedArrayBufferStream=i},8866:function(e,t,r){"use strict";var n,o=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},n(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.ConnectionMessageSentEvent=t.ConnectionMessageReceivedEvent=t.ConnectionEstablishErrorEvent=t.ConnectionErrorEvent=t.ConnectionClosedEvent=t.ConnectionEstablishedEvent=t.ConnectionStartEvent=t.ConnectionEvent=t.ServiceEvent=void 0;var i=r(6314),s=function(e){function t(t,r,n){void 0===n&&(n=i.EventType.Info);var o=e.call(this,t,n)||this;return o.privJsonResult=r,o}return o(t,e),Object.defineProperty(t.prototype,"jsonString",{get:function(){return this.privJsonResult},enumerable:!1,configurable:!0}),t}(i.PlatformEvent);t.ServiceEvent=s;var a=function(e){function t(t,r,n){void 0===n&&(n=i.EventType.Info);var o=e.call(this,t,n)||this;return o.privConnectionId=r,o}return o(t,e),Object.defineProperty(t.prototype,"connectionId",{get:function(){return this.privConnectionId},enumerable:!1,configurable:!0}),t}(i.PlatformEvent);t.ConnectionEvent=a;var c=function(e){function t(t,r,n){var o=e.call(this,"ConnectionStartEvent",t)||this;return o.privUri=r,o.privHeaders=n,o}return o(t,e),Object.defineProperty(t.prototype,"uri",{get:function(){return this.privUri},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"headers",{get:function(){return this.privHeaders},enumerable:!1,configurable:!0}),t}(a);t.ConnectionStartEvent=c;var u=function(e){function t(t,r){return e.call(this,"ConnectionEstablishedEvent",t)||this}return o(t,e),t}(a);t.ConnectionEstablishedEvent=u;var p=function(e){function t(t,r,n){var o=e.call(this,"ConnectionClosedEvent",t,i.EventType.Debug)||this;return o.privReason=n,o.privStatusCode=r,o}return o(t,e),Object.defineProperty(t.prototype,"reason",{get:function(){return this.privReason},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"statusCode",{get:function(){return this.privStatusCode},enumerable:!1,configurable:!0}),t}(a);t.ConnectionClosedEvent=p;var l=function(e){function t(t,r,n){var o=e.call(this,"ConnectionErrorEvent",t,i.EventType.Debug)||this;return o.privMessage=r,o.privType=n,o}return o(t,e),Object.defineProperty(t.prototype,"message",{get:function(){return this.privMessage},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"type",{get:function(){return this.privType},enumerable:!1,configurable:!0}),t}(a);t.ConnectionErrorEvent=l;var f=function(e){function t(t,r,n){var o=e.call(this,"ConnectionEstablishErrorEvent",t,i.EventType.Error)||this;return o.privStatusCode=r,o.privReason=n,o}return o(t,e),Object.defineProperty(t.prototype,"reason",{get:function(){return this.privReason},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"statusCode",{get:function(){return this.privStatusCode},enumerable:!1,configurable:!0}),t}(a);t.ConnectionEstablishErrorEvent=f;var h=function(e){function t(t,r,n){var o=e.call(this,"ConnectionMessageReceivedEvent",t)||this;return o.privNetworkReceivedTime=r,o.privMessage=n,o}return o(t,e),Object.defineProperty(t.prototype,"networkReceivedTime",{get:function(){return this.privNetworkReceivedTime},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"message",{get:function(){return this.privMessage},enumerable:!1,configurable:!0}),t}(a);t.ConnectionMessageReceivedEvent=h;var v=function(e){function t(t,r,n){var o=e.call(this,"ConnectionMessageSentEvent",t)||this;return o.privNetworkSentTime=r,o.privMessage=n,o}return o(t,e),Object.defineProperty(t.prototype,"networkSentTime",{get:function(){return this.privNetworkSentTime},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"message",{get:function(){return this.privMessage},enumerable:!1,configurable:!0}),t}(a);t.ConnectionMessageSentEvent=v},2894:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ConnectionMessage=t.MessageType=void 0;var n,o=r(128),i=r(7432);!function(e){e[e.Text=0]="Text",e[e.Binary=1]="Binary"}(n=t.MessageType||(t.MessageType={}));var s=function(){function e(e,t,r,s){if(this.privBody=null,e===n.Text&&t&&"string"!=typeof t)throw new o.InvalidOperationError("Payload must be a string");if(e===n.Binary&&t&&!(t instanceof ArrayBuffer))throw new o.InvalidOperationError("Payload must be ArrayBuffer");switch(this.privMessageType=e,this.privBody=t,this.privHeaders=r||{},this.privId=s||i.createNoDashGuid(),this.messageType){case n.Binary:this.privSize=null!==this.binaryBody?this.binaryBody.byteLength:0;break;case n.Text:this.privSize=this.textBody.length}}return Object.defineProperty(e.prototype,"messageType",{get:function(){return this.privMessageType},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"headers",{get:function(){return this.privHeaders},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"body",{get:function(){return this.privBody},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"textBody",{get:function(){if(this.privMessageType===n.Binary)throw new o.InvalidOperationError("Not supported for binary message");return this.privBody},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"binaryBody",{get:function(){if(this.privMessageType===n.Text)throw new o.InvalidOperationError("Not supported for text message");return this.privBody},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"id",{get:function(){return this.privId},enumerable:!1,configurable:!0}),e}();t.ConnectionMessage=s},2823:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ConnectionOpenResponse=void 0;var r=function(){function e(e,t){this.privStatusCode=e,this.privReason=t}return Object.defineProperty(e.prototype,"statusCode",{get:function(){return this.privStatusCode},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"reason",{get:function(){return this.privReason},enumerable:!1,configurable:!0}),e}();t.ConnectionOpenResponse=r},7748:function(e,t,r){"use strict";var n,o=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},n(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.SendingAgentContextMessageEvent=t.DialogEvent=void 0;var i=r(6314),s=function(e){function t(t,r){return void 0===r&&(r=i.EventType.Info),e.call(this,t,r)||this}return o(t,e),t}(i.PlatformEvent);t.DialogEvent=s;var a=function(e){function t(t){var r=e.call(this,"SendingAgentContextMessageEvent")||this;return r.privAgentConfig=t,r}return o(t,e),Object.defineProperty(t.prototype,"agentConfig",{get:function(){return this.privAgentConfig},enumerable:!1,configurable:!0}),t}(s);t.SendingAgentContextMessageEvent=a},128:function(e,t){"use strict";var r,n=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},r(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.ObjectDisposedError=t.InvalidOperationError=t.ArgumentNullError=void 0;var o=function(e){function t(t){var r=e.call(this,t)||this;return r.name="ArgumentNull",r.message=t,r}return n(t,e),t}(Error);t.ArgumentNullError=o;var i=function(e){function t(t){var r=e.call(this,t)||this;return r.name="InvalidOperation",r.message=t,r}return n(t,e),t}(Error);t.InvalidOperationError=i;var s=function(e){function t(t,r){var n=e.call(this,r)||this;return n.name=t+"ObjectDisposed",n.message=r,n}return n(t,e),t}(Error);t.ObjectDisposedError=s},7886:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EventSource=void 0;var n=r(128),o=r(7432),i=function(){function e(e){var t=this;this.privEventListeners={},this.privIsDisposed=!1,this.onEvent=function(e){if(t.isDisposed())throw new n.ObjectDisposedError("EventSource");if(t.metadata)for(var r in t.metadata)r&&e.metadata&&(e.metadata[r]||(e.metadata[r]=t.metadata[r]));for(var o in t.privEventListeners)o&&t.privEventListeners[o]&&t.privEventListeners[o](e)},this.attach=function(e){var r=o.createNoDashGuid();return t.privEventListeners[r]=e,{detach:function(){return delete t.privEventListeners[r],Promise.resolve()}}},this.attachListener=function(e){return t.attach(e.onEvent)},this.isDisposed=function(){return t.privIsDisposed},this.dispose=function(){t.privEventListeners=null,t.privIsDisposed=!0},this.privMetadata=e}return Object.defineProperty(e.prototype,"metadata",{get:function(){return this.privMetadata},enumerable:!1,configurable:!0}),e}();t.EventSource=i},7453:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Events=void 0;var n=r(128),o=r(7886),i=function(){function e(){}return Object.defineProperty(e,"instance",{get:function(){return e.privInstance},enumerable:!1,configurable:!0}),e.privInstance=new o.EventSource,e.setEventSource=function(t){if(!t)throw new n.ArgumentNullError("eventSource");e.privInstance=t},e}();t.Events=i},2370:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||t.hasOwnProperty(r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),o(r(7791),t),o(r(8866),t),o(r(2894),t),o(r(2823),t),o(r(7748),t),o(r(128),t),o(r(7453),t),o(r(7886),t),o(r(7432),t),o(r(2323),t),o(r(5677),t),o(r(9365),t),o(r(7548),t),o(r(6287),t),o(r(1376),t),o(r(4490),t),o(r(9515),t),o(r(6783),t),o(r(9724),t),o(r(6314),t),o(r(1189),t),o(r(6738),t),o(r(5297),t),o(r(7826),t),o(r(9790),t);var i=r(9307);Object.defineProperty(t,"TranslationStatus",{enumerable:!0,get:function(){return i.TranslationStatus}}),o(r(5916),t),o(r(3669),t),o(r(1442),t),o(r(4562),t),o(r(1072),t)},7432:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createNoDashGuid=t.createGuid=void 0;var n=r(5834),o=function(){return n.v4()};t.createGuid=o,t.createNoDashGuid=function(){return o().replace(new RegExp("-","g"),"").toUpperCase()}},3669:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},2323:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},5677:function(e,t){"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.ConnectionState=void 0,(r=t.ConnectionState||(t.ConnectionState={}))[r.None=0]="None",r[r.Connected=1]="Connected",r[r.Connecting=2]="Connecting",r[r.Disconnected=3]="Disconnected"},9365:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},7548:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},6287:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},4490:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},1376:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},9515:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},6783:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},9724:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.List=void 0;var n=r(128);t.List=function e(t){var r=this;if(this.privSubscriptionIdCounter=0,this.privAddSubscriptions={},this.privRemoveSubscriptions={},this.privDisposedSubscriptions={},this.privDisposeReason=null,this.get=function(e){return r.throwIfDisposed(),r.privList[e]},this.first=function(){return r.get(0)},this.last=function(){return r.get(r.length()-1)},this.add=function(e){r.throwIfDisposed(),r.insertAt(r.privList.length,e)},this.insertAt=function(e,t){r.throwIfDisposed(),0===e?r.privList.unshift(t):e===r.privList.length?r.privList.push(t):r.privList.splice(e,0,t),r.triggerSubscriptions(r.privAddSubscriptions)},this.removeFirst=function(){return r.throwIfDisposed(),r.removeAt(0)},this.removeLast=function(){return r.throwIfDisposed(),r.removeAt(r.length()-1)},this.removeAt=function(e){return r.throwIfDisposed(),r.remove(e,1)[0]},this.remove=function(e,t){r.throwIfDisposed();var n=r.privList.splice(e,t);return r.triggerSubscriptions(r.privRemoveSubscriptions),n},this.clear=function(){r.throwIfDisposed(),r.remove(0,r.length())},this.length=function(){return r.throwIfDisposed(),r.privList.length},this.onAdded=function(e){r.throwIfDisposed();var t=r.privSubscriptionIdCounter++;return r.privAddSubscriptions[t]=e,{detach:function(){return delete r.privAddSubscriptions[t],Promise.resolve()}}},this.onRemoved=function(e){r.throwIfDisposed();var t=r.privSubscriptionIdCounter++;return r.privRemoveSubscriptions[t]=e,{detach:function(){return delete r.privRemoveSubscriptions[t],Promise.resolve()}}},this.onDisposed=function(e){r.throwIfDisposed();var t=r.privSubscriptionIdCounter++;return r.privDisposedSubscriptions[t]=e,{detach:function(){return delete r.privDisposedSubscriptions[t],Promise.resolve()}}},this.join=function(e){return r.throwIfDisposed(),r.privList.join(e)},this.toArray=function(){var e=Array();return r.privList.forEach((function(t){e.push(t)})),e},this.any=function(e){return r.throwIfDisposed(),e?r.where(e).length()>0:r.length()>0},this.all=function(e){return r.throwIfDisposed(),r.where(e).length()===r.length()},this.forEach=function(e){r.throwIfDisposed();for(var t=0;t<r.length();t++)e(r.privList[t],t)},this.select=function(t){r.throwIfDisposed();for(var n=[],o=0;o<r.privList.length;o++)n.push(t(r.privList[o],o));return new e(n)},this.where=function(t){r.throwIfDisposed();for(var n=new e,o=0;o<r.privList.length;o++)t(r.privList[o],o)&&n.add(r.privList[o]);return n},this.orderBy=function(t){return r.throwIfDisposed(),new e(r.toArray().sort(t))},this.orderByDesc=function(e){return r.throwIfDisposed(),r.orderBy((function(t,r){return e(r,t)}))},this.clone=function(){return r.throwIfDisposed(),new e(r.toArray())},this.concat=function(t){return r.throwIfDisposed(),new e(r.privList.concat(t.toArray()))},this.concatArray=function(t){return r.throwIfDisposed(),new e(r.privList.concat(t))},this.isDisposed=function(){return null==r.privList},this.dispose=function(e){r.isDisposed()||(r.privDisposeReason=e,r.privList=null,r.privAddSubscriptions=null,r.privRemoveSubscriptions=null,r.triggerSubscriptions(r.privDisposedSubscriptions))},this.throwIfDisposed=function(){if(r.isDisposed())throw new n.ObjectDisposedError("List",r.privDisposeReason)},this.triggerSubscriptions=function(e){if(e)for(var t in e)t&&e[t]()},this.privList=[],t)for(var o=0,i=t;o<i.length;o++){var s=i[o];this.privList.push(s)}}},4562:function(e,t,r){"use strict";var n,o=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},n(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.OCSPCacheUpdateErrorEvent=t.OCSPResponseRetrievedEvent=t.OCSPCacheFetchErrorEvent=t.OCSPVerificationFailedEvent=t.OCSPCacheHitEvent=t.OCSPCacheEntryNeedsRefreshEvent=t.OCSPCacheEntryExpiredEvent=t.OCSPWSUpgradeStartedEvent=t.OCSPStapleReceivedEvent=t.OCSPCacheUpdatehCompleteEvent=t.OCSPDiskCacheStoreEvent=t.OCSPMemoryCacheStoreEvent=t.OCSPCacheUpdateNeededEvent=t.OCSPDiskCacheHitEvent=t.OCSPCacheMissEvent=t.OCSPMemoryCacheHitEvent=t.OCSPEvent=void 0;var i=r(6314),s=function(e){function t(t,r,n){var o=e.call(this,t,r)||this;return o.privSignature=n,o}return o(t,e),t}(i.PlatformEvent);t.OCSPEvent=s;var a=function(e){function t(t){return e.call(this,"OCSPMemoryCacheHitEvent",i.EventType.Debug,t)||this}return o(t,e),t}(s);t.OCSPMemoryCacheHitEvent=a;var c=function(e){function t(t){return e.call(this,"OCSPCacheMissEvent",i.EventType.Debug,t)||this}return o(t,e),t}(s);t.OCSPCacheMissEvent=c;var u=function(e){function t(t){return e.call(this,"OCSPDiskCacheHitEvent",i.EventType.Debug,t)||this}return o(t,e),t}(s);t.OCSPDiskCacheHitEvent=u;var p=function(e){function t(t){return e.call(this,"OCSPCacheUpdateNeededEvent",i.EventType.Debug,t)||this}return o(t,e),t}(s);t.OCSPCacheUpdateNeededEvent=p;var l=function(e){function t(t){return e.call(this,"OCSPMemoryCacheStoreEvent",i.EventType.Debug,t)||this}return o(t,e),t}(s);t.OCSPMemoryCacheStoreEvent=l;var f=function(e){function t(t){return e.call(this,"OCSPDiskCacheStoreEvent",i.EventType.Debug,t)||this}return o(t,e),t}(s);t.OCSPDiskCacheStoreEvent=f;var h=function(e){function t(t){return e.call(this,"OCSPCacheUpdatehCompleteEvent",i.EventType.Debug,t)||this}return o(t,e),t}(s);t.OCSPCacheUpdatehCompleteEvent=h;var v=function(e){function t(){return e.call(this,"OCSPStapleReceivedEvent",i.EventType.Debug,"")||this}return o(t,e),t}(s);t.OCSPStapleReceivedEvent=v;var d=function(e){function t(t){return e.call(this,"OCSPWSUpgradeStartedEvent",i.EventType.Debug,t)||this}return o(t,e),t}(s);t.OCSPWSUpgradeStartedEvent=d;var y=function(e){function t(t,r){var n=e.call(this,"OCSPCacheEntryExpiredEvent",i.EventType.Debug,t)||this;return n.privExpireTime=r,n}return o(t,e),t}(s);t.OCSPCacheEntryExpiredEvent=y;var g=function(e){function t(t,r,n){var o=e.call(this,"OCSPCacheEntryNeedsRefreshEvent",i.EventType.Debug,t)||this;return o.privExpireTime=n,o.privStartTime=r,o}return o(t,e),t}(s);t.OCSPCacheEntryNeedsRefreshEvent=g;var m=function(e){function t(t,r,n){var o=e.call(this,"OCSPCacheHitEvent",i.EventType.Debug,t)||this;return o.privExpireTime=n,o.privExpireTimeString=new Date(n).toLocaleDateString(),o.privStartTime=r,o.privStartTimeString=new Date(r).toLocaleTimeString(),o}return o(t,e),t}(s);t.OCSPCacheHitEvent=m;var b=function(e){function t(t,r){var n=e.call(this,"OCSPVerificationFailedEvent",i.EventType.Debug,t)||this;return n.privError=r,n}return o(t,e),t}(s);t.OCSPVerificationFailedEvent=b;var S=function(e){function t(t,r){var n=e.call(this,"OCSPCacheFetchErrorEvent",i.EventType.Debug,t)||this;return n.privError=r,n}return o(t,e),t}(s);t.OCSPCacheFetchErrorEvent=S;var P=function(e){function t(t){return e.call(this,"OCSPResponseRetrievedEvent",i.EventType.Debug,t)||this}return o(t,e),t}(s);t.OCSPResponseRetrievedEvent=P;var C=function(e){function t(t,r){var n=e.call(this,"OCSPCacheUpdateErrorEvent",i.EventType.Debug,t)||this;return n.privError=r,n}return o(t,e),t}(s);t.OCSPCacheUpdateErrorEvent=C},6314:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PlatformEvent=t.EventType=void 0;var n,o=r(7432);(n=t.EventType||(t.EventType={}))[n.Debug=0]="Debug",n[n.Info=1]="Info",n[n.Warning=2]="Warning",n[n.Error=3]="Error";var i=function(){function e(e,t){this.privName=e,this.privEventId=o.createNoDashGuid(),this.privEventTime=(new Date).toISOString(),this.privEventType=t,this.privMetadata={}}return Object.defineProperty(e.prototype,"name",{get:function(){return this.privName},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"eventId",{get:function(){return this.privEventId},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"eventTime",{get:function(){return this.privEventTime},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"eventType",{get:function(){return this.privEventType},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"metadata",{get:function(){return this.privMetadata},enumerable:!1,configurable:!0}),e}();t.PlatformEvent=i},1189:function(e,t){"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.marshalPromiseToCallbacks=t.Sink=t.Deferred=t.PromiseResultEventSource=t.PromiseResult=t.PromiseState=void 0,function(e){e[e.None=0]="None",e[e.Resolved=1]="Resolved",e[e.Rejected=2]="Rejected"}(r=t.PromiseState||(t.PromiseState={}));var n=function(){function e(e){var t=this;this.throwIfError=function(){if(t.isError)throw t.error},e.on((function(e){t.privIsCompleted||(t.privIsCompleted=!0,t.privIsError=!1,t.privResult=e)}),(function(e){t.privIsCompleted||(t.privIsCompleted=!0,t.privIsError=!0,t.privError=e)}))}return Object.defineProperty(e.prototype,"isCompleted",{get:function(){return this.privIsCompleted},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isError",{get:function(){return this.privIsError},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"error",{get:function(){return this.privError},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"result",{get:function(){return this.privResult},enumerable:!1,configurable:!0}),e}();t.PromiseResult=n;var o=function(){var e=this;this.setResult=function(t){e.privOnSetResult(t)},this.setError=function(t){e.privOnSetError(t)},this.on=function(t,r){e.privOnSetResult=t,e.privOnSetError=r}};t.PromiseResultEventSource=o;var i=function(){function e(){var e=this;this.resolve=function(t){return e.privResolve(t),e},this.reject=function(t){return e.privReject(t),e},this.privPromise=new Promise((function(t,r){e.privResolve=t,e.privReject=r}))}return Object.defineProperty(e.prototype,"promise",{get:function(){return this.privPromise},enumerable:!1,configurable:!0}),e}();t.Deferred=i;var s=function(){function e(){var e=this;this.privState=r.None,this.privPromiseResult=null,this.privPromiseResultEvents=null,this.privSuccessHandlers=[],this.privErrorHandlers=[],this.resolve=function(t){if(e.privState!==r.None)throw new Error("'Cannot resolve a completed promise'");e.privState=r.Resolved,e.privPromiseResultEvents.setResult(t);for(var n=0;n<e.privSuccessHandlers.length;n++)e.executeSuccessCallback(t,e.privSuccessHandlers[n],e.privErrorHandlers[n]);e.detachHandlers()},this.reject=function(t){if(e.privState!==r.None)throw new Error("'Cannot reject a completed promise'");e.privState=r.Rejected,e.privPromiseResultEvents.setError(t);for(var n=0,o=e.privErrorHandlers;n<o.length;n++){var i=o[n];e.executeErrorCallback(t,i)}e.detachHandlers()},this.on=function(t,n){null==t&&(t=function(e){}),e.privState===r.None?(e.privSuccessHandlers.push(t),e.privErrorHandlers.push(n)):(e.privState===r.Resolved?e.executeSuccessCallback(e.privPromiseResult.result,t,n):e.privState===r.Rejected&&e.executeErrorCallback(e.privPromiseResult.error,n),e.detachHandlers())},this.executeSuccessCallback=function(t,r,n){try{r(t)}catch(t){e.executeErrorCallback("'Unhandled callback error: "+t+"'",n)}},this.executeErrorCallback=function(e,t){if(!t)throw new Error("'Unhandled error: "+e+"'");try{t(e)}catch(t){throw new Error("'Unhandled callback error: "+t+". InnerError: "+e+"'")}},this.detachHandlers=function(){e.privErrorHandlers=[],e.privSuccessHandlers=[]},this.privPromiseResultEvents=new o,this.privPromiseResult=new n(this.privPromiseResultEvents)}return Object.defineProperty(e.prototype,"state",{get:function(){return this.privState},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"result",{get:function(){return this.privPromiseResult},enumerable:!1,configurable:!0}),e}();t.Sink=s,t.marshalPromiseToCallbacks=function(e,t,r){e.then((function(e){try{t&&t(e)}catch(e){if(r)try{if(e instanceof Error){var n=e;r(n.name+": "+n.message)}else r(e)}catch(e){}}}),(function(e){if(r)try{if(e instanceof Error){var t=e;r(t.name+": "+t.message)}else r(e)}catch(e){}}))}},6738:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function s(e){try{c(n.next(e))}catch(e){i(e)}}function a(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var r,n,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,n=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.Queue=void 0;var i,s=r(128),a=r(9724),c=r(1189);!function(e){e[e.Dequeue=0]="Dequeue",e[e.Peek=1]="Peek"}(i||(i={}));var u=function(){function e(e){var t=this;this.privPromiseStore=new a.List,this.privIsDrainInProgress=!1,this.privIsDisposing=!1,this.privDisposeReason=null,this.enqueue=function(e){t.throwIfDispose(),t.enqueueFromPromise(new Promise((function(t,r){t(e)})))},this.enqueueFromPromise=function(e){t.throwIfDispose(),e.then((function(e){t.privList.add(e)}),(function(e){}))},this.dequeue=function(){t.throwIfDispose();var e=new c.Deferred;return t.privSubscribers&&(t.privSubscribers.add({deferral:e,type:i.Dequeue}),t.drain()),e.promise},this.peek=function(){t.throwIfDispose();var e=new c.Deferred;return t.privSubscribers&&(t.privSubscribers.add({deferral:e,type:i.Peek}),t.drain()),e.promise},this.length=function(){return t.throwIfDispose(),t.privList.length()},this.isDisposed=function(){return null==t.privSubscribers},this.drain=function(){if(!t.privIsDrainInProgress&&!t.privIsDisposing){t.privIsDrainInProgress=!0;var e=t.privSubscribers,r=t.privList;if(e&&r){for(;r.length()>0&&e.length()>0&&!t.privIsDisposing;){var n=e.removeFirst();if(n.type===i.Peek)n.deferral.resolve(r.first());else{var o=r.removeFirst();n.deferral.resolve(o)}}t.privSubscribers===e&&(t.privSubscribers=e),t.privList===r&&(t.privList=r)}t.privIsDrainInProgress=!1}},this.throwIfDispose=function(){if(t.isDisposed()){if(t.privDisposeReason)throw new s.InvalidOperationError(t.privDisposeReason);throw new s.ObjectDisposedError("Queue")}if(t.privIsDisposing)throw new s.InvalidOperationError("Queue disposing")},this.privList=e||new a.List,this.privDetachables=[],this.privSubscribers=new a.List,this.privDetachables.push(this.privList.onAdded(this.drain))}return e.prototype.drainAndDispose=function(e,t){return n(this,void 0,void 0,(function(){var r,n,i,s,a=this;return o(this,(function(o){switch(o.label){case 0:if(this.isDisposed()||this.privIsDisposing)return[3,5];if(this.privDisposeReason=t,this.privIsDisposing=!0,r=this.privSubscribers){for(;r.length()>0;)r.removeFirst().deferral.resolve(void 0);this.privSubscribers===r&&(this.privSubscribers=r)}n=0,i=this.privDetachables,o.label=1;case 1:return n<i.length?[4,i[n].detach()]:[3,4];case 2:o.sent(),o.label=3;case 3:return n++,[3,1];case 4:if(this.privPromiseStore.length()>0&&e)return s=[],this.privPromiseStore.toArray().forEach((function(e){s.push(e)})),[2,Promise.all(s).finally((function(){a.privSubscribers=null,a.privList.forEach((function(t,r){e(t)})),a.privList=null})).then()];this.privSubscribers=null,this.privList=null,o.label=5;case 5:return[2]}}))}))},e.prototype.dispose=function(e){return n(this,void 0,void 0,(function(){return o(this,(function(t){switch(t.label){case 0:return[4,this.drainAndDispose(null,e)];case 1:return t.sent(),[2]}}))}))},e}();t.Queue=u},5297:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RawWebsocketMessage=void 0;var n=r(2894),o=r(128),i=r(7432),s=function(){function e(e,t,r){if(this.privPayload=null,!t)throw new o.ArgumentNullError("payload");if(e===n.MessageType.Binary&&"ArrayBuffer"!==t.__proto__.constructor.name)throw new o.InvalidOperationError("Payload must be ArrayBuffer");if(e===n.MessageType.Text&&"string"!=typeof t)throw new o.InvalidOperationError("Payload must be a string");this.privMessageType=e,this.privPayload=t,this.privId=r||i.createNoDashGuid()}return Object.defineProperty(e.prototype,"messageType",{get:function(){return this.privMessageType},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"payload",{get:function(){return this.privPayload},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"textContent",{get:function(){if(this.privMessageType===n.MessageType.Binary)throw new o.InvalidOperationError("Not supported for binary message");return this.privPayload},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"binaryContent",{get:function(){if(this.privMessageType===n.MessageType.Text)throw new o.InvalidOperationError("Not supported for text message");return this.privPayload},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"id",{get:function(){return this.privId},enumerable:!1,configurable:!0}),e}();t.RawWebsocketMessage=s},7826:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RiffPcmEncoder=void 0;t.RiffPcmEncoder=function(e,t){var r=this;this.encode=function(e){var t=r.downSampleAudioFrame(e,r.privActualSampleRate,r.privDesiredSampleRate);if(!t)return null;var n=2*t.length,o=new ArrayBuffer(n),i=new DataView(o);return r.floatTo16BitPCM(i,0,t),o},this.setString=function(e,t,r){for(var n=0;n<r.length;n++)e.setUint8(t+n,r.charCodeAt(n))},this.floatTo16BitPCM=function(e,t,r){for(var n=0;n<r.length;n++,t+=2){var o=Math.max(-1,Math.min(1,r[n]));e.setInt16(t,o<0?32768*o:32767*o,!0)}},this.downSampleAudioFrame=function(e,t,r){if(r===t||r>t)return e;for(var n=t/r,o=Math.round(e.length/n),i=new Float32Array(o),s=0,a=0;a<o;){for(var c=Math.round((a+1)*n),u=0,p=0;s<c&&s<e.length;)u+=e[s++],p++;i[a++]=u/p}return i},this.privActualSampleRate=e,this.privDesiredSampleRate=t}},9790:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function s(e){try{c(n.next(e))}catch(e){i(e)}}function a(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var r,n,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,n=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.Stream=void 0;var i=r(128),s=r(7432),a=r(6738),c=function(){function e(e){var t=this;this.privIsWriteEnded=!1,this.privIsReadEnded=!1,this.read=function(){if(t.privIsReadEnded)throw new i.InvalidOperationError("Stream read has already finished");return t.privReaderQueue.dequeue().then((function(e){return n(t,void 0,void 0,(function(){return o(this,(function(t){switch(t.label){case 0:return void 0===e||e.isEnd?[4,this.privReaderQueue.dispose("End of stream reached")]:[3,2];case 1:t.sent(),t.label=2;case 2:return[2,e]}}))}))}))},this.readEnded=function(){t.privIsReadEnded||(t.privIsReadEnded=!0,t.privReaderQueue=new a.Queue)},this.throwIfClosed=function(){if(t.privIsWriteEnded)throw new i.InvalidOperationError("Stream closed")},this.privId=e||s.createNoDashGuid(),this.privReaderQueue=new a.Queue}return Object.defineProperty(e.prototype,"isClosed",{get:function(){return this.privIsWriteEnded},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isReadEnded",{get:function(){return this.privIsReadEnded},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"id",{get:function(){return this.privId},enumerable:!1,configurable:!0}),e.prototype.close=function(){this.privIsWriteEnded||(this.writeStreamChunk({buffer:null,isEnd:!0,timeReceived:Date.now()}),this.privIsWriteEnded=!0)},e.prototype.writeStreamChunk=function(e){if(this.throwIfClosed(),!this.privReaderQueue.isDisposed())try{this.privReaderQueue.enqueue(e)}catch(e){}},e}();t.Stream=c},1442:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Timeout=void 0;var r=function(){function e(){}return e.workerTimers=null,e.clearTimeout=function(t){return e.timers().clearTimeout(t)},e.setTimeout=function(t,r){return e.timers().setTimeout(t,r)},e.load=function(t){var r=new Map([[0,function(){}]]),n=new Map,o=new Worker(t);return o.addEventListener("message",(function(t){var o=t.data;if(e.isCallNotification(o)){var i=o.params.timerId,s=r.get(i);if("number"==typeof s){if(void 0===(c=n.get(s))||c!==i)throw new Error("The timer is in an undefined state.")}else{if(void 0===s)throw new Error("The timer is in an undefined state.");s(),r.delete(i)}}else{if(!e.isClearResponse(o)){var a=o.error.message;throw new Error(a)}var c,u=o.id;if(void 0===(c=n.get(u)))throw new Error("The timer is in an undefined state.");n.delete(u),r.delete(c)}})),{clearTimeout:function(e){var t=Math.random();n.set(t,e),r.set(e,t),o.postMessage({id:t,method:"clear",params:{timerId:e}})},setTimeout:function(e,t){var n=Math.random();return r.set(n,e),o.postMessage({id:null,method:"set",params:{delay:t,now:performance.now(),timerId:n}}),n}}},e.loadWorkerTimers=function(){return function(){if(null!==e.workerTimers)return e.workerTimers;var t=new Blob(['!function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=14)}([function(e,t,n){"use strict";n.d(t,"a",(function(){return i})),n.d(t,"b",(function(){return u})),n.d(t,"c",(function(){return a})),n.d(t,"d",(function(){return d}));const r=new Map,o=new Map,i=e=>{const t=r.get(e);if(void 0===t)throw new Error(\'There is no interval scheduled with the given id "\'.concat(e,\'".\'));clearTimeout(t),r.delete(e)},u=e=>{const t=o.get(e);if(void 0===t)throw new Error(\'There is no timeout scheduled with the given id "\'.concat(e,\'".\'));clearTimeout(t),o.delete(e)},f=(e,t)=>{let n,r;if("performance"in self){const o=performance.now();n=o,r=e-Math.max(0,o-t)}else n=Date.now(),r=e;return{expected:n+r,remainingDelay:r}},c=(e,t,n,r)=>{const o="performance"in self?performance.now():Date.now();o>n?postMessage({id:null,method:"call",params:{timerId:t}}):e.set(t,setTimeout(c,n-o,e,t,n))},a=(e,t,n)=>{const{expected:o,remainingDelay:i}=f(e,n);r.set(t,setTimeout(c,i,r,t,o))},d=(e,t,n)=>{const{expected:r,remainingDelay:i}=f(e,n);o.set(t,setTimeout(c,i,o,t,r))}},function(e,t,n){"use strict";n.r(t);var r=n(2);for(var o in r)"default"!==o&&function(e){n.d(t,e,(function(){return r[e]}))}(o);var i=n(3);for(var o in i)"default"!==o&&function(e){n.d(t,e,(function(){return i[e]}))}(o);var u=n(4);for(var o in u)"default"!==o&&function(e){n.d(t,e,(function(){return u[e]}))}(o);var f=n(5);for(var o in f)"default"!==o&&function(e){n.d(t,e,(function(){return f[e]}))}(o);var c=n(6);for(var o in c)"default"!==o&&function(e){n.d(t,e,(function(){return c[e]}))}(o);var a=n(7);for(var o in a)"default"!==o&&function(e){n.d(t,e,(function(){return a[e]}))}(o);var d=n(8);for(var o in d)"default"!==o&&function(e){n.d(t,e,(function(){return d[e]}))}(o);var s=n(9);for(var o in s)"default"!==o&&function(e){n.d(t,e,(function(){return s[e]}))}(o)},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t,n){"use strict";n.r(t);var r=n(11);for(var o in r)"default"!==o&&function(e){n.d(t,e,(function(){return r[e]}))}(o);var i=n(12);for(var o in i)"default"!==o&&function(e){n.d(t,e,(function(){return i[e]}))}(o);var u=n(13);for(var o in u)"default"!==o&&function(e){n.d(t,e,(function(){return u[e]}))}(o)},function(e,t){},function(e,t){},function(e,t){},function(e,t,n){"use strict";n.r(t);var r=n(0),o=n(1);for(var i in o)"default"!==i&&function(e){n.d(t,e,(function(){return o[e]}))}(i);var u=n(10);for(var i in u)"default"!==i&&function(e){n.d(t,e,(function(){return u[e]}))}(i);addEventListener("message",({data:e})=>{try{if("clear"===e.method){const{id:t,params:{timerId:n}}=e;Object(r.b)(n),postMessage({error:null,id:t})}else{if("set"!==e.method)throw new Error(\'The given method "\'.concat(e.method,\'" is not supported\'));{const{params:{delay:t,now:n,timerId:o}}=e;Object(r.d)(t,o,n)}}}catch(t){postMessage({error:{message:t.message},id:e.id,result:null})}})}]);'],{type:"application/javascript; charset=utf-8"}),r=URL.createObjectURL(t);return e.workerTimers=e.load(r),e.workerTimers.setTimeout((function(){return URL.revokeObjectURL(r)}),0),e.workerTimers}},e.timers=e.loadWorkerTimers(),e.isCallNotification=function(e){return void 0!==e.method&&"call"===e.method},e.isClearResponse=function(e){return null===e.error&&"number"==typeof e.id},e}();t.Timeout=r},3349:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActivityReceivedEventArgs=void 0;var r=function(){function e(e,t){this.privActivity=e,this.privAudioStream=t}return Object.defineProperty(e.prototype,"activity",{get:function(){return this.privActivity},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"audioStream",{get:function(){return this.privAudioStream},enumerable:!1,configurable:!0}),e}();t.ActivityReceivedEventArgs=r},5897:function(e,t,r){"use strict";var n,o=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},n(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.AudioOutputConfigImpl=t.AudioConfigImpl=t.AudioConfig=void 0;var i=r(6340),s=r(7348),a=r(9480),c=r(12),u=r(7908),p=r(5149),l=function(){function e(){}return e.fromDefaultMicrophoneInput=function(){var e=new i.PcmRecorder;return new f(new i.MicAudioSource(e))},e.fromMicrophoneInput=function(e){var t=new i.PcmRecorder;return new f(new i.MicAudioSource(t,e))},e.fromWavFileInput=function(e,t){return void 0===t&&(t="unnamedBuffer.wav"),new f(new i.FileAudioSource(e,t))},e.fromStreamInput=function(e){if(e instanceof a.PullAudioInputStreamCallback)return new f(new u.PullAudioInputStreamImpl(e));if(e instanceof a.AudioInputStream)return new f(e);if("undefined"!=typeof MediaStream&&e instanceof MediaStream){var t=new i.PcmRecorder;return new f(new i.MicAudioSource(t,null,null,e))}throw new Error("Not Supported Type")},e.fromDefaultSpeakerOutput=function(){return new h(new a.SpeakerAudioDestination)},e.fromSpeakerOutput=function(t){if(void 0===t)return e.fromDefaultSpeakerOutput();if(t instanceof a.SpeakerAudioDestination)return new h(t);throw new Error("Not Supported Type")},e.fromAudioFileOutput=function(e){return new h(new c.AudioFileWriter(e))},e.fromStreamOutput=function(e){if(e instanceof a.PushAudioOutputStreamCallback)return new h(new p.PushAudioOutputStreamImpl(e));if(e instanceof a.PushAudioOutputStream)return new h(e);if(e instanceof a.PullAudioOutputStream)return new h(e);throw new Error("Not Supported Type")},e}();t.AudioConfig=l;var f=function(e){function t(t){var r=e.call(this)||this;return r.privSource=t,r}return o(t,e),Object.defineProperty(t.prototype,"format",{get:function(){return this.privSource.format},enumerable:!1,configurable:!0}),t.prototype.close=function(e,t){this.privSource.turnOff().then((function(){e&&e()}),(function(e){t&&t(e)}))},t.prototype.id=function(){return this.privSource.id()},Object.defineProperty(t.prototype,"blob",{get:function(){return this.privSource.blob},enumerable:!1,configurable:!0}),t.prototype.turnOn=function(){return this.privSource.turnOn()},t.prototype.attach=function(e){return this.privSource.attach(e)},t.prototype.detach=function(e){return this.privSource.detach(e)},t.prototype.turnOff=function(){return this.privSource.turnOff()},Object.defineProperty(t.prototype,"events",{get:function(){return this.privSource.events},enumerable:!1,configurable:!0}),t.prototype.setProperty=function(e,t){if(s.Contracts.throwIfNull(t,"value"),void 0===this.privSource.setProperty)throw new Error("This AudioConfig instance does not support setting properties.");this.privSource.setProperty(e,t)},t.prototype.getProperty=function(e,t){if(void 0!==this.privSource.getProperty)return this.privSource.getProperty(e,t);throw new Error("This AudioConfig instance does not support getting properties.")},Object.defineProperty(t.prototype,"deviceInfo",{get:function(){return this.privSource.deviceInfo},enumerable:!1,configurable:!0}),t}(l);t.AudioConfigImpl=f;var h=function(e){function t(t){var r=e.call(this)||this;return r.privDestination=t,r}return o(t,e),Object.defineProperty(t.prototype,"format",{set:function(e){this.privDestination.format=e},enumerable:!1,configurable:!0}),t.prototype.write=function(e){this.privDestination.write(e)},t.prototype.close=function(){this.privDestination.close()},t.prototype.id=function(){return this.privDestination.id()},t.prototype.setProperty=function(e,t){throw new Error("This AudioConfig instance does not support setting properties.")},t.prototype.getProperty=function(e,t){throw new Error("This AudioConfig instance does not support getting properties.")},t}(l);t.AudioOutputConfigImpl=h},12:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.hasOwnProperty.call(e,r)&&n(t,e,r);return o(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.AudioFileWriter=void 0;var s=i(r(9315)),a=r(7348),c=function(){function e(e){var t=this;this.id=function(){return t.privId},a.Contracts.throwIfNullOrUndefined(s.openSync,"\nFile System access not available, please use Push or PullAudioOutputStream"),this.privFd=s.openSync(e,"w")}return Object.defineProperty(e.prototype,"format",{set:function(e){a.Contracts.throwIfNotUndefined(this.privAudioFormat,"format is already set"),this.privAudioFormat=e;var t=0;this.privAudioFormat.hasHeader&&(t=this.privAudioFormat.header.byteLength),void 0!==this.privFd&&(this.privWriteStream=s.createWriteStream("",{fd:this.privFd,start:t,autoClose:!1}))},enumerable:!1,configurable:!0}),e.prototype.write=function(e){a.Contracts.throwIfNullOrUndefined(this.privAudioFormat,"must set format before writing."),void 0!==this.privWriteStream&&this.privWriteStream.write(new Uint8Array(e.slice(0)))},e.prototype.close=function(){var e=this;void 0!==this.privFd&&(this.privWriteStream.on("finish",(function(){e.privAudioFormat.hasHeader&&(e.privAudioFormat.updateHeader(e.privWriteStream.bytesWritten),s.writeSync(e.privFd,new Int8Array(e.privAudioFormat.header),0,e.privAudioFormat.header.byteLength,0)),s.closeSync(e.privFd),e.privFd=void 0})),this.privWriteStream.end())},e}();t.AudioFileWriter=c},7908:function(e,t,r){"use strict";var n,o=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},n(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),i=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function s(e){try{c(n.next(e))}catch(e){i(e)}}function a(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))},s=this&&this.__generator||function(e,t){var r,n,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,n=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.PullAudioInputStreamImpl=t.PullAudioInputStream=t.PushAudioInputStreamImpl=t.PushAudioInputStream=t.AudioInputStream=void 0;var a=r(21),c=r(2370),u=r(7432),p=r(9480),l=r(1891),f=function(){function e(){}return e.createPushStream=function(e){return h.create(e)},e.createPullStream=function(e,t){return d.create(e,t)},e}();t.AudioInputStream=f;var h=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o(t,e),t.create=function(e){return new v(e)},t}(f);t.PushAudioInputStream=h;var v=function(e){function t(t){var r=e.call(this)||this;return r.onEvent=function(e){r.privEvents.onEvent(e),c.Events.instance.onEvent(e)},r.privFormat=void 0===t?l.AudioStreamFormatImpl.getDefaultInputFormat():t,r.privEvents=new c.EventSource,r.privId=u.createNoDashGuid(),r.privStream=new c.ChunkedArrayBufferStream(r.privFormat.avgBytesPerSec/10),r}return o(t,e),Object.defineProperty(t.prototype,"format",{get:function(){return Promise.resolve(this.privFormat)},enumerable:!1,configurable:!0}),t.prototype.write=function(e){this.privStream.writeStreamChunk({buffer:e,isEnd:!1,timeReceived:Date.now()})},t.prototype.close=function(){this.privStream.close()},t.prototype.id=function(){return this.privId},Object.defineProperty(t.prototype,"blob",{get:function(){var e=this;return this.attach("id").then((function(t){var r=[],n=Buffer.from(""),o=function(){return t.read().then((function(t){return!t||t.isEnd?"undefined"!=typeof XMLHttpRequest&&"undefined"!=typeof Blob?Promise.resolve(new Blob(r)):Promise.resolve(Buffer.from(n)):("undefined"!=typeof Blob?r.push(t.buffer):n=Buffer.concat([n,e.toBuffer(t.buffer)]),o())}))};return o()}))},enumerable:!1,configurable:!0}),t.prototype.turnOn=function(){this.onEvent(new c.AudioSourceInitializingEvent(this.privId)),this.onEvent(new c.AudioSourceReadyEvent(this.privId))},t.prototype.attach=function(e){return i(this,void 0,void 0,(function(){var t,r=this;return s(this,(function(n){switch(n.label){case 0:return this.onEvent(new c.AudioStreamNodeAttachingEvent(this.privId,e)),[4,this.turnOn()];case 1:return n.sent(),t=this.privStream,this.onEvent(new c.AudioStreamNodeAttachedEvent(this.privId,e)),[2,{detach:function(){return i(r,void 0,void 0,(function(){return s(this,(function(r){return t.readEnded(),this.onEvent(new c.AudioStreamNodeDetachedEvent(this.privId,e)),[2,this.turnOff()]}))}))},id:function(){return e},read:function(){return t.read()}}]}}))}))},t.prototype.detach=function(e){this.onEvent(new c.AudioStreamNodeDetachedEvent(this.privId,e))},t.prototype.turnOff=function(){},Object.defineProperty(t.prototype,"events",{get:function(){return this.privEvents},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"deviceInfo",{get:function(){return Promise.resolve({bitspersample:this.privFormat.bitsPerSample,channelcount:this.privFormat.channels,connectivity:a.connectivity.Unknown,manufacturer:"Speech SDK",model:"PushStream",samplerate:this.privFormat.samplesPerSec,type:a.type.Stream})},enumerable:!1,configurable:!0}),t.prototype.toBuffer=function(e){for(var t=Buffer.alloc(e.byteLength),r=new Uint8Array(e),n=0;n<t.length;++n)t[n]=r[n];return t},t}(h);t.PushAudioInputStreamImpl=v;var d=function(e){function t(){return e.call(this)||this}return o(t,e),t.create=function(e,t){return new y(e,t)},t}(f);t.PullAudioInputStream=d;var y=function(e){function t(t,r){var n=e.call(this)||this;return n.onEvent=function(e){n.privEvents.onEvent(e),c.Events.instance.onEvent(e)},n.privFormat=void 0===r?p.AudioStreamFormat.getDefaultInputFormat():r,n.privEvents=new c.EventSource,n.privId=u.createNoDashGuid(),n.privCallback=t,n.privIsClosed=!1,n.privBufferSize=n.privFormat.avgBytesPerSec/10,n}return o(t,e),Object.defineProperty(t.prototype,"format",{get:function(){return Promise.resolve(this.privFormat)},enumerable:!1,configurable:!0}),t.prototype.close=function(){this.privIsClosed=!0,this.privCallback.close()},t.prototype.id=function(){return this.privId},Object.defineProperty(t.prototype,"blob",{get:function(){return Promise.reject("Not implemented")},enumerable:!1,configurable:!0}),t.prototype.turnOn=function(){this.onEvent(new c.AudioSourceInitializingEvent(this.privId)),this.onEvent(new c.AudioSourceReadyEvent(this.privId))},t.prototype.attach=function(e){return i(this,void 0,void 0,(function(){var t=this;return s(this,(function(r){switch(r.label){case 0:return this.onEvent(new c.AudioStreamNodeAttachingEvent(this.privId,e)),[4,this.turnOn()];case 1:return r.sent(),this.onEvent(new c.AudioStreamNodeAttachedEvent(this.privId,e)),[2,{detach:function(){return t.privCallback.close(),t.onEvent(new c.AudioStreamNodeDetachedEvent(t.privId,e)),t.turnOff()},id:function(){return e},read:function(){for(var e,r=0;r<t.privBufferSize;){var n=new ArrayBuffer(t.privBufferSize-r),o=t.privCallback.read(n);if(void 0===e?e=n:new Int8Array(e).set(new Int8Array(n),r),0===o)break;r+=o}return Promise.resolve({buffer:e.slice(0,r),isEnd:t.privIsClosed||0===r,timeReceived:Date.now()})}}]}}))}))},t.prototype.detach=function(e){this.onEvent(new c.AudioStreamNodeDetachedEvent(this.privId,e))},t.prototype.turnOff=function(){},Object.defineProperty(t.prototype,"events",{get:function(){return this.privEvents},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"deviceInfo",{get:function(){return Promise.resolve({bitspersample:this.privFormat.bitsPerSample,channelcount:this.privFormat.channels,connectivity:a.connectivity.Unknown,manufacturer:"Speech SDK",model:"PullStream",samplerate:this.privFormat.samplesPerSec,type:a.type.Stream})},enumerable:!1,configurable:!0}),t}(d);t.PullAudioInputStreamImpl=y},5019:function(e,t,r){"use strict";var n,o,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},n(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.AudioOutputFormatImpl=void 0;var s=r(4643),a=r(1891),c=function(e){function t(t,r,n,o,i,s,a,c,u){var p=e.call(this,n,s,r,t)||this;return p.formatTag=t,p.avgBytesPerSec=o,p.blockAlign=i,p.priAudioFormatString=a,p.priRequestAudioFormatString=c,p.priHasHeader=u,p}return i(t,e),t.fromSpeechSynthesisOutputFormat=function(e){return void 0===e?t.getDefaultOutputFormat():t.fromSpeechSynthesisOutputFormatString(t.SpeechSynthesisOutputFormatToString[e])},t.fromSpeechSynthesisOutputFormatString=function(e){switch(e){case"raw-8khz-8bit-mono-mulaw":return new t(a.AudioFormatTag.MuLaw,1,8e3,8e3,1,8,e,e,!1);case"riff-16khz-16kbps-mono-siren":return new t(a.AudioFormatTag.Siren,1,16e3,2e3,40,0,e,"audio-16khz-16kbps-mono-siren",!0);case"audio-16khz-16kbps-mono-siren":return new t(a.AudioFormatTag.Siren,1,16e3,2e3,40,0,e,e,!1);case"audio-16khz-32kbitrate-mono-mp3":return new t(a.AudioFormatTag.MP3,1,16e3,4096,2,16,e,e,!1);case"audio-16khz-128kbitrate-mono-mp3":return new t(a.AudioFormatTag.MP3,1,16e3,16384,2,16,e,e,!1);case"audio-16khz-64kbitrate-mono-mp3":return new t(a.AudioFormatTag.MP3,1,16e3,8192,2,16,e,e,!1);case"audio-24khz-48kbitrate-mono-mp3":return new t(a.AudioFormatTag.MP3,1,24e3,6144,2,16,e,e,!1);case"audio-24khz-96kbitrate-mono-mp3":return new t(a.AudioFormatTag.MP3,1,24e3,12288,2,16,e,e,!1);case"audio-24khz-160kbitrate-mono-mp3":return new t(a.AudioFormatTag.MP3,1,24e3,20480,2,16,e,e,!1);case"raw-16khz-16bit-mono-truesilk":return new t(a.AudioFormatTag.SILKSkype,1,16e3,32e3,2,16,e,e,!1);case"riff-8khz-16bit-mono-pcm":return new t(a.AudioFormatTag.PCM,1,8e3,16e3,2,16,e,"raw-8khz-16bit-mono-pcm",!0);case"riff-24khz-16bit-mono-pcm":return new t(a.AudioFormatTag.PCM,1,24e3,48e3,2,16,e,"raw-24khz-16bit-mono-pcm",!0);case"riff-8khz-8bit-mono-mulaw":return new t(a.AudioFormatTag.MuLaw,1,8e3,8e3,1,8,e,"raw-8khz-8bit-mono-mulaw",!0);case"raw-16khz-16bit-mono-pcm":return new t(a.AudioFormatTag.PCM,1,16e3,32e3,2,16,e,"raw-16khz-16bit-mono-pcm",!1);case"raw-24khz-16bit-mono-pcm":return new t(a.AudioFormatTag.PCM,1,24e3,48e3,2,16,e,"raw-24khz-16bit-mono-pcm",!1);case"raw-8khz-16bit-mono-pcm":return new t(a.AudioFormatTag.PCM,1,8e3,16e3,2,16,e,"raw-8khz-16bit-mono-pcm",!1);case"ogg-16khz-16bit-mono-opus":return new t(a.AudioFormatTag.OGG_OPUS,1,16e3,8192,2,16,e,e,!1);case"ogg-24khz-16bit-mono-opus":return new t(a.AudioFormatTag.OGG_OPUS,1,24e3,8192,2,16,e,e,!1);case"raw-48khz-16bit-mono-pcm":return new t(a.AudioFormatTag.PCM,1,48e3,96e3,2,16,e,"raw-48khz-16bit-mono-pcm",!1);case"riff-48khz-16bit-mono-pcm":return new t(a.AudioFormatTag.PCM,1,48e3,96e3,2,16,e,"raw-48khz-16bit-mono-pcm",!0);case"audio-48khz-96kbitrate-mono-mp3":return new t(a.AudioFormatTag.MP3,1,48e3,12288,2,16,e,e,!1);case"audio-48khz-192kbitrate-mono-mp3":return new t(a.AudioFormatTag.MP3,1,48e3,24576,2,16,e,e,!1);case"ogg-48khz-16bit-mono-opus":return new t(a.AudioFormatTag.OGG_OPUS,1,48e3,12e3,2,16,e,e,!1);case"webm-16khz-16bit-mono-opus":return new t(a.AudioFormatTag.WEBM_OPUS,1,16e3,8e3,2,16,e,e,!1);case"webm-24khz-16bit-mono-opus":return new t(a.AudioFormatTag.WEBM_OPUS,1,24e3,8e3,2,16,e,e,!1);case"raw-24khz-16bit-mono-truesilk":return new t(a.AudioFormatTag.SILKSkype,1,24e3,48e3,2,16,e,e,!1);case"raw-8khz-8bit-mono-alaw":return new t(a.AudioFormatTag.ALaw,1,8e3,8e3,1,8,e,e,!1);case"riff-8khz-8bit-mono-alaw":return new t(a.AudioFormatTag.ALaw,1,8e3,8e3,1,8,e,"raw-8khz-8bit-mono-alaw",!0);default:return new t(a.AudioFormatTag.PCM,1,16e3,32e3,2,16,"riff-16khz-16bit-mono-pcm","raw-16khz-16bit-mono-pcm",!0)}},t.getDefaultOutputFormat=function(){return t.fromSpeechSynthesisOutputFormatString("undefined"!=typeof window?"audio-24khz-48kbitrate-mono-mp3":"riff-16khz-16bit-mono-pcm")},Object.defineProperty(t.prototype,"hasHeader",{get:function(){return this.priHasHeader},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"header",{get:function(){if(this.hasHeader)return this.privHeader},enumerable:!1,configurable:!0}),t.prototype.updateHeader=function(e){this.priHasHeader&&new DataView(this.privHeader).setUint32(40,e,!0)},Object.defineProperty(t.prototype,"requestAudioFormatString",{get:function(){return this.priRequestAudioFormatString},enumerable:!1,configurable:!0}),t.SpeechSynthesisOutputFormatToString=((o={})[s.SpeechSynthesisOutputFormat.Raw8Khz8BitMonoMULaw]="raw-8khz-8bit-mono-mulaw",o[s.SpeechSynthesisOutputFormat.Riff16Khz16KbpsMonoSiren]="riff-16khz-16kbps-mono-siren",o[s.SpeechSynthesisOutputFormat.Audio16Khz16KbpsMonoSiren]="audio-16khz-16kbps-mono-siren",o[s.SpeechSynthesisOutputFormat.Audio16Khz32KBitRateMonoMp3]="audio-16khz-32kbitrate-mono-mp3",o[s.SpeechSynthesisOutputFormat.Audio16Khz128KBitRateMonoMp3]="audio-16khz-128kbitrate-mono-mp3",o[s.SpeechSynthesisOutputFormat.Audio16Khz64KBitRateMonoMp3]="audio-16khz-64kbitrate-mono-mp3",o[s.SpeechSynthesisOutputFormat.Audio24Khz48KBitRateMonoMp3]="audio-24khz-48kbitrate-mono-mp3",o[s.SpeechSynthesisOutputFormat.Audio24Khz96KBitRateMonoMp3]="audio-24khz-96kbitrate-mono-mp3",o[s.SpeechSynthesisOutputFormat.Audio24Khz160KBitRateMonoMp3]="audio-24khz-160kbitrate-mono-mp3",o[s.SpeechSynthesisOutputFormat.Raw16Khz16BitMonoTrueSilk]="raw-16khz-16bit-mono-truesilk",o[s.SpeechSynthesisOutputFormat.Riff16Khz16BitMonoPcm]="riff-16khz-16bit-mono-pcm",o[s.SpeechSynthesisOutputFormat.Riff8Khz16BitMonoPcm]="riff-8khz-16bit-mono-pcm",o[s.SpeechSynthesisOutputFormat.Riff24Khz16BitMonoPcm]="riff-24khz-16bit-mono-pcm",o[s.SpeechSynthesisOutputFormat.Riff8Khz8BitMonoMULaw]="riff-8khz-8bit-mono-mulaw",o[s.SpeechSynthesisOutputFormat.Raw16Khz16BitMonoPcm]="raw-16khz-16bit-mono-pcm",o[s.SpeechSynthesisOutputFormat.Raw24Khz16BitMonoPcm]="raw-24khz-16bit-mono-pcm",o[s.SpeechSynthesisOutputFormat.Raw8Khz16BitMonoPcm]="raw-8khz-16bit-mono-pcm",o[s.SpeechSynthesisOutputFormat.Ogg16Khz16BitMonoOpus]="ogg-16khz-16bit-mono-opus",o[s.SpeechSynthesisOutputFormat.Ogg24Khz16BitMonoOpus]="ogg-24khz-16bit-mono-opus",o[s.SpeechSynthesisOutputFormat.Raw48Khz16BitMonoPcm]="raw-48khz-16bit-mono-pcm",o[s.SpeechSynthesisOutputFormat.Riff48Khz16BitMonoPcm]="riff-48khz-16bit-mono-pcm",o[s.SpeechSynthesisOutputFormat.Audio48Khz96KBitRateMonoMp3]="audio-48khz-96kbitrate-mono-mp3",o[s.SpeechSynthesisOutputFormat.Audio48Khz192KBitRateMonoMp3]="audio-48khz-192kbitrate-mono-mp3",o[s.SpeechSynthesisOutputFormat.Ogg48Khz16BitMonoOpus]="ogg-48khz-16bit-mono-opus",o[s.SpeechSynthesisOutputFormat.Webm16Khz16BitMonoOpus]="webm-16khz-16bit-mono-opus",o[s.SpeechSynthesisOutputFormat.Webm24Khz16BitMonoOpus]="webm-24khz-16bit-mono-opus",o[s.SpeechSynthesisOutputFormat.Raw24Khz16BitMonoTrueSilk]="raw-24khz-16bit-mono-truesilk",o[s.SpeechSynthesisOutputFormat.Raw8Khz8BitMonoALaw]="raw-8khz-8bit-mono-alaw",o[s.SpeechSynthesisOutputFormat.Riff8Khz8BitMonoALaw]="riff-8khz-8bit-mono-alaw",o),t}(a.AudioStreamFormatImpl);t.AudioOutputFormatImpl=c},5149:function(e,t,r){"use strict";var n,o=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},n(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),i=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function s(e){try{c(n.next(e))}catch(e){i(e)}}function a(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))},s=this&&this.__generator||function(e,t){var r,n,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,n=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.PushAudioOutputStreamImpl=t.PushAudioOutputStream=t.PullAudioOutputStreamImpl=t.PullAudioOutputStream=t.AudioOutputStream=void 0;var a=r(2370),c=r(7348),u=r(5019),p=function(){function e(){}return e.createPullStream=function(){return l.create()},e}();t.AudioOutputStream=p;var l=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o(t,e),t.create=function(){return new f},t}(p);t.PullAudioOutputStream=l;var f=function(e){function t(){var t=e.call(this)||this;return t.privId=a.createNoDashGuid(),t.privStream=new a.Stream,t}return o(t,e),Object.defineProperty(t.prototype,"format",{get:function(){return this.privFormat},set:function(e){null==e&&(this.privFormat=u.AudioOutputFormatImpl.getDefaultOutputFormat()),this.privFormat=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isClosed",{get:function(){return this.privStream.isClosed},enumerable:!1,configurable:!0}),t.prototype.id=function(){return this.privId},t.prototype.read=function(e){return i(this,void 0,void 0,(function(){var t,r,n,o;return s(this,(function(i){switch(i.label){case 0:if(t=new Int8Array(e),r=0,void 0!==this.privLastChunkView){if(this.privLastChunkView.length>e.byteLength)return t.set(this.privLastChunkView.slice(0,e.byteLength)),this.privLastChunkView=this.privLastChunkView.slice(e.byteLength),[2,Promise.resolve(e.byteLength)];t.set(this.privLastChunkView),r=this.privLastChunkView.length,this.privLastChunkView=void 0}i.label=1;case 1:return r<e.byteLength&&!this.privStream.isReadEnded?[4,this.privStream.read()]:[3,6];case 2:return void 0===(n=i.sent())||n.isEnd?[3,3]:(o=void 0,n.buffer.byteLength>e.byteLength-r?(o=n.buffer.slice(0,e.byteLength-r),this.privLastChunkView=new Int8Array(n.buffer.slice(e.byteLength-r))):o=n.buffer,t.set(new Int8Array(o),r),r+=o.byteLength,[3,5]);case 3:return[4,this.privStream.readEnded()];case 4:i.sent(),i.label=5;case 5:return[3,1];case 6:return[2,r]}}))}))},t.prototype.write=function(e){c.Contracts.throwIfNullOrUndefined(this.privStream,"must set format before writing"),this.privStream.writeStreamChunk({buffer:e,isEnd:!1,timeReceived:Date.now()})},t.prototype.close=function(){this.privStream.close()},t}(l);t.PullAudioOutputStreamImpl=f;var h=function(e){function t(){return e.call(this)||this}return o(t,e),t.create=function(e){return new v(e)},t}(p);t.PushAudioOutputStream=h;var v=function(e){function t(t){var r=e.call(this)||this;return r.privId=a.createNoDashGuid(),r.privCallback=t,r}return o(t,e),Object.defineProperty(t.prototype,"format",{set:function(e){},enumerable:!1,configurable:!0}),t.prototype.write=function(e){this.privCallback.write&&this.privCallback.write(e)},t.prototype.close=function(){this.privCallback.close&&this.privCallback.close()},t.prototype.id=function(){return this.privId},t}(h);t.PushAudioOutputStreamImpl=v},1891:function(e,t){"use strict";var r,n,o=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},r(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.AudioStreamFormatImpl=t.AudioStreamFormat=t.AudioFormatTag=void 0,function(e){e[e.PCM=1]="PCM",e[e.MuLaw=2]="MuLaw",e[e.Siren=3]="Siren",e[e.MP3=4]="MP3",e[e.SILKSkype=5]="SILKSkype",e[e.OGG_OPUS=6]="OGG_OPUS",e[e.WEBM_OPUS=7]="WEBM_OPUS",e[e.ALaw=8]="ALaw"}(n=t.AudioFormatTag||(t.AudioFormatTag={}));var i=function(){function e(){}return e.getDefaultInputFormat=function(){return s.getDefaultInputFormat()},e.getWaveFormatPCM=function(e,t,r){return new s(e,t,r)},e}();t.AudioStreamFormat=i;var s=function(e){function t(t,r,o,i){void 0===t&&(t=16e3),void 0===r&&(r=16),void 0===o&&(o=1),void 0===i&&(i=n.PCM);var s=e.call(this)||this;switch(s.setString=function(e,t,r){for(var n=0;n<r.length;n++)e.setUint8(t+n,r.charCodeAt(n))},i){case n.PCM:s.formatTag=1;break;case n.ALaw:s.formatTag=6;break;case n.MuLaw:s.formatTag=7}s.bitsPerSample=r,s.samplesPerSec=t,s.channels=o,s.avgBytesPerSec=s.samplesPerSec*s.channels*(s.bitsPerSample/8),s.blockAlign=s.channels*Math.max(s.bitsPerSample,8),s.privHeader=new ArrayBuffer(44);var a=new DataView(s.privHeader);return s.setString(a,0,"RIFF"),a.setUint32(4,0,!0),s.setString(a,8,"WAVEfmt "),a.setUint32(16,16,!0),a.setUint16(20,s.formatTag,!0),a.setUint16(22,s.channels,!0),a.setUint32(24,s.samplesPerSec,!0),a.setUint32(28,s.avgBytesPerSec,!0),a.setUint16(32,s.channels*(s.bitsPerSample/8),!0),a.setUint16(34,s.bitsPerSample,!0),s.setString(a,36,"data"),a.setUint32(40,0,!0),s}return o(t,e),t.getDefaultInputFormat=function(){return new t},t.getAudioContext=function(e){var t=window.AudioContext||window.webkitAudioContext||!1;if(t)return void 0!==e&&navigator.mediaDevices.getSupportedConstraints().sampleRate?new t({sampleRate:e}):new t;throw new Error("Browser does not support Web Audio API (AudioContext is not available).")},t.prototype.close=function(){},Object.defineProperty(t.prototype,"header",{get:function(){return this.privHeader},enumerable:!1,configurable:!0}),t}(i);t.AudioStreamFormatImpl=s},5546:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function s(e){try{c(n.next(e))}catch(e){i(e)}}function a(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var r,n,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,n=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.BaseAudioPlayer=void 0;var i=r(128),s=r(1189),a=r(9480),c=r(1891),u=function(){function e(e){this.audioContext=null,this.gainNode=null,this.autoUpdateBufferTimer=0,void 0===e&&(e=a.AudioStreamFormat.getDefaultInputFormat()),this.init(e)}return e.prototype.playAudioSample=function(e,t,r){s.marshalPromiseToCallbacks(n(this,void 0,void 0,(function(){var t,r;return o(this,(function(n){return this.ensureInitializedContext(),t=this.formatAudioData(e),(r=new Float32Array(this.samples.length+t.length)).set(this.samples,0),r.set(t,this.samples.length),this.samples=r,[2]}))})),t,r)},e.prototype.stopAudio=function(e,t){null!==this.audioContext&&(this.samples=new Float32Array,clearInterval(this.autoUpdateBufferTimer),this.audioContext.close().then((function(){e&&e()}),(function(e){t&&t(e)})),this.audioContext=null)},e.prototype.init=function(e){this.audioFormat=e,this.samples=new Float32Array},e.prototype.ensureInitializedContext=function(){var e=this;null===this.audioContext&&(this.createAudioContext(),this.autoUpdateBufferTimer=setInterval((function(){e.updateAudioBuffer()}),200))},e.prototype.createAudioContext=function(){this.audioContext=c.AudioStreamFormatImpl.getAudioContext(),this.gainNode=this.audioContext.createGain(),this.gainNode.gain.value=1,this.gainNode.connect(this.audioContext.destination),this.startTime=this.audioContext.currentTime},e.prototype.formatAudioData=function(e){switch(this.audioFormat.bitsPerSample){case 8:return this.formatArrayBuffer(new Int8Array(e),128);case 16:return this.formatArrayBuffer(new Int16Array(e),32768);case 32:return this.formatArrayBuffer(new Int32Array(e),2147483648);default:throw new i.InvalidOperationError("Only WAVE_FORMAT_PCM (8/16/32 bps) format supported at this time")}},e.prototype.formatArrayBuffer=function(e,t){for(var r=new Float32Array(e.length),n=0;n<e.length;n++)r[n]=e[n]/t;return r},e.prototype.updateAudioBuffer=function(){if(0!==this.samples.length){for(var e=this.audioFormat.channels,t=this.audioContext.createBufferSource(),r=this.samples.length/e,n=this.audioContext.createBuffer(e,r,this.audioFormat.samplesPerSec),o=0;o<e;o++)for(var i=o,s=n.getChannelData(o),a=0;a<this.samples.length;a++,i+=e)s[a]=this.samples[i];this.startTime<this.audioContext.currentTime&&(this.startTime=this.audioContext.currentTime),t.buffer=n,t.connect(this.gainNode),t.start(this.startTime),this.startTime+=n.duration,this.samples=new Float32Array}},e.prototype.playAudio=function(e){return n(this,void 0,void 0,(function(){var t,r;return o(this,(function(n){switch(n.label){case 0:return null===this.audioContext&&this.createAudioContext(),t=this.audioContext.createBufferSource(),r=this.audioContext.destination,[4,this.audioContext.decodeAudioData(e,(function(e){t.buffer=e,t.connect(r),t.start(0)}))];case 1:return n.sent(),[2]}}))}))},e}();t.BaseAudioPlayer=u},9921:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PullAudioInputStreamCallback=void 0;t.PullAudioInputStreamCallback=function(){}},3772:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PushAudioOutputStreamCallback=void 0;t.PushAudioOutputStreamCallback=function(){}},1559:function(e,t,r){"use strict";var n,o=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function s(e){try{c(n.next(e))}catch(e){i(e)}}function a(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var r,n,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,n=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.SpeakerAudioDestination=void 0;var s=r(21),a=r(2370),c=r(5149),u=r(1891),p=((n={})[u.AudioFormatTag.PCM]="audio/wav",n[u.AudioFormatTag.MuLaw]="audio/x-wav",n[u.AudioFormatTag.MP3]="audio/mpeg",n[u.AudioFormatTag.OGG_OPUS]="audio/ogg",n[u.AudioFormatTag.WEBM_OPUS]="audio/webm; codecs=opus",n[u.AudioFormatTag.ALaw]="audio/x-wav",n),l=function(){function e(e){this.privPlaybackStarted=!1,this.privAppendingToBuffer=!1,this.privMediaSourceOpened=!1,this.privBytesReceived=0,this.privId=e||a.createNoDashGuid(),this.privIsPaused=!1,this.privIsClosed=!1}return e.prototype.id=function(){return this.privId},e.prototype.write=function(e,t,r){void 0!==this.privAudioBuffer?(this.privAudioBuffer.push(e),this.updateSourceBuffer().then((function(){t&&t()}),(function(e){r&&r(e)}))):void 0!==this.privAudioOutputStream&&(this.privAudioOutputStream.write(e),this.privBytesReceived+=e.byteLength)},e.prototype.close=function(e,t){var r=this;if(this.privIsClosed=!0,void 0!==this.privSourceBuffer)this.handleSourceBufferUpdateEnd().then((function(){e&&e()}),(function(e){t&&t(e)}));else if(void 0!==this.privAudioOutputStream)if(this.privFormat.formatTag!==u.AudioFormatTag.PCM&&this.privFormat.formatTag!==u.AudioFormatTag.MuLaw&&this.privFormat.formatTag!==u.AudioFormatTag.ALaw||!1!==this.privFormat.hasHeader){var n=new ArrayBuffer(this.privBytesReceived);this.privAudioOutputStream.read(n).then((function(o){n=s.SynthesisAdapterBase.addHeader(n,r.privFormat);var i=new Blob([n],{type:p[r.privFormat.formatTag]});r.privAudio.src=window.URL.createObjectURL(i),r.notifyPlayback().then((function(){e&&e()}),(function(e){t&&t(e)}))}),(function(e){t&&t(e)}))}else console.warn("Play back is not supported for raw PCM, mulaw or alaw format without header."),this.onAudioEnd&&this.onAudioEnd(this);else this.onAudioEnd&&this.onAudioEnd(this)},Object.defineProperty(e.prototype,"format",{set:function(e){var t=this;if("undefined"!=typeof AudioContext||void 0!==window.webkitAudioContext){this.privFormat=e;var r=p[this.privFormat.formatTag];void 0===r?console.warn("Unknown mimeType for format "+u.AudioFormatTag[this.privFormat.formatTag]+"; playback is not supported."):"undefined"!=typeof MediaSource&&MediaSource.isTypeSupported(r)?(this.privAudio=new Audio,this.privAudioBuffer=[],this.privMediaSource=new MediaSource,this.privAudio.src=URL.createObjectURL(this.privMediaSource),this.privAudio.load(),this.privMediaSource.onsourceopen=function(e){t.privMediaSourceOpened=!0,t.privMediaSource.duration=1800,t.privSourceBuffer=t.privMediaSource.addSourceBuffer(r),t.privSourceBuffer.onupdate=function(e){t.updateSourceBuffer().catch((function(e){a.Events.instance.onEvent(new a.BackgroundEvent(e))}))},t.privSourceBuffer.onupdateend=function(e){t.handleSourceBufferUpdateEnd().catch((function(e){a.Events.instance.onEvent(new a.BackgroundEvent(e))}))},t.privSourceBuffer.onupdatestart=function(e){t.privAppendingToBuffer=!1}},this.updateSourceBuffer().catch((function(e){a.Events.instance.onEvent(new a.BackgroundEvent(e))}))):(console.warn("Format "+u.AudioFormatTag[this.privFormat.formatTag]+" could not be played by MSE, streaming playback is not enabled."),this.privAudioOutputStream=new c.PullAudioOutputStreamImpl,this.privAudioOutputStream.format=this.privFormat,this.privAudio=new Audio)}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isClosed",{get:function(){return this.privIsClosed},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"currentTime",{get:function(){return void 0!==this.privAudio?this.privAudio.currentTime:-1},enumerable:!1,configurable:!0}),e.prototype.pause=function(){this.privIsPaused||void 0===this.privAudio||(this.privAudio.pause(),this.privIsPaused=!0)},e.prototype.resume=function(e,t){this.privIsPaused&&void 0!==this.privAudio&&(this.privAudio.play().then((function(){e&&e()}),(function(e){t&&t(e)})),this.privIsPaused=!1)},Object.defineProperty(e.prototype,"internalAudio",{get:function(){return this.privAudio},enumerable:!1,configurable:!0}),e.prototype.updateSourceBuffer=function(){return o(this,void 0,void 0,(function(){var e;return i(this,(function(t){switch(t.label){case 0:if(!(void 0!==this.privAudioBuffer&&this.privAudioBuffer.length>0&&this.sourceBufferAvailable()))return[3,2];this.privAppendingToBuffer=!0,e=this.privAudioBuffer.shift();try{this.privSourceBuffer.appendBuffer(e)}catch(t){return this.privAudioBuffer.unshift(e),console.log("buffer filled, pausing addition of binaries until space is made"),[2]}return[4,this.notifyPlayback()];case 1:return t.sent(),[3,4];case 2:return this.canEndStream()?[4,this.handleSourceBufferUpdateEnd()]:[3,4];case 3:t.sent(),t.label=4;case 4:return[2]}}))}))},e.prototype.handleSourceBufferUpdateEnd=function(){return o(this,void 0,void 0,(function(){return i(this,(function(e){switch(e.label){case 0:return this.canEndStream()&&this.sourceBufferAvailable()?(this.privMediaSource.endOfStream(),[4,this.notifyPlayback()]):[3,2];case 1:e.sent(),e.label=2;case 2:return[2]}}))}))},e.prototype.notifyPlayback=function(){return o(this,void 0,void 0,(function(){var e=this;return i(this,(function(t){switch(t.label){case 0:return this.privPlaybackStarted||void 0===this.privAudio?[3,2]:(this.privPlaybackStarted=!0,this.onAudioStart&&this.onAudioStart(this),this.privAudio.onended=function(){e.onAudioEnd&&e.onAudioEnd(e)},this.privIsPaused?[3,2]:[4,this.privAudio.play()]);case 1:t.sent(),t.label=2;case 2:return[2]}}))}))},e.prototype.canEndStream=function(){return this.isClosed&&void 0!==this.privSourceBuffer&&0===this.privAudioBuffer.length&&this.privMediaSourceOpened&&!this.privAppendingToBuffer&&"open"===this.privMediaSource.readyState},e.prototype.sourceBufferAvailable=function(){return void 0!==this.privSourceBuffer&&!this.privSourceBuffer.updating},e}();t.SpeakerAudioDestination=l},6796:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AutoDetectSourceLanguageConfig=void 0;var n=r(21),o=r(7348),i=r(9480),s=function(){function e(){this.privProperties=new i.PropertyCollection}return e.fromOpenRange=function(){var t=new e;return t.properties.setProperty(i.PropertyId.SpeechServiceConnection_AutoDetectSourceLanguages,n.AutoDetectSourceLanguagesOpenRangeOptionName),t},e.fromLanguages=function(t){o.Contracts.throwIfArrayEmptyOrWhitespace(t,"languages");var r=new e;return r.properties.setProperty(i.PropertyId.SpeechServiceConnection_AutoDetectSourceLanguages,t.join()),r},e.fromSourceLanguageConfigs=function(t){if(t.length<1)throw new Error("Expected non-empty SourceLanguageConfig array.");var r=new e,n=[];return t.forEach((function(e){if(n.push(e.language),void 0!==e.endpointId&&""!==e.endpointId){var t=e.language+i.PropertyId.SpeechServiceConnection_EndpointId.toString();r.properties.setProperty(t,e.endpointId)}})),r.properties.setProperty(i.PropertyId.SpeechServiceConnection_AutoDetectSourceLanguages,n.join()),r},Object.defineProperty(e.prototype,"properties",{get:function(){return this.privProperties},enumerable:!1,configurable:!0}),e}();t.AutoDetectSourceLanguageConfig=s},9878:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AutoDetectSourceLanguageResult=void 0;var n=r(7348),o=function(){function e(e,t){n.Contracts.throwIfNullOrUndefined(e,"language"),n.Contracts.throwIfNullOrUndefined(t,"languageDetectionConfidence"),this.privLanguage=e,this.privLanguageDetectionConfidence=t}return e.fromResult=function(t){return new e(t.language,t.languageDetectionConfidence)},Object.defineProperty(e.prototype,"language",{get:function(){return this.privLanguage},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"languageDetectionConfidence",{get:function(){return this.privLanguageDetectionConfidence},enumerable:!1,configurable:!0}),e}();t.AutoDetectSourceLanguageResult=o},7212:function(e,t,r){"use strict";var n,o=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},n(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.BotFrameworkConfig=void 0;var i=r(7348),s=r(8646),a=r(9480),c=function(e){function t(){return e.call(this)||this}return o(t,e),t.fromSubscription=function(e,t,r){i.Contracts.throwIfNullOrWhitespace(e,"subscription"),i.Contracts.throwIfNullOrWhitespace(t,"region");var n=new s.DialogServiceConfigImpl;return n.setProperty(a.PropertyId.Conversation_DialogType,s.DialogServiceConfig.DialogTypes.BotFramework),n.setProperty(a.PropertyId.SpeechServiceConnection_Key,e),n.setProperty(a.PropertyId.SpeechServiceConnection_Region,t),r&&n.setProperty(a.PropertyId.Conversation_ApplicationId,r),n},t.fromAuthorizationToken=function(e,t,r){i.Contracts.throwIfNullOrWhitespace(e,"authorizationToken"),i.Contracts.throwIfNullOrWhitespace(t,"region");var n=new s.DialogServiceConfigImpl;return n.setProperty(a.PropertyId.Conversation_DialogType,s.DialogServiceConfig.DialogTypes.BotFramework),n.setProperty(a.PropertyId.SpeechServiceAuthorization_Token,e),n.setProperty(a.PropertyId.SpeechServiceConnection_Region,t),r&&n.setProperty(a.PropertyId.Conversation_ApplicationId,r),n},t.fromHost=function(e,t,r){i.Contracts.throwIfNullOrUndefined(e,"host");var n=e instanceof URL?e:new URL("wss://"+e+".convai.speech.azure.us");i.Contracts.throwIfNullOrUndefined(n,"resolvedHost");var o=new s.DialogServiceConfigImpl;return o.setProperty(a.PropertyId.Conversation_DialogType,s.DialogServiceConfig.DialogTypes.BotFramework),o.setProperty(a.PropertyId.SpeechServiceConnection_Host,n.toString()),void 0!==t&&o.setProperty(a.PropertyId.SpeechServiceConnection_Key,t),o},t.fromEndpoint=function(e,t){i.Contracts.throwIfNull(e,"endpoint");var r=new s.DialogServiceConfigImpl;return r.setProperty(a.PropertyId.Conversation_DialogType,s.DialogServiceConfig.DialogTypes.BotFramework),r.setProperty(a.PropertyId.SpeechServiceConnection_Endpoint,e.toString()),void 0!==t&&r.setProperty(a.PropertyId.SpeechServiceConnection_Key,t),r},t}(s.DialogServiceConfigImpl);t.BotFrameworkConfig=c},1255:function(e,t,r){"use strict";var n,o=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},n(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.CancellationDetails=void 0;var i=r(21),s=r(749),a=r(9480),c=function(e){function t(t,r,n){return e.call(this,t,r,n)||this}return o(t,e),t.fromResult=function(e){var r=a.CancellationReason.Error,n=a.CancellationErrorCode.NoError;if(e instanceof a.RecognitionResult&&e.json){var o=i.SimpleSpeechPhrase.fromJSON(e.json);r=i.EnumTranslation.implTranslateCancelResult(o.RecognitionStatus)}return e.properties&&(n=a.CancellationErrorCode[e.properties.getProperty(i.CancellationErrorCodePropertyName,a.CancellationErrorCode[a.CancellationErrorCode.NoError])]),new t(r,e.errorDetails,n)},t}(s.CancellationDetailsBase);t.CancellationDetails=c},749:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CancellationDetailsBase=void 0;var r=function(){function e(e,t,r){this.privReason=e,this.privErrorDetails=t,this.privErrorCode=r}return Object.defineProperty(e.prototype,"reason",{get:function(){return this.privReason},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"errorDetails",{get:function(){return this.privErrorDetails},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"ErrorCode",{get:function(){return this.privErrorCode},enumerable:!1,configurable:!0}),e}();t.CancellationDetailsBase=r},9970:function(e,t){"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.CancellationErrorCode=void 0,(r=t.CancellationErrorCode||(t.CancellationErrorCode={}))[r.NoError=0]="NoError",r[r.AuthenticationFailure=1]="AuthenticationFailure",r[r.BadRequestParameters=2]="BadRequestParameters",r[r.TooManyRequests=3]="TooManyRequests",r[r.ConnectionFailure=4]="ConnectionFailure",r[r.ServiceTimeout=5]="ServiceTimeout",r[r.ServiceError=6]="ServiceError",r[r.RuntimeError=7]="RuntimeError"},762:function(e,t,r){"use strict";var n,o=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},n(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.CancellationEventArgsBase=void 0;var i=function(e){function t(t,r,n,o,i){var s=e.call(this,o,i)||this;return s.privReason=t,s.privErrorDetails=r,s.privErrorCode=n,s}return o(t,e),Object.defineProperty(t.prototype,"reason",{get:function(){return this.privReason},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"errorCode",{get:function(){return this.privErrorCode},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"errorDetails",{get:function(){return this.privErrorDetails},enumerable:!1,configurable:!0}),t}(r(9480).RecognitionEventArgs);t.CancellationEventArgsBase=i},1040:function(e,t){"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.CancellationReason=void 0,(r=t.CancellationReason||(t.CancellationReason={}))[r.Error=0]="Error",r[r.EndOfStream=1]="EndOfStream"},9203:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Connection=void 0;var n=r(21),o=r(2370),i=r(5150),s=r(7348),a=r(9480),c=function(){function e(){}return e.fromRecognizer=function(t){var r=t.internalData,n=new e;return n.privInternalData=r,n.setupEvents(),n},e.fromSynthesizer=function(t){var r=t.internalData,n=new e;return n.privInternalData=r,n.setupEvents(),n},e.prototype.openConnection=function(e,t){o.marshalPromiseToCallbacks(this.privInternalData.connect(),e,t)},e.prototype.closeConnection=function(e,t){if(this.privInternalData instanceof n.SynthesisAdapterBase)throw new Error("Disconnecting a synthesizer's connection is currently not supported");o.marshalPromiseToCallbacks(this.privInternalData.disconnect(),e,t)},e.prototype.setMessageProperty=function(e,t,r){if(s.Contracts.throwIfNullOrWhitespace(t,"propertyName"),this.privInternalData instanceof n.ServiceRecognizerBase){if("speech.context"!==e.toLowerCase())throw new Error("Only speech.context message property sets are currently supported for recognizer");this.privInternalData.speechContext.setSection(t,r)}else if(this.privInternalData instanceof n.SynthesisAdapterBase){if("synthesis.context"!==e.toLowerCase())throw new Error("Only synthesis.context message property sets are currently supported for synthesizer");this.privInternalData.synthesisContext.setSection(t,r)}},e.prototype.sendMessageAsync=function(e,t,r,n){o.marshalPromiseToCallbacks(this.privInternalData.sendNetworkMessage(e,t),r,n)},e.prototype.close=function(){},e.prototype.setupEvents=function(){var e=this;this.privEventListener=this.privInternalData.connectionEvents.attach((function(t){"ConnectionEstablishedEvent"===t.name?e.connected&&e.connected(new a.ConnectionEventArgs(t.connectionId)):"ConnectionClosedEvent"===t.name?e.disconnected&&e.disconnected(new a.ConnectionEventArgs(t.connectionId)):"ConnectionMessageSentEvent"===t.name?e.messageSent&&e.messageSent(new a.ConnectionMessageEventArgs(new i.ConnectionMessageImpl(t.message))):"ConnectionMessageReceivedEvent"===t.name&&e.messageReceived&&e.messageReceived(new a.ConnectionMessageEventArgs(new i.ConnectionMessageImpl(t.message)))})),this.privServiceEventListener=this.privInternalData.serviceEvents.attach((function(t){e.receivedServiceMessage&&e.receivedServiceMessage(new a.ServiceEventArgs(t.jsonString,t.name))}))},e}();t.Connection=c},4401:function(e,t,r){"use strict";var n,o=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},n(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.ConnectionEventArgs=void 0;var i=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o(t,e),t}(r(9480).SessionEventArgs);t.ConnectionEventArgs=i},5150:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ConnectionMessageImpl=t.ConnectionMessage=void 0;var n=r(1562),o=r(2370),i=r(9551),s=r(6776);t.ConnectionMessage=function(){};var a=function(){function e(e){var t=this;this.privConnectionMessage=e,this.privProperties=new i.PropertyCollection,this.privConnectionMessage.headers[n.HeaderNames.ConnectionId]&&this.privProperties.setProperty(s.PropertyId.Speech_SessionId,this.privConnectionMessage.headers[n.HeaderNames.ConnectionId]),Object.keys(this.privConnectionMessage.headers).forEach((function(e,r,n){t.privProperties.setProperty(e,t.privConnectionMessage.headers[e])}))}return Object.defineProperty(e.prototype,"path",{get:function(){return this.privConnectionMessage.headers[Object.keys(this.privConnectionMessage.headers).find((function(e){return e.toLowerCase()==="path".toLowerCase()}))]},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isTextMessage",{get:function(){return this.privConnectionMessage.messageType===o.MessageType.Text},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isBinaryMessage",{get:function(){return this.privConnectionMessage.messageType===o.MessageType.Binary},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"TextMessage",{get:function(){return this.privConnectionMessage.textBody},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"binaryMessage",{get:function(){return this.privConnectionMessage.binaryBody},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"properties",{get:function(){return this.privProperties},enumerable:!1,configurable:!0}),e.prototype.toString=function(){return""},e}();t.ConnectionMessageImpl=a},7142:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ConnectionMessageEventArgs=void 0;var r=function(){function e(e){this.privConnectionMessage=e}return Object.defineProperty(e.prototype,"message",{get:function(){return this.privConnectionMessage},enumerable:!1,configurable:!0}),e.prototype.toString=function(){return"Message: "+this.privConnectionMessage.toString()},e}();t.ConnectionMessageEventArgs=r},7348:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Contracts=void 0;var r=function(){function e(){}return e.throwIfNullOrUndefined=function(e,t){if(null==e)throw new Error("throwIfNullOrUndefined:"+t)},e.throwIfNull=function(e,t){if(null===e)throw new Error("throwIfNull:"+t)},e.throwIfNullOrWhitespace=function(t,r){if(e.throwIfNullOrUndefined(t,r),(""+t).trim().length<1)throw new Error("throwIfNullOrWhitespace:"+r)},e.throwIfDisposed=function(e){if(e)throw new Error("the object is already disposed")},e.throwIfArrayEmptyOrWhitespace=function(t,r){if(e.throwIfNullOrUndefined(t,r),0===t.length)throw new Error("throwIfArrayEmptyOrWhitespace:"+r);for(var n=0,o=t;n<o.length;n++){var i=o[n];e.throwIfNullOrWhitespace(i,r)}},e.throwIfFileDoesNotExist=function(t,r){e.throwIfNullOrWhitespace(t,r)},e.throwIfNotUndefined=function(e,t){if(void 0!==e)throw new Error("throwIfNotUndefined:"+t)},e}();t.Contracts=r},4030:function(e,t,r){"use strict";var n,o=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},n(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.ConversationTranscriptionCanceledEventArgs=void 0;var i=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o(t,e),t}(r(762).CancellationEventArgsBase);t.ConversationTranscriptionCanceledEventArgs=i},3714:function(e,t,r){"use strict";var n,o=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},n(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.CustomCommandsConfig=void 0;var i=r(7348),s=r(8646),a=r(9480),c=function(e){function t(){return e.call(this)||this}return o(t,e),t.fromSubscription=function(e,t,r){i.Contracts.throwIfNullOrWhitespace(e,"applicationId"),i.Contracts.throwIfNullOrWhitespace(t,"subscription"),i.Contracts.throwIfNullOrWhitespace(r,"region");var n=new s.DialogServiceConfigImpl;return n.setProperty(a.PropertyId.Conversation_DialogType,s.DialogServiceConfig.DialogTypes.CustomCommands),n.setProperty(a.PropertyId.Conversation_ApplicationId,e),n.setProperty(a.PropertyId.SpeechServiceConnection_Key,t),n.setProperty(a.PropertyId.SpeechServiceConnection_Region,r),n},t.fromAuthorizationToken=function(e,t,r){i.Contracts.throwIfNullOrWhitespace(e,"applicationId"),i.Contracts.throwIfNullOrWhitespace(t,"authorizationToken"),i.Contracts.throwIfNullOrWhitespace(r,"region");var n=new s.DialogServiceConfigImpl;return n.setProperty(a.PropertyId.Conversation_DialogType,s.DialogServiceConfig.DialogTypes.CustomCommands),n.setProperty(a.PropertyId.Conversation_ApplicationId,e),n.setProperty(a.PropertyId.SpeechServiceAuthorization_Token,t),n.setProperty(a.PropertyId.SpeechServiceConnection_Region,r),n},Object.defineProperty(t.prototype,"applicationId",{get:function(){return this.getProperty(a.PropertyId.Conversation_ApplicationId)},set:function(e){i.Contracts.throwIfNullOrWhitespace(e,"value"),this.setProperty(a.PropertyId.Conversation_ApplicationId,e)},enumerable:!1,configurable:!0}),t}(s.DialogServiceConfigImpl);t.CustomCommandsConfig=c},8646:function(e,t,r){"use strict";var n,o=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},n(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.DialogServiceConfigImpl=t.DialogServiceConfig=void 0;var i=r(7348),s=r(9480),a=function(){function e(){}var t;return Object.defineProperty(e.prototype,"applicationId",{set:function(e){},enumerable:!1,configurable:!0}),e.DialogTypes=((t=function(){}).BotFramework="bot_framework",t.CustomCommands="custom_commands",t),e}();t.DialogServiceConfig=a;var c=function(e){function t(){var t=e.call(this)||this;return t.privSpeechConfig=new s.SpeechConfigImpl,t}return o(t,e),Object.defineProperty(t.prototype,"properties",{get:function(){return this.privSpeechConfig.properties},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"speechRecognitionLanguage",{get:function(){return this.privSpeechConfig.speechRecognitionLanguage},set:function(e){i.Contracts.throwIfNullOrWhitespace(e,"value"),this.privSpeechConfig.speechRecognitionLanguage=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"outputFormat",{get:function(){return this.privSpeechConfig.outputFormat},set:function(e){this.privSpeechConfig.outputFormat=e},enumerable:!1,configurable:!0}),t.prototype.setProperty=function(e,t){this.privSpeechConfig.setProperty(e,t)},t.prototype.getProperty=function(e,t){return this.privSpeechConfig.getProperty(e)},t.prototype.setProxy=function(e,t,r,n){this.setProperty(s.PropertyId.SpeechServiceConnection_ProxyHostName,e),this.setProperty(s.PropertyId.SpeechServiceConnection_ProxyPort,""+t),r&&this.setProperty(s.PropertyId.SpeechServiceConnection_ProxyUserName,r),n&&this.setProperty(s.PropertyId.SpeechServiceConnection_ProxyPassword,n)},t.prototype.setServiceProperty=function(e,t,r){this.privSpeechConfig.setServiceProperty(e,t,r)},t.prototype.close=function(){},t}(a);t.DialogServiceConfigImpl=c},3580:function(e,t,r){"use strict";var n,o=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},n(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),i=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function s(e){try{c(n.next(e))}catch(e){i(e)}}function a(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))},s=this&&this.__generator||function(e,t){var r,n,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,n=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.DialogServiceConnector=void 0;var a=r(7589),c=r(21),u=r(2370),p=r(7348),l=r(9480),f=r(6776),h=function(e){function t(t,r){var n=this,o=t;p.Contracts.throwIfNull(t,"dialogConfig"),(n=e.call(this,r,o.properties,new a.DialogConnectionFactory)||this).isTurnComplete=!0,n.privIsDisposed=!1,n.privProperties=o.properties.clone();var i=n.buildAgentConfig();return n.privReco.agentConfig.set(i),n}return o(t,e),t.prototype.connect=function(e,t){u.marshalPromiseToCallbacks(this.privReco.connect(),e,t)},t.prototype.disconnect=function(e,t){u.marshalPromiseToCallbacks(this.privReco.disconnect(),e,t)},Object.defineProperty(t.prototype,"authorizationToken",{get:function(){return this.properties.getProperty(f.PropertyId.SpeechServiceAuthorization_Token)},set:function(e){p.Contracts.throwIfNullOrWhitespace(e,"token"),this.properties.setProperty(f.PropertyId.SpeechServiceAuthorization_Token,e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"properties",{get:function(){return this.privProperties},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"speechActivityTemplate",{get:function(){return this.properties.getProperty(f.PropertyId.Conversation_Speech_Activity_Template)},set:function(e){this.properties.setProperty(f.PropertyId.Conversation_Speech_Activity_Template,e)},enumerable:!1,configurable:!0}),t.prototype.listenOnceAsync=function(e,t){var r=this;if(this.isTurnComplete){p.Contracts.throwIfDisposed(this.privIsDisposed);var n=i(r,void 0,void 0,(function(){var e,t;return s(this,(function(r){switch(r.label){case 0:return[4,this.privReco.connect()];case 1:return r.sent(),[4,this.implRecognizerStop()];case 2:return r.sent(),this.isTurnComplete=!1,e=new u.Deferred,[4,this.privReco.recognize(c.RecognitionMode.Conversation,e.resolve,e.reject)];case 3:return r.sent(),[4,e.promise];case 4:return t=r.sent(),[4,this.implRecognizerStop()];case 5:return r.sent(),[2,t]}}))}));n.catch((function(){r.dispose(!0).catch((function(){}))})),u.marshalPromiseToCallbacks(n.finally((function(){r.isTurnComplete=!0})),e,t)}},t.prototype.sendActivityAsync=function(e,t,r){u.marshalPromiseToCallbacks(this.privReco.sendMessage(e),t,r)},t.prototype.close=function(e,t){p.Contracts.throwIfDisposed(this.privIsDisposed),u.marshalPromiseToCallbacks(this.dispose(!0),e,t)},t.prototype.dispose=function(t){return i(this,void 0,void 0,(function(){return s(this,(function(r){switch(r.label){case 0:return this.privIsDisposed?[2]:t?(this.privIsDisposed=!0,[4,this.implRecognizerStop()]):[3,3];case 1:return r.sent(),[4,e.prototype.dispose.call(this,t)];case 2:r.sent(),r.label=3;case 3:return[2]}}))}))},t.prototype.createRecognizerConfig=function(e){return new c.RecognizerConfig(e,this.privProperties)},t.prototype.createServiceRecognizer=function(e,t,r,n){var o=r;return new c.DialogServiceAdapter(e,t,o,n,this)},t.prototype.buildAgentConfig=function(){return{botInfo:{commType:this.properties.getProperty("Conversation_Communication_Type","Default"),commandsCulture:void 0,connectionId:this.properties.getProperty(f.PropertyId.Conversation_Agent_Connection_Id),conversationId:this.properties.getProperty(f.PropertyId.Conversation_Conversation_Id,void 0),fromId:this.properties.getProperty(f.PropertyId.Conversation_From_Id,void 0),ttsAudioFormat:this.properties.getProperty(f.PropertyId.SpeechServiceConnection_SynthOutputFormat,void 0)},version:.2}},t}(l.Recognizer);t.DialogServiceConnector=h},9480:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(5897);Object.defineProperty(t,"AudioConfig",{enumerable:!0,get:function(){return n.AudioConfig}});var o=r(1891);Object.defineProperty(t,"AudioStreamFormat",{enumerable:!0,get:function(){return o.AudioStreamFormat}});var i=r(7908);Object.defineProperty(t,"AudioInputStream",{enumerable:!0,get:function(){return i.AudioInputStream}}),Object.defineProperty(t,"PullAudioInputStream",{enumerable:!0,get:function(){return i.PullAudioInputStream}}),Object.defineProperty(t,"PushAudioInputStream",{enumerable:!0,get:function(){return i.PushAudioInputStream}});var s=r(5149);Object.defineProperty(t,"AudioOutputStream",{enumerable:!0,get:function(){return s.AudioOutputStream}}),Object.defineProperty(t,"PullAudioOutputStream",{enumerable:!0,get:function(){return s.PullAudioOutputStream}}),Object.defineProperty(t,"PushAudioOutputStream",{enumerable:!0,get:function(){return s.PushAudioOutputStream}});var a=r(1040);Object.defineProperty(t,"CancellationReason",{enumerable:!0,get:function(){return a.CancellationReason}});var c=r(9921);Object.defineProperty(t,"PullAudioInputStreamCallback",{enumerable:!0,get:function(){return c.PullAudioInputStreamCallback}});var u=r(3772);Object.defineProperty(t,"PushAudioOutputStreamCallback",{enumerable:!0,get:function(){return u.PushAudioOutputStreamCallback}});var p=r(1748);Object.defineProperty(t,"KeywordRecognitionModel",{enumerable:!0,get:function(){return p.KeywordRecognitionModel}});var l=r(2710);Object.defineProperty(t,"SessionEventArgs",{enumerable:!0,get:function(){return l.SessionEventArgs}});var f=r(3885);Object.defineProperty(t,"RecognitionEventArgs",{enumerable:!0,get:function(){return f.RecognitionEventArgs}});var h=r(3040);Object.defineProperty(t,"OutputFormat",{enumerable:!0,get:function(){return h.OutputFormat}});var v=r(5790);Object.defineProperty(t,"IntentRecognitionEventArgs",{enumerable:!0,get:function(){return v.IntentRecognitionEventArgs}});var d=r(6205);Object.defineProperty(t,"RecognitionResult",{enumerable:!0,get:function(){return d.RecognitionResult}});var y=r(5700);Object.defineProperty(t,"SpeechRecognitionResult",{enumerable:!0,get:function(){return y.SpeechRecognitionResult}});var g=r(3599);Object.defineProperty(t,"IntentRecognitionResult",{enumerable:!0,get:function(){return g.IntentRecognitionResult}});var m=r(3503);Object.defineProperty(t,"LanguageUnderstandingModel",{enumerable:!0,get:function(){return m.LanguageUnderstandingModel}});var b=r(3624);Object.defineProperty(t,"SpeechRecognitionEventArgs",{enumerable:!0,get:function(){return b.SpeechRecognitionEventArgs}}),Object.defineProperty(t,"ConversationTranscriptionEventArgs",{enumerable:!0,get:function(){return b.ConversationTranscriptionEventArgs}});var S=r(4975);Object.defineProperty(t,"SpeechRecognitionCanceledEventArgs",{enumerable:!0,get:function(){return S.SpeechRecognitionCanceledEventArgs}});var P=r(7773);Object.defineProperty(t,"TranslationRecognitionEventArgs",{enumerable:!0,get:function(){return P.TranslationRecognitionEventArgs}});var C=r(634);Object.defineProperty(t,"TranslationSynthesisEventArgs",{enumerable:!0,get:function(){return C.TranslationSynthesisEventArgs}});var w=r(2765);Object.defineProperty(t,"TranslationRecognitionResult",{enumerable:!0,get:function(){return w.TranslationRecognitionResult}});var O=r(2834);Object.defineProperty(t,"TranslationSynthesisResult",{enumerable:!0,get:function(){return O.TranslationSynthesisResult}});var R=r(5640);Object.defineProperty(t,"ResultReason",{enumerable:!0,get:function(){return R.ResultReason}});var I=r(3875);Object.defineProperty(t,"SpeechConfig",{enumerable:!0,get:function(){return I.SpeechConfig}}),Object.defineProperty(t,"SpeechConfigImpl",{enumerable:!0,get:function(){return I.SpeechConfigImpl}});var E=r(6244);Object.defineProperty(t,"SpeechTranslationConfig",{enumerable:!0,get:function(){return E.SpeechTranslationConfig}}),Object.defineProperty(t,"SpeechTranslationConfigImpl",{enumerable:!0,get:function(){return E.SpeechTranslationConfigImpl}});var _=r(9551);Object.defineProperty(t,"PropertyCollection",{enumerable:!0,get:function(){return _.PropertyCollection}});var A=r(6776);Object.defineProperty(t,"PropertyId",{enumerable:!0,get:function(){return A.PropertyId}});var T=r(1676);Object.defineProperty(t,"Recognizer",{enumerable:!0,get:function(){return T.Recognizer}});var j=r(263);Object.defineProperty(t,"SpeechRecognizer",{enumerable:!0,get:function(){return j.SpeechRecognizer}});var x=r(9049);Object.defineProperty(t,"IntentRecognizer",{enumerable:!0,get:function(){return x.IntentRecognizer}});var k=r(3764);Object.defineProperty(t,"VoiceProfileType",{enumerable:!0,get:function(){return k.VoiceProfileType}});var M=r(7063);Object.defineProperty(t,"TranslationRecognizer",{enumerable:!0,get:function(){return M.TranslationRecognizer}});var D=r(7810);Object.defineProperty(t,"Translations",{enumerable:!0,get:function(){return D.Translations}});var N=r(1614);Object.defineProperty(t,"NoMatchReason",{enumerable:!0,get:function(){return N.NoMatchReason}});var z=r(1744);Object.defineProperty(t,"NoMatchDetails",{enumerable:!0,get:function(){return z.NoMatchDetails}});var L=r(8450);Object.defineProperty(t,"TranslationRecognitionCanceledEventArgs",{enumerable:!0,get:function(){return L.TranslationRecognitionCanceledEventArgs}});var F=r(620);Object.defineProperty(t,"IntentRecognitionCanceledEventArgs",{enumerable:!0,get:function(){return F.IntentRecognitionCanceledEventArgs}});var B=r(749);Object.defineProperty(t,"CancellationDetailsBase",{enumerable:!0,get:function(){return B.CancellationDetailsBase}});var V=r(1255);Object.defineProperty(t,"CancellationDetails",{enumerable:!0,get:function(){return V.CancellationDetails}});var U=r(9970);Object.defineProperty(t,"CancellationErrorCode",{enumerable:!0,get:function(){return U.CancellationErrorCode}});var q=r(4401);Object.defineProperty(t,"ConnectionEventArgs",{enumerable:!0,get:function(){return q.ConnectionEventArgs}});var H=r(3395);Object.defineProperty(t,"ServiceEventArgs",{enumerable:!0,get:function(){return H.ServiceEventArgs}});var W=r(9203);Object.defineProperty(t,"Connection",{enumerable:!0,get:function(){return W.Connection}});var K=r(5707);Object.defineProperty(t,"PhraseListGrammar",{enumerable:!0,get:function(){return K.PhraseListGrammar}});var G=r(8646);Object.defineProperty(t,"DialogServiceConfig",{enumerable:!0,get:function(){return G.DialogServiceConfig}});var J=r(7212);Object.defineProperty(t,"BotFrameworkConfig",{enumerable:!0,get:function(){return J.BotFrameworkConfig}});var Q=r(3714);Object.defineProperty(t,"CustomCommandsConfig",{enumerable:!0,get:function(){return Q.CustomCommandsConfig}});var X=r(3580);Object.defineProperty(t,"DialogServiceConnector",{enumerable:!0,get:function(){return X.DialogServiceConnector}});var Y=r(3349);Object.defineProperty(t,"ActivityReceivedEventArgs",{enumerable:!0,get:function(){return Y.ActivityReceivedEventArgs}});var Z=r(3234);Object.defineProperty(t,"TurnStatusReceivedEventArgs",{enumerable:!0,get:function(){return Z.TurnStatusReceivedEventArgs}});var $=r(8777);Object.defineProperty(t,"ServicePropertyChannel",{enumerable:!0,get:function(){return $.ServicePropertyChannel}});var ee=r(5732);Object.defineProperty(t,"ProfanityOption",{enumerable:!0,get:function(){return ee.ProfanityOption}});var te=r(5546);Object.defineProperty(t,"BaseAudioPlayer",{enumerable:!0,get:function(){return te.BaseAudioPlayer}});var re=r(7142);Object.defineProperty(t,"ConnectionMessageEventArgs",{enumerable:!0,get:function(){return re.ConnectionMessageEventArgs}});var ne=r(5150);Object.defineProperty(t,"ConnectionMessage",{enumerable:!0,get:function(){return ne.ConnectionMessage}});var oe=r(9714);Object.defineProperty(t,"VoiceProfile",{enumerable:!0,get:function(){return oe.VoiceProfile}});var ie=r(1975);Object.defineProperty(t,"VoiceProfileEnrollmentResult",{enumerable:!0,get:function(){return ie.VoiceProfileEnrollmentResult}}),Object.defineProperty(t,"VoiceProfileEnrollmentCancellationDetails",{enumerable:!0,get:function(){return ie.VoiceProfileEnrollmentCancellationDetails}});var se=r(5780);Object.defineProperty(t,"VoiceProfileResult",{enumerable:!0,get:function(){return se.VoiceProfileResult}}),Object.defineProperty(t,"VoiceProfileCancellationDetails",{enumerable:!0,get:function(){return se.VoiceProfileCancellationDetails}});var ae=r(1875);Object.defineProperty(t,"VoiceProfileAuthorizationPhraseResult",{enumerable:!0,get:function(){return ae.VoiceProfileAuthorizationPhraseResult}});var ce=r(2179);Object.defineProperty(t,"VoiceProfileClient",{enumerable:!0,get:function(){return ce.VoiceProfileClient}});var ue=r(7271);Object.defineProperty(t,"SpeakerRecognizer",{enumerable:!0,get:function(){return ue.SpeakerRecognizer}});var pe=r(1387);Object.defineProperty(t,"SpeakerIdentificationModel",{enumerable:!0,get:function(){return pe.SpeakerIdentificationModel}});var le=r(1486);Object.defineProperty(t,"SpeakerVerificationModel",{enumerable:!0,get:function(){return le.SpeakerVerificationModel}});var fe=r(6796);Object.defineProperty(t,"AutoDetectSourceLanguageConfig",{enumerable:!0,get:function(){return fe.AutoDetectSourceLanguageConfig}});var he=r(9878);Object.defineProperty(t,"AutoDetectSourceLanguageResult",{enumerable:!0,get:function(){return he.AutoDetectSourceLanguageResult}});var ve=r(3839);Object.defineProperty(t,"SourceLanguageConfig",{enumerable:!0,get:function(){return ve.SourceLanguageConfig}});var de=r(3895);Object.defineProperty(t,"SpeakerRecognitionResult",{enumerable:!0,get:function(){return de.SpeakerRecognitionResult}}),Object.defineProperty(t,"SpeakerRecognitionResultType",{enumerable:!0,get:function(){return de.SpeakerRecognitionResultType}}),Object.defineProperty(t,"SpeakerRecognitionCancellationDetails",{enumerable:!0,get:function(){return de.SpeakerRecognitionCancellationDetails}});var ye=r(4477);Object.defineProperty(t,"Conversation",{enumerable:!0,get:function(){return ye.Conversation}}),Object.defineProperty(t,"ConversationExpirationEventArgs",{enumerable:!0,get:function(){return ye.ConversationExpirationEventArgs}}),Object.defineProperty(t,"ConversationParticipantsChangedEventArgs",{enumerable:!0,get:function(){return ye.ConversationParticipantsChangedEventArgs}}),Object.defineProperty(t,"ConversationTranslationCanceledEventArgs",{enumerable:!0,get:function(){return ye.ConversationTranslationCanceledEventArgs}}),Object.defineProperty(t,"ConversationTranslationEventArgs",{enumerable:!0,get:function(){return ye.ConversationTranslationEventArgs}}),Object.defineProperty(t,"ConversationTranslationResult",{enumerable:!0,get:function(){return ye.ConversationTranslationResult}}),Object.defineProperty(t,"ConversationTranslator",{enumerable:!0,get:function(){return ye.ConversationTranslator}}),Object.defineProperty(t,"ConversationTranscriber",{enumerable:!0,get:function(){return ye.ConversationTranscriber}}),Object.defineProperty(t,"Participant",{enumerable:!0,get:function(){return ye.Participant}}),Object.defineProperty(t,"ParticipantChangedReason",{enumerable:!0,get:function(){return ye.ParticipantChangedReason}}),Object.defineProperty(t,"User",{enumerable:!0,get:function(){return ye.User}});var ge=r(4643);Object.defineProperty(t,"SpeechSynthesisOutputFormat",{enumerable:!0,get:function(){return ge.SpeechSynthesisOutputFormat}});var me=r(697);Object.defineProperty(t,"SpeechSynthesizer",{enumerable:!0,get:function(){return me.SpeechSynthesizer}});var be=r(8641);Object.defineProperty(t,"SpeechSynthesisResult",{enumerable:!0,get:function(){return be.SpeechSynthesisResult}});var Se=r(6161);Object.defineProperty(t,"SpeechSynthesisEventArgs",{enumerable:!0,get:function(){return Se.SpeechSynthesisEventArgs}});var Pe=r(3045);Object.defineProperty(t,"SpeechSynthesisWordBoundaryEventArgs",{enumerable:!0,get:function(){return Pe.SpeechSynthesisWordBoundaryEventArgs}});var Ce=r(2567);Object.defineProperty(t,"SpeechSynthesisBookmarkEventArgs",{enumerable:!0,get:function(){return Ce.SpeechSynthesisBookmarkEventArgs}});var we=r(9010);Object.defineProperty(t,"SpeechSynthesisVisemeEventArgs",{enumerable:!0,get:function(){return we.SpeechSynthesisVisemeEventArgs}});var Oe=r(1559);Object.defineProperty(t,"SpeakerAudioDestination",{enumerable:!0,get:function(){return Oe.SpeakerAudioDestination}});var Re=r(4030);Object.defineProperty(t,"ConversationTranscriptionCanceledEventArgs",{enumerable:!0,get:function(){return Re.ConversationTranscriptionCanceledEventArgs}});var Ie=r(2831);Object.defineProperty(t,"PronunciationAssessmentGradingSystem",{enumerable:!0,get:function(){return Ie.PronunciationAssessmentGradingSystem}});var Ee=r(8985);Object.defineProperty(t,"PronunciationAssessmentGranularity",{enumerable:!0,get:function(){return Ee.PronunciationAssessmentGranularity}});var _e=r(6145);Object.defineProperty(t,"PronunciationAssessmentConfig",{enumerable:!0,get:function(){return _e.PronunciationAssessmentConfig}});var Ae=r(2204);Object.defineProperty(t,"PronunciationAssessmentResult",{enumerable:!0,get:function(){return Ae.PronunciationAssessmentResult}})},620:function(e,t,r){"use strict";var n,o=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},n(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.IntentRecognitionCanceledEventArgs=void 0;var i=function(e){function t(t,r,n,o,i,s){var a=e.call(this,o,i,s)||this;return a.privReason=t,a.privErrorDetails=r,a.privErrorCode=n,a}return o(t,e),Object.defineProperty(t.prototype,"reason",{get:function(){return this.privReason},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"errorCode",{get:function(){return this.privErrorCode},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"errorDetails",{get:function(){return this.privErrorDetails},enumerable:!1,configurable:!0}),t}(r(9480).IntentRecognitionEventArgs);t.IntentRecognitionCanceledEventArgs=i},5790:function(e,t,r){"use strict";var n,o=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},n(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.IntentRecognitionEventArgs=void 0;var i=function(e){function t(t,r,n){var o=e.call(this,r,n)||this;return o.privResult=t,o}return o(t,e),Object.defineProperty(t.prototype,"result",{get:function(){return this.privResult},enumerable:!1,configurable:!0}),t}(r(9480).RecognitionEventArgs);t.IntentRecognitionEventArgs=i},3599:function(e,t,r){"use strict";var n,o=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},n(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.IntentRecognitionResult=void 0;var i=function(e){function t(t,r,n,o,i,s,a,c,u,p,l){var f=e.call(this,r,n,o,i,s,a,c,void 0,u,p,l)||this;return f.privIntentId=t,f}return o(t,e),Object.defineProperty(t.prototype,"intentId",{get:function(){return this.privIntentId},enumerable:!1,configurable:!0}),t}(r(9480).SpeechRecognitionResult);t.IntentRecognitionResult=i},9049:function(e,t,r){"use strict";var n,o=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},n(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),i=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function s(e){try{c(n.next(e))}catch(e){i(e)}}function a(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))},s=this&&this.__generator||function(e,t){var r,n,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,n=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.IntentRecognizer=void 0;var a=r(21),c=r(2370),u=r(7348),p=r(9480),l=function(e){function t(t,r){var n=this;u.Contracts.throwIfNullOrUndefined(t,"speechConfig");var o=t;return u.Contracts.throwIfNullOrUndefined(o,"speechConfig"),(n=e.call(this,r,o.properties,new a.IntentConnectionFactory)||this).privAddedIntents=[],n.privAddedLmIntents={},n.privDisposedIntentRecognizer=!1,n.privProperties=o.properties,u.Contracts.throwIfNullOrWhitespace(n.properties.getProperty(p.PropertyId.SpeechServiceConnection_RecoLanguage),p.PropertyId[p.PropertyId.SpeechServiceConnection_RecoLanguage]),n}return o(t,e),Object.defineProperty(t.prototype,"speechRecognitionLanguage",{get:function(){return u.Contracts.throwIfDisposed(this.privDisposedIntentRecognizer),this.properties.getProperty(p.PropertyId.SpeechServiceConnection_RecoLanguage)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"authorizationToken",{get:function(){return this.properties.getProperty(p.PropertyId.SpeechServiceAuthorization_Token)},set:function(e){this.properties.setProperty(p.PropertyId.SpeechServiceAuthorization_Token,e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"properties",{get:function(){return this.privProperties},enumerable:!1,configurable:!0}),t.prototype.recognizeOnceAsync=function(e,t){if(u.Contracts.throwIfDisposed(this.privDisposedIntentRecognizer),0!==Object.keys(this.privAddedLmIntents).length||void 0!==this.privUmbrellaIntent){var r=this.buildSpeechContext();this.privReco.speechContext.setSection("intent",r.Intent),this.privReco.dynamicGrammar.addReferenceGrammar(r.ReferenceGrammars),this.privReco.setIntents(this.privAddedLmIntents,this.privUmbrellaIntent)}c.marshalPromiseToCallbacks(this.recognizeOnceAsyncImpl(a.RecognitionMode.Interactive),e,t)},t.prototype.startContinuousRecognitionAsync=function(e,t){if(0!==Object.keys(this.privAddedLmIntents).length||void 0!==this.privUmbrellaIntent){var r=this.buildSpeechContext();this.privReco.speechContext.setSection("intent",r.Intent),this.privReco.dynamicGrammar.addReferenceGrammar(r.ReferenceGrammars),this.privReco.setIntents(this.privAddedLmIntents,this.privUmbrellaIntent)}c.marshalPromiseToCallbacks(this.startContinuousRecognitionAsyncImpl(a.RecognitionMode.Conversation),e,t)},t.prototype.stopContinuousRecognitionAsync=function(e,t){c.marshalPromiseToCallbacks(this.stopContinuousRecognitionAsyncImpl(),e,t)},t.prototype.startKeywordRecognitionAsync=function(e,t,r){u.Contracts.throwIfNull(e,"model"),r&&r("Not yet implemented.")},t.prototype.stopKeywordRecognitionAsync=function(e,t){e&&e()},t.prototype.addIntent=function(e,t){u.Contracts.throwIfDisposed(this.privDisposedIntentRecognizer),u.Contracts.throwIfNullOrWhitespace(t,"intentId"),u.Contracts.throwIfNullOrWhitespace(e,"simplePhrase"),this.privAddedIntents.push([t,e])},t.prototype.addIntentWithLanguageModel=function(e,t,r){u.Contracts.throwIfDisposed(this.privDisposedIntentRecognizer),u.Contracts.throwIfNullOrWhitespace(e,"intentId"),u.Contracts.throwIfNull(t,"model");var n=t;u.Contracts.throwIfNullOrWhitespace(n.appId,"model.appId"),this.privAddedLmIntents[e]=new a.AddedLmIntent(n,r)},t.prototype.addAllIntents=function(e,t){u.Contracts.throwIfNull(e,"model");var r=e;u.Contracts.throwIfNullOrWhitespace(r.appId,"model.appId"),this.privUmbrellaIntent=new a.AddedLmIntent(r,t)},t.prototype.close=function(e,t){u.Contracts.throwIfDisposed(this.privDisposedIntentRecognizer),c.marshalPromiseToCallbacks(this.dispose(!0),e,t)},t.prototype.createRecognizerConfig=function(e){return new a.RecognizerConfig(e,this.properties)},t.prototype.createServiceRecognizer=function(e,t,r,n){var o=r;return new a.IntentServiceRecognizer(e,t,o,n,this)},t.prototype.dispose=function(t){return i(this,void 0,void 0,(function(){return s(this,(function(r){switch(r.label){case 0:return this.privDisposedIntentRecognizer?[2]:t?(this.privDisposedIntentRecognizer=!0,[4,e.prototype.dispose.call(this,t)]):[3,2];case 1:r.sent(),r.label=2;case 2:return[2]}}))}))},t.prototype.buildSpeechContext=function(){var e,t,r,n=[];void 0!==this.privUmbrellaIntent&&(e=this.privUmbrellaIntent.modelImpl.appId,t=this.privUmbrellaIntent.modelImpl.region,r=this.privUmbrellaIntent.modelImpl.subscriptionKey);for(var o=0,i=Object.keys(this.privAddedLmIntents);o<i.length;o++){var s=i[o],a=this.privAddedLmIntents[s];if(void 0===e)e=a.modelImpl.appId;else if(e!==a.modelImpl.appId)throw new Error("Intents must all be from the same LUIS model");if(void 0===t)t=a.modelImpl.region;else if(t!==a.modelImpl.region)throw new Error("Intents must all be from the same LUIS model in a single region");if(void 0===r)r=a.modelImpl.subscriptionKey;else if(r!==a.modelImpl.subscriptionKey)throw new Error("Intents must all use the same subscription key");var c="luis/"+e+"-PRODUCTION#"+s;n.push(c)}return{Intent:{id:e,key:void 0===r?this.privProperties.getProperty(p.PropertyId[p.PropertyId.SpeechServiceConnection_Key]):r,provider:"LUIS"},ReferenceGrammars:void 0===this.privUmbrellaIntent?n:["luis/"+e+"-PRODUCTION"]}},t}(p.Recognizer);t.IntentRecognizer=l},1748:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.KeywordRecognitionModel=void 0;var n=r(7348),o=function(){function e(){this.privDisposed=!1}return e.fromFile=function(e){throw n.Contracts.throwIfFileDoesNotExist(e,"fileName"),new Error("Not yet implemented.")},e.fromStream=function(e){throw n.Contracts.throwIfNull(e,"file"),new Error("Not yet implemented.")},e.prototype.close=function(){this.privDisposed||(this.privDisposed=!0)},e}();t.KeywordRecognitionModel=o},3503:function(e,t,r){"use strict";var n,o=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},n(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.LanguageUnderstandingModelImpl=t.LanguageUnderstandingModel=void 0;var i=r(7348),s=function(){function e(){}return e.fromEndpoint=function(e){i.Contracts.throwIfNull(e,"uri"),i.Contracts.throwIfNullOrWhitespace(e.hostname,"uri");var t=new a,r=e.host.indexOf(".");if(-1===r)throw new Error("Could not determine region from endpoint");t.region=e.host.substr(0,r);var n=e.pathname.lastIndexOf("/")+1;if(-1===n)throw new Error("Could not determine appId from endpoint");if(t.appId=e.pathname.substr(n),t.subscriptionKey=e.searchParams.get("subscription-key"),void 0===t.subscriptionKey)throw new Error("Could not determine subscription key from endpoint");return t},e.fromAppId=function(e){i.Contracts.throwIfNullOrWhitespace(e,"appId");var t=new a;return t.appId=e,t},e.fromSubscription=function(e,t,r){i.Contracts.throwIfNullOrWhitespace(e,"subscriptionKey"),i.Contracts.throwIfNullOrWhitespace(t,"appId"),i.Contracts.throwIfNullOrWhitespace(r,"region");var n=new a;return n.appId=t,n.region=r,n.subscriptionKey=e,n},e}();t.LanguageUnderstandingModel=s;var a=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o(t,e),t}(s);t.LanguageUnderstandingModelImpl=a},1744:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NoMatchDetails=void 0;var n=r(21),o=r(9480),i=function(){function e(e){this.privReason=e}return e.fromResult=function(t){var r=n.SimpleSpeechPhrase.fromJSON(t.json),i=o.NoMatchReason.NotRecognized;switch(r.RecognitionStatus){case n.RecognitionStatus.BabbleTimeout:i=o.NoMatchReason.InitialBabbleTimeout;break;case n.RecognitionStatus.InitialSilenceTimeout:i=o.NoMatchReason.InitialSilenceTimeout;break;default:i=o.NoMatchReason.NotRecognized}return new e(i)},Object.defineProperty(e.prototype,"reason",{get:function(){return this.privReason},enumerable:!1,configurable:!0}),e}();t.NoMatchDetails=i},1614:function(e,t){"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.NoMatchReason=void 0,(r=t.NoMatchReason||(t.NoMatchReason={}))[r.NotRecognized=0]="NotRecognized",r[r.InitialSilenceTimeout=1]="InitialSilenceTimeout",r[r.InitialBabbleTimeout=2]="InitialBabbleTimeout"},3040:function(e,t){"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.OutputFormat=void 0,(r=t.OutputFormat||(t.OutputFormat={}))[r.Simple=0]="Simple",r[r.Detailed=1]="Detailed"},5707:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PhraseListGrammar=void 0;var r=function(){function e(e){this.privGrammerBuilder=e.dynamicGrammar}return e.fromRecognizer=function(t){return new e(t.internalData)},e.prototype.addPhrase=function(e){this.privGrammerBuilder.addPhrase(e)},e.prototype.addPhrases=function(e){this.privGrammerBuilder.addPhrase(e)},e.prototype.clear=function(){this.privGrammerBuilder.clearPhrases()},e}();t.PhraseListGrammar=r},5732:function(e,t){"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.ProfanityOption=void 0,(r=t.ProfanityOption||(t.ProfanityOption={}))[r.Masked=0]="Masked",r[r.Removed=1]="Removed",r[r.Raw=2]="Raw"},6145:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PronunciationAssessmentConfig=void 0;var n=r(7348),o=r(9480),i=function(){function e(e,t,r,i){void 0===t&&(t=o.PronunciationAssessmentGradingSystem.FivePoint),void 0===r&&(r=o.PronunciationAssessmentGranularity.Phoneme),void 0===i&&(i=!1),n.Contracts.throwIfNullOrUndefined(e,"referenceText"),this.privProperties=new o.PropertyCollection,this.privProperties.setProperty(o.PropertyId.PronunciationAssessment_ReferenceText,e),this.privProperties.setProperty(o.PropertyId.PronunciationAssessment_GradingSystem,o.PronunciationAssessmentGradingSystem[t]),this.privProperties.setProperty(o.PropertyId.PronunciationAssessment_Granularity,o.PronunciationAssessmentGranularity[r]),this.privProperties.setProperty(o.PropertyId.PronunciationAssessment_EnableMiscue,String(i))}return e.fromJSON=function(t){n.Contracts.throwIfNullOrUndefined(t,"json");var r=new e("");return r.privProperties=new o.PropertyCollection,r.properties.setProperty(o.PropertyId.PronunciationAssessment_Json,t),r},e.prototype.toJSON=function(){return this.updateJson(),this.privProperties.getProperty(o.PropertyId.PronunciationAssessment_Params)},e.prototype.applyTo=function(e){this.updateJson(),e.internalData.speechContext.setPronunciationAssessmentParams(this.properties.getProperty(o.PropertyId.PronunciationAssessment_Params))},Object.defineProperty(e.prototype,"referenceText",{get:function(){return this.properties.getProperty(o.PropertyId.PronunciationAssessment_ReferenceText)},set:function(e){n.Contracts.throwIfNullOrWhitespace(e,"referenceText"),this.properties.setProperty(o.PropertyId.PronunciationAssessment_ReferenceText,e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"properties",{get:function(){return this.privProperties},enumerable:!1,configurable:!0}),e.prototype.updateJson=function(){var e=this.privProperties.getProperty(o.PropertyId.PronunciationAssessment_Json,"{}"),t=JSON.parse(e),r=this.privProperties.getProperty(o.PropertyId.PronunciationAssessment_ReferenceText);r&&(t.referenceText=r);var n=this.privProperties.getProperty(o.PropertyId.PronunciationAssessment_GradingSystem);n&&(t.gradingSystem=n);var i=this.privProperties.getProperty(o.PropertyId.PronunciationAssessment_Granularity);i&&(t.granularity=i),t.dimension="Comprehensive";var s=this.privProperties.getProperty(o.PropertyId.PronunciationAssessment_EnableMiscue);"true"===s?t.enableMiscue=!0:"false"===s&&(t.enableMiscue=!1),this.privProperties.setProperty(o.PropertyId.PronunciationAssessment_Params,JSON.stringify(t))},e}();t.PronunciationAssessmentConfig=i},2831:function(e,t){"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.PronunciationAssessmentGradingSystem=void 0,(r=t.PronunciationAssessmentGradingSystem||(t.PronunciationAssessmentGradingSystem={}))[r.FivePoint=1]="FivePoint",r[r.HundredMark=2]="HundredMark"},8985:function(e,t){"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.PronunciationAssessmentGranularity=void 0,(r=t.PronunciationAssessmentGranularity||(t.PronunciationAssessmentGranularity={}))[r.Phoneme=1]="Phoneme",r[r.Word=2]="Word",r[r.FullText=3]="FullText"},2204:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PronunciationAssessmentResult=void 0;var n=r(7348),o=r(9480),i=function(){function e(e){var t=JSON.parse(e);n.Contracts.throwIfNullOrUndefined(t.NBest[0],"NBest"),this.privPronJson=t.NBest[0]}return e.fromResult=function(t){n.Contracts.throwIfNullOrUndefined(t,"result");var r=t.properties.getProperty(o.PropertyId.SpeechServiceResponse_JsonResult);return n.Contracts.throwIfNullOrUndefined(r,"json"),new e(r)},Object.defineProperty(e.prototype,"detailResult",{get:function(){return this.privPronJson},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"accuracyScore",{get:function(){return this.detailResult.PronunciationAssessment.AccuracyScore},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"pronunciationScore",{get:function(){return this.detailResult.PronunciationAssessment.PronScore},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"completenessScore",{get:function(){return this.detailResult.PronunciationAssessment.CompletenessScore},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"fluencyScore",{get:function(){return this.detailResult.PronunciationAssessment.FluencyScore},enumerable:!1,configurable:!0}),e}();t.PronunciationAssessmentResult=i},9551:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PropertyCollection=void 0;var n=r(9480),o=function(){function e(){this.privKeys=[],this.privValues=[]}return e.prototype.getProperty=function(e,t){var r;r="string"==typeof e?e:n.PropertyId[e];for(var o=0;o<this.privKeys.length;o++)if(this.privKeys[o]===r)return this.privValues[o];return t},e.prototype.setProperty=function(e,t){var r;r="string"==typeof e?e:n.PropertyId[e];for(var o=0;o<this.privKeys.length;o++)if(this.privKeys[o]===r)return void(this.privValues[o]=t);this.privKeys.push(r),this.privValues.push(t)},e.prototype.clone=function(){for(var t=new e,r=0;r<this.privKeys.length;r++)t.privKeys.push(this.privKeys[r]),t.privValues.push(this.privValues[r]);return t},e.prototype.mergeTo=function(e){var t=this;this.privKeys.forEach((function(r){if(void 0===e.getProperty(r,void 0)){var n=t.getProperty(r);e.setProperty(r,n)}}))},e}();t.PropertyCollection=o},6776:function(e,t){"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.PropertyId=void 0,(r=t.PropertyId||(t.PropertyId={}))[r.SpeechServiceConnection_Key=0]="SpeechServiceConnection_Key",r[r.SpeechServiceConnection_Endpoint=1]="SpeechServiceConnection_Endpoint",r[r.SpeechServiceConnection_Region=2]="SpeechServiceConnection_Region",r[r.SpeechServiceAuthorization_Token=3]="SpeechServiceAuthorization_Token",r[r.SpeechServiceAuthorization_Type=4]="SpeechServiceAuthorization_Type",r[r.SpeechServiceConnection_EndpointId=5]="SpeechServiceConnection_EndpointId",r[r.SpeechServiceConnection_TranslationToLanguages=6]="SpeechServiceConnection_TranslationToLanguages",r[r.SpeechServiceConnection_TranslationVoice=7]="SpeechServiceConnection_TranslationVoice",r[r.SpeechServiceConnection_TranslationFeatures=8]="SpeechServiceConnection_TranslationFeatures",r[r.SpeechServiceConnection_IntentRegion=9]="SpeechServiceConnection_IntentRegion",r[r.SpeechServiceConnection_ProxyHostName=10]="SpeechServiceConnection_ProxyHostName",r[r.SpeechServiceConnection_ProxyPort=11]="SpeechServiceConnection_ProxyPort",r[r.SpeechServiceConnection_ProxyUserName=12]="SpeechServiceConnection_ProxyUserName",r[r.SpeechServiceConnection_ProxyPassword=13]="SpeechServiceConnection_ProxyPassword",r[r.SpeechServiceConnection_RecoMode=14]="SpeechServiceConnection_RecoMode",r[r.SpeechServiceConnection_RecoLanguage=15]="SpeechServiceConnection_RecoLanguage",r[r.Speech_SessionId=16]="Speech_SessionId",r[r.SpeechServiceConnection_SynthLanguage=17]="SpeechServiceConnection_SynthLanguage",r[r.SpeechServiceConnection_SynthVoice=18]="SpeechServiceConnection_SynthVoice",r[r.SpeechServiceConnection_SynthOutputFormat=19]="SpeechServiceConnection_SynthOutputFormat",r[r.SpeechServiceConnection_AutoDetectSourceLanguages=20]="SpeechServiceConnection_AutoDetectSourceLanguages",r[r.SpeechServiceResponse_RequestDetailedResultTrueFalse=21]="SpeechServiceResponse_RequestDetailedResultTrueFalse",r[r.SpeechServiceResponse_RequestProfanityFilterTrueFalse=22]="SpeechServiceResponse_RequestProfanityFilterTrueFalse",r[r.SpeechServiceResponse_JsonResult=23]="SpeechServiceResponse_JsonResult",r[r.SpeechServiceResponse_JsonErrorDetails=24]="SpeechServiceResponse_JsonErrorDetails",r[r.CancellationDetails_Reason=25]="CancellationDetails_Reason",r[r.CancellationDetails_ReasonText=26]="CancellationDetails_ReasonText",r[r.CancellationDetails_ReasonDetailedText=27]="CancellationDetails_ReasonDetailedText",r[r.LanguageUnderstandingServiceResponse_JsonResult=28]="LanguageUnderstandingServiceResponse_JsonResult",r[r.SpeechServiceConnection_Url=29]="SpeechServiceConnection_Url",r[r.SpeechServiceConnection_InitialSilenceTimeoutMs=30]="SpeechServiceConnection_InitialSilenceTimeoutMs",r[r.SpeechServiceConnection_EndSilenceTimeoutMs=31]="SpeechServiceConnection_EndSilenceTimeoutMs",r[r.SpeechServiceConnection_EnableAudioLogging=32]="SpeechServiceConnection_EnableAudioLogging",r[r.SpeechServiceResponse_ProfanityOption=33]="SpeechServiceResponse_ProfanityOption",r[r.SpeechServiceResponse_PostProcessingOption=34]="SpeechServiceResponse_PostProcessingOption",r[r.SpeechServiceResponse_RequestWordLevelTimestamps=35]="SpeechServiceResponse_RequestWordLevelTimestamps",r[r.SpeechServiceResponse_StablePartialResultThreshold=36]="SpeechServiceResponse_StablePartialResultThreshold",r[r.SpeechServiceResponse_OutputFormatOption=37]="SpeechServiceResponse_OutputFormatOption",r[r.SpeechServiceResponse_TranslationRequestStablePartialResult=38]="SpeechServiceResponse_TranslationRequestStablePartialResult",r[r.Conversation_ApplicationId=39]="Conversation_ApplicationId",r[r.Conversation_DialogType=40]="Conversation_DialogType",r[r.Conversation_Initial_Silence_Timeout=41]="Conversation_Initial_Silence_Timeout",r[r.Conversation_From_Id=42]="Conversation_From_Id",r[r.Conversation_Conversation_Id=43]="Conversation_Conversation_Id",r[r.Conversation_Custom_Voice_Deployment_Ids=44]="Conversation_Custom_Voice_Deployment_Ids",r[r.Conversation_Speech_Activity_Template=45]="Conversation_Speech_Activity_Template",r[r.Conversation_Request_Bot_Status_Messages=46]="Conversation_Request_Bot_Status_Messages",r[r.Conversation_Agent_Connection_Id=47]="Conversation_Agent_Connection_Id",r[r.SpeechServiceConnection_Host=48]="SpeechServiceConnection_Host",r[r.ConversationTranslator_Host=49]="ConversationTranslator_Host",r[r.ConversationTranslator_Name=50]="ConversationTranslator_Name",r[r.ConversationTranslator_CorrelationId=51]="ConversationTranslator_CorrelationId",r[r.ConversationTranslator_Token=52]="ConversationTranslator_Token",r[r.PronunciationAssessment_ReferenceText=53]="PronunciationAssessment_ReferenceText",r[r.PronunciationAssessment_GradingSystem=54]="PronunciationAssessment_GradingSystem",r[r.PronunciationAssessment_Granularity=55]="PronunciationAssessment_Granularity",r[r.PronunciationAssessment_EnableMiscue=56]="PronunciationAssessment_EnableMiscue",r[r.PronunciationAssessment_Json=57]="PronunciationAssessment_Json",r[r.PronunciationAssessment_Params=58]="PronunciationAssessment_Params"},3885:function(e,t,r){"use strict";var n,o=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},n(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.RecognitionEventArgs=void 0;var i=function(e){function t(t,r){var n=e.call(this,r)||this;return n.privOffset=t,n}return o(t,e),Object.defineProperty(t.prototype,"offset",{get:function(){return this.privOffset},enumerable:!1,configurable:!0}),t}(r(9480).SessionEventArgs);t.RecognitionEventArgs=i},6205:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RecognitionResult=void 0;var r=function(){function e(e,t,r,n,o,i,s,a,c,u){this.privResultId=e,this.privReason=t,this.privText=r,this.privDuration=n,this.privOffset=o,this.privLanguage=i,this.privLanguageDetectionConfidence=s,this.privErrorDetails=a,this.privJson=c,this.privProperties=u}return Object.defineProperty(e.prototype,"resultId",{get:function(){return this.privResultId},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"reason",{get:function(){return this.privReason},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"text",{get:function(){return this.privText},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"duration",{get:function(){return this.privDuration},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"offset",{get:function(){return this.privOffset},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"language",{get:function(){return this.privLanguage},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"languageDetectionConfidence",{get:function(){return this.privLanguageDetectionConfidence},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"errorDetails",{get:function(){return this.privErrorDetails},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"json",{get:function(){return this.privJson},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"properties",{get:function(){return this.privProperties},enumerable:!1,configurable:!0}),e}();t.RecognitionResult=r},1676:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function s(e){try{c(n.next(e))}catch(e){i(e)}}function a(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var r,n,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,n=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.Recognizer=void 0;var i=r(21),s=r(2370),a=r(7348),c=r(9480),u=function(){function e(e,t,r){this.audioConfig=void 0!==e?e:c.AudioConfig.fromDefaultMicrophoneInput(),this.privDisposed=!1,this.privProperties=t.clone(),this.privConnectionFactory=r,this.implCommonRecognizerSetup()}return e.prototype.close=function(e,t){a.Contracts.throwIfDisposed(this.privDisposed),s.marshalPromiseToCallbacks(this.dispose(!0),e,t)},Object.defineProperty(e.prototype,"internalData",{get:function(){return this.privReco},enumerable:!1,configurable:!0}),e.prototype.dispose=function(e){return n(this,void 0,void 0,(function(){return o(this,(function(t){switch(t.label){case 0:return this.privDisposed?[2]:(this.privDisposed=!0,e&&this.privReco?[4,this.privReco.audioSource.turnOff()]:[3,3]);case 1:return t.sent(),[4,this.privReco.dispose()];case 2:t.sent(),t.label=3;case 3:return[2]}}))}))},Object.defineProperty(e,"telemetryEnabled",{get:function(){return i.ServiceRecognizerBase.telemetryDataEnabled},enumerable:!1,configurable:!0}),e.enableTelemetry=function(e){i.ServiceRecognizerBase.telemetryDataEnabled=e},e.prototype.implCommonRecognizerSetup=function(){var t="undefined"!=typeof window?"Browser":"Node",r="unknown",n="unknown";"undefined"!=typeof navigator&&(t=t+"/"+navigator.platform,r=navigator.userAgent,n=navigator.appVersion);var o=this.createRecognizerConfig(new i.SpeechServiceConfig(new i.Context(new i.OS(t,r,n))));this.privReco=this.createServiceRecognizer(e.getAuthFromProperties(this.privProperties),this.privConnectionFactory,this.audioConfig,o)},e.prototype.recognizeOnceAsyncImpl=function(e){return n(this,void 0,void 0,(function(){var t,r;return o(this,(function(n){switch(n.label){case 0:return a.Contracts.throwIfDisposed(this.privDisposed),t=new s.Deferred,[4,this.implRecognizerStop()];case 1:return n.sent(),[4,this.privReco.recognize(e,t.resolve,t.reject)];case 2:return n.sent(),[4,t.promise];case 3:return r=n.sent(),[4,this.implRecognizerStop()];case 4:return n.sent(),[2,r]}}))}))},e.prototype.startContinuousRecognitionAsyncImpl=function(e){return n(this,void 0,void 0,(function(){return o(this,(function(t){switch(t.label){case 0:return a.Contracts.throwIfDisposed(this.privDisposed),[4,this.implRecognizerStop()];case 1:return t.sent(),[4,this.privReco.recognize(e,void 0,void 0)];case 2:return t.sent(),[2]}}))}))},e.prototype.stopContinuousRecognitionAsyncImpl=function(){return n(this,void 0,void 0,(function(){return o(this,(function(e){switch(e.label){case 0:return a.Contracts.throwIfDisposed(this.privDisposed),[4,this.implRecognizerStop()];case 1:return e.sent(),[2]}}))}))},e.prototype.implRecognizerStop=function(){return n(this,void 0,void 0,(function(){return o(this,(function(e){switch(e.label){case 0:return this.privReco?[4,this.privReco.stopRecognizing()]:[3,2];case 1:e.sent(),e.label=2;case 2:return[2]}}))}))},e.getAuthFromProperties=function(e){var t=e.getProperty(c.PropertyId.SpeechServiceConnection_Key,void 0);return t&&""!==t?new i.CognitiveSubscriptionKeyAuthentication(t):new i.CognitiveTokenAuthentication((function(t){var r=e.getProperty(c.PropertyId.SpeechServiceAuthorization_Token,void 0);return Promise.resolve(r)}),(function(t){var r=e.getProperty(c.PropertyId.SpeechServiceAuthorization_Token,void 0);return Promise.resolve(r)}))},e}();t.Recognizer=u},5640:function(e,t){"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.ResultReason=void 0,(r=t.ResultReason||(t.ResultReason={}))[r.NoMatch=0]="NoMatch",r[r.Canceled=1]="Canceled",r[r.RecognizingSpeech=2]="RecognizingSpeech",r[r.RecognizedSpeech=3]="RecognizedSpeech",r[r.RecognizedKeyword=4]="RecognizedKeyword",r[r.RecognizingIntent=5]="RecognizingIntent",r[r.RecognizedIntent=6]="RecognizedIntent",r[r.TranslatingSpeech=7]="TranslatingSpeech",r[r.TranslatedSpeech=8]="TranslatedSpeech",r[r.SynthesizingAudio=9]="SynthesizingAudio",r[r.SynthesizingAudioCompleted=10]="SynthesizingAudioCompleted",r[r.SynthesizingAudioStarted=11]="SynthesizingAudioStarted",r[r.EnrollingVoiceProfile=12]="EnrollingVoiceProfile",r[r.EnrolledVoiceProfile=13]="EnrolledVoiceProfile",r[r.RecognizedSpeakers=14]="RecognizedSpeakers",r[r.RecognizedSpeaker=15]="RecognizedSpeaker",r[r.ResetVoiceProfile=16]="ResetVoiceProfile",r[r.DeletedVoiceProfile=17]="DeletedVoiceProfile"},3395:function(e,t,r){"use strict";var n,o=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},n(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.ServiceEventArgs=void 0;var i=function(e){function t(t,r,n){var o=e.call(this,n)||this;return o.privJsonResult=t,o.privEventName=r,o}return o(t,e),Object.defineProperty(t.prototype,"jsonString",{get:function(){return this.privJsonResult},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"eventName",{get:function(){return this.privEventName},enumerable:!1,configurable:!0}),t}(r(9480).SessionEventArgs);t.ServiceEventArgs=i},8777:function(e,t){"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.ServicePropertyChannel=void 0,(r=t.ServicePropertyChannel||(t.ServicePropertyChannel={}))[r.UriQueryParameter=0]="UriQueryParameter"},2710:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SessionEventArgs=void 0;var r=function(){function e(e){this.privSessionId=e}return Object.defineProperty(e.prototype,"sessionId",{get:function(){return this.privSessionId},enumerable:!1,configurable:!0}),e}();t.SessionEventArgs=r},3839:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SourceLanguageConfig=void 0;var n=r(7348),o=function(){function e(e,t){n.Contracts.throwIfNullOrUndefined(e,"language"),this.privLanguage=e,this.privEndpointId=t}return e.fromLanguage=function(t,r){return new e(t,r)},Object.defineProperty(e.prototype,"language",{get:function(){return this.privLanguage},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"endpointId",{get:function(){return this.privEndpointId},enumerable:!1,configurable:!0}),e}();t.SourceLanguageConfig=o},1387:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SpeakerIdentificationModel=void 0;var n=r(7348),o=r(9480),i=function(){function e(e){var t=this;if(this.privVoiceProfiles=[],n.Contracts.throwIfNullOrUndefined(e,"VoiceProfiles"),0===e.length)throw new Error("Empty Voice Profiles array");e.forEach((function(e){if(e.profileType!==o.VoiceProfileType.TextIndependentIdentification)throw new Error("Identification model can only be created from Identification profile: "+e.profileId);t.privVoiceProfiles.push(e)}))}return e.fromProfiles=function(t){return new e(t)},Object.defineProperty(e.prototype,"voiceProfileIds",{get:function(){return this.privVoiceProfiles.map((function(e){return e.profileId})).join(",")},enumerable:!1,configurable:!0}),e}();t.SpeakerIdentificationModel=i},3895:function(e,t,r){"use strict";var n,o=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},n(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.SpeakerRecognitionCancellationDetails=t.SpeakerRecognitionResult=t.SpeakerRecognitionResultType=void 0;var i,s=r(21),a=r(7348),c=r(9480);!function(e){e[e.Verify=0]="Verify",e[e.Identify=1]="Identify"}(i=t.SpeakerRecognitionResultType||(t.SpeakerRecognitionResultType={}));var u=function(){function e(e,t,r,n){if(void 0===n&&(n=c.ResultReason.RecognizedSpeaker),this.privProperties=new c.PropertyCollection,this.privReason=n,this.privReason!==c.ResultReason.Canceled)if(e===i.Identify){var o=JSON.parse(t);a.Contracts.throwIfNullOrUndefined(o,"JSON"),this.privProfileId=o.identifiedProfile.profileId,this.privScore=o.identifiedProfile.score}else o=JSON.parse(t),a.Contracts.throwIfNullOrUndefined(o,"JSON"),this.privScore=o.score,"accept"!==o.recognitionResult.toLowerCase()&&(this.privReason=c.ResultReason.NoMatch),void 0!==r&&""!==r&&(this.privProfileId=r);else o=JSON.parse(t),a.Contracts.throwIfNullOrUndefined(o,"JSON"),this.privErrorDetails=o.statusText,this.privProperties.setProperty(s.CancellationErrorCodePropertyName,c.CancellationErrorCode[c.CancellationErrorCode.ServiceError]);this.privProperties.setProperty(c.PropertyId.SpeechServiceResponse_JsonResult,t)}return Object.defineProperty(e.prototype,"properties",{get:function(){return this.privProperties},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"reason",{get:function(){return this.privReason},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"profileId",{get:function(){return this.privProfileId},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"errorDetails",{get:function(){return this.privErrorDetails},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"score",{get:function(){return this.privScore},enumerable:!1,configurable:!0}),e}();t.SpeakerRecognitionResult=u;var p=function(e){function t(t,r,n){return e.call(this,t,r,n)||this}return o(t,e),t.fromResult=function(e){var r=c.CancellationReason.Error,n=c.CancellationErrorCode.NoError;return e.properties&&(n=c.CancellationErrorCode[e.properties.getProperty(s.CancellationErrorCodePropertyName,c.CancellationErrorCode[c.CancellationErrorCode.NoError])]),new t(r,e.errorDetails,n)},t}(c.CancellationDetailsBase);t.SpeakerRecognitionCancellationDetails=p},7271:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function s(e){try{c(n.next(e))}catch(e){i(e)}}function a(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var r,n,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,n=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.SpeakerRecognizer=void 0;var i=r(21),s=r(2370),a=r(7348),c=r(9480),u=function(){function e(e,t){var r=e;a.Contracts.throwIfNull(r,"speechConfig"),this.privAudioConfigImpl=t,a.Contracts.throwIfNull(this.privAudioConfigImpl,"audioConfig"),this.privProperties=r.properties.clone(),this.implSRSetup()}return Object.defineProperty(e.prototype,"authorizationToken",{get:function(){return this.properties.getProperty(c.PropertyId.SpeechServiceAuthorization_Token)},set:function(e){a.Contracts.throwIfNullOrWhitespace(e,"token"),this.properties.setProperty(c.PropertyId.SpeechServiceAuthorization_Token,e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"properties",{get:function(){return this.privProperties},enumerable:!1,configurable:!0}),e.prototype.recognizeOnceAsync=function(e,t,r){if(e instanceof c.SpeakerIdentificationModel){var n=this.privAdapter.identifySpeaker(e,this.privAudioConfigImpl);s.marshalPromiseToCallbacks(this.getResult(n,c.SpeakerRecognitionResultType.Identify,void 0),t,r)}else{if(!(e instanceof c.SpeakerVerificationModel))throw new Error("SpeakerRecognizer.recognizeOnce: Unexpected model type");n=this.privAdapter.verifySpeaker(e,this.privAudioConfigImpl),s.marshalPromiseToCallbacks(this.getResult(n,c.SpeakerRecognitionResultType.Verify,e.voiceProfile.profileId),t,r)}},e.prototype.close=function(){},e.prototype.implSRSetup=function(){var e="undefined"!=typeof window?"Browser":"Node",t="unknown",r="unknown";"undefined"!=typeof navigator&&(e=e+"/"+navigator.platform,t=navigator.userAgent,r=navigator.appVersion);var n=new i.SpeakerRecognitionConfig(new i.Context(new i.OS(e,t,r)),this.privProperties);this.privAdapter=new i.SpeakerIdMessageAdapter(n)},e.prototype.getResult=function(e,t,r){return n(this,void 0,void 0,(function(){var n;return o(this,(function(o){switch(o.label){case 0:return[4,e];case 1:return n=o.sent(),[2,new c.SpeakerRecognitionResult(t,n.data,r,n.ok?c.ResultReason.RecognizedSpeaker:c.ResultReason.Canceled)]}}))}))},e}();t.SpeakerRecognizer=u},1486:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SpeakerVerificationModel=void 0;var n=r(7348),o=r(9480),i=function(){function e(e){if(n.Contracts.throwIfNullOrUndefined(e,"VoiceProfile"),e.profileType===o.VoiceProfileType.TextIndependentIdentification)throw new Error("Verification model cannot be created from Identification profile");this.privVoiceProfile=e}return e.fromProfile=function(t){return new e(t)},Object.defineProperty(e.prototype,"voiceProfile",{get:function(){return this.privVoiceProfile},enumerable:!1,configurable:!0}),e}();t.SpeakerVerificationModel=i},3875:function(e,t,r){"use strict";var n,o=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},n(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.SpeechConfigImpl=t.SpeechConfig=void 0;var i=r(21),s=r(7348),a=r(9480),c=function(){function e(){}return e.fromSubscription=function(e,t){s.Contracts.throwIfNullOrWhitespace(e,"subscriptionKey"),s.Contracts.throwIfNullOrWhitespace(t,"region");var r=new u;return r.setProperty(a.PropertyId.SpeechServiceConnection_Region,t),r.setProperty(a.PropertyId.SpeechServiceConnection_IntentRegion,t),r.setProperty(a.PropertyId.SpeechServiceConnection_Key,e),r},e.fromEndpoint=function(e,t){s.Contracts.throwIfNull(e,"endpoint");var r=new u;return r.setProperty(a.PropertyId.SpeechServiceConnection_Endpoint,e.href),void 0!==t&&r.setProperty(a.PropertyId.SpeechServiceConnection_Key,t),r},e.fromHost=function(e,t){s.Contracts.throwIfNull(e,"hostName");var r=new u;return r.setProperty(a.PropertyId.SpeechServiceConnection_Host,e.protocol+"//"+e.hostname+(""===e.port?"":":"+e.port)),void 0!==t&&r.setProperty(a.PropertyId.SpeechServiceConnection_Key,t),r},e.fromAuthorizationToken=function(e,t){s.Contracts.throwIfNull(e,"authorizationToken"),s.Contracts.throwIfNullOrWhitespace(t,"region");var r=new u;return r.setProperty(a.PropertyId.SpeechServiceConnection_Region,t),r.setProperty(a.PropertyId.SpeechServiceConnection_IntentRegion,t),r.authorizationToken=e,r},e.prototype.close=function(){},e}();t.SpeechConfig=c;var u=function(e){function t(){var t=e.call(this)||this;return t.privProperties=new a.PropertyCollection,t.speechRecognitionLanguage="en-US",t.outputFormat=a.OutputFormat.Simple,t}return o(t,e),Object.defineProperty(t.prototype,"properties",{get:function(){return this.privProperties},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"endPoint",{get:function(){return new URL(this.privProperties.getProperty(a.PropertyId.SpeechServiceConnection_Endpoint))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"subscriptionKey",{get:function(){return this.privProperties.getProperty(a.PropertyId.SpeechServiceConnection_Key)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"region",{get:function(){return this.privProperties.getProperty(a.PropertyId.SpeechServiceConnection_Region)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"authorizationToken",{get:function(){return this.privProperties.getProperty(a.PropertyId.SpeechServiceAuthorization_Token)},set:function(e){this.privProperties.setProperty(a.PropertyId.SpeechServiceAuthorization_Token,e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"speechRecognitionLanguage",{get:function(){return this.privProperties.getProperty(a.PropertyId.SpeechServiceConnection_RecoLanguage)},set:function(e){this.privProperties.setProperty(a.PropertyId.SpeechServiceConnection_RecoLanguage,e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"autoDetectSourceLanguages",{get:function(){return this.privProperties.getProperty(a.PropertyId.SpeechServiceConnection_AutoDetectSourceLanguages)},set:function(e){this.privProperties.setProperty(a.PropertyId.SpeechServiceConnection_AutoDetectSourceLanguages,e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"outputFormat",{get:function(){return a.OutputFormat[this.privProperties.getProperty(i.OutputFormatPropertyName,void 0)]},set:function(e){this.privProperties.setProperty(i.OutputFormatPropertyName,a.OutputFormat[e])},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"endpointId",{get:function(){return this.privProperties.getProperty(a.PropertyId.SpeechServiceConnection_EndpointId)},set:function(e){this.privProperties.setProperty(a.PropertyId.SpeechServiceConnection_EndpointId,e)},enumerable:!1,configurable:!0}),t.prototype.setProperty=function(e,t){s.Contracts.throwIfNull(t,"value"),this.privProperties.setProperty(e,t)},t.prototype.getProperty=function(e,t){return this.privProperties.getProperty(e,t)},t.prototype.setProxy=function(e,t,r,n){this.setProperty(a.PropertyId[a.PropertyId.SpeechServiceConnection_ProxyHostName],e),this.setProperty(a.PropertyId[a.PropertyId.SpeechServiceConnection_ProxyPort],t),this.setProperty(a.PropertyId[a.PropertyId.SpeechServiceConnection_ProxyUserName],r),this.setProperty(a.PropertyId[a.PropertyId.SpeechServiceConnection_ProxyPassword],n)},t.prototype.setServiceProperty=function(e,t,r){var n=JSON.parse(this.privProperties.getProperty(i.ServicePropertiesPropertyName,"{}"));n[e]=t,this.privProperties.setProperty(i.ServicePropertiesPropertyName,JSON.stringify(n))},t.prototype.setProfanity=function(e){this.privProperties.setProperty(a.PropertyId.SpeechServiceResponse_ProfanityOption,a.ProfanityOption[e])},t.prototype.enableAudioLogging=function(){this.privProperties.setProperty(a.PropertyId.SpeechServiceConnection_EnableAudioLogging,"true")},t.prototype.requestWordLevelTimestamps=function(){this.privProperties.setProperty(a.PropertyId.SpeechServiceResponse_RequestWordLevelTimestamps,"true")},t.prototype.enableDictation=function(){this.privProperties.setProperty(i.ForceDictationPropertyName,"true")},t.prototype.clone=function(){var e=new t;return e.privProperties=this.privProperties.clone(),e},Object.defineProperty(t.prototype,"speechSynthesisLanguage",{get:function(){return this.privProperties.getProperty(a.PropertyId.SpeechServiceConnection_SynthLanguage)},set:function(e){this.privProperties.setProperty(a.PropertyId.SpeechServiceConnection_SynthLanguage,e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"speechSynthesisVoiceName",{get:function(){return this.privProperties.getProperty(a.PropertyId.SpeechServiceConnection_SynthVoice)},set:function(e){this.privProperties.setProperty(a.PropertyId.SpeechServiceConnection_SynthVoice,e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"speechSynthesisOutputFormat",{get:function(){return a.SpeechSynthesisOutputFormat[this.privProperties.getProperty(a.PropertyId.SpeechServiceConnection_SynthOutputFormat,void 0)]},set:function(e){this.privProperties.setProperty(a.PropertyId.SpeechServiceConnection_SynthOutputFormat,a.SpeechSynthesisOutputFormat[e])},enumerable:!1,configurable:!0}),t}(c);t.SpeechConfigImpl=u},4975:function(e,t,r){"use strict";var n,o=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},n(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.SpeechRecognitionCanceledEventArgs=void 0;var i=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o(t,e),t}(r(762).CancellationEventArgsBase);t.SpeechRecognitionCanceledEventArgs=i},3624:function(e,t,r){"use strict";var n,o=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},n(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.ConversationTranscriptionEventArgs=t.SpeechRecognitionEventArgs=void 0;var i=function(e){function t(t,r,n){var o=e.call(this,r,n)||this;return o.privResult=t,o}return o(t,e),Object.defineProperty(t.prototype,"result",{get:function(){return this.privResult},enumerable:!1,configurable:!0}),t}(r(9480).RecognitionEventArgs);t.SpeechRecognitionEventArgs=i;var s=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o(t,e),t}(i);t.ConversationTranscriptionEventArgs=s},5700:function(e,t,r){"use strict";var n,o=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},n(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.SpeechRecognitionResult=void 0;var i=function(e){function t(t,r,n,o,i,s,a,c,u,p,l){var f=e.call(this,t,r,n,o,i,s,a,u,p,l)||this;return f.privSpeakerId=c,f}return o(t,e),Object.defineProperty(t.prototype,"speakerId",{get:function(){return this.privSpeakerId},enumerable:!1,configurable:!0}),t}(r(9480).RecognitionResult);t.SpeechRecognitionResult=i},263:function(e,t,r){"use strict";var n,o=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},n(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),i=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function s(e){try{c(n.next(e))}catch(e){i(e)}}function a(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))},s=this&&this.__generator||function(e,t){var r,n,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,n=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.SpeechRecognizer=void 0;var a=r(21),c=r(2370),u=r(7348),p=r(9480),l=function(e){function t(t,r){var n=this,o=t;return u.Contracts.throwIfNull(o,"speechConfig"),u.Contracts.throwIfNullOrWhitespace(o.properties.getProperty(p.PropertyId.SpeechServiceConnection_RecoLanguage),p.PropertyId[p.PropertyId.SpeechServiceConnection_RecoLanguage]),(n=e.call(this,r,o.properties,new a.SpeechConnectionFactory)||this).privDisposedRecognizer=!1,n}return o(t,e),t.FromConfig=function(e,r,n){var o=e;return r.properties.mergeTo(o.properties),new t(e,n)},Object.defineProperty(t.prototype,"endpointId",{get:function(){return u.Contracts.throwIfDisposed(this.privDisposedRecognizer),this.properties.getProperty(p.PropertyId.SpeechServiceConnection_EndpointId,"00000000-0000-0000-0000-000000000000")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"authorizationToken",{get:function(){return this.properties.getProperty(p.PropertyId.SpeechServiceAuthorization_Token)},set:function(e){u.Contracts.throwIfNullOrWhitespace(e,"token"),this.properties.setProperty(p.PropertyId.SpeechServiceAuthorization_Token,e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"speechRecognitionLanguage",{get:function(){return u.Contracts.throwIfDisposed(this.privDisposedRecognizer),this.properties.getProperty(p.PropertyId.SpeechServiceConnection_RecoLanguage)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"outputFormat",{get:function(){return u.Contracts.throwIfDisposed(this.privDisposedRecognizer),this.properties.getProperty(a.OutputFormatPropertyName,p.OutputFormat[p.OutputFormat.Simple])===p.OutputFormat[p.OutputFormat.Simple]?p.OutputFormat.Simple:p.OutputFormat.Detailed},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"properties",{get:function(){return this.privProperties},enumerable:!1,configurable:!0}),t.prototype.recognizeOnceAsync=function(e,t){c.marshalPromiseToCallbacks(this.recognizeOnceAsyncImpl(a.RecognitionMode.Interactive),e,t)},t.prototype.startContinuousRecognitionAsync=function(e,t){c.marshalPromiseToCallbacks(this.startContinuousRecognitionAsyncImpl(a.RecognitionMode.Conversation),e,t)},t.prototype.stopContinuousRecognitionAsync=function(e,t){c.marshalPromiseToCallbacks(this.stopContinuousRecognitionAsyncImpl(),e,t)},t.prototype.startKeywordRecognitionAsync=function(e,t,r){u.Contracts.throwIfNull(e,"model"),r&&r("Not yet implemented.")},t.prototype.stopKeywordRecognitionAsync=function(e,t){e&&e()},t.prototype.close=function(e,t){u.Contracts.throwIfDisposed(this.privDisposedRecognizer),c.marshalPromiseToCallbacks(this.dispose(!0),e,t)},t.prototype.dispose=function(t){return i(this,void 0,void 0,(function(){return s(this,(function(r){switch(r.label){case 0:return this.privDisposedRecognizer?[2]:t?(this.privDisposedRecognizer=!0,[4,this.implRecognizerStop()]):[3,2];case 1:r.sent(),r.label=2;case 2:return[4,e.prototype.dispose.call(this,t)];case 3:return r.sent(),[2]}}))}))},t.prototype.createRecognizerConfig=function(e){return new a.RecognizerConfig(e,this.properties)},t.prototype.createServiceRecognizer=function(e,t,r,n){var o=r;return new a.SpeechServiceRecognizer(e,t,o,n,this)},t}(p.Recognizer);t.SpeechRecognizer=l},2567:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SpeechSynthesisBookmarkEventArgs=void 0;var r=function(){function e(e,t){this.privAudioOffset=e,this.privText=t}return Object.defineProperty(e.prototype,"audioOffset",{get:function(){return this.privAudioOffset},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"text",{get:function(){return this.privText},enumerable:!1,configurable:!0}),e}();t.SpeechSynthesisBookmarkEventArgs=r},6161:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SpeechSynthesisEventArgs=void 0;var r=function(){function e(e){this.privResult=e}return Object.defineProperty(e.prototype,"result",{get:function(){return this.privResult},enumerable:!1,configurable:!0}),e}();t.SpeechSynthesisEventArgs=r},4643:function(e,t){"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.SpeechSynthesisOutputFormat=void 0,(r=t.SpeechSynthesisOutputFormat||(t.SpeechSynthesisOutputFormat={}))[r.Raw8Khz8BitMonoMULaw=0]="Raw8Khz8BitMonoMULaw",r[r.Riff16Khz16KbpsMonoSiren=1]="Riff16Khz16KbpsMonoSiren",r[r.Audio16Khz16KbpsMonoSiren=2]="Audio16Khz16KbpsMonoSiren",r[r.Audio16Khz32KBitRateMonoMp3=3]="Audio16Khz32KBitRateMonoMp3",r[r.Audio16Khz128KBitRateMonoMp3=4]="Audio16Khz128KBitRateMonoMp3",r[r.Audio16Khz64KBitRateMonoMp3=5]="Audio16Khz64KBitRateMonoMp3",r[r.Audio24Khz48KBitRateMonoMp3=6]="Audio24Khz48KBitRateMonoMp3",r[r.Audio24Khz96KBitRateMonoMp3=7]="Audio24Khz96KBitRateMonoMp3",r[r.Audio24Khz160KBitRateMonoMp3=8]="Audio24Khz160KBitRateMonoMp3",r[r.Raw16Khz16BitMonoTrueSilk=9]="Raw16Khz16BitMonoTrueSilk",r[r.Riff16Khz16BitMonoPcm=10]="Riff16Khz16BitMonoPcm",r[r.Riff8Khz16BitMonoPcm=11]="Riff8Khz16BitMonoPcm",r[r.Riff24Khz16BitMonoPcm=12]="Riff24Khz16BitMonoPcm",r[r.Riff8Khz8BitMonoMULaw=13]="Riff8Khz8BitMonoMULaw",r[r.Raw16Khz16BitMonoPcm=14]="Raw16Khz16BitMonoPcm",r[r.Raw24Khz16BitMonoPcm=15]="Raw24Khz16BitMonoPcm",r[r.Raw8Khz16BitMonoPcm=16]="Raw8Khz16BitMonoPcm",r[r.Ogg16Khz16BitMonoOpus=17]="Ogg16Khz16BitMonoOpus",r[r.Ogg24Khz16BitMonoOpus=18]="Ogg24Khz16BitMonoOpus",r[r.Raw48Khz16BitMonoPcm=19]="Raw48Khz16BitMonoPcm",r[r.Riff48Khz16BitMonoPcm=20]="Riff48Khz16BitMonoPcm",r[r.Audio48Khz96KBitRateMonoMp3=21]="Audio48Khz96KBitRateMonoMp3",r[r.Audio48Khz192KBitRateMonoMp3=22]="Audio48Khz192KBitRateMonoMp3",r[r.Ogg48Khz16BitMonoOpus=23]="Ogg48Khz16BitMonoOpus",r[r.Webm16Khz16BitMonoOpus=24]="Webm16Khz16BitMonoOpus",r[r.Webm24Khz16BitMonoOpus=25]="Webm24Khz16BitMonoOpus",r[r.Raw24Khz16BitMonoTrueSilk=26]="Raw24Khz16BitMonoTrueSilk",r[r.Raw8Khz8BitMonoALaw=27]="Raw8Khz8BitMonoALaw",r[r.Riff8Khz8BitMonoALaw=28]="Riff8Khz8BitMonoALaw"},8641:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SpeechSynthesisResult=void 0;var r=function(){function e(e,t,r,n,o){this.privResultId=e,this.privReason=t,this.privAudioData=r,this.privErrorDetails=n,this.privProperties=o}return Object.defineProperty(e.prototype,"resultId",{get:function(){return this.privResultId},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"reason",{get:function(){return this.privReason},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"audioData",{get:function(){return this.privAudioData},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"errorDetails",{get:function(){return this.privErrorDetails},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"properties",{get:function(){return this.privProperties},enumerable:!1,configurable:!0}),e}();t.SpeechSynthesisResult=r},9010:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SpeechSynthesisVisemeEventArgs=void 0;var r=function(){function e(e,t,r){this.privAudioOffset=e,this.privVisemeId=t,this.privAnimation=r}return Object.defineProperty(e.prototype,"audioOffset",{get:function(){return this.privAudioOffset},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"visemeId",{get:function(){return this.privVisemeId},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"animation",{get:function(){return this.privAnimation},enumerable:!1,configurable:!0}),e}();t.SpeechSynthesisVisemeEventArgs=r},3045:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SpeechSynthesisWordBoundaryEventArgs=void 0;var r=function(){function e(e,t,r,n){this.privAudioOffset=e,this.privText=t,this.privWordLength=r,this.privTextOffset=n}return Object.defineProperty(e.prototype,"audioOffset",{get:function(){return this.privAudioOffset},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"text",{get:function(){return this.privText},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"wordLength",{get:function(){return this.privWordLength},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"textOffset",{get:function(){return this.privTextOffset},enumerable:!1,configurable:!0}),e}();t.SpeechSynthesisWordBoundaryEventArgs=r},697:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function s(e){try{c(n.next(e))}catch(e){i(e)}}function a(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var r,n,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,n=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.SynthesisRequest=t.SpeechSynthesizer=void 0;var i=r(21),s=r(2370),a=r(12),c=r(5019),u=r(5149),p=r(7348),l=r(9480),f=function(){function e(e,t){var r=e;p.Contracts.throwIfNull(r,"speechConfig"),null!==t&&(this.audioConfig=void 0===t?"undefined"==typeof window?void 0:l.AudioConfig.fromDefaultSpeakerOutput():t),this.privProperties=r.properties.clone(),this.privDisposed=!1,this.privSynthesizing=!1,this.privConnectionFactory=new i.SpeechSynthesisConnectionFactory,this.synthesisRequestQueue=new s.Queue,this.implCommonSynthesizeSetup()}return Object.defineProperty(e.prototype,"authorizationToken",{get:function(){return this.properties.getProperty(l.PropertyId.SpeechServiceAuthorization_Token)},set:function(e){p.Contracts.throwIfNullOrWhitespace(e,"token"),this.properties.setProperty(l.PropertyId.SpeechServiceAuthorization_Token,e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"properties",{get:function(){return this.privProperties},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"autoDetectSourceLanguage",{get:function(){return this.properties.getProperty(l.PropertyId.SpeechServiceConnection_AutoDetectSourceLanguages)===i.AutoDetectSourceLanguagesOpenRangeOptionName},enumerable:!1,configurable:!0}),e.FromConfig=function(t,r,n){var o=t;return r.properties.mergeTo(o.properties),new e(t,n)},e.prototype.buildSsml=function(t){var r,n=((r={})["ar-EG"]="Microsoft Server Speech Text to Speech Voice (ar-EG, Hoda)",r["ar-SA"]="Microsoft Server Speech Text to Speech Voice (ar-SA, Naayf)",r["bg-BG"]="Microsoft Server Speech Text to Speech Voice (bg-BG, Ivan)",r["ca-ES"]="Microsoft Server Speech Text to Speech Voice (ca-ES, HerenaRUS)",r["cs-CZ"]="Microsoft Server Speech Text to Speech Voice (cs-CZ, Jakub)",r["da-DK"]="Microsoft Server Speech Text to Speech Voice (da-DK, HelleRUS)",r["de-AT"]="Microsoft Server Speech Text to Speech Voice (de-AT, Michael)",r["de-CH"]="Microsoft Server Speech Text to Speech Voice (de-CH, Karsten)",r["de-DE"]="Microsoft Server Speech Text to Speech Voice (de-DE, HeddaRUS)",r["el-GR"]="Microsoft Server Speech Text to Speech Voice (el-GR, Stefanos)",r["en-AU"]="Microsoft Server Speech Text to Speech Voice (en-AU, HayleyRUS)",r["en-CA"]="Microsoft Server Speech Text to Speech Voice (en-CA, HeatherRUS)",r["en-GB"]="Microsoft Server Speech Text to Speech Voice (en-GB, HazelRUS)",r["en-IE"]="Microsoft Server Speech Text to Speech Voice (en-IE, Sean)",r["en-IN"]="Microsoft Server Speech Text to Speech Voice (en-IN, PriyaRUS)",r["en-US"]="Microsoft Server Speech Text to Speech Voice (en-US, AriaRUS)",r["es-ES"]="Microsoft Server Speech Text to Speech Voice (es-ES, HelenaRUS)",r["es-MX"]="Microsoft Server Speech Text to Speech Voice (es-MX, HildaRUS)",r["fi-FI"]="Microsoft Server Speech Text to Speech Voice (fi-FI, HeidiRUS)",r["fr-CA"]="Microsoft Server Speech Text to Speech Voice (fr-CA, HarmonieRUS)",r["fr-CH"]="Microsoft Server Speech Text to Speech Voice (fr-CH, Guillaume)",r["fr-FR"]="Microsoft Server Speech Text to Speech Voice (fr-FR, HortenseRUS)",r["he-IL"]="Microsoft Server Speech Text to Speech Voice (he-IL, Asaf)",r["hi-IN"]="Microsoft Server Speech Text to Speech Voice (hi-IN, Kalpana)",r["hr-HR"]="Microsoft Server Speech Text to Speech Voice (hr-HR, Matej)",r["hu-HU"]="Microsoft Server Speech Text to Speech Voice (hu-HU, Szabolcs)",r["id-ID"]="Microsoft Server Speech Text to Speech Voice (id-ID, Andika)",r["it-IT"]="Microsoft Server Speech Text to Speech Voice (it-IT, LuciaRUS)",r["ja-JP"]="Microsoft Server Speech Text to Speech Voice (ja-JP, HarukaRUS)",r["ko-KR"]="Microsoft Server Speech Text to Speech Voice (ko-KR, HeamiRUS)",r["ms-MY"]="Microsoft Server Speech Text to Speech Voice (ms-MY, Rizwan)",r["nb-NO"]="Microsoft Server Speech Text to Speech Voice (nb-NO, HuldaRUS)",r["nl-NL"]="Microsoft Server Speech Text to Speech Voice (nl-NL, HannaRUS)",r["pl-PL"]="Microsoft Server Speech Text to Speech Voice (pl-PL, PaulinaRUS)",r["pt-BR"]="Microsoft Server Speech Text to Speech Voice (pt-BR, HeloisaRUS)",r["pt-PT"]="Microsoft Server Speech Text to Speech Voice (pt-PT, HeliaRUS)",r["ro-RO"]="Microsoft Server Speech Text to Speech Voice (ro-RO, Andrei)",r["ru-RU"]="Microsoft Server Speech Text to Speech Voice (ru-RU, EkaterinaRUS)",r["sk-SK"]="Microsoft Server Speech Text to Speech Voice (sk-SK, Filip)",r["sl-SI"]="Microsoft Server Speech Text to Speech Voice (sl-SI, Lado)",r["sv-SE"]="Microsoft Server Speech Text to Speech Voice (sv-SE, HedvigRUS)",r["ta-IN"]="Microsoft Server Speech Text to Speech Voice (ta-IN, Valluvar)",r["te-IN"]="Microsoft Server Speech Text to Speech Voice (te-IN, Chitra)",r["th-TH"]="Microsoft Server Speech Text to Speech Voice (th-TH, Pattara)",r["tr-TR"]="Microsoft Server Speech Text to Speech Voice (tr-TR, SedaRUS)",r["vi-VN"]="Microsoft Server Speech Text to Speech Voice (vi-VN, An)",r["zh-CN"]="Microsoft Server Speech Text to Speech Voice (zh-CN, HuihuiRUS)",r["zh-HK"]="Microsoft Server Speech Text to Speech Voice (zh-HK, TracyRUS)",r["zh-TW"]="Microsoft Server Speech Text to Speech Voice (zh-TW, HanHanRUS)",r),o=this.properties.getProperty(l.PropertyId.SpeechServiceConnection_SynthLanguage,"en-US"),i=this.properties.getProperty(l.PropertyId.SpeechServiceConnection_SynthVoice,""),s=e.XMLEncode(t);return this.autoDetectSourceLanguage?o="en-US":i=i||n[o],i&&(s="<voice name='"+i+"'>"+s+"</voice>"),"<speak version='1.0' xmlns='http://www.w3.org/2001/10/synthesis' xmlns:mstts='http://www.w3.org/2001/mstts' xmlns:emo='http://www.w3.org/2009/10/emotionml' xml:lang='"+o+"'>"+s+"</speak>"},e.prototype.speakTextAsync=function(e,t,r,n){this.speakImpl(e,!1,t,r,n)},e.prototype.speakSsmlAsync=function(e,t,r,n){this.speakImpl(e,!0,t,r,n)},e.prototype.close=function(e,t){p.Contracts.throwIfDisposed(this.privDisposed),s.marshalPromiseToCallbacks(this.dispose(!0),e,t)},Object.defineProperty(e.prototype,"internalData",{get:function(){return this.privAdapter},enumerable:!1,configurable:!0}),e.prototype.dispose=function(e){return n(this,void 0,void 0,(function(){return o(this,(function(t){switch(t.label){case 0:return this.privDisposed?[2]:e&&this.privAdapter?[4,this.privAdapter.dispose()]:[3,2];case 1:t.sent(),t.label=2;case 2:return this.privDisposed=!0,[2]}}))}))},e.prototype.createSynthesizerConfig=function(e){return new i.SynthesizerConfig(e,this.privProperties)},e.prototype.createSynthesisAdapter=function(e,t,r,n){return new i.SynthesisAdapterBase(e,t,n,this,this.audioConfig)},e.prototype.implCommonSynthesizeSetup=function(){var e=this,t="undefined"!=typeof window?"Browser":"Node",r="unknown",n="unknown";"undefined"!=typeof navigator&&(t=t+"/"+navigator.platform,r=navigator.userAgent,n=navigator.appVersion);var o=this.createSynthesizerConfig(new i.SpeechServiceConfig(new i.Context(new i.OS(t,r,n)))),s=this.privProperties.getProperty(l.PropertyId.SpeechServiceConnection_Key,void 0),a=s&&""!==s?new i.CognitiveSubscriptionKeyAuthentication(s):new i.CognitiveTokenAuthentication((function(t){var r=e.privProperties.getProperty(l.PropertyId.SpeechServiceAuthorization_Token,void 0);return Promise.resolve(r)}),(function(t){var r=e.privProperties.getProperty(l.PropertyId.SpeechServiceAuthorization_Token,void 0);return Promise.resolve(r)}));this.privAdapter=this.createSynthesisAdapter(a,this.privConnectionFactory,this.audioConfig,o),this.privAdapter.audioOutputFormat=c.AudioOutputFormatImpl.fromSpeechSynthesisOutputFormat(l.SpeechSynthesisOutputFormat[this.properties.getProperty(l.PropertyId.SpeechServiceConnection_SynthOutputFormat,void 0)])},e.prototype.speakImpl=function(e,t,r,n,o){var i=this;try{p.Contracts.throwIfDisposed(this.privDisposed);var c,f=s.createNoDashGuid();c=o instanceof l.PushAudioOutputStreamCallback?new u.PushAudioOutputStreamImpl(o):o instanceof l.PullAudioOutputStream?o:void 0!==o?new a.AudioFileWriter(o):void 0,this.synthesisRequestQueue.enqueue(new h(f,e,t,(function(e){if(i.privSynthesizing=!1,r)try{r(e)}catch(e){n&&n(e)}r=void 0,i.adapterSpeak().catch((function(){}))}),(function(e){n&&n(e)}),c)),this.adapterSpeak().catch((function(){}))}catch(e){if(n)if(e instanceof Error){var v=e;n(v.name+": "+v.message)}else n(e);this.dispose(!0).catch((function(){}))}},e.prototype.adapterSpeak=function(){return n(this,void 0,void 0,(function(){var e;return o(this,(function(t){switch(t.label){case 0:return this.privDisposed||this.privSynthesizing?[3,2]:(this.privSynthesizing=!0,[4,this.synthesisRequestQueue.dequeue()]);case 1:return e=t.sent(),[2,this.privAdapter.Speak(e.text,e.isSSML,e.requestId,e.cb,e.err,e.dataStream)];case 2:return[2]}}))}))},e.XMLEncode=function(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")},e}();t.SpeechSynthesizer=f;var h=function(e,t,r,n,o,i){this.requestId=e,this.text=t,this.isSSML=r,this.cb=n,this.err=o,this.dataStream=i};t.SynthesisRequest=h},6244:function(e,t,r){"use strict";var n,o=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},n(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.SpeechTranslationConfigImpl=t.SpeechTranslationConfig=void 0;var i=r(21),s=r(7348),a=r(9480),c=function(e){function t(){return e.call(this)||this}return o(t,e),t.fromSubscription=function(e,t){s.Contracts.throwIfNullOrWhitespace(e,"subscriptionKey"),s.Contracts.throwIfNullOrWhitespace(t,"region");var r=new u;return r.properties.setProperty(a.PropertyId.SpeechServiceConnection_Key,e),r.properties.setProperty(a.PropertyId.SpeechServiceConnection_Region,t),r},t.fromAuthorizationToken=function(e,t){s.Contracts.throwIfNullOrWhitespace(e,"authorizationToken"),s.Contracts.throwIfNullOrWhitespace(t,"region");var r=new u;return r.properties.setProperty(a.PropertyId.SpeechServiceAuthorization_Token,e),r.properties.setProperty(a.PropertyId.SpeechServiceConnection_Region,t),r},t.fromHost=function(e,t){s.Contracts.throwIfNull(e,"hostName");var r=new u;return r.setProperty(a.PropertyId.SpeechServiceConnection_Host,e.protocol+"//"+e.hostname+(""===e.port?"":":"+e.port)),void 0!==t&&r.setProperty(a.PropertyId.SpeechServiceConnection_Key,t),r},t.fromEndpoint=function(e,t){s.Contracts.throwIfNull(e,"endpoint"),s.Contracts.throwIfNull(t,"subscriptionKey");var r=new u;return r.properties.setProperty(a.PropertyId.SpeechServiceConnection_Endpoint,e.href),r.properties.setProperty(a.PropertyId.SpeechServiceConnection_Key,t),r},t}(a.SpeechConfig);t.SpeechTranslationConfig=c;var u=function(e){function t(){var t=e.call(this)||this;return t.privSpeechProperties=new a.PropertyCollection,t.outputFormat=a.OutputFormat.Simple,t}return o(t,e),Object.defineProperty(t.prototype,"authorizationToken",{set:function(e){s.Contracts.throwIfNullOrWhitespace(e,"value"),this.privSpeechProperties.setProperty(a.PropertyId.SpeechServiceAuthorization_Token,e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"speechRecognitionLanguage",{get:function(){return this.privSpeechProperties.getProperty(a.PropertyId[a.PropertyId.SpeechServiceConnection_RecoLanguage])},set:function(e){s.Contracts.throwIfNullOrWhitespace(e,"value"),this.privSpeechProperties.setProperty(a.PropertyId.SpeechServiceConnection_RecoLanguage,e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"subscriptionKey",{get:function(){return this.privSpeechProperties.getProperty(a.PropertyId[a.PropertyId.SpeechServiceConnection_Key])},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"outputFormat",{get:function(){return a.OutputFormat[this.privSpeechProperties.getProperty(i.OutputFormatPropertyName,void 0)]},set:function(e){this.privSpeechProperties.setProperty(i.OutputFormatPropertyName,a.OutputFormat[e])},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"endpointId",{get:function(){return this.privSpeechProperties.getProperty(a.PropertyId.SpeechServiceConnection_EndpointId)},set:function(e){this.privSpeechProperties.setProperty(a.PropertyId.SpeechServiceConnection_EndpointId,e)},enumerable:!1,configurable:!0}),t.prototype.addTargetLanguage=function(e){s.Contracts.throwIfNullOrWhitespace(e,"value");var t=this.targetLanguages;t.push(e),this.privSpeechProperties.setProperty(a.PropertyId.SpeechServiceConnection_TranslationToLanguages,t.join(","))},Object.defineProperty(t.prototype,"targetLanguages",{get:function(){return void 0!==this.privSpeechProperties.getProperty(a.PropertyId.SpeechServiceConnection_TranslationToLanguages,void 0)?this.privSpeechProperties.getProperty(a.PropertyId.SpeechServiceConnection_TranslationToLanguages).split(","):[]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"voiceName",{get:function(){return this.getProperty(a.PropertyId[a.PropertyId.SpeechServiceConnection_TranslationVoice])},set:function(e){s.Contracts.throwIfNullOrWhitespace(e,"value"),this.privSpeechProperties.setProperty(a.PropertyId.SpeechServiceConnection_TranslationVoice,e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"region",{get:function(){return this.privSpeechProperties.getProperty(a.PropertyId.SpeechServiceConnection_Region)},enumerable:!1,configurable:!0}),t.prototype.setProxy=function(e,t,r,n){this.setProperty(a.PropertyId[a.PropertyId.SpeechServiceConnection_ProxyHostName],e),this.setProperty(a.PropertyId[a.PropertyId.SpeechServiceConnection_ProxyPort],t),this.setProperty(a.PropertyId[a.PropertyId.SpeechServiceConnection_ProxyUserName],r),this.setProperty(a.PropertyId[a.PropertyId.SpeechServiceConnection_ProxyPassword],n)},t.prototype.getProperty=function(e,t){return this.privSpeechProperties.getProperty(e,t)},t.prototype.setProperty=function(e,t){this.privSpeechProperties.setProperty(e,t)},Object.defineProperty(t.prototype,"properties",{get:function(){return this.privSpeechProperties},enumerable:!1,configurable:!0}),t.prototype.close=function(){},t.prototype.setServiceProperty=function(e,t,r){var n=JSON.parse(this.privSpeechProperties.getProperty(i.ServicePropertiesPropertyName,"{}"));n[e]=t,this.privSpeechProperties.setProperty(i.ServicePropertiesPropertyName,JSON.stringify(n))},t.prototype.setProfanity=function(e){this.privSpeechProperties.setProperty(a.PropertyId.SpeechServiceResponse_ProfanityOption,a.ProfanityOption[e])},t.prototype.enableAudioLogging=function(){this.privSpeechProperties.setProperty(a.PropertyId.SpeechServiceConnection_EnableAudioLogging,"true")},t.prototype.requestWordLevelTimestamps=function(){this.privSpeechProperties.setProperty(a.PropertyId.SpeechServiceResponse_RequestWordLevelTimestamps,"true")},t.prototype.enableDictation=function(){this.privSpeechProperties.setProperty(i.ForceDictationPropertyName,"true")},Object.defineProperty(t.prototype,"speechSynthesisLanguage",{get:function(){return this.privSpeechProperties.getProperty(a.PropertyId.SpeechServiceConnection_SynthLanguage)},set:function(e){this.privSpeechProperties.setProperty(a.PropertyId.SpeechServiceConnection_SynthLanguage,e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"speechSynthesisVoiceName",{get:function(){return this.privSpeechProperties.getProperty(a.PropertyId.SpeechServiceConnection_SynthVoice)},set:function(e){this.privSpeechProperties.setProperty(a.PropertyId.SpeechServiceConnection_SynthVoice,e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"speechSynthesisOutputFormat",{get:function(){return a.SpeechSynthesisOutputFormat[this.privSpeechProperties.getProperty(a.PropertyId.SpeechServiceConnection_SynthOutputFormat,void 0)]},set:function(e){this.privSpeechProperties.setProperty(a.PropertyId.SpeechServiceConnection_SynthOutputFormat,a.SpeechSynthesisOutputFormat[e])},enumerable:!1,configurable:!0}),t}(c);t.SpeechTranslationConfigImpl=u},8394:function(e,t,r){"use strict";var n,o=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},n(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),i=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function s(e){try{c(n.next(e))}catch(e){i(e)}}function a(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))},s=this&&this.__generator||function(e,t){var r,n,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,n=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},a=this&&this.__spreadArrays||function(){for(var e=0,t=0,r=arguments.length;t<r;t++)e+=arguments[t].length;var n=Array(e),o=0;for(t=0;t<r;t++)for(var i=arguments[t],s=0,a=i.length;s<a;s++,o++)n[o]=i[s];return n};Object.defineProperty(t,"__esModule",{value:!0}),t.ConversationImpl=t.Conversation=void 0;var c=r(21),u=r(2370),p=r(7348),l=r(9480),f=function(){function e(){}return e.createConversationAsync=function(e,t,r,n){if(p.Contracts.throwIfNullOrUndefined(e,c.ConversationConnectionConfig.restErrors.invalidArgs.replace("{arg}","config")),p.Contracts.throwIfNullOrUndefined(e.region,c.ConversationConnectionConfig.restErrors.invalidArgs.replace("{arg}","SpeechServiceConnection_Region")),e.subscriptionKey||e.getProperty(l.PropertyId[l.PropertyId.SpeechServiceAuthorization_Token])||p.Contracts.throwIfNullOrUndefined(e.subscriptionKey,c.ConversationConnectionConfig.restErrors.invalidArgs.replace("{arg}","SpeechServiceConnection_Key")),"string"==typeof t){var o=new h(e,t);return u.marshalPromiseToCallbacks(i(this,void 0,void 0,(function(){return s(this,(function(e){return[2]}))})),r,n),o}o=new h(e);var a=t,f=r;return o.createConversationAsync((function(){a&&a()}),(function(e){f&&f(e)})),o},e}();t.Conversation=f;var h=function(e){function t(t,r){var n=e.call(this)||this;if(n.privIsDisposed=!1,n.privIsConnected=!1,n.privErrors=c.ConversationConnectionConfig.restErrors,n.privConversationId="",n.onConnected=function(e){n.privIsConnected=!0;try{n.privConversationTranslator.sessionStarted&&n.privConversationTranslator.sessionStarted(n.privConversationTranslator,e)}catch(e){}},n.onDisconnected=function(e){return i(n,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.close(!1)];case 1:t.sent();try{this.privConversationTranslator.sessionStopped&&this.privConversationTranslator.sessionStopped(this.privConversationTranslator,e)}catch(e){}return[2]}}))}))},n.onCanceled=function(e,t){return i(n,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.close(!1)];case 1:e.sent();try{this.privConversationTranslator.canceled&&this.privConversationTranslator.canceled(this.privConversationTranslator,t)}catch(e){}return[2]}}))}))},n.onParticipantUpdateCommandReceived=function(e,t){var r,o;try{var i=n.privParticipants.getParticipant(t.id);if(void 0!==i){switch(t.key){case c.ConversationTranslatorCommandTypes.changeNickname:i.displayName=t.value;break;case c.ConversationTranslatorCommandTypes.setUseTTS:i.useTts=t.value;break;case c.ConversationTranslatorCommandTypes.setProfanityFiltering:i.profanity=t.value;break;case c.ConversationTranslatorCommandTypes.setMute:i.isMuted=t.value;break;case c.ConversationTranslatorCommandTypes.setTranslateToLanguages:i.translateToLanguages=t.value}n.privParticipants.addOrUpdateParticipant(i),(null===(r=n.privConversationTranslator)||void 0===r?void 0:r.participantsChanged)&&(null===(o=n.privConversationTranslator)||void 0===o||o.participantsChanged(n.privConversationTranslator,new l.ConversationParticipantsChangedEventArgs(l.ParticipantChangedReason.Updated,[n.toParticipant(i)],t.sessionId)))}}catch(t){}},n.onLockRoomCommandReceived=function(e,t){},n.onMuteAllCommandReceived=function(e,t){var r,o;try{n.privParticipants.participants.forEach((function(e){return e.isMuted=!e.isHost&&t.isMuted})),(null===(r=n.privConversationTranslator)||void 0===r?void 0:r.participantsChanged)&&(null===(o=n.privConversationTranslator)||void 0===o||o.participantsChanged(n.privConversationTranslator,new l.ConversationParticipantsChangedEventArgs(l.ParticipantChangedReason.Updated,n.toParticipants(!1),t.sessionId)))}catch(t){}},n.onParticipantJoinCommandReceived=function(e,t){var r,o;try{var i=n.privParticipants.addOrUpdateParticipant(t.participant);void 0!==i&&(null===(r=n.privConversationTranslator)||void 0===r?void 0:r.participantsChanged)&&(null===(o=n.privConversationTranslator)||void 0===o||o.participantsChanged(n.privConversationTranslator,new l.ConversationParticipantsChangedEventArgs(l.ParticipantChangedReason.JoinedConversation,[n.toParticipant(i)],t.sessionId)))}catch(t){}},n.onParticipantLeaveCommandReceived=function(e,t){var r,o;try{var i=n.privParticipants.getParticipant(t.participant.id);void 0!==i&&(n.privParticipants.deleteParticipant(t.participant.id),(null===(r=n.privConversationTranslator)||void 0===r?void 0:r.participantsChanged)&&(null===(o=n.privConversationTranslator)||void 0===o||o.participantsChanged(n.privConversationTranslator,new l.ConversationParticipantsChangedEventArgs(l.ParticipantChangedReason.LeftConversation,[n.toParticipant(i)],t.sessionId))))}catch(t){}},n.onTranslationReceived=function(e,t){var r,o,i,s,a,u;try{switch(t.command){case c.ConversationTranslatorMessageTypes.final:(null===(r=n.privConversationTranslator)||void 0===r?void 0:r.transcribed)&&(null===(o=n.privConversationTranslator)||void 0===o||o.transcribed(n.privConversationTranslator,new l.ConversationTranslationEventArgs(t.payload,void 0,t.sessionId)));break;case c.ConversationTranslatorMessageTypes.partial:(null===(i=n.privConversationTranslator)||void 0===i?void 0:i.transcribing)&&(null===(s=n.privConversationTranslator)||void 0===s||s.transcribing(n.privConversationTranslator,new l.ConversationTranslationEventArgs(t.payload,void 0,t.sessionId)));break;case c.ConversationTranslatorMessageTypes.instantMessage:(null===(a=n.privConversationTranslator)||void 0===a?void 0:a.textMessageReceived)&&(null===(u=n.privConversationTranslator)||void 0===u||u.textMessageReceived(n.privConversationTranslator,new l.ConversationTranslationEventArgs(t.payload,void 0,t.sessionId)))}}catch(t){}},n.onParticipantsListReceived=function(e,t){var r,o,i;try{if(void 0!==t.sessionToken&&null!==t.sessionToken&&(n.privRoom.token=t.sessionToken),n.privParticipants.participants=a(t.participants),void 0!==n.privParticipants.me&&(n.privIsReady=!0),(null===(r=n.privConversationTranslator)||void 0===r?void 0:r.participantsChanged)&&(null===(o=n.privConversationTranslator)||void 0===o||o.participantsChanged(n.privConversationTranslator,new l.ConversationParticipantsChangedEventArgs(l.ParticipantChangedReason.JoinedConversation,n.toParticipants(!0),t.sessionId))),n.me.isHost){var s=null===(i=n.privConversationTranslator)||void 0===i?void 0:i.properties.getProperty(l.PropertyId.ConversationTranslator_Name);void 0!==s&&s.length>0&&s!==n.me.displayName&&n.changeNicknameAsync(s)}}catch(t){}},n.onConversationExpiration=function(e,t){var r,o;try{(null===(r=n.privConversationTranslator)||void 0===r?void 0:r.conversationExpiration)&&(null===(o=n.privConversationTranslator)||void 0===o||o.conversationExpiration(n.privConversationTranslator,t))}catch(t){}},n.privProperties=new l.PropertyCollection,n.privManager=new c.ConversationManager,t.getProperty(l.PropertyId[l.PropertyId.SpeechServiceConnection_RecoLanguage])||t.setProperty(l.PropertyId[l.PropertyId.SpeechServiceConnection_RecoLanguage],c.ConversationConnectionConfig.defaultLanguageCode),n.privLanguage=t.getProperty(l.PropertyId[l.PropertyId.SpeechServiceConnection_RecoLanguage]),r)n.privConversationId=r;else{0===t.targetLanguages.length&&t.addTargetLanguage(n.privLanguage),t.getProperty(l.PropertyId[l.PropertyId.SpeechServiceResponse_ProfanityOption])||t.setProfanity(l.ProfanityOption.Masked);var o=t.getProperty(l.PropertyId[l.PropertyId.ConversationTranslator_Name]);(null==o||o.length<=1||o.length>50)&&(o="Host"),t.setProperty(l.PropertyId[l.PropertyId.ConversationTranslator_Name],o)}n.privConfig=t;var u=t;return p.Contracts.throwIfNull(u,"speechConfig"),n.privProperties=u.properties.clone(),n.privIsConnected=!1,n.privParticipants=new c.InternalParticipants,n.privIsReady=!1,n.privTextMessageMaxLength=1e3,n}return o(t,e),Object.defineProperty(t.prototype,"conversationTranslator",{set:function(e){this.privConversationTranslator=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"room",{get:function(){return this.privRoom},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"connection",{get:function(){return this.privConversationRecognizer},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"authorizationToken",{get:function(){return this.privToken},set:function(e){p.Contracts.throwIfNullOrWhitespace(e,"authorizationToken"),this.privToken=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"config",{get:function(){return this.privConfig},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"conversationId",{get:function(){return this.privRoom?this.privRoom.roomId:this.privConversationId},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"properties",{get:function(){return this.privProperties},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"speechRecognitionLanguage",{get:function(){return this.privLanguage},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isMutedByHost",{get:function(){var e,t;return!(null===(e=this.privParticipants.me)||void 0===e?void 0:e.isHost)&&(null===(t=this.privParticipants.me)||void 0===t?void 0:t.isMuted)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isConnected",{get:function(){return this.privIsConnected&&this.privIsReady},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"participants",{get:function(){return this.toParticipants(!0)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"me",{get:function(){return this.toParticipant(this.privParticipants.me)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"host",{get:function(){return this.toParticipant(this.privParticipants.host)},enumerable:!1,configurable:!0}),t.prototype.createConversationAsync=function(e,t){var r=this;try{this.privConversationRecognizer&&this.handleError(new Error(this.privErrors.permissionDeniedStart),t),this.privManager.createOrJoin(this.privProperties,void 0,(function(n){n||r.handleError(new Error(r.privErrors.permissionDeniedConnect),t),r.privRoom=n,r.handleCallback(e,t)}),(function(e){r.handleError(e,t)}))}catch(e){this.handleError(e,t)}},t.prototype.startConversationAsync=function(e,t){var r=this;try{this.privConversationRecognizer&&this.handleError(new Error(this.privErrors.permissionDeniedStart),t),p.Contracts.throwIfNullOrUndefined(this.privRoom,this.privErrors.permissionDeniedConnect),this.privParticipants.meId=this.privRoom.participantId,this.privConversationRecognizer=c.ConversationRecognizerFactory.fromConfig(this.privConfig),this.privConversationRecognizer.connected=this.onConnected,this.privConversationRecognizer.disconnected=this.onDisconnected,this.privConversationRecognizer.canceled=this.onCanceled,this.privConversationRecognizer.participantUpdateCommandReceived=this.onParticipantUpdateCommandReceived,this.privConversationRecognizer.lockRoomCommandReceived=this.onLockRoomCommandReceived,this.privConversationRecognizer.muteAllCommandReceived=this.onMuteAllCommandReceived,this.privConversationRecognizer.participantJoinCommandReceived=this.onParticipantJoinCommandReceived,this.privConversationRecognizer.participantLeaveCommandReceived=this.onParticipantLeaveCommandReceived,this.privConversationRecognizer.translationReceived=this.onTranslationReceived,this.privConversationRecognizer.participantsListReceived=this.onParticipantsListReceived,this.privConversationRecognizer.conversationExpiration=this.onConversationExpiration,this.privConversationRecognizer.connect(this.privRoom.token,(function(){r.handleCallback(e,t)}),(function(e){r.handleError(e,t)}))}catch(e){this.handleError(e,t)}},t.prototype.addParticipantAsync=function(e,t,r){p.Contracts.throwIfNullOrUndefined(e,"Participant"),u.marshalPromiseToCallbacks(this.addParticipantImplAsync(e),t,r)},t.prototype.joinConversationAsync=function(e,t,r,n,o){var i=this;try{p.Contracts.throwIfNullOrWhitespace(e,this.privErrors.invalidArgs.replace("{arg}","conversationId")),p.Contracts.throwIfNullOrWhitespace(t,this.privErrors.invalidArgs.replace("{arg}","nickname")),p.Contracts.throwIfNullOrWhitespace(r,this.privErrors.invalidArgs.replace("{arg}","language")),this.privManager.createOrJoin(this.privProperties,e,(function(e){p.Contracts.throwIfNullOrUndefined(e,i.privErrors.permissionDeniedConnect),i.privRoom=e,i.privConfig.authorizationToken=e.cognitiveSpeechAuthToken,n&&n(e.cognitiveSpeechAuthToken)}),(function(e){i.handleError(e,o)}))}catch(e){this.handleError(e,o)}},t.prototype.deleteConversationAsync=function(e,t){u.marshalPromiseToCallbacks(this.deleteConversationImplAsync(),e,t)},t.prototype.deleteConversationImplAsync=function(){return i(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return p.Contracts.throwIfNullOrUndefined(this.privProperties,this.privErrors.permissionDeniedConnect),p.Contracts.throwIfNullOrWhitespace(this.privRoom.token,this.privErrors.permissionDeniedConnect),[4,this.privManager.leave(this.privProperties,this.privRoom.token)];case 1:return e.sent(),this.dispose(),[2]}}))}))},t.prototype.endConversationAsync=function(e,t){u.marshalPromiseToCallbacks(this.endConversationImplAsync(),e,t)},t.prototype.endConversationImplAsync=function(){return this.close(!0)},t.prototype.lockConversationAsync=function(e,t){var r,n=this;try{p.Contracts.throwIfDisposed(this.privIsDisposed),p.Contracts.throwIfDisposed(this.privConversationRecognizer.isDisposed()),p.Contracts.throwIfNullOrUndefined(this.privRoom,this.privErrors.permissionDeniedSend),this.canSendAsHost||this.handleError(new Error(this.privErrors.permissionDeniedConversation.replace("{command}","lock")),t),null===(r=this.privConversationRecognizer)||void 0===r||r.sendRequest(this.getLockCommand(!0),(function(){n.handleCallback(e,t)}),(function(e){n.handleError(e,t)}))}catch(e){this.handleError(e,t)}},t.prototype.muteAllParticipantsAsync=function(e,t){var r,n=this;try{p.Contracts.throwIfDisposed(this.privIsDisposed),p.Contracts.throwIfDisposed(this.privConversationRecognizer.isDisposed()),p.Contracts.throwIfNullOrUndefined(this.privConversationRecognizer,this.privErrors.permissionDeniedSend),p.Contracts.throwIfNullOrUndefined(this.privRoom,this.privErrors.permissionDeniedSend),this.canSendAsHost||this.handleError(new Error(this.privErrors.permissionDeniedConversation.replace("{command}","mute")),t),null===(r=this.privConversationRecognizer)||void 0===r||r.sendRequest(this.getMuteAllCommand(!0),(function(){n.handleCallback(e,t)}),(function(e){n.handleError(e,t)}))}catch(e){this.handleError(e,t)}},t.prototype.muteParticipantAsync=function(e,t,r){var n,o=this;try{p.Contracts.throwIfDisposed(this.privIsDisposed),p.Contracts.throwIfDisposed(this.privConversationRecognizer.isDisposed()),p.Contracts.throwIfNullOrWhitespace(e,this.privErrors.invalidArgs.replace("{arg}","userId")),p.Contracts.throwIfNullOrUndefined(this.privRoom,this.privErrors.permissionDeniedSend),this.canSend||this.handleError(new Error(this.privErrors.permissionDeniedSend),r),this.me.isHost||this.me.id===e||this.handleError(new Error(this.privErrors.permissionDeniedParticipant.replace("{command}","mute")),r),-1===this.privParticipants.getParticipantIndex(e)&&this.handleError(new Error(this.privErrors.invalidParticipantRequest),r),null===(n=this.privConversationRecognizer)||void 0===n||n.sendRequest(this.getMuteCommand(e,!0),(function(){o.handleCallback(t,r)}),(function(e){o.handleError(e,r)}))}catch(e){this.handleError(e,r)}},t.prototype.removeParticipantAsync=function(e,t,r){var n,o=this;try{if(p.Contracts.throwIfDisposed(this.privIsDisposed),this.privTranscriberRecognizer&&e.hasOwnProperty("id"))u.marshalPromiseToCallbacks(this.removeParticipantImplAsync(e),t,r);else{p.Contracts.throwIfDisposed(this.privConversationRecognizer.isDisposed()),p.Contracts.throwIfNullOrUndefined(this.privRoom,this.privErrors.permissionDeniedSend),this.canSendAsHost||this.handleError(new Error(this.privErrors.permissionDeniedParticipant.replace("{command}","remove")),r);var i="";"string"==typeof e?i=e:e.hasOwnProperty("id")?i=e.id:e.hasOwnProperty("userId")&&(i=e.userId),p.Contracts.throwIfNullOrWhitespace(i,this.privErrors.invalidArgs.replace("{arg}","userId")),-1===this.participants.findIndex((function(e){return e.id===i}))&&this.handleError(new Error(this.privErrors.invalidParticipantRequest),r),null===(n=this.privConversationRecognizer)||void 0===n||n.sendRequest(this.getEjectCommand(i),(function(){o.handleCallback(t,r)}),(function(e){o.handleError(e,r)}))}}catch(e){this.handleError(e,r)}},t.prototype.unlockConversationAsync=function(e,t){var r,n=this;try{p.Contracts.throwIfDisposed(this.privIsDisposed),p.Contracts.throwIfDisposed(this.privConversationRecognizer.isDisposed()),p.Contracts.throwIfNullOrUndefined(this.privRoom,this.privErrors.permissionDeniedSend),this.canSendAsHost||this.handleError(new Error(this.privErrors.permissionDeniedConversation.replace("{command}","unlock")),t),null===(r=this.privConversationRecognizer)||void 0===r||r.sendRequest(this.getLockCommand(!1),(function(){n.handleCallback(e,t)}),(function(e){n.handleError(e,t)}))}catch(e){this.handleError(e,t)}},t.prototype.unmuteAllParticipantsAsync=function(e,t){var r,n=this;try{p.Contracts.throwIfDisposed(this.privIsDisposed),p.Contracts.throwIfDisposed(this.privConversationRecognizer.isDisposed()),p.Contracts.throwIfNullOrUndefined(this.privRoom,this.privErrors.permissionDeniedSend),this.canSendAsHost||this.handleError(new Error(this.privErrors.permissionDeniedConversation.replace("{command}","unmute all")),t),null===(r=this.privConversationRecognizer)||void 0===r||r.sendRequest(this.getMuteAllCommand(!1),(function(){n.handleCallback(e,t)}),(function(e){n.handleError(e,t)}))}catch(e){this.handleError(e,t)}},t.prototype.unmuteParticipantAsync=function(e,t,r){var n,o=this;try{p.Contracts.throwIfDisposed(this.privIsDisposed),p.Contracts.throwIfDisposed(this.privConversationRecognizer.isDisposed()),p.Contracts.throwIfNullOrWhitespace(e,this.privErrors.invalidArgs.replace("{arg}","userId")),p.Contracts.throwIfNullOrUndefined(this.privRoom,this.privErrors.permissionDeniedSend),this.canSend||this.handleError(new Error(this.privErrors.permissionDeniedSend),r),this.me.isHost||this.me.id===e||this.handleError(new Error(this.privErrors.permissionDeniedParticipant.replace("{command}","mute")),r),-1===this.privParticipants.getParticipantIndex(e)&&this.handleError(new Error(this.privErrors.invalidParticipantRequest),r),null===(n=this.privConversationRecognizer)||void 0===n||n.sendRequest(this.getMuteCommand(e,!1),(function(){o.handleCallback(t,r)}),(function(e){o.handleError(e,r)}))}catch(e){this.handleError(e,r)}},t.prototype.sendTextMessageAsync=function(e,t,r){var n,o=this;try{p.Contracts.throwIfDisposed(this.privIsDisposed),p.Contracts.throwIfDisposed(this.privConversationRecognizer.isDisposed()),p.Contracts.throwIfNullOrWhitespace(e,this.privErrors.invalidArgs.replace("{arg}","message")),p.Contracts.throwIfNullOrUndefined(this.privRoom,this.privErrors.permissionDeniedSend),this.canSend||this.handleError(new Error(this.privErrors.permissionDeniedSend),r),e.length>this.privTextMessageMaxLength&&this.handleError(new Error(this.privErrors.invalidArgs.replace("{arg}","message length")),r),null===(n=this.privConversationRecognizer)||void 0===n||n.sendRequest(this.getMessageCommand(e),(function(){o.handleCallback(t,r)}),(function(e){o.handleError(e,r)}))}catch(e){this.handleError(e,r)}},t.prototype.changeNicknameAsync=function(e,t,r){var n,o=this;try{p.Contracts.throwIfDisposed(this.privIsDisposed),p.Contracts.throwIfDisposed(this.privConversationRecognizer.isDisposed()),p.Contracts.throwIfNullOrWhitespace(e,this.privErrors.invalidArgs.replace("{arg}","nickname")),p.Contracts.throwIfNullOrUndefined(this.privRoom,this.privErrors.permissionDeniedSend),this.canSend||this.handleError(new Error(this.privErrors.permissionDeniedSend),r),null===(n=this.privConversationRecognizer)||void 0===n||n.sendRequest(this.getChangeNicknameCommand(e),(function(){o.handleCallback(t,r)}),(function(e){o.handleError(e,r)}))}catch(e){this.handleError(e,r)}},t.prototype.isDisposed=function(){return this.privIsDisposed},t.prototype.dispose=function(e){var t;this.isDisposed||(this.privIsDisposed=!0,null===(t=this.config)||void 0===t||t.close(),this.privConfig=void 0,this.privLanguage=void 0,this.privProperties=void 0,this.privRoom=void 0,this.privToken=void 0,this.privManager=void 0,this.privConversationRecognizer=void 0,this.privIsConnected=!1,this.privIsReady=!1,this.privParticipants=void 0)},Object.defineProperty(t.prototype,"transcriberRecognizer",{get:function(){return this.privTranscriberRecognizer},enumerable:!1,configurable:!0}),t.prototype.connectTranscriberRecognizer=function(e){return i(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return this.privTranscriberRecognizer?[4,this.privTranscriberRecognizer.close()]:[3,2];case 1:t.sent(),t.label=2;case 2:return this.privTranscriberRecognizer=e,this.privTranscriberRecognizer.conversation=this,[2]}}))}))},Object.defineProperty(t.prototype,"conversationInfo",{get:function(){for(var e=this.conversationId,t=this.participants.map((function(e){return{id:e.id,preferredLanguage:e.preferredLanguage,voice:e.voice}})),r={},n=0,o=c.ConversationConnectionConfig.transcriptionEventKeys;n<o.length;n++){var i=o[n],s=this.properties.getProperty(i,"");""!==s&&(r[i]=s)}return{id:e,participants:t,conversationProperties:r}},enumerable:!1,configurable:!0}),t.prototype.addParticipantImplAsync=function(e){if(void 0!==this.privParticipants.addOrUpdateParticipant(e)&&this.privTranscriberRecognizer){var t=this.conversationInfo;return t.participants=[e],this.privTranscriberRecognizer.pushConversationEvent(t,"join")}},t.prototype.removeParticipantImplAsync=function(e){this.privParticipants.deleteParticipant(e.id);var t=this.conversationInfo;return t.participants=[e],this.privTranscriberRecognizer.pushConversationEvent(t,"leave")},t.prototype.close=function(e){var t,r;return i(this,void 0,void 0,(function(){return s(this,(function(n){switch(n.label){case 0:return n.trys.push([0,3,,4]),this.privIsConnected=!1,[4,this.privConversationRecognizer.close()];case 1:return n.sent(),[4,null===(t=this.privTranscriberRecognizer)||void 0===t?void 0:t.close()];case 2:return n.sent(),this.privConversationRecognizer=void 0,null===(r=this.privConversationTranslator)||void 0===r||r.dispose(),[3,4];case 3:return n.sent(),[3,4];case 4:return e&&this.dispose(),[2]}}))}))},Object.defineProperty(t.prototype,"canSend",{get:function(){var e;return this.privIsConnected&&!(null===(e=this.privParticipants.me)||void 0===e?void 0:e.isMuted)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"canSendAsHost",{get:function(){var e;return this.privIsConnected&&(null===(e=this.privParticipants.me)||void 0===e?void 0:e.isHost)},enumerable:!1,configurable:!0}),t.prototype.handleCallback=function(e,t){if(e){try{e()}catch(e){t&&t(e)}e=void 0}},t.prototype.handleError=function(e,t){if(t)if(e instanceof Error){var r=e;t(r.name+": "+r.message)}else t(e)},t.prototype.toParticipants=function(e){var t=this,r=this.privParticipants.participants.map((function(e){return t.toParticipant(e)}));return e?r:r.filter((function(e){return!1===e.isHost}))},t.prototype.toParticipant=function(e){return new l.Participant(e.id,e.avatar,e.displayName,e.isHost,e.isMuted,e.isUsingTts,e.preferredLanguage,e.voice)},t.prototype.getMuteAllCommand=function(e){return p.Contracts.throwIfNullOrWhitespace(this.privRoom.roomId,"conversationId"),p.Contracts.throwIfNullOrWhitespace(this.privRoom.participantId,"participantId"),JSON.stringify({command:c.ConversationTranslatorCommandTypes.setMuteAll,participantId:this.privRoom.participantId,roomid:this.privRoom.roomId,type:c.ConversationTranslatorMessageTypes.participantCommand,value:e})},t.prototype.getMuteCommand=function(e,t){return p.Contracts.throwIfNullOrWhitespace(this.privRoom.roomId,"conversationId"),p.Contracts.throwIfNullOrWhitespace(e,"participantId"),JSON.stringify({command:c.ConversationTranslatorCommandTypes.setMute,participantId:e,roomid:this.privRoom.roomId,type:c.ConversationTranslatorMessageTypes.participantCommand,value:t})},t.prototype.getLockCommand=function(e){return p.Contracts.throwIfNullOrWhitespace(this.privRoom.roomId,"conversationId"),p.Contracts.throwIfNullOrWhitespace(this.privRoom.participantId,"participantId"),JSON.stringify({command:c.ConversationTranslatorCommandTypes.setLockState,participantId:this.privRoom.participantId,roomid:this.privRoom.roomId,type:c.ConversationTranslatorMessageTypes.participantCommand,value:e})},t.prototype.getEjectCommand=function(e){return p.Contracts.throwIfNullOrWhitespace(this.privRoom.roomId,"conversationId"),p.Contracts.throwIfNullOrWhitespace(e,"participantId"),JSON.stringify({command:c.ConversationTranslatorCommandTypes.ejectParticipant,participantId:e,roomid:this.privRoom.roomId,type:c.ConversationTranslatorMessageTypes.participantCommand})},t.prototype.getChangeNicknameCommand=function(e){return p.Contracts.throwIfNullOrWhitespace(this.privRoom.roomId,"conversationId"),p.Contracts.throwIfNullOrWhitespace(e,"nickname"),p.Contracts.throwIfNullOrWhitespace(this.privRoom.participantId,"participantId"),JSON.stringify({command:c.ConversationTranslatorCommandTypes.changeNickname,nickname:e,participantId:this.privRoom.participantId,roomid:this.privRoom.roomId,type:c.ConversationTranslatorMessageTypes.participantCommand,value:e})},t.prototype.getMessageCommand=function(e){return p.Contracts.throwIfNullOrWhitespace(this.privRoom.roomId,"conversationId"),p.Contracts.throwIfNullOrWhitespace(this.privRoom.participantId,"participantId"),p.Contracts.throwIfNullOrWhitespace(e,"message"),JSON.stringify({participantId:this.privRoom.participantId,roomId:this.privRoom.roomId,text:e,type:c.ConversationTranslatorMessageTypes.instantMessage})},t}(f);t.ConversationImpl=h},4599:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ConversationCommon=void 0;var r=function(){function e(e){this.privAudioConfig=e}return e.prototype.handleCallback=function(e,t){if(e){try{e()}catch(e){t&&t(e)}e=void 0}},e.prototype.handleError=function(e,t){if(t)if(e instanceof Error){var r=e;t(r.name+": "+r.message)}else t(e)},e}();t.ConversationCommon=r},3884:function(e,t,r){"use strict";var n,o=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},n(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.ConversationExpirationEventArgs=void 0;var i=function(e){function t(t,r){var n=e.call(this,r)||this;return n.privExpirationTime=t,n}return o(t,e),Object.defineProperty(t.prototype,"expirationTime",{get:function(){return this.privExpirationTime},enumerable:!1,configurable:!0}),t}(r(9480).SessionEventArgs);t.ConversationExpirationEventArgs=i},6236:function(e,t,r){"use strict";var n,o=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},n(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.ConversationParticipantsChangedEventArgs=void 0;var i=function(e){function t(t,r,n){var o=e.call(this,n)||this;return o.privReason=t,o.privParticipant=r,o}return o(t,e),Object.defineProperty(t.prototype,"reason",{get:function(){return this.privReason},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"participants",{get:function(){return this.privParticipant},enumerable:!1,configurable:!0}),t}(r(9480).SessionEventArgs);t.ConversationParticipantsChangedEventArgs=i},1892:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function s(e){try{c(n.next(e))}catch(e){i(e)}}function a(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var r,n,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,n=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.ConversationTranscriber=void 0;var i=r(21),s=r(2370),a=r(7348),c=r(9480),u=function(){function e(e){this.privAudioConfig=e,this.privProperties=new c.PropertyCollection,this.privRecognizer=void 0,this.privDisposedRecognizer=!1}return e.prototype.joinConversationAsync=function(e,t,r){var n=e;a.Contracts.throwIfNullOrUndefined(n,"Conversation"),this.privRecognizer=new i.TranscriberRecognizer(e.config,this.privAudioConfig),a.Contracts.throwIfNullOrUndefined(this.privRecognizer,"Recognizer"),this.privRecognizer.connectCallbacks(this),s.marshalPromiseToCallbacks(n.connectTranscriberRecognizer(this.privRecognizer),t,r)},Object.defineProperty(e.prototype,"authorizationToken",{get:function(){return this.properties.getProperty(c.PropertyId.SpeechServiceAuthorization_Token)},set:function(e){a.Contracts.throwIfNullOrWhitespace(e,"token"),this.properties.setProperty(c.PropertyId.SpeechServiceAuthorization_Token,e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"speechRecognitionLanguage",{get:function(){return a.Contracts.throwIfDisposed(this.privDisposedRecognizer),this.properties.getProperty(c.PropertyId.SpeechServiceConnection_RecoLanguage)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"properties",{get:function(){return this.privProperties},enumerable:!1,configurable:!0}),e.prototype.startTranscribingAsync=function(e,t){this.privRecognizer.startContinuousRecognitionAsync(e,t)},e.prototype.stopTranscribingAsync=function(e,t){this.privRecognizer.stopContinuousRecognitionAsync(e,t)},e.prototype.leaveConversationAsync=function(e,t){this.privRecognizer.disconnectCallbacks(),s.marshalPromiseToCallbacks(n(this,void 0,void 0,(function(){return o(this,(function(e){return[2]}))})),e,t)},e.prototype.close=function(e,t){a.Contracts.throwIfDisposed(this.privDisposedRecognizer),s.marshalPromiseToCallbacks(this.dispose(!0),e,t)},e.prototype.dispose=function(e){return n(this,void 0,void 0,(function(){return o(this,(function(t){return this.privDisposedRecognizer||e&&(this.privDisposedRecognizer=!0),[2]}))}))},e}();t.ConversationTranscriber=u},1147:function(e,t,r){"use strict";var n,o=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},n(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.ConversationTranslationCanceledEventArgs=void 0;var i=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o(t,e),t}(r(762).CancellationEventArgsBase);t.ConversationTranslationCanceledEventArgs=i},2686:function(e,t,r){"use strict";var n,o=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},n(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.ConversationTranslationEventArgs=void 0;var i=function(e){function t(t,r,n){var o=e.call(this,r,n)||this;return o.privResult=t,o}return o(t,e),Object.defineProperty(t.prototype,"result",{get:function(){return this.privResult},enumerable:!1,configurable:!0}),t}(r(9480).RecognitionEventArgs);t.ConversationTranslationEventArgs=i},6396:function(e,t,r){"use strict";var n,o=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},n(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.ConversationTranslationResult=void 0;var i=function(e){function t(t,r,n,o,i,s,a,c,u,p,l){var f=e.call(this,r,o,i,s,a,c,u,p,l)||this;return f.privId=t,f.privOrigLang=n,f}return o(t,e),Object.defineProperty(t.prototype,"participantId",{get:function(){return this.privId},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"originalLang",{get:function(){return this.privOrigLang},enumerable:!1,configurable:!0}),t}(r(2765).TranslationRecognitionResult);t.ConversationTranslationResult=i},8066:function(e,t,r){"use strict";var n,o=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},n(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),i=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function s(e){try{c(n.next(e))}catch(e){i(e)}}function a(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))},s=this&&this.__generator||function(e,t){var r,n,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,n=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.ConversationTranslator=t.SpeechState=void 0;var a,c=r(21),u=r(2370),p=r(7348),l=r(9480),f=r(8394),h=r(4477);!function(e){e[e.Inactive=0]="Inactive",e[e.Connecting=1]="Connecting",e[e.Connected=2]="Connected"}(a=t.SpeechState||(t.SpeechState={}));var v=function(e){function t(t,r,n){var o=e.call(this,t,r)||this;return o.privSpeechState=a.Inactive,n&&(o.privTranslator=n,o.sessionStarted=function(){o.privSpeechState=a.Connected},o.sessionStopped=function(){o.privSpeechState=a.Inactive},o.recognized=function(e,t){return i(o,void 0,void 0,(function(){var e;return s(this,(function(r){switch(r.label){case 0:return(null===(e=t.result)||void 0===e?void 0:e.errorDetails)?[4,this.cancelSpeech()]:[3,2];case 1:r.sent(),this.fireCancelEvent(t.result.errorDetails),r.label=2;case 2:return[2]}}))}))},o.canceled=function(e,t){return i(o,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:if(this.privSpeechState===a.Inactive)return[3,4];e.label=1;case 1:return e.trys.push([1,3,,4]),[4,this.cancelSpeech()];case 2:return e.sent(),[3,4];case 3:return e.sent(),this.privSpeechState=a.Inactive,[3,4];case 4:return[2]}}))}))}),o}return o(t,e),Object.defineProperty(t.prototype,"state",{get:function(){return this.privSpeechState},set:function(e){this.privSpeechState=e},enumerable:!1,configurable:!0}),t.prototype.onConnection=function(){this.privSpeechState=a.Connected},t.prototype.onDisconnection=function(){return i(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return this.privSpeechState=a.Inactive,[4,this.cancelSpeech()];case 1:return e.sent(),[2]}}))}))},t.prototype.fireCancelEvent=function(e){var t,r,n;try{if(this.privTranslator.canceled){var o=new h.ConversationTranslationCanceledEventArgs(null!==(t=null==e?void 0:e.reason)&&void 0!==t?t:l.CancellationReason.Error,null!==(r=null==e?void 0:e.errorDetails)&&void 0!==r?r:e,null!==(n=null==e?void 0:e.errorCode)&&void 0!==n?n:l.CancellationErrorCode.RuntimeError,void 0,null==e?void 0:e.sessionId);this.privTranslator.canceled(this.privTranslator,o)}}catch(e){}},t.prototype.cancelSpeech=function(){var e;return i(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),this.stopContinuousRecognitionAsync(),[4,null===(e=this.privReco)||void 0===e?void 0:e.disconnect()];case 1:return t.sent(),this.privSpeechState=a.Inactive,[3,3];case 2:return t.sent(),[3,3];case 3:return[2]}}))}))},t}(l.TranslationRecognizer),d=function(e){function t(t){var r=e.call(this,t)||this;return r.privIsDisposed=!1,r.privIsSpeaking=!1,r.privErrors=c.ConversationConnectionConfig.restErrors,r.privPlaceholderKey="abcdefghijklmnopqrstuvwxyz012345",r.privPlaceholderRegion="westus",r.privProperties=new l.PropertyCollection,r}return o(t,e),Object.defineProperty(t.prototype,"properties",{get:function(){return this.privProperties},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"speechRecognitionLanguage",{get:function(){return this.privSpeechRecognitionLanguage},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"participants",{get:function(){var e;return null===(e=this.privConversation)||void 0===e?void 0:e.participants},enumerable:!1,configurable:!0}),t.prototype.joinConversationAsync=function(e,t,r,n,o){var i=this;try{if("string"==typeof e){p.Contracts.throwIfNullOrUndefined(e,this.privErrors.invalidArgs.replace("{arg}","conversation id")),p.Contracts.throwIfNullOrWhitespace(t,this.privErrors.invalidArgs.replace("{arg}","nickname")),this.privConversation&&this.handleError(new Error(this.privErrors.permissionDeniedStart),o);var s=r;null!=s&&""!==s||(s=c.ConversationConnectionConfig.defaultLanguageCode),this.privSpeechTranslationConfig=l.SpeechTranslationConfig.fromSubscription(this.privPlaceholderKey,this.privPlaceholderRegion),this.privSpeechTranslationConfig.setProfanity(l.ProfanityOption.Masked),this.privSpeechTranslationConfig.addTargetLanguage(s),this.privSpeechTranslationConfig.setProperty(l.PropertyId[l.PropertyId.SpeechServiceConnection_RecoLanguage],s),this.privSpeechTranslationConfig.setProperty(l.PropertyId[l.PropertyId.ConversationTranslator_Name],t);var a=this.privProperties.getProperty(l.PropertyId.ConversationTranslator_Host);a&&this.privSpeechTranslationConfig.setProperty(l.PropertyId[l.PropertyId.ConversationTranslator_Host],a);var u=this.privProperties.getProperty(l.PropertyId.SpeechServiceConnection_Host);u&&this.privSpeechTranslationConfig.setProperty(l.PropertyId[l.PropertyId.SpeechServiceConnection_Host],u),this.privConversation=new f.ConversationImpl(this.privSpeechTranslationConfig),this.privConversation.conversationTranslator=this,this.privConversation.joinConversationAsync(e,t,s,(function(e){e||i.handleError(new Error(i.privErrors.permissionDeniedConnect),o),i.privSpeechTranslationConfig.authorizationToken=e,i.privConversation.startConversationAsync((function(){i.handleCallback(n,o)}),(function(e){i.handleError(e,o)}))}),(function(e){i.handleError(e,o)}))}else"object"==typeof e?(p.Contracts.throwIfNullOrUndefined(e,this.privErrors.invalidArgs.replace("{arg}","conversation id")),p.Contracts.throwIfNullOrWhitespace(t,this.privErrors.invalidArgs.replace("{arg}","nickname")),this.privProperties.setProperty(l.PropertyId.ConversationTranslator_Name,t),this.privConversation=e,this.privConversation.conversationTranslator=this,p.Contracts.throwIfNullOrUndefined(this.privConversation,this.privErrors.permissionDeniedConnect),p.Contracts.throwIfNullOrUndefined(this.privConversation.room.token,this.privErrors.permissionDeniedConnect),this.privSpeechTranslationConfig=e.config,this.handleCallback(r,n)):this.handleError(new Error(this.privErrors.invalidArgs.replace("{arg}","invalid conversation type")),n)}catch(e){this.handleError(e,"string"==typeof r?o:n)}},t.prototype.leaveConversationAsync=function(e,t){u.marshalPromiseToCallbacks(i(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.cancelSpeech()];case 1:return e.sent(),[4,this.privConversation.endConversationImplAsync()];case 2:return e.sent(),[4,this.privConversation.deleteConversationImplAsync()];case 3:return e.sent(),this.dispose(),[2]}}))})),e,t)},t.prototype.sendTextMessageAsync=function(e,t,r){var n;try{p.Contracts.throwIfNullOrUndefined(this.privConversation,this.privErrors.permissionDeniedSend),p.Contracts.throwIfNullOrWhitespace(e,this.privErrors.invalidArgs.replace("{arg}",e)),null===(n=this.privConversation)||void 0===n||n.sendTextMessageAsync(e,t,r)}catch(e){this.handleError(e,r)}},t.prototype.startTranscribingAsync=function(e,t){u.marshalPromiseToCallbacks(i(this,void 0,void 0,(function(){var e;return s(this,(function(r){switch(r.label){case 0:return r.trys.push([0,4,,6]),p.Contracts.throwIfNullOrUndefined(this.privConversation,this.privErrors.permissionDeniedSend),p.Contracts.throwIfNullOrUndefined(this.privConversation.room.token,this.privErrors.permissionDeniedConnect),void 0!==this.privCTRecognizer?[3,2]:[4,this.connectTranslatorRecognizer()];case 1:r.sent(),r.label=2;case 2:return p.Contracts.throwIfNullOrUndefined(this.privCTRecognizer,this.privErrors.permissionDeniedSend),this.canSpeak||this.handleError(new Error(this.privErrors.permissionDeniedSend),t),[4,this.startContinuousRecognition()];case 3:return r.sent(),this.privIsSpeaking=!0,[3,6];case 4:return e=r.sent(),this.privIsSpeaking=!1,[4,this.cancelSpeech()];case 5:throw r.sent(),e;case 6:return[2]}}))})),e,t)},t.prototype.stopTranscribingAsync=function(e,t){u.marshalPromiseToCallbacks(i(this,void 0,void 0,(function(){var e=this;return s(this,(function(t){switch(t.label){case 0:return t.trys.push([0,4,,6]),this.privIsSpeaking?[3,2]:[4,this.cancelSpeech()];case 1:return t.sent(),[2];case 2:return this.privIsSpeaking=!1,[4,new Promise((function(t,r){var n;null===(n=e.privCTRecognizer)||void 0===n||n.stopContinuousRecognitionAsync(t,r)}))];case 3:case 5:return t.sent(),[3,6];case 4:return t.sent(),[4,this.cancelSpeech()];case 6:return[2]}}))})),e,t)},t.prototype.isDisposed=function(){return this.privIsDisposed},t.prototype.dispose=function(e,t,r){u.marshalPromiseToCallbacks(i(this,void 0,void 0,(function(){var e,t;return s(this,(function(r){switch(r.label){case 0:return this.isDisposed&&!this.privIsSpeaking?[2]:[4,this.cancelSpeech()];case 1:return r.sent(),this.privIsDisposed=!0,null===(e=this.privSpeechTranslationConfig)||void 0===e||e.close(),this.privSpeechRecognitionLanguage=void 0,this.privProperties=void 0,this.privAudioConfig=void 0,this.privSpeechTranslationConfig=void 0,null===(t=this.privConversation)||void 0===t||t.dispose(),this.privConversation=void 0,[2]}}))})),t,r)},t.prototype.cancelSpeech=function(){var e;return i(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),this.privIsSpeaking=!1,[4,null===(e=this.privCTRecognizer)||void 0===e?void 0:e.onDisconnection()];case 1:return t.sent(),this.privCTRecognizer=void 0,[3,3];case 2:return t.sent(),[3,3];case 3:return[2]}}))}))},t.prototype.connectTranslatorRecognizer=function(){return i(this,void 0,void 0,(function(){var e,t,r,n;return s(this,(function(o){switch(o.label){case 0:return o.trys.push([0,1,,3]),void 0===this.privAudioConfig&&(this.privAudioConfig=l.AudioConfig.fromDefaultMicrophoneInput()),this.privSpeechTranslationConfig.getProperty(l.PropertyId[l.PropertyId.SpeechServiceConnection_Key])===this.privPlaceholderKey&&this.privSpeechTranslationConfig.setProperty(l.PropertyId[l.PropertyId.SpeechServiceConnection_Key],""),e=encodeURIComponent(this.privConversation.room.token),t=(t=this.privSpeechTranslationConfig.getProperty(l.PropertyId[l.PropertyId.SpeechServiceConnection_Host],c.ConversationConnectionConfig.speechHost)).replace("{region}",this.privConversation.room.cognitiveSpeechRegion),r="wss://"+t+c.ConversationConnectionConfig.speechPath+"?"+c.ConversationConnectionConfig.configParams.token+"="+e,this.privSpeechTranslationConfig.setProperty(l.PropertyId[l.PropertyId.SpeechServiceConnection_Endpoint],r),this.privCTRecognizer=new v(this.privSpeechTranslationConfig,this.privAudioConfig,this),[3,3];case 1:return n=o.sent(),[4,this.cancelSpeech()];case 2:throw o.sent(),n;case 3:return[2]}}))}))},t.prototype.startContinuousRecognition=function(){var e=this;return new Promise((function(t,r){e.privCTRecognizer.startContinuousRecognitionAsync(t,r)}))},Object.defineProperty(t.prototype,"canSpeak",{get:function(){return!(!this.privConversation.isConnected||!this.privCTRecognizer||this.privIsSpeaking||this.privCTRecognizer.state===a.Connected||this.privCTRecognizer.state===a.Connecting||this.privConversation.isMutedByHost)},enumerable:!1,configurable:!0}),t}(h.ConversationCommon);t.ConversationTranslator=d},4477:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(8394);Object.defineProperty(t,"Conversation",{enumerable:!0,get:function(){return n.Conversation}}),Object.defineProperty(t,"ConversationImpl",{enumerable:!0,get:function(){return n.ConversationImpl}});var o=r(4599);Object.defineProperty(t,"ConversationCommon",{enumerable:!0,get:function(){return o.ConversationCommon}});var i=r(3884);Object.defineProperty(t,"ConversationExpirationEventArgs",{enumerable:!0,get:function(){return i.ConversationExpirationEventArgs}});var s=r(6236);Object.defineProperty(t,"ConversationParticipantsChangedEventArgs",{enumerable:!0,get:function(){return s.ConversationParticipantsChangedEventArgs}});var a=r(1147);Object.defineProperty(t,"ConversationTranslationCanceledEventArgs",{enumerable:!0,get:function(){return a.ConversationTranslationCanceledEventArgs}});var c=r(2686);Object.defineProperty(t,"ConversationTranslationEventArgs",{enumerable:!0,get:function(){return c.ConversationTranslationEventArgs}});var u=r(6396);Object.defineProperty(t,"ConversationTranslationResult",{enumerable:!0,get:function(){return u.ConversationTranslationResult}});var p=r(8066);Object.defineProperty(t,"ConversationTranslator",{enumerable:!0,get:function(){return p.ConversationTranslator}});var l=r(1892);Object.defineProperty(t,"ConversationTranscriber",{enumerable:!0,get:function(){return l.ConversationTranscriber}});var f=r(1164);Object.defineProperty(t,"Participant",{enumerable:!0,get:function(){return f.Participant}}),Object.defineProperty(t,"User",{enumerable:!0,get:function(){return f.User}});var h=r(1776);Object.defineProperty(t,"ParticipantChangedReason",{enumerable:!0,get:function(){return h.ParticipantChangedReason}})},1164:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Participant=t.User=void 0;var n=r(9480),o=function(){function e(e){this.privUserId=e}return Object.defineProperty(e.prototype,"userId",{get:function(){return this.privUserId},enumerable:!1,configurable:!0}),e}();t.User=o;var i=function(){function e(e,t,r,o,i,s,a,c){this.privId=e,this.privAvatar=t,this.privDisplayName=r,this.privIsHost=o,this.privIsMuted=i,this.privIsUsingTts=s,this.privPreferredLanguage=a,this.privVoice=c,this.privProperties=new n.PropertyCollection}return e.From=function(t,r,n){return new e(t,"",t,!1,!1,!1,r,n)},Object.defineProperty(e.prototype,"avatar",{get:function(){return this.privAvatar},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"displayName",{get:function(){return this.privDisplayName},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"id",{get:function(){return this.privId},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"preferredLanguage",{get:function(){return this.privPreferredLanguage},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isHost",{get:function(){return this.privIsHost},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isMuted",{get:function(){return this.privIsMuted},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isUsingTts",{get:function(){return this.privIsUsingTts},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"voice",{get:function(){return this.privVoice},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"properties",{get:function(){return this.privProperties},enumerable:!1,configurable:!0}),e}();t.Participant=i},1776:function(e,t){"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.ParticipantChangedReason=void 0,(r=t.ParticipantChangedReason||(t.ParticipantChangedReason={}))[r.JoinedConversation=0]="JoinedConversation",r[r.LeftConversation=1]="LeftConversation",r[r.Updated=2]="Updated"},8450:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TranslationRecognitionCanceledEventArgs=void 0;var r=function(){function e(e,t,r,n,o){this.privCancelReason=t,this.privErrorDetails=r,this.privResult=o,this.privSessionId=e,this.privErrorCode=n}return Object.defineProperty(e.prototype,"result",{get:function(){return this.privResult},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"sessionId",{get:function(){return this.privSessionId},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"reason",{get:function(){return this.privCancelReason},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"errorCode",{get:function(){return this.privErrorCode},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"errorDetails",{get:function(){return this.privErrorDetails},enumerable:!1,configurable:!0}),e}();t.TranslationRecognitionCanceledEventArgs=r},7773:function(e,t,r){"use strict";var n,o=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},n(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.TranslationRecognitionEventArgs=void 0;var i=function(e){function t(t,r,n){var o=e.call(this,r,n)||this;return o.privResult=t,o}return o(t,e),Object.defineProperty(t.prototype,"result",{get:function(){return this.privResult},enumerable:!1,configurable:!0}),t}(r(9480).RecognitionEventArgs);t.TranslationRecognitionEventArgs=i},2765:function(e,t,r){"use strict";var n,o=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},n(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.TranslationRecognitionResult=void 0;var i=function(e){function t(t,r,n,o,i,s,a,c,u){var p=e.call(this,r,n,o,i,s,void 0,void 0,void 0,a,c,u)||this;return p.privTranslations=t,p}return o(t,e),Object.defineProperty(t.prototype,"translations",{get:function(){return this.privTranslations},enumerable:!1,configurable:!0}),t}(r(9480).SpeechRecognitionResult);t.TranslationRecognitionResult=i},7063:function(e,t,r){"use strict";var n,o=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},n(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),i=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function s(e){try{c(n.next(e))}catch(e){i(e)}}function a(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))},s=this&&this.__generator||function(e,t){var r,n,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,n=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.TranslationRecognizer=void 0;var a=r(21),c=r(2370),u=r(7348),p=r(9480),l=function(e){function t(t,r){var n=this,o=t;return u.Contracts.throwIfNull(o,"speechConfig"),(n=e.call(this,r,o.properties,new a.TranslationConnectionFactory)||this).privDisposedTranslationRecognizer=!1,n.privProperties=o.properties.clone(),void 0!==n.properties.getProperty(p.PropertyId.SpeechServiceConnection_TranslationVoice,void 0)&&u.Contracts.throwIfNullOrWhitespace(n.properties.getProperty(p.PropertyId.SpeechServiceConnection_TranslationVoice),p.PropertyId[p.PropertyId.SpeechServiceConnection_TranslationVoice]),u.Contracts.throwIfNullOrWhitespace(n.properties.getProperty(p.PropertyId.SpeechServiceConnection_TranslationToLanguages),p.PropertyId[p.PropertyId.SpeechServiceConnection_TranslationToLanguages]),u.Contracts.throwIfNullOrWhitespace(n.properties.getProperty(p.PropertyId.SpeechServiceConnection_RecoLanguage),p.PropertyId[p.PropertyId.SpeechServiceConnection_RecoLanguage]),n}return o(t,e),Object.defineProperty(t.prototype,"speechRecognitionLanguage",{get:function(){return u.Contracts.throwIfDisposed(this.privDisposedTranslationRecognizer),this.properties.getProperty(p.PropertyId.SpeechServiceConnection_RecoLanguage)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"targetLanguages",{get:function(){return u.Contracts.throwIfDisposed(this.privDisposedTranslationRecognizer),this.properties.getProperty(p.PropertyId.SpeechServiceConnection_TranslationToLanguages).split(",")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"voiceName",{get:function(){return u.Contracts.throwIfDisposed(this.privDisposedTranslationRecognizer),this.properties.getProperty(p.PropertyId.SpeechServiceConnection_TranslationVoice,void 0)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"authorizationToken",{get:function(){return this.properties.getProperty(p.PropertyId.SpeechServiceAuthorization_Token)},set:function(e){this.properties.setProperty(p.PropertyId.SpeechServiceAuthorization_Token,e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"properties",{get:function(){return this.privProperties},enumerable:!1,configurable:!0}),t.prototype.recognizeOnceAsync=function(e,t){u.Contracts.throwIfDisposed(this.privDisposedTranslationRecognizer),c.marshalPromiseToCallbacks(this.recognizeOnceAsyncImpl(a.RecognitionMode.Conversation),e,t)},t.prototype.startContinuousRecognitionAsync=function(e,t){c.marshalPromiseToCallbacks(this.startContinuousRecognitionAsyncImpl(a.RecognitionMode.Conversation),e,t)},t.prototype.stopContinuousRecognitionAsync=function(e,t){c.marshalPromiseToCallbacks(this.stopContinuousRecognitionAsyncImpl(),e,t)},t.prototype.close=function(e,t){u.Contracts.throwIfDisposed(this.privDisposedTranslationRecognizer),c.marshalPromiseToCallbacks(this.dispose(!0),e,t)},t.prototype.onConnection=function(){},t.prototype.onDisconnection=function(){return i(this,void 0,void 0,(function(){return s(this,(function(e){return[2]}))}))},t.prototype.dispose=function(t){return i(this,void 0,void 0,(function(){return s(this,(function(r){switch(r.label){case 0:return this.privDisposedTranslationRecognizer?[2]:(this.privDisposedTranslationRecognizer=!0,t?[4,this.implRecognizerStop()]:[3,3]);case 1:return r.sent(),[4,e.prototype.dispose.call(this,t)];case 2:r.sent(),r.label=3;case 3:return[2]}}))}))},t.prototype.createRecognizerConfig=function(e){return new a.RecognizerConfig(e,this.properties)},t.prototype.createServiceRecognizer=function(e,t,r,n){var o=r;return new a.TranslationServiceRecognizer(e,t,o,n,this)},t}(p.Recognizer);t.TranslationRecognizer=l},634:function(e,t,r){"use strict";var n,o=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},n(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.TranslationSynthesisEventArgs=void 0;var i=function(e){function t(t,r){var n=e.call(this,r)||this;return n.privResult=t,n}return o(t,e),Object.defineProperty(t.prototype,"result",{get:function(){return this.privResult},enumerable:!1,configurable:!0}),t}(r(9480).SessionEventArgs);t.TranslationSynthesisEventArgs=i},2834:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TranslationSynthesisResult=void 0;var r=function(){function e(e,t){this.privReason=e,this.privAudio=t}return Object.defineProperty(e.prototype,"audio",{get:function(){return this.privAudio},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"reason",{get:function(){return this.privReason},enumerable:!1,configurable:!0}),e}();t.TranslationSynthesisResult=r},7810:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Translations=void 0;var n=r(9480),o=function(){function e(){this.privMap=new n.PropertyCollection}return e.prototype.get=function(e,t){return this.privMap.getProperty(e,t)},e.prototype.set=function(e,t){this.privMap.setProperty(e,t)},e}();t.Translations=o},3234:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TurnStatusReceivedEventArgs=void 0;var n=r(6597),o=function(){function e(e){this.privTurnStatus=n.TurnStatusResponsePayload.fromJSON(e)}return Object.defineProperty(e.prototype,"interactionId",{get:function(){return this.privTurnStatus.interactionId},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"conversationId",{get:function(){return this.privTurnStatus.conversationId},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"statusCode",{get:function(){return this.privTurnStatus.statusCode},enumerable:!1,configurable:!0}),e}();t.TurnStatusReceivedEventArgs=o},9714:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.VoiceProfile=void 0;var r=function(){function e(e,t){this.privId=e,this.privProfileType=t}return Object.defineProperty(e.prototype,"profileId",{get:function(){return this.privId},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"profileType",{get:function(){return this.privProfileType},enumerable:!1,configurable:!0}),e}();t.VoiceProfile=r},1875:function(e,t,r){"use strict";var n,o=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},n(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.VoiceProfileAuthorizationPhraseResult=void 0;var i=r(7348),s=function(e){function t(t,r,n){var o=e.call(this,t,r)||this;o.privPhrases=[],i.Contracts.throwIfNullOrUndefined(n,"phrases array");for(var s=0,a=n;s<a.length;s++){var c=a[s];o.privPhrases.push(c.passPhrase)}return o}return o(t,e),Object.defineProperty(t.prototype,"phrases",{get:function(){return this.privPhrases},enumerable:!1,configurable:!0}),t}(r(9480).VoiceProfileResult);t.VoiceProfileAuthorizationPhraseResult=s},2179:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function s(e){try{c(n.next(e))}catch(e){i(e)}}function a(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var r,n,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,n=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.VoiceProfileClient=void 0;var i=r(21),s=r(2370),a=r(7348),c=r(9480),u=function(){function e(e){var t=e;a.Contracts.throwIfNull(t,"speechConfig"),this.privProperties=t.properties.clone(),this.implClientSetup()}return Object.defineProperty(e.prototype,"authorizationToken",{get:function(){return this.properties.getProperty(c.PropertyId.SpeechServiceAuthorization_Token)},set:function(e){a.Contracts.throwIfNullOrWhitespace(e,"token"),this.properties.setProperty(c.PropertyId.SpeechServiceAuthorization_Token,e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"properties",{get:function(){return this.privProperties},enumerable:!1,configurable:!0}),e.prototype.createProfileAsync=function(e,t,r,i){s.marshalPromiseToCallbacks(n(this,void 0,void 0,(function(){var r,n;return o(this,(function(o){switch(o.label){case 0:return[4,this.privAdapter.createProfile(e,t)];case 1:return r=o.sent(),n=r.json(),[2,new c.VoiceProfile(n.profileId,e)]}}))})),r,i)},e.prototype.retrieveEnrollmentResultAsync=function(e,t,r){s.marshalPromiseToCallbacks(n(this,void 0,void 0,(function(){var t;return o(this,(function(r){switch(r.label){case 0:return[4,this.privAdapter.getProfileStatus(e)];case 1:return t=r.sent(),[2,new c.VoiceProfileEnrollmentResult(t.ok?c.ResultReason.EnrolledVoiceProfile:c.ResultReason.Canceled,t.data,t.statusText)]}}))})),t,r)},e.prototype.getAllProfilesAsync=function(e,t,r){s.marshalPromiseToCallbacks(n(this,void 0,void 0,(function(){var t;return o(this,(function(r){switch(r.label){case 0:return[4,this.privAdapter.getProfiles(e)];case 1:return t=r.sent(),e===c.VoiceProfileType.TextIndependentIdentification?[2,c.VoiceProfileEnrollmentResult.FromIdentificationProfileList(t.json())]:[2,c.VoiceProfileEnrollmentResult.FromVerificationProfileList(t.json())]}}))})),t,r)},e.prototype.getAuthorizationPhrasesAsync=function(e,t,r){s.marshalPromiseToCallbacks(n(this,void 0,void 0,(function(){var t;return o(this,(function(r){switch(r.label){case 0:return[4,this.privAdapter.getAuthorizationPhrases(e)];case 1:return t=r.sent(),[2,new c.VoiceProfileAuthorizationPhraseResult(t.ok?c.ResultReason.EnrollingVoiceProfile:c.ResultReason.Canceled,t.statusText,t.json())]}}))})),t,r)},e.prototype.enrollProfileAsync=function(e,t,r,i){var u=t;a.Contracts.throwIfNullOrUndefined(u,"audioConfig"),s.marshalPromiseToCallbacks(n(this,void 0,void 0,(function(){var t;return o(this,(function(r){switch(r.label){case 0:return[4,this.privAdapter.createEnrollment(e,u)];case 1:return t=r.sent(),[2,new c.VoiceProfileEnrollmentResult(t.ok?c.ResultReason.EnrolledVoiceProfile:c.ResultReason.Canceled,t.data,t.statusText)]}}))})),r,i)},e.prototype.deleteProfileAsync=function(e,t,r){s.marshalPromiseToCallbacks(n(this,void 0,void 0,(function(){var t;return o(this,(function(r){switch(r.label){case 0:return[4,this.privAdapter.deleteProfile(e)];case 1:return t=r.sent(),[2,this.getResult(t,c.ResultReason.DeletedVoiceProfile)]}}))})),t,r)},e.prototype.resetProfileAsync=function(e,t,r){s.marshalPromiseToCallbacks(n(this,void 0,void 0,(function(){var t;return o(this,(function(r){switch(r.label){case 0:return[4,this.privAdapter.resetProfile(e)];case 1:return t=r.sent(),[2,this.getResult(t,c.ResultReason.ResetVoiceProfile)]}}))})),t,r)},e.prototype.close=function(){},e.prototype.implClientSetup=function(){var e="undefined"!=typeof window?"Browser":"Node",t="unknown",r="unknown";"undefined"!=typeof navigator&&(e=e+"/"+navigator.platform,t=navigator.userAgent,r=navigator.appVersion);var n=new i.SpeakerRecognitionConfig(new i.Context(new i.OS(e,t,r)),this.privProperties);this.privAdapter=new i.SpeakerIdMessageAdapter(n)},e.prototype.getResult=function(e,t,r){return new c.VoiceProfileResult(e.ok?t:c.ResultReason.Canceled,e.statusText)},e}();t.VoiceProfileClient=u},1975:function(e,t,r){"use strict";var n,o=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},n(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.VoiceProfileEnrollmentCancellationDetails=t.VoiceProfileEnrollmentResult=void 0;var i=r(21),s=r(9480),a=function(){function e(e,t,r){this.privReason=e,this.privProperties=new s.PropertyCollection,this.privReason!==s.ResultReason.Canceled?t&&(this.privDetails=JSON.parse(t),"enrolling"===this.privDetails.enrollmentStatus.toLowerCase()&&(this.privReason=s.ResultReason.EnrollingVoiceProfile)):(this.privErrorDetails=r,this.privProperties.setProperty(i.CancellationErrorCodePropertyName,s.CancellationErrorCode[s.CancellationErrorCode.ServiceError]))}return e.FromIdentificationProfileList=function(t){for(var r=[],n=0,o=t.profiles;n<o.length;n++){var i=o[n],a=new e("enrolling"===i.enrollmentStatus.toLowerCase()?s.ResultReason.EnrollingVoiceProfile:"enrolled"===i.enrollmentStatus.toLowerCase()?s.ResultReason.EnrolledVoiceProfile:s.ResultReason.Canceled,null,null);a.privDetails=this.getIdentificationDetails(i),r.push(a)}return r},e.FromVerificationProfileList=function(t){for(var r=[],n=0,o=t.profiles;n<o.length;n++){var i=o[n],a=new e("enrolling"===i.enrollmentStatus.toLowerCase()?s.ResultReason.EnrollingVoiceProfile:"enrolled"===i.enrollmentStatus.toLowerCase()?s.ResultReason.EnrolledVoiceProfile:s.ResultReason.Canceled,null,null);a.privDetails=this.getVerificationDetails(i),r.push(a)}return r},Object.defineProperty(e.prototype,"reason",{get:function(){return this.privReason},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"enrollmentsCount",{get:function(){return this.privDetails.enrollmentsCount},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"enrollmentsLength",{get:function(){return this.privDetails.enrollmentsLength},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"properties",{get:function(){return this.privProperties},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"enrollmentResultDetails",{get:function(){return this.privDetails},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"errorDetails",{get:function(){return this.privErrorDetails},enumerable:!1,configurable:!0}),e.getIdentificationDetails=function(e){return{audioSpeechLength:e.speechTime?parseFloat(e.speechTime):0,enrollmentStatus:e.enrollmentStatus,enrollmentsLength:e.enrollmentSpeechTime?parseFloat(e.enrollmentSpeechTime):0,profileId:e.profileId||e.identificationProfileId,remainingEnrollmentSpeechLength:e.remainingEnrollmentSpeechTime?parseFloat(e.remainingEnrollmentSpeechTime):0}},e.getVerificationDetails=function(e){return{enrollmentStatus:e.enrollmentStatus,enrollmentsCount:e.enrollmentsCount,profileId:e.profileId||e.verificationProfileId,remainingEnrollmentSpeechLength:e.remainingEnrollmentSpeechLength?parseFloat(e.remainingEnrollmentSpeechLength):0,remainingEnrollmentsCount:e.remainingEnrollments||e.remainingEnrollmentsCount}},e}();t.VoiceProfileEnrollmentResult=a;var c=function(e){function t(t,r,n){return e.call(this,t,r,n)||this}return o(t,e),t.fromResult=function(e){var r=s.CancellationReason.Error,n=s.CancellationErrorCode.NoError;return e.properties&&(n=s.CancellationErrorCode[e.properties.getProperty(i.CancellationErrorCodePropertyName,s.CancellationErrorCode[s.CancellationErrorCode.NoError])]),new t(r,e.errorDetails,n)},t}(s.CancellationDetailsBase);t.VoiceProfileEnrollmentCancellationDetails=c},5780:function(e,t,r){"use strict";var n,o=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},n(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.VoiceProfileCancellationDetails=t.VoiceProfileResult=void 0;var i=r(21),s=r(7348),a=r(9480),c=function(){function e(e,t){this.privReason=e,this.privProperties=new a.PropertyCollection,e===a.ResultReason.Canceled&&(s.Contracts.throwIfNullOrUndefined(t,"statusText"),this.privErrorDetails=t,this.privProperties.setProperty(i.CancellationErrorCodePropertyName,a.CancellationErrorCode[a.CancellationErrorCode.ServiceError]))}return Object.defineProperty(e.prototype,"reason",{get:function(){return this.privReason},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"properties",{get:function(){return this.privProperties},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"errorDetails",{get:function(){return this.privErrorDetails},enumerable:!1,configurable:!0}),e}();t.VoiceProfileResult=c;var u=function(e){function t(t,r,n){return e.call(this,t,r,n)||this}return o(t,e),t.fromResult=function(e){var r=a.CancellationReason.Error,n=a.CancellationErrorCode.NoError;return e.properties&&(n=a.CancellationErrorCode[e.properties.getProperty(i.CancellationErrorCodePropertyName,a.CancellationErrorCode[a.CancellationErrorCode.NoError])]),new t(r,e.errorDetails,n)},t}(a.CancellationDetailsBase);t.VoiceProfileCancellationDetails=u},3764:function(e,t){"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.VoiceProfileType=void 0,(r=t.VoiceProfileType||(t.VoiceProfileType={}))[r.TextIndependentIdentification=0]="TextIndependentIdentification",r[r.TextDependentVerification=1]="TextDependentVerification",r[r.TextIndependentVerification=2]="TextIndependentVerification"},567:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;try{var r=e.call(t);return"function"==typeof r.then?new Promise((function(e){r.then(e,(function(){return e()}))})):r}catch(e){}},e.exports=t.default,e.exports.default=t.default},8892:function(e,t,r){"use strict";var n=(0,r(9201).default)(r(630));e.exports=function(){var e={};return e.promise=new n.default((function(t,r){e.resolve=t,e.reject=r})),e}},9699:function(e,t){"use strict";var r=Object.prototype.hasOwnProperty;function n(e){try{return decodeURIComponent(e.replace(/\+/g," "))}catch(e){return null}}function o(e){try{return encodeURIComponent(e)}catch(e){return null}}t.stringify=function(e,t){t=t||"";var n,i,s=[];for(i in"string"!=typeof t&&(t="?"),e)if(r.call(e,i)){if((n=e[i])||null!=n&&!isNaN(n)||(n=""),i=o(i),n=o(n),null===i||null===n)continue;s.push(i+"="+n)}return s.length?t+s.join("&"):""},t.parse=function(e){for(var t,r=/([^=?#&]+)=?([^&]*)/g,o={};t=r.exec(e);){var i=n(t[1]),s=n(t[2]);null===i||null===s||i in o||(o[i]=s)}return o}},6070:function(e){"use strict";e.exports=function(e,t){if(t=t.split(":")[0],!(e=+e))return!1;switch(t){case"http":case"ws":return 80!==e;case"https":case"wss":return 443!==e;case"ftp":return 21!==e;case"gopher":return 70!==e;case"file":return!1}return 0!==e}},1869:function(e,t,r){"use strict";var n=r(6070),o=r(9699),i=/^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/,s=/[\n\r\t]/g,a=/^[A-Za-z][A-Za-z0-9+-.]*:\/\//,c=/:\d+$/,u=/^([a-z][a-z0-9.+-]*:)?(\/\/)?([\\/]+)?([\S\s]*)/i,p=/^[a-zA-Z]:/;function l(e){return(e||"").toString().replace(i,"")}var f=[["#","hash"],["?","query"],function(e,t){return d(t.protocol)?e.replace(/\\/g,"/"):e},["/","pathname"],["@","auth",1],[NaN,"host",void 0,1,1],[/:(\d*)$/,"port",void 0,1],[NaN,"hostname",void 0,1,1]],h={hash:1,query:1};function v(e){var t,n=("undefined"!=typeof window?window:void 0!==r.g?r.g:"undefined"!=typeof self?self:{}).location||{},o={},i=typeof(e=e||n);if("blob:"===e.protocol)o=new g(unescape(e.pathname),{});else if("string"===i)for(t in o=new g(e,{}),h)delete o[t];else if("object"===i){for(t in e)t in h||(o[t]=e[t]);void 0===o.slashes&&(o.slashes=a.test(e.href))}return o}function d(e){return"file:"===e||"ftp:"===e||"http:"===e||"https:"===e||"ws:"===e||"wss:"===e}function y(e,t){e=(e=l(e)).replace(s,""),t=t||{};var r,n=u.exec(e),o=n[1]?n[1].toLowerCase():"",i=!!n[2],a=!!n[3],c=0;return i?a?(r=n[2]+n[3]+n[4],c=n[2].length+n[3].length):(r=n[2]+n[4],c=n[2].length):a?(r=n[3]+n[4],c=n[3].length):r=n[4],"file:"===o?c>=2&&(r=r.slice(2)):d(o)?r=n[4]:o?i&&(r=r.slice(2)):c>=2&&d(t.protocol)&&(r=n[4]),{protocol:o,slashes:i||d(o),slashesCount:c,rest:r}}function g(e,t,r){if(e=(e=l(e)).replace(s,""),!(this instanceof g))return new g(e,t,r);var i,a,c,u,h,m,b=f.slice(),S=typeof t,P=this,C=0;for("object"!==S&&"string"!==S&&(r=t,t=null),r&&"function"!=typeof r&&(r=o.parse),i=!(a=y(e||"",t=v(t))).protocol&&!a.slashes,P.slashes=a.slashes||i&&t.slashes,P.protocol=a.protocol||t.protocol||"",e=a.rest,("file:"===a.protocol&&(2!==a.slashesCount||p.test(e))||!a.slashes&&(a.protocol||a.slashesCount<2||!d(P.protocol)))&&(b[3]=[/(.*)/,"pathname"]);C<b.length;C++)"function"!=typeof(u=b[C])?(c=u[0],m=u[1],c!=c?P[m]=e:"string"==typeof c?~(h="@"===c?e.lastIndexOf(c):e.indexOf(c))&&("number"==typeof u[2]?(P[m]=e.slice(0,h),e=e.slice(h+u[2])):(P[m]=e.slice(h),e=e.slice(0,h))):(h=c.exec(e))&&(P[m]=h[1],e=e.slice(0,h.index)),P[m]=P[m]||i&&u[3]&&t[m]||"",u[4]&&(P[m]=P[m].toLowerCase())):e=u(e,P);r&&(P.query=r(P.query)),i&&t.slashes&&"/"!==P.pathname.charAt(0)&&(""!==P.pathname||""!==t.pathname)&&(P.pathname=function(e,t){if(""===e)return t;for(var r=(t||"/").split("/").slice(0,-1).concat(e.split("/")),n=r.length,o=r[n-1],i=!1,s=0;n--;)"."===r[n]?r.splice(n,1):".."===r[n]?(r.splice(n,1),s++):s&&(0===n&&(i=!0),r.splice(n,1),s--);return i&&r.unshift(""),"."!==o&&".."!==o||r.push(""),r.join("/")}(P.pathname,t.pathname)),"/"!==P.pathname.charAt(0)&&d(P.protocol)&&(P.pathname="/"+P.pathname),n(P.port,P.protocol)||(P.host=P.hostname,P.port=""),P.username=P.password="",P.auth&&(~(h=P.auth.indexOf(":"))?(P.username=P.auth.slice(0,h),P.username=encodeURIComponent(decodeURIComponent(P.username)),P.password=P.auth.slice(h+1),P.password=encodeURIComponent(decodeURIComponent(P.password))):P.username=encodeURIComponent(decodeURIComponent(P.auth)),P.auth=P.password?P.username+":"+P.password:P.username),P.origin="file:"!==P.protocol&&d(P.protocol)&&P.host?P.protocol+"//"+P.host:"null",P.href=P.toString()}g.prototype={set:function(e,t,r){var i=this;switch(e){case"query":"string"==typeof t&&t.length&&(t=(r||o.parse)(t)),i[e]=t;break;case"port":i[e]=t,n(t,i.protocol)?t&&(i.host=i.hostname+":"+t):(i.host=i.hostname,i[e]="");break;case"hostname":i[e]=t,i.port&&(t+=":"+i.port),i.host=t;break;case"host":i[e]=t,c.test(t)?(t=t.split(":"),i.port=t.pop(),i.hostname=t.join(":")):(i.hostname=t,i.port="");break;case"protocol":i.protocol=t.toLowerCase(),i.slashes=!r;break;case"pathname":case"hash":if(t){var s="pathname"===e?"/":"#";i[e]=t.charAt(0)!==s?s+t:t}else i[e]=t;break;case"username":case"password":i[e]=encodeURIComponent(t);break;case"auth":var a=t.indexOf(":");~a?(i.username=t.slice(0,a),i.username=encodeURIComponent(decodeURIComponent(i.username)),i.password=t.slice(a+1),i.password=encodeURIComponent(decodeURIComponent(i.password))):i.username=encodeURIComponent(decodeURIComponent(t))}for(var u=0;u<f.length;u++){var p=f[u];p[4]&&(i[p[1]]=i[p[1]].toLowerCase())}return i.auth=i.password?i.username+":"+i.password:i.username,i.origin="file:"!==i.protocol&&d(i.protocol)&&i.host?i.protocol+"//"+i.host:"null",i.href=i.toString(),i},toString:function(e){e&&"function"==typeof e||(e=o.stringify);var t,r=this,n=r.host,i=r.protocol;i&&":"!==i.charAt(i.length-1)&&(i+=":");var s=i+(r.protocol&&r.slashes||d(r.protocol)?"//":"");return r.username?(s+=r.username,r.password&&(s+=":"+r.password),s+="@"):r.password?(s+=":"+r.password,s+="@"):"file:"!==r.protocol&&d(r.protocol)&&!n&&"/"!==r.pathname&&(s+="@"),(":"===n[n.length-1]||c.test(r.hostname)&&!r.port)&&(n+=":"),s+=n+r.pathname,(t="object"==typeof r.query?e(r.query):r.query)&&(s+="?"!==t.charAt(0)?"?"+t:t),r.hash&&(s+=r.hash),s}},g.extractProtocol=y,g.location=v,g.trimLeft=l,g.qs=o,e.exports=g},5834:function(e,t,r){var n=r(595),o=r(4446),i=o;i.v1=n,i.v4=o,e.exports=i},7298:function(e){for(var t=[],r=0;r<256;++r)t[r]=(r+256).toString(16).substr(1);e.exports=function(e,r){var n=r||0,o=t;return[o[e[n++]],o[e[n++]],o[e[n++]],o[e[n++]],"-",o[e[n++]],o[e[n++]],"-",o[e[n++]],o[e[n++]],"-",o[e[n++]],o[e[n++]],"-",o[e[n++]],o[e[n++]],o[e[n++]],o[e[n++]],o[e[n++]],o[e[n++]]].join("")}},8848:function(e){var t="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof window.msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto);if(t){var r=new Uint8Array(16);e.exports=function(){return t(r),r}}else{var n=new Array(16);e.exports=function(){for(var e,t=0;t<16;t++)0==(3&t)&&(e=4294967296*Math.random()),n[t]=e>>>((3&t)<<3)&255;return n}}},595:function(e,t,r){var n,o,i=r(8848),s=r(7298),a=0,c=0;e.exports=function(e,t,r){var u=t&&r||0,p=t||[],l=(e=e||{}).node||n,f=void 0!==e.clockseq?e.clockseq:o;if(null==l||null==f){var h=i();null==l&&(l=n=[1|h[0],h[1],h[2],h[3],h[4],h[5]]),null==f&&(f=o=16383&(h[6]<<8|h[7]))}var v=void 0!==e.msecs?e.msecs:(new Date).getTime(),d=void 0!==e.nsecs?e.nsecs:c+1,y=v-a+(d-c)/1e4;if(y<0&&void 0===e.clockseq&&(f=f+1&16383),(y<0||v>a)&&void 0===e.nsecs&&(d=0),d>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");a=v,c=d,o=f;var g=(1e4*(268435455&(v+=122192928e5))+d)%4294967296;p[u++]=g>>>24&255,p[u++]=g>>>16&255,p[u++]=g>>>8&255,p[u++]=255&g;var m=v/4294967296*1e4&268435455;p[u++]=m>>>8&255,p[u++]=255&m,p[u++]=m>>>24&15|16,p[u++]=m>>>16&255,p[u++]=f>>>8|128,p[u++]=255&f;for(var b=0;b<6;++b)p[u+b]=l[b];return t||s(p)}},4446:function(e,t,r){var n=r(8848),o=r(7298);e.exports=function(e,t,r){var i=t&&r||0;"string"==typeof e&&(t="binary"===e?new Array(16):null,e=null);var s=(e=e||{}).random||(e.rng||n)();if(s[6]=15&s[6]|64,s[8]=63&s[8]|128,t)for(var a=0;a<16;++a)t[i+a]=s[a];return t||o(s)}},1556:function(){},5733:function(){},9240:function(){},6482:function(){},4822:function(){},5779:function(){},8018:function(){},4715:function(){},2002:function(){},9315:function(){},8698:function(e){function t(r){return e.exports=t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.__esModule=!0,e.exports.default=e.exports,t(r)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},630:function(e,t,r){e.exports=r(9439)},9201:function(e){e.exports=function(e){return e&&e.__esModule?e:{default:e}},e.exports.__esModule=!0,e.exports.default=e.exports},4315:function(e){e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n},e.exports.__esModule=!0,e.exports.default=e.exports},2778:function(e,t,r){var n=r(4315);e.exports=function(e){if(Array.isArray(e))return n(e)},e.exports.__esModule=!0,e.exports.default=e.exports},3065:function(e){e.exports=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e},e.exports.__esModule=!0,e.exports.default=e.exports},5663:function(e){function t(e,t,r,n,o,i,s){try{var a=e[i](s),c=a.value}catch(e){return void r(e)}a.done?t(c):Promise.resolve(c).then(n,o)}e.exports=function(e){return function(){var r=this,n=arguments;return new Promise((function(o,i){var s=e.apply(r,n);function a(e){t(s,o,i,a,c,"next",e)}function c(e){t(s,o,i,a,c,"throw",e)}a(void 0)}))}},e.exports.__esModule=!0,e.exports.default=e.exports},432:function(e){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},e.exports.__esModule=!0,e.exports.default=e.exports},7902:function(e,t,r){var n=r(8183),o=r(4844);function i(t,r,s){return o()?(e.exports=i=Reflect.construct.bind(),e.exports.__esModule=!0,e.exports.default=e.exports):(e.exports=i=function(e,t,r){var o=[null];o.push.apply(o,t);var i=new(Function.bind.apply(e,o));return r&&n(i,r.prototype),i},e.exports.__esModule=!0,e.exports.default=e.exports),i.apply(null,arguments)}e.exports=i,e.exports.__esModule=!0,e.exports.default=e.exports},4430:function(e){function t(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}e.exports=function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e},e.exports.__esModule=!0,e.exports.default=e.exports},5470:function(e){e.exports=function(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e},e.exports.__esModule=!0,e.exports.default=e.exports},3992:function(e,t,r){var n=r(3754);function o(){return"undefined"!=typeof Reflect&&Reflect.get?(e.exports=o=Reflect.get.bind(),e.exports.__esModule=!0,e.exports.default=e.exports):(e.exports=o=function(e,t,r){var o=n(e,t);if(o){var i=Object.getOwnPropertyDescriptor(o,t);return i.get?i.get.call(arguments.length<3?e:r):i.value}},e.exports.__esModule=!0,e.exports.default=e.exports),o.apply(this,arguments)}e.exports=o,e.exports.__esModule=!0,e.exports.default=e.exports},6228:function(e){function t(r){return e.exports=t=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},e.exports.__esModule=!0,e.exports.default=e.exports,t(r)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},9090:function(e,t,r){var n=r(8183);e.exports=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&n(e,t)},e.exports.__esModule=!0,e.exports.default=e.exports},8625:function(e){e.exports=function(e){return e&&e.__esModule?e:{default:e}},e.exports.__esModule=!0,e.exports.default=e.exports},9465:function(e){e.exports=function(e){return-1!==Function.toString.call(e).indexOf("[native code]")},e.exports.__esModule=!0,e.exports.default=e.exports},4844:function(e){e.exports=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}},e.exports.__esModule=!0,e.exports.default=e.exports},3841:function(e){e.exports=function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)},e.exports.__esModule=!0,e.exports.default=e.exports},8335:function(e){e.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},e.exports.__esModule=!0,e.exports.default=e.exports},7817:function(e,t,r){var n=r(4421);e.exports=function(e,t){if(null==e)return{};var r,o,i=n(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(o=0;o<s.length;o++)r=s[o],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i},e.exports.__esModule=!0,e.exports.default=e.exports},4421:function(e){e.exports=function(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(o[r]=e[r]);return o},e.exports.__esModule=!0,e.exports.default=e.exports},3382:function(e,t,r){var n=r(8942).default,o=r(3065);e.exports=function(e,t){if(t&&("object"===n(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return o(e)},e.exports.__esModule=!0,e.exports.default=e.exports},4231:function(e,t,r){var n=r(8942).default;function o(){"use strict";e.exports=o=function(){return t},e.exports.__esModule=!0,e.exports.default=e.exports;var t={},r=Object.prototype,i=r.hasOwnProperty,s="function"==typeof Symbol?Symbol:{},a=s.iterator||"@@iterator",c=s.asyncIterator||"@@asyncIterator",u=s.toStringTag||"@@toStringTag";function p(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{p({},"")}catch(e){p=function(e,t,r){return e[t]=r}}function l(e,t,r,n){var o=t&&t.prototype instanceof v?t:v,i=Object.create(o.prototype),s=new I(n||[]);return i._invoke=function(e,t,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return{value:void 0,done:!0}}for(r.method=o,r.arg=i;;){var s=r.delegate;if(s){var a=w(s,r);if(a){if(a===h)continue;return a}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var c=f(e,t,r);if("normal"===c.type){if(n=r.done?"completed":"suspendedYield",c.arg===h)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(n="completed",r.method="throw",r.arg=c.arg)}}}(e,r,s),i}function f(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=l;var h={};function v(){}function d(){}function y(){}var g={};p(g,a,(function(){return this}));var m=Object.getPrototypeOf,b=m&&m(m(E([])));b&&b!==r&&i.call(b,a)&&(g=b);var S=y.prototype=v.prototype=Object.create(g);function P(e){["next","throw","return"].forEach((function(t){p(e,t,(function(e){return this._invoke(t,e)}))}))}function C(e,t){function r(o,s,a,c){var u=f(e[o],e,s);if("throw"!==u.type){var p=u.arg,l=p.value;return l&&"object"==n(l)&&i.call(l,"__await")?t.resolve(l.__await).then((function(e){r("next",e,a,c)}),(function(e){r("throw",e,a,c)})):t.resolve(l).then((function(e){p.value=e,a(p)}),(function(e){return r("throw",e,a,c)}))}c(u.arg)}var o;this._invoke=function(e,n){function i(){return new t((function(t,o){r(e,n,t,o)}))}return o=o?o.then(i,i):i()}}function w(e,t){var r=e.iterator[t.method];if(void 0===r){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=void 0,w(e,t),"throw"===t.method))return h;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return h}var n=f(r,e.iterator,t.arg);if("throw"===n.type)return t.method="throw",t.arg=n.arg,t.delegate=null,h;var o=n.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,h):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,h)}function O(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function R(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function I(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(O,this),this.reset(!0)}function E(e){if(e){var t=e[a];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,n=function t(){for(;++r<e.length;)if(i.call(e,r))return t.value=e[r],t.done=!1,t;return t.value=void 0,t.done=!0,t};return n.next=n}}return{next:_}}function _(){return{value:void 0,done:!0}}return d.prototype=y,p(S,"constructor",y),p(y,"constructor",d),d.displayName=p(y,u,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===d||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,y):(e.__proto__=y,p(e,u,"GeneratorFunction")),e.prototype=Object.create(S),e},t.awrap=function(e){return{__await:e}},P(C.prototype),p(C.prototype,c,(function(){return this})),t.AsyncIterator=C,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var s=new C(l(e,r,n,o),i);return t.isGeneratorFunction(r)?s:s.next().then((function(e){return e.done?e.value:s.next()}))},P(S),p(S,u,"Generator"),p(S,a,(function(){return this})),p(S,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=[];for(var r in e)t.push(r);return t.reverse(),function r(){for(;t.length;){var n=t.pop();if(n in e)return r.value=n,r.done=!1,r}return r.done=!0,r}},t.values=E,I.prototype={constructor:I,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(R),!e)for(var t in this)"t"===t.charAt(0)&&i.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function r(r,n){return s.type="throw",s.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n],s=o.completion;if("root"===o.tryLoc)return r("end");if(o.tryLoc<=this.prev){var a=i.call(o,"catchLoc"),c=i.call(o,"finallyLoc");if(a&&c){if(this.prev<o.catchLoc)return r(o.catchLoc,!0);if(this.prev<o.finallyLoc)return r(o.finallyLoc)}else if(a){if(this.prev<o.catchLoc)return r(o.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return r(o.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&i.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var s=o?o.completion:{};return s.type=e,s.arg=t,o?(this.method="next",this.next=o.finallyLoc,h):this.complete(s)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),h},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),R(r),h}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;R(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:E(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),h}},t}e.exports=o,e.exports.__esModule=!0,e.exports.default=e.exports},746:function(e,t,r){var n=r(3754),o=r(5470);function i(e,t,r,s){return i="undefined"!=typeof Reflect&&Reflect.set?Reflect.set:function(e,t,r,i){var s,a=n(e,t);if(a){if((s=Object.getOwnPropertyDescriptor(a,t)).set)return s.set.call(i,r),!0;if(!s.writable)return!1}if(s=Object.getOwnPropertyDescriptor(i,t)){if(!s.writable)return!1;s.value=r,Object.defineProperty(i,t,s)}else o(i,t,r);return!0},i(e,t,r,s)}e.exports=function(e,t,r,n,o){if(!i(e,t,r,n||e)&&o)throw new Error("failed to set property");return r},e.exports.__esModule=!0,e.exports.default=e.exports},8183:function(e){function t(r,n){return e.exports=t=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},e.exports.__esModule=!0,e.exports.default=e.exports,t(r,n)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},3754:function(e,t,r){var n=r(6228);e.exports=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=n(e)););return e},e.exports.__esModule=!0,e.exports.default=e.exports},2427:function(e,t,r){var n=r(2778),o=r(3841),i=r(8456),s=r(8335);e.exports=function(e){return n(e)||o(e)||i(e)||s()},e.exports.__esModule=!0,e.exports.default=e.exports},8942:function(e){function t(r){return e.exports=t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.__esModule=!0,e.exports.default=e.exports,t(r)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},8456:function(e,t,r){var n=r(4315);e.exports=function(e,t){if(e){if("string"==typeof e)return n(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(e,t):void 0}},e.exports.__esModule=!0,e.exports.default=e.exports},5124:function(e,t,r){var n=r(6228),o=r(8183),i=r(9465),s=r(7902);function a(t){var r="function"==typeof Map?new Map:void 0;return e.exports=a=function(e){if(null===e||!i(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==r){if(r.has(e))return r.get(e);r.set(e,t)}function t(){return s(e,arguments,n(this).constructor)}return t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),o(t,e)},e.exports.__esModule=!0,e.exports.default=e.exports,a(t)}e.exports=a,e.exports.__esModule=!0,e.exports.default=e.exports},347:function(e,t,r){var n=r(4231)();e.exports=n;try{regeneratorRuntime=n}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=n:Function("r","regeneratorRuntime = r")(n)}}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var i=t[n]={exports:{}};return e[n].call(i.exports,i,i.exports,r),i.exports}r.d=function(e,t){for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var n={};return function(){"use strict";var e=n,t=r(8698);Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"create",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(e,"createSpeechRecognitionPonyfillFromRecognizer",{enumerable:!0,get:function(){return o.createSpeechRecognitionPonyfillFromRecognizer}});var o=function(e,r){if(e&&e.__esModule)return e;if(null===e||"object"!==t(e)&&"function"!=typeof e)return{default:e};var n=i(r);if(n&&n.has(e))return n.get(e);var o={},s=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var c=s?Object.getOwnPropertyDescriptor(e,a):null;c&&(c.get||c.set)?Object.defineProperty(o,a,c):o[a]=e[a]}return o.default=e,n&&n.set(e,o),o}(r(583));function i(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(i=function(e){return e?r:t})(e)}}(),n}()}));
|