@genpact/genome.mfe.mgtwin-app 1.1.321-alpha → 1.1.322-alpha
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/{ArrowLeftCircleIcon-a6cd1759.mjs → ArrowLeftCircleIcon-46e7341d.mjs} +1 -1
- package/dist/{AssessmentAMA-bb8f55e1.mjs → AssessmentAMA-eb91f856.mjs} +109 -109
- package/dist/{AssessmentSimulation-a4763997.mjs → AssessmentSimulation-9839b518.mjs} +5 -5
- package/dist/{EditSkillAdminData-92c009be.mjs → EditSkillAdminData-2739c990.mjs} +3 -3
- package/dist/{EditSkillData-3f119c80.mjs → EditSkillData-24d591e4.mjs} +3 -3
- package/dist/{HomeView-03704b32.mjs → HomeView-eba5816e.mjs} +5 -5
- package/dist/{Loading-34cdf7d2.mjs → Loading-733e898a.mjs} +1 -1
- package/dist/{LoadingSimulation-09def834.mjs → LoadingSimulation-6ca33dd7.mjs} +1 -1
- package/dist/{Modal-b19a1cb5.mjs → Modal-7066e8bf.mjs} +1 -1
- package/dist/{PaperAirplaneIcon-767ce931.mjs → PaperAirplaneIcon-3171a5fd.mjs} +1 -1
- package/dist/{PromptTesting-e9e755b8.mjs → PromptTesting-e4aea97c.mjs} +3 -3
- package/dist/{SkillAutomation-376b44a1.mjs → SkillAutomation-a1c4428b.mjs} +3 -3
- package/dist/{SkillData-6d1645d2.mjs → SkillData-13212a4f.mjs} +3 -3
- package/dist/{Testcase-88d35ea8.mjs → Testcase-183ebad3.mjs} +3 -3
- package/dist/{UnderMaintenance-1605a221.mjs → UnderMaintenance-22333ac2.mjs} +1 -1
- package/dist/{_commonjsHelpers-71235878.mjs → _commonjsHelpers-f6c30715.mjs} +1 -1
- package/dist/{api-0705aaf5.mjs → api-d1382aa2.mjs} +1 -1
- package/dist/{main-8e32194f.mjs → main-ece73e2d.mjs} +1222 -1222
- package/dist/mgtwin.es.min.js +1 -1
- package/dist/mgtwin.umd.min.js +1 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
package/dist/mgtwin.umd.min.js
CHANGED
|
@@ -32,4 +32,4 @@ File System access not available, please use Push or PullAudioOutputStream`),thi
|
|
|
32
32
|
`;class jO{toConnectionMessage(t){const i=new _t.Deferred;try{if(t.messageType===_t.MessageType.Text){const n=t.textContent;let o={},s=null;if(n){const A=n.split(`\r
|
|
33
33
|
\r
|
|
34
34
|
`);A&&A.length>0&&(o=this.parseHeaders(A[0]),A.length>1&&(s=A[1]))}i.resolve(new _t.ConnectionMessage(t.messageType,s,o,t.id))}else if(t.messageType===_t.MessageType.Binary){const n=t.binaryContent;let o={},s=null;if(!n||n.byteLength<2)throw new Error("Invalid binary message format. Header length missing.");const A=new DataView(n),r=A.getInt16(0);if(n.byteLength<r+2)throw new Error("Invalid binary message format. Header content missing.");let a="";for(let c=0;c<r;c++)a+=String.fromCharCode(A.getInt8(c+2));o=this.parseHeaders(a),n.byteLength>r+2&&(s=n.slice(2+r)),i.resolve(new _t.ConnectionMessage(t.messageType,s,o,t.id))}}catch(n){i.reject(`Error formatting the message. Error: ${n}`)}return i.promise}fromConnectionMessage(t){const i=new _t.Deferred;try{if(t.messageType===_t.MessageType.Text){const n=`${this.makeHeaders(t)}${yd}${t.textBody?t.textBody:""}`;i.resolve(new _t.RawWebsocketMessage(_t.MessageType.Text,n,t.id))}else if(t.messageType===_t.MessageType.Binary){const n=this.makeHeaders(t),o=t.binaryBody,s=this.stringToArrayBuffer(n),A=new Int8Array(s),r=A.byteLength,a=new Int8Array(2+r+(o?o.byteLength:0));if(a[0]=r>>8&255,a[1]=r&255,a.set(A,2),o){const u=new Int8Array(o);a.set(u,2+r)}const c=a.buffer;i.resolve(new _t.RawWebsocketMessage(_t.MessageType.Binary,c,t.id))}}catch(n){i.reject(`Error formatting the message. ${n}`)}return i.promise}makeHeaders(t){let i="";if(t.headers)for(const n in t.headers)n&&(i+=`${n}: ${t.headers[n]}${yd}`);return i}parseHeaders(t){const i={};if(t){const n=t.match(/[^\r\n]+/g);if(i){for(const o of n)if(o){const s=o.indexOf(":"),A=s>0?o.substr(0,s).trim().toLowerCase():o,r=s>0&&o.length>s+1?o.substr(s+1).trim():"";i[A]=r}}}return i}stringToArrayBuffer(t){const i=new ArrayBuffer(t.length),n=new DataView(i);for(let o=0;o<t.length;o++)n.setUint8(o,t.charCodeAt(o));return i}}pc.WebsocketMessageFormatter=jO;var xs={},Td;function kO(){if(Td)return xs;Td=1,Object.defineProperty(xs,"__esModule",{value:!0}),xs.SpeechConnectionFactory=void 0;const e=ht(),t=se(),i=q(),n=ai(),o=se(),s=Et,A=Ai,r=Pt;let a=class extends n.ConnectionFactoryBase{constructor(){super(...arguments),this.interactiveRelativeUri="/speech/recognition/interactive/cognitiveservices/v1",this.conversationRelativeUri="/speech/recognition/conversation/cognitiveservices/v1",this.dictationRelativeUri="/speech/recognition/dictation/cognitiveservices/v1",this.universalUri="/stt/speech/universal/v"}async create(u,l,g){let E=u.parameters.getProperty(i.PropertyId.SpeechServiceConnection_Endpoint,void 0);const C=u.parameters.getProperty(i.PropertyId.SpeechServiceConnection_Region,void 0),d=n.ConnectionFactoryBase.getHostSuffix(C),S=u.parameters.getProperty(i.PropertyId.SpeechServiceConnection_Host,"wss://"+C+".stt.speech"+d),I={},p=u.parameters.getProperty(i.PropertyId.SpeechServiceConnection_EndpointId,void 0),M=u.parameters.getProperty(i.PropertyId.SpeechServiceConnection_RecoLanguage,void 0);if(p?(!E||E.search(A.QueryParameterNames.CustomSpeechDeploymentId)===-1)&&(I[A.QueryParameterNames.CustomSpeechDeploymentId]=p):M&&(!E||E.search(A.QueryParameterNames.Language)===-1)&&(I[A.QueryParameterNames.Language]=M),(!E||E.search(A.QueryParameterNames.Format)===-1)&&(I[A.QueryParameterNames.Format]=u.parameters.getProperty(t.OutputFormatPropertyName,i.OutputFormat[i.OutputFormat.Simple]).toLowerCase()),u.autoDetectSourceLanguages!==void 0&&(I[A.QueryParameterNames.EnableLanguageId]="true"),this.setCommonUrlParams(u,I,E),E){const D=new URL(E),j=D.pathname;(j===""||j==="/")&&(D.pathname=this.universalUri+u.recognitionEndpointVersion,E=await n.ConnectionFactoryBase.getRedirectUrlFromEndpoint(D.toString()))}if(!E)switch(u.recognitionMode){case r.RecognitionMode.Conversation:u.parameters.getProperty(t.ForceDictationPropertyName,"false")==="true"?E=S+this.dictationRelativeUri:u.recognitionEndpointVersion!==void 0&&parseInt(u.recognitionEndpointVersion,10)>1?E=`${S}${this.universalUri}${u.recognitionEndpointVersion}`:E=S+this.conversationRelativeUri;break;case r.RecognitionMode.Dictation:E=S+this.dictationRelativeUri;break;default:u.recognitionEndpointVersion!==void 0&&parseInt(u.recognitionEndpointVersion,10)>1?E=`${S}${this.universalUri}${u.recognitionEndpointVersion}`:E=S+this.interactiveRelativeUri;break}const v={};l.token!==void 0&&l.token!==""&&(v[l.headerName]=l.token),v[s.HeaderNames.ConnectionId]=g,v.connectionId=g;const T=u.parameters.getProperty("SPEECH-EnableWebsocketCompression","false")==="true",O=new e.WebsocketConnection(E,I,v,new o.WebsocketMessageFormatter,e.ProxyInfo.fromRecognizerConfig(u),T,g),F=O.uri;return u.parameters.setProperty(i.PropertyId.SpeechServiceConnection_Url,F),O}};return xs.SpeechConnectionFactory=a,xs}var js={},Ld;function YO(){if(Ld)return js;Ld=1,Object.defineProperty(js,"__esModule",{value:!0}),js.ConversationTranscriberConnectionFactory=void 0;const e=ht(),t=q(),i=se(),n=ai(),o=se(),s=Et,A=Ai;let r=class extends n.ConnectionFactoryBase{constructor(){super(...arguments),this.universalUri="/speech/universal/v2"}async create(c,u,l){let g=c.parameters.getProperty(t.PropertyId.SpeechServiceConnection_Endpoint,void 0);const E=c.parameters.getProperty(t.PropertyId.SpeechServiceConnection_Region,void 0),C=n.ConnectionFactoryBase.getHostSuffix(E),d=c.parameters.getProperty(t.PropertyId.SpeechServiceConnection_Host,"wss://"+E+".stt.speech"+C),S={},I=c.parameters.getProperty(t.PropertyId.SpeechServiceConnection_EndpointId,void 0),p=c.parameters.getProperty(t.PropertyId.SpeechServiceConnection_RecoLanguage,void 0);if(I?(!g||g.search(A.QueryParameterNames.CustomSpeechDeploymentId)===-1)&&(S[A.QueryParameterNames.CustomSpeechDeploymentId]=I):p&&(!g||g.search(A.QueryParameterNames.Language)===-1)&&(S[A.QueryParameterNames.Language]=p),c.autoDetectSourceLanguages!==void 0&&(S[A.QueryParameterNames.EnableLanguageId]="true"),this.setV2UrlParams(c,S,g),g){const F=new URL(g),D=F.pathname;(D===""||D==="/")&&(F.pathname=this.universalUri,g=await n.ConnectionFactoryBase.getRedirectUrlFromEndpoint(F.toString()))}g||(g=`${d}${this.universalUri}`);const M={};u.token!==void 0&&u.token!==""&&(M[u.headerName]=u.token),M[s.HeaderNames.ConnectionId]=l;const v=c.parameters.getProperty("SPEECH-EnableWebsocketCompression","false")==="true",T=new e.WebsocketConnection(g,S,M,new o.WebsocketMessageFormatter,e.ProxyInfo.fromRecognizerConfig(c),v,l),O=T.uri;return c.parameters.setProperty(t.PropertyId.SpeechServiceConnection_Url,O),T}setV2UrlParams(c,u,l){new Map([[t.PropertyId.Speech_SegmentationSilenceTimeoutMs,A.QueryParameterNames.SegmentationSilenceTimeoutMs],[t.PropertyId.SpeechServiceConnection_EnableAudioLogging,A.QueryParameterNames.EnableAudioLogging],[t.PropertyId.SpeechServiceConnection_EndSilenceTimeoutMs,A.QueryParameterNames.EndSilenceTimeoutMs],[t.PropertyId.SpeechServiceConnection_InitialSilenceTimeoutMs,A.QueryParameterNames.InitialSilenceTimeoutMs],[t.PropertyId.SpeechServiceResponse_PostProcessingOption,A.QueryParameterNames.Postprocessing],[t.PropertyId.SpeechServiceResponse_ProfanityOption,A.QueryParameterNames.Profanity],[t.PropertyId.SpeechServiceResponse_StablePartialResultThreshold,A.QueryParameterNames.StableIntermediateThreshold]]).forEach((C,d)=>{this.setUrlParameter(d,C,c,u,l)});const E=JSON.parse(c.parameters.getProperty(i.ServicePropertiesPropertyName,"{}"));Object.keys(E).forEach(C=>{u[C]=E[C]})}};return js.ConversationTranscriberConnectionFactory=r,js}var ks={},Od;function zO(){if(Od)return ks;Od=1,Object.defineProperty(ks,"__esModule",{value:!0}),ks.TranscriberConnectionFactory=void 0;const e=ht(),t=q(),i=ai(),n=se(),o=Et,s=Ai;let A=class extends i.ConnectionFactoryBase{constructor(){super(...arguments),this.multiaudioRelativeUri="/speech/recognition/multiaudio"}create(a,c,u){let l=a.parameters.getProperty(t.PropertyId.SpeechServiceConnection_Endpoint,void 0);const g=a.parameters.getProperty(t.PropertyId.SpeechServiceConnection_Region,"centralus"),E=i.ConnectionFactoryBase.getHostSuffix(g),C="wss://transcribe."+g+".cts.speech"+E+this.multiaudioRelativeUri,d=a.parameters.getProperty(t.PropertyId.SpeechServiceConnection_Host,C),S={};this.setQueryParams(S,a,l),l||(l=d);const I={};c.token!==void 0&&c.token!==""&&(I[c.headerName]=c.token),I[o.HeaderNames.ConnectionId]=u,a.parameters.setProperty(t.PropertyId.SpeechServiceConnection_Url,l);const p=a.parameters.getProperty("SPEECH-EnableWebsocketCompression","false")==="true";return Promise.resolve(new e.WebsocketConnection(l,S,I,new n.WebsocketMessageFormatter,e.ProxyInfo.fromRecognizerConfig(a),p,u))}setQueryParams(a,c,u){const l=c.parameters.getProperty(t.PropertyId.SpeechServiceConnection_EndpointId,void 0),g=c.parameters.getProperty(t.PropertyId.SpeechServiceConnection_RecoLanguage,void 0);l&&!(s.QueryParameterNames.CustomSpeechDeploymentId in a)&&(a[s.QueryParameterNames.CustomSpeechDeploymentId]=l),g&&!(s.QueryParameterNames.Language in a)&&(a[s.QueryParameterNames.Language]=g);const E=c.parameters.getProperty(t.PropertyId.SpeechServiceResponse_RequestWordLevelTimestamps,"false").toLowerCase()==="true",C=c.parameters.getProperty(n.OutputFormatPropertyName,t.OutputFormat[t.OutputFormat.Simple])!==t.OutputFormat[t.OutputFormat.Simple];(E||C)&&(a[s.QueryParameterNames.Format]=t.OutputFormat[t.OutputFormat.Detailed].toLowerCase()),this.setCommonUrlParams(c,a,u)}};return ks.TranscriberConnectionFactory=A,ks}var Ys={},Ud;function PO(){if(Ud)return Ys;Ud=1,Object.defineProperty(Ys,"__esModule",{value:!0}),Ys.TranslationConnectionFactory=void 0;const e=ht(),t=Ss,i=q(),n=ai(),o=se(),s=Et,A=Ai,r=Pt;let a=class extends n.ConnectionFactoryBase{constructor(){super(...arguments),this.universalUri="/stt/speech/universal/v2",this.translationV1Uri="/speech/translation/cognitiveservices/v1"}async create(u,l,g){let E=this.getEndpointUrl(u);const C={};if(this.setQueryParams(C,u,E),E){const p=new URL(E),M=p.pathname;(M===""||M==="/")&&(p.pathname=this.universalUri,E=await n.ConnectionFactoryBase.getRedirectUrlFromEndpoint(p.toString()))}const d={};l.token!==void 0&&l.token!==""&&(d[l.headerName]=l.token),d[s.HeaderNames.ConnectionId]=g,u.parameters.setProperty(i.PropertyId.SpeechServiceConnection_Url,E);const S=u.parameters.getProperty("SPEECH-EnableWebsocketCompression","false")==="true";return new e.WebsocketConnection(E,C,d,new o.WebsocketMessageFormatter,e.ProxyInfo.fromRecognizerConfig(u),S,g)}getEndpointUrl(u,l){const g=u.parameters.getProperty(i.PropertyId.SpeechServiceConnection_Region),E=n.ConnectionFactoryBase.getHostSuffix(g);let C=u.parameters.getProperty(i.PropertyId.SpeechServiceConnection_Endpoint,void 0);return C?l===!0?C:t.StringUtils.formatString(C,{region:g}):(u.parameters.getProperty("SPEECH-ForceV1Endpoint","false")==="true"?C=u.parameters.getProperty(i.PropertyId.SpeechServiceConnection_Host,"wss://{region}.s2s.speech"+E)+this.translationV1Uri:C=u.parameters.getProperty(i.PropertyId.SpeechServiceConnection_Host,"wss://{region}.stt.speech"+E)+this.universalUri,l===!0?C:t.StringUtils.formatString(C,{region:g}))}setQueryParams(u,l,g){u.from=l.parameters.getProperty(i.PropertyId.SpeechServiceConnection_RecoLanguage),u.to=l.parameters.getProperty(i.PropertyId.SpeechServiceConnection_TranslationToLanguages),u.scenario=l.recognitionMode===r.RecognitionMode.Interactive?"interactive":l.recognitionMode===r.RecognitionMode.Conversation?"conversation":"",this.setCommonUrlParams(l,u,g),this.setUrlParameter(i.PropertyId.SpeechServiceResponse_TranslationRequestStablePartialResult,A.QueryParameterNames.StableTranslation,l,u,g);const E=l.parameters.getProperty(i.PropertyId.SpeechServiceConnection_TranslationVoice,void 0);E!==void 0&&(u.voice=E,u.features="requireVoice")}};return Ys.TranslationConnectionFactory=a,Ys}var zs={},Nd;function bO(){if(Nd)return zs;Nd=1,Object.defineProperty(zs,"__esModule",{value:!0}),zs.EnumTranslation=void 0;const e=q(),t=se();let i=class{static implTranslateRecognitionResult(o,s=!1){let A=e.ResultReason.Canceled;switch(o){case t.RecognitionStatus.Success:A=e.ResultReason.RecognizedSpeech;break;case t.RecognitionStatus.EndOfDictation:A=s?e.ResultReason.RecognizedSpeech:e.ResultReason.NoMatch;break;case t.RecognitionStatus.NoMatch:case t.RecognitionStatus.InitialSilenceTimeout:case t.RecognitionStatus.BabbleTimeout:A=e.ResultReason.NoMatch;break;case t.RecognitionStatus.Error:case t.RecognitionStatus.BadRequest:case t.RecognitionStatus.Forbidden:default:A=e.ResultReason.Canceled;break}return A}static implTranslateCancelResult(o){let s=e.CancellationReason.EndOfStream;switch(o){case t.RecognitionStatus.Success:case t.RecognitionStatus.EndOfDictation:case t.RecognitionStatus.NoMatch:s=e.CancellationReason.EndOfStream;break;case t.RecognitionStatus.InitialSilenceTimeout:case t.RecognitionStatus.BabbleTimeout:case t.RecognitionStatus.Error:case t.RecognitionStatus.BadRequest:case t.RecognitionStatus.Forbidden:default:s=e.CancellationReason.Error;break}return s}static implTranslateCancelErrorCode(o){let s=e.CancellationErrorCode.NoError;switch(o){case t.RecognitionStatus.Error:s=e.CancellationErrorCode.ServiceError;break;case t.RecognitionStatus.TooManyRequests:s=e.CancellationErrorCode.TooManyRequests;break;case t.RecognitionStatus.BadRequest:s=e.CancellationErrorCode.BadRequestParameters;break;case t.RecognitionStatus.Forbidden:s=e.CancellationErrorCode.Forbidden;break;default:s=e.CancellationErrorCode.NoError;break}return s}static implTranslateErrorDetails(o){let s="The speech service encountered an internal error and could not continue.";switch(o){case e.CancellationErrorCode.Forbidden:s="The recognizer is using a free subscription that ran out of quota.";break;case e.CancellationErrorCode.BadRequestParameters:s="Invalid parameter or unsupported audio format in the request.";break;case e.CancellationErrorCode.TooManyRequests:s="The number of parallel requests exceeded the number of allowed concurrent transcriptions.";break}return s}};return zs.EnumTranslation=i,zs}var Kd={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.RecognitionStatus=e.SynthesisStatus=void 0,function(t){t[t.Success=0]="Success",t[t.SynthesisEnd=1]="SynthesisEnd",t[t.Error=2]="Error"}(e.SynthesisStatus||(e.SynthesisStatus={})),function(t){t[t.Success=0]="Success",t[t.NoMatch=1]="NoMatch",t[t.InitialSilenceTimeout=2]="InitialSilenceTimeout",t[t.BabbleTimeout=3]="BabbleTimeout",t[t.Error=4]="Error",t[t.EndOfDictation=5]="EndOfDictation",t[t.TooManyRequests=6]="TooManyRequests",t[t.BadRequest=7]="BadRequest",t[t.Forbidden=8]="Forbidden"}(e.RecognitionStatus||(e.RecognitionStatus={}))})(Kd);var Ps={},Fd;function JO(){if(Fd)return Ps;Fd=1,Object.defineProperty(Ps,"__esModule",{value:!0}),Ps.TranslationSynthesisEnd=void 0;const e=se();let t=class WS{constructor(n){this.privSynthesisEnd=JSON.parse(n),this.privSynthesisEnd.SynthesisStatus&&(this.privSynthesisEnd.SynthesisStatus=e.SynthesisStatus[this.privSynthesisEnd.SynthesisStatus]),this.privSynthesisEnd.Status&&(this.privSynthesisEnd.SynthesisStatus=e.SynthesisStatus[this.privSynthesisEnd.Status])}static fromJSON(n){return new WS(n)}get SynthesisStatus(){return this.privSynthesisEnd.SynthesisStatus}get FailureReason(){return this.privSynthesisEnd.FailureReason}};return Ps.TranslationSynthesisEnd=t,Ps}var dc={};Object.defineProperty(dc,"__esModule",{value:!0}),dc.TranslationHypothesis=void 0;const HO=Ie,Gd=xa;class Sc{constructor(t,i){this.privTranslationHypothesis=t,this.privTranslationHypothesis.Offset+=i,this.privTranslationHypothesis.Translation.TranslationStatus=this.mapTranslationStatus(this.privTranslationHypothesis.Translation.TranslationStatus)}static fromJSON(t,i){return new Sc(JSON.parse(t),i)}static fromTranslationResponse(t,i){HO.Contracts.throwIfNullOrUndefined(t,"translationHypothesis");const n=t.SpeechHypothesis;return t.SpeechHypothesis=void 0,n.Translation=t,new Sc(n,i)}get Duration(){return this.privTranslationHypothesis.Duration}get Offset(){return this.privTranslationHypothesis.Offset}get Text(){return this.privTranslationHypothesis.Text}get Translation(){return this.privTranslationHypothesis.Translation}get Language(){var t;return(t=this.privTranslationHypothesis.PrimaryLanguage)==null?void 0:t.Language}asJson(){const t={...this.privTranslationHypothesis};return t.Translation!==void 0?JSON.stringify({...t,TranslationStatus:Gd.TranslationStatus[t.Translation.TranslationStatus]}):JSON.stringify(t)}mapTranslationStatus(t){if(typeof t=="string")return Gd.TranslationStatus[t];if(typeof t=="number")return t}}dc.TranslationHypothesis=Sc;var bs={},xd;function qO(){if(xd)return bs;xd=1,Object.defineProperty(bs,"__esModule",{value:!0}),bs.TranslationPhrase=void 0;const e=Ie,t=se(),i=xa;let n=class Mg{constructor(s,A){this.privTranslationPhrase=s,this.privTranslationPhrase.Offset+=A,this.privTranslationPhrase.RecognitionStatus=this.mapRecognitionStatus(this.privTranslationPhrase.RecognitionStatus),this.privTranslationPhrase.Translation!==void 0&&(this.privTranslationPhrase.Translation.TranslationStatus=this.mapTranslationStatus(this.privTranslationPhrase.Translation.TranslationStatus))}static fromJSON(s,A){return new Mg(JSON.parse(s),A)}static fromTranslationResponse(s,A){e.Contracts.throwIfNullOrUndefined(s,"translationResponse");const r=s.SpeechPhrase;return s.SpeechPhrase=void 0,r.Translation=s,r.Text=r.DisplayText,new Mg(r,A)}get RecognitionStatus(){return this.privTranslationPhrase.RecognitionStatus}get Offset(){return this.privTranslationPhrase.Offset}get Duration(){return this.privTranslationPhrase.Duration}get Text(){return this.privTranslationPhrase.Text}get Language(){var s;return(s=this.privTranslationPhrase.PrimaryLanguage)==null?void 0:s.Language}get Confidence(){var s;return(s=this.privTranslationPhrase.PrimaryLanguage)==null?void 0:s.Confidence}get Translation(){return this.privTranslationPhrase.Translation}asJson(){const s={...this.privTranslationPhrase},A={...s,RecognitionStatus:t.RecognitionStatus[s.RecognitionStatus]};return s.Translation&&(A.Translation={...s.Translation,TranslationStatus:i.TranslationStatus[s.Translation.TranslationStatus]}),JSON.stringify(A)}mapRecognitionStatus(s){if(typeof s=="string")return t.RecognitionStatus[s];if(typeof s=="number")return s}mapTranslationStatus(s){if(typeof s=="string")return i.TranslationStatus[s];if(typeof s=="number")return s}};return bs.TranslationPhrase=n,bs}var Js={},jd;function VO(){if(jd)return Js;jd=1,Object.defineProperty(Js,"__esModule",{value:!0}),Js.TranslationServiceRecognizer=void 0;const e=ge(),t=q(),i=se();let n=class extends i.ConversationServiceRecognizer{constructor(s,A,r,a,c){super(s,A,r,a,c),this.privTranslationRecognizer=c,this.connectionEvents.attach(u=>{u.name==="ConnectionEstablishedEvent"&&this.privTranslationRecognizer.onConnection()})}async processTypeSpecificMessages(s){const A=new t.PropertyCollection;let r=await this.processSpeechMessages(s);if(r)return!0;const a=async u=>{if(A.setProperty(t.PropertyId.SpeechServiceResponse_JsonResult,u.asJson()),this.privRequestSession.onPhraseRecognized(u.Offset+u.Duration),u.RecognitionStatus===i.RecognitionStatus.Success){const l=this.fireEventForResult(u,A);if(this.privTranslationRecognizer.recognized)try{this.privTranslationRecognizer.recognized(this.privTranslationRecognizer,l)}catch{}if(this.privSuccessCallback){try{this.privSuccessCallback(l.result)}catch(g){this.privErrorCallback&&this.privErrorCallback(g)}this.privSuccessCallback=void 0,this.privErrorCallback=void 0}}else{const l=i.EnumTranslation.implTranslateRecognitionResult(u.RecognitionStatus),g=new t.TranslationRecognitionResult(void 0,this.privRequestSession.requestId,l,u.Text,u.Duration,u.Offset,u.Language,u.Confidence,void 0,u.asJson(),A);if(l===t.ResultReason.Canceled){const E=i.EnumTranslation.implTranslateCancelResult(u.RecognitionStatus),C=i.EnumTranslation.implTranslateCancelErrorCode(u.RecognitionStatus);await this.cancelRecognitionLocal(E,C,i.EnumTranslation.implTranslateErrorDetails(C))}else if(u.RecognitionStatus!==i.RecognitionStatus.EndOfDictation){const E=new t.TranslationRecognitionEventArgs(g,g.offset,this.privRequestSession.sessionId);if(this.privTranslationRecognizer.recognized)try{this.privTranslationRecognizer.recognized(this.privTranslationRecognizer,E)}catch{}if(this.privSuccessCallback){try{this.privSuccessCallback(g)}catch(C){this.privErrorCallback&&this.privErrorCallback(C)}this.privSuccessCallback=void 0,this.privErrorCallback=void 0}}r=!0}},c=u=>{A.setProperty(t.PropertyId.SpeechServiceResponse_JsonResult,u.asJson());const l=this.fireEventForResult(u,A);if(this.privRequestSession.onHypothesis(l.offset),this.privTranslationRecognizer.recognizing)try{this.privTranslationRecognizer.recognizing(this.privTranslationRecognizer,l)}catch{}r=!0};switch(s.messageType===e.MessageType.Text&&A.setProperty(t.PropertyId.SpeechServiceResponse_JsonResult,s.textBody),s.path.toLowerCase()){case"translation.hypothesis":c(i.TranslationHypothesis.fromJSON(s.textBody,this.privRequestSession.currentTurnAudioOffset));break;case"translation.response":const u=JSON.parse(s.textBody);if(u.SpeechPhrase)await a(i.TranslationPhrase.fromTranslationResponse(u,this.privRequestSession.currentTurnAudioOffset));else{const g=JSON.parse(s.textBody);g.SpeechHypothesis&&c(i.TranslationHypothesis.fromTranslationResponse(g,this.privRequestSession.currentTurnAudioOffset))}break;case"translation.phrase":await a(i.TranslationPhrase.fromJSON(s.textBody,this.privRequestSession.currentTurnAudioOffset));break;case"translation.synthesis":case"audio":this.sendSynthesisAudio(s.binaryBody,this.privRequestSession.sessionId),r=!0;break;case"audio.end":case"translation.synthesis.end":const l=i.TranslationSynthesisEnd.fromJSON(s.textBody);switch(l.SynthesisStatus){case i.SynthesisStatus.Error:if(this.privTranslationRecognizer.synthesizing){const g=new t.TranslationSynthesisResult(t.ResultReason.Canceled,void 0),E=new t.TranslationSynthesisEventArgs(g,this.privRequestSession.sessionId);try{this.privTranslationRecognizer.synthesizing(this.privTranslationRecognizer,E)}catch{}}if(this.privTranslationRecognizer.canceled){const g=new t.TranslationRecognitionCanceledEventArgs(this.privRequestSession.sessionId,t.CancellationReason.Error,l.FailureReason,t.CancellationErrorCode.ServiceError,null);try{this.privTranslationRecognizer.canceled(this.privTranslationRecognizer,g)}catch{}}break;case i.SynthesisStatus.Success:this.sendSynthesisAudio(void 0,this.privRequestSession.sessionId);break}r=!0;break}return r}cancelRecognition(s,A,r,a,c){const u=new t.PropertyCollection;if(u.setProperty(i.CancellationErrorCodePropertyName,t.CancellationErrorCode[a]),this.privTranslationRecognizer.canceled){const l=new t.TranslationRecognitionCanceledEventArgs(s,r,c,a,void 0);try{this.privTranslationRecognizer.canceled(this.privTranslationRecognizer,l)}catch{}}if(this.privSuccessCallback){const l=new t.TranslationRecognitionResult(void 0,A,t.ResultReason.Canceled,void 0,void 0,void 0,void 0,void 0,c,void 0,u);try{this.privSuccessCallback(l),this.privSuccessCallback=void 0}catch{}}}handleRecognizingCallback(s,A,r){try{const a=new t.TranslationRecognitionEventArgs(t.TranslationRecognitionResult.fromSpeechRecognitionResult(s),A,r);this.privTranslationRecognizer.recognizing(this.privTranslationRecognizer,a)}catch{}}handleRecognizedCallback(s,A,r){try{const a=new t.TranslationRecognitionEventArgs(t.TranslationRecognitionResult.fromSpeechRecognitionResult(s),A,r);this.privTranslationRecognizer.recognized(this.privTranslationRecognizer,a)}catch{}}fireEventForResult(s,A){let r;if(s.Translation.Translations!==void 0){r=new t.Translations;for(const E of s.Translation.Translations)r.set(E.Language,E.Text||E.DisplayText)}let a,c;s instanceof i.TranslationPhrase?(s.Translation&&s.Translation.TranslationStatus===e.TranslationStatus.Success?a=t.ResultReason.TranslatedSpeech:a=t.ResultReason.RecognizedSpeech,c=s.Confidence):a=t.ResultReason.TranslatingSpeech;const u=s.Language,l=new t.TranslationRecognitionResult(r,this.privRequestSession.requestId,a,s.Text,s.Duration,s.Offset,u,c,s.Translation.FailureReason,s.asJson(),A);return new t.TranslationRecognitionEventArgs(l,s.Offset,this.privRequestSession.sessionId)}sendSynthesisAudio(s,A){const r=s===void 0?t.ResultReason.SynthesizingAudioCompleted:t.ResultReason.SynthesizingAudio,a=new t.TranslationSynthesisResult(r,s),c=new t.TranslationSynthesisEventArgs(a,A);if(this.privTranslationRecognizer.synthesizing)try{this.privTranslationRecognizer.synthesizing(this.privTranslationRecognizer,c)}catch{}}};return Js.TranslationServiceRecognizer=n,Js}var Mc={};Object.defineProperty(Mc,"__esModule",{value:!0}),Mc.SpeechDetected=void 0;class bl{constructor(t,i){this.privSpeechStartDetected=JSON.parse(t),this.privSpeechStartDetected.Offset+=i}static fromJSON(t,i){return new bl(t,i)}get Offset(){return this.privSpeechStartDetected.Offset}}Mc.SpeechDetected=bl;var Bc={};Object.defineProperty(Bc,"__esModule",{value:!0}),Bc.SpeechHypothesis=void 0;class Jl{constructor(t,i){this.privSpeechHypothesis=JSON.parse(t),this.updateOffset(i)}static fromJSON(t,i){return new Jl(t,i)}updateOffset(t){this.privSpeechHypothesis.Offset+=t}asJson(){return JSON.stringify(this.privSpeechHypothesis)}get Text(){return this.privSpeechHypothesis.Text}get Offset(){return this.privSpeechHypothesis.Offset}get Duration(){return this.privSpeechHypothesis.Duration}get Language(){return this.privSpeechHypothesis.PrimaryLanguage===void 0?void 0:this.privSpeechHypothesis.PrimaryLanguage.Language}get LanguageDetectionConfidence(){return this.privSpeechHypothesis.PrimaryLanguage===void 0?void 0:this.privSpeechHypothesis.PrimaryLanguage.Confidence}get SpeakerId(){return this.privSpeechHypothesis.SpeakerId}}Bc.SpeechHypothesis=Jl;var vc={};Object.defineProperty(vc,"__esModule",{value:!0}),vc.SpeechKeyword=void 0;class Hl{constructor(t,i){this.privSpeechKeyword=JSON.parse(t),this.privSpeechKeyword.Offset+=i}static fromJSON(t,i){return new Hl(t,i)}get Status(){return this.privSpeechKeyword.Status}get Text(){return this.privSpeechKeyword.Text}get Offset(){return this.privSpeechKeyword.Offset}get Duration(){return this.privSpeechKeyword.Duration}asJson(){return JSON.stringify(this.privSpeechKeyword)}}vc.SpeechKeyword=Hl;var Hs={},kd;function WO(){if(kd)return Hs;kd=1,Object.defineProperty(Hs,"__esModule",{value:!0}),Hs.SpeechServiceRecognizer=void 0;const e=q(),t=se();let i=class extends t.ServiceRecognizerBase{constructor(o,s,A,r,a){super(o,s,A,r,a),this.privSpeechRecognizer=a}async processTypeSpecificMessages(o){let s;const A=new e.PropertyCollection;let r=!1;switch(o.path.toLowerCase()){case"speech.hypothesis":case"speech.fragment":const a=t.SpeechHypothesis.fromJSON(o.textBody,this.privRequestSession.currentTurnAudioOffset);A.setProperty(e.PropertyId.SpeechServiceResponse_JsonResult,a.asJson()),s=new e.SpeechRecognitionResult(this.privRequestSession.requestId,e.ResultReason.RecognizingSpeech,a.Text,a.Duration,a.Offset,a.Language,a.LanguageDetectionConfidence,void 0,void 0,a.asJson(),A),this.privRequestSession.onHypothesis(a.Offset);const c=new e.SpeechRecognitionEventArgs(s,a.Offset,this.privRequestSession.sessionId);if(this.privSpeechRecognizer.recognizing)try{this.privSpeechRecognizer.recognizing(this.privSpeechRecognizer,c)}catch{}r=!0;break;case"speech.phrase":const u=t.SimpleSpeechPhrase.fromJSON(o.textBody,this.privRequestSession.currentTurnAudioOffset);A.setProperty(e.PropertyId.SpeechServiceResponse_JsonResult,u.asJson());const l=t.EnumTranslation.implTranslateRecognitionResult(u.RecognitionStatus,this.privExpectContentAssessmentResponse);if(this.privRequestSession.onPhraseRecognized(u.Offset+u.Duration),e.ResultReason.Canceled===l){const g=t.EnumTranslation.implTranslateCancelResult(u.RecognitionStatus),E=t.EnumTranslation.implTranslateCancelErrorCode(u.RecognitionStatus);await this.cancelRecognitionLocal(g,E,t.EnumTranslation.implTranslateErrorDetails(E))}else{if(u.RecognitionStatus===t.RecognitionStatus.EndOfDictation)break;if(this.privRecognizerConfig.parameters.getProperty(t.OutputFormatPropertyName)===e.OutputFormat[e.OutputFormat.Simple])s=new e.SpeechRecognitionResult(this.privRequestSession.requestId,l,u.DisplayText,u.Duration,u.Offset,u.Language,u.LanguageDetectionConfidence,void 0,void 0,u.asJson(),A);else{const E=t.DetailedSpeechPhrase.fromJSON(o.textBody,this.privRequestSession.currentTurnAudioOffset);A.setProperty(e.PropertyId.SpeechServiceResponse_JsonResult,E.asJson()),s=new e.SpeechRecognitionResult(this.privRequestSession.requestId,l,E.RecognitionStatus===t.RecognitionStatus.Success?E.NBest[0].Display:"",E.Duration,E.Offset,E.Language,E.LanguageDetectionConfidence,void 0,void 0,E.asJson(),A)}const g=new e.SpeechRecognitionEventArgs(s,s.offset,this.privRequestSession.sessionId);if(this.privSpeechRecognizer.recognized)try{this.privSpeechRecognizer.recognized(this.privSpeechRecognizer,g)}catch{}if(this.privSuccessCallback){try{this.privSuccessCallback(s)}catch(E){this.privErrorCallback&&this.privErrorCallback(E)}this.privSuccessCallback=void 0,this.privErrorCallback=void 0}}r=!0;break}return r}cancelRecognition(o,s,A,r,a){const c=new e.PropertyCollection;if(c.setProperty(t.CancellationErrorCodePropertyName,e.CancellationErrorCode[r]),this.privSpeechRecognizer.canceled){const u=new e.SpeechRecognitionCanceledEventArgs(A,a,r,void 0,o);try{this.privSpeechRecognizer.canceled(this.privSpeechRecognizer,u)}catch{}}if(this.privSuccessCallback){const u=new e.SpeechRecognitionResult(s,e.ResultReason.Canceled,void 0,void 0,void 0,void 0,void 0,void 0,a,void 0,c);try{this.privSuccessCallback(u),this.privSuccessCallback=void 0}catch{}}}};return Hs.SpeechServiceRecognizer=i,Hs}var qs={},Yd={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.IdentityProvider=e.SpeakerDiarizationMode=void 0,function(t){t.None="None",t.Identity="Identity",t.Anonymous="Anonymous"}(e.SpeakerDiarizationMode||(e.SpeakerDiarizationMode={})),function(t){t.CallCenter="CallCenter"}(e.IdentityProvider||(e.IdentityProvider={}))})(Yd);var zd;function ZO(){if(zd)return qs;zd=1,Object.defineProperty(qs,"__esModule",{value:!0}),qs.ConversationTranscriptionServiceRecognizer=void 0;const e=q(),t=se(),i=Yd,n=Pt;let o=class extends t.ServiceRecognizerBase{constructor(A,r,a,c,u){super(A,r,a,c,u),this.privConversationTranscriber=u,this.setSpeakerDiarizationJson()}setSpeakerDiarizationJson(){if(this.privEnableSpeakerId){const A=this.privSpeechContext.getContext().phraseDetection||{};A.mode=n.RecognitionMode.Conversation;const r={};r.mode=i.SpeakerDiarizationMode.Anonymous,r.audioSessionId=this.privDiarizationSessionId,r.audioOffsetMs=0,r.diarizeIntermediates=this.privRecognizerConfig.parameters.getProperty(e.PropertyId.SpeechServiceResponse_DiarizeIntermediateResults,"false")==="true",A.speakerDiarization=r,this.privSpeechContext.getContext().phraseDetection=A}}async processTypeSpecificMessages(A){let r;const a=new e.PropertyCollection;a.setProperty(e.PropertyId.SpeechServiceResponse_JsonResult,A.textBody);let c=!1;switch(A.path.toLowerCase()){case"speech.hypothesis":case"speech.fragment":const u=t.SpeechHypothesis.fromJSON(A.textBody,this.privRequestSession.currentTurnAudioOffset);r=new e.ConversationTranscriptionResult(this.privRequestSession.requestId,e.ResultReason.RecognizingSpeech,u.Text,u.Duration,u.Offset,u.Language,u.LanguageDetectionConfidence,u.SpeakerId,void 0,u.asJson(),a),this.privRequestSession.onHypothesis(u.Offset);const l=new e.ConversationTranscriptionEventArgs(r,u.Duration,this.privRequestSession.sessionId);if(this.privConversationTranscriber.transcribing)try{this.privConversationTranscriber.transcribing(this.privConversationTranscriber,l)}catch{}c=!0;break;case"speech.phrase":const g=t.SimpleSpeechPhrase.fromJSON(A.textBody,this.privRequestSession.currentTurnAudioOffset),E=t.EnumTranslation.implTranslateRecognitionResult(g.RecognitionStatus);if(this.privRequestSession.onPhraseRecognized(g.Offset+g.Duration),e.ResultReason.Canceled===E){const C=t.EnumTranslation.implTranslateCancelResult(g.RecognitionStatus),d=t.EnumTranslation.implTranslateCancelErrorCode(g.RecognitionStatus);await this.cancelRecognitionLocal(C,d,t.EnumTranslation.implTranslateErrorDetails(d))}else if(!(this.privRequestSession.isSpeechEnded&&E===e.ResultReason.NoMatch&&g.RecognitionStatus!==t.RecognitionStatus.InitialSilenceTimeout)){if(this.privRecognizerConfig.parameters.getProperty(t.OutputFormatPropertyName)===e.OutputFormat[e.OutputFormat.Simple])r=new e.ConversationTranscriptionResult(this.privRequestSession.requestId,E,g.DisplayText,g.Duration,g.Offset,g.Language,g.LanguageDetectionConfidence,g.SpeakerId,void 0,g.asJson(),a);else{const d=t.DetailedSpeechPhrase.fromJSON(A.textBody,this.privRequestSession.currentTurnAudioOffset);r=new e.ConversationTranscriptionResult(this.privRequestSession.requestId,E,d.RecognitionStatus===t.RecognitionStatus.Success?d.NBest[0].Display:void 0,d.Duration,d.Offset,d.Language,d.LanguageDetectionConfidence,g.SpeakerId,void 0,d.asJson(),a)}const C=new e.ConversationTranscriptionEventArgs(r,r.offset,this.privRequestSession.sessionId);if(this.privConversationTranscriber.transcribed)try{this.privConversationTranscriber.transcribed(this.privConversationTranscriber,C)}catch{}}c=!0;break}return c}cancelRecognition(A,r,a,c,u){if(new e.PropertyCollection().setProperty(t.CancellationErrorCodePropertyName,e.CancellationErrorCode[c]),this.privConversationTranscriber.canceled){const g=new e.ConversationTranscriptionCanceledEventArgs(a,u,c,void 0,A);try{this.privConversationTranscriber.canceled(this.privConversationTranscriber,g)}catch{}}}};return qs.ConversationTranscriptionServiceRecognizer=o,qs}var Vs={},Pd;function XO(){if(Pd)return Vs;Pd=1,Object.defineProperty(Vs,"__esModule",{value:!0}),Vs.TranscriptionServiceRecognizer=void 0;const e=ge(),t=q(),i=se(),n=Oi;let o=class extends i.ConversationServiceRecognizer{constructor(A,r,a,c,u){super(A,r,a,c,u),this.privTranscriberRecognizer=u,this.sendPrePayloadJSONOverride=l=>this.sendTranscriptionStartJSON(l),this.privRecognizerConfig.parameters.getProperty(t.PropertyId.SpeechServiceResponse_RequestWordLevelTimestamps)==="true"&&this.privSpeechContext.setWordLevelTimings()}async sendSpeechEventAsync(A,r){if(this.privRequestSession.isRecognizing){const a=await this.fetchConnection();await this.sendSpeechEvent(a,this.createSpeechEventPayload(A,r))}}async sendMeetingSpeechEventAsync(A,r){if(this.privRequestSession.isRecognizing){const a=await this.fetchConnection();await this.sendSpeechEvent(a,this.createMeetingSpeechEventPayload(A,r))}}processTypeSpecificMessages(A){return this.processSpeechMessages(A)}handleRecognizedCallback(A,r,a){try{const c=new t.SpeechRecognitionEventArgs(A,r,a);if(this.privTranscriberRecognizer.recognized(this.privTranscriberRecognizer,c),this.privSuccessCallback){try{this.privSuccessCallback(A)}catch(u){this.privErrorCallback&&this.privErrorCallback(u)}this.privSuccessCallback=void 0,this.privErrorCallback=void 0}}catch{}}handleRecognizingCallback(A,r,a){try{const c=new t.SpeechRecognitionEventArgs(A,r,a);this.privTranscriberRecognizer.recognizing(this.privTranscriberRecognizer,c)}catch{}}cancelRecognition(A,r,a,c,u){const l=new t.PropertyCollection;if(l.setProperty(i.CancellationErrorCodePropertyName,t.CancellationErrorCode[c]),this.privTranscriberRecognizer.IsMeetingRecognizer()){if(this.privTranscriberRecognizer.canceled){const g=new t.MeetingTranscriptionCanceledEventArgs(a,u,c,void 0,A);try{this.privTranscriberRecognizer.canceled(this.privTranscriberRecognizer,g)}catch{}}}else if(this.privTranscriberRecognizer.canceled){const g=new t.ConversationTranscriptionCanceledEventArgs(a,u,c,void 0,A);try{this.privTranscriberRecognizer.canceled(this.privTranscriberRecognizer,g)}catch{}}if(this.privSuccessCallback){const g=new t.SpeechRecognitionResult(r,t.ResultReason.Canceled,void 0,void 0,void 0,void 0,void 0,void 0,u,void 0,l);try{this.privSuccessCallback(g),this.privSuccessCallback=void 0}catch{}}}async sendTranscriptionStartJSON(A){if(await this.sendSpeechContext(A,!0),this.privTranscriberRecognizer.IsMeetingRecognizer()){const r=this.privTranscriberRecognizer.getMeetingInfo(),a=this.createMeetingSpeechEventPayload(r,"start");await this.sendSpeechEvent(A,a)}else{const r=this.privTranscriberRecognizer.getConversationInfo(),a=this.createSpeechEventPayload(r,"start");await this.sendSpeechEvent(A,a)}await this.sendWaveHeader(A)}sendSpeechEvent(A,r){const a=JSON.stringify(r);if(a)return A.send(new n.SpeechConnectionMessage(e.MessageType.Text,"speech.event",this.privRequestSession.requestId,"application/json",a))}createSpeechEventPayload(A,r){const a={id:"meeting",name:r,meeting:A.conversationProperties};return a.meeting.id=A.id,a.meeting.attendees=A.participants,a}createMeetingSpeechEventPayload(A,r){const a={id:"meeting",name:r,meeting:A.meetingProperties};return a.meeting.id=A.id,a.meeting.attendees=A.participants,a}};return Vs.TranscriptionServiceRecognizer=o,Vs}var Ws={},bd;function _O(){if(bd)return Ws;bd=1,Object.defineProperty(Ws,"__esModule",{value:!0}),Ws.DetailedSpeechPhrase=void 0;const e=se();let t=class ZS{constructor(n,o){this.privDetailedSpeechPhrase=JSON.parse(n),this.privDetailedSpeechPhrase.RecognitionStatus=this.mapRecognitionStatus(this.privDetailedSpeechPhrase.RecognitionStatus),this.updateOffsets(o)}static fromJSON(n,o){return new ZS(n,o)}updateOffsets(n){if(this.privDetailedSpeechPhrase.Offset+=n,this.privDetailedSpeechPhrase.NBest)for(const o of this.privDetailedSpeechPhrase.NBest){if(o.Words)for(const s of o.Words)s.Offset+=n;if(o.DisplayWords)for(const s of o.DisplayWords)s.Offset+=n}}asJson(){const n={...this.privDetailedSpeechPhrase};return JSON.stringify({...n,RecognitionStatus:e.RecognitionStatus[n.RecognitionStatus]})}get RecognitionStatus(){return this.privDetailedSpeechPhrase.RecognitionStatus}get NBest(){return this.privDetailedSpeechPhrase.NBest}get Duration(){return this.privDetailedSpeechPhrase.Duration}get Offset(){return this.privDetailedSpeechPhrase.Offset}get Language(){return this.privDetailedSpeechPhrase.PrimaryLanguage===void 0?void 0:this.privDetailedSpeechPhrase.PrimaryLanguage.Language}get LanguageDetectionConfidence(){return this.privDetailedSpeechPhrase.PrimaryLanguage===void 0?void 0:this.privDetailedSpeechPhrase.PrimaryLanguage.Confidence}get Text(){return this.privDetailedSpeechPhrase.NBest&&this.privDetailedSpeechPhrase.NBest[0]?this.privDetailedSpeechPhrase.NBest[0].Display||this.privDetailedSpeechPhrase.NBest[0].DisplayText:this.privDetailedSpeechPhrase.DisplayText}get SpeakerId(){return this.privDetailedSpeechPhrase.SpeakerId}mapRecognitionStatus(n){if(typeof n=="string")return e.RecognitionStatus[n];if(typeof n=="number")return n}};return Ws.DetailedSpeechPhrase=t,Ws}var Zs={},Jd;function $O(){if(Jd)return Zs;Jd=1,Object.defineProperty(Zs,"__esModule",{value:!0}),Zs.SimpleSpeechPhrase=void 0;const e=se();let t=class XS{constructor(n,o=0){this.privSimpleSpeechPhrase=JSON.parse(n),this.privSimpleSpeechPhrase.RecognitionStatus=this.mapRecognitionStatus(this.privSimpleSpeechPhrase.RecognitionStatus),this.updateOffset(o)}static fromJSON(n,o){return new XS(n,o)}updateOffset(n){this.privSimpleSpeechPhrase.Offset+=n}asJson(){const n={...this.privSimpleSpeechPhrase};return JSON.stringify({...n,RecognitionStatus:e.RecognitionStatus[n.RecognitionStatus]})}get RecognitionStatus(){return this.privSimpleSpeechPhrase.RecognitionStatus}get DisplayText(){return this.privSimpleSpeechPhrase.DisplayText}get Offset(){return this.privSimpleSpeechPhrase.Offset}get Duration(){return this.privSimpleSpeechPhrase.Duration}get Language(){return this.privSimpleSpeechPhrase.PrimaryLanguage===void 0?void 0:this.privSimpleSpeechPhrase.PrimaryLanguage.Language}get LanguageDetectionConfidence(){return this.privSimpleSpeechPhrase.PrimaryLanguage===void 0?void 0:this.privSimpleSpeechPhrase.PrimaryLanguage.Confidence}get SpeakerId(){return this.privSimpleSpeechPhrase.SpeakerId}mapRecognitionStatus(n){if(typeof n=="string")return e.RecognitionStatus[n];if(typeof n=="number")return n}};return Zs.SimpleSpeechPhrase=t,Zs}var fc={};Object.defineProperty(fc,"__esModule",{value:!0}),fc.AddedLmIntent=void 0;class eU{constructor(t,i){this.modelImpl=t,this.intentName=i}}fc.AddedLmIntent=eU;var Xs={},Hd;function tU(){if(Hd)return Xs;Hd=1,Object.defineProperty(Xs,"__esModule",{value:!0}),Xs.IntentServiceRecognizer=void 0;const e=ge(),t=q(),i=se();let n=class extends i.ServiceRecognizerBase{constructor(s,A,r,a,c){super(s,A,r,a,c),this.privIntentRecognizer=c,this.privIntentDataSent=!1,a.recognitionEndpointVersion="1"}setIntents(s,A){this.privAddedLmIntents=s,this.privUmbrellaIntent=A,this.privIntentDataSent=!0}processTypeSpecificMessages(s){let A,r,a=!1;const c=new t.PropertyCollection;switch(s.messageType===e.MessageType.Text&&c.setProperty(t.PropertyId.SpeechServiceResponse_JsonResult,s.textBody),s.path.toLowerCase()){case"speech.hypothesis":const l=i.SpeechHypothesis.fromJSON(s.textBody,this.privRequestSession.currentTurnAudioOffset);if(A=new t.IntentRecognitionResult(void 0,this.privRequestSession.requestId,t.ResultReason.RecognizingIntent,l.Text,l.Duration,l.Offset,l.Language,l.LanguageDetectionConfidence,void 0,l.asJson(),c),this.privRequestSession.onHypothesis(A.offset),r=new t.IntentRecognitionEventArgs(A,l.Offset,this.privRequestSession.sessionId),this.privIntentRecognizer.recognizing)try{this.privIntentRecognizer.recognizing(this.privIntentRecognizer,r)}catch{}a=!0;break;case"speech.phrase":const g=i.SimpleSpeechPhrase.fromJSON(s.textBody,this.privRequestSession.currentTurnAudioOffset);A=new t.IntentRecognitionResult(void 0,this.privRequestSession.requestId,i.EnumTranslation.implTranslateRecognitionResult(g.RecognitionStatus),g.DisplayText,g.Duration,g.Offset,g.Language,g.LanguageDetectionConfidence,void 0,g.asJson(),c),r=new t.IntentRecognitionEventArgs(A,A.offset,this.privRequestSession.sessionId);const E=()=>{if(this.privIntentRecognizer.recognized)try{this.privIntentRecognizer.recognized(this.privIntentRecognizer,r)}catch{}if(this.privSuccessCallback){try{this.privSuccessCallback(A)}catch(d){this.privErrorCallback&&this.privErrorCallback(d)}this.privSuccessCallback=void 0,this.privErrorCallback=void 0}};this.privIntentDataSent===!1||t.ResultReason.NoMatch===r.result.reason?(this.privRequestSession.onPhraseRecognized(r.offset+r.result.duration),E()):this.privPendingIntentArgs=r,a=!0;break;case"response":if(r=this.privPendingIntentArgs,this.privPendingIntentArgs=void 0,r===void 0){if(s.textBody==="")return;r=new t.IntentRecognitionEventArgs(new t.IntentRecognitionResult,0,this.privRequestSession.sessionId)}const C=i.IntentResponse.fromJSON(s.textBody);if(C!==null&&C.topScoringIntent&&C.topScoringIntent.intent){let d=this.privAddedLmIntents[C.topScoringIntent.intent];if(this.privUmbrellaIntent!==void 0&&(d=this.privUmbrellaIntent),d){const S=d===void 0||d.intentName===void 0?C.topScoringIntent.intent:d.intentName;let I=r.result.reason;S!==void 0&&(I=t.ResultReason.RecognizedIntent);const p=r.result.properties!==void 0?r.result.properties:new t.PropertyCollection;p.setProperty(t.PropertyId.LanguageUnderstandingServiceResponse_JsonResult,s.textBody),r=new t.IntentRecognitionEventArgs(new t.IntentRecognitionResult(S,r.result.resultId,I,r.result.text,r.result.duration,r.result.offset,void 0,void 0,r.result.errorDetails,r.result.json,p),r.offset,r.sessionId)}}if(this.privRequestSession.onPhraseRecognized(r.offset+r.result.duration),this.privIntentRecognizer.recognized)try{this.privIntentRecognizer.recognized(this.privIntentRecognizer,r)}catch{}if(this.privSuccessCallback){try{this.privSuccessCallback(r.result)}catch(d){this.privErrorCallback&&this.privErrorCallback(d)}this.privSuccessCallback=void 0,this.privErrorCallback=void 0}a=!0;break}const u=new e.Deferred;return u.resolve(a),u.promise}cancelRecognition(s,A,r,a,c){const u=new t.PropertyCollection;if(u.setProperty(i.CancellationErrorCodePropertyName,t.CancellationErrorCode[a]),this.privIntentRecognizer.canceled){const l=new t.IntentRecognitionCanceledEventArgs(r,c,a,void 0,void 0,s);try{this.privIntentRecognizer.canceled(this.privIntentRecognizer,l)}catch{}}if(this.privSuccessCallback){const l=new t.IntentRecognitionResult(void 0,A,t.ResultReason.Canceled,void 0,void 0,void 0,void 0,void 0,c,void 0,u);try{this.privSuccessCallback(l),this.privSuccessCallback=void 0}catch{}}}};return Xs.IntentServiceRecognizer=n,Xs}var wc={};Object.defineProperty(wc,"__esModule",{value:!0}),wc.IntentResponse=void 0;class ql{constructor(t){t===""?this.privIntentResponse={}:this.privIntentResponse=JSON.parse(t)}static fromJSON(t){return new ql(t)}get query(){return this.privIntentResponse.query}get topScoringIntent(){return this.privIntentResponse.topScoringIntent}get entities(){return this.privIntentResponse.entities}}wc.IntentResponse=ql;var qd={};Object.defineProperty(qd,"__esModule",{value:!0});var Qc={},Rc={};Object.defineProperty(Rc,"__esModule",{value:!0}),Rc.ServiceTelemetryListener=void 0;const Ni=ge(),Vd=Ic;class iU{constructor(t,i,n){this.privIsDisposed=!1,this.privListeningTriggerMetric=null,this.privMicMetric=null,this.privConnectionEstablishMetric=null,this.privRequestId=t,this.privAudioSourceId=i,this.privAudioNodeId=n,this.privReceivedMessages={},this.privPhraseLatencies=[],this.privHypothesisLatencies=[]}phraseReceived(t){t>0&&this.privPhraseLatencies.push(Date.now()-t)}hypothesisReceived(t){t>0&&this.privHypothesisLatencies.push(Date.now()-t)}onEvent(t){if(!this.privIsDisposed&&(t instanceof Vd.RecognitionTriggeredEvent&&t.requestId===this.privRequestId&&(this.privListeningTriggerMetric={End:t.eventTime,Name:"ListeningTrigger",Start:t.eventTime}),t instanceof Ni.AudioStreamNodeAttachingEvent&&t.audioSourceId===this.privAudioSourceId&&t.audioNodeId===this.privAudioNodeId&&(this.privMicStartTime=t.eventTime),t instanceof Ni.AudioStreamNodeAttachedEvent&&t.audioSourceId===this.privAudioSourceId&&t.audioNodeId===this.privAudioNodeId&&(this.privMicStartTime=t.eventTime),t instanceof Ni.AudioSourceErrorEvent&&t.audioSourceId===this.privAudioSourceId&&(this.privMicMetric||(this.privMicMetric={End:t.eventTime,Error:t.error,Name:"Microphone",Start:this.privMicStartTime})),t instanceof Ni.AudioStreamNodeErrorEvent&&t.audioSourceId===this.privAudioSourceId&&t.audioNodeId===this.privAudioNodeId&&(this.privMicMetric||(this.privMicMetric={End:t.eventTime,Error:t.error,Name:"Microphone",Start:this.privMicStartTime})),t instanceof Ni.AudioStreamNodeDetachedEvent&&t.audioSourceId===this.privAudioSourceId&&t.audioNodeId===this.privAudioNodeId&&(this.privMicMetric||(this.privMicMetric={End:t.eventTime,Name:"Microphone",Start:this.privMicStartTime})),t instanceof Vd.ConnectingToServiceEvent&&t.requestId===this.privRequestId&&(this.privConnectionId=t.sessionId),t instanceof Ni.ConnectionStartEvent&&t.connectionId===this.privConnectionId&&(this.privConnectionStartTime=t.eventTime),t instanceof Ni.ConnectionEstablishedEvent&&t.connectionId===this.privConnectionId&&(this.privConnectionEstablishMetric||(this.privConnectionEstablishMetric={End:t.eventTime,Id:this.privConnectionId,Name:"Connection",Start:this.privConnectionStartTime})),t instanceof Ni.ConnectionEstablishErrorEvent&&t.connectionId===this.privConnectionId&&(this.privConnectionEstablishMetric||(this.privConnectionEstablishMetric={End:t.eventTime,Error:this.getConnectionError(t.statusCode),Id:this.privConnectionId,Name:"Connection",Start:this.privConnectionStartTime})),t instanceof Ni.ConnectionMessageReceivedEvent&&t.connectionId===this.privConnectionId&&t.message&&t.message.headers&&t.message.headers.path)){this.privReceivedMessages[t.message.headers.path]||(this.privReceivedMessages[t.message.headers.path]=new Array);const i=50;this.privReceivedMessages[t.message.headers.path].length<i&&this.privReceivedMessages[t.message.headers.path].push(t.networkReceivedTime)}}getTelemetry(){const t=new Array;this.privListeningTriggerMetric&&t.push(this.privListeningTriggerMetric),this.privMicMetric&&t.push(this.privMicMetric),this.privConnectionEstablishMetric&&t.push(this.privConnectionEstablishMetric),this.privPhraseLatencies.length>0&&t.push({PhraseLatencyMs:this.privPhraseLatencies}),this.privHypothesisLatencies.length>0&&t.push({FirstHypothesisLatencyMs:this.privHypothesisLatencies});const i={Metrics:t,ReceivedMessages:this.privReceivedMessages},n=JSON.stringify(i);return this.privReceivedMessages={},this.privListeningTriggerMetric=null,this.privMicMetric=null,this.privConnectionEstablishMetric=null,this.privPhraseLatencies=[],this.privHypothesisLatencies=[],n}get hasTelemetry(){return Object.keys(this.privReceivedMessages).length!==0||this.privListeningTriggerMetric!==null||this.privMicMetric!==null||this.privConnectionEstablishMetric!==null||this.privPhraseLatencies.length!==0||this.privHypothesisLatencies.length!==0}dispose(){this.privIsDisposed=!0}getConnectionError(t){switch(t){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:"+t.toString()}}}Rc.ServiceTelemetryListener=iU,Object.defineProperty(Qc,"__esModule",{value:!0}),Qc.RequestSession=void 0;const Qr=ge(),mc=Ic,nU=Rc;class rU{constructor(t){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.privRecognitionBytesSent=0,this.privRecogNumber=0,this.privInTurn=!1,this.privConnectionAttempts=0,this.privAudioSourceId=t,this.privRequestId=(0,Qr.createNoDashGuid)(),this.privAudioNodeId=(0,Qr.createNoDashGuid)(),this.privTurnDeferral=new Qr.Deferred,this.privTurnDeferral.resolve()}get sessionId(){return this.privSessionId}get requestId(){return this.privRequestId}get audioNodeId(){return this.privAudioNodeId}get turnCompletionPromise(){return this.privTurnDeferral.promise}get isSpeechEnded(){return this.privIsSpeechEnded}get isRecognizing(){return this.privIsRecognizing}get currentTurnAudioOffset(){return this.privTurnStartAudioOffset}get recogNumber(){return this.privRecogNumber}get numConnectionAttempts(){return this.privConnectionAttempts}get bytesSent(){return this.privBytesSent}get recognitionBytesSent(){return this.privRecognitionBytesSent}listenForServiceTelemetry(t){this.privServiceTelemetryListener&&this.privDetachables.push(t.attachListener(this.privServiceTelemetryListener))}startNewRecognition(){this.privRecognitionBytesSent=0,this.privIsSpeechEnded=!1,this.privIsRecognizing=!0,this.privTurnStartAudioOffset=0,this.privLastRecoOffset=0,this.privRecogNumber++,this.privServiceTelemetryListener=new nU.ServiceTelemetryListener(this.privRequestId,this.privAudioSourceId,this.privAudioNodeId),this.onEvent(new mc.RecognitionTriggeredEvent(this.requestId,this.privSessionId,this.privAudioSourceId,this.privAudioNodeId))}async onAudioSourceAttachCompleted(t,i){this.privAudioNode=t,this.privIsAudioNodeDetached=!1,i?await this.onComplete():this.onEvent(new mc.ListeningStartedEvent(this.privRequestId,this.privSessionId,this.privAudioSourceId,this.privAudioNodeId))}onPreConnectionStart(t,i){this.privAuthFetchEventId=t,this.privSessionId=i,this.onEvent(new mc.ConnectingToServiceEvent(this.privRequestId,this.privAuthFetchEventId,this.privSessionId))}async onAuthCompleted(t){t&&await this.onComplete()}async onConnectionEstablishCompleted(t,i){if(t===200){this.onEvent(new mc.RecognitionStartedEvent(this.requestId,this.privAudioSourceId,this.privAudioNodeId,this.privAuthFetchEventId,this.privSessionId)),this.privAudioNode&&this.privAudioNode.replay(),this.privTurnStartAudioOffset=this.privLastRecoOffset,this.privBytesSent=0;return}else t===403&&await this.onComplete()}async onServiceTurnEndResponse(t){this.privTurnDeferral.resolve(),!t||this.isSpeechEnded?(await this.onComplete(),this.privInTurn=!1):(this.privTurnStartAudioOffset=this.privLastRecoOffset,this.privAudioNode.replay())}onSpeechContext(){this.privRequestId=(0,Qr.createNoDashGuid)()}onServiceTurnStartResponse(){this.privTurnDeferral&&this.privInTurn&&(this.privTurnDeferral.reject("Another turn started before current completed."),this.privTurnDeferral.promise.then().catch(()=>{})),this.privInTurn=!0,this.privTurnDeferral=new Qr.Deferred}onHypothesis(t){this.privHypothesisReceived||(this.privHypothesisReceived=!0,this.privServiceTelemetryListener.hypothesisReceived(this.privAudioNode.findTimeAtOffset(t)))}onPhraseRecognized(t){this.privServiceTelemetryListener.phraseReceived(this.privAudioNode.findTimeAtOffset(t)),this.onServiceRecognized(t)}onServiceRecognized(t){this.privLastRecoOffset=t,this.privHypothesisReceived=!1,this.privAudioNode.shrinkBuffers(t),this.privConnectionAttempts=0}onAudioSent(t){this.privBytesSent+=t,this.privRecognitionBytesSent+=t}onRetryConnection(){this.privConnectionAttempts++}async dispose(){if(!this.privIsDisposed){this.privIsDisposed=!0;for(const t of this.privDetachables)await t.detach();this.privServiceTelemetryListener&&this.privServiceTelemetryListener.dispose(),this.privIsRecognizing=!1}}getTelemetry(){return this.privServiceTelemetryListener.hasTelemetry?this.privServiceTelemetryListener.getTelemetry():null}async onStopRecognizing(){await this.onComplete()}onSpeechEnded(){this.privIsSpeechEnded=!0}onEvent(t){this.privServiceTelemetryListener&&this.privServiceTelemetryListener.onEvent(t),Qr.Events.instance.onEvent(t)}async onComplete(){this.privIsRecognizing&&(this.privIsRecognizing=!1,await this.detachAudioNode())}async detachAudioNode(){this.privIsAudioNodeDetached||(this.privIsAudioNodeDetached=!0,this.privAudioNode&&await this.privAudioNode.detach())}}Qc.RequestSession=rU;var Dc={},Wd={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.TentativePhraseResultsOption=e.OutputFormat=e.PhraseExtension=e.PhraseOption=void 0,function(t){t.WordTimings="WordTimings",t.SNR="SNR",t.Pronunciation="Pronunciation",t.WordPronunciation="WordPronunciation",t.WordConfidence="WordConfidence",t.Words="Words",t.Sentiment="Sentiment",t.PronunciationAssessment="PronunciationAssessment",t.ContentAssessment="ContentAssessment",t.PhraseAMScore="PhraseAMScore",t.PhraseLMScore="PhraseLMScore",t.WordAMScore="WordAMScore",t.WordLMScore="WordLMScore",t.RuleTree="RuleTree",t.NBestTimings="NBestTimings",t.DecoderDiagnostics="DecoderDiagnostics",t.DisplayWordTimings="DisplayWordTimings",t.DisplayWords="DisplayWords"}(e.PhraseOption||(e.PhraseOption={})),function(t){t.Graph="Graph",t.Corrections="Corrections",t.Sentiment="Sentiment"}(e.PhraseExtension||(e.PhraseExtension={})),function(t){t.Simple="Simple",t.Detailed="Detailed"}(e.OutputFormat||(e.OutputFormat={})),function(t){t.None="None",t.Always="Always"}(e.TentativePhraseResultsOption||(e.TentativePhraseResultsOption={}))})(Wd),Object.defineProperty(Dc,"__esModule",{value:!0}),Dc.SpeechContext=void 0;const oU=Pt,hn=Wd;class sU{constructor(t){this.privContext={},this.privDynamicGrammar=t}getContext(){return this.privContext}setPronunciationAssessmentParams(t,i,n=!1){this.privContext.phraseDetection===void 0&&(this.privContext.phraseDetection={enrichment:{pronunciationAssessment:{}}}),this.privContext.phraseDetection.enrichment===void 0&&(this.privContext.phraseDetection.enrichment={pronunciationAssessment:{}}),this.privContext.phraseDetection.enrichment.pronunciationAssessment=JSON.parse(t)||{},n&&(this.privContext.phraseDetection.mode=oU.RecognitionMode.Conversation),this.setWordLevelTimings(),this.privContext.phraseOutput.detailed.options.push(hn.PhraseOption.PronunciationAssessment),this.privContext.phraseOutput.detailed.options.indexOf(hn.PhraseOption.SNR)===-1&&this.privContext.phraseOutput.detailed.options.push(hn.PhraseOption.SNR),i&&(this.privContext.phraseDetection.enrichment.contentAssessment={topic:i},this.privContext.phraseOutput.detailed.options.push(hn.PhraseOption.ContentAssessment))}setDetailedOutputFormat(){this.privContext.phraseOutput===void 0&&(this.privContext.phraseOutput={detailed:{options:[]}}),this.privContext.phraseOutput.detailed===void 0&&(this.privContext.phraseOutput.detailed={options:[]}),this.privContext.phraseOutput.format=hn.OutputFormat.Detailed}setWordLevelTimings(){this.privContext.phraseOutput===void 0&&(this.privContext.phraseOutput={detailed:{options:[]}}),this.privContext.phraseOutput.detailed===void 0&&(this.privContext.phraseOutput.detailed={options:[]}),this.privContext.phraseOutput.format=hn.OutputFormat.Detailed,this.privContext.phraseOutput.detailed.options.indexOf(hn.PhraseOption.WordTimings)===-1&&this.privContext.phraseOutput.detailed.options.push(hn.PhraseOption.WordTimings)}setSpeakerDiarizationAudioOffsetMs(t){this.privContext.phraseDetection.speakerDiarization.audioOffsetMs=t}toJSON(){const t=this.privDynamicGrammar.generateGrammarObject();return this.privContext.dgi=t,JSON.stringify(this.privContext)}}Dc.SpeechContext=sU;var yc={},Zd={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.SubstringMatchType=e.GroupType=void 0,function(t){t.IntentText="IntentText",t.IntentEntity="IntentEntity",t.Generic="Generic",t.People="People",t.Place="Place",t.DynamicEntity="DynamicEntity"}(e.GroupType||(e.GroupType={})),function(t){t.None="None",t.LeftRooted="LeftRooted",t.PartialName="PartialName",t.MiddleOfSentence="MiddleOfSentence"}(e.SubstringMatchType||(e.SubstringMatchType={}))})(Zd),Object.defineProperty(yc,"__esModule",{value:!0}),yc.DynamicGrammarBuilder=void 0;const AU=Zd;class aU{addPhrase(t){this.privPhrases||(this.privPhrases=[]),t instanceof Array?this.privPhrases=this.privPhrases.concat(t):this.privPhrases.push(t)}clearPhrases(){this.privPhrases=void 0}addReferenceGrammar(t){this.privGrammars||(this.privGrammars=[]),t instanceof Array?this.privGrammars=this.privGrammars.concat(t):this.privGrammars.push(t)}clearGrammars(){this.privGrammars=void 0}generateGrammarObject(){if(this.privGrammars===void 0&&this.privPhrases===void 0)return;const t={};if(t.referenceGrammars=this.privGrammars,this.privPhrases!==void 0&&this.privPhrases.length!==0){const i=[];this.privPhrases.forEach(n=>{i.push({text:n})}),t.groups=[{type:AU.GroupType.Generic,items:i}]}return t}}yc.DynamicGrammarBuilder=aU;var _s={},Tc={},Lc={},Vl={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.MessageDataStreamType=e.ActivityPayloadResponse=void 0;class t{constructor(n){this.privActivityResponse=JSON.parse(n)}static fromJSON(n){return new t(n)}get conversationId(){return this.privActivityResponse.conversationId}get messageDataStreamType(){return this.privActivityResponse.messageDataStreamType}get messagePayload(){return this.privActivityResponse.messagePayload}get version(){return this.privActivityResponse.version}}e.ActivityPayloadResponse=t,function(i){i[i.None=0]="None",i[i.TextToSpeechAudio=1]="TextToSpeechAudio"}(e.MessageDataStreamType||(e.MessageDataStreamType={}))})(Vl),Object.defineProperty(Lc,"__esModule",{value:!0}),Lc.DialogServiceTurnState=void 0;const cU=gn,uU=Bt,lU=Vl;class gU{constructor(t,i){this.privRequestId=i,this.privIsCompleted=!1,this.privAudioStream=null,this.privTurnManager=t,this.resetTurnEndTimeout()}get audioStream(){return this.resetTurnEndTimeout(),this.privAudioStream}processActivityPayload(t,i){return t.messageDataStreamType===lU.MessageDataStreamType.TextToSpeechAudio&&(this.privAudioStream=uU.AudioOutputStream.createPullStream(),this.privAudioStream.format=i!==void 0?i:cU.AudioOutputFormatImpl.getDefaultOutputFormat()),this.privAudioStream}endAudioStream(){this.privAudioStream!==null&&!this.privAudioStream.isClosed&&this.privAudioStream.close()}complete(){this.privTimeoutToken!==void 0&&clearTimeout(this.privTimeoutToken),this.endAudioStream()}resetTurnEndTimeout(){this.privTimeoutToken!==void 0&&clearTimeout(this.privTimeoutToken),this.privTimeoutToken=setTimeout(()=>{this.privTurnManager.CompleteTurn(this.privRequestId)},2e3)}}Lc.DialogServiceTurnState=gU,Object.defineProperty(Tc,"__esModule",{value:!0}),Tc.DialogServiceTurnStateManager=void 0;const Xd=dt,EU=Lc;class hU{constructor(){this.privTurnMap=new Map}StartTurn(t){if(this.privTurnMap.has(t))throw new Xd.InvalidOperationError("Service error: There is already a turn with id:"+t);const i=new EU.DialogServiceTurnState(this,t);return this.privTurnMap.set(t,i),this.privTurnMap.get(t)}GetTurn(t){return this.privTurnMap.get(t)}CompleteTurn(t){if(!this.privTurnMap.has(t))throw new Xd.InvalidOperationError("Service error: Received turn end for an unknown turn id:"+t);const i=this.privTurnMap.get(t);return i.complete(),this.privTurnMap.delete(t),i}}Tc.DialogServiceTurnStateManager=hU;var _d={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.InvocationSource=void 0,function(t){t.None="None",t.VoiceActivationWithKeyword="VoiceActivationWithKeyword"}(e.InvocationSource||(e.InvocationSource={}))})(_d);var $d={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.OnRejectAction=e.KeywordDetectionType=void 0,function(t){t.StartTrigger="StartTrigger"}(e.KeywordDetectionType||(e.KeywordDetectionType={})),function(t){t.EndOfTurn="EndOfTurn",t.Continue="Continue"}(e.OnRejectAction||(e.OnRejectAction={}))})($d);var eS;function CU(){if(eS)return _s;eS=1,Object.defineProperty(_s,"__esModule",{value:!0}),_s.DialogServiceAdapter=void 0;const e=ht(),t=Tn,i=ge(),n=gn,o=q(),s=Tc,A=se(),r=Vl,a=_d,c=$d,u=Oi;let l=class extends A.ServiceRecognizerBase{constructor(E,C,d,S,I){super(E,C,d,S,I),this.privEvents=new i.EventSource,this.privDialogServiceConnector=I,this.receiveMessageOverride=()=>this.receiveDialogMessageOverride(),this.privTurnStateManager=new s.DialogServiceTurnStateManager,this.recognizeOverride=(p,M,v)=>this.listenOnce(p,M,v),this.postConnectImplOverride=p=>this.dialogConnectImpl(p),this.configConnectionOverride=p=>this.configConnection(p),this.disconnectOverride=()=>this.privDisconnect(),this.privDialogAudioSource=d,this.agentConfigSent=!1,this.privLastResult=null,this.connectionEvents.attach(p=>{p.name==="ConnectionClosedEvent"&&(this.terminateMessageLoop=!0)})}async sendMessage(E){const C=(0,i.createGuid)(),d=(0,i.createNoDashGuid)(),S={context:{interactionId:C},messagePayload:JSON.parse(E),version:.5},I=JSON.stringify(S);await(await this.fetchConnection()).send(new u.SpeechConnectionMessage(i.MessageType.Text,"agent",d,"application/json",I))}async privDisconnect(){await this.cancelRecognition(this.privRequestSession.sessionId,this.privRequestSession.requestId,o.CancellationReason.Error,o.CancellationErrorCode.NoError,"Disconnecting"),this.terminateMessageLoop=!0,this.agentConfigSent=!1}processTypeSpecificMessages(E){const C=new o.PropertyCollection;E.messageType===i.MessageType.Text&&C.setProperty(o.PropertyId.SpeechServiceResponse_JsonResult,E.textBody);let d,S;switch(E.path.toLowerCase()){case"speech.phrase":const p=A.SimpleSpeechPhrase.fromJSON(E.textBody,this.privRequestSession.currentTurnAudioOffset);if(this.privRequestSession.onPhraseRecognized(p.Offset+p.Duration),p.RecognitionStatus!==A.RecognitionStatus.TooManyRequests&&p.RecognitionStatus!==A.RecognitionStatus.Error){const F=this.fireEventForResult(p,C);if(this.privLastResult=F.result,this.privDialogServiceConnector.recognized)try{this.privDialogServiceConnector.recognized(this.privDialogServiceConnector,F)}catch{}}S=!0;break;case"speech.hypothesis":const M=A.SpeechHypothesis.fromJSON(E.textBody,this.privRequestSession.currentTurnAudioOffset);d=new o.SpeechRecognitionResult(this.privRequestSession.requestId,o.ResultReason.RecognizingSpeech,M.Text,M.Duration,M.Offset,M.Language,M.LanguageDetectionConfidence,void 0,void 0,M.asJson(),C),this.privRequestSession.onHypothesis(M.Offset);const v=new o.SpeechRecognitionEventArgs(d,M.Offset,this.privRequestSession.sessionId);if(this.privDialogServiceConnector.recognizing)try{this.privDialogServiceConnector.recognizing(this.privDialogServiceConnector,v)}catch{}S=!0;break;case"speech.keyword":const T=A.SpeechKeyword.fromJSON(E.textBody,this.privRequestSession.currentTurnAudioOffset);d=new o.SpeechRecognitionResult(this.privRequestSession.requestId,T.Status==="Accepted"?o.ResultReason.RecognizedKeyword:o.ResultReason.NoMatch,T.Text,T.Duration,T.Offset,void 0,void 0,void 0,void 0,T.asJson(),C),T.Status!=="Accepted"&&(this.privLastResult=d);const O=new o.SpeechRecognitionEventArgs(d,d.duration,d.resultId);if(this.privDialogServiceConnector.recognized)try{this.privDialogServiceConnector.recognized(this.privDialogServiceConnector,O)}catch{}S=!0;break;case"audio":{const F=E.requestId.toUpperCase(),D=this.privTurnStateManager.GetTurn(F);try{E.binaryBody?D.audioStream.write(E.binaryBody):D.endAudioStream()}catch{}}S=!0;break;case"response":this.handleResponseMessage(E),S=!0;break}const I=new i.Deferred;return I.resolve(S),I.promise}async cancelRecognition(E,C,d,S,I){if(this.terminateMessageLoop=!0,this.privRequestSession.isRecognizing&&await this.privRequestSession.onStopRecognizing(),this.privDialogServiceConnector.canceled){const p=new o.PropertyCollection;p.setProperty(A.CancellationErrorCodePropertyName,o.CancellationErrorCode[S]);const M=new o.SpeechRecognitionCanceledEventArgs(d,I,S,void 0,E);try{this.privDialogServiceConnector.canceled(this.privDialogServiceConnector,M)}catch{}if(this.privSuccessCallback){const v=new o.SpeechRecognitionResult(void 0,o.ResultReason.Canceled,void 0,void 0,void 0,void 0,void 0,void 0,I,void 0,p);try{this.privSuccessCallback(v),this.privSuccessCallback=void 0}catch{}}}}async listenOnce(E,C,d){this.privRecognizerConfig.recognitionMode=E,this.privSuccessCallback=C,this.privErrorCallback=d,this.privRequestSession.startNewRecognition(),this.privRequestSession.listenForServiceTelemetry(this.privDialogAudioSource.events),this.privRecognizerConfig.parameters.setProperty(o.PropertyId.Speech_SessionId,this.privRequestSession.sessionId);const S=this.connectImpl(),I=this.sendPreAudioMessages(),p=await this.privDialogAudioSource.attach(this.privRequestSession.audioNodeId),M=await this.privDialogAudioSource.format,v=await this.privDialogAudioSource.deviceInfo,T=new e.ReplayableAudioNode(p,M.avgBytesPerSec);await this.privRequestSession.onAudioSourceAttachCompleted(T,!1),this.privRecognizerConfig.SpeechServiceConfig.Context.audio={source:v};try{await S,await I}catch(D){return await this.cancelRecognition(this.privRequestSession.sessionId,this.privRequestSession.requestId,o.CancellationReason.Error,o.CancellationErrorCode.ConnectionFailure,D),Promise.resolve()}const O=new o.SessionEventArgs(this.privRequestSession.sessionId);this.privRecognizer.sessionStarted&&this.privRecognizer.sessionStarted(this.privRecognizer,O),this.sendAudio(T).then(()=>{},async D=>{await this.cancelRecognition(this.privRequestSession.sessionId,this.privRequestSession.requestId,o.CancellationReason.Error,o.CancellationErrorCode.RuntimeError,D)})}dialogConnectImpl(E){return this.privConnectionLoop=this.startMessageLoop(),E}receiveDialogMessageOverride(){const E=new i.Deferred,C=async()=>{try{const d=this.isDisposed(),S=!this.isDisposed()&&this.terminateMessageLoop;if(d||S){E.resolve(void 0);return}const p=await(await this.fetchConnection()).read();if(!p)return C();const M=u.SpeechConnectionMessage.fromConnectionMessage(p);switch(M.path.toLowerCase()){case"turn.start":{const z=M.requestId.toUpperCase(),G=this.privRequestSession.requestId.toUpperCase();z!==G?this.privTurnStateManager.StartTurn(z):this.privRequestSession.onServiceTurnStartResponse()}break;case"speech.startdetected":const T=A.SpeechDetected.fromJSON(M.textBody,this.privRequestSession.currentTurnAudioOffset),O=new o.RecognitionEventArgs(T.Offset,this.privRequestSession.sessionId);this.privRecognizer.speechStartDetected&&this.privRecognizer.speechStartDetected(this.privRecognizer,O);break;case"speech.enddetected":let F;M.textBody.length>0?F=M.textBody:F="{ Offset: 0 }";const D=A.SpeechDetected.fromJSON(F,this.privRequestSession.currentTurnAudioOffset);this.privRequestSession.onServiceRecognized(D.Offset);const j=new o.RecognitionEventArgs(D.Offset,this.privRequestSession.sessionId);this.privRecognizer.speechEndDetected&&this.privRecognizer.speechEndDetected(this.privRecognizer,j);break;case"turn.end":{const z=M.requestId.toUpperCase(),G=this.privRequestSession.requestId.toUpperCase();if(z!==G)this.privTurnStateManager.CompleteTurn(z);else{const K=new o.SessionEventArgs(this.privRequestSession.sessionId);if(await this.privRequestSession.onServiceTurnEndResponse(!1),(!this.privRecognizerConfig.isContinuousRecognition||this.privRequestSession.isSpeechEnded||!this.privRequestSession.isRecognizing)&&this.privRecognizer.sessionStopped&&this.privRecognizer.sessionStopped(this.privRecognizer,K),this.privSuccessCallback&&this.privLastResult){try{this.privSuccessCallback(this.privLastResult),this.privLastResult=null}catch(ie){this.privErrorCallback&&this.privErrorCallback(ie)}this.privSuccessCallback=void 0,this.privErrorCallback=void 0}}}break;default:try{await this.processTypeSpecificMessages(M)||this.serviceEvents&&this.serviceEvents.onEvent(new i.ServiceEvent(M.path.toLowerCase(),M.textBody))}catch{}}return C()}catch{this.terminateMessageLoop=!0,E.resolve()}};return C().catch(d=>{i.Events.instance.onEvent(new i.BackgroundEvent(d))}),E.promise}async startMessageLoop(){this.terminateMessageLoop=!1;try{await this.receiveDialogMessageOverride()}catch(E){await this.cancelRecognition(this.privRequestSession.sessionId,this.privRequestSession.requestId,o.CancellationReason.Error,o.CancellationErrorCode.RuntimeError,E)}return Promise.resolve()}async configConnection(E){return this.terminateMessageLoop?(this.terminateMessageLoop=!1,Promise.reject("Connection to service terminated.")):(await this.sendSpeechServiceConfig(E,this.privRequestSession,this.privRecognizerConfig.SpeechServiceConfig.serialize()),await this.sendAgentConfig(E),E)}async sendPreAudioMessages(){const E=await this.fetchConnection();this.addKeywordContextData(),await this.sendSpeechContext(E,!0),await this.sendAgentContext(E),await this.sendWaveHeader(E)}sendAgentConfig(E){if(this.agentConfig&&!this.agentConfigSent){if(this.privRecognizerConfig.parameters.getProperty(o.PropertyId.Conversation_DialogType)===o.DialogServiceConfig.DialogTypes.CustomCommands){const d=this.agentConfig.get();d.botInfo.commandsCulture=this.privRecognizerConfig.parameters.getProperty(o.PropertyId.SpeechServiceConnection_RecoLanguage,"en-us"),this.agentConfig.set(d)}this.onEvent(new t.SendingAgentContextMessageEvent(this.agentConfig));const C=this.agentConfig.toJsonString();return this.agentConfigSent=!0,E.send(new u.SpeechConnectionMessage(i.MessageType.Text,"agent.config",this.privRequestSession.requestId,"application/json",C))}}sendAgentContext(E){const C=(0,i.createGuid)(),d=this.privDialogServiceConnector.properties.getProperty(o.PropertyId.Conversation_Speech_Activity_Template),I=JSON.stringify({channelData:"",context:{interactionId:C},messagePayload:typeof d===void 0?void 0:d,version:.5});return E.send(new u.SpeechConnectionMessage(i.MessageType.Text,"speech.agent.context",this.privRequestSession.requestId,"application/json",I))}fireEventForResult(E,C){const d=A.EnumTranslation.implTranslateRecognitionResult(E.RecognitionStatus),S=new o.SpeechRecognitionResult(this.privRequestSession.requestId,d,E.DisplayText,E.Duration,E.Offset,E.Language,E.LanguageDetectionConfidence,void 0,void 0,E.asJson(),C);return new o.SpeechRecognitionEventArgs(S,E.Offset,this.privRequestSession.sessionId)}handleResponseMessage(E){const C=JSON.parse(E.textBody);switch(C.messageType.toLowerCase()){case"message":const d=E.requestId.toUpperCase(),S=r.ActivityPayloadResponse.fromJSON(E.textBody),I=this.privTurnStateManager.GetTurn(d);if(S.conversationId){const v=this.agentConfig.get();v.botInfo.conversationId=S.conversationId,this.agentConfig.set(v)}const p=I.processActivityPayload(S,n.AudioOutputFormatImpl.fromSpeechSynthesisOutputFormatString(this.privDialogServiceConnector.properties.getProperty(o.PropertyId.SpeechServiceConnection_SynthOutputFormat,void 0))),M=new o.ActivityReceivedEventArgs(S.messagePayload,p);if(this.privDialogServiceConnector.activityReceived)try{this.privDialogServiceConnector.activityReceived(this.privDialogServiceConnector,M)}catch{}break;case"messagestatus":if(this.privDialogServiceConnector.turnStatusReceived)try{this.privDialogServiceConnector.turnStatusReceived(this.privDialogServiceConnector,new o.TurnStatusReceivedEventArgs(E.textBody))}catch{}break;default:i.Events.instance.onEvent(new i.BackgroundEvent(`Unexpected response of type ${C.messageType}. Ignoring.`));break}}onEvent(E){this.privEvents.onEvent(E),i.Events.instance.onEvent(E)}addKeywordContextData(){const E=this.privRecognizerConfig.parameters.getProperty("SPEECH-KeywordsToDetect");if(E===void 0)return;const C=this.privRecognizerConfig.parameters.getProperty("SPEECH-KeywordsToDetect-Offsets"),d=this.privRecognizerConfig.parameters.getProperty("SPEECH-KeywordsToDetect-Durations"),S=E.split(";"),I=C===void 0?[]:C.split(";"),p=d===void 0?[]:d.split(";"),M=[];for(let v=0;v<S.length;v++){const T={text:S[v]};v<I.length&&(T.startOffset=Number(I[v])),v<p.length&&(T.duration=Number(p[v])),M.push(T)}this.speechContext.getContext().invocationSource=a.InvocationSource.VoiceActivationWithKeyword,this.speechContext.getContext().keywordDetection=[{clientDetectedKeywords:M,onReject:{action:c.OnRejectAction.EndOfTurn},type:c.KeywordDetectionType.StartTrigger}]}};return _s.DialogServiceAdapter=l,_s}var Oc={};Object.defineProperty(Oc,"__esModule",{value:!0}),Oc.AgentConfig=void 0;class IU{toJsonString(){return JSON.stringify(this.iPrivConfig)}get(){return this.iPrivConfig}set(t){this.iPrivConfig=t}}Oc.AgentConfig=IU;var Wl={},$s={},Rr={};Object.defineProperty(Rr,"__esModule",{value:!0}),Rr.ConversationConnectionConfig=void 0;const pU=Ks;class Lt extends pU.RestConfigBase{static get host(){return Lt.privHost}static get apiVersion(){return Lt.privApiVersion}static get clientAppId(){return Lt.privClientAppId}static get defaultLanguageCode(){return Lt.privDefaultLanguageCode}static get restPath(){return Lt.privRestPath}static get webSocketPath(){return Lt.privWebSocketPath}static get transcriptionEventKeys(){return Lt.privTranscriptionEventKeys}}Rr.ConversationConnectionConfig=Lt,Lt.privHost="dev.microsofttranslator.com",Lt.privRestPath="/capito/room",Lt.privApiVersion="2.0",Lt.privDefaultLanguageCode="en-US",Lt.privClientAppId="FC539C22-1767-4F1F-84BC-B4D811114F15",Lt.privWebSocketPath="/capito/translate",Lt.privTranscriptionEventKeys=["iCalUid","callId","organizer","FLAC","MTUri","DifferentiateGuestSpeakers","audiorecording","Threadid","OrganizerMri","OrganizerTenantId","UserToken"];var tS;function dU(){if(tS)return $s;tS=1,Object.defineProperty($s,"__esModule",{value:!0}),$s.ConversationManager=void 0;const e=ht(),t=Ie,i=q(),n=Rr;let o=class{constructor(){this.privRequestParams=n.ConversationConnectionConfig.configParams,this.privErrors=n.ConversationConnectionConfig.restErrors,this.privHost=n.ConversationConnectionConfig.host,this.privApiVersion=n.ConversationConnectionConfig.apiVersion,this.privRestPath=n.ConversationConnectionConfig.restPath,this.privRestAdapter=new e.RestMessageAdapter({})}createOrJoin(A,r,a,c){try{t.Contracts.throwIfNullOrUndefined(A,"args");const u=A.getProperty(i.PropertyId.SpeechServiceConnection_RecoLanguage,n.ConversationConnectionConfig.defaultLanguageCode),l=A.getProperty(i.PropertyId.ConversationTranslator_Name,"conversation_host"),g=A.getProperty(i.PropertyId.ConversationTranslator_Host,this.privHost),E=A.getProperty(i.PropertyId.ConversationTranslator_CorrelationId),C=A.getProperty(i.PropertyId.SpeechServiceConnection_Key),d=A.getProperty(i.PropertyId.SpeechServiceConnection_Region),S=A.getProperty(i.PropertyId.SpeechServiceAuthorization_Token);t.Contracts.throwIfNullOrWhitespace(u,"languageCode"),t.Contracts.throwIfNullOrWhitespace(l,"nickname"),t.Contracts.throwIfNullOrWhitespace(g,"endpointHost");const I={};I[this.privRequestParams.apiVersion]=this.privApiVersion,I[this.privRequestParams.languageCode]=u,I[this.privRequestParams.nickname]=l;const p={};E&&(p[this.privRequestParams.correlationId]=E),p[this.privRequestParams.clientAppId]=n.ConversationConnectionConfig.clientAppId,r!==void 0?I[this.privRequestParams.roomId]=r:(t.Contracts.throwIfNullOrUndefined(d,this.privErrors.authInvalidSubscriptionRegion),p[this.privRequestParams.subscriptionRegion]=d,C?p[this.privRequestParams.subscriptionKey]=C:S?p[this.privRequestParams.authorization]=`Bearer ${S}`:t.Contracts.throwIfNullOrUndefined(C,this.privErrors.authInvalidSubscriptionKey));const M={};M.headers=p,this.privRestAdapter.options=M;const v=`https://${g}${this.privRestPath}`;this.privRestAdapter.request(e.RestRequestType.Post,v,I,null).then(T=>{const O=e.RestMessageAdapter.extractHeaderValue(this.privRequestParams.requestId,T.headers);if(!T.ok){if(c){let D=this.privErrors.invalidCreateJoinConversationResponse.replace("{status}",T.status.toString()),j;try{j=JSON.parse(T.data),D+=` [${j.error.code}: ${j.error.message}]`}catch{D+=` [${T.data}]`}O&&(D+=` ${O}`),c(D)}return}const F=JSON.parse(T.data);if(F&&(F.requestId=O),a){try{a(F)}catch(D){c&&c(D)}a=void 0}}).catch(()=>{})}catch(u){if(c)if(u instanceof Error){const l=u;c(l.name+": "+l.message)}else c(u)}}leave(A,r){return new Promise((a,c)=>{try{t.Contracts.throwIfNullOrUndefined(A,this.privErrors.invalidArgs.replace("{arg}","config")),t.Contracts.throwIfNullOrWhitespace(r,this.privErrors.invalidArgs.replace("{arg}","token"));const u=A.getProperty(i.PropertyId.ConversationTranslator_Host,this.privHost),l=A.getProperty(i.PropertyId.ConversationTranslator_CorrelationId),g={};g[this.privRequestParams.apiVersion]=this.privApiVersion,g[this.privRequestParams.sessionToken]=r;const E={};l&&(E[this.privRequestParams.correlationId]=l);const C={};C.headers=E,this.privRestAdapter.options=C;const d=`https://${u}${this.privRestPath}`;this.privRestAdapter.request(e.RestRequestType.Delete,d,g,null).then(S=>{S.ok,a()}).catch(()=>{})}catch(u){if(u instanceof Error){const l=u;c(l.name+": "+l.message)}else c(u)}})}};return $s.ConversationManager=o,$s}var Jn={},eA={},Uc={},tA={};Object.defineProperty(tA,"__esModule",{value:!0}),tA.ConversationConnectionMessage=void 0;const SU=ge();class MU extends SU.ConnectionMessage{constructor(t,i,n,o){super(t,i,n,o);const s=JSON.parse(this.textBody);s.type!==void 0&&(this.privConversationMessageType=s.type)}get conversationMessageType(){return this.privConversationMessageType}}tA.ConversationConnectionMessage=MU,Object.defineProperty(Uc,"__esModule",{value:!0}),Uc.ConversationWebsocketMessageFormatter=void 0;const Hn=ge(),iS=tA;class BU{toConnectionMessage(t){const i=new Hn.Deferred;try{if(t.messageType===Hn.MessageType.Text){const n=new iS.ConversationConnectionMessage(t.messageType,t.textContent,{},t.id);i.resolve(n)}else t.messageType===Hn.MessageType.Binary&&i.resolve(new iS.ConversationConnectionMessage(t.messageType,t.binaryContent,void 0,t.id))}catch(n){i.reject(`Error formatting the message. Error: ${n}`)}return i.promise}fromConnectionMessage(t){const i=new Hn.Deferred;try{if(t.messageType===Hn.MessageType.Text){const n=`${t.textBody?t.textBody:""}`;i.resolve(new Hn.RawWebsocketMessage(Hn.MessageType.Text,n,t.id))}}catch(n){i.reject(`Error formatting the message. ${n}`)}return i.promise}}Uc.ConversationWebsocketMessageFormatter=BU;var nS;function vU(){if(nS)return eA;nS=1,Object.defineProperty(eA,"__esModule",{value:!0}),eA.ConversationConnectionFactory=void 0;const e=ht(),t=ge(),i=Ie,n=q(),o=ai(),s=Rr,A=Uc;let r=class extends o.ConnectionFactoryBase{create(c,u,l){const g=c.parameters.getProperty(n.PropertyId.ConversationTranslator_Host,s.ConversationConnectionConfig.host),E=c.parameters.getProperty(n.PropertyId.ConversationTranslator_CorrelationId,(0,t.createGuid)()),C=`wss://${g}${s.ConversationConnectionConfig.webSocketPath}`,d=c.parameters.getProperty(n.PropertyId.ConversationTranslator_Token,void 0);i.Contracts.throwIfNullOrUndefined(d,"token");const S={};S[s.ConversationConnectionConfig.configParams.apiVersion]=s.ConversationConnectionConfig.apiVersion,S[s.ConversationConnectionConfig.configParams.token]=d,S[s.ConversationConnectionConfig.configParams.correlationId]=E;const I=c.parameters.getProperty("SPEECH-EnableWebsocketCompression","false")==="true";return Promise.resolve(new e.WebsocketConnection(C,S,{},new A.ConversationWebsocketMessageFormatter,e.ProxyInfo.fromRecognizerConfig(c),I,l))}};return eA.ConversationConnectionFactory=r,eA}var iA={},Nc={};Object.defineProperty(Nc,"__esModule",{value:!0}),Nc.ConversationRequestSession=void 0;const Zl=ge();class fU{constructor(t){this.privIsDisposed=!1,this.privDetachables=new Array,this.privSessionId=t,this.privRequestId=(0,Zl.createNoDashGuid)(),this.privRequestCompletionDeferral=new Zl.Deferred}get sessionId(){return this.privSessionId}get requestId(){return this.privRequestId}get completionPromise(){return this.privRequestCompletionDeferral.promise}onPreConnectionStart(t,i){this.privSessionId=i}onAuthCompleted(t){t&&this.onComplete()}onConnectionEstablishCompleted(t){t!==200&&t===403&&this.onComplete()}onServiceTurnEndResponse(t){t?this.privRequestId=(0,Zl.createNoDashGuid)():this.onComplete()}async dispose(){if(!this.privIsDisposed){this.privIsDisposed=!0;for(const t of this.privDetachables)await t.detach()}}onComplete(){}}Nc.ConversationRequestSession=fU;var Ut={},rS;function oS(){if(rS)return Ut;rS=1,Object.defineProperty(Ut,"__esModule",{value:!0}),Ut.ConversationReceivedTranslationEventArgs=Ut.ParticipantsListEventArgs=Ut.ParticipantAttributeEventArgs=Ut.ParticipantEventArgs=Ut.LockRoomEventArgs=Ut.MuteAllEventArgs=void 0;const e=q();class t extends e.SessionEventArgs{constructor(a,c){super(c),this.privIsMuted=a}get isMuted(){return this.privIsMuted}}Ut.MuteAllEventArgs=t;class i extends e.SessionEventArgs{constructor(a,c){super(c),this.privIsLocked=a}get isMuted(){return this.privIsLocked}}Ut.LockRoomEventArgs=i;class n extends e.SessionEventArgs{constructor(a,c){super(c),this.privParticipant=a}get participant(){return this.privParticipant}}Ut.ParticipantEventArgs=n;class o extends e.SessionEventArgs{constructor(a,c,u,l){super(l),this.privKey=c,this.privValue=u,this.privParticipantId=a}get value(){return this.privValue}get key(){return this.privKey}get id(){return this.privParticipantId}}Ut.ParticipantAttributeEventArgs=o;class s extends e.SessionEventArgs{constructor(a,c,u,l,g,E,C,d,S){super(S),this.privRoomId=a,this.privSessionToken=c,this.privTranslateTo=u,this.privProfanityFilter=l,this.privRoomProfanityFilter=g,this.privIsRoomLocked=E,this.privIsRoomLocked=C,this.privParticipants=d}get sessionToken(){return this.privSessionToken}get conversationId(){return this.privRoomId}get translateTo(){return this.privTranslateTo}get profanityFilter(){return this.privProfanityFilter}get roomProfanityFilter(){return this.privRoomProfanityFilter}get isRoomLocked(){return this.privIsRoomLocked}get isMuteAll(){return this.privIsMuteAll}get participants(){return this.privParticipants}}Ut.ParticipantsListEventArgs=s;class A{constructor(a,c,u){this.privPayload=c,this.privCommand=a,this.privSessionId=u}get payload(){return this.privPayload}get command(){return this.privCommand}get sessionId(){return this.privSessionId}}return Ut.ConversationReceivedTranslationEventArgs=A,Ut}var Ki={};Object.defineProperty(Ki,"__esModule",{value:!0}),Ki.ConversationTranslatorCommandTypes=Ki.ConversationTranslatorMessageTypes=Ki.InternalParticipants=void 0;class wU{constructor(t=[],i){this.participants=t,this.meId=i}addOrUpdateParticipant(t){if(t===void 0)return;const i=this.getParticipantIndex(t.id);return i>-1?this.participants.splice(i,1,t):this.participants.push(t),this.getParticipant(t.id)}getParticipantIndex(t){return this.participants.findIndex(i=>i.id===t)}getParticipant(t){return this.participants.find(i=>i.id===t)}deleteParticipant(t){this.participants=this.participants.filter(i=>i.id!==t)}get host(){return this.participants.find(t=>t.isHost===!0)}get me(){return this.getParticipant(this.meId)}}Ki.InternalParticipants=wU,Ki.ConversationTranslatorMessageTypes={command:"command",final:"final",info:"info",instantMessage:"instant_message",keepAlive:"keep_alive",partial:"partial",participantCommand:"participant_command",translatedMessage:"translated_message"},Ki.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"};var sS={},Kc={};Object.defineProperty(Kc,"__esModule",{value:!0}),Kc.CommandResponsePayload=void 0;const QU=e=>JSON.parse(e);class Xl{constructor(t){this.privCommandResponse=QU(t)}get type(){return this.privCommandResponse.type}get command(){return this.privCommandResponse.command}get id(){return this.privCommandResponse.id}get nickname(){return this.privCommandResponse.nickname}get participantId(){return this.privCommandResponse.participantId}get roomid(){return this.privCommandResponse.roomid}get value(){return this.privCommandResponse.value}get token(){return this.privCommandResponse.token}static fromJSON(t){return new Xl(t)}}Kc.CommandResponsePayload=Xl;var mr={};Object.defineProperty(mr,"__esModule",{value:!0}),mr.ParticipantPayloadResponse=mr.ParticipantsListPayloadResponse=void 0;const RU=e=>JSON.parse(e),mU=e=>JSON.parse(e);class _l{constructor(t){this.privParticipantsPayloadResponse=RU(t)}get roomid(){return this.privParticipantsPayloadResponse.roomid}get id(){return this.privParticipantsPayloadResponse.id}get command(){return this.privParticipantsPayloadResponse.command}get participants(){return this.privParticipantsPayloadResponse.participants}get token(){return this.privParticipantsPayloadResponse.token}get translateTo(){return this.privParticipantsPayloadResponse.translateTo}get profanityFilter(){return this.privParticipantsPayloadResponse.profanityFilter}get roomProfanityFilter(){return this.privParticipantsPayloadResponse.roomProfanityFilter}get roomLocked(){return this.privParticipantsPayloadResponse.roomLocked}get muteAll(){return this.privParticipantsPayloadResponse.muteAll}get type(){return this.privParticipantsPayloadResponse.type}static fromJSON(t){return new _l(t)}}mr.ParticipantsListPayloadResponse=_l;class $l{constructor(t){this.privParticipantPayloadResponse=mU(t)}get nickname(){return this.privParticipantPayloadResponse.nickname}get locale(){return this.privParticipantPayloadResponse.locale}get usetts(){return this.privParticipantPayloadResponse.usetts}get ismuted(){return this.privParticipantPayloadResponse.ismuted}get ishost(){return this.privParticipantPayloadResponse.ishost}get participantId(){return this.privParticipantPayloadResponse.participantId}get avatar(){return this.privParticipantPayloadResponse.avatar}static fromJSON(t){return new $l(t)}}mr.ParticipantPayloadResponse=$l;var Dr={};Object.defineProperty(Dr,"__esModule",{value:!0}),Dr.TextResponsePayload=Dr.SpeechResponsePayload=void 0;const DU=e=>JSON.parse(e),yU=e=>JSON.parse(e);class eg{constructor(t){this.privSpeechResponse=DU(t)}get recognition(){return this.privSpeechResponse.recognition}get translations(){return this.privSpeechResponse.translations}get id(){return this.privSpeechResponse.id}get language(){return this.privSpeechResponse.language}get nickname(){return this.privSpeechResponse.nickname}get participantId(){return this.privSpeechResponse.participantId}get roomid(){return this.privSpeechResponse.roomid}get timestamp(){return this.privSpeechResponse.timestamp}get type(){return this.privSpeechResponse.type}get isFinal(){return this.privSpeechResponse.type==="final"}static fromJSON(t){return new eg(t)}}Dr.SpeechResponsePayload=eg;class tg{constructor(t){this.privTextResponse=yU(t)}get originalText(){return this.privTextResponse.originalText}get translations(){return this.privTextResponse.translations}get id(){return this.privTextResponse.id}get language(){return this.privTextResponse.language}get nickname(){return this.privTextResponse.nickname}get participantId(){return this.privTextResponse.participantId}get roomid(){return this.privTextResponse.roomid}get timestamp(){return this.privTextResponse.timestamp}get type(){return this.privTextResponse.type}static fromJSON(t){return new tg(t)}}Dr.TextResponsePayload=tg,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.TextResponsePayload=e.SpeechResponsePayload=e.ParticipantPayloadResponse=e.ParticipantsListPayloadResponse=e.CommandResponsePayload=void 0;var t=Kc;Object.defineProperty(e,"CommandResponsePayload",{enumerable:!0,get:function(){return t.CommandResponsePayload}});var i=mr;Object.defineProperty(e,"ParticipantsListPayloadResponse",{enumerable:!0,get:function(){return i.ParticipantsListPayloadResponse}}),Object.defineProperty(e,"ParticipantPayloadResponse",{enumerable:!0,get:function(){return i.ParticipantPayloadResponse}});var n=Dr;Object.defineProperty(e,"SpeechResponsePayload",{enumerable:!0,get:function(){return n.SpeechResponsePayload}}),Object.defineProperty(e,"TextResponsePayload",{enumerable:!0,get:function(){return n.TextResponsePayload}})}(sS);var AS;function TU(){if(AS)return iA;AS=1,Object.defineProperty(iA,"__esModule",{value:!0}),iA.ConversationServiceAdapter=void 0;const e=ge(),t=q(),i=se(),n=tA,o=Nc,s=oS(),A=Ki,r=sS;let a=class extends i.ServiceRecognizerBase{constructor(u,l,g,E,C){super(u,l,g,E,C),this.privConnectionConfigPromise=void 0,this.privLastPartialUtteranceId="",this.privConversationServiceConnector=C,this.privConversationAuthentication=u,this.receiveMessageOverride=()=>this.receiveConversationMessageOverride(),this.recognizeOverride=()=>this.noOp(),this.postConnectImplOverride=d=>this.conversationConnectImpl(d),this.configConnectionOverride=()=>this.configConnection(),this.disconnectOverride=()=>this.privDisconnect(),this.privConversationRequestSession=new o.ConversationRequestSession((0,e.createNoDashGuid)()),this.privConversationConnectionFactory=l,this.privConversationIsDisposed=!1}isDisposed(){return super.isDisposed()||this.privConversationIsDisposed}async dispose(u){this.privConversationIsDisposed=!0,this.privConnectionConfigPromise!==void 0&&await(await this.privConnectionConfigPromise).dispose(u),await super.dispose(u)}async sendMessage(u){return(await this.fetchConnection()).send(new n.ConversationConnectionMessage(e.MessageType.Text,u))}async sendMessageAsync(u){await(await this.fetchConnection()).send(new n.ConversationConnectionMessage(e.MessageType.Text,u))}privDisconnect(){if(!this.terminateMessageLoop)return this.cancelRecognition(this.privConversationRequestSession.sessionId,this.privConversationRequestSession.requestId,t.CancellationReason.Error,t.CancellationErrorCode.NoError,"Disconnecting"),this.terminateMessageLoop=!0,Promise.resolve()}async processTypeSpecificMessages(){return!0}cancelRecognition(u,l,g,E,C){this.terminateMessageLoop=!0;const d=new t.ConversationTranslationCanceledEventArgs(g,C,E,void 0,u);try{this.privConversationServiceConnector.canceled&&this.privConversationServiceConnector.canceled(this.privConversationServiceConnector,d)}catch{}}async conversationConnectImpl(u){return this.privConnectionLoop=this.startMessageLoop(),u}async receiveConversationMessageOverride(){if(this.isDisposed()||this.terminateMessageLoop)return Promise.resolve();const u=new e.Deferred;try{const g=await(await this.fetchConnection()).read();if(this.isDisposed()||this.terminateMessageLoop)return u.resolve(),Promise.resolve();if(!g)return this.receiveConversationMessageOverride();const E=this.privConversationRequestSession.sessionId,C=g.conversationMessageType.toLowerCase();let d=!1;try{switch(C){case"info":case"participant_command":case"command":const S=r.CommandResponsePayload.fromJSON(g.textBody);switch(S.command.toLowerCase()){case"participantlist":const O=r.ParticipantsListPayloadResponse.fromJSON(g.textBody),F=O.participants.map(ie=>({avatar:ie.avatar,displayName:ie.nickname,id:ie.participantId,isHost:ie.ishost,isMuted:ie.ismuted,isUsingTts:ie.usetts,preferredLanguage:ie.locale}));this.privConversationServiceConnector.participantsListReceived&&this.privConversationServiceConnector.participantsListReceived(this.privConversationServiceConnector,new s.ParticipantsListEventArgs(O.roomid,O.token,O.translateTo,O.profanityFilter,O.roomProfanityFilter,O.roomLocked,O.muteAll,F,E));break;case"settranslatetolanguages":this.privConversationServiceConnector.participantUpdateCommandReceived&&this.privConversationServiceConnector.participantUpdateCommandReceived(this.privConversationServiceConnector,new s.ParticipantAttributeEventArgs(S.participantId,A.ConversationTranslatorCommandTypes.setTranslateToLanguages,S.value,E));break;case"setprofanityfiltering":this.privConversationServiceConnector.participantUpdateCommandReceived&&this.privConversationServiceConnector.participantUpdateCommandReceived(this.privConversationServiceConnector,new s.ParticipantAttributeEventArgs(S.participantId,A.ConversationTranslatorCommandTypes.setProfanityFiltering,S.value,E));break;case"setmute":this.privConversationServiceConnector.participantUpdateCommandReceived&&this.privConversationServiceConnector.participantUpdateCommandReceived(this.privConversationServiceConnector,new s.ParticipantAttributeEventArgs(S.participantId,A.ConversationTranslatorCommandTypes.setMute,S.value,E));break;case"setmuteall":this.privConversationServiceConnector.muteAllCommandReceived&&this.privConversationServiceConnector.muteAllCommandReceived(this.privConversationServiceConnector,new s.MuteAllEventArgs(S.value,E));break;case"roomexpirationwarning":this.privConversationServiceConnector.conversationExpiration&&this.privConversationServiceConnector.conversationExpiration(this.privConversationServiceConnector,new t.ConversationExpirationEventArgs(S.value,this.privConversationRequestSession.sessionId));break;case"setusetts":this.privConversationServiceConnector.participantUpdateCommandReceived&&this.privConversationServiceConnector.participantUpdateCommandReceived(this.privConversationServiceConnector,new s.ParticipantAttributeEventArgs(S.participantId,A.ConversationTranslatorCommandTypes.setUseTTS,S.value,E));break;case"setlockstate":this.privConversationServiceConnector.lockRoomCommandReceived&&this.privConversationServiceConnector.lockRoomCommandReceived(this.privConversationServiceConnector,new s.LockRoomEventArgs(S.value,E));break;case"changenickname":this.privConversationServiceConnector.participantUpdateCommandReceived&&this.privConversationServiceConnector.participantUpdateCommandReceived(this.privConversationServiceConnector,new s.ParticipantAttributeEventArgs(S.participantId,A.ConversationTranslatorCommandTypes.changeNickname,S.value,E));break;case"joinsession":const D=r.ParticipantPayloadResponse.fromJSON(g.textBody),j={avatar:D.avatar,displayName:D.nickname,id:D.participantId,isHost:D.ishost,isMuted:D.ismuted,isUsingTts:D.usetts,preferredLanguage:D.locale};this.privConversationServiceConnector.participantJoinCommandReceived&&this.privConversationServiceConnector.participantJoinCommandReceived(this.privConversationServiceConnector,new s.ParticipantEventArgs(j,E));break;case"leavesession":const z={id:S.participantId};this.privConversationServiceConnector.participantLeaveCommandReceived&&this.privConversationServiceConnector.participantLeaveCommandReceived(this.privConversationServiceConnector,new s.ParticipantEventArgs(z,E));break;case"disconnectsession":const G={id:S.participantId};break;case"token":const K=new i.CognitiveTokenAuthentication(()=>{const ie=S.token;return Promise.resolve(ie)},()=>{const ie=S.token;return Promise.resolve(ie)});this.authentication=K,this.privConversationServiceConnector.onToken(K);break;default:break}break;case"partial":case"final":const I=r.SpeechResponsePayload.fromJSON(g.textBody),p=C==="final"?t.ResultReason.TranslatedParticipantSpeech:t.ResultReason.TranslatingParticipantSpeech,M=new t.ConversationTranslationResult(I.participantId,this.getTranslations(I.translations),I.language,I.id,p,I.recognition,void 0,void 0,g.textBody,void 0);I.isFinal?((M.text!==void 0&&M.text.length>0||I.id===this.privLastPartialUtteranceId)&&(d=!0),d&&this.privConversationServiceConnector.translationReceived&&this.privConversationServiceConnector.translationReceived(this.privConversationServiceConnector,new s.ConversationReceivedTranslationEventArgs(A.ConversationTranslatorMessageTypes.final,M,E))):M.text!==void 0&&(this.privLastPartialUtteranceId=I.id,this.privConversationServiceConnector.translationReceived&&this.privConversationServiceConnector.translationReceived(this.privConversationServiceConnector,new s.ConversationReceivedTranslationEventArgs(A.ConversationTranslatorMessageTypes.partial,M,E)));break;case"translated_message":const v=r.TextResponsePayload.fromJSON(g.textBody),T=new t.ConversationTranslationResult(v.participantId,this.getTranslations(v.translations),v.language,void 0,void 0,v.originalText,void 0,void 0,void 0,g.textBody,void 0);this.privConversationServiceConnector.translationReceived&&this.privConversationServiceConnector.translationReceived(this.privConversationServiceConnector,new s.ConversationReceivedTranslationEventArgs(A.ConversationTranslatorMessageTypes.instantMessage,T,E));break;default:break}}catch{}return this.receiveConversationMessageOverride()}catch{this.terminateMessageLoop=!0}return u.promise}async startMessageLoop(){if(this.isDisposed())return Promise.resolve();this.terminateMessageLoop=!1;const u=this.receiveConversationMessageOverride();try{return await u}catch(l){return this.cancelRecognition(this.privRequestSession?this.privRequestSession.sessionId:"",this.privRequestSession?this.privRequestSession.requestId:"",t.CancellationReason.Error,t.CancellationErrorCode.RuntimeError,l),null}}configConnection(){return this.isDisposed()?Promise.resolve(void 0):this.privConnectionConfigPromise!==void 0?this.privConnectionConfigPromise.then(u=>u.state()===e.ConnectionState.Disconnected?(this.privConnectionId=null,this.privConnectionConfigPromise=void 0,this.configConnection()):this.privConnectionConfigPromise,()=>(this.privConnectionId=null,this.privConnectionConfigPromise=void 0,this.configConnection())):this.terminateMessageLoop?Promise.resolve(void 0):(this.privConnectionConfigPromise=this.connectImpl().then(u=>u),this.privConnectionConfigPromise)}getTranslations(u){let l;if(u!==void 0){l=new t.Translations;for(const g of u)l.set(g.lang,g.translation)}return l}};return iA.ConversationServiceAdapter=a,iA}var aS;function LU(){if(aS)return Jn;aS=1,Object.defineProperty(Jn,"__esModule",{value:!0}),Jn.ConversationTranslatorRecognizer=Jn.ConversationRecognizerFactory=void 0;const e=se(),t=ge(),i=Ie,n=q(),o=vU(),s=TU();class A{static fromConfig(c,u,l){return new r(c,u,l)}}Jn.ConversationRecognizerFactory=A;let r=class extends n.Recognizer{constructor(c,u,l){const g=u;i.Contracts.throwIfNull(g,"speechConfig");const E=c;i.Contracts.throwIfNull(E,"conversationImpl"),super(l,g.properties,new o.ConversationConnectionFactory),this.privConversation=E,this.privIsDisposed=!1,this.privProperties=g.properties.clone(),this.privConnection=n.Connection.fromRecognizer(this),this.privProperties.getProperty(n.PropertyId.WebWorkerLoadType,"on").toLowerCase()==="on"&&typeof Blob<"u"&&typeof Worker<"u"?(this.privSetTimeout=t.Timeout.setTimeout,this.privClearTimeout=t.Timeout.clearTimeout):typeof window<"u"?(this.privSetTimeout=window.setTimeout.bind(window),this.privClearTimeout=window.clearTimeout.bind(window)):(this.privSetTimeout=setTimeout,this.privClearTimeout=clearTimeout)}set connected(c){this.privConnection.connected=c}set disconnected(c){this.privConnection.disconnected=c}get speechRecognitionLanguage(){return this.privSpeechRecognitionLanguage}get properties(){return this.privProperties}isDisposed(){return this.privIsDisposed}connect(c,u,l){try{i.Contracts.throwIfDisposed(this.privIsDisposed),i.Contracts.throwIfNullOrWhitespace(c,"token"),this.privReco.conversationTranslatorToken=c,this.resetConversationTimeout(),this.privReco.connectAsync(u,l)}catch(g){if(l)if(g instanceof Error){const E=g;l(E.name+": "+E.message)}else l(g)}}disconnect(c,u){try{i.Contracts.throwIfDisposed(this.privIsDisposed),this.privTimeoutToken!==void 0&&this.privClearTimeout(this.privTimeoutToken),this.privReco.disconnect().then(()=>{c&&c()},l=>{u&&u(l)})}catch(l){if(u)if(l instanceof Error){const g=l;u(g.name+": "+g.message)}else u(l);this.dispose(!0).catch(g=>{t.Events.instance.onEvent(new t.BackgroundEvent(g))})}}sendRequest(c,u,l){try{i.Contracts.throwIfDisposed(this.privIsDisposed),this.sendMessage(c,u,l)}catch(g){if(l)if(g instanceof Error){const E=g;l(E.name+": "+E.message)}else l(g);this.dispose(!0).catch(E=>{t.Events.instance.onEvent(new t.BackgroundEvent(E))})}}onToken(c){this.privConversation.onToken(c)}async close(){this.privIsDisposed||(this.privConnection&&(this.privConnection.closeConnection(),this.privConnection.close()),this.privConnection=void 0,await this.dispose(!0))}async dispose(c){this.privIsDisposed||c&&(this.privTimeoutToken!==void 0&&this.privClearTimeout(this.privTimeoutToken),this.privIsDisposed=!0,this.privConnection&&(this.privConnection.closeConnection(),this.privConnection.close(),this.privConnection=void 0),await super.dispose(c))}createRecognizerConfig(c){return new e.RecognizerConfig(c,this.privProperties)}createServiceRecognizer(c,u,l,g){const E=l;return new s.ConversationServiceAdapter(c,u,E,g,this)}sendMessage(c,u,l){const g=this.privReco;((C,d,S)=>{C!==void 0?C.then(()=>{try{d&&d()}catch(I){S&&S(`'Unhandled error on promise callback: ${I}'`)}},I=>{try{S&&S(I)}catch{}}):S&&S("Null promise")})(g.sendMessageAsync(c),u,l),this.resetConversationTimeout()}resetConversationTimeout(){this.privTimeoutToken!==void 0&&this.privClearTimeout(this.privTimeoutToken),this.privTimeoutToken=this.privSetTimeout(()=>{this.sendRequest(this.privConversation.getKeepAlive())},6e4)}};return Jn.ConversationTranslatorRecognizer=r,Jn}var nA={},cS;function OU(){if(cS)return nA;cS=1,Object.defineProperty(nA,"__esModule",{value:!0}),nA.TranscriberRecognizer=void 0;const e=ge(),t=Ie,i=q(),n=se(),o=Pt;let s=class extends i.Recognizer{constructor(r,a){const c=r;t.Contracts.throwIfNull(c,"speechTranslationConfig");const u=a;t.Contracts.throwIfNull(u,"audioConfigImpl"),t.Contracts.throwIfNullOrWhitespace(c.speechRecognitionLanguage,i.PropertyId[i.PropertyId.SpeechServiceConnection_RecoLanguage]),super(a,c.properties,new n.TranscriberConnectionFactory),this.privDisposedRecognizer=!1,this.isMeetingRecognizer=!1}get speechRecognitionLanguage(){return t.Contracts.throwIfDisposed(this.privDisposedRecognizer),this.properties.getProperty(i.PropertyId.SpeechServiceConnection_RecoLanguage)}get properties(){return this.privProperties}get authorizationToken(){return this.properties.getProperty(i.PropertyId.SpeechServiceAuthorization_Token)}set authorizationToken(r){t.Contracts.throwIfNullOrWhitespace(r,"token"),this.properties.setProperty(i.PropertyId.SpeechServiceAuthorization_Token,r)}set conversation(r){t.Contracts.throwIfNullOrUndefined(r,"Conversation"),this.isMeetingRecognizer=!1,this.privConversation=r}getConversationInfo(){return t.Contracts.throwIfNullOrUndefined(this.privConversation,"Conversation"),this.privConversation.conversationInfo}set meeting(r){t.Contracts.throwIfNullOrUndefined(r,"Meeting"),this.isMeetingRecognizer=!0,this.privMeeting=r}getMeetingInfo(){return t.Contracts.throwIfNullOrUndefined(this.privMeeting,"Meeting"),this.privMeeting.meetingInfo}IsMeetingRecognizer(){return this.isMeetingRecognizer}startContinuousRecognitionAsync(r,a){(0,e.marshalPromiseToCallbacks)(this.startContinuousRecognitionAsyncImpl(o.RecognitionMode.Conversation),r,a)}stopContinuousRecognitionAsync(r,a){(0,e.marshalPromiseToCallbacks)(this.stopContinuousRecognitionAsyncImpl(),r,a)}async close(){this.privDisposedRecognizer||await this.dispose(!0)}async pushConversationEvent(r,a){const c=this.privReco;t.Contracts.throwIfNullOrUndefined(c,"serviceRecognizer"),await c.sendSpeechEventAsync(r,a)}async pushMeetingEvent(r,a){const c=this.privReco;t.Contracts.throwIfNullOrUndefined(c,"serviceRecognizer"),await c.sendMeetingSpeechEventAsync(r,a)}async enforceAudioGating(){const c=(await this.audioConfig.format).channels;if(c===1){if(this.properties.getProperty("f0f5debc-f8c9-4892-ac4b-90a7ab359fd2","false").toLowerCase()!=="true")throw new Error("Single channel audio configuration for MeetingTranscriber is currently under private preview, please contact diarizationrequest@microsoft.com for more details")}else if(c!==8)throw new Error(`Unsupported audio configuration: Detected ${c}-channel audio`)}connectMeetingCallbacks(r){this.isMeetingRecognizer=!0,this.canceled=(a,c)=>{r.canceled&&r.canceled(r,c)},this.recognizing=(a,c)=>{r.transcribing&&r.transcribing(r,c)},this.recognized=(a,c)=>{r.transcribed&&r.transcribed(r,c)},this.sessionStarted=(a,c)=>{r.sessionStarted&&r.sessionStarted(r,c)},this.sessionStopped=(a,c)=>{r.sessionStopped&&r.sessionStopped(r,c)}}disconnectCallbacks(){this.canceled=void 0,this.recognizing=void 0,this.recognized=void 0,this.sessionStarted=void 0,this.sessionStopped=void 0}async dispose(r){this.privDisposedRecognizer||(r&&(this.privDisposedRecognizer=!0,await this.implRecognizerStop()),await super.dispose(r))}createRecognizerConfig(r){return new n.RecognizerConfig(r,this.properties)}createServiceRecognizer(r,a,c,u){const l=c;return new n.TranscriptionServiceRecognizer(r,a,l,u,this)}};return nA.TranscriberRecognizer=s,nA}var uS;function UU(){return uS||(uS=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.InternalParticipants=e.ConversationTranslatorMessageTypes=e.ConversationTranslatorCommandTypes=e.ParticipantsListEventArgs=e.ParticipantEventArgs=e.ParticipantAttributeEventArgs=e.MuteAllEventArgs=e.LockRoomEventArgs=e.ConversationReceivedTranslationEventArgs=e.TranscriberRecognizer=e.ConversationRecognizerFactory=e.ConversationConnectionConfig=e.ConversationManager=void 0;var t=dU();Object.defineProperty(e,"ConversationManager",{enumerable:!0,get:function(){return t.ConversationManager}});var i=Rr;Object.defineProperty(e,"ConversationConnectionConfig",{enumerable:!0,get:function(){return i.ConversationConnectionConfig}});var n=LU();Object.defineProperty(e,"ConversationRecognizerFactory",{enumerable:!0,get:function(){return n.ConversationRecognizerFactory}});var o=OU();Object.defineProperty(e,"TranscriberRecognizer",{enumerable:!0,get:function(){return o.TranscriberRecognizer}});var s=oS();Object.defineProperty(e,"ConversationReceivedTranslationEventArgs",{enumerable:!0,get:function(){return s.ConversationReceivedTranslationEventArgs}}),Object.defineProperty(e,"LockRoomEventArgs",{enumerable:!0,get:function(){return s.LockRoomEventArgs}}),Object.defineProperty(e,"MuteAllEventArgs",{enumerable:!0,get:function(){return s.MuteAllEventArgs}}),Object.defineProperty(e,"ParticipantAttributeEventArgs",{enumerable:!0,get:function(){return s.ParticipantAttributeEventArgs}}),Object.defineProperty(e,"ParticipantEventArgs",{enumerable:!0,get:function(){return s.ParticipantEventArgs}}),Object.defineProperty(e,"ParticipantsListEventArgs",{enumerable:!0,get:function(){return s.ParticipantsListEventArgs}});var A=Ki;Object.defineProperty(e,"ConversationTranslatorCommandTypes",{enumerable:!0,get:function(){return A.ConversationTranslatorCommandTypes}}),Object.defineProperty(e,"ConversationTranslatorMessageTypes",{enumerable:!0,get:function(){return A.ConversationTranslatorMessageTypes}}),Object.defineProperty(e,"InternalParticipants",{enumerable:!0,get:function(){return A.InternalParticipants}})}(Wl)),Wl}var ig={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.SynthesisAudioMetadata=e.MetadataType=void 0,function(i){i.WordBoundary="WordBoundary",i.Bookmark="Bookmark",i.Viseme="Viseme",i.SentenceBoundary="SentenceBoundary",i.SessionEnd="SessionEnd",i.AvatarSignal="TalkingAvatarSignal"}(e.MetadataType||(e.MetadataType={}));class t{constructor(n){this.privSynthesisAudioMetadata=JSON.parse(n)}static fromJSON(n){return new t(n)}get Metadata(){return this.privSynthesisAudioMetadata.Metadata}}e.SynthesisAudioMetadata=t})(ig);var rA={},di={};Object.defineProperty(di,"__esModule",{value:!0}),di.SynthesisStartedEvent=di.ConnectingToSynthesisServiceEvent=di.SynthesisTriggeredEvent=di.SpeechSynthesisEvent=void 0;const lS=ge();class Fc extends lS.PlatformEvent{constructor(t,i,n=lS.EventType.Info){super(t,n),this.privRequestId=i}get requestId(){return this.privRequestId}}di.SpeechSynthesisEvent=Fc;class NU extends Fc{constructor(t,i,n){super("SynthesisTriggeredEvent",t),this.privSessionAudioDestinationId=i,this.privTurnAudioDestinationId=n}get audioSessionDestinationId(){return this.privSessionAudioDestinationId}get audioTurnDestinationId(){return this.privTurnAudioDestinationId}}di.SynthesisTriggeredEvent=NU;class KU extends Fc{constructor(t,i){super("ConnectingToSynthesisServiceEvent",t),this.privAuthFetchEventId=i}get authFetchEventId(){return this.privAuthFetchEventId}}di.ConnectingToSynthesisServiceEvent=KU;class FU extends Fc{constructor(t,i){super("SynthesisStartedEvent",t),this.privAuthFetchEventId=i}get authFetchEventId(){return this.privAuthFetchEventId}}di.SynthesisStartedEvent=FU;var gS;function GU(){if(gS)return rA;gS=1,Object.defineProperty(rA,"__esModule",{value:!0}),rA.SynthesisTurn=void 0;const e=ge(),t=Bt,i=q(),n=ig,o=di;let s=class Bg{constructor(){this.privIsDisposed=!1,this.privIsSynthesizing=!1,this.privIsSynthesisEnded=!1,this.privBytesReceived=0,this.privInTurn=!1,this.privTextOffset=0,this.privNextSearchTextIndex=0,this.privSentenceOffset=0,this.privNextSearchSentenceIndex=0,this.privRequestId=(0,e.createNoDashGuid)(),this.privTurnDeferral=new e.Deferred,this.privTurnDeferral.resolve()}get requestId(){return this.privRequestId}get streamId(){return this.privStreamId}set streamId(r){this.privStreamId=r}get audioOutputFormat(){return this.privAudioOutputFormat}set audioOutputFormat(r){this.privAudioOutputFormat=r}get turnCompletionPromise(){return this.privTurnDeferral.promise}get isSynthesisEnded(){return this.privIsSynthesisEnded}get isSynthesizing(){return this.privIsSynthesizing}get currentTextOffset(){return this.privTextOffset}get currentSentenceOffset(){return this.privSentenceOffset}get bytesReceived(){return this.privBytesReceived}get audioDuration(){return this.privAudioDuration}get extraProperties(){if(this.privWebRTCSDP){const r=new i.PropertyCollection;return r.setProperty(i.PropertyId.TalkingAvatarService_WebRTC_SDP,this.privWebRTCSDP),r}}async getAllReceivedAudio(){return this.privReceivedAudio?Promise.resolve(this.privReceivedAudio):this.privIsSynthesisEnded?(await this.readAllAudioFromStream(),Promise.resolve(this.privReceivedAudio)):null}async getAllReceivedAudioWithHeader(){if(this.privReceivedAudioWithHeader)return this.privReceivedAudioWithHeader;if(!this.privIsSynthesisEnded)return null;if(this.audioOutputFormat.hasHeader){const r=await this.getAllReceivedAudio();return this.privReceivedAudioWithHeader=this.audioOutputFormat.addHeader(r),this.privReceivedAudioWithHeader}else return this.getAllReceivedAudio()}startNewSynthesis(r,a,c,u){this.privIsSynthesisEnded=!1,this.privIsSynthesizing=!0,this.privRequestId=r,this.privRawText=a,this.privIsSSML=c,this.privAudioOutputStream=new t.PullAudioOutputStreamImpl,this.privAudioOutputStream.format=this.privAudioOutputFormat,this.privReceivedAudio=null,this.privReceivedAudioWithHeader=null,this.privBytesReceived=0,this.privTextOffset=0,this.privNextSearchTextIndex=0,this.privSentenceOffset=0,this.privNextSearchSentenceIndex=0,this.privPartialVisemeAnimation="",this.privWebRTCSDP="",u!==void 0&&(this.privTurnAudioDestination=u,this.privTurnAudioDestination.format=this.privAudioOutputFormat),this.onEvent(new o.SynthesisTriggeredEvent(this.requestId,void 0,u===void 0?void 0:u.id()))}onPreConnectionStart(r){this.privAuthFetchEventId=r,this.onEvent(new o.ConnectingToSynthesisServiceEvent(this.privRequestId,this.privAuthFetchEventId))}onAuthCompleted(r){r&&this.onComplete()}onConnectionEstablishCompleted(r){if(r===200){this.onEvent(new o.SynthesisStartedEvent(this.requestId,this.privAuthFetchEventId)),this.privBytesReceived=0;return}else r===403&&this.onComplete()}onServiceResponseMessage(r){const a=JSON.parse(r);this.streamId=a.audio.streamId}onServiceTurnEndResponse(){this.privInTurn=!1,this.privTurnDeferral.resolve(),this.onComplete()}onServiceTurnStartResponse(r){this.privTurnDeferral&&this.privInTurn&&(this.privTurnDeferral.reject("Another turn started before current completed."),this.privTurnDeferral.promise.then().catch(()=>{})),this.privInTurn=!0,this.privTurnDeferral=new e.Deferred;const a=JSON.parse(r);a.webrtc&&(this.privWebRTCSDP=a.webrtc.connectionString)}onAudioChunkReceived(r){this.isSynthesizing&&(this.privAudioOutputStream.write(r),this.privBytesReceived+=r.byteLength,this.privTurnAudioDestination!==void 0&&this.privTurnAudioDestination.write(r))}onTextBoundaryEvent(r){this.updateTextOffset(r.Data.text.Text,r.Type)}onVisemeMetadataReceived(r){r.Data.AnimationChunk!==void 0&&(this.privPartialVisemeAnimation+=r.Data.AnimationChunk)}onSessionEnd(r){this.privAudioDuration=r.Data.Offset}async constructSynthesisResult(){const r=await this.getAllReceivedAudioWithHeader();return new i.SpeechSynthesisResult(this.requestId,i.ResultReason.SynthesizingAudioCompleted,r,void 0,this.extraProperties,this.audioDuration)}dispose(){this.privIsDisposed||(this.privIsDisposed=!0)}onStopSynthesizing(){this.onComplete()}getAndClearVisemeAnimation(){const r=this.privPartialVisemeAnimation;return this.privPartialVisemeAnimation="",r}onEvent(r){e.Events.instance.onEvent(r)}static isXmlTag(r){return r.length>=2&&r[0]==="<"&&r[r.length-1]===">"}updateTextOffset(r,a){a===n.MetadataType.WordBoundary?(this.privTextOffset=this.privRawText.indexOf(r,this.privNextSearchTextIndex),this.privTextOffset>=0&&(this.privNextSearchTextIndex=this.privTextOffset+r.length,this.privIsSSML&&this.withinXmlTag(this.privTextOffset)&&!Bg.isXmlTag(r)&&this.updateTextOffset(r,a))):(this.privSentenceOffset=this.privRawText.indexOf(r,this.privNextSearchSentenceIndex),this.privSentenceOffset>=0&&(this.privNextSearchSentenceIndex=this.privSentenceOffset+r.length,this.privIsSSML&&this.withinXmlTag(this.privSentenceOffset)&&!Bg.isXmlTag(r)&&this.updateTextOffset(r,a)))}onComplete(){this.privIsSynthesizing&&(this.privIsSynthesizing=!1,this.privIsSynthesisEnded=!0,this.privAudioOutputStream.close(),this.privInTurn=!1,this.privTurnAudioDestination!==void 0&&(this.privTurnAudioDestination.close(),this.privTurnAudioDestination=void 0))}async readAllAudioFromStream(){if(this.privIsSynthesisEnded){this.privReceivedAudio=new ArrayBuffer(this.bytesReceived);try{await this.privAudioOutputStream.read(this.privReceivedAudio)}catch{this.privReceivedAudio=new ArrayBuffer(0)}}}withinXmlTag(r){return this.privRawText.indexOf("<",r+1)>this.privRawText.indexOf(">",r+1)}};return rA.SynthesisTurn=s,rA}var oA={},ES;function xU(){if(ES)return oA;ES=1,Object.defineProperty(oA,"__esModule",{value:!0}),oA.SynthesisAdapterBase=void 0;const e=ge(),t=q(),i=se(),n=Oi;let o=class{constructor(A,r,a,c){if(this.speakOverride=void 0,this.receiveMessageOverride=void 0,this.connectImplOverride=void 0,this.configConnectionOverride=void 0,this.privConnectionConfigurationPromise=void 0,!A)throw new e.ArgumentNullError("authentication");if(!r)throw new e.ArgumentNullError("connectionFactory");if(!a)throw new e.ArgumentNullError("synthesizerConfig");this.privAuthentication=A,this.privConnectionFactory=r,this.privSynthesizerConfig=a,this.privIsDisposed=!1,this.privSessionAudioDestination=c,this.privSynthesisTurn=new i.SynthesisTurn,this.privConnectionEvents=new e.EventSource,this.privServiceEvents=new e.EventSource,this.privSynthesisContext=new i.SynthesisContext,this.privAgentConfig=new i.AgentConfig,this.connectionEvents.attach(u=>{if(u.name==="ConnectionClosedEvent"){const l=u;l.statusCode!==1e3&&this.cancelSynthesisLocal(t.CancellationReason.Error,l.statusCode===1007?t.CancellationErrorCode.BadRequestParameters:t.CancellationErrorCode.ConnectionFailure,`${l.reason} websocket error code: ${l.statusCode}`)}})}get synthesisContext(){return this.privSynthesisContext}get agentConfig(){return this.privAgentConfig}get connectionEvents(){return this.privConnectionEvents}get serviceEvents(){return this.privServiceEvents}set activityTemplate(A){this.privActivityTemplate=A}get activityTemplate(){return this.privActivityTemplate}set audioOutputFormat(A){this.privAudioOutputFormat=A,this.privSynthesisTurn.audioOutputFormat=A,this.privSessionAudioDestination!==void 0&&(this.privSessionAudioDestination.format=A),this.synthesisContext!==void 0&&(this.synthesisContext.audioOutputFormat=A)}isDisposed(){return this.privIsDisposed}async dispose(A){this.privIsDisposed=!0,this.privSessionAudioDestination!==void 0&&this.privSessionAudioDestination.close(),this.privConnectionConfigurationPromise!==void 0&&await(await this.privConnectionConfigurationPromise).dispose(A)}async connect(){await this.connectImpl()}async sendNetworkMessage(A,r){const a=typeof r=="string"?e.MessageType.Text:e.MessageType.Binary,c=typeof r=="string"?"application/json":"";return(await this.fetchConnection()).send(new n.SpeechConnectionMessage(a,A,this.privSynthesisTurn.requestId,c,r))}async Speak(A,r,a,c,u,l){let g;if(r?g=A:g=this.privSynthesizer.buildSsml(A),this.speakOverride!==void 0)return this.speakOverride(g,a,c,u);this.privSuccessCallback=c,this.privErrorCallback=u,this.privSynthesisTurn.startNewSynthesis(a,A,r,l);try{await this.connectImpl();const E=await this.fetchConnection();await this.sendSynthesisContext(E),await this.sendSsmlMessage(E,g,a),this.onSynthesisStarted(a),this.receiveMessage()}catch(E){return this.cancelSynthesisLocal(t.CancellationReason.Error,t.CancellationErrorCode.ConnectionFailure,E),Promise.reject(E)}}async stopSpeaking(){return await this.connectImpl(),(await this.fetchConnection()).send(new n.SpeechConnectionMessage(e.MessageType.Text,"synthesis.control",this.privSynthesisTurn.requestId,"application/json",JSON.stringify({action:"stop"})))}cancelSynthesis(A,r,a,c){const u=new t.PropertyCollection;u.setProperty(i.CancellationErrorCodePropertyName,t.CancellationErrorCode[a]);const l=new t.SpeechSynthesisResult(A,t.ResultReason.Canceled,void 0,c,u);if(this.onSynthesisCancelled(l),this.privSuccessCallback)try{this.privSuccessCallback(l)}catch{}}cancelSynthesisLocal(A,r,a){this.privSynthesisTurn.isSynthesizing&&(this.privSynthesisTurn.onStopSynthesizing(),this.cancelSynthesis(this.privSynthesisTurn.requestId,A,r,a))}processTypeSpecificMessages(A){return!0}async receiveMessage(){try{const r=await(await this.fetchConnection()).read();if(this.receiveMessageOverride!==void 0)return this.receiveMessageOverride();if(this.privIsDisposed)return;if(!r)return this.privSynthesisTurn.isSynthesizing?this.receiveMessage():void 0;const a=n.SpeechConnectionMessage.fromConnectionMessage(r);if(a.requestId.toLowerCase()===this.privSynthesisTurn.requestId.toLowerCase())switch(a.path.toLowerCase()){case"turn.start":this.privSynthesisTurn.onServiceTurnStartResponse(a.textBody);break;case"response":this.privSynthesisTurn.onServiceResponseMessage(a.textBody);break;case"audio":this.privSynthesisTurn.streamId.toLowerCase()===a.streamId.toLowerCase()&&a.binaryBody&&(this.privSynthesisTurn.onAudioChunkReceived(a.binaryBody),this.onSynthesizing(a.binaryBody),this.privSessionAudioDestination!==void 0&&this.privSessionAudioDestination.write(a.binaryBody));break;case"audio.metadata":const c=i.SynthesisAudioMetadata.fromJSON(a.textBody).Metadata;for(const l of c)switch(l.Type){case i.MetadataType.WordBoundary:case i.MetadataType.SentenceBoundary:this.privSynthesisTurn.onTextBoundaryEvent(l);const g=new t.SpeechSynthesisWordBoundaryEventArgs(l.Data.Offset,l.Data.Duration,l.Data.text.Text,l.Data.text.Length,l.Type===i.MetadataType.WordBoundary?this.privSynthesisTurn.currentTextOffset:this.privSynthesisTurn.currentSentenceOffset,l.Data.text.BoundaryType);this.onWordBoundary(g);break;case i.MetadataType.Bookmark:const E=new t.SpeechSynthesisBookmarkEventArgs(l.Data.Offset,l.Data.Bookmark);this.onBookmarkReached(E);break;case i.MetadataType.Viseme:if(this.privSynthesisTurn.onVisemeMetadataReceived(l),l.Data.IsLastAnimation){const C=new t.SpeechSynthesisVisemeEventArgs(l.Data.Offset,l.Data.VisemeId,this.privSynthesisTurn.getAndClearVisemeAnimation());this.onVisemeReceived(C)}break;case i.MetadataType.AvatarSignal:this.onAvatarEvent(l);break;case i.MetadataType.SessionEnd:this.privSynthesisTurn.onSessionEnd(l);break}break;case"turn.end":this.privSynthesisTurn.onServiceTurnEndResponse();let u;try{u=await this.privSynthesisTurn.constructSynthesisResult(),this.privSuccessCallback&&this.privSuccessCallback(u)}catch(l){this.privErrorCallback&&this.privErrorCallback(l)}this.onSynthesisCompleted(u);break;default:this.processTypeSpecificMessages(a)||this.privServiceEvents&&this.serviceEvents.onEvent(new e.ServiceEvent(a.path.toLowerCase(),a.textBody))}return this.receiveMessage()}catch{}}sendSynthesisContext(A){this.setSynthesisContextSynthesisSection();const r=this.synthesisContext.toJSON();if(r)return A.send(new n.SpeechConnectionMessage(e.MessageType.Text,"synthesis.context",this.privSynthesisTurn.requestId,"application/json",r))}setSpeechConfigSynthesisSection(){}connectImpl(A=!1){if(this.privConnectionPromise!=null)return this.privConnectionPromise.then(a=>a.state()===e.ConnectionState.Disconnected?(this.privConnectionId=null,this.privConnectionPromise=null,this.connectImpl()):this.privConnectionPromise,()=>(this.privConnectionId=null,this.privConnectionPromise=null,this.connectImpl()));this.privAuthFetchEventId=(0,e.createNoDashGuid)(),this.privConnectionId=(0,e.createNoDashGuid)(),this.privSynthesisTurn.onPreConnectionStart(this.privAuthFetchEventId);const r=A?this.privAuthentication.fetchOnExpiry(this.privAuthFetchEventId):this.privAuthentication.fetch(this.privAuthFetchEventId);return this.privConnectionPromise=r.then(async a=>{this.privSynthesisTurn.onAuthCompleted(!1);const c=await this.privConnectionFactory.create(this.privSynthesizerConfig,a,this.privConnectionId);c.events.attach(l=>{this.connectionEvents.onEvent(l)});const u=await c.open();return u.statusCode===200?(this.privSynthesisTurn.onConnectionEstablishCompleted(u.statusCode),Promise.resolve(c)):u.statusCode===403&&!A?this.connectImpl(!0):(this.privSynthesisTurn.onConnectionEstablishCompleted(u.statusCode),Promise.reject(`Unable to contact server. StatusCode: ${u.statusCode},
|
|
35
|
-
${this.privSynthesizerConfig.parameters.getProperty(t.PropertyId.SpeechServiceConnection_Url)} Reason: ${u.reason}`))},a=>{throw this.privSynthesisTurn.onAuthCompleted(!0),new Error(a)}),this.privConnectionPromise.catch(()=>{}),this.privConnectionPromise}sendSpeechServiceConfig(A,r){if(r)return A.send(new n.SpeechConnectionMessage(e.MessageType.Text,"speech.config",this.privSynthesisTurn.requestId,"application/json",r))}sendSsmlMessage(A,r,a){return A.send(new n.SpeechConnectionMessage(e.MessageType.Text,"ssml",a,"application/ssml+xml",r))}async fetchConnection(){return this.privConnectionConfigurationPromise!==void 0?this.privConnectionConfigurationPromise.then(A=>A.state()===e.ConnectionState.Disconnected?(this.privConnectionId=null,this.privConnectionConfigurationPromise=void 0,this.fetchConnection()):this.privConnectionConfigurationPromise,()=>(this.privConnectionId=null,this.privConnectionConfigurationPromise=void 0,this.fetchConnection())):(this.privConnectionConfigurationPromise=this.configureConnection(),await this.privConnectionConfigurationPromise)}async configureConnection(){const A=await this.connectImpl();return this.configConnectionOverride!==void 0?this.configConnectionOverride(A):(this.setSpeechConfigSynthesisSection(),await this.sendSpeechServiceConfig(A,this.privSynthesizerConfig.SpeechServiceConfig.serialize()),A)}onAvatarEvent(A){}onSynthesisStarted(A){}onSynthesizing(A){}onSynthesisCancelled(A){}onSynthesisCompleted(A){}onWordBoundary(A){}onVisemeReceived(A){}onBookmarkReached(A){}};return oA.SynthesisAdapterBase=o,o.telemetryDataEnabled=!0,oA}var sA={},hS;function jU(){if(hS)return sA;hS=1,Object.defineProperty(sA,"__esModule",{value:!0}),sA.AvatarSynthesisAdapter=void 0;const e=q(),t=se();let i=class extends t.SynthesisAdapterBase{constructor(o,s,A,r,a){super(o,s,A,void 0),this.privAvatarSynthesizer=r,this.privSynthesizer=r,this.privAvatarConfig=a}setSynthesisContextSynthesisSection(){this.privSynthesisContext.setSynthesisSection(void 0)}setSpeechConfigSynthesisSection(){var o,s,A,r,a,c,u,l,g,E,C,d,S,I,p,M,v;this.privSynthesizerConfig.synthesisVideoSection={format:{bitrate:(o=this.privAvatarConfig.videoFormat)==null?void 0:o.bitrate,codec:(s=this.privAvatarConfig.videoFormat)==null?void 0:s.codec,crop:{bottomRight:{x:(a=(r=(A=this.privAvatarConfig.videoFormat)==null?void 0:A.cropRange)==null?void 0:r.bottomRight)==null?void 0:a.x,y:(l=(u=(c=this.privAvatarConfig.videoFormat)==null?void 0:c.cropRange)==null?void 0:u.bottomRight)==null?void 0:l.y},topLeft:{x:(C=(E=(g=this.privAvatarConfig.videoFormat)==null?void 0:g.cropRange)==null?void 0:E.topLeft)==null?void 0:C.x,y:(I=(S=(d=this.privAvatarConfig.videoFormat)==null?void 0:d.cropRange)==null?void 0:S.topLeft)==null?void 0:I.y}},resolution:{height:(p=this.privAvatarConfig.videoFormat)==null?void 0:p.height,width:(M=this.privAvatarConfig.videoFormat)==null?void 0:M.width}},protocol:{name:"WebRTC",webrtcConfig:{clientDescription:btoa(this.privSynthesizerConfig.parameters.getProperty(e.PropertyId.TalkingAvatarService_WebRTC_SDP)),iceServers:this.privAvatarConfig.remoteIceServers??this.privAvatarSynthesizer.iceServers}},talkingAvatar:{background:{color:this.privAvatarConfig.backgroundColor,image:{url:(v=this.privAvatarConfig.backgroundImage)==null?void 0:v.toString()}},character:this.privAvatarConfig.character,customized:this.privAvatarConfig.customized,style:this.privAvatarConfig.style,useBuiltInVoice:this.privAvatarConfig.useBuiltInVoice}}}onAvatarEvent(o){if(this.privAvatarSynthesizer.avatarEventReceived){const s=new e.AvatarEventArgs(o.Data.Offset,o.Data.Name);try{this.privAvatarSynthesizer.avatarEventReceived(this.privAvatarSynthesizer,s)}catch{}}}};return sA.AvatarSynthesisAdapter=i,sA}var AA={},CS;function kU(){if(CS)return AA;CS=1,Object.defineProperty(AA,"__esModule",{value:!0}),AA.SpeechSynthesisAdapter=void 0;const e=q(),t=se();let i=class extends t.SynthesisAdapterBase{constructor(o,s,A,r,a){super(o,s,A,a),this.privSpeechSynthesizer=r,this.privSynthesizer=r}setSynthesisContextSynthesisSection(){this.privSynthesisContext.setSynthesisSection(this.privSpeechSynthesizer)}onSynthesisStarted(o){const s=new e.SpeechSynthesisEventArgs(new e.SpeechSynthesisResult(o,e.ResultReason.SynthesizingAudioStarted));this.privSpeechSynthesizer.synthesisStarted&&this.privSpeechSynthesizer.synthesisStarted(this.privSpeechSynthesizer,s)}onSynthesizing(o){if(this.privSpeechSynthesizer.synthesizing)try{const s=this.privSynthesisTurn.audioOutputFormat.addHeader(o),A=new e.SpeechSynthesisEventArgs(new e.SpeechSynthesisResult(this.privSynthesisTurn.requestId,e.ResultReason.SynthesizingAudio,s));this.privSpeechSynthesizer.synthesizing(this.privSpeechSynthesizer,A)}catch{}}onSynthesisCancelled(o){if(this.privSpeechSynthesizer.SynthesisCanceled){const s=new e.SpeechSynthesisEventArgs(o);try{this.privSpeechSynthesizer.SynthesisCanceled(this.privSpeechSynthesizer,s)}catch{}}}onSynthesisCompleted(o){if(this.privSpeechSynthesizer.synthesisCompleted)try{this.privSpeechSynthesizer.synthesisCompleted(this.privSpeechSynthesizer,new e.SpeechSynthesisEventArgs(o))}catch{}}onWordBoundary(o){if(this.privSpeechSynthesizer.wordBoundary)try{this.privSpeechSynthesizer.wordBoundary(this.privSpeechSynthesizer,o)}catch{}}onVisemeReceived(o){if(this.privSpeechSynthesizer.visemeReceived)try{this.privSpeechSynthesizer.visemeReceived(this.privSpeechSynthesizer,o)}catch{}}onBookmarkReached(o){if(this.privSpeechSynthesizer.bookmarkReached)try{this.privSpeechSynthesizer.bookmarkReached(this.privSpeechSynthesizer,o)}catch{}}};return AA.SpeechSynthesisAdapter=i,AA}var aA={},IS;function YU(){if(IS)return aA;IS=1,Object.defineProperty(aA,"__esModule",{value:!0}),aA.SynthesisRestAdapter=void 0;const e=ht(),t=q(),i=ai(),n=Et;let o=class{constructor(A,r){let a=A.parameters.getProperty(t.PropertyId.SpeechServiceConnection_Endpoint,void 0);if(!a){const u=A.parameters.getProperty(t.PropertyId.SpeechServiceConnection_Region,"westus"),l=i.ConnectionFactoryBase.getHostSuffix(u);a=A.parameters.getProperty(t.PropertyId.SpeechServiceConnection_Host,`https://${u}.tts.speech${l}`)}this.privUri=`${a}/cognitiveservices/voices/list`;const c=e.RestConfigBase.requestOptions;this.privRestAdapter=new e.RestMessageAdapter(c),this.privAuthentication=r}getVoicesList(A){return this.privRestAdapter.setHeaders(n.HeaderNames.ConnectionId,A),this.privAuthentication.fetch(A).then(r=>(this.privRestAdapter.setHeaders(r.headerName,r.token),this.privRestAdapter.request(e.RestRequestType.Get,this.privUri)))}};return aA.SynthesisRestAdapter=o,aA}var ng={},pS;function zU(){return pS||(pS=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.SynthesizerConfig=e.SynthesisServiceType=void 0;const t=se();var i;(function(o){o[o.Standard=0]="Standard",o[o.Custom=1]="Custom"})(i=e.SynthesisServiceType||(e.SynthesisServiceType={}));class n{constructor(s,A){this.privSynthesisServiceType=i.Standard,this.avatarEnabled=!1,this.privSpeechServiceConfig=s||new t.SpeechServiceConfig(new t.Context(null)),this.privParameters=A}get parameters(){return this.privParameters}get synthesisServiceType(){return this.privSynthesisServiceType}set synthesisServiceType(s){this.privSynthesisServiceType=s}set synthesisVideoSection(s){this.privSpeechServiceConfig.Context.synthesis={video:s}}get SpeechServiceConfig(){return this.privSpeechServiceConfig}}e.SynthesizerConfig=n}(ng)),ng}var cA={},dS;function PU(){if(dS)return cA;dS=1,Object.defineProperty(cA,"__esModule",{value:!0}),cA.SynthesisContext=void 0;const e=q();let t=class{constructor(){this.privContext={}}setSection(n,o){this.privContext[n]=o}set audioOutputFormat(n){this.privAudioOutputFormat=n}toJSON(){return JSON.stringify(this.privContext)}setSynthesisSection(n){const o=this.buildSynthesisContext(n);this.setSection("synthesis",o)}buildSynthesisContext(n){return{audio:{metadataOptions:{bookmarkEnabled:!!(n!=null&&n.bookmarkReached),punctuationBoundaryEnabled:n==null?void 0:n.properties.getProperty(e.PropertyId.SpeechServiceResponse_RequestPunctuationBoundary,!!(n!=null&&n.wordBoundary)),sentenceBoundaryEnabled:n==null?void 0:n.properties.getProperty(e.PropertyId.SpeechServiceResponse_RequestSentenceBoundary,!1),sessionEndEnabled:!0,visemeEnabled:!!(n!=null&&n.visemeReceived),wordBoundaryEnabled:n==null?void 0:n.properties.getProperty(e.PropertyId.SpeechServiceResponse_RequestWordBoundary,!!(n!=null&&n.wordBoundary))},outputFormat:this.privAudioOutputFormat.requestAudioFormatString},language:{autoDetection:n==null?void 0:n.autoDetectSourceLanguage}}}};return cA.SynthesisContext=t,cA}var uA={},SS;function bU(){if(SS)return uA;SS=1,Object.defineProperty(uA,"__esModule",{value:!0}),uA.SpeakerRecognitionConfig=void 0;const e=se();let t=class{constructor(n,o){this.privContext=n||new e.Context(null),this.privParameters=o}get parameters(){return this.privParameters}get Context(){return this.privContext}};return uA.SpeakerRecognitionConfig=t,uA}var lA={},MS;function JU(){if(MS)return lA;MS=1,Object.defineProperty(lA,"__esModule",{value:!0}),lA.SpeakerServiceRecognizer=void 0;const e=ht(),t=ge(),i=q(),n=se(),o=Oi;let s=class extends n.ServiceRecognizerBase{constructor(r,a,c,u,l){super(r,a,c,u,l),this.privSpeakerRecognizer=l,this.privSpeakerAudioSource=c,this.recognizeSpeaker=g=>this.recognizeSpeakerOnce(g),this.sendPrePayloadJSONOverride=()=>this.noOp()}processTypeSpecificMessages(r){let a=!1;const c=new i.PropertyCollection;switch(r.messageType===t.MessageType.Text&&c.setProperty(i.PropertyId.SpeechServiceResponse_JsonResult,r.textBody),r.path.toLowerCase()){case"speaker.response":const l=JSON.parse(r.textBody);let g;l.status.statusCode.toLowerCase()!=="success"?g=new i.SpeakerRecognitionResult(l,i.ResultReason.Canceled,i.CancellationErrorCode.ServiceError,l.status.reason):g=new i.SpeakerRecognitionResult(l,i.ResultReason.RecognizedSpeaker),this.privResultDeferral&&this.privResultDeferral.resolve(g),a=!0;break}const u=new t.Deferred;return u.resolve(a),u.promise}cancelRecognition(r,a,c,u,l){if(new i.PropertyCollection().setProperty(n.CancellationErrorCodePropertyName,i.CancellationErrorCode[u]),this.privResultDeferral){const E=new i.SpeakerRecognitionResult({scenario:this.privSpeakerModel.scenario,status:{statusCode:l,reason:l}},i.ResultReason.Canceled,u,l);try{this.privResultDeferral.resolve(E)}catch(C){this.privResultDeferral.reject(C)}}}async recognizeSpeakerOnce(r){this.privSpeakerModel=r,this.voiceProfileType=r.scenario,this.privResultDeferral||(this.privResultDeferral=new t.Deferred),this.privRequestSession.startNewRecognition(),this.privRequestSession.listenForServiceTelemetry(this.privSpeakerAudioSource.events),this.privRecognizerConfig.parameters.setProperty(i.PropertyId.Speech_SessionId,this.privRequestSession.sessionId);const a=this.connectImpl(),c=this.sendPreAudioMessages(this.extractSpeakerContext(r)),u=await this.privSpeakerAudioSource.attach(this.privRequestSession.audioNodeId),l=await this.privSpeakerAudioSource.format,g=await this.privSpeakerAudioSource.deviceInfo,E=new e.ReplayableAudioNode(u,l.avgBytesPerSec);await this.privRequestSession.onAudioSourceAttachCompleted(E,!1),this.privRecognizerConfig.SpeechServiceConfig.Context.audio={source:g};try{await a,await c}catch(S){this.cancelRecognition(this.privRequestSession.sessionId,this.privRequestSession.requestId,i.CancellationReason.Error,i.CancellationErrorCode.ConnectionFailure,S)}const C=new i.SessionEventArgs(this.privRequestSession.sessionId);return this.privRecognizer.sessionStarted&&this.privRecognizer.sessionStarted(this.privRecognizer,C),this.receiveMessage(),this.sendAudio(E).then(()=>{},S=>{this.cancelRecognition(this.privRequestSession.sessionId,this.privRequestSession.requestId,i.CancellationReason.Error,i.CancellationErrorCode.RuntimeError,S)}),this.privResultDeferral.promise}async sendPreAudioMessages(r){const a=await this.fetchConnection();await this.sendSpeakerRecognition(a,r)}async sendSpeakerRecognition(r,a){const c=JSON.stringify(a);return r.send(new o.SpeechConnectionMessage(t.MessageType.Text,"speaker.context",this.privRequestSession.requestId,"application/json; charset=utf-8",c))}extractSpeakerContext(r){return{features:{interimResult:"enabled",progressiveDetection:"disabled"},profileIds:r.profileIds,scenario:r.scenario}}};return lA.SpeakerServiceRecognizer=s,lA}var gA={},BS;function HU(){if(BS)return gA;BS=1,Object.defineProperty(gA,"__esModule",{value:!0}),gA.VoiceServiceRecognizer=void 0;const e=ht(),t=ge(),i=q(),n=se(),o=Oi;let s=class extends n.ServiceRecognizerBase{constructor(r,a,c,u,l){super(r,a,c,u,l),this.privDeferralMap=new t.DeferralMap,this.privSpeakerAudioSource=c,this.sendPrePayloadJSONOverride=()=>this.noOp()}set SpeakerAudioSource(r){this.privSpeakerAudioSource=r}processTypeSpecificMessages(r){let a=!1;const c=new i.PropertyCollection;switch(r.messageType===t.MessageType.Text&&c.setProperty(i.PropertyId.SpeechServiceResponse_JsonResult,r.textBody),r.path.toLowerCase()){case"speaker.profiles":const l=JSON.parse(r.textBody);switch(l.operation.toLowerCase()){case"create":this.handleCreateResponse(l,r.requestId);break;case"delete":case"reset":this.handleResultResponse(l,r.requestId);break;case"fetch":const d=JSON.parse(r.textBody);this.handleFetchResponse(d,r.requestId);break}a=!0;break;case"speaker.phrases":const g=JSON.parse(r.textBody);this.handlePhrasesResponse(g,r.requestId),a=!0;break;case"speaker.profile.enrollment":const E=JSON.parse(r.textBody),C=new i.VoiceProfileEnrollmentResult(this.enrollmentReasonFrom(E.enrollment?E.enrollment.enrollmentStatus:E.status.statusCode),E.enrollment?JSON.stringify(E.enrollment):void 0,E.status.reason);this.privDeferralMap.getId(r.requestId)&&this.privDeferralMap.complete(r.requestId,C),this.privRequestSession.onSpeechEnded(),a=!0;break}const u=new t.Deferred;return u.resolve(a),u.promise}cancelRecognition(r,a,c,u,l){new i.PropertyCollection().setProperty(n.CancellationErrorCodePropertyName,i.CancellationErrorCode[u]);const E=new i.VoiceProfileEnrollmentResult(i.ResultReason.Canceled,l,l);this.privDeferralMap.getId(a)&&this.privDeferralMap.complete(a,E)}async createProfile(r,a){this.voiceProfileType=r.toString();const c=this.connectImpl();try{const u=new t.Deferred;return await c,await this.sendCreateProfile(u,r,a),this.receiveMessage(),u.promise}catch(u){throw u}}async resetProfile(r){return this.voiceProfileType=r.profileType.toString(),this.sendCommonRequest("reset",r.profileType,r)}async deleteProfile(r){return this.voiceProfileType=r.profileType.toString(),this.sendCommonRequest("delete",r.profileType,r)}async retrieveEnrollmentResult(r){return this.voiceProfileType=r.profileType.toString(),this.privExpectedProfileId=r.profileId,this.sendCommonRequest("fetch",r.profileType,r)}async getAllProfiles(r){return this.voiceProfileType=r.toString(),this.sendCommonRequest("fetch",r)}async getActivationPhrases(r,a){this.voiceProfileType=r.toString();const c=this.connectImpl();try{const u=new t.Deferred;return await c,await this.sendPhrasesRequest(u,r,a),this.receiveMessage(),u.promise}catch(u){throw u}}async enrollProfile(r){this.voiceProfileType=r.profileType.toString();const a=new t.Deferred;this.privRequestSession.startNewRecognition(),this.privRequestSession.listenForServiceTelemetry(this.privSpeakerAudioSource.events),this.privRecognizerConfig.parameters.setProperty(i.PropertyId.Speech_SessionId,this.privRequestSession.sessionId);const c=this.connectImpl(),u=this.sendPreAudioMessages(r,a),l=await this.privSpeakerAudioSource.attach(this.privRequestSession.audioNodeId),g=await this.privSpeakerAudioSource.format,E=await this.privSpeakerAudioSource.deviceInfo,C=new e.ReplayableAudioNode(l,g.avgBytesPerSec);await this.privRequestSession.onAudioSourceAttachCompleted(C,!1),this.privRecognizerConfig.SpeechServiceConfig.Context.audio={source:E};try{await c,await u}catch(I){this.cancelRecognition(this.privRequestSession.sessionId,this.privRequestSession.requestId,i.CancellationReason.Error,i.CancellationErrorCode.ConnectionFailure,I)}const d=new i.SessionEventArgs(this.privRequestSession.sessionId);return this.privRecognizer.sessionStarted&&this.privRecognizer.sessionStarted(this.privRecognizer,d),this.receiveMessage(),this.sendAudio(C).then(()=>{},I=>{this.cancelRecognition(this.privRequestSession.sessionId,this.privRequestSession.requestId,i.CancellationReason.Error,i.CancellationErrorCode.RuntimeError,I)}),a.promise}async sendPreAudioMessages(r,a){const c=await this.fetchConnection();this.privRequestSession.onSpeechContext(),this.privDeferralMap.add(this.privRequestSession.requestId,a),await this.sendBaseRequest(c,"enroll",this.scenarioFrom(r.profileType),r)}async sendPhrasesRequest(r,a,c){const u=await this.fetchConnection();this.privRequestSession.onSpeechContext(),this.privDeferralMap.add(this.privRequestSession.requestId,r);const l=this.scenarioFrom(a),g={locale:c,scenario:l};return u.send(new o.SpeechConnectionMessage(t.MessageType.Text,"speaker.profile.phrases",this.privRequestSession.requestId,"application/json; charset=utf-8",JSON.stringify(g)))}async sendCreateProfile(r,a,c){const u=await this.fetchConnection();this.privRequestSession.onSpeechContext(),this.privDeferralMap.add(this.privRequestSession.requestId,r);const l=a===i.VoiceProfileType.TextIndependentIdentification?"TextIndependentIdentification":a===i.VoiceProfileType.TextIndependentVerification?"TextIndependentVerification":"TextDependentVerification",g={locale:c,number:"1",scenario:l};return u.send(new o.SpeechConnectionMessage(t.MessageType.Text,"speaker.profile.create",this.privRequestSession.requestId,"application/json; charset=utf-8",JSON.stringify(g)))}async sendCommonRequest(r,a,c=void 0){const u=this.connectImpl();try{const l=new t.Deferred;this.privRequestSession.onSpeechContext(),await u;const g=await this.fetchConnection();return this.privDeferralMap.add(this.privRequestSession.requestId,l),await this.sendBaseRequest(g,r,this.scenarioFrom(a),c),this.receiveMessage(),l.promise}catch(l){throw l}}async sendBaseRequest(r,a,c,u){const l={scenario:c};return u?l.profileIds=[u.profileId]:l.maxPageSize=-1,r.send(new o.SpeechConnectionMessage(t.MessageType.Text,`speaker.profile.${a}`,this.privRequestSession.requestId,"application/json; charset=utf-8",JSON.stringify(l)))}extractSpeakerContext(r){return{features:{interimResult:"enabled",progressiveDetection:"disabled"},profileIds:r.profileIds,scenario:r.scenario}}handlePhrasesResponse(r,a){if(this.privDeferralMap.getId(a))if(r.status.statusCode.toLowerCase()!=="success"){const c=i.ResultReason.Canceled,u=new i.VoiceProfilePhraseResult(c,r.status.statusCode,r.passPhraseType,[]);this.privDeferralMap.complete(a,u)}else if(r.phrases&&r.phrases.length>0){const c=i.ResultReason.EnrollingVoiceProfile,u=new i.VoiceProfilePhraseResult(c,r.status.statusCode,r.passPhraseType,r.phrases);this.privDeferralMap.complete(a,u)}else throw new Error("Voice Profile get activation phrases failed, no phrases received");else throw new Error(`Voice Profile get activation phrases request for requestID ${a} not found`)}handleCreateResponse(r,a){if(r.profiles&&r.profiles.length>0)if(this.privDeferralMap.getId(a)){const c=r.profiles.map(u=>u.profileId);this.privDeferralMap.complete(a,c)}else throw new Error(`Voice Profile create request for requestID ${a} not found`);else throw new Error("Voice Profile create failed, no profile id received")}handleResultResponse(r,a){if(this.privDeferralMap.getId(a)){const c=r.operation.toLowerCase()==="delete"?i.ResultReason.DeletedVoiceProfile:i.ResultReason.ResetVoiceProfile,u=r.status.statusCode.toLowerCase()==="success"?c:i.ResultReason.Canceled,l=new i.VoiceProfileResult(u,`statusCode: ${r.status.statusCode}, errorDetails: ${r.status.reason}`);this.privDeferralMap.complete(a,l)}else throw new Error(`Voice Profile create request for requestID ${a} not found`)}handleFetchResponse(r,a){if(this.privDeferralMap.getId(a)&&r.profiles[0]){if(this.privExpectedProfileId&&r.profiles.length===1&&r.profiles[0].profileId===this.privExpectedProfileId){this.privExpectedProfileId=void 0;const c=r.profiles[0],u=new i.VoiceProfileEnrollmentResult(this.enrollmentReasonFrom(c.enrollmentStatus),JSON.stringify(c),r.status.reason);this.privDeferralMap.complete(a,u)}else if(r.profiles.length>0){const c=r.profiles,u=[];for(const l of c)u.push(new i.VoiceProfileEnrollmentResult(this.enrollmentReasonFrom(l.enrollmentStatus),JSON.stringify(l),r.status.reason));this.privDeferralMap.complete(a,u)}}else throw new Error(`Voice Profile fetch request for requestID ${a} not found`)}enrollmentReasonFrom(r){switch(r.toLowerCase()){case"enrolled":return i.ResultReason.EnrolledVoiceProfile;case"invalidlocale":case"invalidphrase":case"invalidaudioformat":case"invalidscenario":case"invalidprofilecount":case"invalidoperation":case"audiotooshort":case"audiotoolong":case"toomanyenrollments":case"storageconflict":case"profilenotfound":case"incompatibleprofiles":case"incompleteenrollment":return i.ResultReason.Canceled;default:return i.ResultReason.EnrollingVoiceProfile}}scenarioFrom(r){return r===i.VoiceProfileType.TextIndependentIdentification?"TextIndependentIdentification":r===i.VoiceProfileType.TextIndependentVerification?"TextIndependentVerification":"TextDependentVerification"}};return gA.VoiceServiceRecognizer=s,gA}var vS={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.type=e.connectivity=e.Device=e.OS=e.System=e.Context=e.SpeechServiceConfig=void 0;class t{constructor(r){this.context=r}serialize(){return JSON.stringify(this,(r,a)=>{if(a&&typeof a=="object"&&!Array.isArray(a)){const c={};for(const u in a)Object.hasOwnProperty.call(a,u)&&(c[u&&u.charAt(0).toLowerCase()+u.substring(1)]=a[u]);return c}return a})}get Context(){return this.context}get Recognition(){return this.recognition}set Recognition(r){this.recognition=r.toLowerCase()}}e.SpeechServiceConfig=t;class i{constructor(r){this.system=new n,this.os=r}}e.Context=i;class n{constructor(){const r="1.44.0";this.name="SpeechSDK",this.version=r,this.build="JavaScript",this.lang="JavaScript"}}e.System=n;class o{constructor(r,a,c){this.platform=r,this.name=a,this.version=c}}e.OS=o;class s{constructor(r,a,c){this.manufacturer=r,this.model=a,this.version=c}}e.Device=s,function(A){A.Bluetooth="Bluetooth",A.Wired="Wired",A.WiFi="WiFi",A.Cellular="Cellular",A.InBuilt="InBuilt",A.Unknown="Unknown"}(e.connectivity||(e.connectivity={})),function(A){A.Phone="Phone",A.Speaker="Speaker",A.Car="Car",A.Headset="Headset",A.Thermostat="Thermostat",A.Microphones="Microphones",A.Deskphone="Deskphone",A.RemoteControl="RemoteControl",A.Unknown="Unknown",A.File="File",A.Stream="Stream"}(e.type||(e.type={}))})(vS);var fS;function se(){return fS||(fS=1,function(e){var t=me&&me.__createBinding||(Object.create?function(s,A,r,a){a===void 0&&(a=r),Object.defineProperty(s,a,{enumerable:!0,get:function(){return A[r]}})}:function(s,A,r,a){a===void 0&&(a=r),s[a]=A[r]}),i=me&&me.__exportStar||function(s,A){for(var r in s)r!=="default"&&!Object.prototype.hasOwnProperty.call(A,r)&&t(A,s,r)};Object.defineProperty(e,"__esModule",{value:!0}),e.AutoDetectSourceLanguagesOpenRangeOptionName=e.ForceDictationPropertyName=e.ServicePropertiesPropertyName=e.CancellationErrorCodePropertyName=e.OutputFormatPropertyName=e.SpeechSynthesisAdapter=e.AvatarSynthesisAdapter=void 0,i(pa,e),i(ka,e),i(Br,e),i(lI,e),i(gI,e),i(NO(),e),i(KO(),e),i(Ic,e),i(FO(),e),i(GO(),e),i(xO(),e),i(Dd,e),i(pc,e),i(kO(),e),i(YO(),e),i(zO(),e),i(PO(),e),i(sd(),e),i(bO(),e),i(Kd,e),i(JO(),e),i(dc,e),i(qO(),e),i(VO(),e),i(Mc,e),i(Bc,e),i(vc,e),i(WO(),e),i(ZO(),e),i(XO(),e),i(_O(),e),i($O(),e),i(fc,e),i(tU(),e),i(wc,e),i(qd,e),i(Qc,e),i(Dc,e),i(yc,e),i(CU(),e),i(Oc,e),i(UU(),e),i(ig,e),i(GU(),e),i(xU(),e);var n=jU();Object.defineProperty(e,"AvatarSynthesisAdapter",{enumerable:!0,get:function(){return n.AvatarSynthesisAdapter}});var o=kU();Object.defineProperty(e,"SpeechSynthesisAdapter",{enumerable:!0,get:function(){return o.SpeechSynthesisAdapter}}),i(YU(),e),i(zU(),e),i(PU(),e),i(bU(),e),i(JU(),e),i(HU(),e),i(vS,e),e.OutputFormatPropertyName="OutputFormat",e.CancellationErrorCodePropertyName="CancellationErrorCode",e.ServicePropertiesPropertyName="ServiceProperties",e.ForceDictationPropertyName="ForceDictation",e.AutoDetectSourceLanguagesOpenRangeOptionName="UND"}(al)),al}(function(e){var t=me&&me.__createBinding||(Object.create?function(o,s,A,r){r===void 0&&(r=A),Object.defineProperty(o,r,{enumerable:!0,get:function(){return s[A]}})}:function(o,s,A,r){r===void 0&&(r=A),o[r]=s[A]}),i=me&&me.__exportStar||function(o,s){for(var A in o)A!=="default"&&!Object.prototype.hasOwnProperty.call(s,A)&&t(s,o,A)};Object.defineProperty(e,"__esModule",{value:!0});const n=se();new n.AgentConfig,i(q(),e)})(pi);const vt=[];for(let e=0;e<256;++e)vt.push((e+256).toString(16).slice(1));function qU(e,t=0){return(vt[e[t+0]]+vt[e[t+1]]+vt[e[t+2]]+vt[e[t+3]]+"-"+vt[e[t+4]]+vt[e[t+5]]+"-"+vt[e[t+6]]+vt[e[t+7]]+"-"+vt[e[t+8]]+vt[e[t+9]]+"-"+vt[e[t+10]]+vt[e[t+11]]+vt[e[t+12]]+vt[e[t+13]]+vt[e[t+14]]+vt[e[t+15]]).toLowerCase()}let rg;const VU=new Uint8Array(16);function WU(){if(!rg){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");rg=crypto.getRandomValues.bind(crypto)}return rg(VU)}const wS={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function ZU(e,t,i){var o;if(wS.randomUUID&&!t&&!e)return wS.randomUUID();e=e||{};const n=e.random??((o=e.rng)==null?void 0:o.call(e))??WU();if(n.length<16)throw new Error("Random bytes length must be >= 16");if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,t){if(i=i||0,i<0||i+16>t.length)throw new RangeError(`UUID byte range ${i}:${i+15} is out of buffer bounds`);for(let s=0;s<16;++s)t[i+s]=n[s];return t}return qU(n)}const yr=lt(),QS=be(),Tr=f(""),qn=f(""),Fi=f(""),Si=f(""),RS=f("");let Cn=null;const mS=4e3;Gt(async()=>{await og()});let nt=null,Lr=null,Mi=null,Gc=null;const Or=()=>{Mi&&Mi.mute(),nt&&(nt.close(),nt=null),Lr=null},og=async()=>{var e,t,i;try{const n=await oi("/voiceTesting");return(e=n==null?void 0:n.data)==null?void 0:e.token}catch(n){if(console.error(n),Ne.isAxiosError(n)){const o=n;console.log("Error found!"),console.error((t=o.response)==null?void 0:t.data),yr.setError(((i=o.response)==null?void 0:i.data).message)}else yr.setError("There was an issue while fetching data")}},sg=()=>{Cn&&clearTimeout(Cn),Gc&&(Gc.stopContinuousRecognitionAsync(()=>{},e=>{console.error("Error stopping recognition",e)}),Gc=null)},XU=async e=>{const t=await og();return await Or(),new Promise((i,n)=>{const o=pi.SpeechConfig.fromAuthorizationToken(t,"eastus2");o.speechSynthesisVoiceName="en-US-EmmaMultilingualNeural",Mi=new pi.SpeakerAudioDestination;const s=pi.AudioConfig.fromSpeakerOutput(Mi);nt=new pi.SpeechSynthesizer(o,s);const A=ZU();Lr=A,nt.speakTextAsync(e,r=>{if(A!==Lr)return Mi==null||Mi.mute(),nt==null||nt.close(),nt=null,i();r.reason===pi.ResultReason.SynthesizingAudioCompleted?i():n(new Error("Speech synthesis failed")),nt==null||nt.close(),nt=null,Lr=null},r=>{if(A!==Lr)return Mi==null||Mi.mute(),nt==null||nt.close(),nt=null,i();nt==null||nt.close(),nt=null,Lr=null,n(r)})})},_U=async e=>{const t=await og(),i=pi.SpeechConfig.fromAuthorizationToken(t,"eastus2");i.speechRecognitionLanguage="en-US";const n=pi.AudioConfig.fromDefaultMicrophoneInput(),o=new pi.SpeechRecognizer(i,n);return Gc=o,Tr.value="",qn.value="",o.recognizing=(s,A)=>{A.result.text&&A.result.text.trim()&&(Tr.value=A.result.text.trim(),Or(),QS.userspeaking=!0,QS.userSpeechText=(qn.value?qn.value+" ":"")+Tr.value,Si.value="user",Cn&&clearTimeout(Cn),Cn=setTimeout(()=>{Tr.value&&(e(Tr.value.trim()),Tr.value="")},mS))},o.recognized=(s,A)=>{A.result.reason===pi.ResultReason.RecognizedSpeech&&A.result.text&&A.result.text.trim()&&(qn.value+=" "+A.result.text.trim(),Cn&&clearTimeout(Cn),Cn=setTimeout(()=>{qn.value&&(e(qn.value),qn.value="")},mS))},o.canceled=(s,A)=>{console.error("Recognition canceled:",A)},o.startContinuousRecognitionAsync(),o},$U=async()=>{var e,t;Fi.value="",RS.value="";try{Or(),await _U(i=>{i&&(Fi.value=i)})}catch(i){if(console.error(i),Ne.isAxiosError(i)){const n=i;console.log("Error found!"),console.error((e=n.response)==null?void 0:e.data),yr.setError(((t=n.response)==null?void 0:t.data).message)}else yr.setError("There was an issue while fetching data")}},eN=async e=>{var t,i;RS.value="";try{(Si.value=="user"||Si.value=="listening")&&Or(),await XU(e)}catch(n){if(console.error(n),Ne.isAxiosError(n)){const o=n;console.log("Error found!"),console.error((t=o.response)==null?void 0:t.data),yr.setError(((i=o.response)==null?void 0:i.data).message)}else yr.setError("There was an issue while fetching data")}},tN={class:"flex items-center gap-4 py-2 rounded-full z-10"},iN={key:0,class:"flex items-center"},nN={width:"30",height:"30",viewBox:"0 0 36 24",class:"fill-white",style:{transform:"scaleX(-1)"}},rN=[rr('<rect x="0" y="11" width="2" height="2" rx="1"><animate attributeName="height" values="2;6;2" dur="1s" repeatCount="indefinite" begin="0s"></animate><animate attributeName="y" values="11;9;11" dur="1s" repeatCount="indefinite" begin="0s"></animate></rect><rect x="4" y="10" width="2" height="4" rx="1"><animate attributeName="height" values="4;8;4" dur="1s" repeatCount="indefinite" begin="0.1s"></animate><animate attributeName="y" values="10;8;10" dur="1s" repeatCount="indefinite" begin="0.1s"></animate></rect><rect x="8" y="8" width="2" height="8" rx="1"><animate attributeName="height" values="8;12;8" dur="1s" repeatCount="indefinite" begin="0.2s"></animate><animate attributeName="y" values="8;6;8" dur="1s" repeatCount="indefinite" begin="0.2s"></animate></rect><rect x="12" y="6" width="2" height="12" rx="1"><animate attributeName="height" values="12;16;12" dur="1s" repeatCount="indefinite" begin="0.3s"></animate><animate attributeName="y" values="6;4;6" dur="1s" repeatCount="indefinite" begin="0.3s"></animate></rect><rect x="16" y="4" width="2" height="16" rx="1"><animate attributeName="height" values="16;20;16" dur="1s" repeatCount="indefinite" begin="0.4s"></animate><animate attributeName="y" values="4;2;4" dur="1s" repeatCount="indefinite" begin="0.4s"></animate></rect><rect x="20" y="6" width="2" height="12" rx="1"><animate attributeName="height" values="12;16;12" dur="1s" repeatCount="indefinite" begin="0.5s"></animate><animate attributeName="y" values="6;4;6" dur="1s" repeatCount="indefinite" begin="0.5s"></animate></rect><rect x="24" y="8" width="2" height="8" rx="1"><animate attributeName="height" values="8;12;8" dur="1s" repeatCount="indefinite" begin="0.6s"></animate><animate attributeName="y" values="8;6;8" dur="1s" repeatCount="indefinite" begin="0.6s"></animate></rect><rect x="28" y="10" width="2" height="4" rx="1"><animate attributeName="height" values="4;8;4" dur="1s" repeatCount="indefinite" begin="0.7s"></animate><animate attributeName="y" values="10;8;10" dur="1s" repeatCount="indefinite" begin="0.7s"></animate></rect><rect x="32" y="11" width="2" height="2" rx="1"><animate attributeName="height" values="2;6;2" dur="1s" repeatCount="indefinite" begin="0.8s"></animate><animate attributeName="y" values="11;9;11" dur="1s" repeatCount="indefinite" begin="0.8s"></animate></rect>',9)],oN={key:1,class:"flex items-center"},sN={width:"30",height:"30",viewBox:"0 0 36 24",class:"fill-white",style:{transform:"scaleX(-1)"}},AN=[rr('<rect x="0" y="11" width="2" height="2" rx="1"><animate attributeName="height" values="2;6;2" dur="1s" repeatCount="indefinite" begin="0s"></animate><animate attributeName="y" values="11;9;11" dur="1s" repeatCount="indefinite" begin="0s"></animate></rect><rect x="4" y="10" width="2" height="4" rx="1"><animate attributeName="height" values="4;8;4" dur="1s" repeatCount="indefinite" begin="0.1s"></animate><animate attributeName="y" values="10;8;10" dur="1s" repeatCount="indefinite" begin="0.1s"></animate></rect><rect x="8" y="8" width="2" height="8" rx="1"><animate attributeName="height" values="8;12;8" dur="1s" repeatCount="indefinite" begin="0.2s"></animate><animate attributeName="y" values="8;6;8" dur="1s" repeatCount="indefinite" begin="0.2s"></animate></rect><rect x="12" y="6" width="2" height="12" rx="1"><animate attributeName="height" values="12;16;12" dur="1s" repeatCount="indefinite" begin="0.3s"></animate><animate attributeName="y" values="6;4;6" dur="1s" repeatCount="indefinite" begin="0.3s"></animate></rect><rect x="16" y="4" width="2" height="16" rx="1"><animate attributeName="height" values="16;20;16" dur="1s" repeatCount="indefinite" begin="0.4s"></animate><animate attributeName="y" values="4;2;4" dur="1s" repeatCount="indefinite" begin="0.4s"></animate></rect><rect x="20" y="6" width="2" height="12" rx="1"><animate attributeName="height" values="12;16;12" dur="1s" repeatCount="indefinite" begin="0.5s"></animate><animate attributeName="y" values="6;4;6" dur="1s" repeatCount="indefinite" begin="0.5s"></animate></rect><rect x="24" y="8" width="2" height="8" rx="1"><animate attributeName="height" values="8;12;8" dur="1s" repeatCount="indefinite" begin="0.6s"></animate><animate attributeName="y" values="8;6;8" dur="1s" repeatCount="indefinite" begin="0.6s"></animate></rect><rect x="28" y="10" width="2" height="4" rx="1"><animate attributeName="height" values="4;8;4" dur="1s" repeatCount="indefinite" begin="0.7s"></animate><animate attributeName="y" values="10;8;10" dur="1s" repeatCount="indefinite" begin="0.7s"></animate></rect><rect x="32" y="11" width="2" height="2" rx="1"><animate attributeName="height" values="2;6;2" dur="1s" repeatCount="indefinite" begin="0.8s"></animate><animate attributeName="y" values="11;9;11" dur="1s" repeatCount="indefinite" begin="0.8s"></animate></rect>',9)],aN={key:2,class:"flex items-center"},cN=[rr('<svg width="30" height="30" viewBox="0 0 64 64" fill="none" xmlns="http://www.w3.org/2000/svg"><rect x="12" y="16" width="40" height="32" rx="8" fill="white" stroke="#9CA3AF" stroke-width="2"></rect><circle cx="24" cy="32" r="4" fill="black"></circle><circle cx="40" cy="32" r="4" fill="black"></circle><line x1="32" y1="10" x2="32" y2="16" stroke="#9CA3AF" stroke-width="2"></line><circle cx="32" cy="8" r="2" fill="white"></circle><circle cx="52" cy="14" r="3" fill="white"><animate attributeName="opacity" values="0;1;0" dur="1.2s" begin="0s" repeatCount="indefinite"></animate></circle><circle cx="58" cy="10" r="2.5" fill="white"><animate attributeName="opacity" values="0;1;0" dur="1.2s" begin="0.2s" repeatCount="indefinite"></animate></circle><circle cx="63" cy="6" r="2" fill="white"><animate attributeName="opacity" values="0;1;0" dur="1.2s" begin="0.4s" repeatCount="indefinite"></animate></circle></svg>',1)],uN={class:"tooltiptext text-genpact-darkest-teal"},lN=[h("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-[10px] w-[10px] text-gray-700",fill:"currentColor",viewBox:"0 0 24 24"},[h("path",{d:"M12 14a3 3 0 0 0 3-3V5a3 3 0 0 0-6 0v6a3 3 0 0 0 3 3zm5-3a5 5 0 0 1-10 0H5a7 7 0 0 0 14 0h-2zm-5 9a7 7 0 0 0 7-7h2a9 9 0 0 1-8 8.94V22h-2v-1.06A9 9 0 0 1 3 13h2a7 7 0 0 0 7 7z"})],-1)],gN=[h("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-[10px] w-[10px] text-gray-700",fill:"currentColor",viewBox:"0 0 24 24"},[h("path",{d:"M12 14a3 3 0 0 0 3-3V5a3 3 0 0 0-6 0v6a3 3 0 0 0 3 3zm5-3a5 5 0 0 1-10 0H5a7 7 0 0 0 14 0h-2zm-5 9a7 7 0 0 0 7-7h2a9 9 0 0 1-8 8.94V22h-2v-1.06A9 9 0 0 1 3 13h2a7 7 0 0 0 7 7z"}),h("line",{x1:"4",y1:"4",x2:"20",y2:"20",stroke:"currentColor","stroke-width":"2"})],-1)],EN=Re({__name:"WebSocketVoiceConversation",setup(e,{expose:t}){const i=f(!1),n=f("Turn on mic"),o=()=>{i.value===!1?(console.log("mic enabled true"),i.value=!0,Or(),$U(),Si.value="user",n.value="Turn off mic"):(console.log("mic enabled false"),sg(),i.value=!1,n.value="Turn on mic")},s=()=>{console.log("closeConversation"),sg(),Or(),Si.value="none",i.value=!1};return t({micEnabled:i}),(A,r)=>(Q(),R("div",tN,[m(Si)==="bot"?(Q(),R("div",iN,[h("span",null,[(Q(),R("svg",nN,rN))])])):m(Si)==="user"?(Q(),R("div",oN,[h("span",null,[(Q(),R("svg",sN,AN))])])):m(Si)==="listening"?(Q(),R("div",aN,cN)):Me("",!0),h("div",{class:Ee([i.value?"":"animate-pulse","tooltip"])},[h("span",uN,de(n.value),1),i.value?(Q(),R("button",{key:0,class:"rounded-full bg-white p-2 transition hover:bg-gray-300",onClick:r[0]||(r[0]=a=>o())},lN)):(Q(),R("button",{key:1,class:"rounded-full bg-white p-2 transition hover:bg-gray-300",onClick:r[1]||(r[1]=a=>o())},gN))],2),h("button",{class:"rounded-full bg-white p-2 hover:bg-gray-300",onClick:r[2]||(r[2]=a=>s())},[ne(m(vC),{class:"h-[10px] w-[10px] text-gray-700"})])]))}}),In=e=>(At("data-v-540bff5b"),e=e(),at(),e),hN={class:"z-3 absolute bottom-0 mt-4 w-full bg-white px-2 md:px-6"},CN={class:"py-2"},IN={class:"flex"},pN={class:"z-1 relative w-full"},dN={class:"flex justify-between my-2 w-full"},SN=In(()=>h("div",null,null,-1)),MN={key:0,class:"flex justify-center bg-genpact-darkest-blue px-4 rounded-full"},BN={class:"relative w-full"},vN={class:"absolute inset-y-0 left-0 flex items-center pl-3"},fN={class:"tooltip"},wN=In(()=>h("span",{class:"tooltiptext text-genpact-darkest-teal"},"Restart",-1)),QN=[In(()=>h("path",{d:"M12 4C8.229 4 6.343 4 5.172 5.172C4.001 6.344 4 8.229 4 12V18C4 18.943 4 19.414 4.293 19.707C4.586 20 5.057 20 6 20H12C15.771 20 17.657 20 18.828 18.828C19.999 17.656 20 15.771 20 12",stroke:"currentColor","stroke-width":"2"},null,-1)),In(()=>h("path",{d:"M9 10H15M9 14H12M19 8V2M16 5H22",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},null,-1))],RN={class:"absolute inset-y-0 right-0 flex items-center md:pr-8 pr-3"},mN={key:0},DN=["disabled"],yN=[In(()=>h("path",{d:"M15.854.146a.5.5 0 0 1 .11.54l-5.819 14.547a.75.75 0 0 1-1.329.124l-3.178-4.995L.643 7.184a.75.75 0 0 1 .124-1.33L15.314.037a.5.5 0 0 1 .54.11ZM6.636 10.07l2.761 4.338L14.13 2.576 6.636 10.07Zm6.787-8.201L1.591 6.602l4.339 2.76 7.494-7.493Z"},null,-1))],TN={key:1,class:"tooltip"},LN=[In(()=>h("span",{class:"tooltiptext fontFormattingAMA"},"Waiting for response",-1)),In(()=>h("img",{title:"Waiting for response",class:"w-7 h-7",src:Al,alt:"watingIcon"},null,-1))],ON={class:"flex justify-start gap-2 md:gap-1"},UN=["disabled"],NN=In(()=>h("div",{class:"pt-1 text-start font-sans text-xs font-bold text-gray-500 md:text-sm"},[h("div",null," Note: AI-generated response may not be fully accurate; check with experts for critical information. ")],-1)),KN="wss://corp-wap-eus-dev-tas-immerse-01.azurewebsites.net",FN=Re({__name:"NewQuestionSimulation",setup(e,{expose:t}){const i=be(),n=lt(),o=f(),s=f(null),A=f(!1),r=f(Wt),a=f(!1),c=f(""),u=f(""),l=f(),g=f(""),E=async()=>{l.value=new WebSocket(KN),l.value.onopen=()=>{u.value="WebSocket connected"},l.value.onmessage=async I=>{try{if(typeof I.data!="string"||!I.data.trim()||!I.data.trim().startsWith("{"))return;const p=JSON.parse(I.data);if(p.status&&(u.value=p.status),p.body&&p.body.answer&&(i.botresponse=!0,i.streamingContent+=p.body.answer),p.done){i.dotLoader&&(i.dotLoader=!1),a.value=!1,Si.value="bot",u.value="Streaming complete",i.botresponse=!1,c.value=i.streamingContent;const M={question:g.value,answer:c.value};i.addConversation(M,"new"),i.dotLoader=!1,i.showVoiceComponent&&(c.value.includes("Feedback and Assessment")?(i.showVoiceComponent=!1,sg(),o.value.micEnabled.value=!1):await eN(c.value.replace(/[*#]/g,"")))}p.error&&(u.value=`Error: ${p.error}`,n.setError(`Server error: ${p.error}`),a.value=!1,i.dotLoader=!1)}catch{u.value="Received non-JSON message",n.setError("Invalid response from server."),a.value=!1,i.dotLoader=!1}},l.value.onerror=I=>{u.value="WebSocket error",n.setError("WebSocket connection error. Please try again."),a.value=!1,i.dotLoader=!1},l.value.onclose=I=>{u.value="WebSocket closed",I.wasClean||(n.setError("WebSocket closed unexpectedly."),E()),a.value=!1,i.dotLoader=!1}};Gt(E),hu(()=>{l.value&&l.value.close()});const C=()=>{window.location.reload()},d=I=>{const p=I.length;r.value=Wt-p,A.value=p>=Wt},S=async()=>{try{if(i.question.trim().length<1&&Fi.value.trim().length<1){console.log("Please enter answer!"),n.setError("Please enter answer!");return}const I=localStorage.getItem("accessToken");a.value=!0,console.log(" isWaitingResponse",a.value),i.dotLoader=!0,i.streamingContent="";const p={question:i.question||Fi.value};i.conversations.push(p),g.value=i.question||Fi.value,i.question="";const M={question:g.value,bandCode:"A1",userFunction:"Engineering",auth_token:`Bearer ${I}`,past_messages:i.past_messages};l.value.send(JSON.stringify(M)),u.value="Question sent..."}catch(I){console.error(I),i.dotLoader=!1,a.value=!1,n.setError("Failed to send question. Please try again.")}};return Ji(Fi,async I=>{if(I){if(console.log("Recognized text:",I),Fi.value.toLowerCase().includes("play")&&Fi.value.length<10){console.log("play command detected, ignoring input");return}Si.value="listening",i.userspeaking=!1,await S(),Fi.value=""}}),t({sendQuestion:S}),(I,p)=>(Q(),R("div",hN,[h("div",CN,[h("div",IN,[h("div",pN,[h("div",dN,[SN,m(i).showVoiceComponent?(Q(),R("div",MN,[ne(EN,{ref_key:"voiceref",ref:o},null,512)])):Me("",!0)]),h("div",BN,[h("div",vN,[h("div",fN,[wN,(Q(),R("svg",{onClick:C,class:"ml-2 h-7 w-7 rounded",id:"newTopicDisable",width:"7",height:"",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",title:"restart"},QN))])]),h("div",RN,[a.value?(Q(),R("div",TN,LN)):(Q(),R("div",mN,[(Q(),R("svg",{disabled:m(i).beginFlag===!0,class:Ee([m(i).beginFlag===!0?"cursor-not-allowed text-gray-600":"cursor-pointer","bi bi-send ml-2 h-7 w-7 rotate-45 rounded"]),onClick:p[0]||(p[0]=M=>m(i).searchBoxdisable===!1||m(i).beginFlag===!0?"":S()),xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 16 16"},yN,10,DN))]))]),h("div",ON,[Te(h("input",{onKeyup:[p[1]||(p[1]=Tu(M=>a.value?"":S(),["enter"])),p[3]||(p[3]=M=>d(m(i).question))],disabled:m(i).beginFlag===!0||m(i).searchBoxdisable===!1,class:Ee([m(i).beginFlag===!0||m(i).searchBoxdisable===!1?"cursor-not-allowed bg-[#e5e7eb]":"bg-white","fontFormattingAMA rounded-lg flex w-full border border-genpact-darkest-teal py-[18px] px-[70px]"]),"onUpdate:modelValue":p[2]||(p[2]=M=>m(i).question=M),placeholder:"Write your answer here...",type:"text",ref_key:"AiSearch",ref:s},null,42,UN),[[qe,m(i).question]])])]),NN])])])]))}}),Uk="",GN=je(FN,[["__scopeId","data-v-540bff5b"]]),xc=e=>(At("data-v-a047746e"),e=e(),at(),e),xN={class:"z-3 absolute bottom-0 mt-4 w-full bg-white px-2 md:px-6"},jN={class:"py-2"},kN={class:"flex"},YN={class:"z-1 relative w-full"},zN={class:"relative w-full"},PN={class:"absolute inset-y-0 right-0 flex items-center md:pr-8 pr-3"},bN={key:0},JN=["disabled"],HN=[xc(()=>h("path",{d:"M15.854.146a.5.5 0 0 1 .11.54l-5.819 14.547a.75.75 0 0 1-1.329.124l-3.178-4.995L.643 7.184a.75.75 0 0 1 .124-1.33L15.314.037a.5.5 0 0 1 .54.11ZM6.636 10.07l2.761 4.338L14.13 2.576 6.636 10.07Zm6.787-8.201L1.591 6.602l4.339 2.76 7.494-7.493Z"},null,-1))],qN={key:1,class:"tooltip"},VN=[xc(()=>h("span",{class:"tooltiptext fontFormattingAMA"},"Waiting for response",-1)),xc(()=>h("img",{class:"w-7 h-7",src:Al,alt:"watingIcon"},null,-1))],WN={class:"flex justify-start gap-2 md:gap-1"},ZN=["disabled"],XN=xc(()=>h("div",{class:"pt-1 text-start font-sans text-xs font-bold text-gray-500 md:text-sm"},[h("div",null," Note: AI-generated response may not be fully accurate; check with experts for critical information. ")],-1)),_N=Re({__name:"NewMDMQuestionSimulation",setup(e){const t=be(),i=lt(),n=f("");t.question="";const o=f(null),s=f(!1),A=f(Wt),r=f(!1);n.value=t.recognizedText,Gt(()=>{o.value.focus()});const a=u=>{const l=u.length;A.value=Wt-l,s.value=l>=Wt},c=async()=>{var u,l,g;console.log("options fdsfdscdzxfsdv",t.recognizedText);try{if(console.log("options fdsfdscdzxfsdv",t.recognizedText),t.question.trim().length<1){console.log("Please enter answer!");return}r.value=!0,t.dotLoader=!0;const E={question:t.question||t.recognizedText};console.log("ques",E),t.conversations.push(E);const C=f("");C.value=t.question||t.recognizedText,t.question="";const d={assessmentId:t.simulationSkill,question:C.value,past_messages:t.past_messages,prompt:t.generatedPrompt,assessmentType:t.assessmentType,userFunction:"HR",empSeniority:t.empSeniority,functionRole:t.functionRole,userBand:t.band_code,storeFinalFeedback:t.storeFinalFeedback,storeFinalScore:t.storeFinalScore};console.log("Payload for MDM1==> ",d);let S;Ii==="prod"?S="/ManualExportActivity":S="/fetchCompletionDemo";const I=await Yt(S,d);t.addConversation((u=I.data)==null?void 0:u.body,"new"),r.value=!1,t.dotLoader=!1,t.recognizedText=""}catch(E){if(console.error(E),Ne.isAxiosError(E)){const C=E;console.log("Error found!"),console.error((l=C.response)==null?void 0:l.data),i.setError(((g=C.response)==null?void 0:g.data).message)}else i.setError("There was an issue, please contact helpmate")}};return(u,l)=>(Q(),R("div",xN,[h("div",jN,[h("div",kN,[h("div",YN,[h("div",zN,[h("div",PN,[r.value?(Q(),R("div",qN,VN)):(Q(),R("div",bN,[(Q(),R("svg",{disabled:m(t).beginFlag===!0,class:Ee([m(t).beginFlag===!0?"cursor-not-allowed text-gray-600":"cursor-pointer","bi bi-send ml-2 h-7 w-7 rotate-45 rounded"]),onClick:l[0]||(l[0]=g=>m(t).searchBoxdisable===!1||m(t).beginFlag===!0?"":c()),xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 16 16"},HN,10,JN))]))]),h("div",WN,[Te(h("input",{onKeyup:[l[1]||(l[1]=Tu(g=>r.value?"":c(),["enter"])),l[3]||(l[3]=g=>a(m(t).question))],disabled:m(t).beginFlag===!0||m(t).searchBoxdisable===!1,class:Ee([m(t).beginFlag===!0||m(t).searchBoxdisable===!1?"cursor-not-allowed bg-[#e5e7eb]":"bg-white","fontFormattingAMA rounded-lg flex w-full border border-genpact-darkest-teal py-[18px] pl-[30px] pr-[70px]"]),"onUpdate:modelValue":l[2]||(l[2]=g=>m(t).question=g),placeholder:"Write your answer here...",type:"text",ref_key:"AiSearch",ref:o},null,42,ZN),[[qe,m(t).question]])])]),XN])])])]))}}),Gk="",$N=je(_N,[["__scopeId","data-v-a047746e"]]),eK={},tK={class:"flex min-h-screen justify-center -mt-16"},iK=[h("div",{class:"flex items-center justify-center"},[h("img",{class:"loadercss",src:Di,alt:"Loader Gif"})],-1)];function nK(e,t){return Q(),R("div",tK,iK)}const DS=je(eK,[["render",nK]]),EA=e=>(At("data-v-450b2de7"),e=e(),at(),e),rK={class:"max-h-screen overflow-auto md:p-6 p-3 text-[#161916]"},oK={key:0,class:"flex flex-col items-center justify-center gap-4"},sK=[EA(()=>h("div",{class:"text-2xl font-[700]"},"Assessment Access Required",-1)),EA(()=>h("h3",{className:"text-lg font-medium my-6 text-center text-gray-500"}," You don't have access to this assessment. Please contact to administrator ",-1))],AK={key:1,class:"flex flex-col items-center justify-center gap-4"},aK=[EA(()=>h("div",{class:"text-2xl font-[700]"},"Invalid URL",-1)),EA(()=>h("h3",{className:"text-lg font-medium my-6 text-center text-gray-500"}," Invalid URL or assessment not found. Please check the URL or contact support. ",-1))],cK={key:1,className:"h-screen flex flex-col items-stretch"},uK={class:"z-20"},lK=EA(()=>h("div",{class:"mt-6"},null,-1)),gK={class:"flex h-full items-stretch overflow-hidden"},EK={class:"mx-auto w-11/12 bg-white"},hK={class:"relative flex h-full w-full flex-col items-stretch overflow-hidden"},CK={key:0,class:"relative"},IK={key:1,class:"relative"},pK=Re({__name:"AssessmentSimulation",setup(e){const t=f(!0),i=f(!1),n=f(!1);f(!1),f(!1);const o=be(),s=lt(),A=f(""),r=f(""),a=f(""),c=f(""),u=localStorage.getItem("accessToken");let l="";const g=f("");let E="",C="";const d=f(),S=f(!1),I=new URL(window.location.href),p=I.searchParams.get("skillId")||I.searchParams.get("assessmentId");r.value=I.searchParams.get("mode")??"",o.simulationSkill=p??"";const M=["703331197","703380812","703331909","703363051","703319578"];Gt(async()=>{t.value=!0,await v(),await O()});const v=async()=>{var D,j,z,G,K,ie,X;try{const Y=await oi(`/getLearnerData?forSimulation=true&skillForSimulation=${o.simulationSkill}`);o.initialize(Y.data),o.assessmentQuestion||(console.log("getAssessmentDetails========================>"),await T()),t.value=!1,o.simulationSkill==="937e84ef-e95d-4327-9afe-e7be2bf420eb"?o.skillNameForSimulation="GenpactNext":o.simulationSkill==="32b7d6d8-f7a8-40a0-ab84-8784f25897ea"||o.simulationSkill==="32b7d6d8-f7a8-40a0-ab84-8784f25897ef"?o.skillNameForSimulation="Agentic AI":o.simulationSkill==="7bd03cb6-79ad-4e2a-8a8b-88dc16147369"&&(o.skillNameForSimulation="Data")}catch(Y){if(console.error(Y),t.value=!1,Ne.isAxiosError(Y)&&((D=Y.response)!=null&&D.status)||Y&&typeof Y=="object"&&"response"in Y&&Y.response&&typeof Y.response=="object"&&"status"in Y.response&&Y.response.status){const L=Y;if(console.log("Error found!"),console.error((j=L.response)==null?void 0:j.data),((z=L.response)==null?void 0:z.status)===424||((G=L.response)==null?void 0:G.status)===425||((K=L.response)==null?void 0:K.status)===400){c.value=(ie=L.response)==null?void 0:ie.status,console.log("errorCode value",c.value),n.value=!0;return}s.setError(((X=L.response)==null?void 0:X.data).message)}else s.setError("There was an issue, please contact helpmate")}},T=async()=>{var D,j,z,G,K,ie,X,Y,L,V,P,ue,ae,pe,ve,Ge,ke,Xe,Ye,U,$,W,ee,Se,B,w,y,N,k,b,te,Z,_,J,Ae,re,ce,he,fe,xe,Oe,He,Ct,Nt,et,$t,xi,st;console.log("Start getAssessmentDetails");try{Ii==="prod"?l=`https://api-v2.genpact.com/api/my-profile/assessment-master/getAssessmentDetailsById?id=${o.simulationSkill}`:l=`https://api-v2-dev.genpact.com/api/my-profile/assessment-master/getAssessmentDetailsById?id=${o.simulationSkill}`;const oe=await oi(l);A.value=(j=(D=oe==null?void 0:oe.data)==null?void 0:D.data)==null?void 0:j.name,o.skillNameForSimulation=A.value,o.generatedPrompt=(G=(z=oe==null?void 0:oe.data)==null?void 0:z.data)==null?void 0:G.generatedPrompt,o.assessmentType=(ie=(K=oe==null?void 0:oe.data)==null?void 0:K.data)==null?void 0:ie.assessmentType,a.value=(Y=(X=oe==null?void 0:oe.data)==null?void 0:X.data)==null?void 0:Y.status,S.value=(V=(L=oe==null?void 0:oe.data)==null?void 0:L.data)==null?void 0:V.editMode,o.empSeniority=(ue=(P=oe==null?void 0:oe.data)==null?void 0:P.data)==null?void 0:ue.empSeniority,o.functionRole=(pe=(ae=oe==null?void 0:oe.data)==null?void 0:ae.data)==null?void 0:pe.functionRole,E=(Ge=(ve=oe==null?void 0:oe.data)==null?void 0:ve.data)==null?void 0:Ge.accessBand,C=(Xe=(ke=oe==null?void 0:oe.data)==null?void 0:ke.data)==null?void 0:Xe.accessOhrList;const bt=(U=(Ye=oe==null?void 0:oe.data)==null?void 0:Ye.data)==null?void 0:U.createdBy;if(o.mcqType=(W=($=oe==null?void 0:oe.data)==null?void 0:$.data)==null?void 0:W.mcqTypes,o.storeFinalFeedback=(Se=(ee=oe==null?void 0:oe.data)==null?void 0:ee.data)==null?void 0:Se.storeFinalFeedback,o.storeFinalScore=(w=(B=oe==null?void 0:oe.data)==null?void 0:B.data)==null?void 0:w.storeFinalScore,a.value==="inactive")i.value=!0;else if(a.value==="draft")r.value!==nl.DRAFT&&(i.value=!0);else if(a.value==="active"&&S.value&&r.value===nl.DRAFT){Ii==="prod"?l=`https://api-v2.genpact.com/api/my-profile/assessment-master/getDraftAssessmentDetailsById?assessmentId=${o.simulationSkill}`:l=`https://api-v2-dev.genpact.com/api/my-profile/assessment-master/getDraftAssessmentDetailsById?assessmentId=${o.simulationSkill}`;const ze=await oi(l);o.generatedPrompt=(N=(y=ze==null?void 0:ze.data)==null?void 0:y.data)==null?void 0:N.generatedPrompt,o.assessmentType=(b=(k=ze==null?void 0:ze.data)==null?void 0:k.data)==null?void 0:b.assessmentType,o.empSeniority=(Z=(te=ze==null?void 0:ze.data)==null?void 0:te.data)==null?void 0:Z.empSeniority,o.functionRole=(J=(_=ze==null?void 0:ze.data)==null?void 0:_.data)==null?void 0:J.functionRole,o.storeFinalFeedback=(re=(Ae=ze==null?void 0:ze.data)==null?void 0:Ae.data)==null?void 0:re.storeFinalFeedback,o.storeFinalScore=(he=(ce=ze==null?void 0:ze.data)==null?void 0:ce.data)==null?void 0:he.storeFinalScore,E=(xe=(fe=ze==null?void 0:ze.data)==null?void 0:fe.data)==null?void 0:xe.accessBand,C=(He=(Oe=ze==null?void 0:ze.data)==null?void 0:Oe.data)==null?void 0:He.accessOhrList}const CA=o==null?void 0:o.band_code,Ur=(Ct=E==null?void 0:E.split(","))==null?void 0:Ct.map(ze=>ze.trim());if(bt===(o==null?void 0:o.ohr)||M.includes(o==null?void 0:o.ohr))console.log("User has access to this assessment.");else{if(Ur.length===0&&C.length===0)throw console.log("Both bands and exceptionOHR are empty. Access denied."),{response:{status:424,data:{message:"You don't have access to this assessment. Please contact to administrator"}}};if(Ur.includes(CA)||C.includes(o==null?void 0:o.ohr))console.log("User has access to this assessment.");else throw console.log("User does not have access to this assessment."),{response:{status:424,data:{message:"You don't have access to this assessment. Please contact to administrator"}}}}console.log("end getAssessmentDetails")}catch(oe){if(console.error(oe),t.value=!1,Ne.isAxiosError(oe)&&((Nt=oe.response)!=null&&Nt.status)||oe&&typeof oe=="object"&&"response"in oe&&oe.response&&typeof oe.response=="object"&&"status"in oe.response&&oe.response.status){const bt=oe;if(console.log("Error found!"),console.error((et=bt.response)==null?void 0:et.data),(($t=bt.response)==null?void 0:$t.status)===424||((xi=bt.response)==null?void 0:xi.status)===425){n.value=!0;return}s.setError(((st=bt.response)==null?void 0:st.data).message)}else s.setError("There was an issue, please contact helpmate")}},O=async()=>{var D,j,z,G,K,ie,X,Y;try{Ii==="prod"?g.value="https://api-v2.genpact.com/api/delphi/v2/myprofile":g.value="https://api-v2-dev.genpact.com/api/delphi/v2/myprofile";const L=await Ne({url:g.value,headers:{authorization:`Bearer ${u}`,"content-type":"application/json"},method:"get"});o.genomeFunctionValue=(z=(j=(D=L==null?void 0:L.data)==null?void 0:D.role_function)==null?void 0:j.function)==null?void 0:z.name,o.genomeRoleValue=(ie=(K=(G=L==null?void 0:L.data)==null?void 0:G.role_function)==null?void 0:K.role)==null?void 0:ie.name}catch(L){if(console.error(L),t.value=!1,Ne.isAxiosError(L)){const V=L;console.log("Error found!"),console.error((X=V.response)==null?void 0:X.data),s.setError(((Y=V.response)==null?void 0:Y.data).message)}else s.setError("There was an issue, please contact helpmate")}},F=()=>{var D;(D=d.value)==null||D.sendQuestion()};return(D,j)=>(Q(),R("section",null,[ne(dr,{"is-visible":n.value},{default:li(()=>[h("div",rK,[c.value===424||c.value==="425"?(Q(),R("div",oK,sK)):Me("",!0),c.value===400?(Q(),R("div",AK,aK)):Me("",!0)])]),_:1},8,["is-visible"]),h("div",null,[t.value?(Q(),Qi(DS,{key:0})):(Q(),R("main",cK,[h("div",uK,[ne(Qy)]),lK,h("div",gK,[h("div",EK,[h("div",hK,[ne(fT,{onCallQuestion:F}),h("div",{class:Ee(m(o).showVoiceComponent===!0?"mt-[160px]":"mt-[120px]")},null,2)]),m(o).assessmentQuestion?(Q(),R("div",CK,[ne(GN,{ref_key:"newQuestionRef",ref:d},null,512)])):(Q(),R("div",IK,[ne($N)]))])])]))])]))}}),Pk="",dK=Object.freeze(Object.defineProperty({__proto__:null,default:je(pK,[["__scopeId","data-v-450b2de7"]])},Symbol.toStringTag,{value:"Module"})),SK={class:"flex h-14 w-full flex-1 items-center justify-between bg-[#021c42] md:pr-6 lg:pr-6"},MK=["href"],BK=[h("img",{class:"h-11 w-auto cursor-pointer",src:TC,alt:"Genome Logo"},null,-1)],vK=["href"],fK=[h("img",{class:"h-9 w-28 cursor-pointer md:w-36",src:rl,alt:"Aiguru Logo"},null,-1)],wK=Re({__name:"headerAMA",setup(e){const t=f(""),i=f("");return Ii==="prod"?t.value="https://genome.genpact.com":t.value="https://genome-dev.genpact.com",Ii==="prod"?i.value="https://genome.genpact.com/#aiguru":i.value="https://genome-dev.genpact.com/#aiguru",(n,o)=>(Q(),R("nav",SK,[h("a",{class:"px-2 md:px-0 lg:px-0",href:t.value,target:"_blank"},BK,8,MK),h("a",{class:"px-2 md:px-0 lg:px-0",href:i.value,target:"_blank"},fK,8,vK)]))}}),QK={class:"flex items-end justify-start"},RK={class:"fontFormattingAMA w-full bg-gray-100 rounded-lg"},mK={class:"w-full rounded-md px-3 py-2 text-lg text-black md:text-xl"},DK=["innerHTML"],yK={class:"w-full px-3 py-2 text-black text-xs md:text-base font-[550]"},TK=["innerHTML"],LK=h("br",null,null,-1),OK=Re({__name:"greetingsAMA",setup(e){const t=be(),i=` Hi ${t.learnerName||"Learner"} ! 👋`,n=it(()=>i),o=it(()=>`I'm here and ready to help! What would you like to know about <span class='font-[600]'>${t.amaSkillName||"Skill"}</span>? <br/> Ask me to explain concepts, provide examples, or clarify anything that seems confusing.`);return(s,A)=>(Q(),R("section",null,[h("div",QK,[h("div",RK,[h("div",mK,[h("div",{innerHTML:n.value},null,8,DK)]),h("div",yK,[h("div",{innerHTML:o.value},null,8,TK)])])]),LK]))}}),UK={class:"fontFormattingAMA flex items-end justify-start py-2"},NK={class:"line-break w-full bg-gray-100 p-3 text-xs md:text-sm text-black rounded-lg"},KK=["innerHTML"],FK=Re({__name:"responseAMA",props:{answer:{type:String,required:!0}},setup(e){const t=e,i=it(()=>{const n=t.answer.replace(/[*#]/g,"").replace(/Assessment Rating & Feedback/g,'<div style="font-size: 26px; font-weight: bold; text-decoration: underline;">Rating & Feedback</div>'),o=/\[([^\]]+)\]\((https?:\/\/[^\s]+)\)/g;return n.replace(o,(s,A,r)=>`<a href="${r}" target="_blank" rel="noopener noreferrer" style="color: blue; text-decoration: underline;">${A}</a>`)});return(n,o)=>(Q(),R("div",UK,[h("div",NK,[h("span",{class:"fontFormattingAMA",innerHTML:i.value},null,8,KK)])]))}}),qk="",GK=je(FK,[["__scopeId","data-v-aea5566e"]]),xK={class:"flex justify-end items-end py-3"},jK={class:"max-w-[80%]"},kK={class:"w-fit fontFormattingAMA text-xs md:text-sm text-white bg-genpact-blue-box leading-6 p-3 rounded-lg"},YK=Re({__name:"learnerAMA",props:{question:{type:String,required:!0}},setup(e){return(t,i)=>(Q(),R("div",xK,[h("div",jK,[h("div",kK,de(e.question),1)])]))}}),zK=e=>(At("data-v-12a02acf"),e=e(),at(),e),PK={class:"flex w-full flex-col items-start justify-start bg-white"},bK={class:"bot-typing-animation gap-1"},JK={class:"block w-full text-lg italic text-gray-800"},HK=zK(()=>h("span",{class:"dot-animation"},[h("span",null,"."),h("span",null,"."),h("span",null,".")],-1)),qK=rr('<div class="block w-full max-w-full items-stretch" data-v-12a02acf><div class="flex animate-pulse items-start justify-start space-x-4" data-v-12a02acf><div class="flex-1 space-y-6 py-1" data-v-12a02acf><div class="h-2 w-full rounded bg-gray-300" data-v-12a02acf></div><div class="space-y-3" data-v-12a02acf><div class="grid grid-cols-3 gap-4" data-v-12a02acf><div class="col-span-2 h-2 rounded bg-gray-300" data-v-12a02acf></div><div class="col-span-1 h-2 rounded bg-gray-300" data-v-12a02acf></div></div><div class="h-2 rounded bg-gray-300" data-v-12a02acf></div></div></div></div></div>',1),VK=Re({__name:"LoadingResponseAMA",setup(e){const t=f("Generating response"),i=f(["This may take a few seconds","Fetching the best response for you","Thinking... give me a moment","One moment while I gather the information","Hang in tight, we are almost there","Almost there... just a bit longer","Compiling a response for you"]);return setTimeout(()=>{const n=Math.floor(Math.random()*i.value.length);t.value=i.value[n]},15e3),(n,o)=>(Q(),R("div",PK,[h("div",bK,[h("div",JK,de(t.value),1),HK]),qK]))}}),Vk="",WK=je(VK,[["__scopeId","data-v-12a02acf"]]),ZK={key:0},XK={key:1},_K={key:0,class:"flex"},$K=Re({__name:"conversationAMA",setup(e){let t=f(""),i=f("");t.value='<a style="color:#00AECF;"',i.value='<ul style="list-style: disc !important; margin-left: 3.5rem !important; padding: 0;"';const n=be(),o=f();return Gt(()=>{var r;const s=document.getElementsByName("askQuestion"),A=Array.from(s);s.length&&((r=A==null?void 0:A.pop())==null||r.scrollIntoView({behavior:"smooth",block:"center"}))}),bA(()=>{var r;const s=document.getElementsByName("askQuestion"),A=Array.from(s);s.length&&((r=A==null?void 0:A.pop())==null||r.scrollIntoView({behavior:"smooth",block:"center"}))}),(s,A)=>(Q(),R("div",{ref_key:"nestedElement",ref:o,class:"smooth-scroll overflow-auto md:px-6 px-2"},[ne(OK),(Q(!0),R(Le,null,Qt(m(n).conversations,(r,a)=>(Q(),R("div",{key:a},[r.question?(Q(),R("div",ZK,[ne(YK,{question:r.question,c2question:r.c2question,"show-feedback":r.showFeedback,id:`qId${a}`,name:"askQuestion","que-id":a},null,8,["question","c2question","show-feedback","id","que-id"])])):Me("",!0),r.answer?(Q(),R("div",XK,[ne(GK,{question:r==null?void 0:r.question,c2question:r==null?void 0:r.c2question,"show-sources":r==null?void 0:r.showSources,questionId:r.id,answer:r.answer.replaceAll("<a",m(t)).replaceAll("<ul",m(i)),"show-feedback":r.showFeedback,"related-ques":r.relatedQues,"options-array":r.optionsArray,"ans-id":a},null,8,["question","c2question","show-sources","questionId","answer","show-feedback","related-ques","options-array","ans-id"])])):Me("",!0)]))),128)),m(n).dotLoader?(Q(),R("div",_K,[ne(WK)])):Me("",!0)],512))}}),Wk="",eF=je($K,[["__scopeId","data-v-e6168dd4"]]),jc=e=>(At("data-v-43c648f4"),e=e(),at(),e),tF={class:"z-3 absolute bottom-0 mt-4 w-full bg-white px-2 md:px-6"},iF={class:"py-2"},nF={class:"flex"},rF={class:"z-1 relative w-full"},oF={class:"relative w-full"},sF={class:"absolute inset-y-0 right-0 flex items-center md:pr-8 pr-3"},AF={key:0},aF=[jc(()=>h("path",{d:"M15.854.146a.5.5 0 0 1 .11.54l-5.819 14.547a.75.75 0 0 1-1.329.124l-3.178-4.995L.643 7.184a.75.75 0 0 1 .124-1.33L15.314.037a.5.5 0 0 1 .54.11ZM6.636 10.07l2.761 4.338L14.13 2.576 6.636 10.07Zm6.787-8.201L1.591 6.602l4.339 2.76 7.494-7.493Z"},null,-1))],cF={key:1,class:"tooltip"},uF=[jc(()=>h("span",{class:"tooltiptext fontFormattingAMA"},"Waiting for response",-1)),jc(()=>h("img",{class:"w-7 h-7",src:Al,alt:"watingIcon"},null,-1))],lF={class:"flex justify-start"},gF=["placeholder"],EF={class:"flex justify-start items-start text-[#161916]"},hF=jc(()=>h("div",{class:"pt-1 text-start font-sans"},[h("div",{class:"text-xs font-bold text-gray-500 md:text-sm"}," Note: AI-generated response may not be fully accurate; check with experts for critical information. ")],-1)),CF=Re({__name:"NewQuestionAMA",setup(e){const t=be(),i=lt();t.question="";const n=f(null),o=f(!1),s=f(Wt),A=f(!1);Gt(()=>{n.value.focus()});const a=f((l=>new URLSearchParams(window.location.search).get(l)||"")("amaId"));console.log("amaId",a.value);const c=l=>{const g=l.length;s.value=Wt-g,o.value=g>=Wt},u=async()=>{var l,g,E,C;try{if(t.question.trim().length<1){i.setError("Please enter answer!");return}if(t.amaQuestionsLeft<=0){i.setError("You have exhausted your question limit!");return}A.value=!0,t.dotLoader=!0;const d={question:t==null?void 0:t.question};t.conversations.push(d);const S=f("");S.value=t==null?void 0:t.question,t.question="";const I={skillId:a.value,question:S.value,past_messages:t.past_messages},p=await Yt("/amaBotResponse",I);t.addConversation((l=p.data)==null?void 0:l.body,"new"),A.value=!1,t.dotLoader=!1}catch(d){if(console.error(d),t.dotLoader=!1,A.value=!1,Ne.isAxiosError(d)){const S=d;console.log("Error found!"),console.error((g=S.response)==null?void 0:g.data),i.setError((C=(E=S.response)==null?void 0:E.data)==null?void 0:C.message)}else i.setError("There was an issue, please contact helpmate")}};return(l,g)=>(Q(),R("div",tF,[h("div",iF,[h("div",nF,[h("div",rF,[h("div",oF,[h("div",sF,[A.value?(Q(),R("div",cF,uF)):(Q(),R("div",AF,[(Q(),R("svg",{onClick:g[0]||(g[0]=E=>u()),xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",class:"bi bi-send ml-2 h-7 w-7 rotate-45 rounded",viewBox:"0 0 16 16"},aF))]))]),h("div",lF,[Te(h("input",{onKeyup:[g[1]||(g[1]=Tu(E=>A.value?"":u(),["enter"])),g[3]||(g[3]=E=>c(m(t).question))],"onUpdate:modelValue":g[2]||(g[2]=E=>m(t).question=E),class:"fontFormattingAMA text-xs md:text-sm rounded-lg flex w-full border border-genpact-darkest-teal py-4 pl-7 pr-16",placeholder:`Ask me about ${m(t).amaSkillName||"Skill Name"}`,type:"text",ref_key:"AiSearch",ref:n},null,40,gF),[[qe,m(t).question]])])]),h("div",EF,de(m(t).amaQuestionsLeft)+" questions remaining for the day ",1),hF])])])]))}}),$k="",IF=je(CF,[["__scopeId","data-v-43c648f4"]]),Ag=e=>(At("data-v-944ca5e3"),e=e(),at(),e),pF=Ag(()=>h("div",{class:"max-h-screen overflow-auto md:p-6 p-3 flex flex-col items-center justify-center gap-4 text-[#161916]"},[h("div",{class:"text-2xl font-[700]"},"Assessment Access Required"),h("h3",{className:"text-lg font-medium my-6 text-center text-gray-500"}," You don't have access to this assessment. Please contact to administrator ")],-1)),dF={key:1,className:"h-screen flex flex-col items-stretch"},SF={class:"z-20"},MF=Ag(()=>h("div",{class:"mt-6"},null,-1)),BF={class:"flex h-full items-stretch overflow-hidden"},vF={class:"mx-auto w-11/12 bg-white"},fF={class:"relative flex h-full w-full flex-col items-stretch overflow-hidden"},wF=Ag(()=>h("div",{class:"mt-[160px]"},null,-1)),QF={class:"relative"},RF=Re({__name:"AssessmentAMA",setup(e){const t=f(!0),i=f(!1),n=be(),o=lt();f("");const A=f((a=>new URLSearchParams(window.location.search).get(a)||"")("amaId"));n.amaSkillId=A.value??"",Gt(async()=>{t.value=!0,await r(),t.value=!1});const r=async()=>{var a,c,u,l,g,E,C;try{if(A.value===null)throw{response:{status:424,data:{message:"Invalid URL"}}};console.log("before calling get learner");const d=await oi(`/getLearnerData?amaSkillId=${A.value}`);n.initialize(d.data),n.amaQuestionsLeft=(a=d==null?void 0:d.data)==null?void 0:a.questionsLeftAIGC,n.amaSkillName=(c=d==null?void 0:d.data)==null?void 0:c.skillName,t.value=!1}catch(d){if(console.error(d),t.value=!1,Ne.isAxiosError(d)&&((u=d.response)!=null&&u.status)||d&&typeof d=="object"&&"response"in d&&d.response&&typeof d.response=="object"&&"status"in d.response&&d.response.status){const S=d;if(console.log("Error found!"),console.error((l=S.response)==null?void 0:l.data),((g=S.response)==null?void 0:g.status)===424||((E=S.response)==null?void 0:E.status)===425){i.value=!0;return}o.setError(((C=S.response)==null?void 0:C.data).message)}else o.setError("There was an issue, please contact helpmate")}};return(a,c)=>(Q(),R("section",null,[ne(dr,{"is-visible":i.value},{default:li(()=>[pF]),_:1},8,["is-visible"]),h("div",null,[t.value?(Q(),Qi(DS,{key:0})):(Q(),R("main",dF,[h("div",SF,[ne(wK)]),MF,h("div",BF,[h("div",vF,[h("div",fF,[ne(eF),wF]),h("div",QF,[ne(IF)])])])]))])]))}}),e1="",mF=Object.freeze(Object.defineProperty({__proto__:null,default:je(RF,[["__scopeId","data-v-944ca5e3"]])},Symbol.toStringTag,{value:"Module"})),hA=e=>(At("data-v-e4e697db"),e=e(),at(),e),DF={class:"playground h-full"},yF={class:"grid grid-cols-5 gap-8 px-5 items-stretch"},TF={class:"col-span-4 mt-10"},LF=hA(()=>h("label",{for:"EmpID",class:"block text-base font-bold text-gray-900"},"EmpID",-1)),OF=hA(()=>h("label",{for:"EmpName",class:"block text-base font-bold text-gray-900"},"EmpName",-1)),UF=hA(()=>h("label",{for:"EmpDesignation",class:"block text-base font-bold text-gray-900 mt-6"},"EmpDesignation",-1)),NF={class:"flex flex-col items-end gap-2"},KF={key:0,id:"button",class:"cursor-pointer"},FF={key:1},GF=[hA(()=>h("img",{class:"w-10 h-10 block mx-auto loadercss",src:Di,alt:"Loader Gif"},null,-1))],xF={class:"mb-12"},jF=hA(()=>h("label",{for:"response",class:"block text-base font-bold text-gray-900 mb-1"},"Response",-1)),kF={class:"line-break min-h-[20vh] p-4 text-sm text-gray-900 bg-gray-50 rounded-lg border border-gray-300 w-full shadow-sm focus:outline-none focus:border-genpact-blue-box focus:ring-genpact-blue-box focus:ring-1"},YF=Re({__name:"Testcase",setup(e){const t=f(!1),i=f(""),n=f(""),o=f(""),s=f(""),A=lt();Gt(()=>{r()});const r=async()=>{var a,c;try{t.value=!0;const u=await oi("http://localhost:7071/api/fetchCompletionSubDemo1");console.log(u.data),s.value=(a=u.data)==null?void 0:a.body,t.value=!1}catch(u){if(console.log(u),t.value=!1,Ne.isAxiosError(u)){const l=u;A.setError(((c=l.response)==null?void 0:c.data).message)}else A.setError("There was an issue, contact to helpmate")}};return(a,c)=>(Q(),R("div",DF,[h("div",yF,[h("div",TF,[h("div",null,[LF,Te(h("textarea",{"onUpdate:modelValue":c[0]||(c[0]=u=>i.value=u),id:"EmpID",rows:"1",class:"w-full mt-1 p-2.5 text-sm text-gray-900 bg-gray-50 rounded-lg border border-gray-300 shadow-sm focus:outline-none focus:border-genpact-blue-box focus:ring-genpact-blue-box focus:ring-1 resize-none",placeholder:"Write here..."},null,512),[[qe,i.value]])]),h("div",null,[OF,Te(h("textarea",{"onUpdate:modelValue":c[1]||(c[1]=u=>n.value=u),id:"EmpName",rows:"1",class:"w-full mt-1 p-2.5 text-sm text-gray-900 bg-gray-50 rounded-lg border border-gray-300 shadow-sm focus:outline-none focus:border-genpact-blue-box focus:ring-genpact-blue-box focus:ring-1 resize-none",placeholder:"Write here..."},null,512),[[qe,n.value]])]),h("div",null,[UF,h("div",NF,[Te(h("textarea",{"onUpdate:modelValue":c[2]||(c[2]=u=>o.value=u),id:"EmpDesignation",rows:"1",class:"w-full p-2.5 text-sm text-gray-900 bg-gray-50 rounded-lg border border-gray-300 shadow-sm focus:outline-none focus:border-genpact-blue-box focus:ring-genpact-blue-box focus:ring-1 resize-none",placeholder:"Write here..."},null,512),[[qe,o.value]]),t.value?(Q(),R("div",FF,GF)):(Q(),R("button",KF,[ne(m(BC),{class:"w-7 h-7 fill-genpact-blue-box"})]))])]),h("div",xF,[jF,h("div",kF,de(s.value),1)])])])]))}}),n1="",zF=Object.freeze(Object.defineProperty({__proto__:null,default:je(YF,[["__scopeId","data-v-e4e697db"]])},Symbol.toStringTag,{value:"Module"})),PF={},bF={className:"flex justify-between items-center gap-4 h-14"},JF=[h("div",{class:"text-white font-bold md:text-xl text-base"}," AI Guru Skill Data ",-1),h("img",{class:"md:w-36 w-20",src:lo},null,-1)];function HF(e,t){return Q(),R("div",bF,JF)}const qF=je(PF,[["render",HF]]),VF={class:"bg-genpact-blue-box w-full px-5 mb-4"},WF={key:0},ZF={class:"flex justify-between items-start text-lg px-6"},XF=h("div",null,null,-1),_F={class:"flex justify-start items-center text-white bg-genpact-darkest-blue rounded-lg py-2 px-4 cursor-pointer"},$F={class:"flex justify-start items-start w-full px-6 py-3"},eG=h("div",{class:"md:w-1/2"},null,-1),tG={class:"relative flex justify-start items-end border border-gray-300 md:rounded-full rounded-lg md:w-1/2 w-full"},iG={class:"absolute inset-y-0 left-5 flex items-center"},nG={class:"flex justify-between flex-col md:flex-row items-center w-full border-none py-1 px-1 md:px-2 md:py-2 text-sm md:border md:border-gray-300 rounded-full"},rG={class:"flex justify-start flex-wrap md:gap-2 items-start ml-10 space-y-2 md:space-y-0 md:space-x-1 mx-auto"},oG={class:"flex justify-start items-center"},sG=h("div",{class:"flex items-center"},[h("div",{class:"text-gray-500 font-medium text-sm px-1 py-2 md:px-2 md:py-2 hidden md:flex"}," | ")],-1),AG={class:"flex-grow md:flex-grow-0"},aG={class:"px-6"},cG=h("div",{class:"flex justify-start items-start text-xl font-bold py-1 italic"}," Current Topic List ",-1),uG={class:"w-full relative overflow-x-auto rounded-lg border border-gray-200 max-h-[630px]"},lG={class:"table-auto w-full text-sm text-left rtl:text-right rounded-lg"},gG=h("thead",{class:"text-sm text-center md:text-base text-gray-700 uppercase bg-gray-200 top-0 sticky z-10"},[h("tr",null,[h("th",{scope:"col",class:"px-6 py-3"},"Topic name"),h("th",{scope:"col",class:"px-6 py-3"},"Description"),h("th",{scope:"col",class:"px-6 py-3"},"Knowledge corpus"),h("th",{scope:"col",class:"px-6 py-3"},"Edit")])],-1),EG={class:"px-3 py-4 font-medium text-gray-900"},hG={class:"px-3 py-4"},CG={class:"px-3 py-4 text-center"},IG={class:"px-1.5 py-4 text-center"},pG=["onClick"],dG={key:1,id:"index",class:"flex justify-center items-center bg-genpact-darkest-blue text-white font-bold text-center rounded-lg px-6 py-2 hover:-translate-y-1 hover:scale-100 duration-300"},SG=[h("img",{class:"w-6 h-6 block loadercss",src:Di,alt:"Loader Gif"},null,-1)],yS=Object.freeze(Object.defineProperty({__proto__:null,default:Re({__name:"SkillData",setup(e){const t=f([]),i=f(),n=f(""),o=f(""),s=f(!1),A=f([!0]),r=be(),a=lt(),c=na(),u=f(""),l=()=>{try{u.value==="user"?(sessionStorage.setItem("dataViewAccess","true"),sessionStorage.setItem("role","user"),c.replace({name:"EditSkillData"})):u.value==="admin"&&(sessionStorage.setItem("dataViewAccess","true"),sessionStorage.setItem("role","admin"),c.replace({name:"EditSkillAdminData"})),r.isTopicPending=!1,r.topicNameForSkillData="",r.descriptionForSkillData="",r.offeringTypeForSkillData="",r.enableInputbox=!0}catch{a.setError("Invalid Router!!")}},g=async(I,p)=>{var M,v,T;try{console.log("isTopicPending------->",r.isTopicPending),r.topicNameForSkillData=I.Topic,r.descriptionForSkillData=I.Description,r.offeringTypeForSkillData=I.OfferingType,r.enableInputbox=!1,A.value[p]=!1;const O=await oi(`/fetchTempTopic?Topic=${r.topicNameForSkillData}`);r.isTopicPending=!1,console.log("response array length------->",(M=O==null?void 0:O.data)==null?void 0:M.length),((v=O==null?void 0:O.data)==null?void 0:v.length)>0&&(r.isTopicPending=!0),A.value[p]=!0,u.value==="user"?(sessionStorage.setItem("dataViewAccess","true"),sessionStorage.setItem("role","user"),c.replace({name:"EditSkillData"})):u.value==="admin"&&(sessionStorage.setItem("dataViewAccess","true"),sessionStorage.setItem("role","admin"),c.replace({name:"EditSkillAdminData"}))}catch(O){if(console.error(O),Ne.isAxiosError(O)){const F=O;a.setError(((T=F.response)==null?void 0:T.data).message)}else a.setError("There was an issue with route")}},E=async()=>{var I,p,M,v,T,O;try{const F=await oi("/FetchSkillData");console.log("role value ",(I=F==null?void 0:F.data)==null?void 0:I.role),i.value=((p=F==null?void 0:F.data)==null?void 0:p.body)||[],u.value=(M=F==null?void 0:F.data)==null?void 0:M.role,t.value=i.value,console.log("length",(v=F==null?void 0:F.data)==null?void 0:v.body),console.log("data",(T=F==null?void 0:F.data)==null?void 0:T.body)}catch(F){if(console.error(F),Ne.isAxiosError(F)){const D=F;a.setError(((O=D.response)==null?void 0:O.data).message)}else a.setError("There was an issue while fetching data")}},C=I=>{console.log(I.target.value),I.target.value===""&&(t.value=i.value),console.log("Invoked topic name Search"),t.value=i.value.filter(p=>p.Topic.toLowerCase().includes(I.target.value.toLowerCase()))},d=I=>{console.log(I.target.value),I.target.value===""&&(t.value=i.value),console.log("Invoked Knowledge Corpus Search"),t.value=i.value.filter(p=>p.OfferingType.toLowerCase().includes(I.target.value.toLowerCase()))},S=()=>{n.value="",o.value="",t.value=i.value};return Gt(async()=>{await E(),s.value=!0,A.value=Array(t.value.length).fill(!0),console.log("array",A.value)}),(I,p)=>(Q(),R(Le,null,[h("nav",VF,[ne(qF)]),s.value?(Q(),R("div",WF,[h("div",ZF,[XF,h("div",_F,[ne(m(FQ),{class:"w-7 h-7 mr-1"}),h("button",{onClick:l,class:"font-bold"},"Add New Topic")])]),h("div",$F,[eG,h("div",tG,[h("div",iG,[ne(m(KQ),{class:"w-5 h-5 mr-5 hidden md:flex"})]),h("div",nG,[h("div",rG,[h("div",oG,[Te(h("input",{id:"topic-search",type:"search",onInput:C,"onUpdate:modelValue":p[0]||(p[0]=M=>n.value=M),class:"text-gray-500 font-medium text-sm px-2 py-2 w-full md:w-52 rounded-lg shadow-sm border-none border-gray-500 focus:outline-none focus:border focus:border-genpact-blue-box md:ml-2",placeholder:"enter topic name "},null,544),[[qe,n.value]])]),sG,h("div",AG,[Te(h("input",{id:"offering-search",type:"search",onInput:d,"onUpdate:modelValue":p[1]||(p[1]=M=>o.value=M),class:"text-gray-500 font-medium text-sm px-2 py-2 md:w-52 w-full rounded-lg shadow-sm border-none border-gray-500 focus:outline-none focus:border focus:border-genpact-blue-box",placeholder:"enter knowledge corpus"},null,544),[[qe,o.value]])])]),h("div",{class:"mt-2 md:mt-0"},[h("button",{onClick:S,type:"reset",class:"text-white bg-genpact-blue-box hover:bg-genpact-darkest-blue font-medium rounded-full text-base px-8 py-1"}," Reset ")])])])]),h("div",aG,[cG,h("div",uG,[h("table",lG,[gG,h("tbody",null,[(Q(!0),R(Le,null,Qt(t.value,(M,v)=>(Q(),R("tr",{key:v,class:"odd:bg-white even:bg-gray-100"},[h("th",EG,de(M.Topic||"title"),1),h("td",hG,de(M.Description||"desc"),1),h("td",CG,de(M.OfferingType||"Knowledge Corpus"),1),h("td",IG,[A.value[v]?(Q(),R("button",{key:0,id:"index",onClick:T=>g(M,v),class:"hover:bg-genpact-darkest-blue bg-genpact-blue-box text-white font-bold py-2 px-6 rounded-lg hover:-translate-y-1 hover:scale-100 duration-300"}," edit ",8,pG)):(Q(),R("div",dG,SG))])]))),128))])])])])])):(Q(),Qi(ol,{key:1}))],64))}})},Symbol.toStringTag,{value:"Module"})),MG={className:"flex justify-between items-center gap-4 h-14"},BG=h("div",{class:"font-bold text-base md:text-xl"},"Back",-1),vG=h("div",{class:"text-white font-bold md:text-xl text-base"},"AI Guru Edit Skill Data",-1),fG=h("img",{class:"md:w-36 w-20",src:lo},null,-1),wG=Re({__name:"HeaderForEditSkillData",setup(e){const t=na(),i=()=>{Jr(()=>{sessionStorage.removeItem("dataViewAccess")}),t.push({name:"SkillData"}),sessionStorage.removeItem("dataViewAccess"),sessionStorage.removeItem("role")};return(n,o)=>(Q(),R("div",MG,[h("div",{onClick:i,class:"flex justify-start items-center text-white cursor-pointer"},[ne(m(MC),{class:"md:w-9 w-5 h-5 md:h-9 mr-1"}),BG]),vG,fG]))}}),Gi=e=>(At("data-v-18de1cf9"),e=e(),at(),e),QG={class:"bg-genpact-blue-box w-full px-5 mb-6"},RG={class:"grid grid-cols-5 gap-8 p-10 items-stretch"},mG=Gi(()=>h("div",{class:"col-span-1 text-right"},[h("label",{for:"topic",class:"block text-lg font-bold text-gray-900 mb-1 italic"},[We("Topic Name "),h("span",{class:"label"},"*")])],-1)),DG={class:"col-span-4"},yG=["disabled"],TG=Gi(()=>h("div",{class:"col-span-1 text-right"},[h("label",{for:"description",class:"block text-lg font-bold text-gray-900 mb-1 italic"},[We("Description "),h("span",{class:"label"},"*")])],-1)),LG={class:"col-span-4"},OG=Gi(()=>h("div",{class:"col-span-1 text-right"},[h("label",{for:"Knowledge Corpus",class:"block text-lg font-bold text-gray-900 mb-1 italic"},[We("Knowledge Corpus "),h("span",{class:"label"},"*")])],-1)),UG={class:"col-span-4"},NG=Gi(()=>h("div",{class:"col-span-1"},null,-1)),KG={class:"col-span-4"},FG={class:"md:flex block justify-between items-center space-y-2"},GG=["disabled"],xG={key:1,class:"flex justify-center items-center text-center bg-genpact-darkest-blue text-white rounded-md w-40 px-4 py-2"},jG=[Gi(()=>h("img",{class:"w-6 h-6 block loadercss",src:Di,alt:"Loader Gif"},null,-1))],kG=["disabled"],YG={key:3,class:"flex justify-center items-center text-center bg-genpact-darkest-blue text-white rounded-md w-40 px-10 py-2"},zG=[Gi(()=>h("img",{class:"w-6 h-6 block loadercss",src:Di,alt:"Loader Gif"},null,-1))],PG=Gi(()=>h("div",{class:"col-span-1"},null,-1)),bG={key:0,class:"col-span-4"},JG=[Gi(()=>h("div",{class:"p-2 items-center text-lg font-bold bg-gray-200"}," This topic is under review and cannot be submitted again at this moment ",-1))],HG={key:0,class:"pl-16 pr-8 py-2"},qG={class:"w-full relative overflow-x-auto rounded-lg border border-gray-200 max-h-[550px]"},VG={class:"table-auto w-full text-sm text-left rtl:text-right rounded-lg"},WG=Gi(()=>h("thead",{class:"text-sm text-center md:text-base text-gray-700 uppercase bg-gray-200 top-0 sticky z-10"},[h("tr",null,[h("th",{scope:"col",class:"px-6 py-3"},"Topic name"),h("th",{scope:"col",class:"px-6 py-3"},"Description"),h("th",{scope:"col",class:"px-6 py-3"},"Knowledge Corpus"),h("th",{scope:"col",class:"px-6 py-3"},"Score")])],-1)),ZG={key:0,class:"px-3 py-4 font-medium text-gray-900 text-center"},XG={key:1,class:"px-3 py-4"},_G={key:2,class:"px-3 py-4 text-center"},$G={key:3,class:"px-3 py-4 text-center"},ex={class:"absolute top-0 md:left-20 md:right-20 left-12 right-12 flex justify-center items-center mx-auto z-[100]"},tx={class:"w-full rounded-md px-3 text-center mt-4 bg-green-500 py-2 text-white"},ix=Re({__name:"EditSkillData",setup(e){const t=be(),i=lt(),n=f(!0),o=f(!0),s=f(!1),A=f(""),r=f(""),a=f(!1),c=f(!1),u=f(),l=f(),g=f([]),E=async()=>{var S,I,p,M,v,T,O;try{const F={question:t.descriptionForSkillData};console.log("question",r.value),n.value=!1;const D=await Yt("/SearchSkillTags",F);console.log("abc",(S=D==null?void 0:D.data)==null?void 0:S.body),l.value=(p=(I=D==null?void 0:D.data)==null?void 0:I.body)==null?void 0:p.length,console.log("ARRAY LENGTH",l.value),u.value=((M=D==null?void 0:D.data)==null?void 0:M.body)||[],g.value=u.value,console.log("length",(T=(v=D==null?void 0:D.data)==null?void 0:v.body)==null?void 0:T.length),console.log("data",D),n.value=!0,a.value=!0,c.value=!0,console.log("showSubmitButton",c.value)}catch(F){if(console.error(F),n.value=!0,Ne.isAxiosError(F)){const D=F;i.setError(((O=D.response)==null?void 0:O.data).message)}else i.setError("We ran into an issue while fetching duplicate values.")}},C=async()=>{var S;try{const I={Topic:t.topicNameForSkillData,Description:t.descriptionForSkillData,OfferingType:t.offeringTypeForSkillData,DuplicateExists:l.value>0?1:0};o.value=!1,console.log("payload-=====>",I);const p=await Yt("/InsertIntoTempSkillFile",I);console.log("data",p),A.value="Data Submitted Successfully!",o.value=!0,d()}catch(I){if(console.error(I),o.value=!0,Ne.isAxiosError(I)){const p=I;i.setError(((S=p.response)==null?void 0:S.data).message)}else i.setError("There was an issue while inserting data")}},d=()=>{s.value=!0,setTimeout(()=>{s.value=!1,Jr(()=>{sessionStorage.removeItem("dataViewAccess")}),Cr.push({name:"SkillData"}),sessionStorage.removeItem("dataViewAccess"),sessionStorage.removeItem("role")},3e3),c.value=!1};return(S,I)=>(Q(),R(Le,null,[h("nav",QG,[ne(wG)]),h("div",RG,[mG,h("div",DG,[Te(h("input",{disabled:m(t).enableInputbox!==!0,class:Ee([m(t).enableInputbox!==!0?"cursor-not-allowed fill-gray-400":"","w-full p-2.5 text-sm text-gray-900 bg-gray-50 rounded-lg border border-gray-300 shadow-sm focus:outline-none focus:border-genpact-blue-box focus:ring-genpact-blue-box focus:ring-1"]),type:"text","onUpdate:modelValue":I[0]||(I[0]=p=>m(t).topicNameForSkillData=p),id:"topic",placeholder:"Write here...",required:""},null,10,yG),[[qe,m(t).topicNameForSkillData]])]),TG,h("div",LG,[Te(h("textarea",{"onUpdate:modelValue":I[1]||(I[1]=p=>m(t).descriptionForSkillData=p),onInput:I[2]||(I[2]=p=>c.value=!1),type:"text",id:"description",rows:"5",class:"w-full p-2.5 text-sm text-gray-900 bg-gray-50 rounded-lg border border-gray-300 shadow-sm focus:outline-none focus:border-genpact-blue-box focus:ring-genpact-blue-box focus:ring-1",placeholder:"Write here...",required:""},null,544),[[qe,m(t).descriptionForSkillData]])]),OG,h("div",UG,[Te(h("input",{"onUpdate:modelValue":I[3]||(I[3]=p=>m(t).offeringTypeForSkillData=p),type:"text",id:"offeringType",class:"w-full p-2.5 text-sm text-gray-900 bg-gray-50 rounded-lg border border-gray-300 shadow-sm focus:outline-none focus:border-genpact-blue-box focus:ring-genpact-blue-box focus:ring-1",placeholder:"Write here...",required:""},null,512),[[qe,m(t).offeringTypeForSkillData]])]),NG,h("div",KG,[h("div",FG,[n.value?(Q(),R("button",{key:0,disabled:m(t).isTopicPending===!0,class:Ee([m(t).isTopicPending===!0?"cursor-not-allowed bg-gray-600":"cursor-pointer bg-genpact-darkest-blue","text-center whitespace-nowrap text-white w-40 px-4 py-2 rounded-md font-bold"]),onClick:E,type:"button"}," Duplicate Check ",10,GG)):(Q(),R("div",xG,jG)),o.value?(Q(),R("button",{key:2,disabled:c.value!==!0,class:Ee([c.value!==!0?"cursor-not-allowed bg-gray-600":"cursor-pointer bg-genpact-darkest-blue","text-center text-white w-40 px-10 py-2 rounded-md font-bold"]),onClick:C,type:"submit"}," Submit ",10,kG)):(Q(),R("div",YG,zG))])]),PG,m(t).isTopicPending?(Q(),R("div",bG,JG)):Me("",!0)]),a.value?(Q(),R("div",HG,[h("div",qG,[h("table",VG,[WG,h("tbody",null,[(Q(!0),R(Le,null,Qt(g.value,(p,M)=>(Q(),R("tr",{key:M,class:"odd:bg-white even:bg-gray-100"},[p.Topic!==m(t).topicNameForSkillData?(Q(),R("th",ZG,de(p.Topic||"title"),1)):Me("",!0),p.Topic!==m(t).topicNameForSkillData?(Q(),R("td",XG,de(p.Description||"desc"),1)):Me("",!0),p.Topic!==m(t).topicNameForSkillData?(Q(),R("td",_G,de(p.OfferingType||"Knowledge Corpus"),1)):Me("",!0),p.Topic!==m(t).topicNameForSkillData?(Q(),R("td",$G,de(p.new_tag),1)):Me("",!0)]))),128))])])])])):Me("",!0),Te(h("div",ex,[h("div",tx,de(A.value),1)],512),[[ar,s.value]])],64))}}),g1="",nx=Object.freeze(Object.defineProperty({__proto__:null,default:je(ix,[["__scopeId","data-v-18de1cf9"]])},Symbol.toStringTag,{value:"Module"})),rx={},ox={className:"flex justify-between items-center gap-4 h-14"},sx=[h("div",{class:"text-white font-bold md:text-xl text-base"}," AI Guru Skill Automation ",-1),h("img",{class:"md:w-36 w-20",src:lo},null,-1)];function Ax(e,t){return Q(),R("div",ox,sx)}const ax=je(rx,[["render",Ax]]),cx={class:"bg-genpact-blue-box w-full px-5 mb-4"},ux={key:0},lx={class:"w-full px-6 py-1"},gx=h("div",{class:"flex justify-start items-start text-xl font-bold py-1 italic"}," Topic Update Request ",-1),Ex={class:"w-full relative overflow-x-auto rounded-lg border border-gray-200 max-h-[630px]"},hx={class:"table-auto w-full text-sm text-left rtl:text-right rounded-lg"},Cx=h("thead",{class:"text-sm text-center md:text-base font-bold text-gray-700 uppercase bg-gray-200 top-0 sticky z-10"},[h("tr",null,[h("th",{scope:"col",class:"px-6 py-3"},"Topic name"),h("th",{scope:"col",class:"px-6 py-3"},"Description"),h("th",{scope:"col",class:"px-6 py-3"},"Knowledge Corpus"),h("th",{scope:"col",class:"px-6 py-3"},"Duplicate Exist"),h("th",{scope:"col",class:"px-6 py-3"},"View")])],-1),Ix={class:"px-3 py-4 font-medium text-gray-900 text-center"},px={class:"px-3 py-4"},dx={class:"px-3 py-4 text-center"},Sx={class:"px-2 py-4 text-center"},Mx={class:"px-2 py-4 text-gray-500 hover:text-genpact-darkest-blue"},Bx=Object.freeze(Object.defineProperty({__proto__:null,default:Re({__name:"SkillAutomation",setup(e){const t=f([]),i=f(),n=f(!1),o=be(),s=lt(),A=na(),r=c=>{sessionStorage.setItem("dataViewAccess","true"),sessionStorage.setItem("role","skillAutomation"),A.replace({name:"EditSkillAdminData"}),o.topicNameForSkillData=c.Topic,o.descriptionForSkillData=c.Description,o.offeringTypeForSkillData=c.OfferingType,o.enableInputbox=!1},a=async()=>{var c,u;try{const l=await oi("/sqlTest");i.value=((c=l==null?void 0:l.data)==null?void 0:c.body)||[],t.value=i.value,console.log("length",l.data.length),console.log("data",l.data)}catch(l){if(console.error(l),Ne.isAxiosError(l)){const g=l;s.setError(((u=g.response)==null?void 0:u.data).message)}else s.setError("There was an issue while fetching data")}};return Gt(async()=>{await a(),n.value=!0}),(c,u)=>(Q(),R(Le,null,[h("nav",cx,[ne(ax)]),n.value?(Q(),R("div",ux,[h("div",lx,[gx,h("div",Ex,[h("table",hx,[Cx,h("tbody",null,[(Q(!0),R(Le,null,Qt(t.value,(l,g)=>(Q(),R("tr",{key:g,class:"odd:bg-white even:bg-gray-100"},[h("th",Ix,de(l.Topic||"title"),1),h("td",px,de(l.Description||"desc"),1),h("td",dx,de(l.OfferingType||"Knowledge Corpus"),1),h("td",Sx,de(l.DuplicateExists),1),h("td",Mx,[ne(m(UQ),{onClick:E=>r(l),class:"w-8 h-8 text-center cursor-pointer hover:-translate-y-1 hover:scale-110 duration-300"},null,8,["onClick"])])]))),128))])])])])])):(Q(),Qi(ol,{key:1}))],64))}})},Symbol.toStringTag,{value:"Module"})),vx={className:"flex justify-between items-center gap-4 h-14"},fx=h("div",{class:"font-bold text-base md:text-xl"},"Back",-1),wx=h("div",{class:"text-white font-bold md:text-xl text-base"},"AI Guru Edit Skill Admin Data",-1),Qx=h("img",{class:"md:w-36 w-20",src:lo},null,-1),Rx=Re({__name:"HeaderForEditSKillAdminDatas",setup(e){const t=na(),i=()=>{const n=sessionStorage.getItem("role");console.log("role",n),n==="user"?t.push({name:"SkillData"}):n==="admin"?t.push({name:"SkillData"}):t.push({name:"SkillAutomation"}),sessionStorage.removeItem("dataViewAccess"),sessionStorage.removeItem("role")};return(n,o)=>(Q(),R("div",vx,[h("div",{onClick:i,class:"flex justify-start items-center text-white cursor-pointer"},[ne(m(MC),{class:"md:w-9 w-5 h-5 md:h-9 mr-1"}),fx]),wx,Qx]))}}),ci=e=>(At("data-v-ecf2c818"),e=e(),at(),e),mx={class:"bg-genpact-blue-box w-full px-5 mb-6"},Dx={class:"grid grid-cols-5 gap-8 p-10 items-stretch"},yx=ci(()=>h("div",{class:"col-span-1 text-right"},[h("label",{for:"topic",class:"block text-lg font-bold text-gray-900 mb-1 italic"},[We("Topic Name "),h("span",{class:"label"},"*")])],-1)),Tx={class:"col-span-4"},Lx=["disabled"],Ox=ci(()=>h("div",{class:"col-span-1 text-right"},[h("label",{for:"description",class:"block text-lg font-bold text-gray-900 mb-1 italic"},[We("Description "),h("span",{class:"label"},"*")])],-1)),Ux={class:"col-span-4"},Nx=ci(()=>h("div",{class:"col-span-1 text-right"},[h("label",{for:"Knowledge Corpus",class:"block text-lg font-bold text-gray-900 mb-1 italic"},[We("Knowledge Corpus "),h("span",{class:"label"},"*")])],-1)),Kx={class:"col-span-4"},Fx=ci(()=>h("div",{class:"col-span-1"},null,-1)),Gx={class:"col-span-4"},xx={class:"grid md:grid-cols-5 grid-cols-1 justify-start items-center gap-2"},jx={class:"col-span-1"},kx=["disabled"],Yx={key:1,class:"flex justify-center items-center text-center bg-genpact-darkest-blue text-white rounded-md w-40"},zx=[ci(()=>h("img",{class:"w-10 h-10 block loadercss",src:Di,alt:"Loader Gif"},null,-1))],Px=ci(()=>h("div",{class:"col-span-1"},null,-1)),bx=ci(()=>h("div",{class:"col-span-1"},null,-1)),Jx={class:"col-span-1 flex md:justify-end justify-start items-end"},Hx={key:1,class:"flex justify-center items-center text-center w-52 bg-genpact-darkest-blue text-white rounded-md"},qx=[ci(()=>h("img",{class:"w-10 h-10 block loadercss",src:Di,alt:"Loader Gif"},null,-1))],Vx={class:"col-span-1 flex md:justify-end justify-start items-end"},Wx=["disabled"],Zx={key:1,class:"flex justify-center items-center text-center w-52 bg-genpact-darkest-blue text-white rounded-md"},Xx=[ci(()=>h("img",{class:"w-10 h-10 block loadercss",src:Di,alt:"Loader Gif"},null,-1))],_x={class:"pl-16 pr-8 py-2"},$x={class:"w-full relative overflow-x-auto rounded-lg border border-gray-200 max-h-[550px]"},ej={class:"table-auto w-full text-sm text-left rtl:text-right rounded-lg"},tj=ci(()=>h("thead",{class:"text-sm text-center md:text-base text-gray-700 uppercase bg-gray-200 top-0 sticky z-10"},[h("tr",null,[h("th",{scope:"col",class:"px-6 py-3"},"Topic name"),h("th",{scope:"col",class:"px-6 py-3"},"Description"),h("th",{scope:"col",class:"px-6 py-3"},"Knowledge Corpus"),h("th",{scope:"col",class:"px-6 py-3"},"Score")])],-1)),ij={class:"px-3 py-4 font-medium text-gray-900 text-center"},nj={class:"px-3 py-4"},rj={class:"px-3 py-4 text-center"},oj=ci(()=>h("td",{class:"px-3 py-4 text-center"},de("1.05"),-1)),sj={class:"absolute top-0 md:left-20 md:right-20 left-12 right-12 flex justify-center items-center mx-auto z-[100]"},Aj={class:"w-full rounded-md px-3 text-center mt-4 bg-green-500 py-2 text-white"},aj=Re({__name:"EditSkillAdminData",setup(e){const t=be(),i=lt(),n=f(!0),o=f(!0),s=f(!0),A=f(!1),r=f(""),a=f(!1),c=f(!1),u=f(),l=f(),g=f(""),E=f([]),C=async()=>{var p,M,v,T,O,F;try{const D={question:t.descriptionForSkillData};console.log("question",r.value),n.value=!1;const j=await Yt("/SearchSkillTags",D);l.value=(M=(p=j==null?void 0:j.data)==null?void 0:p.body)==null?void 0:M.length,console.log("ARRAY LENGTH",l.value),u.value=((v=j==null?void 0:j.data)==null?void 0:v.body)||[],E.value=u.value,console.log("length",(O=(T=j==null?void 0:j.data)==null?void 0:T.body)==null?void 0:O.length),console.log("data",j),n.value=!0,a.value=!0,c.value=!0,console.log("showSubmitButton",c.value)}catch(D){if(console.error(D),n.value=!0,Ne.isAxiosError(D)){const j=D;i.setError(((F=j.response)==null?void 0:F.data).message)}else i.setError("We ran into an issue while fetching duplicate values.")}},d=async()=>{var p;try{console.log("before rejecting topic"),o.value=!1;const M=encodeURIComponent(t.topicNameForSkillData),v=await oi(`/rejectTempTopic?Topic=${M}`);console.log("encoded topic",M),console.log("response",v),o.value=!0,v.status===200&&(t.topicNameForSkillData="",t.descriptionForSkillData="",t.offeringTypeForSkillData="",console.log("after rejecting topic"),g.value="Data Rejected Successfully!",I())}catch(M){if(console.error(M),o.value=!0,Ne.isAxiosError(M)){const v=M;i.setError(((p=v.response)==null?void 0:p.data).message)}else i.setError("We ran into an issue while rejecting values.")}},S=async()=>{var p;try{const M={Topic:t.topicNameForSkillData,Description:t.descriptionForSkillData,OfferingType:t.offeringTypeForSkillData};console.log("payload-=====>",M),s.value=!1;const v=await Yt("/editMasterSkillFile",M);console.log("data",v),s.value=!0,g.value="Data Submitted Successfully!",I()}catch(M){if(console.error(M),s.value=!0,Ne.isAxiosError(M)){const v=M;i.setError(((p=v.response)==null?void 0:p.data).message)}else i.setError("There was an issue while inserting data")}},I=()=>{A.value=!0,setTimeout(()=>{A.value=!1;const p=sessionStorage.getItem("role");console.log("role",p),p==="user"?Cr.push({name:"SkillData"}):p==="admin"?Cr.push({name:"SkillData"}):Cr.push({name:"SkillAutomation"}),sessionStorage.removeItem("dataViewAccess"),sessionStorage.removeItem("role")},3e3)};return(p,M)=>(Q(),R(Le,null,[h("nav",mx,[ne(Rx)]),h("div",Dx,[yx,h("div",Tx,[Te(h("input",{disabled:m(t).enableInputbox!==!0,class:Ee([m(t).enableInputbox!==!0?"cursor-not-allowed fill-gray-400":"","w-full p-2.5 text-sm text-gray-900 bg-gray-50 rounded-lg border border-gray-300 shadow-sm focus:outline-none focus:border-genpact-blue-box focus:ring-genpact-blue-box focus:ring-1"]),type:"text","onUpdate:modelValue":M[0]||(M[0]=v=>m(t).topicNameForSkillData=v),id:"topic",placeholder:"Write here...",required:""},null,10,Lx),[[qe,m(t).topicNameForSkillData]])]),Ox,h("div",Ux,[Te(h("textarea",{"onUpdate:modelValue":M[1]||(M[1]=v=>m(t).descriptionForSkillData=v),onInput:M[2]||(M[2]=v=>c.value=!1),type:"text",id:"description",rows:"5",class:"w-full p-2.5 text-sm text-gray-900 bg-gray-50 rounded-lg border border-gray-300 shadow-sm focus:outline-none focus:border-genpact-blue-box focus:ring-genpact-blue-box focus:ring-1",placeholder:"Write here...",required:""},null,544),[[qe,m(t).descriptionForSkillData]])]),Nx,h("div",Kx,[Te(h("input",{"onUpdate:modelValue":M[3]||(M[3]=v=>m(t).offeringTypeForSkillData=v),type:"text",id:"offeringType",class:"w-full p-2.5 text-sm text-gray-900 bg-gray-50 rounded-lg border border-gray-300 shadow-sm focus:outline-none focus:border-genpact-blue-box focus:ring-genpact-blue-box focus:ring-1",placeholder:"Write here...",required:""},null,512),[[qe,m(t).offeringTypeForSkillData]])]),Fx,h("div",Gx,[h("div",xx,[h("div",jx,[n.value?(Q(),R("button",{key:0,disabled:m(t).isTopicPending===!0,class:Ee([m(t).isTopicPending===!0?"cursor-not-allowed bg-gray-600":"cursor-pointer bg-genpact-darkest-blue","text-center whitespace-nowrap text-white w-52 px-4 py-2 rounded-md font-bold"]),type:"button",onClick:C}," Duplicate Check ",10,kx)):(Q(),R("div",Yx,zx))]),Px,bx,h("div",Jx,[o.value?(Q(),R("button",{key:0,type:"button",onClick:d,class:"bg-genpact-darkest-blue text-center text-white w-52 px-16 py-2 rounded-md font-bold cursor-pointer"}," Reject ")):(Q(),R("div",Hx,qx))]),h("div",Vx,[s.value?(Q(),R("button",{key:0,type:"submit",disabled:c.value!==!0,class:Ee([c.value!==!0?"cursor-not-allowed bg-gray-600":"cursor-pointer bg-genpact-darkest-blue","text-center text-white w-52 px-2 py-2 rounded-md whitespace-nowrap font-bold"]),onClick:S}," Approve & Submit ",10,Wx)):(Q(),R("div",Zx,Xx))])])])]),Te(h("div",_x,[h("div",$x,[h("table",ej,[tj,h("tbody",null,[(Q(!0),R(Le,null,Qt(E.value,(v,T)=>(Q(),R("tr",{key:T,class:"odd:bg-white even:bg-gray-100"},[h("th",ij,de(v.Topic||"title"),1),h("td",nj,de(v.Description||"desc"),1),h("td",rj,de(v.OfferingType||"Knowledge Corpus"),1),oj]))),128))])])])],512),[[ar,a.value]]),Te(h("div",sj,[h("div",Aj,de(g.value),1)],512),[[ar,A.value]])],64))}}),M1="",cj=Object.freeze(Object.defineProperty({__proto__:null,default:je(aj,[["__scopeId","data-v-ecf2c818"]])},Symbol.toStringTag,{value:"Module"})),uj="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAgEAAAIBCAYAAADQ5mxhAAAACXBIWXMAAAsSAAALEgHS3X78AAAfXUlEQVR4nO3dsY7kRp7gYeZhjfI0uhfYg/YBpoDSA8ho+duGxh0NCpDc9VrmmZJ160pAYSR3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ZZN43yOfwu3Tug6XEFNREBC0ozqD+t7Nr2WY4vL/fpPeQ+1a2kfTqF0cQKf8bthIe5e7M+h9/d7W+aH1dQCxGwsHHlfXx5+fGM28wu6aR/P22APp6xgSvhx7ThaW1F/03mcn4xdyKoz+F3d/ub/d3+pulxBTUQAStJ51L/ZYOV1o/pMPX/PGdFPu4FHl9efpn2wJa8Ucy01/mnVo4A3JeOBix2O2Gfw9vSJLNNx9UYJCv+u1CUiYErundDoW/SrYNfnDA7+znTrPA3v0uvwNPVBa/TzWk+Sz/nvv7p7ng/VvJwoHN9ly5Re24i35vLO0+ZbOdz+N29Gwp9k24dvPi4Sv8mNM8lghVIK/KrtNGYDhF/9J6V2LSCni7/Gn//vNWKO01ye/Hg9V89sRGcXuP0ul83eMi/Sj6Ht6VbCJ89rp67/A9aJgIAIChzAgAgKBEAAEGJAAAISgQAQFAiAACCEgEAEJQIAICgRAAABCUCACAoEQAAQYkAAAhKBABAUCIAAIISAQAQlAgAgKBEAAAEJQIAICgRAABBiQAACEoEAEBQIgAAghIBABCUCACAoEQAAAQlAgAgKBEAAEGJAAAISgQAQFAiAACCEgEAEJQIAICgRAAABCUCACAoEQAAQYkAAAhKBABAUCIAAIISAQAQlAgAgKBEAAAEJQIAICgRAABBiQAACEoEAEBQIgAAghIBABCUCACAoEQAAAQlAgAgKBEAAEGJAACIaBiG/w+yjGibxxwNWgAAAABJRU5ErkJggg==",lj={},gj={class:"w-screen h-screen flex justify-center"},Ej=[h("div",{class:"flex flex-col justify-center items-center gap-6"},[h("img",{class:"h-24",src:uj}),h("div",{class:"font-bold text-[50px] capitalize text-gray-600"},"We are under maintenance"),h("div",{class:"font-medium text-lg capitalize text-gray-600"},"please check back later")],-1)];function hj(e,t){return Q(),R("div",gj,Ej)}const TS=Object.freeze(Object.defineProperty({__proto__:null,default:je(lj,[["render",hj]])},Symbol.toStringTag,{value:"Module"}))});
|
|
35
|
+
${this.privSynthesizerConfig.parameters.getProperty(t.PropertyId.SpeechServiceConnection_Url)} Reason: ${u.reason}`))},a=>{throw this.privSynthesisTurn.onAuthCompleted(!0),new Error(a)}),this.privConnectionPromise.catch(()=>{}),this.privConnectionPromise}sendSpeechServiceConfig(A,r){if(r)return A.send(new n.SpeechConnectionMessage(e.MessageType.Text,"speech.config",this.privSynthesisTurn.requestId,"application/json",r))}sendSsmlMessage(A,r,a){return A.send(new n.SpeechConnectionMessage(e.MessageType.Text,"ssml",a,"application/ssml+xml",r))}async fetchConnection(){return this.privConnectionConfigurationPromise!==void 0?this.privConnectionConfigurationPromise.then(A=>A.state()===e.ConnectionState.Disconnected?(this.privConnectionId=null,this.privConnectionConfigurationPromise=void 0,this.fetchConnection()):this.privConnectionConfigurationPromise,()=>(this.privConnectionId=null,this.privConnectionConfigurationPromise=void 0,this.fetchConnection())):(this.privConnectionConfigurationPromise=this.configureConnection(),await this.privConnectionConfigurationPromise)}async configureConnection(){const A=await this.connectImpl();return this.configConnectionOverride!==void 0?this.configConnectionOverride(A):(this.setSpeechConfigSynthesisSection(),await this.sendSpeechServiceConfig(A,this.privSynthesizerConfig.SpeechServiceConfig.serialize()),A)}onAvatarEvent(A){}onSynthesisStarted(A){}onSynthesizing(A){}onSynthesisCancelled(A){}onSynthesisCompleted(A){}onWordBoundary(A){}onVisemeReceived(A){}onBookmarkReached(A){}};return oA.SynthesisAdapterBase=o,o.telemetryDataEnabled=!0,oA}var sA={},hS;function jU(){if(hS)return sA;hS=1,Object.defineProperty(sA,"__esModule",{value:!0}),sA.AvatarSynthesisAdapter=void 0;const e=q(),t=se();let i=class extends t.SynthesisAdapterBase{constructor(o,s,A,r,a){super(o,s,A,void 0),this.privAvatarSynthesizer=r,this.privSynthesizer=r,this.privAvatarConfig=a}setSynthesisContextSynthesisSection(){this.privSynthesisContext.setSynthesisSection(void 0)}setSpeechConfigSynthesisSection(){var o,s,A,r,a,c,u,l,g,E,C,d,S,I,p,M,v;this.privSynthesizerConfig.synthesisVideoSection={format:{bitrate:(o=this.privAvatarConfig.videoFormat)==null?void 0:o.bitrate,codec:(s=this.privAvatarConfig.videoFormat)==null?void 0:s.codec,crop:{bottomRight:{x:(a=(r=(A=this.privAvatarConfig.videoFormat)==null?void 0:A.cropRange)==null?void 0:r.bottomRight)==null?void 0:a.x,y:(l=(u=(c=this.privAvatarConfig.videoFormat)==null?void 0:c.cropRange)==null?void 0:u.bottomRight)==null?void 0:l.y},topLeft:{x:(C=(E=(g=this.privAvatarConfig.videoFormat)==null?void 0:g.cropRange)==null?void 0:E.topLeft)==null?void 0:C.x,y:(I=(S=(d=this.privAvatarConfig.videoFormat)==null?void 0:d.cropRange)==null?void 0:S.topLeft)==null?void 0:I.y}},resolution:{height:(p=this.privAvatarConfig.videoFormat)==null?void 0:p.height,width:(M=this.privAvatarConfig.videoFormat)==null?void 0:M.width}},protocol:{name:"WebRTC",webrtcConfig:{clientDescription:btoa(this.privSynthesizerConfig.parameters.getProperty(e.PropertyId.TalkingAvatarService_WebRTC_SDP)),iceServers:this.privAvatarConfig.remoteIceServers??this.privAvatarSynthesizer.iceServers}},talkingAvatar:{background:{color:this.privAvatarConfig.backgroundColor,image:{url:(v=this.privAvatarConfig.backgroundImage)==null?void 0:v.toString()}},character:this.privAvatarConfig.character,customized:this.privAvatarConfig.customized,style:this.privAvatarConfig.style,useBuiltInVoice:this.privAvatarConfig.useBuiltInVoice}}}onAvatarEvent(o){if(this.privAvatarSynthesizer.avatarEventReceived){const s=new e.AvatarEventArgs(o.Data.Offset,o.Data.Name);try{this.privAvatarSynthesizer.avatarEventReceived(this.privAvatarSynthesizer,s)}catch{}}}};return sA.AvatarSynthesisAdapter=i,sA}var AA={},CS;function kU(){if(CS)return AA;CS=1,Object.defineProperty(AA,"__esModule",{value:!0}),AA.SpeechSynthesisAdapter=void 0;const e=q(),t=se();let i=class extends t.SynthesisAdapterBase{constructor(o,s,A,r,a){super(o,s,A,a),this.privSpeechSynthesizer=r,this.privSynthesizer=r}setSynthesisContextSynthesisSection(){this.privSynthesisContext.setSynthesisSection(this.privSpeechSynthesizer)}onSynthesisStarted(o){const s=new e.SpeechSynthesisEventArgs(new e.SpeechSynthesisResult(o,e.ResultReason.SynthesizingAudioStarted));this.privSpeechSynthesizer.synthesisStarted&&this.privSpeechSynthesizer.synthesisStarted(this.privSpeechSynthesizer,s)}onSynthesizing(o){if(this.privSpeechSynthesizer.synthesizing)try{const s=this.privSynthesisTurn.audioOutputFormat.addHeader(o),A=new e.SpeechSynthesisEventArgs(new e.SpeechSynthesisResult(this.privSynthesisTurn.requestId,e.ResultReason.SynthesizingAudio,s));this.privSpeechSynthesizer.synthesizing(this.privSpeechSynthesizer,A)}catch{}}onSynthesisCancelled(o){if(this.privSpeechSynthesizer.SynthesisCanceled){const s=new e.SpeechSynthesisEventArgs(o);try{this.privSpeechSynthesizer.SynthesisCanceled(this.privSpeechSynthesizer,s)}catch{}}}onSynthesisCompleted(o){if(this.privSpeechSynthesizer.synthesisCompleted)try{this.privSpeechSynthesizer.synthesisCompleted(this.privSpeechSynthesizer,new e.SpeechSynthesisEventArgs(o))}catch{}}onWordBoundary(o){if(this.privSpeechSynthesizer.wordBoundary)try{this.privSpeechSynthesizer.wordBoundary(this.privSpeechSynthesizer,o)}catch{}}onVisemeReceived(o){if(this.privSpeechSynthesizer.visemeReceived)try{this.privSpeechSynthesizer.visemeReceived(this.privSpeechSynthesizer,o)}catch{}}onBookmarkReached(o){if(this.privSpeechSynthesizer.bookmarkReached)try{this.privSpeechSynthesizer.bookmarkReached(this.privSpeechSynthesizer,o)}catch{}}};return AA.SpeechSynthesisAdapter=i,AA}var aA={},IS;function YU(){if(IS)return aA;IS=1,Object.defineProperty(aA,"__esModule",{value:!0}),aA.SynthesisRestAdapter=void 0;const e=ht(),t=q(),i=ai(),n=Et;let o=class{constructor(A,r){let a=A.parameters.getProperty(t.PropertyId.SpeechServiceConnection_Endpoint,void 0);if(!a){const u=A.parameters.getProperty(t.PropertyId.SpeechServiceConnection_Region,"westus"),l=i.ConnectionFactoryBase.getHostSuffix(u);a=A.parameters.getProperty(t.PropertyId.SpeechServiceConnection_Host,`https://${u}.tts.speech${l}`)}this.privUri=`${a}/cognitiveservices/voices/list`;const c=e.RestConfigBase.requestOptions;this.privRestAdapter=new e.RestMessageAdapter(c),this.privAuthentication=r}getVoicesList(A){return this.privRestAdapter.setHeaders(n.HeaderNames.ConnectionId,A),this.privAuthentication.fetch(A).then(r=>(this.privRestAdapter.setHeaders(r.headerName,r.token),this.privRestAdapter.request(e.RestRequestType.Get,this.privUri)))}};return aA.SynthesisRestAdapter=o,aA}var ng={},pS;function zU(){return pS||(pS=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.SynthesizerConfig=e.SynthesisServiceType=void 0;const t=se();var i;(function(o){o[o.Standard=0]="Standard",o[o.Custom=1]="Custom"})(i=e.SynthesisServiceType||(e.SynthesisServiceType={}));class n{constructor(s,A){this.privSynthesisServiceType=i.Standard,this.avatarEnabled=!1,this.privSpeechServiceConfig=s||new t.SpeechServiceConfig(new t.Context(null)),this.privParameters=A}get parameters(){return this.privParameters}get synthesisServiceType(){return this.privSynthesisServiceType}set synthesisServiceType(s){this.privSynthesisServiceType=s}set synthesisVideoSection(s){this.privSpeechServiceConfig.Context.synthesis={video:s}}get SpeechServiceConfig(){return this.privSpeechServiceConfig}}e.SynthesizerConfig=n}(ng)),ng}var cA={},dS;function PU(){if(dS)return cA;dS=1,Object.defineProperty(cA,"__esModule",{value:!0}),cA.SynthesisContext=void 0;const e=q();let t=class{constructor(){this.privContext={}}setSection(n,o){this.privContext[n]=o}set audioOutputFormat(n){this.privAudioOutputFormat=n}toJSON(){return JSON.stringify(this.privContext)}setSynthesisSection(n){const o=this.buildSynthesisContext(n);this.setSection("synthesis",o)}buildSynthesisContext(n){return{audio:{metadataOptions:{bookmarkEnabled:!!(n!=null&&n.bookmarkReached),punctuationBoundaryEnabled:n==null?void 0:n.properties.getProperty(e.PropertyId.SpeechServiceResponse_RequestPunctuationBoundary,!!(n!=null&&n.wordBoundary)),sentenceBoundaryEnabled:n==null?void 0:n.properties.getProperty(e.PropertyId.SpeechServiceResponse_RequestSentenceBoundary,!1),sessionEndEnabled:!0,visemeEnabled:!!(n!=null&&n.visemeReceived),wordBoundaryEnabled:n==null?void 0:n.properties.getProperty(e.PropertyId.SpeechServiceResponse_RequestWordBoundary,!!(n!=null&&n.wordBoundary))},outputFormat:this.privAudioOutputFormat.requestAudioFormatString},language:{autoDetection:n==null?void 0:n.autoDetectSourceLanguage}}}};return cA.SynthesisContext=t,cA}var uA={},SS;function bU(){if(SS)return uA;SS=1,Object.defineProperty(uA,"__esModule",{value:!0}),uA.SpeakerRecognitionConfig=void 0;const e=se();let t=class{constructor(n,o){this.privContext=n||new e.Context(null),this.privParameters=o}get parameters(){return this.privParameters}get Context(){return this.privContext}};return uA.SpeakerRecognitionConfig=t,uA}var lA={},MS;function JU(){if(MS)return lA;MS=1,Object.defineProperty(lA,"__esModule",{value:!0}),lA.SpeakerServiceRecognizer=void 0;const e=ht(),t=ge(),i=q(),n=se(),o=Oi;let s=class extends n.ServiceRecognizerBase{constructor(r,a,c,u,l){super(r,a,c,u,l),this.privSpeakerRecognizer=l,this.privSpeakerAudioSource=c,this.recognizeSpeaker=g=>this.recognizeSpeakerOnce(g),this.sendPrePayloadJSONOverride=()=>this.noOp()}processTypeSpecificMessages(r){let a=!1;const c=new i.PropertyCollection;switch(r.messageType===t.MessageType.Text&&c.setProperty(i.PropertyId.SpeechServiceResponse_JsonResult,r.textBody),r.path.toLowerCase()){case"speaker.response":const l=JSON.parse(r.textBody);let g;l.status.statusCode.toLowerCase()!=="success"?g=new i.SpeakerRecognitionResult(l,i.ResultReason.Canceled,i.CancellationErrorCode.ServiceError,l.status.reason):g=new i.SpeakerRecognitionResult(l,i.ResultReason.RecognizedSpeaker),this.privResultDeferral&&this.privResultDeferral.resolve(g),a=!0;break}const u=new t.Deferred;return u.resolve(a),u.promise}cancelRecognition(r,a,c,u,l){if(new i.PropertyCollection().setProperty(n.CancellationErrorCodePropertyName,i.CancellationErrorCode[u]),this.privResultDeferral){const E=new i.SpeakerRecognitionResult({scenario:this.privSpeakerModel.scenario,status:{statusCode:l,reason:l}},i.ResultReason.Canceled,u,l);try{this.privResultDeferral.resolve(E)}catch(C){this.privResultDeferral.reject(C)}}}async recognizeSpeakerOnce(r){this.privSpeakerModel=r,this.voiceProfileType=r.scenario,this.privResultDeferral||(this.privResultDeferral=new t.Deferred),this.privRequestSession.startNewRecognition(),this.privRequestSession.listenForServiceTelemetry(this.privSpeakerAudioSource.events),this.privRecognizerConfig.parameters.setProperty(i.PropertyId.Speech_SessionId,this.privRequestSession.sessionId);const a=this.connectImpl(),c=this.sendPreAudioMessages(this.extractSpeakerContext(r)),u=await this.privSpeakerAudioSource.attach(this.privRequestSession.audioNodeId),l=await this.privSpeakerAudioSource.format,g=await this.privSpeakerAudioSource.deviceInfo,E=new e.ReplayableAudioNode(u,l.avgBytesPerSec);await this.privRequestSession.onAudioSourceAttachCompleted(E,!1),this.privRecognizerConfig.SpeechServiceConfig.Context.audio={source:g};try{await a,await c}catch(S){this.cancelRecognition(this.privRequestSession.sessionId,this.privRequestSession.requestId,i.CancellationReason.Error,i.CancellationErrorCode.ConnectionFailure,S)}const C=new i.SessionEventArgs(this.privRequestSession.sessionId);return this.privRecognizer.sessionStarted&&this.privRecognizer.sessionStarted(this.privRecognizer,C),this.receiveMessage(),this.sendAudio(E).then(()=>{},S=>{this.cancelRecognition(this.privRequestSession.sessionId,this.privRequestSession.requestId,i.CancellationReason.Error,i.CancellationErrorCode.RuntimeError,S)}),this.privResultDeferral.promise}async sendPreAudioMessages(r){const a=await this.fetchConnection();await this.sendSpeakerRecognition(a,r)}async sendSpeakerRecognition(r,a){const c=JSON.stringify(a);return r.send(new o.SpeechConnectionMessage(t.MessageType.Text,"speaker.context",this.privRequestSession.requestId,"application/json; charset=utf-8",c))}extractSpeakerContext(r){return{features:{interimResult:"enabled",progressiveDetection:"disabled"},profileIds:r.profileIds,scenario:r.scenario}}};return lA.SpeakerServiceRecognizer=s,lA}var gA={},BS;function HU(){if(BS)return gA;BS=1,Object.defineProperty(gA,"__esModule",{value:!0}),gA.VoiceServiceRecognizer=void 0;const e=ht(),t=ge(),i=q(),n=se(),o=Oi;let s=class extends n.ServiceRecognizerBase{constructor(r,a,c,u,l){super(r,a,c,u,l),this.privDeferralMap=new t.DeferralMap,this.privSpeakerAudioSource=c,this.sendPrePayloadJSONOverride=()=>this.noOp()}set SpeakerAudioSource(r){this.privSpeakerAudioSource=r}processTypeSpecificMessages(r){let a=!1;const c=new i.PropertyCollection;switch(r.messageType===t.MessageType.Text&&c.setProperty(i.PropertyId.SpeechServiceResponse_JsonResult,r.textBody),r.path.toLowerCase()){case"speaker.profiles":const l=JSON.parse(r.textBody);switch(l.operation.toLowerCase()){case"create":this.handleCreateResponse(l,r.requestId);break;case"delete":case"reset":this.handleResultResponse(l,r.requestId);break;case"fetch":const d=JSON.parse(r.textBody);this.handleFetchResponse(d,r.requestId);break}a=!0;break;case"speaker.phrases":const g=JSON.parse(r.textBody);this.handlePhrasesResponse(g,r.requestId),a=!0;break;case"speaker.profile.enrollment":const E=JSON.parse(r.textBody),C=new i.VoiceProfileEnrollmentResult(this.enrollmentReasonFrom(E.enrollment?E.enrollment.enrollmentStatus:E.status.statusCode),E.enrollment?JSON.stringify(E.enrollment):void 0,E.status.reason);this.privDeferralMap.getId(r.requestId)&&this.privDeferralMap.complete(r.requestId,C),this.privRequestSession.onSpeechEnded(),a=!0;break}const u=new t.Deferred;return u.resolve(a),u.promise}cancelRecognition(r,a,c,u,l){new i.PropertyCollection().setProperty(n.CancellationErrorCodePropertyName,i.CancellationErrorCode[u]);const E=new i.VoiceProfileEnrollmentResult(i.ResultReason.Canceled,l,l);this.privDeferralMap.getId(a)&&this.privDeferralMap.complete(a,E)}async createProfile(r,a){this.voiceProfileType=r.toString();const c=this.connectImpl();try{const u=new t.Deferred;return await c,await this.sendCreateProfile(u,r,a),this.receiveMessage(),u.promise}catch(u){throw u}}async resetProfile(r){return this.voiceProfileType=r.profileType.toString(),this.sendCommonRequest("reset",r.profileType,r)}async deleteProfile(r){return this.voiceProfileType=r.profileType.toString(),this.sendCommonRequest("delete",r.profileType,r)}async retrieveEnrollmentResult(r){return this.voiceProfileType=r.profileType.toString(),this.privExpectedProfileId=r.profileId,this.sendCommonRequest("fetch",r.profileType,r)}async getAllProfiles(r){return this.voiceProfileType=r.toString(),this.sendCommonRequest("fetch",r)}async getActivationPhrases(r,a){this.voiceProfileType=r.toString();const c=this.connectImpl();try{const u=new t.Deferred;return await c,await this.sendPhrasesRequest(u,r,a),this.receiveMessage(),u.promise}catch(u){throw u}}async enrollProfile(r){this.voiceProfileType=r.profileType.toString();const a=new t.Deferred;this.privRequestSession.startNewRecognition(),this.privRequestSession.listenForServiceTelemetry(this.privSpeakerAudioSource.events),this.privRecognizerConfig.parameters.setProperty(i.PropertyId.Speech_SessionId,this.privRequestSession.sessionId);const c=this.connectImpl(),u=this.sendPreAudioMessages(r,a),l=await this.privSpeakerAudioSource.attach(this.privRequestSession.audioNodeId),g=await this.privSpeakerAudioSource.format,E=await this.privSpeakerAudioSource.deviceInfo,C=new e.ReplayableAudioNode(l,g.avgBytesPerSec);await this.privRequestSession.onAudioSourceAttachCompleted(C,!1),this.privRecognizerConfig.SpeechServiceConfig.Context.audio={source:E};try{await c,await u}catch(I){this.cancelRecognition(this.privRequestSession.sessionId,this.privRequestSession.requestId,i.CancellationReason.Error,i.CancellationErrorCode.ConnectionFailure,I)}const d=new i.SessionEventArgs(this.privRequestSession.sessionId);return this.privRecognizer.sessionStarted&&this.privRecognizer.sessionStarted(this.privRecognizer,d),this.receiveMessage(),this.sendAudio(C).then(()=>{},I=>{this.cancelRecognition(this.privRequestSession.sessionId,this.privRequestSession.requestId,i.CancellationReason.Error,i.CancellationErrorCode.RuntimeError,I)}),a.promise}async sendPreAudioMessages(r,a){const c=await this.fetchConnection();this.privRequestSession.onSpeechContext(),this.privDeferralMap.add(this.privRequestSession.requestId,a),await this.sendBaseRequest(c,"enroll",this.scenarioFrom(r.profileType),r)}async sendPhrasesRequest(r,a,c){const u=await this.fetchConnection();this.privRequestSession.onSpeechContext(),this.privDeferralMap.add(this.privRequestSession.requestId,r);const l=this.scenarioFrom(a),g={locale:c,scenario:l};return u.send(new o.SpeechConnectionMessage(t.MessageType.Text,"speaker.profile.phrases",this.privRequestSession.requestId,"application/json; charset=utf-8",JSON.stringify(g)))}async sendCreateProfile(r,a,c){const u=await this.fetchConnection();this.privRequestSession.onSpeechContext(),this.privDeferralMap.add(this.privRequestSession.requestId,r);const l=a===i.VoiceProfileType.TextIndependentIdentification?"TextIndependentIdentification":a===i.VoiceProfileType.TextIndependentVerification?"TextIndependentVerification":"TextDependentVerification",g={locale:c,number:"1",scenario:l};return u.send(new o.SpeechConnectionMessage(t.MessageType.Text,"speaker.profile.create",this.privRequestSession.requestId,"application/json; charset=utf-8",JSON.stringify(g)))}async sendCommonRequest(r,a,c=void 0){const u=this.connectImpl();try{const l=new t.Deferred;this.privRequestSession.onSpeechContext(),await u;const g=await this.fetchConnection();return this.privDeferralMap.add(this.privRequestSession.requestId,l),await this.sendBaseRequest(g,r,this.scenarioFrom(a),c),this.receiveMessage(),l.promise}catch(l){throw l}}async sendBaseRequest(r,a,c,u){const l={scenario:c};return u?l.profileIds=[u.profileId]:l.maxPageSize=-1,r.send(new o.SpeechConnectionMessage(t.MessageType.Text,`speaker.profile.${a}`,this.privRequestSession.requestId,"application/json; charset=utf-8",JSON.stringify(l)))}extractSpeakerContext(r){return{features:{interimResult:"enabled",progressiveDetection:"disabled"},profileIds:r.profileIds,scenario:r.scenario}}handlePhrasesResponse(r,a){if(this.privDeferralMap.getId(a))if(r.status.statusCode.toLowerCase()!=="success"){const c=i.ResultReason.Canceled,u=new i.VoiceProfilePhraseResult(c,r.status.statusCode,r.passPhraseType,[]);this.privDeferralMap.complete(a,u)}else if(r.phrases&&r.phrases.length>0){const c=i.ResultReason.EnrollingVoiceProfile,u=new i.VoiceProfilePhraseResult(c,r.status.statusCode,r.passPhraseType,r.phrases);this.privDeferralMap.complete(a,u)}else throw new Error("Voice Profile get activation phrases failed, no phrases received");else throw new Error(`Voice Profile get activation phrases request for requestID ${a} not found`)}handleCreateResponse(r,a){if(r.profiles&&r.profiles.length>0)if(this.privDeferralMap.getId(a)){const c=r.profiles.map(u=>u.profileId);this.privDeferralMap.complete(a,c)}else throw new Error(`Voice Profile create request for requestID ${a} not found`);else throw new Error("Voice Profile create failed, no profile id received")}handleResultResponse(r,a){if(this.privDeferralMap.getId(a)){const c=r.operation.toLowerCase()==="delete"?i.ResultReason.DeletedVoiceProfile:i.ResultReason.ResetVoiceProfile,u=r.status.statusCode.toLowerCase()==="success"?c:i.ResultReason.Canceled,l=new i.VoiceProfileResult(u,`statusCode: ${r.status.statusCode}, errorDetails: ${r.status.reason}`);this.privDeferralMap.complete(a,l)}else throw new Error(`Voice Profile create request for requestID ${a} not found`)}handleFetchResponse(r,a){if(this.privDeferralMap.getId(a)&&r.profiles[0]){if(this.privExpectedProfileId&&r.profiles.length===1&&r.profiles[0].profileId===this.privExpectedProfileId){this.privExpectedProfileId=void 0;const c=r.profiles[0],u=new i.VoiceProfileEnrollmentResult(this.enrollmentReasonFrom(c.enrollmentStatus),JSON.stringify(c),r.status.reason);this.privDeferralMap.complete(a,u)}else if(r.profiles.length>0){const c=r.profiles,u=[];for(const l of c)u.push(new i.VoiceProfileEnrollmentResult(this.enrollmentReasonFrom(l.enrollmentStatus),JSON.stringify(l),r.status.reason));this.privDeferralMap.complete(a,u)}}else throw new Error(`Voice Profile fetch request for requestID ${a} not found`)}enrollmentReasonFrom(r){switch(r.toLowerCase()){case"enrolled":return i.ResultReason.EnrolledVoiceProfile;case"invalidlocale":case"invalidphrase":case"invalidaudioformat":case"invalidscenario":case"invalidprofilecount":case"invalidoperation":case"audiotooshort":case"audiotoolong":case"toomanyenrollments":case"storageconflict":case"profilenotfound":case"incompatibleprofiles":case"incompleteenrollment":return i.ResultReason.Canceled;default:return i.ResultReason.EnrollingVoiceProfile}}scenarioFrom(r){return r===i.VoiceProfileType.TextIndependentIdentification?"TextIndependentIdentification":r===i.VoiceProfileType.TextIndependentVerification?"TextIndependentVerification":"TextDependentVerification"}};return gA.VoiceServiceRecognizer=s,gA}var vS={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.type=e.connectivity=e.Device=e.OS=e.System=e.Context=e.SpeechServiceConfig=void 0;class t{constructor(r){this.context=r}serialize(){return JSON.stringify(this,(r,a)=>{if(a&&typeof a=="object"&&!Array.isArray(a)){const c={};for(const u in a)Object.hasOwnProperty.call(a,u)&&(c[u&&u.charAt(0).toLowerCase()+u.substring(1)]=a[u]);return c}return a})}get Context(){return this.context}get Recognition(){return this.recognition}set Recognition(r){this.recognition=r.toLowerCase()}}e.SpeechServiceConfig=t;class i{constructor(r){this.system=new n,this.os=r}}e.Context=i;class n{constructor(){const r="1.44.0";this.name="SpeechSDK",this.version=r,this.build="JavaScript",this.lang="JavaScript"}}e.System=n;class o{constructor(r,a,c){this.platform=r,this.name=a,this.version=c}}e.OS=o;class s{constructor(r,a,c){this.manufacturer=r,this.model=a,this.version=c}}e.Device=s,function(A){A.Bluetooth="Bluetooth",A.Wired="Wired",A.WiFi="WiFi",A.Cellular="Cellular",A.InBuilt="InBuilt",A.Unknown="Unknown"}(e.connectivity||(e.connectivity={})),function(A){A.Phone="Phone",A.Speaker="Speaker",A.Car="Car",A.Headset="Headset",A.Thermostat="Thermostat",A.Microphones="Microphones",A.Deskphone="Deskphone",A.RemoteControl="RemoteControl",A.Unknown="Unknown",A.File="File",A.Stream="Stream"}(e.type||(e.type={}))})(vS);var fS;function se(){return fS||(fS=1,function(e){var t=me&&me.__createBinding||(Object.create?function(s,A,r,a){a===void 0&&(a=r),Object.defineProperty(s,a,{enumerable:!0,get:function(){return A[r]}})}:function(s,A,r,a){a===void 0&&(a=r),s[a]=A[r]}),i=me&&me.__exportStar||function(s,A){for(var r in s)r!=="default"&&!Object.prototype.hasOwnProperty.call(A,r)&&t(A,s,r)};Object.defineProperty(e,"__esModule",{value:!0}),e.AutoDetectSourceLanguagesOpenRangeOptionName=e.ForceDictationPropertyName=e.ServicePropertiesPropertyName=e.CancellationErrorCodePropertyName=e.OutputFormatPropertyName=e.SpeechSynthesisAdapter=e.AvatarSynthesisAdapter=void 0,i(pa,e),i(ka,e),i(Br,e),i(lI,e),i(gI,e),i(NO(),e),i(KO(),e),i(Ic,e),i(FO(),e),i(GO(),e),i(xO(),e),i(Dd,e),i(pc,e),i(kO(),e),i(YO(),e),i(zO(),e),i(PO(),e),i(sd(),e),i(bO(),e),i(Kd,e),i(JO(),e),i(dc,e),i(qO(),e),i(VO(),e),i(Mc,e),i(Bc,e),i(vc,e),i(WO(),e),i(ZO(),e),i(XO(),e),i(_O(),e),i($O(),e),i(fc,e),i(tU(),e),i(wc,e),i(qd,e),i(Qc,e),i(Dc,e),i(yc,e),i(CU(),e),i(Oc,e),i(UU(),e),i(ig,e),i(GU(),e),i(xU(),e);var n=jU();Object.defineProperty(e,"AvatarSynthesisAdapter",{enumerable:!0,get:function(){return n.AvatarSynthesisAdapter}});var o=kU();Object.defineProperty(e,"SpeechSynthesisAdapter",{enumerable:!0,get:function(){return o.SpeechSynthesisAdapter}}),i(YU(),e),i(zU(),e),i(PU(),e),i(bU(),e),i(JU(),e),i(HU(),e),i(vS,e),e.OutputFormatPropertyName="OutputFormat",e.CancellationErrorCodePropertyName="CancellationErrorCode",e.ServicePropertiesPropertyName="ServiceProperties",e.ForceDictationPropertyName="ForceDictation",e.AutoDetectSourceLanguagesOpenRangeOptionName="UND"}(al)),al}(function(e){var t=me&&me.__createBinding||(Object.create?function(o,s,A,r){r===void 0&&(r=A),Object.defineProperty(o,r,{enumerable:!0,get:function(){return s[A]}})}:function(o,s,A,r){r===void 0&&(r=A),o[r]=s[A]}),i=me&&me.__exportStar||function(o,s){for(var A in o)A!=="default"&&!Object.prototype.hasOwnProperty.call(s,A)&&t(s,o,A)};Object.defineProperty(e,"__esModule",{value:!0});const n=se();new n.AgentConfig,i(q(),e)})(pi);const vt=[];for(let e=0;e<256;++e)vt.push((e+256).toString(16).slice(1));function qU(e,t=0){return(vt[e[t+0]]+vt[e[t+1]]+vt[e[t+2]]+vt[e[t+3]]+"-"+vt[e[t+4]]+vt[e[t+5]]+"-"+vt[e[t+6]]+vt[e[t+7]]+"-"+vt[e[t+8]]+vt[e[t+9]]+"-"+vt[e[t+10]]+vt[e[t+11]]+vt[e[t+12]]+vt[e[t+13]]+vt[e[t+14]]+vt[e[t+15]]).toLowerCase()}let rg;const VU=new Uint8Array(16);function WU(){if(!rg){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");rg=crypto.getRandomValues.bind(crypto)}return rg(VU)}const wS={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function ZU(e,t,i){var o;if(wS.randomUUID&&!t&&!e)return wS.randomUUID();e=e||{};const n=e.random??((o=e.rng)==null?void 0:o.call(e))??WU();if(n.length<16)throw new Error("Random bytes length must be >= 16");if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,t){if(i=i||0,i<0||i+16>t.length)throw new RangeError(`UUID byte range ${i}:${i+15} is out of buffer bounds`);for(let s=0;s<16;++s)t[i+s]=n[s];return t}return qU(n)}const yr=lt(),QS=be(),Tr=f(""),qn=f(""),Fi=f(""),Si=f(""),RS=f("");let Cn=null;const mS=4e3;Gt(async()=>{await og()});let nt=null,Lr=null,Mi=null,Gc=null;const Or=()=>{Mi&&Mi.mute(),nt&&(nt.close(),nt=null),Lr=null},og=async()=>{var e,t,i;try{const n=await oi("/voiceTesting");return(e=n==null?void 0:n.data)==null?void 0:e.token}catch(n){if(console.error(n),Ne.isAxiosError(n)){const o=n;console.log("Error found!"),console.error((t=o.response)==null?void 0:t.data),yr.setError(((i=o.response)==null?void 0:i.data).message)}else yr.setError("There was an issue while fetching data")}},sg=()=>{Cn&&clearTimeout(Cn),Gc&&(Gc.stopContinuousRecognitionAsync(()=>{},e=>{console.error("Error stopping recognition",e)}),Gc=null)},XU=async e=>{const t=await og();return await Or(),new Promise((i,n)=>{const o=pi.SpeechConfig.fromAuthorizationToken(t,"eastus2");o.speechSynthesisVoiceName="en-US-EmmaMultilingualNeural",Mi=new pi.SpeakerAudioDestination;const s=pi.AudioConfig.fromSpeakerOutput(Mi);nt=new pi.SpeechSynthesizer(o,s);const A=ZU();Lr=A,nt.speakTextAsync(e,r=>{if(A!==Lr)return Mi==null||Mi.mute(),nt==null||nt.close(),nt=null,i();r.reason===pi.ResultReason.SynthesizingAudioCompleted?i():n(new Error("Speech synthesis failed")),nt==null||nt.close(),nt=null,Lr=null},r=>{if(A!==Lr)return Mi==null||Mi.mute(),nt==null||nt.close(),nt=null,i();nt==null||nt.close(),nt=null,Lr=null,n(r)})})},_U=async e=>{const t=await og(),i=pi.SpeechConfig.fromAuthorizationToken(t,"eastus2");i.speechRecognitionLanguage="en-US";const n=pi.AudioConfig.fromDefaultMicrophoneInput(),o=new pi.SpeechRecognizer(i,n);return Gc=o,Tr.value="",qn.value="",o.recognizing=(s,A)=>{A.result.text&&A.result.text.trim()&&(Tr.value=A.result.text.trim(),Or(),QS.userspeaking=!0,QS.userSpeechText=(qn.value?qn.value+" ":"")+Tr.value,Si.value="user",Cn&&clearTimeout(Cn),Cn=setTimeout(()=>{Tr.value&&(e(Tr.value.trim()),Tr.value="")},mS))},o.recognized=(s,A)=>{A.result.reason===pi.ResultReason.RecognizedSpeech&&A.result.text&&A.result.text.trim()&&(qn.value+=" "+A.result.text.trim(),Cn&&clearTimeout(Cn),Cn=setTimeout(()=>{qn.value&&(e(qn.value),qn.value="")},mS))},o.canceled=(s,A)=>{console.error("Recognition canceled:",A)},o.startContinuousRecognitionAsync(),o},$U=async()=>{var e,t;Fi.value="",RS.value="";try{Or(),await _U(i=>{i&&(Fi.value=i)})}catch(i){if(console.error(i),Ne.isAxiosError(i)){const n=i;console.log("Error found!"),console.error((e=n.response)==null?void 0:e.data),yr.setError(((t=n.response)==null?void 0:t.data).message)}else yr.setError("There was an issue while fetching data")}},eN=async e=>{var t,i;RS.value="";try{(Si.value=="user"||Si.value=="listening")&&Or(),await XU(e)}catch(n){if(console.error(n),Ne.isAxiosError(n)){const o=n;console.log("Error found!"),console.error((t=o.response)==null?void 0:t.data),yr.setError(((i=o.response)==null?void 0:i.data).message)}else yr.setError("There was an issue while fetching data")}},tN={class:"flex items-center gap-4 py-2 rounded-full z-10"},iN={key:0,class:"flex items-center"},nN={width:"30",height:"30",viewBox:"0 0 36 24",class:"fill-white",style:{transform:"scaleX(-1)"}},rN=[rr('<rect x="0" y="11" width="2" height="2" rx="1"><animate attributeName="height" values="2;6;2" dur="1s" repeatCount="indefinite" begin="0s"></animate><animate attributeName="y" values="11;9;11" dur="1s" repeatCount="indefinite" begin="0s"></animate></rect><rect x="4" y="10" width="2" height="4" rx="1"><animate attributeName="height" values="4;8;4" dur="1s" repeatCount="indefinite" begin="0.1s"></animate><animate attributeName="y" values="10;8;10" dur="1s" repeatCount="indefinite" begin="0.1s"></animate></rect><rect x="8" y="8" width="2" height="8" rx="1"><animate attributeName="height" values="8;12;8" dur="1s" repeatCount="indefinite" begin="0.2s"></animate><animate attributeName="y" values="8;6;8" dur="1s" repeatCount="indefinite" begin="0.2s"></animate></rect><rect x="12" y="6" width="2" height="12" rx="1"><animate attributeName="height" values="12;16;12" dur="1s" repeatCount="indefinite" begin="0.3s"></animate><animate attributeName="y" values="6;4;6" dur="1s" repeatCount="indefinite" begin="0.3s"></animate></rect><rect x="16" y="4" width="2" height="16" rx="1"><animate attributeName="height" values="16;20;16" dur="1s" repeatCount="indefinite" begin="0.4s"></animate><animate attributeName="y" values="4;2;4" dur="1s" repeatCount="indefinite" begin="0.4s"></animate></rect><rect x="20" y="6" width="2" height="12" rx="1"><animate attributeName="height" values="12;16;12" dur="1s" repeatCount="indefinite" begin="0.5s"></animate><animate attributeName="y" values="6;4;6" dur="1s" repeatCount="indefinite" begin="0.5s"></animate></rect><rect x="24" y="8" width="2" height="8" rx="1"><animate attributeName="height" values="8;12;8" dur="1s" repeatCount="indefinite" begin="0.6s"></animate><animate attributeName="y" values="8;6;8" dur="1s" repeatCount="indefinite" begin="0.6s"></animate></rect><rect x="28" y="10" width="2" height="4" rx="1"><animate attributeName="height" values="4;8;4" dur="1s" repeatCount="indefinite" begin="0.7s"></animate><animate attributeName="y" values="10;8;10" dur="1s" repeatCount="indefinite" begin="0.7s"></animate></rect><rect x="32" y="11" width="2" height="2" rx="1"><animate attributeName="height" values="2;6;2" dur="1s" repeatCount="indefinite" begin="0.8s"></animate><animate attributeName="y" values="11;9;11" dur="1s" repeatCount="indefinite" begin="0.8s"></animate></rect>',9)],oN={key:1,class:"flex items-center"},sN={width:"30",height:"30",viewBox:"0 0 36 24",class:"fill-white",style:{transform:"scaleX(-1)"}},AN=[rr('<rect x="0" y="11" width="2" height="2" rx="1"><animate attributeName="height" values="2;6;2" dur="1s" repeatCount="indefinite" begin="0s"></animate><animate attributeName="y" values="11;9;11" dur="1s" repeatCount="indefinite" begin="0s"></animate></rect><rect x="4" y="10" width="2" height="4" rx="1"><animate attributeName="height" values="4;8;4" dur="1s" repeatCount="indefinite" begin="0.1s"></animate><animate attributeName="y" values="10;8;10" dur="1s" repeatCount="indefinite" begin="0.1s"></animate></rect><rect x="8" y="8" width="2" height="8" rx="1"><animate attributeName="height" values="8;12;8" dur="1s" repeatCount="indefinite" begin="0.2s"></animate><animate attributeName="y" values="8;6;8" dur="1s" repeatCount="indefinite" begin="0.2s"></animate></rect><rect x="12" y="6" width="2" height="12" rx="1"><animate attributeName="height" values="12;16;12" dur="1s" repeatCount="indefinite" begin="0.3s"></animate><animate attributeName="y" values="6;4;6" dur="1s" repeatCount="indefinite" begin="0.3s"></animate></rect><rect x="16" y="4" width="2" height="16" rx="1"><animate attributeName="height" values="16;20;16" dur="1s" repeatCount="indefinite" begin="0.4s"></animate><animate attributeName="y" values="4;2;4" dur="1s" repeatCount="indefinite" begin="0.4s"></animate></rect><rect x="20" y="6" width="2" height="12" rx="1"><animate attributeName="height" values="12;16;12" dur="1s" repeatCount="indefinite" begin="0.5s"></animate><animate attributeName="y" values="6;4;6" dur="1s" repeatCount="indefinite" begin="0.5s"></animate></rect><rect x="24" y="8" width="2" height="8" rx="1"><animate attributeName="height" values="8;12;8" dur="1s" repeatCount="indefinite" begin="0.6s"></animate><animate attributeName="y" values="8;6;8" dur="1s" repeatCount="indefinite" begin="0.6s"></animate></rect><rect x="28" y="10" width="2" height="4" rx="1"><animate attributeName="height" values="4;8;4" dur="1s" repeatCount="indefinite" begin="0.7s"></animate><animate attributeName="y" values="10;8;10" dur="1s" repeatCount="indefinite" begin="0.7s"></animate></rect><rect x="32" y="11" width="2" height="2" rx="1"><animate attributeName="height" values="2;6;2" dur="1s" repeatCount="indefinite" begin="0.8s"></animate><animate attributeName="y" values="11;9;11" dur="1s" repeatCount="indefinite" begin="0.8s"></animate></rect>',9)],aN={key:2,class:"flex items-center"},cN=[rr('<svg width="30" height="30" viewBox="0 0 64 64" fill="none" xmlns="http://www.w3.org/2000/svg"><rect x="12" y="16" width="40" height="32" rx="8" fill="white" stroke="#9CA3AF" stroke-width="2"></rect><circle cx="24" cy="32" r="4" fill="black"></circle><circle cx="40" cy="32" r="4" fill="black"></circle><line x1="32" y1="10" x2="32" y2="16" stroke="#9CA3AF" stroke-width="2"></line><circle cx="32" cy="8" r="2" fill="white"></circle><circle cx="52" cy="14" r="3" fill="white"><animate attributeName="opacity" values="0;1;0" dur="1.2s" begin="0s" repeatCount="indefinite"></animate></circle><circle cx="58" cy="10" r="2.5" fill="white"><animate attributeName="opacity" values="0;1;0" dur="1.2s" begin="0.2s" repeatCount="indefinite"></animate></circle><circle cx="63" cy="6" r="2" fill="white"><animate attributeName="opacity" values="0;1;0" dur="1.2s" begin="0.4s" repeatCount="indefinite"></animate></circle></svg>',1)],uN={class:"tooltiptext text-genpact-darkest-teal"},lN=[h("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-[10px] w-[10px] text-gray-700",fill:"currentColor",viewBox:"0 0 24 24"},[h("path",{d:"M12 14a3 3 0 0 0 3-3V5a3 3 0 0 0-6 0v6a3 3 0 0 0 3 3zm5-3a5 5 0 0 1-10 0H5a7 7 0 0 0 14 0h-2zm-5 9a7 7 0 0 0 7-7h2a9 9 0 0 1-8 8.94V22h-2v-1.06A9 9 0 0 1 3 13h2a7 7 0 0 0 7 7z"})],-1)],gN=[h("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-[10px] w-[10px] text-gray-700",fill:"currentColor",viewBox:"0 0 24 24"},[h("path",{d:"M12 14a3 3 0 0 0 3-3V5a3 3 0 0 0-6 0v6a3 3 0 0 0 3 3zm5-3a5 5 0 0 1-10 0H5a7 7 0 0 0 14 0h-2zm-5 9a7 7 0 0 0 7-7h2a9 9 0 0 1-8 8.94V22h-2v-1.06A9 9 0 0 1 3 13h2a7 7 0 0 0 7 7z"}),h("line",{x1:"4",y1:"4",x2:"20",y2:"20",stroke:"currentColor","stroke-width":"2"})],-1)],EN=Re({__name:"WebSocketVoiceConversation",setup(e,{expose:t}){const i=f(!1),n=f("Turn on mic"),o=()=>{i.value===!1?(console.log("mic enabled true"),i.value=!0,Or(),$U(),Si.value="user",n.value="Turn off mic"):(console.log("mic enabled false"),sg(),i.value=!1,n.value="Turn on mic")},s=()=>{console.log("closeConversation"),sg(),Or(),Si.value="none",i.value=!1};return t({micEnabled:i}),(A,r)=>(Q(),R("div",tN,[m(Si)==="bot"?(Q(),R("div",iN,[h("span",null,[(Q(),R("svg",nN,rN))])])):m(Si)==="user"?(Q(),R("div",oN,[h("span",null,[(Q(),R("svg",sN,AN))])])):m(Si)==="listening"?(Q(),R("div",aN,cN)):Me("",!0),h("div",{class:Ee([i.value?"":"animate-pulse","tooltip"])},[h("span",uN,de(n.value),1),i.value?(Q(),R("button",{key:0,class:"rounded-full bg-white p-2 transition hover:bg-gray-300",onClick:r[0]||(r[0]=a=>o())},lN)):(Q(),R("button",{key:1,class:"rounded-full bg-white p-2 transition hover:bg-gray-300",onClick:r[1]||(r[1]=a=>o())},gN))],2),h("button",{class:"rounded-full bg-white p-2 hover:bg-gray-300",onClick:r[2]||(r[2]=a=>s())},[ne(m(vC),{class:"h-[10px] w-[10px] text-gray-700"})])]))}}),In=e=>(At("data-v-540bff5b"),e=e(),at(),e),hN={class:"z-3 absolute bottom-0 mt-4 w-full bg-white px-2 md:px-6"},CN={class:"py-2"},IN={class:"flex"},pN={class:"z-1 relative w-full"},dN={class:"flex justify-between my-2 w-full"},SN=In(()=>h("div",null,null,-1)),MN={key:0,class:"flex justify-center bg-genpact-darkest-blue px-4 rounded-full"},BN={class:"relative w-full"},vN={class:"absolute inset-y-0 left-0 flex items-center pl-3"},fN={class:"tooltip"},wN=In(()=>h("span",{class:"tooltiptext text-genpact-darkest-teal"},"Restart",-1)),QN=[In(()=>h("path",{d:"M12 4C8.229 4 6.343 4 5.172 5.172C4.001 6.344 4 8.229 4 12V18C4 18.943 4 19.414 4.293 19.707C4.586 20 5.057 20 6 20H12C15.771 20 17.657 20 18.828 18.828C19.999 17.656 20 15.771 20 12",stroke:"currentColor","stroke-width":"2"},null,-1)),In(()=>h("path",{d:"M9 10H15M9 14H12M19 8V2M16 5H22",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},null,-1))],RN={class:"absolute inset-y-0 right-0 flex items-center md:pr-8 pr-3"},mN={key:0},DN=["disabled"],yN=[In(()=>h("path",{d:"M15.854.146a.5.5 0 0 1 .11.54l-5.819 14.547a.75.75 0 0 1-1.329.124l-3.178-4.995L.643 7.184a.75.75 0 0 1 .124-1.33L15.314.037a.5.5 0 0 1 .54.11ZM6.636 10.07l2.761 4.338L14.13 2.576 6.636 10.07Zm6.787-8.201L1.591 6.602l4.339 2.76 7.494-7.493Z"},null,-1))],TN={key:1,class:"tooltip"},LN=[In(()=>h("span",{class:"tooltiptext fontFormattingAMA"},"Waiting for response",-1)),In(()=>h("img",{title:"Waiting for response",class:"w-7 h-7",src:Al,alt:"watingIcon"},null,-1))],ON={class:"flex justify-start gap-2 md:gap-1"},UN=["disabled"],NN=In(()=>h("div",{class:"pt-1 text-start font-sans text-xs font-bold text-gray-500 md:text-sm"},[h("div",null," Note: AI-generated response may not be fully accurate; check with experts for critical information. ")],-1)),KN="wss://corp-wap-eus-dev-tas-immerse-01.azurewebsites.net",FN=Re({__name:"NewQuestionSimulation",setup(e,{expose:t}){const i=be(),n=lt(),o=f(),s=f(null),A=f(!1),r=f(Wt),a=f(!1),c=f(""),u=f(""),l=f(),g=f(""),E=async()=>{l.value=new WebSocket(KN),l.value.onopen=()=>{u.value="WebSocket connected"},l.value.onmessage=async I=>{try{if(typeof I.data!="string"||!I.data.trim()||!I.data.trim().startsWith("{"))return;const p=JSON.parse(I.data);if(p.status&&(u.value=p.status),p.body&&p.body.answer&&(i.botresponse=!0,i.streamingContent+=p.body.answer),p.done){i.dotLoader&&(i.dotLoader=!1),a.value=!1,Si.value="bot",u.value="Streaming complete",i.botresponse=!1,c.value=i.streamingContent;const M={question:g.value,answer:c.value};i.addConversation(M,"new"),i.dotLoader=!1,i.showVoiceComponent&&(c.value.includes("Feedback and Assessment")?(i.showVoiceComponent=!1,sg(),o.value.micEnabled.value=!1):await eN(c.value.replace(/[*#]/g,"")))}p.error&&(u.value=`Error: ${p.error}`,n.setError(`Server error: ${p.error}`),a.value=!1,i.dotLoader=!1)}catch{u.value="Received non-JSON message",n.setError("Invalid response from server."),a.value=!1,i.dotLoader=!1}},l.value.onerror=I=>{u.value="WebSocket error",n.setError("WebSocket connection error. Please try again."),a.value=!1,i.dotLoader=!1},l.value.onclose=I=>{u.value="WebSocket closed",I.wasClean||(n.setError("WebSocket closed unexpectedly."),E()),a.value=!1,i.dotLoader=!1}};Gt(E),hu(()=>{l.value&&l.value.close()});const C=()=>{window.location.reload()},d=I=>{const p=I.length;r.value=Wt-p,A.value=p>=Wt},S=async()=>{try{if(i.question.trim().length<1&&Fi.value.trim().length<1){console.log("Please enter answer!"),n.setError("Please enter answer!");return}const I=localStorage.getItem("accessToken");a.value=!0,console.log(" isWaitingResponse",a.value),i.dotLoader=!0,i.streamingContent="";const p={question:i.question||Fi.value};i.conversations.push(p),g.value=i.question||Fi.value,i.question="";const M={question:g.value,bandCode:"A1",userFunction:"Engineering",auth_token:`Bearer ${I}`,past_messages:i.past_messages};l.value.send(JSON.stringify(M)),u.value="Question sent..."}catch(I){console.error(I),i.dotLoader=!1,a.value=!1,n.setError("Failed to send question. Please try again.")}};return Ji(Fi,async I=>{if(I){if(console.log("Recognized text:",I),Fi.value.toLowerCase().includes("play")&&Fi.value.length<10){console.log("play command detected, ignoring input");return}Si.value="listening",i.userspeaking=!1,await S(),Fi.value=""}}),t({sendQuestion:S}),(I,p)=>(Q(),R("div",hN,[h("div",CN,[h("div",IN,[h("div",pN,[h("div",dN,[SN,m(i).showVoiceComponent?(Q(),R("div",MN,[ne(EN,{ref_key:"voiceref",ref:o},null,512)])):Me("",!0)]),h("div",BN,[h("div",vN,[h("div",fN,[wN,(Q(),R("svg",{onClick:C,class:"ml-2 h-7 w-7 rounded",id:"newTopicDisable",width:"7",height:"",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",title:"restart"},QN))])]),h("div",RN,[a.value?(Q(),R("div",TN,LN)):(Q(),R("div",mN,[(Q(),R("svg",{disabled:m(i).beginFlag===!0,class:Ee([m(i).beginFlag===!0?"cursor-not-allowed text-gray-600":"cursor-pointer","bi bi-send ml-2 h-7 w-7 rotate-45 rounded"]),onClick:p[0]||(p[0]=M=>m(i).searchBoxdisable===!1||m(i).beginFlag===!0?"":S()),xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 16 16"},yN,10,DN))]))]),h("div",ON,[Te(h("input",{onKeyup:[p[1]||(p[1]=Tu(M=>a.value?"":S(),["enter"])),p[3]||(p[3]=M=>d(m(i).question))],disabled:m(i).beginFlag===!0||m(i).searchBoxdisable===!1,class:Ee([m(i).beginFlag===!0||m(i).searchBoxdisable===!1?"cursor-not-allowed bg-[#e5e7eb]":"bg-white","fontFormattingAMA rounded-lg flex w-full border border-genpact-darkest-teal py-[18px] px-[70px]"]),"onUpdate:modelValue":p[2]||(p[2]=M=>m(i).question=M),placeholder:"Write your answer here...",type:"text",ref_key:"AiSearch",ref:s},null,42,UN),[[qe,m(i).question]])])]),NN])])])]))}}),Uk="",GN=je(FN,[["__scopeId","data-v-540bff5b"]]),xc=e=>(At("data-v-a047746e"),e=e(),at(),e),xN={class:"z-3 absolute bottom-0 mt-4 w-full bg-white px-2 md:px-6"},jN={class:"py-2"},kN={class:"flex"},YN={class:"z-1 relative w-full"},zN={class:"relative w-full"},PN={class:"absolute inset-y-0 right-0 flex items-center md:pr-8 pr-3"},bN={key:0},JN=["disabled"],HN=[xc(()=>h("path",{d:"M15.854.146a.5.5 0 0 1 .11.54l-5.819 14.547a.75.75 0 0 1-1.329.124l-3.178-4.995L.643 7.184a.75.75 0 0 1 .124-1.33L15.314.037a.5.5 0 0 1 .54.11ZM6.636 10.07l2.761 4.338L14.13 2.576 6.636 10.07Zm6.787-8.201L1.591 6.602l4.339 2.76 7.494-7.493Z"},null,-1))],qN={key:1,class:"tooltip"},VN=[xc(()=>h("span",{class:"tooltiptext fontFormattingAMA"},"Waiting for response",-1)),xc(()=>h("img",{class:"w-7 h-7",src:Al,alt:"watingIcon"},null,-1))],WN={class:"flex justify-start gap-2 md:gap-1"},ZN=["disabled"],XN=xc(()=>h("div",{class:"pt-1 text-start font-sans text-xs font-bold text-gray-500 md:text-sm"},[h("div",null," Note: AI-generated response may not be fully accurate; check with experts for critical information. ")],-1)),_N=Re({__name:"NewMDMQuestionSimulation",setup(e){const t=be(),i=lt(),n=f("");t.question="";const o=f(null),s=f(!1),A=f(Wt),r=f(!1);n.value=t.recognizedText,Gt(()=>{o.value.focus()});const a=u=>{const l=u.length;A.value=Wt-l,s.value=l>=Wt},c=async()=>{var u,l,g;console.log("options fdsfdscdzxfsdv",t.recognizedText);try{if(console.log("options fdsfdscdzxfsdv",t.recognizedText),t.question.trim().length<1){console.log("Please enter answer!");return}r.value=!0,t.dotLoader=!0;const E={question:t.question||t.recognizedText};console.log("ques",E),t.conversations.push(E);const C=f("");C.value=t.question||t.recognizedText,t.question="";const d={assessmentId:t.simulationSkill,question:C.value,past_messages:t.past_messages,prompt:t.generatedPrompt,assessmentType:t.assessmentType,userFunction:"HR",empSeniority:t.empSeniority,functionRole:t.functionRole,userBand:t.band_code,storeFinalFeedback:t.storeFinalFeedback,storeFinalScore:t.storeFinalScore};console.log("Payload for MDM1==> ",d);let S;Ii==="prod"?S="/ManualExportActivity":S="/fetchCompletionDemo";const I=await Yt(S,d);t.addConversation((u=I.data)==null?void 0:u.body,"new"),r.value=!1,t.dotLoader=!1,t.recognizedText=""}catch(E){if(console.error(E),Ne.isAxiosError(E)){const C=E;console.log("Error found!"),console.error((l=C.response)==null?void 0:l.data),i.setError(((g=C.response)==null?void 0:g.data).message)}else i.setError("There was an issue, please contact helpmate")}};return(u,l)=>(Q(),R("div",xN,[h("div",jN,[h("div",kN,[h("div",YN,[h("div",zN,[h("div",PN,[r.value?(Q(),R("div",qN,VN)):(Q(),R("div",bN,[(Q(),R("svg",{disabled:m(t).beginFlag===!0,class:Ee([m(t).beginFlag===!0?"cursor-not-allowed text-gray-600":"cursor-pointer","bi bi-send ml-2 h-7 w-7 rotate-45 rounded"]),onClick:l[0]||(l[0]=g=>m(t).searchBoxdisable===!1||m(t).beginFlag===!0?"":c()),xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 16 16"},HN,10,JN))]))]),h("div",WN,[Te(h("input",{onKeyup:[l[1]||(l[1]=Tu(g=>r.value?"":c(),["enter"])),l[3]||(l[3]=g=>a(m(t).question))],disabled:m(t).beginFlag===!0||m(t).searchBoxdisable===!1,class:Ee([m(t).beginFlag===!0||m(t).searchBoxdisable===!1?"cursor-not-allowed bg-[#e5e7eb]":"bg-white","fontFormattingAMA rounded-lg flex w-full border border-genpact-darkest-teal py-[18px] pl-[30px] pr-[70px]"]),"onUpdate:modelValue":l[2]||(l[2]=g=>m(t).question=g),placeholder:"Write your answer here...",type:"text",ref_key:"AiSearch",ref:o},null,42,ZN),[[qe,m(t).question]])])]),XN])])])]))}}),Gk="",$N=je(_N,[["__scopeId","data-v-a047746e"]]),eK={},tK={class:"flex min-h-screen justify-center -mt-16"},iK=[h("div",{class:"flex items-center justify-center"},[h("img",{class:"loadercss",src:Di,alt:"Loader Gif"})],-1)];function nK(e,t){return Q(),R("div",tK,iK)}const DS=je(eK,[["render",nK]]),EA=e=>(At("data-v-450b2de7"),e=e(),at(),e),rK={class:"max-h-screen overflow-auto md:p-6 p-3 text-[#161916]"},oK={key:0,class:"flex flex-col items-center justify-center gap-4"},sK=[EA(()=>h("div",{class:"text-2xl font-[700]"},"Assessment Access Required",-1)),EA(()=>h("h3",{className:"text-lg font-medium my-6 text-center text-gray-500"}," You don't have access to this assessment. Please contact to administrator ",-1))],AK={key:1,class:"flex flex-col items-center justify-center gap-4"},aK=[EA(()=>h("div",{class:"text-2xl font-[700]"},"Invalid URL",-1)),EA(()=>h("h3",{className:"text-lg font-medium my-6 text-center text-gray-500"}," Invalid URL or assessment not found. Please check the URL or contact support. ",-1))],cK={key:1,className:"h-screen flex flex-col items-stretch"},uK={class:"z-20"},lK=EA(()=>h("div",{class:"mt-6"},null,-1)),gK={class:"flex h-full items-stretch overflow-hidden"},EK={class:"mx-auto w-11/12 bg-white"},hK={class:"relative flex h-full w-full flex-col items-stretch overflow-hidden"},CK={key:0,class:"relative"},IK={key:1,class:"relative"},pK=Re({__name:"AssessmentSimulation",setup(e){const t=f(!0),i=f(!1),n=f(!1);f(!1),f(!1);const o=be(),s=lt(),A=f(""),r=f(""),a=f(""),c=f(""),u=localStorage.getItem("accessToken");let l="";const g=f("");let E="",C="";const d=f(),S=f(!1),I=new URL(window.location.href),p=I.searchParams.get("skillId")||I.searchParams.get("assessmentId");r.value=I.searchParams.get("mode")??"",o.simulationSkill=p??"";const M=["703331197","703380812","703331909","703363051","703319578"];Gt(async()=>{t.value=!0,await v(),await O()});const v=async()=>{var D,j,z,G,K,ie,X;try{const Y=await oi(`/getLearnerData?forSimulation=true&skillForSimulation=${o.simulationSkill}`);o.initialize(Y.data),o.assessmentQuestion||(console.log("getAssessmentDetails========================>"),await T()),t.value=!1,o.simulationSkill==="937e84ef-e95d-4327-9afe-e7be2bf420eb"?o.skillNameForSimulation="GenpactNext":o.simulationSkill==="32b7d6d8-f7a8-40a0-ab84-8784f25897ea"||o.simulationSkill==="32b7d6d8-f7a8-40a0-ab84-8784f25897ef"?o.skillNameForSimulation="Agentic AI":o.simulationSkill==="7bd03cb6-79ad-4e2a-8a8b-88dc16147369"&&(o.skillNameForSimulation="Data")}catch(Y){if(console.error(Y),t.value=!1,Ne.isAxiosError(Y)&&((D=Y.response)!=null&&D.status)||Y&&typeof Y=="object"&&"response"in Y&&Y.response&&typeof Y.response=="object"&&"status"in Y.response&&Y.response.status){const L=Y;if(console.log("Error found!"),console.error((j=L.response)==null?void 0:j.data),((z=L.response)==null?void 0:z.status)===424||((G=L.response)==null?void 0:G.status)===425||((K=L.response)==null?void 0:K.status)===400){c.value=(ie=L.response)==null?void 0:ie.status,console.log("errorCode value",c.value),n.value=!0;return}s.setError(((X=L.response)==null?void 0:X.data).message)}else s.setError("There was an issue, please contact helpmate")}},T=async()=>{var D,j,z,G,K,ie,X,Y,L,V,P,ue,ae,pe,ve,Ge,ke,Xe,Ye,U,$,W,ee,Se,B,w,y,N,k,b,te,Z,_,J,Ae,re,ce,he,fe,xe,Oe,He,Ct,Nt,et,$t,xi,st;console.log("Start getAssessmentDetails");try{Ii==="prod"?l=`https://api-v2.genpact.com/api/my-profile/assessment-master/getAssessmentDetailsById?id=${o.simulationSkill}`:l=`https://api-v2-dev.genpact.com/api/my-profile/assessment-master/getAssessmentDetailsById?id=${o.simulationSkill}`;const oe=await oi(l);A.value=(j=(D=oe==null?void 0:oe.data)==null?void 0:D.data)==null?void 0:j.name,o.skillNameForSimulation=A.value,o.generatedPrompt=(G=(z=oe==null?void 0:oe.data)==null?void 0:z.data)==null?void 0:G.generatedPrompt,o.assessmentType=(ie=(K=oe==null?void 0:oe.data)==null?void 0:K.data)==null?void 0:ie.assessmentType,a.value=(Y=(X=oe==null?void 0:oe.data)==null?void 0:X.data)==null?void 0:Y.status,S.value=(V=(L=oe==null?void 0:oe.data)==null?void 0:L.data)==null?void 0:V.editMode,o.empSeniority=(ue=(P=oe==null?void 0:oe.data)==null?void 0:P.data)==null?void 0:ue.empSeniority,o.functionRole=(pe=(ae=oe==null?void 0:oe.data)==null?void 0:ae.data)==null?void 0:pe.functionRole,E=(Ge=(ve=oe==null?void 0:oe.data)==null?void 0:ve.data)==null?void 0:Ge.accessBand,C=(Xe=(ke=oe==null?void 0:oe.data)==null?void 0:ke.data)==null?void 0:Xe.accessOhrList;const bt=(U=(Ye=oe==null?void 0:oe.data)==null?void 0:Ye.data)==null?void 0:U.createdBy;if(o.mcqType=(W=($=oe==null?void 0:oe.data)==null?void 0:$.data)==null?void 0:W.mcqTypes,o.storeFinalFeedback=(Se=(ee=oe==null?void 0:oe.data)==null?void 0:ee.data)==null?void 0:Se.storeFinalFeedback,o.storeFinalScore=(w=(B=oe==null?void 0:oe.data)==null?void 0:B.data)==null?void 0:w.storeFinalScore,a.value==="inactive")i.value=!0;else if(a.value==="draft")r.value!==nl.DRAFT&&(i.value=!0);else if(a.value==="active"&&S.value&&r.value===nl.DRAFT){Ii==="prod"?l=`https://api-v2.genpact.com/api/my-profile/assessment-master/getDraftAssessmentDetailsById?assessmentId=${o.simulationSkill}`:l=`https://api-v2-dev.genpact.com/api/my-profile/assessment-master/getDraftAssessmentDetailsById?assessmentId=${o.simulationSkill}`;const ze=await oi(l);o.generatedPrompt=(N=(y=ze==null?void 0:ze.data)==null?void 0:y.data)==null?void 0:N.generatedPrompt,o.assessmentType=(b=(k=ze==null?void 0:ze.data)==null?void 0:k.data)==null?void 0:b.assessmentType,o.empSeniority=(Z=(te=ze==null?void 0:ze.data)==null?void 0:te.data)==null?void 0:Z.empSeniority,o.functionRole=(J=(_=ze==null?void 0:ze.data)==null?void 0:_.data)==null?void 0:J.functionRole,o.storeFinalFeedback=(re=(Ae=ze==null?void 0:ze.data)==null?void 0:Ae.data)==null?void 0:re.storeFinalFeedback,o.storeFinalScore=(he=(ce=ze==null?void 0:ze.data)==null?void 0:ce.data)==null?void 0:he.storeFinalScore,E=(xe=(fe=ze==null?void 0:ze.data)==null?void 0:fe.data)==null?void 0:xe.accessBand,C=(He=(Oe=ze==null?void 0:ze.data)==null?void 0:Oe.data)==null?void 0:He.accessOhrList}const CA=o==null?void 0:o.band_code,Ur=(Ct=E==null?void 0:E.split(","))==null?void 0:Ct.map(ze=>ze.trim());if(bt===(o==null?void 0:o.ohr)||M.includes(o==null?void 0:o.ohr))console.log("User has access to this assessment.");else{if(Ur.length===0&&C.length===0)throw console.log("Both bands and exceptionOHR are empty. Access denied."),{response:{status:424,data:{message:"You don't have access to this assessment. Please contact to administrator"}}};if(Ur.includes(CA)||C.includes(o==null?void 0:o.ohr))console.log("User has access to this assessment.");else throw console.log("User does not have access to this assessment."),{response:{status:424,data:{message:"You don't have access to this assessment. Please contact to administrator"}}}}console.log("end getAssessmentDetails")}catch(oe){if(console.error(oe),t.value=!1,Ne.isAxiosError(oe)&&((Nt=oe.response)!=null&&Nt.status)||oe&&typeof oe=="object"&&"response"in oe&&oe.response&&typeof oe.response=="object"&&"status"in oe.response&&oe.response.status){const bt=oe;if(console.log("Error found!"),console.error((et=bt.response)==null?void 0:et.data),(($t=bt.response)==null?void 0:$t.status)===424||((xi=bt.response)==null?void 0:xi.status)===425){n.value=!0;return}s.setError(((st=bt.response)==null?void 0:st.data).message)}else s.setError("There was an issue, please contact helpmate")}},O=async()=>{var D,j,z,G,K,ie,X,Y;try{Ii==="prod"?g.value="https://api-v2.genpact.com/api/delphi/v2/myprofile":g.value="https://api-v2-dev.genpact.com/api/delphi/v2/myprofile";const L=await Ne({url:g.value,headers:{authorization:`Bearer ${u}`,"content-type":"application/json"},method:"get"});o.genomeFunctionValue=(z=(j=(D=L==null?void 0:L.data)==null?void 0:D.role_function)==null?void 0:j.function)==null?void 0:z.name,o.genomeRoleValue=(ie=(K=(G=L==null?void 0:L.data)==null?void 0:G.role_function)==null?void 0:K.role)==null?void 0:ie.name}catch(L){if(console.error(L),t.value=!1,Ne.isAxiosError(L)){const V=L;console.log("Error found!"),console.error((X=V.response)==null?void 0:X.data),s.setError(((Y=V.response)==null?void 0:Y.data).message)}else s.setError("There was an issue, please contact helpmate")}},F=()=>{var D;(D=d.value)==null||D.sendQuestion()};return(D,j)=>(Q(),R("section",null,[ne(dr,{"is-visible":n.value},{default:li(()=>[h("div",rK,[c.value===424||c.value==="425"?(Q(),R("div",oK,sK)):Me("",!0),c.value===400?(Q(),R("div",AK,aK)):Me("",!0)])]),_:1},8,["is-visible"]),h("div",null,[t.value?(Q(),Qi(DS,{key:0})):(Q(),R("main",cK,[h("div",uK,[ne(Qy)]),lK,h("div",gK,[h("div",EK,[h("div",hK,[ne(fT,{onCallQuestion:F}),h("div",{class:Ee(m(o).showVoiceComponent===!0?"mt-[160px]":"mt-[120px]")},null,2)]),m(o).assessmentQuestion?(Q(),R("div",CK,[ne(GN,{ref_key:"newQuestionRef",ref:d},null,512)])):(Q(),R("div",IK,[ne($N)]))])])]))])]))}}),Pk="",dK=Object.freeze(Object.defineProperty({__proto__:null,default:je(pK,[["__scopeId","data-v-450b2de7"]])},Symbol.toStringTag,{value:"Module"})),SK={class:"flex h-14 w-full flex-1 items-center justify-between bg-[#021c42] md:pr-6 lg:pr-6"},MK=["href"],BK=[h("img",{class:"h-11 w-auto cursor-pointer",src:TC,alt:"Genome Logo"},null,-1)],vK=["href"],fK=[h("img",{class:"h-9 w-28 cursor-pointer md:w-36",src:rl,alt:"Aiguru Logo"},null,-1)],wK=Re({__name:"headerAMA",setup(e){const t=f(""),i=f("");return Ii==="prod"?t.value="https://genome.genpact.com":t.value="https://genome-dev.genpact.com",Ii==="prod"?i.value="https://genome.genpact.com/#aiguru":i.value="https://genome-dev.genpact.com/#aiguru",(n,o)=>(Q(),R("nav",SK,[h("a",{class:"px-2 md:px-0 lg:px-0",href:t.value,target:"_blank"},BK,8,MK),h("a",{class:"px-2 md:px-0 lg:px-0",href:i.value,target:"_blank"},fK,8,vK)]))}}),QK={class:"flex items-end justify-start"},RK={class:"fontFormattingAMA w-full bg-gray-100 rounded-lg"},mK={class:"w-full rounded-md px-3 py-2 text-lg text-black md:text-xl"},DK=["innerHTML"],yK={class:"w-full px-3 py-2 text-black text-sm md:text-base font-[550]"},TK=["innerHTML"],LK=h("br",null,null,-1),OK=Re({__name:"greetingsAMA",setup(e){const t=be(),i=` Hi ${t.learnerName||"Learner"} ! 👋`,n=it(()=>i),o=it(()=>`I'm here and ready to help! What would you like to know about <span class='font-[600]'>${t.amaSkillName||"Skill"}</span>? <br/> Ask me to explain concepts, provide examples, or clarify anything that seems confusing.`);return(s,A)=>(Q(),R("section",null,[h("div",QK,[h("div",RK,[h("div",mK,[h("div",{innerHTML:n.value},null,8,DK)]),h("div",yK,[h("div",{innerHTML:o.value},null,8,TK)])])]),LK]))}}),UK={class:"fontFormattingAMA flex items-end justify-start py-2"},NK={class:"line-break w-full bg-gray-100 p-3 text-[0.8125rem] md:text-[0.9375rem] text-black rounded-lg"},KK=["innerHTML"],FK=Re({__name:"responseAMA",props:{answer:{type:String,required:!0}},setup(e){const t=e,i=it(()=>{const n=t.answer.replace(/[*#]/g,"").replace(/Assessment Rating & Feedback/g,'<div style="font-size: 26px; font-weight: bold; text-decoration: underline;">Rating & Feedback</div>'),o=/\[([^\]]+)\]\((https?:\/\/[^\s]+)\)/g;return n.replace(o,(s,A,r)=>`<a href="${r}" target="_blank" rel="noopener noreferrer" style="color: blue; text-decoration: underline;">${A}</a>`)});return(n,o)=>(Q(),R("div",UK,[h("div",NK,[h("span",{class:"fontFormattingAMA",innerHTML:i.value},null,8,KK)])]))}}),qk="",GK=je(FK,[["__scopeId","data-v-f88d6450"]]),xK={class:"flex justify-end items-end py-3"},jK={class:"max-w-[80%]"},kK={class:"w-fit fontFormattingAMA text-[0.8125rem] md:text-[0.9375rem] text-white bg-genpact-blue-box leading-6 p-3 rounded-lg"},YK=Re({__name:"learnerAMA",props:{question:{type:String,required:!0}},setup(e){return(t,i)=>(Q(),R("div",xK,[h("div",jK,[h("div",kK,de(e.question),1)])]))}}),zK=e=>(At("data-v-12a02acf"),e=e(),at(),e),PK={class:"flex w-full flex-col items-start justify-start bg-white"},bK={class:"bot-typing-animation gap-1"},JK={class:"block w-full text-lg italic text-gray-800"},HK=zK(()=>h("span",{class:"dot-animation"},[h("span",null,"."),h("span",null,"."),h("span",null,".")],-1)),qK=rr('<div class="block w-full max-w-full items-stretch" data-v-12a02acf><div class="flex animate-pulse items-start justify-start space-x-4" data-v-12a02acf><div class="flex-1 space-y-6 py-1" data-v-12a02acf><div class="h-2 w-full rounded bg-gray-300" data-v-12a02acf></div><div class="space-y-3" data-v-12a02acf><div class="grid grid-cols-3 gap-4" data-v-12a02acf><div class="col-span-2 h-2 rounded bg-gray-300" data-v-12a02acf></div><div class="col-span-1 h-2 rounded bg-gray-300" data-v-12a02acf></div></div><div class="h-2 rounded bg-gray-300" data-v-12a02acf></div></div></div></div></div>',1),VK=Re({__name:"LoadingResponseAMA",setup(e){const t=f("Generating response"),i=f(["This may take a few seconds","Fetching the best response for you","Thinking... give me a moment","One moment while I gather the information","Hang in tight, we are almost there","Almost there... just a bit longer","Compiling a response for you"]);return setTimeout(()=>{const n=Math.floor(Math.random()*i.value.length);t.value=i.value[n]},15e3),(n,o)=>(Q(),R("div",PK,[h("div",bK,[h("div",JK,de(t.value),1),HK]),qK]))}}),Vk="",WK=je(VK,[["__scopeId","data-v-12a02acf"]]),ZK={key:0},XK={key:1},_K={key:0,class:"flex"},$K=Re({__name:"conversationAMA",setup(e){let t=f(""),i=f("");t.value='<a style="color:#00AECF;"',i.value='<ul style="list-style: disc !important; margin-left: 3.5rem !important; padding: 0;"';const n=be(),o=f();return Gt(()=>{var r;const s=document.getElementsByName("askQuestion"),A=Array.from(s);s.length&&((r=A==null?void 0:A.pop())==null||r.scrollIntoView({behavior:"smooth",block:"center"}))}),bA(()=>{var r;const s=document.getElementsByName("askQuestion"),A=Array.from(s);s.length&&((r=A==null?void 0:A.pop())==null||r.scrollIntoView({behavior:"smooth",block:"center"}))}),(s,A)=>(Q(),R("div",{ref_key:"nestedElement",ref:o,class:"smooth-scroll overflow-auto md:px-6 px-2"},[ne(OK),(Q(!0),R(Le,null,Qt(m(n).conversations,(r,a)=>(Q(),R("div",{key:a},[r.question?(Q(),R("div",ZK,[ne(YK,{question:r.question,c2question:r.c2question,"show-feedback":r.showFeedback,id:`qId${a}`,name:"askQuestion","que-id":a},null,8,["question","c2question","show-feedback","id","que-id"])])):Me("",!0),r.answer?(Q(),R("div",XK,[ne(GK,{question:r==null?void 0:r.question,c2question:r==null?void 0:r.c2question,"show-sources":r==null?void 0:r.showSources,questionId:r.id,answer:r.answer.replaceAll("<a",m(t)).replaceAll("<ul",m(i)),"show-feedback":r.showFeedback,"related-ques":r.relatedQues,"options-array":r.optionsArray,"ans-id":a},null,8,["question","c2question","show-sources","questionId","answer","show-feedback","related-ques","options-array","ans-id"])])):Me("",!0)]))),128)),m(n).dotLoader?(Q(),R("div",_K,[ne(WK)])):Me("",!0)],512))}}),Wk="",eF=je($K,[["__scopeId","data-v-e6168dd4"]]),jc=e=>(At("data-v-18fef92d"),e=e(),at(),e),tF={class:"z-3 absolute bottom-0 mt-4 w-full bg-white px-2 md:px-6"},iF={class:"py-2"},nF={class:"flex"},rF={class:"z-1 relative w-full"},oF={class:"relative w-full"},sF={class:"absolute inset-y-0 right-0 flex items-center md:pr-8 pr-3"},AF={key:0},aF=[jc(()=>h("path",{d:"M15.854.146a.5.5 0 0 1 .11.54l-5.819 14.547a.75.75 0 0 1-1.329.124l-3.178-4.995L.643 7.184a.75.75 0 0 1 .124-1.33L15.314.037a.5.5 0 0 1 .54.11ZM6.636 10.07l2.761 4.338L14.13 2.576 6.636 10.07Zm6.787-8.201L1.591 6.602l4.339 2.76 7.494-7.493Z"},null,-1))],cF={key:1,class:"tooltip"},uF=[jc(()=>h("span",{class:"tooltiptext fontFormattingAMA"},"Waiting for response",-1)),jc(()=>h("img",{class:"w-7 h-7",src:Al,alt:"watingIcon"},null,-1))],lF={class:"flex justify-start"},gF=["placeholder"],EF={class:"flex justify-start items-start text-[#161916]"},hF=jc(()=>h("div",{class:"pt-1 text-start font-sans"},[h("div",{class:"text-xs font-bold text-gray-500 md:text-sm"}," Note: AI-generated response may not be fully accurate; check with experts for critical information. ")],-1)),CF=Re({__name:"NewQuestionAMA",setup(e){const t=be(),i=lt();t.question="";const n=f(null),o=f(!1),s=f(Wt),A=f(!1);Gt(()=>{n.value.focus()});const a=f((l=>new URLSearchParams(window.location.search).get(l)||"")("amaId"));console.log("amaId",a.value);const c=l=>{const g=l.length;s.value=Wt-g,o.value=g>=Wt},u=async()=>{var l,g,E,C;try{if(t.question.trim().length<1){i.setError("Please enter answer!");return}if(t.amaQuestionsLeft<=0){i.setError("You have exhausted your question limit!");return}A.value=!0,t.dotLoader=!0;const d={question:t==null?void 0:t.question};t.conversations.push(d);const S=f("");S.value=t==null?void 0:t.question,t.question="";const I={skillId:a.value,question:S.value,past_messages:t.past_messages},p=await Yt("/amaBotResponse",I);t.addConversation((l=p.data)==null?void 0:l.body,"new"),A.value=!1,t.dotLoader=!1}catch(d){if(console.error(d),t.dotLoader=!1,A.value=!1,Ne.isAxiosError(d)){const S=d;console.log("Error found!"),console.error((g=S.response)==null?void 0:g.data),i.setError((C=(E=S.response)==null?void 0:E.data)==null?void 0:C.message)}else i.setError("There was an issue, please contact helpmate")}};return(l,g)=>(Q(),R("div",tF,[h("div",iF,[h("div",nF,[h("div",rF,[h("div",oF,[h("div",sF,[A.value?(Q(),R("div",cF,uF)):(Q(),R("div",AF,[(Q(),R("svg",{onClick:g[0]||(g[0]=E=>u()),xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",class:"bi bi-send ml-2 h-7 w-7 rotate-45 rounded",viewBox:"0 0 16 16"},aF))]))]),h("div",lF,[Te(h("input",{onKeyup:[g[1]||(g[1]=Tu(E=>A.value?"":u(),["enter"])),g[3]||(g[3]=E=>c(m(t).question))],"onUpdate:modelValue":g[2]||(g[2]=E=>m(t).question=E),class:"fontFormattingAMA text-[0.8125rem] md:text-[0.9375rem] rounded-lg flex w-full border border-genpact-darkest-teal py-4 pl-7 pr-16",placeholder:`Ask me about ${m(t).amaSkillName||"Skill Name"}`,type:"text",ref_key:"AiSearch",ref:n},null,40,gF),[[qe,m(t).question]])])]),h("div",EF,de(m(t).amaQuestionsLeft)+" questions remaining for the day ",1),hF])])])]))}}),$k="",IF=je(CF,[["__scopeId","data-v-18fef92d"]]),Ag=e=>(At("data-v-944ca5e3"),e=e(),at(),e),pF=Ag(()=>h("div",{class:"max-h-screen overflow-auto md:p-6 p-3 flex flex-col items-center justify-center gap-4 text-[#161916]"},[h("div",{class:"text-2xl font-[700]"},"Assessment Access Required"),h("h3",{className:"text-lg font-medium my-6 text-center text-gray-500"}," You don't have access to this assessment. Please contact to administrator ")],-1)),dF={key:1,className:"h-screen flex flex-col items-stretch"},SF={class:"z-20"},MF=Ag(()=>h("div",{class:"mt-6"},null,-1)),BF={class:"flex h-full items-stretch overflow-hidden"},vF={class:"mx-auto w-11/12 bg-white"},fF={class:"relative flex h-full w-full flex-col items-stretch overflow-hidden"},wF=Ag(()=>h("div",{class:"mt-[160px]"},null,-1)),QF={class:"relative"},RF=Re({__name:"AssessmentAMA",setup(e){const t=f(!0),i=f(!1),n=be(),o=lt();f("");const A=f((a=>new URLSearchParams(window.location.search).get(a)||"")("amaId"));n.amaSkillId=A.value??"",Gt(async()=>{t.value=!0,await r(),t.value=!1});const r=async()=>{var a,c,u,l,g,E,C;try{if(A.value===null)throw{response:{status:424,data:{message:"Invalid URL"}}};console.log("before calling get learner");const d=await oi(`/getLearnerData?amaSkillId=${A.value}`);n.initialize(d.data),n.amaQuestionsLeft=(a=d==null?void 0:d.data)==null?void 0:a.questionsLeftAIGC,n.amaSkillName=(c=d==null?void 0:d.data)==null?void 0:c.skillName,t.value=!1}catch(d){if(console.error(d),t.value=!1,Ne.isAxiosError(d)&&((u=d.response)!=null&&u.status)||d&&typeof d=="object"&&"response"in d&&d.response&&typeof d.response=="object"&&"status"in d.response&&d.response.status){const S=d;if(console.log("Error found!"),console.error((l=S.response)==null?void 0:l.data),((g=S.response)==null?void 0:g.status)===424||((E=S.response)==null?void 0:E.status)===425){i.value=!0;return}o.setError(((C=S.response)==null?void 0:C.data).message)}else o.setError("There was an issue, please contact helpmate")}};return(a,c)=>(Q(),R("section",null,[ne(dr,{"is-visible":i.value},{default:li(()=>[pF]),_:1},8,["is-visible"]),h("div",null,[t.value?(Q(),Qi(DS,{key:0})):(Q(),R("main",dF,[h("div",SF,[ne(wK)]),MF,h("div",BF,[h("div",vF,[h("div",fF,[ne(eF),wF]),h("div",QF,[ne(IF)])])])]))])]))}}),e1="",mF=Object.freeze(Object.defineProperty({__proto__:null,default:je(RF,[["__scopeId","data-v-944ca5e3"]])},Symbol.toStringTag,{value:"Module"})),hA=e=>(At("data-v-e4e697db"),e=e(),at(),e),DF={class:"playground h-full"},yF={class:"grid grid-cols-5 gap-8 px-5 items-stretch"},TF={class:"col-span-4 mt-10"},LF=hA(()=>h("label",{for:"EmpID",class:"block text-base font-bold text-gray-900"},"EmpID",-1)),OF=hA(()=>h("label",{for:"EmpName",class:"block text-base font-bold text-gray-900"},"EmpName",-1)),UF=hA(()=>h("label",{for:"EmpDesignation",class:"block text-base font-bold text-gray-900 mt-6"},"EmpDesignation",-1)),NF={class:"flex flex-col items-end gap-2"},KF={key:0,id:"button",class:"cursor-pointer"},FF={key:1},GF=[hA(()=>h("img",{class:"w-10 h-10 block mx-auto loadercss",src:Di,alt:"Loader Gif"},null,-1))],xF={class:"mb-12"},jF=hA(()=>h("label",{for:"response",class:"block text-base font-bold text-gray-900 mb-1"},"Response",-1)),kF={class:"line-break min-h-[20vh] p-4 text-sm text-gray-900 bg-gray-50 rounded-lg border border-gray-300 w-full shadow-sm focus:outline-none focus:border-genpact-blue-box focus:ring-genpact-blue-box focus:ring-1"},YF=Re({__name:"Testcase",setup(e){const t=f(!1),i=f(""),n=f(""),o=f(""),s=f(""),A=lt();Gt(()=>{r()});const r=async()=>{var a,c;try{t.value=!0;const u=await oi("http://localhost:7071/api/fetchCompletionSubDemo1");console.log(u.data),s.value=(a=u.data)==null?void 0:a.body,t.value=!1}catch(u){if(console.log(u),t.value=!1,Ne.isAxiosError(u)){const l=u;A.setError(((c=l.response)==null?void 0:c.data).message)}else A.setError("There was an issue, contact to helpmate")}};return(a,c)=>(Q(),R("div",DF,[h("div",yF,[h("div",TF,[h("div",null,[LF,Te(h("textarea",{"onUpdate:modelValue":c[0]||(c[0]=u=>i.value=u),id:"EmpID",rows:"1",class:"w-full mt-1 p-2.5 text-sm text-gray-900 bg-gray-50 rounded-lg border border-gray-300 shadow-sm focus:outline-none focus:border-genpact-blue-box focus:ring-genpact-blue-box focus:ring-1 resize-none",placeholder:"Write here..."},null,512),[[qe,i.value]])]),h("div",null,[OF,Te(h("textarea",{"onUpdate:modelValue":c[1]||(c[1]=u=>n.value=u),id:"EmpName",rows:"1",class:"w-full mt-1 p-2.5 text-sm text-gray-900 bg-gray-50 rounded-lg border border-gray-300 shadow-sm focus:outline-none focus:border-genpact-blue-box focus:ring-genpact-blue-box focus:ring-1 resize-none",placeholder:"Write here..."},null,512),[[qe,n.value]])]),h("div",null,[UF,h("div",NF,[Te(h("textarea",{"onUpdate:modelValue":c[2]||(c[2]=u=>o.value=u),id:"EmpDesignation",rows:"1",class:"w-full p-2.5 text-sm text-gray-900 bg-gray-50 rounded-lg border border-gray-300 shadow-sm focus:outline-none focus:border-genpact-blue-box focus:ring-genpact-blue-box focus:ring-1 resize-none",placeholder:"Write here..."},null,512),[[qe,o.value]]),t.value?(Q(),R("div",FF,GF)):(Q(),R("button",KF,[ne(m(BC),{class:"w-7 h-7 fill-genpact-blue-box"})]))])]),h("div",xF,[jF,h("div",kF,de(s.value),1)])])])]))}}),n1="",zF=Object.freeze(Object.defineProperty({__proto__:null,default:je(YF,[["__scopeId","data-v-e4e697db"]])},Symbol.toStringTag,{value:"Module"})),PF={},bF={className:"flex justify-between items-center gap-4 h-14"},JF=[h("div",{class:"text-white font-bold md:text-xl text-base"}," AI Guru Skill Data ",-1),h("img",{class:"md:w-36 w-20",src:lo},null,-1)];function HF(e,t){return Q(),R("div",bF,JF)}const qF=je(PF,[["render",HF]]),VF={class:"bg-genpact-blue-box w-full px-5 mb-4"},WF={key:0},ZF={class:"flex justify-between items-start text-lg px-6"},XF=h("div",null,null,-1),_F={class:"flex justify-start items-center text-white bg-genpact-darkest-blue rounded-lg py-2 px-4 cursor-pointer"},$F={class:"flex justify-start items-start w-full px-6 py-3"},eG=h("div",{class:"md:w-1/2"},null,-1),tG={class:"relative flex justify-start items-end border border-gray-300 md:rounded-full rounded-lg md:w-1/2 w-full"},iG={class:"absolute inset-y-0 left-5 flex items-center"},nG={class:"flex justify-between flex-col md:flex-row items-center w-full border-none py-1 px-1 md:px-2 md:py-2 text-sm md:border md:border-gray-300 rounded-full"},rG={class:"flex justify-start flex-wrap md:gap-2 items-start ml-10 space-y-2 md:space-y-0 md:space-x-1 mx-auto"},oG={class:"flex justify-start items-center"},sG=h("div",{class:"flex items-center"},[h("div",{class:"text-gray-500 font-medium text-sm px-1 py-2 md:px-2 md:py-2 hidden md:flex"}," | ")],-1),AG={class:"flex-grow md:flex-grow-0"},aG={class:"px-6"},cG=h("div",{class:"flex justify-start items-start text-xl font-bold py-1 italic"}," Current Topic List ",-1),uG={class:"w-full relative overflow-x-auto rounded-lg border border-gray-200 max-h-[630px]"},lG={class:"table-auto w-full text-sm text-left rtl:text-right rounded-lg"},gG=h("thead",{class:"text-sm text-center md:text-base text-gray-700 uppercase bg-gray-200 top-0 sticky z-10"},[h("tr",null,[h("th",{scope:"col",class:"px-6 py-3"},"Topic name"),h("th",{scope:"col",class:"px-6 py-3"},"Description"),h("th",{scope:"col",class:"px-6 py-3"},"Knowledge corpus"),h("th",{scope:"col",class:"px-6 py-3"},"Edit")])],-1),EG={class:"px-3 py-4 font-medium text-gray-900"},hG={class:"px-3 py-4"},CG={class:"px-3 py-4 text-center"},IG={class:"px-1.5 py-4 text-center"},pG=["onClick"],dG={key:1,id:"index",class:"flex justify-center items-center bg-genpact-darkest-blue text-white font-bold text-center rounded-lg px-6 py-2 hover:-translate-y-1 hover:scale-100 duration-300"},SG=[h("img",{class:"w-6 h-6 block loadercss",src:Di,alt:"Loader Gif"},null,-1)],yS=Object.freeze(Object.defineProperty({__proto__:null,default:Re({__name:"SkillData",setup(e){const t=f([]),i=f(),n=f(""),o=f(""),s=f(!1),A=f([!0]),r=be(),a=lt(),c=na(),u=f(""),l=()=>{try{u.value==="user"?(sessionStorage.setItem("dataViewAccess","true"),sessionStorage.setItem("role","user"),c.replace({name:"EditSkillData"})):u.value==="admin"&&(sessionStorage.setItem("dataViewAccess","true"),sessionStorage.setItem("role","admin"),c.replace({name:"EditSkillAdminData"})),r.isTopicPending=!1,r.topicNameForSkillData="",r.descriptionForSkillData="",r.offeringTypeForSkillData="",r.enableInputbox=!0}catch{a.setError("Invalid Router!!")}},g=async(I,p)=>{var M,v,T;try{console.log("isTopicPending------->",r.isTopicPending),r.topicNameForSkillData=I.Topic,r.descriptionForSkillData=I.Description,r.offeringTypeForSkillData=I.OfferingType,r.enableInputbox=!1,A.value[p]=!1;const O=await oi(`/fetchTempTopic?Topic=${r.topicNameForSkillData}`);r.isTopicPending=!1,console.log("response array length------->",(M=O==null?void 0:O.data)==null?void 0:M.length),((v=O==null?void 0:O.data)==null?void 0:v.length)>0&&(r.isTopicPending=!0),A.value[p]=!0,u.value==="user"?(sessionStorage.setItem("dataViewAccess","true"),sessionStorage.setItem("role","user"),c.replace({name:"EditSkillData"})):u.value==="admin"&&(sessionStorage.setItem("dataViewAccess","true"),sessionStorage.setItem("role","admin"),c.replace({name:"EditSkillAdminData"}))}catch(O){if(console.error(O),Ne.isAxiosError(O)){const F=O;a.setError(((T=F.response)==null?void 0:T.data).message)}else a.setError("There was an issue with route")}},E=async()=>{var I,p,M,v,T,O;try{const F=await oi("/FetchSkillData");console.log("role value ",(I=F==null?void 0:F.data)==null?void 0:I.role),i.value=((p=F==null?void 0:F.data)==null?void 0:p.body)||[],u.value=(M=F==null?void 0:F.data)==null?void 0:M.role,t.value=i.value,console.log("length",(v=F==null?void 0:F.data)==null?void 0:v.body),console.log("data",(T=F==null?void 0:F.data)==null?void 0:T.body)}catch(F){if(console.error(F),Ne.isAxiosError(F)){const D=F;a.setError(((O=D.response)==null?void 0:O.data).message)}else a.setError("There was an issue while fetching data")}},C=I=>{console.log(I.target.value),I.target.value===""&&(t.value=i.value),console.log("Invoked topic name Search"),t.value=i.value.filter(p=>p.Topic.toLowerCase().includes(I.target.value.toLowerCase()))},d=I=>{console.log(I.target.value),I.target.value===""&&(t.value=i.value),console.log("Invoked Knowledge Corpus Search"),t.value=i.value.filter(p=>p.OfferingType.toLowerCase().includes(I.target.value.toLowerCase()))},S=()=>{n.value="",o.value="",t.value=i.value};return Gt(async()=>{await E(),s.value=!0,A.value=Array(t.value.length).fill(!0),console.log("array",A.value)}),(I,p)=>(Q(),R(Le,null,[h("nav",VF,[ne(qF)]),s.value?(Q(),R("div",WF,[h("div",ZF,[XF,h("div",_F,[ne(m(FQ),{class:"w-7 h-7 mr-1"}),h("button",{onClick:l,class:"font-bold"},"Add New Topic")])]),h("div",$F,[eG,h("div",tG,[h("div",iG,[ne(m(KQ),{class:"w-5 h-5 mr-5 hidden md:flex"})]),h("div",nG,[h("div",rG,[h("div",oG,[Te(h("input",{id:"topic-search",type:"search",onInput:C,"onUpdate:modelValue":p[0]||(p[0]=M=>n.value=M),class:"text-gray-500 font-medium text-sm px-2 py-2 w-full md:w-52 rounded-lg shadow-sm border-none border-gray-500 focus:outline-none focus:border focus:border-genpact-blue-box md:ml-2",placeholder:"enter topic name "},null,544),[[qe,n.value]])]),sG,h("div",AG,[Te(h("input",{id:"offering-search",type:"search",onInput:d,"onUpdate:modelValue":p[1]||(p[1]=M=>o.value=M),class:"text-gray-500 font-medium text-sm px-2 py-2 md:w-52 w-full rounded-lg shadow-sm border-none border-gray-500 focus:outline-none focus:border focus:border-genpact-blue-box",placeholder:"enter knowledge corpus"},null,544),[[qe,o.value]])])]),h("div",{class:"mt-2 md:mt-0"},[h("button",{onClick:S,type:"reset",class:"text-white bg-genpact-blue-box hover:bg-genpact-darkest-blue font-medium rounded-full text-base px-8 py-1"}," Reset ")])])])]),h("div",aG,[cG,h("div",uG,[h("table",lG,[gG,h("tbody",null,[(Q(!0),R(Le,null,Qt(t.value,(M,v)=>(Q(),R("tr",{key:v,class:"odd:bg-white even:bg-gray-100"},[h("th",EG,de(M.Topic||"title"),1),h("td",hG,de(M.Description||"desc"),1),h("td",CG,de(M.OfferingType||"Knowledge Corpus"),1),h("td",IG,[A.value[v]?(Q(),R("button",{key:0,id:"index",onClick:T=>g(M,v),class:"hover:bg-genpact-darkest-blue bg-genpact-blue-box text-white font-bold py-2 px-6 rounded-lg hover:-translate-y-1 hover:scale-100 duration-300"}," edit ",8,pG)):(Q(),R("div",dG,SG))])]))),128))])])])])])):(Q(),Qi(ol,{key:1}))],64))}})},Symbol.toStringTag,{value:"Module"})),MG={className:"flex justify-between items-center gap-4 h-14"},BG=h("div",{class:"font-bold text-base md:text-xl"},"Back",-1),vG=h("div",{class:"text-white font-bold md:text-xl text-base"},"AI Guru Edit Skill Data",-1),fG=h("img",{class:"md:w-36 w-20",src:lo},null,-1),wG=Re({__name:"HeaderForEditSkillData",setup(e){const t=na(),i=()=>{Jr(()=>{sessionStorage.removeItem("dataViewAccess")}),t.push({name:"SkillData"}),sessionStorage.removeItem("dataViewAccess"),sessionStorage.removeItem("role")};return(n,o)=>(Q(),R("div",MG,[h("div",{onClick:i,class:"flex justify-start items-center text-white cursor-pointer"},[ne(m(MC),{class:"md:w-9 w-5 h-5 md:h-9 mr-1"}),BG]),vG,fG]))}}),Gi=e=>(At("data-v-18de1cf9"),e=e(),at(),e),QG={class:"bg-genpact-blue-box w-full px-5 mb-6"},RG={class:"grid grid-cols-5 gap-8 p-10 items-stretch"},mG=Gi(()=>h("div",{class:"col-span-1 text-right"},[h("label",{for:"topic",class:"block text-lg font-bold text-gray-900 mb-1 italic"},[We("Topic Name "),h("span",{class:"label"},"*")])],-1)),DG={class:"col-span-4"},yG=["disabled"],TG=Gi(()=>h("div",{class:"col-span-1 text-right"},[h("label",{for:"description",class:"block text-lg font-bold text-gray-900 mb-1 italic"},[We("Description "),h("span",{class:"label"},"*")])],-1)),LG={class:"col-span-4"},OG=Gi(()=>h("div",{class:"col-span-1 text-right"},[h("label",{for:"Knowledge Corpus",class:"block text-lg font-bold text-gray-900 mb-1 italic"},[We("Knowledge Corpus "),h("span",{class:"label"},"*")])],-1)),UG={class:"col-span-4"},NG=Gi(()=>h("div",{class:"col-span-1"},null,-1)),KG={class:"col-span-4"},FG={class:"md:flex block justify-between items-center space-y-2"},GG=["disabled"],xG={key:1,class:"flex justify-center items-center text-center bg-genpact-darkest-blue text-white rounded-md w-40 px-4 py-2"},jG=[Gi(()=>h("img",{class:"w-6 h-6 block loadercss",src:Di,alt:"Loader Gif"},null,-1))],kG=["disabled"],YG={key:3,class:"flex justify-center items-center text-center bg-genpact-darkest-blue text-white rounded-md w-40 px-10 py-2"},zG=[Gi(()=>h("img",{class:"w-6 h-6 block loadercss",src:Di,alt:"Loader Gif"},null,-1))],PG=Gi(()=>h("div",{class:"col-span-1"},null,-1)),bG={key:0,class:"col-span-4"},JG=[Gi(()=>h("div",{class:"p-2 items-center text-lg font-bold bg-gray-200"}," This topic is under review and cannot be submitted again at this moment ",-1))],HG={key:0,class:"pl-16 pr-8 py-2"},qG={class:"w-full relative overflow-x-auto rounded-lg border border-gray-200 max-h-[550px]"},VG={class:"table-auto w-full text-sm text-left rtl:text-right rounded-lg"},WG=Gi(()=>h("thead",{class:"text-sm text-center md:text-base text-gray-700 uppercase bg-gray-200 top-0 sticky z-10"},[h("tr",null,[h("th",{scope:"col",class:"px-6 py-3"},"Topic name"),h("th",{scope:"col",class:"px-6 py-3"},"Description"),h("th",{scope:"col",class:"px-6 py-3"},"Knowledge Corpus"),h("th",{scope:"col",class:"px-6 py-3"},"Score")])],-1)),ZG={key:0,class:"px-3 py-4 font-medium text-gray-900 text-center"},XG={key:1,class:"px-3 py-4"},_G={key:2,class:"px-3 py-4 text-center"},$G={key:3,class:"px-3 py-4 text-center"},ex={class:"absolute top-0 md:left-20 md:right-20 left-12 right-12 flex justify-center items-center mx-auto z-[100]"},tx={class:"w-full rounded-md px-3 text-center mt-4 bg-green-500 py-2 text-white"},ix=Re({__name:"EditSkillData",setup(e){const t=be(),i=lt(),n=f(!0),o=f(!0),s=f(!1),A=f(""),r=f(""),a=f(!1),c=f(!1),u=f(),l=f(),g=f([]),E=async()=>{var S,I,p,M,v,T,O;try{const F={question:t.descriptionForSkillData};console.log("question",r.value),n.value=!1;const D=await Yt("/SearchSkillTags",F);console.log("abc",(S=D==null?void 0:D.data)==null?void 0:S.body),l.value=(p=(I=D==null?void 0:D.data)==null?void 0:I.body)==null?void 0:p.length,console.log("ARRAY LENGTH",l.value),u.value=((M=D==null?void 0:D.data)==null?void 0:M.body)||[],g.value=u.value,console.log("length",(T=(v=D==null?void 0:D.data)==null?void 0:v.body)==null?void 0:T.length),console.log("data",D),n.value=!0,a.value=!0,c.value=!0,console.log("showSubmitButton",c.value)}catch(F){if(console.error(F),n.value=!0,Ne.isAxiosError(F)){const D=F;i.setError(((O=D.response)==null?void 0:O.data).message)}else i.setError("We ran into an issue while fetching duplicate values.")}},C=async()=>{var S;try{const I={Topic:t.topicNameForSkillData,Description:t.descriptionForSkillData,OfferingType:t.offeringTypeForSkillData,DuplicateExists:l.value>0?1:0};o.value=!1,console.log("payload-=====>",I);const p=await Yt("/InsertIntoTempSkillFile",I);console.log("data",p),A.value="Data Submitted Successfully!",o.value=!0,d()}catch(I){if(console.error(I),o.value=!0,Ne.isAxiosError(I)){const p=I;i.setError(((S=p.response)==null?void 0:S.data).message)}else i.setError("There was an issue while inserting data")}},d=()=>{s.value=!0,setTimeout(()=>{s.value=!1,Jr(()=>{sessionStorage.removeItem("dataViewAccess")}),Cr.push({name:"SkillData"}),sessionStorage.removeItem("dataViewAccess"),sessionStorage.removeItem("role")},3e3),c.value=!1};return(S,I)=>(Q(),R(Le,null,[h("nav",QG,[ne(wG)]),h("div",RG,[mG,h("div",DG,[Te(h("input",{disabled:m(t).enableInputbox!==!0,class:Ee([m(t).enableInputbox!==!0?"cursor-not-allowed fill-gray-400":"","w-full p-2.5 text-sm text-gray-900 bg-gray-50 rounded-lg border border-gray-300 shadow-sm focus:outline-none focus:border-genpact-blue-box focus:ring-genpact-blue-box focus:ring-1"]),type:"text","onUpdate:modelValue":I[0]||(I[0]=p=>m(t).topicNameForSkillData=p),id:"topic",placeholder:"Write here...",required:""},null,10,yG),[[qe,m(t).topicNameForSkillData]])]),TG,h("div",LG,[Te(h("textarea",{"onUpdate:modelValue":I[1]||(I[1]=p=>m(t).descriptionForSkillData=p),onInput:I[2]||(I[2]=p=>c.value=!1),type:"text",id:"description",rows:"5",class:"w-full p-2.5 text-sm text-gray-900 bg-gray-50 rounded-lg border border-gray-300 shadow-sm focus:outline-none focus:border-genpact-blue-box focus:ring-genpact-blue-box focus:ring-1",placeholder:"Write here...",required:""},null,544),[[qe,m(t).descriptionForSkillData]])]),OG,h("div",UG,[Te(h("input",{"onUpdate:modelValue":I[3]||(I[3]=p=>m(t).offeringTypeForSkillData=p),type:"text",id:"offeringType",class:"w-full p-2.5 text-sm text-gray-900 bg-gray-50 rounded-lg border border-gray-300 shadow-sm focus:outline-none focus:border-genpact-blue-box focus:ring-genpact-blue-box focus:ring-1",placeholder:"Write here...",required:""},null,512),[[qe,m(t).offeringTypeForSkillData]])]),NG,h("div",KG,[h("div",FG,[n.value?(Q(),R("button",{key:0,disabled:m(t).isTopicPending===!0,class:Ee([m(t).isTopicPending===!0?"cursor-not-allowed bg-gray-600":"cursor-pointer bg-genpact-darkest-blue","text-center whitespace-nowrap text-white w-40 px-4 py-2 rounded-md font-bold"]),onClick:E,type:"button"}," Duplicate Check ",10,GG)):(Q(),R("div",xG,jG)),o.value?(Q(),R("button",{key:2,disabled:c.value!==!0,class:Ee([c.value!==!0?"cursor-not-allowed bg-gray-600":"cursor-pointer bg-genpact-darkest-blue","text-center text-white w-40 px-10 py-2 rounded-md font-bold"]),onClick:C,type:"submit"}," Submit ",10,kG)):(Q(),R("div",YG,zG))])]),PG,m(t).isTopicPending?(Q(),R("div",bG,JG)):Me("",!0)]),a.value?(Q(),R("div",HG,[h("div",qG,[h("table",VG,[WG,h("tbody",null,[(Q(!0),R(Le,null,Qt(g.value,(p,M)=>(Q(),R("tr",{key:M,class:"odd:bg-white even:bg-gray-100"},[p.Topic!==m(t).topicNameForSkillData?(Q(),R("th",ZG,de(p.Topic||"title"),1)):Me("",!0),p.Topic!==m(t).topicNameForSkillData?(Q(),R("td",XG,de(p.Description||"desc"),1)):Me("",!0),p.Topic!==m(t).topicNameForSkillData?(Q(),R("td",_G,de(p.OfferingType||"Knowledge Corpus"),1)):Me("",!0),p.Topic!==m(t).topicNameForSkillData?(Q(),R("td",$G,de(p.new_tag),1)):Me("",!0)]))),128))])])])])):Me("",!0),Te(h("div",ex,[h("div",tx,de(A.value),1)],512),[[ar,s.value]])],64))}}),g1="",nx=Object.freeze(Object.defineProperty({__proto__:null,default:je(ix,[["__scopeId","data-v-18de1cf9"]])},Symbol.toStringTag,{value:"Module"})),rx={},ox={className:"flex justify-between items-center gap-4 h-14"},sx=[h("div",{class:"text-white font-bold md:text-xl text-base"}," AI Guru Skill Automation ",-1),h("img",{class:"md:w-36 w-20",src:lo},null,-1)];function Ax(e,t){return Q(),R("div",ox,sx)}const ax=je(rx,[["render",Ax]]),cx={class:"bg-genpact-blue-box w-full px-5 mb-4"},ux={key:0},lx={class:"w-full px-6 py-1"},gx=h("div",{class:"flex justify-start items-start text-xl font-bold py-1 italic"}," Topic Update Request ",-1),Ex={class:"w-full relative overflow-x-auto rounded-lg border border-gray-200 max-h-[630px]"},hx={class:"table-auto w-full text-sm text-left rtl:text-right rounded-lg"},Cx=h("thead",{class:"text-sm text-center md:text-base font-bold text-gray-700 uppercase bg-gray-200 top-0 sticky z-10"},[h("tr",null,[h("th",{scope:"col",class:"px-6 py-3"},"Topic name"),h("th",{scope:"col",class:"px-6 py-3"},"Description"),h("th",{scope:"col",class:"px-6 py-3"},"Knowledge Corpus"),h("th",{scope:"col",class:"px-6 py-3"},"Duplicate Exist"),h("th",{scope:"col",class:"px-6 py-3"},"View")])],-1),Ix={class:"px-3 py-4 font-medium text-gray-900 text-center"},px={class:"px-3 py-4"},dx={class:"px-3 py-4 text-center"},Sx={class:"px-2 py-4 text-center"},Mx={class:"px-2 py-4 text-gray-500 hover:text-genpact-darkest-blue"},Bx=Object.freeze(Object.defineProperty({__proto__:null,default:Re({__name:"SkillAutomation",setup(e){const t=f([]),i=f(),n=f(!1),o=be(),s=lt(),A=na(),r=c=>{sessionStorage.setItem("dataViewAccess","true"),sessionStorage.setItem("role","skillAutomation"),A.replace({name:"EditSkillAdminData"}),o.topicNameForSkillData=c.Topic,o.descriptionForSkillData=c.Description,o.offeringTypeForSkillData=c.OfferingType,o.enableInputbox=!1},a=async()=>{var c,u;try{const l=await oi("/sqlTest");i.value=((c=l==null?void 0:l.data)==null?void 0:c.body)||[],t.value=i.value,console.log("length",l.data.length),console.log("data",l.data)}catch(l){if(console.error(l),Ne.isAxiosError(l)){const g=l;s.setError(((u=g.response)==null?void 0:u.data).message)}else s.setError("There was an issue while fetching data")}};return Gt(async()=>{await a(),n.value=!0}),(c,u)=>(Q(),R(Le,null,[h("nav",cx,[ne(ax)]),n.value?(Q(),R("div",ux,[h("div",lx,[gx,h("div",Ex,[h("table",hx,[Cx,h("tbody",null,[(Q(!0),R(Le,null,Qt(t.value,(l,g)=>(Q(),R("tr",{key:g,class:"odd:bg-white even:bg-gray-100"},[h("th",Ix,de(l.Topic||"title"),1),h("td",px,de(l.Description||"desc"),1),h("td",dx,de(l.OfferingType||"Knowledge Corpus"),1),h("td",Sx,de(l.DuplicateExists),1),h("td",Mx,[ne(m(UQ),{onClick:E=>r(l),class:"w-8 h-8 text-center cursor-pointer hover:-translate-y-1 hover:scale-110 duration-300"},null,8,["onClick"])])]))),128))])])])])])):(Q(),Qi(ol,{key:1}))],64))}})},Symbol.toStringTag,{value:"Module"})),vx={className:"flex justify-between items-center gap-4 h-14"},fx=h("div",{class:"font-bold text-base md:text-xl"},"Back",-1),wx=h("div",{class:"text-white font-bold md:text-xl text-base"},"AI Guru Edit Skill Admin Data",-1),Qx=h("img",{class:"md:w-36 w-20",src:lo},null,-1),Rx=Re({__name:"HeaderForEditSKillAdminDatas",setup(e){const t=na(),i=()=>{const n=sessionStorage.getItem("role");console.log("role",n),n==="user"?t.push({name:"SkillData"}):n==="admin"?t.push({name:"SkillData"}):t.push({name:"SkillAutomation"}),sessionStorage.removeItem("dataViewAccess"),sessionStorage.removeItem("role")};return(n,o)=>(Q(),R("div",vx,[h("div",{onClick:i,class:"flex justify-start items-center text-white cursor-pointer"},[ne(m(MC),{class:"md:w-9 w-5 h-5 md:h-9 mr-1"}),fx]),wx,Qx]))}}),ci=e=>(At("data-v-ecf2c818"),e=e(),at(),e),mx={class:"bg-genpact-blue-box w-full px-5 mb-6"},Dx={class:"grid grid-cols-5 gap-8 p-10 items-stretch"},yx=ci(()=>h("div",{class:"col-span-1 text-right"},[h("label",{for:"topic",class:"block text-lg font-bold text-gray-900 mb-1 italic"},[We("Topic Name "),h("span",{class:"label"},"*")])],-1)),Tx={class:"col-span-4"},Lx=["disabled"],Ox=ci(()=>h("div",{class:"col-span-1 text-right"},[h("label",{for:"description",class:"block text-lg font-bold text-gray-900 mb-1 italic"},[We("Description "),h("span",{class:"label"},"*")])],-1)),Ux={class:"col-span-4"},Nx=ci(()=>h("div",{class:"col-span-1 text-right"},[h("label",{for:"Knowledge Corpus",class:"block text-lg font-bold text-gray-900 mb-1 italic"},[We("Knowledge Corpus "),h("span",{class:"label"},"*")])],-1)),Kx={class:"col-span-4"},Fx=ci(()=>h("div",{class:"col-span-1"},null,-1)),Gx={class:"col-span-4"},xx={class:"grid md:grid-cols-5 grid-cols-1 justify-start items-center gap-2"},jx={class:"col-span-1"},kx=["disabled"],Yx={key:1,class:"flex justify-center items-center text-center bg-genpact-darkest-blue text-white rounded-md w-40"},zx=[ci(()=>h("img",{class:"w-10 h-10 block loadercss",src:Di,alt:"Loader Gif"},null,-1))],Px=ci(()=>h("div",{class:"col-span-1"},null,-1)),bx=ci(()=>h("div",{class:"col-span-1"},null,-1)),Jx={class:"col-span-1 flex md:justify-end justify-start items-end"},Hx={key:1,class:"flex justify-center items-center text-center w-52 bg-genpact-darkest-blue text-white rounded-md"},qx=[ci(()=>h("img",{class:"w-10 h-10 block loadercss",src:Di,alt:"Loader Gif"},null,-1))],Vx={class:"col-span-1 flex md:justify-end justify-start items-end"},Wx=["disabled"],Zx={key:1,class:"flex justify-center items-center text-center w-52 bg-genpact-darkest-blue text-white rounded-md"},Xx=[ci(()=>h("img",{class:"w-10 h-10 block loadercss",src:Di,alt:"Loader Gif"},null,-1))],_x={class:"pl-16 pr-8 py-2"},$x={class:"w-full relative overflow-x-auto rounded-lg border border-gray-200 max-h-[550px]"},ej={class:"table-auto w-full text-sm text-left rtl:text-right rounded-lg"},tj=ci(()=>h("thead",{class:"text-sm text-center md:text-base text-gray-700 uppercase bg-gray-200 top-0 sticky z-10"},[h("tr",null,[h("th",{scope:"col",class:"px-6 py-3"},"Topic name"),h("th",{scope:"col",class:"px-6 py-3"},"Description"),h("th",{scope:"col",class:"px-6 py-3"},"Knowledge Corpus"),h("th",{scope:"col",class:"px-6 py-3"},"Score")])],-1)),ij={class:"px-3 py-4 font-medium text-gray-900 text-center"},nj={class:"px-3 py-4"},rj={class:"px-3 py-4 text-center"},oj=ci(()=>h("td",{class:"px-3 py-4 text-center"},de("1.05"),-1)),sj={class:"absolute top-0 md:left-20 md:right-20 left-12 right-12 flex justify-center items-center mx-auto z-[100]"},Aj={class:"w-full rounded-md px-3 text-center mt-4 bg-green-500 py-2 text-white"},aj=Re({__name:"EditSkillAdminData",setup(e){const t=be(),i=lt(),n=f(!0),o=f(!0),s=f(!0),A=f(!1),r=f(""),a=f(!1),c=f(!1),u=f(),l=f(),g=f(""),E=f([]),C=async()=>{var p,M,v,T,O,F;try{const D={question:t.descriptionForSkillData};console.log("question",r.value),n.value=!1;const j=await Yt("/SearchSkillTags",D);l.value=(M=(p=j==null?void 0:j.data)==null?void 0:p.body)==null?void 0:M.length,console.log("ARRAY LENGTH",l.value),u.value=((v=j==null?void 0:j.data)==null?void 0:v.body)||[],E.value=u.value,console.log("length",(O=(T=j==null?void 0:j.data)==null?void 0:T.body)==null?void 0:O.length),console.log("data",j),n.value=!0,a.value=!0,c.value=!0,console.log("showSubmitButton",c.value)}catch(D){if(console.error(D),n.value=!0,Ne.isAxiosError(D)){const j=D;i.setError(((F=j.response)==null?void 0:F.data).message)}else i.setError("We ran into an issue while fetching duplicate values.")}},d=async()=>{var p;try{console.log("before rejecting topic"),o.value=!1;const M=encodeURIComponent(t.topicNameForSkillData),v=await oi(`/rejectTempTopic?Topic=${M}`);console.log("encoded topic",M),console.log("response",v),o.value=!0,v.status===200&&(t.topicNameForSkillData="",t.descriptionForSkillData="",t.offeringTypeForSkillData="",console.log("after rejecting topic"),g.value="Data Rejected Successfully!",I())}catch(M){if(console.error(M),o.value=!0,Ne.isAxiosError(M)){const v=M;i.setError(((p=v.response)==null?void 0:p.data).message)}else i.setError("We ran into an issue while rejecting values.")}},S=async()=>{var p;try{const M={Topic:t.topicNameForSkillData,Description:t.descriptionForSkillData,OfferingType:t.offeringTypeForSkillData};console.log("payload-=====>",M),s.value=!1;const v=await Yt("/editMasterSkillFile",M);console.log("data",v),s.value=!0,g.value="Data Submitted Successfully!",I()}catch(M){if(console.error(M),s.value=!0,Ne.isAxiosError(M)){const v=M;i.setError(((p=v.response)==null?void 0:p.data).message)}else i.setError("There was an issue while inserting data")}},I=()=>{A.value=!0,setTimeout(()=>{A.value=!1;const p=sessionStorage.getItem("role");console.log("role",p),p==="user"?Cr.push({name:"SkillData"}):p==="admin"?Cr.push({name:"SkillData"}):Cr.push({name:"SkillAutomation"}),sessionStorage.removeItem("dataViewAccess"),sessionStorage.removeItem("role")},3e3)};return(p,M)=>(Q(),R(Le,null,[h("nav",mx,[ne(Rx)]),h("div",Dx,[yx,h("div",Tx,[Te(h("input",{disabled:m(t).enableInputbox!==!0,class:Ee([m(t).enableInputbox!==!0?"cursor-not-allowed fill-gray-400":"","w-full p-2.5 text-sm text-gray-900 bg-gray-50 rounded-lg border border-gray-300 shadow-sm focus:outline-none focus:border-genpact-blue-box focus:ring-genpact-blue-box focus:ring-1"]),type:"text","onUpdate:modelValue":M[0]||(M[0]=v=>m(t).topicNameForSkillData=v),id:"topic",placeholder:"Write here...",required:""},null,10,Lx),[[qe,m(t).topicNameForSkillData]])]),Ox,h("div",Ux,[Te(h("textarea",{"onUpdate:modelValue":M[1]||(M[1]=v=>m(t).descriptionForSkillData=v),onInput:M[2]||(M[2]=v=>c.value=!1),type:"text",id:"description",rows:"5",class:"w-full p-2.5 text-sm text-gray-900 bg-gray-50 rounded-lg border border-gray-300 shadow-sm focus:outline-none focus:border-genpact-blue-box focus:ring-genpact-blue-box focus:ring-1",placeholder:"Write here...",required:""},null,544),[[qe,m(t).descriptionForSkillData]])]),Nx,h("div",Kx,[Te(h("input",{"onUpdate:modelValue":M[3]||(M[3]=v=>m(t).offeringTypeForSkillData=v),type:"text",id:"offeringType",class:"w-full p-2.5 text-sm text-gray-900 bg-gray-50 rounded-lg border border-gray-300 shadow-sm focus:outline-none focus:border-genpact-blue-box focus:ring-genpact-blue-box focus:ring-1",placeholder:"Write here...",required:""},null,512),[[qe,m(t).offeringTypeForSkillData]])]),Fx,h("div",Gx,[h("div",xx,[h("div",jx,[n.value?(Q(),R("button",{key:0,disabled:m(t).isTopicPending===!0,class:Ee([m(t).isTopicPending===!0?"cursor-not-allowed bg-gray-600":"cursor-pointer bg-genpact-darkest-blue","text-center whitespace-nowrap text-white w-52 px-4 py-2 rounded-md font-bold"]),type:"button",onClick:C}," Duplicate Check ",10,kx)):(Q(),R("div",Yx,zx))]),Px,bx,h("div",Jx,[o.value?(Q(),R("button",{key:0,type:"button",onClick:d,class:"bg-genpact-darkest-blue text-center text-white w-52 px-16 py-2 rounded-md font-bold cursor-pointer"}," Reject ")):(Q(),R("div",Hx,qx))]),h("div",Vx,[s.value?(Q(),R("button",{key:0,type:"submit",disabled:c.value!==!0,class:Ee([c.value!==!0?"cursor-not-allowed bg-gray-600":"cursor-pointer bg-genpact-darkest-blue","text-center text-white w-52 px-2 py-2 rounded-md whitespace-nowrap font-bold"]),onClick:S}," Approve & Submit ",10,Wx)):(Q(),R("div",Zx,Xx))])])])]),Te(h("div",_x,[h("div",$x,[h("table",ej,[tj,h("tbody",null,[(Q(!0),R(Le,null,Qt(E.value,(v,T)=>(Q(),R("tr",{key:T,class:"odd:bg-white even:bg-gray-100"},[h("th",ij,de(v.Topic||"title"),1),h("td",nj,de(v.Description||"desc"),1),h("td",rj,de(v.OfferingType||"Knowledge Corpus"),1),oj]))),128))])])])],512),[[ar,a.value]]),Te(h("div",sj,[h("div",Aj,de(g.value),1)],512),[[ar,A.value]])],64))}}),M1="",cj=Object.freeze(Object.defineProperty({__proto__:null,default:je(aj,[["__scopeId","data-v-ecf2c818"]])},Symbol.toStringTag,{value:"Module"})),uj="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAgEAAAIBCAYAAAD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PnR3OWGHVck7zT+Pe1MyHtFwtcBOb/VYbnlxjXO1uD68zPrsP08bgyxl/3ueQLhm8uLoeOhhXUA2nAxaSDhH/aeYhzNrew/jaP934PUyvoQW5G/ZZN43yOfwu3Tug6XEFNREBC0ozqD+t7Nr2WY4vL/fpPeQ+1a2kfTqF0cQKf8bthIe5e7M+h9/d7W+aH1dQCxGwsHHlfXx5+fGM28wu6aR/P22APp6xgSvhx7ThaW1F/03mcn4xdyKoz+F3d/ub/d3+pulxBTUQAStJ51L/ZYOV1o/pMPX/PGdFPu4FHl9efpn2wJa8Ucy01/mnVo4A3JeOBix2O2Gfw9vSJLNNx9UYJCv+u1CUiYErundDoW/SrYNfnDA7+znTrPA3v0uvwNPVBa/TzWk+Sz/nvv7p7ng/VvJwoHN9ly5Re24i35vLO0+ZbOdz+N29Gwp9k24dvPi4Sv8mNM8lghVIK/KrtNGYDhF/9J6V2LSCni7/Gn//vNWKO01ye/Hg9V89sRGcXuP0ul83eMi/Sj6Ht6VbCJ89rp67/A9aJgIAIChzAgAgKBEAAEGJAAAISgQAQFAiAACCEgEAEJQIAICgRAAABCUCACAoEQAAQYkAAAhKBABAUCIAAIISAQAQlAgAgKBEAAAEJQIAICgRAABBiQAACEoEAEBQIgAAghIBABCUCACAoEQAAAQlAgAgKBEAAEGJAAAISgQAQFAiAACCEgEAEJQIAICgRAAABCUCACAoEQAAQYkAAAhKBABAUCIAAIISAQAQlAgAgKBEAAAEJQIAICgRAABBiQAACEoEAEBQIgAAghIBABCUCACAoEQAAAQlAgAgKBEAAEGJAACIaBiG/w+yjGibxxwNWgAAAABJRU5ErkJggg==",lj={},gj={class:"w-screen h-screen flex justify-center"},Ej=[h("div",{class:"flex flex-col justify-center items-center gap-6"},[h("img",{class:"h-24",src:uj}),h("div",{class:"font-bold text-[50px] capitalize text-gray-600"},"We are under maintenance"),h("div",{class:"font-medium text-lg capitalize text-gray-600"},"please check back later")],-1)];function hj(e,t){return Q(),R("div",gj,Ej)}const TS=Object.freeze(Object.defineProperty({__proto__:null,default:je(lj,[["render",hj]])},Symbol.toStringTag,{value:"Module"}))});
|