@bytexbyte/nxtlinq-ai-agent-sdk 1.4.0 → 1.4.2

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.
@@ -0,0 +1,102 @@
1
+ /*! For license information please see nxtlinq-ai-agent.umd.js.LICENSE.txt */
2
+ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react")):"function"==typeof define&&define.amd?define(["react"],t):"object"==typeof exports?exports.NxtlinqAIAgent=t(require("react")):e.NxtlinqAIAgent=t(e.React)}(this,e=>(()=>{var t,r,i={15:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.List=void 0;const i=r(6209);class n{constructor(e){if(this.privSubscriptionIdCounter=0,this.privAddSubscriptions={},this.privRemoveSubscriptions={},this.privDisposedSubscriptions={},this.privDisposeReason=null,this.privList=[],e)for(const t of e)this.privList.push(t)}get(e){return this.throwIfDisposed(),this.privList[e]}first(){return this.get(0)}last(){return this.get(this.length()-1)}add(e){this.throwIfDisposed(),this.insertAt(this.privList.length,e)}insertAt(e,t){this.throwIfDisposed(),0===e?this.privList.unshift(t):e===this.privList.length?this.privList.push(t):this.privList.splice(e,0,t),this.triggerSubscriptions(this.privAddSubscriptions)}removeFirst(){return this.throwIfDisposed(),this.removeAt(0)}removeLast(){return this.throwIfDisposed(),this.removeAt(this.length()-1)}removeAt(e){return this.throwIfDisposed(),this.remove(e,1)[0]}remove(e,t){this.throwIfDisposed();const r=this.privList.splice(e,t);return this.triggerSubscriptions(this.privRemoveSubscriptions),r}clear(){this.throwIfDisposed(),this.remove(0,this.length())}length(){return this.throwIfDisposed(),this.privList.length}onAdded(e){this.throwIfDisposed();const t=this.privSubscriptionIdCounter++;return this.privAddSubscriptions[t]=e,{detach:()=>(delete this.privAddSubscriptions[t],Promise.resolve())}}onRemoved(e){this.throwIfDisposed();const t=this.privSubscriptionIdCounter++;return this.privRemoveSubscriptions[t]=e,{detach:()=>(delete this.privRemoveSubscriptions[t],Promise.resolve())}}onDisposed(e){this.throwIfDisposed();const t=this.privSubscriptionIdCounter++;return this.privDisposedSubscriptions[t]=e,{detach:()=>(delete this.privDisposedSubscriptions[t],Promise.resolve())}}join(e){return this.throwIfDisposed(),this.privList.join(e)}toArray(){const e=Array();return this.privList.forEach(t=>{e.push(t)}),e}any(e){return this.throwIfDisposed(),e?this.where(e).length()>0:this.length()>0}all(e){return this.throwIfDisposed(),this.where(e).length()===this.length()}forEach(e){this.throwIfDisposed();for(let t=0;t<this.length();t++)e(this.privList[t],t)}select(e){this.throwIfDisposed();const t=[];for(let r=0;r<this.privList.length;r++)t.push(e(this.privList[r],r));return new n(t)}where(e){this.throwIfDisposed();const t=new n;for(let r=0;r<this.privList.length;r++)e(this.privList[r],r)&&t.add(this.privList[r]);return t}orderBy(e){this.throwIfDisposed();const t=this.toArray().sort(e);return new n(t)}orderByDesc(e){return this.throwIfDisposed(),this.orderBy((t,r)=>e(r,t))}clone(){return this.throwIfDisposed(),new n(this.toArray())}concat(e){return this.throwIfDisposed(),new n(this.privList.concat(e.toArray()))}concatArray(e){return this.throwIfDisposed(),new n(this.privList.concat(e))}isDisposed(){return null==this.privList}dispose(e){this.isDisposed()||(this.privDisposeReason=e,this.privList=null,this.privAddSubscriptions=null,this.privRemoveSubscriptions=null,this.triggerSubscriptions(this.privDisposedSubscriptions))}throwIfDisposed(){if(this.isDisposed())throw new i.ObjectDisposedError("List",this.privDisposeReason)}triggerSubscriptions(e){if(e)for(const t in e)t&&e[t]()}}t.List=n},18:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SynthesisRestAdapter=void 0;const i=r(4378),n=r(881),o=r(7778),s=r(7014);t.SynthesisRestAdapter=class{constructor(e,t){let r=e.parameters.getProperty(n.PropertyId.SpeechServiceConnection_Endpoint,void 0);if(!r){const t=e.parameters.getProperty(n.PropertyId.SpeechServiceConnection_Region,"westus"),i=o.ConnectionFactoryBase.getHostSuffix(t);r=e.parameters.getProperty(n.PropertyId.SpeechServiceConnection_Host,`https://${t}.tts.speech${i}`)}this.privUri=`${r}/cognitiveservices/voices/list`;const s=i.RestConfigBase.requestOptions;this.privRestAdapter=new i.RestMessageAdapter(s),this.privAuthentication=t}getVoicesList(e){return this.privRestAdapter.setHeaders(s.HeaderNames.ConnectionId,e),this.privAuthentication.fetch(e).then(e=>(this.privRestAdapter.setHeaders(e.headerName,e.token),this.privRestAdapter.request(i.RestRequestType.Get,this.privUri)))}}},42:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ConnectionRedirectEvent=t.ConnectionMessageSentEvent=t.ConnectionMessageReceivedEvent=t.ConnectionEstablishErrorEvent=t.ConnectionErrorEvent=t.ConnectionClosedEvent=t.ConnectionEstablishedEvent=t.ConnectionStartEvent=t.ConnectionEvent=t.ServiceEvent=void 0;const i=r(2754);class n extends i.PlatformEvent{constructor(e,t,r=i.EventType.Info){super(e,r),this.privJsonResult=t}get jsonString(){return this.privJsonResult}}t.ServiceEvent=n;class o extends i.PlatformEvent{constructor(e,t,r=i.EventType.Info){super(e,r),this.privConnectionId=t}get connectionId(){return this.privConnectionId}}t.ConnectionEvent=o,t.ConnectionStartEvent=class extends o{constructor(e,t,r){super("ConnectionStartEvent",e),this.privUri=t,this.privHeaders=r}get uri(){return this.privUri}get headers(){return this.privHeaders}},t.ConnectionEstablishedEvent=class extends o{constructor(e){super("ConnectionEstablishedEvent",e)}},t.ConnectionClosedEvent=class extends o{constructor(e,t,r){super("ConnectionClosedEvent",e,i.EventType.Debug),this.privReason=r,this.privStatusCode=t}get reason(){return this.privReason}get statusCode(){return this.privStatusCode}},t.ConnectionErrorEvent=class extends o{constructor(e,t,r){super("ConnectionErrorEvent",e,i.EventType.Debug),this.privMessage=t,this.privType=r}get message(){return this.privMessage}get type(){return this.privType}},t.ConnectionEstablishErrorEvent=class extends o{constructor(e,t,r){super("ConnectionEstablishErrorEvent",e,i.EventType.Error),this.privStatusCode=t,this.privReason=r}get reason(){return this.privReason}get statusCode(){return this.privStatusCode}},t.ConnectionMessageReceivedEvent=class extends o{constructor(e,t,r){super("ConnectionMessageReceivedEvent",e),this.privNetworkReceivedTime=t,this.privMessage=r}get networkReceivedTime(){return this.privNetworkReceivedTime}get message(){return this.privMessage}},t.ConnectionMessageSentEvent=class extends o{constructor(e,t,r){super("ConnectionMessageSentEvent",e),this.privNetworkSentTime=t,this.privMessage=r}get networkSentTime(){return this.privNetworkSentTime}get message(){return this.privMessage}},t.ConnectionRedirectEvent=class extends o{constructor(e,t,r,n){super("ConnectionRedirectEvent",e,i.EventType.Info),this.privRedirectUrl=t,this.privOriginalUrl=r,this.privContext=n}get redirectUrl(){return this.privRedirectUrl}get originalUrl(){return this.privOriginalUrl}get context(){return this.privContext}}},143:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TranscriberRecognizer=void 0;const i=r(868),n=r(5245),o=r(881),s=r(9190),a=r(2699);class c extends o.Recognizer{constructor(e,t){const r=e;n.Contracts.throwIfNull(r,"speechTranslationConfig");const i=t;n.Contracts.throwIfNull(i,"audioConfigImpl"),n.Contracts.throwIfNullOrWhitespace(r.speechRecognitionLanguage,o.PropertyId[o.PropertyId.SpeechServiceConnection_RecoLanguage]),super(t,r.properties,new s.TranscriberConnectionFactory),this.privDisposedRecognizer=!1,this.isMeetingRecognizer=!1}get speechRecognitionLanguage(){return n.Contracts.throwIfDisposed(this.privDisposedRecognizer),this.properties.getProperty(o.PropertyId.SpeechServiceConnection_RecoLanguage)}get properties(){return this.privProperties}get authorizationToken(){return this.properties.getProperty(o.PropertyId.SpeechServiceAuthorization_Token)}set authorizationToken(e){n.Contracts.throwIfNullOrWhitespace(e,"token"),this.properties.setProperty(o.PropertyId.SpeechServiceAuthorization_Token,e)}set conversation(e){n.Contracts.throwIfNullOrUndefined(e,"Conversation"),this.isMeetingRecognizer=!1,this.privConversation=e}getConversationInfo(){return n.Contracts.throwIfNullOrUndefined(this.privConversation,"Conversation"),this.privConversation.conversationInfo}set meeting(e){n.Contracts.throwIfNullOrUndefined(e,"Meeting"),this.isMeetingRecognizer=!0,this.privMeeting=e}getMeetingInfo(){return n.Contracts.throwIfNullOrUndefined(this.privMeeting,"Meeting"),this.privMeeting.meetingInfo}IsMeetingRecognizer(){return this.isMeetingRecognizer}startContinuousRecognitionAsync(e,t){(0,i.marshalPromiseToCallbacks)(this.startContinuousRecognitionAsyncImpl(a.RecognitionMode.Conversation),e,t)}stopContinuousRecognitionAsync(e,t){(0,i.marshalPromiseToCallbacks)(this.stopContinuousRecognitionAsyncImpl(),e,t)}async close(){this.privDisposedRecognizer||await this.dispose(!0)}async pushConversationEvent(e,t){const r=this.privReco;n.Contracts.throwIfNullOrUndefined(r,"serviceRecognizer"),await r.sendSpeechEventAsync(e,t)}async pushMeetingEvent(e,t){const r=this.privReco;n.Contracts.throwIfNullOrUndefined(r,"serviceRecognizer"),await r.sendMeetingSpeechEventAsync(e,t)}async enforceAudioGating(){const e=this.audioConfig,t=(await e.format).channels;if(1===t){if("true"!==this.properties.getProperty("f0f5debc-f8c9-4892-ac4b-90a7ab359fd2","false").toLowerCase())throw new Error("Single channel audio configuration for MeetingTranscriber is currently under private preview, please contact diarizationrequest@microsoft.com for more details")}else if(8!==t)throw new Error(`Unsupported audio configuration: Detected ${t}-channel audio`)}connectMeetingCallbacks(e){this.isMeetingRecognizer=!0,this.canceled=(t,r)=>{e.canceled&&e.canceled(e,r)},this.recognizing=(t,r)=>{e.transcribing&&e.transcribing(e,r)},this.recognized=(t,r)=>{e.transcribed&&e.transcribed(e,r)},this.sessionStarted=(t,r)=>{e.sessionStarted&&e.sessionStarted(e,r)},this.sessionStopped=(t,r)=>{e.sessionStopped&&e.sessionStopped(e,r)}}disconnectCallbacks(){this.canceled=void 0,this.recognizing=void 0,this.recognized=void 0,this.sessionStarted=void 0,this.sessionStopped=void 0}async dispose(e){this.privDisposedRecognizer||(e&&(this.privDisposedRecognizer=!0,await this.implRecognizerStop()),await super.dispose(e))}createRecognizerConfig(e){return new s.RecognizerConfig(e,this.properties)}createServiceRecognizer(e,t,r,i){const n=r;return new s.TranscriptionServiceRecognizer(e,t,n,i,this)}}t.TranscriberRecognizer=c},251:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SpeechSynthesisResult=void 0;const i=r(881);class n extends i.SynthesisResult{constructor(e,t,r,i,n,o){super(e,t,i,n),this.privAudioData=r,this.privAudioDuration=o}get audioData(){return this.privAudioData}get audioDuration(){return this.privAudioDuration}}t.SpeechSynthesisResult=n},362:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IntentRecognitionEventArgs=void 0;const i=r(881);class n extends i.RecognitionEventArgs{constructor(e,t,r){super(t,r),this.privResult=e}get result(){return this.privResult}}t.IntentRecognitionEventArgs=n},400:(e,t)=>{"use strict";function r(e){return 14+(e+64>>>9<<4)+1}function i(e,t){const r=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(r>>16)<<16|65535&r}function n(e,t,r,n,o,s){return i((a=i(i(t,e),i(n,s)))<<(c=o)|a>>>32-c,r);var a,c}function o(e,t,r,i,o,s,a){return n(t&r|~t&i,e,t,o,s,a)}function s(e,t,r,i,o,s,a){return n(t&i|r&~i,e,t,o,s,a)}function a(e,t,r,i,o,s,a){return n(t^r^i,e,t,o,s,a)}function c(e,t,r,i,o,s,a){return n(r^(t|~i),e,t,o,s,a)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;t.default=function(e){if("string"==typeof e){const t=unescape(encodeURIComponent(e));e=new Uint8Array(t.length);for(let r=0;r<t.length;++r)e[r]=t.charCodeAt(r)}return function(e){const t=[],r=32*e.length,i="0123456789abcdef";for(let n=0;n<r;n+=8){const r=e[n>>5]>>>n%32&255,o=parseInt(i.charAt(r>>>4&15)+i.charAt(15&r),16);t.push(o)}return t}(function(e,t){e[t>>5]|=128<<t%32,e[r(t)-1]=t;let n=1732584193,u=-271733879,h=-1732584194,d=271733878;for(let t=0;t<e.length;t+=16){const r=n,l=u,p=h,f=d;n=o(n,u,h,d,e[t],7,-680876936),d=o(d,n,u,h,e[t+1],12,-389564586),h=o(h,d,n,u,e[t+2],17,606105819),u=o(u,h,d,n,e[t+3],22,-1044525330),n=o(n,u,h,d,e[t+4],7,-176418897),d=o(d,n,u,h,e[t+5],12,1200080426),h=o(h,d,n,u,e[t+6],17,-1473231341),u=o(u,h,d,n,e[t+7],22,-45705983),n=o(n,u,h,d,e[t+8],7,1770035416),d=o(d,n,u,h,e[t+9],12,-1958414417),h=o(h,d,n,u,e[t+10],17,-42063),u=o(u,h,d,n,e[t+11],22,-1990404162),n=o(n,u,h,d,e[t+12],7,1804603682),d=o(d,n,u,h,e[t+13],12,-40341101),h=o(h,d,n,u,e[t+14],17,-1502002290),u=o(u,h,d,n,e[t+15],22,1236535329),n=s(n,u,h,d,e[t+1],5,-165796510),d=s(d,n,u,h,e[t+6],9,-1069501632),h=s(h,d,n,u,e[t+11],14,643717713),u=s(u,h,d,n,e[t],20,-373897302),n=s(n,u,h,d,e[t+5],5,-701558691),d=s(d,n,u,h,e[t+10],9,38016083),h=s(h,d,n,u,e[t+15],14,-660478335),u=s(u,h,d,n,e[t+4],20,-405537848),n=s(n,u,h,d,e[t+9],5,568446438),d=s(d,n,u,h,e[t+14],9,-1019803690),h=s(h,d,n,u,e[t+3],14,-187363961),u=s(u,h,d,n,e[t+8],20,1163531501),n=s(n,u,h,d,e[t+13],5,-1444681467),d=s(d,n,u,h,e[t+2],9,-51403784),h=s(h,d,n,u,e[t+7],14,1735328473),u=s(u,h,d,n,e[t+12],20,-1926607734),n=a(n,u,h,d,e[t+5],4,-378558),d=a(d,n,u,h,e[t+8],11,-2022574463),h=a(h,d,n,u,e[t+11],16,1839030562),u=a(u,h,d,n,e[t+14],23,-35309556),n=a(n,u,h,d,e[t+1],4,-1530992060),d=a(d,n,u,h,e[t+4],11,1272893353),h=a(h,d,n,u,e[t+7],16,-155497632),u=a(u,h,d,n,e[t+10],23,-1094730640),n=a(n,u,h,d,e[t+13],4,681279174),d=a(d,n,u,h,e[t],11,-358537222),h=a(h,d,n,u,e[t+3],16,-722521979),u=a(u,h,d,n,e[t+6],23,76029189),n=a(n,u,h,d,e[t+9],4,-640364487),d=a(d,n,u,h,e[t+12],11,-421815835),h=a(h,d,n,u,e[t+15],16,530742520),u=a(u,h,d,n,e[t+2],23,-995338651),n=c(n,u,h,d,e[t],6,-198630844),d=c(d,n,u,h,e[t+7],10,1126891415),h=c(h,d,n,u,e[t+14],15,-1416354905),u=c(u,h,d,n,e[t+5],21,-57434055),n=c(n,u,h,d,e[t+12],6,1700485571),d=c(d,n,u,h,e[t+3],10,-1894986606),h=c(h,d,n,u,e[t+10],15,-1051523),u=c(u,h,d,n,e[t+1],21,-2054922799),n=c(n,u,h,d,e[t+8],6,1873313359),d=c(d,n,u,h,e[t+15],10,-30611744),h=c(h,d,n,u,e[t+6],15,-1560198380),u=c(u,h,d,n,e[t+13],21,1309151649),n=c(n,u,h,d,e[t+4],6,-145523070),d=c(d,n,u,h,e[t+11],10,-1120210379),h=c(h,d,n,u,e[t+2],15,718787259),u=c(u,h,d,n,e[t+9],21,-343485551),n=i(n,r),u=i(u,l),h=i(h,p),d=i(d,f)}return[n,u,h,d]}(function(e){if(0===e.length)return[];const t=8*e.length,i=new Uint32Array(r(t));for(let r=0;r<t;r+=8)i[r>>5]|=(255&e[r/8])<<r%32;return i}(e),8*e.length))}},403:function(e,t,r){"use strict";var i=this&&this.__createBinding||(Object.create?function(e,t,r,i){void 0===i&&(i=r),Object.defineProperty(e,i,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,i){void 0===i&&(i=r),e[i]=t[r]}),n=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&i(t,e,r);return n(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.ConsoleLoggingListener=void 0;const s=o(r(2250)),a=r(5648),c=r(5245);t.ConsoleLoggingListener=class{constructor(e=a.LogLevel.None){this.privLogPath=void 0,this.privEnableConsoleOutput=!0,this.privLogLevelFilter=e}set logPath(e){c.Contracts.throwIfNullOrUndefined(s.openSync,"\nFile System access not available"),this.privLogPath=e}set enableConsoleOutput(e){this.privEnableConsoleOutput=e}onEvent(e){if(e.eventType>=this.privLogLevelFilter){const t=this.toString(e);if(this.logCallback&&this.logCallback(t),this.privLogPath&&s.writeFileSync(this.privLogPath,t+"\n",{flag:"a+"}),this.privEnableConsoleOutput)switch(e.eventType){case a.LogLevel.Debug:console.debug(t);break;case a.LogLevel.Info:console.info(t);break;case a.LogLevel.Warning:console.warn(t);break;case a.LogLevel.Error:console.error(t);break;default:console.log(t)}}}toString(e){const t=[`${e.eventTime}`,`${e.name}`],r=e;for(const i in r)if(i&&e.hasOwnProperty(i)&&"eventTime"!==i&&"eventType"!==i&&"eventId"!==i&&"name"!==i&&"constructor"!==i){const e=r[i];let n="<NULL>";null!=e&&(n="number"==typeof e||"string"==typeof e?e.toString():JSON.stringify(e)),t.push(`${i}: ${n}`)}return t.join(" | ")}}},404:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ConversationManager=void 0;const i=r(4378),n=r(5245),o=r(881),s=r(5321);t.ConversationManager=class{constructor(){this.privRequestParams=s.ConversationConnectionConfig.configParams,this.privErrors=s.ConversationConnectionConfig.restErrors,this.privHost=s.ConversationConnectionConfig.host,this.privApiVersion=s.ConversationConnectionConfig.apiVersion,this.privRestPath=s.ConversationConnectionConfig.restPath,this.privRestAdapter=new i.RestMessageAdapter({})}createOrJoin(e,t,r,a){try{n.Contracts.throwIfNullOrUndefined(e,"args");const c=e.getProperty(o.PropertyId.SpeechServiceConnection_RecoLanguage,s.ConversationConnectionConfig.defaultLanguageCode),u=e.getProperty(o.PropertyId.ConversationTranslator_Name,"conversation_host"),h=e.getProperty(o.PropertyId.ConversationTranslator_Host,this.privHost),d=e.getProperty(o.PropertyId.ConversationTranslator_CorrelationId),l=e.getProperty(o.PropertyId.SpeechServiceConnection_Key),p=e.getProperty(o.PropertyId.SpeechServiceConnection_Region),f=e.getProperty(o.PropertyId.SpeechServiceAuthorization_Token);n.Contracts.throwIfNullOrWhitespace(c,"languageCode"),n.Contracts.throwIfNullOrWhitespace(u,"nickname"),n.Contracts.throwIfNullOrWhitespace(h,"endpointHost");const v={};v[this.privRequestParams.apiVersion]=this.privApiVersion,v[this.privRequestParams.languageCode]=c,v[this.privRequestParams.nickname]=u;const g={};d&&(g[this.privRequestParams.correlationId]=d),g[this.privRequestParams.clientAppId]=s.ConversationConnectionConfig.clientAppId,void 0!==t?v[this.privRequestParams.roomId]=t:(n.Contracts.throwIfNullOrUndefined(p,this.privErrors.authInvalidSubscriptionRegion),g[this.privRequestParams.subscriptionRegion]=p,l?g[this.privRequestParams.subscriptionKey]=l:f?g[this.privRequestParams.authorization]=`Bearer ${f}`:n.Contracts.throwIfNullOrUndefined(l,this.privErrors.authInvalidSubscriptionKey));const m={};m.headers=g,this.privRestAdapter.options=m;const y=`https://${h}${this.privRestPath}`;this.privRestAdapter.request(i.RestRequestType.Post,y,v,null).then(e=>{const t=i.RestMessageAdapter.extractHeaderValue(this.privRequestParams.requestId,e.headers);if(!e.ok){if(a){let r,i=this.privErrors.invalidCreateJoinConversationResponse.replace("{status}",e.status.toString());try{r=JSON.parse(e.data),i+=` [${r.error.code}: ${r.error.message}]`}catch(t){i+=` [${e.data}]`}t&&(i+=` ${t}`),a(i)}return}const n=JSON.parse(e.data);if(n&&(n.requestId=t),r){try{r(n)}catch(e){a&&a(e)}r=void 0}}).catch(()=>{})}catch(e){if(a)if(e instanceof Error){const t=e;a(t.name+": "+t.message)}else a(e)}}leave(e,t){return new Promise((r,s)=>{try{n.Contracts.throwIfNullOrUndefined(e,this.privErrors.invalidArgs.replace("{arg}","config")),n.Contracts.throwIfNullOrWhitespace(t,this.privErrors.invalidArgs.replace("{arg}","token"));const s=e.getProperty(o.PropertyId.ConversationTranslator_Host,this.privHost),a=e.getProperty(o.PropertyId.ConversationTranslator_CorrelationId),c={};c[this.privRequestParams.apiVersion]=this.privApiVersion,c[this.privRequestParams.sessionToken]=t;const u={};a&&(u[this.privRequestParams.correlationId]=a);const h={};h.headers=u,this.privRestAdapter.options=h;const d=`https://${s}${this.privRestPath}`;this.privRestAdapter.request(i.RestRequestType.Delete,d,c,null).then(e=>{e.ok,r()}).catch(()=>{})}catch(e){if(e instanceof Error){const t=e;s(t.name+": "+t.message)}else s(e)}})}}},425:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActivityReceivedEventArgs=void 0,t.ActivityReceivedEventArgs=class{constructor(e,t){this.privActivity=e,this.privAudioStream=t}get activity(){return this.privActivity}get audioStream(){return this.privAudioStream}}},436:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SpeechKeyword=void 0;class r{constructor(e,t){this.privSpeechKeyword=JSON.parse(e),this.privSpeechKeyword.Offset+=t}static fromJSON(e,t){return new r(e,t)}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)}}t.SpeechKeyword=r},471:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SpeakerVerificationModel=void 0;const i=r(5245),n=r(881);class o{constructor(e){if(i.Contracts.throwIfNullOrUndefined(e,"VoiceProfile"),e.profileType===n.VoiceProfileType.TextIndependentIdentification)throw new Error("Verification model cannot be created from Identification profile");this.privVoiceProfile=e}static fromProfile(e){return new o(e)}get voiceProfile(){return this.privVoiceProfile}get profileIds(){return[this.voiceProfile.profileId]}get scenario(){return this.voiceProfile.profileType===n.VoiceProfileType.TextDependentVerification?"TextDependentVerification":"TextIndependentVerification"}}t.SpeakerVerificationModel=o},472:(e,t)=>{"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.PronunciationAssessmentGradingSystem=void 0,(r=t.PronunciationAssessmentGradingSystem||(t.PronunciationAssessmentGradingSystem={}))[r.FivePoint=1]="FivePoint",r[r.HundredMark=2]="HundredMark"},478:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Recognizer=void 0;const i=r(9190),n=r(868),o=r(5245),s=r(881);class a{constructor(e,t,r,i){this.audioConfig=void 0!==e?e:s.AudioConfig.fromDefaultMicrophoneInput(),this.privDisposed=!1,this.privProperties=t.clone(),this.privConnectionFactory=r,this.tokenCredential=i,this.implCommonRecognizerSetup()}close(e,t){o.Contracts.throwIfDisposed(this.privDisposed),(0,n.marshalPromiseToCallbacks)(this.dispose(!0),e,t)}get internalData(){return this.privReco}async dispose(e){this.privDisposed||(this.privDisposed=!0,e&&this.privReco&&(await this.privReco.audioSource.turnOff(),await this.privReco.dispose()))}static get telemetryEnabled(){return i.ServiceRecognizerBase.telemetryDataEnabled}static enableTelemetry(e){i.ServiceRecognizerBase.telemetryDataEnabled=e}implCommonRecognizerSetup(){let e="undefined"!=typeof window?"Browser":"Node",t="unknown",r="unknown";"undefined"!=typeof navigator&&(e=e+"/"+navigator.platform,t=navigator.userAgent,r=navigator.appVersion);const n=this.createRecognizerConfig(new i.SpeechServiceConfig(new i.Context(new i.OS(e,t,r))));this.privReco=this.createServiceRecognizer(a.getAuth(this.privProperties,this.tokenCredential),this.privConnectionFactory,this.audioConfig,n)}async recognizeOnceAsyncImpl(e){o.Contracts.throwIfDisposed(this.privDisposed);const t=new n.Deferred;await this.implRecognizerStop(),await this.privReco.recognize(e,t.resolve,t.reject);const r=await t.promise;return await this.implRecognizerStop(),r}async startContinuousRecognitionAsyncImpl(e){o.Contracts.throwIfDisposed(this.privDisposed),await this.implRecognizerStop(),await this.privReco.recognize(e,void 0,void 0)}async stopContinuousRecognitionAsyncImpl(){o.Contracts.throwIfDisposed(this.privDisposed),await this.implRecognizerStop()}async implRecognizerStop(){this.privReco&&await this.privReco.stopRecognizing()}static getAuth(e,t){const r=e.getProperty(s.PropertyId.SpeechServiceConnection_Key,void 0);return r&&""!==r?new i.CognitiveSubscriptionKeyAuthentication(r):t?new i.CognitiveTokenAuthentication(async()=>{try{const e=await t.getToken("https://cognitiveservices.azure.com/.default");return e?.token??""}catch(e){throw e}},async()=>{try{const e=await t.getToken("https://cognitiveservices.azure.com/.default");return e?.token??""}catch(e){throw e}}):new i.CognitiveTokenAuthentication(()=>{const t=e.getProperty(s.PropertyId.SpeechServiceAuthorization_Token,void 0);return Promise.resolve(t)},()=>{const t=e.getProperty(s.PropertyId.SpeechServiceAuthorization_Token,void 0);return Promise.resolve(t)})}}t.Recognizer=a},504:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"NIL",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(t,"parse",{enumerable:!0,get:function(){return d.default}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return h.default}}),Object.defineProperty(t,"v1",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(t,"v3",{enumerable:!0,get:function(){return n.default}}),Object.defineProperty(t,"v4",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(t,"v5",{enumerable:!0,get:function(){return s.default}}),Object.defineProperty(t,"validate",{enumerable:!0,get:function(){return u.default}}),Object.defineProperty(t,"version",{enumerable:!0,get:function(){return c.default}});var i=l(r(1895)),n=l(r(6873)),o=l(r(6924)),s=l(r(8563)),a=l(r(1603)),c=l(r(4612)),u=l(r(1280)),h=l(r(6821)),d=l(r(4235));function l(e){return e&&e.__esModule?e:{default:e}}},522:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},580:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SpeechSynthesisVisemeEventArgs=void 0,t.SpeechSynthesisVisemeEventArgs=class{constructor(e,t,r){this.privAudioOffset=e,this.privVisemeId=t,this.privAnimation=r}get audioOffset(){return this.privAudioOffset}get visemeId(){return this.privVisemeId}get animation(){return this.privAnimation}}},616:(e,t)=>{"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.LanguageIdMode=void 0,(r=t.LanguageIdMode||(t.LanguageIdMode={}))[r.AtStart=0]="AtStart",r[r.Continuous=1]="Continuous"},644:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.VoiceProfileClient=void 0;const i=r(9190),n=r(6883),o=r(5245),s=r(881);class a extends s.Recognizer{constructor(e){o.Contracts.throwIfNullOrUndefined(e,"speechConfig");const t=e;o.Contracts.throwIfNull(t,"speechConfig"),super(n.AudioConfig.fromStreamInput(s.AudioInputStream.createPushStream()),t.properties,new i.VoiceProfileConnectionFactory),this.privProperties=t.properties.clone(),this.privVoiceAdapter=this.privReco,this.privDisposedVoiceAdapter=!1}get properties(){return this.privProperties}get authorizationToken(){return this.properties.getProperty(s.PropertyId.SpeechServiceAuthorization_Token)}set authorizationToken(e){o.Contracts.throwIfNullOrWhitespace(e,"token"),this.properties.setProperty(s.PropertyId.SpeechServiceAuthorization_Token,e)}async createProfileAsync(e,t){const r=await this.privVoiceAdapter.createProfile(e,t);return new s.VoiceProfile(r[0],e)}async retrieveEnrollmentResultAsync(e){return this.privVoiceAdapter.retrieveEnrollmentResult(e)}async getAllProfilesAsync(e){return this.privVoiceAdapter.getAllProfiles(e)}async getActivationPhrasesAsync(e,t){return this.privVoiceAdapter.getActivationPhrases(e,t)}async enrollProfileAsync(e,t){const r=t;return o.Contracts.throwIfNullOrUndefined(r,"audioConfig"),this.audioConfig=t,this.privVoiceAdapter.SpeakerAudioSource=r,this.privVoiceAdapter.enrollProfile(e)}async deleteProfileAsync(e){return this.privVoiceAdapter.deleteProfile(e)}async resetProfileAsync(e){return this.privVoiceAdapter.resetProfile(e)}async close(){await this.dispose(!0)}createServiceRecognizer(e,t,r,n){const o=r;return new i.VoiceServiceRecognizer(e,t,o,n,this)}async dispose(e){this.privDisposedVoiceAdapter||(this.privDisposedVoiceAdapter=!0,e&&await super.dispose(e))}createRecognizerConfig(e){return new i.RecognizerConfig(e,this.properties)}getResult(e,t){return new s.VoiceProfileResult(e.ok?t:s.ResultReason.Canceled,e.statusText)}}t.VoiceProfileClient=a},705:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SpeechSynthesisBookmarkEventArgs=void 0,t.SpeechSynthesisBookmarkEventArgs=class{constructor(e,t){this.privAudioOffset=e,this.privText=t}get audioOffset(){return this.privAudioOffset}get text(){return this.privText}}},764:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ConversationTranslator=t.SpeechState=void 0;const i=r(9190),n=r(2451),o=r(868),s=r(5245),a=r(881),c=r(5054),u=r(2966);var h;!function(e){e[e.Inactive=0]="Inactive",e[e.Connecting=1]="Connecting",e[e.Connected=2]="Connected"}(h=t.SpeechState||(t.SpeechState={}));class d extends a.TranslationRecognizer{constructor(e,t,r,i){super(e,t,new n.ConversationTranslatorConnectionFactory(i)),this.privSpeechState=h.Inactive,r&&(this.privTranslator=r,this.sessionStarted=()=>{this.privSpeechState=h.Connected},this.sessionStopped=()=>{this.privSpeechState=h.Inactive},this.recognizing=(e,t)=>{this.privTranslator.recognizing&&this.privTranslator.recognizing(this.privTranslator,t)},this.recognized=async(e,t)=>{t.result?.errorDetails?(await this.cancelSpeech(),this.fireCancelEvent(t.result.errorDetails)):this.privTranslator.recognized&&this.privTranslator.recognized(this.privTranslator,t)},this.canceled=async()=>{if(this.privSpeechState!==h.Inactive)try{await this.cancelSpeech()}catch(e){this.privSpeechState=h.Inactive}})}get state(){return this.privSpeechState}set state(e){this.privSpeechState=e}set authentication(e){this.privReco.authentication=e}onConnection(){this.privSpeechState=h.Connected}async onCancelSpeech(){this.privSpeechState=h.Inactive,await this.cancelSpeech()}fireCancelEvent(e){try{if(this.privTranslator.canceled){const t=new u.ConversationTranslationCanceledEventArgs(a.CancellationReason.Error,e,a.CancellationErrorCode.RuntimeError);this.privTranslator.canceled(this.privTranslator,t)}}catch(e){}}async cancelSpeech(){try{this.stopContinuousRecognitionAsync(),await(this.privReco?.disconnect()),this.privSpeechState=h.Inactive}catch(e){}}}class l extends u.ConversationCommon{constructor(e){super(e),this.privErrors=i.ConversationConnectionConfig.restErrors,this.privIsDisposed=!1,this.privIsSpeaking=!1,this.privPlaceholderKey="abcdefghijklmnopqrstuvwxyz012345",this.privPlaceholderRegion="westus",this.privProperties=new a.PropertyCollection}get properties(){return this.privProperties}get speechRecognitionLanguage(){return this.privSpeechRecognitionLanguage}get participants(){return this.privConversation?.participants}get canSpeak(){return!(!this.privConversation.isConnected||!this.privCTRecognizer||this.privIsSpeaking||this.privCTRecognizer.state===h.Connected||this.privCTRecognizer.state===h.Connecting||this.privConversation.isMutedByHost)}onToken(e){this.privCTRecognizer.authentication=e}setServiceProperty(e,t){const r=JSON.parse(this.privProperties.getProperty(i.ServicePropertiesPropertyName,"{}"));r[e]=t,this.privProperties.setProperty(i.ServicePropertiesPropertyName,JSON.stringify(r))}joinConversationAsync(e,t,r,n,o){try{if("string"==typeof e){s.Contracts.throwIfNullOrUndefined(e,this.privErrors.invalidArgs.replace("{arg}","conversation id")),s.Contracts.throwIfNullOrWhitespace(t,this.privErrors.invalidArgs.replace("{arg}","nickname")),this.privConversation&&this.handleError(new Error(this.privErrors.permissionDeniedStart),o);let u=r;null!=u&&""!==u||(u=i.ConversationConnectionConfig.defaultLanguageCode),this.privSpeechTranslationConfig=a.SpeechTranslationConfig.fromSubscription(this.privPlaceholderKey,this.privPlaceholderRegion),this.privSpeechTranslationConfig.setProfanity(a.ProfanityOption.Masked),this.privSpeechTranslationConfig.addTargetLanguage(u),this.privSpeechTranslationConfig.setProperty(a.PropertyId[a.PropertyId.SpeechServiceConnection_RecoLanguage],u),this.privSpeechTranslationConfig.setProperty(a.PropertyId[a.PropertyId.ConversationTranslator_Name],t);const h=[a.PropertyId.SpeechServiceConnection_Host,a.PropertyId.ConversationTranslator_Host,a.PropertyId.SpeechServiceConnection_Endpoint,a.PropertyId.SpeechServiceConnection_ProxyHostName,a.PropertyId.SpeechServiceConnection_ProxyPassword,a.PropertyId.SpeechServiceConnection_ProxyPort,a.PropertyId.SpeechServiceConnection_ProxyUserName,"ConversationTranslator_MultiChannelAudio","ConversationTranslator_Region"];for(const e of h){const t=this.privProperties.getProperty(e);if(t){const r="string"==typeof e?e:a.PropertyId[e];this.privSpeechTranslationConfig.setProperty(r,t)}}const d=JSON.parse(this.privProperties.getProperty(i.ServicePropertiesPropertyName,"{}"));for(const e of Object.keys(d))this.privSpeechTranslationConfig.setServiceProperty(e,d[e],a.ServicePropertyChannel.UriQueryParameter);this.privConversation=new c.ConversationImpl(this.privSpeechTranslationConfig),this.privConversation.conversationTranslator=this,this.privConversation.joinConversationAsync(e,t,u,e=>{e||this.handleError(new Error(this.privErrors.permissionDeniedConnect),o),this.privSpeechTranslationConfig.authorizationToken=e,this.privConversation.room.isHost=!1,this.privConversation.startConversationAsync(()=>{this.handleCallback(n,o)},e=>{this.handleError(e,o)})},e=>{this.handleError(e,o)})}else"object"==typeof e?(s.Contracts.throwIfNullOrUndefined(e,this.privErrors.invalidArgs.replace("{arg}","conversation id")),s.Contracts.throwIfNullOrWhitespace(t,this.privErrors.invalidArgs.replace("{arg}","nickname")),this.privProperties.setProperty(a.PropertyId.ConversationTranslator_Name,t),this.privConversation=e,this.privConversation.conversationTranslator=this,this.privConversation.room.isHost=!0,s.Contracts.throwIfNullOrUndefined(this.privConversation,this.privErrors.permissionDeniedConnect),s.Contracts.throwIfNullOrUndefined(this.privConversation.room.token,this.privErrors.permissionDeniedConnect),this.privSpeechTranslationConfig=e.config,this.handleCallback(r,n)):this.handleError(new Error(this.privErrors.invalidArgs.replace("{arg}","invalid conversation type")),n)}catch(e){this.handleError(e,"string"==typeof r?o:n)}}leaveConversationAsync(e,t){(0,o.marshalPromiseToCallbacks)((async()=>{await this.cancelSpeech(),await this.privConversation.endConversationImplAsync(),await this.privConversation.deleteConversationImplAsync(),this.dispose()})(),e,t)}sendTextMessageAsync(e,t,r){try{s.Contracts.throwIfNullOrUndefined(this.privConversation,this.privErrors.permissionDeniedSend),s.Contracts.throwIfNullOrWhitespace(e,this.privErrors.invalidArgs.replace("{arg}",e)),this.privConversation.sendTextMessageAsync(e,t,r)}catch(e){this.handleError(e,r)}}startTranscribingAsync(e,t){(0,o.marshalPromiseToCallbacks)((async()=>{try{s.Contracts.throwIfNullOrUndefined(this.privConversation,this.privErrors.permissionDeniedSend),s.Contracts.throwIfNullOrUndefined(this.privConversation.room.token,this.privErrors.permissionDeniedConnect),void 0===this.privCTRecognizer&&await this.connectTranslatorRecognizer(),s.Contracts.throwIfNullOrUndefined(this.privCTRecognizer,this.privErrors.permissionDeniedSend),this.canSpeak||this.handleError(new Error(this.privErrors.permissionDeniedSend),t),await this.startContinuousRecognition(),this.privIsSpeaking=!0}catch(e){throw this.privIsSpeaking=!1,await this.cancelSpeech(),e}})(),e,t)}stopTranscribingAsync(e,t){(0,o.marshalPromiseToCallbacks)((async()=>{try{if(!this.privIsSpeaking)return void await this.cancelSpeech();this.privIsSpeaking=!1,await new Promise((e,t)=>{this.privCTRecognizer.stopContinuousRecognitionAsync(e,t)})}catch(e){await this.cancelSpeech()}})(),e,t)}isDisposed(){return this.privIsDisposed}dispose(e,t,r){(0,o.marshalPromiseToCallbacks)((async()=>{this.isDisposed&&!this.privIsSpeaking||(await this.cancelSpeech(),this.privIsDisposed=!0,this.privSpeechTranslationConfig.close(),this.privSpeechRecognitionLanguage=void 0,this.privProperties=void 0,this.privAudioConfig=void 0,this.privSpeechTranslationConfig=void 0,this.privConversation.dispose(),this.privConversation=void 0)})(),t,r)}async cancelSpeech(){try{this.privIsSpeaking=!1,await(this.privCTRecognizer?.onCancelSpeech()),this.privCTRecognizer=void 0}catch(e){}}async connectTranslatorRecognizer(){try{void 0===this.privAudioConfig&&(this.privAudioConfig=a.AudioConfig.fromDefaultMicrophoneInput()),this.privSpeechTranslationConfig.getProperty(a.PropertyId[a.PropertyId.SpeechServiceConnection_Key])===this.privPlaceholderKey&&this.privSpeechTranslationConfig.setProperty(a.PropertyId[a.PropertyId.SpeechServiceConnection_Key],"");const e=()=>this.privConversation;this.privCTRecognizer=new d(this.privSpeechTranslationConfig,this.privAudioConfig,this,e)}catch(e){throw await this.cancelSpeech(),e}}startContinuousRecognition(){return new Promise((e,t)=>{this.privCTRecognizer.startContinuousRecognitionAsync(e,t)})}}t.ConversationTranslator=l},802:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NoMatchDetails=void 0;const i=r(9190),n=r(881);class o{constructor(e){this.privReason=e}static fromResult(e){const t=i.SimpleSpeechPhrase.fromJSON(e.json,0);let r=n.NoMatchReason.NotRecognized;switch(t.RecognitionStatus){case i.RecognitionStatus.BabbleTimeout:r=n.NoMatchReason.InitialBabbleTimeout;break;case i.RecognitionStatus.InitialSilenceTimeout:r=n.NoMatchReason.InitialSilenceTimeout;break;default:r=n.NoMatchReason.NotRecognized}return new o(r)}get reason(){return this.privReason}}t.NoMatchDetails=o},868:function(e,t,r){"use strict";var i=this&&this.__createBinding||(Object.create?function(e,t,r,i){void 0===i&&(i=r),Object.defineProperty(e,i,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,i){void 0===i&&(i=r),e[i]=t[r]}),n=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||i(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),t.TranslationStatus=void 0,n(r(9981),t),n(r(42),t),n(r(4132),t),n(r(5636),t),n(r(1124),t),n(r(8618),t),n(r(6209),t),n(r(8922),t),n(r(5870),t),n(r(4462),t),n(r(8285),t),n(r(4008),t),n(r(3483),t),n(r(8136),t),n(r(6090),t),n(r(2278),t),n(r(1891),t),n(r(1960),t),n(r(8607),t),n(r(6682),t),n(r(15),t),n(r(2754),t),n(r(5338),t),n(r(3804),t),n(r(3567),t),n(r(7378),t),n(r(2623),t);var o=r(4520);Object.defineProperty(t,"TranslationStatus",{enumerable:!0,get:function(){return o.TranslationStatus}}),n(r(4028),t),n(r(1806),t),n(r(5304),t),n(r(4207),t),n(r(2509),t)},881:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ConnectionEventArgs=t.CancellationErrorCode=t.CancellationDetails=t.CancellationDetailsBase=t.IntentRecognitionCanceledEventArgs=t.TranslationRecognitionCanceledEventArgs=t.NoMatchDetails=t.NoMatchReason=t.Translations=t.TranslationRecognizer=t.VoiceProfileType=t.IntentRecognizer=t.SpeechRecognizer=t.Recognizer=t.PropertyId=t.PropertyCollection=t.SpeechTranslationConfigImpl=t.SpeechTranslationConfig=t.SpeechConfigImpl=t.SpeechConfig=t.ResultReason=t.TranslationSynthesisResult=t.TranslationRecognitionResult=t.TranslationSynthesisEventArgs=t.TranslationRecognitionEventArgs=t.SpeechRecognitionCanceledEventArgs=t.MeetingTranscriptionEventArgs=t.ConversationTranscriptionEventArgs=t.SpeechRecognitionEventArgs=t.LanguageUnderstandingModel=t.IntentRecognitionResult=t.SpeechRecognitionResult=t.RecognitionResult=t.IntentRecognitionEventArgs=t.OutputFormat=t.RecognitionEventArgs=t.SessionEventArgs=t.KeywordRecognitionModel=t.PushAudioOutputStreamCallback=t.PullAudioInputStreamCallback=t.CancellationReason=t.PushAudioOutputStream=t.PullAudioOutputStream=t.AudioOutputStream=t.PushAudioInputStream=t.PullAudioInputStream=t.AudioInputStream=t.AudioFormatTag=t.AudioStreamFormat=t.AudioConfig=void 0,t.SpeechSynthesisEventArgs=t.SpeechSynthesisResult=t.SynthesisResult=t.SpeechSynthesizer=t.SpeechSynthesisOutputFormat=t.Synthesizer=t.User=t.ParticipantChangedReason=t.Participant=t.MeetingTranscriber=t.Meeting=t.ConversationTranscriptionResult=t.ConversationTranscriber=t.ConversationTranslator=t.ConversationTranslationResult=t.ConversationTranslationEventArgs=t.ConversationTranslationCanceledEventArgs=t.ConversationParticipantsChangedEventArgs=t.ConversationExpirationEventArgs=t.Conversation=t.SpeakerRecognitionCancellationDetails=t.SpeakerRecognitionResultType=t.SpeakerRecognitionResult=t.SourceLanguageConfig=t.AutoDetectSourceLanguageResult=t.AutoDetectSourceLanguageConfig=t.SpeakerVerificationModel=t.SpeakerIdentificationModel=t.SpeakerRecognizer=t.VoiceProfileClient=t.VoiceProfilePhraseResult=t.VoiceProfileCancellationDetails=t.VoiceProfileResult=t.VoiceProfileEnrollmentCancellationDetails=t.VoiceProfileEnrollmentResult=t.VoiceProfile=t.ConnectionMessage=t.ConnectionMessageEventArgs=t.BaseAudioPlayer=t.ProfanityOption=t.ServicePropertyChannel=t.TurnStatusReceivedEventArgs=t.ActivityReceivedEventArgs=t.DialogServiceConnector=t.CustomCommandsConfig=t.BotFrameworkConfig=t.DialogServiceConfig=t.PhraseListGrammar=t.Connection=t.ServiceEventArgs=void 0,t.LogLevel=t.Diagnostics=t.AvatarWebRTCConnectionResult=t.Coordinate=t.AvatarVideoFormat=t.AvatarSynthesizer=t.AvatarEventArgs=t.AvatarConfig=t.LanguageIdMode=t.PronunciationAssessmentResult=t.PronunciationAssessmentConfig=t.PronunciationAssessmentGranularity=t.PronunciationAssessmentGradingSystem=t.MeetingTranscriptionCanceledEventArgs=t.ConversationTranscriptionCanceledEventArgs=t.SpeakerAudioDestination=t.VoiceInfo=t.SynthesisVoiceType=t.SynthesisVoiceGender=t.SynthesisVoicesResult=t.SpeechSynthesisBoundaryType=t.SpeechSynthesisVisemeEventArgs=t.SpeechSynthesisBookmarkEventArgs=t.SpeechSynthesisWordBoundaryEventArgs=void 0;var i=r(6883);Object.defineProperty(t,"AudioConfig",{enumerable:!0,get:function(){return i.AudioConfig}});var n=r(8698);Object.defineProperty(t,"AudioStreamFormat",{enumerable:!0,get:function(){return n.AudioStreamFormat}}),Object.defineProperty(t,"AudioFormatTag",{enumerable:!0,get:function(){return n.AudioFormatTag}});var o=r(2025);Object.defineProperty(t,"AudioInputStream",{enumerable:!0,get:function(){return o.AudioInputStream}}),Object.defineProperty(t,"PullAudioInputStream",{enumerable:!0,get:function(){return o.PullAudioInputStream}}),Object.defineProperty(t,"PushAudioInputStream",{enumerable:!0,get:function(){return o.PushAudioInputStream}});var s=r(8640);Object.defineProperty(t,"AudioOutputStream",{enumerable:!0,get:function(){return s.AudioOutputStream}}),Object.defineProperty(t,"PullAudioOutputStream",{enumerable:!0,get:function(){return s.PullAudioOutputStream}}),Object.defineProperty(t,"PushAudioOutputStream",{enumerable:!0,get:function(){return s.PushAudioOutputStream}});var a=r(4859);Object.defineProperty(t,"CancellationReason",{enumerable:!0,get:function(){return a.CancellationReason}});var c=r(2621);Object.defineProperty(t,"PullAudioInputStreamCallback",{enumerable:!0,get:function(){return c.PullAudioInputStreamCallback}});var u=r(4479);Object.defineProperty(t,"PushAudioOutputStreamCallback",{enumerable:!0,get:function(){return u.PushAudioOutputStreamCallback}});var h=r(1389);Object.defineProperty(t,"KeywordRecognitionModel",{enumerable:!0,get:function(){return h.KeywordRecognitionModel}});var d=r(4549);Object.defineProperty(t,"SessionEventArgs",{enumerable:!0,get:function(){return d.SessionEventArgs}});var l=r(6376);Object.defineProperty(t,"RecognitionEventArgs",{enumerable:!0,get:function(){return l.RecognitionEventArgs}});var p=r(5310);Object.defineProperty(t,"OutputFormat",{enumerable:!0,get:function(){return p.OutputFormat}});var f=r(362);Object.defineProperty(t,"IntentRecognitionEventArgs",{enumerable:!0,get:function(){return f.IntentRecognitionEventArgs}});var v=r(2548);Object.defineProperty(t,"RecognitionResult",{enumerable:!0,get:function(){return v.RecognitionResult}});var g=r(8194);Object.defineProperty(t,"SpeechRecognitionResult",{enumerable:!0,get:function(){return g.SpeechRecognitionResult}});var m=r(1430);Object.defineProperty(t,"IntentRecognitionResult",{enumerable:!0,get:function(){return m.IntentRecognitionResult}});var y=r(9165);Object.defineProperty(t,"LanguageUnderstandingModel",{enumerable:!0,get:function(){return y.LanguageUnderstandingModel}});var b=r(7710);Object.defineProperty(t,"SpeechRecognitionEventArgs",{enumerable:!0,get:function(){return b.SpeechRecognitionEventArgs}}),Object.defineProperty(t,"ConversationTranscriptionEventArgs",{enumerable:!0,get:function(){return b.ConversationTranscriptionEventArgs}}),Object.defineProperty(t,"MeetingTranscriptionEventArgs",{enumerable:!0,get:function(){return b.MeetingTranscriptionEventArgs}});var S=r(7207);Object.defineProperty(t,"SpeechRecognitionCanceledEventArgs",{enumerable:!0,get:function(){return S.SpeechRecognitionCanceledEventArgs}});var C=r(1977);Object.defineProperty(t,"TranslationRecognitionEventArgs",{enumerable:!0,get:function(){return C.TranslationRecognitionEventArgs}});var w=r(2654);Object.defineProperty(t,"TranslationSynthesisEventArgs",{enumerable:!0,get:function(){return w.TranslationSynthesisEventArgs}});var P=r(919);Object.defineProperty(t,"TranslationRecognitionResult",{enumerable:!0,get:function(){return P.TranslationRecognitionResult}});var A=r(8434);Object.defineProperty(t,"TranslationSynthesisResult",{enumerable:!0,get:function(){return A.TranslationSynthesisResult}});var I=r(7065);Object.defineProperty(t,"ResultReason",{enumerable:!0,get:function(){return I.ResultReason}});var R=r(1236);Object.defineProperty(t,"SpeechConfig",{enumerable:!0,get:function(){return R.SpeechConfig}}),Object.defineProperty(t,"SpeechConfigImpl",{enumerable:!0,get:function(){return R.SpeechConfigImpl}});var E=r(9701);Object.defineProperty(t,"SpeechTranslationConfig",{enumerable:!0,get:function(){return E.SpeechTranslationConfig}}),Object.defineProperty(t,"SpeechTranslationConfigImpl",{enumerable:!0,get:function(){return E.SpeechTranslationConfigImpl}});var T=r(7317);Object.defineProperty(t,"PropertyCollection",{enumerable:!0,get:function(){return T.PropertyCollection}});var M=r(6300);Object.defineProperty(t,"PropertyId",{enumerable:!0,get:function(){return M.PropertyId}});var k=r(478);Object.defineProperty(t,"Recognizer",{enumerable:!0,get:function(){return k.Recognizer}});var O=r(1432);Object.defineProperty(t,"SpeechRecognizer",{enumerable:!0,get:function(){return O.SpeechRecognizer}});var _=r(9876);Object.defineProperty(t,"IntentRecognizer",{enumerable:!0,get:function(){return _.IntentRecognizer}});var x=r(4415);Object.defineProperty(t,"VoiceProfileType",{enumerable:!0,get:function(){return x.VoiceProfileType}});var N=r(4635);Object.defineProperty(t,"TranslationRecognizer",{enumerable:!0,get:function(){return N.TranslationRecognizer}});var D=r(1648);Object.defineProperty(t,"Translations",{enumerable:!0,get:function(){return D.Translations}});var z=r(942);Object.defineProperty(t,"NoMatchReason",{enumerable:!0,get:function(){return z.NoMatchReason}});var L=r(802);Object.defineProperty(t,"NoMatchDetails",{enumerable:!0,get:function(){return L.NoMatchDetails}});var B=r(5576);Object.defineProperty(t,"TranslationRecognitionCanceledEventArgs",{enumerable:!0,get:function(){return B.TranslationRecognitionCanceledEventArgs}});var F=r(6731);Object.defineProperty(t,"IntentRecognitionCanceledEventArgs",{enumerable:!0,get:function(){return F.IntentRecognitionCanceledEventArgs}});var j=r(6352);Object.defineProperty(t,"CancellationDetailsBase",{enumerable:!0,get:function(){return j.CancellationDetailsBase}});var U=r(9446);Object.defineProperty(t,"CancellationDetails",{enumerable:!0,get:function(){return U.CancellationDetails}});var q=r(5711);Object.defineProperty(t,"CancellationErrorCode",{enumerable:!0,get:function(){return q.CancellationErrorCode}});var W=r(9911);Object.defineProperty(t,"ConnectionEventArgs",{enumerable:!0,get:function(){return W.ConnectionEventArgs}});var K=r(9176);Object.defineProperty(t,"ServiceEventArgs",{enumerable:!0,get:function(){return K.ServiceEventArgs}});var H=r(9112);Object.defineProperty(t,"Connection",{enumerable:!0,get:function(){return H.Connection}});var V=r(5571);Object.defineProperty(t,"PhraseListGrammar",{enumerable:!0,get:function(){return V.PhraseListGrammar}});var G=r(9707);Object.defineProperty(t,"DialogServiceConfig",{enumerable:!0,get:function(){return G.DialogServiceConfig}});var J=r(3553);Object.defineProperty(t,"BotFrameworkConfig",{enumerable:!0,get:function(){return J.BotFrameworkConfig}});var $=r(1575);Object.defineProperty(t,"CustomCommandsConfig",{enumerable:!0,get:function(){return $.CustomCommandsConfig}});var Q=r(6558);Object.defineProperty(t,"DialogServiceConnector",{enumerable:!0,get:function(){return Q.DialogServiceConnector}});var Y=r(425);Object.defineProperty(t,"ActivityReceivedEventArgs",{enumerable:!0,get:function(){return Y.ActivityReceivedEventArgs}});var X=r(4177);Object.defineProperty(t,"TurnStatusReceivedEventArgs",{enumerable:!0,get:function(){return X.TurnStatusReceivedEventArgs}});var Z=r(2277);Object.defineProperty(t,"ServicePropertyChannel",{enumerable:!0,get:function(){return Z.ServicePropertyChannel}});var ee=r(9995);Object.defineProperty(t,"ProfanityOption",{enumerable:!0,get:function(){return ee.ProfanityOption}});var te=r(8987);Object.defineProperty(t,"BaseAudioPlayer",{enumerable:!0,get:function(){return te.BaseAudioPlayer}});var re=r(3020);Object.defineProperty(t,"ConnectionMessageEventArgs",{enumerable:!0,get:function(){return re.ConnectionMessageEventArgs}});var ie=r(2501);Object.defineProperty(t,"ConnectionMessage",{enumerable:!0,get:function(){return ie.ConnectionMessage}});var ne=r(1063);Object.defineProperty(t,"VoiceProfile",{enumerable:!0,get:function(){return ne.VoiceProfile}});var oe=r(9138);Object.defineProperty(t,"VoiceProfileEnrollmentResult",{enumerable:!0,get:function(){return oe.VoiceProfileEnrollmentResult}}),Object.defineProperty(t,"VoiceProfileEnrollmentCancellationDetails",{enumerable:!0,get:function(){return oe.VoiceProfileEnrollmentCancellationDetails}});var se=r(4458);Object.defineProperty(t,"VoiceProfileResult",{enumerable:!0,get:function(){return se.VoiceProfileResult}}),Object.defineProperty(t,"VoiceProfileCancellationDetails",{enumerable:!0,get:function(){return se.VoiceProfileCancellationDetails}});var ae=r(2563);Object.defineProperty(t,"VoiceProfilePhraseResult",{enumerable:!0,get:function(){return ae.VoiceProfilePhraseResult}});var ce=r(644);Object.defineProperty(t,"VoiceProfileClient",{enumerable:!0,get:function(){return ce.VoiceProfileClient}});var ue=r(4361);Object.defineProperty(t,"SpeakerRecognizer",{enumerable:!0,get:function(){return ue.SpeakerRecognizer}});var he=r(4128);Object.defineProperty(t,"SpeakerIdentificationModel",{enumerable:!0,get:function(){return he.SpeakerIdentificationModel}});var de=r(471);Object.defineProperty(t,"SpeakerVerificationModel",{enumerable:!0,get:function(){return de.SpeakerVerificationModel}});var le=r(3785);Object.defineProperty(t,"AutoDetectSourceLanguageConfig",{enumerable:!0,get:function(){return le.AutoDetectSourceLanguageConfig}});var pe=r(1474);Object.defineProperty(t,"AutoDetectSourceLanguageResult",{enumerable:!0,get:function(){return pe.AutoDetectSourceLanguageResult}});var fe=r(3173);Object.defineProperty(t,"SourceLanguageConfig",{enumerable:!0,get:function(){return fe.SourceLanguageConfig}});var ve=r(1681);Object.defineProperty(t,"SpeakerRecognitionResult",{enumerable:!0,get:function(){return ve.SpeakerRecognitionResult}}),Object.defineProperty(t,"SpeakerRecognitionResultType",{enumerable:!0,get:function(){return ve.SpeakerRecognitionResultType}}),Object.defineProperty(t,"SpeakerRecognitionCancellationDetails",{enumerable:!0,get:function(){return ve.SpeakerRecognitionCancellationDetails}});var ge=r(2966);Object.defineProperty(t,"Conversation",{enumerable:!0,get:function(){return ge.Conversation}}),Object.defineProperty(t,"ConversationExpirationEventArgs",{enumerable:!0,get:function(){return ge.ConversationExpirationEventArgs}}),Object.defineProperty(t,"ConversationParticipantsChangedEventArgs",{enumerable:!0,get:function(){return ge.ConversationParticipantsChangedEventArgs}}),Object.defineProperty(t,"ConversationTranslationCanceledEventArgs",{enumerable:!0,get:function(){return ge.ConversationTranslationCanceledEventArgs}}),Object.defineProperty(t,"ConversationTranslationEventArgs",{enumerable:!0,get:function(){return ge.ConversationTranslationEventArgs}}),Object.defineProperty(t,"ConversationTranslationResult",{enumerable:!0,get:function(){return ge.ConversationTranslationResult}}),Object.defineProperty(t,"ConversationTranslator",{enumerable:!0,get:function(){return ge.ConversationTranslator}}),Object.defineProperty(t,"ConversationTranscriber",{enumerable:!0,get:function(){return ge.ConversationTranscriber}}),Object.defineProperty(t,"ConversationTranscriptionResult",{enumerable:!0,get:function(){return ge.ConversationTranscriptionResult}}),Object.defineProperty(t,"Meeting",{enumerable:!0,get:function(){return ge.Meeting}}),Object.defineProperty(t,"MeetingTranscriber",{enumerable:!0,get:function(){return ge.MeetingTranscriber}}),Object.defineProperty(t,"Participant",{enumerable:!0,get:function(){return ge.Participant}}),Object.defineProperty(t,"ParticipantChangedReason",{enumerable:!0,get:function(){return ge.ParticipantChangedReason}}),Object.defineProperty(t,"User",{enumerable:!0,get:function(){return ge.User}});var me=r(4040);Object.defineProperty(t,"Synthesizer",{enumerable:!0,get:function(){return me.Synthesizer}});var ye=r(8268);Object.defineProperty(t,"SpeechSynthesisOutputFormat",{enumerable:!0,get:function(){return ye.SpeechSynthesisOutputFormat}});var be=r(4102);Object.defineProperty(t,"SpeechSynthesizer",{enumerable:!0,get:function(){return be.SpeechSynthesizer}});var Se=r(8585);Object.defineProperty(t,"SynthesisResult",{enumerable:!0,get:function(){return Se.SynthesisResult}});var Ce=r(251);Object.defineProperty(t,"SpeechSynthesisResult",{enumerable:!0,get:function(){return Ce.SpeechSynthesisResult}});var we=r(6389);Object.defineProperty(t,"SpeechSynthesisEventArgs",{enumerable:!0,get:function(){return we.SpeechSynthesisEventArgs}});var Pe=r(8267);Object.defineProperty(t,"SpeechSynthesisWordBoundaryEventArgs",{enumerable:!0,get:function(){return Pe.SpeechSynthesisWordBoundaryEventArgs}});var Ae=r(705);Object.defineProperty(t,"SpeechSynthesisBookmarkEventArgs",{enumerable:!0,get:function(){return Ae.SpeechSynthesisBookmarkEventArgs}});var Ie=r(580);Object.defineProperty(t,"SpeechSynthesisVisemeEventArgs",{enumerable:!0,get:function(){return Ie.SpeechSynthesisVisemeEventArgs}});var Re=r(8252);Object.defineProperty(t,"SpeechSynthesisBoundaryType",{enumerable:!0,get:function(){return Re.SpeechSynthesisBoundaryType}});var Ee=r(2546);Object.defineProperty(t,"SynthesisVoicesResult",{enumerable:!0,get:function(){return Ee.SynthesisVoicesResult}});var Te=r(3400);Object.defineProperty(t,"SynthesisVoiceGender",{enumerable:!0,get:function(){return Te.SynthesisVoiceGender}}),Object.defineProperty(t,"SynthesisVoiceType",{enumerable:!0,get:function(){return Te.SynthesisVoiceType}}),Object.defineProperty(t,"VoiceInfo",{enumerable:!0,get:function(){return Te.VoiceInfo}});var Me=r(4884);Object.defineProperty(t,"SpeakerAudioDestination",{enumerable:!0,get:function(){return Me.SpeakerAudioDestination}});var ke=r(2079);Object.defineProperty(t,"ConversationTranscriptionCanceledEventArgs",{enumerable:!0,get:function(){return ke.ConversationTranscriptionCanceledEventArgs}});var Oe=r(7351);Object.defineProperty(t,"MeetingTranscriptionCanceledEventArgs",{enumerable:!0,get:function(){return Oe.MeetingTranscriptionCanceledEventArgs}});var _e=r(472);Object.defineProperty(t,"PronunciationAssessmentGradingSystem",{enumerable:!0,get:function(){return _e.PronunciationAssessmentGradingSystem}});var xe=r(2929);Object.defineProperty(t,"PronunciationAssessmentGranularity",{enumerable:!0,get:function(){return xe.PronunciationAssessmentGranularity}});var Ne=r(5551);Object.defineProperty(t,"PronunciationAssessmentConfig",{enumerable:!0,get:function(){return Ne.PronunciationAssessmentConfig}});var De=r(4572);Object.defineProperty(t,"PronunciationAssessmentResult",{enumerable:!0,get:function(){return De.PronunciationAssessmentResult}});var ze=r(616);Object.defineProperty(t,"LanguageIdMode",{enumerable:!0,get:function(){return ze.LanguageIdMode}});var Le=r(1491);Object.defineProperty(t,"AvatarConfig",{enumerable:!0,get:function(){return Le.AvatarConfig}});var Be=r(8716);Object.defineProperty(t,"AvatarEventArgs",{enumerable:!0,get:function(){return Be.AvatarEventArgs}});var Fe=r(9071);Object.defineProperty(t,"AvatarSynthesizer",{enumerable:!0,get:function(){return Fe.AvatarSynthesizer}});var je=r(3961);Object.defineProperty(t,"AvatarVideoFormat",{enumerable:!0,get:function(){return je.AvatarVideoFormat}}),Object.defineProperty(t,"Coordinate",{enumerable:!0,get:function(){return je.Coordinate}});var Ue=r(8701);Object.defineProperty(t,"AvatarWebRTCConnectionResult",{enumerable:!0,get:function(){return Ue.AvatarWebRTCConnectionResult}});var qe=r(2842);Object.defineProperty(t,"Diagnostics",{enumerable:!0,get:function(){return qe.Diagnostics}});var We=r(5648);Object.defineProperty(t,"LogLevel",{enumerable:!0,get:function(){return We.LogLevel}})},919:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TranslationRecognitionResult=void 0;const i=r(881);class n extends i.SpeechRecognitionResult{constructor(e,t,r,i,n,o,s,a,c,u,h){super(t,r,i,n,o,s,a,void 0,c,u,h),this.privTranslations=e}static fromSpeechRecognitionResult(e){return new n(void 0,e.resultId,e.reason,e.text,e.duration,e.offset,e.language,e.languageDetectionConfidence,e.errorDetails,e.json,e.properties)}get translations(){return this.privTranslations}}t.TranslationRecognitionResult=n},942:(e,t)=>{"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.NoMatchReason=void 0,(r=t.NoMatchReason||(t.NoMatchReason={}))[r.NotRecognized=0]="NotRecognized",r[r.InitialSilenceTimeout=1]="InitialSilenceTimeout",r[r.InitialBabbleTimeout=2]="InitialBabbleTimeout"},944:e=>{"use strict";const t=new Set(["json","buffer","string"]);e.exports=e=>(...r)=>{const i=new Set;let n,o,s,a="";return r.forEach(e=>{if("string"==typeof e)if(e.toUpperCase()===e){if(n)throw new Error(`Can't set method to ${e}, already set to ${n}.`);n=e}else if(e.startsWith("http:")||e.startsWith("https:"))a=e;else{if(!t.has(e))throw new Error(`Unknown encoding, ${e}`);o=e}else if("number"==typeof e)i.add(e);else{if("object"!=typeof e)throw new Error("Unknown type: "+typeof e);if(Array.isArray(e)||e instanceof Set)e.forEach(e=>i.add(e));else{if(s)throw new Error("Cannot set headers twice.");s=e}}}),n||(n="GET"),0===i.size&&i.add(200),e(i,n,o,s,a)}},952:()=>{},1020:(e,t,r)=>{"use strict";var i=r(4012),n=Symbol.for("react.element"),o=(Symbol.for("react.fragment"),Object.prototype.hasOwnProperty),s=i.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,a={key:!0,ref:!0,__self:!0,__source:!0};function c(e,t,r){var i,c={},u=null,h=null;for(i in void 0!==r&&(u=""+r),void 0!==t.key&&(u=""+t.key),void 0!==t.ref&&(h=t.ref),t)o.call(t,i)&&!a.hasOwnProperty(i)&&(c[i]=t[i]);if(e&&e.defaultProps)for(i in t=e.defaultProps)void 0===c[i]&&(c[i]=t[i]);return{$$typeof:n,type:e,key:u,ref:h,props:c,_owner:s.current}}t.jsx=c,t.jsxs=c},1063:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.VoiceProfile=void 0,t.VoiceProfile=class{constructor(e,t){this.privId=e,this.privProfileType=t}get profileId(){return this.privId}get profileType(){return this.privProfileType}}},1120:function(e,t,r){"use strict";var i=this&&this.__createBinding||(Object.create?function(e,t,r,i){void 0===i&&(i=r),Object.defineProperty(e,i,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,i){void 0===i&&(i=r),e[i]=t[r]}),n=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&i(t,e,r);return n(t,e),t},s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.WebsocketMessageAdapter=void 0;const a=o(r(8632)),c=o(r(3678)),u=s(r(6308)),h=s(r(9645)),d=s(r(4573)),l=r(7014),p=r(868);class f{constructor(e,t,r,i,n,o){if(!e)throw new p.ArgumentNullError("uri");if(!r)throw new p.ArgumentNullError("messageFormatter");this.proxyInfo=i,this.privConnectionEvents=new p.EventSource,this.privConnectionId=t,this.privMessageFormatter=r,this.privConnectionState=p.ConnectionState.None,this.privUri=e,this.privHeaders=n,this.privEnableCompression=o,this.privHeaders[l.HeaderNames.ConnectionId]=this.privConnectionId,this.privHeaders.connectionId=this.privConnectionId,this.privLastErrorReceived=""}get state(){return this.privConnectionState}open(){if(this.privConnectionState===p.ConnectionState.Disconnected)return Promise.reject(`Cannot open a connection that is in ${this.privConnectionState} state`);if(this.privConnectionEstablishDeferral)return this.privConnectionEstablishDeferral.promise;this.privConnectionEstablishDeferral=new p.Deferred,this.privCertificateValidatedDeferral=new p.Deferred,this.privConnectionState=p.ConnectionState.Connecting;try{if("undefined"==typeof WebSocket||f.forceNpmWebSocket){let e=new URL(this.privUri).protocol;"wss:"===e?.toLocaleLowerCase()?e="https:":"ws:"===e?.toLocaleLowerCase()&&(e="http:");const t={headers:this.privHeaders,perMessageDeflate:this.privEnableCompression,followRedirects:"https:"===e.toLocaleLowerCase()};this.privCertificateValidatedDeferral.resolve(),t.agent=this.getAgent(),t.agent.protocol=e,this.privWebsocketClient=new d.default(this.privUri,t),this.privWebsocketClient.on("redirect",e=>{const t=new p.ConnectionRedirectEvent(this.privConnectionId,e,this.privUri,`Getting redirect URL from endpoint ${this.privUri} with redirect URL '${e}'`);p.Events.instance.onEvent(t)})}else this.privCertificateValidatedDeferral.resolve(),this.privWebsocketClient=new WebSocket(this.privUri);this.privWebsocketClient.binaryType="arraybuffer",this.privReceivingMessageQueue=new p.Queue,this.privDisconnectDeferral=new p.Deferred,this.privSendMessageQueue=new p.Queue,this.processSendQueue().catch(e=>{p.Events.instance.onEvent(new p.BackgroundEvent(e))})}catch(e){return this.privConnectionEstablishDeferral.resolve(new p.ConnectionOpenResponse(500,e)),this.privConnectionEstablishDeferral.promise}return this.onEvent(new p.ConnectionStartEvent(this.privConnectionId,this.privUri)),this.privWebsocketClient.onopen=()=>{this.privCertificateValidatedDeferral.promise.then(()=>{this.privConnectionState=p.ConnectionState.Connected,this.onEvent(new p.ConnectionEstablishedEvent(this.privConnectionId)),this.privConnectionEstablishDeferral.resolve(new p.ConnectionOpenResponse(200,""))},e=>{this.privConnectionEstablishDeferral.reject(e)})},this.privWebsocketClient.onerror=e=>{this.onEvent(new p.ConnectionErrorEvent(this.privConnectionId,e.message,e.type)),this.privLastErrorReceived=e.message},this.privWebsocketClient.onclose=e=>{this.privConnectionState===p.ConnectionState.Connecting?(this.privConnectionState=p.ConnectionState.Disconnected,this.privConnectionEstablishDeferral.resolve(new p.ConnectionOpenResponse(e.code,e.reason+" "+this.privLastErrorReceived))):(this.privConnectionState=p.ConnectionState.Disconnected,this.privWebsocketClient=null,this.onEvent(new p.ConnectionClosedEvent(this.privConnectionId,e.code,e.reason))),this.onClose(e.code,e.reason).catch(e=>{p.Events.instance.onEvent(new p.BackgroundEvent(e))})},this.privWebsocketClient.onmessage=e=>{const t=(new Date).toISOString();if(this.privConnectionState===p.ConnectionState.Connected){const r=new p.Deferred;if(this.privReceivingMessageQueue.enqueueFromPromise(r.promise),e.data instanceof ArrayBuffer){const i=new p.RawWebsocketMessage(p.MessageType.Binary,e.data);this.privMessageFormatter.toConnectionMessage(i).then(e=>{this.onEvent(new p.ConnectionMessageReceivedEvent(this.privConnectionId,t,e)),r.resolve(e)},e=>{r.reject(`Invalid binary message format. Error: ${e}`)})}else{const i=new p.RawWebsocketMessage(p.MessageType.Text,e.data);this.privMessageFormatter.toConnectionMessage(i).then(e=>{this.onEvent(new p.ConnectionMessageReceivedEvent(this.privConnectionId,t,e)),r.resolve(e)},e=>{r.reject(`Invalid text message format. Error: ${e}`)})}}},this.privConnectionEstablishDeferral.promise}send(e){if(this.privConnectionState!==p.ConnectionState.Connected)return Promise.reject(`Cannot send on connection that is in ${p.ConnectionState[this.privConnectionState]} state`);const t=new p.Deferred,r=new p.Deferred;return this.privSendMessageQueue.enqueueFromPromise(r.promise),this.privMessageFormatter.fromConnectionMessage(e).then(i=>{r.resolve({Message:e,RawWebsocketMessage:i,sendStatusDeferral:t})},e=>{r.reject(`Error formatting the message. ${e}`)}),t.promise}read(){return this.privConnectionState!==p.ConnectionState.Connected?Promise.reject(`Cannot read on connection that is in ${this.privConnectionState} state`):this.privReceivingMessageQueue.dequeue()}close(e){return this.privWebsocketClient?(this.privConnectionState!==p.ConnectionState.Disconnected&&this.privWebsocketClient.close(1e3,e||"Normal closure by client"),this.privDisconnectDeferral.promise):Promise.resolve()}get events(){return this.privConnectionEvents}sendRawMessage(e){try{return e?(this.onEvent(new p.ConnectionMessageSentEvent(this.privConnectionId,(new Date).toISOString(),e.Message)),this.isWebsocketOpen?(this.privWebsocketClient.send(e.RawWebsocketMessage.payload),Promise.resolve()):Promise.reject("websocket send error: Websocket not ready "+this.privConnectionId+" "+e.Message.id+" "+(new Error).stack)):Promise.resolve()}catch(e){return Promise.reject(`websocket send error: ${e}`)}}async onClose(e,t){const r=`Connection closed. ${e}: ${t}`;this.privConnectionState=p.ConnectionState.Disconnected,this.privDisconnectDeferral.resolve(),await this.privReceivingMessageQueue.drainAndDispose(()=>{},r),await this.privSendMessageQueue.drainAndDispose(e=>{e.sendStatusDeferral.reject(r)},r)}async processSendQueue(){for(;;){const e=this.privSendMessageQueue.dequeue(),t=await e;if(!t)return;try{await this.sendRawMessage(t),t.sendStatusDeferral.resolve()}catch(e){t.sendStatusDeferral.reject(e)}}}onEvent(e){this.privConnectionEvents.onEvent(e),p.Events.instance.onEvent(e)}getAgent(){const e=new u.default.Agent(this.createConnection);return void 0!==this.proxyInfo&&void 0!==this.proxyInfo.HostName&&this.proxyInfo.Port>0&&(e.proxyInfo=this.proxyInfo),e}static GetProxyAgent(e){const t={host:e.HostName,port:e.Port};return e.UserName?t.headers={"Proxy-Authentication":"Basic "+Buffer.from(`${e.UserName}:${void 0===e.Password?"":e.Password}`).toString("base64")}:t.headers={},t.headers.requestOCSP="true",new h.default(t)}createConnection(e,t){let r;if(t={...t,requestOCSP:!0,servername:t.host},this.proxyInfo){const i=f.GetProxyAgent(this.proxyInfo);r=new Promise((r,n)=>{i.callback(e,t,(e,t)=>{e?n(e):r(t)})})}else r=t.secureEndpoint?Promise.resolve(c.connect(t)):Promise.resolve(a.connect(t));return r}get isWebsocketOpen(){return this.privWebsocketClient&&this.privWebsocketClient.readyState===this.privWebsocketClient.OPEN}}t.WebsocketMessageAdapter=f,f.forceNpmWebSocket=!1},1124:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DeferralMap=void 0,t.DeferralMap=class{constructor(){this.privMap={}}add(e,t){this.privMap[e]=t}getId(e){return this.privMap[e]}complete(e,t){try{this.privMap[e].resolve(t)}catch(t){this.privMap[e].reject(t)}finally{this.privMap[e]=void 0}}}},1176:(e,t,r)=>{var i;!function(){"use strict";var n="input is invalid type",o="object"==typeof window,s=o?window:{};s.JS_SHA3_NO_WINDOW&&(o=!1);var a=!o&&"object"==typeof self;!s.JS_SHA3_NO_NODE_JS&&"object"==typeof process&&process.versions&&process.versions.node?s=r.g:a&&(s=self);var c=!s.JS_SHA3_NO_COMMON_JS&&e.exports,u=r.amdO,h=!s.JS_SHA3_NO_ARRAY_BUFFER&&"undefined"!=typeof ArrayBuffer,d="0123456789abcdef".split(""),l=[4,1024,262144,67108864],p=[0,8,16,24],f=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],v=[224,256,384,512],g=[128,256],m=["hex","buffer","arrayBuffer","array","digest"],y={128:168,256:136};!s.JS_SHA3_NO_NODE_JS&&Array.isArray||(Array.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),!h||!s.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW&&ArrayBuffer.isView||(ArrayBuffer.isView=function(e){return"object"==typeof e&&e.buffer&&e.buffer.constructor===ArrayBuffer});for(var b=function(e,t,r){return function(i){return new N(e,t,e).update(i)[r]()}},S=function(e,t,r){return function(i,n){return new N(e,t,n).update(i)[r]()}},C=function(e,t,r){return function(t,i,n,o){return R["cshake"+e].update(t,i,n,o)[r]()}},w=function(e,t,r){return function(t,i,n,o){return R["kmac"+e].update(t,i,n,o)[r]()}},P=function(e,t,r,i){for(var n=0;n<m.length;++n){var o=m[n];e[o]=t(r,i,o)}return e},A=function(e,t){var r=b(e,t,"hex");return r.create=function(){return new N(e,t,e)},r.update=function(e){return r.create().update(e)},P(r,b,e,t)},I=[{name:"keccak",padding:[1,256,65536,16777216],bits:v,createMethod:A},{name:"sha3",padding:[6,1536,393216,100663296],bits:v,createMethod:A},{name:"shake",padding:[31,7936,2031616,520093696],bits:g,createMethod:function(e,t){var r=S(e,t,"hex");return r.create=function(r){return new N(e,t,r)},r.update=function(e,t){return r.create(t).update(e)},P(r,S,e,t)}},{name:"cshake",padding:l,bits:g,createMethod:function(e,t){var r=y[e],i=C(e,0,"hex");return i.create=function(i,n,o){return n||o?new N(e,t,i).bytepad([n,o],r):R["shake"+e].create(i)},i.update=function(e,t,r,n){return i.create(t,r,n).update(e)},P(i,C,e,t)}},{name:"kmac",padding:l,bits:g,createMethod:function(e,t){var r=y[e],i=w(e,0,"hex");return i.create=function(i,n,o){return new D(e,t,n).bytepad(["KMAC",o],r).bytepad([i],r)},i.update=function(e,t,r,n){return i.create(e,r,n).update(t)},P(i,w,e,t)}}],R={},E=[],T=0;T<I.length;++T)for(var M=I[T],k=M.bits,O=0;O<k.length;++O){var _=M.name+"_"+k[O];if(E.push(_),R[_]=M.createMethod(k[O],M.padding),"sha3"!==M.name){var x=M.name+k[O];E.push(x),R[x]=R[_]}}function N(e,t,r){this.blocks=[],this.s=[],this.padding=t,this.outputBits=r,this.reset=!0,this.finalized=!1,this.block=0,this.start=0,this.blockCount=1600-(e<<1)>>5,this.byteCount=this.blockCount<<2,this.outputBlocks=r>>5,this.extraBytes=(31&r)>>3;for(var i=0;i<50;++i)this.s[i]=0}function D(e,t,r){N.call(this,e,t,r)}N.prototype.update=function(e){if(this.finalized)throw new Error("finalize already called");var t,r=typeof e;if("string"!==r){if("object"!==r)throw new Error(n);if(null===e)throw new Error(n);if(h&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!(Array.isArray(e)||h&&ArrayBuffer.isView(e)))throw new Error(n);t=!0}for(var i,o,s=this.blocks,a=this.byteCount,c=e.length,u=this.blockCount,d=0,l=this.s;d<c;){if(this.reset)for(this.reset=!1,s[0]=this.block,i=1;i<u+1;++i)s[i]=0;if(t)for(i=this.start;d<c&&i<a;++d)s[i>>2]|=e[d]<<p[3&i++];else for(i=this.start;d<c&&i<a;++d)(o=e.charCodeAt(d))<128?s[i>>2]|=o<<p[3&i++]:o<2048?(s[i>>2]|=(192|o>>6)<<p[3&i++],s[i>>2]|=(128|63&o)<<p[3&i++]):o<55296||o>=57344?(s[i>>2]|=(224|o>>12)<<p[3&i++],s[i>>2]|=(128|o>>6&63)<<p[3&i++],s[i>>2]|=(128|63&o)<<p[3&i++]):(o=65536+((1023&o)<<10|1023&e.charCodeAt(++d)),s[i>>2]|=(240|o>>18)<<p[3&i++],s[i>>2]|=(128|o>>12&63)<<p[3&i++],s[i>>2]|=(128|o>>6&63)<<p[3&i++],s[i>>2]|=(128|63&o)<<p[3&i++]);if(this.lastByteIndex=i,i>=a){for(this.start=i-a,this.block=s[u],i=0;i<u;++i)l[i]^=s[i];z(l),this.reset=!0}else this.start=i}return this},N.prototype.encode=function(e,t){var r=255&e,i=1,n=[r];for(r=255&(e>>=8);r>0;)n.unshift(r),r=255&(e>>=8),++i;return t?n.push(i):n.unshift(i),this.update(n),n.length},N.prototype.encodeString=function(e){var t,r=typeof e;if("string"!==r){if("object"!==r)throw new Error(n);if(null===e)throw new Error(n);if(h&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!(Array.isArray(e)||h&&ArrayBuffer.isView(e)))throw new Error(n);t=!0}var i=0,o=e.length;if(t)i=o;else for(var s=0;s<e.length;++s){var a=e.charCodeAt(s);a<128?i+=1:a<2048?i+=2:a<55296||a>=57344?i+=3:(a=65536+((1023&a)<<10|1023&e.charCodeAt(++s)),i+=4)}return i+=this.encode(8*i),this.update(e),i},N.prototype.bytepad=function(e,t){for(var r=this.encode(t),i=0;i<e.length;++i)r+=this.encodeString(e[i]);var n=t-r%t,o=[];return o.length=n,this.update(o),this},N.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var e=this.blocks,t=this.lastByteIndex,r=this.blockCount,i=this.s;if(e[t>>2]|=this.padding[3&t],this.lastByteIndex===this.byteCount)for(e[0]=e[r],t=1;t<r+1;++t)e[t]=0;for(e[r-1]|=2147483648,t=0;t<r;++t)i[t]^=e[t];z(i)}},N.prototype.toString=N.prototype.hex=function(){this.finalize();for(var e,t=this.blockCount,r=this.s,i=this.outputBlocks,n=this.extraBytes,o=0,s=0,a="";s<i;){for(o=0;o<t&&s<i;++o,++s)e=r[o],a+=d[e>>4&15]+d[15&e]+d[e>>12&15]+d[e>>8&15]+d[e>>20&15]+d[e>>16&15]+d[e>>28&15]+d[e>>24&15];s%t===0&&(z(r),o=0)}return n&&(e=r[o],a+=d[e>>4&15]+d[15&e],n>1&&(a+=d[e>>12&15]+d[e>>8&15]),n>2&&(a+=d[e>>20&15]+d[e>>16&15])),a},N.prototype.arrayBuffer=function(){this.finalize();var e,t=this.blockCount,r=this.s,i=this.outputBlocks,n=this.extraBytes,o=0,s=0,a=this.outputBits>>3;e=n?new ArrayBuffer(i+1<<2):new ArrayBuffer(a);for(var c=new Uint32Array(e);s<i;){for(o=0;o<t&&s<i;++o,++s)c[s]=r[o];s%t===0&&z(r)}return n&&(c[o]=r[o],e=e.slice(0,a)),e},N.prototype.buffer=N.prototype.arrayBuffer,N.prototype.digest=N.prototype.array=function(){this.finalize();for(var e,t,r=this.blockCount,i=this.s,n=this.outputBlocks,o=this.extraBytes,s=0,a=0,c=[];a<n;){for(s=0;s<r&&a<n;++s,++a)e=a<<2,t=i[s],c[e]=255&t,c[e+1]=t>>8&255,c[e+2]=t>>16&255,c[e+3]=t>>24&255;a%r===0&&z(i)}return o&&(e=a<<2,t=i[s],c[e]=255&t,o>1&&(c[e+1]=t>>8&255),o>2&&(c[e+2]=t>>16&255)),c},D.prototype=new N,D.prototype.finalize=function(){return this.encode(this.outputBits,!0),N.prototype.finalize.call(this)};var z=function(e){var t,r,i,n,o,s,a,c,u,h,d,l,p,v,g,m,y,b,S,C,w,P,A,I,R,E,T,M,k,O,_,x,N,D,z,L,B,F,j,U,q,W,K,H,V,G,J,$,Q,Y,X,Z,ee,te,re,ie,ne,oe,se,ae,ce,ue,he;for(i=0;i<48;i+=2)n=e[0]^e[10]^e[20]^e[30]^e[40],o=e[1]^e[11]^e[21]^e[31]^e[41],s=e[2]^e[12]^e[22]^e[32]^e[42],a=e[3]^e[13]^e[23]^e[33]^e[43],c=e[4]^e[14]^e[24]^e[34]^e[44],u=e[5]^e[15]^e[25]^e[35]^e[45],h=e[6]^e[16]^e[26]^e[36]^e[46],d=e[7]^e[17]^e[27]^e[37]^e[47],t=(l=e[8]^e[18]^e[28]^e[38]^e[48])^(s<<1|a>>>31),r=(p=e[9]^e[19]^e[29]^e[39]^e[49])^(a<<1|s>>>31),e[0]^=t,e[1]^=r,e[10]^=t,e[11]^=r,e[20]^=t,e[21]^=r,e[30]^=t,e[31]^=r,e[40]^=t,e[41]^=r,t=n^(c<<1|u>>>31),r=o^(u<<1|c>>>31),e[2]^=t,e[3]^=r,e[12]^=t,e[13]^=r,e[22]^=t,e[23]^=r,e[32]^=t,e[33]^=r,e[42]^=t,e[43]^=r,t=s^(h<<1|d>>>31),r=a^(d<<1|h>>>31),e[4]^=t,e[5]^=r,e[14]^=t,e[15]^=r,e[24]^=t,e[25]^=r,e[34]^=t,e[35]^=r,e[44]^=t,e[45]^=r,t=c^(l<<1|p>>>31),r=u^(p<<1|l>>>31),e[6]^=t,e[7]^=r,e[16]^=t,e[17]^=r,e[26]^=t,e[27]^=r,e[36]^=t,e[37]^=r,e[46]^=t,e[47]^=r,t=h^(n<<1|o>>>31),r=d^(o<<1|n>>>31),e[8]^=t,e[9]^=r,e[18]^=t,e[19]^=r,e[28]^=t,e[29]^=r,e[38]^=t,e[39]^=r,e[48]^=t,e[49]^=r,v=e[0],g=e[1],G=e[11]<<4|e[10]>>>28,J=e[10]<<4|e[11]>>>28,M=e[20]<<3|e[21]>>>29,k=e[21]<<3|e[20]>>>29,ae=e[31]<<9|e[30]>>>23,ce=e[30]<<9|e[31]>>>23,W=e[40]<<18|e[41]>>>14,K=e[41]<<18|e[40]>>>14,D=e[2]<<1|e[3]>>>31,z=e[3]<<1|e[2]>>>31,m=e[13]<<12|e[12]>>>20,y=e[12]<<12|e[13]>>>20,$=e[22]<<10|e[23]>>>22,Q=e[23]<<10|e[22]>>>22,O=e[33]<<13|e[32]>>>19,_=e[32]<<13|e[33]>>>19,ue=e[42]<<2|e[43]>>>30,he=e[43]<<2|e[42]>>>30,te=e[5]<<30|e[4]>>>2,re=e[4]<<30|e[5]>>>2,L=e[14]<<6|e[15]>>>26,B=e[15]<<6|e[14]>>>26,b=e[25]<<11|e[24]>>>21,S=e[24]<<11|e[25]>>>21,Y=e[34]<<15|e[35]>>>17,X=e[35]<<15|e[34]>>>17,x=e[45]<<29|e[44]>>>3,N=e[44]<<29|e[45]>>>3,I=e[6]<<28|e[7]>>>4,R=e[7]<<28|e[6]>>>4,ie=e[17]<<23|e[16]>>>9,ne=e[16]<<23|e[17]>>>9,F=e[26]<<25|e[27]>>>7,j=e[27]<<25|e[26]>>>7,C=e[36]<<21|e[37]>>>11,w=e[37]<<21|e[36]>>>11,Z=e[47]<<24|e[46]>>>8,ee=e[46]<<24|e[47]>>>8,H=e[8]<<27|e[9]>>>5,V=e[9]<<27|e[8]>>>5,E=e[18]<<20|e[19]>>>12,T=e[19]<<20|e[18]>>>12,oe=e[29]<<7|e[28]>>>25,se=e[28]<<7|e[29]>>>25,U=e[38]<<8|e[39]>>>24,q=e[39]<<8|e[38]>>>24,P=e[48]<<14|e[49]>>>18,A=e[49]<<14|e[48]>>>18,e[0]=v^~m&b,e[1]=g^~y&S,e[10]=I^~E&M,e[11]=R^~T&k,e[20]=D^~L&F,e[21]=z^~B&j,e[30]=H^~G&$,e[31]=V^~J&Q,e[40]=te^~ie&oe,e[41]=re^~ne&se,e[2]=m^~b&C,e[3]=y^~S&w,e[12]=E^~M&O,e[13]=T^~k&_,e[22]=L^~F&U,e[23]=B^~j&q,e[32]=G^~$&Y,e[33]=J^~Q&X,e[42]=ie^~oe&ae,e[43]=ne^~se&ce,e[4]=b^~C&P,e[5]=S^~w&A,e[14]=M^~O&x,e[15]=k^~_&N,e[24]=F^~U&W,e[25]=j^~q&K,e[34]=$^~Y&Z,e[35]=Q^~X&ee,e[44]=oe^~ae&ue,e[45]=se^~ce&he,e[6]=C^~P&v,e[7]=w^~A&g,e[16]=O^~x&I,e[17]=_^~N&R,e[26]=U^~W&D,e[27]=q^~K&z,e[36]=Y^~Z&H,e[37]=X^~ee&V,e[46]=ae^~ue&te,e[47]=ce^~he&re,e[8]=P^~v&m,e[9]=A^~g&y,e[18]=x^~I&E,e[19]=N^~R&T,e[28]=W^~D&L,e[29]=K^~z&B,e[38]=Z^~H&G,e[39]=ee^~V&J,e[48]=ue^~te&ie,e[49]=he^~re&ne,e[0]^=f[i],e[1]^=f[i+1]};if(c)e.exports=R;else{for(T=0;T<E.length;++T)s[E[T]]=R[E[T]];u&&(void 0===(i=function(){return R}.call(t,r,t,e))||(e.exports=i))}}()},1236:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SpeechConfigImpl=t.SpeechConfig=void 0;const i=r(9190),n=r(5245),o=r(881);class s{constructor(){}static fromSubscription(e,t){n.Contracts.throwIfNullOrWhitespace(e,"subscriptionKey"),n.Contracts.throwIfNullOrWhitespace(t,"region");const r=new a;return r.setProperty(o.PropertyId.SpeechServiceConnection_Region,t),r.setProperty(o.PropertyId.SpeechServiceConnection_IntentRegion,t),r.setProperty(o.PropertyId.SpeechServiceConnection_Key,e),r}static fromEndpoint(e,t){n.Contracts.throwIfNull(e,"endpoint");const r="string"==typeof t&&t.trim().length>0,i="object"==typeof t&&null!==t&&"function"==typeof t.getToken,s="object"==typeof t&&null!==t&&"string"==typeof t.key;if(void 0!==t&&!r&&!i&&!s)throw new Error("Invalid 'auth' parameter: expected a non-empty API key string, a TokenCredential, or a KeyCredential.");let c;return"string"==typeof t?(c=new a,c.setProperty(o.PropertyId.SpeechServiceConnection_Key,t)):"object"==typeof t&&"function"==typeof t.getToken?c=new a(t):"object"==typeof t&&"string"==typeof t.key?(c=new a,c.setProperty(o.PropertyId.SpeechServiceConnection_Key,t.key)):c=new a,c.setProperty(o.PropertyId.SpeechServiceConnection_Endpoint,e.href),c}static fromHost(e,t){n.Contracts.throwIfNull(e,"hostName");const r=new a;return r.setProperty(o.PropertyId.SpeechServiceConnection_Host,e.protocol+"//"+e.hostname+(""===e.port?"":":"+e.port)),r.setProperty(o.PropertyId.SpeechServiceConnection_RecognitionEndpointVersion,"1"),void 0!==t&&r.setProperty(o.PropertyId.SpeechServiceConnection_Key,t),r}static fromAuthorizationToken(e,t){n.Contracts.throwIfNull(e,"authorizationToken"),n.Contracts.throwIfNullOrWhitespace(t,"region");const r=new a;return r.setProperty(o.PropertyId.SpeechServiceConnection_Region,t),r.setProperty(o.PropertyId.SpeechServiceConnection_IntentRegion,t),r.authorizationToken=e,r}close(){}}t.SpeechConfig=s;class a extends s{constructor(e){super(),this.privProperties=new o.PropertyCollection,this.speechRecognitionLanguage="en-US",this.outputFormat=o.OutputFormat.Simple,this.privTokenCredential=e}get properties(){return this.privProperties}get endPoint(){return new URL(this.privProperties.getProperty(o.PropertyId.SpeechServiceConnection_Endpoint))}get subscriptionKey(){return this.privProperties.getProperty(o.PropertyId.SpeechServiceConnection_Key)}get region(){return this.privProperties.getProperty(o.PropertyId.SpeechServiceConnection_Region)}get authorizationToken(){return this.privProperties.getProperty(o.PropertyId.SpeechServiceAuthorization_Token)}set authorizationToken(e){this.privProperties.setProperty(o.PropertyId.SpeechServiceAuthorization_Token,e)}get speechRecognitionLanguage(){return this.privProperties.getProperty(o.PropertyId.SpeechServiceConnection_RecoLanguage)}set speechRecognitionLanguage(e){this.privProperties.setProperty(o.PropertyId.SpeechServiceConnection_RecoLanguage,e)}get autoDetectSourceLanguages(){return this.privProperties.getProperty(o.PropertyId.SpeechServiceConnection_AutoDetectSourceLanguages)}set autoDetectSourceLanguages(e){this.privProperties.setProperty(o.PropertyId.SpeechServiceConnection_AutoDetectSourceLanguages,e)}get outputFormat(){return o.OutputFormat[this.privProperties.getProperty(i.OutputFormatPropertyName,void 0)]}set outputFormat(e){this.privProperties.setProperty(i.OutputFormatPropertyName,o.OutputFormat[e])}get endpointId(){return this.privProperties.getProperty(o.PropertyId.SpeechServiceConnection_EndpointId)}set endpointId(e){this.privProperties.setProperty(o.PropertyId.SpeechServiceConnection_EndpointId,e)}get tokenCredential(){return this.privTokenCredential}setProperty(e,t){n.Contracts.throwIfNull(t,"value"),this.privProperties.setProperty(e,t)}getProperty(e,t){return this.privProperties.getProperty(e,t)}setProxy(e,t,r,i){this.setProperty(o.PropertyId[o.PropertyId.SpeechServiceConnection_ProxyHostName],e),this.setProperty(o.PropertyId[o.PropertyId.SpeechServiceConnection_ProxyPort],t),this.setProperty(o.PropertyId[o.PropertyId.SpeechServiceConnection_ProxyUserName],r),this.setProperty(o.PropertyId[o.PropertyId.SpeechServiceConnection_ProxyPassword],i)}setServiceProperty(e,t){const r=JSON.parse(this.privProperties.getProperty(i.ServicePropertiesPropertyName,"{}"));r[e]=t,this.privProperties.setProperty(i.ServicePropertiesPropertyName,JSON.stringify(r))}setProfanity(e){this.privProperties.setProperty(o.PropertyId.SpeechServiceResponse_ProfanityOption,o.ProfanityOption[e])}enableAudioLogging(){this.privProperties.setProperty(o.PropertyId.SpeechServiceConnection_EnableAudioLogging,"true")}requestWordLevelTimestamps(){this.privProperties.setProperty(o.PropertyId.SpeechServiceResponse_RequestWordLevelTimestamps,"true"),this.privProperties.setProperty(i.OutputFormatPropertyName,o.OutputFormat[o.OutputFormat.Detailed])}enableDictation(){this.privProperties.setProperty(i.ForceDictationPropertyName,"true")}clone(){const e=new a(this.tokenCredential);return e.privProperties=this.privProperties.clone(),e}get speechSynthesisLanguage(){return this.privProperties.getProperty(o.PropertyId.SpeechServiceConnection_SynthLanguage)}set speechSynthesisLanguage(e){this.privProperties.setProperty(o.PropertyId.SpeechServiceConnection_SynthLanguage,e)}get speechSynthesisVoiceName(){return this.privProperties.getProperty(o.PropertyId.SpeechServiceConnection_SynthVoice)}set speechSynthesisVoiceName(e){this.privProperties.setProperty(o.PropertyId.SpeechServiceConnection_SynthVoice,e)}get speechSynthesisOutputFormat(){return o.SpeechSynthesisOutputFormat[this.privProperties.getProperty(o.PropertyId.SpeechServiceConnection_SynthOutputFormat,void 0)]}set speechSynthesisOutputFormat(e){this.privProperties.setProperty(o.PropertyId.SpeechServiceConnection_SynthOutputFormat,o.SpeechSynthesisOutputFormat[e])}}t.SpeechConfigImpl=a},1280:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i,n=(i=r(1487))&&i.__esModule?i:{default:i};t.default=function(e){return"string"==typeof e&&n.default.test(e)}},1336:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IntentResponse=void 0;class r{constructor(e){this.privIntentResponse=""===e?{}:JSON.parse(e)}static fromJSON(e){return new r(e)}get query(){return this.privIntentResponse.query}get topScoringIntent(){return this.privIntentResponse.topScoringIntent}get entities(){return this.privIntentResponse.entities}}t.IntentResponse=r},1355:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AudioOutputFormatImpl=void 0;const i=r(8268),n=r(8698);class o extends n.AudioStreamFormatImpl{constructor(e,t,r,i,n,o,s,a,c){super(r,o,t,e),this.formatTag=e,this.avgBytesPerSec=i,this.blockAlign=n,this.priAudioFormatString=s,this.priRequestAudioFormatString=a,this.priHasHeader=c}static fromSpeechSynthesisOutputFormat(e){return void 0===e?o.getDefaultOutputFormat():o.fromSpeechSynthesisOutputFormatString(o.SpeechSynthesisOutputFormatToString[e])}static fromSpeechSynthesisOutputFormatString(e){switch(e){case"raw-8khz-8bit-mono-mulaw":return new o(n.AudioFormatTag.MuLaw,1,8e3,8e3,1,8,e,e,!1);case"riff-16khz-16kbps-mono-siren":return new o(n.AudioFormatTag.Siren,1,16e3,2e3,40,0,e,"audio-16khz-16kbps-mono-siren",!0);case"audio-16khz-16kbps-mono-siren":return new o(n.AudioFormatTag.Siren,1,16e3,2e3,40,0,e,e,!1);case"audio-16khz-32kbitrate-mono-mp3":return new o(n.AudioFormatTag.MP3,1,16e3,4096,2,16,e,e,!1);case"audio-16khz-128kbitrate-mono-mp3":return new o(n.AudioFormatTag.MP3,1,16e3,16384,2,16,e,e,!1);case"audio-16khz-64kbitrate-mono-mp3":return new o(n.AudioFormatTag.MP3,1,16e3,8192,2,16,e,e,!1);case"audio-24khz-48kbitrate-mono-mp3":return new o(n.AudioFormatTag.MP3,1,24e3,6144,2,16,e,e,!1);case"audio-24khz-96kbitrate-mono-mp3":return new o(n.AudioFormatTag.MP3,1,24e3,12288,2,16,e,e,!1);case"audio-24khz-160kbitrate-mono-mp3":return new o(n.AudioFormatTag.MP3,1,24e3,20480,2,16,e,e,!1);case"raw-16khz-16bit-mono-truesilk":return new o(n.AudioFormatTag.SILKSkype,1,16e3,32e3,2,16,e,e,!1);case"riff-8khz-16bit-mono-pcm":return new o(n.AudioFormatTag.PCM,1,8e3,16e3,2,16,e,"raw-8khz-16bit-mono-pcm",!0);case"riff-24khz-16bit-mono-pcm":return new o(n.AudioFormatTag.PCM,1,24e3,48e3,2,16,e,"raw-24khz-16bit-mono-pcm",!0);case"riff-8khz-8bit-mono-mulaw":return new o(n.AudioFormatTag.MuLaw,1,8e3,8e3,1,8,e,"raw-8khz-8bit-mono-mulaw",!0);case"raw-16khz-16bit-mono-pcm":return new o(n.AudioFormatTag.PCM,1,16e3,32e3,2,16,e,"raw-16khz-16bit-mono-pcm",!1);case"raw-24khz-16bit-mono-pcm":return new o(n.AudioFormatTag.PCM,1,24e3,48e3,2,16,e,"raw-24khz-16bit-mono-pcm",!1);case"raw-8khz-16bit-mono-pcm":return new o(n.AudioFormatTag.PCM,1,8e3,16e3,2,16,e,"raw-8khz-16bit-mono-pcm",!1);case"ogg-16khz-16bit-mono-opus":return new o(n.AudioFormatTag.OGG_OPUS,1,16e3,8192,2,16,e,e,!1);case"ogg-24khz-16bit-mono-opus":return new o(n.AudioFormatTag.OGG_OPUS,1,24e3,8192,2,16,e,e,!1);case"raw-48khz-16bit-mono-pcm":return new o(n.AudioFormatTag.PCM,1,48e3,96e3,2,16,e,"raw-48khz-16bit-mono-pcm",!1);case"riff-48khz-16bit-mono-pcm":return new o(n.AudioFormatTag.PCM,1,48e3,96e3,2,16,e,"raw-48khz-16bit-mono-pcm",!0);case"audio-48khz-96kbitrate-mono-mp3":return new o(n.AudioFormatTag.MP3,1,48e3,12288,2,16,e,e,!1);case"audio-48khz-192kbitrate-mono-mp3":return new o(n.AudioFormatTag.MP3,1,48e3,24576,2,16,e,e,!1);case"ogg-48khz-16bit-mono-opus":return new o(n.AudioFormatTag.OGG_OPUS,1,48e3,12e3,2,16,e,e,!1);case"webm-16khz-16bit-mono-opus":return new o(n.AudioFormatTag.WEBM_OPUS,1,16e3,4e3,2,16,e,e,!1);case"webm-24khz-16bit-mono-opus":return new o(n.AudioFormatTag.WEBM_OPUS,1,24e3,6e3,2,16,e,e,!1);case"webm-24khz-16bit-24kbps-mono-opus":return new o(n.AudioFormatTag.WEBM_OPUS,1,24e3,3e3,2,16,e,e,!1);case"audio-16khz-16bit-32kbps-mono-opus":return new o(n.AudioFormatTag.OPUS,1,16e3,4e3,2,16,e,e,!1);case"audio-24khz-16bit-48kbps-mono-opus":return new o(n.AudioFormatTag.OPUS,1,24e3,6e3,2,16,e,e,!1);case"audio-24khz-16bit-24kbps-mono-opus":return new o(n.AudioFormatTag.OPUS,1,24e3,3e3,2,16,e,e,!1);case"audio-24khz-16bit-mono-flac":return new o(n.AudioFormatTag.FLAC,1,24e3,24e3,2,16,e,e,!1);case"audio-48khz-16bit-mono-flac":return new o(n.AudioFormatTag.FLAC,1,48e3,3e4,2,16,e,e,!1);case"raw-24khz-16bit-mono-truesilk":return new o(n.AudioFormatTag.SILKSkype,1,24e3,48e3,2,16,e,e,!1);case"raw-8khz-8bit-mono-alaw":return new o(n.AudioFormatTag.ALaw,1,8e3,8e3,1,8,e,e,!1);case"riff-8khz-8bit-mono-alaw":return new o(n.AudioFormatTag.ALaw,1,8e3,8e3,1,8,e,"raw-8khz-8bit-mono-alaw",!0);case"raw-22050hz-16bit-mono-pcm":return new o(n.AudioFormatTag.PCM,1,22050,44100,2,16,e,e,!1);case"riff-22050hz-16bit-mono-pcm":return new o(n.AudioFormatTag.PCM,1,22050,44100,2,16,e,"raw-22050hz-16bit-mono-pcm",!0);case"raw-44100hz-16bit-mono-pcm":return new o(n.AudioFormatTag.PCM,1,44100,88200,2,16,e,e,!1);case"riff-44100hz-16bit-mono-pcm":return new o(n.AudioFormatTag.PCM,1,44100,88200,2,16,e,"raw-44100hz-16bit-mono-pcm",!0);case"amr-wb-16000h":return new o(n.AudioFormatTag.AMR_WB,1,16e3,3052,2,16,e,e,!1);case"g722-16khz-64kbps":return new o(n.AudioFormatTag.G722,1,16e3,8e3,2,16,e,e,!1);default:return new o(n.AudioFormatTag.PCM,1,16e3,32e3,2,16,"riff-16khz-16bit-mono-pcm","raw-16khz-16bit-mono-pcm",!0)}}static getDefaultOutputFormat(){return o.fromSpeechSynthesisOutputFormatString("undefined"!=typeof window?"audio-24khz-48kbitrate-mono-mp3":"riff-16khz-16bit-mono-pcm")}get hasHeader(){return this.priHasHeader}get header(){if(this.hasHeader)return this.privHeader}updateHeader(e){if(this.priHasHeader){const t=new DataView(this.privHeader);t.setUint32(4,e+this.privHeader.byteLength-8,!0),t.setUint32(40,e,!0)}}get requestAudioFormatString(){return this.priRequestAudioFormatString}addHeader(e){if(!this.hasHeader)return e;this.updateHeader(e.byteLength);const t=new Uint8Array(e.byteLength+this.header.byteLength);return t.set(new Uint8Array(this.header),0),t.set(new Uint8Array(e),this.header.byteLength),t.buffer}}t.AudioOutputFormatImpl=o,o.SpeechSynthesisOutputFormatToString={[i.SpeechSynthesisOutputFormat.Raw8Khz8BitMonoMULaw]:"raw-8khz-8bit-mono-mulaw",[i.SpeechSynthesisOutputFormat.Riff16Khz16KbpsMonoSiren]:"riff-16khz-16kbps-mono-siren",[i.SpeechSynthesisOutputFormat.Audio16Khz16KbpsMonoSiren]:"audio-16khz-16kbps-mono-siren",[i.SpeechSynthesisOutputFormat.Audio16Khz32KBitRateMonoMp3]:"audio-16khz-32kbitrate-mono-mp3",[i.SpeechSynthesisOutputFormat.Audio16Khz128KBitRateMonoMp3]:"audio-16khz-128kbitrate-mono-mp3",[i.SpeechSynthesisOutputFormat.Audio16Khz64KBitRateMonoMp3]:"audio-16khz-64kbitrate-mono-mp3",[i.SpeechSynthesisOutputFormat.Audio24Khz48KBitRateMonoMp3]:"audio-24khz-48kbitrate-mono-mp3",[i.SpeechSynthesisOutputFormat.Audio24Khz96KBitRateMonoMp3]:"audio-24khz-96kbitrate-mono-mp3",[i.SpeechSynthesisOutputFormat.Audio24Khz160KBitRateMonoMp3]:"audio-24khz-160kbitrate-mono-mp3",[i.SpeechSynthesisOutputFormat.Raw16Khz16BitMonoTrueSilk]:"raw-16khz-16bit-mono-truesilk",[i.SpeechSynthesisOutputFormat.Riff16Khz16BitMonoPcm]:"riff-16khz-16bit-mono-pcm",[i.SpeechSynthesisOutputFormat.Riff8Khz16BitMonoPcm]:"riff-8khz-16bit-mono-pcm",[i.SpeechSynthesisOutputFormat.Riff24Khz16BitMonoPcm]:"riff-24khz-16bit-mono-pcm",[i.SpeechSynthesisOutputFormat.Riff8Khz8BitMonoMULaw]:"riff-8khz-8bit-mono-mulaw",[i.SpeechSynthesisOutputFormat.Raw16Khz16BitMonoPcm]:"raw-16khz-16bit-mono-pcm",[i.SpeechSynthesisOutputFormat.Raw24Khz16BitMonoPcm]:"raw-24khz-16bit-mono-pcm",[i.SpeechSynthesisOutputFormat.Raw8Khz16BitMonoPcm]:"raw-8khz-16bit-mono-pcm",[i.SpeechSynthesisOutputFormat.Ogg16Khz16BitMonoOpus]:"ogg-16khz-16bit-mono-opus",[i.SpeechSynthesisOutputFormat.Ogg24Khz16BitMonoOpus]:"ogg-24khz-16bit-mono-opus",[i.SpeechSynthesisOutputFormat.Raw48Khz16BitMonoPcm]:"raw-48khz-16bit-mono-pcm",[i.SpeechSynthesisOutputFormat.Riff48Khz16BitMonoPcm]:"riff-48khz-16bit-mono-pcm",[i.SpeechSynthesisOutputFormat.Audio48Khz96KBitRateMonoMp3]:"audio-48khz-96kbitrate-mono-mp3",[i.SpeechSynthesisOutputFormat.Audio48Khz192KBitRateMonoMp3]:"audio-48khz-192kbitrate-mono-mp3",[i.SpeechSynthesisOutputFormat.Ogg48Khz16BitMonoOpus]:"ogg-48khz-16bit-mono-opus",[i.SpeechSynthesisOutputFormat.Webm16Khz16BitMonoOpus]:"webm-16khz-16bit-mono-opus",[i.SpeechSynthesisOutputFormat.Webm24Khz16BitMonoOpus]:"webm-24khz-16bit-mono-opus",[i.SpeechSynthesisOutputFormat.Webm24Khz16Bit24KbpsMonoOpus]:"webm-24khz-16bit-24kbps-mono-opus",[i.SpeechSynthesisOutputFormat.Raw24Khz16BitMonoTrueSilk]:"raw-24khz-16bit-mono-truesilk",[i.SpeechSynthesisOutputFormat.Raw8Khz8BitMonoALaw]:"raw-8khz-8bit-mono-alaw",[i.SpeechSynthesisOutputFormat.Riff8Khz8BitMonoALaw]:"riff-8khz-8bit-mono-alaw",[i.SpeechSynthesisOutputFormat.Audio16Khz16Bit32KbpsMonoOpus]:"audio-16khz-16bit-32kbps-mono-opus",[i.SpeechSynthesisOutputFormat.Audio24Khz16Bit48KbpsMonoOpus]:"audio-24khz-16bit-48kbps-mono-opus",[i.SpeechSynthesisOutputFormat.Audio24Khz16Bit24KbpsMonoOpus]:"audio-24khz-16bit-24kbps-mono-opus",[i.SpeechSynthesisOutputFormat.Raw22050Hz16BitMonoPcm]:"raw-22050hz-16bit-mono-pcm",[i.SpeechSynthesisOutputFormat.Riff22050Hz16BitMonoPcm]:"riff-22050hz-16bit-mono-pcm",[i.SpeechSynthesisOutputFormat.Raw44100Hz16BitMonoPcm]:"raw-44100hz-16bit-mono-pcm",[i.SpeechSynthesisOutputFormat.Riff44100Hz16BitMonoPcm]:"riff-44100hz-16bit-mono-pcm",[i.SpeechSynthesisOutputFormat.AmrWb16000Hz]:"amr-wb-16000hz",[i.SpeechSynthesisOutputFormat.G72216Khz64Kbps]:"g722-16khz-64kbps"}},1389:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.KeywordRecognitionModel=void 0;const i=r(5245);t.KeywordRecognitionModel=class{constructor(){this.privDisposed=!1}static fromFile(e){throw i.Contracts.throwIfFileDoesNotExist(e,"fileName"),new Error("Not yet implemented.")}static fromStream(e){throw i.Contracts.throwIfNull(e,"file"),new Error("Not yet implemented.")}close(){this.privDisposed||(this.privDisposed=!0)}}},1430:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IntentRecognitionResult=void 0;const i=r(881);class n extends i.SpeechRecognitionResult{constructor(e,t,r,i,n,o,s,a,c,u,h){super(t,r,i,n,o,s,a,void 0,c,u,h),this.privIntentId=e}get intentId(){return this.privIntentId}}t.IntentRecognitionResult=n},1432:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SpeechRecognizer=void 0;const i=r(9190),n=r(2699),o=r(868),s=r(5245),a=r(881);class c extends a.Recognizer{constructor(e,t){const r=e;s.Contracts.throwIfNull(r,"speechConfig"),s.Contracts.throwIfNullOrWhitespace(r.properties.getProperty(a.PropertyId.SpeechServiceConnection_RecoLanguage),a.PropertyId[a.PropertyId.SpeechServiceConnection_RecoLanguage]),super(t,r.properties,new i.SpeechConnectionFactory,e.tokenCredential),this.privDisposedRecognizer=!1}static FromConfig(e,t,r){const i=e;return t.properties.mergeTo(i.properties),new c(e,r)}get endpointId(){return s.Contracts.throwIfDisposed(this.privDisposedRecognizer),this.properties.getProperty(a.PropertyId.SpeechServiceConnection_EndpointId,"00000000-0000-0000-0000-000000000000")}get authorizationToken(){return this.properties.getProperty(a.PropertyId.SpeechServiceAuthorization_Token)}set authorizationToken(e){s.Contracts.throwIfNullOrWhitespace(e,"token"),this.properties.setProperty(a.PropertyId.SpeechServiceAuthorization_Token,e)}get speechRecognitionLanguage(){return s.Contracts.throwIfDisposed(this.privDisposedRecognizer),this.properties.getProperty(a.PropertyId.SpeechServiceConnection_RecoLanguage)}get outputFormat(){return s.Contracts.throwIfDisposed(this.privDisposedRecognizer),this.properties.getProperty(i.OutputFormatPropertyName,a.OutputFormat[a.OutputFormat.Simple])===a.OutputFormat[a.OutputFormat.Simple]?a.OutputFormat.Simple:a.OutputFormat.Detailed}get properties(){return this.privProperties}recognizeOnceAsync(e,t){(0,o.marshalPromiseToCallbacks)(this.recognizeOnceAsyncImpl(n.RecognitionMode.Interactive),e,t)}startContinuousRecognitionAsync(e,t){(0,o.marshalPromiseToCallbacks)(this.startContinuousRecognitionAsyncImpl(void 0===this.properties.getProperty(i.ForceDictationPropertyName,void 0)?n.RecognitionMode.Conversation:n.RecognitionMode.Dictation),e,t)}stopContinuousRecognitionAsync(e,t){(0,o.marshalPromiseToCallbacks)(this.stopContinuousRecognitionAsyncImpl(),e,t)}startKeywordRecognitionAsync(e,t,r){s.Contracts.throwIfNull(e,"model"),r&&r("Not yet implemented.")}stopKeywordRecognitionAsync(e){e&&e()}close(e,t){s.Contracts.throwIfDisposed(this.privDisposedRecognizer),(0,o.marshalPromiseToCallbacks)(this.dispose(!0),e,t)}async dispose(e){this.privDisposedRecognizer||(e&&(this.privDisposedRecognizer=!0,await this.implRecognizerStop()),await super.dispose(e))}createRecognizerConfig(e){return new i.RecognizerConfig(e,this.privProperties)}createServiceRecognizer(e,t,r,n){const o=r;return new i.SpeechServiceRecognizer(e,t,o,n,this)}}t.SpeechRecognizer=c},1474:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AutoDetectSourceLanguageResult=void 0;const i=r(5245);class n{constructor(e,t){i.Contracts.throwIfNullOrUndefined(e,"language"),i.Contracts.throwIfNullOrUndefined(t,"languageDetectionConfidence"),this.privLanguage=e,this.privLanguageDetectionConfidence=t}static fromResult(e){return new n(e.language,e.languageDetectionConfidence)}static fromConversationTranscriptionResult(e){return new n(e.language,e.languageDetectionConfidence)}get language(){return this.privLanguage}get languageDetectionConfidence(){return this.privLanguageDetectionConfidence}}t.AutoDetectSourceLanguageResult=n},1487:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i},1491:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AvatarConfig=void 0;const i=r(5245),n=r(881);t.AvatarConfig=class{constructor(e,t,r){this.privCustomized=!1,this.privUseBuiltInVoice=!1,i.Contracts.throwIfNullOrWhitespace(e,"character"),this.character=e,this.style=t,void 0===r&&(r=new n.AvatarVideoFormat),this.videoFormat=r}get customized(){return this.privCustomized}set customized(e){this.privCustomized=e}get useBuiltInVoice(){return this.privUseBuiltInVoice}set useBuiltInVoice(e){this.privUseBuiltInVoice=e}get backgroundColor(){return this.privBackgroundColor}set backgroundColor(e){this.privBackgroundColor=e}get backgroundImage(){return this.privBackgroundImage}set backgroundImage(e){this.privBackgroundImage=e}get remoteIceServers(){return this.privRemoteIceServers}set remoteIceServers(e){this.privRemoteIceServers=e}}},1514:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ConversationTranslationEventArgs=void 0;const i=r(881);class n extends i.RecognitionEventArgs{constructor(e,t,r){super(t,r),this.privResult=e}get result(){return this.privResult}}t.ConversationTranslationEventArgs=n},1515:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ConversationCommon=void 0,t.ConversationCommon=class{constructor(e){this.privAudioConfig=e}handleCallback(e,t){if(e){try{e()}catch(e){t&&t(e)}e=void 0}}handleError(e,t){if(t)if(e instanceof Error){const r=e;t(r.name+": "+r.message)}else t(e)}}},1548:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TurnStatusResponsePayload=void 0;class r{constructor(e){this.privMessageStatusResponse=JSON.parse(e)}static fromJSON(e){return new r(e)}get interactionId(){return this.privMessageStatusResponse.interactionId}get conversationId(){return this.privMessageStatusResponse.conversationId}get statusCode(){switch(this.privMessageStatusResponse.statusCode){case"Success":return 200;case"Failed":return 400;case"TimedOut":return 429;default:return this.privMessageStatusResponse.statusCode}}}t.TurnStatusResponsePayload=r},1575:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CustomCommandsConfig=void 0;const i=r(5245),n=r(9707),o=r(881);class s extends n.DialogServiceConfigImpl{constructor(){super()}static fromSubscription(e,t,r){i.Contracts.throwIfNullOrWhitespace(e,"applicationId"),i.Contracts.throwIfNullOrWhitespace(t,"subscription"),i.Contracts.throwIfNullOrWhitespace(r,"region");const s=new n.DialogServiceConfigImpl;return s.setProperty(o.PropertyId.Conversation_DialogType,n.DialogServiceConfig.DialogTypes.CustomCommands),s.setProperty(o.PropertyId.Conversation_ApplicationId,e),s.setProperty(o.PropertyId.SpeechServiceConnection_Key,t),s.setProperty(o.PropertyId.SpeechServiceConnection_Region,r),s}static fromAuthorizationToken(e,t,r){i.Contracts.throwIfNullOrWhitespace(e,"applicationId"),i.Contracts.throwIfNullOrWhitespace(t,"authorizationToken"),i.Contracts.throwIfNullOrWhitespace(r,"region");const s=new n.DialogServiceConfigImpl;return s.setProperty(o.PropertyId.Conversation_DialogType,n.DialogServiceConfig.DialogTypes.CustomCommands),s.setProperty(o.PropertyId.Conversation_ApplicationId,e),s.setProperty(o.PropertyId.SpeechServiceAuthorization_Token,t),s.setProperty(o.PropertyId.SpeechServiceConnection_Region,r),s}set applicationId(e){i.Contracts.throwIfNullOrWhitespace(e,"value"),this.setProperty(o.PropertyId.Conversation_ApplicationId,e)}get applicationId(){return this.getProperty(o.PropertyId.Conversation_ApplicationId)}}t.CustomCommandsConfig=s},1603:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default="00000000-0000-0000-0000-000000000000"},1633:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RecognizerConfig=t.SpeechResultFormat=void 0;const i=r(881),n=r(9190),o=r(2699);var s;(s=t.SpeechResultFormat||(t.SpeechResultFormat={}))[s.Simple=0]="Simple",s[s.Detailed=1]="Detailed",t.RecognizerConfig=class{constructor(e,t){this.privSpeechServiceConfig=e||new n.SpeechServiceConfig(new n.Context(null)),this.privParameters=t,this.privMaxRetryCount=parseInt(t.getProperty("SPEECH-Error-MaxRetryCount","4"),10),this.privLanguageIdMode=t.getProperty(i.PropertyId.SpeechServiceConnection_LanguageIdMode,void 0),this.privEnableSpeakerId=!1}get parameters(){return this.privParameters}get recognitionMode(){return this.privRecognitionMode}set recognitionMode(e){this.privRecognitionMode=e,this.privRecognitionActivityTimeout=e===o.RecognitionMode.Interactive?8e3:25e3,this.privSpeechServiceConfig.Recognition=o.RecognitionMode[e]}get SpeechServiceConfig(){return this.privSpeechServiceConfig}get recognitionActivityTimeout(){return this.privRecognitionActivityTimeout}get isContinuousRecognition(){return this.privRecognitionMode!==o.RecognitionMode.Interactive}get languageIdMode(){return this.privLanguageIdMode}get autoDetectSourceLanguages(){return this.parameters.getProperty(i.PropertyId.SpeechServiceConnection_AutoDetectSourceLanguages,void 0)}get recognitionEndpointVersion(){return this.parameters.getProperty(i.PropertyId.SpeechServiceConnection_RecognitionEndpointVersion,"2")}set recognitionEndpointVersion(e){this.parameters.setProperty(i.PropertyId.SpeechServiceConnection_RecognitionEndpointVersion,e)}get sourceLanguageModels(){const e=[];let t=!1;if(void 0!==this.autoDetectSourceLanguages)for(const r of this.autoDetectSourceLanguages.split(",")){const n=r+i.PropertyId.SpeechServiceConnection_EndpointId.toString(),o=this.parameters.getProperty(n,void 0);void 0!==o?(e.push({language:r,endpoint:o}),t=!0):e.push({language:r,endpoint:""})}return t?e:void 0}get maxRetryCount(){return this.privMaxRetryCount}get isSpeakerDiarizationEnabled(){return this.privEnableSpeakerId}set isSpeakerDiarizationEnabled(e){this.privEnableSpeakerId=e}}},1647:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TranscriptionServiceRecognizer=void 0;const i=r(868),n=r(881),o=r(9190),s=r(4081);class a extends o.ConversationServiceRecognizer{constructor(e,t,r,i,o){super(e,t,r,i,o),this.privTranscriberRecognizer=o,this.sendPrePayloadJSONOverride=e=>this.sendTranscriptionStartJSON(e),"true"===this.privRecognizerConfig.parameters.getProperty(n.PropertyId.SpeechServiceResponse_RequestWordLevelTimestamps)&&this.privSpeechContext.setWordLevelTimings()}async sendSpeechEventAsync(e,t){if(this.privRequestSession.isRecognizing){const r=await this.fetchConnection();await this.sendSpeechEvent(r,this.createSpeechEventPayload(e,t))}}async sendMeetingSpeechEventAsync(e,t){if(this.privRequestSession.isRecognizing){const r=await this.fetchConnection();await this.sendSpeechEvent(r,this.createMeetingSpeechEventPayload(e,t))}}processTypeSpecificMessages(e){return this.processSpeechMessages(e)}handleRecognizedCallback(e,t,r){try{const i=new n.SpeechRecognitionEventArgs(e,t,r);if(this.privTranscriberRecognizer.recognized(this.privTranscriberRecognizer,i),this.privSuccessCallback){try{this.privSuccessCallback(e)}catch(e){this.privErrorCallback&&this.privErrorCallback(e)}this.privSuccessCallback=void 0,this.privErrorCallback=void 0}}catch(e){}}handleRecognizingCallback(e,t,r){try{const i=new n.SpeechRecognitionEventArgs(e,t,r);this.privTranscriberRecognizer.recognizing(this.privTranscriberRecognizer,i)}catch(e){}}cancelRecognition(e,t,r,i,s){const a=new n.PropertyCollection;if(a.setProperty(o.CancellationErrorCodePropertyName,n.CancellationErrorCode[i]),this.privTranscriberRecognizer.IsMeetingRecognizer()){if(this.privTranscriberRecognizer.canceled){const t=new n.MeetingTranscriptionCanceledEventArgs(r,s,i,void 0,e);try{this.privTranscriberRecognizer.canceled(this.privTranscriberRecognizer,t)}catch{}}}else if(this.privTranscriberRecognizer.canceled){const t=new n.ConversationTranscriptionCanceledEventArgs(r,s,i,void 0,e);try{this.privTranscriberRecognizer.canceled(this.privTranscriberRecognizer,t)}catch{}}if(this.privSuccessCallback){const e=new n.SpeechRecognitionResult(t,n.ResultReason.Canceled,void 0,void 0,void 0,void 0,void 0,void 0,s,void 0,a);try{this.privSuccessCallback(e),this.privSuccessCallback=void 0}catch{}}}async sendTranscriptionStartJSON(e){if(await this.sendSpeechContext(e,!0),this.privTranscriberRecognizer.IsMeetingRecognizer()){const t=this.privTranscriberRecognizer.getMeetingInfo(),r=this.createMeetingSpeechEventPayload(t,"start");await this.sendSpeechEvent(e,r)}else{const t=this.privTranscriberRecognizer.getConversationInfo(),r=this.createSpeechEventPayload(t,"start");await this.sendSpeechEvent(e,r)}await this.sendWaveHeader(e)}sendSpeechEvent(e,t){const r=JSON.stringify(t);if(r)return e.send(new s.SpeechConnectionMessage(i.MessageType.Text,"speech.event",this.privRequestSession.requestId,"application/json",r))}createSpeechEventPayload(e,t){const r={id:"meeting",name:t,meeting:e.conversationProperties};return r.meeting.id=e.id,r.meeting.attendees=e.participants,r}createMeetingSpeechEventPayload(e,t){const r={id:"meeting",name:t,meeting:e.meetingProperties};return r.meeting.id=e.id,r.meeting.attendees=e.participants,r}}t.TranscriptionServiceRecognizer=a},1648:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Translations=void 0;const i=r(881);t.Translations=class{constructor(){this.privMap=new i.PropertyCollection}get languages(){return this.privMap.keys}get(e,t){return this.privMap.getProperty(e,t)}set(e,t){this.privMap.setProperty(e,t)}}},1681:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SpeakerRecognitionCancellationDetails=t.SpeakerRecognitionResult=t.SpeakerRecognitionResultType=void 0;const i=r(9190),n=r(881);var o;!function(e){e[e.Verify=0]="Verify",e[e.Identify=1]="Identify"}(o=t.SpeakerRecognitionResultType||(t.SpeakerRecognitionResultType={})),t.SpeakerRecognitionResult=class{constructor(e,t=n.ResultReason.RecognizedSpeaker,r=n.CancellationErrorCode.NoError,s=""){this.privProperties=new n.PropertyCollection;const a="TextIndependentIdentification"===e.scenario?o.Identify:o.Verify;this.privReason=t,this.privReason!==n.ResultReason.Canceled?a===o.Identify?(this.privProfileId=e.identificationResult.identifiedProfile.profileId,this.privScore=e.identificationResult.identifiedProfile.score,this.privReason=n.ResultReason.RecognizedSpeakers):(this.privScore=e.verificationResult.score,"accept"!==e.verificationResult.recognitionResult.toLowerCase()&&(this.privReason=n.ResultReason.NoMatch),void 0!==e.verificationResult.profileId&&""!==e.verificationResult.profileId&&(this.privProfileId=e.verificationResult.profileId)):(this.privErrorDetails=s,this.privProperties.setProperty(i.CancellationErrorCodePropertyName,n.CancellationErrorCode[r])),this.privProperties.setProperty(n.PropertyId.SpeechServiceResponse_JsonResult,JSON.stringify(e))}get properties(){return this.privProperties}get reason(){return this.privReason}get profileId(){return this.privProfileId}get errorDetails(){return this.privErrorDetails}get score(){return this.privScore}};class s extends n.CancellationDetailsBase{constructor(e,t,r){super(e,t,r)}static fromResult(e){const t=n.CancellationReason.Error;let r=n.CancellationErrorCode.NoError;return e.properties&&(r=n.CancellationErrorCode[e.properties.getProperty(i.CancellationErrorCodePropertyName,n.CancellationErrorCode[n.CancellationErrorCode.NoError])]),new s(t,e.errorDetails,r)}}t.SpeakerRecognitionCancellationDetails=s},1706:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.URL=t.DNS=void 0,t.default=function(e,t,r){function i(e,i,s,a){var c;if("string"==typeof e&&(e=function(e){e=unescape(encodeURIComponent(e));const t=[];for(let r=0;r<e.length;++r)t.push(e.charCodeAt(r));return t}(e)),"string"==typeof i&&(i=(0,o.default)(i)),16!==(null===(c=i)||void 0===c?void 0:c.length))throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");let u=new Uint8Array(16+e.length);if(u.set(i),u.set(e,i.length),u=r(u),u[6]=15&u[6]|t,u[8]=63&u[8]|128,s){a=a||0;for(let e=0;e<16;++e)s[a+e]=u[e];return s}return(0,n.unsafeStringify)(u)}try{i.name=e}catch(e){}return i.DNS=s,i.URL=a,i};var i,n=r(6821),o=(i=r(4235))&&i.__esModule?i:{default:i};const s="6ba7b810-9dad-11d1-80b4-00c04fd430c8";t.DNS=s;const a="6ba7b811-9dad-11d1-80b4-00c04fd430c8";t.URL=a},1729:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MessageDataStreamType=t.ActivityPayloadResponse=void 0;class r{constructor(e){this.privActivityResponse=JSON.parse(e)}static fromJSON(e){return new r(e)}get conversationId(){return this.privActivityResponse.conversationId}get messageDataStreamType(){return this.privActivityResponse.messageDataStreamType}get messagePayload(){return this.privActivityResponse.messagePayload}get version(){return this.privActivityResponse.version}}var i;t.ActivityPayloadResponse=r,(i=t.MessageDataStreamType||(t.MessageDataStreamType={}))[i.None=0]="None",i[i.TextToSpeechAudio=1]="TextToSpeechAudio"},1765:(e,t,r)=>{"use strict";var i=r(3404),n={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},o={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},s={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},a={};function c(e){return i.isMemo(e)?s:a[e.$$typeof]||n}a[i.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},a[i.Memo]=s;var u=Object.defineProperty,h=Object.getOwnPropertyNames,d=Object.getOwnPropertySymbols,l=Object.getOwnPropertyDescriptor,p=Object.getPrototypeOf,f=Object.prototype;e.exports=function e(t,r,i){if("string"!=typeof r){if(f){var n=p(r);n&&n!==f&&e(t,n,i)}var s=h(r);d&&(s=s.concat(d(r)));for(var a=c(t),v=c(r),g=0;g<s.length;++g){var m=s[g];if(!(o[m]||i&&i[m]||v&&v[m]||a&&a[m])){var y=l(r,m);try{u(t,m,y)}catch(e){}}}}return t}},1766:(e,t)=>{"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.ParticipantChangedReason=void 0,(r=t.ParticipantChangedReason||(t.ParticipantChangedReason={}))[r.JoinedConversation=0]="JoinedConversation",r[r.LeftConversation=1]="LeftConversation",r[r.Updated=2]="Updated"},1800:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DynamicGrammarBuilder=void 0;const i=r(3549);t.DynamicGrammarBuilder=class{constructor(){this.privWeight=1}addPhrase(e){this.privPhrases||(this.privPhrases=[]),e instanceof Array?this.privPhrases=this.privPhrases.concat(e):this.privPhrases.push(e)}clearPhrases(){this.privPhrases=void 0}addReferenceGrammar(e){this.privGrammars||(this.privGrammars=[]),e instanceof Array?this.privGrammars=this.privGrammars.concat(e):this.privGrammars.push(e)}clearGrammars(){this.privGrammars=void 0}setWeight(e){this.privWeight=e}generateGrammarObject(){if(void 0===this.privGrammars&&void 0===this.privPhrases)return;const e={};if(e.referenceGrammars=this.privGrammars,void 0!==this.privPhrases&&0!==this.privPhrases.length){const t=[];this.privPhrases.forEach(e=>{t.push({text:e})}),e.groups=[{type:i.GroupType.Generic,items:t}],e.bias=this.privWeight}return e}}},1806:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},1846:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RequestSession=void 0;const i=r(868),n=r(5843),o=r(7100);t.RequestSession=class{constructor(e){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=e,this.privRequestId=(0,i.createNoDashGuid)(),this.privAudioNodeId=(0,i.createNoDashGuid)(),this.privTurnDeferral=new i.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(e){this.privServiceTelemetryListener&&this.privDetachables.push(e.attachListener(this.privServiceTelemetryListener))}startNewRecognition(){this.privRecognitionBytesSent=0,this.privIsSpeechEnded=!1,this.privIsRecognizing=!0,this.privTurnStartAudioOffset=0,this.privLastRecoOffset=0,this.privRecogNumber++,this.privServiceTelemetryListener=new o.ServiceTelemetryListener(this.privRequestId,this.privAudioSourceId,this.privAudioNodeId),this.onEvent(new n.RecognitionTriggeredEvent(this.requestId,this.privSessionId,this.privAudioSourceId,this.privAudioNodeId))}async onAudioSourceAttachCompleted(e,t){this.privAudioNode=e,this.privIsAudioNodeDetached=!1,t?await this.onComplete():this.onEvent(new n.ListeningStartedEvent(this.privRequestId,this.privSessionId,this.privAudioSourceId,this.privAudioNodeId))}onPreConnectionStart(e,t){this.privAuthFetchEventId=e,this.privSessionId=t,this.onEvent(new n.ConnectingToServiceEvent(this.privRequestId,this.privAuthFetchEventId,this.privSessionId))}async onAuthCompleted(e){e&&await this.onComplete()}async onConnectionEstablishCompleted(e,t){if(200===e)return this.onEvent(new n.RecognitionStartedEvent(this.requestId,this.privAudioSourceId,this.privAudioNodeId,this.privAuthFetchEventId,this.privSessionId)),this.privAudioNode&&this.privAudioNode.replay(),this.privTurnStartAudioOffset=this.privLastRecoOffset,void(this.privBytesSent=0);403===e&&await this.onComplete()}async onServiceTurnEndResponse(e){this.privTurnDeferral.resolve(),!e||this.isSpeechEnded?(await this.onComplete(),this.privInTurn=!1):(this.privTurnStartAudioOffset=this.privLastRecoOffset,this.privAudioNode.replay())}onSpeechContext(){this.privRequestId=(0,i.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 i.Deferred}onHypothesis(e){this.privHypothesisReceived||(this.privHypothesisReceived=!0,this.privServiceTelemetryListener.hypothesisReceived(this.privAudioNode.findTimeAtOffset(e)))}onPhraseRecognized(e){this.privServiceTelemetryListener.phraseReceived(this.privAudioNode.findTimeAtOffset(e)),this.onServiceRecognized(e)}onServiceRecognized(e){this.privLastRecoOffset=e,this.privHypothesisReceived=!1,this.privAudioNode.shrinkBuffers(e),this.privConnectionAttempts=0}onAudioSent(e){this.privBytesSent+=e,this.privRecognitionBytesSent+=e}onRetryConnection(){this.privConnectionAttempts++}async dispose(){if(!this.privIsDisposed){this.privIsDisposed=!0;for(const e of this.privDetachables)await e.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(e){this.privServiceTelemetryListener&&this.privServiceTelemetryListener.onEvent(e),i.Events.instance.onEvent(e)}async onComplete(){this.privIsRecognizing&&(this.privIsRecognizing=!1,await this.detachAudioNode())}async detachAudioNode(){this.privIsAudioNodeDetached||(this.privIsAudioNodeDetached=!0,this.privAudioNode&&await this.privAudioNode.detach())}}},1864:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CognitiveTokenAuthentication=void 0;const i=r(868),n=r(2690),o=r(7014);class s{constructor(e,t){if(!e)throw new i.ArgumentNullError("fetchCallback");if(!t)throw new i.ArgumentNullError("fetchOnExpiryCallback");this.privFetchCallback=e,this.privFetchOnExpiryCallback=t}fetch(e){return this.privFetchCallback(e).then(e=>new n.AuthInfo(o.HeaderNames.Authorization,void 0===e?void 0:s.privTokenPrefix+e))}fetchOnExpiry(e){return this.privFetchOnExpiryCallback(e).then(e=>new n.AuthInfo(o.HeaderNames.Authorization,void 0===e?void 0:s.privTokenPrefix+e))}}t.CognitiveTokenAuthentication=s,s.privTokenPrefix="Bearer "},1891:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},1895:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i,n=(i=r(7285))&&i.__esModule?i:{default:i},o=r(6821);let s,a,c=0,u=0;t.default=function(e,t,r){let i=t&&r||0;const h=t||new Array(16);let d=(e=e||{}).node||s,l=void 0!==e.clockseq?e.clockseq:a;if(null==d||null==l){const t=e.random||(e.rng||n.default)();null==d&&(d=s=[1|t[0],t[1],t[2],t[3],t[4],t[5]]),null==l&&(l=a=16383&(t[6]<<8|t[7]))}let p=void 0!==e.msecs?e.msecs:Date.now(),f=void 0!==e.nsecs?e.nsecs:u+1;const v=p-c+(f-u)/1e4;if(v<0&&void 0===e.clockseq&&(l=l+1&16383),(v<0||p>c)&&void 0===e.nsecs&&(f=0),f>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");c=p,u=f,a=l,p+=122192928e5;const g=(1e4*(268435455&p)+f)%4294967296;h[i++]=g>>>24&255,h[i++]=g>>>16&255,h[i++]=g>>>8&255,h[i++]=255&g;const m=p/4294967296*1e4&268435455;h[i++]=m>>>8&255,h[i++]=255&m,h[i++]=m>>>24&15|16,h[i++]=m>>>16&255,h[i++]=l>>>8|128,h[i++]=255&l;for(let e=0;e<6;++e)h[i+e]=d[e];return t||(0,o.unsafeStringify)(h)}},1911:(e,t,r)=>{"use strict";var i=r(7426),n=r(7766);function o(){if(!(this instanceof o))return new o;n.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}i.inherits(o,n),e.exports=o,o.blockSize=1024,o.outSize=384,o.hmacStrength=192,o.padLength=128,o.prototype._digest=function(e){return"hex"===e?i.toHex32(this.h.slice(0,12),"big"):i.split32(this.h.slice(0,12),"big")}},1919:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ConversationTranslatorRecognizer=t.ConversationRecognizerFactory=void 0;const i=r(9190),n=r(868),o=r(5245),s=r(881),a=r(8553),c=r(3245);t.ConversationRecognizerFactory=class{static fromConfig(e,t,r){return new u(e,t,r)}};class u extends s.Recognizer{constructor(e,t,r){const i=t;o.Contracts.throwIfNull(i,"speechConfig");const c=e;o.Contracts.throwIfNull(c,"conversationImpl"),super(r,i.properties,new a.ConversationConnectionFactory),this.privConversation=c,this.privIsDisposed=!1,this.privProperties=i.properties.clone(),this.privConnection=s.Connection.fromRecognizer(this),"on"===this.privProperties.getProperty(s.PropertyId.WebWorkerLoadType,"on").toLowerCase()&&"undefined"!=typeof Blob&&"undefined"!=typeof Worker?(this.privSetTimeout=n.Timeout.setTimeout,this.privClearTimeout=n.Timeout.clearTimeout):"undefined"!=typeof window?(this.privSetTimeout=window.setTimeout.bind(window),this.privClearTimeout=window.clearTimeout.bind(window)):(this.privSetTimeout=setTimeout,this.privClearTimeout=clearTimeout)}set connected(e){this.privConnection.connected=e}set disconnected(e){this.privConnection.disconnected=e}get speechRecognitionLanguage(){return this.privSpeechRecognitionLanguage}get properties(){return this.privProperties}isDisposed(){return this.privIsDisposed}connect(e,t,r){try{o.Contracts.throwIfDisposed(this.privIsDisposed),o.Contracts.throwIfNullOrWhitespace(e,"token"),this.privReco.conversationTranslatorToken=e,this.resetConversationTimeout(),this.privReco.connectAsync(t,r)}catch(e){if(r)if(e instanceof Error){const t=e;r(t.name+": "+t.message)}else r(e)}}disconnect(e,t){try{o.Contracts.throwIfDisposed(this.privIsDisposed),void 0!==this.privTimeoutToken&&this.privClearTimeout(this.privTimeoutToken),this.privReco.disconnect().then(()=>{e&&e()},e=>{t&&t(e)})}catch(e){if(t)if(e instanceof Error){const r=e;t(r.name+": "+r.message)}else t(e);this.dispose(!0).catch(e=>{n.Events.instance.onEvent(new n.BackgroundEvent(e))})}}sendRequest(e,t,r){try{o.Contracts.throwIfDisposed(this.privIsDisposed),this.sendMessage(e,t,r)}catch(e){if(r)if(e instanceof Error){const t=e;r(t.name+": "+t.message)}else r(e);this.dispose(!0).catch(e=>{n.Events.instance.onEvent(new n.BackgroundEvent(e))})}}onToken(e){this.privConversation.onToken(e)}async close(){this.privIsDisposed||(this.privConnection&&(this.privConnection.closeConnection(),this.privConnection.close()),this.privConnection=void 0,await this.dispose(!0))}async dispose(e){this.privIsDisposed||e&&(void 0!==this.privTimeoutToken&&this.privClearTimeout(this.privTimeoutToken),this.privIsDisposed=!0,this.privConnection&&(this.privConnection.closeConnection(),this.privConnection.close(),this.privConnection=void 0),await super.dispose(e))}createRecognizerConfig(e){return new i.RecognizerConfig(e,this.privProperties)}createServiceRecognizer(e,t,r,i){const n=r;return new c.ConversationServiceAdapter(e,t,n,i,this)}sendMessage(e,t,r){((e,t,r)=>{void 0!==e?e.then(()=>{try{t&&t()}catch(e){r&&r(`'Unhandled error on promise callback: ${e}'`)}},e=>{try{r&&r(e)}catch(e){}}):r&&r("Null promise")})(this.privReco.sendMessageAsync(e),t,r),this.resetConversationTimeout()}resetConversationTimeout(){void 0!==this.privTimeoutToken&&this.privClearTimeout(this.privTimeoutToken),this.privTimeoutToken=this.privSetTimeout(()=>{this.sendRequest(this.privConversation.getKeepAlive())},6e4)}}t.ConversationTranslatorRecognizer=u},1960:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},1977:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TranslationRecognitionEventArgs=void 0;const i=r(881);class n extends i.RecognitionEventArgs{constructor(e,t,r){super(t,r),this.privResult=e}get result(){return this.privResult}}t.TranslationRecognitionEventArgs=n},1979:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SpeakerRecognitionConfig=void 0;const i=r(9190);t.SpeakerRecognitionConfig=class{constructor(e,t){this.privContext=e||new i.Context(null),this.privParameters=t}get parameters(){return this.privParameters}get Context(){return this.privContext}}},1980:(e,t)=>{"use strict";var r,i,n,o;Object.defineProperty(t,"__esModule",{value:!0}),t.TentativePhraseResultsOption=t.OutputFormat=t.PhraseExtension=t.PhraseOption=void 0,(o=t.PhraseOption||(t.PhraseOption={})).WordTimings="WordTimings",o.SNR="SNR",o.Pronunciation="Pronunciation",o.WordPronunciation="WordPronunciation",o.WordConfidence="WordConfidence",o.Words="Words",o.Sentiment="Sentiment",o.PronunciationAssessment="PronunciationAssessment",o.ContentAssessment="ContentAssessment",o.PhraseAMScore="PhraseAMScore",o.PhraseLMScore="PhraseLMScore",o.WordAMScore="WordAMScore",o.WordLMScore="WordLMScore",o.RuleTree="RuleTree",o.NBestTimings="NBestTimings",o.DecoderDiagnostics="DecoderDiagnostics",o.DisplayWordTimings="DisplayWordTimings",o.DisplayWords="DisplayWords",(n=t.PhraseExtension||(t.PhraseExtension={})).Graph="Graph",n.Corrections="Corrections",n.Sentiment="Sentiment",(i=t.OutputFormat||(t.OutputFormat={})).Simple="Simple",i.Detailed="Detailed",(r=t.TentativePhraseResultsOption||(t.TentativePhraseResultsOption={})).None="None",r.Always="Always"},2025:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PullAudioInputStreamImpl=t.PullAudioInputStream=t.PushAudioInputStreamImpl=t.PushAudioInputStream=t.AudioInputStream=void 0;const i=r(9190),n=r(868),o=r(4462),s=r(881),a=r(8698);class c{constructor(){}static createPushStream(e){return u.create(e)}static createPullStream(e,t){return d.create(e,t)}}t.AudioInputStream=c;class u extends c{static create(e){return new h(e)}}t.PushAudioInputStream=u;class h extends u{constructor(e){super(),this.privFormat=void 0===e?a.AudioStreamFormatImpl.getDefaultInputFormat():e,this.privEvents=new n.EventSource,this.privId=(0,o.createNoDashGuid)(),this.privStream=new n.ChunkedArrayBufferStream(this.privFormat.avgBytesPerSec/10)}get format(){return Promise.resolve(this.privFormat)}write(e){this.privStream.writeStreamChunk({buffer:e,isEnd:!1,timeReceived:Date.now()})}close(){this.privStream.close()}id(){return this.privId}turnOn(){this.onEvent(new n.AudioSourceInitializingEvent(this.privId)),this.onEvent(new n.AudioSourceReadyEvent(this.privId))}async attach(e){this.onEvent(new n.AudioStreamNodeAttachingEvent(this.privId,e)),await this.turnOn();const t=this.privStream;return this.onEvent(new n.AudioStreamNodeAttachedEvent(this.privId,e)),{detach:async()=>(this.onEvent(new n.AudioStreamNodeDetachedEvent(this.privId,e)),this.turnOff()),id:()=>e,read:()=>t.read()}}detach(e){this.onEvent(new n.AudioStreamNodeDetachedEvent(this.privId,e))}turnOff(){}get events(){return this.privEvents}get deviceInfo(){return Promise.resolve({bitspersample:this.privFormat.bitsPerSample,channelcount:this.privFormat.channels,connectivity:i.connectivity.Unknown,manufacturer:"Speech SDK",model:"PushStream",samplerate:this.privFormat.samplesPerSec,type:i.type.Stream})}onEvent(e){this.privEvents.onEvent(e),n.Events.instance.onEvent(e)}toBuffer(e){const t=Buffer.alloc(e.byteLength),r=new Uint8Array(e);for(let e=0;e<t.length;++e)t[e]=r[e];return t}}t.PushAudioInputStreamImpl=h;class d extends c{constructor(){super()}static create(e,t){return new l(e,t)}}t.PullAudioInputStream=d;class l extends d{constructor(e,t){super(),this.privFormat=void 0===t?s.AudioStreamFormat.getDefaultInputFormat():t,this.privEvents=new n.EventSource,this.privId=(0,o.createNoDashGuid)(),this.privCallback=e,this.privIsClosed=!1,this.privBufferSize=this.privFormat.avgBytesPerSec/10}get format(){return Promise.resolve(this.privFormat)}close(){this.privIsClosed=!0,this.privCallback.close()}id(){return this.privId}turnOn(){this.onEvent(new n.AudioSourceInitializingEvent(this.privId)),this.onEvent(new n.AudioSourceReadyEvent(this.privId))}async attach(e){return this.onEvent(new n.AudioStreamNodeAttachingEvent(this.privId,e)),await this.turnOn(),this.onEvent(new n.AudioStreamNodeAttachedEvent(this.privId,e)),{detach:()=>(this.privCallback.close(),this.onEvent(new n.AudioStreamNodeDetachedEvent(this.privId,e)),this.turnOff()),id:()=>e,read:()=>{let e,t=0;for(;t<this.privBufferSize;){const r=new ArrayBuffer(this.privBufferSize-t),i=this.privCallback.read(r);if(void 0===e?e=r:new Int8Array(e).set(new Int8Array(r),t),0===i)break;t+=i}return Promise.resolve({buffer:e.slice(0,t),isEnd:this.privIsClosed||0===t,timeReceived:Date.now()})}}}detach(e){this.onEvent(new n.AudioStreamNodeDetachedEvent(this.privId,e))}turnOff(){}get events(){return this.privEvents}get deviceInfo(){return Promise.resolve({bitspersample:this.privFormat.bitsPerSample,channelcount:this.privFormat.channels,connectivity:i.connectivity.Unknown,manufacturer:"Speech SDK",model:"PullStream",samplerate:this.privFormat.samplesPerSec,type:i.type.Stream})}onEvent(e){this.privEvents.onEvent(e),n.Events.instance.onEvent(e)}}t.PullAudioInputStreamImpl=l},2079:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ConversationTranscriptionCanceledEventArgs=void 0;const i=r(6119);class n extends i.CancellationEventArgsBase{}t.ConversationTranscriptionCanceledEventArgs=n},2150:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ConversationTranslationResult=void 0;const i=r(919);class n extends i.TranslationRecognitionResult{constructor(e,t,r,i,n,o,s,a,c,u,h){super(t,i,n,o,s,a,void 0,void 0,c,u,h),this.privId=e,this.privOrigLang=r}get participantId(){return this.privId}get originalLang(){return this.privOrigLang}}t.ConversationTranslationResult=n},2250:()=>{},2277:(e,t)=>{"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.ServicePropertyChannel=void 0,(r=t.ServicePropertyChannel||(t.ServicePropertyChannel={}))[r.UriQueryParameter=0]="UriQueryParameter"},2278:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},2287:(e,t,r)=>{"use strict";var i=r(7426),n=r(6166),o=r(6225),s=r(3349),a=i.sum32,c=i.sum32_4,u=i.sum32_5,h=o.ch32,d=o.maj32,l=o.s0_256,p=o.s1_256,f=o.g0_256,v=o.g1_256,g=n.BlockHash,m=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];function y(){if(!(this instanceof y))return new y;g.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=m,this.W=new Array(64)}i.inherits(y,g),e.exports=y,y.blockSize=512,y.outSize=256,y.hmacStrength=192,y.padLength=64,y.prototype._update=function(e,t){for(var r=this.W,i=0;i<16;i++)r[i]=e[t+i];for(;i<r.length;i++)r[i]=c(v(r[i-2]),r[i-7],f(r[i-15]),r[i-16]);var n=this.h[0],o=this.h[1],g=this.h[2],m=this.h[3],y=this.h[4],b=this.h[5],S=this.h[6],C=this.h[7];for(s(this.k.length===r.length),i=0;i<r.length;i++){var w=u(C,p(y),h(y,b,S),this.k[i],r[i]),P=a(l(n),d(n,o,g));C=S,S=b,b=y,y=a(m,w),m=g,g=o,o=n,n=a(w,P)}this.h[0]=a(this.h[0],n),this.h[1]=a(this.h[1],o),this.h[2]=a(this.h[2],g),this.h[3]=a(this.h[3],m),this.h[4]=a(this.h[4],y),this.h[5]=a(this.h[5],b),this.h[6]=a(this.h[6],S),this.h[7]=a(this.h[7],C)},y.prototype._digest=function(e){return"hex"===e?i.toHex32(this.h,"big"):i.split32(this.h,"big")}},2387:(e,t)=>{"use strict";var r,i;Object.defineProperty(t,"__esModule",{value:!0}),t.LanguageIdDetectionPriority=t.LanguageIdDetectionMode=void 0,(i=t.LanguageIdDetectionMode||(t.LanguageIdDetectionMode={})).DetectAtAudioStart="DetectAtAudioStart",i.DetectContinuous="DetectContinuous",i.DetectSegments="DetectSegments",(r=t.LanguageIdDetectionPriority||(t.LanguageIdDetectionPriority={})).Auto="Auto",r.PrioritizeLatency="PrioritizeLatency",r.PrioritizeAccuracy="PrioritizeAccuracy"},2451:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ConversationTranslatorConnectionFactory=void 0;const i=r(4378),n=r(4677),o=r(5245),s=r(881),a=r(7014),c=r(9324),u=r(7778),h=r(9190);class d extends u.ConnectionFactoryBase{constructor(e){super(),o.Contracts.throwIfNullOrUndefined(e,"convGetter"),this.privConvGetter=e}create(e,t,r){const o="TRUE"===e.parameters.getProperty("ConversationTranslator_MultiChannelAudio","").toUpperCase(),l=this.privConvGetter().room,p=l.cognitiveSpeechRegion||e.parameters.getProperty(s.PropertyId.SpeechServiceConnection_Region,""),f={hostSuffix:u.ConnectionFactoryBase.getHostSuffix(p),path:d.CTS_VIRT_MIC_PATH,region:encodeURIComponent(p)};f[c.QueryParameterNames.Language]=encodeURIComponent(e.parameters.getProperty(s.PropertyId.SpeechServiceConnection_RecoLanguage,"")),f[c.QueryParameterNames.CtsMeetingId]=encodeURIComponent(l.roomId),f[c.QueryParameterNames.CtsDeviceId]=encodeURIComponent(l.participantId),f[c.QueryParameterNames.CtsIsParticipant]=l.isHost?"":"&"+c.QueryParameterNames.CtsIsParticipant;let v="";const g={},m={};if(o){v=e.parameters.getProperty(s.PropertyId.SpeechServiceConnection_Endpoint),v||(v="wss://"+e.parameters.getProperty(s.PropertyId.SpeechServiceConnection_Host,"transcribe.{region}.cts.speech{hostSuffix}")+"{path}"),v=n.StringUtils.formatString(v,f);const t=new URL(v);t.searchParams.forEach((e,t)=>{g[t]=e}),(new h.TranscriberConnectionFactory).setQueryParams(g,e,v),g[c.QueryParameterNames.CtsMeetingId]=f[c.QueryParameterNames.CtsMeetingId],g[c.QueryParameterNames.CtsDeviceId]=f[c.QueryParameterNames.CtsDeviceId],l.isHost||(g[c.QueryParameterNames.CtsIsParticipant]=""),c.QueryParameterNames.Format in g||(g[c.QueryParameterNames.Format]="simple"),t.searchParams.forEach((e,r)=>{t.searchParams.set(r,g[r]),delete g[r]}),v=t.toString()}else{const t=new h.TranslationConnectionFactory;v=t.getEndpointUrl(e,!0),v=n.StringUtils.formatString(v,f),t.setQueryParams(g,e,v)}m[a.HeaderNames.ConnectionId]=r,m[i.RestConfigBase.configParams.token]=l.token,t.token&&(m[t.headerName]=t.token);const y="TRUE"===e.parameters.getProperty("SPEECH-EnableWebsocketCompression","").toUpperCase();return Promise.resolve(new i.WebsocketConnection(v,g,m,new h.WebsocketMessageFormatter,i.ProxyInfo.fromRecognizerConfig(e),y,r))}}t.ConversationTranslatorConnectionFactory=d,d.CTS_VIRT_MIC_PATH="/speech/recognition/dynamicaudio"},2492:e=>{"use strict";e.exports=function(e,t){t||(t={}),"function"==typeof t&&(t={cmp:t});var r,i="boolean"==typeof t.cycles&&t.cycles,n=t.cmp&&(r=t.cmp,function(e){return function(t,i){var n={key:t,value:e[t]},o={key:i,value:e[i]};return r(n,o)}}),o=[];return function e(t){if(t&&t.toJSON&&"function"==typeof t.toJSON&&(t=t.toJSON()),void 0!==t){if("number"==typeof t)return isFinite(t)?""+t:"null";if("object"!=typeof t)return JSON.stringify(t);var r,s;if(Array.isArray(t)){for(s="[",r=0;r<t.length;r++)r&&(s+=","),s+=e(t[r])||"null";return s+"]"}if(null===t)return"null";if(-1!==o.indexOf(t)){if(i)return JSON.stringify("__cycle__");throw new TypeError("Converting circular structure to JSON")}var a=o.push(t)-1,c=Object.keys(t).sort(n&&n(t));for(s="",r=0;r<c.length;r++){var u=c[r],h=e(t[u]);h&&(s&&(s+=","),s+=JSON.stringify(u)+":"+h)}return o.splice(a,1),"{"+s+"}"}}(e)}},2501:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ConnectionMessageImpl=t.ConnectionMessage=void 0;const i=r(7014),n=r(868),o=r(7317),s=r(6300);t.ConnectionMessage=class{},t.ConnectionMessageImpl=class{constructor(e){this.privConnectionMessage=e,this.privProperties=new o.PropertyCollection,this.privConnectionMessage.headers[i.HeaderNames.ConnectionId]&&this.privProperties.setProperty(s.PropertyId.Speech_SessionId,this.privConnectionMessage.headers[i.HeaderNames.ConnectionId]),Object.keys(this.privConnectionMessage.headers).forEach(e=>{this.privProperties.setProperty(e,this.privConnectionMessage.headers[e])})}get path(){return this.privConnectionMessage.headers[Object.keys(this.privConnectionMessage.headers).find(e=>e.toLowerCase()==="path".toLowerCase())]}get isTextMessage(){return this.privConnectionMessage.messageType===n.MessageType.Text}get isBinaryMessage(){return this.privConnectionMessage.messageType===n.MessageType.Binary}get TextMessage(){return this.privConnectionMessage.textBody}get binaryMessage(){return this.privConnectionMessage.binaryBody}get properties(){return this.privProperties}toString(){return""}}},2505:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TranslationSynthesisEnd=void 0;const i=r(9190);class n{constructor(e){this.privSynthesisEnd=JSON.parse(e),this.privSynthesisEnd.SynthesisStatus&&(this.privSynthesisEnd.SynthesisStatus=i.SynthesisStatus[this.privSynthesisEnd.SynthesisStatus]),this.privSynthesisEnd.Status&&(this.privSynthesisEnd.SynthesisStatus=i.SynthesisStatus[this.privSynthesisEnd.Status])}static fromJSON(e){return new n(e)}get SynthesisStatus(){return this.privSynthesisEnd.SynthesisStatus}get FailureReason(){return this.privSynthesisEnd.FailureReason}}t.TranslationSynthesisEnd=n},2509:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BackgroundEvent=void 0;const i=r(868);class n extends i.PlatformEvent{constructor(e){super("BackgroundEvent",i.EventType.Error),this.privError=e}get error(){return this.privError}}t.BackgroundEvent=n},2512:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ParticipantPayloadResponse=t.ParticipantsListPayloadResponse=void 0;class r{constructor(e){this.privParticipantsPayloadResponse=(e=>JSON.parse(e))(e)}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(e){return new r(e)}}t.ParticipantsListPayloadResponse=r;class i{constructor(e){this.privParticipantPayloadResponse=(e=>JSON.parse(e))(e)}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(e){return new i(e)}}t.ParticipantPayloadResponse=i},2546:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SynthesisVoicesResult=void 0;const i=r(881);class n extends i.SynthesisResult{constructor(e,t,r){if(Array.isArray(t)){super(e,i.ResultReason.VoicesListRetrieved,void 0,new i.PropertyCollection),this.privVoices=[];for(const e of t)this.privVoices.push(new i.VoiceInfo(e))}else super(e,i.ResultReason.Canceled,r||"Error information unavailable",new i.PropertyCollection)}get voices(){return this.privVoices}}t.SynthesisVoicesResult=n},2548:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RecognitionResult=void 0,t.RecognitionResult=class{constructor(e,t,r,i,n,o,s,a,c,u){this.privResultId=e,this.privReason=t,this.privText=r,this.privDuration=i,this.privOffset=n,this.privLanguage=o,this.privLanguageDetectionConfidence=s,this.privErrorDetails=a,this.privJson=c,this.privProperties=u}get resultId(){return this.privResultId}get reason(){return this.privReason}get text(){return this.privText}get duration(){return this.privDuration}get offset(){return this.privOffset}get language(){return this.privLanguage}get languageDetectionConfidence(){return this.privLanguageDetectionConfidence}get errorDetails(){return this.privErrorDetails}get json(){return this.privJson}get properties(){return this.privProperties}}},2563:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.VoiceProfilePhraseResult=void 0;const i=r(5245),n=r(881);class o extends n.VoiceProfileResult{constructor(e,t,r,n){super(e,t),this.privPhrases=[],i.Contracts.throwIfNullOrUndefined(n,"phrase array"),this.privType=r,n&&n[0]&&(this.privPhrases=n)}get phrases(){return this.privPhrases}get type(){return this.privType}}t.VoiceProfilePhraseResult=o},2621:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PullAudioInputStreamCallback=void 0,t.PullAudioInputStreamCallback=class{}},2623:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Stream=void 0;const i=r(6209),n=r(4462),o=r(3804);t.Stream=class{constructor(e){this.privIsWriteEnded=!1,this.privIsReadEnded=!1,this.privId=e||(0,n.createNoDashGuid)(),this.privReaderQueue=new o.Queue}get isClosed(){return this.privIsWriteEnded}get isReadEnded(){return this.privIsReadEnded}get id(){return this.privId}close(){this.privIsWriteEnded||(this.writeStreamChunk({buffer:null,isEnd:!0,timeReceived:Date.now()}),this.privIsWriteEnded=!0)}writeStreamChunk(e){if(this.throwIfClosed(),!this.privReaderQueue.isDisposed())try{this.privReaderQueue.enqueue(e)}catch(e){}}read(){if(this.privIsReadEnded)throw new i.InvalidOperationError("Stream read has already finished");return this.privReaderQueue.dequeue().then(async e=>((void 0===e||e.isEnd)&&await this.privReaderQueue.dispose("End of stream reached"),e))}readEnded(){this.privIsReadEnded||(this.privIsReadEnded=!0,this.privReaderQueue=new o.Queue)}throwIfClosed(){if(this.privIsWriteEnded)throw new i.InvalidOperationError("Stream closed")}}},2649:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WebsocketMessageFormatter=void 0;const i=r(868);t.WebsocketMessageFormatter=class{toConnectionMessage(e){const t=new i.Deferred;try{if(e.messageType===i.MessageType.Text){const r=e.textContent;let n={},o=null;if(r){const e=r.split("\r\n\r\n");e&&e.length>0&&(n=this.parseHeaders(e[0]),e.length>1&&(o=e[1]))}t.resolve(new i.ConnectionMessage(e.messageType,o,n,e.id))}else if(e.messageType===i.MessageType.Binary){const r=e.binaryContent;let n={},o=null;if(!r||r.byteLength<2)throw new Error("Invalid binary message format. Header length missing.");const s=new DataView(r),a=s.getInt16(0);if(r.byteLength<a+2)throw new Error("Invalid binary message format. Header content missing.");let c="";for(let e=0;e<a;e++)c+=String.fromCharCode(s.getInt8(e+2));n=this.parseHeaders(c),r.byteLength>a+2&&(o=r.slice(2+a)),t.resolve(new i.ConnectionMessage(e.messageType,o,n,e.id))}}catch(e){t.reject(`Error formatting the message. Error: ${e}`)}return t.promise}fromConnectionMessage(e){const t=new i.Deferred;try{if(e.messageType===i.MessageType.Text){const r=`${this.makeHeaders(e)}\r\n${e.textBody?e.textBody:""}`;t.resolve(new i.RawWebsocketMessage(i.MessageType.Text,r,e.id))}else if(e.messageType===i.MessageType.Binary){const r=this.makeHeaders(e),n=e.binaryBody,o=this.stringToArrayBuffer(r),s=new Int8Array(o),a=s.byteLength,c=new Int8Array(2+a+(n?n.byteLength:0));if(c[0]=a>>8&255,c[1]=255&a,c.set(s,2),n){const e=new Int8Array(n);c.set(e,2+a)}const u=c.buffer;t.resolve(new i.RawWebsocketMessage(i.MessageType.Binary,u,e.id))}}catch(e){t.reject(`Error formatting the message. ${e}`)}return t.promise}makeHeaders(e){let t="";if(e.headers)for(const r in e.headers)r&&(t+=`${r}: ${e.headers[r]}\r\n`);return t}parseHeaders(e){const t={};if(e){const r=e.match(/[^\r\n]+/g);if(t)for(const e of r)if(e){const r=e.indexOf(":"),i=r>0?e.substr(0,r).trim().toLowerCase():e,n=r>0&&e.length>r+1?e.substr(r+1).trim():"";t[i]=n}}return t}stringToArrayBuffer(e){const t=new ArrayBuffer(e.length),r=new DataView(t);for(let t=0;t<e.length;t++)r.setUint8(t,e.charCodeAt(t));return t}}},2654:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TranslationSynthesisEventArgs=void 0;const i=r(881);class n extends i.SessionEventArgs{constructor(e,t){super(t),this.privResult=e}get result(){return this.privResult}}t.TranslationSynthesisEventArgs=n},2690:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AuthInfo=void 0,t.AuthInfo=class{constructor(e,t){this.privHeaderName=e,this.privToken=t}get headerName(){return this.privHeaderName}get token(){return this.privToken}}},2699:(e,t)=>{"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.RecognitionMode=void 0,(r=t.RecognitionMode||(t.RecognitionMode={})).Interactive="Interactive",r.Dictation="Dictation",r.Conversation="Conversation",r.None="None"},2754:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PlatformEvent=t.EventType=void 0;const i=r(4462);var n;(n=t.EventType||(t.EventType={}))[n.Debug=0]="Debug",n[n.Info=1]="Info",n[n.Warning=2]="Warning",n[n.Error=3]="Error",n[n.None=4]="None",t.PlatformEvent=class{constructor(e,t){this.privName=e,this.privEventId=(0,i.createNoDashGuid)(),this.privEventTime=(new Date).toISOString(),this.privEventType=t,this.privMetadata={}}get name(){return this.privName}get eventId(){return this.privEventId}get eventTime(){return this.privEventTime}get eventType(){return this.privEventType}get metadata(){return this.privMetadata}}},2820:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SpeechContext=void 0;const i=r(2699),n=r(1980);t.SpeechContext=class{constructor(e){this.privContext={},this.privDynamicGrammar=e}getContext(){return this.privContext}setPronunciationAssessmentParams(e,t,r=!1){void 0===this.privContext.phraseDetection&&(this.privContext.phraseDetection={enrichment:{pronunciationAssessment:{}}}),void 0===this.privContext.phraseDetection.enrichment&&(this.privContext.phraseDetection.enrichment={pronunciationAssessment:{}}),this.privContext.phraseDetection.enrichment.pronunciationAssessment=JSON.parse(e)||{},r&&(this.privContext.phraseDetection.mode=i.RecognitionMode.Conversation),this.setWordLevelTimings(),this.privContext.phraseOutput.detailed.options.push(n.PhraseOption.PronunciationAssessment),-1===this.privContext.phraseOutput.detailed.options.indexOf(n.PhraseOption.SNR)&&this.privContext.phraseOutput.detailed.options.push(n.PhraseOption.SNR),t&&(this.privContext.phraseDetection.enrichment.contentAssessment={topic:t},this.privContext.phraseOutput.detailed.options.push(n.PhraseOption.ContentAssessment))}setDetailedOutputFormat(){void 0===this.privContext.phraseOutput&&(this.privContext.phraseOutput={detailed:{options:[]}}),void 0===this.privContext.phraseOutput.detailed&&(this.privContext.phraseOutput.detailed={options:[]}),this.privContext.phraseOutput.format=n.OutputFormat.Detailed}setWordLevelTimings(){void 0===this.privContext.phraseOutput&&(this.privContext.phraseOutput={detailed:{options:[]}}),void 0===this.privContext.phraseOutput.detailed&&(this.privContext.phraseOutput.detailed={options:[]}),this.privContext.phraseOutput.format=n.OutputFormat.Detailed,-1===this.privContext.phraseOutput.detailed.options.indexOf(n.PhraseOption.WordTimings)&&this.privContext.phraseOutput.detailed.options.push(n.PhraseOption.WordTimings)}setSpeakerDiarizationAudioOffsetMs(e){this.privContext.phraseDetection.speakerDiarization.audioOffsetMs=e}toJSON(){const e=this.privDynamicGrammar.generateGrammarObject();return this.privContext.dgi=e,JSON.stringify(this.privContext)}}},2842:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Diagnostics=void 0;const i=r(4378),n=r(868);class o{static SetLoggingLevel(e){this.privListener=new i.ConsoleLoggingListener(e),n.Events.instance.attachConsoleListener(this.privListener)}static StartConsoleOutput(){this.privListener&&(this.privListener.enableConsoleOutput=!0)}static StopConsoleOutput(){this.privListener&&(this.privListener.enableConsoleOutput=!1)}static SetLogOutputPath(e){if("undefined"!=typeof window)throw new Error("File system logging not available in browser.");this.privListener&&(this.privListener.logPath=e)}static set onLogOutput(e){this.privListener&&(this.privListener.logCallback=e)}}t.Diagnostics=o,o.privListener=void 0},2894:(e,t)=>{"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.SegmentationMode=void 0,(r=t.SegmentationMode||(t.SegmentationMode={})).Normal="Normal",r.Disabled="Disabled",r.Custom="Custom",r.Semantic="Semantic"},2929:(e,t)=>{"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.PronunciationAssessmentGranularity=void 0,(r=t.PronunciationAssessmentGranularity||(t.PronunciationAssessmentGranularity={}))[r.Phoneme=1]="Phoneme",r[r.Word=2]="Word",r[r.FullText=3]="FullText"},2964:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},2966:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ConversationTranscriptionResult=t.MeetingTranscriber=t.MeetingTranscriptionCanceledEventArgs=t.MeetingImpl=t.Meeting=t.ParticipantChangedReason=t.User=t.Participant=t.ConversationTranscriber=t.ConversationTranslator=t.ConversationTranslationResult=t.ConversationTranslationEventArgs=t.ConversationTranslationCanceledEventArgs=t.ConversationParticipantsChangedEventArgs=t.ConversationExpirationEventArgs=t.ConversationCommon=t.ConversationImpl=t.Conversation=void 0;var i=r(5054);Object.defineProperty(t,"Conversation",{enumerable:!0,get:function(){return i.Conversation}}),Object.defineProperty(t,"ConversationImpl",{enumerable:!0,get:function(){return i.ConversationImpl}});var n=r(1515);Object.defineProperty(t,"ConversationCommon",{enumerable:!0,get:function(){return n.ConversationCommon}});var o=r(8174);Object.defineProperty(t,"ConversationExpirationEventArgs",{enumerable:!0,get:function(){return o.ConversationExpirationEventArgs}});var s=r(7181);Object.defineProperty(t,"ConversationParticipantsChangedEventArgs",{enumerable:!0,get:function(){return s.ConversationParticipantsChangedEventArgs}});var a=r(3547);Object.defineProperty(t,"ConversationTranslationCanceledEventArgs",{enumerable:!0,get:function(){return a.ConversationTranslationCanceledEventArgs}});var c=r(1514);Object.defineProperty(t,"ConversationTranslationEventArgs",{enumerable:!0,get:function(){return c.ConversationTranslationEventArgs}});var u=r(2150);Object.defineProperty(t,"ConversationTranslationResult",{enumerable:!0,get:function(){return u.ConversationTranslationResult}});var h=r(764);Object.defineProperty(t,"ConversationTranslator",{enumerable:!0,get:function(){return h.ConversationTranslator}});var d=r(6315);Object.defineProperty(t,"ConversationTranscriber",{enumerable:!0,get:function(){return d.ConversationTranscriber}});var l=r(4497);Object.defineProperty(t,"Participant",{enumerable:!0,get:function(){return l.Participant}}),Object.defineProperty(t,"User",{enumerable:!0,get:function(){return l.User}});var p=r(1766);Object.defineProperty(t,"ParticipantChangedReason",{enumerable:!0,get:function(){return p.ParticipantChangedReason}});var f=r(4408);Object.defineProperty(t,"Meeting",{enumerable:!0,get:function(){return f.Meeting}}),Object.defineProperty(t,"MeetingImpl",{enumerable:!0,get:function(){return f.MeetingImpl}});var v=r(6420);Object.defineProperty(t,"MeetingTranscriptionCanceledEventArgs",{enumerable:!0,get:function(){return v.MeetingTranscriptionCanceledEventArgs}});var g=r(4293);Object.defineProperty(t,"MeetingTranscriber",{enumerable:!0,get:function(){return g.MeetingTranscriber}});var m=r(6793);Object.defineProperty(t,"ConversationTranscriptionResult",{enumerable:!0,get:function(){return m.ConversationTranscriptionResult}})},3020:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ConnectionMessageEventArgs=void 0,t.ConnectionMessageEventArgs=class{constructor(e){this.privConnectionMessage=e}get message(){return this.privConnectionMessage}toString(){return"Message: "+this.privConnectionMessage.toString()}}},3072:(e,t)=>{"use strict";var r="function"==typeof Symbol&&Symbol.for,i=r?Symbol.for("react.element"):60103,n=r?Symbol.for("react.portal"):60106,o=r?Symbol.for("react.fragment"):60107,s=r?Symbol.for("react.strict_mode"):60108,a=r?Symbol.for("react.profiler"):60114,c=r?Symbol.for("react.provider"):60109,u=r?Symbol.for("react.context"):60110,h=r?Symbol.for("react.async_mode"):60111,d=r?Symbol.for("react.concurrent_mode"):60111,l=r?Symbol.for("react.forward_ref"):60112,p=r?Symbol.for("react.suspense"):60113,f=r?Symbol.for("react.suspense_list"):60120,v=r?Symbol.for("react.memo"):60115,g=r?Symbol.for("react.lazy"):60116,m=r?Symbol.for("react.block"):60121,y=r?Symbol.for("react.fundamental"):60117,b=r?Symbol.for("react.responder"):60118,S=r?Symbol.for("react.scope"):60119;function C(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case i:switch(e=e.type){case h:case d:case o:case a:case s:case p:return e;default:switch(e=e&&e.$$typeof){case u:case l:case g:case v:case c:return e;default:return t}}case n:return t}}}function w(e){return C(e)===d}t.AsyncMode=h,t.ConcurrentMode=d,t.ContextConsumer=u,t.ContextProvider=c,t.Element=i,t.ForwardRef=l,t.Fragment=o,t.Lazy=g,t.Memo=v,t.Portal=n,t.Profiler=a,t.StrictMode=s,t.Suspense=p,t.isAsyncMode=function(e){return w(e)||C(e)===h},t.isConcurrentMode=w,t.isContextConsumer=function(e){return C(e)===u},t.isContextProvider=function(e){return C(e)===c},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===i},t.isForwardRef=function(e){return C(e)===l},t.isFragment=function(e){return C(e)===o},t.isLazy=function(e){return C(e)===g},t.isMemo=function(e){return C(e)===v},t.isPortal=function(e){return C(e)===n},t.isProfiler=function(e){return C(e)===a},t.isStrictMode=function(e){return C(e)===s},t.isSuspense=function(e){return C(e)===p},t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===o||e===d||e===a||e===s||e===p||e===f||"object"==typeof e&&null!==e&&(e.$$typeof===g||e.$$typeof===v||e.$$typeof===c||e.$$typeof===u||e.$$typeof===l||e.$$typeof===y||e.$$typeof===b||e.$$typeof===S||e.$$typeof===m)},t.typeOf=C},3126:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TextResponsePayload=t.SpeechResponsePayload=void 0;class r{constructor(e){this.privSpeechResponse=(e=>JSON.parse(e))(e)}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"final"===this.privSpeechResponse.type}static fromJSON(e){return new r(e)}}t.SpeechResponsePayload=r;class i{constructor(e){this.privTextResponse=(e=>JSON.parse(e))(e)}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(e){return new i(e)}}t.TextResponsePayload=i},3173:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SourceLanguageConfig=void 0;const i=r(5245);class n{constructor(e,t){i.Contracts.throwIfNullOrUndefined(e,"language"),this.privLanguage=e,this.privEndpointId=t}static fromLanguage(e,t){return new n(e,t)}get language(){return this.privLanguage}get endpointId(){return this.privEndpointId}}t.SourceLanguageConfig=n},3226:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DialogConnectionFactory=void 0;const i=r(4378),n=r(9190),o=r(881),s=r(7778),a=r(9190),c=r(7014),u=r(9324);class h extends s.ConnectionFactoryBase{create(e,t,r){const d=e.parameters.getProperty(o.PropertyId.Conversation_ApplicationId,""),l=e.parameters.getProperty(o.PropertyId.Conversation_DialogType),p=e.parameters.getProperty(o.PropertyId.SpeechServiceConnection_Region),f=e.parameters.getProperty(o.PropertyId.SpeechServiceConnection_RecoLanguage,"en-US"),v=e.parameters.getProperty(o.PropertyId.Conversation_Request_Bot_Status_Messages,"true"),g={};g[c.HeaderNames.ConnectionId]=r,g[u.QueryParameterNames.Format]=e.parameters.getProperty(n.OutputFormatPropertyName,o.OutputFormat[o.OutputFormat.Simple]).toLowerCase(),g[u.QueryParameterNames.Language]=f,g[u.QueryParameterNames.RequestBotStatusMessages]=v,d&&(g[u.QueryParameterNames.BotId]=d,l===o.DialogServiceConfig.DialogTypes.CustomCommands&&(g[c.HeaderNames.CustomCommandsAppId]=d));const m=l===o.DialogServiceConfig.DialogTypes.CustomCommands?"commands/":"",y=l===o.DialogServiceConfig.DialogTypes.CustomCommands?"v1":l===o.DialogServiceConfig.DialogTypes.BotFramework?"v3":"v0",b={};null!=t.token&&""!==t.token&&(b[t.headerName]=t.token);let S=e.parameters.getProperty(o.PropertyId.SpeechServiceConnection_Endpoint,"");if(!S){const t=s.ConnectionFactoryBase.getHostSuffix(p),r=e.parameters.getProperty(o.PropertyId.SpeechServiceConnection_Host,`wss://${p}.${h.BaseUrl}${t}`);S=`${r.endsWith("/")?r:r+"/"}${m}${h.ApiKey}/${y}`}this.setCommonUrlParams(e,g,S);const C="true"===e.parameters.getProperty("SPEECH-EnableWebsocketCompression","false");return Promise.resolve(new i.WebsocketConnection(S,g,b,new a.WebsocketMessageFormatter,i.ProxyInfo.fromRecognizerConfig(e),C,r))}}t.DialogConnectionFactory=h,h.ApiKey="api",h.BaseUrl="convai.speech"},3245:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ConversationServiceAdapter=void 0;const i=r(868),n=r(881),o=r(9190),s=r(4524),a=r(5472),c=r(4272),u=r(9061),h=r(6641);class d extends o.ServiceRecognizerBase{constructor(e,t,r,n,o){super(e,t,r,n,o),this.privConnectionConfigPromise=void 0,this.privLastPartialUtteranceId="",this.privConversationServiceConnector=o,this.privConversationAuthentication=e,this.receiveMessageOverride=()=>this.receiveConversationMessageOverride(),this.recognizeOverride=()=>this.noOp(),this.postConnectImplOverride=e=>this.conversationConnectImpl(e),this.configConnectionOverride=()=>this.configConnection(),this.disconnectOverride=()=>this.privDisconnect(),this.privConversationRequestSession=new a.ConversationRequestSession((0,i.createNoDashGuid)()),this.privConversationConnectionFactory=t,this.privConversationIsDisposed=!1}isDisposed(){return super.isDisposed()||this.privConversationIsDisposed}async dispose(e){if(this.privConversationIsDisposed=!0,void 0!==this.privConnectionConfigPromise){const t=await this.privConnectionConfigPromise;await t.dispose(e)}await super.dispose(e)}async sendMessage(e){return(await this.fetchConnection()).send(new s.ConversationConnectionMessage(i.MessageType.Text,e))}async sendMessageAsync(e){const t=await this.fetchConnection();await t.send(new s.ConversationConnectionMessage(i.MessageType.Text,e))}privDisconnect(){if(!this.terminateMessageLoop)return this.cancelRecognition(this.privConversationRequestSession.sessionId,this.privConversationRequestSession.requestId,n.CancellationReason.Error,n.CancellationErrorCode.NoError,"Disconnecting"),this.terminateMessageLoop=!0,Promise.resolve()}async processTypeSpecificMessages(){return!0}cancelRecognition(e,t,r,i,o){this.terminateMessageLoop=!0;const s=new n.ConversationTranslationCanceledEventArgs(r,o,i,void 0,e);try{this.privConversationServiceConnector.canceled&&this.privConversationServiceConnector.canceled(this.privConversationServiceConnector,s)}catch{}}async conversationConnectImpl(e){return this.privConnectionLoop=this.startMessageLoop(),e}async receiveConversationMessageOverride(){if(this.isDisposed()||this.terminateMessageLoop)return Promise.resolve();const e=new i.Deferred;try{const t=await this.fetchConnection(),r=await t.read();if(this.isDisposed()||this.terminateMessageLoop)return e.resolve(),Promise.resolve();if(!r)return this.receiveConversationMessageOverride();const i=this.privConversationRequestSession.sessionId,s=r.conversationMessageType.toLowerCase();let a=!1;try{switch(s){case"info":case"participant_command":case"command":const e=h.CommandResponsePayload.fromJSON(r.textBody);switch(e.command.toLowerCase()){case"participantlist":const t=h.ParticipantsListPayloadResponse.fromJSON(r.textBody),s=t.participants.map(e=>({avatar:e.avatar,displayName:e.nickname,id:e.participantId,isHost:e.ishost,isMuted:e.ismuted,isUsingTts:e.usetts,preferredLanguage:e.locale}));this.privConversationServiceConnector.participantsListReceived&&this.privConversationServiceConnector.participantsListReceived(this.privConversationServiceConnector,new c.ParticipantsListEventArgs(t.roomid,t.token,t.translateTo,t.profanityFilter,t.roomProfanityFilter,t.roomLocked,t.muteAll,s,i));break;case"settranslatetolanguages":this.privConversationServiceConnector.participantUpdateCommandReceived&&this.privConversationServiceConnector.participantUpdateCommandReceived(this.privConversationServiceConnector,new c.ParticipantAttributeEventArgs(e.participantId,u.ConversationTranslatorCommandTypes.setTranslateToLanguages,e.value,i));break;case"setprofanityfiltering":this.privConversationServiceConnector.participantUpdateCommandReceived&&this.privConversationServiceConnector.participantUpdateCommandReceived(this.privConversationServiceConnector,new c.ParticipantAttributeEventArgs(e.participantId,u.ConversationTranslatorCommandTypes.setProfanityFiltering,e.value,i));break;case"setmute":this.privConversationServiceConnector.participantUpdateCommandReceived&&this.privConversationServiceConnector.participantUpdateCommandReceived(this.privConversationServiceConnector,new c.ParticipantAttributeEventArgs(e.participantId,u.ConversationTranslatorCommandTypes.setMute,e.value,i));break;case"setmuteall":this.privConversationServiceConnector.muteAllCommandReceived&&this.privConversationServiceConnector.muteAllCommandReceived(this.privConversationServiceConnector,new c.MuteAllEventArgs(e.value,i));break;case"roomexpirationwarning":this.privConversationServiceConnector.conversationExpiration&&this.privConversationServiceConnector.conversationExpiration(this.privConversationServiceConnector,new n.ConversationExpirationEventArgs(e.value,this.privConversationRequestSession.sessionId));break;case"setusetts":this.privConversationServiceConnector.participantUpdateCommandReceived&&this.privConversationServiceConnector.participantUpdateCommandReceived(this.privConversationServiceConnector,new c.ParticipantAttributeEventArgs(e.participantId,u.ConversationTranslatorCommandTypes.setUseTTS,e.value,i));break;case"setlockstate":this.privConversationServiceConnector.lockRoomCommandReceived&&this.privConversationServiceConnector.lockRoomCommandReceived(this.privConversationServiceConnector,new c.LockRoomEventArgs(e.value,i));break;case"changenickname":this.privConversationServiceConnector.participantUpdateCommandReceived&&this.privConversationServiceConnector.participantUpdateCommandReceived(this.privConversationServiceConnector,new c.ParticipantAttributeEventArgs(e.participantId,u.ConversationTranslatorCommandTypes.changeNickname,e.value,i));break;case"joinsession":const a=h.ParticipantPayloadResponse.fromJSON(r.textBody),d={avatar:a.avatar,displayName:a.nickname,id:a.participantId,isHost:a.ishost,isMuted:a.ismuted,isUsingTts:a.usetts,preferredLanguage:a.locale};this.privConversationServiceConnector.participantJoinCommandReceived&&this.privConversationServiceConnector.participantJoinCommandReceived(this.privConversationServiceConnector,new c.ParticipantEventArgs(d,i));break;case"leavesession":const l={id:e.participantId};this.privConversationServiceConnector.participantLeaveCommandReceived&&this.privConversationServiceConnector.participantLeaveCommandReceived(this.privConversationServiceConnector,new c.ParticipantEventArgs(l,i));break;case"disconnectsession":e.participantId;break;case"token":const p=new o.CognitiveTokenAuthentication(()=>{const t=e.token;return Promise.resolve(t)},()=>{const t=e.token;return Promise.resolve(t)});this.authentication=p,this.privConversationServiceConnector.onToken(p)}break;case"partial":case"final":const t=h.SpeechResponsePayload.fromJSON(r.textBody),d="final"===s?n.ResultReason.TranslatedParticipantSpeech:n.ResultReason.TranslatingParticipantSpeech,l=new n.ConversationTranslationResult(t.participantId,this.getTranslations(t.translations),t.language,t.id,d,t.recognition,void 0,void 0,r.textBody,void 0);t.isFinal?((void 0!==l.text&&l.text.length>0||t.id===this.privLastPartialUtteranceId)&&(a=!0),a&&this.privConversationServiceConnector.translationReceived&&this.privConversationServiceConnector.translationReceived(this.privConversationServiceConnector,new c.ConversationReceivedTranslationEventArgs(u.ConversationTranslatorMessageTypes.final,l,i))):void 0!==l.text&&(this.privLastPartialUtteranceId=t.id,this.privConversationServiceConnector.translationReceived&&this.privConversationServiceConnector.translationReceived(this.privConversationServiceConnector,new c.ConversationReceivedTranslationEventArgs(u.ConversationTranslatorMessageTypes.partial,l,i)));break;case"translated_message":const p=h.TextResponsePayload.fromJSON(r.textBody),f=new n.ConversationTranslationResult(p.participantId,this.getTranslations(p.translations),p.language,void 0,void 0,p.originalText,void 0,void 0,void 0,r.textBody,void 0);this.privConversationServiceConnector.translationReceived&&this.privConversationServiceConnector.translationReceived(this.privConversationServiceConnector,new c.ConversationReceivedTranslationEventArgs(u.ConversationTranslatorMessageTypes.instantMessage,f,i))}}catch(e){}return this.receiveConversationMessageOverride()}catch(e){this.terminateMessageLoop=!0}return e.promise}async startMessageLoop(){if(this.isDisposed())return Promise.resolve();this.terminateMessageLoop=!1;const e=this.receiveConversationMessageOverride();try{return await e}catch(e){return this.cancelRecognition(this.privRequestSession?this.privRequestSession.sessionId:"",this.privRequestSession?this.privRequestSession.requestId:"",n.CancellationReason.Error,n.CancellationErrorCode.RuntimeError,e),null}}configConnection(){return this.isDisposed()?Promise.resolve(void 0):void 0!==this.privConnectionConfigPromise?this.privConnectionConfigPromise.then(e=>e.state()===i.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(e=>e),this.privConnectionConfigPromise)}getTranslations(e){let t;if(void 0!==e){t=new n.Translations;for(const r of e)t.set(r.lang,r.translation)}return t}}t.ConversationServiceAdapter=d},3349:e=>{function t(e,t){if(!e)throw new Error(t||"Assertion failed")}e.exports=t,t.equal=function(e,t,r){if(e!=t)throw new Error(r||"Assertion failed: "+e+" != "+t)}},3400:(e,t)=>{"use strict";var r,i;Object.defineProperty(t,"__esModule",{value:!0}),t.VoiceInfo=t.SynthesisVoiceType=t.SynthesisVoiceGender=void 0,function(e){e[e.Unknown=0]="Unknown",e[e.Female=1]="Female",e[e.Male=2]="Male",e[e.Neutral=3]="Neutral"}(r=t.SynthesisVoiceGender||(t.SynthesisVoiceGender={})),function(e){e[e.Unknown=0]="Unknown",e[e.OnlineNeural=1]="OnlineNeural",e[e.OnlineStandard=2]="OnlineStandard",e[e.OfflineNeural=3]="OfflineNeural",e[e.OfflineStandard=4]="OfflineStandard",e[e.OnlineNeuralHD=5]="OnlineNeuralHD"}(i=t.SynthesisVoiceType||(t.SynthesisVoiceType={}));const n={[r[r.Neutral]]:r.Neutral,[r[r.Male]]:r.Male,[r[r.Female]]:r.Female},o={Neural:i.OnlineNeural,NeuralHD:i.OnlineNeuralHD};t.VoiceInfo=class{constructor(e){if(this.privStyleList=[],e){if(this.privName=e.Name,this.privLocale=e.Locale,this.privShortName=e.ShortName,this.privLocaleName=e.LocaleName,this.privDisplayName=e.DisplayName,this.privLocalName=e.LocalName,this.privVoiceType=o[e.VoiceType]||i.Unknown,this.privGender=n[e.Gender]||r.Unknown,e.StyleList&&Array.isArray(e.StyleList))for(const t of e.StyleList)this.privStyleList.push(t);this.privSampleRateHertz=e.SampleRateHertz,this.privStatus=e.Status,e.ExtendedPropertyMap&&(this.privExtendedPropertyMap=e.ExtendedPropertyMap),this.privWordsPerMinute=e.WordsPerMinute,Array.isArray(e.SecondaryLocaleList)&&(this.privSecondaryLocaleList=[...e.SecondaryLocaleList]),Array.isArray(e.RolePlayList)&&(this.privRolePlayList=[...e.RolePlayList]),e.VoiceTag&&(this.privVoiceTag=e.VoiceTag)}}get name(){return this.privName}get locale(){return this.privLocale}get shortName(){return this.privShortName}get displayName(){return this.privDisplayName}get localName(){return this.privLocalName}get localeName(){return this.privLocaleName}get gender(){return this.privGender}get voiceType(){return this.privVoiceType}get styleList(){return this.privStyleList}get sampleRateHertz(){return this.privSampleRateHertz}get status(){return this.privStatus}get extendedPropertyMap(){return this.privExtendedPropertyMap}get wordsPerMinute(){return this.privWordsPerMinute}get secondaryLocaleList(){return this.privSecondaryLocaleList}get rolePlayList(){return this.privRolePlayList}get voiceTag(){return this.privVoiceTag}}},3404:(e,t,r)=>{"use strict";e.exports=r(3072)},3476:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DialogServiceTurnState=void 0;const i=r(1355),n=r(8640),o=r(1729);t.DialogServiceTurnState=class{constructor(e,t){this.privRequestId=t,this.privIsCompleted=!1,this.privAudioStream=null,this.privTurnManager=e,this.resetTurnEndTimeout()}get audioStream(){return this.resetTurnEndTimeout(),this.privAudioStream}processActivityPayload(e,t){return e.messageDataStreamType===o.MessageDataStreamType.TextToSpeechAudio&&(this.privAudioStream=n.AudioOutputStream.createPullStream(),this.privAudioStream.format=void 0!==t?t:i.AudioOutputFormatImpl.getDefaultOutputFormat()),this.privAudioStream}endAudioStream(){null===this.privAudioStream||this.privAudioStream.isClosed||this.privAudioStream.close()}complete(){void 0!==this.privTimeoutToken&&clearTimeout(this.privTimeoutToken),this.endAudioStream()}resetTurnEndTimeout(){void 0!==this.privTimeoutToken&&clearTimeout(this.privTimeoutToken),this.privTimeoutToken=setTimeout(()=>{this.privTurnManager.CompleteTurn(this.privRequestId)},2e3)}}},3483:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},3493:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ConversationServiceRecognizer=void 0;const i=r(881),n=r(9190);class o extends n.ServiceRecognizerBase{constructor(e,t,r,i,n){super(e,t,r,i,n),this.handleSpeechPhraseMessage=async e=>this.handleSpeechPhrase(e),this.handleSpeechHypothesisMessage=e=>this.handleSpeechHypothesis(e)}processTypeSpecificMessages(e){}handleRecognizedCallback(e,t,r){}handleRecognizingCallback(e,t,r){}async processSpeechMessages(e){let t=!1;switch(e.path.toLowerCase()){case"speech.hypothesis":case"speech.fragment":this.handleSpeechHypothesisMessage&&this.handleSpeechHypothesisMessage(e.textBody),t=!0;break;case"speech.phrase":this.handleSpeechPhraseMessage&&await this.handleSpeechPhraseMessage(e.textBody),t=!0}return t}cancelRecognition(e,t,r,i,n){}async handleSpeechPhrase(e){const t=n.SimpleSpeechPhrase.fromJSON(e,this.privRequestSession.currentTurnAudioOffset),r=n.EnumTranslation.implTranslateRecognitionResult(t.RecognitionStatus);let o;const s=new i.PropertyCollection;if(s.setProperty(i.PropertyId.SpeechServiceResponse_JsonResult,e),this.privRequestSession.onPhraseRecognized(t.Offset+t.Duration),i.ResultReason.Canceled===r){const e=n.EnumTranslation.implTranslateCancelResult(t.RecognitionStatus),r=n.EnumTranslation.implTranslateCancelErrorCode(t.RecognitionStatus);await this.cancelRecognitionLocal(e,r,n.EnumTranslation.implTranslateErrorDetails(r))}else if(t.RecognitionStatus!==n.RecognitionStatus.EndOfDictation){if(this.privRecognizerConfig.parameters.getProperty(n.OutputFormatPropertyName)===i.OutputFormat[i.OutputFormat.Simple])o=new i.SpeechRecognitionResult(this.privRequestSession.requestId,r,t.DisplayText,t.Duration,t.Offset,t.Language,t.LanguageDetectionConfidence,t.SpeakerId,void 0,t.asJson(),s);else{const t=n.DetailedSpeechPhrase.fromJSON(e,this.privRequestSession.currentTurnAudioOffset);o=new i.SpeechRecognitionResult(this.privRequestSession.requestId,r,t.Text,t.Duration,t.Offset,t.Language,t.LanguageDetectionConfidence,t.SpeakerId,void 0,t.asJson(),s)}this.handleRecognizedCallback(o,o.offset,this.privRequestSession.sessionId)}}handleSpeechHypothesis(e){const t=n.SpeechHypothesis.fromJSON(e,this.privRequestSession.currentTurnAudioOffset),r=new i.PropertyCollection;r.setProperty(i.PropertyId.SpeechServiceResponse_JsonResult,e);const o=new i.SpeechRecognitionResult(this.privRequestSession.requestId,i.ResultReason.RecognizingSpeech,t.Text,t.Duration,t.Offset,t.Language,t.LanguageDetectionConfidence,t.SpeakerId,void 0,t.asJson(),r);this.privRequestSession.onHypothesis(t.Offset),this.handleRecognizingCallback(o,t.Duration,this.privRequestSession.sessionId)}}t.ConversationServiceRecognizer=o},3514:(e,t)=>{"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.ResultType=void 0,(r=t.ResultType||(t.ResultType={})).Auto="Auto",r.StableFragment="StableFragment",r.Hypothesis="Hypothesis",r.None="None"},3547:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ConversationTranslationCanceledEventArgs=void 0;const i=r(6119);class n extends i.CancellationEventArgsBase{}t.ConversationTranslationCanceledEventArgs=n},3549:(e,t)=>{"use strict";var r,i;Object.defineProperty(t,"__esModule",{value:!0}),t.SubstringMatchType=t.GroupType=void 0,(i=t.GroupType||(t.GroupType={})).IntentText="IntentText",i.IntentEntity="IntentEntity",i.Generic="Generic",i.People="People",i.Place="Place",i.DynamicEntity="DynamicEntity",(r=t.SubstringMatchType||(t.SubstringMatchType={})).None="None",r.LeftRooted="LeftRooted",r.PartialName="PartialName",r.MiddleOfSentence="MiddleOfSentence"},3553:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BotFrameworkConfig=void 0;const i=r(5245),n=r(9707),o=r(881);class s extends n.DialogServiceConfigImpl{constructor(){super()}static fromSubscription(e,t,r){i.Contracts.throwIfNullOrWhitespace(e,"subscription"),i.Contracts.throwIfNullOrWhitespace(t,"region");const s=new n.DialogServiceConfigImpl;return s.setProperty(o.PropertyId.Conversation_DialogType,n.DialogServiceConfig.DialogTypes.BotFramework),s.setProperty(o.PropertyId.SpeechServiceConnection_Key,e),s.setProperty(o.PropertyId.SpeechServiceConnection_Region,t),r&&s.setProperty(o.PropertyId.Conversation_ApplicationId,r),s}static fromAuthorizationToken(e,t,r){i.Contracts.throwIfNullOrWhitespace(e,"authorizationToken"),i.Contracts.throwIfNullOrWhitespace(t,"region");const s=new n.DialogServiceConfigImpl;return s.setProperty(o.PropertyId.Conversation_DialogType,n.DialogServiceConfig.DialogTypes.BotFramework),s.setProperty(o.PropertyId.SpeechServiceAuthorization_Token,e),s.setProperty(o.PropertyId.SpeechServiceConnection_Region,t),r&&s.setProperty(o.PropertyId.Conversation_ApplicationId,r),s}static fromHost(e,t,r){i.Contracts.throwIfNullOrUndefined(e,"host");const s=e instanceof URL?e:new URL(`wss://${e}.convai.speech.azure.us`);i.Contracts.throwIfNullOrUndefined(s,"resolvedHost");const a=new n.DialogServiceConfigImpl;return a.setProperty(o.PropertyId.Conversation_DialogType,n.DialogServiceConfig.DialogTypes.BotFramework),a.setProperty(o.PropertyId.SpeechServiceConnection_Host,s.toString()),void 0!==t&&a.setProperty(o.PropertyId.SpeechServiceConnection_Key,t),a}static fromEndpoint(e,t){i.Contracts.throwIfNull(e,"endpoint");const r=new n.DialogServiceConfigImpl;return r.setProperty(o.PropertyId.Conversation_DialogType,n.DialogServiceConfig.DialogTypes.BotFramework),r.setProperty(o.PropertyId.SpeechServiceConnection_Endpoint,e.toString()),void 0!==t&&r.setProperty(o.PropertyId.SpeechServiceConnection_Key,t),r}}t.BotFrameworkConfig=s},3567:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RawWebsocketMessage=void 0;const i=r(4132),n=r(6209),o=r(4462);t.RawWebsocketMessage=class{constructor(e,t,r){if(this.privPayload=null,!t)throw new n.ArgumentNullError("payload");if(e===i.MessageType.Binary&&"ArrayBuffer"!==Object.getPrototypeOf(t).constructor.name)throw new n.InvalidOperationError("Payload must be ArrayBuffer");if(e===i.MessageType.Text&&"string"!=typeof t)throw new n.InvalidOperationError("Payload must be a string");this.privMessageType=e,this.privPayload=t,this.privId=r||(0,o.createNoDashGuid)()}get messageType(){return this.privMessageType}get payload(){return this.privPayload}get textContent(){if(this.privMessageType===i.MessageType.Binary)throw new n.InvalidOperationError("Not supported for binary message");return this.privPayload}get binaryContent(){if(this.privMessageType===i.MessageType.Text)throw new n.InvalidOperationError("Not supported for text message");return this.privPayload}get id(){return this.privId}}},3678:()=>{},3768:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RestConfigBase=void 0;class r{static get requestOptions(){return r.privDefaultRequestOptions}static get configParams(){return r.privDefaultParams}static get restErrors(){return r.privRestErrors}}t.RestConfigBase=r,r.privDefaultRequestOptions={headers:{Accept:"application/json"},ignoreCache:!1,timeout:1e4},r.privRestErrors={authInvalidSubscriptionKey:"You must specify either an authentication token to use, or a Cognitive Speech subscription key.",authInvalidSubscriptionRegion:"You must specify the Cognitive Speech region to use.",invalidArgs:"Required input not found: {arg}.",invalidCreateJoinConversationResponse:"Creating/Joining conversation failed with HTTP {status}.",invalidParticipantRequest:"The requested participant was not found.",permissionDeniedConnect:"Required credentials not found.",permissionDeniedConversation:"Invalid operation: only the host can {command} the conversation.",permissionDeniedParticipant:"Invalid operation: only the host can {command} a participant.",permissionDeniedSend:"Invalid operation: the conversation is not in a connected state.",permissionDeniedStart:"Invalid operation: there is already an active conversation."},r.privDefaultParams={apiVersion:"api-version",authorization:"Authorization",clientAppId:"X-ClientAppId",contentTypeKey:"Content-Type",correlationId:"X-CorrelationId",languageCode:"language",nickname:"nickname",profanity:"profanity",requestId:"X-RequestId",roomId:"roomid",sessionToken:"token",subscriptionKey:"Ocp-Apim-Subscription-Key",subscriptionRegion:"Ocp-Apim-Subscription-Region",token:"X-CapitoToken"}},3785:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AutoDetectSourceLanguageConfig=void 0;const i=r(9190),n=r(5245),o=r(881),s=r(616);class a{constructor(){this.privProperties=new o.PropertyCollection,this.privProperties.setProperty(o.PropertyId.SpeechServiceConnection_LanguageIdMode,"AtStart"),this.privLanguageIdMode=s.LanguageIdMode.AtStart}static fromOpenRange(){const e=new a;return e.properties.setProperty(o.PropertyId.SpeechServiceConnection_AutoDetectSourceLanguages,i.AutoDetectSourceLanguagesOpenRangeOptionName),e.properties.setProperty(o.PropertyId.SpeechServiceConnection_RecoLanguage,"en-US"),e}static fromLanguages(e){n.Contracts.throwIfArrayEmptyOrWhitespace(e,"languages");const t=new a;return t.properties.setProperty(o.PropertyId.SpeechServiceConnection_AutoDetectSourceLanguages,e.join()),t}static fromSourceLanguageConfigs(e){if(e.length<1)throw new Error("Expected non-empty SourceLanguageConfig array.");const t=new a,r=[];return e.forEach(e=>{if(r.push(e.language),void 0!==e.endpointId&&""!==e.endpointId){const r=e.language+o.PropertyId.SpeechServiceConnection_EndpointId.toString();t.properties.setProperty(r,e.endpointId)}}),t.properties.setProperty(o.PropertyId.SpeechServiceConnection_AutoDetectSourceLanguages,r.join()),t}get properties(){return this.privProperties}set mode(e){e===s.LanguageIdMode.Continuous?(this.privProperties.setProperty(o.PropertyId.SpeechServiceConnection_RecognitionEndpointVersion,"2"),this.privProperties.setProperty(o.PropertyId.SpeechServiceConnection_LanguageIdMode,"Continuous")):(this.privProperties.setProperty(o.PropertyId.SpeechServiceConnection_RecognitionEndpointVersion,"1"),this.privProperties.setProperty(o.PropertyId.SpeechServiceConnection_LanguageIdMode,"AtStart")),this.privLanguageIdMode=e}}t.AutoDetectSourceLanguageConfig=a},3804:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Queue=void 0;const i=r(6209),n=r(15),o=r(5338);var s;!function(e){e[e.Dequeue=0]="Dequeue",e[e.Peek=1]="Peek"}(s||(s={})),t.Queue=class{constructor(e){this.privPromiseStore=new n.List,this.privIsDrainInProgress=!1,this.privIsDisposing=!1,this.privDisposeReason=null,this.privList=e||new n.List,this.privDetachables=[],this.privSubscribers=new n.List,this.privDetachables.push(this.privList.onAdded(()=>this.drain()))}enqueue(e){this.throwIfDispose(),this.enqueueFromPromise(new Promise(t=>t(e)))}enqueueFromPromise(e){this.throwIfDispose(),e.then(e=>{this.privList.add(e)},()=>{})}dequeue(){this.throwIfDispose();const e=new o.Deferred;return this.privSubscribers&&(this.privSubscribers.add({deferral:e,type:s.Dequeue}),this.drain()),e.promise}peek(){this.throwIfDispose();const e=new o.Deferred;return this.privSubscribers&&(this.privSubscribers.add({deferral:e,type:s.Peek}),this.drain()),e.promise}length(){return this.throwIfDispose(),this.privList.length()}isDisposed(){return null==this.privSubscribers}async drainAndDispose(e,t){if(!this.isDisposed()&&!this.privIsDisposing){this.privDisposeReason=t,this.privIsDisposing=!0;const r=this.privSubscribers;if(r){for(;r.length()>0;)r.removeFirst().deferral.resolve(void 0);this.privSubscribers===r&&(this.privSubscribers=r)}for(const e of this.privDetachables)await e.detach();if(this.privPromiseStore.length()>0&&e){const t=[];return this.privPromiseStore.toArray().forEach(e=>{t.push(e)}),Promise.all(t).finally(()=>{this.privSubscribers=null,this.privList.forEach(t=>{e(t)}),this.privList=null}).then()}this.privSubscribers=null,this.privList=null}}async dispose(e){await this.drainAndDispose(null,e)}drain(){if(!this.privIsDrainInProgress&&!this.privIsDisposing){this.privIsDrainInProgress=!0;const e=this.privSubscribers,t=this.privList;if(e&&t){for(;t.length()>0&&e.length()>0&&!this.privIsDisposing;){const r=e.removeFirst();if(r.type===s.Peek)r.deferral.resolve(t.first());else{const e=t.removeFirst();r.deferral.resolve(e)}}this.privSubscribers===e&&(this.privSubscribers=e),this.privList===t&&(this.privList=t)}this.privIsDrainInProgress=!1}}throwIfDispose(){if(this.isDisposed()){if(this.privDisposeReason)throw new i.InvalidOperationError(this.privDisposeReason);throw new i.ObjectDisposedError("Queue")}if(this.privIsDisposing)throw new i.InvalidOperationError("Queue disposing")}}},3917:(e,t,r)=>{"use strict";var i=r(7426),n=r(6166),o=r(6225),s=i.rotl32,a=i.sum32,c=i.sum32_5,u=o.ft_1,h=n.BlockHash,d=[1518500249,1859775393,2400959708,3395469782];function l(){if(!(this instanceof l))return new l;h.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}i.inherits(l,h),e.exports=l,l.blockSize=512,l.outSize=160,l.hmacStrength=80,l.padLength=64,l.prototype._update=function(e,t){for(var r=this.W,i=0;i<16;i++)r[i]=e[t+i];for(;i<r.length;i++)r[i]=s(r[i-3]^r[i-8]^r[i-14]^r[i-16],1);var n=this.h[0],o=this.h[1],h=this.h[2],l=this.h[3],p=this.h[4];for(i=0;i<r.length;i++){var f=~~(i/20),v=c(s(n,5),u(f,o,h,l),p,r[i],d[f]);p=l,l=h,h=s(o,30),o=n,n=v}this.h[0]=a(this.h[0],n),this.h[1]=a(this.h[1],o),this.h[2]=a(this.h[2],h),this.h[3]=a(this.h[3],l),this.h[4]=a(this.h[4],p)},l.prototype._digest=function(e){return"hex"===e?i.toHex32(this.h,"big"):i.split32(this.h,"big")}},3961:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AvatarVideoFormat=t.Coordinate=void 0,t.Coordinate=class{constructor(e,t){this.x=e,this.y=t}},t.AvatarVideoFormat=class{constructor(e="H264",t=2e6,r=1920,i=1080){this.codec=e,this.bitrate=t,this.width=r,this.height=i}setCropRange(e,t){this.cropRange={bottomRight:t,topLeft:e}}}},4008:(e,t)=>{"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.ConnectionState=void 0,(r=t.ConnectionState||(t.ConnectionState={}))[r.None=0]="None",r[r.Connected=1]="Connected",r[r.Connecting=2]="Connecting",r[r.Disconnected=3]="Disconnected"},4012:t=>{"use strict";t.exports=e},4028:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ChunkedArrayBufferStream=void 0;const i=r(868);class n extends i.Stream{constructor(e,t){super(t),this.privTargetChunkSize=Math.round(e),this.privNextBufferReadyBytes=0}writeStreamChunk(e){if(e.isEnd||0===this.privNextBufferReadyBytes&&e.buffer.byteLength===this.privTargetChunkSize)return void super.writeStreamChunk(e);let t=0;for(;t<e.buffer.byteLength;){void 0===this.privNextBufferToWrite&&(this.privNextBufferToWrite=new ArrayBuffer(this.privTargetChunkSize),this.privNextBufferStartTime=e.timeReceived);const r=Math.min(e.buffer.byteLength-t,this.privTargetChunkSize-this.privNextBufferReadyBytes),i=new Uint8Array(this.privNextBufferToWrite),n=new Uint8Array(e.buffer.slice(t,r+t));i.set(n,this.privNextBufferReadyBytes),this.privNextBufferReadyBytes+=r,t+=r,this.privNextBufferReadyBytes===this.privTargetChunkSize&&(super.writeStreamChunk({buffer:this.privNextBufferToWrite,isEnd:!1,timeReceived:this.privNextBufferStartTime}),this.privNextBufferReadyBytes=0,this.privNextBufferToWrite=void 0)}}close(){0===this.privNextBufferReadyBytes||this.isClosed||super.writeStreamChunk({buffer:this.privNextBufferToWrite.slice(0,this.privNextBufferReadyBytes),isEnd:!1,timeReceived:this.privNextBufferStartTime}),super.close()}}t.ChunkedArrayBufferStream=n},4038:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SpeechSynthesisAdapter=void 0;const i=r(881),n=r(9190);class o extends n.SynthesisAdapterBase{constructor(e,t,r,i,n){super(e,t,r,n),this.privSpeechSynthesizer=i,this.privSynthesizer=i}setSynthesisContextSynthesisSection(){this.privSynthesisContext.setSynthesisSection(this.privSpeechSynthesizer)}onSynthesisStarted(e){const t=new i.SpeechSynthesisEventArgs(new i.SpeechSynthesisResult(e,i.ResultReason.SynthesizingAudioStarted));this.privSpeechSynthesizer.synthesisStarted&&this.privSpeechSynthesizer.synthesisStarted(this.privSpeechSynthesizer,t)}onSynthesizing(e){if(this.privSpeechSynthesizer.synthesizing)try{const t=this.privSynthesisTurn.audioOutputFormat.addHeader(e),r=new i.SpeechSynthesisEventArgs(new i.SpeechSynthesisResult(this.privSynthesisTurn.requestId,i.ResultReason.SynthesizingAudio,t));this.privSpeechSynthesizer.synthesizing(this.privSpeechSynthesizer,r)}catch(e){}}onSynthesisCancelled(e){if(this.privSpeechSynthesizer.SynthesisCanceled){const t=new i.SpeechSynthesisEventArgs(e);try{this.privSpeechSynthesizer.SynthesisCanceled(this.privSpeechSynthesizer,t)}catch{}}}onSynthesisCompleted(e){if(this.privSpeechSynthesizer.synthesisCompleted)try{this.privSpeechSynthesizer.synthesisCompleted(this.privSpeechSynthesizer,new i.SpeechSynthesisEventArgs(e))}catch(e){}}onWordBoundary(e){if(this.privSpeechSynthesizer.wordBoundary)try{this.privSpeechSynthesizer.wordBoundary(this.privSpeechSynthesizer,e)}catch(e){}}onVisemeReceived(e){if(this.privSpeechSynthesizer.visemeReceived)try{this.privSpeechSynthesizer.visemeReceived(this.privSpeechSynthesizer,e)}catch(e){}}onBookmarkReached(e){if(this.privSpeechSynthesizer.bookmarkReached)try{this.privSpeechSynthesizer.bookmarkReached(this.privSpeechSynthesizer,e)}catch(e){}}}t.SpeechSynthesisAdapter=o},4040:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SynthesisRequest=t.Synthesizer=void 0;const i=r(9190),n=r(868),o=r(5245),s=r(881);class a{constructor(e){const t=e;o.Contracts.throwIfNull(t,"speechConfig"),this.privProperties=t.properties.clone(),this.privDisposed=!1,this.privSynthesizing=!1,this.synthesisRequestQueue=new n.Queue,this.tokenCredential=e.tokenCredential}get authorizationToken(){return this.properties.getProperty(s.PropertyId.SpeechServiceAuthorization_Token)}set authorizationToken(e){o.Contracts.throwIfNullOrWhitespace(e,"token"),this.properties.setProperty(s.PropertyId.SpeechServiceAuthorization_Token,e)}get properties(){return this.privProperties}get autoDetectSourceLanguage(){return this.properties.getProperty(s.PropertyId.SpeechServiceConnection_AutoDetectSourceLanguages)===i.AutoDetectSourceLanguagesOpenRangeOptionName}buildSsml(e){let t=this.properties.getProperty(s.PropertyId.SpeechServiceConnection_SynthLanguage,"en-US"),r=this.properties.getProperty(s.PropertyId.SpeechServiceConnection_SynthVoice,""),i=a.XMLEncode(e);return this.autoDetectSourceLanguage?t="en-US":r=r||{"af-ZA":"af-ZA-AdriNeural","am-ET":"am-ET-AmehaNeural","ar-AE":"ar-AE-FatimaNeural","ar-BH":"ar-BH-AliNeural","ar-DZ":"ar-DZ-AminaNeural","ar-EG":"ar-EG-SalmaNeural","ar-IQ":"ar-IQ-BasselNeural","ar-JO":"ar-JO-SanaNeural","ar-KW":"ar-KW-FahedNeural","ar-LY":"ar-LY-ImanNeural","ar-MA":"ar-MA-JamalNeural","ar-QA":"ar-QA-AmalNeural","ar-SA":"ar-SA-HamedNeural","ar-SY":"ar-SY-AmanyNeural","ar-TN":"ar-TN-HediNeural","ar-YE":"ar-YE-MaryamNeural","bg-BG":"bg-BG-BorislavNeural","bn-BD":"bn-BD-NabanitaNeural","bn-IN":"bn-IN-BashkarNeural","ca-ES":"ca-ES-JoanaNeural","cs-CZ":"cs-CZ-AntoninNeural","cy-GB":"cy-GB-AledNeural","da-DK":"da-DK-ChristelNeural","de-AT":"de-AT-IngridNeural","de-CH":"de-CH-JanNeural","de-DE":"de-DE-KatjaNeural","el-GR":"el-GR-AthinaNeural","en-AU":"en-AU-NatashaNeural","en-CA":"en-CA-ClaraNeural","en-GB":"en-GB-LibbyNeural","en-HK":"en-HK-SamNeural","en-IE":"en-IE-ConnorNeural","en-IN":"en-IN-NeerjaNeural","en-KE":"en-KE-AsiliaNeural","en-NG":"en-NG-AbeoNeural","en-NZ":"en-NZ-MitchellNeural","en-PH":"en-PH-JamesNeural","en-SG":"en-SG-LunaNeural","en-TZ":"en-TZ-ElimuNeural","en-US":"en-US-AvaMultilingualNeural","en-ZA":"en-ZA-LeahNeural","es-AR":"es-AR-ElenaNeural","es-BO":"es-BO-MarceloNeural","es-CL":"es-CL-CatalinaNeural","es-CO":"es-CO-GonzaloNeural","es-CR":"es-CR-JuanNeural","es-CU":"es-CU-BelkysNeural","es-DO":"es-DO-EmilioNeural","es-EC":"es-EC-AndreaNeural","es-ES":"es-ES-AlvaroNeural","es-GQ":"es-GQ-JavierNeural","es-GT":"es-GT-AndresNeural","es-HN":"es-HN-CarlosNeural","es-MX":"es-MX-DaliaNeural","es-NI":"es-NI-FedericoNeural","es-PA":"es-PA-MargaritaNeural","es-PE":"es-PE-AlexNeural","es-PR":"es-PR-KarinaNeural","es-PY":"es-PY-MarioNeural","es-SV":"es-SV-LorenaNeural","es-US":"es-US-AlonsoNeural","es-UY":"es-UY-MateoNeural","es-VE":"es-VE-PaolaNeural","et-EE":"et-EE-AnuNeural","fa-IR":"fa-IR-DilaraNeural","fi-FI":"fi-FI-SelmaNeural","fil-PH":"fil-PH-AngeloNeural","fr-BE":"fr-BE-CharlineNeural","fr-CA":"fr-CA-SylvieNeural","fr-CH":"fr-CH-ArianeNeural","fr-FR":"fr-FR-DeniseNeural","ga-IE":"ga-IE-ColmNeural","gl-ES":"gl-ES-RoiNeural","gu-IN":"gu-IN-DhwaniNeural","he-IL":"he-IL-AvriNeural","hi-IN":"hi-IN-MadhurNeural","hr-HR":"hr-HR-GabrijelaNeural","hu-HU":"hu-HU-NoemiNeural","id-ID":"id-ID-ArdiNeural","is-IS":"is-IS-GudrunNeural","it-IT":"it-IT-IsabellaNeural","ja-JP":"ja-JP-NanamiNeural","jv-ID":"jv-ID-DimasNeural","kk-KZ":"kk-KZ-AigulNeural","km-KH":"km-KH-PisethNeural","kn-IN":"kn-IN-GaganNeural","ko-KR":"ko-KR-SunHiNeural","lo-LA":"lo-LA-ChanthavongNeural","lt-LT":"lt-LT-LeonasNeural","lv-LV":"lv-LV-EveritaNeural","mk-MK":"mk-MK-AleksandarNeural","ml-IN":"ml-IN-MidhunNeural","mr-IN":"mr-IN-AarohiNeural","ms-MY":"ms-MY-OsmanNeural","mt-MT":"mt-MT-GraceNeural","my-MM":"my-MM-NilarNeural","nb-NO":"nb-NO-PernilleNeural","nl-BE":"nl-BE-ArnaudNeural","nl-NL":"nl-NL-ColetteNeural","pl-PL":"pl-PL-AgnieszkaNeural","ps-AF":"ps-AF-GulNawazNeural","pt-BR":"pt-BR-FranciscaNeural","pt-PT":"pt-PT-DuarteNeural","ro-RO":"ro-RO-AlinaNeural","ru-RU":"ru-RU-SvetlanaNeural","si-LK":"si-LK-SameeraNeural","sk-SK":"sk-SK-LukasNeural","sl-SI":"sl-SI-PetraNeural","so-SO":"so-SO-MuuseNeural","sr-RS":"sr-RS-NicholasNeural","su-ID":"su-ID-JajangNeural","sv-SE":"sv-SE-SofieNeural","sw-KE":"sw-KE-RafikiNeural","sw-TZ":"sw-TZ-DaudiNeural","ta-IN":"ta-IN-PallaviNeural","ta-LK":"ta-LK-KumarNeural","ta-SG":"ta-SG-AnbuNeural","te-IN":"te-IN-MohanNeural","th-TH":"th-TH-PremwadeeNeural","tr-TR":"tr-TR-AhmetNeural","uk-UA":"uk-UA-OstapNeural","ur-IN":"ur-IN-GulNeural","ur-PK":"ur-PK-AsadNeural","uz-UZ":"uz-UZ-MadinaNeural","vi-VN":"vi-VN-HoaiMyNeural","zh-CN":"zh-CN-XiaoxiaoNeural","zh-HK":"zh-HK-HiuMaanNeural","zh-TW":"zh-TW-HsiaoChenNeural","zu-ZA":"zu-ZA-ThandoNeural"}[t],r&&(i=`<voice name='${r}'>${i}</voice>`),i=`<speak version='1.0' xmlns='http://www.w3.org/2001/10/synthesis' xmlns:mstts='http://www.w3.org/2001/mstts' xmlns:emo='http://www.w3.org/2009/10/emotionml' xml:lang='${t}'>${i}</speak>`,i}async dispose(e){this.privDisposed||(e&&this.privAdapter&&await this.privAdapter.dispose(),this.privDisposed=!0)}async adapterSpeak(){if(!this.privDisposed&&!this.privSynthesizing){this.privSynthesizing=!0;const e=await this.synthesisRequestQueue.dequeue();return this.privAdapter.Speak(e.text,e.isSSML,e.requestId,e.cb,e.err,e.dataStream)}}createSynthesizerConfig(e){return new i.SynthesizerConfig(e,this.privProperties)}implCommonSynthesizeSetup(){let e="undefined"!=typeof window?"Browser":"Node",t="unknown",r="unknown";"undefined"!=typeof navigator&&(e=e+"/"+navigator.platform,t=navigator.userAgent,r=navigator.appVersion);const n=this.createSynthesizerConfig(new i.SpeechServiceConfig(new i.Context(new i.OS(e,t,r)))),o=this.privProperties.getProperty(s.PropertyId.SpeechServiceConnection_Key,void 0),a=o&&""!==o?new i.CognitiveSubscriptionKeyAuthentication(o):this.tokenCredential?new i.CognitiveTokenAuthentication(async()=>{try{const e=await this.tokenCredential.getToken("https://cognitiveservices.azure.com/.default");return e?.token??""}catch(e){throw e}},async()=>{try{const e=await this.tokenCredential.getToken("https://cognitiveservices.azure.com/.default");return e?.token??""}catch(e){throw e}}):new i.CognitiveTokenAuthentication(()=>{const e=this.privProperties.getProperty(s.PropertyId.SpeechServiceAuthorization_Token,void 0);return Promise.resolve(e)},()=>{const e=this.privProperties.getProperty(s.PropertyId.SpeechServiceAuthorization_Token,void 0);return Promise.resolve(e)});this.privAdapter=this.createSynthesisAdapter(a,this.privConnectionFactory,n),this.privRestAdapter=this.createRestSynthesisAdapter(a,n)}static XMLEncode(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&apos;")}}t.Synthesizer=a,t.SynthesisRequest=class{constructor(e,t,r,i,n,o){this.requestId=e,this.text=t,this.isSSML=r,this.cb=i,this.err=n,this.dataStream=o}}},4081:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SpeechConnectionMessage=void 0;const i=r(868),n=r(7014);class o extends i.ConnectionMessage{constructor(e,t,r,o,s,a,c,u){if(!t)throw new i.ArgumentNullError("path");if(!r)throw new i.ArgumentNullError("requestId");const h={};if(h[n.HeaderNames.Path]=t,h[n.HeaderNames.RequestId]=r,h[n.HeaderNames.RequestTimestamp]=(new Date).toISOString(),o&&(h[n.HeaderNames.ContentType]=o),a&&(h[n.HeaderNames.RequestStreamId]=a),c)for(const e in c)e&&(h[e]=c[e]);u?super(e,s,h,u):super(e,s,h),this.privPath=t,this.privRequestId=r,this.privContentType=o,this.privStreamId=a,this.privAdditionalHeaders=c}get path(){return this.privPath}get requestId(){return this.privRequestId}get contentType(){return this.privContentType}get streamId(){return this.privStreamId}get additionalHeaders(){return this.privAdditionalHeaders}static fromConnectionMessage(e){let t=null,r=null,i=null,s=null;const a={};if(e.headers)for(const o in e.headers)o&&(o.toLowerCase()===n.HeaderNames.Path.toLowerCase()?t=e.headers[o]:o.toLowerCase()===n.HeaderNames.RequestId.toLowerCase()?r=e.headers[o]:o.toLowerCase()===n.HeaderNames.ContentType.toLowerCase()?i=e.headers[o]:o.toLowerCase()===n.HeaderNames.RequestStreamId.toLowerCase()?s=e.headers[o]:a[o]=e.headers[o]);return new o(e.messageType,t,r,i,e.body,s,a,e.id)}}t.SpeechConnectionMessage=o},4102:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SpeechSynthesizer=void 0;const i=r(9190),n=r(868),o=r(7208),s=r(1355),a=r(8640),c=r(5245),u=r(881),h=r(4040);class d extends u.Synthesizer{constructor(e,t){super(e),null!==t&&(this.audioConfig=void 0===t?"undefined"==typeof window?void 0:u.AudioConfig.fromDefaultSpeakerOutput():t),this.privConnectionFactory=new i.SpeechSynthesisConnectionFactory,this.implCommonSynthesizeSetup()}static FromConfig(e,t,r){const i=e;return t.properties.mergeTo(i.properties),new d(e,r)}speakTextAsync(e,t,r,i){this.speakImpl(e,!1,t,r,i)}speakSsmlAsync(e,t,r,i){this.speakImpl(e,!0,t,r,i)}async getVoicesAsync(e=""){return this.getVoices(e)}close(e,t){c.Contracts.throwIfDisposed(this.privDisposed),(0,n.marshalPromiseToCallbacks)(this.dispose(!0),e,t)}get internalData(){return this.privAdapter}createSynthesisAdapter(e,t,r){return new i.SpeechSynthesisAdapter(e,t,r,this,this.audioConfig)}createRestSynthesisAdapter(e,t){return new i.SynthesisRestAdapter(t,e)}implCommonSynthesizeSetup(){super.implCommonSynthesizeSetup(),this.privAdapter.audioOutputFormat=s.AudioOutputFormatImpl.fromSpeechSynthesisOutputFormat(u.SpeechSynthesisOutputFormat[this.properties.getProperty(u.PropertyId.SpeechServiceConnection_SynthOutputFormat,void 0)])}speakImpl(e,t,r,i,s){try{c.Contracts.throwIfDisposed(this.privDisposed);const d=(0,n.createNoDashGuid)();let l;l=s instanceof u.PushAudioOutputStreamCallback?new a.PushAudioOutputStreamImpl(s):s instanceof u.PullAudioOutputStream?s:void 0!==s?new o.AudioFileWriter(s):void 0,this.synthesisRequestQueue.enqueue(new h.SynthesisRequest(d,e,t,e=>{if(this.privSynthesizing=!1,r)try{r(e)}catch(e){i&&i(e)}r=void 0,this.adapterSpeak().catch(()=>{})},e=>{i&&i(e)},l)),this.adapterSpeak().catch(()=>{})}catch(e){if(i)if(e instanceof Error){const t=e;i(t.name+": "+t.message)}else i(e);this.dispose(!0).catch(()=>{})}}async getVoices(e){const t=(0,n.createNoDashGuid)(),r=await this.privRestAdapter.getVoicesList(t);if(r.ok&&Array.isArray(r.json)){let i=r.json;return e&&e.length>0&&(i=i.filter(t=>!!t.Locale&&t.Locale.toLowerCase()===e.toLowerCase())),new u.SynthesisVoicesResult(t,i,void 0)}return new u.SynthesisVoicesResult(t,void 0,`Error: ${r.status}: ${r.statusText}`)}}t.SpeechSynthesizer=d},4128:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SpeakerIdentificationModel=void 0;const i=r(5245),n=r(881);class o{constructor(e){if(this.privVoiceProfiles=[],this.privProfileIds=[],i.Contracts.throwIfNullOrUndefined(e,"VoiceProfiles"),0===e.length)throw new Error("Empty Voice Profiles array");for(const t of e){if(t.profileType!==n.VoiceProfileType.TextIndependentIdentification)throw new Error("Identification model can only be created from Identification profile: "+t.profileId);this.privVoiceProfiles.push(t),this.privProfileIds.push(t.profileId)}}static fromProfiles(e){return new o(e)}get voiceProfileIds(){return this.privProfileIds.join(",")}get profileIds(){return this.privProfileIds}get scenario(){return"TextIndependentIdentification"}}t.SpeakerIdentificationModel=o},4132:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ConnectionMessage=t.MessageType=void 0;const i=r(6209),n=r(4462);var o;!function(e){e[e.Text=0]="Text",e[e.Binary=1]="Binary"}(o=t.MessageType||(t.MessageType={})),t.ConnectionMessage=class{constructor(e,t,r,s){if(this.privBody=null,e===o.Text&&t&&"string"!=typeof t)throw new i.InvalidOperationError("Payload must be a string");if(e===o.Binary&&t&&!(t instanceof ArrayBuffer))throw new i.InvalidOperationError("Payload must be ArrayBuffer");switch(this.privMessageType=e,this.privBody=t,this.privHeaders=r||{},this.privId=s||(0,n.createNoDashGuid)(),this.messageType){case o.Binary:this.privSize=null!==this.binaryBody?this.binaryBody.byteLength:0;break;case o.Text:this.privSize=this.textBody.length}}get messageType(){return this.privMessageType}get headers(){return this.privHeaders}get body(){return this.privBody}get textBody(){if(this.privMessageType===o.Binary)throw new i.InvalidOperationError("Not supported for binary message");return this.privBody}get binaryBody(){if(this.privMessageType===o.Text)throw new i.InvalidOperationError("Not supported for text message");return this.privBody}get id(){return this.privId}}},4146:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WebsocketConnection=void 0;const i=r(868),n=r(1120);t.WebsocketConnection=class{constructor(e,t,r,o,s,a=!1,c){if(this.privIsDisposed=!1,!e)throw new i.ArgumentNullError("uri");if(!o)throw new i.ArgumentNullError("messageFormatter");this.privMessageFormatter=o;let u="",h=0;if(t)for(const r in t)if(r){u+=0===h&&-1===e.indexOf("?")?"?":"&",u+=encodeURIComponent(r);let i=t[r];i&&(i=encodeURIComponent(i),u+=`=${i}`),h++}if(r)for(const t in r)t&&(u+=0===h&&-1===e.indexOf("?")?"?":"&",u+=`${t}=${encodeURIComponent(r[t])}`,h++);this.privUri=e+u,this.privId=c||(0,i.createNoDashGuid)(),this.privConnectionMessageAdapter=new n.WebsocketMessageAdapter(this.privUri,this.id,this.privMessageFormatter,s,r,a)}async dispose(){this.privIsDisposed=!0,this.privConnectionMessageAdapter&&await this.privConnectionMessageAdapter.close()}isDisposed(){return this.privIsDisposed}get id(){return this.privId}get uri(){return this.privUri}state(){return this.privConnectionMessageAdapter.state}open(){return this.privConnectionMessageAdapter.open()}send(e){return this.privConnectionMessageAdapter.send(e)}read(){return this.privConnectionMessageAdapter.read()}get events(){return this.privConnectionMessageAdapter.events}}},4177:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TurnStatusReceivedEventArgs=void 0;const i=r(1548);t.TurnStatusReceivedEventArgs=class{constructor(e){this.privTurnStatus=i.TurnStatusResponsePayload.fromJSON(e)}get interactionId(){return this.privTurnStatus.interactionId}get conversationId(){return this.privTurnStatus.conversationId}get statusCode(){return this.privTurnStatus.statusCode}}},4196:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TranslationHypothesis=void 0;const i=r(5245),n=r(4520);class o{constructor(e,t){this.privTranslationHypothesis=e,this.privTranslationHypothesis.Offset+=t,this.privTranslationHypothesis.Translation.TranslationStatus=this.mapTranslationStatus(this.privTranslationHypothesis.Translation.TranslationStatus)}static fromJSON(e,t){return new o(JSON.parse(e),t)}static fromTranslationResponse(e,t){i.Contracts.throwIfNullOrUndefined(e,"translationHypothesis");const r=e.SpeechHypothesis;return e.SpeechHypothesis=void 0,r.Translation=e,new o(r,t)}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(){return this.privTranslationHypothesis.PrimaryLanguage?.Language}asJson(){const e={...this.privTranslationHypothesis};return void 0!==e.Translation?JSON.stringify({...e,TranslationStatus:n.TranslationStatus[e.Translation.TranslationStatus]}):JSON.stringify(e)}mapTranslationStatus(e){return"string"==typeof e?n.TranslationStatus[e]:"number"==typeof e?e:void 0}}t.TranslationHypothesis=o},4207:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.OCSPCacheUpdateErrorEvent=t.OCSPResponseRetrievedEvent=t.OCSPCacheFetchErrorEvent=t.OCSPVerificationFailedEvent=t.OCSPCacheHitEvent=t.OCSPCacheEntryNeedsRefreshEvent=t.OCSPCacheEntryExpiredEvent=t.OCSPWSUpgradeStartedEvent=t.OCSPStapleReceivedEvent=t.OCSPCacheUpdateCompleteEvent=t.OCSPDiskCacheStoreEvent=t.OCSPMemoryCacheStoreEvent=t.OCSPCacheUpdateNeededEvent=t.OCSPDiskCacheHitEvent=t.OCSPCacheMissEvent=t.OCSPMemoryCacheHitEvent=t.OCSPEvent=void 0;const i=r(2754);class n extends i.PlatformEvent{constructor(e,t,r){super(e,t),this.privSignature=r}}t.OCSPEvent=n,t.OCSPMemoryCacheHitEvent=class extends n{constructor(e){super("OCSPMemoryCacheHitEvent",i.EventType.Debug,e)}},t.OCSPCacheMissEvent=class extends n{constructor(e){super("OCSPCacheMissEvent",i.EventType.Debug,e)}},t.OCSPDiskCacheHitEvent=class extends n{constructor(e){super("OCSPDiskCacheHitEvent",i.EventType.Debug,e)}},t.OCSPCacheUpdateNeededEvent=class extends n{constructor(e){super("OCSPCacheUpdateNeededEvent",i.EventType.Debug,e)}},t.OCSPMemoryCacheStoreEvent=class extends n{constructor(e){super("OCSPMemoryCacheStoreEvent",i.EventType.Debug,e)}},t.OCSPDiskCacheStoreEvent=class extends n{constructor(e){super("OCSPDiskCacheStoreEvent",i.EventType.Debug,e)}},t.OCSPCacheUpdateCompleteEvent=class extends n{constructor(e){super("OCSPCacheUpdateCompleteEvent",i.EventType.Debug,e)}},t.OCSPStapleReceivedEvent=class extends n{constructor(){super("OCSPStapleReceivedEvent",i.EventType.Debug,"")}},t.OCSPWSUpgradeStartedEvent=class extends n{constructor(e){super("OCSPWSUpgradeStartedEvent",i.EventType.Debug,e)}},t.OCSPCacheEntryExpiredEvent=class extends n{constructor(e,t){super("OCSPCacheEntryExpiredEvent",i.EventType.Debug,e),this.privExpireTime=t}},t.OCSPCacheEntryNeedsRefreshEvent=class extends n{constructor(e,t,r){super("OCSPCacheEntryNeedsRefreshEvent",i.EventType.Debug,e),this.privExpireTime=r,this.privStartTime=t}},t.OCSPCacheHitEvent=class extends n{constructor(e,t,r){super("OCSPCacheHitEvent",i.EventType.Debug,e),this.privExpireTime=r,this.privExpireTimeString=new Date(r).toLocaleDateString(),this.privStartTime=t,this.privStartTimeString=new Date(t).toLocaleTimeString()}},t.OCSPVerificationFailedEvent=class extends n{constructor(e,t){super("OCSPVerificationFailedEvent",i.EventType.Debug,e),this.privError=t}},t.OCSPCacheFetchErrorEvent=class extends n{constructor(e,t){super("OCSPCacheFetchErrorEvent",i.EventType.Debug,e),this.privError=t}},t.OCSPResponseRetrievedEvent=class extends n{constructor(e){super("OCSPResponseRetrievedEvent",i.EventType.Debug,e)}},t.OCSPCacheUpdateErrorEvent=class extends n{constructor(e,t){super("OCSPCacheUpdateErrorEvent",i.EventType.Debug,e),this.privError=t}}},4235:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i,n=(i=r(1280))&&i.__esModule?i:{default:i};t.default=function(e){if(!(0,n.default)(e))throw TypeError("Invalid UUID");let t;const r=new Uint8Array(16);return r[0]=(t=parseInt(e.slice(0,8),16))>>>24,r[1]=t>>>16&255,r[2]=t>>>8&255,r[3]=255&t,r[4]=(t=parseInt(e.slice(9,13),16))>>>8,r[5]=255&t,r[6]=(t=parseInt(e.slice(14,18),16))>>>8,r[7]=255&t,r[8]=(t=parseInt(e.slice(19,23),16))>>>8,r[9]=255&t,r[10]=(t=parseInt(e.slice(24,36),16))/1099511627776&255,r[11]=t/4294967296&255,r[12]=t>>>24&255,r[13]=t>>>16&255,r[14]=t>>>8&255,r[15]=255&t,r}},4241:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DialogServiceTurnStateManager=void 0;const i=r(6209),n=r(3476);t.DialogServiceTurnStateManager=class{constructor(){this.privTurnMap=new Map}StartTurn(e){if(this.privTurnMap.has(e))throw new i.InvalidOperationError("Service error: There is already a turn with id:"+e);const t=new n.DialogServiceTurnState(this,e);return this.privTurnMap.set(e,t),this.privTurnMap.get(e)}GetTurn(e){return this.privTurnMap.get(e)}CompleteTurn(e){if(!this.privTurnMap.has(e))throw new i.InvalidOperationError("Service error: Received turn end for an unknown turn id:"+e);const t=this.privTurnMap.get(e);return t.complete(),this.privTurnMap.delete(e),t}}},4272:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ConversationReceivedTranslationEventArgs=t.ParticipantsListEventArgs=t.ParticipantAttributeEventArgs=t.ParticipantEventArgs=t.LockRoomEventArgs=t.MuteAllEventArgs=void 0;const i=r(881);class n extends i.SessionEventArgs{constructor(e,t){super(t),this.privIsMuted=e}get isMuted(){return this.privIsMuted}}t.MuteAllEventArgs=n;class o extends i.SessionEventArgs{constructor(e,t){super(t),this.privIsLocked=e}get isMuted(){return this.privIsLocked}}t.LockRoomEventArgs=o;class s extends i.SessionEventArgs{constructor(e,t){super(t),this.privParticipant=e}get participant(){return this.privParticipant}}t.ParticipantEventArgs=s;class a extends i.SessionEventArgs{constructor(e,t,r,i){super(i),this.privKey=t,this.privValue=r,this.privParticipantId=e}get value(){return this.privValue}get key(){return this.privKey}get id(){return this.privParticipantId}}t.ParticipantAttributeEventArgs=a;class c extends i.SessionEventArgs{constructor(e,t,r,i,n,o,s,a,c){super(c),this.privRoomId=e,this.privSessionToken=t,this.privTranslateTo=r,this.privProfanityFilter=i,this.privRoomProfanityFilter=n,this.privIsRoomLocked=o,this.privIsRoomLocked=s,this.privParticipants=a}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}}t.ParticipantsListEventArgs=c,t.ConversationReceivedTranslationEventArgs=class{constructor(e,t,r){this.privPayload=t,this.privCommand=e,this.privSessionId=r}get payload(){return this.privPayload}get command(){return this.privCommand}get sessionId(){return this.privSessionId}}},4293:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MeetingTranscriber=void 0;const i=r(9190),n=r(868),o=r(5245),s=r(881),a=r(2966);t.MeetingTranscriber=class{constructor(e){this.privAudioConfig=e,this.privProperties=new s.PropertyCollection,this.privRecognizer=void 0,this.privDisposedRecognizer=!1}get speechRecognitionLanguage(){return o.Contracts.throwIfDisposed(this.privDisposedRecognizer),this.properties.getProperty(s.PropertyId.SpeechServiceConnection_RecoLanguage)}get properties(){return this.privProperties}get internalData(){return this.privRecognizer.internalData}get connection(){return s.Connection.fromRecognizer(this.privRecognizer)}get authorizationToken(){return this.properties.getProperty(s.PropertyId.SpeechServiceAuthorization_Token)}set authorizationToken(e){o.Contracts.throwIfNullOrWhitespace(e,"token"),this.properties.setProperty(s.PropertyId.SpeechServiceAuthorization_Token,e)}joinMeetingAsync(e,t,r){const s=e;o.Contracts.throwIfNullOrUndefined(a.MeetingImpl,"Meeting"),this.privRecognizer=new i.TranscriberRecognizer(e.config,this.privAudioConfig),o.Contracts.throwIfNullOrUndefined(this.privRecognizer,"Recognizer"),this.privRecognizer.connectMeetingCallbacks(this),(0,n.marshalPromiseToCallbacks)(s.connectTranscriberRecognizer(this.privRecognizer),t,r)}startTranscribingAsync(e,t){this.privRecognizer.startContinuousRecognitionAsync(e,t)}stopTranscribingAsync(e,t){this.privRecognizer.stopContinuousRecognitionAsync(e,t)}leaveMeetingAsync(e,t){this.privRecognizer.disconnectCallbacks(),(0,n.marshalPromiseToCallbacks)((async()=>{})(),e,t)}close(e,t){o.Contracts.throwIfDisposed(this.privDisposedRecognizer),(0,n.marshalPromiseToCallbacks)(this.dispose(!0),e,t)}async dispose(e){this.privDisposedRecognizer||(this.privRecognizer&&(await this.privRecognizer.close(),this.privRecognizer=void 0),e&&(this.privDisposedRecognizer=!0))}}},4326:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AddedLmIntent=void 0,t.AddedLmIntent=class{constructor(e,t){this.modelImpl=e,this.intentName=t}}},4361:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SpeakerRecognizer=void 0;const i=r(9190),n=r(5245),o=r(881);class s extends o.Recognizer{constructor(e,t){n.Contracts.throwIfNullOrUndefined(e,"speechConfig");const r=e;n.Contracts.throwIfNullOrUndefined(r,"speechConfig"),super(t,r.properties,new i.SpeakerRecognitionConnectionFactory),this.privAudioConfigImpl=t,n.Contracts.throwIfNull(this.privAudioConfigImpl,"audioConfig"),this.privDisposedSpeakerRecognizer=!1,this.privProperties=r.properties}get authorizationToken(){return this.properties.getProperty(o.PropertyId.SpeechServiceAuthorization_Token)}set authorizationToken(e){n.Contracts.throwIfNullOrWhitespace(e,"token"),this.properties.setProperty(o.PropertyId.SpeechServiceAuthorization_Token,e)}get properties(){return this.privProperties}async recognizeOnceAsync(e){return n.Contracts.throwIfDisposed(this.privDisposedSpeakerRecognizer),this.recognizeSpeakerOnceAsyncImpl(e)}async close(){n.Contracts.throwIfDisposed(this.privDisposedSpeakerRecognizer),await this.dispose(!0)}async recognizeSpeakerOnceAsyncImpl(e){n.Contracts.throwIfDisposed(this.privDisposedSpeakerRecognizer),await this.implRecognizerStop();const t=await this.privReco.recognizeSpeaker(e);return await this.implRecognizerStop(),t}async implRecognizerStop(){this.privReco&&await this.privReco.stopRecognizing()}createRecognizerConfig(e){return new i.RecognizerConfig(e,this.privProperties)}createServiceRecognizer(e,t,r,n){const o=r;return new i.SpeakerServiceRecognizer(e,t,o,n,this)}async dispose(e){this.privDisposedSpeakerRecognizer||e&&(this.privDisposedSpeakerRecognizer=!0,await super.dispose(e))}}t.SpeakerRecognizer=s},4378:function(e,t,r){"use strict";var i=this&&this.__createBinding||(Object.create?function(e,t,r,i){void 0===i&&(i=r),Object.defineProperty(e,i,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,i){void 0===i&&(i=r),e[i]=t[r]}),n=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||i(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),n(r(403),t),n(r(5956),t),n(r(9475),t),n(r(7968),t),n(r(8343),t),n(r(4146),t),n(r(1120),t),n(r(6106),t),n(r(8361),t),n(r(7689),t),n(r(3768),t)},4405:(e,t)=>{"use strict";Symbol.for("react.transitional.element"),Symbol.for("react.portal");var r=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),n=Symbol.for("react.profiler");Symbol.for("react.provider");var o=Symbol.for("react.consumer"),s=Symbol.for("react.context"),a=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),u=Symbol.for("react.suspense_list"),h=Symbol.for("react.memo"),d=Symbol.for("react.lazy"),l=(Symbol.for("react.view_transition"),Symbol.for("react.client.reference"));t.Hy=function(e){return"string"==typeof e||"function"==typeof e||e===r||e===n||e===i||e===c||e===u||"object"==typeof e&&null!==e&&(e.$$typeof===d||e.$$typeof===h||e.$$typeof===s||e.$$typeof===o||e.$$typeof===a||e.$$typeof===l||void 0!==e.getModuleId)}},4408:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MeetingImpl=t.Meeting=void 0;const i=r(9190),n=r(868),o=r(5245),s=r(881);class a{constructor(){}static createMeetingAsync(e,t,r,a){if(o.Contracts.throwIfNullOrUndefined(e,i.ConversationConnectionConfig.restErrors.invalidArgs.replace("{arg}","config")),o.Contracts.throwIfNullOrUndefined(e.region,i.ConversationConnectionConfig.restErrors.invalidArgs.replace("{arg}","SpeechServiceConnection_Region")),o.Contracts.throwIfNull(t,"meetingId"),0===t.length)throw new Error("meetingId cannot be empty");e.subscriptionKey||e.getProperty(s.PropertyId[s.PropertyId.SpeechServiceAuthorization_Token])||o.Contracts.throwIfNullOrUndefined(e.subscriptionKey,i.ConversationConnectionConfig.restErrors.invalidArgs.replace("{arg}","SpeechServiceConnection_Key"));const u=new c(e,t);return(0,n.marshalPromiseToCallbacks)((async()=>{})(),r,a),u}}t.Meeting=a;class c extends a{constructor(e,t){super(),this.privErrors=i.ConversationConnectionConfig.restErrors,this.onConnected=e=>{this.privIsConnected=!0;try{this.privConversationTranslator?.sessionStarted&&this.privConversationTranslator.sessionStarted(this.privConversationTranslator,e)}catch(e){}},this.onDisconnected=e=>{try{this.privConversationTranslator?.sessionStopped&&this.privConversationTranslator.sessionStopped(this.privConversationTranslator,e)}catch(e){}finally{this.close(!1)}},this.onCanceled=(e,t)=>{try{this.privConversationTranslator?.canceled&&this.privConversationTranslator.canceled(this.privConversationTranslator,t)}catch(t){}},this.onParticipantUpdateCommandReceived=(e,t)=>{try{const e=this.privParticipants.getParticipant(t.id);if(void 0!==e){switch(t.key){case i.ConversationTranslatorCommandTypes.changeNickname:e.displayName=t.value;break;case i.ConversationTranslatorCommandTypes.setUseTTS:e.isUsingTts=t.value;break;case i.ConversationTranslatorCommandTypes.setProfanityFiltering:e.profanity=t.value;break;case i.ConversationTranslatorCommandTypes.setMute:e.isMuted=t.value;break;case i.ConversationTranslatorCommandTypes.setTranslateToLanguages:e.translateToLanguages=t.value}this.privParticipants.addOrUpdateParticipant(e),this.privConversationTranslator&&this.privConversationTranslator.participantsChanged(this.privConversationTranslator,new s.ConversationParticipantsChangedEventArgs(s.ParticipantChangedReason.Updated,[this.toParticipant(e)],t.sessionId))}}catch(t){}},this.onLockRoomCommandReceived=()=>{},this.onMuteAllCommandReceived=(e,t)=>{try{this.privParticipants.participants.forEach(e=>e.isMuted=!e.isHost&&t.isMuted),this.privConversationTranslator&&this.privConversationTranslator.participantsChanged(this.privConversationTranslator,new s.ConversationParticipantsChangedEventArgs(s.ParticipantChangedReason.Updated,this.toParticipants(!1),t.sessionId))}catch(t){}},this.onParticipantJoinCommandReceived=(e,t)=>{try{const e=this.privParticipants.addOrUpdateParticipant(t.participant);void 0!==e&&this.privConversationTranslator&&this.privConversationTranslator.participantsChanged(this.privConversationTranslator,new s.ConversationParticipantsChangedEventArgs(s.ParticipantChangedReason.JoinedConversation,[this.toParticipant(e)],t.sessionId))}catch(t){}},this.onParticipantLeaveCommandReceived=(e,t)=>{try{const e=this.privParticipants.getParticipant(t.participant.id);void 0!==e&&(this.privParticipants.deleteParticipant(t.participant.id),this.privConversationTranslator&&this.privConversationTranslator.participantsChanged(this.privConversationTranslator,new s.ConversationParticipantsChangedEventArgs(s.ParticipantChangedReason.LeftConversation,[this.toParticipant(e)],t.sessionId)))}catch(t){}},this.onTranslationReceived=(e,t)=>{try{switch(t.command){case i.ConversationTranslatorMessageTypes.final:this.privConversationTranslator&&this.privConversationTranslator.transcribed(this.privConversationTranslator,new s.ConversationTranslationEventArgs(t.payload,void 0,t.sessionId));break;case i.ConversationTranslatorMessageTypes.partial:this.privConversationTranslator&&this.privConversationTranslator.transcribing(this.privConversationTranslator,new s.ConversationTranslationEventArgs(t.payload,void 0,t.sessionId));break;case i.ConversationTranslatorMessageTypes.instantMessage:this.privConversationTranslator&&this.privConversationTranslator.textMessageReceived(this.privConversationTranslator,new s.ConversationTranslationEventArgs(t.payload,void 0,t.sessionId))}}catch(t){}},this.onParticipantsListReceived=(e,t)=>{try{if(void 0!==t.sessionToken&&null!==t.sessionToken&&(this.privRoom.token=t.sessionToken),this.privParticipants.participants=[...t.participants],void 0!==this.privParticipants.me&&(this.privIsReady=!0),this.privConversationTranslator&&this.privConversationTranslator.participantsChanged(this.privConversationTranslator,new s.ConversationParticipantsChangedEventArgs(s.ParticipantChangedReason.JoinedConversation,this.toParticipants(!0),t.sessionId)),this.me.isHost){const e=this.privConversationTranslator?.properties.getProperty(s.PropertyId.ConversationTranslator_Name);void 0!==e&&e.length>0&&e!==this.me.displayName&&this.changeNicknameAsync(e)}}catch(t){}},this.onConversationExpiration=(e,t)=>{try{this.privConversationTranslator&&this.privConversationTranslator.conversationExpiration(this.privConversationTranslator,t)}catch(t){}},this.privIsConnected=!1,this.privIsDisposed=!1,this.privConversationId="",this.privProperties=new s.PropertyCollection,this.privManager=new i.ConversationManager,e.getProperty(s.PropertyId[s.PropertyId.SpeechServiceConnection_RecoLanguage])||e.setProperty(s.PropertyId[s.PropertyId.SpeechServiceConnection_RecoLanguage],i.ConversationConnectionConfig.defaultLanguageCode),this.privLanguage=e.getProperty(s.PropertyId[s.PropertyId.SpeechServiceConnection_RecoLanguage]),this.privConversationId=t,this.privConfig=e;const r=e;o.Contracts.throwIfNull(r,"speechConfig"),this.privProperties=r.properties.clone(),this.privIsConnected=!1,this.privParticipants=new i.InternalParticipants,this.privIsReady=!1,this.privTextMessageMaxLength=1e3}get room(){return this.privRoom}get connection(){return this.privConversationRecognizer}get config(){return this.privConfig}get meetingId(){return this.privRoom?this.privRoom.roomId:this.privConversationId}get properties(){return this.privProperties}get speechRecognitionLanguage(){return this.privLanguage}get isMutedByHost(){return!this.privParticipants.me?.isHost&&this.privParticipants.me?.isMuted}get isConnected(){return this.privIsConnected&&this.privIsReady}get participants(){return this.toParticipants(!0)}get me(){return this.toParticipant(this.privParticipants.me)}get host(){return this.toParticipant(this.privParticipants.host)}get transcriberRecognizer(){return this.privTranscriberRecognizer}get meetingInfo(){const e=this.meetingId,t=this.participants.map(e=>({id:e.id,preferredLanguage:e.preferredLanguage,voice:e.voice})),r={};for(const e of i.ConversationConnectionConfig.transcriptionEventKeys){const t=this.properties.getProperty(e,"");""!==t&&(r[e]=t)}return{id:e,participants:t,meetingProperties:r}}get canSend(){return this.privIsConnected&&!this.privParticipants.me?.isMuted}get canSendAsHost(){return this.privIsConnected&&this.privParticipants.me?.isHost}get authorizationToken(){return this.privToken}set authorizationToken(e){o.Contracts.throwIfNullOrWhitespace(e,"authorizationToken"),this.privToken=e}createMeetingAsync(e,t){try{this.privConversationRecognizer&&this.handleError(new Error(this.privErrors.permissionDeniedStart),t),this.privManager.createOrJoin(this.privProperties,void 0,r=>{r||this.handleError(new Error(this.privErrors.permissionDeniedConnect),t),this.privRoom=r,this.handleCallback(e,t)},e=>{this.handleError(e,t)})}catch(e){this.handleError(e,t)}}startMeetingAsync(e,t){try{this.privConversationRecognizer&&this.handleError(new Error(this.privErrors.permissionDeniedStart),t),o.Contracts.throwIfNullOrUndefined(this.privRoom,this.privErrors.permissionDeniedConnect),this.privParticipants.meId=this.privRoom.participantId,this.privConversationRecognizer.connected=this.onConnected,this.privConversationRecognizer.disconnected=this.onDisconnected,this.privConversationRecognizer.canceled=this.onCanceled,this.privConversationRecognizer.participantUpdateCommandReceived=this.onParticipantUpdateCommandReceived,this.privConversationRecognizer.lockRoomCommandReceived=this.onLockRoomCommandReceived,this.privConversationRecognizer.muteAllCommandReceived=this.onMuteAllCommandReceived,this.privConversationRecognizer.participantJoinCommandReceived=this.onParticipantJoinCommandReceived,this.privConversationRecognizer.participantLeaveCommandReceived=this.onParticipantLeaveCommandReceived,this.privConversationRecognizer.translationReceived=this.onTranslationReceived,this.privConversationRecognizer.participantsListReceived=this.onParticipantsListReceived,this.privConversationRecognizer.conversationExpiration=this.onConversationExpiration,this.privConversationRecognizer.connect(this.privRoom.token,()=>{this.handleCallback(e,t)},e=>{this.handleError(e,t)})}catch(e){this.handleError(e,t)}}addParticipantAsync(e,t,r){o.Contracts.throwIfNullOrUndefined(e,"Participant"),(0,n.marshalPromiseToCallbacks)(this.addParticipantImplAsync(e),t,r)}joinMeetingAsync(e,t,r,i,n){try{o.Contracts.throwIfNullOrWhitespace(e,this.privErrors.invalidArgs.replace("{arg}","conversationId")),o.Contracts.throwIfNullOrWhitespace(t,this.privErrors.invalidArgs.replace("{arg}","nickname")),o.Contracts.throwIfNullOrWhitespace(r,this.privErrors.invalidArgs.replace("{arg}","language")),this.privManager.createOrJoin(this.privProperties,e,e=>{o.Contracts.throwIfNullOrUndefined(e,this.privErrors.permissionDeniedConnect),this.privRoom=e,this.privConfig.authorizationToken=e.cognitiveSpeechAuthToken,i&&i(e.cognitiveSpeechAuthToken)},e=>{this.handleError(e,n)})}catch(e){this.handleError(e,n)}}deleteMeetingAsync(e,t){(0,n.marshalPromiseToCallbacks)(this.deleteMeetingImplAsync(),e,t)}async deleteMeetingImplAsync(){o.Contracts.throwIfNullOrUndefined(this.privProperties,this.privErrors.permissionDeniedConnect),o.Contracts.throwIfNullOrWhitespace(this.privRoom.token,this.privErrors.permissionDeniedConnect),await this.privManager.leave(this.privProperties,this.privRoom.token),this.dispose()}endMeetingAsync(e,t){(0,n.marshalPromiseToCallbacks)(this.endMeetingImplAsync(),e,t)}endMeetingImplAsync(){return this.close(!0)}lockMeetingAsync(e,t){try{o.Contracts.throwIfDisposed(this.privIsDisposed),o.Contracts.throwIfDisposed(this.privConversationRecognizer.isDisposed()),o.Contracts.throwIfNullOrUndefined(this.privRoom,this.privErrors.permissionDeniedSend),this.canSendAsHost||this.handleError(new Error(this.privErrors.permissionDeniedConversation.replace("{command}","lock")),t),this.privConversationRecognizer&&this.privConversationRecognizer.sendRequest(this.getLockCommand(!0),()=>{this.handleCallback(e,t)},e=>{this.handleError(e,t)})}catch(e){this.handleError(e,t)}}muteAllParticipantsAsync(e,t){try{o.Contracts.throwIfDisposed(this.privIsDisposed),o.Contracts.throwIfDisposed(this.privConversationRecognizer.isDisposed()),o.Contracts.throwIfNullOrUndefined(this.privConversationRecognizer,this.privErrors.permissionDeniedSend),o.Contracts.throwIfNullOrUndefined(this.privRoom,this.privErrors.permissionDeniedSend),this.canSendAsHost||this.handleError(new Error(this.privErrors.permissionDeniedConversation.replace("{command}","mute")),t),this.privConversationRecognizer&&this.privConversationRecognizer.sendRequest(this.getMuteAllCommand(!0),()=>{this.handleCallback(e,t)},e=>{this.handleError(e,t)})}catch(e){this.handleError(e,t)}}muteParticipantAsync(e,t,r){try{o.Contracts.throwIfDisposed(this.privIsDisposed),o.Contracts.throwIfDisposed(this.privConversationRecognizer.isDisposed()),o.Contracts.throwIfNullOrWhitespace(e,this.privErrors.invalidArgs.replace("{arg}","userId")),o.Contracts.throwIfNullOrUndefined(this.privRoom,this.privErrors.permissionDeniedSend),this.canSend||this.handleError(new Error(this.privErrors.permissionDeniedSend),r),this.me.isHost||this.me.id===e||this.handleError(new Error(this.privErrors.permissionDeniedParticipant.replace("{command}","mute")),r),-1===this.privParticipants.getParticipantIndex(e)&&this.handleError(new Error(this.privErrors.invalidParticipantRequest),r),this.privConversationRecognizer&&this.privConversationRecognizer.sendRequest(this.getMuteCommand(e,!0),()=>{this.handleCallback(t,r)},e=>{this.handleError(e,r)})}catch(e){this.handleError(e,r)}}removeParticipantAsync(e,t,r){try{if(o.Contracts.throwIfDisposed(this.privIsDisposed),this.privTranscriberRecognizer&&e.hasOwnProperty("id"))(0,n.marshalPromiseToCallbacks)(this.removeParticipantImplAsync(e),t,r);else{o.Contracts.throwIfDisposed(this.privConversationRecognizer.isDisposed()),o.Contracts.throwIfNullOrUndefined(this.privRoom,this.privErrors.permissionDeniedSend),this.canSendAsHost||this.handleError(new Error(this.privErrors.permissionDeniedParticipant.replace("{command}","remove")),r);let i="";"string"==typeof e?i=e:e.hasOwnProperty("id")?i=e.id:e.hasOwnProperty("userId")&&(i=e.userId),o.Contracts.throwIfNullOrWhitespace(i,this.privErrors.invalidArgs.replace("{arg}","userId")),-1===this.participants.findIndex(e=>e.id===i)&&this.handleError(new Error(this.privErrors.invalidParticipantRequest),r),this.privConversationRecognizer&&this.privConversationRecognizer.sendRequest(this.getEjectCommand(i),()=>{this.handleCallback(t,r)},e=>{this.handleError(e,r)})}}catch(e){this.handleError(e,r)}}unlockMeetingAsync(e,t){try{o.Contracts.throwIfDisposed(this.privIsDisposed),o.Contracts.throwIfDisposed(this.privConversationRecognizer.isDisposed()),o.Contracts.throwIfNullOrUndefined(this.privRoom,this.privErrors.permissionDeniedSend),this.canSendAsHost||this.handleError(new Error(this.privErrors.permissionDeniedConversation.replace("{command}","unlock")),t),this.privConversationRecognizer&&this.privConversationRecognizer.sendRequest(this.getLockCommand(!1),()=>{this.handleCallback(e,t)},e=>{this.handleError(e,t)})}catch(e){this.handleError(e,t)}}unmuteAllParticipantsAsync(e,t){try{o.Contracts.throwIfDisposed(this.privIsDisposed),o.Contracts.throwIfDisposed(this.privConversationRecognizer.isDisposed()),o.Contracts.throwIfNullOrUndefined(this.privRoom,this.privErrors.permissionDeniedSend),this.canSendAsHost||this.handleError(new Error(this.privErrors.permissionDeniedConversation.replace("{command}","unmute all")),t),this.privConversationRecognizer&&this.privConversationRecognizer.sendRequest(this.getMuteAllCommand(!1),()=>{this.handleCallback(e,t)},e=>{this.handleError(e,t)})}catch(e){this.handleError(e,t)}}unmuteParticipantAsync(e,t,r){try{o.Contracts.throwIfDisposed(this.privIsDisposed),o.Contracts.throwIfDisposed(this.privConversationRecognizer.isDisposed()),o.Contracts.throwIfNullOrWhitespace(e,this.privErrors.invalidArgs.replace("{arg}","userId")),o.Contracts.throwIfNullOrUndefined(this.privRoom,this.privErrors.permissionDeniedSend),this.canSend||this.handleError(new Error(this.privErrors.permissionDeniedSend),r),this.me.isHost||this.me.id===e||this.handleError(new Error(this.privErrors.permissionDeniedParticipant.replace("{command}","mute")),r),-1===this.privParticipants.getParticipantIndex(e)&&this.handleError(new Error(this.privErrors.invalidParticipantRequest),r),this.privConversationRecognizer&&this.privConversationRecognizer.sendRequest(this.getMuteCommand(e,!1),()=>{this.handleCallback(t,r)},e=>{this.handleError(e,r)})}catch(e){this.handleError(e,r)}}sendTextMessageAsync(e,t,r){try{o.Contracts.throwIfDisposed(this.privIsDisposed),o.Contracts.throwIfDisposed(this.privConversationRecognizer.isDisposed()),o.Contracts.throwIfNullOrWhitespace(e,this.privErrors.invalidArgs.replace("{arg}","message")),o.Contracts.throwIfNullOrUndefined(this.privRoom,this.privErrors.permissionDeniedSend),this.canSend||this.handleError(new Error(this.privErrors.permissionDeniedSend),r),e.length>this.privTextMessageMaxLength&&this.handleError(new Error(this.privErrors.invalidArgs.replace("{arg}","message length")),r),this.privConversationRecognizer&&this.privConversationRecognizer.sendRequest(this.getMessageCommand(e),()=>{this.handleCallback(t,r)},e=>{this.handleError(e,r)})}catch(e){this.handleError(e,r)}}setTranslatedLanguagesAsync(e,t,r){try{o.Contracts.throwIfDisposed(this.privIsDisposed),o.Contracts.throwIfDisposed(this.privConversationRecognizer.isDisposed()),o.Contracts.throwIfArrayEmptyOrWhitespace(e,this.privErrors.invalidArgs.replace("{arg}","languages")),o.Contracts.throwIfNullOrUndefined(this.privRoom,this.privErrors.permissionDeniedSend),this.canSend||this.handleError(new Error(this.privErrors.permissionDeniedSend),r),this.privConversationRecognizer&&this.privConversationRecognizer.sendRequest(this.getSetTranslateToLanguagesCommand(e),()=>{this.handleCallback(t,r)},e=>{this.handleError(e,r)})}catch(e){this.handleError(e,r)}}changeNicknameAsync(e,t,r){try{o.Contracts.throwIfDisposed(this.privIsDisposed),o.Contracts.throwIfDisposed(this.privConversationRecognizer.isDisposed()),o.Contracts.throwIfNullOrWhitespace(e,this.privErrors.invalidArgs.replace("{arg}","nickname")),o.Contracts.throwIfNullOrUndefined(this.privRoom,this.privErrors.permissionDeniedSend),this.canSend||this.handleError(new Error(this.privErrors.permissionDeniedSend),r),this.privConversationRecognizer&&this.privConversationRecognizer.sendRequest(this.getChangeNicknameCommand(e),()=>{this.handleCallback(t,r)},e=>{this.handleError(e,r)})}catch(e){this.handleError(e,r)}}isDisposed(){return this.privIsDisposed}dispose(){this.isDisposed||(this.privIsDisposed=!0,this.config&&this.config.close(),this.privConfig=void 0,this.privLanguage=void 0,this.privProperties=void 0,this.privRoom=void 0,this.privToken=void 0,this.privManager=void 0,this.privIsConnected=!1,this.privIsReady=!1,this.privParticipants=void 0)}async connectTranscriberRecognizer(e){this.privTranscriberRecognizer&&await this.privTranscriberRecognizer.close(),await e.enforceAudioGating(),this.privTranscriberRecognizer=e,this.privTranscriberRecognizer.meeting=this}getKeepAlive(){const e=this.me?this.me.displayName:"default_nickname";return JSON.stringify({id:"0",nickname:e,participantId:this.privRoom.participantId,roomId:this.privRoom.roomId,type:i.ConversationTranslatorMessageTypes.keepAlive})}addParticipantImplAsync(e){if(void 0!==this.privParticipants.addOrUpdateParticipant(e)&&this.privTranscriberRecognizer){const t=this.meetingInfo;return t.participants=[e],this.privTranscriberRecognizer.pushMeetingEvent(t,"join")}}removeParticipantImplAsync(e){this.privParticipants.deleteParticipant(e.id);const t=this.meetingInfo;return t.participants=[e],this.privTranscriberRecognizer.pushMeetingEvent(t,"leave")}async close(e){try{this.privIsConnected=!1,await(this.privConversationRecognizer?.close()),this.privConversationRecognizer=void 0,this.privConversationTranslator&&this.privConversationTranslator.dispose()}catch(e){throw e}e&&this.dispose()}handleCallback(e,t){if(e){try{e()}catch(e){t&&t(e)}e=void 0}}handleError(e,t){if(t)if(e instanceof Error){const r=e;t(r.name+": "+r.message)}else t(e)}toParticipants(e){const t=this.privParticipants.participants.map(e=>this.toParticipant(e));return e?t:t.filter(e=>!1===e.isHost)}toParticipant(e){return new s.Participant(e.id,e.avatar,e.displayName,e.isHost,e.isMuted,e.isUsingTts,e.preferredLanguage,e.voice)}getMuteAllCommand(e){return o.Contracts.throwIfNullOrWhitespace(this.privRoom.roomId,"meetingd"),o.Contracts.throwIfNullOrWhitespace(this.privRoom.participantId,"participantId"),JSON.stringify({command:i.ConversationTranslatorCommandTypes.setMuteAll,participantId:this.privRoom.participantId,roomid:this.privRoom.roomId,type:i.ConversationTranslatorMessageTypes.participantCommand,value:e})}getMuteCommand(e,t){return o.Contracts.throwIfNullOrWhitespace(this.privRoom.roomId,"conversationId"),o.Contracts.throwIfNullOrWhitespace(e,"participantId"),JSON.stringify({command:i.ConversationTranslatorCommandTypes.setMute,participantId:e,roomid:this.privRoom.roomId,type:i.ConversationTranslatorMessageTypes.participantCommand,value:t})}getLockCommand(e){return o.Contracts.throwIfNullOrWhitespace(this.privRoom.roomId,"meetingId"),o.Contracts.throwIfNullOrWhitespace(this.privRoom.participantId,"participantId"),JSON.stringify({command:i.ConversationTranslatorCommandTypes.setLockState,participantId:this.privRoom.participantId,roomid:this.privRoom.roomId,type:i.ConversationTranslatorMessageTypes.participantCommand,value:e})}getEjectCommand(e){return o.Contracts.throwIfNullOrWhitespace(this.privRoom.roomId,"meetingId"),o.Contracts.throwIfNullOrWhitespace(e,"participantId"),JSON.stringify({command:i.ConversationTranslatorCommandTypes.ejectParticipant,participantId:e,roomid:this.privRoom.roomId,type:i.ConversationTranslatorMessageTypes.participantCommand})}getSetTranslateToLanguagesCommand(e){return o.Contracts.throwIfNullOrWhitespace(this.privRoom.roomId,"meetingId"),o.Contracts.throwIfNullOrWhitespace(this.privRoom.participantId,"participantId"),JSON.stringify({command:i.ConversationTranslatorCommandTypes.setTranslateToLanguages,participantId:this.privRoom.participantId,roomid:this.privRoom.roomId,type:i.ConversationTranslatorMessageTypes.participantCommand,value:e})}getChangeNicknameCommand(e){return o.Contracts.throwIfNullOrWhitespace(this.privRoom.roomId,"meetingId"),o.Contracts.throwIfNullOrWhitespace(e,"nickname"),o.Contracts.throwIfNullOrWhitespace(this.privRoom.participantId,"participantId"),JSON.stringify({command:i.ConversationTranslatorCommandTypes.changeNickname,nickname:e,participantId:this.privRoom.participantId,roomid:this.privRoom.roomId,type:i.ConversationTranslatorMessageTypes.participantCommand,value:e})}getMessageCommand(e){return o.Contracts.throwIfNullOrWhitespace(this.privRoom.roomId,"meetingId"),o.Contracts.throwIfNullOrWhitespace(this.privRoom.participantId,"participantId"),o.Contracts.throwIfNullOrWhitespace(e,"message"),JSON.stringify({participantId:this.privRoom.participantId,roomId:this.privRoom.roomId,text:e,type:i.ConversationTranslatorMessageTypes.instantMessage})}}t.MeetingImpl=c},4415:(e,t)=>{"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.VoiceProfileType=void 0,(r=t.VoiceProfileType||(t.VoiceProfileType={}))[r.TextIndependentIdentification=0]="TextIndependentIdentification",r[r.TextDependentVerification=1]="TextDependentVerification",r[r.TextIndependentVerification=2]="TextIndependentVerification"},4458:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.VoiceProfileCancellationDetails=t.VoiceProfileResult=void 0;const i=r(9190),n=r(5245),o=r(881);t.VoiceProfileResult=class{constructor(e,t){this.privReason=e,this.privProperties=new o.PropertyCollection,e===o.ResultReason.Canceled&&(n.Contracts.throwIfNullOrUndefined(t,"statusText"),this.privErrorDetails=t,this.privProperties.setProperty(i.CancellationErrorCodePropertyName,o.CancellationErrorCode[o.CancellationErrorCode.ServiceError]))}get reason(){return this.privReason}get properties(){return this.privProperties}get errorDetails(){return this.privErrorDetails}};class s extends o.CancellationDetailsBase{constructor(e,t,r){super(e,t,r)}static fromResult(e){const t=o.CancellationReason.Error;let r=o.CancellationErrorCode.NoError;return e.properties&&(r=o.CancellationErrorCode[e.properties.getProperty(i.CancellationErrorCodePropertyName,o.CancellationErrorCode[o.CancellationErrorCode.NoError])]),new s(t,e.errorDetails,r)}}t.VoiceProfileCancellationDetails=s},4462:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createNoDashGuid=t.createGuid=void 0;const i=r(504),n=()=>(0,i.v4)();t.createGuid=n,t.createNoDashGuid=()=>n().replace(new RegExp("-","g"),"").toUpperCase()},4479:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PushAudioOutputStreamCallback=void 0,t.PushAudioOutputStreamCallback=class{}},4480:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SynthesisTurn=void 0;const i=r(868),n=r(8640),o=r(881),s=r(8032),a=r(5518);class c{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,i.createNoDashGuid)(),this.privTurnDeferral=new i.Deferred,this.privTurnDeferral.resolve()}get requestId(){return this.privRequestId}get streamId(){return this.privStreamId}set streamId(e){this.privStreamId=e}get audioOutputFormat(){return this.privAudioOutputFormat}set audioOutputFormat(e){this.privAudioOutputFormat=e}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 e=new o.PropertyCollection;return e.setProperty(o.PropertyId.TalkingAvatarService_WebRTC_SDP,this.privWebRTCSDP),e}}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 e=await this.getAllReceivedAudio();return this.privReceivedAudioWithHeader=this.audioOutputFormat.addHeader(e),this.privReceivedAudioWithHeader}return this.getAllReceivedAudio()}startNewSynthesis(e,t,r,i){this.privIsSynthesisEnded=!1,this.privIsSynthesizing=!0,this.privRequestId=e,this.privRawText=t,this.privIsSSML=r,this.privAudioOutputStream=new n.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="",void 0!==i&&(this.privTurnAudioDestination=i,this.privTurnAudioDestination.format=this.privAudioOutputFormat),this.onEvent(new a.SynthesisTriggeredEvent(this.requestId,void 0,void 0===i?void 0:i.id()))}onPreConnectionStart(e){this.privAuthFetchEventId=e,this.onEvent(new a.ConnectingToSynthesisServiceEvent(this.privRequestId,this.privAuthFetchEventId))}onAuthCompleted(e){e&&this.onComplete()}onConnectionEstablishCompleted(e){if(200===e)return this.onEvent(new a.SynthesisStartedEvent(this.requestId,this.privAuthFetchEventId)),void(this.privBytesReceived=0);403===e&&this.onComplete()}onServiceResponseMessage(e){const t=JSON.parse(e);this.streamId=t.audio.streamId}onServiceTurnEndResponse(){this.privInTurn=!1,this.privTurnDeferral.resolve(),this.onComplete()}onServiceTurnStartResponse(e){this.privTurnDeferral&&this.privInTurn&&(this.privTurnDeferral.reject("Another turn started before current completed."),this.privTurnDeferral.promise.then().catch(()=>{})),this.privInTurn=!0,this.privTurnDeferral=new i.Deferred;const t=JSON.parse(e);t.webrtc&&(this.privWebRTCSDP=t.webrtc.connectionString)}onAudioChunkReceived(e){this.isSynthesizing&&(this.privAudioOutputStream.write(e),this.privBytesReceived+=e.byteLength,void 0!==this.privTurnAudioDestination&&this.privTurnAudioDestination.write(e))}onTextBoundaryEvent(e){this.updateTextOffset(e.Data.text.Text,e.Type)}onVisemeMetadataReceived(e){void 0!==e.Data.AnimationChunk&&(this.privPartialVisemeAnimation+=e.Data.AnimationChunk)}onSessionEnd(e){this.privAudioDuration=e.Data.Offset}async constructSynthesisResult(){const e=await this.getAllReceivedAudioWithHeader();return new o.SpeechSynthesisResult(this.requestId,o.ResultReason.SynthesizingAudioCompleted,e,void 0,this.extraProperties,this.audioDuration)}dispose(){this.privIsDisposed||(this.privIsDisposed=!0)}onStopSynthesizing(){this.onComplete()}getAndClearVisemeAnimation(){const e=this.privPartialVisemeAnimation;return this.privPartialVisemeAnimation="",e}onEvent(e){i.Events.instance.onEvent(e)}static isXmlTag(e){return e.length>=2&&"<"===e[0]&&">"===e[e.length-1]}updateTextOffset(e,t){t===s.MetadataType.WordBoundary?(this.privTextOffset=this.privRawText.indexOf(e,this.privNextSearchTextIndex),this.privTextOffset>=0&&(this.privNextSearchTextIndex=this.privTextOffset+e.length,this.privIsSSML&&this.withinXmlTag(this.privTextOffset)&&!c.isXmlTag(e)&&this.updateTextOffset(e,t))):(this.privSentenceOffset=this.privRawText.indexOf(e,this.privNextSearchSentenceIndex),this.privSentenceOffset>=0&&(this.privNextSearchSentenceIndex=this.privSentenceOffset+e.length,this.privIsSSML&&this.withinXmlTag(this.privSentenceOffset)&&!c.isXmlTag(e)&&this.updateTextOffset(e,t)))}onComplete(){this.privIsSynthesizing&&(this.privIsSynthesizing=!1,this.privIsSynthesisEnded=!0,this.privAudioOutputStream.close(),this.privInTurn=!1,void 0!==this.privTurnAudioDestination&&(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(e){this.privReceivedAudio=new ArrayBuffer(0)}}}withinXmlTag(e){return this.privRawText.indexOf("<",e+1)>this.privRawText.indexOf(">",e+1)}}t.SynthesisTurn=c},4497:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Participant=t.User=void 0;const i=r(881);t.User=class{constructor(e){this.privUserId=e}get userId(){return this.privUserId}};class n{constructor(e,t,r,n,o,s,a,c){this.privId=e,this.privAvatar=t,this.privDisplayName=r,this.privIsHost=n,this.privIsMuted=o,this.privIsUsingTts=s,this.privPreferredLanguage=a,this.privVoice=c,this.privProperties=new i.PropertyCollection}get avatar(){return this.privAvatar}get displayName(){return this.privDisplayName}get id(){return this.privId}get preferredLanguage(){return this.privPreferredLanguage}get isHost(){return this.privIsHost}get isMuted(){return this.privIsMuted}get isUsingTts(){return this.privIsUsingTts}get voice(){return this.privVoice}get properties(){return this.privProperties}static From(e,t,r){return new n(e,"",e,!1,!1,!1,t,r)}}t.Participant=n},4520:(e,t)=>{"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.TranslationStatus=void 0,(r=t.TranslationStatus||(t.TranslationStatus={}))[r.Success=0]="Success",r[r.Error=1]="Error"},4521:function(e){var t;t=()=>(()=>{var e,t,r={931:(e,t,r)=>{var i;function n(e){this.rand=e}if(e.exports=function(e){return i||(i=new n(null)),i.generate(e)},e.exports.Rand=n,n.prototype.generate=function(e){return this._rand(e)},n.prototype._rand=function(e){if(this.rand.getBytes)return this.rand.getBytes(e);for(var t=new Uint8Array(e),r=0;r<t.length;r++)t[r]=this.rand.getByte();return t},"object"==typeof self)self.crypto&&self.crypto.getRandomValues?n.prototype._rand=function(e){var t=new Uint8Array(e);return self.crypto.getRandomValues(t),t}:self.msCrypto&&self.msCrypto.getRandomValues?n.prototype._rand=function(e){var t=new Uint8Array(e);return self.msCrypto.getRandomValues(t),t}:"object"==typeof window&&(n.prototype._rand=function(){throw new Error("Not implemented yet")});else try{var o=r(214);if("function"!=typeof o.randomBytes)throw new Error("Not supported");n.prototype._rand=function(e){return o.randomBytes(e)}}catch(e){}},266:(e,t,r)=>{"use strict";var i=t;i.version=r(597).i8,i.utils=r(953),i.rand=r(931),i.curve=r(254),i.curves=r(427),i.ec=r(954),i.eddsa=r(980)},918:(e,t,r)=>{"use strict";var i=r(785),n=r(953),o=n.getNAF,s=n.getJSF,a=n.assert;function c(e,t){this.type=e,this.p=new i(t.p,16),this.red=t.prime?i.red(t.prime):i.mont(this.p),this.zero=new i(0).toRed(this.red),this.one=new i(1).toRed(this.red),this.two=new i(2).toRed(this.red),this.n=t.n&&new i(t.n,16),this.g=t.g&&this.pointFromJSON(t.g,t.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var r=this.n&&this.p.div(this.n);!r||r.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}function u(e,t){this.curve=e,this.type=t,this.precomputed=null}e.exports=c,c.prototype.point=function(){throw new Error("Not implemented")},c.prototype.validate=function(){throw new Error("Not implemented")},c.prototype._fixedNafMul=function(e,t){a(e.precomputed);var r=e._getDoubles(),i=o(t,1,this._bitLength),n=(1<<r.step+1)-(r.step%2==0?2:1);n/=3;var s,c,u=[];for(s=0;s<i.length;s+=r.step){c=0;for(var h=s+r.step-1;h>=s;h--)c=(c<<1)+i[h];u.push(c)}for(var d=this.jpoint(null,null,null),l=this.jpoint(null,null,null),p=n;p>0;p--){for(s=0;s<u.length;s++)(c=u[s])===p?l=l.mixedAdd(r.points[s]):c===-p&&(l=l.mixedAdd(r.points[s].neg()));d=d.add(l)}return d.toP()},c.prototype._wnafMul=function(e,t){var r=4,i=e._getNAFPoints(r);r=i.wnd;for(var n=i.points,s=o(t,r,this._bitLength),c=this.jpoint(null,null,null),u=s.length-1;u>=0;u--){for(var h=0;u>=0&&0===s[u];u--)h++;if(u>=0&&h++,c=c.dblp(h),u<0)break;var d=s[u];a(0!==d),c="affine"===e.type?d>0?c.mixedAdd(n[d-1>>1]):c.mixedAdd(n[-d-1>>1].neg()):d>0?c.add(n[d-1>>1]):c.add(n[-d-1>>1].neg())}return"affine"===e.type?c.toP():c},c.prototype._wnafMulAdd=function(e,t,r,i,n){var a,c,u,h=this._wnafT1,d=this._wnafT2,l=this._wnafT3,p=0;for(a=0;a<i;a++){var f=(u=t[a])._getNAFPoints(e);h[a]=f.wnd,d[a]=f.points}for(a=i-1;a>=1;a-=2){var v=a-1,g=a;if(1===h[v]&&1===h[g]){var m=[t[v],null,null,t[g]];0===t[v].y.cmp(t[g].y)?(m[1]=t[v].add(t[g]),m[2]=t[v].toJ().mixedAdd(t[g].neg())):0===t[v].y.cmp(t[g].y.redNeg())?(m[1]=t[v].toJ().mixedAdd(t[g]),m[2]=t[v].add(t[g].neg())):(m[1]=t[v].toJ().mixedAdd(t[g]),m[2]=t[v].toJ().mixedAdd(t[g].neg()));var y=[-3,-1,-5,-7,0,7,5,1,3],b=s(r[v],r[g]);for(p=Math.max(b[0].length,p),l[v]=new Array(p),l[g]=new Array(p),c=0;c<p;c++){var S=0|b[0][c],C=0|b[1][c];l[v][c]=y[3*(S+1)+(C+1)],l[g][c]=0,d[v]=m}}else l[v]=o(r[v],h[v],this._bitLength),l[g]=o(r[g],h[g],this._bitLength),p=Math.max(l[v].length,p),p=Math.max(l[g].length,p)}var w=this.jpoint(null,null,null),P=this._wnafT4;for(a=p;a>=0;a--){for(var A=0;a>=0;){var I=!0;for(c=0;c<i;c++)P[c]=0|l[c][a],0!==P[c]&&(I=!1);if(!I)break;A++,a--}if(a>=0&&A++,w=w.dblp(A),a<0)break;for(c=0;c<i;c++){var R=P[c];0!==R&&(R>0?u=d[c][R-1>>1]:R<0&&(u=d[c][-R-1>>1].neg()),w="affine"===u.type?w.mixedAdd(u):w.add(u))}}for(a=0;a<i;a++)d[a]=null;return n?w:w.toP()},c.BasePoint=u,u.prototype.eq=function(){throw new Error("Not implemented")},u.prototype.validate=function(){return this.curve.validate(this)},c.prototype.decodePoint=function(e,t){e=n.toArray(e,t);var r=this.p.byteLength();if((4===e[0]||6===e[0]||7===e[0])&&e.length-1==2*r)return 6===e[0]?a(e[e.length-1]%2==0):7===e[0]&&a(e[e.length-1]%2==1),this.point(e.slice(1,1+r),e.slice(1+r,1+2*r));if((2===e[0]||3===e[0])&&e.length-1===r)return this.pointFromX(e.slice(1,1+r),3===e[0]);throw new Error("Unknown point format")},u.prototype.encodeCompressed=function(e){return this.encode(e,!0)},u.prototype._encode=function(e){var t=this.curve.p.byteLength(),r=this.getX().toArray("be",t);return e?[this.getY().isEven()?2:3].concat(r):[4].concat(r,this.getY().toArray("be",t))},u.prototype.encode=function(e,t){return n.encode(this._encode(t),e)},u.prototype.precompute=function(e){if(this.precomputed)return this;var t={doubles:null,naf:null,beta:null};return t.naf=this._getNAFPoints(8),t.doubles=this._getDoubles(4,e),t.beta=this._getBeta(),this.precomputed=t,this},u.prototype._hasDoubles=function(e){if(!this.precomputed)return!1;var t=this.precomputed.doubles;return!!t&&t.points.length>=Math.ceil((e.bitLength()+1)/t.step)},u.prototype._getDoubles=function(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],i=this,n=0;n<t;n+=e){for(var o=0;o<e;o++)i=i.dbl();r.push(i)}return{step:e,points:r}},u.prototype._getNAFPoints=function(e){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var t=[this],r=(1<<e)-1,i=1===r?null:this.dbl(),n=1;n<r;n++)t[n]=t[n-1].add(i);return{wnd:e,points:t}},u.prototype._getBeta=function(){return null},u.prototype.dblp=function(e){for(var t=this,r=0;r<e;r++)t=t.dbl();return t}},138:(e,t,r)=>{"use strict";var i=r(953),n=r(785),o=r(717),s=r(918),a=i.assert;function c(e){this.twisted=1!=(0|e.a),this.mOneA=this.twisted&&-1==(0|e.a),this.extended=this.mOneA,s.call(this,"edwards",e),this.a=new n(e.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new n(e.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new n(e.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),a(!this.twisted||0===this.c.fromRed().cmpn(1)),this.oneC=1==(0|e.c)}function u(e,t,r,i,o){s.BasePoint.call(this,e,"projective"),null===t&&null===r&&null===i?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new n(t,16),this.y=new n(r,16),this.z=i?new n(i,16):this.curve.one,this.t=o&&new n(o,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t&&(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}o(c,s),e.exports=c,c.prototype._mulA=function(e){return this.mOneA?e.redNeg():this.a.redMul(e)},c.prototype._mulC=function(e){return this.oneC?e:this.c.redMul(e)},c.prototype.jpoint=function(e,t,r,i){return this.point(e,t,r,i)},c.prototype.pointFromX=function(e,t){(e=new n(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr(),i=this.c2.redSub(this.a.redMul(r)),o=this.one.redSub(this.c2.redMul(this.d).redMul(r)),s=i.redMul(o.redInvm()),a=s.redSqrt();if(0!==a.redSqr().redSub(s).cmp(this.zero))throw new Error("invalid point");var c=a.fromRed().isOdd();return(t&&!c||!t&&c)&&(a=a.redNeg()),this.point(e,a)},c.prototype.pointFromY=function(e,t){(e=new n(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr(),i=r.redSub(this.c2),o=r.redMul(this.d).redMul(this.c2).redSub(this.a),s=i.redMul(o.redInvm());if(0===s.cmp(this.zero)){if(t)throw new Error("invalid point");return this.point(this.zero,e)}var a=s.redSqrt();if(0!==a.redSqr().redSub(s).cmp(this.zero))throw new Error("invalid point");return a.fromRed().isOdd()!==t&&(a=a.redNeg()),this.point(a,e)},c.prototype.validate=function(e){if(e.isInfinity())return!0;e.normalize();var t=e.x.redSqr(),r=e.y.redSqr(),i=t.redMul(this.a).redAdd(r),n=this.c2.redMul(this.one.redAdd(this.d.redMul(t).redMul(r)));return 0===i.cmp(n)},o(u,s.BasePoint),c.prototype.pointFromJSON=function(e){return u.fromJSON(this,e)},c.prototype.point=function(e,t,r,i){return new u(this,e,t,r,i)},u.fromJSON=function(e,t){return new u(e,t[0],t[1],t[2])},u.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},u.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&(0===this.y.cmp(this.z)||this.zOne&&0===this.y.cmp(this.curve.c))},u.prototype._extDbl=function(){var e=this.x.redSqr(),t=this.y.redSqr(),r=this.z.redSqr();r=r.redIAdd(r);var i=this.curve._mulA(e),n=this.x.redAdd(this.y).redSqr().redISub(e).redISub(t),o=i.redAdd(t),s=o.redSub(r),a=i.redSub(t),c=n.redMul(s),u=o.redMul(a),h=n.redMul(a),d=s.redMul(o);return this.curve.point(c,u,d,h)},u.prototype._projDbl=function(){var e,t,r,i,n,o,s=this.x.redAdd(this.y).redSqr(),a=this.x.redSqr(),c=this.y.redSqr();if(this.curve.twisted){var u=(i=this.curve._mulA(a)).redAdd(c);this.zOne?(e=s.redSub(a).redSub(c).redMul(u.redSub(this.curve.two)),t=u.redMul(i.redSub(c)),r=u.redSqr().redSub(u).redSub(u)):(n=this.z.redSqr(),o=u.redSub(n).redISub(n),e=s.redSub(a).redISub(c).redMul(o),t=u.redMul(i.redSub(c)),r=u.redMul(o))}else i=a.redAdd(c),n=this.curve._mulC(this.z).redSqr(),o=i.redSub(n).redSub(n),e=this.curve._mulC(s.redISub(i)).redMul(o),t=this.curve._mulC(i).redMul(a.redISub(c)),r=i.redMul(o);return this.curve.point(e,t,r)},u.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},u.prototype._extAdd=function(e){var t=this.y.redSub(this.x).redMul(e.y.redSub(e.x)),r=this.y.redAdd(this.x).redMul(e.y.redAdd(e.x)),i=this.t.redMul(this.curve.dd).redMul(e.t),n=this.z.redMul(e.z.redAdd(e.z)),o=r.redSub(t),s=n.redSub(i),a=n.redAdd(i),c=r.redAdd(t),u=o.redMul(s),h=a.redMul(c),d=o.redMul(c),l=s.redMul(a);return this.curve.point(u,h,l,d)},u.prototype._projAdd=function(e){var t,r,i=this.z.redMul(e.z),n=i.redSqr(),o=this.x.redMul(e.x),s=this.y.redMul(e.y),a=this.curve.d.redMul(o).redMul(s),c=n.redSub(a),u=n.redAdd(a),h=this.x.redAdd(this.y).redMul(e.x.redAdd(e.y)).redISub(o).redISub(s),d=i.redMul(c).redMul(h);return this.curve.twisted?(t=i.redMul(u).redMul(s.redSub(this.curve._mulA(o))),r=c.redMul(u)):(t=i.redMul(u).redMul(s.redSub(o)),r=this.curve._mulC(c).redMul(u)),this.curve.point(d,t,r)},u.prototype.add=function(e){return this.isInfinity()?e:e.isInfinity()?this:this.curve.extended?this._extAdd(e):this._projAdd(e)},u.prototype.mul=function(e){return this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve._wnafMul(this,e)},u.prototype.mulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!1)},u.prototype.jmulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!0)},u.prototype.normalize=function(){if(this.zOne)return this;var e=this.z.redInvm();return this.x=this.x.redMul(e),this.y=this.y.redMul(e),this.t&&(this.t=this.t.redMul(e)),this.z=this.curve.one,this.zOne=!0,this},u.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},u.prototype.getX=function(){return this.normalize(),this.x.fromRed()},u.prototype.getY=function(){return this.normalize(),this.y.fromRed()},u.prototype.eq=function(e){return this===e||0===this.getX().cmp(e.getX())&&0===this.getY().cmp(e.getY())},u.prototype.eqXToP=function(e){var t=e.toRed(this.curve.red).redMul(this.z);if(0===this.x.cmp(t))return!0;for(var r=e.clone(),i=this.curve.redN.redMul(this.z);;){if(r.iadd(this.curve.n),r.cmp(this.curve.p)>=0)return!1;if(t.redIAdd(i),0===this.x.cmp(t))return!0}},u.prototype.toP=u.prototype.normalize,u.prototype.mixedAdd=u.prototype.add},254:(e,t,r)=>{"use strict";var i=t;i.base=r(918),i.short=r(673),i.mont=r(881),i.edwards=r(138)},881:(e,t,r)=>{"use strict";var i=r(785),n=r(717),o=r(918),s=r(953);function a(e){o.call(this,"mont",e),this.a=new i(e.a,16).toRed(this.red),this.b=new i(e.b,16).toRed(this.red),this.i4=new i(4).toRed(this.red).redInvm(),this.two=new i(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}function c(e,t,r){o.BasePoint.call(this,e,"projective"),null===t&&null===r?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new i(t,16),this.z=new i(r,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}n(a,o),e.exports=a,a.prototype.validate=function(e){var t=e.normalize().x,r=t.redSqr(),i=r.redMul(t).redAdd(r.redMul(this.a)).redAdd(t);return 0===i.redSqrt().redSqr().cmp(i)},n(c,o.BasePoint),a.prototype.decodePoint=function(e,t){return this.point(s.toArray(e,t),1)},a.prototype.point=function(e,t){return new c(this,e,t)},a.prototype.pointFromJSON=function(e){return c.fromJSON(this,e)},c.prototype.precompute=function(){},c.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},c.fromJSON=function(e,t){return new c(e,t[0],t[1]||e.one)},c.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},c.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},c.prototype.dbl=function(){var e=this.x.redAdd(this.z).redSqr(),t=this.x.redSub(this.z).redSqr(),r=e.redSub(t),i=e.redMul(t),n=r.redMul(t.redAdd(this.curve.a24.redMul(r)));return this.curve.point(i,n)},c.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},c.prototype.diffAdd=function(e,t){var r=this.x.redAdd(this.z),i=this.x.redSub(this.z),n=e.x.redAdd(e.z),o=e.x.redSub(e.z).redMul(r),s=n.redMul(i),a=t.z.redMul(o.redAdd(s).redSqr()),c=t.x.redMul(o.redISub(s).redSqr());return this.curve.point(a,c)},c.prototype.mul=function(e){for(var t=e.clone(),r=this,i=this.curve.point(null,null),n=[];0!==t.cmpn(0);t.iushrn(1))n.push(t.andln(1));for(var o=n.length-1;o>=0;o--)0===n[o]?(r=r.diffAdd(i,this),i=i.dbl()):(i=r.diffAdd(i,this),r=r.dbl());return i},c.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},c.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},c.prototype.eq=function(e){return 0===this.getX().cmp(e.getX())},c.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},c.prototype.getX=function(){return this.normalize(),this.x.fromRed()}},673:(e,t,r)=>{"use strict";var i=r(953),n=r(785),o=r(717),s=r(918),a=i.assert;function c(e){s.call(this,"short",e),this.a=new n(e.a,16).toRed(this.red),this.b=new n(e.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=0===this.a.fromRed().cmpn(0),this.threeA=0===this.a.fromRed().sub(this.p).cmpn(-3),this.endo=this._getEndomorphism(e),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}function u(e,t,r,i){s.BasePoint.call(this,e,"affine"),null===t&&null===r?(this.x=null,this.y=null,this.inf=!0):(this.x=new n(t,16),this.y=new n(r,16),i&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}function h(e,t,r,i){s.BasePoint.call(this,e,"jacobian"),null===t&&null===r&&null===i?(this.x=this.curve.one,this.y=this.curve.one,this.z=new n(0)):(this.x=new n(t,16),this.y=new n(r,16),this.z=new n(i,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}o(c,s),e.exports=c,c.prototype._getEndomorphism=function(e){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var t,r;if(e.beta)t=new n(e.beta,16).toRed(this.red);else{var i=this._getEndoRoots(this.p);t=(t=i[0].cmp(i[1])<0?i[0]:i[1]).toRed(this.red)}if(e.lambda)r=new n(e.lambda,16);else{var o=this._getEndoRoots(this.n);0===this.g.mul(o[0]).x.cmp(this.g.x.redMul(t))?r=o[0]:(r=o[1],a(0===this.g.mul(r).x.cmp(this.g.x.redMul(t))))}return{beta:t,lambda:r,basis:e.basis?e.basis.map(function(e){return{a:new n(e.a,16),b:new n(e.b,16)}}):this._getEndoBasis(r)}}},c.prototype._getEndoRoots=function(e){var t=e===this.p?this.red:n.mont(e),r=new n(2).toRed(t).redInvm(),i=r.redNeg(),o=new n(3).toRed(t).redNeg().redSqrt().redMul(r);return[i.redAdd(o).fromRed(),i.redSub(o).fromRed()]},c.prototype._getEndoBasis=function(e){for(var t,r,i,o,s,a,c,u,h,d=this.n.ushrn(Math.floor(this.n.bitLength()/2)),l=e,p=this.n.clone(),f=new n(1),v=new n(0),g=new n(0),m=new n(1),y=0;0!==l.cmpn(0);){var b=p.div(l);u=p.sub(b.mul(l)),h=g.sub(b.mul(f));var S=m.sub(b.mul(v));if(!i&&u.cmp(d)<0)t=c.neg(),r=f,i=u.neg(),o=h;else if(i&&2==++y)break;c=u,p=l,l=u,g=f,f=h,m=v,v=S}s=u.neg(),a=h;var C=i.sqr().add(o.sqr());return s.sqr().add(a.sqr()).cmp(C)>=0&&(s=t,a=r),i.negative&&(i=i.neg(),o=o.neg()),s.negative&&(s=s.neg(),a=a.neg()),[{a:i,b:o},{a:s,b:a}]},c.prototype._endoSplit=function(e){var t=this.endo.basis,r=t[0],i=t[1],n=i.b.mul(e).divRound(this.n),o=r.b.neg().mul(e).divRound(this.n),s=n.mul(r.a),a=o.mul(i.a),c=n.mul(r.b),u=o.mul(i.b);return{k1:e.sub(s).sub(a),k2:c.add(u).neg()}},c.prototype.pointFromX=function(e,t){(e=new n(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),i=r.redSqrt();if(0!==i.redSqr().redSub(r).cmp(this.zero))throw new Error("invalid point");var o=i.fromRed().isOdd();return(t&&!o||!t&&o)&&(i=i.redNeg()),this.point(e,i)},c.prototype.validate=function(e){if(e.inf)return!0;var t=e.x,r=e.y,i=this.a.redMul(t),n=t.redSqr().redMul(t).redIAdd(i).redIAdd(this.b);return 0===r.redSqr().redISub(n).cmpn(0)},c.prototype._endoWnafMulAdd=function(e,t,r){for(var i=this._endoWnafT1,n=this._endoWnafT2,o=0;o<e.length;o++){var s=this._endoSplit(t[o]),a=e[o],c=a._getBeta();s.k1.negative&&(s.k1.ineg(),a=a.neg(!0)),s.k2.negative&&(s.k2.ineg(),c=c.neg(!0)),i[2*o]=a,i[2*o+1]=c,n[2*o]=s.k1,n[2*o+1]=s.k2}for(var u=this._wnafMulAdd(1,i,n,2*o,r),h=0;h<2*o;h++)i[h]=null,n[h]=null;return u},o(u,s.BasePoint),c.prototype.point=function(e,t,r){return new u(this,e,t,r)},c.prototype.pointFromJSON=function(e,t){return u.fromJSON(this,e,t)},u.prototype._getBeta=function(){if(this.curve.endo){var e=this.precomputed;if(e&&e.beta)return e.beta;var t=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(e){var r=this.curve,i=function(e){return r.point(e.x.redMul(r.endo.beta),e.y)};e.beta=t,t.precomputed={beta:null,naf:e.naf&&{wnd:e.naf.wnd,points:e.naf.points.map(i)},doubles:e.doubles&&{step:e.doubles.step,points:e.doubles.points.map(i)}}}return t}},u.prototype.toJSON=function(){return this.precomputed?[this.x,this.y,this.precomputed&&{doubles:this.precomputed.doubles&&{step:this.precomputed.doubles.step,points:this.precomputed.doubles.points.slice(1)},naf:this.precomputed.naf&&{wnd:this.precomputed.naf.wnd,points:this.precomputed.naf.points.slice(1)}}]:[this.x,this.y]},u.fromJSON=function(e,t,r){"string"==typeof t&&(t=JSON.parse(t));var i=e.point(t[0],t[1],r);if(!t[2])return i;function n(t){return e.point(t[0],t[1],r)}var o=t[2];return i.precomputed={beta:null,doubles:o.doubles&&{step:o.doubles.step,points:[i].concat(o.doubles.points.map(n))},naf:o.naf&&{wnd:o.naf.wnd,points:[i].concat(o.naf.points.map(n))}},i},u.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"},u.prototype.isInfinity=function(){return this.inf},u.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(0===this.x.cmp(e.x))return this.curve.point(null,null);var t=this.y.redSub(e.y);0!==t.cmpn(0)&&(t=t.redMul(this.x.redSub(e.x).redInvm()));var r=t.redSqr().redISub(this.x).redISub(e.x),i=t.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,i)},u.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(0===e.cmpn(0))return this.curve.point(null,null);var t=this.curve.a,r=this.x.redSqr(),i=e.redInvm(),n=r.redAdd(r).redIAdd(r).redIAdd(t).redMul(i),o=n.redSqr().redISub(this.x.redAdd(this.x)),s=n.redMul(this.x.redSub(o)).redISub(this.y);return this.curve.point(o,s)},u.prototype.getX=function(){return this.x.fromRed()},u.prototype.getY=function(){return this.y.fromRed()},u.prototype.mul=function(e){return e=new n(e,16),this.isInfinity()?this:this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)},u.prototype.mulAdd=function(e,t,r){var i=[this,t],n=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(i,n):this.curve._wnafMulAdd(1,i,n,2)},u.prototype.jmulAdd=function(e,t,r){var i=[this,t],n=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(i,n,!0):this.curve._wnafMulAdd(1,i,n,2,!0)},u.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||0===this.x.cmp(e.x)&&0===this.y.cmp(e.y))},u.prototype.neg=function(e){if(this.inf)return this;var t=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var r=this.precomputed,i=function(e){return e.neg()};t.precomputed={naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(i)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(i)}}}return t},u.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},o(h,s.BasePoint),c.prototype.jpoint=function(e,t,r){return new h(this,e,t,r)},h.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),t=e.redSqr(),r=this.x.redMul(t),i=this.y.redMul(t).redMul(e);return this.curve.point(r,i)},h.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},h.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.z.redSqr(),r=this.z.redSqr(),i=this.x.redMul(t),n=e.x.redMul(r),o=this.y.redMul(t.redMul(e.z)),s=e.y.redMul(r.redMul(this.z)),a=i.redSub(n),c=o.redSub(s);if(0===a.cmpn(0))return 0!==c.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var u=a.redSqr(),h=u.redMul(a),d=i.redMul(u),l=c.redSqr().redIAdd(h).redISub(d).redISub(d),p=c.redMul(d.redISub(l)).redISub(o.redMul(h)),f=this.z.redMul(e.z).redMul(a);return this.curve.jpoint(l,p,f)},h.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var t=this.z.redSqr(),r=this.x,i=e.x.redMul(t),n=this.y,o=e.y.redMul(t).redMul(this.z),s=r.redSub(i),a=n.redSub(o);if(0===s.cmpn(0))return 0!==a.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var c=s.redSqr(),u=c.redMul(s),h=r.redMul(c),d=a.redSqr().redIAdd(u).redISub(h).redISub(h),l=a.redMul(h.redISub(d)).redISub(n.redMul(u)),p=this.z.redMul(s);return this.curve.jpoint(d,l,p)},h.prototype.dblp=function(e){if(0===e)return this;if(this.isInfinity())return this;if(!e)return this.dbl();var t;if(this.curve.zeroA||this.curve.threeA){var r=this;for(t=0;t<e;t++)r=r.dbl();return r}var i=this.curve.a,n=this.curve.tinv,o=this.x,s=this.y,a=this.z,c=a.redSqr().redSqr(),u=s.redAdd(s);for(t=0;t<e;t++){var h=o.redSqr(),d=u.redSqr(),l=d.redSqr(),p=h.redAdd(h).redIAdd(h).redIAdd(i.redMul(c)),f=o.redMul(d),v=p.redSqr().redISub(f.redAdd(f)),g=f.redISub(v),m=p.redMul(g);m=m.redIAdd(m).redISub(l);var y=u.redMul(a);t+1<e&&(c=c.redMul(l)),o=v,a=y,u=m}return this.curve.jpoint(o,u.redMul(n),a)},h.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},h.prototype._zeroDbl=function(){var e,t,r;if(this.zOne){var i=this.x.redSqr(),n=this.y.redSqr(),o=n.redSqr(),s=this.x.redAdd(n).redSqr().redISub(i).redISub(o);s=s.redIAdd(s);var a=i.redAdd(i).redIAdd(i),c=a.redSqr().redISub(s).redISub(s),u=o.redIAdd(o);u=(u=u.redIAdd(u)).redIAdd(u),e=c,t=a.redMul(s.redISub(c)).redISub(u),r=this.y.redAdd(this.y)}else{var h=this.x.redSqr(),d=this.y.redSqr(),l=d.redSqr(),p=this.x.redAdd(d).redSqr().redISub(h).redISub(l);p=p.redIAdd(p);var f=h.redAdd(h).redIAdd(h),v=f.redSqr(),g=l.redIAdd(l);g=(g=g.redIAdd(g)).redIAdd(g),e=v.redISub(p).redISub(p),t=f.redMul(p.redISub(e)).redISub(g),r=(r=this.y.redMul(this.z)).redIAdd(r)}return this.curve.jpoint(e,t,r)},h.prototype._threeDbl=function(){var e,t,r;if(this.zOne){var i=this.x.redSqr(),n=this.y.redSqr(),o=n.redSqr(),s=this.x.redAdd(n).redSqr().redISub(i).redISub(o);s=s.redIAdd(s);var a=i.redAdd(i).redIAdd(i).redIAdd(this.curve.a),c=a.redSqr().redISub(s).redISub(s);e=c;var u=o.redIAdd(o);u=(u=u.redIAdd(u)).redIAdd(u),t=a.redMul(s.redISub(c)).redISub(u),r=this.y.redAdd(this.y)}else{var h=this.z.redSqr(),d=this.y.redSqr(),l=this.x.redMul(d),p=this.x.redSub(h).redMul(this.x.redAdd(h));p=p.redAdd(p).redIAdd(p);var f=l.redIAdd(l),v=(f=f.redIAdd(f)).redAdd(f);e=p.redSqr().redISub(v),r=this.y.redAdd(this.z).redSqr().redISub(d).redISub(h);var g=d.redSqr();g=(g=(g=g.redIAdd(g)).redIAdd(g)).redIAdd(g),t=p.redMul(f.redISub(e)).redISub(g)}return this.curve.jpoint(e,t,r)},h.prototype._dbl=function(){var e=this.curve.a,t=this.x,r=this.y,i=this.z,n=i.redSqr().redSqr(),o=t.redSqr(),s=r.redSqr(),a=o.redAdd(o).redIAdd(o).redIAdd(e.redMul(n)),c=t.redAdd(t),u=(c=c.redIAdd(c)).redMul(s),h=a.redSqr().redISub(u.redAdd(u)),d=u.redISub(h),l=s.redSqr();l=(l=(l=l.redIAdd(l)).redIAdd(l)).redIAdd(l);var p=a.redMul(d).redISub(l),f=r.redAdd(r).redMul(i);return this.curve.jpoint(h,p,f)},h.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var e=this.x.redSqr(),t=this.y.redSqr(),r=this.z.redSqr(),i=t.redSqr(),n=e.redAdd(e).redIAdd(e),o=n.redSqr(),s=this.x.redAdd(t).redSqr().redISub(e).redISub(i),a=(s=(s=(s=s.redIAdd(s)).redAdd(s).redIAdd(s)).redISub(o)).redSqr(),c=i.redIAdd(i);c=(c=(c=c.redIAdd(c)).redIAdd(c)).redIAdd(c);var u=n.redIAdd(s).redSqr().redISub(o).redISub(a).redISub(c),h=t.redMul(u);h=(h=h.redIAdd(h)).redIAdd(h);var d=this.x.redMul(a).redISub(h);d=(d=d.redIAdd(d)).redIAdd(d);var l=this.y.redMul(u.redMul(c.redISub(u)).redISub(s.redMul(a)));l=(l=(l=l.redIAdd(l)).redIAdd(l)).redIAdd(l);var p=this.z.redAdd(s).redSqr().redISub(r).redISub(a);return this.curve.jpoint(d,l,p)},h.prototype.mul=function(e,t){return e=new n(e,t),this.curve._wnafMul(this,e)},h.prototype.eq=function(e){if("affine"===e.type)return this.eq(e.toJ());if(this===e)return!0;var t=this.z.redSqr(),r=e.z.redSqr();if(0!==this.x.redMul(r).redISub(e.x.redMul(t)).cmpn(0))return!1;var i=t.redMul(this.z),n=r.redMul(e.z);return 0===this.y.redMul(n).redISub(e.y.redMul(i)).cmpn(0)},h.prototype.eqXToP=function(e){var t=this.z.redSqr(),r=e.toRed(this.curve.red).redMul(t);if(0===this.x.cmp(r))return!0;for(var i=e.clone(),n=this.curve.redN.redMul(t);;){if(i.iadd(this.curve.n),i.cmp(this.curve.p)>=0)return!1;if(r.redIAdd(n),0===this.x.cmp(r))return!0}},h.prototype.inspect=function(){return this.isInfinity()?"<EC JPoint Infinity>":"<EC JPoint x: "+this.x.toString(16,2)+" y: "+this.y.toString(16,2)+" z: "+this.z.toString(16,2)+">"},h.prototype.isInfinity=function(){return 0===this.z.cmpn(0)}},427:(e,t,r)=>{"use strict";var i,n=t,o=r(715),s=r(254),a=r(953).assert;function c(e){"short"===e.type?this.curve=new s.short(e):"edwards"===e.type?this.curve=new s.edwards(e):this.curve=new s.mont(e),this.g=this.curve.g,this.n=this.curve.n,this.hash=e.hash,a(this.g.validate(),"Invalid curve"),a(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function u(e,t){Object.defineProperty(n,e,{configurable:!0,enumerable:!0,get:function(){var r=new c(t);return Object.defineProperty(n,e,{configurable:!0,enumerable:!0,value:r}),r}})}n.PresetCurve=c,u("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:o.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),u("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:o.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),u("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:o.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),u("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:o.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),u("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:o.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),u("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:o.sha256,gRed:!1,g:["9"]}),u("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:o.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{i=r(37)}catch(e){i=void 0}u("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:o.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",i]})},954:(e,t,r)=>{"use strict";var i=r(785),n=r(156),o=r(953),s=r(427),a=r(931),c=o.assert,u=r(251),h=r(611);function d(e){if(!(this instanceof d))return new d(e);"string"==typeof e&&(c(Object.prototype.hasOwnProperty.call(s,e),"Unknown curve "+e),e=s[e]),e instanceof s.PresetCurve&&(e={curve:e}),this.curve=e.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=e.curve.g,this.g.precompute(e.curve.n.bitLength()+1),this.hash=e.hash||e.curve.hash}e.exports=d,d.prototype.keyPair=function(e){return new u(this,e)},d.prototype.keyFromPrivate=function(e,t){return u.fromPrivate(this,e,t)},d.prototype.keyFromPublic=function(e,t){return u.fromPublic(this,e,t)},d.prototype.genKeyPair=function(e){e||(e={});for(var t=new n({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||a(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),r=this.n.byteLength(),o=this.n.sub(new i(2));;){var s=new i(t.generate(r));if(!(s.cmp(o)>0))return s.iaddn(1),this.keyFromPrivate(s)}},d.prototype._truncateToN=function(e,t){var r=8*e.byteLength()-this.n.bitLength();return r>0&&(e=e.ushrn(r)),!t&&e.cmp(this.n)>=0?e.sub(this.n):e},d.prototype.sign=function(e,t,r,o){"object"==typeof r&&(o=r,r=null),o||(o={}),t=this.keyFromPrivate(t,r),e=this._truncateToN(new i(e,16));for(var s=this.n.byteLength(),a=t.getPrivate().toArray("be",s),c=e.toArray("be",s),u=new n({hash:this.hash,entropy:a,nonce:c,pers:o.pers,persEnc:o.persEnc||"utf8"}),d=this.n.sub(new i(1)),l=0;;l++){var p=o.k?o.k(l):new i(u.generate(this.n.byteLength()));if(!((p=this._truncateToN(p,!0)).cmpn(1)<=0||p.cmp(d)>=0)){var f=this.g.mul(p);if(!f.isInfinity()){var v=f.getX(),g=v.umod(this.n);if(0!==g.cmpn(0)){var m=p.invm(this.n).mul(g.mul(t.getPrivate()).iadd(e));if(0!==(m=m.umod(this.n)).cmpn(0)){var y=(f.getY().isOdd()?1:0)|(0!==v.cmp(g)?2:0);return o.canonical&&m.cmp(this.nh)>0&&(m=this.n.sub(m),y^=1),new h({r:g,s:m,recoveryParam:y})}}}}}},d.prototype.verify=function(e,t,r,n){e=this._truncateToN(new i(e,16)),r=this.keyFromPublic(r,n);var o=(t=new h(t,"hex")).r,s=t.s;if(o.cmpn(1)<0||o.cmp(this.n)>=0)return!1;if(s.cmpn(1)<0||s.cmp(this.n)>=0)return!1;var a,c=s.invm(this.n),u=c.mul(e).umod(this.n),d=c.mul(o).umod(this.n);return this.curve._maxwellTrick?!(a=this.g.jmulAdd(u,r.getPublic(),d)).isInfinity()&&a.eqXToP(o):!(a=this.g.mulAdd(u,r.getPublic(),d)).isInfinity()&&0===a.getX().umod(this.n).cmp(o)},d.prototype.recoverPubKey=function(e,t,r,n){c((3&r)===r,"The recovery param is more than two bits"),t=new h(t,n);var o=this.n,s=new i(e),a=t.r,u=t.s,d=1&r,l=r>>1;if(a.cmp(this.curve.p.umod(this.curve.n))>=0&&l)throw new Error("Unable to find sencond key candinate");a=l?this.curve.pointFromX(a.add(this.curve.n),d):this.curve.pointFromX(a,d);var p=t.r.invm(o),f=o.sub(s).mul(p).umod(o),v=u.mul(p).umod(o);return this.g.mulAdd(f,a,v)},d.prototype.getKeyRecoveryParam=function(e,t,r,i){if(null!==(t=new h(t,i)).recoveryParam)return t.recoveryParam;for(var n=0;n<4;n++){var o;try{o=this.recoverPubKey(e,t,n)}catch(e){continue}if(o.eq(r))return n}throw new Error("Unable to find valid recovery factor")}},251:(e,t,r)=>{"use strict";var i=r(785),n=r(953).assert;function o(e,t){this.ec=e,this.priv=null,this.pub=null,t.priv&&this._importPrivate(t.priv,t.privEnc),t.pub&&this._importPublic(t.pub,t.pubEnc)}e.exports=o,o.fromPublic=function(e,t,r){return t instanceof o?t:new o(e,{pub:t,pubEnc:r})},o.fromPrivate=function(e,t,r){return t instanceof o?t:new o(e,{priv:t,privEnc:r})},o.prototype.validate=function(){var e=this.getPublic();return e.isInfinity()?{result:!1,reason:"Invalid public key"}:e.validate()?e.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},o.prototype.getPublic=function(e,t){return"string"==typeof e&&(t=e,e=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),t?this.pub.encode(t,e):this.pub},o.prototype.getPrivate=function(e){return"hex"===e?this.priv.toString(16,2):this.priv},o.prototype._importPrivate=function(e,t){this.priv=new i(e,t||16),this.priv=this.priv.umod(this.ec.curve.n)},o.prototype._importPublic=function(e,t){if(e.x||e.y)return"mont"===this.ec.curve.type?n(e.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||n(e.x&&e.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(e.x,e.y));this.pub=this.ec.curve.decodePoint(e,t)},o.prototype.derive=function(e){return e.validate()||n(e.validate(),"public point not validated"),e.mul(this.priv).getX()},o.prototype.sign=function(e,t,r){return this.ec.sign(e,this,t,r)},o.prototype.verify=function(e,t){return this.ec.verify(e,t,this)},o.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"}},611:(e,t,r)=>{"use strict";var i=r(785),n=r(953),o=n.assert;function s(e,t){if(e instanceof s)return e;this._importDER(e,t)||(o(e.r&&e.s,"Signature without r or s"),this.r=new i(e.r,16),this.s=new i(e.s,16),void 0===e.recoveryParam?this.recoveryParam=null:this.recoveryParam=e.recoveryParam)}function a(){this.place=0}function c(e,t){var r=e[t.place++];if(!(128&r))return r;var i=15&r;if(0===i||i>4)return!1;for(var n=0,o=0,s=t.place;o<i;o++,s++)n<<=8,n|=e[s],n>>>=0;return!(n<=127)&&(t.place=s,n)}function u(e){for(var t=0,r=e.length-1;!e[t]&&!(128&e[t+1])&&t<r;)t++;return 0===t?e:e.slice(t)}function h(e,t){if(t<128)e.push(t);else{var r=1+(Math.log(t)/Math.LN2>>>3);for(e.push(128|r);--r;)e.push(t>>>(r<<3)&255);e.push(t)}}e.exports=s,s.prototype._importDER=function(e,t){e=n.toArray(e,t);var r=new a;if(48!==e[r.place++])return!1;var o=c(e,r);if(!1===o)return!1;if(o+r.place!==e.length)return!1;if(2!==e[r.place++])return!1;var s=c(e,r);if(!1===s)return!1;var u=e.slice(r.place,s+r.place);if(r.place+=s,2!==e[r.place++])return!1;var h=c(e,r);if(!1===h)return!1;if(e.length!==h+r.place)return!1;var d=e.slice(r.place,h+r.place);if(0===u[0]){if(!(128&u[1]))return!1;u=u.slice(1)}if(0===d[0]){if(!(128&d[1]))return!1;d=d.slice(1)}return this.r=new i(u),this.s=new i(d),this.recoveryParam=null,!0},s.prototype.toDER=function(e){var t=this.r.toArray(),r=this.s.toArray();for(128&t[0]&&(t=[0].concat(t)),128&r[0]&&(r=[0].concat(r)),t=u(t),r=u(r);!(r[0]||128&r[1]);)r=r.slice(1);var i=[2];h(i,t.length),(i=i.concat(t)).push(2),h(i,r.length);var o=i.concat(r),s=[48];return h(s,o.length),s=s.concat(o),n.encode(s,e)}},980:(e,t,r)=>{"use strict";var i=r(715),n=r(427),o=r(953),s=o.assert,a=o.parseBytes,c=r(87),u=r(622);function h(e){if(s("ed25519"===e,"only tested with ed25519 so far"),!(this instanceof h))return new h(e);e=n[e].curve,this.curve=e,this.g=e.g,this.g.precompute(e.n.bitLength()+1),this.pointClass=e.point().constructor,this.encodingLength=Math.ceil(e.n.bitLength()/8),this.hash=i.sha512}e.exports=h,h.prototype.sign=function(e,t){e=a(e);var r=this.keyFromSecret(t),i=this.hashInt(r.messagePrefix(),e),n=this.g.mul(i),o=this.encodePoint(n),s=this.hashInt(o,r.pubBytes(),e).mul(r.priv()),c=i.add(s).umod(this.curve.n);return this.makeSignature({R:n,S:c,Rencoded:o})},h.prototype.verify=function(e,t,r){e=a(e),t=this.makeSignature(t);var i=this.keyFromPublic(r),n=this.hashInt(t.Rencoded(),i.pubBytes(),e),o=this.g.mul(t.S());return t.R().add(i.pub().mul(n)).eq(o)},h.prototype.hashInt=function(){for(var e=this.hash(),t=0;t<arguments.length;t++)e.update(arguments[t]);return o.intFromLE(e.digest()).umod(this.curve.n)},h.prototype.keyFromPublic=function(e){return c.fromPublic(this,e)},h.prototype.keyFromSecret=function(e){return c.fromSecret(this,e)},h.prototype.makeSignature=function(e){return e instanceof u?e:new u(this,e)},h.prototype.encodePoint=function(e){var t=e.getY().toArray("le",this.encodingLength);return t[this.encodingLength-1]|=e.getX().isOdd()?128:0,t},h.prototype.decodePoint=function(e){var t=(e=o.parseBytes(e)).length-1,r=e.slice(0,t).concat(-129&e[t]),i=!!(128&e[t]),n=o.intFromLE(r);return this.curve.pointFromY(n,i)},h.prototype.encodeInt=function(e){return e.toArray("le",this.encodingLength)},h.prototype.decodeInt=function(e){return o.intFromLE(e)},h.prototype.isPoint=function(e){return e instanceof this.pointClass}},87:(e,t,r)=>{"use strict";var i=r(953),n=i.assert,o=i.parseBytes,s=i.cachedProperty;function a(e,t){this.eddsa=e,this._secret=o(t.secret),e.isPoint(t.pub)?this._pub=t.pub:this._pubBytes=o(t.pub)}a.fromPublic=function(e,t){return t instanceof a?t:new a(e,{pub:t})},a.fromSecret=function(e,t){return t instanceof a?t:new a(e,{secret:t})},a.prototype.secret=function(){return this._secret},s(a,"pubBytes",function(){return this.eddsa.encodePoint(this.pub())}),s(a,"pub",function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())}),s(a,"privBytes",function(){var e=this.eddsa,t=this.hash(),r=e.encodingLength-1,i=t.slice(0,e.encodingLength);return i[0]&=248,i[r]&=127,i[r]|=64,i}),s(a,"priv",function(){return this.eddsa.decodeInt(this.privBytes())}),s(a,"hash",function(){return this.eddsa.hash().update(this.secret()).digest()}),s(a,"messagePrefix",function(){return this.hash().slice(this.eddsa.encodingLength)}),a.prototype.sign=function(e){return n(this._secret,"KeyPair can only verify"),this.eddsa.sign(e,this)},a.prototype.verify=function(e,t){return this.eddsa.verify(e,t,this)},a.prototype.getSecret=function(e){return n(this._secret,"KeyPair is public only"),i.encode(this.secret(),e)},a.prototype.getPublic=function(e){return i.encode(this.pubBytes(),e)},e.exports=a},622:(e,t,r)=>{"use strict";var i=r(785),n=r(953),o=n.assert,s=n.cachedProperty,a=n.parseBytes;function c(e,t){this.eddsa=e,"object"!=typeof t&&(t=a(t)),Array.isArray(t)&&(t={R:t.slice(0,e.encodingLength),S:t.slice(e.encodingLength)}),o(t.R&&t.S,"Signature without R or S"),e.isPoint(t.R)&&(this._R=t.R),t.S instanceof i&&(this._S=t.S),this._Rencoded=Array.isArray(t.R)?t.R:t.Rencoded,this._Sencoded=Array.isArray(t.S)?t.S:t.Sencoded}s(c,"S",function(){return this.eddsa.decodeInt(this.Sencoded())}),s(c,"R",function(){return this.eddsa.decodePoint(this.Rencoded())}),s(c,"Rencoded",function(){return this.eddsa.encodePoint(this.R())}),s(c,"Sencoded",function(){return this.eddsa.encodeInt(this.S())}),c.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())},c.prototype.toHex=function(){return n.encode(this.toBytes(),"hex").toUpperCase()},e.exports=c},37:e=>{e.exports={doubles:{step:4,points:[["e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a","f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821"],["8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508","11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf"],["175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739","d3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695"],["363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640","4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9"],["8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c","4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36"],["723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda","96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f"],["eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa","5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999"],["100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0","cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09"],["e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d","9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d"],["feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d","e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088"],["da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1","9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d"],["53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0","5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8"],["8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047","10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a"],["385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862","283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453"],["6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7","7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160"],["3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd","56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0"],["85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83","7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6"],["948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a","53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589"],["6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8","bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17"],["e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d","4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda"],["e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725","7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd"],["213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754","4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2"],["4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c","17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6"],["fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6","6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f"],["76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39","c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01"],["c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891","893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3"],["d895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b","febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f"],["b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03","2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7"],["e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d","eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78"],["a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070","7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1"],["90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4","e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150"],["8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da","662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82"],["e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11","1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc"],["8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e","efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b"],["e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41","2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51"],["b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef","67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45"],["d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8","db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120"],["324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d","648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84"],["4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96","35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d"],["9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd","ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d"],["6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5","9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8"],["a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266","40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8"],["7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71","34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac"],["928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac","c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f"],["85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751","1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962"],["ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e","493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907"],["827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241","c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec"],["eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3","be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d"],["e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f","4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414"],["1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19","aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd"],["146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be","b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0"],["fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9","6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811"],["da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2","8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1"],["a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13","7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c"],["174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c","ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73"],["959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba","2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd"],["d2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151","e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405"],["64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073","d99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589"],["8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458","38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e"],["13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b","69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27"],["bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366","d3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1"],["8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa","40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482"],["8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0","620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945"],["dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787","7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573"],["f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e","ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82"]]},naf:{wnd:7,points:[["f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9","388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672"],["2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4","d8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6"],["5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc","6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da"],["acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe","cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37"],["774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb","d984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b"],["f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8","ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81"],["d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e","581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58"],["defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34","4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77"],["2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c","85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a"],["352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5","321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c"],["2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f","2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67"],["9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714","73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402"],["daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729","a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55"],["c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db","2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482"],["6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4","e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82"],["1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5","b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396"],["605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479","2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49"],["62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d","80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf"],["80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f","1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a"],["7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb","d0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7"],["d528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9","eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933"],["49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963","758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a"],["77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74","958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6"],["f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530","e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37"],["463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b","5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e"],["f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247","cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6"],["caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1","cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476"],["2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120","4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40"],["7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435","91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61"],["754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18","673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683"],["e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8","59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5"],["186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb","3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b"],["df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f","55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417"],["5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143","efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868"],["290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba","e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a"],["af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45","f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6"],["766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a","744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996"],["59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e","c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e"],["f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8","e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d"],["7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c","30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2"],["948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519","e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e"],["7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab","100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437"],["3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca","ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311"],["d3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf","8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4"],["1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610","68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575"],["733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4","f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d"],["15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c","d56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d"],["a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940","edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629"],["e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980","a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06"],["311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3","66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374"],["34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf","9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee"],["f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63","4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1"],["d7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448","fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b"],["32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf","5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661"],["7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5","8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6"],["ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6","8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e"],["16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5","5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d"],["eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99","f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc"],["78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51","f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4"],["494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5","42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c"],["a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5","204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b"],["c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997","4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913"],["841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881","73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154"],["5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5","39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865"],["36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66","d2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc"],["336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726","ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224"],["8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede","6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e"],["1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94","60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6"],["85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31","3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511"],["29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51","b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b"],["a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252","ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2"],["4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5","cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c"],["d24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b","6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3"],["ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4","322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d"],["af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f","6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700"],["e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889","2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4"],["591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246","b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196"],["11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984","998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4"],["3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a","b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257"],["cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030","bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13"],["c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197","6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096"],["c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593","c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38"],["a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef","21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f"],["347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38","60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448"],["da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a","49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a"],["c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111","5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4"],["4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502","7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437"],["3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea","be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7"],["cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26","8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d"],["b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986","39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a"],["d4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e","62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54"],["48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4","25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77"],["dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda","ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517"],["6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859","cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10"],["e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f","f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125"],["eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c","6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e"],["13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942","fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1"],["ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a","1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2"],["b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80","5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423"],["ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d","438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8"],["8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1","cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758"],["52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63","c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375"],["e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352","6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d"],["7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193","ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec"],["5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00","9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0"],["32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58","ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c"],["e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7","d3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4"],["8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8","c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f"],["4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e","67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649"],["3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d","cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826"],["674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b","299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5"],["d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f","f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87"],["30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6","462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b"],["be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297","62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc"],["93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a","7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c"],["b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c","ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f"],["d5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52","4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a"],["d3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb","bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46"],["463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065","bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f"],["7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917","603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03"],["74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9","cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08"],["30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3","553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8"],["9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57","712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373"],["176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66","ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3"],["75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8","9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8"],["809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721","9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1"],["1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180","4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9"]]}}},953:(e,t,r)=>{"use strict";var i=t,n=r(785),o=r(746),s=r(504);i.assert=o,i.toArray=s.toArray,i.zero2=s.zero2,i.toHex=s.toHex,i.encode=s.encode,i.getNAF=function(e,t,r){var i=new Array(Math.max(e.bitLength(),r)+1);i.fill(0);for(var n=1<<t+1,o=e.clone(),s=0;s<i.length;s++){var a,c=o.andln(n-1);o.isOdd()?(a=c>(n>>1)-1?(n>>1)-c:c,o.isubn(a)):a=0,i[s]=a,o.iushrn(1)}return i},i.getJSF=function(e,t){var r=[[],[]];e=e.clone(),t=t.clone();for(var i,n=0,o=0;e.cmpn(-n)>0||t.cmpn(-o)>0;){var s,a,c=e.andln(3)+n&3,u=t.andln(3)+o&3;3===c&&(c=-1),3===u&&(u=-1),s=1&c?3!=(i=e.andln(7)+n&7)&&5!==i||2!==u?c:-c:0,r[0].push(s),a=1&u?3!=(i=t.andln(7)+o&7)&&5!==i||2!==c?u:-u:0,r[1].push(a),2*n===s+1&&(n=1-n),2*o===a+1&&(o=1-o),e.iushrn(1),t.iushrn(1)}return r},i.cachedProperty=function(e,t,r){var i="_"+t;e.prototype[t]=function(){return void 0!==this[i]?this[i]:this[i]=r.call(this)}},i.parseBytes=function(e){return"string"==typeof e?i.toArray(e,"hex"):e},i.intFromLE=function(e){return new n(e,"hex","le")}},785:function(e,t,r){!function(e,t){"use strict";function i(e,t){if(!e)throw new Error(t||"Assertion failed")}function n(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function o(e,t,r){if(o.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(r=t,t=10),this._init(e||0,t||10,r||"be"))}var s;"object"==typeof e?e.exports=o:t.BN=o,o.BN=o,o.wordSize=26;try{s="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:r(568).Buffer}catch(e){}function a(e,t){var r=e.charCodeAt(t);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function c(e,t,r){var i=a(e,r);return r-1>=t&&(i|=a(e,r-1)<<4),i}function u(e,t,r,i){for(var n=0,o=Math.min(e.length,r),s=t;s<o;s++){var a=e.charCodeAt(s)-48;n*=i,n+=a>=49?a-49+10:a>=17?a-17+10:a}return n}o.isBN=function(e){return e instanceof o||null!==e&&"object"==typeof e&&e.constructor.wordSize===o.wordSize&&Array.isArray(e.words)},o.max=function(e,t){return e.cmp(t)>0?e:t},o.min=function(e,t){return e.cmp(t)<0?e:t},o.prototype._init=function(e,t,r){if("number"==typeof e)return this._initNumber(e,t,r);if("object"==typeof e)return this._initArray(e,t,r);"hex"===t&&(t=16),i(t===(0|t)&&t>=2&&t<=36);var n=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(n++,this.negative=1),n<e.length&&(16===t?this._parseHex(e,n,r):(this._parseBase(e,t,n),"le"===r&&this._initArray(this.toArray(),t,r)))},o.prototype._initNumber=function(e,t,r){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[67108863&e],this.length=1):e<4503599627370496?(this.words=[67108863&e,e/67108864&67108863],this.length=2):(i(e<9007199254740992),this.words=[67108863&e,e/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),t,r)},o.prototype._initArray=function(e,t,r){if(i("number"==typeof e.length),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=new Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var o,s,a=0;if("be"===r)for(n=e.length-1,o=0;n>=0;n-=3)s=e[n]|e[n-1]<<8|e[n-2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);else if("le"===r)for(n=0,o=0;n<e.length;n+=3)s=e[n]|e[n+1]<<8|e[n+2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);return this.strip()},o.prototype._parseHex=function(e,t,r){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var i=0;i<this.length;i++)this.words[i]=0;var n,o=0,s=0;if("be"===r)for(i=e.length-1;i>=t;i-=2)n=c(e,t,i)<<o,this.words[s]|=67108863&n,o>=18?(o-=18,s+=1,this.words[s]|=n>>>26):o+=8;else for(i=(e.length-t)%2==0?t+1:t;i<e.length;i+=2)n=c(e,t,i)<<o,this.words[s]|=67108863&n,o>=18?(o-=18,s+=1,this.words[s]|=n>>>26):o+=8;this.strip()},o.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var i=0,n=1;n<=67108863;n*=t)i++;i--,n=n/t|0;for(var o=e.length-r,s=o%i,a=Math.min(o,o-s)+r,c=0,h=r;h<a;h+=i)c=u(e,h,h+i,t),this.imuln(n),this.words[0]+c<67108864?this.words[0]+=c:this._iaddn(c);if(0!==s){var d=1;for(c=u(e,h,e.length,t),h=0;h<s;h++)d*=t;this.imuln(d),this.words[0]+c<67108864?this.words[0]+=c:this._iaddn(c)}this.strip()},o.prototype.copy=function(e){e.words=new Array(this.length);for(var t=0;t<this.length;t++)e.words[t]=this.words[t];e.length=this.length,e.negative=this.negative,e.red=this.red},o.prototype.clone=function(){var e=new o(null);return this.copy(e),e},o.prototype._expand=function(e){for(;this.length<e;)this.words[this.length++]=0;return this},o.prototype.strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},o.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var h=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],d=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],l=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function p(e,t,r){r.negative=t.negative^e.negative;var i=e.length+t.length|0;r.length=i,i=i-1|0;var n=0|e.words[0],o=0|t.words[0],s=n*o,a=67108863&s,c=s/67108864|0;r.words[0]=a;for(var u=1;u<i;u++){for(var h=c>>>26,d=67108863&c,l=Math.min(u,t.length-1),p=Math.max(0,u-e.length+1);p<=l;p++){var f=u-p|0;h+=(s=(n=0|e.words[f])*(o=0|t.words[p])+d)/67108864|0,d=67108863&s}r.words[u]=0|d,c=0|h}return 0!==c?r.words[u]=0|c:r.length--,r.strip()}o.prototype.toString=function(e,t){var r;if(t=0|t||1,16===(e=e||10)||"hex"===e){r="";for(var n=0,o=0,s=0;s<this.length;s++){var a=this.words[s],c=(16777215&(a<<n|o)).toString(16);r=0!=(o=a>>>24-n&16777215)||s!==this.length-1?h[6-c.length]+c+r:c+r,(n+=2)>=26&&(n-=26,s--)}for(0!==o&&(r=o.toString(16)+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&e>=2&&e<=36){var u=d[e],p=l[e];r="";var f=this.clone();for(f.negative=0;!f.isZero();){var v=f.modn(p).toString(e);r=(f=f.idivn(p)).isZero()?v+r:h[u-v.length]+v+r}for(this.isZero()&&(r="0"+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}i(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&i(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(e,t){return i(void 0!==s),this.toArrayLike(s,e,t)},o.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},o.prototype.toArrayLike=function(e,t,r){var n=this.byteLength(),o=r||Math.max(1,n);i(n<=o,"byte array longer than desired length"),i(o>0,"Requested array length <= 0"),this.strip();var s,a,c="le"===t,u=new e(o),h=this.clone();if(c){for(a=0;!h.isZero();a++)s=h.andln(255),h.iushrn(8),u[a]=s;for(;a<o;a++)u[a]=0}else{for(a=0;a<o-n;a++)u[a]=0;for(a=0;!h.isZero();a++)s=h.andln(255),h.iushrn(8),u[o-a-1]=s}return u},Math.clz32?o.prototype._countBits=function(e){return 32-Math.clz32(e)}:o.prototype._countBits=function(e){var t=e,r=0;return t>=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},o.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return!(8191&t)&&(r+=13,t>>>=13),!(127&t)&&(r+=7,t>>>=7),!(15&t)&&(r+=4,t>>>=4),!(3&t)&&(r+=2,t>>>=2),!(1&t)&&r++,r},o.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;t<this.length;t++){var r=this._zeroBits(this.words[t]);if(e+=r,26!==r)break}return e},o.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},o.prototype.toTwos=function(e){return 0!==this.negative?this.abs().inotn(e).iaddn(1):this.clone()},o.prototype.fromTwos=function(e){return this.testn(e-1)?this.notn(e).iaddn(1).ineg():this.clone()},o.prototype.isNeg=function(){return 0!==this.negative},o.prototype.neg=function(){return this.clone().ineg()},o.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},o.prototype.iuor=function(e){for(;this.length<e.length;)this.words[this.length++]=0;for(var t=0;t<e.length;t++)this.words[t]=this.words[t]|e.words[t];return this.strip()},o.prototype.ior=function(e){return i(0==(this.negative|e.negative)),this.iuor(e)},o.prototype.or=function(e){return this.length>e.length?this.clone().ior(e):e.clone().ior(this)},o.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},o.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;r<t.length;r++)this.words[r]=this.words[r]&e.words[r];return this.length=t.length,this.strip()},o.prototype.iand=function(e){return i(0==(this.negative|e.negative)),this.iuand(e)},o.prototype.and=function(e){return this.length>e.length?this.clone().iand(e):e.clone().iand(this)},o.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},o.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var i=0;i<r.length;i++)this.words[i]=t.words[i]^r.words[i];if(this!==t)for(;i<t.length;i++)this.words[i]=t.words[i];return this.length=t.length,this.strip()},o.prototype.ixor=function(e){return i(0==(this.negative|e.negative)),this.iuxor(e)},o.prototype.xor=function(e){return this.length>e.length?this.clone().ixor(e):e.clone().ixor(this)},o.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},o.prototype.inotn=function(e){i("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),r>0&&t--;for(var n=0;n<t;n++)this.words[n]=67108863&~this.words[n];return r>0&&(this.words[n]=~this.words[n]&67108863>>26-r),this.strip()},o.prototype.notn=function(e){return this.clone().inotn(e)},o.prototype.setn=function(e,t){i("number"==typeof e&&e>=0);var r=e/26|0,n=e%26;return this._expand(r+1),this.words[r]=t?this.words[r]|1<<n:this.words[r]&~(1<<n),this.strip()},o.prototype.iadd=function(e){var t,r,i;if(0!==this.negative&&0===e.negative)return this.negative=0,t=this.isub(e),this.negative^=1,this._normSign();if(0===this.negative&&0!==e.negative)return e.negative=0,t=this.isub(e),e.negative=1,t._normSign();this.length>e.length?(r=this,i=e):(r=e,i=this);for(var n=0,o=0;o<i.length;o++)t=(0|r.words[o])+(0|i.words[o])+n,this.words[o]=67108863&t,n=t>>>26;for(;0!==n&&o<r.length;o++)t=(0|r.words[o])+n,this.words[o]=67108863&t,n=t>>>26;if(this.length=r.length,0!==n)this.words[this.length]=n,this.length++;else if(r!==this)for(;o<r.length;o++)this.words[o]=r.words[o];return this},o.prototype.add=function(e){var t;return 0!==e.negative&&0===this.negative?(e.negative=0,t=this.sub(e),e.negative^=1,t):0===e.negative&&0!==this.negative?(this.negative=0,t=e.sub(this),this.negative=1,t):this.length>e.length?this.clone().iadd(e):e.clone().iadd(this)},o.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var r,i,n=this.cmp(e);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(r=this,i=e):(r=e,i=this);for(var o=0,s=0;s<i.length;s++)o=(t=(0|r.words[s])-(0|i.words[s])+o)>>26,this.words[s]=67108863&t;for(;0!==o&&s<r.length;s++)o=(t=(0|r.words[s])+o)>>26,this.words[s]=67108863&t;if(0===o&&s<r.length&&r!==this)for(;s<r.length;s++)this.words[s]=r.words[s];return this.length=Math.max(this.length,s),r!==this&&(this.negative=1),this.strip()},o.prototype.sub=function(e){return this.clone().isub(e)};var f=function(e,t,r){var i,n,o,s=e.words,a=t.words,c=r.words,u=0,h=0|s[0],d=8191&h,l=h>>>13,p=0|s[1],f=8191&p,v=p>>>13,g=0|s[2],m=8191&g,y=g>>>13,b=0|s[3],S=8191&b,C=b>>>13,w=0|s[4],P=8191&w,A=w>>>13,I=0|s[5],R=8191&I,E=I>>>13,T=0|s[6],M=8191&T,k=T>>>13,O=0|s[7],_=8191&O,x=O>>>13,N=0|s[8],D=8191&N,z=N>>>13,L=0|s[9],B=8191&L,F=L>>>13,j=0|a[0],U=8191&j,q=j>>>13,W=0|a[1],K=8191&W,H=W>>>13,V=0|a[2],G=8191&V,J=V>>>13,$=0|a[3],Q=8191&$,Y=$>>>13,X=0|a[4],Z=8191&X,ee=X>>>13,te=0|a[5],re=8191&te,ie=te>>>13,ne=0|a[6],oe=8191&ne,se=ne>>>13,ae=0|a[7],ce=8191&ae,ue=ae>>>13,he=0|a[8],de=8191&he,le=he>>>13,pe=0|a[9],fe=8191&pe,ve=pe>>>13;r.negative=e.negative^t.negative,r.length=19;var ge=(u+(i=Math.imul(d,U))|0)+((8191&(n=(n=Math.imul(d,q))+Math.imul(l,U)|0))<<13)|0;u=((o=Math.imul(l,q))+(n>>>13)|0)+(ge>>>26)|0,ge&=67108863,i=Math.imul(f,U),n=(n=Math.imul(f,q))+Math.imul(v,U)|0,o=Math.imul(v,q);var me=(u+(i=i+Math.imul(d,K)|0)|0)+((8191&(n=(n=n+Math.imul(d,H)|0)+Math.imul(l,K)|0))<<13)|0;u=((o=o+Math.imul(l,H)|0)+(n>>>13)|0)+(me>>>26)|0,me&=67108863,i=Math.imul(m,U),n=(n=Math.imul(m,q))+Math.imul(y,U)|0,o=Math.imul(y,q),i=i+Math.imul(f,K)|0,n=(n=n+Math.imul(f,H)|0)+Math.imul(v,K)|0,o=o+Math.imul(v,H)|0;var ye=(u+(i=i+Math.imul(d,G)|0)|0)+((8191&(n=(n=n+Math.imul(d,J)|0)+Math.imul(l,G)|0))<<13)|0;u=((o=o+Math.imul(l,J)|0)+(n>>>13)|0)+(ye>>>26)|0,ye&=67108863,i=Math.imul(S,U),n=(n=Math.imul(S,q))+Math.imul(C,U)|0,o=Math.imul(C,q),i=i+Math.imul(m,K)|0,n=(n=n+Math.imul(m,H)|0)+Math.imul(y,K)|0,o=o+Math.imul(y,H)|0,i=i+Math.imul(f,G)|0,n=(n=n+Math.imul(f,J)|0)+Math.imul(v,G)|0,o=o+Math.imul(v,J)|0;var be=(u+(i=i+Math.imul(d,Q)|0)|0)+((8191&(n=(n=n+Math.imul(d,Y)|0)+Math.imul(l,Q)|0))<<13)|0;u=((o=o+Math.imul(l,Y)|0)+(n>>>13)|0)+(be>>>26)|0,be&=67108863,i=Math.imul(P,U),n=(n=Math.imul(P,q))+Math.imul(A,U)|0,o=Math.imul(A,q),i=i+Math.imul(S,K)|0,n=(n=n+Math.imul(S,H)|0)+Math.imul(C,K)|0,o=o+Math.imul(C,H)|0,i=i+Math.imul(m,G)|0,n=(n=n+Math.imul(m,J)|0)+Math.imul(y,G)|0,o=o+Math.imul(y,J)|0,i=i+Math.imul(f,Q)|0,n=(n=n+Math.imul(f,Y)|0)+Math.imul(v,Q)|0,o=o+Math.imul(v,Y)|0;var Se=(u+(i=i+Math.imul(d,Z)|0)|0)+((8191&(n=(n=n+Math.imul(d,ee)|0)+Math.imul(l,Z)|0))<<13)|0;u=((o=o+Math.imul(l,ee)|0)+(n>>>13)|0)+(Se>>>26)|0,Se&=67108863,i=Math.imul(R,U),n=(n=Math.imul(R,q))+Math.imul(E,U)|0,o=Math.imul(E,q),i=i+Math.imul(P,K)|0,n=(n=n+Math.imul(P,H)|0)+Math.imul(A,K)|0,o=o+Math.imul(A,H)|0,i=i+Math.imul(S,G)|0,n=(n=n+Math.imul(S,J)|0)+Math.imul(C,G)|0,o=o+Math.imul(C,J)|0,i=i+Math.imul(m,Q)|0,n=(n=n+Math.imul(m,Y)|0)+Math.imul(y,Q)|0,o=o+Math.imul(y,Y)|0,i=i+Math.imul(f,Z)|0,n=(n=n+Math.imul(f,ee)|0)+Math.imul(v,Z)|0,o=o+Math.imul(v,ee)|0;var Ce=(u+(i=i+Math.imul(d,re)|0)|0)+((8191&(n=(n=n+Math.imul(d,ie)|0)+Math.imul(l,re)|0))<<13)|0;u=((o=o+Math.imul(l,ie)|0)+(n>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,i=Math.imul(M,U),n=(n=Math.imul(M,q))+Math.imul(k,U)|0,o=Math.imul(k,q),i=i+Math.imul(R,K)|0,n=(n=n+Math.imul(R,H)|0)+Math.imul(E,K)|0,o=o+Math.imul(E,H)|0,i=i+Math.imul(P,G)|0,n=(n=n+Math.imul(P,J)|0)+Math.imul(A,G)|0,o=o+Math.imul(A,J)|0,i=i+Math.imul(S,Q)|0,n=(n=n+Math.imul(S,Y)|0)+Math.imul(C,Q)|0,o=o+Math.imul(C,Y)|0,i=i+Math.imul(m,Z)|0,n=(n=n+Math.imul(m,ee)|0)+Math.imul(y,Z)|0,o=o+Math.imul(y,ee)|0,i=i+Math.imul(f,re)|0,n=(n=n+Math.imul(f,ie)|0)+Math.imul(v,re)|0,o=o+Math.imul(v,ie)|0;var we=(u+(i=i+Math.imul(d,oe)|0)|0)+((8191&(n=(n=n+Math.imul(d,se)|0)+Math.imul(l,oe)|0))<<13)|0;u=((o=o+Math.imul(l,se)|0)+(n>>>13)|0)+(we>>>26)|0,we&=67108863,i=Math.imul(_,U),n=(n=Math.imul(_,q))+Math.imul(x,U)|0,o=Math.imul(x,q),i=i+Math.imul(M,K)|0,n=(n=n+Math.imul(M,H)|0)+Math.imul(k,K)|0,o=o+Math.imul(k,H)|0,i=i+Math.imul(R,G)|0,n=(n=n+Math.imul(R,J)|0)+Math.imul(E,G)|0,o=o+Math.imul(E,J)|0,i=i+Math.imul(P,Q)|0,n=(n=n+Math.imul(P,Y)|0)+Math.imul(A,Q)|0,o=o+Math.imul(A,Y)|0,i=i+Math.imul(S,Z)|0,n=(n=n+Math.imul(S,ee)|0)+Math.imul(C,Z)|0,o=o+Math.imul(C,ee)|0,i=i+Math.imul(m,re)|0,n=(n=n+Math.imul(m,ie)|0)+Math.imul(y,re)|0,o=o+Math.imul(y,ie)|0,i=i+Math.imul(f,oe)|0,n=(n=n+Math.imul(f,se)|0)+Math.imul(v,oe)|0,o=o+Math.imul(v,se)|0;var Pe=(u+(i=i+Math.imul(d,ce)|0)|0)+((8191&(n=(n=n+Math.imul(d,ue)|0)+Math.imul(l,ce)|0))<<13)|0;u=((o=o+Math.imul(l,ue)|0)+(n>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,i=Math.imul(D,U),n=(n=Math.imul(D,q))+Math.imul(z,U)|0,o=Math.imul(z,q),i=i+Math.imul(_,K)|0,n=(n=n+Math.imul(_,H)|0)+Math.imul(x,K)|0,o=o+Math.imul(x,H)|0,i=i+Math.imul(M,G)|0,n=(n=n+Math.imul(M,J)|0)+Math.imul(k,G)|0,o=o+Math.imul(k,J)|0,i=i+Math.imul(R,Q)|0,n=(n=n+Math.imul(R,Y)|0)+Math.imul(E,Q)|0,o=o+Math.imul(E,Y)|0,i=i+Math.imul(P,Z)|0,n=(n=n+Math.imul(P,ee)|0)+Math.imul(A,Z)|0,o=o+Math.imul(A,ee)|0,i=i+Math.imul(S,re)|0,n=(n=n+Math.imul(S,ie)|0)+Math.imul(C,re)|0,o=o+Math.imul(C,ie)|0,i=i+Math.imul(m,oe)|0,n=(n=n+Math.imul(m,se)|0)+Math.imul(y,oe)|0,o=o+Math.imul(y,se)|0,i=i+Math.imul(f,ce)|0,n=(n=n+Math.imul(f,ue)|0)+Math.imul(v,ce)|0,o=o+Math.imul(v,ue)|0;var Ae=(u+(i=i+Math.imul(d,de)|0)|0)+((8191&(n=(n=n+Math.imul(d,le)|0)+Math.imul(l,de)|0))<<13)|0;u=((o=o+Math.imul(l,le)|0)+(n>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,i=Math.imul(B,U),n=(n=Math.imul(B,q))+Math.imul(F,U)|0,o=Math.imul(F,q),i=i+Math.imul(D,K)|0,n=(n=n+Math.imul(D,H)|0)+Math.imul(z,K)|0,o=o+Math.imul(z,H)|0,i=i+Math.imul(_,G)|0,n=(n=n+Math.imul(_,J)|0)+Math.imul(x,G)|0,o=o+Math.imul(x,J)|0,i=i+Math.imul(M,Q)|0,n=(n=n+Math.imul(M,Y)|0)+Math.imul(k,Q)|0,o=o+Math.imul(k,Y)|0,i=i+Math.imul(R,Z)|0,n=(n=n+Math.imul(R,ee)|0)+Math.imul(E,Z)|0,o=o+Math.imul(E,ee)|0,i=i+Math.imul(P,re)|0,n=(n=n+Math.imul(P,ie)|0)+Math.imul(A,re)|0,o=o+Math.imul(A,ie)|0,i=i+Math.imul(S,oe)|0,n=(n=n+Math.imul(S,se)|0)+Math.imul(C,oe)|0,o=o+Math.imul(C,se)|0,i=i+Math.imul(m,ce)|0,n=(n=n+Math.imul(m,ue)|0)+Math.imul(y,ce)|0,o=o+Math.imul(y,ue)|0,i=i+Math.imul(f,de)|0,n=(n=n+Math.imul(f,le)|0)+Math.imul(v,de)|0,o=o+Math.imul(v,le)|0;var Ie=(u+(i=i+Math.imul(d,fe)|0)|0)+((8191&(n=(n=n+Math.imul(d,ve)|0)+Math.imul(l,fe)|0))<<13)|0;u=((o=o+Math.imul(l,ve)|0)+(n>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,i=Math.imul(B,K),n=(n=Math.imul(B,H))+Math.imul(F,K)|0,o=Math.imul(F,H),i=i+Math.imul(D,G)|0,n=(n=n+Math.imul(D,J)|0)+Math.imul(z,G)|0,o=o+Math.imul(z,J)|0,i=i+Math.imul(_,Q)|0,n=(n=n+Math.imul(_,Y)|0)+Math.imul(x,Q)|0,o=o+Math.imul(x,Y)|0,i=i+Math.imul(M,Z)|0,n=(n=n+Math.imul(M,ee)|0)+Math.imul(k,Z)|0,o=o+Math.imul(k,ee)|0,i=i+Math.imul(R,re)|0,n=(n=n+Math.imul(R,ie)|0)+Math.imul(E,re)|0,o=o+Math.imul(E,ie)|0,i=i+Math.imul(P,oe)|0,n=(n=n+Math.imul(P,se)|0)+Math.imul(A,oe)|0,o=o+Math.imul(A,se)|0,i=i+Math.imul(S,ce)|0,n=(n=n+Math.imul(S,ue)|0)+Math.imul(C,ce)|0,o=o+Math.imul(C,ue)|0,i=i+Math.imul(m,de)|0,n=(n=n+Math.imul(m,le)|0)+Math.imul(y,de)|0,o=o+Math.imul(y,le)|0;var Re=(u+(i=i+Math.imul(f,fe)|0)|0)+((8191&(n=(n=n+Math.imul(f,ve)|0)+Math.imul(v,fe)|0))<<13)|0;u=((o=o+Math.imul(v,ve)|0)+(n>>>13)|0)+(Re>>>26)|0,Re&=67108863,i=Math.imul(B,G),n=(n=Math.imul(B,J))+Math.imul(F,G)|0,o=Math.imul(F,J),i=i+Math.imul(D,Q)|0,n=(n=n+Math.imul(D,Y)|0)+Math.imul(z,Q)|0,o=o+Math.imul(z,Y)|0,i=i+Math.imul(_,Z)|0,n=(n=n+Math.imul(_,ee)|0)+Math.imul(x,Z)|0,o=o+Math.imul(x,ee)|0,i=i+Math.imul(M,re)|0,n=(n=n+Math.imul(M,ie)|0)+Math.imul(k,re)|0,o=o+Math.imul(k,ie)|0,i=i+Math.imul(R,oe)|0,n=(n=n+Math.imul(R,se)|0)+Math.imul(E,oe)|0,o=o+Math.imul(E,se)|0,i=i+Math.imul(P,ce)|0,n=(n=n+Math.imul(P,ue)|0)+Math.imul(A,ce)|0,o=o+Math.imul(A,ue)|0,i=i+Math.imul(S,de)|0,n=(n=n+Math.imul(S,le)|0)+Math.imul(C,de)|0,o=o+Math.imul(C,le)|0;var Ee=(u+(i=i+Math.imul(m,fe)|0)|0)+((8191&(n=(n=n+Math.imul(m,ve)|0)+Math.imul(y,fe)|0))<<13)|0;u=((o=o+Math.imul(y,ve)|0)+(n>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,i=Math.imul(B,Q),n=(n=Math.imul(B,Y))+Math.imul(F,Q)|0,o=Math.imul(F,Y),i=i+Math.imul(D,Z)|0,n=(n=n+Math.imul(D,ee)|0)+Math.imul(z,Z)|0,o=o+Math.imul(z,ee)|0,i=i+Math.imul(_,re)|0,n=(n=n+Math.imul(_,ie)|0)+Math.imul(x,re)|0,o=o+Math.imul(x,ie)|0,i=i+Math.imul(M,oe)|0,n=(n=n+Math.imul(M,se)|0)+Math.imul(k,oe)|0,o=o+Math.imul(k,se)|0,i=i+Math.imul(R,ce)|0,n=(n=n+Math.imul(R,ue)|0)+Math.imul(E,ce)|0,o=o+Math.imul(E,ue)|0,i=i+Math.imul(P,de)|0,n=(n=n+Math.imul(P,le)|0)+Math.imul(A,de)|0,o=o+Math.imul(A,le)|0;var Te=(u+(i=i+Math.imul(S,fe)|0)|0)+((8191&(n=(n=n+Math.imul(S,ve)|0)+Math.imul(C,fe)|0))<<13)|0;u=((o=o+Math.imul(C,ve)|0)+(n>>>13)|0)+(Te>>>26)|0,Te&=67108863,i=Math.imul(B,Z),n=(n=Math.imul(B,ee))+Math.imul(F,Z)|0,o=Math.imul(F,ee),i=i+Math.imul(D,re)|0,n=(n=n+Math.imul(D,ie)|0)+Math.imul(z,re)|0,o=o+Math.imul(z,ie)|0,i=i+Math.imul(_,oe)|0,n=(n=n+Math.imul(_,se)|0)+Math.imul(x,oe)|0,o=o+Math.imul(x,se)|0,i=i+Math.imul(M,ce)|0,n=(n=n+Math.imul(M,ue)|0)+Math.imul(k,ce)|0,o=o+Math.imul(k,ue)|0,i=i+Math.imul(R,de)|0,n=(n=n+Math.imul(R,le)|0)+Math.imul(E,de)|0,o=o+Math.imul(E,le)|0;var Me=(u+(i=i+Math.imul(P,fe)|0)|0)+((8191&(n=(n=n+Math.imul(P,ve)|0)+Math.imul(A,fe)|0))<<13)|0;u=((o=o+Math.imul(A,ve)|0)+(n>>>13)|0)+(Me>>>26)|0,Me&=67108863,i=Math.imul(B,re),n=(n=Math.imul(B,ie))+Math.imul(F,re)|0,o=Math.imul(F,ie),i=i+Math.imul(D,oe)|0,n=(n=n+Math.imul(D,se)|0)+Math.imul(z,oe)|0,o=o+Math.imul(z,se)|0,i=i+Math.imul(_,ce)|0,n=(n=n+Math.imul(_,ue)|0)+Math.imul(x,ce)|0,o=o+Math.imul(x,ue)|0,i=i+Math.imul(M,de)|0,n=(n=n+Math.imul(M,le)|0)+Math.imul(k,de)|0,o=o+Math.imul(k,le)|0;var ke=(u+(i=i+Math.imul(R,fe)|0)|0)+((8191&(n=(n=n+Math.imul(R,ve)|0)+Math.imul(E,fe)|0))<<13)|0;u=((o=o+Math.imul(E,ve)|0)+(n>>>13)|0)+(ke>>>26)|0,ke&=67108863,i=Math.imul(B,oe),n=(n=Math.imul(B,se))+Math.imul(F,oe)|0,o=Math.imul(F,se),i=i+Math.imul(D,ce)|0,n=(n=n+Math.imul(D,ue)|0)+Math.imul(z,ce)|0,o=o+Math.imul(z,ue)|0,i=i+Math.imul(_,de)|0,n=(n=n+Math.imul(_,le)|0)+Math.imul(x,de)|0,o=o+Math.imul(x,le)|0;var Oe=(u+(i=i+Math.imul(M,fe)|0)|0)+((8191&(n=(n=n+Math.imul(M,ve)|0)+Math.imul(k,fe)|0))<<13)|0;u=((o=o+Math.imul(k,ve)|0)+(n>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,i=Math.imul(B,ce),n=(n=Math.imul(B,ue))+Math.imul(F,ce)|0,o=Math.imul(F,ue),i=i+Math.imul(D,de)|0,n=(n=n+Math.imul(D,le)|0)+Math.imul(z,de)|0,o=o+Math.imul(z,le)|0;var _e=(u+(i=i+Math.imul(_,fe)|0)|0)+((8191&(n=(n=n+Math.imul(_,ve)|0)+Math.imul(x,fe)|0))<<13)|0;u=((o=o+Math.imul(x,ve)|0)+(n>>>13)|0)+(_e>>>26)|0,_e&=67108863,i=Math.imul(B,de),n=(n=Math.imul(B,le))+Math.imul(F,de)|0,o=Math.imul(F,le);var xe=(u+(i=i+Math.imul(D,fe)|0)|0)+((8191&(n=(n=n+Math.imul(D,ve)|0)+Math.imul(z,fe)|0))<<13)|0;u=((o=o+Math.imul(z,ve)|0)+(n>>>13)|0)+(xe>>>26)|0,xe&=67108863;var Ne=(u+(i=Math.imul(B,fe))|0)+((8191&(n=(n=Math.imul(B,ve))+Math.imul(F,fe)|0))<<13)|0;return u=((o=Math.imul(F,ve))+(n>>>13)|0)+(Ne>>>26)|0,Ne&=67108863,c[0]=ge,c[1]=me,c[2]=ye,c[3]=be,c[4]=Se,c[5]=Ce,c[6]=we,c[7]=Pe,c[8]=Ae,c[9]=Ie,c[10]=Re,c[11]=Ee,c[12]=Te,c[13]=Me,c[14]=ke,c[15]=Oe,c[16]=_e,c[17]=xe,c[18]=Ne,0!==u&&(c[19]=u,r.length++),r};function v(e,t,r){return(new g).mulp(e,t,r)}function g(e,t){this.x=e,this.y=t}Math.imul||(f=p),o.prototype.mulTo=function(e,t){var r,i=this.length+e.length;return r=10===this.length&&10===e.length?f(this,e,t):i<63?p(this,e,t):i<1024?function(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var i=0,n=0,o=0;o<r.length-1;o++){var s=n;n=0;for(var a=67108863&i,c=Math.min(o,t.length-1),u=Math.max(0,o-e.length+1);u<=c;u++){var h=o-u,d=(0|e.words[h])*(0|t.words[u]),l=67108863&d;a=67108863&(l=l+a|0),n+=(s=(s=s+(d/67108864|0)|0)+(l>>>26)|0)>>>26,s&=67108863}r.words[o]=a,i=s,s=n}return 0!==i?r.words[o]=i:r.length--,r.strip()}(this,e,t):v(this,e,t),r},g.prototype.makeRBT=function(e){for(var t=new Array(e),r=o.prototype._countBits(e)-1,i=0;i<e;i++)t[i]=this.revBin(i,r,e);return t},g.prototype.revBin=function(e,t,r){if(0===e||e===r-1)return e;for(var i=0,n=0;n<t;n++)i|=(1&e)<<t-n-1,e>>=1;return i},g.prototype.permute=function(e,t,r,i,n,o){for(var s=0;s<o;s++)i[s]=t[e[s]],n[s]=r[e[s]]},g.prototype.transform=function(e,t,r,i,n,o){this.permute(o,e,t,r,i,n);for(var s=1;s<n;s<<=1)for(var a=s<<1,c=Math.cos(2*Math.PI/a),u=Math.sin(2*Math.PI/a),h=0;h<n;h+=a)for(var d=c,l=u,p=0;p<s;p++){var f=r[h+p],v=i[h+p],g=r[h+p+s],m=i[h+p+s],y=d*g-l*m;m=d*m+l*g,g=y,r[h+p]=f+g,i[h+p]=v+m,r[h+p+s]=f-g,i[h+p+s]=v-m,p!==a&&(y=c*d-u*l,l=c*l+u*d,d=y)}},g.prototype.guessLen13b=function(e,t){var r=1|Math.max(t,e),i=1&r,n=0;for(r=r/2|0;r;r>>>=1)n++;return 1<<n+1+i},g.prototype.conjugate=function(e,t,r){if(!(r<=1))for(var i=0;i<r/2;i++){var n=e[i];e[i]=e[r-i-1],e[r-i-1]=n,n=t[i],t[i]=-t[r-i-1],t[r-i-1]=-n}},g.prototype.normalize13b=function(e,t){for(var r=0,i=0;i<t/2;i++){var n=8192*Math.round(e[2*i+1]/t)+Math.round(e[2*i]/t)+r;e[i]=67108863&n,r=n<67108864?0:n/67108864|0}return e},g.prototype.convert13b=function(e,t,r,n){for(var o=0,s=0;s<t;s++)o+=0|e[s],r[2*s]=8191&o,o>>>=13,r[2*s+1]=8191&o,o>>>=13;for(s=2*t;s<n;++s)r[s]=0;i(0===o),i(!(-8192&o))},g.prototype.stub=function(e){for(var t=new Array(e),r=0;r<e;r++)t[r]=0;return t},g.prototype.mulp=function(e,t,r){var i=2*this.guessLen13b(e.length,t.length),n=this.makeRBT(i),o=this.stub(i),s=new Array(i),a=new Array(i),c=new Array(i),u=new Array(i),h=new Array(i),d=new Array(i),l=r.words;l.length=i,this.convert13b(e.words,e.length,s,i),this.convert13b(t.words,t.length,u,i),this.transform(s,o,a,c,i,n),this.transform(u,o,h,d,i,n);for(var p=0;p<i;p++){var f=a[p]*h[p]-c[p]*d[p];c[p]=a[p]*d[p]+c[p]*h[p],a[p]=f}return this.conjugate(a,c,i),this.transform(a,c,l,o,i,n),this.conjugate(l,o,i),this.normalize13b(l,i),r.negative=e.negative^t.negative,r.length=e.length+t.length,r.strip()},o.prototype.mul=function(e){var t=new o(null);return t.words=new Array(this.length+e.length),this.mulTo(e,t)},o.prototype.mulf=function(e){var t=new o(null);return t.words=new Array(this.length+e.length),v(this,e,t)},o.prototype.imul=function(e){return this.clone().mulTo(e,this)},o.prototype.imuln=function(e){i("number"==typeof e),i(e<67108864);for(var t=0,r=0;r<this.length;r++){var n=(0|this.words[r])*e,o=(67108863&n)+(67108863&t);t>>=26,t+=n/67108864|0,t+=o>>>26,this.words[r]=67108863&o}return 0!==t&&(this.words[r]=t,this.length++),this},o.prototype.muln=function(e){return this.clone().imuln(e)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),r=0;r<t.length;r++){var i=r/26|0,n=r%26;t[r]=(e.words[i]&1<<n)>>>n}return t}(e);if(0===t.length)return new o(1);for(var r=this,i=0;i<t.length&&0===t[i];i++,r=r.sqr());if(++i<t.length)for(var n=r.sqr();i<t.length;i++,n=n.sqr())0!==t[i]&&(r=r.mul(n));return r},o.prototype.iushln=function(e){i("number"==typeof e&&e>=0);var t,r=e%26,n=(e-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var s=0;for(t=0;t<this.length;t++){var a=this.words[t]&o,c=(0|this.words[t])-a<<r;this.words[t]=c|s,s=a>>>26-r}s&&(this.words[t]=s,this.length++)}if(0!==n){for(t=this.length-1;t>=0;t--)this.words[t+n]=this.words[t];for(t=0;t<n;t++)this.words[t]=0;this.length+=n}return this.strip()},o.prototype.ishln=function(e){return i(0===this.negative),this.iushln(e)},o.prototype.iushrn=function(e,t,r){var n;i("number"==typeof e&&e>=0),n=t?(t-t%26)/26:0;var o=e%26,s=Math.min((e-o)/26,this.length),a=67108863^67108863>>>o<<o,c=r;if(n-=s,n=Math.max(0,n),c){for(var u=0;u<s;u++)c.words[u]=this.words[u];c.length=s}if(0===s);else if(this.length>s)for(this.length-=s,u=0;u<this.length;u++)this.words[u]=this.words[u+s];else this.words[0]=0,this.length=1;var h=0;for(u=this.length-1;u>=0&&(0!==h||u>=n);u--){var d=0|this.words[u];this.words[u]=h<<26-o|d>>>o,h=d&a}return c&&0!==h&&(c.words[c.length++]=h),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(e,t,r){return i(0===this.negative),this.iushrn(e,t,r)},o.prototype.shln=function(e){return this.clone().ishln(e)},o.prototype.ushln=function(e){return this.clone().iushln(e)},o.prototype.shrn=function(e){return this.clone().ishrn(e)},o.prototype.ushrn=function(e){return this.clone().iushrn(e)},o.prototype.testn=function(e){i("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26,n=1<<t;return!(this.length<=r||!(this.words[r]&n))},o.prototype.imaskn=function(e){i("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26;if(i(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==t&&r++,this.length=Math.min(r,this.length),0!==t){var n=67108863^67108863>>>t<<t;this.words[this.length-1]&=n}return this.strip()},o.prototype.maskn=function(e){return this.clone().imaskn(e)},o.prototype.iaddn=function(e){return i("number"==typeof e),i(e<67108864),e<0?this.isubn(-e):0!==this.negative?1===this.length&&(0|this.words[0])<e?(this.words[0]=e-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(e),this.negative=1,this):this._iaddn(e)},o.prototype._iaddn=function(e){this.words[0]+=e;for(var t=0;t<this.length&&this.words[t]>=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},o.prototype.isubn=function(e){if(i("number"==typeof e),i(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t<this.length&&this.words[t]<0;t++)this.words[t]+=67108864,this.words[t+1]-=1;return this.strip()},o.prototype.addn=function(e){return this.clone().iaddn(e)},o.prototype.subn=function(e){return this.clone().isubn(e)},o.prototype.iabs=function(){return this.negative=0,this},o.prototype.abs=function(){return this.clone().iabs()},o.prototype._ishlnsubmul=function(e,t,r){var n,o,s=e.length+r;this._expand(s);var a=0;for(n=0;n<e.length;n++){o=(0|this.words[n+r])+a;var c=(0|e.words[n])*t;a=((o-=67108863&c)>>26)-(c/67108864|0),this.words[n+r]=67108863&o}for(;n<this.length-r;n++)a=(o=(0|this.words[n+r])+a)>>26,this.words[n+r]=67108863&o;if(0===a)return this.strip();for(i(-1===a),a=0,n=0;n<this.length;n++)a=(o=-(0|this.words[n])+a)>>26,this.words[n]=67108863&o;return this.negative=1,this.strip()},o.prototype._wordDiv=function(e,t){var r=(this.length,e.length),i=this.clone(),n=e,s=0|n.words[n.length-1];0!=(r=26-this._countBits(s))&&(n=n.ushln(r),i.iushln(r),s=0|n.words[n.length-1]);var a,c=i.length-n.length;if("mod"!==t){(a=new o(null)).length=c+1,a.words=new Array(a.length);for(var u=0;u<a.length;u++)a.words[u]=0}var h=i.clone()._ishlnsubmul(n,1,c);0===h.negative&&(i=h,a&&(a.words[c]=1));for(var d=c-1;d>=0;d--){var l=67108864*(0|i.words[n.length+d])+(0|i.words[n.length+d-1]);for(l=Math.min(l/s|0,67108863),i._ishlnsubmul(n,l,d);0!==i.negative;)l--,i.negative=0,i._ishlnsubmul(n,1,d),i.isZero()||(i.negative^=1);a&&(a.words[d]=l)}return a&&a.strip(),i.strip(),"div"!==t&&0!==r&&i.iushrn(r),{div:a||null,mod:i}},o.prototype.divmod=function(e,t,r){return i(!e.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===e.negative?(a=this.neg().divmod(e,t),"mod"!==t&&(n=a.div.neg()),"div"!==t&&(s=a.mod.neg(),r&&0!==s.negative&&s.iadd(e)),{div:n,mod:s}):0===this.negative&&0!==e.negative?(a=this.divmod(e.neg(),t),"mod"!==t&&(n=a.div.neg()),{div:n,mod:a.mod}):0!=(this.negative&e.negative)?(a=this.neg().divmod(e.neg(),t),"div"!==t&&(s=a.mod.neg(),r&&0!==s.negative&&s.isub(e)),{div:a.div,mod:s}):e.length>this.length||this.cmp(e)<0?{div:new o(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new o(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new o(this.modn(e.words[0]))}:this._wordDiv(e,t);var n,s,a},o.prototype.div=function(e){return this.divmod(e,"div",!1).div},o.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},o.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},o.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,i=e.ushrn(1),n=e.andln(1),o=r.cmp(i);return o<0||1===n&&0===o?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},o.prototype.modn=function(e){i(e<=67108863);for(var t=(1<<26)%e,r=0,n=this.length-1;n>=0;n--)r=(t*r+(0|this.words[n]))%e;return r},o.prototype.idivn=function(e){i(e<=67108863);for(var t=0,r=this.length-1;r>=0;r--){var n=(0|this.words[r])+67108864*t;this.words[r]=n/e|0,t=n%e}return this.strip()},o.prototype.divn=function(e){return this.clone().idivn(e)},o.prototype.egcd=function(e){i(0===e.negative),i(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var n=new o(1),s=new o(0),a=new o(0),c=new o(1),u=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++u;for(var h=r.clone(),d=t.clone();!t.isZero();){for(var l=0,p=1;0==(t.words[0]&p)&&l<26;++l,p<<=1);if(l>0)for(t.iushrn(l);l-- >0;)(n.isOdd()||s.isOdd())&&(n.iadd(h),s.isub(d)),n.iushrn(1),s.iushrn(1);for(var f=0,v=1;0==(r.words[0]&v)&&f<26;++f,v<<=1);if(f>0)for(r.iushrn(f);f-- >0;)(a.isOdd()||c.isOdd())&&(a.iadd(h),c.isub(d)),a.iushrn(1),c.iushrn(1);t.cmp(r)>=0?(t.isub(r),n.isub(a),s.isub(c)):(r.isub(t),a.isub(n),c.isub(s))}return{a,b:c,gcd:r.iushln(u)}},o.prototype._invmp=function(e){i(0===e.negative),i(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var n,s=new o(1),a=new o(0),c=r.clone();t.cmpn(1)>0&&r.cmpn(1)>0;){for(var u=0,h=1;0==(t.words[0]&h)&&u<26;++u,h<<=1);if(u>0)for(t.iushrn(u);u-- >0;)s.isOdd()&&s.iadd(c),s.iushrn(1);for(var d=0,l=1;0==(r.words[0]&l)&&d<26;++d,l<<=1);if(d>0)for(r.iushrn(d);d-- >0;)a.isOdd()&&a.iadd(c),a.iushrn(1);t.cmp(r)>=0?(t.isub(r),s.isub(a)):(r.isub(t),a.isub(s))}return(n=0===t.cmpn(1)?s:a).cmpn(0)<0&&n.iadd(e),n},o.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var i=0;t.isEven()&&r.isEven();i++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var n=t.cmp(r);if(n<0){var o=t;t=r,r=o}else if(0===n||0===r.cmpn(1))break;t.isub(r)}return r.iushln(i)},o.prototype.invm=function(e){return this.egcd(e).a.umod(e)},o.prototype.isEven=function(){return!(1&this.words[0])},o.prototype.isOdd=function(){return!(1&~this.words[0])},o.prototype.andln=function(e){return this.words[0]&e},o.prototype.bincn=function(e){i("number"==typeof e);var t=e%26,r=(e-t)/26,n=1<<t;if(this.length<=r)return this._expand(r+1),this.words[r]|=n,this;for(var o=n,s=r;0!==o&&s<this.length;s++){var a=0|this.words[s];o=(a+=o)>>>26,a&=67108863,this.words[s]=a}return 0!==o&&(this.words[s]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(e){var t,r=e<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)t=1;else{r&&(e=-e),i(e<=67108863,"Number is too big");var n=0|this.words[0];t=n===e?0:n<e?-1:1}return 0!==this.negative?0|-t:t},o.prototype.cmp=function(e){if(0!==this.negative&&0===e.negative)return-1;if(0===this.negative&&0!==e.negative)return 1;var t=this.ucmp(e);return 0!==this.negative?0|-t:t},o.prototype.ucmp=function(e){if(this.length>e.length)return 1;if(this.length<e.length)return-1;for(var t=0,r=this.length-1;r>=0;r--){var i=0|this.words[r],n=0|e.words[r];if(i!==n){i<n?t=-1:i>n&&(t=1);break}}return t},o.prototype.gtn=function(e){return 1===this.cmpn(e)},o.prototype.gt=function(e){return 1===this.cmp(e)},o.prototype.gten=function(e){return this.cmpn(e)>=0},o.prototype.gte=function(e){return this.cmp(e)>=0},o.prototype.ltn=function(e){return-1===this.cmpn(e)},o.prototype.lt=function(e){return-1===this.cmp(e)},o.prototype.lten=function(e){return this.cmpn(e)<=0},o.prototype.lte=function(e){return this.cmp(e)<=0},o.prototype.eqn=function(e){return 0===this.cmpn(e)},o.prototype.eq=function(e){return 0===this.cmp(e)},o.red=function(e){return new P(e)},o.prototype.toRed=function(e){return i(!this.red,"Already a number in reduction context"),i(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},o.prototype.fromRed=function(){return i(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(e){return this.red=e,this},o.prototype.forceRed=function(e){return i(!this.red,"Already a number in reduction context"),this._forceRed(e)},o.prototype.redAdd=function(e){return i(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},o.prototype.redIAdd=function(e){return i(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},o.prototype.redSub=function(e){return i(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},o.prototype.redISub=function(e){return i(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},o.prototype.redShl=function(e){return i(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},o.prototype.redMul=function(e){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},o.prototype.redIMul=function(e){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},o.prototype.redSqr=function(){return i(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return i(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return i(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return i(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return i(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(e){return i(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var m={k256:null,p224:null,p192:null,p25519:null};function y(e,t){this.name=e,this.p=new o(t,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function b(){y.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function S(){y.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function C(){y.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function w(){y.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function P(e){if("string"==typeof e){var t=o._prime(e);this.m=t.p,this.prime=t}else i(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function A(e){P.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}y.prototype._tmp=function(){var e=new o(null);return e.words=new Array(Math.ceil(this.n/13)),e},y.prototype.ireduce=function(e){var t,r=e;do{this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(t>this.n);var i=t<this.n?-1:r.ucmp(this.p);return 0===i?(r.words[0]=0,r.length=1):i>0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},y.prototype.split=function(e,t){e.iushrn(this.n,0,t)},y.prototype.imulK=function(e){return e.imul(this.k)},n(b,y),b.prototype.split=function(e,t){for(var r=4194303,i=Math.min(e.length,9),n=0;n<i;n++)t.words[n]=e.words[n];if(t.length=i,e.length<=9)return e.words[0]=0,void(e.length=1);var o=e.words[9];for(t.words[t.length++]=o&r,n=10;n<e.length;n++){var s=0|e.words[n];e.words[n-10]=(s&r)<<4|o>>>22,o=s}o>>>=22,e.words[n-10]=o,0===o&&e.length>10?e.length-=10:e.length-=9},b.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,r=0;r<e.length;r++){var i=0|e.words[r];t+=977*i,e.words[r]=67108863&t,t=64*i+(t/67108864|0)}return 0===e.words[e.length-1]&&(e.length--,0===e.words[e.length-1]&&e.length--),e},n(S,y),n(C,y),n(w,y),w.prototype.imulK=function(e){for(var t=0,r=0;r<e.length;r++){var i=19*(0|e.words[r])+t,n=67108863&i;i>>>=26,e.words[r]=n,t=i}return 0!==t&&(e.words[e.length++]=t),e},o._prime=function(e){if(m[e])return m[e];var t;if("k256"===e)t=new b;else if("p224"===e)t=new S;else if("p192"===e)t=new C;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new w}return m[e]=t,t},P.prototype._verify1=function(e){i(0===e.negative,"red works only with positives"),i(e.red,"red works only with red numbers")},P.prototype._verify2=function(e,t){i(0==(e.negative|t.negative),"red works only with positives"),i(e.red&&e.red===t.red,"red works only with red numbers")},P.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},P.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},P.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},P.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},P.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},P.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},P.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},P.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},P.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},P.prototype.isqr=function(e){return this.imul(e,e.clone())},P.prototype.sqr=function(e){return this.mul(e,e)},P.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(i(t%2==1),3===t){var r=this.m.add(new o(1)).iushrn(2);return this.pow(e,r)}for(var n=this.m.subn(1),s=0;!n.isZero()&&0===n.andln(1);)s++,n.iushrn(1);i(!n.isZero());var a=new o(1).toRed(this),c=a.redNeg(),u=this.m.subn(1).iushrn(1),h=this.m.bitLength();for(h=new o(2*h*h).toRed(this);0!==this.pow(h,u).cmp(c);)h.redIAdd(c);for(var d=this.pow(h,n),l=this.pow(e,n.addn(1).iushrn(1)),p=this.pow(e,n),f=s;0!==p.cmp(a);){for(var v=p,g=0;0!==v.cmp(a);g++)v=v.redSqr();i(g<f);var m=this.pow(d,new o(1).iushln(f-g-1));l=l.redMul(m),d=m.redSqr(),p=p.redMul(d),f=g}return l},P.prototype.invm=function(e){var t=e._invmp(this.m);return 0!==t.negative?(t.negative=0,this.imod(t).redNeg()):this.imod(t)},P.prototype.pow=function(e,t){if(t.isZero())return new o(1).toRed(this);if(0===t.cmpn(1))return e.clone();var r=new Array(16);r[0]=new o(1).toRed(this),r[1]=e;for(var i=2;i<r.length;i++)r[i]=this.mul(r[i-1],e);var n=r[0],s=0,a=0,c=t.bitLength()%26;for(0===c&&(c=26),i=t.length-1;i>=0;i--){for(var u=t.words[i],h=c-1;h>=0;h--){var d=u>>h&1;n!==r[0]&&(n=this.sqr(n)),0!==d||0!==s?(s<<=1,s|=d,(4==++a||0===i&&0===h)&&(n=this.mul(n,r[s]),a=0,s=0)):a=0}c=26}return n},P.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},P.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},o.mont=function(e){return new A(e)},n(A,P),A.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},A.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},A.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),o=n;return n.cmp(this.m)>=0?o=n.isub(this.m):n.cmpn(0)<0&&(o=n.iadd(this.m)),o._forceRed(this)},A.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new o(0)._forceRed(this);var r=e.mul(t),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),s=n;return n.cmp(this.m)>=0?s=n.isub(this.m):n.cmpn(0)<0&&(s=n.iadd(this.m)),s._forceRed(this)},A.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e=r.nmd(e),this)},715:(e,t,r)=>{var i=t;i.utils=r(436),i.common=r(772),i.sha=r(41),i.ripemd=r(949),i.hmac=r(326),i.sha1=i.sha.sha1,i.sha256=i.sha.sha256,i.sha224=i.sha.sha224,i.sha384=i.sha.sha384,i.sha512=i.sha.sha512,i.ripemd160=i.ripemd.ripemd160},772:(e,t,r)=>{"use strict";var i=r(436),n=r(746);function o(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}t.BlockHash=o,o.prototype.update=function(e,t){if(e=i.toArray(e,t),this.pending?this.pending=this.pending.concat(e):this.pending=e,this.pendingTotal+=e.length,this.pending.length>=this._delta8){var r=(e=this.pending).length%this._delta8;this.pending=e.slice(e.length-r,e.length),0===this.pending.length&&(this.pending=null),e=i.join32(e,0,e.length-r,this.endian);for(var n=0;n<e.length;n+=this._delta32)this._update(e,n,n+this._delta32)}return this},o.prototype.digest=function(e){return this.update(this._pad()),n(null===this.pending),this._digest(e)},o.prototype._pad=function(){var e=this.pendingTotal,t=this._delta8,r=t-(e+this.padLength)%t,i=new Array(r+this.padLength);i[0]=128;for(var n=1;n<r;n++)i[n]=0;if(e<<=3,"big"===this.endian){for(var o=8;o<this.padLength;o++)i[n++]=0;i[n++]=0,i[n++]=0,i[n++]=0,i[n++]=0,i[n++]=e>>>24&255,i[n++]=e>>>16&255,i[n++]=e>>>8&255,i[n++]=255&e}else for(i[n++]=255&e,i[n++]=e>>>8&255,i[n++]=e>>>16&255,i[n++]=e>>>24&255,i[n++]=0,i[n++]=0,i[n++]=0,i[n++]=0,o=8;o<this.padLength;o++)i[n++]=0;return i}},326:(e,t,r)=>{"use strict";var i=r(436),n=r(746);function o(e,t,r){if(!(this instanceof o))return new o(e,t,r);this.Hash=e,this.blockSize=e.blockSize/8,this.outSize=e.outSize/8,this.inner=null,this.outer=null,this._init(i.toArray(t,r))}e.exports=o,o.prototype._init=function(e){e.length>this.blockSize&&(e=(new this.Hash).update(e).digest()),n(e.length<=this.blockSize);for(var t=e.length;t<this.blockSize;t++)e.push(0);for(t=0;t<e.length;t++)e[t]^=54;for(this.inner=(new this.Hash).update(e),t=0;t<e.length;t++)e[t]^=106;this.outer=(new this.Hash).update(e)},o.prototype.update=function(e,t){return this.inner.update(e,t),this},o.prototype.digest=function(e){return this.outer.update(this.inner.digest()),this.outer.digest(e)}},949:(e,t,r)=>{"use strict";var i=r(436),n=r(772),o=i.rotl32,s=i.sum32,a=i.sum32_3,c=i.sum32_4,u=n.BlockHash;function h(){if(!(this instanceof h))return new h;u.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}function d(e,t,r,i){return e<=15?t^r^i:e<=31?t&r|~t&i:e<=47?(t|~r)^i:e<=63?t&i|r&~i:t^(r|~i)}function l(e){return e<=15?0:e<=31?1518500249:e<=47?1859775393:e<=63?2400959708:2840853838}function p(e){return e<=15?1352829926:e<=31?1548603684:e<=47?1836072691:e<=63?2053994217:0}i.inherits(h,u),t.ripemd160=h,h.blockSize=512,h.outSize=160,h.hmacStrength=192,h.padLength=64,h.prototype._update=function(e,t){for(var r=this.h[0],i=this.h[1],n=this.h[2],u=this.h[3],h=this.h[4],y=r,b=i,S=n,C=u,w=h,P=0;P<80;P++){var A=s(o(c(r,d(P,i,n,u),e[f[P]+t],l(P)),g[P]),h);r=h,h=u,u=o(n,10),n=i,i=A,A=s(o(c(y,d(79-P,b,S,C),e[v[P]+t],p(P)),m[P]),w),y=w,w=C,C=o(S,10),S=b,b=A}A=a(this.h[1],n,C),this.h[1]=a(this.h[2],u,w),this.h[2]=a(this.h[3],h,y),this.h[3]=a(this.h[4],r,b),this.h[4]=a(this.h[0],i,S),this.h[0]=A},h.prototype._digest=function(e){return"hex"===e?i.toHex32(this.h,"little"):i.split32(this.h,"little")};var f=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],v=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],g=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],m=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]},41:(e,t,r)=>{"use strict";t.sha1=r(761),t.sha224=r(799),t.sha256=r(344),t.sha384=r(978),t.sha512=r(900)},761:(e,t,r)=>{"use strict";var i=r(436),n=r(772),o=r(38),s=i.rotl32,a=i.sum32,c=i.sum32_5,u=o.ft_1,h=n.BlockHash,d=[1518500249,1859775393,2400959708,3395469782];function l(){if(!(this instanceof l))return new l;h.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}i.inherits(l,h),e.exports=l,l.blockSize=512,l.outSize=160,l.hmacStrength=80,l.padLength=64,l.prototype._update=function(e,t){for(var r=this.W,i=0;i<16;i++)r[i]=e[t+i];for(;i<r.length;i++)r[i]=s(r[i-3]^r[i-8]^r[i-14]^r[i-16],1);var n=this.h[0],o=this.h[1],h=this.h[2],l=this.h[3],p=this.h[4];for(i=0;i<r.length;i++){var f=~~(i/20),v=c(s(n,5),u(f,o,h,l),p,r[i],d[f]);p=l,l=h,h=s(o,30),o=n,n=v}this.h[0]=a(this.h[0],n),this.h[1]=a(this.h[1],o),this.h[2]=a(this.h[2],h),this.h[3]=a(this.h[3],l),this.h[4]=a(this.h[4],p)},l.prototype._digest=function(e){return"hex"===e?i.toHex32(this.h,"big"):i.split32(this.h,"big")}},799:(e,t,r)=>{"use strict";var i=r(436),n=r(344);function o(){if(!(this instanceof o))return new o;n.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}i.inherits(o,n),e.exports=o,o.blockSize=512,o.outSize=224,o.hmacStrength=192,o.padLength=64,o.prototype._digest=function(e){return"hex"===e?i.toHex32(this.h.slice(0,7),"big"):i.split32(this.h.slice(0,7),"big")}},344:(e,t,r)=>{"use strict";var i=r(436),n=r(772),o=r(38),s=r(746),a=i.sum32,c=i.sum32_4,u=i.sum32_5,h=o.ch32,d=o.maj32,l=o.s0_256,p=o.s1_256,f=o.g0_256,v=o.g1_256,g=n.BlockHash,m=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];function y(){if(!(this instanceof y))return new y;g.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=m,this.W=new Array(64)}i.inherits(y,g),e.exports=y,y.blockSize=512,y.outSize=256,y.hmacStrength=192,y.padLength=64,y.prototype._update=function(e,t){for(var r=this.W,i=0;i<16;i++)r[i]=e[t+i];for(;i<r.length;i++)r[i]=c(v(r[i-2]),r[i-7],f(r[i-15]),r[i-16]);var n=this.h[0],o=this.h[1],g=this.h[2],m=this.h[3],y=this.h[4],b=this.h[5],S=this.h[6],C=this.h[7];for(s(this.k.length===r.length),i=0;i<r.length;i++){var w=u(C,p(y),h(y,b,S),this.k[i],r[i]),P=a(l(n),d(n,o,g));C=S,S=b,b=y,y=a(m,w),m=g,g=o,o=n,n=a(w,P)}this.h[0]=a(this.h[0],n),this.h[1]=a(this.h[1],o),this.h[2]=a(this.h[2],g),this.h[3]=a(this.h[3],m),this.h[4]=a(this.h[4],y),this.h[5]=a(this.h[5],b),this.h[6]=a(this.h[6],S),this.h[7]=a(this.h[7],C)},y.prototype._digest=function(e){return"hex"===e?i.toHex32(this.h,"big"):i.split32(this.h,"big")}},978:(e,t,r)=>{"use strict";var i=r(436),n=r(900);function o(){if(!(this instanceof o))return new o;n.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}i.inherits(o,n),e.exports=o,o.blockSize=1024,o.outSize=384,o.hmacStrength=192,o.padLength=128,o.prototype._digest=function(e){return"hex"===e?i.toHex32(this.h.slice(0,12),"big"):i.split32(this.h.slice(0,12),"big")}},900:(e,t,r)=>{"use strict";var i=r(436),n=r(772),o=r(746),s=i.rotr64_hi,a=i.rotr64_lo,c=i.shr64_hi,u=i.shr64_lo,h=i.sum64,d=i.sum64_hi,l=i.sum64_lo,p=i.sum64_4_hi,f=i.sum64_4_lo,v=i.sum64_5_hi,g=i.sum64_5_lo,m=n.BlockHash,y=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function b(){if(!(this instanceof b))return new b;m.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=y,this.W=new Array(160)}function S(e,t,r,i,n){var o=e&r^~e&n;return o<0&&(o+=4294967296),o}function C(e,t,r,i,n,o){var s=t&i^~t&o;return s<0&&(s+=4294967296),s}function w(e,t,r,i,n){var o=e&r^e&n^r&n;return o<0&&(o+=4294967296),o}function P(e,t,r,i,n,o){var s=t&i^t&o^i&o;return s<0&&(s+=4294967296),s}function A(e,t){var r=s(e,t,28)^s(t,e,2)^s(t,e,7);return r<0&&(r+=4294967296),r}function I(e,t){var r=a(e,t,28)^a(t,e,2)^a(t,e,7);return r<0&&(r+=4294967296),r}function R(e,t){var r=a(e,t,14)^a(e,t,18)^a(t,e,9);return r<0&&(r+=4294967296),r}function E(e,t){var r=s(e,t,1)^s(e,t,8)^c(e,t,7);return r<0&&(r+=4294967296),r}function T(e,t){var r=a(e,t,1)^a(e,t,8)^u(e,t,7);return r<0&&(r+=4294967296),r}function M(e,t){var r=a(e,t,19)^a(t,e,29)^u(e,t,6);return r<0&&(r+=4294967296),r}i.inherits(b,m),e.exports=b,b.blockSize=1024,b.outSize=512,b.hmacStrength=192,b.padLength=128,b.prototype._prepareBlock=function(e,t){for(var r=this.W,i=0;i<32;i++)r[i]=e[t+i];for(;i<r.length;i+=2){var n=(g=r[i-4],m=r[i-3],y=void 0,(y=s(g,m,19)^s(m,g,29)^c(g,m,6))<0&&(y+=4294967296),y),o=M(r[i-4],r[i-3]),a=r[i-14],u=r[i-13],h=E(r[i-30],r[i-29]),d=T(r[i-30],r[i-29]),l=r[i-32],v=r[i-31];r[i]=p(n,o,a,u,h,d,l,v),r[i+1]=f(n,o,a,u,h,d,l,v)}var g,m,y},b.prototype._update=function(e,t){this._prepareBlock(e,t);var r,i,n,a=this.W,c=this.h[0],u=this.h[1],p=this.h[2],f=this.h[3],m=this.h[4],y=this.h[5],b=this.h[6],E=this.h[7],T=this.h[8],M=this.h[9],k=this.h[10],O=this.h[11],_=this.h[12],x=this.h[13],N=this.h[14],D=this.h[15];o(this.k.length===a.length);for(var z=0;z<a.length;z+=2){var L=N,B=D,F=(n=void 0,(n=s(r=T,i=M,14)^s(r,i,18)^s(i,r,9))<0&&(n+=4294967296),n),j=R(T,M),U=S(T,0,k,0,_),q=C(0,M,0,O,0,x),W=this.k[z],K=this.k[z+1],H=a[z],V=a[z+1],G=v(L,B,F,j,U,q,W,K,H,V),J=g(L,B,F,j,U,q,W,K,H,V);L=A(c,u),B=I(c,u),F=w(c,0,p,0,m),j=P(0,u,0,f,0,y);var $=d(L,B,F,j),Q=l(L,B,F,j);N=_,D=x,_=k,x=O,k=T,O=M,T=d(b,E,G,J),M=l(E,E,G,J),b=m,E=y,m=p,y=f,p=c,f=u,c=d(G,J,$,Q),u=l(G,J,$,Q)}h(this.h,0,c,u),h(this.h,2,p,f),h(this.h,4,m,y),h(this.h,6,b,E),h(this.h,8,T,M),h(this.h,10,k,O),h(this.h,12,_,x),h(this.h,14,N,D)},b.prototype._digest=function(e){return"hex"===e?i.toHex32(this.h,"big"):i.split32(this.h,"big")}},38:(e,t,r)=>{"use strict";var i=r(436).rotr32;function n(e,t,r){return e&t^~e&r}function o(e,t,r){return e&t^e&r^t&r}function s(e,t,r){return e^t^r}t.ft_1=function(e,t,r,i){return 0===e?n(t,r,i):1===e||3===e?s(t,r,i):2===e?o(t,r,i):void 0},t.ch32=n,t.maj32=o,t.p32=s,t.s0_256=function(e){return i(e,2)^i(e,13)^i(e,22)},t.s1_256=function(e){return i(e,6)^i(e,11)^i(e,25)},t.g0_256=function(e){return i(e,7)^i(e,18)^e>>>3},t.g1_256=function(e){return i(e,17)^i(e,19)^e>>>10}},436:(e,t,r)=>{"use strict";var i=r(746),n=r(717);function o(e,t){return 55296==(64512&e.charCodeAt(t))&&!(t<0||t+1>=e.length)&&56320==(64512&e.charCodeAt(t+1))}function s(e){return(e>>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24)>>>0}function a(e){return 1===e.length?"0"+e:e}function c(e){return 7===e.length?"0"+e:6===e.length?"00"+e:5===e.length?"000"+e:4===e.length?"0000"+e:3===e.length?"00000"+e:2===e.length?"000000"+e:1===e.length?"0000000"+e:e}t.inherits=n,t.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var r=[];if("string"==typeof e)if(t){if("hex"===t)for((e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e),n=0;n<e.length;n+=2)r.push(parseInt(e[n]+e[n+1],16))}else for(var i=0,n=0;n<e.length;n++){var s=e.charCodeAt(n);s<128?r[i++]=s:s<2048?(r[i++]=s>>6|192,r[i++]=63&s|128):o(e,n)?(s=65536+((1023&s)<<10)+(1023&e.charCodeAt(++n)),r[i++]=s>>18|240,r[i++]=s>>12&63|128,r[i++]=s>>6&63|128,r[i++]=63&s|128):(r[i++]=s>>12|224,r[i++]=s>>6&63|128,r[i++]=63&s|128)}else for(n=0;n<e.length;n++)r[n]=0|e[n];return r},t.toHex=function(e){for(var t="",r=0;r<e.length;r++)t+=a(e[r].toString(16));return t},t.htonl=s,t.toHex32=function(e,t){for(var r="",i=0;i<e.length;i++){var n=e[i];"little"===t&&(n=s(n)),r+=c(n.toString(16))}return r},t.zero2=a,t.zero8=c,t.join32=function(e,t,r,n){var o=r-t;i(o%4==0);for(var s=new Array(o/4),a=0,c=t;a<s.length;a++,c+=4){var u;u="big"===n?e[c]<<24|e[c+1]<<16|e[c+2]<<8|e[c+3]:e[c+3]<<24|e[c+2]<<16|e[c+1]<<8|e[c],s[a]=u>>>0}return s},t.split32=function(e,t){for(var r=new Array(4*e.length),i=0,n=0;i<e.length;i++,n+=4){var o=e[i];"big"===t?(r[n]=o>>>24,r[n+1]=o>>>16&255,r[n+2]=o>>>8&255,r[n+3]=255&o):(r[n+3]=o>>>24,r[n+2]=o>>>16&255,r[n+1]=o>>>8&255,r[n]=255&o)}return r},t.rotr32=function(e,t){return e>>>t|e<<32-t},t.rotl32=function(e,t){return e<<t|e>>>32-t},t.sum32=function(e,t){return e+t>>>0},t.sum32_3=function(e,t,r){return e+t+r>>>0},t.sum32_4=function(e,t,r,i){return e+t+r+i>>>0},t.sum32_5=function(e,t,r,i,n){return e+t+r+i+n>>>0},t.sum64=function(e,t,r,i){var n=e[t],o=i+e[t+1]>>>0,s=(o<i?1:0)+r+n;e[t]=s>>>0,e[t+1]=o},t.sum64_hi=function(e,t,r,i){return(t+i>>>0<t?1:0)+e+r>>>0},t.sum64_lo=function(e,t,r,i){return t+i>>>0},t.sum64_4_hi=function(e,t,r,i,n,o,s,a){var c=0,u=t;return c+=(u=u+i>>>0)<t?1:0,c+=(u=u+o>>>0)<o?1:0,e+r+n+s+(c+=(u=u+a>>>0)<a?1:0)>>>0},t.sum64_4_lo=function(e,t,r,i,n,o,s,a){return t+i+o+a>>>0},t.sum64_5_hi=function(e,t,r,i,n,o,s,a,c,u){var h=0,d=t;return h+=(d=d+i>>>0)<t?1:0,h+=(d=d+o>>>0)<o?1:0,h+=(d=d+a>>>0)<a?1:0,e+r+n+s+c+(h+=(d=d+u>>>0)<u?1:0)>>>0},t.sum64_5_lo=function(e,t,r,i,n,o,s,a,c,u){return t+i+o+a+u>>>0},t.rotr64_hi=function(e,t,r){return(t<<32-r|e>>>r)>>>0},t.rotr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0},t.shr64_hi=function(e,t,r){return e>>>r},t.shr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0}},156:(e,t,r)=>{"use strict";var i=r(715),n=r(504),o=r(746);function s(e){if(!(this instanceof s))return new s(e);this.hash=e.hash,this.predResist=!!e.predResist,this.outLen=this.hash.outSize,this.minEntropy=e.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var t=n.toArray(e.entropy,e.entropyEnc||"hex"),r=n.toArray(e.nonce,e.nonceEnc||"hex"),i=n.toArray(e.pers,e.persEnc||"hex");o(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,r,i)}e.exports=s,s.prototype._init=function(e,t,r){var i=e.concat(t).concat(r);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var n=0;n<this.V.length;n++)this.K[n]=0,this.V[n]=1;this._update(i),this._reseed=1,this.reseedInterval=281474976710656},s.prototype._hmac=function(){return new i.hmac(this.hash,this.K)},s.prototype._update=function(e){var t=this._hmac().update(this.V).update([0]);e&&(t=t.update(e)),this.K=t.digest(),this.V=this._hmac().update(this.V).digest(),e&&(this.K=this._hmac().update(this.V).update([1]).update(e).digest(),this.V=this._hmac().update(this.V).digest())},s.prototype.reseed=function(e,t,r,i){"string"!=typeof t&&(i=r,r=t,t=null),e=n.toArray(e,t),r=n.toArray(r,i),o(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(r||[])),this._reseed=1},s.prototype.generate=function(e,t,r,i){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof t&&(i=r,r=t,t=null),r&&(r=n.toArray(r,i||"hex"),this._update(r));for(var o=[];o.length<e;)this.V=this._hmac().update(this.V).digest(),o=o.concat(this.V);var s=o.slice(0,e);return this._update(r),this._reseed++,n.encode(s,t)}},717:e=>{"function"==typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}}},746:e=>{function t(e,t){if(!e)throw new Error(t||"Assertion failed")}e.exports=t,t.equal=function(e,t,r){if(e!=t)throw new Error(r||"Assertion failed: "+e+" != "+t)}},504:(e,t)=>{"use strict";var r=t;function i(e){return 1===e.length?"0"+e:e}function n(e){for(var t="",r=0;r<e.length;r++)t+=i(e[r].toString(16));return t}r.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var r=[];if("string"!=typeof e){for(var i=0;i<e.length;i++)r[i]=0|e[i];return r}if("hex"===t)for((e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e),i=0;i<e.length;i+=2)r.push(parseInt(e[i]+e[i+1],16));else for(i=0;i<e.length;i++){var n=e.charCodeAt(i),o=n>>8,s=255&n;o?r.push(o,s):r.push(s)}return r},r.zero2=i,r.toHex=n,r.encode=function(e,t){return"hex"===t?n(e):e}},458:(e,t)=>{!function(e){var t,r,i,n=String.fromCharCode;function o(e){for(var t,r,i=[],n=0,o=e.length;n<o;)(t=e.charCodeAt(n++))>=55296&&t<=56319&&n<o?56320==(64512&(r=e.charCodeAt(n++)))?i.push(((1023&t)<<10)+(1023&r)+65536):(i.push(t),n--):i.push(t);return i}function s(e){if(e>=55296&&e<=57343)throw Error("Lone surrogate U+"+e.toString(16).toUpperCase()+" is not a scalar value")}function a(e,t){return n(e>>t&63|128)}function c(e){if(!(4294967168&e))return n(e);var t="";return 4294965248&e?4294901760&e?!(4292870144&e)&&(t=n(e>>18&7|240),t+=a(e,12),t+=a(e,6)):(s(e),t=n(e>>12&15|224),t+=a(e,6)):t=n(e>>6&31|192),t+n(63&e|128)}function u(){if(i>=r)throw Error("Invalid byte index");var e=255&t[i];if(i++,128==(192&e))return 63&e;throw Error("Invalid continuation byte")}function h(){var e,n;if(i>r)throw Error("Invalid byte index");if(i==r)return!1;if(e=255&t[i],i++,!(128&e))return e;if(192==(224&e)){if((n=(31&e)<<6|u())>=128)return n;throw Error("Invalid continuation byte")}if(224==(240&e)){if((n=(15&e)<<12|u()<<6|u())>=2048)return s(n),n;throw Error("Invalid continuation byte")}if(240==(248&e)&&(n=(7&e)<<18|u()<<12|u()<<6|u())>=65536&&n<=1114111)return n;throw Error("Invalid UTF-8 detected")}e.version="3.0.0",e.encode=function(e){for(var t=o(e),r=t.length,i=-1,n="";++i<r;)n+=c(t[i]);return n},e.decode=function(e){t=o(e),r=t.length,i=0;for(var s,a=[];!1!==(s=h());)a.push(s);return function(e){for(var t,r=e.length,i=-1,o="";++i<r;)(t=e[i])>65535&&(o+=n((t-=65536)>>>10&1023|55296),t=56320|1023&t),o+=n(t);return o}(a)}}(t)},329:()=>{},214:()=>{},568:()=>{},597:e=>{"use strict";e.exports={i8:"6.5.4"}}},i={};function n(e){var t=i[e];if(void 0!==t)return t.exports;var o=i[e]={id:e,loaded:!1,exports:{}};return r[e].call(o.exports,o,o.exports,n),o.loaded=!0,o.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},t=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,n.t=function(r,i){if(1&i&&(r=this(r)),8&i)return r;if("object"==typeof r&&r){if(4&i&&r.__esModule)return r;if(16&i&&"function"==typeof r.then)return r}var o=Object.create(null);n.r(o);var s={};e=e||[null,t({}),t([]),t(t)];for(var a=2&i&&r;"object"==typeof a&&!~e.indexOf(a);a=t(a))Object.getOwnPropertyNames(a).forEach(e=>s[e]=()=>r[e]);return s.default=()=>r,n.d(o,s),o},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.nmd=e=>(e.paths=[],e.children||(e.children=[]),e);var o={};return(()=>{"use strict";n.r(o),n.d(o,{EthereumProvider:()=>Ne,MetaKeep:()=>De});var e,t,r,i,s,a=n(266),c=n.n(a);function u(e){const t=e&&e.parentNode;t&&"function"==typeof t.removeChild&&t.removeChild(e)}!function(e){e.dublin="https://auth.dublin.metakeep.xyz",e.prod="https://auth.metakeep.xyz",e.dev="https://auth.dev.metakeep.xyz",e.local="http://localhost:3000"}(e||(e={})),function(e){e.SIGN_TRANSACTION="SIGN_TRANSACTION",e.SIGN_TYPED_DATA="SIGN_TYPED_DATA",e.SIGN_MESSAGE="SIGN_MESSAGE",e.SIGN_TRANSACTION_MULTIPLE="SIGN_TRANSACTION_MULTIPLE",e.DECRYPT="DECRYPT"}(t||(t={})),function(e){e.SUCCESS="Success",e.ERROR="Error",e.SIGN_REQUEST="SIGN_REQUEST",e.MESSAGE="message",e.CLOSE_FRAME="CLOSE_FRAME",e.SIGN_IN_REQUEST="SIGN_IN_REQUEST",e.SDK_MESSAGE="SDK_MESSAGE",e.FRAME_READY="FRAME_READY",e.MAKE_FRAME_VISIBLE="MAKE_FRAME_VISIBLE"}(r||(r={})),function(e){e.APPROVAl="APPROVAL",e.CONSENT="CONSENT",e.LOGIN="LOGIN",e.PREFETCH="PREFETCH"}(i||(i={})),function(e){e.SOMETHING_WENT_WRONG="SOMETHING_WENT_WRONG",e.OPERATION_CANCELLED="OPERATION_CANCELLED"}(s||(s={}));const h=(e,t=(e,t)=>{},r=window)=>{r.addEventListener(e,function i(n){t(n,()=>r.removeEventListener(e,i))})};var d=n(458);const l=(p=globalThis,f={},new Proxy(p,{get:(e,t,r)=>t in f?f[t]:p[t],set:(e,t,r)=>(t in f&&delete f[t],p[t]=r,!0),deleteProperty(e,t){let r=!1;return t in f&&(delete f[t],r=!0),t in p&&(delete p[t],r=!0),r},ownKeys(e){const t=Reflect.ownKeys(p),r=Reflect.ownKeys(f),i=new Set(r);return[...t.filter(e=>!i.has(e)),...r]},defineProperty:(e,t,r)=>(t in f&&delete f[t],Reflect.defineProperty(p,t,r),!0),getOwnPropertyDescriptor:(e,t)=>t in f?Reflect.getOwnPropertyDescriptor(f,t):Reflect.getOwnPropertyDescriptor(p,t),has:(e,t)=>t in f||t in p}));var p,f;class v extends Error{constructor(e){let t;t=e instanceof Error?e.message:"string"==typeof e?e:"",super(t),this.name=this.constructor.name}}class g extends v{}class m extends g{}class y extends g{}class b extends g{}class S extends g{}class C extends g{}class w extends g{}class P extends g{}class A extends g{}class I extends g{}class R extends g{}class E extends g{}class T{constructor(){Object.defineProperty(this,"_api",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}async _setup(){void 0===this._api&&(this._api=await async function(){if(void 0!==l&&void 0!==globalThis.crypto)return globalThis.crypto.subtle;try{const{webcrypto:e}=await Promise.resolve().then(n.t.bind(n,329,19));return e.subtle}catch(e){throw new E(e)}}())}}const M=["encrypt","decrypt"];class k extends T{constructor(e){super(),Object.defineProperty(this,"_rawKey",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_key",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._rawKey=e}async seal(e,t,r){await this._setupKey();const i={name:"AES-GCM",iv:e,additionalData:r};return await this._api.encrypt(i,this._key,t)}async open(e,t,r){await this._setupKey();const i={name:"AES-GCM",iv:e,additionalData:r};return await this._api.decrypt(i,this._key,t)}async _setupKey(){if(void 0!==this._key)return;await this._setup();const e=await this._importKey(this._rawKey);new Uint8Array(this._rawKey).fill(0),this._key=e}async _importKey(e){return await this._api.importKey("raw",e,{name:"AES-GCM"},!0,M)}}class O{constructor(){Object.defineProperty(this,"id",{enumerable:!0,configurable:!0,writable:!0,value:1}),Object.defineProperty(this,"keySize",{enumerable:!0,configurable:!0,writable:!0,value:16}),Object.defineProperty(this,"nonceSize",{enumerable:!0,configurable:!0,writable:!0,value:12}),Object.defineProperty(this,"tagSize",{enumerable:!0,configurable:!0,writable:!0,value:16})}createEncryptionContext(e){return new k(e)}}class _ extends O{constructor(){super(...arguments),Object.defineProperty(this,"id",{enumerable:!0,configurable:!0,writable:!0,value:2}),Object.defineProperty(this,"keySize",{enumerable:!0,configurable:!0,writable:!0,value:32}),Object.defineProperty(this,"nonceSize",{enumerable:!0,configurable:!0,writable:!0,value:12}),Object.defineProperty(this,"tagSize",{enumerable:!0,configurable:!0,writable:!0,value:16})}}const x=8192,N=new Uint8Array(0);function D(){return new Promise((e,t)=>{t(new E("Not supported"))})}const z=new Uint8Array([115,101,99]);class L{constructor(e,t,r){Object.defineProperty(this,"_api",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"exporterSecret",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_kdf",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._api=e,this._kdf=t,this.exporterSecret=r}async seal(e,t){return await D()}async open(e,t){return await D()}async export(e,t){if(e.byteLength>x)throw new m("Too long exporter context");try{return await this._kdf.labeledExpand(this.exporterSecret,z,new Uint8Array(e),t)}catch(e){throw new w(e)}}}class B extends L{}class F extends L{constructor(e,t,r,i){super(e,t,r),Object.defineProperty(this,"enc",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.enc=i}}const j=e=>"object"==typeof e&&null!==e&&"object"==typeof e.privateKey&&"object"==typeof e.publicKey;function U(e,t){if(t<=0)throw new Error("i2Osp: too small size");if(e>=256**t)throw new Error("i2Osp: too large integer");const r=new Uint8Array(t);for(let i=0;i<t&&e;i++)r[t-(i+1)]=e%256,e>>=8;return r}function q(e,t){const r=new Uint8Array(e.length+t.length);return r.set(e,0),r.set(t,e.length),r}class W extends L{constructor(e,t,r){if(super(e,t,r.exporterSecret),Object.defineProperty(this,"_aead",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_nK",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_nN",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_nT",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_ctx",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),void 0===r.key||void 0===r.baseNonce||void 0===r.seq)throw new Error("Required parameters are missing");this._aead=r.aead,this._nK=this._aead.keySize,this._nN=this._aead.nonceSize,this._nT=this._aead.tagSize;const i=this._aead.createEncryptionContext(r.key);this._ctx={key:i,baseNonce:r.baseNonce,seq:r.seq}}computeNonce(e){const t=U(e.seq,e.baseNonce.byteLength);return function(e,t){if(e.byteLength!==t.byteLength)throw new Error("xor: different length inputs");const r=new Uint8Array(e.byteLength);for(let i=0;i<e.byteLength;i++)r[i]=e[i]^t[i];return r}(e.baseNonce,t)}incrementSeq(e){if(e.seq>Number.MAX_SAFE_INTEGER)throw new I("Message limit reached");e.seq+=1}}class K extends W{async open(e,t=N){let r;try{r=await this._ctx.key.open(this.computeNonce(this._ctx),e,t)}catch(e){throw new A(e)}return this.incrementSeq(this._ctx),r}}class H extends W{constructor(e,t,r,i){super(e,t,r),Object.defineProperty(this,"enc",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.enc=i}async seal(e,t=N){let r;try{r=await this._ctx.key.seal(this.computeNonce(this._ctx),e,t)}catch(e){throw new P(e)}return this.incrementSeq(this._ctx),r}}const V=new Uint8Array([98,97,115,101,95,110,111,110,99,101]),G=new Uint8Array([101,120,112]),J=new Uint8Array([105,110,102,111,95,104,97,115,104]),$=new Uint8Array([107,101,121]),Q=new Uint8Array([112,115,107,95,105,100,95,104,97,115,104]),Y=new Uint8Array([115,101,99,114,101,116]),X=new Uint8Array([72,80,75,69,0,0,0,0,0,0]);class Z extends T{constructor(e){if(super(),Object.defineProperty(this,"_kem",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_kdf",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_aead",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_suiteId",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),"number"==typeof e.kem)throw new m("KemId cannot be used");if(this._kem=e.kem,"number"==typeof e.kdf)throw new m("KdfId cannot be used");if(this._kdf=e.kdf,"number"==typeof e.aead)throw new m("AeadId cannot be used");this._aead=e.aead,this._suiteId=new Uint8Array(X),this._suiteId.set(U(this._kem.id,2),4),this._suiteId.set(U(this._kdf.id,2),6),this._suiteId.set(U(this._aead.id,2),8),this._kdf.init(this._suiteId)}get kem(){return this._kem}get kdf(){return this._kdf}get aead(){return this._aead}async createSenderContext(e){this._validateInputLength(e),await this._setup();const t=await this._kem.encap(e);let r;return r=void 0!==e.psk?void 0!==e.senderKey?3:1:void 0!==e.senderKey?2:0,await this._keyScheduleS(r,t.sharedSecret,t.enc,e)}async createRecipientContext(e){this._validateInputLength(e),await this._setup();const t=await this._kem.decap(e);let r;return r=void 0!==e.psk?void 0!==e.senderPublicKey?3:1:void 0!==e.senderPublicKey?2:0,await this._keyScheduleR(r,t,e)}async seal(e,t,r=N){const i=await this.createSenderContext(e);return{ct:await i.seal(t,r),enc:i.enc}}async open(e,t,r=N){const i=await this.createRecipientContext(e);return await i.open(t,r)}async _keySchedule(e,t,r){const i=void 0===r.psk?N:new Uint8Array(r.psk.id),n=await this._kdf.labeledExtract(N,Q,i),o=void 0===r.info?N:new Uint8Array(r.info),s=await this._kdf.labeledExtract(N,J,o),a=new Uint8Array(1+n.byteLength+s.byteLength);a.set(new Uint8Array([e]),0),a.set(new Uint8Array(n),1),a.set(new Uint8Array(s),1+n.byteLength);const c=void 0===r.psk?N:new Uint8Array(r.psk.key),u=this._kdf.buildLabeledIkm(Y,c),h=this._kdf.buildLabeledInfo(G,a,this._kdf.hashSize),d=await this._kdf.extractAndExpand(t,u,h,this._kdf.hashSize);if(65535===this._aead.id)return{aead:this._aead,exporterSecret:d};const l=this._kdf.buildLabeledInfo($,a,this._aead.keySize),p=await this._kdf.extractAndExpand(t,u,l,this._aead.keySize),f=this._kdf.buildLabeledInfo(V,a,this._aead.nonceSize),v=await this._kdf.extractAndExpand(t,u,f,this._aead.nonceSize);return{aead:this._aead,exporterSecret:d,key:p,baseNonce:new Uint8Array(v),seq:0}}async _keyScheduleS(e,t,r,i){const n=await this._keySchedule(e,t,i);return void 0===n.key?new F(this._api,this._kdf,n.exporterSecret,r):new H(this._api,this._kdf,n,r)}async _keyScheduleR(e,t,r){const i=await this._keySchedule(e,t,r);return void 0===i.key?new B(this._api,this._kdf,i.exporterSecret):new K(this._api,this._kdf,i)}_validateInputLength(e){if(void 0!==e.info&&e.info.byteLength>x)throw new m("Too long info");if(void 0!==e.psk){if(e.psk.key.byteLength<32)throw new m("PSK must have at least 32 bytes");if(e.psk.key.byteLength>x)throw new m("Too long psk.key");if(e.psk.id.byteLength>x)throw new m("Too long psk.id")}}}const ee=new Uint8Array([72,80,75,69,45,118,49]);class te extends T{constructor(){super(),Object.defineProperty(this,"id",{enumerable:!0,configurable:!0,writable:!0,value:1}),Object.defineProperty(this,"hashSize",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_suiteId",{enumerable:!0,configurable:!0,writable:!0,value:N}),Object.defineProperty(this,"algHash",{enumerable:!0,configurable:!0,writable:!0,value:{name:"HMAC",hash:"SHA-256",length:256}})}init(e){this._suiteId=e}buildLabeledIkm(e,t){this._checkInit();const r=new Uint8Array(7+this._suiteId.byteLength+e.byteLength+t.byteLength);return r.set(ee,0),r.set(this._suiteId,7),r.set(e,7+this._suiteId.byteLength),r.set(t,7+this._suiteId.byteLength+e.byteLength),r}buildLabeledInfo(e,t,r){this._checkInit();const i=new Uint8Array(9+this._suiteId.byteLength+e.byteLength+t.byteLength);return i.set(new Uint8Array([0,r]),0),i.set(ee,2),i.set(this._suiteId,9),i.set(e,9+this._suiteId.byteLength),i.set(t,9+this._suiteId.byteLength+e.byteLength),i}async extract(e,t){if(await this._setup(),0===e.byteLength&&(e=new ArrayBuffer(this.hashSize)),e.byteLength!==this.hashSize)throw new m("The salt length must be the same as the hashSize");const r=await this._api.importKey("raw",e,this.algHash,!1,["sign"]);return await this._api.sign("HMAC",r,t)}async expand(e,t,r){await this._setup();const i=await this._api.importKey("raw",e,this.algHash,!1,["sign"]),n=new ArrayBuffer(r),o=new Uint8Array(n);let s=N;const a=new Uint8Array(t),c=new Uint8Array(1);if(r>255*this.hashSize)throw new Error("Entropy limit reached");const u=new Uint8Array(this.hashSize+a.length+1);for(let e=1,t=0;t<o.length;e++)c[0]=e,u.set(s,0),u.set(a,s.length),u.set(c,s.length+a.length),s=new Uint8Array(await this._api.sign("HMAC",i,u.slice(0,s.length+a.length+1))),o.length-t>=s.length?(o.set(s,t),t+=s.length):(o.set(s.slice(0,o.length-t),t),t+=o.length-t);return n}async extractAndExpand(e,t,r,i){await this._setup();const n=await this._api.importKey("raw",t,"HKDF",!1,["deriveBits"]);return await this._api.deriveBits({name:"HKDF",hash:this.algHash.hash,salt:e,info:r},n,8*i)}async labeledExtract(e,t,r){return await this.extract(e,this.buildLabeledIkm(t,r))}async labeledExpand(e,t,r,i){return await this.expand(e,this.buildLabeledInfo(t,r,i),i)}_checkInit(){if(this._suiteId===N)throw new Error("Not initialized. Call init()")}}class re extends te{constructor(){super(...arguments),Object.defineProperty(this,"id",{enumerable:!0,configurable:!0,writable:!0,value:1}),Object.defineProperty(this,"hashSize",{enumerable:!0,configurable:!0,writable:!0,value:32}),Object.defineProperty(this,"algHash",{enumerable:!0,configurable:!0,writable:!0,value:{name:"HMAC",hash:"SHA-256",length:256}})}}const ie=new Uint8Array([75,69,77,0,0]),ne=new Uint8Array([101,97,101,95,112,114,107]),oe=new Uint8Array([115,104,97,114,101,100,95,115,101,99,114,101,116]);class se{constructor(e,t,r){Object.defineProperty(this,"id",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"secretSize",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"encSize",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"publicKeySize",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"privateKeySize",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_prim",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_kdf",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.id=e,this._prim=t,this._kdf=r;const i=new Uint8Array(ie);i.set(U(this.id,2),3),this._kdf.init(i)}async serializePublicKey(e){return await this._prim.serializePublicKey(e)}async deserializePublicKey(e){return await this._prim.deserializePublicKey(e)}async serializePrivateKey(e){return await this._prim.serializePrivateKey(e)}async deserializePrivateKey(e){return await this._prim.deserializePrivateKey(e)}async importKey(e,t,r=!0){return await this._prim.importKey(e,t,r)}async generateKeyPair(){return await this._prim.generateKeyPair()}async deriveKeyPair(e){if(e.byteLength>x)throw new m("Too long ikm");return await this._prim.deriveKeyPair(e)}async encap(e){let t;t=void 0===e.ekm?await this.generateKeyPair():j(e.ekm)?e.ekm:await this.deriveKeyPair(e.ekm);const r=await this._prim.serializePublicKey(t.publicKey),i=await this._prim.serializePublicKey(e.recipientPublicKey);try{let n,o;if(void 0===e.senderKey)n=new Uint8Array(await this._prim.dh(t.privateKey,e.recipientPublicKey));else{const r=j(e.senderKey)?e.senderKey.privateKey:e.senderKey;n=q(new Uint8Array(await this._prim.dh(t.privateKey,e.recipientPublicKey)),new Uint8Array(await this._prim.dh(r,e.recipientPublicKey)))}if(void 0===e.senderKey)o=q(new Uint8Array(r),new Uint8Array(i));else{const t=j(e.senderKey)?e.senderKey.publicKey:await this._prim.derivePublicKey(e.senderKey),n=await this._prim.serializePublicKey(t);o=function(e,t,r){const i=new Uint8Array(e.length+t.length+r.length);return i.set(e,0),i.set(t,e.length),i.set(r,e.length+t.length),i}(new Uint8Array(r),new Uint8Array(i),new Uint8Array(n))}return{enc:r,sharedSecret:await this._generateSharedSecret(n,o)}}catch(e){throw new S(e)}}async decap(e){const t=await this._prim.deserializePublicKey(e.enc),r=j(e.recipientKey)?e.recipientKey.privateKey:e.recipientKey,i=j(e.recipientKey)?e.recipientKey.publicKey:await this._prim.derivePublicKey(e.recipientKey),n=await this._prim.serializePublicKey(i);try{let i,o;if(i=void 0===e.senderPublicKey?new Uint8Array(await this._prim.dh(r,t)):q(new Uint8Array(await this._prim.dh(r,t)),new Uint8Array(await this._prim.dh(r,e.senderPublicKey))),void 0===e.senderPublicKey)o=q(new Uint8Array(e.enc),new Uint8Array(n));else{const t=await this._prim.serializePublicKey(e.senderPublicKey);o=new Uint8Array(e.enc.byteLength+n.byteLength+t.byteLength),o.set(new Uint8Array(e.enc),0),o.set(new Uint8Array(n),e.enc.byteLength),o.set(new Uint8Array(t),e.enc.byteLength+n.byteLength)}return await this._generateSharedSecret(i,o)}catch(e){throw new C(e)}}async _generateSharedSecret(e,t){const r=this._kdf.buildLabeledIkm(ne,e),i=this._kdf.buildLabeledInfo(oe,t,this.secretSize);return await this._kdf.extractAndExpand(N,r,i,this.secretSize)}}const ae=["deriveBits"],ce=new Uint8Array([100,107,112,95,112,114,107]);new Uint8Array([115,107]);class ue{constructor(e){Object.defineProperty(this,"_num",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._num=new Uint8Array(e)}val(){return this._num}reset(){this._num.fill(0)}set(e){if(e.length!==this._num.length)throw new Error("Bignum.set: invalid argument");this._num.set(e)}isZero(){for(let e=0;e<this._num.length;e++)if(0!==this._num[e])return!1;return!0}lessThan(e){if(e.length!==this._num.length)throw new Error("Bignum.lessThan: invalid argument");for(let t=0;t<this._num.length;t++){if(this._num[t]<e[t])return!0;if(this._num[t]>e[t])return!1}return!1}}const he=new Uint8Array([99,97,110,100,105,100,97,116,101]),de=new Uint8Array([255,255,255,255,0,0,0,0,255,255,255,255,255,255,255,255,188,230,250,173,167,23,158,132,243,185,202,194,252,99,37,81]),le=new Uint8Array([255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,199,99,77,129,244,55,45,223,88,26,13,178,72,176,167,122,236,236,25,106,204,197,41,115]),pe=new Uint8Array([1,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,250,81,134,135,131,191,47,150,107,127,204,1,72,247,9,165,208,59,181,201,184,137,156,71,174,187,111,183,30,145,56,100,9]),fe=new Uint8Array([48,65,2,1,0,48,19,6,7,42,134,72,206,61,2,1,6,8,42,134,72,206,61,3,1,7,4,39,48,37,2,1,1,4,32]),ve=new Uint8Array([48,78,2,1,0,48,16,6,7,42,134,72,206,61,2,1,6,5,43,129,4,0,34,4,55,48,53,2,1,1,4,48]),ge=new Uint8Array([48,96,2,1,0,48,16,6,7,42,134,72,206,61,2,1,6,5,43,129,4,0,35,4,73,48,71,2,1,1,4,66]);class me extends T{constructor(e,t){switch(super(),Object.defineProperty(this,"_hkdf",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_alg",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_nPk",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_nSk",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_nDh",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_order",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_bitmask",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_pkcs8AlgId",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._hkdf=t,e){case 16:this._alg={name:"ECDH",namedCurve:"P-256"},this._nPk=65,this._nSk=32,this._nDh=32,this._order=de,this._bitmask=255,this._pkcs8AlgId=fe;break;case 17:this._alg={name:"ECDH",namedCurve:"P-384"},this._nPk=97,this._nSk=48,this._nDh=48,this._order=le,this._bitmask=255,this._pkcs8AlgId=ve;break;default:this._alg={name:"ECDH",namedCurve:"P-521"},this._nPk=133,this._nSk=66,this._nDh=66,this._order=pe,this._bitmask=1,this._pkcs8AlgId=ge}}async serializePublicKey(e){await this._setup();try{return await this._api.exportKey("raw",e)}catch(e){throw new y(e)}}async deserializePublicKey(e){await this._setup();try{return await this._importRawKey(e,!0)}catch(e){throw new b(e)}}async serializePrivateKey(e){await this._setup();try{const t=await this._api.exportKey("jwk",e);if(!("d"in t))throw new Error("Not private key");return function(e){const t=e.replace(/-/g,"+").replace(/_/g,"/"),r=atob(t),i=new Uint8Array(r.length);for(let e=0;e<r.length;e++)i[e]=r.charCodeAt(e);return i}(t.d)}catch(e){throw new y(e)}}async deserializePrivateKey(e){await this._setup();try{return await this._importRawKey(e,!1)}catch(e){throw new b(e)}}async importKey(e,t,r){await this._setup();try{if("raw"===e)return await this._importRawKey(t,r);if(t instanceof ArrayBuffer)throw new Error("Invalid jwk key format");return await this._importJWK(t,r)}catch(e){throw new b(e)}}async generateKeyPair(){await this._setup();try{return await this._api.generateKey(this._alg,!0,ae)}catch(e){throw new E(e)}}async deriveKeyPair(e){await this._setup();try{const t=await this._hkdf.labeledExtract(N,ce,new Uint8Array(e)),r=new ue(this._nSk);for(let e=0;r.isZero()||!r.lessThan(this._order);e++){if(e>255)throw new Error("Faild to derive a key pair");const i=new Uint8Array(await this._hkdf.labeledExpand(t,he,U(e,1),this._nSk));i[0]=i[0]&this._bitmask,r.set(i)}const i=await this._deserializePkcs8Key(r.val());return r.reset(),{privateKey:i,publicKey:await this.derivePublicKey(i)}}catch(e){throw new R(e)}}async derivePublicKey(e){await this._setup();try{const t=await this._api.exportKey("jwk",e);return delete t.d,delete t.key_ops,await this._api.importKey("jwk",t,this._alg,!0,[])}catch(e){throw new b(e)}}async dh(e,t){try{return await this._setup(),await this._api.deriveBits({name:"ECDH",public:t},e,8*this._nDh)}catch(e){throw new y(e)}}async _importRawKey(e,t){if(t&&e.byteLength!==this._nPk)throw new Error("Invalid public key for the ciphersuite");if(!t&&e.byteLength!==this._nSk)throw new Error("Invalid private key for the ciphersuite");return t?await this._api.importKey("raw",e,this._alg,!0,[]):await this._deserializePkcs8Key(new Uint8Array(e))}async _importJWK(e,t){if(void 0===e.crv||e.crv!==this._alg.namedCurve)throw new Error(`Invalid crv: ${e.crv}`);if(t){if(void 0!==e.d)throw new Error("Invalid key: `d` should not be set");return await this._api.importKey("jwk",e,this._alg,!0,[])}if(void 0===e.d)throw new Error("Invalid key: `d` not found");return await this._api.importKey("jwk",e,this._alg,!0,ae)}async _deserializePkcs8Key(e){const t=new Uint8Array(this._pkcs8AlgId.length+e.length);return t.set(this._pkcs8AlgId,0),t.set(e,this._pkcs8AlgId.length),await this._api.importKey("pkcs8",t,this._alg,!0,ae)}}class ye extends se{constructor(){const e=new re;super(16,new me(16,e),e),Object.defineProperty(this,"id",{enumerable:!0,configurable:!0,writable:!0,value:16}),Object.defineProperty(this,"secretSize",{enumerable:!0,configurable:!0,writable:!0,value:32}),Object.defineProperty(this,"encSize",{enumerable:!0,configurable:!0,writable:!0,value:65}),Object.defineProperty(this,"publicKeySize",{enumerable:!0,configurable:!0,writable:!0,value:65}),Object.defineProperty(this,"privateKeySize",{enumerable:!0,configurable:!0,writable:!0,value:32})}}class be extends Z{}class Se extends ye{}class Ce extends re{}const we=function(e){if(!function(e){return("string"==typeof e||"number"==typeof e)&&/^(-)?0x[0-9a-f]*$/i.test(e)}(e))throw new Error('The parameter "'+e+'" must be a valid HEX string.');for(var t="",r=0,i=(e=(e=(e=(e=(e=e.replace(/^0x/i,"")).replace(/^(?:00)*/,"")).split("").reverse().join("")).replace(/^(?:00)*/,"")).split("").reverse().join("")).length,n=0;n<i;n+=2)r=parseInt(e.slice(n,n+2),16),t+=String.fromCharCode(r);return d.decode(t)},Pe=e=>"bigint"==typeof e||"number"==typeof e?parseInt(e.toString()):"string"==typeof e&&e.includes("0x")?parseInt(e,16):parseInt(e,10),Ae=(e={},t="")=>void 0===e[t]||null===e[t],Ie=e=>null==e,Re=e=>"compileMessage"in e&&"function"==typeof e.compileMessage&&"legacy"===e.compileMessage().version?{serializedTransactionMessage:"0x"+e.serializeMessage().toString("hex")}:!("message"in e)||void 0===e.message||0!==e.message.version&&"legacy"!==e.message.version?e:(e=>{const t=e.message.serialize();return{serializedTransactionMessage:"0x"+Array.from(new Uint8Array(t)).map(e=>e.toString(16).padStart(2,"0")).join("")}})(e),Ee=e=>{const t=e.replace(/-/g,"+").replace(/_/g,"/"),r=atob(t),i=new Uint8Array(r.length);for(let e=0;e<r.length;e++)i[e]=r.charCodeAt(e);return i},Te=[];class Me{constructor(e,t,i=!1){this.initializeFrame=(e,t=!1)=>{!this.allowParallelExecution&&Te.length>0&&(console.debug("Removing old frames"),Te.forEach(e=>{try{e.reject({status:s.OPERATION_CANCELLED}),u(e.iframe)}catch(e){console.error("Error while removing old frame",e)}}),Te.length=0),this.iframe=function(e){const t=document.createElement("iframe");return t.setAttribute("id","metakeep-iframe"),t.setAttribute("src",e),t.setAttribute("allow","publickey-credentials-create *; publickey-credentials-get *; clipboard-write;"),t}(e),function(e){if(!document.getElementById("metakeep-iframe-style")){const e=document.head||document.getElementsByTagName("head")[0],t=document.createElement("style");t.setAttribute("id","metakeep-iframe-style"),t.textContent="#metakeep-iframe {width:0;height:0;position:fixed;top:0;left:0;border:none;z-index:99999;color-scheme:light;};",e.appendChild(t)}document.body.appendChild(e)}(this.iframe),t&&this.postMessageOnFrameReady()},this.makeFrameVisible=()=>{this.iframe.style.width="100%",this.iframe.style.height="100%"},this.postMessageOnFrameReady=()=>{h(r.MESSAGE,(e,t)=>{const{origin:i="",data:n={},source:o}=e,{eventType:s=""}=n;i===this.frameOrigin&&o===this.iframe.contentWindow&&s===r.FRAME_READY&&(this.iframe.contentWindow.postMessage({eventType:r.SDK_MESSAGE,payload:this.payload,client:this.client},this.frameOrigin),t())})},this.frameEventHandler=()=>new Promise((e,t)=>{this.allowParallelExecution||Te.push({iframe:this.iframe,reject:t}),h(r.MESSAGE,(i,n)=>{const{origin:o,source:s,data:a}=i;if(o!==this.frameOrigin||s!==this.iframe.contentWindow)return;const{payload:c={},eventType:h,removeFrame:d}=a;if(h===r.MAKE_FRAME_VISIBLE&&this.makeFrameVisible(),h!==r.SUCCESS&&h!==r.ERROR||(h===r.SUCCESS?e(c):t(c)),h===r.CLOSE_FRAME||d){n(),u(this.iframe);const e=Te.findIndex(e=>e.iframe===this.iframe);-1!==e&&Te.splice(e,1)}})}),this.frameOrigin=e,this.payload=t,this.client={type:"WEB",version:"2.2.8"},this.allowParallelExecution=i}}const ke=async(e,t)=>{const r=`${t}/widget`,n=Object.assign(Object.assign({},e),{widgetType:i.APPROVAl}),{initializeFrame:o,frameEventHandler:s}=new Me(t,n);return o(r,!0),s()},Oe=async(e,t)=>{const r=`${t}/widget`,n=Object.assign(Object.assign({},e),{widgetType:i.LOGIN}),{initializeFrame:o,frameEventHandler:s}=new Me(t,n);return o(r,!0),s()};class _e{constructor(){this.mutex=Promise.resolve()}async run(e){return new Promise((t,r)=>{this.mutex=this.mutex.then(async()=>{try{t(await e())}catch(e){r(e)}})})}}var xe;class Ne{constructor(e){var t=function(e,t){var r={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(r[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(i=Object.getOwnPropertySymbols(e);n<i.length;n++)t.indexOf(i[n])<0&&Object.prototype.propertyIsEnumerable.call(e,i[n])&&(r[i[n]]=e[i[n]])}return r}(e,[]);this.connected=!1,this.accounts=[],this.chainId=137,this.rpcNodeUrls={},this.connectMutex=new _e,this.signMessage=t.signMessage,this.signTransaction=t.signTransaction,this.signTypedData=t.signTypedData,this.loginUser=t.loginUser,this.rpcNodeUrls=t.rpcNodeUrls,this.getUser=t.getUser,this.setUser=t.setUser}async request(e){console.debug("EthereumProvider request",e),this.connected||await this.enable();try{switch(e.method){case"eth_requestAccounts":case"eth_accounts":return this.accounts.length?this.accounts:await this.enable();case"eth_signTypedData_v3":case"eth_signTypedData":case"eth_signTypedData_v4":case"personal_sign":case"eth_signTransaction":case"eth_sign":return await this.handleSign(e);case"eth_sendTransaction":return await this.handleSendTransaction(e);case"wallet_switchEthereumChain":const{chainId:t}=e.params[0];return await this.handleSwitchChain(t);default:return await this.rpcHandler(e)}}catch(e){throw e}}async handleSwitchChain(e){if(this.chainId=Pe(e),this.rpcNodeUrl=this.rpcNodeUrls[this.chainId],!this.rpcNodeUrl)throw new Error(`No available RPC node for chain Id ${this.chainId}`);const t=Pe(await this.getChainId());if(this.chainId!==t)throw new Error(`RPC node chainId ${t} does not match given chain Id ${this.chainId}`)}async handleSendTransaction({params:e}){let t=Object.assign({},e[0]);Ae(t,"nonce")&&(t.nonce=await this.getTransactionCount()),Ae(t,"chainId")&&(t.chainId=await this.getChainId()),Ae(t,"gasLimit")&&Ae(t,"gas")&&(t.gas=await this.estimateGas(t));const r=((e={})=>!Ie(e)&&(Ie(e.type)?!Ie(e.maxPriorityFeePerGas)||!Ie(e.maxFeePerGas):2===Pe(e.type)))(t);!r&&Ae(t,"gasPrice")&&(t.gasPrice=await this.getGasPrice()),r&&(t=await(async(e={},t)=>{if(Ie(e.maxPriorityFeePerGas)&&(e.maxPriorityFeePerGas="0x"+BigInt("1000000000").toString(16)),Ie(e.maxFeePerGas)){const r=await t();e.maxFeePerGas="0x"+(BigInt(r.baseFeePerGas)*BigInt(2)+BigInt(e.maxPriorityFeePerGas)).toString(16)}return e})(t,async()=>await this.getBlock("latest",!1)));const{signedRawTransaction:i}=await this.signTransaction(t,"sign a transaction");return await this.rpcHandler({method:"eth_sendRawTransaction",params:[i]})}async getChainId(){return await this.rpcHandler({method:"eth_chainId",params:[]})}async getGasPrice(){return await this.rpcHandler({method:"eth_gasPrice",params:[]})}async estimateGas(e){"number"!=typeof e.chainId&&e.chainId.startsWith("0x")||(e.chainId=`0x${e.chainId.toString(16)}`);const t=1.2*await this.rpcHandler({method:"eth_estimateGas",params:[e]});return Math.round(t)}async getTransactionCount(){return await this.rpcHandler({method:"eth_getTransactionCount",params:[this.accounts[0],"latest"]})}async getBlock(e="latest",t=!1){return await this.rpcHandler({method:"eth_getBlockByNumber",params:[e,t]})}async handleSign({method:e,params:t}){if(Array.isArray(t)){if("eth_sign"===e)return(await this.signMessage(we(t[1]),"sign a message")).signature;if("eth_signTypedData"===e||"eth_signTypedData_v4"===e)return await this.signTypedData((r=t[1],"string"==typeof r?JSON.parse(r):r),"sign typed data");var r;if("eth_signTransaction"===e){const e=await this.signTransaction(t[0],"sign a transaction");return((e,t)=>{const{transactionHash:r,signedRawTransaction:i,v:n,r:o,s}=t;return{raw:i,tx:Object.assign(Object.assign({},e),{v:n,r:o,s,hash:r})}})(t[0],e)}if("personal_sign"===e)return(await this.signMessage(we(t[0]),"sign a message")).signature;throw new Error("Method not implemented")}}async rpcHandler(e){var t;if(!this.rpcNodeUrl)throw new Error("RPC is not set");const r=await fetch(this.rpcNodeUrl,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(Object.assign({id:1,jsonrpc:"2.0"},e))}),i=await r.json();if(i&&i.error)throw(null===(t=i.error)||void 0===t?void 0:t.message)||"Something Went wrong";return i.result}async enable(){return await this.connectMutex.run(async()=>{if(this.connected)return this.accounts;try{const e=await this.loginUser({user:this.getUser()}),{wallet:t,user:r={}}=e,{ethAddress:i}=t;return this.accounts=[i],this.connected=!0,this.setUser(r),Promise.resolve(this.accounts)}catch(e){return Promise.reject(e)}})}}xe=Ne,Ne.getNewProvider=async e=>{const t=new xe(e);return await t.handleSwitchChain(e.chainId),t};class De{constructor(r){var n;this.getUser=()=>this.user,this.setUser=e=>{this.user=e},this.getConsent=async e=>{if(!e)throw Error("Consent token is required");return await(async(e,t)=>{const r=`${t}/widget`,n=Object.assign(Object.assign({},e),{widgetType:i.CONSENT}),{initializeFrame:o,frameEventHandler:s}=new Me(t,n);return o(r,!0),s()})({consentToken:e,appId:this.appId,internalOptions:this.internalOptions},this.frameOrigin)},this.signMessage=async(e,r)=>{if(!e)throw Error("Message is required");const i={payload:e,type:t.SIGN_MESSAGE,user:this.getUser()||{},reason:r,appId:this.appId,internalOptions:this.internalOptions};return await ke(i,this.frameOrigin)},this.signTransaction=async(e,r)=>{if(!e)throw Error("Transaction object is required");const i={payload:e=Re(e),type:t.SIGN_TRANSACTION,user:this.getUser()||{},reason:r,appId:this.appId,internalOptions:this.internalOptions};return await ke(i,this.frameOrigin)},this.signTransactionMultiple=async(e,r)=>{let i=[];for(let t=0;t<e.length;t++){let r=Re(e[t].transactionObject);i.push({transactionObject:r,reason:e[t].reason})}const n={payload:i,reason:r,type:t.SIGN_TRANSACTION_MULTIPLE,user:this.getUser()||{},appId:this.appId,internalOptions:this.internalOptions};return await ke(n,this.frameOrigin)},this.signTypedData=async(e,r)=>{if(!e)throw Error("Typed data is required");const i={payload:e,type:t.SIGN_TYPED_DATA,user:this.getUser()||{},reason:r,appId:this.appId,internalOptions:this.internalOptions};return await ke(i,this.frameOrigin)},this.loginUser=async(e={})=>await Oe(Object.assign(Object.assign({},e),{appId:this.appId,internalOptions:this.internalOptions}),this.frameOrigin),this.getWallet=async()=>await Oe({user:this.getUser()||{},appId:this.appId,internalOptions:this.internalOptions},this.frameOrigin),this.decrypt=async({encryptedData:e,description:r})=>{var i,n;if(!e)throw Error("Encrypted data is required.");if(!(null==r?void 0:r.text))throw new Error("Description text is required.");const o=new be({kem:new Se,kdf:new Ce,aead:new _}),a=await o.kem.generateKeyPair(),u={type:t.DECRYPT,payload:{encryptedData:e,endToEndEncryption:{hpkeDhkemP256:{recipientPublicKey:(h=await crypto.subtle.exportKey("raw",a.publicKey),btoa(String.fromCharCode(...new Uint8Array(h))))}}},user:this.getUser()||{},description:r,appId:this.appId,internalOptions:this.internalOptions};var h;const d=await ke(u,this.frameOrigin),l=new(c().ec)("p256");if(!(null===(n=null===(i=null==d?void 0:d.endToEndEncryption)||void 0===i?void 0:i.hpkeDhkemP256)||void 0===n?void 0:n.senderPublicKey))throw new Error("Sender public key not found in response.");try{const e=l.keyFromPublic(Ee(d.endToEndEncryption.hpkeDhkemP256.senderPublicKey)).getPublic(!1,"array");if(!a.privateKey)throw new Error("Recipient private key is required.");const t=await(async({encryptedData:e,recipientKey:t,encappedKey:r})=>{const i=new be({kem:new Se,kdf:new Ce,aead:new _}),n=await i.kem.importKey("jwk",JSON.parse('{"crv":"P-256","key_ops":["verify"],"kid": "b5zjGPu0mAAYebEcvj6WTBZsxqNvwD8s3IZn6QvBD20","kty": "EC","x": "iII4wfj2d79F4Ohyposzk9dGo0LrjdCVCybPbE0OpBU","y": "Un2ggw7tGpUT3yNtxiLuIgdZQKyGpXAFj8A7ICQXU3E"}'),!0),o=await i.createRecipientContext({recipientKey:t,enc:r,senderPublicKey:n});return await o.open(e)})({encryptedData:Ee(d.endToEndEncryptedData),recipientKey:a.privateKey,encappedKey:new Uint8Array(e)});return{data:t,status:d.status}}catch(e){return console.error(e),Promise.reject({status:s.SOMETHING_WENT_WRONG})}},this.prefetch=async()=>await(async(e,t)=>{const r=`${t}/widget`,n=Object.assign(Object.assign({},e),{widgetType:i.PREFETCH}),{initializeFrame:o,frameEventHandler:s}=new Me(t,n,!0);return o(r,!0),s()})({appId:this.appId,internalOptions:this.internalOptions},this.frameOrigin),this.frameOrigin=e[r.environment]||e.prod,this.user=r.user||{},this.rpcNodeUrls=r.rpcNodeUrls||{},this.chainId=r.chainId||137,this.appId=r.appId||"",this.internalOptions=r.internalOptions||{},!(null===(n=this.internalOptions)||void 0===n?void 0:n.skipPrefetch)&&this.prefetch()}get ethereum(){return(async()=>{try{const e=await Ne.getNewProvider(this);return Object.defineProperty(this,"ethereum",{value:e,writable:!1,configurable:!1,enumerable:!1}),e}catch(e){return Promise.reject(e)}})()}}})(),o})(),e.exports=t()},4524:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ConversationConnectionMessage=void 0;const i=r(868);class n extends i.ConnectionMessage{constructor(e,t,r,i){super(e,t,r,i);const n=JSON.parse(this.textBody);void 0!==n.type&&(this.privConversationMessageType=n.type)}get conversationMessageType(){return this.privConversationMessageType}}t.ConversationConnectionMessage=n},4525:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ConversationTranscriberConnectionFactory=void 0;const i=r(4378),n=r(881),o=r(9190),s=r(7778),a=r(9190),c=r(7014),u=r(9324);class h extends s.ConnectionFactoryBase{constructor(){super(...arguments),this.universalUri="/stt/speech/universal/v2"}async create(e,t,r){let o=e.parameters.getProperty(n.PropertyId.SpeechServiceConnection_Endpoint,void 0);const h=e.parameters.getProperty(n.PropertyId.SpeechServiceConnection_Region,void 0),d=s.ConnectionFactoryBase.getHostSuffix(h),l=e.parameters.getProperty(n.PropertyId.SpeechServiceConnection_Host,"wss://"+h+".stt.speech"+d),p={},f=e.parameters.getProperty(n.PropertyId.SpeechServiceConnection_EndpointId,void 0),v=e.parameters.getProperty(n.PropertyId.SpeechServiceConnection_RecoLanguage,void 0);if(f?o&&-1!==o.search(u.QueryParameterNames.CustomSpeechDeploymentId)||(p[u.QueryParameterNames.CustomSpeechDeploymentId]=f):v&&(o&&-1!==o.search(u.QueryParameterNames.Language)||(p[u.QueryParameterNames.Language]=v)),void 0!==e.autoDetectSourceLanguages&&(p[u.QueryParameterNames.EnableLanguageId]="true"),this.setV2UrlParams(e,p,o),o){const e=new URL(o),t=e.pathname;""!==t&&"/"!==t||(e.pathname=this.universalUri,o=await s.ConnectionFactoryBase.getRedirectUrlFromEndpoint(e.toString()))}o||(o=`${l}${this.universalUri}`);const g={};void 0!==t.token&&""!==t.token&&(g[t.headerName]=t.token),g[c.HeaderNames.ConnectionId]=r;const m="true"===e.parameters.getProperty("SPEECH-EnableWebsocketCompression","false"),y=new i.WebsocketConnection(o,p,g,new a.WebsocketMessageFormatter,i.ProxyInfo.fromRecognizerConfig(e),m,r),b=y.uri;return e.parameters.setProperty(n.PropertyId.SpeechServiceConnection_Url,b),y}setV2UrlParams(e,t,r){new Map([[n.PropertyId.Speech_SegmentationSilenceTimeoutMs,u.QueryParameterNames.SegmentationSilenceTimeoutMs],[n.PropertyId.SpeechServiceConnection_EnableAudioLogging,u.QueryParameterNames.EnableAudioLogging],[n.PropertyId.SpeechServiceConnection_EndSilenceTimeoutMs,u.QueryParameterNames.EndSilenceTimeoutMs],[n.PropertyId.SpeechServiceConnection_InitialSilenceTimeoutMs,u.QueryParameterNames.InitialSilenceTimeoutMs],[n.PropertyId.SpeechServiceResponse_PostProcessingOption,u.QueryParameterNames.Postprocessing],[n.PropertyId.SpeechServiceResponse_ProfanityOption,u.QueryParameterNames.Profanity],[n.PropertyId.SpeechServiceResponse_StablePartialResultThreshold,u.QueryParameterNames.StableIntermediateThreshold]]).forEach((i,n)=>{this.setUrlParameter(n,i,e,t,r)});const i=JSON.parse(e.parameters.getProperty(o.ServicePropertiesPropertyName,"{}"));Object.keys(i).forEach(e=>{t[e]=i[e]})}}t.ConversationTranscriberConnectionFactory=h},4549:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SessionEventArgs=void 0,t.SessionEventArgs=class{constructor(e){this.privSessionId=e}get sessionId(){return this.privSessionId}}},4572:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PronunciationAssessmentResult=t.ContentAssessmentResult=void 0;const i=r(5245),n=r(881);class o{constructor(e){this.privPronJson=e}get grammarScore(){return this.privPronJson.ContentAssessment.GrammarScore}get vocabularyScore(){return this.privPronJson.ContentAssessment.VocabularyScore}get topicScore(){return this.privPronJson.ContentAssessment.TopicScore}}t.ContentAssessmentResult=o;class s{constructor(e){const t=JSON.parse(e);i.Contracts.throwIfNullOrUndefined(t.NBest[0],"NBest"),this.privPronJson=t.NBest[0]}static fromResult(e){i.Contracts.throwIfNullOrUndefined(e,"result");const t=e.properties.getProperty(n.PropertyId.SpeechServiceResponse_JsonResult);return i.Contracts.throwIfNullOrUndefined(t,"json"),new s(t)}get detailResult(){return this.privPronJson}get accuracyScore(){return this.detailResult.PronunciationAssessment?.AccuracyScore}get pronunciationScore(){return this.detailResult.PronunciationAssessment?.PronScore}get completenessScore(){return this.detailResult.PronunciationAssessment?.CompletenessScore}get fluencyScore(){return this.detailResult.PronunciationAssessment?.FluencyScore}get prosodyScore(){return this.detailResult.PronunciationAssessment?.ProsodyScore}get contentAssessmentResult(){if(void 0!==this.detailResult.ContentAssessment)return new o(this.detailResult)}}t.PronunciationAssessmentResult=s},4573:()=>{},4612:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i,n=(i=r(1280))&&i.__esModule?i:{default:i};t.default=function(e){if(!(0,n.default)(e))throw TypeError("Invalid UUID");return parseInt(e.slice(14,15),16)}},4635:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TranslationRecognizer=void 0;const i=r(9190),n=r(2699),o=r(868),s=r(9112),a=r(5245),c=r(881);class u extends c.Recognizer{constructor(e,t,r){const n=e;a.Contracts.throwIfNull(n,"speechConfig"),super(t,n.properties,r||new i.TranslationConnectionFactory,e.tokenCredential),this.privDisposedTranslationRecognizer=!1,void 0!==this.properties.getProperty(c.PropertyId.SpeechServiceConnection_TranslationVoice,void 0)&&a.Contracts.throwIfNullOrWhitespace(this.properties.getProperty(c.PropertyId.SpeechServiceConnection_TranslationVoice),c.PropertyId[c.PropertyId.SpeechServiceConnection_TranslationVoice]),a.Contracts.throwIfNullOrWhitespace(this.properties.getProperty(c.PropertyId.SpeechServiceConnection_TranslationToLanguages),c.PropertyId[c.PropertyId.SpeechServiceConnection_TranslationToLanguages]),a.Contracts.throwIfNullOrWhitespace(this.properties.getProperty(c.PropertyId.SpeechServiceConnection_RecoLanguage),c.PropertyId[c.PropertyId.SpeechServiceConnection_RecoLanguage])}static FromConfig(e,t,r){const n=e;return t.properties.mergeTo(n.properties),t.properties.getProperty(c.PropertyId.SpeechServiceConnection_AutoDetectSourceLanguages,void 0)===i.AutoDetectSourceLanguagesOpenRangeOptionName&&n.properties.setProperty(c.PropertyId.SpeechServiceConnection_RecoLanguage,"en-US"),new u(e,r)}get speechRecognitionLanguage(){return a.Contracts.throwIfDisposed(this.privDisposedTranslationRecognizer),this.properties.getProperty(c.PropertyId.SpeechServiceConnection_RecoLanguage)}get targetLanguages(){return a.Contracts.throwIfDisposed(this.privDisposedTranslationRecognizer),this.properties.getProperty(c.PropertyId.SpeechServiceConnection_TranslationToLanguages).split(",")}get voiceName(){return a.Contracts.throwIfDisposed(this.privDisposedTranslationRecognizer),this.properties.getProperty(c.PropertyId.SpeechServiceConnection_TranslationVoice,void 0)}get properties(){return this.privProperties}get authorizationToken(){return this.properties.getProperty(c.PropertyId.SpeechServiceAuthorization_Token)}set authorizationToken(e){this.properties.setProperty(c.PropertyId.SpeechServiceAuthorization_Token,e)}recognizeOnceAsync(e,t){a.Contracts.throwIfDisposed(this.privDisposedTranslationRecognizer),(0,o.marshalPromiseToCallbacks)(this.recognizeOnceAsyncImpl(n.RecognitionMode.Interactive),e,t)}startContinuousRecognitionAsync(e,t){(0,o.marshalPromiseToCallbacks)(this.startContinuousRecognitionAsyncImpl(n.RecognitionMode.Conversation),e,t)}stopContinuousRecognitionAsync(e,t){(0,o.marshalPromiseToCallbacks)(this.stopContinuousRecognitionAsyncImpl(),e,t)}removeTargetLanguage(e){if(a.Contracts.throwIfNullOrUndefined(e,"language to be removed"),void 0!==this.properties.getProperty(c.PropertyId.SpeechServiceConnection_TranslationToLanguages,void 0)){const t=this.properties.getProperty(c.PropertyId.SpeechServiceConnection_TranslationToLanguages).split(","),r=t.indexOf(e);r>-1&&(t.splice(r,1),this.properties.setProperty(c.PropertyId.SpeechServiceConnection_TranslationToLanguages,t.join(",")),this.updateLanguages(t))}}addTargetLanguage(e){a.Contracts.throwIfNullOrUndefined(e,"language to be added");let t=[];void 0!==this.properties.getProperty(c.PropertyId.SpeechServiceConnection_TranslationToLanguages,void 0)?(t=this.properties.getProperty(c.PropertyId.SpeechServiceConnection_TranslationToLanguages).split(","),t.includes(e)||(t.push(e),this.properties.setProperty(c.PropertyId.SpeechServiceConnection_TranslationToLanguages,t.join(",")))):(this.properties.setProperty(c.PropertyId.SpeechServiceConnection_TranslationToLanguages,e),t=[e]),this.updateLanguages(t)}close(e,t){a.Contracts.throwIfDisposed(this.privDisposedTranslationRecognizer),(0,o.marshalPromiseToCallbacks)(this.dispose(!0),e,t)}onConnection(){}async dispose(e){this.privDisposedTranslationRecognizer||(this.privDisposedTranslationRecognizer=!0,e&&(await this.implRecognizerStop(),await super.dispose(e)))}createRecognizerConfig(e){return new i.RecognizerConfig(e,this.privProperties)}createServiceRecognizer(e,t,r,n){const o=r;return new i.TranslationServiceRecognizer(e,t,o,n,this)}updateLanguages(e){const t=s.Connection.fromRecognizer(this);t&&(t.setMessageProperty("speech.context","translationcontext",{to:e}),t.sendMessageAsync("event",JSON.stringify({id:"translation",name:"updateLanguage",to:e})))}}t.TranslationRecognizer=u},4677:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.StringUtils=void 0,t.StringUtils=class{static formatString(e,t){if(!e)return"";if(!t)return e;let r="",i="";const n=e=>{r+=e},o=e=>{i+=e};let s=n;for(let a=0;a<e.length;a++){const c=e[a],u=a+1<e.length?e[a+1]:"";switch(c){case"{":"{"===u?(s("{"),a++):s=o;break;case"}":"}"===u?(s("}"),a++):(t.hasOwnProperty(i)&&(r+=t[i]),s=n,i="");break;default:s(c)}}return r}}},4815:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ConversationWebsocketMessageFormatter=void 0;const i=r(868),n=r(4524);t.ConversationWebsocketMessageFormatter=class{toConnectionMessage(e){const t=new i.Deferred;try{if(e.messageType===i.MessageType.Text){const r=new n.ConversationConnectionMessage(e.messageType,e.textContent,{},e.id);t.resolve(r)}else e.messageType===i.MessageType.Binary&&t.resolve(new n.ConversationConnectionMessage(e.messageType,e.binaryContent,void 0,e.id))}catch(e){t.reject(`Error formatting the message. Error: ${e}`)}return t.promise}fromConnectionMessage(e){const t=new i.Deferred;try{if(e.messageType===i.MessageType.Text){const r=`${e.textBody?e.textBody:""}`;t.resolve(new i.RawWebsocketMessage(i.MessageType.Text,r,e.id))}}catch(e){t.reject(`Error formatting the message. ${e}`)}return t.promise}}},4848:(e,t,r)=>{"use strict";e.exports=r(1020)},4859:(e,t)=>{"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.CancellationReason=void 0,(r=t.CancellationReason||(t.CancellationReason={}))[r.Error=0]="Error",r[r.EndOfStream=1]="EndOfStream"},4873:(e,t)=>{"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.NextAction=void 0,(r=t.NextAction||(t.NextAction={})).None="None",r.Synthesize="Synthesize"},4877:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SpeechConnectionFactory=void 0;const i=r(4378),n=r(9190),o=r(881),s=r(7778),a=r(9190),c=r(7014),u=r(9324),h=r(2699);class d extends s.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(e,t,r){let d=e.parameters.getProperty(o.PropertyId.SpeechServiceConnection_Endpoint,void 0);const l=e.parameters.getProperty(o.PropertyId.SpeechServiceConnection_Region,void 0),p=s.ConnectionFactoryBase.getHostSuffix(l),f=e.parameters.getProperty(o.PropertyId.SpeechServiceConnection_Host,"wss://"+l+".stt.speech"+p),v={},g=e.parameters.getProperty(o.PropertyId.SpeechServiceConnection_EndpointId,void 0),m=e.parameters.getProperty(o.PropertyId.SpeechServiceConnection_RecoLanguage,void 0);if(g?d&&-1!==d.search(u.QueryParameterNames.CustomSpeechDeploymentId)||(v[u.QueryParameterNames.CustomSpeechDeploymentId]=g):m&&(d&&-1!==d.search(u.QueryParameterNames.Language)||(v[u.QueryParameterNames.Language]=m)),d&&-1!==d.search(u.QueryParameterNames.Format)||(v[u.QueryParameterNames.Format]=e.parameters.getProperty(n.OutputFormatPropertyName,o.OutputFormat[o.OutputFormat.Simple]).toLowerCase()),void 0!==e.autoDetectSourceLanguages&&(v[u.QueryParameterNames.EnableLanguageId]="true"),this.setCommonUrlParams(e,v,d),d){const t=new URL(d),r=t.pathname;""!==r&&"/"!==r||(t.pathname=this.universalUri+e.recognitionEndpointVersion,d=await s.ConnectionFactoryBase.getRedirectUrlFromEndpoint(t.toString()))}if(!d)switch(e.recognitionMode){case h.RecognitionMode.Conversation:d="true"===e.parameters.getProperty(n.ForceDictationPropertyName,"false")?f+this.dictationRelativeUri:void 0!==e.recognitionEndpointVersion&&parseInt(e.recognitionEndpointVersion,10)>1?`${f}${this.universalUri}${e.recognitionEndpointVersion}`:f+this.conversationRelativeUri;break;case h.RecognitionMode.Dictation:d=f+this.dictationRelativeUri;break;default:d=void 0!==e.recognitionEndpointVersion&&parseInt(e.recognitionEndpointVersion,10)>1?`${f}${this.universalUri}${e.recognitionEndpointVersion}`:f+this.interactiveRelativeUri}const y={};void 0!==t.token&&""!==t.token&&(y[t.headerName]=t.token),y[c.HeaderNames.ConnectionId]=r,y.connectionId=r;const b="true"===e.parameters.getProperty("SPEECH-EnableWebsocketCompression","false"),S=new i.WebsocketConnection(d,v,y,new a.WebsocketMessageFormatter,i.ProxyInfo.fromRecognizerConfig(e),b,r),C=S.uri;return e.parameters.setProperty(o.PropertyId.SpeechServiceConnection_Url,C),S}}t.SpeechConnectionFactory=d},4884:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SpeakerAudioDestination=void 0;const i=r(868),n=r(8640),o=r(8698),s={[o.AudioFormatTag.PCM]:"audio/wav",[o.AudioFormatTag.MuLaw]:"audio/x-wav",[o.AudioFormatTag.MP3]:"audio/mpeg",[o.AudioFormatTag.OGG_OPUS]:"audio/ogg",[o.AudioFormatTag.WEBM_OPUS]:"audio/webm; codecs=opus",[o.AudioFormatTag.ALaw]:"audio/x-wav",[o.AudioFormatTag.FLAC]:"audio/flac",[o.AudioFormatTag.AMR_WB]:"audio/amr-wb",[o.AudioFormatTag.G722]:"audio/G722"};t.SpeakerAudioDestination=class{constructor(e){this.privPlaybackStarted=!1,this.privAppendingToBuffer=!1,this.privMediaSourceOpened=!1,this.privBytesReceived=0,this.privId=e||(0,i.createNoDashGuid)(),this.privIsPaused=!1,this.privIsClosed=!1}id(){return this.privId}write(e,t,r){void 0!==this.privAudioBuffer?(this.privAudioBuffer.push(e),this.updateSourceBuffer().then(()=>{t&&t()},e=>{r&&r(e)})):void 0!==this.privAudioOutputStream&&(this.privAudioOutputStream.write(e),this.privBytesReceived+=e.byteLength)}close(e,t){if(this.privIsClosed=!0,void 0!==this.privSourceBuffer)this.handleSourceBufferUpdateEnd().then(()=>{e&&e()},e=>{t&&t(e)});else if(void 0!==this.privAudioOutputStream&&"undefined"!=typeof window)if(this.privFormat.formatTag!==o.AudioFormatTag.PCM&&this.privFormat.formatTag!==o.AudioFormatTag.MuLaw&&this.privFormat.formatTag!==o.AudioFormatTag.ALaw||!1!==this.privFormat.hasHeader){let r=new ArrayBuffer(this.privBytesReceived);this.privAudioOutputStream.read(r).then(()=>{r=this.privFormat.addHeader(r);const i=new Blob([r],{type:s[this.privFormat.formatTag]});this.privAudio.src=window.URL.createObjectURL(i),this.notifyPlayback().then(()=>{e&&e()},e=>{t&&t(e)})},e=>{t&&t(e)})}else console.warn("Play back is not supported for raw PCM, mulaw or alaw format without header."),this.onAudioEnd&&this.onAudioEnd(this);else this.onAudioEnd&&this.onAudioEnd(this)}set format(e){if("undefined"!=typeof AudioContext||"undefined"!=typeof window&&void 0!==window.webkitAudioContext){this.privFormat=e;const t=s[this.privFormat.formatTag];void 0===t?console.warn(`Unknown mimeType for format ${o.AudioFormatTag[this.privFormat.formatTag]}; playback is not supported.`):"undefined"!=typeof MediaSource&&MediaSource.isTypeSupported(t)?(this.privAudio=new Audio,this.privAudioBuffer=[],this.privMediaSource=new MediaSource,this.privAudio.src=URL.createObjectURL(this.privMediaSource),this.privAudio.load(),this.privMediaSource.onsourceopen=()=>{this.privMediaSourceOpened=!0,this.privMediaSource.duration=1800,this.privSourceBuffer=this.privMediaSource.addSourceBuffer(t),this.privSourceBuffer.onupdate=()=>{this.updateSourceBuffer().catch(e=>{i.Events.instance.onEvent(new i.BackgroundEvent(e))})},this.privSourceBuffer.onupdateend=()=>{this.handleSourceBufferUpdateEnd().catch(e=>{i.Events.instance.onEvent(new i.BackgroundEvent(e))})},this.privSourceBuffer.onupdatestart=()=>{this.privAppendingToBuffer=!1}},this.updateSourceBuffer().catch(e=>{i.Events.instance.onEvent(new i.BackgroundEvent(e))})):(console.warn(`Format ${o.AudioFormatTag[this.privFormat.formatTag]} could not be played by MSE, streaming playback is not enabled.`),this.privAudioOutputStream=new n.PullAudioOutputStreamImpl,this.privAudioOutputStream.format=this.privFormat,this.privAudio=new Audio)}}get volume(){return this.privAudio?.volume??-1}set volume(e){this.privAudio&&(this.privAudio.volume=e)}mute(){this.privAudio&&(this.privAudio.muted=!0)}unmute(){this.privAudio&&(this.privAudio.muted=!1)}get isClosed(){return this.privIsClosed}get currentTime(){return void 0!==this.privAudio?this.privAudio.currentTime:-1}pause(){this.privIsPaused||void 0===this.privAudio||(this.privAudio.pause(),this.privIsPaused=!0)}resume(e,t){this.privIsPaused&&void 0!==this.privAudio&&(this.privAudio.play().then(()=>{e&&e()},e=>{t&&t(e)}),this.privIsPaused=!1)}get internalAudio(){return this.privAudio}async updateSourceBuffer(){if(void 0!==this.privAudioBuffer&&this.privAudioBuffer.length>0&&this.sourceBufferAvailable()){this.privAppendingToBuffer=!0;const e=this.privAudioBuffer.shift();try{this.privSourceBuffer.appendBuffer(e)}catch(t){return this.privAudioBuffer.unshift(e),void console.log("buffer filled, pausing addition of binaries until space is made")}await this.notifyPlayback()}else this.canEndStream()&&await this.handleSourceBufferUpdateEnd()}async handleSourceBufferUpdateEnd(){this.canEndStream()&&this.sourceBufferAvailable()&&(this.privMediaSource.endOfStream(),await this.notifyPlayback())}async notifyPlayback(){this.privPlaybackStarted||void 0===this.privAudio||(this.privPlaybackStarted=!0,this.onAudioStart&&this.onAudioStart(this),this.privAudio.onended=()=>{this.onAudioEnd&&this.onAudioEnd(this)},this.privIsPaused||await this.privAudio.play())}canEndStream(){return this.isClosed&&void 0!==this.privSourceBuffer&&0===this.privAudioBuffer.length&&this.privMediaSourceOpened&&!this.privAppendingToBuffer&&"open"===this.privMediaSource.readyState}sourceBufferAvailable(){return void 0!==this.privSourceBuffer&&!this.privSourceBuffer.updating}}},5027:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SpeakerServiceRecognizer=void 0;const i=r(4378),n=r(868),o=r(881),s=r(9190),a=r(4081);class c extends s.ServiceRecognizerBase{constructor(e,t,r,i,n){super(e,t,r,i,n),this.privSpeakerRecognizer=n,this.privSpeakerAudioSource=r,this.recognizeSpeaker=e=>this.recognizeSpeakerOnce(e),this.sendPrePayloadJSONOverride=()=>this.noOp()}processTypeSpecificMessages(e){let t=!1;const r=new o.PropertyCollection;if(e.messageType===n.MessageType.Text&&r.setProperty(o.PropertyId.SpeechServiceResponse_JsonResult,e.textBody),"speaker.response"===e.path.toLowerCase()){const r=JSON.parse(e.textBody);let i;i="success"!==r.status.statusCode.toLowerCase()?new o.SpeakerRecognitionResult(r,o.ResultReason.Canceled,o.CancellationErrorCode.ServiceError,r.status.reason):new o.SpeakerRecognitionResult(r,o.ResultReason.RecognizedSpeaker),this.privResultDeferral&&this.privResultDeferral.resolve(i),t=!0}const i=new n.Deferred;return i.resolve(t),i.promise}cancelRecognition(e,t,r,i,n){if((new o.PropertyCollection).setProperty(s.CancellationErrorCodePropertyName,o.CancellationErrorCode[i]),this.privResultDeferral){const e=new o.SpeakerRecognitionResult({scenario:this.privSpeakerModel.scenario,status:{statusCode:n,reason:n}},o.ResultReason.Canceled,i,n);try{this.privResultDeferral.resolve(e)}catch(n){this.privResultDeferral.reject(n)}}}async recognizeSpeakerOnce(e){this.privSpeakerModel=e,this.voiceProfileType=e.scenario,this.privResultDeferral||(this.privResultDeferral=new n.Deferred),this.privRequestSession.startNewRecognition(),this.privRequestSession.listenForServiceTelemetry(this.privSpeakerAudioSource.events),this.privRecognizerConfig.parameters.setProperty(o.PropertyId.Speech_SessionId,this.privRequestSession.sessionId);const t=this.connectImpl(),r=this.sendPreAudioMessages(this.extractSpeakerContext(e)),s=await this.privSpeakerAudioSource.attach(this.privRequestSession.audioNodeId),a=await this.privSpeakerAudioSource.format,c=await this.privSpeakerAudioSource.deviceInfo,u=new i.ReplayableAudioNode(s,a.avgBytesPerSec);await this.privRequestSession.onAudioSourceAttachCompleted(u,!1),this.privRecognizerConfig.SpeechServiceConfig.Context.audio={source:c};try{await t,await r}catch(e){this.cancelRecognition(this.privRequestSession.sessionId,this.privRequestSession.requestId,o.CancellationReason.Error,o.CancellationErrorCode.ConnectionFailure,e)}const h=new o.SessionEventArgs(this.privRequestSession.sessionId);return this.privRecognizer.sessionStarted&&this.privRecognizer.sessionStarted(this.privRecognizer,h),this.receiveMessage(),this.sendAudio(u).then(()=>{},e=>{this.cancelRecognition(this.privRequestSession.sessionId,this.privRequestSession.requestId,o.CancellationReason.Error,o.CancellationErrorCode.RuntimeError,e)}),this.privResultDeferral.promise}async sendPreAudioMessages(e){const t=await this.fetchConnection();await this.sendSpeakerRecognition(t,e)}async sendSpeakerRecognition(e,t){const r=JSON.stringify(t);return e.send(new a.SpeechConnectionMessage(n.MessageType.Text,"speaker.context",this.privRequestSession.requestId,"application/json; charset=utf-8",r))}extractSpeakerContext(e){return{features:{interimResult:"enabled",progressiveDetection:"disabled"},profileIds:e.profileIds,scenario:e.scenario}}}t.SpeakerServiceRecognizer=c},5054:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ConversationImpl=t.Conversation=void 0;const i=r(9190),n=r(868),o=r(5245),s=r(881);class a{constructor(){}static createConversationAsync(e,t,r,a){let u,h,d;return o.Contracts.throwIfNullOrUndefined(e,i.ConversationConnectionConfig.restErrors.invalidArgs.replace("{arg}","config")),o.Contracts.throwIfNullOrUndefined(e.region,i.ConversationConnectionConfig.restErrors.invalidArgs.replace("{arg}","SpeechServiceConnection_Region")),e.subscriptionKey||e.getProperty(s.PropertyId[s.PropertyId.SpeechServiceAuthorization_Token])||o.Contracts.throwIfNullOrUndefined(e.subscriptionKey,i.ConversationConnectionConfig.restErrors.invalidArgs.replace("{arg}","SpeechServiceConnection_Key")),"string"==typeof t?(u=new c(e,t),(0,n.marshalPromiseToCallbacks)((async()=>{})(),r,a)):(u=new c(e),h=t,d=r,u.createConversationAsync(()=>{h&&h()},e=>{d&&d(e)})),u}}t.Conversation=a;class c extends a{constructor(e,t){if(super(),this.privErrors=i.ConversationConnectionConfig.restErrors,this.onConnected=e=>{this.privIsConnected=!0;try{this.privConversationTranslator?.sessionStarted&&this.privConversationTranslator.sessionStarted(this.privConversationTranslator,e)}catch(e){}},this.onDisconnected=e=>{try{this.privConversationTranslator?.sessionStopped&&this.privConversationTranslator.sessionStopped(this.privConversationTranslator,e)}catch(e){}finally{this.close(!1)}},this.onCanceled=(e,t)=>{try{this.privConversationTranslator?.canceled&&this.privConversationTranslator.canceled(this.privConversationTranslator,t)}catch(t){}},this.onParticipantUpdateCommandReceived=(e,t)=>{try{const e=this.privParticipants.getParticipant(t.id);if(void 0!==e){switch(t.key){case i.ConversationTranslatorCommandTypes.changeNickname:e.displayName=t.value;break;case i.ConversationTranslatorCommandTypes.setUseTTS:e.isUsingTts=t.value;break;case i.ConversationTranslatorCommandTypes.setProfanityFiltering:e.profanity=t.value;break;case i.ConversationTranslatorCommandTypes.setMute:e.isMuted=t.value;break;case i.ConversationTranslatorCommandTypes.setTranslateToLanguages:e.translateToLanguages=t.value}this.privParticipants.addOrUpdateParticipant(e),this.privConversationTranslator&&this.privConversationTranslator.participantsChanged(this.privConversationTranslator,new s.ConversationParticipantsChangedEventArgs(s.ParticipantChangedReason.Updated,[this.toParticipant(e)],t.sessionId))}}catch(t){}},this.onLockRoomCommandReceived=()=>{},this.onMuteAllCommandReceived=(e,t)=>{try{this.privParticipants.participants.forEach(e=>e.isMuted=!e.isHost&&t.isMuted),this.privConversationTranslator&&this.privConversationTranslator.participantsChanged(this.privConversationTranslator,new s.ConversationParticipantsChangedEventArgs(s.ParticipantChangedReason.Updated,this.toParticipants(!1),t.sessionId))}catch(t){}},this.onParticipantJoinCommandReceived=(e,t)=>{try{const e=this.privParticipants.addOrUpdateParticipant(t.participant);void 0!==e&&this.privConversationTranslator&&this.privConversationTranslator.participantsChanged(this.privConversationTranslator,new s.ConversationParticipantsChangedEventArgs(s.ParticipantChangedReason.JoinedConversation,[this.toParticipant(e)],t.sessionId))}catch(t){}},this.onParticipantLeaveCommandReceived=(e,t)=>{try{const e=this.privParticipants.getParticipant(t.participant.id);void 0!==e&&(this.privParticipants.deleteParticipant(t.participant.id),this.privConversationTranslator&&this.privConversationTranslator.participantsChanged(this.privConversationTranslator,new s.ConversationParticipantsChangedEventArgs(s.ParticipantChangedReason.LeftConversation,[this.toParticipant(e)],t.sessionId)))}catch(t){}},this.onTranslationReceived=(e,t)=>{try{switch(t.command){case i.ConversationTranslatorMessageTypes.final:this.privConversationTranslator&&this.privConversationTranslator.transcribed(this.privConversationTranslator,new s.ConversationTranslationEventArgs(t.payload,void 0,t.sessionId));break;case i.ConversationTranslatorMessageTypes.partial:this.privConversationTranslator&&this.privConversationTranslator.transcribing(this.privConversationTranslator,new s.ConversationTranslationEventArgs(t.payload,void 0,t.sessionId));break;case i.ConversationTranslatorMessageTypes.instantMessage:this.privConversationTranslator&&this.privConversationTranslator.textMessageReceived(this.privConversationTranslator,new s.ConversationTranslationEventArgs(t.payload,void 0,t.sessionId))}}catch(t){}},this.onParticipantsListReceived=(e,t)=>{try{if(void 0!==t.sessionToken&&null!==t.sessionToken&&(this.privRoom.token=t.sessionToken),this.privParticipants.participants=[...t.participants],void 0!==this.privParticipants.me&&(this.privIsReady=!0),this.privConversationTranslator&&this.privConversationTranslator.participantsChanged(this.privConversationTranslator,new s.ConversationParticipantsChangedEventArgs(s.ParticipantChangedReason.JoinedConversation,this.toParticipants(!0),t.sessionId)),this.me.isHost){const e=this.privConversationTranslator?.properties.getProperty(s.PropertyId.ConversationTranslator_Name);void 0!==e&&e.length>0&&e!==this.me.displayName&&this.changeNicknameAsync(e)}}catch(t){}},this.onConversationExpiration=(e,t)=>{try{this.privConversationTranslator&&this.privConversationTranslator.conversationExpiration(this.privConversationTranslator,t)}catch(t){}},this.privIsConnected=!1,this.privIsDisposed=!1,this.privConversationId="",this.privProperties=new s.PropertyCollection,this.privManager=new i.ConversationManager,e.getProperty(s.PropertyId[s.PropertyId.SpeechServiceConnection_RecoLanguage])||e.setProperty(s.PropertyId[s.PropertyId.SpeechServiceConnection_RecoLanguage],i.ConversationConnectionConfig.defaultLanguageCode),this.privLanguage=e.getProperty(s.PropertyId[s.PropertyId.SpeechServiceConnection_RecoLanguage]),t)this.privConversationId=t;else{0===e.targetLanguages.length&&e.addTargetLanguage(this.privLanguage),e.getProperty(s.PropertyId[s.PropertyId.SpeechServiceResponse_ProfanityOption])||e.setProfanity(s.ProfanityOption.Masked);let t=e.getProperty(s.PropertyId[s.PropertyId.ConversationTranslator_Name]);null==t&&(t="Host"),o.Contracts.throwIfNullOrTooLong(t,"nickname",50),o.Contracts.throwIfNullOrTooShort(t,"nickname",2),e.setProperty(s.PropertyId[s.PropertyId.ConversationTranslator_Name],t)}this.privConfig=e;const r=e;o.Contracts.throwIfNull(r,"speechConfig"),this.privProperties=r.properties.clone(),this.privIsConnected=!1,this.privParticipants=new i.InternalParticipants,this.privIsReady=!1,this.privTextMessageMaxLength=1e3}get room(){return this.privRoom}get connection(){return this.privConversationRecognizer}get config(){return this.privConfig}get conversationId(){return this.privRoom?this.privRoom.roomId:this.privConversationId}get properties(){return this.privProperties}get speechRecognitionLanguage(){return this.privLanguage}get isMutedByHost(){return!this.privParticipants.me?.isHost&&this.privParticipants.me?.isMuted}get isConnected(){return this.privIsConnected&&this.privIsReady}get participants(){return this.toParticipants(!0)}get me(){return this.toParticipant(this.privParticipants.me)}get host(){return this.toParticipant(this.privParticipants.host)}get transcriberRecognizer(){return this.privTranscriberRecognizer}get conversationInfo(){const e=this.conversationId,t=this.participants.map(e=>({id:e.id,preferredLanguage:e.preferredLanguage,voice:e.voice})),r={};for(const e of i.ConversationConnectionConfig.transcriptionEventKeys){const t=this.properties.getProperty(e,"");""!==t&&(r[e]=t)}return{id:e,participants:t,conversationProperties:r}}get canSend(){return this.privIsConnected&&!this.privParticipants.me?.isMuted}get canSendAsHost(){return this.privIsConnected&&this.privParticipants.me?.isHost}get authorizationToken(){return this.privToken}set authorizationToken(e){o.Contracts.throwIfNullOrWhitespace(e,"authorizationToken"),this.privToken=e}set conversationTranslator(e){this.privConversationTranslator=e}onToken(e){this.privConversationTranslator.onToken(e)}createConversationAsync(e,t){try{this.privConversationRecognizer&&this.handleError(new Error(this.privErrors.permissionDeniedStart),t),this.privManager.createOrJoin(this.privProperties,void 0,r=>{r||this.handleError(new Error(this.privErrors.permissionDeniedConnect),t),this.privRoom=r,this.handleCallback(e,t)},e=>{this.handleError(e,t)})}catch(e){this.handleError(e,t)}}startConversationAsync(e,t){try{this.privConversationRecognizer&&this.handleError(new Error(this.privErrors.permissionDeniedStart),t),o.Contracts.throwIfNullOrUndefined(this.privRoom,this.privErrors.permissionDeniedConnect),this.privParticipants.meId=this.privRoom.participantId,this.privConversationRecognizer=i.ConversationRecognizerFactory.fromConfig(this,this.privConfig),this.privConversationRecognizer.connected=this.onConnected,this.privConversationRecognizer.disconnected=this.onDisconnected,this.privConversationRecognizer.canceled=this.onCanceled,this.privConversationRecognizer.participantUpdateCommandReceived=this.onParticipantUpdateCommandReceived,this.privConversationRecognizer.lockRoomCommandReceived=this.onLockRoomCommandReceived,this.privConversationRecognizer.muteAllCommandReceived=this.onMuteAllCommandReceived,this.privConversationRecognizer.participantJoinCommandReceived=this.onParticipantJoinCommandReceived,this.privConversationRecognizer.participantLeaveCommandReceived=this.onParticipantLeaveCommandReceived,this.privConversationRecognizer.translationReceived=this.onTranslationReceived,this.privConversationRecognizer.participantsListReceived=this.onParticipantsListReceived,this.privConversationRecognizer.conversationExpiration=this.onConversationExpiration,this.privConversationRecognizer.connect(this.privRoom.token,()=>{this.handleCallback(e,t)},e=>{this.handleError(e,t)})}catch(e){this.handleError(e,t)}}addParticipantAsync(e,t,r){o.Contracts.throwIfNullOrUndefined(e,"Participant"),(0,n.marshalPromiseToCallbacks)(this.addParticipantImplAsync(e),t,r)}joinConversationAsync(e,t,r,i,n){try{o.Contracts.throwIfNullOrWhitespace(e,this.privErrors.invalidArgs.replace("{arg}","conversationId")),o.Contracts.throwIfNullOrWhitespace(t,this.privErrors.invalidArgs.replace("{arg}","nickname")),o.Contracts.throwIfNullOrWhitespace(r,this.privErrors.invalidArgs.replace("{arg}","language")),this.privManager.createOrJoin(this.privProperties,e,e=>{o.Contracts.throwIfNullOrUndefined(e,this.privErrors.permissionDeniedConnect),this.privRoom=e,this.privConfig.authorizationToken=e.cognitiveSpeechAuthToken,i&&i(e.cognitiveSpeechAuthToken)},e=>{this.handleError(e,n)})}catch(e){this.handleError(e,n)}}deleteConversationAsync(e,t){(0,n.marshalPromiseToCallbacks)(this.deleteConversationImplAsync(),e,t)}async deleteConversationImplAsync(){o.Contracts.throwIfNullOrUndefined(this.privProperties,this.privErrors.permissionDeniedConnect),o.Contracts.throwIfNullOrWhitespace(this.privRoom.token,this.privErrors.permissionDeniedConnect),await this.privManager.leave(this.privProperties,this.privRoom.token),this.dispose()}endConversationAsync(e,t){(0,n.marshalPromiseToCallbacks)(this.endConversationImplAsync(),e,t)}endConversationImplAsync(){return this.close(!0)}lockConversationAsync(e,t){try{o.Contracts.throwIfDisposed(this.privIsDisposed),o.Contracts.throwIfDisposed(this.privConversationRecognizer.isDisposed()),o.Contracts.throwIfNullOrUndefined(this.privRoom,this.privErrors.permissionDeniedSend),this.canSendAsHost||this.handleError(new Error(this.privErrors.permissionDeniedConversation.replace("{command}","lock")),t),this.privConversationRecognizer&&this.privConversationRecognizer.sendRequest(this.getLockCommand(!0),()=>{this.handleCallback(e,t)},e=>{this.handleError(e,t)})}catch(e){this.handleError(e,t)}}muteAllParticipantsAsync(e,t){try{o.Contracts.throwIfDisposed(this.privIsDisposed),o.Contracts.throwIfDisposed(this.privConversationRecognizer.isDisposed()),o.Contracts.throwIfNullOrUndefined(this.privConversationRecognizer,this.privErrors.permissionDeniedSend),o.Contracts.throwIfNullOrUndefined(this.privRoom,this.privErrors.permissionDeniedSend),this.canSendAsHost||this.handleError(new Error(this.privErrors.permissionDeniedConversation.replace("{command}","mute")),t),this.privConversationRecognizer&&this.privConversationRecognizer.sendRequest(this.getMuteAllCommand(!0),()=>{this.handleCallback(e,t)},e=>{this.handleError(e,t)})}catch(e){this.handleError(e,t)}}muteParticipantAsync(e,t,r){try{o.Contracts.throwIfDisposed(this.privIsDisposed),o.Contracts.throwIfDisposed(this.privConversationRecognizer.isDisposed()),o.Contracts.throwIfNullOrWhitespace(e,this.privErrors.invalidArgs.replace("{arg}","userId")),o.Contracts.throwIfNullOrUndefined(this.privRoom,this.privErrors.permissionDeniedSend),this.canSend||this.handleError(new Error(this.privErrors.permissionDeniedSend),r),this.me.isHost||this.me.id===e||this.handleError(new Error(this.privErrors.permissionDeniedParticipant.replace("{command}","mute")),r),-1===this.privParticipants.getParticipantIndex(e)&&this.handleError(new Error(this.privErrors.invalidParticipantRequest),r),this.privConversationRecognizer&&this.privConversationRecognizer.sendRequest(this.getMuteCommand(e,!0),()=>{this.handleCallback(t,r)},e=>{this.handleError(e,r)})}catch(e){this.handleError(e,r)}}removeParticipantAsync(e,t,r){try{if(o.Contracts.throwIfDisposed(this.privIsDisposed),this.privTranscriberRecognizer&&e.hasOwnProperty("id"))(0,n.marshalPromiseToCallbacks)(this.removeParticipantImplAsync(e),t,r);else{o.Contracts.throwIfDisposed(this.privConversationRecognizer.isDisposed()),o.Contracts.throwIfNullOrUndefined(this.privRoom,this.privErrors.permissionDeniedSend),this.canSendAsHost||this.handleError(new Error(this.privErrors.permissionDeniedParticipant.replace("{command}","remove")),r);let i="";"string"==typeof e?i=e:e.hasOwnProperty("id")?i=e.id:e.hasOwnProperty("userId")&&(i=e.userId),o.Contracts.throwIfNullOrWhitespace(i,this.privErrors.invalidArgs.replace("{arg}","userId")),-1===this.participants.findIndex(e=>e.id===i)&&this.handleError(new Error(this.privErrors.invalidParticipantRequest),r),this.privConversationRecognizer&&this.privConversationRecognizer.sendRequest(this.getEjectCommand(i),()=>{this.handleCallback(t,r)},e=>{this.handleError(e,r)})}}catch(e){this.handleError(e,r)}}unlockConversationAsync(e,t){try{o.Contracts.throwIfDisposed(this.privIsDisposed),o.Contracts.throwIfDisposed(this.privConversationRecognizer.isDisposed()),o.Contracts.throwIfNullOrUndefined(this.privRoom,this.privErrors.permissionDeniedSend),this.canSendAsHost||this.handleError(new Error(this.privErrors.permissionDeniedConversation.replace("{command}","unlock")),t),this.privConversationRecognizer&&this.privConversationRecognizer.sendRequest(this.getLockCommand(!1),()=>{this.handleCallback(e,t)},e=>{this.handleError(e,t)})}catch(e){this.handleError(e,t)}}unmuteAllParticipantsAsync(e,t){try{o.Contracts.throwIfDisposed(this.privIsDisposed),o.Contracts.throwIfDisposed(this.privConversationRecognizer.isDisposed()),o.Contracts.throwIfNullOrUndefined(this.privRoom,this.privErrors.permissionDeniedSend),this.canSendAsHost||this.handleError(new Error(this.privErrors.permissionDeniedConversation.replace("{command}","unmute all")),t),this.privConversationRecognizer&&this.privConversationRecognizer.sendRequest(this.getMuteAllCommand(!1),()=>{this.handleCallback(e,t)},e=>{this.handleError(e,t)})}catch(e){this.handleError(e,t)}}unmuteParticipantAsync(e,t,r){try{o.Contracts.throwIfDisposed(this.privIsDisposed),o.Contracts.throwIfDisposed(this.privConversationRecognizer.isDisposed()),o.Contracts.throwIfNullOrWhitespace(e,this.privErrors.invalidArgs.replace("{arg}","userId")),o.Contracts.throwIfNullOrUndefined(this.privRoom,this.privErrors.permissionDeniedSend),this.canSend||this.handleError(new Error(this.privErrors.permissionDeniedSend),r),this.me.isHost||this.me.id===e||this.handleError(new Error(this.privErrors.permissionDeniedParticipant.replace("{command}","mute")),r),-1===this.privParticipants.getParticipantIndex(e)&&this.handleError(new Error(this.privErrors.invalidParticipantRequest),r),this.privConversationRecognizer&&this.privConversationRecognizer.sendRequest(this.getMuteCommand(e,!1),()=>{this.handleCallback(t,r)},e=>{this.handleError(e,r)})}catch(e){this.handleError(e,r)}}sendTextMessageAsync(e,t,r){try{o.Contracts.throwIfDisposed(this.privIsDisposed),o.Contracts.throwIfDisposed(this.privConversationRecognizer.isDisposed()),o.Contracts.throwIfNullOrWhitespace(e,this.privErrors.invalidArgs.replace("{arg}","message")),o.Contracts.throwIfNullOrUndefined(this.privRoom,this.privErrors.permissionDeniedSend),this.canSend||this.handleError(new Error(this.privErrors.permissionDeniedSend),r),e.length>this.privTextMessageMaxLength&&this.handleError(new Error(this.privErrors.invalidArgs.replace("{arg}","message length")),r),this.privConversationRecognizer&&this.privConversationRecognizer.sendRequest(this.getMessageCommand(e),()=>{this.handleCallback(t,r)},e=>{this.handleError(e,r)})}catch(e){this.handleError(e,r)}}setTranslatedLanguagesAsync(e,t,r){try{o.Contracts.throwIfDisposed(this.privIsDisposed),o.Contracts.throwIfDisposed(this.privConversationRecognizer.isDisposed()),o.Contracts.throwIfArrayEmptyOrWhitespace(e,this.privErrors.invalidArgs.replace("{arg}","languages")),o.Contracts.throwIfNullOrUndefined(this.privRoom,this.privErrors.permissionDeniedSend),this.canSend||this.handleError(new Error(this.privErrors.permissionDeniedSend),r),this.privConversationRecognizer&&this.privConversationRecognizer.sendRequest(this.getSetTranslateToLanguagesCommand(e),()=>{this.handleCallback(t,r)},e=>{this.handleError(e,r)})}catch(e){this.handleError(e,r)}}changeNicknameAsync(e,t,r){try{o.Contracts.throwIfDisposed(this.privIsDisposed),o.Contracts.throwIfDisposed(this.privConversationRecognizer.isDisposed()),o.Contracts.throwIfNullOrWhitespace(e,this.privErrors.invalidArgs.replace("{arg}","nickname")),o.Contracts.throwIfNullOrUndefined(this.privRoom,this.privErrors.permissionDeniedSend),this.canSend||this.handleError(new Error(this.privErrors.permissionDeniedSend),r),this.privConversationRecognizer&&this.privConversationRecognizer.sendRequest(this.getChangeNicknameCommand(e),()=>{this.handleCallback(t,r)},e=>{this.handleError(e,r)})}catch(e){this.handleError(e,r)}}isDisposed(){return this.privIsDisposed}dispose(){this.isDisposed||(this.privIsDisposed=!0,this.config&&this.config.close(),this.privConfig=void 0,this.privLanguage=void 0,this.privProperties=void 0,this.privRoom=void 0,this.privToken=void 0,this.privManager=void 0,this.privIsConnected=!1,this.privIsReady=!1,this.privParticipants=void 0)}async connectTranscriberRecognizer(e){this.privTranscriberRecognizer&&await this.privTranscriberRecognizer.close(),await e.enforceAudioGating(),this.privTranscriberRecognizer=e,this.privTranscriberRecognizer.conversation=this}getKeepAlive(){const e=this.me?this.me.displayName:"default_nickname";return JSON.stringify({id:"0",nickname:e,participantId:this.privRoom.participantId,roomId:this.privRoom.roomId,type:i.ConversationTranslatorMessageTypes.keepAlive})}addParticipantImplAsync(e){if(void 0!==this.privParticipants.addOrUpdateParticipant(e)&&this.privTranscriberRecognizer){const t=this.conversationInfo;return t.participants=[e],this.privTranscriberRecognizer.pushConversationEvent(t,"join")}}removeParticipantImplAsync(e){this.privParticipants.deleteParticipant(e.id);const t=this.conversationInfo;return t.participants=[e],this.privTranscriberRecognizer.pushConversationEvent(t,"leave")}async close(e){try{this.privIsConnected=!1,await(this.privConversationRecognizer?.close()),this.privConversationRecognizer=void 0,this.privConversationTranslator&&this.privConversationTranslator.dispose()}catch(e){throw e}e&&this.dispose()}handleCallback(e,t){if(e){try{e()}catch(e){t&&t(e)}e=void 0}}handleError(e,t){if(t)if(e instanceof Error){const r=e;t(r.name+": "+r.message)}else t(e)}toParticipants(e){const t=this.privParticipants.participants.map(e=>this.toParticipant(e));return e?t:t.filter(e=>!1===e.isHost)}toParticipant(e){return new s.Participant(e.id,e.avatar,e.displayName,e.isHost,e.isMuted,e.isUsingTts,e.preferredLanguage,e.voice)}getMuteAllCommand(e){return o.Contracts.throwIfNullOrWhitespace(this.privRoom.roomId,"conversationId"),o.Contracts.throwIfNullOrWhitespace(this.privRoom.participantId,"participantId"),JSON.stringify({command:i.ConversationTranslatorCommandTypes.setMuteAll,participantId:this.privRoom.participantId,roomid:this.privRoom.roomId,type:i.ConversationTranslatorMessageTypes.participantCommand,value:e})}getMuteCommand(e,t){return o.Contracts.throwIfNullOrWhitespace(this.privRoom.roomId,"conversationId"),o.Contracts.throwIfNullOrWhitespace(e,"participantId"),JSON.stringify({command:i.ConversationTranslatorCommandTypes.setMute,participantId:e,roomid:this.privRoom.roomId,type:i.ConversationTranslatorMessageTypes.participantCommand,value:t})}getLockCommand(e){return o.Contracts.throwIfNullOrWhitespace(this.privRoom.roomId,"conversationId"),o.Contracts.throwIfNullOrWhitespace(this.privRoom.participantId,"participantId"),JSON.stringify({command:i.ConversationTranslatorCommandTypes.setLockState,participantId:this.privRoom.participantId,roomid:this.privRoom.roomId,type:i.ConversationTranslatorMessageTypes.participantCommand,value:e})}getEjectCommand(e){return o.Contracts.throwIfNullOrWhitespace(this.privRoom.roomId,"conversationId"),o.Contracts.throwIfNullOrWhitespace(e,"participantId"),JSON.stringify({command:i.ConversationTranslatorCommandTypes.ejectParticipant,participantId:e,roomid:this.privRoom.roomId,type:i.ConversationTranslatorMessageTypes.participantCommand})}getSetTranslateToLanguagesCommand(e){return o.Contracts.throwIfNullOrWhitespace(this.privRoom.roomId,"conversationId"),o.Contracts.throwIfNullOrWhitespace(this.privRoom.participantId,"participantId"),JSON.stringify({command:i.ConversationTranslatorCommandTypes.setTranslateToLanguages,participantId:this.privRoom.participantId,roomid:this.privRoom.roomId,type:i.ConversationTranslatorMessageTypes.participantCommand,value:e})}getChangeNicknameCommand(e){return o.Contracts.throwIfNullOrWhitespace(this.privRoom.roomId,"conversationId"),o.Contracts.throwIfNullOrWhitespace(e,"nickname"),o.Contracts.throwIfNullOrWhitespace(this.privRoom.participantId,"participantId"),JSON.stringify({command:i.ConversationTranslatorCommandTypes.changeNickname,nickname:e,participantId:this.privRoom.participantId,roomid:this.privRoom.roomId,type:i.ConversationTranslatorMessageTypes.participantCommand,value:e})}getMessageCommand(e){return o.Contracts.throwIfNullOrWhitespace(this.privRoom.roomId,"conversationId"),o.Contracts.throwIfNullOrWhitespace(this.privRoom.participantId,"participantId"),o.Contracts.throwIfNullOrWhitespace(e,"message"),JSON.stringify({participantId:this.privRoom.participantId,roomId:this.privRoom.roomId,text:e,type:i.ConversationTranslatorMessageTypes.instantMessage})}}t.ConversationImpl=c},5189:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SpeechDetected=void 0;class r{constructor(e,t){this.privSpeechStartDetected=JSON.parse(e),this.privSpeechStartDetected.Offset+=t}static fromJSON(e,t){return new r(e,t)}get Offset(){return this.privSpeechStartDetected.Offset}}t.SpeechDetected=r},5245:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Contracts=void 0;class r{static throwIfNullOrUndefined(e,t){if(null==e)throw new Error("throwIfNullOrUndefined:"+t)}static throwIfNull(e,t){if(null===e)throw new Error("throwIfNull:"+t)}static throwIfNullOrWhitespace(e,t){if(r.throwIfNullOrUndefined(e,t),(""+e).trim().length<1)throw new Error("throwIfNullOrWhitespace:"+t)}static throwIfNullOrTooLong(e,t,i){if(r.throwIfNullOrUndefined(e,t),(""+e).length>i)throw new Error("throwIfNullOrTooLong:"+t+" (more than "+i.toString()+" characters)")}static throwIfNullOrTooShort(e,t,i){if(r.throwIfNullOrUndefined(e,t),(""+e).length<i)throw new Error("throwIfNullOrTooShort:"+t+" (less than "+i.toString()+" characters)")}static throwIfDisposed(e){if(e)throw new Error("the object is already disposed")}static throwIfArrayEmptyOrWhitespace(e,t){if(r.throwIfNullOrUndefined(e,t),0===e.length)throw new Error("throwIfArrayEmptyOrWhitespace:"+t);for(const i of e)r.throwIfNullOrWhitespace(i,t)}static throwIfFileDoesNotExist(e,t){r.throwIfNullOrWhitespace(e,t)}static throwIfNotUndefined(e,t){if(void 0!==e)throw new Error("throwIfNotUndefined:"+t)}static throwIfNumberOutOfRange(e,t,i,n){if(r.throwIfNullOrUndefined(e,t),e<i||e>n)throw new Error("throwIfNumberOutOfRange:"+t+" (must be between "+i.toString()+" and "+n.toString()+")")}}t.Contracts=r},5304:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Timeout=void 0;class r{static load(){const e=new Map([[0,()=>{}]]),t=new Map,i="data:text/javascript;base64,"+btoa('!function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=14)}([function(e,t,n){"use strict";n.d(t,"a",(function(){return i})),n.d(t,"b",(function(){return u})),n.d(t,"c",(function(){return a})),n.d(t,"d",(function(){return d}));const r=new Map,o=new Map,i=e=>{const t=r.get(e);if(void 0===t)throw new Error(\'There is no interval scheduled with the given id "\'.concat(e,\'".\'));clearTimeout(t),r.delete(e)},u=e=>{const t=o.get(e);if(void 0===t)throw new Error(\'There is no timeout scheduled with the given id "\'.concat(e,\'".\'));clearTimeout(t),o.delete(e)},f=(e,t)=>{let n,r;if("performance"in self){const o=performance.now();n=o,r=e-Math.max(0,o-t)}else n=Date.now(),r=e;return{expected:n+r,remainingDelay:r}},c=(e,t,n,r)=>{const o="performance"in self?performance.now():Date.now();o>n?postMessage({id:null,method:"call",params:{timerId:t}}):e.set(t,setTimeout(c,n-o,e,t,n))},a=(e,t,n)=>{const{expected:o,remainingDelay:i}=f(e,n);r.set(t,setTimeout(c,i,r,t,o))},d=(e,t,n)=>{const{expected:r,remainingDelay:i}=f(e,n);o.set(t,setTimeout(c,i,o,t,r))}},function(e,t,n){"use strict";n.r(t);var r=n(2);for(var o in r)"default"!==o&&function(e){n.d(t,e,(function(){return r[e]}))}(o);var i=n(3);for(var o in i)"default"!==o&&function(e){n.d(t,e,(function(){return i[e]}))}(o);var u=n(4);for(var o in u)"default"!==o&&function(e){n.d(t,e,(function(){return u[e]}))}(o);var f=n(5);for(var o in f)"default"!==o&&function(e){n.d(t,e,(function(){return f[e]}))}(o);var c=n(6);for(var o in c)"default"!==o&&function(e){n.d(t,e,(function(){return c[e]}))}(o);var a=n(7);for(var o in a)"default"!==o&&function(e){n.d(t,e,(function(){return a[e]}))}(o);var d=n(8);for(var o in d)"default"!==o&&function(e){n.d(t,e,(function(){return d[e]}))}(o);var s=n(9);for(var o in s)"default"!==o&&function(e){n.d(t,e,(function(){return s[e]}))}(o)},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t,n){"use strict";n.r(t);var r=n(11);for(var o in r)"default"!==o&&function(e){n.d(t,e,(function(){return r[e]}))}(o);var i=n(12);for(var o in i)"default"!==o&&function(e){n.d(t,e,(function(){return i[e]}))}(o);var u=n(13);for(var o in u)"default"!==o&&function(e){n.d(t,e,(function(){return u[e]}))}(o)},function(e,t){},function(e,t){},function(e,t){},function(e,t,n){"use strict";n.r(t);var r=n(0),o=n(1);for(var i in o)"default"!==i&&function(e){n.d(t,e,(function(){return o[e]}))}(i);var u=n(10);for(var i in u)"default"!==i&&function(e){n.d(t,e,(function(){return u[e]}))}(i);addEventListener("message",({data:e})=>{try{if("clear"===e.method){const{id:t,params:{timerId:n}}=e;Object(r.b)(n),postMessage({error:null,id:t})}else{if("set"!==e.method)throw new Error(\'The given method "\'.concat(e.method,\'" is not supported\'));{const{params:{delay:t,now:n,timerId:o}}=e;Object(r.d)(t,o,n)}}}catch(t){postMessage({error:{message:t.message},id:e.id,result:null})}})}]);'),n=new Worker(i);return n.addEventListener("message",({data:i})=>{if(r.isCallNotification(i)){const{params:{timerId:r}}=i,n=e.get(r);if("number"==typeof n){const e=t.get(n);if(void 0===e||e!==r)throw new Error("The timer is in an undefined state.")}else{if(void 0===n)throw new Error("The timer is in an undefined state.");n(),e.delete(r)}}else{if(!r.isClearResponse(i)){const{error:{message:e}}=i;throw new Error(e)}{const{id:r}=i,n=t.get(r);if(void 0===n)throw new Error("The timer is in an undefined state.");t.delete(r),e.delete(n)}}}),{clearTimeout:r=>{const i=Math.random();t.set(i,r),e.set(r,i),n.postMessage({id:i,method:"clear",params:{timerId:r}})},setTimeout:(t,r)=>{const i=Math.random();return e.set(i,t),n.postMessage({id:null,method:"set",params:{delay:r,now:performance.now(),timerId:i}}),i}}}static loadWorkerTimers(){return()=>(null!==r.workerTimers||(r.workerTimers=r.load()),r.workerTimers)}static isCallNotification(e){return void 0!==e.method&&"call"===e.method}static isClearResponse(e){return null===e.error&&"number"==typeof e.id}}t.Timeout=r,r.workerTimers=null,r.clearTimeout=e=>r.timers().clearTimeout(e),r.setTimeout=(e,t)=>r.timers().setTimeout(e,t),r.timers=r.loadWorkerTimers()},5306:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SpeechServiceRecognizer=void 0;const i=r(881),n=r(9190);class o extends n.ServiceRecognizerBase{constructor(e,t,r,i,n){super(e,t,r,i,n),this.privSpeechRecognizer=n}async processTypeSpecificMessages(e){let t;const r=new i.PropertyCollection;let o=!1;switch(e.path.toLowerCase()){case"speech.hypothesis":case"speech.fragment":const s=n.SpeechHypothesis.fromJSON(e.textBody,this.privRequestSession.currentTurnAudioOffset);r.setProperty(i.PropertyId.SpeechServiceResponse_JsonResult,s.asJson()),t=new i.SpeechRecognitionResult(this.privRequestSession.requestId,i.ResultReason.RecognizingSpeech,s.Text,s.Duration,s.Offset,s.Language,s.LanguageDetectionConfidence,void 0,void 0,s.asJson(),r),this.privRequestSession.onHypothesis(s.Offset);const a=new i.SpeechRecognitionEventArgs(t,s.Offset,this.privRequestSession.sessionId);if(this.privSpeechRecognizer.recognizing)try{this.privSpeechRecognizer.recognizing(this.privSpeechRecognizer,a)}catch(e){}o=!0;break;case"speech.phrase":const c=n.SimpleSpeechPhrase.fromJSON(e.textBody,this.privRequestSession.currentTurnAudioOffset);r.setProperty(i.PropertyId.SpeechServiceResponse_JsonResult,c.asJson());const u=n.EnumTranslation.implTranslateRecognitionResult(c.RecognitionStatus,this.privExpectContentAssessmentResponse);if(this.privRequestSession.onPhraseRecognized(c.Offset+c.Duration),i.ResultReason.Canceled===u){const e=n.EnumTranslation.implTranslateCancelResult(c.RecognitionStatus),t=n.EnumTranslation.implTranslateCancelErrorCode(c.RecognitionStatus);await this.cancelRecognitionLocal(e,t,n.EnumTranslation.implTranslateErrorDetails(t))}else{if(c.RecognitionStatus===n.RecognitionStatus.EndOfDictation)break;if(this.privRecognizerConfig.parameters.getProperty(n.OutputFormatPropertyName)===i.OutputFormat[i.OutputFormat.Simple])t=new i.SpeechRecognitionResult(this.privRequestSession.requestId,u,c.DisplayText,c.Duration,c.Offset,c.Language,c.LanguageDetectionConfidence,void 0,void 0,c.asJson(),r);else{const o=n.DetailedSpeechPhrase.fromJSON(e.textBody,this.privRequestSession.currentTurnAudioOffset);r.setProperty(i.PropertyId.SpeechServiceResponse_JsonResult,o.asJson()),t=new i.SpeechRecognitionResult(this.privRequestSession.requestId,u,o.RecognitionStatus===n.RecognitionStatus.Success?o.NBest[0].Display:"",o.Duration,o.Offset,o.Language,o.LanguageDetectionConfidence,void 0,void 0,o.asJson(),r)}const o=new i.SpeechRecognitionEventArgs(t,t.offset,this.privRequestSession.sessionId);if(this.privSpeechRecognizer.recognized)try{this.privSpeechRecognizer.recognized(this.privSpeechRecognizer,o)}catch(e){}if(this.privSuccessCallback){try{this.privSuccessCallback(t)}catch(e){this.privErrorCallback&&this.privErrorCallback(e)}this.privSuccessCallback=void 0,this.privErrorCallback=void 0}}o=!0}return o}cancelRecognition(e,t,r,o,s){const a=new i.PropertyCollection;if(a.setProperty(n.CancellationErrorCodePropertyName,i.CancellationErrorCode[o]),this.privSpeechRecognizer.canceled){const t=new i.SpeechRecognitionCanceledEventArgs(r,s,o,void 0,e);try{this.privSpeechRecognizer.canceled(this.privSpeechRecognizer,t)}catch{}}if(this.privSuccessCallback){const e=new i.SpeechRecognitionResult(t,i.ResultReason.Canceled,void 0,void 0,void 0,void 0,void 0,void 0,s,void 0,a);try{this.privSuccessCallback(e),this.privSuccessCallback=void 0}catch{}}}}t.SpeechServiceRecognizer=o},5310:(e,t)=>{"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.OutputFormat=void 0,(r=t.OutputFormat||(t.OutputFormat={}))[r.Simple=0]="Simple",r[r.Detailed=1]="Detailed"},5321:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ConversationConnectionConfig=void 0;const i=r(3768);class n extends i.RestConfigBase{static get host(){return n.privHost}static get apiVersion(){return n.privApiVersion}static get clientAppId(){return n.privClientAppId}static get defaultLanguageCode(){return n.privDefaultLanguageCode}static get restPath(){return n.privRestPath}static get webSocketPath(){return n.privWebSocketPath}static get transcriptionEventKeys(){return n.privTranscriptionEventKeys}}t.ConversationConnectionConfig=n,n.privHost="dev.microsofttranslator.com",n.privRestPath="/capito/room",n.privApiVersion="2.0",n.privDefaultLanguageCode="en-US",n.privClientAppId="FC539C22-1767-4F1F-84BC-B4D811114F15",n.privWebSocketPath="/capito/translate",n.privTranscriptionEventKeys=["iCalUid","callId","organizer","FLAC","MTUri","DifferentiateGuestSpeakers","audiorecording","Threadid","OrganizerMri","OrganizerTenantId","UserToken"]},5338:(e,t)=>{"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.marshalPromiseToCallbacks=t.Sink=t.Deferred=t.PromiseResultEventSource=t.PromiseResult=t.PromiseState=void 0,function(e){e[e.None=0]="None",e[e.Resolved=1]="Resolved",e[e.Rejected=2]="Rejected"}(r=t.PromiseState||(t.PromiseState={}));class i{constructor(e){this.throwIfError=()=>{if(this.isError)throw this.error},e.on(e=>{this.privIsCompleted||(this.privIsCompleted=!0,this.privIsError=!1,this.privResult=e)},e=>{this.privIsCompleted||(this.privIsCompleted=!0,this.privIsError=!0,this.privError=e)})}get isCompleted(){return this.privIsCompleted}get isError(){return this.privIsError}get error(){return this.privError}get result(){return this.privResult}}t.PromiseResult=i;class n{constructor(){this.setResult=e=>{this.privOnSetResult(e)},this.setError=e=>{this.privOnSetError(e)},this.on=(e,t)=>{this.privOnSetResult=e,this.privOnSetError=t}}}t.PromiseResultEventSource=n,t.Deferred=class{constructor(){this.resolve=e=>(this.privResolve(e),this),this.reject=e=>(this.privReject(e),this),this.privPromise=new Promise((e,t)=>{this.privResolve=e,this.privReject=t})}get promise(){return this.privPromise}},t.Sink=class{constructor(){this.privState=r.None,this.privPromiseResult=null,this.privPromiseResultEvents=null,this.privSuccessHandlers=[],this.privErrorHandlers=[],this.privPromiseResultEvents=new n,this.privPromiseResult=new i(this.privPromiseResultEvents)}get state(){return this.privState}get result(){return this.privPromiseResult}resolve(e){if(this.privState!==r.None)throw new Error("'Cannot resolve a completed promise'");this.privState=r.Resolved,this.privPromiseResultEvents.setResult(e);for(let t=0;t<this.privSuccessHandlers.length;t++)this.executeSuccessCallback(e,this.privSuccessHandlers[t],this.privErrorHandlers[t]);this.detachHandlers()}reject(e){if(this.privState!==r.None)throw new Error("'Cannot reject a completed promise'");this.privState=r.Rejected,this.privPromiseResultEvents.setError(e);for(const t of this.privErrorHandlers)this.executeErrorCallback(e,t);this.detachHandlers()}on(e,t){null==e&&(e=()=>{}),this.privState===r.None?(this.privSuccessHandlers.push(e),this.privErrorHandlers.push(t)):(this.privState===r.Resolved?this.executeSuccessCallback(this.privPromiseResult.result,e,t):this.privState===r.Rejected&&this.executeErrorCallback(this.privPromiseResult.error,t),this.detachHandlers())}executeSuccessCallback(e,t,r){try{t(e)}catch(e){this.executeErrorCallback(`'Unhandled callback error: ${e}'`,r)}}executeErrorCallback(e,t){if(!t)throw new Error(`'Unhandled error: ${e}'`);try{t(e)}catch(t){throw new Error(`'Unhandled callback error: ${t}. InnerError: ${e}'`)}}detachHandlers(){this.privErrorHandlers=[],this.privSuccessHandlers=[]}},t.marshalPromiseToCallbacks=function(e,t,r){e.then(e=>{try{t&&t(e)}catch(e){if(r)try{if(e instanceof Error){const t=e;r(t.name+": "+t.message)}else r(e)}catch(e){}}},e=>{if(r)try{if(e instanceof Error){const t=e;r(t.name+": "+t.message)}else r(e)}catch(e){}})}},5400:(e,t)=>{"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.OnUnknownAction=void 0,(r=t.OnUnknownAction||(t.OnUnknownAction={})).RecognizeWithDefaultLanguage="RecognizeWithDefaultLanguage",r.None="None"},5462:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.VoiceServiceRecognizer=void 0;const i=r(4378),n=r(868),o=r(881),s=r(9190),a=r(4081);class c extends s.ServiceRecognizerBase{constructor(e,t,r,i,o){super(e,t,r,i,o),this.privDeferralMap=new n.DeferralMap,this.privSpeakerAudioSource=r,this.sendPrePayloadJSONOverride=()=>this.noOp()}set SpeakerAudioSource(e){this.privSpeakerAudioSource=e}processTypeSpecificMessages(e){let t=!1;const r=new o.PropertyCollection;switch(e.messageType===n.MessageType.Text&&r.setProperty(o.PropertyId.SpeechServiceResponse_JsonResult,e.textBody),e.path.toLowerCase()){case"speaker.profiles":const r=JSON.parse(e.textBody);switch(r.operation.toLowerCase()){case"create":this.handleCreateResponse(r,e.requestId);break;case"delete":case"reset":this.handleResultResponse(r,e.requestId);break;case"fetch":const t=JSON.parse(e.textBody);this.handleFetchResponse(t,e.requestId)}t=!0;break;case"speaker.phrases":const i=JSON.parse(e.textBody);this.handlePhrasesResponse(i,e.requestId),t=!0;break;case"speaker.profile.enrollment":const n=JSON.parse(e.textBody),s=new o.VoiceProfileEnrollmentResult(this.enrollmentReasonFrom(n.enrollment?n.enrollment.enrollmentStatus:n.status.statusCode),n.enrollment?JSON.stringify(n.enrollment):void 0,n.status.reason);this.privDeferralMap.getId(e.requestId)&&this.privDeferralMap.complete(e.requestId,s),this.privRequestSession.onSpeechEnded(),t=!0}const i=new n.Deferred;return i.resolve(t),i.promise}cancelRecognition(e,t,r,i,n){(new o.PropertyCollection).setProperty(s.CancellationErrorCodePropertyName,o.CancellationErrorCode[i]);const a=new o.VoiceProfileEnrollmentResult(o.ResultReason.Canceled,n,n);this.privDeferralMap.getId(t)&&this.privDeferralMap.complete(t,a)}async createProfile(e,t){this.voiceProfileType=e.toString();const r=this.connectImpl();try{const i=new n.Deferred;return await r,await this.sendCreateProfile(i,e,t),this.receiveMessage(),i.promise}catch(e){throw e}}async resetProfile(e){return this.voiceProfileType=e.profileType.toString(),this.sendCommonRequest("reset",e.profileType,e)}async deleteProfile(e){return this.voiceProfileType=e.profileType.toString(),this.sendCommonRequest("delete",e.profileType,e)}async retrieveEnrollmentResult(e){return this.voiceProfileType=e.profileType.toString(),this.privExpectedProfileId=e.profileId,this.sendCommonRequest("fetch",e.profileType,e)}async getAllProfiles(e){return this.voiceProfileType=e.toString(),this.sendCommonRequest("fetch",e)}async getActivationPhrases(e,t){this.voiceProfileType=e.toString();const r=this.connectImpl();try{const i=new n.Deferred;return await r,await this.sendPhrasesRequest(i,e,t),this.receiveMessage(),i.promise}catch(e){throw e}}async enrollProfile(e){this.voiceProfileType=e.profileType.toString();const t=new n.Deferred;this.privRequestSession.startNewRecognition(),this.privRequestSession.listenForServiceTelemetry(this.privSpeakerAudioSource.events),this.privRecognizerConfig.parameters.setProperty(o.PropertyId.Speech_SessionId,this.privRequestSession.sessionId);const r=this.connectImpl(),s=this.sendPreAudioMessages(e,t),a=await this.privSpeakerAudioSource.attach(this.privRequestSession.audioNodeId),c=await this.privSpeakerAudioSource.format,u=await this.privSpeakerAudioSource.deviceInfo,h=new i.ReplayableAudioNode(a,c.avgBytesPerSec);await this.privRequestSession.onAudioSourceAttachCompleted(h,!1),this.privRecognizerConfig.SpeechServiceConfig.Context.audio={source:u};try{await r,await s}catch(e){this.cancelRecognition(this.privRequestSession.sessionId,this.privRequestSession.requestId,o.CancellationReason.Error,o.CancellationErrorCode.ConnectionFailure,e)}const d=new o.SessionEventArgs(this.privRequestSession.sessionId);return this.privRecognizer.sessionStarted&&this.privRecognizer.sessionStarted(this.privRecognizer,d),this.receiveMessage(),this.sendAudio(h).then(()=>{},e=>{this.cancelRecognition(this.privRequestSession.sessionId,this.privRequestSession.requestId,o.CancellationReason.Error,o.CancellationErrorCode.RuntimeError,e)}),t.promise}async sendPreAudioMessages(e,t){const r=await this.fetchConnection();this.privRequestSession.onSpeechContext(),this.privDeferralMap.add(this.privRequestSession.requestId,t),await this.sendBaseRequest(r,"enroll",this.scenarioFrom(e.profileType),e)}async sendPhrasesRequest(e,t,r){const i=await this.fetchConnection();this.privRequestSession.onSpeechContext(),this.privDeferralMap.add(this.privRequestSession.requestId,e);const o={locale:r,scenario:this.scenarioFrom(t)};return i.send(new a.SpeechConnectionMessage(n.MessageType.Text,"speaker.profile.phrases",this.privRequestSession.requestId,"application/json; charset=utf-8",JSON.stringify(o)))}async sendCreateProfile(e,t,r){const i=await this.fetchConnection();this.privRequestSession.onSpeechContext(),this.privDeferralMap.add(this.privRequestSession.requestId,e);const s={locale:r,number:"1",scenario:t===o.VoiceProfileType.TextIndependentIdentification?"TextIndependentIdentification":t===o.VoiceProfileType.TextIndependentVerification?"TextIndependentVerification":"TextDependentVerification"};return i.send(new a.SpeechConnectionMessage(n.MessageType.Text,"speaker.profile.create",this.privRequestSession.requestId,"application/json; charset=utf-8",JSON.stringify(s)))}async sendCommonRequest(e,t,r=void 0){const i=this.connectImpl();try{const o=new n.Deferred;this.privRequestSession.onSpeechContext(),await i;const s=await this.fetchConnection();return this.privDeferralMap.add(this.privRequestSession.requestId,o),await this.sendBaseRequest(s,e,this.scenarioFrom(t),r),this.receiveMessage(),o.promise}catch(e){throw e}}async sendBaseRequest(e,t,r,i){const o={scenario:r};return i?o.profileIds=[i.profileId]:o.maxPageSize=-1,e.send(new a.SpeechConnectionMessage(n.MessageType.Text,`speaker.profile.${t}`,this.privRequestSession.requestId,"application/json; charset=utf-8",JSON.stringify(o)))}extractSpeakerContext(e){return{features:{interimResult:"enabled",progressiveDetection:"disabled"},profileIds:e.profileIds,scenario:e.scenario}}handlePhrasesResponse(e,t){if(!this.privDeferralMap.getId(t))throw new Error(`Voice Profile get activation phrases request for requestID ${t} not found`);if("success"!==e.status.statusCode.toLowerCase()){const r=o.ResultReason.Canceled,i=new o.VoiceProfilePhraseResult(r,e.status.statusCode,e.passPhraseType,[]);this.privDeferralMap.complete(t,i)}else{if(!(e.phrases&&e.phrases.length>0))throw new Error("Voice Profile get activation phrases failed, no phrases received");{const r=o.ResultReason.EnrollingVoiceProfile,i=new o.VoiceProfilePhraseResult(r,e.status.statusCode,e.passPhraseType,e.phrases);this.privDeferralMap.complete(t,i)}}}handleCreateResponse(e,t){if(!(e.profiles&&e.profiles.length>0))throw new Error("Voice Profile create failed, no profile id received");if(!this.privDeferralMap.getId(t))throw new Error(`Voice Profile create request for requestID ${t} not found`);{const r=e.profiles.map(e=>e.profileId);this.privDeferralMap.complete(t,r)}}handleResultResponse(e,t){if(!this.privDeferralMap.getId(t))throw new Error(`Voice Profile create request for requestID ${t} not found`);{const r="delete"===e.operation.toLowerCase()?o.ResultReason.DeletedVoiceProfile:o.ResultReason.ResetVoiceProfile,i="success"===e.status.statusCode.toLowerCase()?r:o.ResultReason.Canceled,n=new o.VoiceProfileResult(i,`statusCode: ${e.status.statusCode}, errorDetails: ${e.status.reason}`);this.privDeferralMap.complete(t,n)}}handleFetchResponse(e,t){if(!this.privDeferralMap.getId(t)||!e.profiles[0])throw new Error(`Voice Profile fetch request for requestID ${t} not found`);if(this.privExpectedProfileId&&1===e.profiles.length&&e.profiles[0].profileId===this.privExpectedProfileId){this.privExpectedProfileId=void 0;const r=e.profiles[0],i=new o.VoiceProfileEnrollmentResult(this.enrollmentReasonFrom(r.enrollmentStatus),JSON.stringify(r),e.status.reason);this.privDeferralMap.complete(t,i)}else if(e.profiles.length>0){const r=e.profiles,i=[];for(const t of r)i.push(new o.VoiceProfileEnrollmentResult(this.enrollmentReasonFrom(t.enrollmentStatus),JSON.stringify(t),e.status.reason));this.privDeferralMap.complete(t,i)}}enrollmentReasonFrom(e){switch(e.toLowerCase()){case"enrolled":return o.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 o.ResultReason.Canceled;default:return o.ResultReason.EnrollingVoiceProfile}}scenarioFrom(e){return e===o.VoiceProfileType.TextIndependentIdentification?"TextIndependentIdentification":e===o.VoiceProfileType.TextIndependentVerification?"TextIndependentVerification":"TextDependentVerification"}}t.VoiceServiceRecognizer=c},5472:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ConversationRequestSession=void 0;const i=r(868);t.ConversationRequestSession=class{constructor(e){this.privIsDisposed=!1,this.privDetachables=new Array,this.privSessionId=e,this.privRequestId=(0,i.createNoDashGuid)(),this.privRequestCompletionDeferral=new i.Deferred}get sessionId(){return this.privSessionId}get requestId(){return this.privRequestId}get completionPromise(){return this.privRequestCompletionDeferral.promise}onPreConnectionStart(e,t){this.privSessionId=t}onAuthCompleted(e){e&&this.onComplete()}onConnectionEstablishCompleted(e){200!==e&&403===e&&this.onComplete()}onServiceTurnEndResponse(e){e?this.privRequestId=(0,i.createNoDashGuid)():this.onComplete()}async dispose(){if(!this.privIsDisposed){this.privIsDisposed=!0;for(const e of this.privDetachables)await e.detach()}}onComplete(){}}},5518:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SynthesisStartedEvent=t.ConnectingToSynthesisServiceEvent=t.SynthesisTriggeredEvent=t.SpeechSynthesisEvent=void 0;const i=r(868);class n extends i.PlatformEvent{constructor(e,t,r=i.EventType.Info){super(e,r),this.privRequestId=t}get requestId(){return this.privRequestId}}t.SpeechSynthesisEvent=n,t.SynthesisTriggeredEvent=class extends n{constructor(e,t,r){super("SynthesisTriggeredEvent",e),this.privSessionAudioDestinationId=t,this.privTurnAudioDestinationId=r}get audioSessionDestinationId(){return this.privSessionAudioDestinationId}get audioTurnDestinationId(){return this.privTurnAudioDestinationId}},t.ConnectingToSynthesisServiceEvent=class extends n{constructor(e,t){super("ConnectingToSynthesisServiceEvent",e),this.privAuthFetchEventId=t}get authFetchEventId(){return this.privAuthFetchEventId}},t.SynthesisStartedEvent=class extends n{constructor(e,t){super("SynthesisStartedEvent",e),this.privAuthFetchEventId=t}get authFetchEventId(){return this.privAuthFetchEventId}}},5551:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PronunciationAssessmentConfig=void 0;const i=r(5245),n=r(881);class o{constructor(e,t=n.PronunciationAssessmentGradingSystem.FivePoint,r=n.PronunciationAssessmentGranularity.Phoneme,o=!1){i.Contracts.throwIfNullOrUndefined(e,"referenceText"),this.privProperties=new n.PropertyCollection,this.privProperties.setProperty(n.PropertyId.PronunciationAssessment_ReferenceText,e),this.privProperties.setProperty(n.PropertyId.PronunciationAssessment_GradingSystem,n.PronunciationAssessmentGradingSystem[t]),this.privProperties.setProperty(n.PropertyId.PronunciationAssessment_Granularity,n.PronunciationAssessmentGranularity[r]),this.privProperties.setProperty(n.PropertyId.PronunciationAssessment_EnableMiscue,String(o))}static fromJSON(e){i.Contracts.throwIfNullOrUndefined(e,"json");const t=new o("");return t.privProperties=new n.PropertyCollection,t.properties.setProperty(n.PropertyId.PronunciationAssessment_Json,e),t}toJSON(){return this.updateJson(),this.privProperties.getProperty(n.PropertyId.PronunciationAssessment_Params)}applyTo(e){this.updateJson();const t=e.internalData;t.expectContentAssessmentResponse=!!this.privContentAssessmentTopic,t.speechContext.setPronunciationAssessmentParams(this.properties.getProperty(n.PropertyId.PronunciationAssessment_Params),this.privContentAssessmentTopic,t.isSpeakerDiarizationEnabled)}get referenceText(){return this.properties.getProperty(n.PropertyId.PronunciationAssessment_ReferenceText)}set referenceText(e){i.Contracts.throwIfNullOrWhitespace(e,"referenceText"),this.properties.setProperty(n.PropertyId.PronunciationAssessment_ReferenceText,e)}set phonemeAlphabet(e){i.Contracts.throwIfNullOrWhitespace(e,"phonemeAlphabet"),this.privPhonemeAlphabet=e}set enableMiscue(e){const t=e?"true":"false";this.properties.setProperty(n.PropertyId.PronunciationAssessment_EnableMiscue,t)}get enableMiscue(){return"true"===this.properties.getProperty(n.PropertyId.PronunciationAssessment_EnableMiscue,"false").toLowerCase()}set nbestPhonemeCount(e){this.privNBestPhonemeCount=e}set enableProsodyAssessment(e){this.privEnableProsodyAssessment=e}enableContentAssessmentWithTopic(e){this.privContentAssessmentTopic=e}get properties(){return this.privProperties}updateJson(){const e=this.privProperties.getProperty(n.PropertyId.PronunciationAssessment_Json,"{}"),t=JSON.parse(e),r=this.privProperties.getProperty(n.PropertyId.PronunciationAssessment_ReferenceText);r&&(t.referenceText=r);const i=this.privProperties.getProperty(n.PropertyId.PronunciationAssessment_GradingSystem);i&&(t.gradingSystem=i);const o=this.privProperties.getProperty(n.PropertyId.PronunciationAssessment_Granularity);o&&(t.granularity=o),this.privPhonemeAlphabet&&(t.phonemeAlphabet=this.privPhonemeAlphabet),this.privNBestPhonemeCount&&(t.nbestPhonemeCount=this.privNBestPhonemeCount),t.enableProsodyAssessment=this.privEnableProsodyAssessment,t.dimension="Comprehensive",this.privProperties.getProperty(n.PropertyId.PronunciationAssessment_EnableMiscue)&&(t.enableMiscue=this.enableMiscue),this.privProperties.setProperty(n.PropertyId.PronunciationAssessment_Params,JSON.stringify(t))}}t.PronunciationAssessmentConfig=o},5571:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PhraseListGrammar=void 0;const i=r(5245);class n{constructor(e){this.privGrammerBuilder=e.dynamicGrammar}static fromRecognizer(e){const t=e.internalData;return new n(t)}addPhrase(e){this.privGrammerBuilder.addPhrase(e)}addPhrases(e){this.privGrammerBuilder.addPhrase(e)}clear(){this.privGrammerBuilder.clearPhrases()}setWeight(e){i.Contracts.throwIfNumberOutOfRange(e,"weight",0,2),this.privGrammerBuilder.setWeight(e)}}t.PhraseListGrammar=n},5576:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TranslationRecognitionCanceledEventArgs=void 0,t.TranslationRecognitionCanceledEventArgs=class{constructor(e,t,r,i,n){this.privCancelReason=t,this.privErrorDetails=r,this.privResult=n,this.privSessionId=e,this.privErrorCode=i}get result(){return this.privResult}get sessionId(){return this.privSessionId}get reason(){return this.privCancelReason}get errorCode(){return this.privErrorCode}get errorDetails(){return this.privErrorDetails}}},5636:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ConnectionOpenResponse=void 0,t.ConnectionOpenResponse=class{constructor(e,t){this.privStatusCode=e,this.privReason=t}get statusCode(){return this.privStatusCode}get reason(){return this.privReason}}},5648:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LogLevel=void 0;const i=r(868);Object.defineProperty(t,"LogLevel",{enumerable:!0,get:function(){return i.EventType}})},5685:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.InternalParticipants=t.ConversationTranslatorMessageTypes=t.ConversationTranslatorCommandTypes=t.ParticipantsListEventArgs=t.ParticipantEventArgs=t.ParticipantAttributeEventArgs=t.MuteAllEventArgs=t.LockRoomEventArgs=t.ConversationReceivedTranslationEventArgs=t.TranscriberRecognizer=t.ConversationRecognizerFactory=t.ConversationConnectionConfig=t.ConversationManager=void 0;var i=r(404);Object.defineProperty(t,"ConversationManager",{enumerable:!0,get:function(){return i.ConversationManager}});var n=r(5321);Object.defineProperty(t,"ConversationConnectionConfig",{enumerable:!0,get:function(){return n.ConversationConnectionConfig}});var o=r(1919);Object.defineProperty(t,"ConversationRecognizerFactory",{enumerable:!0,get:function(){return o.ConversationRecognizerFactory}});var s=r(143);Object.defineProperty(t,"TranscriberRecognizer",{enumerable:!0,get:function(){return s.TranscriberRecognizer}});var a=r(4272);Object.defineProperty(t,"ConversationReceivedTranslationEventArgs",{enumerable:!0,get:function(){return a.ConversationReceivedTranslationEventArgs}}),Object.defineProperty(t,"LockRoomEventArgs",{enumerable:!0,get:function(){return a.LockRoomEventArgs}}),Object.defineProperty(t,"MuteAllEventArgs",{enumerable:!0,get:function(){return a.MuteAllEventArgs}}),Object.defineProperty(t,"ParticipantAttributeEventArgs",{enumerable:!0,get:function(){return a.ParticipantAttributeEventArgs}}),Object.defineProperty(t,"ParticipantEventArgs",{enumerable:!0,get:function(){return a.ParticipantEventArgs}}),Object.defineProperty(t,"ParticipantsListEventArgs",{enumerable:!0,get:function(){return a.ParticipantsListEventArgs}});var c=r(9061);Object.defineProperty(t,"ConversationTranslatorCommandTypes",{enumerable:!0,get:function(){return c.ConversationTranslatorCommandTypes}}),Object.defineProperty(t,"ConversationTranslatorMessageTypes",{enumerable:!0,get:function(){return c.ConversationTranslatorMessageTypes}}),Object.defineProperty(t,"InternalParticipants",{enumerable:!0,get:function(){return c.InternalParticipants}})},5711:(e,t)=>{"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.CancellationErrorCode=void 0,(r=t.CancellationErrorCode||(t.CancellationErrorCode={}))[r.NoError=0]="NoError",r[r.AuthenticationFailure=1]="AuthenticationFailure",r[r.BadRequestParameters=2]="BadRequestParameters",r[r.TooManyRequests=3]="TooManyRequests",r[r.ConnectionFailure=4]="ConnectionFailure",r[r.ServiceTimeout=5]="ServiceTimeout",r[r.ServiceError=6]="ServiceError",r[r.RuntimeError=7]="RuntimeError",r[r.Forbidden=8]="Forbidden"},5737:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EnumTranslation=void 0;const i=r(881),n=r(9190);t.EnumTranslation=class{static implTranslateRecognitionResult(e,t=!1){let r=i.ResultReason.Canceled;switch(e){case n.RecognitionStatus.Success:r=i.ResultReason.RecognizedSpeech;break;case n.RecognitionStatus.EndOfDictation:r=t?i.ResultReason.RecognizedSpeech:i.ResultReason.NoMatch;break;case n.RecognitionStatus.NoMatch:case n.RecognitionStatus.InitialSilenceTimeout:case n.RecognitionStatus.BabbleTimeout:r=i.ResultReason.NoMatch;break;case n.RecognitionStatus.Error:case n.RecognitionStatus.BadRequest:case n.RecognitionStatus.Forbidden:default:r=i.ResultReason.Canceled}return r}static implTranslateCancelResult(e){let t=i.CancellationReason.EndOfStream;switch(e){case n.RecognitionStatus.Success:case n.RecognitionStatus.EndOfDictation:case n.RecognitionStatus.NoMatch:t=i.CancellationReason.EndOfStream;break;case n.RecognitionStatus.InitialSilenceTimeout:case n.RecognitionStatus.BabbleTimeout:case n.RecognitionStatus.Error:case n.RecognitionStatus.BadRequest:case n.RecognitionStatus.Forbidden:default:t=i.CancellationReason.Error}return t}static implTranslateCancelErrorCode(e){let t=i.CancellationErrorCode.NoError;switch(e){case n.RecognitionStatus.Error:t=i.CancellationErrorCode.ServiceError;break;case n.RecognitionStatus.TooManyRequests:t=i.CancellationErrorCode.TooManyRequests;break;case n.RecognitionStatus.BadRequest:t=i.CancellationErrorCode.BadRequestParameters;break;case n.RecognitionStatus.Forbidden:t=i.CancellationErrorCode.Forbidden;break;default:t=i.CancellationErrorCode.NoError}return t}static implTranslateErrorDetails(e){let t="The speech service encountered an internal error and could not continue.";switch(e){case i.CancellationErrorCode.Forbidden:t="The recognizer is using a free subscription that ran out of quota.";break;case i.CancellationErrorCode.BadRequestParameters:t="Invalid parameter or unsupported audio format in the request.";break;case i.CancellationErrorCode.TooManyRequests:t="The number of parallel requests exceeded the number of allowed concurrent transcriptions."}return t}}},5763:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SpeechSynthesisConnectionFactory=void 0;const i=r(4378),n=r(881),o=r(7778),s=r(9190),a=r(7014),c=r(9324);t.SpeechSynthesisConnectionFactory=class{constructor(){this.synthesisUri="/tts/cognitiveservices/websocket/v1"}async create(e,t,r){let u=e.parameters.getProperty(n.PropertyId.SpeechServiceConnection_Endpoint,void 0);const h=e.parameters.getProperty(n.PropertyId.SpeechServiceConnection_Region,void 0),d=o.ConnectionFactoryBase.getHostSuffix(h),l=e.parameters.getProperty(n.PropertyId.SpeechServiceConnection_EndpointId,void 0),p=void 0===l?"tts":"voice",f=e.parameters.getProperty(n.PropertyId.SpeechServiceConnection_Host,"wss://"+h+"."+p+".speech"+d),v={},g={};if(void 0!==t.token&&""!==t.token&&(g[t.headerName]=t.token),g[a.HeaderNames.ConnectionId]=r,void 0!==l&&""!==l&&(u&&-1!==u.search(c.QueryParameterNames.CustomVoiceDeploymentId)||(v[c.QueryParameterNames.CustomVoiceDeploymentId]=l)),e.avatarEnabled&&(u&&-1!==u.search(c.QueryParameterNames.EnableAvatar)||(v[c.QueryParameterNames.EnableAvatar]="true")),u){const e=new URL(u),t=e.pathname;""!==t&&"/"!==t||(e.pathname=this.synthesisUri,u=await o.ConnectionFactoryBase.getRedirectUrlFromEndpoint(e.toString()))}u||(u=f+this.synthesisUri),e.parameters.setProperty(n.PropertyId.SpeechServiceConnection_Url,u);const m="true"===e.parameters.getProperty("SPEECH-EnableWebsocketCompression","false");return new i.WebsocketConnection(u,v,g,new s.WebsocketMessageFormatter,i.ProxyInfo.fromParameters(e.parameters),m,r)}}},5843:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RecognitionEndedEvent=t.RecognitionCompletionStatus=t.RecognitionStartedEvent=t.ConnectingToServiceEvent=t.ListeningStartedEvent=t.RecognitionTriggeredEvent=t.SpeechRecognitionEvent=void 0;const i=r(868);class n extends i.PlatformEvent{constructor(e,t,r,n=i.EventType.Info){super(e,n),this.privRequestId=t,this.privSessionId=r}get requestId(){return this.privRequestId}get sessionId(){return this.privSessionId}}var o;t.SpeechRecognitionEvent=n,t.RecognitionTriggeredEvent=class extends n{constructor(e,t,r,i){super("RecognitionTriggeredEvent",e,t),this.privAudioSourceId=r,this.privAudioNodeId=i}get audioSourceId(){return this.privAudioSourceId}get audioNodeId(){return this.privAudioNodeId}},t.ListeningStartedEvent=class extends n{constructor(e,t,r,i){super("ListeningStartedEvent",e,t),this.privAudioSourceId=r,this.privAudioNodeId=i}get audioSourceId(){return this.privAudioSourceId}get audioNodeId(){return this.privAudioNodeId}},t.ConnectingToServiceEvent=class extends n{constructor(e,t,r){super("ConnectingToServiceEvent",e,r),this.privAuthFetchEventid=t}get authFetchEventid(){return this.privAuthFetchEventid}},t.RecognitionStartedEvent=class extends n{constructor(e,t,r,i,n){super("RecognitionStartedEvent",e,n),this.privAudioSourceId=t,this.privAudioNodeId=r,this.privAuthFetchEventId=i}get audioSourceId(){return this.privAudioSourceId}get audioNodeId(){return this.privAudioNodeId}get authFetchEventId(){return this.privAuthFetchEventId}},function(e){e[e.Success=0]="Success",e[e.AudioSourceError=1]="AudioSourceError",e[e.AudioSourceTimeout=2]="AudioSourceTimeout",e[e.AuthTokenFetchError=3]="AuthTokenFetchError",e[e.AuthTokenFetchTimeout=4]="AuthTokenFetchTimeout",e[e.UnAuthorized=5]="UnAuthorized",e[e.ConnectTimeout=6]="ConnectTimeout",e[e.ConnectError=7]="ConnectError",e[e.ClientRecognitionActivityTimeout=8]="ClientRecognitionActivityTimeout",e[e.UnknownError=9]="UnknownError"}(o=t.RecognitionCompletionStatus||(t.RecognitionCompletionStatus={})),t.RecognitionEndedEvent=class extends n{constructor(e,t,r,n,s,a,c,u){super("RecognitionEndedEvent",e,s,c===o.Success?i.EventType.Info:i.EventType.Error),this.privAudioSourceId=t,this.privAudioNodeId=r,this.privAuthFetchEventId=n,this.privStatus=c,this.privError=u,this.privServiceTag=a}get audioSourceId(){return this.privAudioSourceId}get audioNodeId(){return this.privAudioNodeId}get authFetchEventId(){return this.privAuthFetchEventId}get serviceTag(){return this.privServiceTag}get status(){return this.privStatus}get error(){return this.privError}}},5870:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EventSource=void 0;const i=r(6209),n=r(4462);t.EventSource=class{constructor(e){this.privEventListeners={},this.privIsDisposed=!1,this.privConsoleListener=void 0,this.privMetadata=e}onEvent(e){if(this.isDisposed())throw new i.ObjectDisposedError("EventSource");if(this.metadata)for(const t in this.metadata)t&&e.metadata&&(e.metadata[t]||(e.metadata[t]=this.metadata[t]));for(const t in this.privEventListeners)t&&this.privEventListeners[t]&&this.privEventListeners[t](e)}attach(e){const t=(0,n.createNoDashGuid)();return this.privEventListeners[t]=e,{detach:()=>(delete this.privEventListeners[t],Promise.resolve())}}attachListener(e){return this.attach(t=>e.onEvent(t))}attachConsoleListener(e){return this.privConsoleListener&&this.privConsoleListener.detach(),this.privConsoleListener=this.attach(t=>e.onEvent(t)),this.privConsoleListener}isDisposed(){return this.privIsDisposed}dispose(){this.privEventListeners=null,this.privIsDisposed=!0}get metadata(){return this.privMetadata}}},5887:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SynthesisContext=void 0;const i=r(881);t.SynthesisContext=class{constructor(){this.privContext={}}setSection(e,t){this.privContext[e]=t}set audioOutputFormat(e){this.privAudioOutputFormat=e}toJSON(){return JSON.stringify(this.privContext)}setSynthesisSection(e){const t=this.buildSynthesisContext(e);this.setSection("synthesis",t)}buildSynthesisContext(e){return{audio:{metadataOptions:{bookmarkEnabled:!!e?.bookmarkReached,punctuationBoundaryEnabled:e?.properties.getProperty(i.PropertyId.SpeechServiceResponse_RequestPunctuationBoundary,!!e?.wordBoundary),sentenceBoundaryEnabled:e?.properties.getProperty(i.PropertyId.SpeechServiceResponse_RequestSentenceBoundary,!1),sessionEndEnabled:!0,visemeEnabled:!!e?.visemeReceived,wordBoundaryEnabled:e?.properties.getProperty(i.PropertyId.SpeechServiceResponse_RequestWordBoundary,!!e?.wordBoundary)},outputFormat:this.privAudioOutputFormat.requestAudioFormatString},language:{autoDetection:e?.autoDetectSourceLanguage}}}}},5956:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},6037:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CognitiveSubscriptionKeyAuthentication=void 0;const i=r(868),n=r(7014),o=r(2690);t.CognitiveSubscriptionKeyAuthentication=class{constructor(e){if(!e)throw new i.ArgumentNullError("subscriptionKey");this.privAuthInfo=new o.AuthInfo(n.HeaderNames.AuthKey,e)}fetch(e){return Promise.resolve(this.privAuthInfo)}fetchOnExpiry(e){return Promise.resolve(this.privAuthInfo)}}},6090:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},6091:(e,t)=>{"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.IdentityProvider=t.SpeakerDiarizationMode=void 0,(r=t.SpeakerDiarizationMode||(t.SpeakerDiarizationMode={})).None="None",r.Identity="Identity",r.Anonymous="Anonymous",(t.IdentityProvider||(t.IdentityProvider={})).CallCenter="CallCenter"},6106:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ReplayableAudioNode=void 0,t.ReplayableAudioNode=class{constructor(e,t){this.privBuffers=[],this.privReplayOffset=0,this.privLastShrinkOffset=0,this.privBufferStartOffset=0,this.privBufferSerial=0,this.privBufferedBytes=0,this.privReplay=!1,this.privLastChunkAcquiredTime=0,this.privAudioNode=e,this.privBytesPerSecond=t}id(){return this.privAudioNode.id()}read(){if(this.privReplay&&0!==this.privBuffers.length){const e=this.privReplayOffset-this.privBufferStartOffset;let t=Math.round(e*this.privBytesPerSecond*1e-7);0!=t%2&&t++;let r=0;for(;r<this.privBuffers.length&&t>=this.privBuffers[r].chunk.buffer.byteLength;)t-=this.privBuffers[r++].chunk.buffer.byteLength;if(r<this.privBuffers.length){const e=this.privBuffers[r].chunk.buffer.slice(t);return this.privReplayOffset+=e.byteLength/this.privBytesPerSecond*1e7,r===this.privBuffers.length-1&&(this.privReplay=!1),Promise.resolve({buffer:e,isEnd:!1,timeReceived:this.privBuffers[r].chunk.timeReceived})}}return this.privAudioNode.read().then(e=>(e&&e.buffer&&this.privBuffers&&(this.privBuffers.push(new r(e,this.privBufferSerial++,this.privBufferedBytes)),this.privBufferedBytes+=e.buffer.byteLength),e))}detach(){return this.privBuffers=void 0,this.privAudioNode.detach()}replay(){this.privBuffers&&0!==this.privBuffers.length&&(this.privReplay=!0,this.privReplayOffset=this.privLastShrinkOffset)}shrinkBuffers(e){if(void 0===this.privBuffers||0===this.privBuffers.length)return;this.privLastShrinkOffset=e;const t=e-this.privBufferStartOffset;let r=Math.round(t*this.privBytesPerSecond*1e-7),i=0;for(;i<this.privBuffers.length&&r>=this.privBuffers[i].chunk.buffer.byteLength;)r-=this.privBuffers[i++].chunk.buffer.byteLength;this.privBufferStartOffset=Math.round(e-r/this.privBytesPerSecond*1e7),this.privBuffers=this.privBuffers.slice(i)}findTimeAtOffset(e){if(e<this.privBufferStartOffset||void 0===this.privBuffers)return 0;for(const t of this.privBuffers){const r=t.byteOffset/this.privBytesPerSecond*1e7,i=r+t.chunk.buffer.byteLength/this.privBytesPerSecond*1e7;if(e>=r&&e<=i)return t.chunk.timeReceived}return 0}};class r{constructor(e,t,r){this.chunk=e,this.serial=t,this.byteOffset=r}}},6119:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CancellationEventArgsBase=void 0;const i=r(881);class n extends i.RecognitionEventArgs{constructor(e,t,r,i,n){super(i,n),this.privReason=e,this.privErrorDetails=t,this.privErrorCode=r}get reason(){return this.privReason}get errorCode(){return this.privErrorCode}get errorDetails(){return this.privErrorDetails}}t.CancellationEventArgsBase=n},6143:(e,t)=>{"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.Mode=void 0,(r=t.Mode||(t.Mode={})).None="None",r.Always="Always"},6166:(e,t,r)=>{"use strict";var i=r(7426),n=r(3349);function o(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}t.BlockHash=o,o.prototype.update=function(e,t){if(e=i.toArray(e,t),this.pending?this.pending=this.pending.concat(e):this.pending=e,this.pendingTotal+=e.length,this.pending.length>=this._delta8){var r=(e=this.pending).length%this._delta8;this.pending=e.slice(e.length-r,e.length),0===this.pending.length&&(this.pending=null),e=i.join32(e,0,e.length-r,this.endian);for(var n=0;n<e.length;n+=this._delta32)this._update(e,n,n+this._delta32)}return this},o.prototype.digest=function(e){return this.update(this._pad()),n(null===this.pending),this._digest(e)},o.prototype._pad=function(){var e=this.pendingTotal,t=this._delta8,r=t-(e+this.padLength)%t,i=new Array(r+this.padLength);i[0]=128;for(var n=1;n<r;n++)i[n]=0;if(e<<=3,"big"===this.endian){for(var o=8;o<this.padLength;o++)i[n++]=0;i[n++]=0,i[n++]=0,i[n++]=0,i[n++]=0,i[n++]=e>>>24&255,i[n++]=e>>>16&255,i[n++]=e>>>8&255,i[n++]=255&e}else for(i[n++]=255&e,i[n++]=e>>>8&255,i[n++]=e>>>16&255,i[n++]=e>>>24&255,i[n++]=0,i[n++]=0,i[n++]=0,i[n++]=0,o=8;o<this.padLength;o++)i[n++]=0;return i}},6209:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ObjectDisposedError=t.InvalidOperationError=t.ArgumentNullError=void 0;class r extends Error{constructor(e){super(e),this.name="ArgumentNull",this.message=e}}t.ArgumentNullError=r;class i extends Error{constructor(e){super(e),this.name="InvalidOperation",this.message=e}}t.InvalidOperationError=i;class n extends Error{constructor(e,t){super(t),this.name=e+"ObjectDisposed",this.message=t}}t.ObjectDisposedError=n},6211:(e,t)=>{"use strict";function r(e,t,r,i){switch(e){case 0:return t&r^~t&i;case 1:case 3:return t^r^i;case 2:return t&r^t&i^r&i}}function i(e,t){return e<<t|e>>>32-t}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;t.default=function(e){const t=[1518500249,1859775393,2400959708,3395469782],n=[1732584193,4023233417,2562383102,271733878,3285377520];if("string"==typeof e){const t=unescape(encodeURIComponent(e));e=[];for(let r=0;r<t.length;++r)e.push(t.charCodeAt(r))}else Array.isArray(e)||(e=Array.prototype.slice.call(e));e.push(128);const o=e.length/4+2,s=Math.ceil(o/16),a=new Array(s);for(let t=0;t<s;++t){const r=new Uint32Array(16);for(let i=0;i<16;++i)r[i]=e[64*t+4*i]<<24|e[64*t+4*i+1]<<16|e[64*t+4*i+2]<<8|e[64*t+4*i+3];a[t]=r}a[s-1][14]=8*(e.length-1)/Math.pow(2,32),a[s-1][14]=Math.floor(a[s-1][14]),a[s-1][15]=8*(e.length-1)&4294967295;for(let e=0;e<s;++e){const o=new Uint32Array(80);for(let t=0;t<16;++t)o[t]=a[e][t];for(let e=16;e<80;++e)o[e]=i(o[e-3]^o[e-8]^o[e-14]^o[e-16],1);let s=n[0],c=n[1],u=n[2],h=n[3],d=n[4];for(let e=0;e<80;++e){const n=Math.floor(e/20),a=i(s,5)+r(n,c,u,h)+d+t[n]+o[e]>>>0;d=h,h=u,u=i(c,30)>>>0,c=s,s=a}n[0]=n[0]+s>>>0,n[1]=n[1]+c>>>0,n[2]=n[2]+u>>>0,n[3]=n[3]+h>>>0,n[4]=n[4]+d>>>0}return[n[0]>>24&255,n[0]>>16&255,n[0]>>8&255,255&n[0],n[1]>>24&255,n[1]>>16&255,n[1]>>8&255,255&n[1],n[2]>>24&255,n[2]>>16&255,n[2]>>8&255,255&n[2],n[3]>>24&255,n[3]>>16&255,n[3]>>8&255,255&n[3],n[4]>>24&255,n[4]>>16&255,n[4]>>8&255,255&n[4]]}},6225:(e,t,r)=>{"use strict";var i=r(7426).rotr32;function n(e,t,r){return e&t^~e&r}function o(e,t,r){return e&t^e&r^t&r}function s(e,t,r){return e^t^r}t.ft_1=function(e,t,r,i){return 0===e?n(t,r,i):1===e||3===e?s(t,r,i):2===e?o(t,r,i):void 0},t.ch32=n,t.maj32=o,t.p32=s,t.s0_256=function(e){return i(e,2)^i(e,13)^i(e,22)},t.s1_256=function(e){return i(e,6)^i(e,11)^i(e,25)},t.g0_256=function(e){return i(e,7)^i(e,18)^e>>>3},t.g1_256=function(e){return i(e,17)^i(e,19)^e>>>10}},6229:(e,t,r)=>{"use strict";t.sha1=r(3917),t.sha224=r(7714),t.sha256=r(2287),t.sha384=r(1911),t.sha512=r(7766)},6300:(e,t)=>{"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.PropertyId=void 0,(r=t.PropertyId||(t.PropertyId={}))[r.SpeechServiceConnection_Key=0]="SpeechServiceConnection_Key",r[r.SpeechServiceConnection_Endpoint=1]="SpeechServiceConnection_Endpoint",r[r.SpeechServiceConnection_Region=2]="SpeechServiceConnection_Region",r[r.SpeechServiceAuthorization_Token=3]="SpeechServiceAuthorization_Token",r[r.SpeechServiceAuthorization_Type=4]="SpeechServiceAuthorization_Type",r[r.SpeechServiceConnection_EndpointId=5]="SpeechServiceConnection_EndpointId",r[r.SpeechServiceConnection_TranslationToLanguages=6]="SpeechServiceConnection_TranslationToLanguages",r[r.SpeechServiceConnection_TranslationVoice=7]="SpeechServiceConnection_TranslationVoice",r[r.SpeechServiceConnection_TranslationFeatures=8]="SpeechServiceConnection_TranslationFeatures",r[r.SpeechServiceConnection_TranslationCategoryId=9]="SpeechServiceConnection_TranslationCategoryId",r[r.SpeechServiceConnection_IntentRegion=10]="SpeechServiceConnection_IntentRegion",r[r.SpeechServiceConnection_ProxyHostName=11]="SpeechServiceConnection_ProxyHostName",r[r.SpeechServiceConnection_ProxyPort=12]="SpeechServiceConnection_ProxyPort",r[r.SpeechServiceConnection_ProxyUserName=13]="SpeechServiceConnection_ProxyUserName",r[r.SpeechServiceConnection_ProxyPassword=14]="SpeechServiceConnection_ProxyPassword",r[r.SpeechServiceConnection_RecoMode=15]="SpeechServiceConnection_RecoMode",r[r.SpeechServiceConnection_RecoLanguage=16]="SpeechServiceConnection_RecoLanguage",r[r.Speech_SessionId=17]="Speech_SessionId",r[r.SpeechServiceConnection_SynthLanguage=18]="SpeechServiceConnection_SynthLanguage",r[r.SpeechServiceConnection_SynthVoice=19]="SpeechServiceConnection_SynthVoice",r[r.SpeechServiceConnection_SynthOutputFormat=20]="SpeechServiceConnection_SynthOutputFormat",r[r.SpeechServiceConnection_AutoDetectSourceLanguages=21]="SpeechServiceConnection_AutoDetectSourceLanguages",r[r.SpeechServiceResponse_RequestDetailedResultTrueFalse=22]="SpeechServiceResponse_RequestDetailedResultTrueFalse",r[r.SpeechServiceResponse_RequestProfanityFilterTrueFalse=23]="SpeechServiceResponse_RequestProfanityFilterTrueFalse",r[r.SpeechServiceResponse_JsonResult=24]="SpeechServiceResponse_JsonResult",r[r.SpeechServiceResponse_JsonErrorDetails=25]="SpeechServiceResponse_JsonErrorDetails",r[r.CancellationDetails_Reason=26]="CancellationDetails_Reason",r[r.CancellationDetails_ReasonText=27]="CancellationDetails_ReasonText",r[r.CancellationDetails_ReasonDetailedText=28]="CancellationDetails_ReasonDetailedText",r[r.LanguageUnderstandingServiceResponse_JsonResult=29]="LanguageUnderstandingServiceResponse_JsonResult",r[r.SpeechServiceConnection_Url=30]="SpeechServiceConnection_Url",r[r.SpeechServiceConnection_InitialSilenceTimeoutMs=31]="SpeechServiceConnection_InitialSilenceTimeoutMs",r[r.SpeechServiceConnection_EndSilenceTimeoutMs=32]="SpeechServiceConnection_EndSilenceTimeoutMs",r[r.Speech_SegmentationSilenceTimeoutMs=33]="Speech_SegmentationSilenceTimeoutMs",r[r.Speech_SegmentationMaximumTimeMs=34]="Speech_SegmentationMaximumTimeMs",r[r.Speech_SegmentationStrategy=35]="Speech_SegmentationStrategy",r[r.SpeechServiceConnection_EnableAudioLogging=36]="SpeechServiceConnection_EnableAudioLogging",r[r.SpeechServiceConnection_LanguageIdMode=37]="SpeechServiceConnection_LanguageIdMode",r[r.SpeechServiceConnection_RecognitionEndpointVersion=38]="SpeechServiceConnection_RecognitionEndpointVersion",r[r.SpeechServiceConnection_SpeakerIdMode=39]="SpeechServiceConnection_SpeakerIdMode",r[r.SpeechServiceResponse_ProfanityOption=40]="SpeechServiceResponse_ProfanityOption",r[r.SpeechServiceResponse_PostProcessingOption=41]="SpeechServiceResponse_PostProcessingOption",r[r.SpeechServiceResponse_RequestWordLevelTimestamps=42]="SpeechServiceResponse_RequestWordLevelTimestamps",r[r.SpeechServiceResponse_StablePartialResultThreshold=43]="SpeechServiceResponse_StablePartialResultThreshold",r[r.SpeechServiceResponse_OutputFormatOption=44]="SpeechServiceResponse_OutputFormatOption",r[r.SpeechServiceResponse_TranslationRequestStablePartialResult=45]="SpeechServiceResponse_TranslationRequestStablePartialResult",r[r.SpeechServiceResponse_RequestWordBoundary=46]="SpeechServiceResponse_RequestWordBoundary",r[r.SpeechServiceResponse_RequestPunctuationBoundary=47]="SpeechServiceResponse_RequestPunctuationBoundary",r[r.SpeechServiceResponse_RequestSentenceBoundary=48]="SpeechServiceResponse_RequestSentenceBoundary",r[r.SpeechServiceResponse_DiarizeIntermediateResults=49]="SpeechServiceResponse_DiarizeIntermediateResults",r[r.Conversation_ApplicationId=50]="Conversation_ApplicationId",r[r.Conversation_DialogType=51]="Conversation_DialogType",r[r.Conversation_Initial_Silence_Timeout=52]="Conversation_Initial_Silence_Timeout",r[r.Conversation_From_Id=53]="Conversation_From_Id",r[r.Conversation_Conversation_Id=54]="Conversation_Conversation_Id",r[r.Conversation_Custom_Voice_Deployment_Ids=55]="Conversation_Custom_Voice_Deployment_Ids",r[r.Conversation_Speech_Activity_Template=56]="Conversation_Speech_Activity_Template",r[r.Conversation_Request_Bot_Status_Messages=57]="Conversation_Request_Bot_Status_Messages",r[r.Conversation_Agent_Connection_Id=58]="Conversation_Agent_Connection_Id",r[r.SpeechServiceConnection_Host=59]="SpeechServiceConnection_Host",r[r.ConversationTranslator_Host=60]="ConversationTranslator_Host",r[r.ConversationTranslator_Name=61]="ConversationTranslator_Name",r[r.ConversationTranslator_CorrelationId=62]="ConversationTranslator_CorrelationId",r[r.ConversationTranslator_Token=63]="ConversationTranslator_Token",r[r.PronunciationAssessment_ReferenceText=64]="PronunciationAssessment_ReferenceText",r[r.PronunciationAssessment_GradingSystem=65]="PronunciationAssessment_GradingSystem",r[r.PronunciationAssessment_Granularity=66]="PronunciationAssessment_Granularity",r[r.PronunciationAssessment_EnableMiscue=67]="PronunciationAssessment_EnableMiscue",r[r.PronunciationAssessment_Json=68]="PronunciationAssessment_Json",r[r.PronunciationAssessment_Params=69]="PronunciationAssessment_Params",r[r.SpeakerRecognition_Api_Version=70]="SpeakerRecognition_Api_Version",r[r.WebWorkerLoadType=71]="WebWorkerLoadType",r[r.TalkingAvatarService_WebRTC_SDP=72]="TalkingAvatarService_WebRTC_SDP"},6308:()=>{},6315:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ConversationTranscriber=void 0;const i=r(9190),n=r(2699),o=r(868),s=r(5245),a=r(881);class c extends a.Recognizer{constructor(e,t){const r=e;s.Contracts.throwIfNull(r,"speechConfig"),s.Contracts.throwIfNullOrWhitespace(r.properties.getProperty(a.PropertyId.SpeechServiceConnection_RecoLanguage),a.PropertyId[a.PropertyId.SpeechServiceConnection_RecoLanguage]),super(t,r.properties,new i.ConversationTranscriberConnectionFactory,e.tokenCredential),this.privProperties.setProperty(a.PropertyId.SpeechServiceConnection_RecognitionEndpointVersion,"2"),this.privDisposedRecognizer=!1}static FromConfig(e,t,r){const i=e;return t.properties.mergeTo(i.properties),new c(e,r)}get endpointId(){return s.Contracts.throwIfDisposed(this.privDisposedRecognizer),this.properties.getProperty(a.PropertyId.SpeechServiceConnection_EndpointId,"00000000-0000-0000-0000-000000000000")}get authorizationToken(){return this.properties.getProperty(a.PropertyId.SpeechServiceAuthorization_Token)}set authorizationToken(e){s.Contracts.throwIfNullOrWhitespace(e,"token"),this.properties.setProperty(a.PropertyId.SpeechServiceAuthorization_Token,e)}get speechRecognitionLanguage(){return s.Contracts.throwIfDisposed(this.privDisposedRecognizer),this.properties.getProperty(a.PropertyId.SpeechServiceConnection_RecoLanguage)}get outputFormat(){return s.Contracts.throwIfDisposed(this.privDisposedRecognizer),this.properties.getProperty(i.OutputFormatPropertyName,a.OutputFormat[a.OutputFormat.Simple])===a.OutputFormat[a.OutputFormat.Simple]?a.OutputFormat.Simple:a.OutputFormat.Detailed}get properties(){return this.privProperties}startTranscribingAsync(e,t){(0,o.marshalPromiseToCallbacks)(this.startContinuousRecognitionAsyncImpl(n.RecognitionMode.Conversation),e,t)}stopTranscribingAsync(e,t){(0,o.marshalPromiseToCallbacks)(this.stopContinuousRecognitionAsyncImpl(),e,t)}close(e,t){s.Contracts.throwIfDisposed(this.privDisposedRecognizer),(0,o.marshalPromiseToCallbacks)(this.dispose(!0),e,t)}async dispose(e){this.privDisposedRecognizer||(e&&(this.privDisposedRecognizer=!0,await this.implRecognizerStop()),await super.dispose(e))}createRecognizerConfig(e){return new i.RecognizerConfig(e,this.privProperties)}createServiceRecognizer(e,t,r,n){const o=r;return n.isSpeakerDiarizationEnabled=!0,new i.ConversationTranscriptionServiceRecognizer(e,t,o,n,this)}}t.ConversationTranscriber=c},6352:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CancellationDetailsBase=void 0,t.CancellationDetailsBase=class{constructor(e,t,r){this.privReason=e,this.privErrorDetails=t,this.privErrorCode=r}get reason(){return this.privReason}get errorDetails(){return this.privErrorDetails}get ErrorCode(){return this.privErrorCode}}},6376:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RecognitionEventArgs=void 0;const i=r(881);class n extends i.SessionEventArgs{constructor(e,t){super(t),this.privOffset=e}get offset(){return this.privOffset}}t.RecognitionEventArgs=n},6389:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SpeechSynthesisEventArgs=void 0,t.SpeechSynthesisEventArgs=class{constructor(e){this.privResult=e}get result(){return this.privResult}}},6420:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MeetingTranscriptionCanceledEventArgs=void 0;const i=r(6119);class n extends i.CancellationEventArgsBase{}t.MeetingTranscriptionCanceledEventArgs=n},6427:(e,t)=>{"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.PhraseResultOutputType=void 0,(r=t.PhraseResultOutputType||(t.PhraseResultOutputType={})).Always="Always",r.None="None"},6449:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TranslationServiceRecognizer=void 0;const i=r(868),n=r(881),o=r(9190);class s extends o.ConversationServiceRecognizer{constructor(e,t,r,i,n){super(e,t,r,i,n),this.privTranslationRecognizer=n,this.connectionEvents.attach(e=>{"ConnectionEstablishedEvent"===e.name&&this.privTranslationRecognizer.onConnection()})}async processTypeSpecificMessages(e){const t=new n.PropertyCollection;let r=await this.processSpeechMessages(e);if(r)return!0;const s=async e=>{if(t.setProperty(n.PropertyId.SpeechServiceResponse_JsonResult,e.asJson()),this.privRequestSession.onPhraseRecognized(e.Offset+e.Duration),e.RecognitionStatus===o.RecognitionStatus.Success){const r=this.fireEventForResult(e,t);if(this.privTranslationRecognizer.recognized)try{this.privTranslationRecognizer.recognized(this.privTranslationRecognizer,r)}catch(e){}if(this.privSuccessCallback){try{this.privSuccessCallback(r.result)}catch(e){this.privErrorCallback&&this.privErrorCallback(e)}this.privSuccessCallback=void 0,this.privErrorCallback=void 0}}else{const i=o.EnumTranslation.implTranslateRecognitionResult(e.RecognitionStatus),s=new n.TranslationRecognitionResult(void 0,this.privRequestSession.requestId,i,e.Text,e.Duration,e.Offset,e.Language,e.Confidence,void 0,e.asJson(),t);if(i===n.ResultReason.Canceled){const t=o.EnumTranslation.implTranslateCancelResult(e.RecognitionStatus),r=o.EnumTranslation.implTranslateCancelErrorCode(e.RecognitionStatus);await this.cancelRecognitionLocal(t,r,o.EnumTranslation.implTranslateErrorDetails(r))}else if(e.RecognitionStatus!==o.RecognitionStatus.EndOfDictation){const e=new n.TranslationRecognitionEventArgs(s,s.offset,this.privRequestSession.sessionId);if(this.privTranslationRecognizer.recognized)try{this.privTranslationRecognizer.recognized(this.privTranslationRecognizer,e)}catch(e){}if(this.privSuccessCallback){try{this.privSuccessCallback(s)}catch(e){this.privErrorCallback&&this.privErrorCallback(e)}this.privSuccessCallback=void 0,this.privErrorCallback=void 0}}r=!0}},a=e=>{t.setProperty(n.PropertyId.SpeechServiceResponse_JsonResult,e.asJson());const i=this.fireEventForResult(e,t);if(this.privRequestSession.onHypothesis(i.offset),this.privTranslationRecognizer.recognizing)try{this.privTranslationRecognizer.recognizing(this.privTranslationRecognizer,i)}catch(e){}r=!0};switch(e.messageType===i.MessageType.Text&&t.setProperty(n.PropertyId.SpeechServiceResponse_JsonResult,e.textBody),e.path.toLowerCase()){case"translation.hypothesis":a(o.TranslationHypothesis.fromJSON(e.textBody,this.privRequestSession.currentTurnAudioOffset));break;case"translation.response":const t=JSON.parse(e.textBody);if(t.SpeechPhrase)await s(o.TranslationPhrase.fromTranslationResponse(t,this.privRequestSession.currentTurnAudioOffset));else{const t=JSON.parse(e.textBody);t.SpeechHypothesis&&a(o.TranslationHypothesis.fromTranslationResponse(t,this.privRequestSession.currentTurnAudioOffset))}break;case"translation.phrase":await s(o.TranslationPhrase.fromJSON(e.textBody,this.privRequestSession.currentTurnAudioOffset));break;case"translation.synthesis":case"audio":this.sendSynthesisAudio(e.binaryBody,this.privRequestSession.sessionId),r=!0;break;case"audio.end":case"translation.synthesis.end":const i=o.TranslationSynthesisEnd.fromJSON(e.textBody);switch(i.SynthesisStatus){case o.SynthesisStatus.Error:if(this.privTranslationRecognizer.synthesizing){const e=new n.TranslationSynthesisResult(n.ResultReason.Canceled,void 0),t=new n.TranslationSynthesisEventArgs(e,this.privRequestSession.sessionId);try{this.privTranslationRecognizer.synthesizing(this.privTranslationRecognizer,t)}catch(e){}}if(this.privTranslationRecognizer.canceled){const e=new n.TranslationRecognitionCanceledEventArgs(this.privRequestSession.sessionId,n.CancellationReason.Error,i.FailureReason,n.CancellationErrorCode.ServiceError,null);try{this.privTranslationRecognizer.canceled(this.privTranslationRecognizer,e)}catch(e){}}break;case o.SynthesisStatus.Success:this.sendSynthesisAudio(void 0,this.privRequestSession.sessionId)}r=!0}return r}cancelRecognition(e,t,r,i,s){const a=new n.PropertyCollection;if(a.setProperty(o.CancellationErrorCodePropertyName,n.CancellationErrorCode[i]),this.privTranslationRecognizer.canceled){const t=new n.TranslationRecognitionCanceledEventArgs(e,r,s,i,void 0);try{this.privTranslationRecognizer.canceled(this.privTranslationRecognizer,t)}catch{}}if(this.privSuccessCallback){const e=new n.TranslationRecognitionResult(void 0,t,n.ResultReason.Canceled,void 0,void 0,void 0,void 0,void 0,s,void 0,a);try{this.privSuccessCallback(e),this.privSuccessCallback=void 0}catch{}}}handleRecognizingCallback(e,t,r){try{const i=new n.TranslationRecognitionEventArgs(n.TranslationRecognitionResult.fromSpeechRecognitionResult(e),t,r);this.privTranslationRecognizer.recognizing(this.privTranslationRecognizer,i)}catch(e){}}handleRecognizedCallback(e,t,r){try{const i=new n.TranslationRecognitionEventArgs(n.TranslationRecognitionResult.fromSpeechRecognitionResult(e),t,r);this.privTranslationRecognizer.recognized(this.privTranslationRecognizer,i)}catch(e){}}fireEventForResult(e,t){let r,s,a;if(void 0!==e.Translation.Translations){r=new n.Translations;for(const t of e.Translation.Translations)r.set(t.Language,t.Text||t.DisplayText)}e instanceof o.TranslationPhrase?(s=e.Translation&&e.Translation.TranslationStatus===i.TranslationStatus.Success?n.ResultReason.TranslatedSpeech:n.ResultReason.RecognizedSpeech,a=e.Confidence):s=n.ResultReason.TranslatingSpeech;const c=e.Language,u=new n.TranslationRecognitionResult(r,this.privRequestSession.requestId,s,e.Text,e.Duration,e.Offset,c,a,e.Translation.FailureReason,e.asJson(),t);return new n.TranslationRecognitionEventArgs(u,e.Offset,this.privRequestSession.sessionId)}sendSynthesisAudio(e,t){const r=void 0===e?n.ResultReason.SynthesizingAudioCompleted:n.ResultReason.SynthesizingAudio,i=new n.TranslationSynthesisResult(r,e),o=new n.TranslationSynthesisEventArgs(i,t);if(this.privTranslationRecognizer.synthesizing)try{this.privTranslationRecognizer.synthesizing(this.privTranslationRecognizer,o)}catch(e){}}}t.TranslationServiceRecognizer=s},6558:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DialogServiceConnector=void 0;const i=r(3226),n=r(9190),o=r(2699),s=r(868),a=r(5245),c=r(881),u=r(6300);class h extends c.Recognizer{constructor(e,t){const r=e;a.Contracts.throwIfNull(e,"dialogConfig"),super(t,r.properties,new i.DialogConnectionFactory),this.isTurnComplete=!0,this.privIsDisposed=!1,this.privProperties=r.properties.clone();const n=this.buildAgentConfig();this.privReco.agentConfig.set(n)}connect(e,t){(0,s.marshalPromiseToCallbacks)(this.privReco.connect(),e,t)}disconnect(e,t){(0,s.marshalPromiseToCallbacks)(this.privReco.disconnect(),e,t)}get authorizationToken(){return this.properties.getProperty(u.PropertyId.SpeechServiceAuthorization_Token)}set authorizationToken(e){a.Contracts.throwIfNullOrWhitespace(e,"token"),this.properties.setProperty(u.PropertyId.SpeechServiceAuthorization_Token,e)}get properties(){return this.privProperties}get speechActivityTemplate(){return this.properties.getProperty(u.PropertyId.Conversation_Speech_Activity_Template)}set speechActivityTemplate(e){this.properties.setProperty(u.PropertyId.Conversation_Speech_Activity_Template,e)}listenOnceAsync(e,t){if(this.isTurnComplete){a.Contracts.throwIfDisposed(this.privIsDisposed);const r=(async()=>{await this.privReco.connect(),await this.implRecognizerStop(),this.isTurnComplete=!1;const e=new s.Deferred;await this.privReco.recognize(o.RecognitionMode.Conversation,e.resolve,e.reject);const t=await e.promise;return await this.implRecognizerStop(),t})();r.catch(()=>{this.dispose(!0).catch(()=>{})}),(0,s.marshalPromiseToCallbacks)(r.finally(()=>{this.isTurnComplete=!0}),e,t)}}sendActivityAsync(e,t,r){(0,s.marshalPromiseToCallbacks)(this.privReco.sendMessage(e),t,r)}close(e,t){a.Contracts.throwIfDisposed(this.privIsDisposed),(0,s.marshalPromiseToCallbacks)(this.dispose(!0),e,t)}async dispose(e){this.privIsDisposed||e&&(this.privIsDisposed=!0,await this.implRecognizerStop(),await super.dispose(e))}createRecognizerConfig(e){return new n.RecognizerConfig(e,this.privProperties)}createServiceRecognizer(e,t,r,i){const o=r;return new n.DialogServiceAdapter(e,t,o,i,this)}buildAgentConfig(){return{botInfo:{commType:this.properties.getProperty("Conversation_Communication_Type","Default"),commandsCulture:void 0,connectionId:this.properties.getProperty(u.PropertyId.Conversation_Agent_Connection_Id),conversationId:this.properties.getProperty(u.PropertyId.Conversation_Conversation_Id,void 0),fromId:this.properties.getProperty(u.PropertyId.Conversation_From_Id,void 0),ttsAudioFormat:this.properties.getProperty(u.PropertyId.SpeechServiceConnection_SynthOutputFormat,void 0)},version:.2}}}t.DialogServiceConnector=h},6565:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};t.default=r},6641:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TextResponsePayload=t.SpeechResponsePayload=t.ParticipantPayloadResponse=t.ParticipantsListPayloadResponse=t.CommandResponsePayload=void 0;var i=r(9828);Object.defineProperty(t,"CommandResponsePayload",{enumerable:!0,get:function(){return i.CommandResponsePayload}});var n=r(2512);Object.defineProperty(t,"ParticipantsListPayloadResponse",{enumerable:!0,get:function(){return n.ParticipantsListPayloadResponse}}),Object.defineProperty(t,"ParticipantPayloadResponse",{enumerable:!0,get:function(){return n.ParticipantPayloadResponse}});var o=r(3126);Object.defineProperty(t,"SpeechResponsePayload",{enumerable:!0,get:function(){return o.SpeechResponsePayload}}),Object.defineProperty(t,"TextResponsePayload",{enumerable:!0,get:function(){return o.TextResponsePayload}})},6682:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},6698:e=>{"function"==typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}}},6731:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IntentRecognitionCanceledEventArgs=void 0;const i=r(881);class n extends i.IntentRecognitionEventArgs{constructor(e,t,r,i,n,o){super(i,n,o),this.privReason=e,this.privErrorDetails=t,this.privErrorCode=r}get reason(){return this.privReason}get errorCode(){return this.privErrorCode}get errorDetails(){return this.privErrorDetails}}t.IntentRecognitionCanceledEventArgs=n},6784:(e,t,r)=>{"use strict";var i=r(7426),n=r(6166),o=i.rotl32,s=i.sum32,a=i.sum32_3,c=i.sum32_4,u=n.BlockHash;function h(){if(!(this instanceof h))return new h;u.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}function d(e,t,r,i){return e<=15?t^r^i:e<=31?t&r|~t&i:e<=47?(t|~r)^i:e<=63?t&i|r&~i:t^(r|~i)}function l(e){return e<=15?0:e<=31?1518500249:e<=47?1859775393:e<=63?2400959708:2840853838}function p(e){return e<=15?1352829926:e<=31?1548603684:e<=47?1836072691:e<=63?2053994217:0}i.inherits(h,u),t.ripemd160=h,h.blockSize=512,h.outSize=160,h.hmacStrength=192,h.padLength=64,h.prototype._update=function(e,t){for(var r=this.h[0],i=this.h[1],n=this.h[2],u=this.h[3],h=this.h[4],y=r,b=i,S=n,C=u,w=h,P=0;P<80;P++){var A=s(o(c(r,d(P,i,n,u),e[f[P]+t],l(P)),g[P]),h);r=h,h=u,u=o(n,10),n=i,i=A,A=s(o(c(y,d(79-P,b,S,C),e[v[P]+t],p(P)),m[P]),w),y=w,w=C,C=o(S,10),S=b,b=A}A=a(this.h[1],n,C),this.h[1]=a(this.h[2],u,w),this.h[2]=a(this.h[3],h,y),this.h[3]=a(this.h[4],r,b),this.h[4]=a(this.h[0],i,S),this.h[0]=A},h.prototype._digest=function(e){return"hex"===e?i.toHex32(this.h,"little"):i.split32(this.h,"little")};var f=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],v=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],g=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],m=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]},6793:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ConversationTranscriptionResult=void 0;const i=r(881);class n extends i.RecognitionResult{constructor(e,t,r,i,n,o,s,a,c,u,h){super(e,t,r,i,n,o,s,c,u,h),this.privSpeakerId=a}get speakerId(){return this.privSpeakerId}}t.ConversationTranscriptionResult=n},6821:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.unsafeStringify=s;var i,n=(i=r(1280))&&i.__esModule?i:{default:i};const o=[];for(let e=0;e<256;++e)o.push((e+256).toString(16).slice(1));function s(e,t=0){return o[e[t+0]]+o[e[t+1]]+o[e[t+2]]+o[e[t+3]]+"-"+o[e[t+4]]+o[e[t+5]]+"-"+o[e[t+6]]+o[e[t+7]]+"-"+o[e[t+8]]+o[e[t+9]]+"-"+o[e[t+10]]+o[e[t+11]]+o[e[t+12]]+o[e[t+13]]+o[e[t+14]]+o[e[t+15]]}t.default=function(e,t=0){const r=s(e,t);if(!(0,n.default)(r))throw TypeError("Stringified UUID is invalid");return r}},6873:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=o(r(1706)),n=o(r(400));function o(e){return e&&e.__esModule?e:{default:e}}var s=(0,i.default)("v3",48,n.default);t.default=s},6883:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AudioOutputConfigImpl=t.AudioConfigImpl=t.AudioConfig=void 0;const i=r(4378),n=r(5245),o=r(881),s=r(7208),a=r(2025),c=r(8640);class u{static fromDefaultMicrophoneInput(){const e=new i.PcmRecorder(!0);return new h(new i.MicAudioSource(e))}static fromMicrophoneInput(e){const t=new i.PcmRecorder(!0);return new h(new i.MicAudioSource(t,e))}static fromWavFileInput(e,t="unnamedBuffer.wav"){return new h(new i.FileAudioSource(e,t))}static fromStreamInput(e){if(e instanceof o.PullAudioInputStreamCallback)return new h(new a.PullAudioInputStreamImpl(e));if(e instanceof o.AudioInputStream)return new h(e);if("undefined"!=typeof MediaStream&&e instanceof MediaStream){const t=new i.PcmRecorder(!1);return new h(new i.MicAudioSource(t,null,null,e))}throw new Error("Not Supported Type")}static fromDefaultSpeakerOutput(){return new d(new o.SpeakerAudioDestination)}static fromSpeakerOutput(e){if(void 0===e)return u.fromDefaultSpeakerOutput();if(e instanceof o.SpeakerAudioDestination)return new d(e);throw new Error("Not Supported Type")}static fromAudioFileOutput(e){return new d(new s.AudioFileWriter(e))}static fromStreamOutput(e){if(e instanceof o.PushAudioOutputStreamCallback)return new d(new c.PushAudioOutputStreamImpl(e));if(e instanceof o.PushAudioOutputStream)return new d(e);if(e instanceof o.PullAudioOutputStream)return new d(e);throw new Error("Not Supported Type")}}t.AudioConfig=u;class h extends u{constructor(e){super(),this.privSource=e}get format(){return this.privSource.format}close(e,t){this.privSource.turnOff().then(()=>{e&&e()},e=>{t&&t(e)})}id(){return this.privSource.id()}turnOn(){return this.privSource.turnOn()}attach(e){return this.privSource.attach(e)}detach(e){return this.privSource.detach(e)}turnOff(){return this.privSource.turnOff()}get events(){return this.privSource.events}setProperty(e,t){if(n.Contracts.throwIfNull(t,"value"),void 0===this.privSource.setProperty)throw new Error("This AudioConfig instance does not support setting properties.");this.privSource.setProperty(e,t)}getProperty(e,t){if(void 0!==this.privSource.getProperty)return this.privSource.getProperty(e,t);throw new Error("This AudioConfig instance does not support getting properties.")}get deviceInfo(){return this.privSource.deviceInfo}}t.AudioConfigImpl=h;class d extends u{constructor(e){super(),this.privDestination=e}set format(e){this.privDestination.format=e}write(e){this.privDestination.write(e)}close(){this.privDestination.close()}id(){return this.privDestination.id()}setProperty(){throw new Error("This AudioConfig instance does not support setting properties.")}getProperty(){throw new Error("This AudioConfig instance does not support getting properties.")}}t.AudioOutputConfigImpl=d},6924:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=s(r(6565)),n=s(r(7285)),o=r(6821);function s(e){return e&&e.__esModule?e:{default:e}}t.default=function(e,t,r){if(i.default.randomUUID&&!t&&!e)return i.default.randomUUID();const s=(e=e||{}).random||(e.rng||n.default)();if(s[6]=15&s[6]|64,s[8]=63&s[8]|128,t){r=r||0;for(let e=0;e<16;++e)t[r+e]=s[e];return t}return(0,o.unsafeStringify)(s)}},6986:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AgentConfig=void 0,t.AgentConfig=class{toJsonString(){return JSON.stringify(this.iPrivConfig)}get(){return this.iPrivConfig}set(e){this.iPrivConfig=e}}},7014:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.HeaderNames=void 0;class r{}t.HeaderNames=r,r.AuthKey="Ocp-Apim-Subscription-Key",r.Authorization="Authorization",r.SpIDAuthKey="Apim-Subscription-Id",r.ConnectionId="X-ConnectionId",r.ContentType="Content-Type",r.CustomCommandsAppId="X-CommandsAppId",r.Path="Path",r.RequestId="X-RequestId",r.RequestStreamId="X-StreamId",r.RequestTimestamp="X-Timestamp"},7037:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IntentConnectionFactory=void 0;const i=r(4378),n=r(881),o=r(7778),s=r(9190),a=r(7014);class c extends o.ConnectionFactoryBase{create(e,t,r){let c=e.parameters.getProperty(n.PropertyId.SpeechServiceConnection_Endpoint);if(!c){const t=e.parameters.getProperty(n.PropertyId.SpeechServiceConnection_IntentRegion),r=o.ConnectionFactoryBase.getHostSuffix(t);c=e.parameters.getProperty(n.PropertyId.SpeechServiceConnection_Host,"wss://"+t+".sr.speech"+r)+"/speech/recognition/interactive/cognitiveservices/v1"}const u={format:"simple",language:e.parameters.getProperty(n.PropertyId.SpeechServiceConnection_RecoLanguage)};this.setCommonUrlParams(e,u,c);const h={};void 0!==t.token&&""!==t.token&&(h[t.headerName]=t.token),h[a.HeaderNames.ConnectionId]=r,e.parameters.setProperty(n.PropertyId.SpeechServiceConnection_Url,c);const d="true"===e.parameters.getProperty("SPEECH-EnableWebsocketCompression","false");return Promise.resolve(new i.WebsocketConnection(c,u,h,new s.WebsocketMessageFormatter,i.ProxyInfo.fromRecognizerConfig(e),d,r))}getSpeechRegionFromIntentRegion(e){switch(e){case"West US":case"US West":case"westus":return"uswest";case"West US 2":case"US West 2":case"westus2":return"uswest2";case"South Central US":case"US South Central":case"southcentralus":return"ussouthcentral";case"West Central US":case"US West Central":case"westcentralus":return"uswestcentral";case"East US":case"US East":case"eastus":return"useast";case"East US 2":case"US East 2":case"eastus2":return"useast2";case"West Europe":case"Europe West":case"westeurope":return"europewest";case"North Europe":case"Europe North":case"northeurope":return"europenorth";case"Brazil South":case"South Brazil":case"southbrazil":return"brazilsouth";case"Australia East":case"East Australia":case"eastaustralia":return"australiaeast";case"Southeast Asia":case"Asia Southeast":case"southeastasia":return"asiasoutheast";case"East Asia":case"Asia East":case"eastasia":return"asiaeast";default:return e}}}t.IntentConnectionFactory=c},7065:(e,t)=>{"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.ResultReason=void 0,(r=t.ResultReason||(t.ResultReason={}))[r.NoMatch=0]="NoMatch",r[r.Canceled=1]="Canceled",r[r.RecognizingSpeech=2]="RecognizingSpeech",r[r.RecognizedSpeech=3]="RecognizedSpeech",r[r.RecognizedKeyword=4]="RecognizedKeyword",r[r.RecognizingIntent=5]="RecognizingIntent",r[r.RecognizedIntent=6]="RecognizedIntent",r[r.TranslatingSpeech=7]="TranslatingSpeech",r[r.TranslatedSpeech=8]="TranslatedSpeech",r[r.SynthesizingAudio=9]="SynthesizingAudio",r[r.SynthesizingAudioCompleted=10]="SynthesizingAudioCompleted",r[r.SynthesizingAudioStarted=11]="SynthesizingAudioStarted",r[r.EnrollingVoiceProfile=12]="EnrollingVoiceProfile",r[r.EnrolledVoiceProfile=13]="EnrolledVoiceProfile",r[r.RecognizedSpeakers=14]="RecognizedSpeakers",r[r.RecognizedSpeaker=15]="RecognizedSpeaker",r[r.ResetVoiceProfile=16]="ResetVoiceProfile",r[r.DeletedVoiceProfile=17]="DeletedVoiceProfile",r[r.VoicesListRetrieved=18]="VoicesListRetrieved",r[r.TranslatingParticipantSpeech=19]="TranslatingParticipantSpeech",r[r.TranslatedParticipantSpeech=20]="TranslatedParticipantSpeech",r[r.TranslatedInstantMessage=21]="TranslatedInstantMessage",r[r.TranslatedParticipantInstantMessage=22]="TranslatedParticipantInstantMessage"},7100:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ServiceTelemetryListener=void 0;const i=r(868),n=r(5843);t.ServiceTelemetryListener=class{constructor(e,t,r){this.privIsDisposed=!1,this.privListeningTriggerMetric=null,this.privMicMetric=null,this.privConnectionEstablishMetric=null,this.privRequestId=e,this.privAudioSourceId=t,this.privAudioNodeId=r,this.privReceivedMessages={},this.privPhraseLatencies=[],this.privHypothesisLatencies=[]}phraseReceived(e){e>0&&this.privPhraseLatencies.push(Date.now()-e)}hypothesisReceived(e){e>0&&this.privHypothesisLatencies.push(Date.now()-e)}onEvent(e){if(!this.privIsDisposed&&(e instanceof n.RecognitionTriggeredEvent&&e.requestId===this.privRequestId&&(this.privListeningTriggerMetric={End:e.eventTime,Name:"ListeningTrigger",Start:e.eventTime}),e instanceof i.AudioStreamNodeAttachingEvent&&e.audioSourceId===this.privAudioSourceId&&e.audioNodeId===this.privAudioNodeId&&(this.privMicStartTime=e.eventTime),e instanceof i.AudioStreamNodeAttachedEvent&&e.audioSourceId===this.privAudioSourceId&&e.audioNodeId===this.privAudioNodeId&&(this.privMicStartTime=e.eventTime),e instanceof i.AudioSourceErrorEvent&&e.audioSourceId===this.privAudioSourceId&&(this.privMicMetric||(this.privMicMetric={End:e.eventTime,Error:e.error,Name:"Microphone",Start:this.privMicStartTime})),e instanceof i.AudioStreamNodeErrorEvent&&e.audioSourceId===this.privAudioSourceId&&e.audioNodeId===this.privAudioNodeId&&(this.privMicMetric||(this.privMicMetric={End:e.eventTime,Error:e.error,Name:"Microphone",Start:this.privMicStartTime})),e instanceof i.AudioStreamNodeDetachedEvent&&e.audioSourceId===this.privAudioSourceId&&e.audioNodeId===this.privAudioNodeId&&(this.privMicMetric||(this.privMicMetric={End:e.eventTime,Name:"Microphone",Start:this.privMicStartTime})),e instanceof n.ConnectingToServiceEvent&&e.requestId===this.privRequestId&&(this.privConnectionId=e.sessionId),e instanceof i.ConnectionStartEvent&&e.connectionId===this.privConnectionId&&(this.privConnectionStartTime=e.eventTime),e instanceof i.ConnectionEstablishedEvent&&e.connectionId===this.privConnectionId&&(this.privConnectionEstablishMetric||(this.privConnectionEstablishMetric={End:e.eventTime,Id:this.privConnectionId,Name:"Connection",Start:this.privConnectionStartTime})),e instanceof i.ConnectionEstablishErrorEvent&&e.connectionId===this.privConnectionId&&(this.privConnectionEstablishMetric||(this.privConnectionEstablishMetric={End:e.eventTime,Error:this.getConnectionError(e.statusCode),Id:this.privConnectionId,Name:"Connection",Start:this.privConnectionStartTime})),e instanceof i.ConnectionMessageReceivedEvent&&e.connectionId===this.privConnectionId&&e.message&&e.message.headers&&e.message.headers.path)){this.privReceivedMessages[e.message.headers.path]||(this.privReceivedMessages[e.message.headers.path]=new Array);const t=50;this.privReceivedMessages[e.message.headers.path].length<t&&this.privReceivedMessages[e.message.headers.path].push(e.networkReceivedTime)}}getTelemetry(){const e=new Array;this.privListeningTriggerMetric&&e.push(this.privListeningTriggerMetric),this.privMicMetric&&e.push(this.privMicMetric),this.privConnectionEstablishMetric&&e.push(this.privConnectionEstablishMetric),this.privPhraseLatencies.length>0&&e.push({PhraseLatencyMs:this.privPhraseLatencies}),this.privHypothesisLatencies.length>0&&e.push({FirstHypothesisLatencyMs:this.privHypothesisLatencies});const t={Metrics:e,ReceivedMessages:this.privReceivedMessages},r=JSON.stringify(t);return this.privReceivedMessages={},this.privListeningTriggerMetric=null,this.privMicMetric=null,this.privConnectionEstablishMetric=null,this.privPhraseLatencies=[],this.privHypothesisLatencies=[],r}get hasTelemetry(){return 0!==Object.keys(this.privReceivedMessages).length||null!==this.privListeningTriggerMetric||null!==this.privMicMetric||null!==this.privConnectionEstablishMetric||0!==this.privPhraseLatencies.length||0!==this.privHypothesisLatencies.length}dispose(){this.privIsDisposed=!0}getConnectionError(e){switch(e){case 400:case 1002:case 1003:case 1005:case 1007:case 1008:case 1009:return"BadRequest";case 401:return"Unauthorized";case 403:return"Forbidden";case 503:case 1001:return"ServerUnavailable";case 500:case 1011:return"ServerError";case 408:case 504:return"Timeout";default:return"statuscode:"+e.toString()}}}},7126:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.type=t.connectivity=t.Device=t.OS=t.System=t.Context=t.SpeechServiceConfig=void 0,t.SpeechServiceConfig=class{constructor(e){this.context=e}serialize(){return JSON.stringify(this,(e,t)=>{if(t&&"object"==typeof t&&!Array.isArray(t)){const e={};for(const r in t)Object.hasOwnProperty.call(t,r)&&(e[r&&r.charAt(0).toLowerCase()+r.substring(1)]=t[r]);return e}return t})}get Context(){return this.context}get Recognition(){return this.recognition}set Recognition(e){this.recognition=e.toLowerCase()}},t.Context=class{constructor(e){this.system=new r,this.os=e}};class r{constructor(){this.name="SpeechSDK",this.version="1.45.0",this.build="JavaScript",this.lang="JavaScript"}}var i,n;t.System=r,t.OS=class{constructor(e,t,r){this.platform=e,this.name=t,this.version=r}},t.Device=class{constructor(e,t,r){this.manufacturer=e,this.model=t,this.version=r}},(n=t.connectivity||(t.connectivity={})).Bluetooth="Bluetooth",n.Wired="Wired",n.WiFi="WiFi",n.Cellular="Cellular",n.InBuilt="InBuilt",n.Unknown="Unknown",(i=t.type||(t.type={})).Phone="Phone",i.Speaker="Speaker",i.Car="Car",i.Headset="Headset",i.Thermostat="Thermostat",i.Microphones="Microphones",i.Deskphone="Deskphone",i.RemoteControl="RemoteControl",i.Unknown="Unknown",i.File="File",i.Stream="Stream"},7181:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ConversationParticipantsChangedEventArgs=void 0;const i=r(881);class n extends i.SessionEventArgs{constructor(e,t,r){super(r),this.privReason=e,this.privParticipant=t}get reason(){return this.privReason}get participants(){return this.privParticipant}}t.ConversationParticipantsChangedEventArgs=n},7207:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SpeechRecognitionCanceledEventArgs=void 0;const i=r(6119);class n extends i.CancellationEventArgsBase{}t.SpeechRecognitionCanceledEventArgs=n},7208:function(e,t,r){"use strict";var i=this&&this.__createBinding||(Object.create?function(e,t,r,i){void 0===i&&(i=r),Object.defineProperty(e,i,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,i){void 0===i&&(i=r),e[i]=t[r]}),n=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&i(t,e,r);return n(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.AudioFileWriter=void 0;const s=o(r(952)),a=r(5245);t.AudioFileWriter=class{constructor(e){a.Contracts.throwIfNullOrUndefined(s.openSync,"\nFile System access not available, please use Push or PullAudioOutputStream"),this.privFd=s.openSync(e,"w")}set format(e){a.Contracts.throwIfNotUndefined(this.privAudioFormat,"format is already set"),this.privAudioFormat=e;let t=0;this.privAudioFormat.hasHeader&&(t=this.privAudioFormat.header.byteLength),void 0!==this.privFd&&(this.privWriteStream=s.createWriteStream("",{fd:this.privFd,start:t,autoClose:!1}))}write(e){a.Contracts.throwIfNullOrUndefined(this.privAudioFormat,"must set format before writing."),void 0!==this.privWriteStream&&this.privWriteStream.write(new Uint8Array(e.slice(0)))}close(){void 0!==this.privFd&&(this.privWriteStream.on("finish",()=>{this.privAudioFormat.hasHeader&&(this.privAudioFormat.updateHeader(this.privWriteStream.bytesWritten),s.writeSync(this.privFd,new Int8Array(this.privAudioFormat.header),0,this.privAudioFormat.header.byteLength,0)),s.closeSync(this.privFd),this.privFd=void 0}),this.privWriteStream.end())}id(){return this.privId}}},7285:(e,t)=>{"use strict";let r;Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){if(!r&&(r="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!r))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return r(i)};const i=new Uint8Array(16)},7317:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PropertyCollection=void 0;const i=r(881);class n{constructor(){this.privKeys=[],this.privValues=[]}getProperty(e,t){let r;r="string"==typeof e?e:i.PropertyId[e];for(let e=0;e<this.privKeys.length;e++)if(this.privKeys[e]===r)return this.privValues[e];if(void 0!==t)return String(t)}setProperty(e,t){let r;r="string"==typeof e?e:i.PropertyId[e];for(let e=0;e<this.privKeys.length;e++)if(this.privKeys[e]===r)return void(this.privValues[e]=t);this.privKeys.push(r),this.privValues.push(t)}clone(){const e=new n;for(let t=0;t<this.privKeys.length;t++)e.privKeys.push(this.privKeys[t]),e.privValues.push(this.privValues[t]);return e}mergeTo(e){this.privKeys.forEach(t=>{if(void 0===e.getProperty(t,void 0)){const r=this.getProperty(t);e.setProperty(t,r)}})}get keys(){return this.privKeys}}t.PropertyCollection=n},7351:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MeetingTranscriptionCanceledEventArgs=void 0;const i=r(6119);class n extends i.CancellationEventArgsBase{}t.MeetingTranscriptionCanceledEventArgs=n},7378:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RiffPcmEncoder=void 0,t.RiffPcmEncoder=class{constructor(e,t){this.privActualSampleRate=e,this.privDesiredSampleRate=t}encode(e){const t=this.downSampleAudioFrame(e,this.privActualSampleRate,this.privDesiredSampleRate);if(!t)return null;const r=2*t.length,i=new ArrayBuffer(r),n=new DataView(i);return this.floatTo16BitPCM(n,0,t),i}setString(e,t,r){for(let i=0;i<r.length;i++)e.setUint8(t+i,r.charCodeAt(i))}floatTo16BitPCM(e,t,r){for(let i=0;i<r.length;i++,t+=2){const n=Math.max(-1,Math.min(1,r[i]));e.setInt16(t,n<0?32768*n:32767*n,!0)}}downSampleAudioFrame(e,t,r){if(!e)return null;if(r===t||r>t)return e;const i=t/r,n=Math.round(e.length/i),o=new Float32Array(n);let s=0,a=0;for(;a<n;){const t=Math.round((a+1)*i);let r=0,n=0;for(;s<t&&s<e.length;)r+=e[s++],n++;o[a++]=r/n}return o}}},7402:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IntentServiceRecognizer=void 0;const i=r(868),n=r(881),o=r(9190);class s extends o.ServiceRecognizerBase{constructor(e,t,r,i,n){super(e,t,r,i,n),this.privIntentRecognizer=n,this.privIntentDataSent=!1,i.recognitionEndpointVersion="1"}setIntents(e,t){this.privAddedLmIntents=e,this.privUmbrellaIntent=t,this.privIntentDataSent=!0}processTypeSpecificMessages(e){let t,r,s=!1;const a=new n.PropertyCollection;switch(e.messageType===i.MessageType.Text&&a.setProperty(n.PropertyId.SpeechServiceResponse_JsonResult,e.textBody),e.path.toLowerCase()){case"speech.hypothesis":const i=o.SpeechHypothesis.fromJSON(e.textBody,this.privRequestSession.currentTurnAudioOffset);if(t=new n.IntentRecognitionResult(void 0,this.privRequestSession.requestId,n.ResultReason.RecognizingIntent,i.Text,i.Duration,i.Offset,i.Language,i.LanguageDetectionConfidence,void 0,i.asJson(),a),this.privRequestSession.onHypothesis(t.offset),r=new n.IntentRecognitionEventArgs(t,i.Offset,this.privRequestSession.sessionId),this.privIntentRecognizer.recognizing)try{this.privIntentRecognizer.recognizing(this.privIntentRecognizer,r)}catch(e){}s=!0;break;case"speech.phrase":const c=o.SimpleSpeechPhrase.fromJSON(e.textBody,this.privRequestSession.currentTurnAudioOffset);t=new n.IntentRecognitionResult(void 0,this.privRequestSession.requestId,o.EnumTranslation.implTranslateRecognitionResult(c.RecognitionStatus),c.DisplayText,c.Duration,c.Offset,c.Language,c.LanguageDetectionConfidence,void 0,c.asJson(),a),r=new n.IntentRecognitionEventArgs(t,t.offset,this.privRequestSession.sessionId);const u=()=>{if(this.privIntentRecognizer.recognized)try{this.privIntentRecognizer.recognized(this.privIntentRecognizer,r)}catch(e){}if(this.privSuccessCallback){try{this.privSuccessCallback(t)}catch(e){this.privErrorCallback&&this.privErrorCallback(e)}this.privSuccessCallback=void 0,this.privErrorCallback=void 0}};!1===this.privIntentDataSent||n.ResultReason.NoMatch===r.result.reason?(this.privRequestSession.onPhraseRecognized(r.offset+r.result.duration),u()):this.privPendingIntentArgs=r,s=!0;break;case"response":if(r=this.privPendingIntentArgs,this.privPendingIntentArgs=void 0,void 0===r){if(""===e.textBody)return;r=new n.IntentRecognitionEventArgs(new n.IntentRecognitionResult,0,this.privRequestSession.sessionId)}const h=o.IntentResponse.fromJSON(e.textBody);if(null!==h&&h.topScoringIntent&&h.topScoringIntent.intent){let t=this.privAddedLmIntents[h.topScoringIntent.intent];if(void 0!==this.privUmbrellaIntent&&(t=this.privUmbrellaIntent),t){const i=void 0===t||void 0===t.intentName?h.topScoringIntent.intent:t.intentName;let o=r.result.reason;void 0!==i&&(o=n.ResultReason.RecognizedIntent);const s=void 0!==r.result.properties?r.result.properties:new n.PropertyCollection;s.setProperty(n.PropertyId.LanguageUnderstandingServiceResponse_JsonResult,e.textBody),r=new n.IntentRecognitionEventArgs(new n.IntentRecognitionResult(i,r.result.resultId,o,r.result.text,r.result.duration,r.result.offset,void 0,void 0,r.result.errorDetails,r.result.json,s),r.offset,r.sessionId)}}if(this.privRequestSession.onPhraseRecognized(r.offset+r.result.duration),this.privIntentRecognizer.recognized)try{this.privIntentRecognizer.recognized(this.privIntentRecognizer,r)}catch(e){}if(this.privSuccessCallback){try{this.privSuccessCallback(r.result)}catch(e){this.privErrorCallback&&this.privErrorCallback(e)}this.privSuccessCallback=void 0,this.privErrorCallback=void 0}s=!0}const c=new i.Deferred;return c.resolve(s),c.promise}cancelRecognition(e,t,r,i,s){const a=new n.PropertyCollection;if(a.setProperty(o.CancellationErrorCodePropertyName,n.CancellationErrorCode[i]),this.privIntentRecognizer.canceled){const t=new n.IntentRecognitionCanceledEventArgs(r,s,i,void 0,void 0,e);try{this.privIntentRecognizer.canceled(this.privIntentRecognizer,t)}catch{}}if(this.privSuccessCallback){const e=new n.IntentRecognitionResult(void 0,t,n.ResultReason.Canceled,void 0,void 0,void 0,void 0,void 0,s,void 0,a);try{this.privSuccessCallback(e),this.privSuccessCallback=void 0}catch{}}}}t.IntentServiceRecognizer=s},7426:(e,t,r)=>{"use strict";var i=r(3349),n=r(6698);function o(e,t){return 55296==(64512&e.charCodeAt(t))&&!(t<0||t+1>=e.length)&&56320==(64512&e.charCodeAt(t+1))}function s(e){return(e>>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24)>>>0}function a(e){return 1===e.length?"0"+e:e}function c(e){return 7===e.length?"0"+e:6===e.length?"00"+e:5===e.length?"000"+e:4===e.length?"0000"+e:3===e.length?"00000"+e:2===e.length?"000000"+e:1===e.length?"0000000"+e:e}t.inherits=n,t.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var r=[];if("string"==typeof e)if(t){if("hex"===t)for((e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e),n=0;n<e.length;n+=2)r.push(parseInt(e[n]+e[n+1],16))}else for(var i=0,n=0;n<e.length;n++){var s=e.charCodeAt(n);s<128?r[i++]=s:s<2048?(r[i++]=s>>6|192,r[i++]=63&s|128):o(e,n)?(s=65536+((1023&s)<<10)+(1023&e.charCodeAt(++n)),r[i++]=s>>18|240,r[i++]=s>>12&63|128,r[i++]=s>>6&63|128,r[i++]=63&s|128):(r[i++]=s>>12|224,r[i++]=s>>6&63|128,r[i++]=63&s|128)}else for(n=0;n<e.length;n++)r[n]=0|e[n];return r},t.toHex=function(e){for(var t="",r=0;r<e.length;r++)t+=a(e[r].toString(16));return t},t.htonl=s,t.toHex32=function(e,t){for(var r="",i=0;i<e.length;i++){var n=e[i];"little"===t&&(n=s(n)),r+=c(n.toString(16))}return r},t.zero2=a,t.zero8=c,t.join32=function(e,t,r,n){var o=r-t;i(o%4==0);for(var s=new Array(o/4),a=0,c=t;a<s.length;a++,c+=4){var u;u="big"===n?e[c]<<24|e[c+1]<<16|e[c+2]<<8|e[c+3]:e[c+3]<<24|e[c+2]<<16|e[c+1]<<8|e[c],s[a]=u>>>0}return s},t.split32=function(e,t){for(var r=new Array(4*e.length),i=0,n=0;i<e.length;i++,n+=4){var o=e[i];"big"===t?(r[n]=o>>>24,r[n+1]=o>>>16&255,r[n+2]=o>>>8&255,r[n+3]=255&o):(r[n+3]=o>>>24,r[n+2]=o>>>16&255,r[n+1]=o>>>8&255,r[n]=255&o)}return r},t.rotr32=function(e,t){return e>>>t|e<<32-t},t.rotl32=function(e,t){return e<<t|e>>>32-t},t.sum32=function(e,t){return e+t>>>0},t.sum32_3=function(e,t,r){return e+t+r>>>0},t.sum32_4=function(e,t,r,i){return e+t+r+i>>>0},t.sum32_5=function(e,t,r,i,n){return e+t+r+i+n>>>0},t.sum64=function(e,t,r,i){var n=e[t],o=i+e[t+1]>>>0,s=(o<i?1:0)+r+n;e[t]=s>>>0,e[t+1]=o},t.sum64_hi=function(e,t,r,i){return(t+i>>>0<t?1:0)+e+r>>>0},t.sum64_lo=function(e,t,r,i){return t+i>>>0},t.sum64_4_hi=function(e,t,r,i,n,o,s,a){var c=0,u=t;return c+=(u=u+i>>>0)<t?1:0,c+=(u=u+o>>>0)<o?1:0,e+r+n+s+(c+=(u=u+a>>>0)<a?1:0)>>>0},t.sum64_4_lo=function(e,t,r,i,n,o,s,a){return t+i+o+a>>>0},t.sum64_5_hi=function(e,t,r,i,n,o,s,a,c,u){var h=0,d=t;return h+=(d=d+i>>>0)<t?1:0,h+=(d=d+o>>>0)<o?1:0,h+=(d=d+a>>>0)<a?1:0,e+r+n+s+c+(h+=(d=d+u>>>0)<u?1:0)>>>0},t.sum64_5_lo=function(e,t,r,i,n,o,s,a,c,u){return t+i+o+a+u>>>0},t.rotr64_hi=function(e,t,r){return(t<<32-r|e>>>r)>>>0},t.rotr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0},t.shr64_hi=function(e,t,r){return e>>>r},t.shr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0}},7461:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SynthesizerConfig=t.SynthesisServiceType=void 0;const i=r(9190);var n;!function(e){e[e.Standard=0]="Standard",e[e.Custom=1]="Custom"}(n=t.SynthesisServiceType||(t.SynthesisServiceType={})),t.SynthesizerConfig=class{constructor(e,t){this.privSynthesisServiceType=n.Standard,this.avatarEnabled=!1,this.privSpeechServiceConfig=e||new i.SpeechServiceConfig(new i.Context(null)),this.privParameters=t}get parameters(){return this.privParameters}get synthesisServiceType(){return this.privSynthesisServiceType}set synthesisServiceType(e){this.privSynthesisServiceType=e}set synthesisVideoSection(e){this.privSpeechServiceConfig.Context.synthesis={video:e}}get SpeechServiceConfig(){return this.privSpeechServiceConfig}setContextFromJson(e){const t=JSON.parse(e);t.system&&(this.privSpeechServiceConfig.Context.system=t.system),t.os&&(this.privSpeechServiceConfig.Context.os=t.os),t.audio&&(this.privSpeechServiceConfig.Context.audio=t.audio),t.synthesis&&(this.privSpeechServiceConfig.Context.synthesis=t.synthesis)}}},7512:(e,t)=>{"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.OnRejectAction=t.KeywordDetectionType=void 0,(t.KeywordDetectionType||(t.KeywordDetectionType={})).StartTrigger="StartTrigger",(r=t.OnRejectAction||(t.OnRejectAction={})).EndOfTurn="EndOfTurn",r.Continue="Continue"},7689:function(e,t,r){"use strict";var i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.RestMessageAdapter=t.RestRequestType=void 0;const n=i(r(9163)),o=r(868);var s;!function(e){e.Get="GET",e.Post="POST",e.Delete="DELETE",e.File="file"}(s=t.RestRequestType||(t.RestRequestType={})),t.RestMessageAdapter=class{constructor(e){if(!e)throw new o.ArgumentNullError("configParams");this.privHeaders=e.headers,this.privIgnoreCache=e.ignoreCache}static extractHeaderValue(e,t){let r="";try{const i=t.trim().split(/[\r\n]+/),n={};i.forEach(e=>{const t=e.split(": "),r=t.shift().toLowerCase(),i=t.join(": ");n[r]=i}),r=n[e.toLowerCase()]}catch(e){}return r}set options(e){this.privHeaders=e.headers,this.privIgnoreCache=e.ignoreCache}setHeaders(e,t){this.privHeaders[e]=t}request(e,t,r={},i=null){const a=new o.Deferred,c=e===s.File?"POST":e,u=(e,t={})=>{const r=e;return{data:JSON.stringify(t),headers:JSON.stringify(e.headers),json:t,ok:e.statusCode>=200&&e.statusCode<300,status:e.statusCode,statusText:t.error?t.error.message:r.statusText?r.statusText:r.statusMessage}};return this.privIgnoreCache&&(this.privHeaders["Cache-Control"]="no-cache"),e===s.Post&&i&&(this.privHeaders["content-type"]="application/json",this.privHeaders["Content-Type"]="application/json"),(i=>{(0,n.default)(t,c,this.privHeaders,200,201,202,204,400,401,402,403,404)(""===this.queryParams(r)?"":`?${this.queryParams(r)}`,i).then(async t=>{if(e===s.Delete||204===t.statusCode)a.resolve(u(t));else try{const e=await t.json();a.resolve(u(t,e))}catch{a.resolve(u(t))}}).catch(e=>{a.reject(e)})})(i),a.promise}queryParams(e={}){return Object.keys(e).map(t=>encodeURIComponent(t)+"="+encodeURIComponent(e[t])).join("&")}}},7710:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MeetingTranscriptionEventArgs=t.ConversationTranscriptionEventArgs=t.SpeechRecognitionEventArgs=void 0;const i=r(881);class n extends i.RecognitionEventArgs{constructor(e,t,r){super(t,r),this.privResult=e}get result(){return this.privResult}}t.SpeechRecognitionEventArgs=n;class o extends i.RecognitionEventArgs{constructor(e,t,r){super(t,r),this.privResult=e}get result(){return this.privResult}}t.ConversationTranscriptionEventArgs=o,t.MeetingTranscriptionEventArgs=class extends n{}},7714:(e,t,r)=>{"use strict";var i=r(7426),n=r(2287);function o(){if(!(this instanceof o))return new o;n.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}i.inherits(o,n),e.exports=o,o.blockSize=512,o.outSize=224,o.hmacStrength=192,o.padLength=64,o.prototype._digest=function(e){return"hex"===e?i.toHex32(this.h.slice(0,7),"big"):i.split32(this.h.slice(0,7),"big")}},7766:(e,t,r)=>{"use strict";var i=r(7426),n=r(6166),o=r(3349),s=i.rotr64_hi,a=i.rotr64_lo,c=i.shr64_hi,u=i.shr64_lo,h=i.sum64,d=i.sum64_hi,l=i.sum64_lo,p=i.sum64_4_hi,f=i.sum64_4_lo,v=i.sum64_5_hi,g=i.sum64_5_lo,m=n.BlockHash,y=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function b(){if(!(this instanceof b))return new b;m.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=y,this.W=new Array(160)}function S(e,t,r,i,n){var o=e&r^~e&n;return o<0&&(o+=4294967296),o}function C(e,t,r,i,n,o){var s=t&i^~t&o;return s<0&&(s+=4294967296),s}function w(e,t,r,i,n){var o=e&r^e&n^r&n;return o<0&&(o+=4294967296),o}function P(e,t,r,i,n,o){var s=t&i^t&o^i&o;return s<0&&(s+=4294967296),s}function A(e,t){var r=s(e,t,28)^s(t,e,2)^s(t,e,7);return r<0&&(r+=4294967296),r}function I(e,t){var r=a(e,t,28)^a(t,e,2)^a(t,e,7);return r<0&&(r+=4294967296),r}function R(e,t){var r=s(e,t,14)^s(e,t,18)^s(t,e,9);return r<0&&(r+=4294967296),r}function E(e,t){var r=a(e,t,14)^a(e,t,18)^a(t,e,9);return r<0&&(r+=4294967296),r}function T(e,t){var r=s(e,t,1)^s(e,t,8)^c(e,t,7);return r<0&&(r+=4294967296),r}function M(e,t){var r=a(e,t,1)^a(e,t,8)^u(e,t,7);return r<0&&(r+=4294967296),r}function k(e,t){var r=s(e,t,19)^s(t,e,29)^c(e,t,6);return r<0&&(r+=4294967296),r}function O(e,t){var r=a(e,t,19)^a(t,e,29)^u(e,t,6);return r<0&&(r+=4294967296),r}i.inherits(b,m),e.exports=b,b.blockSize=1024,b.outSize=512,b.hmacStrength=192,b.padLength=128,b.prototype._prepareBlock=function(e,t){for(var r=this.W,i=0;i<32;i++)r[i]=e[t+i];for(;i<r.length;i+=2){var n=k(r[i-4],r[i-3]),o=O(r[i-4],r[i-3]),s=r[i-14],a=r[i-13],c=T(r[i-30],r[i-29]),u=M(r[i-30],r[i-29]),h=r[i-32],d=r[i-31];r[i]=p(n,o,s,a,c,u,h,d),r[i+1]=f(n,o,s,a,c,u,h,d)}},b.prototype._update=function(e,t){this._prepareBlock(e,t);var r=this.W,i=this.h[0],n=this.h[1],s=this.h[2],a=this.h[3],c=this.h[4],u=this.h[5],p=this.h[6],f=this.h[7],m=this.h[8],y=this.h[9],b=this.h[10],T=this.h[11],M=this.h[12],k=this.h[13],O=this.h[14],_=this.h[15];o(this.k.length===r.length);for(var x=0;x<r.length;x+=2){var N=O,D=_,z=R(m,y),L=E(m,y),B=S(m,0,b,0,M),F=C(0,y,0,T,0,k),j=this.k[x],U=this.k[x+1],q=r[x],W=r[x+1],K=v(N,D,z,L,B,F,j,U,q,W),H=g(N,D,z,L,B,F,j,U,q,W);N=A(i,n),D=I(i,n),z=w(i,0,s,0,c),L=P(0,n,0,a,0,u);var V=d(N,D,z,L),G=l(N,D,z,L);O=M,_=k,M=b,k=T,b=m,T=y,m=d(p,f,K,H),y=l(f,f,K,H),p=c,f=u,c=s,u=a,s=i,a=n,i=d(K,H,V,G),n=l(K,H,V,G)}h(this.h,0,i,n),h(this.h,2,s,a),h(this.h,4,c,u),h(this.h,6,p,f),h(this.h,8,m,y),h(this.h,10,b,T),h(this.h,12,M,k),h(this.h,14,O,_)},b.prototype._digest=function(e){return"hex"===e?i.toHex32(this.h,"big"):i.split32(this.h,"big")}},7778:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ConnectionFactoryBase=void 0;const i=r(9190),n=r(868),o=r(881),s=r(9324);t.ConnectionFactoryBase=class{static getHostSuffix(e){if(e){if(e.toLowerCase().startsWith("china"))return".azure.cn";if(e.toLowerCase().startsWith("usgov"))return".azure.us"}return".microsoft.com"}setCommonUrlParams(e,t,r){new Map([[o.PropertyId.Speech_SegmentationSilenceTimeoutMs,s.QueryParameterNames.SegmentationSilenceTimeoutMs],[o.PropertyId.SpeechServiceConnection_EnableAudioLogging,s.QueryParameterNames.EnableAudioLogging],[o.PropertyId.SpeechServiceConnection_EndSilenceTimeoutMs,s.QueryParameterNames.EndSilenceTimeoutMs],[o.PropertyId.SpeechServiceConnection_InitialSilenceTimeoutMs,s.QueryParameterNames.InitialSilenceTimeoutMs],[o.PropertyId.SpeechServiceResponse_PostProcessingOption,s.QueryParameterNames.Postprocessing],[o.PropertyId.SpeechServiceResponse_ProfanityOption,s.QueryParameterNames.Profanity],[o.PropertyId.SpeechServiceResponse_RequestWordLevelTimestamps,s.QueryParameterNames.EnableWordLevelTimestamps],[o.PropertyId.SpeechServiceResponse_StablePartialResultThreshold,s.QueryParameterNames.StableIntermediateThreshold]]).forEach((i,n)=>{this.setUrlParameter(n,i,e,t,r)});const n=JSON.parse(e.parameters.getProperty(i.ServicePropertiesPropertyName,"{}"));Object.keys(n).forEach(e=>{t[e]=n[e]})}setUrlParameter(e,t,r,i,n){const o=r.parameters.getProperty(e,void 0);!o||n&&-1!==n.search(t)||(i[t]=o.toLocaleLowerCase())}static async getRedirectUrlFromEndpoint(e){const t=new URL(e);t.protocol="https:",t.port="443",t.searchParams.append("GenerateRedirectResponse","true");const r=t.toString();n.Events.instance.onEvent(new n.ConnectionRedirectEvent("",r,void 0,"ConnectionFactoryBase: redirectUrl request"));const i=await fetch(r);if(200!==i.status)return e;const o=await i.text();n.Events.instance.onEvent(new n.ConnectionRedirectEvent("",o,e,"ConnectionFactoryBase: redirectUrlString"));try{return new URL(o.trim()).toString()}catch(t){return e}}}},7790:()=>{},7952:(e,t,r)=>{var i=t;i.utils=r(7426),i.common=r(6166),i.sha=r(6229),i.ripemd=r(6784),i.hmac=r(8948),i.sha1=i.sha.sha1,i.sha256=i.sha.sha256,i.sha224=i.sha.sha224,i.sha384=i.sha.sha384,i.sha512=i.sha.sha512,i.ripemd160=i.ripemd.ripemd160},7968:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FileAudioSource=void 0;const i=r(9190),n=r(868),o=r(8698);t.FileAudioSource=class{constructor(e,t,r){this.privStreams={},this.privHeaderEnd=44,this.privId=r||(0,n.createNoDashGuid)(),this.privEvents=new n.EventSource,this.privSource=e,"undefined"!=typeof window&&"undefined"!=typeof Blob&&this.privSource instanceof Blob?this.privFilename=e.name:this.privFilename=t||"unknown.wav",this.privAudioFormatPromise=this.readHeader()}get format(){return this.privAudioFormatPromise}turnOn(){if(this.privFilename.lastIndexOf(".wav")!==this.privFilename.length-4){const e=this.privFilename+" is not supported. Only WAVE files are allowed at the moment.";return this.onEvent(new n.AudioSourceErrorEvent(e,"")),Promise.reject(e)}this.onEvent(new n.AudioSourceInitializingEvent(this.privId)),this.onEvent(new n.AudioSourceReadyEvent(this.privId))}id(){return this.privId}async attach(e){this.onEvent(new n.AudioStreamNodeAttachingEvent(this.privId,e));const t=await this.upload(e);return this.onEvent(new n.AudioStreamNodeAttachedEvent(this.privId,e)),Promise.resolve({detach:async()=>{t.readEnded(),delete this.privStreams[e],this.onEvent(new n.AudioStreamNodeDetachedEvent(this.privId,e)),await this.turnOff()},id:()=>e,read:()=>t.read()})}detach(e){e&&this.privStreams[e]&&(this.privStreams[e].close(),delete this.privStreams[e],this.onEvent(new n.AudioStreamNodeDetachedEvent(this.privId,e)))}turnOff(){for(const e in this.privStreams)if(e){const t=this.privStreams[e];t&&!t.isClosed&&t.close()}return this.onEvent(new n.AudioSourceOffEvent(this.privId)),Promise.resolve()}get events(){return this.privEvents}get deviceInfo(){return this.privAudioFormatPromise.then(e=>Promise.resolve({bitspersample:e.bitsPerSample,channelcount:e.channels,connectivity:i.connectivity.Unknown,manufacturer:"Speech SDK",model:"File",samplerate:e.samplesPerSec,type:i.type.File}))}readHeader(){const e=this.privSource.slice(0,4296),t=new n.Deferred,r=e=>{const r=new DataView(e),i=e=>String.fromCharCode(r.getUint8(e),r.getUint8(e+1),r.getUint8(e+2),r.getUint8(e+3));if("RIFF"!==i(0))return void t.reject("Invalid WAV header in file, RIFF was not found");if("WAVE"!==i(8)||"fmt "!==i(12))return void t.reject("Invalid WAV header in file, WAVEfmt was not found");const n=r.getInt32(16,!0),s=r.getUint16(22,!0),a=r.getUint32(24,!0),c=r.getUint16(34,!0);let u=36+Math.max(n-16,0);for(;"data"!==i(u);u+=2)if(u>4288)return void t.reject("Invalid WAV header in file, data block was not found");this.privHeaderEnd=u+8,t.resolve(o.AudioStreamFormat.getWaveFormatPCM(a,c,s))};if("undefined"!=typeof window&&"undefined"!=typeof Blob&&e instanceof Blob){const t=new FileReader;t.onload=e=>{const t=e.target.result;r(t)},t.readAsArrayBuffer(e)}else{const t=e;r(t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength))}return t.promise}async upload(e){const t=t=>{const r=`Error occurred while processing '${this.privFilename}'. ${t}`;throw this.onEvent(new n.AudioStreamNodeErrorEvent(this.privId,e,r)),new Error(r)};try{await this.turnOn();const r=await this.privAudioFormatPromise,i=new n.ChunkedArrayBufferStream(r.avgBytesPerSec/10,e);this.privStreams[e]=i;const o=this.privSource.slice(this.privHeaderEnd),s=e=>{i.isClosed||(i.writeStreamChunk({buffer:e,isEnd:!1,timeReceived:Date.now()}),i.close())};if("undefined"!=typeof window&&"undefined"!=typeof Blob&&o instanceof Blob){const e=new FileReader;e.onerror=e=>t(e.toString()),e.onload=e=>{const t=e.target.result;s(t)},e.readAsArrayBuffer(o)}else{const e=o;s(e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength))}return i}catch(e){t(e)}}onEvent(e){this.privEvents.onEvent(e),n.Events.instance.onEvent(e)}}},8032:(e,t)=>{"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.SynthesisAudioMetadata=t.MetadataType=void 0,(r=t.MetadataType||(t.MetadataType={})).WordBoundary="WordBoundary",r.Bookmark="Bookmark",r.Viseme="Viseme",r.SentenceBoundary="SentenceBoundary",r.SessionEnd="SessionEnd",r.AvatarSignal="TalkingAvatarSignal";class i{constructor(e){this.privSynthesisAudioMetadata=JSON.parse(e)}static fromJSON(e){return new i(e)}get Metadata(){return this.privSynthesisAudioMetadata.Metadata}}t.SynthesisAudioMetadata=i},8075:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DialogServiceAdapter=void 0;const i=r(4378),n=r(8618),o=r(868),s=r(1355),a=r(881),c=r(4241),u=r(9190),h=r(1729),d=r(8506),l=r(7512),p=r(4081);class f extends u.ServiceRecognizerBase{constructor(e,t,r,i,n){super(e,t,r,i,n),this.privEvents=new o.EventSource,this.privDialogServiceConnector=n,this.receiveMessageOverride=()=>this.receiveDialogMessageOverride(),this.privTurnStateManager=new c.DialogServiceTurnStateManager,this.recognizeOverride=(e,t,r)=>this.listenOnce(e,t,r),this.postConnectImplOverride=e=>this.dialogConnectImpl(e),this.configConnectionOverride=e=>this.configConnection(e),this.disconnectOverride=()=>this.privDisconnect(),this.privDialogAudioSource=r,this.agentConfigSent=!1,this.privLastResult=null,this.connectionEvents.attach(e=>{"ConnectionClosedEvent"===e.name&&(this.terminateMessageLoop=!0)})}async sendMessage(e){const t=(0,o.createGuid)(),r=(0,o.createNoDashGuid)(),i={context:{interactionId:t},messagePayload:JSON.parse(e),version:.5},n=JSON.stringify(i),s=await this.fetchConnection();await s.send(new p.SpeechConnectionMessage(o.MessageType.Text,"agent",r,"application/json",n))}async privDisconnect(){await this.cancelRecognition(this.privRequestSession.sessionId,this.privRequestSession.requestId,a.CancellationReason.Error,a.CancellationErrorCode.NoError,"Disconnecting"),this.terminateMessageLoop=!0,this.agentConfigSent=!1}processTypeSpecificMessages(e){const t=new a.PropertyCollection;let r,i;switch(e.messageType===o.MessageType.Text&&t.setProperty(a.PropertyId.SpeechServiceResponse_JsonResult,e.textBody),e.path.toLowerCase()){case"speech.phrase":const n=u.SimpleSpeechPhrase.fromJSON(e.textBody,this.privRequestSession.currentTurnAudioOffset);if(this.privRequestSession.onPhraseRecognized(n.Offset+n.Duration),n.RecognitionStatus!==u.RecognitionStatus.TooManyRequests&&n.RecognitionStatus!==u.RecognitionStatus.Error){const e=this.fireEventForResult(n,t);if(this.privLastResult=e.result,this.privDialogServiceConnector.recognized)try{this.privDialogServiceConnector.recognized(this.privDialogServiceConnector,e)}catch(e){}}i=!0;break;case"speech.hypothesis":const o=u.SpeechHypothesis.fromJSON(e.textBody,this.privRequestSession.currentTurnAudioOffset);r=new a.SpeechRecognitionResult(this.privRequestSession.requestId,a.ResultReason.RecognizingSpeech,o.Text,o.Duration,o.Offset,o.Language,o.LanguageDetectionConfidence,void 0,void 0,o.asJson(),t),this.privRequestSession.onHypothesis(o.Offset);const s=new a.SpeechRecognitionEventArgs(r,o.Offset,this.privRequestSession.sessionId);if(this.privDialogServiceConnector.recognizing)try{this.privDialogServiceConnector.recognizing(this.privDialogServiceConnector,s)}catch(e){}i=!0;break;case"speech.keyword":const c=u.SpeechKeyword.fromJSON(e.textBody,this.privRequestSession.currentTurnAudioOffset);r=new a.SpeechRecognitionResult(this.privRequestSession.requestId,"Accepted"===c.Status?a.ResultReason.RecognizedKeyword:a.ResultReason.NoMatch,c.Text,c.Duration,c.Offset,void 0,void 0,void 0,void 0,c.asJson(),t),"Accepted"!==c.Status&&(this.privLastResult=r);const h=new a.SpeechRecognitionEventArgs(r,r.duration,r.resultId);if(this.privDialogServiceConnector.recognized)try{this.privDialogServiceConnector.recognized(this.privDialogServiceConnector,h)}catch(e){}i=!0;break;case"audio":{const t=e.requestId.toUpperCase(),r=this.privTurnStateManager.GetTurn(t);try{e.binaryBody?r.audioStream.write(e.binaryBody):r.endAudioStream()}catch(e){}}i=!0;break;case"response":this.handleResponseMessage(e),i=!0}const n=new o.Deferred;return n.resolve(i),n.promise}async cancelRecognition(e,t,r,i,n){if(this.terminateMessageLoop=!0,this.privRequestSession.isRecognizing&&await this.privRequestSession.onStopRecognizing(),this.privDialogServiceConnector.canceled){const t=new a.PropertyCollection;t.setProperty(u.CancellationErrorCodePropertyName,a.CancellationErrorCode[i]);const o=new a.SpeechRecognitionCanceledEventArgs(r,n,i,void 0,e);try{this.privDialogServiceConnector.canceled(this.privDialogServiceConnector,o)}catch{}if(this.privSuccessCallback){const e=new a.SpeechRecognitionResult(void 0,a.ResultReason.Canceled,void 0,void 0,void 0,void 0,void 0,void 0,n,void 0,t);try{this.privSuccessCallback(e),this.privSuccessCallback=void 0}catch{}}}}async listenOnce(e,t,r){this.privRecognizerConfig.recognitionMode=e,this.privSuccessCallback=t,this.privErrorCallback=r,this.privRequestSession.startNewRecognition(),this.privRequestSession.listenForServiceTelemetry(this.privDialogAudioSource.events),this.privRecognizerConfig.parameters.setProperty(a.PropertyId.Speech_SessionId,this.privRequestSession.sessionId);const n=this.connectImpl(),o=this.sendPreAudioMessages(),s=await this.privDialogAudioSource.attach(this.privRequestSession.audioNodeId),c=await this.privDialogAudioSource.format,u=await this.privDialogAudioSource.deviceInfo,h=new i.ReplayableAudioNode(s,c.avgBytesPerSec);await this.privRequestSession.onAudioSourceAttachCompleted(h,!1),this.privRecognizerConfig.SpeechServiceConfig.Context.audio={source:u};try{await n,await o}catch(e){return await this.cancelRecognition(this.privRequestSession.sessionId,this.privRequestSession.requestId,a.CancellationReason.Error,a.CancellationErrorCode.ConnectionFailure,e),Promise.resolve()}const d=new a.SessionEventArgs(this.privRequestSession.sessionId);this.privRecognizer.sessionStarted&&this.privRecognizer.sessionStarted(this.privRecognizer,d),this.sendAudio(h).then(()=>{},async e=>{await this.cancelRecognition(this.privRequestSession.sessionId,this.privRequestSession.requestId,a.CancellationReason.Error,a.CancellationErrorCode.RuntimeError,e)})}dialogConnectImpl(e){return this.privConnectionLoop=this.startMessageLoop(),e}receiveDialogMessageOverride(){const e=new o.Deferred,t=async()=>{try{const r=this.isDisposed(),i=!this.isDisposed()&&this.terminateMessageLoop;if(r||i)return void e.resolve(void 0);const n=await this.fetchConnection(),s=await n.read();if(!s)return t();const c=p.SpeechConnectionMessage.fromConnectionMessage(s);switch(c.path.toLowerCase()){case"turn.start":{const e=c.requestId.toUpperCase();e!==this.privRequestSession.requestId.toUpperCase()?this.privTurnStateManager.StartTurn(e):this.privRequestSession.onServiceTurnStartResponse()}break;case"speech.startdetected":const e=u.SpeechDetected.fromJSON(c.textBody,this.privRequestSession.currentTurnAudioOffset),t=new a.RecognitionEventArgs(e.Offset,this.privRequestSession.sessionId);this.privRecognizer.speechStartDetected&&this.privRecognizer.speechStartDetected(this.privRecognizer,t);break;case"speech.enddetected":let r;r=c.textBody.length>0?c.textBody:"{ Offset: 0 }";const i=u.SpeechDetected.fromJSON(r,this.privRequestSession.currentTurnAudioOffset);this.privRequestSession.onServiceRecognized(i.Offset);const n=new a.RecognitionEventArgs(i.Offset,this.privRequestSession.sessionId);this.privRecognizer.speechEndDetected&&this.privRecognizer.speechEndDetected(this.privRecognizer,n);break;case"turn.end":{const e=c.requestId.toUpperCase();if(e!==this.privRequestSession.requestId.toUpperCase())this.privTurnStateManager.CompleteTurn(e);else{const e=new a.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,e),this.privSuccessCallback&&this.privLastResult){try{this.privSuccessCallback(this.privLastResult),this.privLastResult=null}catch(e){this.privErrorCallback&&this.privErrorCallback(e)}this.privSuccessCallback=void 0,this.privErrorCallback=void 0}}}break;default:try{await this.processTypeSpecificMessages(c)||this.serviceEvents&&this.serviceEvents.onEvent(new o.ServiceEvent(c.path.toLowerCase(),c.textBody))}catch(e){}}return t()}catch(t){this.terminateMessageLoop=!0,e.resolve()}};return t().catch(e=>{o.Events.instance.onEvent(new o.BackgroundEvent(e))}),e.promise}async startMessageLoop(){this.terminateMessageLoop=!1;try{await this.receiveDialogMessageOverride()}catch(e){await this.cancelRecognition(this.privRequestSession.sessionId,this.privRequestSession.requestId,a.CancellationReason.Error,a.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(a.PropertyId.Conversation_DialogType)===a.DialogServiceConfig.DialogTypes.CustomCommands){const e=this.agentConfig.get();e.botInfo.commandsCulture=this.privRecognizerConfig.parameters.getProperty(a.PropertyId.SpeechServiceConnection_RecoLanguage,"en-us"),this.agentConfig.set(e)}this.onEvent(new n.SendingAgentContextMessageEvent(this.agentConfig));const t=this.agentConfig.toJsonString();return this.agentConfigSent=!0,e.send(new p.SpeechConnectionMessage(o.MessageType.Text,"agent.config",this.privRequestSession.requestId,"application/json",t))}}sendAgentContext(e){const t=(0,o.createGuid)(),r=this.privDialogServiceConnector.properties.getProperty(a.PropertyId.Conversation_Speech_Activity_Template),i={channelData:"",context:{interactionId:t},messagePayload:void 0===typeof r?void 0:r,version:.5},n=JSON.stringify(i);return e.send(new p.SpeechConnectionMessage(o.MessageType.Text,"speech.agent.context",this.privRequestSession.requestId,"application/json",n))}fireEventForResult(e,t){const r=u.EnumTranslation.implTranslateRecognitionResult(e.RecognitionStatus),i=new a.SpeechRecognitionResult(this.privRequestSession.requestId,r,e.DisplayText,e.Duration,e.Offset,e.Language,e.LanguageDetectionConfidence,void 0,void 0,e.asJson(),t);return new a.SpeechRecognitionEventArgs(i,e.Offset,this.privRequestSession.sessionId)}handleResponseMessage(e){const t=JSON.parse(e.textBody);switch(t.messageType.toLowerCase()){case"message":const r=e.requestId.toUpperCase(),i=h.ActivityPayloadResponse.fromJSON(e.textBody),n=this.privTurnStateManager.GetTurn(r);if(i.conversationId){const e=this.agentConfig.get();e.botInfo.conversationId=i.conversationId,this.agentConfig.set(e)}const c=n.processActivityPayload(i,s.AudioOutputFormatImpl.fromSpeechSynthesisOutputFormatString(this.privDialogServiceConnector.properties.getProperty(a.PropertyId.SpeechServiceConnection_SynthOutputFormat,void 0))),u=new a.ActivityReceivedEventArgs(i.messagePayload,c);if(this.privDialogServiceConnector.activityReceived)try{this.privDialogServiceConnector.activityReceived(this.privDialogServiceConnector,u)}catch(e){}break;case"messagestatus":if(this.privDialogServiceConnector.turnStatusReceived)try{this.privDialogServiceConnector.turnStatusReceived(this.privDialogServiceConnector,new a.TurnStatusReceivedEventArgs(e.textBody))}catch(e){}break;default:o.Events.instance.onEvent(new o.BackgroundEvent(`Unexpected response of type ${t.messageType}. Ignoring.`))}}onEvent(e){this.privEvents.onEvent(e),o.Events.instance.onEvent(e)}addKeywordContextData(){const e=this.privRecognizerConfig.parameters.getProperty("SPEECH-KeywordsToDetect");if(void 0===e)return;const t=this.privRecognizerConfig.parameters.getProperty("SPEECH-KeywordsToDetect-Offsets"),r=this.privRecognizerConfig.parameters.getProperty("SPEECH-KeywordsToDetect-Durations"),i=e.split(";"),n=void 0===t?[]:t.split(";"),o=void 0===r?[]:r.split(";"),s=[];for(let e=0;e<i.length;e++){const t={text:i[e]};e<n.length&&(t.startOffset=Number(n[e])),e<o.length&&(t.duration=Number(o[e])),s.push(t)}this.speechContext.getContext().invocationSource=d.InvocationSource.VoiceActivationWithKeyword,this.speechContext.getContext().keywordDetection=[{clientDetectedKeywords:s,onReject:{action:l.OnRejectAction.EndOfTurn},type:l.KeywordDetectionType.StartTrigger}]}}t.DialogServiceAdapter=f},8126:(e,t)=>{"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.NextAction=void 0,(r=t.NextAction||(t.NextAction={})).None="None",r.Translate="Translate"},8136:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},8174:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ConversationExpirationEventArgs=void 0;const i=r(881);class n extends i.SessionEventArgs{constructor(e,t){super(t),this.privExpirationTime=e}get expirationTime(){return this.privExpirationTime}}t.ConversationExpirationEventArgs=n},8183:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.VoiceProfileConnectionFactory=t.SpeakerRecognitionConnectionFactory=void 0;const i=r(4378),n=r(881),o=r(7778),s=r(9190),a=r(7014);class c extends o.ConnectionFactoryBase{create(e,t,r,c){let u=e.parameters.getProperty(n.PropertyId.SpeechServiceConnection_Endpoint);if(!u){const t=e.parameters.getProperty(n.PropertyId.SpeechServiceConnection_Region),i=o.ConnectionFactoryBase.getHostSuffix(t),s=e.parameters.getProperty(n.PropertyId.SpeechServiceConnection_Host,`wss://${t}.spr-frontend.speech${i}`),a=e.parameters.getProperty(n.PropertyId.SpeechServiceConnection_SpeakerIdMode,"TextIndependentIdentification");u=`${s}/speaker/ws/${this.scenarioToPath(a)}/${r}`}const h={format:"simple",language:e.parameters.getProperty(n.PropertyId.SpeechServiceConnection_RecoLanguage)};this.setCommonUrlParams(e,h,u);const d={};void 0!==t.token&&""!==t.token&&(d[t.headerName]=t.token),d[a.HeaderNames.ConnectionId]=c,d[a.HeaderNames.SpIDAuthKey]=e.parameters.getProperty(n.PropertyId.SpeechServiceConnection_Key),e.parameters.setProperty(n.PropertyId.SpeechServiceConnection_Url,u);const l="true"===e.parameters.getProperty("SPEECH-EnableWebsocketCompression","false");return Promise.resolve(new i.WebsocketConnection(u,h,d,new s.WebsocketMessageFormatter,i.ProxyInfo.fromRecognizerConfig(e),l,c))}scenarioToPath(e){switch(e){case"TextIndependentVerification":case"2":return"verification/text-independent";case"TextDependentVerification":case"1":return"verification/text-dependent";default:return"identification/text-independent"}}}t.SpeakerRecognitionConnectionFactory=class extends c{create(e,t,r){return super.create(e,t,"recognition",r)}},t.VoiceProfileConnectionFactory=class extends c{create(e,t,r){return super.create(e,t,"profile",r)}}},8194:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SpeechRecognitionResult=void 0;const i=r(881);class n extends i.RecognitionResult{constructor(e,t,r,i,n,o,s,a,c,u,h){super(e,t,r,i,n,o,s,c,u,h),this.privSpeakerId=a}get speakerId(){return this.privSpeakerId}}t.SpeechRecognitionResult=n},8233:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SpeechHypothesis=void 0;class r{constructor(e,t){this.privSpeechHypothesis=JSON.parse(e),this.updateOffset(t)}static fromJSON(e,t){return new r(e,t)}updateOffset(e){this.privSpeechHypothesis.Offset+=e}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 void 0===this.privSpeechHypothesis.PrimaryLanguage?void 0:this.privSpeechHypothesis.PrimaryLanguage.Language}get LanguageDetectionConfidence(){return void 0===this.privSpeechHypothesis.PrimaryLanguage?void 0:this.privSpeechHypothesis.PrimaryLanguage.Confidence}get SpeakerId(){return this.privSpeechHypothesis.SpeakerId}}t.SpeechHypothesis=r},8252:(e,t)=>{"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.SpeechSynthesisBoundaryType=void 0,(r=t.SpeechSynthesisBoundaryType||(t.SpeechSynthesisBoundaryType={})).Word="WordBoundary",r.Punctuation="PunctuationBoundary",r.Sentence="SentenceBoundary"},8257:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ServiceRecognizerBase=void 0;const i=r(4378),n=r(868),o=r(881),s=r(9190),a=r(4081),c=r(2894),u=r(2699),h=r(4873),d=r(6143),l=r(2387),p=r(9113),f=r(5400),v=r(3514),g=r(6427),m=r(8126);class y{constructor(e,t,r,i,a){if(this.privConnectionConfigurationPromise=void 0,this.privConnectionPromise=void 0,this.privSetTimeout=setTimeout,this.privIsLiveAudio=!1,this.privAverageBytesPerMs=0,this.privEnableSpeakerId=!1,this.privExpectContentAssessmentResponse=!1,this.recognizeOverride=void 0,this.recognizeSpeaker=void 0,this.disconnectOverride=void 0,this.receiveMessageOverride=void 0,this.sendPrePayloadJSONOverride=void 0,this.postConnectImplOverride=void 0,this.configConnectionOverride=void 0,this.handleSpeechPhraseMessage=void 0,this.handleSpeechHypothesisMessage=void 0,!e)throw new n.ArgumentNullError("authentication");if(!t)throw new n.ArgumentNullError("connectionFactory");if(!r)throw new n.ArgumentNullError("audioSource");if(!i)throw new n.ArgumentNullError("recognizerConfig");this.privEnableSpeakerId=i.isSpeakerDiarizationEnabled,this.privMustReportEndOfStream=!1,this.privAuthentication=e,this.privConnectionFactory=t,this.privAudioSource=r,this.privRecognizerConfig=i,this.privIsDisposed=!1,this.privRecognizer=a,this.privRequestSession=new s.RequestSession(this.privAudioSource.id()),this.privConnectionEvents=new n.EventSource,this.privServiceEvents=new n.EventSource,this.privDynamicGrammar=new s.DynamicGrammarBuilder,this.privSpeechContext=new s.SpeechContext(this.privDynamicGrammar),this.privAgentConfig=new s.AgentConfig,"on"===this.privRecognizerConfig.parameters.getProperty(o.PropertyId.WebWorkerLoadType,"on").toLowerCase()&&"undefined"!=typeof Blob&&"undefined"!=typeof Worker?this.privSetTimeout=n.Timeout.setTimeout:("undefined"!=typeof window&&(this.privSetTimeout=window.setTimeout.bind(window)),"undefined"!=typeof globalThis&&(this.privSetTimeout=globalThis.setTimeout.bind(globalThis))),this.connectionEvents.attach(e=>{if("ConnectionClosedEvent"===e.name){const t=e;(1003===t.statusCode||1007===t.statusCode||1002===t.statusCode||4e3===t.statusCode||this.privRequestSession.numConnectionAttempts>this.privRecognizerConfig.maxRetryCount)&&this.cancelRecognitionLocal(o.CancellationReason.Error,1007===t.statusCode?o.CancellationErrorCode.BadRequestParameters:o.CancellationErrorCode.ConnectionFailure,`${t.reason} websocket error code: ${t.statusCode}`)}}),this.privEnableSpeakerId&&(this.privDiarizationSessionId=(0,n.createNoDashGuid)())}setTranslationJson(){const e=this.privRecognizerConfig.parameters.getProperty(o.PropertyId.SpeechServiceConnection_TranslationToLanguages,void 0);if(void 0!==e){const t=e.split(","),r=this.privRecognizerConfig.parameters.getProperty(o.PropertyId.SpeechServiceConnection_TranslationVoice,void 0),i=this.privRecognizerConfig.parameters.getProperty(o.PropertyId.SpeechServiceConnection_TranslationCategoryId,void 0),n=void 0!==r?h.NextAction.Synthesize:h.NextAction.None;if(this.privSpeechContext.getContext().translation={onPassthrough:{action:n},onSuccess:{action:n},output:{includePassThroughResults:!0,interimResults:{mode:d.Mode.Always}},targetLanguages:t},void 0!==i&&(this.privSpeechContext.getContext().translation.category=i),void 0!==r){const e={};for(const i of t)e[i]=r;this.privSpeechContext.getContext().synthesis={defaultVoices:e}}const s=this.privSpeechContext.getContext().phraseDetection||{};s.onSuccess={action:m.NextAction.Translate},s.onInterim={action:m.NextAction.Translate},this.privSpeechContext.getContext().phraseDetection=s}}setSpeechSegmentationTimeoutJson(){const e=this.privRecognizerConfig.parameters.getProperty(o.PropertyId.Speech_SegmentationSilenceTimeoutMs,void 0),t=this.privRecognizerConfig.parameters.getProperty(o.PropertyId.Speech_SegmentationMaximumTimeMs,void 0),r=this.privRecognizerConfig.parameters.getProperty(o.PropertyId.Speech_SegmentationStrategy,void 0),i={mode:c.SegmentationMode.Normal};let n=!1;if(void 0!==r){n=!0;let e=c.SegmentationMode.Normal;switch(r.toLowerCase()){case"default":break;case"time":e=c.SegmentationMode.Custom;break;case"semantic":e=c.SegmentationMode.Semantic}i.mode=e}if(void 0!==e){n=!0;const t=parseInt(e,10);i.mode=c.SegmentationMode.Custom,i.segmentationSilenceTimeoutMs=t}if(void 0!==t){n=!0;const e=parseInt(t,10);i.mode=c.SegmentationMode.Custom,i.segmentationForcedTimeoutMs=e}if(n){const e=this.privSpeechContext.getContext().phraseDetection||{};switch(e.mode=this.recognitionMode,this.recognitionMode){case u.RecognitionMode.Conversation:e.conversation=e.conversation??{segmentation:{}},e.conversation.segmentation=i;break;case u.RecognitionMode.Interactive:e.interactive=e.interactive??{segmentation:{}},e.interactive.segmentation=i;break;case u.RecognitionMode.Dictation:e.dictation=e.dictation??{},e.dictation.segmentation=i}this.privSpeechContext.getContext().phraseDetection=e}}setLanguageIdJson(){const e=this.privSpeechContext.getContext().phraseDetection||{};if(void 0!==this.privRecognizerConfig.autoDetectSourceLanguages){const t=this.privRecognizerConfig.autoDetectSourceLanguages.split(",");let r;1===t.length&&t[0]===s.AutoDetectSourceLanguagesOpenRangeOptionName&&(t[0]="UND"),r="Continuous"===this.privRecognizerConfig.languageIdMode?l.LanguageIdDetectionMode.DetectContinuous:l.LanguageIdDetectionMode.DetectAtAudioStart,this.privSpeechContext.getContext().languageId={languages:t,mode:r,onSuccess:{action:p.NextAction.Recognize},onUnknown:{action:f.OnUnknownAction.None},priority:l.LanguageIdDetectionPriority.PrioritizeLatency},this.privSpeechContext.getContext().phraseOutput={interimResults:{resultType:v.ResultType.Auto},phraseResults:{resultType:g.PhraseResultOutputType.Always}};const i=this.privRecognizerConfig.sourceLanguageModels;void 0!==i&&(e.customModels=i,e.onInterim={action:m.NextAction.None},e.onSuccess={action:m.NextAction.None})}this.privSpeechContext.getContext().phraseDetection=e}setOutputDetailLevelJson(){this.privEnableSpeakerId&&("true"===this.privRecognizerConfig.parameters.getProperty(o.PropertyId.SpeechServiceResponse_RequestWordLevelTimestamps,"false").toLowerCase()?this.privSpeechContext.setWordLevelTimings():this.privRecognizerConfig.parameters.getProperty(s.OutputFormatPropertyName,o.OutputFormat[o.OutputFormat.Simple]).toLowerCase()===o.OutputFormat[o.OutputFormat.Detailed].toLocaleLowerCase()&&this.privSpeechContext.setDetailedOutputFormat())}get isSpeakerDiarizationEnabled(){return this.privEnableSpeakerId}get audioSource(){return this.privAudioSource}get speechContext(){return this.privSpeechContext}get dynamicGrammar(){return this.privDynamicGrammar}get agentConfig(){return this.privAgentConfig}set conversationTranslatorToken(e){this.privRecognizerConfig.parameters.setProperty(o.PropertyId.ConversationTranslator_Token,e)}set voiceProfileType(e){this.privRecognizerConfig.parameters.setProperty(o.PropertyId.SpeechServiceConnection_SpeakerIdMode,e)}set authentication(e){this.privAuthentication=e}isDisposed(){return this.privIsDisposed}async dispose(e){if(this.privIsDisposed=!0,void 0!==this.privConnectionPromise)try{const t=await this.privConnectionPromise;await t.dispose(e)}catch(e){return}}get connectionEvents(){return this.privConnectionEvents}get serviceEvents(){return this.privServiceEvents}get recognitionMode(){return this.privRecognizerConfig.recognitionMode}async recognize(e,t,r){if(void 0!==this.recognizeOverride)return void await this.recognizeOverride(e,t,r);if(this.privConnectionConfigurationPromise=void 0,this.privRecognizerConfig.recognitionMode=e,"2"===this.privRecognizerConfig.recognitionEndpointVersion){const t=this.privSpeechContext.getContext().phraseDetection||{};t.mode=e,this.privSpeechContext.getContext().phraseDetection=t}this.setLanguageIdJson(),this.setTranslationJson(),void 0!==this.privRecognizerConfig.autoDetectSourceLanguages&&void 0!==this.privRecognizerConfig.parameters.getProperty(o.PropertyId.SpeechServiceConnection_TranslationToLanguages,void 0)&&this.setupTranslationWithLanguageId(),this.setSpeechSegmentationTimeoutJson(),this.setOutputDetailLevelJson(),this.privSuccessCallback=t,this.privErrorCallback=r,this.privRequestSession.startNewRecognition(),this.privRequestSession.listenForServiceTelemetry(this.privAudioSource.events);const n=this.connectImpl();let a;try{const e=await this.audioSource.attach(this.privRequestSession.audioNodeId),t=await this.audioSource.format,r=await this.audioSource.deviceInfo;this.privIsLiveAudio=r.type&&r.type===s.type.Microphones,a=new i.ReplayableAudioNode(e,t.avgBytesPerSec),await this.privRequestSession.onAudioSourceAttachCompleted(a,!1),this.privRecognizerConfig.SpeechServiceConfig.Context.audio={source:r}}catch(e){throw await this.privRequestSession.onStopRecognizing(),e}try{await n}catch(e){return void await this.cancelRecognitionLocal(o.CancellationReason.Error,o.CancellationErrorCode.ConnectionFailure,e)}const c=new o.SessionEventArgs(this.privRequestSession.sessionId);this.privRecognizer.sessionStarted&&this.privRecognizer.sessionStarted(this.privRecognizer,c),this.receiveMessage(),this.sendAudio(a).catch(async e=>{await this.cancelRecognitionLocal(o.CancellationReason.Error,o.CancellationErrorCode.RuntimeError,e)})}async stopRecognizing(){if(this.privRequestSession.isRecognizing)try{await this.audioSource.turnOff(),await this.sendFinalAudio(),await this.privRequestSession.onStopRecognizing(),await this.privRequestSession.turnCompletionPromise}finally{await this.privRequestSession.dispose()}}async connect(){return await this.connectImpl(),Promise.resolve()}connectAsync(e,t){this.connectImpl().then(()=>{try{e&&e()}catch(e){t&&t(e)}},e=>{try{t&&t(e)}catch(e){}})}async disconnect(){if(await this.cancelRecognitionLocal(o.CancellationReason.Error,o.CancellationErrorCode.NoError,"Disconnecting"),void 0!==this.disconnectOverride&&await this.disconnectOverride(),void 0!==this.privConnectionPromise)try{await(await this.privConnectionPromise).dispose()}catch(e){}this.privConnectionPromise=void 0}sendMessage(e){}async sendNetworkMessage(e,t){const r="string"==typeof t?n.MessageType.Text:n.MessageType.Binary,i="string"==typeof t?"application/json":"";return(await this.fetchConnection()).send(new a.SpeechConnectionMessage(r,e,this.privRequestSession.requestId,i,t))}set activityTemplate(e){this.privActivityTemplate=e}get activityTemplate(){return this.privActivityTemplate}set expectContentAssessmentResponse(e){this.privExpectContentAssessmentResponse=e}async sendTelemetryData(){const e=this.privRequestSession.getTelemetry();if(!0!==y.telemetryDataEnabled||this.privIsDisposed||null===e)return;if(y.telemetryData)try{y.telemetryData(e)}catch{}const t=await this.fetchConnection();await t.send(new a.SpeechConnectionMessage(n.MessageType.Text,"telemetry",this.privRequestSession.requestId,"application/json",e))}async cancelRecognitionLocal(e,t,r){this.privRequestSession.isRecognizing&&(await this.privRequestSession.onStopRecognizing(),this.cancelRecognition(this.privRequestSession.sessionId,this.privRequestSession.requestId,e,t,r))}async receiveMessage(){try{if(this.privIsDisposed)return;let e=await this.fetchConnection();const t=await e.read();if(void 0!==this.receiveMessageOverride)return this.receiveMessageOverride();if(!t)return this.receiveMessage();this.privServiceHasSentMessage=!0;const r=a.SpeechConnectionMessage.fromConnectionMessage(t);if(r.requestId.toLowerCase()===this.privRequestSession.requestId.toLowerCase())switch(r.path.toLowerCase()){case"turn.start":this.privMustReportEndOfStream=!0,this.privRequestSession.onServiceTurnStartResponse();break;case"speech.startdetected":const t=s.SpeechDetected.fromJSON(r.textBody,this.privRequestSession.currentTurnAudioOffset),i=new o.RecognitionEventArgs(t.Offset,this.privRequestSession.sessionId);this.privRecognizer.speechStartDetected&&this.privRecognizer.speechStartDetected(this.privRecognizer,i);break;case"speech.enddetected":let a;a=r.textBody.length>0?r.textBody:"{ Offset: 0 }";const c=s.SpeechDetected.fromJSON(a,this.privRequestSession.currentTurnAudioOffset),u=new o.RecognitionEventArgs(c.Offset+this.privRequestSession.currentTurnAudioOffset,this.privRequestSession.sessionId);this.privRecognizer.speechEndDetected&&this.privRecognizer.speechEndDetected(this.privRecognizer,u);break;case"turn.end":await this.sendTelemetryData(),this.privRequestSession.isSpeechEnded&&this.privMustReportEndOfStream&&(this.privMustReportEndOfStream=!1,await this.cancelRecognitionLocal(o.CancellationReason.EndOfStream,o.CancellationErrorCode.NoError,void 0));const h=new o.SessionEventArgs(this.privRequestSession.sessionId);if(await this.privRequestSession.onServiceTurnEndResponse(this.privRecognizerConfig.isContinuousRecognition),!this.privRecognizerConfig.isContinuousRecognition||this.privRequestSession.isSpeechEnded||!this.privRequestSession.isRecognizing)return void(this.privRecognizer.sessionStopped&&this.privRecognizer.sessionStopped(this.privRecognizer,h));e=await this.fetchConnection(),await this.sendPrePayloadJSON(e);break;default:await this.processTypeSpecificMessages(r)||this.privServiceEvents&&this.serviceEvents.onEvent(new n.ServiceEvent(r.path.toLowerCase(),r.textBody))}return this.receiveMessage()}catch(e){return null}}updateSpeakerDiarizationAudioOffset(){const e=this.privRequestSession.recognitionBytesSent,t=0!==this.privAverageBytesPerMs?e/this.privAverageBytesPerMs:0;this.privSpeechContext.setSpeakerDiarizationAudioOffsetMs(t)}sendSpeechContext(e,t){this.privEnableSpeakerId&&this.updateSpeakerDiarizationAudioOffset();const r=this.speechContext.toJSON();if(t&&this.privRequestSession.onSpeechContext(),r)return e.send(new a.SpeechConnectionMessage(n.MessageType.Text,"speech.context",this.privRequestSession.requestId,"application/json",r))}setupTranslationWithLanguageId(){const e=this.privRecognizerConfig.parameters.getProperty(o.PropertyId.SpeechServiceConnection_TranslationToLanguages,void 0),t=void 0!==this.privRecognizerConfig.autoDetectSourceLanguages;if(void 0!==e&&t){this.privSpeechContext.getContext().phraseOutput={interimResults:{resultType:v.ResultType.None},phraseResults:{resultType:g.PhraseResultOutputType.None}};const e=this.privSpeechContext.getContext().translation;if(e){const t=this.privRecognizerConfig.sourceLanguageModels;if(void 0!==t&&t.length>0){const e=this.privSpeechContext.getContext().phraseDetection||{};e.customModels=t,this.privSpeechContext.getContext().phraseDetection=e}void 0!==this.privRecognizerConfig.parameters.getProperty(o.PropertyId.SpeechServiceConnection_TranslationVoice,void 0)&&(e.onSuccess={action:h.NextAction.Synthesize},e.onPassthrough={action:h.NextAction.Synthesize})}}}noOp(){}async sendPrePayloadJSON(e,t=!0){if(void 0!==this.sendPrePayloadJSONOverride)return this.sendPrePayloadJSONOverride(e);await this.sendSpeechContext(e,t),await this.sendWaveHeader(e)}async sendWaveHeader(e){const t=await this.audioSource.format;return e.send(new a.SpeechConnectionMessage(n.MessageType.Binary,"audio",this.privRequestSession.requestId,"audio/x-wav",t.header))}connectImpl(){return void 0!==this.privConnectionPromise?this.privConnectionPromise.then(e=>e.state()===n.ConnectionState.Disconnected?(this.privConnectionId=null,this.privConnectionPromise=void 0,this.privServiceHasSentMessage=!1,this.connectImpl()):this.privConnectionPromise,()=>(this.privConnectionId=null,this.privConnectionPromise=void 0,this.privServiceHasSentMessage=!1,this.connectImpl())):(this.privConnectionPromise=this.retryableConnect(),this.privConnectionPromise.catch(()=>{}),void 0!==this.postConnectImplOverride?this.postConnectImplOverride(this.privConnectionPromise):this.privConnectionPromise)}sendSpeechServiceConfig(e,t,r){if(t.onSpeechContext(),!0!==y.telemetryDataEnabled){const e={context:{system:JSON.parse(r).context.system}};r=JSON.stringify(e)}if("true"===this.privRecognizerConfig.parameters.getProperty("f0f5debc-f8c9-4892-ac4b-90a7ab359fd2","false").toLowerCase()){const e=JSON.parse(r);e.context.DisableReferenceChannel="True",e.context.MicSpec="1_0_0",r=JSON.stringify(e)}if(r)return e.send(new a.SpeechConnectionMessage(n.MessageType.Text,"speech.config",t.requestId,"application/json",r))}async fetchConnection(){return void 0!==this.privConnectionConfigurationPromise?this.privConnectionConfigurationPromise.then(e=>e.state()===n.ConnectionState.Disconnected?(this.privConnectionId=null,this.privConnectionConfigurationPromise=void 0,this.privServiceHasSentMessage=!1,this.fetchConnection()):this.privConnectionConfigurationPromise,()=>(this.privConnectionId=null,this.privConnectionConfigurationPromise=void 0,this.privServiceHasSentMessage=!1,this.fetchConnection())):(this.privConnectionConfigurationPromise=this.configureConnection(),await this.privConnectionConfigurationPromise)}async sendAudio(e){const t=await this.audioSource.format;this.privAverageBytesPerMs=t.avgBytesPerSec/1e3;let r=Date.now();const i=this.privRecognizerConfig.parameters.getProperty("SPEECH-TransmitLengthBeforThrottleMs","5000"),o=t.avgBytesPerSec/1e3*parseInt(i,10),s=this.privRequestSession.recogNumber,c=async()=>{if(!this.privIsDisposed&&!this.privRequestSession.isSpeechEnded&&this.privRequestSession.isRecognizing&&this.privRequestSession.recogNumber===s){const i=await this.fetchConnection(),u=await e.read();if(this.privRequestSession.isSpeechEnded)return;let h,d;if(!u||u.isEnd?(h=null,d=0):(h=u.buffer,this.privRequestSession.onAudioSent(h.byteLength),d=o>=this.privRequestSession.bytesSent?0:Math.max(0,r-Date.now())),0!==d&&await this.delay(d),null!==h&&(r=Date.now()+1e3*h.byteLength/(2*t.avgBytesPerSec)),!this.privIsDisposed&&!this.privRequestSession.isSpeechEnded&&this.privRequestSession.isRecognizing&&this.privRequestSession.recogNumber===s){if(i.send(new a.SpeechConnectionMessage(n.MessageType.Binary,"audio",this.privRequestSession.requestId,null,h)).catch(()=>{this.privRequestSession.onServiceTurnEndResponse(this.privRecognizerConfig.isContinuousRecognition).catch(()=>{})}),!u?.isEnd)return c();this.privIsLiveAudio||this.privRequestSession.onSpeechEnded()}}};return c()}async retryableConnect(){let e=!1;this.privAuthFetchEventId=(0,n.createNoDashGuid)();const t=this.privRequestSession.sessionId;this.privConnectionId=void 0!==t?t:(0,n.createNoDashGuid)(),this.privRequestSession.onPreConnectionStart(this.privAuthFetchEventId,this.privConnectionId);let r=0,i="";for(;this.privRequestSession.numConnectionAttempts<=this.privRecognizerConfig.maxRetryCount;){this.privRequestSession.onRetryConnection();const t=e?this.privAuthentication.fetchOnExpiry(this.privAuthFetchEventId):this.privAuthentication.fetch(this.privAuthFetchEventId),n=await t;await this.privRequestSession.onAuthCompleted(!1);const o=await this.privConnectionFactory.create(this.privRecognizerConfig,n,this.privConnectionId);this.privRequestSession.listenForServiceTelemetry(o.events),o.events.attach(e=>{this.connectionEvents.onEvent(e)});const s=await o.open();if(200===s.statusCode)return await this.privRequestSession.onConnectionEstablishCompleted(s.statusCode),Promise.resolve(o);1006===s.statusCode&&(e=!0),r=s.statusCode,i=s.reason}return await this.privRequestSession.onConnectionEstablishCompleted(r,i),Promise.reject(`Unable to contact server. StatusCode: ${r}, ${this.privRecognizerConfig.parameters.getProperty(o.PropertyId.SpeechServiceConnection_Endpoint)} Reason: ${i}`)}delay(e){return new Promise(t=>this.privSetTimeout(t,e))}writeBufferToConsole(e){let t="Buffer Size: ";if(null===e)t+="null";else{const r=new Uint8Array(e);t+=`${e.byteLength}\r\n`;for(let i=0;i<e.byteLength;i++)t+=r[i].toString(16).padStart(2,"0")+" ",(i+1)%16==0&&(console.info(t),t="")}console.info(t)}async sendFinalAudio(){const e=await this.fetchConnection();await e.send(new a.SpeechConnectionMessage(n.MessageType.Binary,"audio",this.privRequestSession.requestId,null,null))}async configureConnection(){const e=await this.connectImpl();return void 0!==this.configConnectionOverride?this.configConnectionOverride(e):(await this.sendSpeechServiceConfig(e,this.privRequestSession,this.privRecognizerConfig.SpeechServiceConfig.serialize()),await this.sendPrePayloadJSON(e,!1),e)}}t.ServiceRecognizerBase=y,y.telemetryDataEnabled=!0},8267:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SpeechSynthesisWordBoundaryEventArgs=void 0,t.SpeechSynthesisWordBoundaryEventArgs=class{constructor(e,t,r,i,n,o){this.privAudioOffset=e,this.privDuration=t,this.privText=r,this.privWordLength=i,this.privTextOffset=n,this.privBoundaryType=o}get audioOffset(){return this.privAudioOffset}get duration(){return this.privDuration}get text(){return this.privText}get wordLength(){return this.privWordLength}get textOffset(){return this.privTextOffset}get boundaryType(){return this.privBoundaryType}}},8268:(e,t)=>{"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.SpeechSynthesisOutputFormat=void 0,(r=t.SpeechSynthesisOutputFormat||(t.SpeechSynthesisOutputFormat={}))[r.Raw8Khz8BitMonoMULaw=0]="Raw8Khz8BitMonoMULaw",r[r.Riff16Khz16KbpsMonoSiren=1]="Riff16Khz16KbpsMonoSiren",r[r.Audio16Khz16KbpsMonoSiren=2]="Audio16Khz16KbpsMonoSiren",r[r.Audio16Khz32KBitRateMonoMp3=3]="Audio16Khz32KBitRateMonoMp3",r[r.Audio16Khz128KBitRateMonoMp3=4]="Audio16Khz128KBitRateMonoMp3",r[r.Audio16Khz64KBitRateMonoMp3=5]="Audio16Khz64KBitRateMonoMp3",r[r.Audio24Khz48KBitRateMonoMp3=6]="Audio24Khz48KBitRateMonoMp3",r[r.Audio24Khz96KBitRateMonoMp3=7]="Audio24Khz96KBitRateMonoMp3",r[r.Audio24Khz160KBitRateMonoMp3=8]="Audio24Khz160KBitRateMonoMp3",r[r.Raw16Khz16BitMonoTrueSilk=9]="Raw16Khz16BitMonoTrueSilk",r[r.Riff16Khz16BitMonoPcm=10]="Riff16Khz16BitMonoPcm",r[r.Riff8Khz16BitMonoPcm=11]="Riff8Khz16BitMonoPcm",r[r.Riff24Khz16BitMonoPcm=12]="Riff24Khz16BitMonoPcm",r[r.Riff8Khz8BitMonoMULaw=13]="Riff8Khz8BitMonoMULaw",r[r.Raw16Khz16BitMonoPcm=14]="Raw16Khz16BitMonoPcm",r[r.Raw24Khz16BitMonoPcm=15]="Raw24Khz16BitMonoPcm",r[r.Raw8Khz16BitMonoPcm=16]="Raw8Khz16BitMonoPcm",r[r.Ogg16Khz16BitMonoOpus=17]="Ogg16Khz16BitMonoOpus",r[r.Ogg24Khz16BitMonoOpus=18]="Ogg24Khz16BitMonoOpus",r[r.Raw48Khz16BitMonoPcm=19]="Raw48Khz16BitMonoPcm",r[r.Riff48Khz16BitMonoPcm=20]="Riff48Khz16BitMonoPcm",r[r.Audio48Khz96KBitRateMonoMp3=21]="Audio48Khz96KBitRateMonoMp3",r[r.Audio48Khz192KBitRateMonoMp3=22]="Audio48Khz192KBitRateMonoMp3",r[r.Ogg48Khz16BitMonoOpus=23]="Ogg48Khz16BitMonoOpus",r[r.Webm16Khz16BitMonoOpus=24]="Webm16Khz16BitMonoOpus",r[r.Webm24Khz16BitMonoOpus=25]="Webm24Khz16BitMonoOpus",r[r.Raw24Khz16BitMonoTrueSilk=26]="Raw24Khz16BitMonoTrueSilk",r[r.Raw8Khz8BitMonoALaw=27]="Raw8Khz8BitMonoALaw",r[r.Riff8Khz8BitMonoALaw=28]="Riff8Khz8BitMonoALaw",r[r.Webm24Khz16Bit24KbpsMonoOpus=29]="Webm24Khz16Bit24KbpsMonoOpus",r[r.Audio16Khz16Bit32KbpsMonoOpus=30]="Audio16Khz16Bit32KbpsMonoOpus",r[r.Audio24Khz16Bit48KbpsMonoOpus=31]="Audio24Khz16Bit48KbpsMonoOpus",r[r.Audio24Khz16Bit24KbpsMonoOpus=32]="Audio24Khz16Bit24KbpsMonoOpus",r[r.Raw22050Hz16BitMonoPcm=33]="Raw22050Hz16BitMonoPcm",r[r.Riff22050Hz16BitMonoPcm=34]="Riff22050Hz16BitMonoPcm",r[r.Raw44100Hz16BitMonoPcm=35]="Raw44100Hz16BitMonoPcm",r[r.Riff44100Hz16BitMonoPcm=36]="Riff44100Hz16BitMonoPcm",r[r.AmrWb16000Hz=37]="AmrWb16000Hz",r[r.G72216Khz64Kbps=38]="G72216Khz64Kbps"},8285:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},8343:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PcmRecorder=void 0;const i=r(868);t.PcmRecorder=class{constructor(e){this.privStopInputOnRelease=e}record(e,t,r){const n=new i.RiffPcmEncoder(e.sampleRate,16e3),o=e.createMediaStreamSource(t),s=()=>{const i=(()=>{let t=0;try{return e.createScriptProcessor(t,1,1)}catch(r){t=2048;let i=e.sampleRate;for(;t<16384&&i>=32e3;)t<<=1,i>>=1;return e.createScriptProcessor(t,1,1)}})();i.onaudioprocess=e=>{const t=e.inputBuffer.getChannelData(0);if(r&&!r.isClosed){const e=n.encode(t);e&&r.writeStreamChunk({buffer:e,isEnd:!1,timeReceived:Date.now()})}},o.connect(i),i.connect(e.destination),this.privMediaResources={scriptProcessorNode:i,source:o,stream:t}},a=!!this.privSpeechProcessorScript&&"ignore"===this.privSpeechProcessorScript.toLowerCase();if(e.audioWorklet&&!a){if(!this.privSpeechProcessorScript){const e=new Blob(["class SP extends AudioWorkletProcessor {\n constructor(options) {\n super(options);\n }\n process(inputs, outputs) {\n const input = inputs[0];\n const output = [];\n for (let channel = 0; channel < input.length; channel += 1) {\n output[channel] = input[channel];\n }\n this.port.postMessage(output[0]);\n return true;\n }\n }\n registerProcessor('speech-processor', SP);"],{type:"application/javascript; charset=utf-8"});this.privSpeechProcessorScript=URL.createObjectURL(e)}e.audioWorklet.addModule(this.privSpeechProcessorScript).then(()=>{const i=new AudioWorkletNode(e,"speech-processor");i.port.onmessage=e=>{const t=e.data;if(r&&!r.isClosed){const e=n.encode(t);e&&r.writeStreamChunk({buffer:e,isEnd:!1,timeReceived:Date.now()})}},o.connect(i),i.connect(e.destination),this.privMediaResources={scriptProcessorNode:i,source:o,stream:t}}).catch(()=>{s()})}else try{s()}catch(e){throw new Error(`Unable to start audio worklet node for PCMRecorder: ${e}`)}}releaseMediaResources(e){this.privMediaResources&&(this.privMediaResources.scriptProcessorNode&&(this.privMediaResources.scriptProcessorNode.disconnect(e.destination),this.privMediaResources.scriptProcessorNode=null),this.privMediaResources.source&&(this.privMediaResources.source.disconnect(),this.privStopInputOnRelease&&this.privMediaResources.stream.getTracks().forEach(e=>e.stop()),this.privMediaResources.source=null))}setWorkletUrl(e){this.privSpeechProcessorScript=e}}},8361:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ProxyInfo=void 0;const i=r(881);class n{constructor(e,t,r,i){this.privProxyHostName=e,this.privProxyPort=t,this.privProxyUserName=r,this.privProxyPassword=i}static fromParameters(e){return new n(e.getProperty(i.PropertyId.SpeechServiceConnection_ProxyHostName),parseInt(e.getProperty(i.PropertyId.SpeechServiceConnection_ProxyPort),10),e.getProperty(i.PropertyId.SpeechServiceConnection_ProxyUserName),e.getProperty(i.PropertyId.SpeechServiceConnection_ProxyPassword))}static fromRecognizerConfig(e){return this.fromParameters(e.parameters)}get HostName(){return this.privProxyHostName}get Port(){return this.privProxyPort}get UserName(){return this.privProxyUserName}get Password(){return this.privProxyPassword}}t.ProxyInfo=n},8434:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TranslationSynthesisResult=void 0,t.TranslationSynthesisResult=class{constructor(e,t){this.privReason=e,this.privAudio=t}get audio(){return this.privAudio}get reason(){return this.privReason}}},8506:(e,t)=>{"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.InvocationSource=void 0,(r=t.InvocationSource||(t.InvocationSource={})).None="None",r.VoiceActivationWithKeyword="VoiceActivationWithKeyword"},8553:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ConversationConnectionFactory=void 0;const i=r(4378),n=r(868),o=r(5245),s=r(881),a=r(7778),c=r(5321),u=r(4815);class h extends a.ConnectionFactoryBase{create(e,t,r){const a=e.parameters.getProperty(s.PropertyId.ConversationTranslator_Host,c.ConversationConnectionConfig.host),h=e.parameters.getProperty(s.PropertyId.ConversationTranslator_CorrelationId,(0,n.createGuid)()),d=`wss://${a}${c.ConversationConnectionConfig.webSocketPath}`,l=e.parameters.getProperty(s.PropertyId.ConversationTranslator_Token,void 0);o.Contracts.throwIfNullOrUndefined(l,"token");const p={};p[c.ConversationConnectionConfig.configParams.apiVersion]=c.ConversationConnectionConfig.apiVersion,p[c.ConversationConnectionConfig.configParams.token]=l,p[c.ConversationConnectionConfig.configParams.correlationId]=h;const f="true"===e.parameters.getProperty("SPEECH-EnableWebsocketCompression","false");return Promise.resolve(new i.WebsocketConnection(d,p,{},new u.ConversationWebsocketMessageFormatter,i.ProxyInfo.fromRecognizerConfig(e),f,r))}}t.ConversationConnectionFactory=h},8554:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DetailedSpeechPhrase=void 0;const i=r(9190);class n{constructor(e,t){this.privDetailedSpeechPhrase=JSON.parse(e),this.privDetailedSpeechPhrase.RecognitionStatus=this.mapRecognitionStatus(this.privDetailedSpeechPhrase.RecognitionStatus),this.updateOffsets(t)}static fromJSON(e,t){return new n(e,t)}updateOffsets(e){if(this.privDetailedSpeechPhrase.Offset+=e,this.privDetailedSpeechPhrase.NBest)for(const t of this.privDetailedSpeechPhrase.NBest){if(t.Words)for(const r of t.Words)r.Offset+=e;if(t.DisplayWords)for(const r of t.DisplayWords)r.Offset+=e}}asJson(){const e={...this.privDetailedSpeechPhrase};return JSON.stringify({...e,RecognitionStatus:i.RecognitionStatus[e.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 void 0===this.privDetailedSpeechPhrase.PrimaryLanguage?void 0:this.privDetailedSpeechPhrase.PrimaryLanguage.Language}get LanguageDetectionConfidence(){return void 0===this.privDetailedSpeechPhrase.PrimaryLanguage?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(e){return"string"==typeof e?i.RecognitionStatus[e]:"number"==typeof e?e:void 0}}t.DetailedSpeechPhrase=n},8563:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=o(r(1706)),n=o(r(6211));function o(e){return e&&e.__esModule?e:{default:e}}var s=(0,i.default)("v5",80,n.default);t.default=s},8585:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SynthesisResult=void 0,t.SynthesisResult=class{constructor(e,t,r,i){this.privResultId=e,this.privReason=t,this.privErrorDetails=r,this.privProperties=i}get resultId(){return this.privResultId}get reason(){return this.privReason}get errorDetails(){return this.privErrorDetails}get properties(){return this.privProperties}}},8607:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},8618:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SendingAgentContextMessageEvent=t.DialogEvent=void 0;const i=r(2754);class n extends i.PlatformEvent{constructor(e,t=i.EventType.Info){super(e,t)}}t.DialogEvent=n,t.SendingAgentContextMessageEvent=class extends n{constructor(e){super("SendingAgentContextMessageEvent"),this.privAgentConfig=e}get agentConfig(){return this.privAgentConfig}}},8632:()=>{},8640:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PushAudioOutputStreamImpl=t.PushAudioOutputStream=t.PullAudioOutputStreamImpl=t.PullAudioOutputStream=t.AudioOutputStream=void 0;const i=r(868),n=r(5245),o=r(1355);class s{constructor(){}static createPullStream(){return a.create()}}t.AudioOutputStream=s;class a extends s{static create(){return new c}}t.PullAudioOutputStream=a;class c extends a{constructor(){super(),this.privId=(0,i.createNoDashGuid)(),this.privStream=new i.Stream}set format(e){null==e&&(this.privFormat=o.AudioOutputFormatImpl.getDefaultOutputFormat()),this.privFormat=e}get format(){return this.privFormat}get isClosed(){return this.privStream.isClosed}id(){return this.privId}async read(e){const t=new Int8Array(e);let r=0;if(void 0!==this.privLastChunkView){if(this.privLastChunkView.length>e.byteLength)return t.set(this.privLastChunkView.slice(0,e.byteLength)),this.privLastChunkView=this.privLastChunkView.slice(e.byteLength),Promise.resolve(e.byteLength);t.set(this.privLastChunkView),r=this.privLastChunkView.length,this.privLastChunkView=void 0}for(;r<e.byteLength&&!this.privStream.isReadEnded;){const i=await this.privStream.read();if(void 0===i||i.isEnd)this.privStream.readEnded();else{let n;i.buffer.byteLength>e.byteLength-r?(n=i.buffer.slice(0,e.byteLength-r),this.privLastChunkView=new Int8Array(i.buffer.slice(e.byteLength-r))):n=i.buffer,t.set(new Int8Array(n),r),r+=n.byteLength}}return r}write(e){n.Contracts.throwIfNullOrUndefined(this.privStream,"must set format before writing"),this.privStream.writeStreamChunk({buffer:e,isEnd:!1,timeReceived:Date.now()})}close(){this.privStream.close()}}t.PullAudioOutputStreamImpl=c;class u extends s{constructor(){super()}static create(e){return new h(e)}}t.PushAudioOutputStream=u;class h extends u{constructor(e){super(),this.privId=(0,i.createNoDashGuid)(),this.privCallback=e}set format(e){}write(e){this.privCallback.write&&this.privCallback.write(e)}close(){this.privCallback.close&&this.privCallback.close()}id(){return this.privId}}t.PushAudioOutputStreamImpl=h},8643:(e,t)=>{"use strict";var r,i;Object.defineProperty(t,"__esModule",{value:!0}),t.RecognitionStatus=t.SynthesisStatus=void 0,(i=t.SynthesisStatus||(t.SynthesisStatus={}))[i.Success=0]="Success",i[i.SynthesisEnd=1]="SynthesisEnd",i[i.Error=2]="Error",(r=t.RecognitionStatus||(t.RecognitionStatus={}))[r.Success=0]="Success",r[r.NoMatch=1]="NoMatch",r[r.InitialSilenceTimeout=2]="InitialSilenceTimeout",r[r.BabbleTimeout=3]="BabbleTimeout",r[r.Error=4]="Error",r[r.EndOfDictation=5]="EndOfDictation",r[r.TooManyRequests=6]="TooManyRequests",r[r.BadRequest=7]="BadRequest",r[r.Forbidden=8]="Forbidden"},8698:(e,t)=>{"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.AudioStreamFormatImpl=t.AudioStreamFormat=t.AudioFormatTag=void 0,function(e){e[e.PCM=1]="PCM",e[e.MuLaw=2]="MuLaw",e[e.Siren=3]="Siren",e[e.MP3=4]="MP3",e[e.SILKSkype=5]="SILKSkype",e[e.OGG_OPUS=6]="OGG_OPUS",e[e.WEBM_OPUS=7]="WEBM_OPUS",e[e.ALaw=8]="ALaw",e[e.FLAC=9]="FLAC",e[e.OPUS=10]="OPUS",e[e.AMR_WB=11]="AMR_WB",e[e.G722=12]="G722"}(r=t.AudioFormatTag||(t.AudioFormatTag={}));class i{static getDefaultInputFormat(){return n.getDefaultInputFormat()}static getWaveFormat(e,t,r,i){return new n(e,t,r,i)}static getWaveFormatPCM(e,t,r){return new n(e,t,r)}}t.AudioStreamFormat=i;class n extends i{constructor(e=16e3,t=16,i=1,n=r.PCM){super();let o=!0;switch(n){case r.PCM:this.formatTag=1;break;case r.ALaw:this.formatTag=6;break;case r.MuLaw:this.formatTag=7;break;default:o=!1}if(this.bitsPerSample=t,this.samplesPerSec=e,this.channels=i,this.avgBytesPerSec=this.samplesPerSec*this.channels*(this.bitsPerSample/8),this.blockAlign=this.channels*Math.max(this.bitsPerSample,8),o){this.privHeader=new ArrayBuffer(44);const e=new DataView(this.privHeader);this.setString(e,0,"RIFF"),e.setUint32(4,0,!0),this.setString(e,8,"WAVEfmt "),e.setUint32(16,16,!0),e.setUint16(20,this.formatTag,!0),e.setUint16(22,this.channels,!0),e.setUint32(24,this.samplesPerSec,!0),e.setUint32(28,this.avgBytesPerSec,!0),e.setUint16(32,this.channels*(this.bitsPerSample/8),!0),e.setUint16(34,this.bitsPerSample,!0),this.setString(e,36,"data"),e.setUint32(40,0,!0)}}static getDefaultInputFormat(){return new n}static getAudioContext(e){const t=window.AudioContext||window.webkitAudioContext||!1;if(t)return void 0!==e&&navigator.mediaDevices.getSupportedConstraints().sampleRate?new t({sampleRate:e}):new t;throw new Error("Browser does not support Web Audio API (AudioContext is not available).")}close(){}get header(){return this.privHeader}setString(e,t,r){for(let i=0;i<r.length;i++)e.setUint8(t+i,r.charCodeAt(i))}}t.AudioStreamFormatImpl=n},8701:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AvatarWebRTCConnectionResult=void 0;const i=r(881);class n extends i.SynthesisResult{constructor(e,t,r,i,n){super(t,r,i,n),this.privSDPAnswer=e}get SDPAnswer(){return this.privSDPAnswer}}t.AvatarWebRTCConnectionResult=n},8716:(e,t)=>{"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.AvatarEventArgs=t.AvatarEventTypes=void 0,(r=t.AvatarEventTypes||(t.AvatarEventTypes={})).SwitchedToSpeaking="SwitchedToSpeaking",r.SwitchedToIdle="SwitchedToIdle",r.SessionClosed="SessionClosed",t.AvatarEventArgs=class{constructor(e,t){this.privOffset=e,this.privDescription=t}get type(){return this.privType}get offset(){return this.privOffset}get description(){return this.privDescription}}},8922:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Events=void 0;const i=r(6209),n=r(5870);class o{static setEventSource(e){if(!e)throw new i.ArgumentNullError("eventSource");o.privInstance=e}static get instance(){return o.privInstance}}t.Events=o,o.privInstance=new n.EventSource},8948:(e,t,r)=>{"use strict";var i=r(7426),n=r(3349);function o(e,t,r){if(!(this instanceof o))return new o(e,t,r);this.Hash=e,this.blockSize=e.blockSize/8,this.outSize=e.outSize/8,this.inner=null,this.outer=null,this._init(i.toArray(t,r))}e.exports=o,o.prototype._init=function(e){e.length>this.blockSize&&(e=(new this.Hash).update(e).digest()),n(e.length<=this.blockSize);for(var t=e.length;t<this.blockSize;t++)e.push(0);for(t=0;t<e.length;t++)e[t]^=54;for(this.inner=(new this.Hash).update(e),t=0;t<e.length;t++)e[t]^=106;this.outer=(new this.Hash).update(e)},o.prototype.update=function(e,t){return this.inner.update(e,t),this},o.prototype.digest=function(e){return this.outer.update(this.inner.digest()),this.outer.digest(e)}},8987:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BaseAudioPlayer=void 0;const i=r(6209),n=r(881),o=r(8698);t.BaseAudioPlayer=class{constructor(e){this.audioContext=null,this.gainNode=null,this.autoUpdateBufferTimer=0,void 0===e&&(e=n.AudioStreamFormat.getDefaultInputFormat()),this.init(e)}playAudioSample(e,t,r){try{this.ensureInitializedContext();const r=this.formatAudioData(e),i=new Float32Array(this.samples.length+r.length);i.set(this.samples,0),i.set(r,this.samples.length),this.samples=i,t&&t()}catch(e){r&&r(e)}}stopAudio(e,t){null!==this.audioContext&&(this.samples=new Float32Array,clearInterval(this.autoUpdateBufferTimer),this.audioContext.close().then(()=>{e&&e()},e=>{t&&t(e)}),this.audioContext=null)}init(e){this.audioFormat=e,this.samples=new Float32Array}ensureInitializedContext(){if(null===this.audioContext){this.createAudioContext();const e=200;this.autoUpdateBufferTimer=setInterval(()=>{this.updateAudioBuffer()},e)}}createAudioContext(){this.audioContext=o.AudioStreamFormatImpl.getAudioContext(),this.gainNode=this.audioContext.createGain(),this.gainNode.gain.value=1,this.gainNode.connect(this.audioContext.destination),this.startTime=this.audioContext.currentTime}formatAudioData(e){switch(this.audioFormat.bitsPerSample){case 8:return this.formatArrayBuffer(new Int8Array(e),128);case 16:return this.formatArrayBuffer(new Int16Array(e),32768);case 32:return this.formatArrayBuffer(new Int32Array(e),2147483648);default:throw new i.InvalidOperationError("Only WAVE_FORMAT_PCM (8/16/32 bps) format supported at this time")}}formatArrayBuffer(e,t){const r=new Float32Array(e.length);for(let i=0;i<e.length;i++)r[i]=e[i]/t;return r}updateAudioBuffer(){if(0===this.samples.length)return;const e=this.audioFormat.channels,t=this.audioContext.createBufferSource(),r=this.samples.length/e,i=this.audioContext.createBuffer(e,r,this.audioFormat.samplesPerSec);for(let t=0;t<e;t++){let r=t;const n=i.getChannelData(t);for(let t=0;t<this.samples.length;t++,r+=e)n[t]=this.samples[r]}this.startTime<this.audioContext.currentTime&&(this.startTime=this.audioContext.currentTime),t.buffer=i,t.connect(this.gainNode),t.start(this.startTime),this.startTime+=i.duration,this.samples=new Float32Array}async playAudio(e){null===this.audioContext&&this.createAudioContext();const t=this.audioContext.createBufferSource(),r=this.audioContext.destination;await this.audioContext.decodeAudioData(e,e=>{t.buffer=e,t.connect(r),t.start(0)})}}},9061:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ConversationTranslatorCommandTypes=t.ConversationTranslatorMessageTypes=t.InternalParticipants=void 0,t.InternalParticipants=class{constructor(e=[],t){this.participants=e,this.meId=t}addOrUpdateParticipant(e){if(void 0===e)return;const t=this.getParticipantIndex(e.id);return t>-1?this.participants.splice(t,1,e):this.participants.push(e),this.getParticipant(e.id)}getParticipantIndex(e){return this.participants.findIndex(t=>t.id===e)}getParticipant(e){return this.participants.find(t=>t.id===e)}deleteParticipant(e){this.participants=this.participants.filter(t=>t.id!==e)}get host(){return this.participants.find(e=>!0===e.isHost)}get me(){return this.getParticipant(this.meId)}},t.ConversationTranslatorMessageTypes={command:"command",final:"final",info:"info",instantMessage:"instant_message",keepAlive:"keep_alive",partial:"partial",participantCommand:"participant_command",translatedMessage:"translated_message"},t.ConversationTranslatorCommandTypes={changeNickname:"ChangeNickname",disconnectSession:"DisconnectSession",ejectParticipant:"EjectParticipant",instant_message:"instant_message",joinSession:"JoinSession",leaveSession:"LeaveSession",participantList:"ParticipantList",roomExpirationWarning:"RoomExpirationWarning",setLockState:"SetLockState",setMute:"SetMute",setMuteAll:"SetMuteAll",setProfanityFiltering:"SetProfanityFiltering",setTranslateToLanguages:"SetTranslateToLanguages",setUseTTS:"SetUseTTS"}},9071:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AvatarSynthesizer=void 0;const i=r(5763),n=r(9190),o=r(868),s=r(1355),a=r(881),c=r(5245),u=r(4040);class h extends a.Synthesizer{constructor(e,t){super(e),c.Contracts.throwIfNullOrUndefined(t,"avatarConfig"),this.privConnectionFactory=new i.SpeechSynthesisConnectionFactory,this.privAvatarConfig=t,this.implCommonSynthesizeSetup()}implCommonSynthesizeSetup(){super.implCommonSynthesizeSetup(),this.privAdapter.audioOutputFormat=s.AudioOutputFormatImpl.fromSpeechSynthesisOutputFormat(a.SpeechSynthesisOutputFormat.Riff24Khz16BitMonoPcm)}async startAvatarAsync(e){c.Contracts.throwIfNullOrUndefined(e,"peerConnection"),this.privIceServers=e.getConfiguration().iceServers,c.Contracts.throwIfNullOrUndefined(this.privIceServers,"Ice servers must be set.");const t=new o.Deferred;e.onicegatheringstatechange=()=>{o.Events.instance.onEvent(new o.PlatformEvent("peer connection: ice gathering state: "+e.iceGatheringState,o.EventType.Debug)),"complete"===e.iceGatheringState&&(o.Events.instance.onEvent(new o.PlatformEvent("peer connection: ice gathering complete.",o.EventType.Info)),t.resolve())},e.onicecandidate=e=>{e.candidate?o.Events.instance.onEvent(new o.PlatformEvent("peer connection: ice candidate: "+e.candidate.candidate,o.EventType.Debug)):(o.Events.instance.onEvent(new o.PlatformEvent("peer connection: ice candidate: complete",o.EventType.Debug)),t.resolve())},setTimeout(()=>{"complete"!==e.iceGatheringState&&(o.Events.instance.onEvent(new o.PlatformEvent("peer connection: ice gathering timeout.",o.EventType.Warning)),t.resolve())},2e3);const r=await e.createOffer();await e.setLocalDescription(r),await t.promise,o.Events.instance.onEvent(new o.PlatformEvent("peer connection: got local SDP.",o.EventType.Info)),this.privProperties.setProperty(a.PropertyId.TalkingAvatarService_WebRTC_SDP,JSON.stringify(e.localDescription));const i=await this.speak("",!1);if(i.reason!==a.ResultReason.SynthesizingAudioCompleted)return new a.SynthesisResult(i.resultId,i.reason,i.errorDetails,i.properties);const n=atob(i.properties.getProperty(a.PropertyId.TalkingAvatarService_WebRTC_SDP)),s=new RTCSessionDescription(JSON.parse(n));return await e.setRemoteDescription(s),new a.SynthesisResult(i.resultId,i.reason,void 0,i.properties)}async speakTextAsync(e){const t=await this.speak(e,!1);return new a.SynthesisResult(t.resultId,t.reason,t.errorDetails,t.properties)}async speakSsmlAsync(e){const t=await this.speak(e,!0);return new a.SynthesisResult(t.resultId,t.reason,t.errorDetails,t.properties)}async stopSpeakingAsync(){for(;this.synthesisRequestQueue.length()>0;)(await this.synthesisRequestQueue.dequeue()).err("Synthesis is canceled by user.");return this.privAdapter.stopSpeaking()}async stopAvatarAsync(){return c.Contracts.throwIfDisposed(this.privDisposed),this.dispose(!0)}async close(){if(!this.privDisposed)return this.dispose(!0)}get iceServers(){return this.privIceServers}createSynthesisAdapter(e,t,r){return new n.AvatarSynthesisAdapter(e,t,r,this,this.privAvatarConfig)}createRestSynthesisAdapter(e,t){}createSynthesizerConfig(e){const t=super.createSynthesizerConfig(e);return t.avatarEnabled=!0,t}async speak(e,t){const r=(0,o.createNoDashGuid)(),i=new o.Deferred;return this.synthesisRequestQueue.enqueue(new u.SynthesisRequest(r,e,t,e=>{i.resolve(e),this.privSynthesizing=!1,this.adapterSpeak()},e=>{i.reject(e),this.privSynthesizing=!1})),this.adapterSpeak(),i.promise}}t.AvatarSynthesizer=h},9112:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Connection=void 0;const i=r(9190),n=r(868),o=r(2501),s=r(5245),a=r(881);class c{static fromRecognizer(e){const t=e.internalData,r=new c;return r.privInternalData=t,r.setupEvents(),r}static fromSynthesizer(e){const t=e.internalData,r=new c;return r.privInternalData=t,r.setupEvents(),r}openConnection(e,t){(0,n.marshalPromiseToCallbacks)(this.privInternalData.connect(),e,t)}closeConnection(e,t){if(this.privInternalData instanceof i.SynthesisAdapterBase)throw new Error("Disconnecting a synthesizer's connection is currently not supported");(0,n.marshalPromiseToCallbacks)(this.privInternalData.disconnect(),e,t)}setMessageProperty(e,t,r){if(s.Contracts.throwIfNullOrWhitespace(t,"propertyName"),this.privInternalData instanceof i.ServiceRecognizerBase){if("speech.context"!==e.toLowerCase())throw new Error("Only speech.context message property sets are currently supported for recognizer");this.privInternalData.speechContext.getContext()[t]=r}else if(this.privInternalData instanceof i.SynthesisAdapterBase){if("speech.config"!==e.toLowerCase()&&"synthesis.context"!==e.toLowerCase())throw new Error("Only speech.config and synthesis.context message paths are currently supported for synthesizer");if("speech.config"===e.toLowerCase()){if("context"!==t.toLowerCase())throw new Error("Only context property is currently supported for speech.config message path for synthesizer");this.privInternalData.synthesizerConfig.setContextFromJson(r)}else this.privInternalData.synthesisContext.setSection(t,r)}}sendMessageAsync(e,t,r,i){(0,n.marshalPromiseToCallbacks)(this.privInternalData.sendNetworkMessage(e,t),r,i)}close(){}setupEvents(){this.privEventListener=this.privInternalData.connectionEvents.attach(e=>{"ConnectionEstablishedEvent"===e.name?this.connected&&this.connected(new a.ConnectionEventArgs(e.connectionId)):"ConnectionClosedEvent"===e.name?this.disconnected&&this.disconnected(new a.ConnectionEventArgs(e.connectionId)):"ConnectionMessageSentEvent"===e.name?this.messageSent&&this.messageSent(new a.ConnectionMessageEventArgs(new o.ConnectionMessageImpl(e.message))):"ConnectionMessageReceivedEvent"===e.name&&this.messageReceived&&this.messageReceived(new a.ConnectionMessageEventArgs(new o.ConnectionMessageImpl(e.message)))}),this.privServiceEventListener=this.privInternalData.serviceEvents.attach(e=>{this.receivedServiceMessage&&this.receivedServiceMessage(new a.ServiceEventArgs(e.jsonString,e.name))})}}t.Connection=c},9113:(e,t)=>{"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.NextAction=void 0,(r=t.NextAction||(t.NextAction={})).Recognize="Recognize",r.None="None"},9138:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.VoiceProfileEnrollmentCancellationDetails=t.VoiceProfileEnrollmentResult=void 0;const i=r(9190),n=r(881);class o{constructor(e,t,r){this.privReason=e,this.privProperties=new n.PropertyCollection,this.privReason!==n.ResultReason.Canceled?t&&(this.privDetails=JSON.parse(t),"enrolling"===this.privDetails.enrollmentStatus.toLowerCase()&&(this.privReason=n.ResultReason.EnrollingVoiceProfile)):(this.privErrorDetails=r,this.privProperties.setProperty(i.CancellationErrorCodePropertyName,n.CancellationErrorCode[n.CancellationErrorCode.ServiceError]))}get reason(){return this.privReason}get enrollmentsCount(){return this.privDetails.enrollmentsCount}get enrollmentsLength(){return this.privDetails.enrollmentsLength}get properties(){return this.privProperties}get enrollmentResultDetails(){return this.privDetails}get errorDetails(){return this.privErrorDetails}static FromIdentificationProfileList(e){const t=[];for(const r of e.value){const e="enrolling"===r.enrollmentStatus.toLowerCase()?n.ResultReason.EnrollingVoiceProfile:"enrolled"===r.enrollmentStatus.toLowerCase()?n.ResultReason.EnrolledVoiceProfile:n.ResultReason.Canceled,i=new o(e,null,null);i.privDetails=this.getIdentificationDetails(r),t.push(i)}return t}static FromVerificationProfileList(e){const t=[];for(const r of e.value){const e="enrolling"===r.enrollmentStatus.toLowerCase()?n.ResultReason.EnrollingVoiceProfile:"enrolled"===r.enrollmentStatus.toLowerCase()?n.ResultReason.EnrolledVoiceProfile:n.ResultReason.Canceled,i=new o(e,null,null);i.privDetails=this.getVerificationDetails(r),t.push(i)}return t}static getIdentificationDetails(e){return{audioLength:e.audioLength?parseFloat(e.audioLength):0,audioSpeechLength:e.audioSpeechLength?parseFloat(e.audioSpeechLength):0,enrollmentStatus:e.enrollmentStatus,enrollmentsCount:e.enrollmentsCount||0,enrollmentsLength:e.enrollmentsLength?parseFloat(e.enrollmentsLength):0,enrollmentsSpeechLength:e.enrollmentsSpeechLength?parseFloat(e.enrollmentsSpeechLength):0,profileId:e.profileId||e.identificationProfileId,remainingEnrollmentsSpeechLength:e.remainingEnrollmentsSpeechLength?parseFloat(e.remainingEnrollmentsSpeechLength):0}}static getVerificationDetails(e){return{audioLength:e.audioLength?parseFloat(e.audioLength):0,audioSpeechLength:e.audioSpeechLength?parseFloat(e.audioSpeechLength):0,enrollmentStatus:e.enrollmentStatus,enrollmentsCount:e.enrollmentsCount,enrollmentsLength:e.enrollmentsLength?parseFloat(e.enrollmentsLength):0,enrollmentsSpeechLength:e.enrollmentsSpeechLength?parseFloat(e.enrollmentsSpeechLength):0,profileId:e.profileId||e.verificationProfileId,remainingEnrollmentsCount:e.remainingEnrollments||e.remainingEnrollmentsCount,remainingEnrollmentsSpeechLength:e.remainingEnrollmentsSpeechLength?parseFloat(e.remainingEnrollmentsSpeechLength):0}}}t.VoiceProfileEnrollmentResult=o;class s extends n.CancellationDetailsBase{constructor(e,t,r){super(e,t,r)}static fromResult(e){const t=n.CancellationReason.Error;let r=n.CancellationErrorCode.NoError;return e.properties&&(r=n.CancellationErrorCode[e.properties.getProperty(i.CancellationErrorCodePropertyName,n.CancellationErrorCode[n.CancellationErrorCode.NoError])]),new s(t,e.errorDetails,r)}}t.VoiceProfileEnrollmentCancellationDetails=s},9163:(e,t,r)=>{"use strict";const i=r(944);class n extends Error{constructor(e,...t){let r;super(...t),Error.captureStackTrace&&Error.captureStackTrace(this,n),this.name="StatusError",this.message=e.statusMessage,this.statusCode=e.status,this.res=e,this.json=e.json.bind(e),this.text=e.text.bind(e),this.arrayBuffer=e.arrayBuffer.bind(e),Object.defineProperty(this,"responseBody",{get:()=>(r||(r=this.arrayBuffer()),r)}),this.headers={};for(const[t,r]of e.headers.entries())this.headers[t.toLowerCase()]=r}}e.exports=i((e,t,r,i,o)=>async(s,a,c={})=>{s=o+(s||"");let u=new URL(s);if(i||(i={}),u.username&&(i.Authorization="Basic "+btoa(u.username+":"+u.password),u=new URL(u.protocol+"//"+u.host+u.pathname+u.search)),"https:"!==u.protocol&&"http:"!==u.protocol)throw new Error(`Unknown protocol, ${u.protocol}`);if(a)if(a instanceof ArrayBuffer||ArrayBuffer.isView(a)||"string"==typeof a);else{if("object"!=typeof a)throw new Error("Unknown body type.");a=JSON.stringify(a),i["Content-Type"]="application/json"}c=new Headers({...i||{},...c});const h=await fetch(u,{method:t,headers:c,body:a});if(h.statusCode=h.status,!e.has(h.status))throw new n(h);return"json"===r?h.json():"buffer"===r?h.arrayBuffer():"string"===r?h.text():h})},9165:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LanguageUnderstandingModelImpl=t.LanguageUnderstandingModel=void 0;const i=r(5245);class n{constructor(){}static fromEndpoint(e){i.Contracts.throwIfNull(e,"uri"),i.Contracts.throwIfNullOrWhitespace(e.hostname,"uri");const t=new o,r=e.host.indexOf(".");if(-1===r)throw new Error("Could not determine region from endpoint");t.region=e.host.substr(0,r);const n=e.pathname.lastIndexOf("/")+1;if(-1===n)throw new Error("Could not determine appId from endpoint");if(t.appId=e.pathname.substr(n),t.subscriptionKey=e.searchParams.get("subscription-key"),void 0===t.subscriptionKey)throw new Error("Could not determine subscription key from endpoint");return t}static fromAppId(e){i.Contracts.throwIfNullOrWhitespace(e,"appId");const t=new o;return t.appId=e,t}static fromSubscription(e,t,r){i.Contracts.throwIfNullOrWhitespace(e,"subscriptionKey"),i.Contracts.throwIfNullOrWhitespace(t,"appId"),i.Contracts.throwIfNullOrWhitespace(r,"region");const n=new o;return n.appId=t,n.region=r,n.subscriptionKey=e,n}}t.LanguageUnderstandingModel=n;class o extends n{}t.LanguageUnderstandingModelImpl=o},9176:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ServiceEventArgs=void 0;const i=r(881);class n extends i.SessionEventArgs{constructor(e,t,r){super(r),this.privJsonResult=e,this.privEventName=t}get jsonString(){return this.privJsonResult}get eventName(){return this.privEventName}}t.ServiceEventArgs=n},9190:function(e,t,r){"use strict";var i=this&&this.__createBinding||(Object.create?function(e,t,r,i){void 0===i&&(i=r),Object.defineProperty(e,i,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,i){void 0===i&&(i=r),e[i]=t[r]}),n=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||i(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),t.AutoDetectSourceLanguagesOpenRangeOptionName=t.ForceDictationPropertyName=t.ServicePropertiesPropertyName=t.CancellationErrorCodePropertyName=t.OutputFormatPropertyName=t.SpeechSynthesisAdapter=t.AvatarSynthesisAdapter=void 0,n(r(6037),t),n(r(1864),t),n(r(2690),t),n(r(9962),t),n(r(522),t),n(r(7037),t),n(r(8183),t),n(r(5843),t),n(r(8257),t),n(r(3493),t),n(r(1633),t),n(r(2964),t),n(r(2649),t),n(r(4877),t),n(r(4525),t),n(r(9366),t),n(r(9958),t),n(r(5763),t),n(r(5737),t),n(r(8643),t),n(r(2505),t),n(r(4196),t),n(r(9203),t),n(r(6449),t),n(r(5189),t),n(r(8233),t),n(r(436),t),n(r(5306),t),n(r(9747),t),n(r(1647),t),n(r(8554),t),n(r(9548),t),n(r(4326),t),n(r(7402),t),n(r(1336),t),n(r(9355),t),n(r(1846),t),n(r(2820),t),n(r(1800),t),n(r(8075),t),n(r(6986),t),n(r(5685),t),n(r(8032),t),n(r(4480),t),n(r(9841),t);var o=r(9493);Object.defineProperty(t,"AvatarSynthesisAdapter",{enumerable:!0,get:function(){return o.AvatarSynthesisAdapter}});var s=r(4038);Object.defineProperty(t,"SpeechSynthesisAdapter",{enumerable:!0,get:function(){return s.SpeechSynthesisAdapter}}),n(r(18),t),n(r(7461),t),n(r(5887),t),n(r(1979),t),n(r(5027),t),n(r(5462),t),n(r(7126),t),t.OutputFormatPropertyName="OutputFormat",t.CancellationErrorCodePropertyName="CancellationErrorCode",t.ServicePropertiesPropertyName="ServiceProperties",t.ForceDictationPropertyName="ForceDictation",t.AutoDetectSourceLanguagesOpenRangeOptionName="UND"},9203:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TranslationPhrase=void 0;const i=r(5245),n=r(9190),o=r(4520);class s{constructor(e,t){this.privTranslationPhrase=e,this.privTranslationPhrase.Offset+=t,this.privTranslationPhrase.RecognitionStatus=this.mapRecognitionStatus(this.privTranslationPhrase.RecognitionStatus),void 0!==this.privTranslationPhrase.Translation&&(this.privTranslationPhrase.Translation.TranslationStatus=this.mapTranslationStatus(this.privTranslationPhrase.Translation.TranslationStatus))}static fromJSON(e,t){return new s(JSON.parse(e),t)}static fromTranslationResponse(e,t){i.Contracts.throwIfNullOrUndefined(e,"translationResponse");const r=e.SpeechPhrase;return e.SpeechPhrase=void 0,r.Translation=e,r.Text=r.DisplayText,new s(r,t)}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(){return this.privTranslationPhrase.PrimaryLanguage?.Language}get Confidence(){return this.privTranslationPhrase.PrimaryLanguage?.Confidence}get Translation(){return this.privTranslationPhrase.Translation}asJson(){const e={...this.privTranslationPhrase},t={...e,RecognitionStatus:n.RecognitionStatus[e.RecognitionStatus]};return e.Translation&&(t.Translation={...e.Translation,TranslationStatus:o.TranslationStatus[e.Translation.TranslationStatus]}),JSON.stringify(t)}mapRecognitionStatus(e){return"string"==typeof e?n.RecognitionStatus[e]:"number"==typeof e?e:void 0}mapTranslationStatus(e){return"string"==typeof e?o.TranslationStatus[e]:"number"==typeof e?e:void 0}}t.TranslationPhrase=s},9324:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.QueryParameterNames=void 0;class r{}t.QueryParameterNames=r,r.BotId="botid",r.CustomSpeechDeploymentId="cid",r.CustomVoiceDeploymentId="deploymentId",r.EnableAudioLogging="storeAudio",r.EnableLanguageId="lidEnabled",r.EnableWordLevelTimestamps="wordLevelTimestamps",r.EndSilenceTimeoutMs="endSilenceTimeoutMs",r.SegmentationSilenceTimeoutMs="segmentationSilenceTimeoutMs",r.SegmentationMaximumTimeMs="segmentationMaximumTimeMs",r.SegmentationStrategy="segmentationStrategy",r.Format="format",r.InitialSilenceTimeoutMs="initialSilenceTimeoutMs",r.Language="language",r.Profanity="profanity",r.RequestBotStatusMessages="enableBotMessageStatus",r.StableIntermediateThreshold="stableIntermediateThreshold",r.StableTranslation="stableTranslation",r.TestHooks="testhooks",r.Postprocessing="postprocessing",r.CtsMeetingId="meetingId",r.CtsDeviceId="deviceId",r.CtsIsParticipant="isParticipant",r.EnableAvatar="enableTalkingAvatar"},9355:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},9366:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TranscriberConnectionFactory=void 0;const i=r(4378),n=r(881),o=r(7778),s=r(9190),a=r(7014),c=r(9324);class u extends o.ConnectionFactoryBase{constructor(){super(...arguments),this.multiaudioRelativeUri="/speech/recognition/multiaudio"}create(e,t,r){let c=e.parameters.getProperty(n.PropertyId.SpeechServiceConnection_Endpoint,void 0);const u=e.parameters.getProperty(n.PropertyId.SpeechServiceConnection_Region,"centralus"),h="wss://transcribe."+u+".cts.speech"+o.ConnectionFactoryBase.getHostSuffix(u)+this.multiaudioRelativeUri,d=e.parameters.getProperty(n.PropertyId.SpeechServiceConnection_Host,h),l={};this.setQueryParams(l,e,c),c||(c=d);const p={};void 0!==t.token&&""!==t.token&&(p[t.headerName]=t.token),p[a.HeaderNames.ConnectionId]=r,e.parameters.setProperty(n.PropertyId.SpeechServiceConnection_Url,c);const f="true"===e.parameters.getProperty("SPEECH-EnableWebsocketCompression","false");return Promise.resolve(new i.WebsocketConnection(c,l,p,new s.WebsocketMessageFormatter,i.ProxyInfo.fromRecognizerConfig(e),f,r))}setQueryParams(e,t,r){const i=t.parameters.getProperty(n.PropertyId.SpeechServiceConnection_EndpointId,void 0),o=t.parameters.getProperty(n.PropertyId.SpeechServiceConnection_RecoLanguage,void 0);i&&!(c.QueryParameterNames.CustomSpeechDeploymentId in e)&&(e[c.QueryParameterNames.CustomSpeechDeploymentId]=i),o&&!(c.QueryParameterNames.Language in e)&&(e[c.QueryParameterNames.Language]=o);const a="true"===t.parameters.getProperty(n.PropertyId.SpeechServiceResponse_RequestWordLevelTimestamps,"false").toLowerCase(),u=t.parameters.getProperty(s.OutputFormatPropertyName,n.OutputFormat[n.OutputFormat.Simple])!==n.OutputFormat[n.OutputFormat.Simple];(a||u)&&(e[c.QueryParameterNames.Format]=n.OutputFormat[n.OutputFormat.Detailed].toLowerCase()),this.setCommonUrlParams(t,e,r)}}t.TranscriberConnectionFactory=u},9404:function(e,t,r){!function(e,t){"use strict";function i(e,t){if(!e)throw new Error(t||"Assertion failed")}function n(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function o(e,t,r){if(o.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(r=t,t=10),this._init(e||0,t||10,r||"be"))}var s;"object"==typeof e?e.exports=o:t.BN=o,o.BN=o,o.wordSize=26;try{s="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:r(7790).Buffer}catch(e){}function a(e,t){var r=e.charCodeAt(t);return r>=48&&r<=57?r-48:r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:void i(!1,"Invalid character in "+e)}function c(e,t,r){var i=a(e,r);return r-1>=t&&(i|=a(e,r-1)<<4),i}function u(e,t,r,n){for(var o=0,s=0,a=Math.min(e.length,r),c=t;c<a;c++){var u=e.charCodeAt(c)-48;o*=n,s=u>=49?u-49+10:u>=17?u-17+10:u,i(u>=0&&s<n,"Invalid character"),o+=s}return o}function h(e,t){e.words=t.words,e.length=t.length,e.negative=t.negative,e.red=t.red}if(o.isBN=function(e){return e instanceof o||null!==e&&"object"==typeof e&&e.constructor.wordSize===o.wordSize&&Array.isArray(e.words)},o.max=function(e,t){return e.cmp(t)>0?e:t},o.min=function(e,t){return e.cmp(t)<0?e:t},o.prototype._init=function(e,t,r){if("number"==typeof e)return this._initNumber(e,t,r);if("object"==typeof e)return this._initArray(e,t,r);"hex"===t&&(t=16),i(t===(0|t)&&t>=2&&t<=36);var n=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(n++,this.negative=1),n<e.length&&(16===t?this._parseHex(e,n,r):(this._parseBase(e,t,n),"le"===r&&this._initArray(this.toArray(),t,r)))},o.prototype._initNumber=function(e,t,r){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[67108863&e],this.length=1):e<4503599627370496?(this.words=[67108863&e,e/67108864&67108863],this.length=2):(i(e<9007199254740992),this.words=[67108863&e,e/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),t,r)},o.prototype._initArray=function(e,t,r){if(i("number"==typeof e.length),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=new Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var o,s,a=0;if("be"===r)for(n=e.length-1,o=0;n>=0;n-=3)s=e[n]|e[n-1]<<8|e[n-2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);else if("le"===r)for(n=0,o=0;n<e.length;n+=3)s=e[n]|e[n+1]<<8|e[n+2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);return this._strip()},o.prototype._parseHex=function(e,t,r){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var i=0;i<this.length;i++)this.words[i]=0;var n,o=0,s=0;if("be"===r)for(i=e.length-1;i>=t;i-=2)n=c(e,t,i)<<o,this.words[s]|=67108863&n,o>=18?(o-=18,s+=1,this.words[s]|=n>>>26):o+=8;else for(i=(e.length-t)%2==0?t+1:t;i<e.length;i+=2)n=c(e,t,i)<<o,this.words[s]|=67108863&n,o>=18?(o-=18,s+=1,this.words[s]|=n>>>26):o+=8;this._strip()},o.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var i=0,n=1;n<=67108863;n*=t)i++;i--,n=n/t|0;for(var o=e.length-r,s=o%i,a=Math.min(o,o-s)+r,c=0,h=r;h<a;h+=i)c=u(e,h,h+i,t),this.imuln(n),this.words[0]+c<67108864?this.words[0]+=c:this._iaddn(c);if(0!==s){var d=1;for(c=u(e,h,e.length,t),h=0;h<s;h++)d*=t;this.imuln(d),this.words[0]+c<67108864?this.words[0]+=c:this._iaddn(c)}this._strip()},o.prototype.copy=function(e){e.words=new Array(this.length);for(var t=0;t<this.length;t++)e.words[t]=this.words[t];e.length=this.length,e.negative=this.negative,e.red=this.red},o.prototype._move=function(e){h(e,this)},o.prototype.clone=function(){var e=new o(null);return this.copy(e),e},o.prototype._expand=function(e){for(;this.length<e;)this.words[this.length++]=0;return this},o.prototype._strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!=typeof Symbol&&"function"==typeof Symbol.for)try{o.prototype[Symbol.for("nodejs.util.inspect.custom")]=d}catch(e){o.prototype.inspect=d}else o.prototype.inspect=d;function d(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var l=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],p=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],f=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function v(e,t,r){r.negative=t.negative^e.negative;var i=e.length+t.length|0;r.length=i,i=i-1|0;var n=0|e.words[0],o=0|t.words[0],s=n*o,a=67108863&s,c=s/67108864|0;r.words[0]=a;for(var u=1;u<i;u++){for(var h=c>>>26,d=67108863&c,l=Math.min(u,t.length-1),p=Math.max(0,u-e.length+1);p<=l;p++){var f=u-p|0;h+=(s=(n=0|e.words[f])*(o=0|t.words[p])+d)/67108864|0,d=67108863&s}r.words[u]=0|d,c=0|h}return 0!==c?r.words[u]=0|c:r.length--,r._strip()}o.prototype.toString=function(e,t){var r;if(t=0|t||1,16===(e=e||10)||"hex"===e){r="";for(var n=0,o=0,s=0;s<this.length;s++){var a=this.words[s],c=(16777215&(a<<n|o)).toString(16);o=a>>>24-n&16777215,(n+=2)>=26&&(n-=26,s--),r=0!==o||s!==this.length-1?l[6-c.length]+c+r:c+r}for(0!==o&&(r=o.toString(16)+r);r.length%t!==0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&e>=2&&e<=36){var u=p[e],h=f[e];r="";var d=this.clone();for(d.negative=0;!d.isZero();){var v=d.modrn(h).toString(e);r=(d=d.idivn(h)).isZero()?v+r:l[u-v.length]+v+r}for(this.isZero()&&(r="0"+r);r.length%t!==0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}i(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&i(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},o.prototype.toJSON=function(){return this.toString(16,2)},s&&(o.prototype.toBuffer=function(e,t){return this.toArrayLike(s,e,t)}),o.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},o.prototype.toArrayLike=function(e,t,r){this._strip();var n=this.byteLength(),o=r||Math.max(1,n);i(n<=o,"byte array longer than desired length"),i(o>0,"Requested array length <= 0");var s=function(e,t){return e.allocUnsafe?e.allocUnsafe(t):new e(t)}(e,o);return this["_toArrayLike"+("le"===t?"LE":"BE")](s,n),s},o.prototype._toArrayLikeLE=function(e,t){for(var r=0,i=0,n=0,o=0;n<this.length;n++){var s=this.words[n]<<o|i;e[r++]=255&s,r<e.length&&(e[r++]=s>>8&255),r<e.length&&(e[r++]=s>>16&255),6===o?(r<e.length&&(e[r++]=s>>24&255),i=0,o=0):(i=s>>>24,o+=2)}if(r<e.length)for(e[r++]=i;r<e.length;)e[r++]=0},o.prototype._toArrayLikeBE=function(e,t){for(var r=e.length-1,i=0,n=0,o=0;n<this.length;n++){var s=this.words[n]<<o|i;e[r--]=255&s,r>=0&&(e[r--]=s>>8&255),r>=0&&(e[r--]=s>>16&255),6===o?(r>=0&&(e[r--]=s>>24&255),i=0,o=0):(i=s>>>24,o+=2)}if(r>=0)for(e[r--]=i;r>=0;)e[r--]=0},Math.clz32?o.prototype._countBits=function(e){return 32-Math.clz32(e)}:o.prototype._countBits=function(e){var t=e,r=0;return t>=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},o.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 8191&t||(r+=13,t>>>=13),127&t||(r+=7,t>>>=7),15&t||(r+=4,t>>>=4),3&t||(r+=2,t>>>=2),1&t||r++,r},o.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;t<this.length;t++){var r=this._zeroBits(this.words[t]);if(e+=r,26!==r)break}return e},o.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},o.prototype.toTwos=function(e){return 0!==this.negative?this.abs().inotn(e).iaddn(1):this.clone()},o.prototype.fromTwos=function(e){return this.testn(e-1)?this.notn(e).iaddn(1).ineg():this.clone()},o.prototype.isNeg=function(){return 0!==this.negative},o.prototype.neg=function(){return this.clone().ineg()},o.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},o.prototype.iuor=function(e){for(;this.length<e.length;)this.words[this.length++]=0;for(var t=0;t<e.length;t++)this.words[t]=this.words[t]|e.words[t];return this._strip()},o.prototype.ior=function(e){return i(0===(this.negative|e.negative)),this.iuor(e)},o.prototype.or=function(e){return this.length>e.length?this.clone().ior(e):e.clone().ior(this)},o.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},o.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;r<t.length;r++)this.words[r]=this.words[r]&e.words[r];return this.length=t.length,this._strip()},o.prototype.iand=function(e){return i(0===(this.negative|e.negative)),this.iuand(e)},o.prototype.and=function(e){return this.length>e.length?this.clone().iand(e):e.clone().iand(this)},o.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},o.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var i=0;i<r.length;i++)this.words[i]=t.words[i]^r.words[i];if(this!==t)for(;i<t.length;i++)this.words[i]=t.words[i];return this.length=t.length,this._strip()},o.prototype.ixor=function(e){return i(0===(this.negative|e.negative)),this.iuxor(e)},o.prototype.xor=function(e){return this.length>e.length?this.clone().ixor(e):e.clone().ixor(this)},o.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},o.prototype.inotn=function(e){i("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),r>0&&t--;for(var n=0;n<t;n++)this.words[n]=67108863&~this.words[n];return r>0&&(this.words[n]=~this.words[n]&67108863>>26-r),this._strip()},o.prototype.notn=function(e){return this.clone().inotn(e)},o.prototype.setn=function(e,t){i("number"==typeof e&&e>=0);var r=e/26|0,n=e%26;return this._expand(r+1),this.words[r]=t?this.words[r]|1<<n:this.words[r]&~(1<<n),this._strip()},o.prototype.iadd=function(e){var t,r,i;if(0!==this.negative&&0===e.negative)return this.negative=0,t=this.isub(e),this.negative^=1,this._normSign();if(0===this.negative&&0!==e.negative)return e.negative=0,t=this.isub(e),e.negative=1,t._normSign();this.length>e.length?(r=this,i=e):(r=e,i=this);for(var n=0,o=0;o<i.length;o++)t=(0|r.words[o])+(0|i.words[o])+n,this.words[o]=67108863&t,n=t>>>26;for(;0!==n&&o<r.length;o++)t=(0|r.words[o])+n,this.words[o]=67108863&t,n=t>>>26;if(this.length=r.length,0!==n)this.words[this.length]=n,this.length++;else if(r!==this)for(;o<r.length;o++)this.words[o]=r.words[o];return this},o.prototype.add=function(e){var t;return 0!==e.negative&&0===this.negative?(e.negative=0,t=this.sub(e),e.negative^=1,t):0===e.negative&&0!==this.negative?(this.negative=0,t=e.sub(this),this.negative=1,t):this.length>e.length?this.clone().iadd(e):e.clone().iadd(this)},o.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var r,i,n=this.cmp(e);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(r=this,i=e):(r=e,i=this);for(var o=0,s=0;s<i.length;s++)o=(t=(0|r.words[s])-(0|i.words[s])+o)>>26,this.words[s]=67108863&t;for(;0!==o&&s<r.length;s++)o=(t=(0|r.words[s])+o)>>26,this.words[s]=67108863&t;if(0===o&&s<r.length&&r!==this)for(;s<r.length;s++)this.words[s]=r.words[s];return this.length=Math.max(this.length,s),r!==this&&(this.negative=1),this._strip()},o.prototype.sub=function(e){return this.clone().isub(e)};var g=function(e,t,r){var i,n,o,s=e.words,a=t.words,c=r.words,u=0,h=0|s[0],d=8191&h,l=h>>>13,p=0|s[1],f=8191&p,v=p>>>13,g=0|s[2],m=8191&g,y=g>>>13,b=0|s[3],S=8191&b,C=b>>>13,w=0|s[4],P=8191&w,A=w>>>13,I=0|s[5],R=8191&I,E=I>>>13,T=0|s[6],M=8191&T,k=T>>>13,O=0|s[7],_=8191&O,x=O>>>13,N=0|s[8],D=8191&N,z=N>>>13,L=0|s[9],B=8191&L,F=L>>>13,j=0|a[0],U=8191&j,q=j>>>13,W=0|a[1],K=8191&W,H=W>>>13,V=0|a[2],G=8191&V,J=V>>>13,$=0|a[3],Q=8191&$,Y=$>>>13,X=0|a[4],Z=8191&X,ee=X>>>13,te=0|a[5],re=8191&te,ie=te>>>13,ne=0|a[6],oe=8191&ne,se=ne>>>13,ae=0|a[7],ce=8191&ae,ue=ae>>>13,he=0|a[8],de=8191&he,le=he>>>13,pe=0|a[9],fe=8191&pe,ve=pe>>>13;r.negative=e.negative^t.negative,r.length=19;var ge=(u+(i=Math.imul(d,U))|0)+((8191&(n=(n=Math.imul(d,q))+Math.imul(l,U)|0))<<13)|0;u=((o=Math.imul(l,q))+(n>>>13)|0)+(ge>>>26)|0,ge&=67108863,i=Math.imul(f,U),n=(n=Math.imul(f,q))+Math.imul(v,U)|0,o=Math.imul(v,q);var me=(u+(i=i+Math.imul(d,K)|0)|0)+((8191&(n=(n=n+Math.imul(d,H)|0)+Math.imul(l,K)|0))<<13)|0;u=((o=o+Math.imul(l,H)|0)+(n>>>13)|0)+(me>>>26)|0,me&=67108863,i=Math.imul(m,U),n=(n=Math.imul(m,q))+Math.imul(y,U)|0,o=Math.imul(y,q),i=i+Math.imul(f,K)|0,n=(n=n+Math.imul(f,H)|0)+Math.imul(v,K)|0,o=o+Math.imul(v,H)|0;var ye=(u+(i=i+Math.imul(d,G)|0)|0)+((8191&(n=(n=n+Math.imul(d,J)|0)+Math.imul(l,G)|0))<<13)|0;u=((o=o+Math.imul(l,J)|0)+(n>>>13)|0)+(ye>>>26)|0,ye&=67108863,i=Math.imul(S,U),n=(n=Math.imul(S,q))+Math.imul(C,U)|0,o=Math.imul(C,q),i=i+Math.imul(m,K)|0,n=(n=n+Math.imul(m,H)|0)+Math.imul(y,K)|0,o=o+Math.imul(y,H)|0,i=i+Math.imul(f,G)|0,n=(n=n+Math.imul(f,J)|0)+Math.imul(v,G)|0,o=o+Math.imul(v,J)|0;var be=(u+(i=i+Math.imul(d,Q)|0)|0)+((8191&(n=(n=n+Math.imul(d,Y)|0)+Math.imul(l,Q)|0))<<13)|0;u=((o=o+Math.imul(l,Y)|0)+(n>>>13)|0)+(be>>>26)|0,be&=67108863,i=Math.imul(P,U),n=(n=Math.imul(P,q))+Math.imul(A,U)|0,o=Math.imul(A,q),i=i+Math.imul(S,K)|0,n=(n=n+Math.imul(S,H)|0)+Math.imul(C,K)|0,o=o+Math.imul(C,H)|0,i=i+Math.imul(m,G)|0,n=(n=n+Math.imul(m,J)|0)+Math.imul(y,G)|0,o=o+Math.imul(y,J)|0,i=i+Math.imul(f,Q)|0,n=(n=n+Math.imul(f,Y)|0)+Math.imul(v,Q)|0,o=o+Math.imul(v,Y)|0;var Se=(u+(i=i+Math.imul(d,Z)|0)|0)+((8191&(n=(n=n+Math.imul(d,ee)|0)+Math.imul(l,Z)|0))<<13)|0;u=((o=o+Math.imul(l,ee)|0)+(n>>>13)|0)+(Se>>>26)|0,Se&=67108863,i=Math.imul(R,U),n=(n=Math.imul(R,q))+Math.imul(E,U)|0,o=Math.imul(E,q),i=i+Math.imul(P,K)|0,n=(n=n+Math.imul(P,H)|0)+Math.imul(A,K)|0,o=o+Math.imul(A,H)|0,i=i+Math.imul(S,G)|0,n=(n=n+Math.imul(S,J)|0)+Math.imul(C,G)|0,o=o+Math.imul(C,J)|0,i=i+Math.imul(m,Q)|0,n=(n=n+Math.imul(m,Y)|0)+Math.imul(y,Q)|0,o=o+Math.imul(y,Y)|0,i=i+Math.imul(f,Z)|0,n=(n=n+Math.imul(f,ee)|0)+Math.imul(v,Z)|0,o=o+Math.imul(v,ee)|0;var Ce=(u+(i=i+Math.imul(d,re)|0)|0)+((8191&(n=(n=n+Math.imul(d,ie)|0)+Math.imul(l,re)|0))<<13)|0;u=((o=o+Math.imul(l,ie)|0)+(n>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,i=Math.imul(M,U),n=(n=Math.imul(M,q))+Math.imul(k,U)|0,o=Math.imul(k,q),i=i+Math.imul(R,K)|0,n=(n=n+Math.imul(R,H)|0)+Math.imul(E,K)|0,o=o+Math.imul(E,H)|0,i=i+Math.imul(P,G)|0,n=(n=n+Math.imul(P,J)|0)+Math.imul(A,G)|0,o=o+Math.imul(A,J)|0,i=i+Math.imul(S,Q)|0,n=(n=n+Math.imul(S,Y)|0)+Math.imul(C,Q)|0,o=o+Math.imul(C,Y)|0,i=i+Math.imul(m,Z)|0,n=(n=n+Math.imul(m,ee)|0)+Math.imul(y,Z)|0,o=o+Math.imul(y,ee)|0,i=i+Math.imul(f,re)|0,n=(n=n+Math.imul(f,ie)|0)+Math.imul(v,re)|0,o=o+Math.imul(v,ie)|0;var we=(u+(i=i+Math.imul(d,oe)|0)|0)+((8191&(n=(n=n+Math.imul(d,se)|0)+Math.imul(l,oe)|0))<<13)|0;u=((o=o+Math.imul(l,se)|0)+(n>>>13)|0)+(we>>>26)|0,we&=67108863,i=Math.imul(_,U),n=(n=Math.imul(_,q))+Math.imul(x,U)|0,o=Math.imul(x,q),i=i+Math.imul(M,K)|0,n=(n=n+Math.imul(M,H)|0)+Math.imul(k,K)|0,o=o+Math.imul(k,H)|0,i=i+Math.imul(R,G)|0,n=(n=n+Math.imul(R,J)|0)+Math.imul(E,G)|0,o=o+Math.imul(E,J)|0,i=i+Math.imul(P,Q)|0,n=(n=n+Math.imul(P,Y)|0)+Math.imul(A,Q)|0,o=o+Math.imul(A,Y)|0,i=i+Math.imul(S,Z)|0,n=(n=n+Math.imul(S,ee)|0)+Math.imul(C,Z)|0,o=o+Math.imul(C,ee)|0,i=i+Math.imul(m,re)|0,n=(n=n+Math.imul(m,ie)|0)+Math.imul(y,re)|0,o=o+Math.imul(y,ie)|0,i=i+Math.imul(f,oe)|0,n=(n=n+Math.imul(f,se)|0)+Math.imul(v,oe)|0,o=o+Math.imul(v,se)|0;var Pe=(u+(i=i+Math.imul(d,ce)|0)|0)+((8191&(n=(n=n+Math.imul(d,ue)|0)+Math.imul(l,ce)|0))<<13)|0;u=((o=o+Math.imul(l,ue)|0)+(n>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,i=Math.imul(D,U),n=(n=Math.imul(D,q))+Math.imul(z,U)|0,o=Math.imul(z,q),i=i+Math.imul(_,K)|0,n=(n=n+Math.imul(_,H)|0)+Math.imul(x,K)|0,o=o+Math.imul(x,H)|0,i=i+Math.imul(M,G)|0,n=(n=n+Math.imul(M,J)|0)+Math.imul(k,G)|0,o=o+Math.imul(k,J)|0,i=i+Math.imul(R,Q)|0,n=(n=n+Math.imul(R,Y)|0)+Math.imul(E,Q)|0,o=o+Math.imul(E,Y)|0,i=i+Math.imul(P,Z)|0,n=(n=n+Math.imul(P,ee)|0)+Math.imul(A,Z)|0,o=o+Math.imul(A,ee)|0,i=i+Math.imul(S,re)|0,n=(n=n+Math.imul(S,ie)|0)+Math.imul(C,re)|0,o=o+Math.imul(C,ie)|0,i=i+Math.imul(m,oe)|0,n=(n=n+Math.imul(m,se)|0)+Math.imul(y,oe)|0,o=o+Math.imul(y,se)|0,i=i+Math.imul(f,ce)|0,n=(n=n+Math.imul(f,ue)|0)+Math.imul(v,ce)|0,o=o+Math.imul(v,ue)|0;var Ae=(u+(i=i+Math.imul(d,de)|0)|0)+((8191&(n=(n=n+Math.imul(d,le)|0)+Math.imul(l,de)|0))<<13)|0;u=((o=o+Math.imul(l,le)|0)+(n>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,i=Math.imul(B,U),n=(n=Math.imul(B,q))+Math.imul(F,U)|0,o=Math.imul(F,q),i=i+Math.imul(D,K)|0,n=(n=n+Math.imul(D,H)|0)+Math.imul(z,K)|0,o=o+Math.imul(z,H)|0,i=i+Math.imul(_,G)|0,n=(n=n+Math.imul(_,J)|0)+Math.imul(x,G)|0,o=o+Math.imul(x,J)|0,i=i+Math.imul(M,Q)|0,n=(n=n+Math.imul(M,Y)|0)+Math.imul(k,Q)|0,o=o+Math.imul(k,Y)|0,i=i+Math.imul(R,Z)|0,n=(n=n+Math.imul(R,ee)|0)+Math.imul(E,Z)|0,o=o+Math.imul(E,ee)|0,i=i+Math.imul(P,re)|0,n=(n=n+Math.imul(P,ie)|0)+Math.imul(A,re)|0,o=o+Math.imul(A,ie)|0,i=i+Math.imul(S,oe)|0,n=(n=n+Math.imul(S,se)|0)+Math.imul(C,oe)|0,o=o+Math.imul(C,se)|0,i=i+Math.imul(m,ce)|0,n=(n=n+Math.imul(m,ue)|0)+Math.imul(y,ce)|0,o=o+Math.imul(y,ue)|0,i=i+Math.imul(f,de)|0,n=(n=n+Math.imul(f,le)|0)+Math.imul(v,de)|0,o=o+Math.imul(v,le)|0;var Ie=(u+(i=i+Math.imul(d,fe)|0)|0)+((8191&(n=(n=n+Math.imul(d,ve)|0)+Math.imul(l,fe)|0))<<13)|0;u=((o=o+Math.imul(l,ve)|0)+(n>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,i=Math.imul(B,K),n=(n=Math.imul(B,H))+Math.imul(F,K)|0,o=Math.imul(F,H),i=i+Math.imul(D,G)|0,n=(n=n+Math.imul(D,J)|0)+Math.imul(z,G)|0,o=o+Math.imul(z,J)|0,i=i+Math.imul(_,Q)|0,n=(n=n+Math.imul(_,Y)|0)+Math.imul(x,Q)|0,o=o+Math.imul(x,Y)|0,i=i+Math.imul(M,Z)|0,n=(n=n+Math.imul(M,ee)|0)+Math.imul(k,Z)|0,o=o+Math.imul(k,ee)|0,i=i+Math.imul(R,re)|0,n=(n=n+Math.imul(R,ie)|0)+Math.imul(E,re)|0,o=o+Math.imul(E,ie)|0,i=i+Math.imul(P,oe)|0,n=(n=n+Math.imul(P,se)|0)+Math.imul(A,oe)|0,o=o+Math.imul(A,se)|0,i=i+Math.imul(S,ce)|0,n=(n=n+Math.imul(S,ue)|0)+Math.imul(C,ce)|0,o=o+Math.imul(C,ue)|0,i=i+Math.imul(m,de)|0,n=(n=n+Math.imul(m,le)|0)+Math.imul(y,de)|0,o=o+Math.imul(y,le)|0;var Re=(u+(i=i+Math.imul(f,fe)|0)|0)+((8191&(n=(n=n+Math.imul(f,ve)|0)+Math.imul(v,fe)|0))<<13)|0;u=((o=o+Math.imul(v,ve)|0)+(n>>>13)|0)+(Re>>>26)|0,Re&=67108863,i=Math.imul(B,G),n=(n=Math.imul(B,J))+Math.imul(F,G)|0,o=Math.imul(F,J),i=i+Math.imul(D,Q)|0,n=(n=n+Math.imul(D,Y)|0)+Math.imul(z,Q)|0,o=o+Math.imul(z,Y)|0,i=i+Math.imul(_,Z)|0,n=(n=n+Math.imul(_,ee)|0)+Math.imul(x,Z)|0,o=o+Math.imul(x,ee)|0,i=i+Math.imul(M,re)|0,n=(n=n+Math.imul(M,ie)|0)+Math.imul(k,re)|0,o=o+Math.imul(k,ie)|0,i=i+Math.imul(R,oe)|0,n=(n=n+Math.imul(R,se)|0)+Math.imul(E,oe)|0,o=o+Math.imul(E,se)|0,i=i+Math.imul(P,ce)|0,n=(n=n+Math.imul(P,ue)|0)+Math.imul(A,ce)|0,o=o+Math.imul(A,ue)|0,i=i+Math.imul(S,de)|0,n=(n=n+Math.imul(S,le)|0)+Math.imul(C,de)|0,o=o+Math.imul(C,le)|0;var Ee=(u+(i=i+Math.imul(m,fe)|0)|0)+((8191&(n=(n=n+Math.imul(m,ve)|0)+Math.imul(y,fe)|0))<<13)|0;u=((o=o+Math.imul(y,ve)|0)+(n>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,i=Math.imul(B,Q),n=(n=Math.imul(B,Y))+Math.imul(F,Q)|0,o=Math.imul(F,Y),i=i+Math.imul(D,Z)|0,n=(n=n+Math.imul(D,ee)|0)+Math.imul(z,Z)|0,o=o+Math.imul(z,ee)|0,i=i+Math.imul(_,re)|0,n=(n=n+Math.imul(_,ie)|0)+Math.imul(x,re)|0,o=o+Math.imul(x,ie)|0,i=i+Math.imul(M,oe)|0,n=(n=n+Math.imul(M,se)|0)+Math.imul(k,oe)|0,o=o+Math.imul(k,se)|0,i=i+Math.imul(R,ce)|0,n=(n=n+Math.imul(R,ue)|0)+Math.imul(E,ce)|0,o=o+Math.imul(E,ue)|0,i=i+Math.imul(P,de)|0,n=(n=n+Math.imul(P,le)|0)+Math.imul(A,de)|0,o=o+Math.imul(A,le)|0;var Te=(u+(i=i+Math.imul(S,fe)|0)|0)+((8191&(n=(n=n+Math.imul(S,ve)|0)+Math.imul(C,fe)|0))<<13)|0;u=((o=o+Math.imul(C,ve)|0)+(n>>>13)|0)+(Te>>>26)|0,Te&=67108863,i=Math.imul(B,Z),n=(n=Math.imul(B,ee))+Math.imul(F,Z)|0,o=Math.imul(F,ee),i=i+Math.imul(D,re)|0,n=(n=n+Math.imul(D,ie)|0)+Math.imul(z,re)|0,o=o+Math.imul(z,ie)|0,i=i+Math.imul(_,oe)|0,n=(n=n+Math.imul(_,se)|0)+Math.imul(x,oe)|0,o=o+Math.imul(x,se)|0,i=i+Math.imul(M,ce)|0,n=(n=n+Math.imul(M,ue)|0)+Math.imul(k,ce)|0,o=o+Math.imul(k,ue)|0,i=i+Math.imul(R,de)|0,n=(n=n+Math.imul(R,le)|0)+Math.imul(E,de)|0,o=o+Math.imul(E,le)|0;var Me=(u+(i=i+Math.imul(P,fe)|0)|0)+((8191&(n=(n=n+Math.imul(P,ve)|0)+Math.imul(A,fe)|0))<<13)|0;u=((o=o+Math.imul(A,ve)|0)+(n>>>13)|0)+(Me>>>26)|0,Me&=67108863,i=Math.imul(B,re),n=(n=Math.imul(B,ie))+Math.imul(F,re)|0,o=Math.imul(F,ie),i=i+Math.imul(D,oe)|0,n=(n=n+Math.imul(D,se)|0)+Math.imul(z,oe)|0,o=o+Math.imul(z,se)|0,i=i+Math.imul(_,ce)|0,n=(n=n+Math.imul(_,ue)|0)+Math.imul(x,ce)|0,o=o+Math.imul(x,ue)|0,i=i+Math.imul(M,de)|0,n=(n=n+Math.imul(M,le)|0)+Math.imul(k,de)|0,o=o+Math.imul(k,le)|0;var ke=(u+(i=i+Math.imul(R,fe)|0)|0)+((8191&(n=(n=n+Math.imul(R,ve)|0)+Math.imul(E,fe)|0))<<13)|0;u=((o=o+Math.imul(E,ve)|0)+(n>>>13)|0)+(ke>>>26)|0,ke&=67108863,i=Math.imul(B,oe),n=(n=Math.imul(B,se))+Math.imul(F,oe)|0,o=Math.imul(F,se),i=i+Math.imul(D,ce)|0,n=(n=n+Math.imul(D,ue)|0)+Math.imul(z,ce)|0,o=o+Math.imul(z,ue)|0,i=i+Math.imul(_,de)|0,n=(n=n+Math.imul(_,le)|0)+Math.imul(x,de)|0,o=o+Math.imul(x,le)|0;var Oe=(u+(i=i+Math.imul(M,fe)|0)|0)+((8191&(n=(n=n+Math.imul(M,ve)|0)+Math.imul(k,fe)|0))<<13)|0;u=((o=o+Math.imul(k,ve)|0)+(n>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,i=Math.imul(B,ce),n=(n=Math.imul(B,ue))+Math.imul(F,ce)|0,o=Math.imul(F,ue),i=i+Math.imul(D,de)|0,n=(n=n+Math.imul(D,le)|0)+Math.imul(z,de)|0,o=o+Math.imul(z,le)|0;var _e=(u+(i=i+Math.imul(_,fe)|0)|0)+((8191&(n=(n=n+Math.imul(_,ve)|0)+Math.imul(x,fe)|0))<<13)|0;u=((o=o+Math.imul(x,ve)|0)+(n>>>13)|0)+(_e>>>26)|0,_e&=67108863,i=Math.imul(B,de),n=(n=Math.imul(B,le))+Math.imul(F,de)|0,o=Math.imul(F,le);var xe=(u+(i=i+Math.imul(D,fe)|0)|0)+((8191&(n=(n=n+Math.imul(D,ve)|0)+Math.imul(z,fe)|0))<<13)|0;u=((o=o+Math.imul(z,ve)|0)+(n>>>13)|0)+(xe>>>26)|0,xe&=67108863;var Ne=(u+(i=Math.imul(B,fe))|0)+((8191&(n=(n=Math.imul(B,ve))+Math.imul(F,fe)|0))<<13)|0;return u=((o=Math.imul(F,ve))+(n>>>13)|0)+(Ne>>>26)|0,Ne&=67108863,c[0]=ge,c[1]=me,c[2]=ye,c[3]=be,c[4]=Se,c[5]=Ce,c[6]=we,c[7]=Pe,c[8]=Ae,c[9]=Ie,c[10]=Re,c[11]=Ee,c[12]=Te,c[13]=Me,c[14]=ke,c[15]=Oe,c[16]=_e,c[17]=xe,c[18]=Ne,0!==u&&(c[19]=u,r.length++),r};function m(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var i=0,n=0,o=0;o<r.length-1;o++){var s=n;n=0;for(var a=67108863&i,c=Math.min(o,t.length-1),u=Math.max(0,o-e.length+1);u<=c;u++){var h=o-u,d=(0|e.words[h])*(0|t.words[u]),l=67108863&d;a=67108863&(l=l+a|0),n+=(s=(s=s+(d/67108864|0)|0)+(l>>>26)|0)>>>26,s&=67108863}r.words[o]=a,i=s,s=n}return 0!==i?r.words[o]=i:r.length--,r._strip()}function y(e,t,r){return m(e,t,r)}function b(e,t){this.x=e,this.y=t}Math.imul||(g=v),o.prototype.mulTo=function(e,t){var r=this.length+e.length;return 10===this.length&&10===e.length?g(this,e,t):r<63?v(this,e,t):r<1024?m(this,e,t):y(this,e,t)},b.prototype.makeRBT=function(e){for(var t=new Array(e),r=o.prototype._countBits(e)-1,i=0;i<e;i++)t[i]=this.revBin(i,r,e);return t},b.prototype.revBin=function(e,t,r){if(0===e||e===r-1)return e;for(var i=0,n=0;n<t;n++)i|=(1&e)<<t-n-1,e>>=1;return i},b.prototype.permute=function(e,t,r,i,n,o){for(var s=0;s<o;s++)i[s]=t[e[s]],n[s]=r[e[s]]},b.prototype.transform=function(e,t,r,i,n,o){this.permute(o,e,t,r,i,n);for(var s=1;s<n;s<<=1)for(var a=s<<1,c=Math.cos(2*Math.PI/a),u=Math.sin(2*Math.PI/a),h=0;h<n;h+=a)for(var d=c,l=u,p=0;p<s;p++){var f=r[h+p],v=i[h+p],g=r[h+p+s],m=i[h+p+s],y=d*g-l*m;m=d*m+l*g,g=y,r[h+p]=f+g,i[h+p]=v+m,r[h+p+s]=f-g,i[h+p+s]=v-m,p!==a&&(y=c*d-u*l,l=c*l+u*d,d=y)}},b.prototype.guessLen13b=function(e,t){var r=1|Math.max(t,e),i=1&r,n=0;for(r=r/2|0;r;r>>>=1)n++;return 1<<n+1+i},b.prototype.conjugate=function(e,t,r){if(!(r<=1))for(var i=0;i<r/2;i++){var n=e[i];e[i]=e[r-i-1],e[r-i-1]=n,n=t[i],t[i]=-t[r-i-1],t[r-i-1]=-n}},b.prototype.normalize13b=function(e,t){for(var r=0,i=0;i<t/2;i++){var n=8192*Math.round(e[2*i+1]/t)+Math.round(e[2*i]/t)+r;e[i]=67108863&n,r=n<67108864?0:n/67108864|0}return e},b.prototype.convert13b=function(e,t,r,n){for(var o=0,s=0;s<t;s++)o+=0|e[s],r[2*s]=8191&o,o>>>=13,r[2*s+1]=8191&o,o>>>=13;for(s=2*t;s<n;++s)r[s]=0;i(0===o),i(!(-8192&o))},b.prototype.stub=function(e){for(var t=new Array(e),r=0;r<e;r++)t[r]=0;return t},b.prototype.mulp=function(e,t,r){var i=2*this.guessLen13b(e.length,t.length),n=this.makeRBT(i),o=this.stub(i),s=new Array(i),a=new Array(i),c=new Array(i),u=new Array(i),h=new Array(i),d=new Array(i),l=r.words;l.length=i,this.convert13b(e.words,e.length,s,i),this.convert13b(t.words,t.length,u,i),this.transform(s,o,a,c,i,n),this.transform(u,o,h,d,i,n);for(var p=0;p<i;p++){var f=a[p]*h[p]-c[p]*d[p];c[p]=a[p]*d[p]+c[p]*h[p],a[p]=f}return this.conjugate(a,c,i),this.transform(a,c,l,o,i,n),this.conjugate(l,o,i),this.normalize13b(l,i),r.negative=e.negative^t.negative,r.length=e.length+t.length,r._strip()},o.prototype.mul=function(e){var t=new o(null);return t.words=new Array(this.length+e.length),this.mulTo(e,t)},o.prototype.mulf=function(e){var t=new o(null);return t.words=new Array(this.length+e.length),y(this,e,t)},o.prototype.imul=function(e){return this.clone().mulTo(e,this)},o.prototype.imuln=function(e){var t=e<0;t&&(e=-e),i("number"==typeof e),i(e<67108864);for(var r=0,n=0;n<this.length;n++){var o=(0|this.words[n])*e,s=(67108863&o)+(67108863&r);r>>=26,r+=o/67108864|0,r+=s>>>26,this.words[n]=67108863&s}return 0!==r&&(this.words[n]=r,this.length++),this.length=0===e?1:this.length,t?this.ineg():this},o.prototype.muln=function(e){return this.clone().imuln(e)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),r=0;r<t.length;r++){var i=r/26|0,n=r%26;t[r]=e.words[i]>>>n&1}return t}(e);if(0===t.length)return new o(1);for(var r=this,i=0;i<t.length&&0===t[i];i++,r=r.sqr());if(++i<t.length)for(var n=r.sqr();i<t.length;i++,n=n.sqr())0!==t[i]&&(r=r.mul(n));return r},o.prototype.iushln=function(e){i("number"==typeof e&&e>=0);var t,r=e%26,n=(e-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var s=0;for(t=0;t<this.length;t++){var a=this.words[t]&o,c=(0|this.words[t])-a<<r;this.words[t]=c|s,s=a>>>26-r}s&&(this.words[t]=s,this.length++)}if(0!==n){for(t=this.length-1;t>=0;t--)this.words[t+n]=this.words[t];for(t=0;t<n;t++)this.words[t]=0;this.length+=n}return this._strip()},o.prototype.ishln=function(e){return i(0===this.negative),this.iushln(e)},o.prototype.iushrn=function(e,t,r){var n;i("number"==typeof e&&e>=0),n=t?(t-t%26)/26:0;var o=e%26,s=Math.min((e-o)/26,this.length),a=67108863^67108863>>>o<<o,c=r;if(n-=s,n=Math.max(0,n),c){for(var u=0;u<s;u++)c.words[u]=this.words[u];c.length=s}if(0===s);else if(this.length>s)for(this.length-=s,u=0;u<this.length;u++)this.words[u]=this.words[u+s];else this.words[0]=0,this.length=1;var h=0;for(u=this.length-1;u>=0&&(0!==h||u>=n);u--){var d=0|this.words[u];this.words[u]=h<<26-o|d>>>o,h=d&a}return c&&0!==h&&(c.words[c.length++]=h),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},o.prototype.ishrn=function(e,t,r){return i(0===this.negative),this.iushrn(e,t,r)},o.prototype.shln=function(e){return this.clone().ishln(e)},o.prototype.ushln=function(e){return this.clone().iushln(e)},o.prototype.shrn=function(e){return this.clone().ishrn(e)},o.prototype.ushrn=function(e){return this.clone().iushrn(e)},o.prototype.testn=function(e){i("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26,n=1<<t;return!(this.length<=r||!(this.words[r]&n))},o.prototype.imaskn=function(e){i("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26;if(i(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==t&&r++,this.length=Math.min(r,this.length),0!==t){var n=67108863^67108863>>>t<<t;this.words[this.length-1]&=n}return this._strip()},o.prototype.maskn=function(e){return this.clone().imaskn(e)},o.prototype.iaddn=function(e){return i("number"==typeof e),i(e<67108864),e<0?this.isubn(-e):0!==this.negative?1===this.length&&(0|this.words[0])<=e?(this.words[0]=e-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(e),this.negative=1,this):this._iaddn(e)},o.prototype._iaddn=function(e){this.words[0]+=e;for(var t=0;t<this.length&&this.words[t]>=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},o.prototype.isubn=function(e){if(i("number"==typeof e),i(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t<this.length&&this.words[t]<0;t++)this.words[t]+=67108864,this.words[t+1]-=1;return this._strip()},o.prototype.addn=function(e){return this.clone().iaddn(e)},o.prototype.subn=function(e){return this.clone().isubn(e)},o.prototype.iabs=function(){return this.negative=0,this},o.prototype.abs=function(){return this.clone().iabs()},o.prototype._ishlnsubmul=function(e,t,r){var n,o,s=e.length+r;this._expand(s);var a=0;for(n=0;n<e.length;n++){o=(0|this.words[n+r])+a;var c=(0|e.words[n])*t;a=((o-=67108863&c)>>26)-(c/67108864|0),this.words[n+r]=67108863&o}for(;n<this.length-r;n++)a=(o=(0|this.words[n+r])+a)>>26,this.words[n+r]=67108863&o;if(0===a)return this._strip();for(i(-1===a),a=0,n=0;n<this.length;n++)a=(o=-(0|this.words[n])+a)>>26,this.words[n]=67108863&o;return this.negative=1,this._strip()},o.prototype._wordDiv=function(e,t){var r=(this.length,e.length),i=this.clone(),n=e,s=0|n.words[n.length-1];0!=(r=26-this._countBits(s))&&(n=n.ushln(r),i.iushln(r),s=0|n.words[n.length-1]);var a,c=i.length-n.length;if("mod"!==t){(a=new o(null)).length=c+1,a.words=new Array(a.length);for(var u=0;u<a.length;u++)a.words[u]=0}var h=i.clone()._ishlnsubmul(n,1,c);0===h.negative&&(i=h,a&&(a.words[c]=1));for(var d=c-1;d>=0;d--){var l=67108864*(0|i.words[n.length+d])+(0|i.words[n.length+d-1]);for(l=Math.min(l/s|0,67108863),i._ishlnsubmul(n,l,d);0!==i.negative;)l--,i.negative=0,i._ishlnsubmul(n,1,d),i.isZero()||(i.negative^=1);a&&(a.words[d]=l)}return a&&a._strip(),i._strip(),"div"!==t&&0!==r&&i.iushrn(r),{div:a||null,mod:i}},o.prototype.divmod=function(e,t,r){return i(!e.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===e.negative?(a=this.neg().divmod(e,t),"mod"!==t&&(n=a.div.neg()),"div"!==t&&(s=a.mod.neg(),r&&0!==s.negative&&s.iadd(e)),{div:n,mod:s}):0===this.negative&&0!==e.negative?(a=this.divmod(e.neg(),t),"mod"!==t&&(n=a.div.neg()),{div:n,mod:a.mod}):0!==(this.negative&e.negative)?(a=this.neg().divmod(e.neg(),t),"div"!==t&&(s=a.mod.neg(),r&&0!==s.negative&&s.isub(e)),{div:a.div,mod:s}):e.length>this.length||this.cmp(e)<0?{div:new o(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new o(this.modrn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new o(this.modrn(e.words[0]))}:this._wordDiv(e,t);var n,s,a},o.prototype.div=function(e){return this.divmod(e,"div",!1).div},o.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},o.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},o.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,i=e.ushrn(1),n=e.andln(1),o=r.cmp(i);return o<0||1===n&&0===o?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},o.prototype.modrn=function(e){var t=e<0;t&&(e=-e),i(e<=67108863);for(var r=(1<<26)%e,n=0,o=this.length-1;o>=0;o--)n=(r*n+(0|this.words[o]))%e;return t?-n:n},o.prototype.modn=function(e){return this.modrn(e)},o.prototype.idivn=function(e){var t=e<0;t&&(e=-e),i(e<=67108863);for(var r=0,n=this.length-1;n>=0;n--){var o=(0|this.words[n])+67108864*r;this.words[n]=o/e|0,r=o%e}return this._strip(),t?this.ineg():this},o.prototype.divn=function(e){return this.clone().idivn(e)},o.prototype.egcd=function(e){i(0===e.negative),i(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var n=new o(1),s=new o(0),a=new o(0),c=new o(1),u=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++u;for(var h=r.clone(),d=t.clone();!t.isZero();){for(var l=0,p=1;0===(t.words[0]&p)&&l<26;++l,p<<=1);if(l>0)for(t.iushrn(l);l-- >0;)(n.isOdd()||s.isOdd())&&(n.iadd(h),s.isub(d)),n.iushrn(1),s.iushrn(1);for(var f=0,v=1;0===(r.words[0]&v)&&f<26;++f,v<<=1);if(f>0)for(r.iushrn(f);f-- >0;)(a.isOdd()||c.isOdd())&&(a.iadd(h),c.isub(d)),a.iushrn(1),c.iushrn(1);t.cmp(r)>=0?(t.isub(r),n.isub(a),s.isub(c)):(r.isub(t),a.isub(n),c.isub(s))}return{a,b:c,gcd:r.iushln(u)}},o.prototype._invmp=function(e){i(0===e.negative),i(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var n,s=new o(1),a=new o(0),c=r.clone();t.cmpn(1)>0&&r.cmpn(1)>0;){for(var u=0,h=1;0===(t.words[0]&h)&&u<26;++u,h<<=1);if(u>0)for(t.iushrn(u);u-- >0;)s.isOdd()&&s.iadd(c),s.iushrn(1);for(var d=0,l=1;0===(r.words[0]&l)&&d<26;++d,l<<=1);if(d>0)for(r.iushrn(d);d-- >0;)a.isOdd()&&a.iadd(c),a.iushrn(1);t.cmp(r)>=0?(t.isub(r),s.isub(a)):(r.isub(t),a.isub(s))}return(n=0===t.cmpn(1)?s:a).cmpn(0)<0&&n.iadd(e),n},o.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var i=0;t.isEven()&&r.isEven();i++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var n=t.cmp(r);if(n<0){var o=t;t=r,r=o}else if(0===n||0===r.cmpn(1))break;t.isub(r)}return r.iushln(i)},o.prototype.invm=function(e){return this.egcd(e).a.umod(e)},o.prototype.isEven=function(){return!(1&this.words[0])},o.prototype.isOdd=function(){return!(1&~this.words[0])},o.prototype.andln=function(e){return this.words[0]&e},o.prototype.bincn=function(e){i("number"==typeof e);var t=e%26,r=(e-t)/26,n=1<<t;if(this.length<=r)return this._expand(r+1),this.words[r]|=n,this;for(var o=n,s=r;0!==o&&s<this.length;s++){var a=0|this.words[s];o=(a+=o)>>>26,a&=67108863,this.words[s]=a}return 0!==o&&(this.words[s]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(e){var t,r=e<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this._strip(),this.length>1)t=1;else{r&&(e=-e),i(e<=67108863,"Number is too big");var n=0|this.words[0];t=n===e?0:n<e?-1:1}return 0!==this.negative?0|-t:t},o.prototype.cmp=function(e){if(0!==this.negative&&0===e.negative)return-1;if(0===this.negative&&0!==e.negative)return 1;var t=this.ucmp(e);return 0!==this.negative?0|-t:t},o.prototype.ucmp=function(e){if(this.length>e.length)return 1;if(this.length<e.length)return-1;for(var t=0,r=this.length-1;r>=0;r--){var i=0|this.words[r],n=0|e.words[r];if(i!==n){i<n?t=-1:i>n&&(t=1);break}}return t},o.prototype.gtn=function(e){return 1===this.cmpn(e)},o.prototype.gt=function(e){return 1===this.cmp(e)},o.prototype.gten=function(e){return this.cmpn(e)>=0},o.prototype.gte=function(e){return this.cmp(e)>=0},o.prototype.ltn=function(e){return-1===this.cmpn(e)},o.prototype.lt=function(e){return-1===this.cmp(e)},o.prototype.lten=function(e){return this.cmpn(e)<=0},o.prototype.lte=function(e){return this.cmp(e)<=0},o.prototype.eqn=function(e){return 0===this.cmpn(e)},o.prototype.eq=function(e){return 0===this.cmp(e)},o.red=function(e){return new R(e)},o.prototype.toRed=function(e){return i(!this.red,"Already a number in reduction context"),i(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},o.prototype.fromRed=function(){return i(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(e){return this.red=e,this},o.prototype.forceRed=function(e){return i(!this.red,"Already a number in reduction context"),this._forceRed(e)},o.prototype.redAdd=function(e){return i(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},o.prototype.redIAdd=function(e){return i(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},o.prototype.redSub=function(e){return i(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},o.prototype.redISub=function(e){return i(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},o.prototype.redShl=function(e){return i(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},o.prototype.redMul=function(e){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},o.prototype.redIMul=function(e){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},o.prototype.redSqr=function(){return i(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return i(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return i(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return i(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return i(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(e){return i(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var S={k256:null,p224:null,p192:null,p25519:null};function C(e,t){this.name=e,this.p=new o(t,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function w(){C.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function P(){C.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function A(){C.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function I(){C.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function R(e){if("string"==typeof e){var t=o._prime(e);this.m=t.p,this.prime=t}else i(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function E(e){R.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}C.prototype._tmp=function(){var e=new o(null);return e.words=new Array(Math.ceil(this.n/13)),e},C.prototype.ireduce=function(e){var t,r=e;do{this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(t>this.n);var i=t<this.n?-1:r.ucmp(this.p);return 0===i?(r.words[0]=0,r.length=1):i>0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},C.prototype.split=function(e,t){e.iushrn(this.n,0,t)},C.prototype.imulK=function(e){return e.imul(this.k)},n(w,C),w.prototype.split=function(e,t){for(var r=4194303,i=Math.min(e.length,9),n=0;n<i;n++)t.words[n]=e.words[n];if(t.length=i,e.length<=9)return e.words[0]=0,void(e.length=1);var o=e.words[9];for(t.words[t.length++]=o&r,n=10;n<e.length;n++){var s=0|e.words[n];e.words[n-10]=(s&r)<<4|o>>>22,o=s}o>>>=22,e.words[n-10]=o,0===o&&e.length>10?e.length-=10:e.length-=9},w.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,r=0;r<e.length;r++){var i=0|e.words[r];t+=977*i,e.words[r]=67108863&t,t=64*i+(t/67108864|0)}return 0===e.words[e.length-1]&&(e.length--,0===e.words[e.length-1]&&e.length--),e},n(P,C),n(A,C),n(I,C),I.prototype.imulK=function(e){for(var t=0,r=0;r<e.length;r++){var i=19*(0|e.words[r])+t,n=67108863&i;i>>>=26,e.words[r]=n,t=i}return 0!==t&&(e.words[e.length++]=t),e},o._prime=function(e){if(S[e])return S[e];var t;if("k256"===e)t=new w;else if("p224"===e)t=new P;else if("p192"===e)t=new A;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new I}return S[e]=t,t},R.prototype._verify1=function(e){i(0===e.negative,"red works only with positives"),i(e.red,"red works only with red numbers")},R.prototype._verify2=function(e,t){i(0===(e.negative|t.negative),"red works only with positives"),i(e.red&&e.red===t.red,"red works only with red numbers")},R.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):(h(e,e.umod(this.m)._forceRed(this)),e)},R.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},R.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},R.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},R.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},R.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},R.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},R.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},R.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},R.prototype.isqr=function(e){return this.imul(e,e.clone())},R.prototype.sqr=function(e){return this.mul(e,e)},R.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(i(t%2==1),3===t){var r=this.m.add(new o(1)).iushrn(2);return this.pow(e,r)}for(var n=this.m.subn(1),s=0;!n.isZero()&&0===n.andln(1);)s++,n.iushrn(1);i(!n.isZero());var a=new o(1).toRed(this),c=a.redNeg(),u=this.m.subn(1).iushrn(1),h=this.m.bitLength();for(h=new o(2*h*h).toRed(this);0!==this.pow(h,u).cmp(c);)h.redIAdd(c);for(var d=this.pow(h,n),l=this.pow(e,n.addn(1).iushrn(1)),p=this.pow(e,n),f=s;0!==p.cmp(a);){for(var v=p,g=0;0!==v.cmp(a);g++)v=v.redSqr();i(g<f);var m=this.pow(d,new o(1).iushln(f-g-1));l=l.redMul(m),d=m.redSqr(),p=p.redMul(d),f=g}return l},R.prototype.invm=function(e){var t=e._invmp(this.m);return 0!==t.negative?(t.negative=0,this.imod(t).redNeg()):this.imod(t)},R.prototype.pow=function(e,t){if(t.isZero())return new o(1).toRed(this);if(0===t.cmpn(1))return e.clone();var r=new Array(16);r[0]=new o(1).toRed(this),r[1]=e;for(var i=2;i<r.length;i++)r[i]=this.mul(r[i-1],e);var n=r[0],s=0,a=0,c=t.bitLength()%26;for(0===c&&(c=26),i=t.length-1;i>=0;i--){for(var u=t.words[i],h=c-1;h>=0;h--){var d=u>>h&1;n!==r[0]&&(n=this.sqr(n)),0!==d||0!==s?(s<<=1,s|=d,(4===++a||0===i&&0===h)&&(n=this.mul(n,r[s]),a=0,s=0)):a=0}c=26}return n},R.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},R.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},o.mont=function(e){return new E(e)},n(E,R),E.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},E.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},E.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),o=n;return n.cmp(this.m)>=0?o=n.isub(this.m):n.cmpn(0)<0&&(o=n.iadd(this.m)),o._forceRed(this)},E.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new o(0)._forceRed(this);var r=e.mul(t),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),s=n;return n.cmp(this.m)>=0?s=n.isub(this.m):n.cmpn(0)<0&&(s=n.iadd(this.m)),s._forceRed(this)},E.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e=r.nmd(e),this)},9446:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CancellationDetails=void 0;const i=r(9190),n=r(6352),o=r(881);class s extends n.CancellationDetailsBase{constructor(e,t,r){super(e,t,r)}static fromResult(e){let t=o.CancellationReason.Error,r=o.CancellationErrorCode.NoError;if(e instanceof o.RecognitionResult&&e.json){const r=i.SimpleSpeechPhrase.fromJSON(e.json,0);t=i.EnumTranslation.implTranslateCancelResult(r.RecognitionStatus)}return e.properties&&(r=o.CancellationErrorCode[e.properties.getProperty(i.CancellationErrorCodePropertyName,o.CancellationErrorCode[o.CancellationErrorCode.NoError])]),new s(t,e.errorDetails||i.EnumTranslation.implTranslateErrorDetails(r),r)}}t.CancellationDetails=s},9475:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MicAudioSource=t.AudioWorkletSourceURLPropertyName=void 0;const i=r(9190),n=r(868),o=r(8698);t.AudioWorkletSourceURLPropertyName="MICROPHONE-WorkletSourceUrl";class s{constructor(e,t,r,i){this.privRecorder=e,this.deviceId=t,this.privStreams={},this.privOutputChunkSize=s.AUDIOFORMAT.avgBytesPerSec/10,this.privId=r||(0,n.createNoDashGuid)(),this.privEvents=new n.EventSource,this.privMediaStream=i||null,this.privIsClosing=!1}get format(){return Promise.resolve(s.AUDIOFORMAT)}turnOn(){if(this.privInitializeDeferral)return this.privInitializeDeferral.promise;this.privInitializeDeferral=new n.Deferred;try{this.createAudioContext()}catch(e){if(e instanceof Error){const t=e;this.privInitializeDeferral.reject(t.name+": "+t.message)}else this.privInitializeDeferral.reject(e);return this.privInitializeDeferral.promise}const e=window.navigator;let t=e.getUserMedia||e.webkitGetUserMedia||e.mozGetUserMedia||e.msGetUserMedia;if(e.mediaDevices&&(t=(t,r,i)=>{e.mediaDevices.getUserMedia(t).then(r).catch(i)}),t){const e=()=>{this.onEvent(new n.AudioSourceInitializingEvent(this.privId)),this.privMediaStream&&this.privMediaStream.active?(this.onEvent(new n.AudioSourceReadyEvent(this.privId)),this.privInitializeDeferral.resolve()):t({audio:!this.deviceId||{deviceId:this.deviceId},video:!1},e=>{this.privMediaStream=e,this.onEvent(new n.AudioSourceReadyEvent(this.privId)),this.privInitializeDeferral.resolve()},e=>{const t=`Error occurred during microphone initialization: ${e}`;this.privInitializeDeferral.reject(t),this.onEvent(new n.AudioSourceErrorEvent(this.privId,t))})};"suspended"===this.privContext.state?this.privContext.resume().then(e).catch(e=>{this.privInitializeDeferral.reject(`Failed to initialize audio context: ${e}`)}):e()}else{const e="Browser does not support getUserMedia.";this.privInitializeDeferral.reject(e),this.onEvent(new n.AudioSourceErrorEvent(e,""))}return this.privInitializeDeferral.promise}id(){return this.privId}attach(e){return this.onEvent(new n.AudioStreamNodeAttachingEvent(this.privId,e)),this.listen(e).then(t=>(this.onEvent(new n.AudioStreamNodeAttachedEvent(this.privId,e)),{detach:async()=>(t.readEnded(),delete this.privStreams[e],this.onEvent(new n.AudioStreamNodeDetachedEvent(this.privId,e)),this.turnOff()),id:()=>e,read:()=>t.read()}))}detach(e){e&&this.privStreams[e]&&(this.privStreams[e].close(),delete this.privStreams[e],this.onEvent(new n.AudioStreamNodeDetachedEvent(this.privId,e)))}async turnOff(){for(const e in this.privStreams)if(e){const t=this.privStreams[e];t&&t.close()}this.onEvent(new n.AudioSourceOffEvent(this.privId)),this.privInitializeDeferral&&(await this.privInitializeDeferral,this.privInitializeDeferral=null),await this.destroyAudioContext()}get events(){return this.privEvents}get deviceInfo(){return this.getMicrophoneLabel().then(e=>({bitspersample:s.AUDIOFORMAT.bitsPerSample,channelcount:s.AUDIOFORMAT.channels,connectivity:i.connectivity.Unknown,manufacturer:"Speech SDK",model:e,samplerate:s.AUDIOFORMAT.samplesPerSec,type:i.type.Microphones}))}setProperty(e,r){if(e!==t.AudioWorkletSourceURLPropertyName)throw new Error("Property '"+e+"' is not supported on Microphone.");this.privRecorder.setWorkletUrl(r)}getMicrophoneLabel(){const e="microphone";if(void 0!==this.privMicrophoneLabel)return Promise.resolve(this.privMicrophoneLabel);if(void 0===this.privMediaStream||!this.privMediaStream.active)return Promise.resolve(e);this.privMicrophoneLabel=e;const t=this.privMediaStream.getTracks()[0].getSettings().deviceId;if(void 0===t)return Promise.resolve(this.privMicrophoneLabel);const r=new n.Deferred;return navigator.mediaDevices.enumerateDevices().then(e=>{for(const r of e)if(r.deviceId===t){this.privMicrophoneLabel=r.label;break}r.resolve(this.privMicrophoneLabel)},()=>r.resolve(this.privMicrophoneLabel)),r.promise}async listen(e){await this.turnOn();const t=new n.ChunkedArrayBufferStream(this.privOutputChunkSize,e);this.privStreams[e]=t;try{this.privRecorder.record(this.privContext,this.privMediaStream,t)}catch(t){throw this.onEvent(new n.AudioStreamNodeErrorEvent(this.privId,e,t)),t}return t}onEvent(e){this.privEvents.onEvent(e),n.Events.instance.onEvent(e)}createAudioContext(){this.privContext||(this.privContext=o.AudioStreamFormatImpl.getAudioContext(s.AUDIOFORMAT.samplesPerSec))}async destroyAudioContext(){if(!this.privContext)return;this.privRecorder.releaseMediaResources(this.privContext);let e=!1;"close"in this.privContext&&(e=!0),e?this.privIsClosing||(this.privIsClosing=!0,await this.privContext.close(),this.privContext=null,this.privIsClosing=!1):null!==this.privContext&&"running"===this.privContext.state&&await this.privContext.suspend()}}t.MicAudioSource=s,s.AUDIOFORMAT=o.AudioStreamFormat.getDefaultInputFormat()},9493:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AvatarSynthesisAdapter=void 0;const i=r(881),n=r(9190);class o extends n.SynthesisAdapterBase{constructor(e,t,r,i,n){super(e,t,r,void 0),this.privAvatarSynthesizer=i,this.privSynthesizer=i,this.privAvatarConfig=n}setSynthesisContextSynthesisSection(){this.privSynthesisContext.setSynthesisSection(void 0)}setSpeechConfigSynthesisSection(){this.privSynthesizerConfig.synthesisVideoSection={format:{bitrate:this.privAvatarConfig.videoFormat?.bitrate,codec:this.privAvatarConfig.videoFormat?.codec,crop:{bottomRight:{x:this.privAvatarConfig.videoFormat?.cropRange?.bottomRight?.x,y:this.privAvatarConfig.videoFormat?.cropRange?.bottomRight?.y},topLeft:{x:this.privAvatarConfig.videoFormat?.cropRange?.topLeft?.x,y:this.privAvatarConfig.videoFormat?.cropRange?.topLeft?.y}},resolution:{height:this.privAvatarConfig.videoFormat?.height,width:this.privAvatarConfig.videoFormat?.width}},protocol:{name:"WebRTC",webrtcConfig:{clientDescription:btoa(this.privSynthesizerConfig.parameters.getProperty(i.PropertyId.TalkingAvatarService_WebRTC_SDP)),iceServers:this.privAvatarConfig.remoteIceServers??this.privAvatarSynthesizer.iceServers}},talkingAvatar:{background:{color:this.privAvatarConfig.backgroundColor,image:{url:this.privAvatarConfig.backgroundImage?.toString()}},character:this.privAvatarConfig.character,customized:this.privAvatarConfig.customized,style:this.privAvatarConfig.style,useBuiltInVoice:this.privAvatarConfig.useBuiltInVoice}}}onAvatarEvent(e){if(this.privAvatarSynthesizer.avatarEventReceived){const t=new i.AvatarEventArgs(e.Data.Offset,e.Data.Name);try{this.privAvatarSynthesizer.avatarEventReceived(this.privAvatarSynthesizer,t)}catch(e){}}}}t.AvatarSynthesisAdapter=o},9548:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SimpleSpeechPhrase=void 0;const i=r(9190);class n{constructor(e,t=0){this.privSimpleSpeechPhrase=JSON.parse(e),this.privSimpleSpeechPhrase.RecognitionStatus=this.mapRecognitionStatus(this.privSimpleSpeechPhrase.RecognitionStatus),this.updateOffset(t)}static fromJSON(e,t){return new n(e,t)}updateOffset(e){this.privSimpleSpeechPhrase.Offset+=e}asJson(){const e={...this.privSimpleSpeechPhrase};return JSON.stringify({...e,RecognitionStatus:i.RecognitionStatus[e.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 void 0===this.privSimpleSpeechPhrase.PrimaryLanguage?void 0:this.privSimpleSpeechPhrase.PrimaryLanguage.Language}get LanguageDetectionConfidence(){return void 0===this.privSimpleSpeechPhrase.PrimaryLanguage?void 0:this.privSimpleSpeechPhrase.PrimaryLanguage.Confidence}get SpeakerId(){return this.privSimpleSpeechPhrase.SpeakerId}mapRecognitionStatus(e){return"string"==typeof e?i.RecognitionStatus[e]:"number"==typeof e?e:void 0}}t.SimpleSpeechPhrase=n},9645:()=>{},9674:e=>{"use strict";for(var t="qpzry9x8gf2tvdw0s3jn54khce6mua7l",r={},i=0;i<32;i++){var n=t.charAt(i);if(void 0!==r[n])throw new TypeError(n+" is ambiguous");r[n]=i}function o(e){var t=e>>25;return(33554431&e)<<5^996825010&-(1&t)^642813549&-(t>>1&1)^513874426&-(t>>2&1)^1027748829&-(t>>3&1)^705979059&-(t>>4&1)}function s(e){for(var t=1,r=0;r<e.length;++r){var i=e.charCodeAt(r);if(i<33||i>126)return"Invalid prefix ("+e+")";t=o(t)^i>>5}for(t=o(t),r=0;r<e.length;++r){var n=e.charCodeAt(r);t=o(t)^31&n}return t}function a(e,t){if(t=t||90,e.length<8)return e+" too short";if(e.length>t)return"Exceeds length limit";var i=e.toLowerCase(),n=e.toUpperCase();if(e!==i&&e!==n)return"Mixed-case string "+e;var a=(e=i).lastIndexOf("1");if(-1===a)return"No separator character for "+e;if(0===a)return"Missing prefix for "+e;var c=e.slice(0,a),u=e.slice(a+1);if(u.length<6)return"Data too short";var h=s(c);if("string"==typeof h)return h;for(var d=[],l=0;l<u.length;++l){var p=u.charAt(l),f=r[p];if(void 0===f)return"Unknown character "+p;h=o(h)^f,l+6>=u.length||d.push(f)}return 1!==h?"Invalid checksum for "+e:{prefix:c,words:d}}function c(e,t,r,i){for(var n=0,o=0,s=(1<<r)-1,a=[],c=0;c<e.length;++c)for(n=n<<t|e[c],o+=t;o>=r;)o-=r,a.push(n>>o&s);if(i)o>0&&a.push(n<<r-o&s);else{if(o>=t)return"Excess padding";if(n<<r-o&s)return"Non-zero padding"}return a}e.exports={decodeUnsafe:function(){var e=a.apply(null,arguments);if("object"==typeof e)return e},decode:function(e){var t=a.apply(null,arguments);if("object"==typeof t)return t;throw new Error(t)},encode:function(e,r,i){if(i=i||90,e.length+7+r.length>i)throw new TypeError("Exceeds length limit");var n=s(e=e.toLowerCase());if("string"==typeof n)throw new Error(n);for(var a=e+"1",c=0;c<r.length;++c){var u=r[c];if(u>>5)throw new Error("Non 5-bit word");n=o(n)^u,a+=t.charAt(u)}for(c=0;c<6;++c)n=o(n);for(n^=1,c=0;c<6;++c)a+=t.charAt(n>>5*(5-c)&31);return a},toWordsUnsafe:function(e){var t=c(e,8,5,!0);if(Array.isArray(t))return t},toWords:function(e){var t=c(e,8,5,!0);if(Array.isArray(t))return t;throw new Error(t)},fromWordsUnsafe:function(e){var t=c(e,5,8,!1);if(Array.isArray(t))return t},fromWords:function(e){var t=c(e,5,8,!1);if(Array.isArray(t))return t;throw new Error(t)}}},9701:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SpeechTranslationConfigImpl=t.SpeechTranslationConfig=void 0;const i=r(9190),n=r(5245),o=r(881);class s extends o.SpeechConfig{constructor(){super()}static fromSubscription(e,t){n.Contracts.throwIfNullOrWhitespace(e,"subscriptionKey"),n.Contracts.throwIfNullOrWhitespace(t,"region");const r=new a;return r.properties.setProperty(o.PropertyId.SpeechServiceConnection_Key,e),r.properties.setProperty(o.PropertyId.SpeechServiceConnection_Region,t),r}static fromAuthorizationToken(e,t){n.Contracts.throwIfNullOrWhitespace(e,"authorizationToken"),n.Contracts.throwIfNullOrWhitespace(t,"region");const r=new a;return r.properties.setProperty(o.PropertyId.SpeechServiceAuthorization_Token,e),r.properties.setProperty(o.PropertyId.SpeechServiceConnection_Region,t),r}static fromHost(e,t){n.Contracts.throwIfNull(e,"hostName");const r=new a;return r.setProperty(o.PropertyId.SpeechServiceConnection_Host,e.protocol+"//"+e.hostname+(""===e.port?"":":"+e.port)),void 0!==t&&r.setProperty(o.PropertyId.SpeechServiceConnection_Key,t),r}static fromEndpoint(e,t){n.Contracts.throwIfNull(e,"endpoint");const r="string"==typeof t&&t.trim().length>0,i="object"==typeof t&&null!==t&&"function"==typeof t.getToken,s="object"==typeof t&&null!==t&&"string"==typeof t.key;if(void 0!==t&&!r&&!i&&!s)throw new Error("Invalid 'auth' parameter: expected a non-empty API key string, a TokenCredential, or a KeyCredential.");let c;return"string"==typeof t?(c=new a,c.setProperty(o.PropertyId.SpeechServiceConnection_Key,t)):"object"==typeof t&&"function"==typeof t.getToken?c=new a(t):"object"==typeof t&&"string"==typeof t.key?(c=new a,c.setProperty(o.PropertyId.SpeechServiceConnection_Key,t.key)):c=new a,c.setProperty(o.PropertyId.SpeechServiceConnection_Endpoint,e.href),c}}t.SpeechTranslationConfig=s;class a extends s{constructor(e){super(),this.privSpeechProperties=new o.PropertyCollection,this.outputFormat=o.OutputFormat.Simple,this.privTokenCredential=e}set authorizationToken(e){n.Contracts.throwIfNullOrWhitespace(e,"value"),this.privSpeechProperties.setProperty(o.PropertyId.SpeechServiceAuthorization_Token,e)}set speechRecognitionLanguage(e){n.Contracts.throwIfNullOrWhitespace(e,"value"),this.privSpeechProperties.setProperty(o.PropertyId.SpeechServiceConnection_RecoLanguage,e)}get speechRecognitionLanguage(){return this.privSpeechProperties.getProperty(o.PropertyId[o.PropertyId.SpeechServiceConnection_RecoLanguage])}get subscriptionKey(){return this.privSpeechProperties.getProperty(o.PropertyId[o.PropertyId.SpeechServiceConnection_Key])}get outputFormat(){return o.OutputFormat[this.privSpeechProperties.getProperty(i.OutputFormatPropertyName,void 0)]}set outputFormat(e){this.privSpeechProperties.setProperty(i.OutputFormatPropertyName,o.OutputFormat[e])}get endpointId(){return this.privSpeechProperties.getProperty(o.PropertyId.SpeechServiceConnection_EndpointId)}set endpointId(e){this.privSpeechProperties.setProperty(o.PropertyId.SpeechServiceConnection_EndpointId,e)}addTargetLanguage(e){n.Contracts.throwIfNullOrWhitespace(e,"value");const t=this.targetLanguages;t.includes(e)||(t.push(e),this.privSpeechProperties.setProperty(o.PropertyId.SpeechServiceConnection_TranslationToLanguages,t.join(",")))}get targetLanguages(){return void 0!==this.privSpeechProperties.getProperty(o.PropertyId.SpeechServiceConnection_TranslationToLanguages,void 0)?this.privSpeechProperties.getProperty(o.PropertyId.SpeechServiceConnection_TranslationToLanguages).split(","):[]}get voiceName(){return this.getProperty(o.PropertyId[o.PropertyId.SpeechServiceConnection_TranslationVoice])}set voiceName(e){n.Contracts.throwIfNullOrWhitespace(e,"value"),this.privSpeechProperties.setProperty(o.PropertyId.SpeechServiceConnection_TranslationVoice,e)}get region(){return this.privSpeechProperties.getProperty(o.PropertyId.SpeechServiceConnection_Region)}get tokenCredential(){return this.privTokenCredential}setProxy(e,t,r,i){this.setProperty(o.PropertyId[o.PropertyId.SpeechServiceConnection_ProxyHostName],e),this.setProperty(o.PropertyId[o.PropertyId.SpeechServiceConnection_ProxyPort],t),this.setProperty(o.PropertyId[o.PropertyId.SpeechServiceConnection_ProxyUserName],r),this.setProperty(o.PropertyId[o.PropertyId.SpeechServiceConnection_ProxyPassword],i)}getProperty(e,t){return this.privSpeechProperties.getProperty(e,t)}setProperty(e,t){this.privSpeechProperties.setProperty(e,t)}get properties(){return this.privSpeechProperties}close(){}setServiceProperty(e,t){const r=JSON.parse(this.privSpeechProperties.getProperty(i.ServicePropertiesPropertyName,"{}"));r[e]=t,this.privSpeechProperties.setProperty(i.ServicePropertiesPropertyName,JSON.stringify(r))}setProfanity(e){this.privSpeechProperties.setProperty(o.PropertyId.SpeechServiceResponse_ProfanityOption,o.ProfanityOption[e])}enableAudioLogging(){this.privSpeechProperties.setProperty(o.PropertyId.SpeechServiceConnection_EnableAudioLogging,"true")}requestWordLevelTimestamps(){this.privSpeechProperties.setProperty(o.PropertyId.SpeechServiceResponse_RequestWordLevelTimestamps,"true")}enableDictation(){this.privSpeechProperties.setProperty(i.ForceDictationPropertyName,"true")}get speechSynthesisLanguage(){return this.privSpeechProperties.getProperty(o.PropertyId.SpeechServiceConnection_SynthLanguage)}set speechSynthesisLanguage(e){this.privSpeechProperties.setProperty(o.PropertyId.SpeechServiceConnection_SynthLanguage,e)}get speechSynthesisVoiceName(){return this.privSpeechProperties.getProperty(o.PropertyId.SpeechServiceConnection_SynthVoice)}set speechSynthesisVoiceName(e){this.privSpeechProperties.setProperty(o.PropertyId.SpeechServiceConnection_SynthVoice,e)}get speechSynthesisOutputFormat(){return o.SpeechSynthesisOutputFormat[this.privSpeechProperties.getProperty(o.PropertyId.SpeechServiceConnection_SynthOutputFormat,void 0)]}set speechSynthesisOutputFormat(e){this.privSpeechProperties.setProperty(o.PropertyId.SpeechServiceConnection_SynthOutputFormat,o.SpeechSynthesisOutputFormat[e])}}t.SpeechTranslationConfigImpl=a},9707:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DialogServiceConfigImpl=t.DialogServiceConfig=void 0;const i=r(5245),n=r(881);class o{constructor(){}set applicationId(e){}static get DialogTypes(){return{BotFramework:"bot_framework",CustomCommands:"custom_commands"}}}t.DialogServiceConfig=o,t.DialogServiceConfigImpl=class extends o{constructor(){super(),this.privSpeechConfig=new n.SpeechConfigImpl}get properties(){return this.privSpeechConfig.properties}get speechRecognitionLanguage(){return this.privSpeechConfig.speechRecognitionLanguage}set speechRecognitionLanguage(e){i.Contracts.throwIfNullOrWhitespace(e,"value"),this.privSpeechConfig.speechRecognitionLanguage=e}get outputFormat(){return this.privSpeechConfig.outputFormat}set outputFormat(e){this.privSpeechConfig.outputFormat=e}setProperty(e,t){this.privSpeechConfig.setProperty(e,t)}getProperty(e,t){return this.privSpeechConfig.getProperty(e)}setProxy(e,t,r,i){this.setProperty(n.PropertyId.SpeechServiceConnection_ProxyHostName,e),this.setProperty(n.PropertyId.SpeechServiceConnection_ProxyPort,`${t}`),r&&this.setProperty(n.PropertyId.SpeechServiceConnection_ProxyUserName,r),i&&this.setProperty(n.PropertyId.SpeechServiceConnection_ProxyPassword,i)}setServiceProperty(e,t,r){this.privSpeechConfig.setServiceProperty(e,t)}close(){}}},9738:function(e,t,r){"use strict";var i=this&&this.__createBinding||(Object.create?function(e,t,r,i){void 0===i&&(i=r),Object.defineProperty(e,i,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,i){void 0===i&&(i=r),e[i]=t[r]}),n=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||i(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),new(r(9190).AgentConfig),n(r(881),t)},9747:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ConversationTranscriptionServiceRecognizer=void 0;const i=r(881),n=r(9190),o=r(6091),s=r(2699);class a extends n.ServiceRecognizerBase{constructor(e,t,r,i,n){super(e,t,r,i,n),this.privConversationTranscriber=n,this.setSpeakerDiarizationJson()}setSpeakerDiarizationJson(){if(this.privEnableSpeakerId){const e=this.privSpeechContext.getContext().phraseDetection||{};e.mode=s.RecognitionMode.Conversation;const t={};t.mode=o.SpeakerDiarizationMode.Anonymous,t.audioSessionId=this.privDiarizationSessionId,t.audioOffsetMs=0,t.diarizeIntermediates="true"===this.privRecognizerConfig.parameters.getProperty(i.PropertyId.SpeechServiceResponse_DiarizeIntermediateResults,"false"),e.speakerDiarization=t,this.privSpeechContext.getContext().phraseDetection=e}}async processTypeSpecificMessages(e){let t;const r=new i.PropertyCollection;r.setProperty(i.PropertyId.SpeechServiceResponse_JsonResult,e.textBody);let o=!1;switch(e.path.toLowerCase()){case"speech.hypothesis":case"speech.fragment":const s=n.SpeechHypothesis.fromJSON(e.textBody,this.privRequestSession.currentTurnAudioOffset);t=new i.ConversationTranscriptionResult(this.privRequestSession.requestId,i.ResultReason.RecognizingSpeech,s.Text,s.Duration,s.Offset,s.Language,s.LanguageDetectionConfidence,s.SpeakerId,void 0,s.asJson(),r),this.privRequestSession.onHypothesis(s.Offset);const a=new i.ConversationTranscriptionEventArgs(t,s.Duration,this.privRequestSession.sessionId);if(this.privConversationTranscriber.transcribing)try{this.privConversationTranscriber.transcribing(this.privConversationTranscriber,a)}catch(e){}o=!0;break;case"speech.phrase":const c=n.SimpleSpeechPhrase.fromJSON(e.textBody,this.privRequestSession.currentTurnAudioOffset),u=n.EnumTranslation.implTranslateRecognitionResult(c.RecognitionStatus);if(this.privRequestSession.onPhraseRecognized(c.Offset+c.Duration),i.ResultReason.Canceled===u){const e=n.EnumTranslation.implTranslateCancelResult(c.RecognitionStatus),t=n.EnumTranslation.implTranslateCancelErrorCode(c.RecognitionStatus);await this.cancelRecognitionLocal(e,t,n.EnumTranslation.implTranslateErrorDetails(t))}else if(!this.privRequestSession.isSpeechEnded||u!==i.ResultReason.NoMatch||c.RecognitionStatus===n.RecognitionStatus.InitialSilenceTimeout){if(this.privRecognizerConfig.parameters.getProperty(n.OutputFormatPropertyName)===i.OutputFormat[i.OutputFormat.Simple])t=new i.ConversationTranscriptionResult(this.privRequestSession.requestId,u,c.DisplayText,c.Duration,c.Offset,c.Language,c.LanguageDetectionConfidence,c.SpeakerId,void 0,c.asJson(),r);else{const o=n.DetailedSpeechPhrase.fromJSON(e.textBody,this.privRequestSession.currentTurnAudioOffset);t=new i.ConversationTranscriptionResult(this.privRequestSession.requestId,u,o.RecognitionStatus===n.RecognitionStatus.Success?o.NBest[0].Display:void 0,o.Duration,o.Offset,o.Language,o.LanguageDetectionConfidence,c.SpeakerId,void 0,o.asJson(),r)}const o=new i.ConversationTranscriptionEventArgs(t,t.offset,this.privRequestSession.sessionId);if(this.privConversationTranscriber.transcribed)try{this.privConversationTranscriber.transcribed(this.privConversationTranscriber,o)}catch(e){}}o=!0}return o}cancelRecognition(e,t,r,o,s){if((new i.PropertyCollection).setProperty(n.CancellationErrorCodePropertyName,i.CancellationErrorCode[o]),this.privConversationTranscriber.canceled){const t=new i.ConversationTranscriptionCanceledEventArgs(r,s,o,void 0,e);try{this.privConversationTranscriber.canceled(this.privConversationTranscriber,t)}catch{}}}}t.ConversationTranscriptionServiceRecognizer=a},9828:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CommandResponsePayload=void 0;class r{constructor(e){this.privCommandResponse=(e=>JSON.parse(e))(e)}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(e){return new r(e)}}t.CommandResponsePayload=r},9841:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SynthesisAdapterBase=void 0;const i=r(868),n=r(881),o=r(9190),s=r(4081);class a{constructor(e,t,r,s){if(this.speakOverride=void 0,this.receiveMessageOverride=void 0,this.connectImplOverride=void 0,this.configConnectionOverride=void 0,this.privConnectionConfigurationPromise=void 0,!e)throw new i.ArgumentNullError("authentication");if(!t)throw new i.ArgumentNullError("connectionFactory");if(!r)throw new i.ArgumentNullError("synthesizerConfig");this.privAuthentication=e,this.privConnectionFactory=t,this.privSynthesizerConfig=r,this.privIsDisposed=!1,this.privSessionAudioDestination=s,this.privSynthesisTurn=new o.SynthesisTurn,this.privConnectionEvents=new i.EventSource,this.privServiceEvents=new i.EventSource,this.privSynthesisContext=new o.SynthesisContext,this.privAgentConfig=new o.AgentConfig,this.connectionEvents.attach(e=>{if("ConnectionClosedEvent"===e.name){const t=e;1e3!==t.statusCode&&this.cancelSynthesisLocal(n.CancellationReason.Error,1007===t.statusCode?n.CancellationErrorCode.BadRequestParameters:n.CancellationErrorCode.ConnectionFailure,`${t.reason} websocket error code: ${t.statusCode}`)}})}get synthesizerConfig(){return this.privSynthesizerConfig}get synthesisContext(){return this.privSynthesisContext}get agentConfig(){return this.privAgentConfig}get connectionEvents(){return this.privConnectionEvents}get serviceEvents(){return this.privServiceEvents}set activityTemplate(e){this.privActivityTemplate=e}get activityTemplate(){return this.privActivityTemplate}set audioOutputFormat(e){this.privAudioOutputFormat=e,this.privSynthesisTurn.audioOutputFormat=e,void 0!==this.privSessionAudioDestination&&(this.privSessionAudioDestination.format=e),void 0!==this.synthesisContext&&(this.synthesisContext.audioOutputFormat=e)}isDisposed(){return this.privIsDisposed}async dispose(e){if(this.privIsDisposed=!0,void 0!==this.privSessionAudioDestination&&this.privSessionAudioDestination.close(),void 0!==this.privConnectionConfigurationPromise){const t=await this.privConnectionConfigurationPromise;await t.dispose(e)}}async connect(){await this.connectImpl()}async sendNetworkMessage(e,t){const r="string"==typeof t?i.MessageType.Text:i.MessageType.Binary,n="string"==typeof t?"application/json":"";return(await this.fetchConnection()).send(new s.SpeechConnectionMessage(r,e,this.privSynthesisTurn.requestId,n,t))}async Speak(e,t,r,i,o,s){let a;if(a=t?e:this.privSynthesizer.buildSsml(e),void 0!==this.speakOverride)return this.speakOverride(a,r,i,o);this.privSuccessCallback=i,this.privErrorCallback=o,this.privSynthesisTurn.startNewSynthesis(r,e,t,s);try{await this.connectImpl();const e=await this.fetchConnection();await this.sendSynthesisContext(e),await this.sendSsmlMessage(e,a,r),this.onSynthesisStarted(r),this.receiveMessage()}catch(e){return this.cancelSynthesisLocal(n.CancellationReason.Error,n.CancellationErrorCode.ConnectionFailure,e),Promise.reject(e)}}async stopSpeaking(){return await this.connectImpl(),(await this.fetchConnection()).send(new s.SpeechConnectionMessage(i.MessageType.Text,"synthesis.control",this.privSynthesisTurn.requestId,"application/json",JSON.stringify({action:"stop"})))}cancelSynthesis(e,t,r,i){const s=new n.PropertyCollection;s.setProperty(o.CancellationErrorCodePropertyName,n.CancellationErrorCode[r]);const a=new n.SpeechSynthesisResult(e,n.ResultReason.Canceled,void 0,i,s);if(this.onSynthesisCancelled(a),this.privSuccessCallback)try{this.privSuccessCallback(a)}catch{}}cancelSynthesisLocal(e,t,r){this.privSynthesisTurn.isSynthesizing&&(this.privSynthesisTurn.onStopSynthesizing(),this.cancelSynthesis(this.privSynthesisTurn.requestId,e,t,r))}processTypeSpecificMessages(e){return!0}async receiveMessage(){try{const e=await this.fetchConnection(),t=await e.read();if(void 0!==this.receiveMessageOverride)return this.receiveMessageOverride();if(this.privIsDisposed)return;if(!t)return this.privSynthesisTurn.isSynthesizing?this.receiveMessage():void 0;const r=s.SpeechConnectionMessage.fromConnectionMessage(t);if(r.requestId.toLowerCase()===this.privSynthesisTurn.requestId.toLowerCase())switch(r.path.toLowerCase()){case"turn.start":this.privSynthesisTurn.onServiceTurnStartResponse(r.textBody);break;case"response":this.privSynthesisTurn.onServiceResponseMessage(r.textBody);break;case"audio":this.privSynthesisTurn.streamId.toLowerCase()===r.streamId.toLowerCase()&&r.binaryBody&&(this.privSynthesisTurn.onAudioChunkReceived(r.binaryBody),this.onSynthesizing(r.binaryBody),void 0!==this.privSessionAudioDestination&&this.privSessionAudioDestination.write(r.binaryBody));break;case"audio.metadata":const e=o.SynthesisAudioMetadata.fromJSON(r.textBody).Metadata;for(const t of e)switch(t.Type){case o.MetadataType.WordBoundary:case o.MetadataType.SentenceBoundary:this.privSynthesisTurn.onTextBoundaryEvent(t);const e=new n.SpeechSynthesisWordBoundaryEventArgs(t.Data.Offset,t.Data.Duration,t.Data.text.Text,t.Data.text.Length,t.Type===o.MetadataType.WordBoundary?this.privSynthesisTurn.currentTextOffset:this.privSynthesisTurn.currentSentenceOffset,t.Data.text.BoundaryType);this.onWordBoundary(e);break;case o.MetadataType.Bookmark:const r=new n.SpeechSynthesisBookmarkEventArgs(t.Data.Offset,t.Data.Bookmark);this.onBookmarkReached(r);break;case o.MetadataType.Viseme:if(this.privSynthesisTurn.onVisemeMetadataReceived(t),t.Data.IsLastAnimation){const e=new n.SpeechSynthesisVisemeEventArgs(t.Data.Offset,t.Data.VisemeId,this.privSynthesisTurn.getAndClearVisemeAnimation());this.onVisemeReceived(e)}break;case o.MetadataType.AvatarSignal:this.onAvatarEvent(t);break;case o.MetadataType.SessionEnd:this.privSynthesisTurn.onSessionEnd(t)}break;case"turn.end":let t;this.privSynthesisTurn.onServiceTurnEndResponse();try{t=await this.privSynthesisTurn.constructSynthesisResult(),this.privSuccessCallback&&this.privSuccessCallback(t)}catch(e){this.privErrorCallback&&this.privErrorCallback(e)}this.onSynthesisCompleted(t);break;default:this.processTypeSpecificMessages(r)||this.privServiceEvents&&this.serviceEvents.onEvent(new i.ServiceEvent(r.path.toLowerCase(),r.textBody))}return this.receiveMessage()}catch(e){}}sendSynthesisContext(e){this.setSynthesisContextSynthesisSection();const t=this.synthesisContext.toJSON();if(t)return e.send(new s.SpeechConnectionMessage(i.MessageType.Text,"synthesis.context",this.privSynthesisTurn.requestId,"application/json",t))}setSpeechConfigSynthesisSection(){}connectImpl(e=!1){if(null!=this.privConnectionPromise)return this.privConnectionPromise.then(e=>e.state()===i.ConnectionState.Disconnected?(this.privConnectionId=null,this.privConnectionPromise=null,this.connectImpl()):this.privConnectionPromise,()=>(this.privConnectionId=null,this.privConnectionPromise=null,this.connectImpl()));this.privAuthFetchEventId=(0,i.createNoDashGuid)(),this.privConnectionId=(0,i.createNoDashGuid)(),this.privSynthesisTurn.onPreConnectionStart(this.privAuthFetchEventId);const t=e?this.privAuthentication.fetchOnExpiry(this.privAuthFetchEventId):this.privAuthentication.fetch(this.privAuthFetchEventId);return this.privConnectionPromise=t.then(async t=>{this.privSynthesisTurn.onAuthCompleted(!1);const r=await this.privConnectionFactory.create(this.privSynthesizerConfig,t,this.privConnectionId);r.events.attach(e=>{this.connectionEvents.onEvent(e)});const i=await r.open();return 200===i.statusCode?(this.privSynthesisTurn.onConnectionEstablishCompleted(i.statusCode),Promise.resolve(r)):403!==i.statusCode||e?(this.privSynthesisTurn.onConnectionEstablishCompleted(i.statusCode),Promise.reject(`Unable to contact server. StatusCode: ${i.statusCode},\n ${this.privSynthesizerConfig.parameters.getProperty(n.PropertyId.SpeechServiceConnection_Url)} Reason: ${i.reason}`)):this.connectImpl(!0)},e=>{throw this.privSynthesisTurn.onAuthCompleted(!0),new Error(e)}),this.privConnectionPromise.catch(()=>{}),this.privConnectionPromise}sendSpeechServiceConfig(e,t){if(t)return e.send(new s.SpeechConnectionMessage(i.MessageType.Text,"speech.config",this.privSynthesisTurn.requestId,"application/json",t))}sendSsmlMessage(e,t,r){return e.send(new s.SpeechConnectionMessage(i.MessageType.Text,"ssml",r,"application/ssml+xml",t))}async fetchConnection(){return void 0!==this.privConnectionConfigurationPromise?this.privConnectionConfigurationPromise.then(e=>e.state()===i.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 e=await this.connectImpl();return void 0!==this.configConnectionOverride?this.configConnectionOverride(e):(this.setSpeechConfigSynthesisSection(),await this.sendSpeechServiceConfig(e,this.privSynthesizerConfig.SpeechServiceConfig.serialize()),e)}onAvatarEvent(e){}onSynthesisStarted(e){}onSynthesizing(e){}onSynthesisCancelled(e){}onSynthesisCompleted(e){}onWordBoundary(e){}onVisemeReceived(e){}onBookmarkReached(e){}}t.SynthesisAdapterBase=a,a.telemetryDataEnabled=!0},9876:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IntentRecognizer=void 0;const i=r(9190),n=r(2699),o=r(868),s=r(5245),a=r(881);class c extends a.Recognizer{constructor(e,t){s.Contracts.throwIfNullOrUndefined(e,"speechConfig");const r=e;s.Contracts.throwIfNullOrUndefined(r,"speechConfig"),super(t,r.properties,new i.IntentConnectionFactory),this.privAddedIntents=[],this.privAddedLmIntents={},this.privDisposedIntentRecognizer=!1,this.privProperties=r.properties,s.Contracts.throwIfNullOrWhitespace(this.properties.getProperty(a.PropertyId.SpeechServiceConnection_RecoLanguage),a.PropertyId[a.PropertyId.SpeechServiceConnection_RecoLanguage])}get speechRecognitionLanguage(){return s.Contracts.throwIfDisposed(this.privDisposedIntentRecognizer),this.properties.getProperty(a.PropertyId.SpeechServiceConnection_RecoLanguage)}get authorizationToken(){return this.properties.getProperty(a.PropertyId.SpeechServiceAuthorization_Token)}set authorizationToken(e){this.properties.setProperty(a.PropertyId.SpeechServiceAuthorization_Token,e)}get properties(){return this.privProperties}recognizeOnceAsync(e,t){if(s.Contracts.throwIfDisposed(this.privDisposedIntentRecognizer),0!==Object.keys(this.privAddedLmIntents).length||void 0!==this.privUmbrellaIntent){const e=this.buildSpeechContext();this.privReco.speechContext.getContext().intent=e.Intent,this.privReco.dynamicGrammar.addReferenceGrammar(e.ReferenceGrammars),this.privReco.setIntents(this.privAddedLmIntents,this.privUmbrellaIntent)}(0,o.marshalPromiseToCallbacks)(this.recognizeOnceAsyncImpl(n.RecognitionMode.Interactive),e,t)}startContinuousRecognitionAsync(e,t){if(0!==Object.keys(this.privAddedLmIntents).length||void 0!==this.privUmbrellaIntent){const e=this.buildSpeechContext();this.privReco.speechContext.getContext().intent=e.Intent,this.privReco.dynamicGrammar.addReferenceGrammar(e.ReferenceGrammars),this.privReco.setIntents(this.privAddedLmIntents,this.privUmbrellaIntent)}(0,o.marshalPromiseToCallbacks)(this.startContinuousRecognitionAsyncImpl(n.RecognitionMode.Conversation),e,t)}stopContinuousRecognitionAsync(e,t){(0,o.marshalPromiseToCallbacks)(this.stopContinuousRecognitionAsyncImpl(),e,t)}startKeywordRecognitionAsync(e,t,r){s.Contracts.throwIfNull(e,"model"),r&&r("Not yet implemented.")}stopKeywordRecognitionAsync(e,t){if(e)try{e()}catch(e){t&&t(e)}}addIntent(e,t){s.Contracts.throwIfDisposed(this.privDisposedIntentRecognizer),s.Contracts.throwIfNullOrWhitespace(t,"intentId"),s.Contracts.throwIfNullOrWhitespace(e,"simplePhrase"),this.privAddedIntents.push([t,e])}addIntentWithLanguageModel(e,t,r){s.Contracts.throwIfDisposed(this.privDisposedIntentRecognizer),s.Contracts.throwIfNullOrWhitespace(e,"intentId"),s.Contracts.throwIfNull(t,"model");const n=t;s.Contracts.throwIfNullOrWhitespace(n.appId,"model.appId"),this.privAddedLmIntents[e]=new i.AddedLmIntent(n,r)}addAllIntents(e,t){s.Contracts.throwIfNull(e,"model");const r=e;s.Contracts.throwIfNullOrWhitespace(r.appId,"model.appId"),this.privUmbrellaIntent=new i.AddedLmIntent(r,t)}close(e,t){s.Contracts.throwIfDisposed(this.privDisposedIntentRecognizer),(0,o.marshalPromiseToCallbacks)(this.dispose(!0),e,t)}createRecognizerConfig(e){return new i.RecognizerConfig(e,this.privProperties)}createServiceRecognizer(e,t,r,n){const o=r;return new i.IntentServiceRecognizer(e,t,o,n,this)}async dispose(e){this.privDisposedIntentRecognizer||e&&(this.privDisposedIntentRecognizer=!0,await super.dispose(e))}buildSpeechContext(){let e,t,r;const i=[];void 0!==this.privUmbrellaIntent&&(e=this.privUmbrellaIntent.modelImpl.appId,t=this.privUmbrellaIntent.modelImpl.region,r=this.privUmbrellaIntent.modelImpl.subscriptionKey);for(const n of Object.keys(this.privAddedLmIntents)){const o=this.privAddedLmIntents[n];if(void 0===e)e=o.modelImpl.appId;else if(e!==o.modelImpl.appId)throw new Error("Intents must all be from the same LUIS model");if(void 0===t)t=o.modelImpl.region;else if(t!==o.modelImpl.region)throw new Error("Intents must all be from the same LUIS model in a single region");if(void 0===r)r=o.modelImpl.subscriptionKey;else if(r!==o.modelImpl.subscriptionKey)throw new Error("Intents must all use the same subscription key");const s="luis/"+e+"-PRODUCTION#"+n;i.push(s)}return{Intent:{id:e,key:void 0===r?this.privProperties.getProperty(a.PropertyId[a.PropertyId.SpeechServiceConnection_Key]):r,provider:"LUIS"},ReferenceGrammars:void 0===this.privUmbrellaIntent?i:["luis/"+e+"-PRODUCTION"]}}}t.IntentRecognizer=c},9911:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ConnectionEventArgs=void 0;const i=r(881);class n extends i.SessionEventArgs{}t.ConnectionEventArgs=n},9958:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TranslationConnectionFactory=void 0;const i=r(4378),n=r(4677),o=r(881),s=r(7778),a=r(9190),c=r(7014),u=r(9324),h=r(2699);class d extends s.ConnectionFactoryBase{constructor(){super(...arguments),this.universalUri="/stt/speech/universal/v2",this.translationV1Uri="/speech/translation/cognitiveservices/v1"}async create(e,t,r){let n=this.getEndpointUrl(e);const u={};if(this.setQueryParams(u,e,n),n){const e=new URL(n),t=e.pathname;""!==t&&"/"!==t||(e.pathname=this.universalUri,n=await s.ConnectionFactoryBase.getRedirectUrlFromEndpoint(e.toString()))}const h={};void 0!==t.token&&""!==t.token&&(h[t.headerName]=t.token),h[c.HeaderNames.ConnectionId]=r,e.parameters.setProperty(o.PropertyId.SpeechServiceConnection_Url,n);const d="true"===e.parameters.getProperty("SPEECH-EnableWebsocketCompression","false");return new i.WebsocketConnection(n,u,h,new a.WebsocketMessageFormatter,i.ProxyInfo.fromRecognizerConfig(e),d,r)}getEndpointUrl(e,t){const r=e.parameters.getProperty(o.PropertyId.SpeechServiceConnection_Region),i=s.ConnectionFactoryBase.getHostSuffix(r);let a=e.parameters.getProperty(o.PropertyId.SpeechServiceConnection_Endpoint,void 0);return a||(a="true"===e.parameters.getProperty("SPEECH-ForceV1Endpoint","false")?e.parameters.getProperty(o.PropertyId.SpeechServiceConnection_Host,"wss://{region}.s2s.speech"+i)+this.translationV1Uri:e.parameters.getProperty(o.PropertyId.SpeechServiceConnection_Host,"wss://{region}.stt.speech"+i)+this.universalUri),!0===t?a:n.StringUtils.formatString(a,{region:r})}setQueryParams(e,t,r){e.from=t.parameters.getProperty(o.PropertyId.SpeechServiceConnection_RecoLanguage),e.to=t.parameters.getProperty(o.PropertyId.SpeechServiceConnection_TranslationToLanguages),e.scenario=t.recognitionMode===h.RecognitionMode.Interactive?"interactive":t.recognitionMode===h.RecognitionMode.Conversation?"conversation":"",this.setCommonUrlParams(t,e,r),this.setUrlParameter(o.PropertyId.SpeechServiceResponse_TranslationRequestStablePartialResult,u.QueryParameterNames.StableTranslation,t,e,r);const i=t.parameters.getProperty(o.PropertyId.SpeechServiceConnection_TranslationVoice,void 0);void 0!==i&&(e.voice=i,e.features="requireVoice")}}t.TranslationConnectionFactory=d},9962:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},9981:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AudioStreamNodeErrorEvent=t.AudioStreamNodeDetachedEvent=t.AudioStreamNodeAttachedEvent=t.AudioStreamNodeAttachingEvent=t.AudioStreamNodeEvent=t.AudioSourceErrorEvent=t.AudioSourceOffEvent=t.AudioSourceReadyEvent=t.AudioSourceInitializingEvent=t.AudioSourceEvent=void 0;const i=r(2754);class n extends i.PlatformEvent{constructor(e,t,r=i.EventType.Info){super(e,r),this.privAudioSourceId=t}get audioSourceId(){return this.privAudioSourceId}}t.AudioSourceEvent=n,t.AudioSourceInitializingEvent=class extends n{constructor(e){super("AudioSourceInitializingEvent",e)}},t.AudioSourceReadyEvent=class extends n{constructor(e){super("AudioSourceReadyEvent",e)}},t.AudioSourceOffEvent=class extends n{constructor(e){super("AudioSourceOffEvent",e)}},t.AudioSourceErrorEvent=class extends n{constructor(e,t){super("AudioSourceErrorEvent",e,i.EventType.Error),this.privError=t}get error(){return this.privError}};class o extends n{constructor(e,t,r){super(e,t),this.privAudioNodeId=r}get audioNodeId(){return this.privAudioNodeId}}t.AudioStreamNodeEvent=o,t.AudioStreamNodeAttachingEvent=class extends o{constructor(e,t){super("AudioStreamNodeAttachingEvent",e,t)}},t.AudioStreamNodeAttachedEvent=class extends o{constructor(e,t){super("AudioStreamNodeAttachedEvent",e,t)}},t.AudioStreamNodeDetachedEvent=class extends o{constructor(e,t){super("AudioStreamNodeDetachedEvent",e,t)}},t.AudioStreamNodeErrorEvent=class extends o{constructor(e,t,r){super("AudioStreamNodeErrorEvent",e,t),this.privError=r}get error(){return this.privError}}},9995:(e,t)=>{"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.ProfanityOption=void 0,(r=t.ProfanityOption||(t.ProfanityOption={}))[r.Masked=0]="Masked",r[r.Removed=1]="Removed",r[r.Raw=2]="Raw"}},n={};function o(e){var t=n[e];if(void 0!==t)return t.exports;var r=n[e]={id:e,loaded:!1,exports:{}};return i[e].call(r.exports,r,r.exports,o),r.loaded=!0,r.exports}o.amdO={},o.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return o.d(t,{a:t}),t},r=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,o.t=function(e,i){if(1&i&&(e=this(e)),8&i)return e;if("object"==typeof e&&e){if(4&i&&e.__esModule)return e;if(16&i&&"function"==typeof e.then)return e}var n=Object.create(null);o.r(n);var s={};t=t||[null,r({}),r([]),r(r)];for(var a=2&i&&e;("object"==typeof a||"function"==typeof a)&&!~t.indexOf(a);a=r(a))Object.getOwnPropertyNames(a).forEach(t=>s[t]=()=>e[t]);return s.default=()=>e,o.d(n,s),n},o.d=(e,t)=>{for(var r in t)o.o(t,r)&&!o.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},o.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),o.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.nmd=e=>(e.paths=[],e.children||(e.children=[]),e);var s={};return(()=>{"use strict";o.d(s,{default:()=>id});var e=o(4012),t=o.t(e,2),r=o.n(e);let i=!1,n=!1;const a={debug:1,default:2,info:2,warning:3,error:4,off:5};let c=a.default,u=null;const h=function(){try{const e=[];if(["NFD","NFC","NFKD","NFKC"].forEach(t=>{try{if("test"!=="test".normalize(t))throw new Error("bad normalize")}catch(r){e.push(t)}}),e.length)throw new Error("missing "+e.join(", "));if(String.fromCharCode(233).normalize("NFD")!==String.fromCharCode(101,769))throw new Error("broken implementation")}catch(e){return e.message}return null}();var d,l;!function(e){e.DEBUG="DEBUG",e.INFO="INFO",e.WARNING="WARNING",e.ERROR="ERROR",e.OFF="OFF"}(d||(d={})),function(e){e.UNKNOWN_ERROR="UNKNOWN_ERROR",e.NOT_IMPLEMENTED="NOT_IMPLEMENTED",e.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION",e.NETWORK_ERROR="NETWORK_ERROR",e.SERVER_ERROR="SERVER_ERROR",e.TIMEOUT="TIMEOUT",e.BUFFER_OVERRUN="BUFFER_OVERRUN",e.NUMERIC_FAULT="NUMERIC_FAULT",e.MISSING_NEW="MISSING_NEW",e.INVALID_ARGUMENT="INVALID_ARGUMENT",e.MISSING_ARGUMENT="MISSING_ARGUMENT",e.UNEXPECTED_ARGUMENT="UNEXPECTED_ARGUMENT",e.CALL_EXCEPTION="CALL_EXCEPTION",e.INSUFFICIENT_FUNDS="INSUFFICIENT_FUNDS",e.NONCE_EXPIRED="NONCE_EXPIRED",e.REPLACEMENT_UNDERPRICED="REPLACEMENT_UNDERPRICED",e.UNPREDICTABLE_GAS_LIMIT="UNPREDICTABLE_GAS_LIMIT",e.TRANSACTION_REPLACED="TRANSACTION_REPLACED",e.ACTION_REJECTED="ACTION_REJECTED"}(l||(l={}));const p="0123456789abcdef";class f{constructor(e){Object.defineProperty(this,"version",{enumerable:!0,value:e,writable:!1})}_log(e,t){const r=e.toLowerCase();null==a[r]&&this.throwArgumentError("invalid log level name","logLevel",e),c>a[r]||console.log.apply(console,t)}debug(...e){this._log(f.levels.DEBUG,e)}info(...e){this._log(f.levels.INFO,e)}warn(...e){this._log(f.levels.WARNING,e)}makeError(e,t,r){if(n)return this.makeError("censored error",t,{});t||(t=f.errors.UNKNOWN_ERROR),r||(r={});const i=[];Object.keys(r).forEach(e=>{const t=r[e];try{if(t instanceof Uint8Array){let r="";for(let e=0;e<t.length;e++)r+=p[t[e]>>4],r+=p[15&t[e]];i.push(e+"=Uint8Array(0x"+r+")")}else i.push(e+"="+JSON.stringify(t))}catch(t){i.push(e+"="+JSON.stringify(r[e].toString()))}}),i.push(`code=${t}`),i.push(`version=${this.version}`);const o=e;let s="";switch(t){case l.NUMERIC_FAULT:{s="NUMERIC_FAULT";const t=e;switch(t){case"overflow":case"underflow":case"division-by-zero":s+="-"+t;break;case"negative-power":case"negative-width":s+="-unsupported";break;case"unbound-bitwise-result":s+="-unbound-result"}break}case l.CALL_EXCEPTION:case l.INSUFFICIENT_FUNDS:case l.MISSING_NEW:case l.NONCE_EXPIRED:case l.REPLACEMENT_UNDERPRICED:case l.TRANSACTION_REPLACED:case l.UNPREDICTABLE_GAS_LIMIT:s=t}s&&(e+=" [ See: https://links.ethers.org/v5-errors-"+s+" ]"),i.length&&(e+=" ("+i.join(", ")+")");const a=new Error(e);return a.reason=o,a.code=t,Object.keys(r).forEach(function(e){a[e]=r[e]}),a}throwError(e,t,r){throw this.makeError(e,t,r)}throwArgumentError(e,t,r){return this.throwError(e,f.errors.INVALID_ARGUMENT,{argument:t,value:r})}assert(e,t,r,i){e||this.throwError(t,r,i)}assertArgument(e,t,r,i){e||this.throwArgumentError(t,r,i)}checkNormalize(e){null==e&&(e="platform missing String.prototype.normalize"),h&&this.throwError("platform missing String.prototype.normalize",f.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:h})}checkSafeUint53(e,t){"number"==typeof e&&(null==t&&(t="value not safe"),(e<0||e>=9007199254740991)&&this.throwError(t,f.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:e}),e%1&&this.throwError(t,f.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:e}))}checkArgumentCount(e,t,r){r=r?": "+r:"",e<t&&this.throwError("missing argument"+r,f.errors.MISSING_ARGUMENT,{count:e,expectedCount:t}),e>t&&this.throwError("too many arguments"+r,f.errors.UNEXPECTED_ARGUMENT,{count:e,expectedCount:t})}checkNew(e,t){e!==Object&&null!=e||this.throwError("missing new",f.errors.MISSING_NEW,{name:t.name})}checkAbstract(e,t){e===t?this.throwError("cannot instantiate abstract class "+JSON.stringify(t.name)+" directly; use a sub-class",f.errors.UNSUPPORTED_OPERATION,{name:e.name,operation:"new"}):e!==Object&&null!=e||this.throwError("missing new",f.errors.MISSING_NEW,{name:t.name})}static globalLogger(){return u||(u=new f("logger/5.7.0")),u}static setCensorship(e,t){if(!e&&t&&this.globalLogger().throwError("cannot permanently disable censorship",f.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),i){if(!e)return;this.globalLogger().throwError("error censorship permanent",f.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}n=!!e,i=!!t}static setLogLevel(e){const t=a[e.toLowerCase()];null!=t?c=t:f.globalLogger().warn("invalid log level - "+e)}static from(e){return new f(e)}}f.errors=l,f.levels=d;const v=new f("properties/5.7.0");function g(e,t,r){Object.defineProperty(e,t,{enumerable:!0,value:r,writable:!1})}function m(e,t){for(let r=0;r<32;r++){if(e[t])return e[t];if(!e.prototype||"object"!=typeof e.prototype)break;e=Object.getPrototypeOf(e.prototype).constructor}return null}function y(e){return t=this,r=void 0,n=function*(){const t=Object.keys(e).map(t=>{const r=e[t];return Promise.resolve(r).then(e=>({key:t,value:e}))});return(yield Promise.all(t)).reduce((e,t)=>(e[t.key]=t.value,e),{})},new((i=void 0)||(i=Promise))(function(e,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(t){var r;t.done?e(t.value):(r=t.value,r instanceof i?r:new i(function(e){e(r)})).then(s,a)}c((n=n.apply(t,r||[])).next())});var t,r,i,n}function b(e){const t={};for(const r in e)t[r]=e[r];return t}const S={bigint:!0,boolean:!0,function:!0,number:!0,string:!0};function C(e){if(null==e||S[typeof e])return!0;if(Array.isArray(e)||"object"==typeof e){if(!Object.isFrozen(e))return!1;const t=Object.keys(e);for(let r=0;r<t.length;r++){let i=null;try{i=e[t[r]]}catch(e){continue}if(!C(i))return!1}return!0}return v.throwArgumentError("Cannot deepCopy "+typeof e,"object",e)}function w(e){if(C(e))return e;if(Array.isArray(e))return Object.freeze(e.map(e=>P(e)));if("object"==typeof e){const t={};for(const r in e){const i=e[r];void 0!==i&&g(t,r,P(i))}return t}return v.throwArgumentError("Cannot deepCopy "+typeof e,"object",e)}function P(e){return w(e)}class A{constructor(e){for(const t in e)this[t]=P(e[t])}}const I="providers/5.7.0";var R=function(e,t,r,i){return new(r||(r=Promise))(function(n,o){function s(e){try{c(i.next(e))}catch(e){o(e)}}function a(e){try{c(i.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?n(e.value):(t=e.value,t instanceof r?t:new r(function(e){e(t)})).then(s,a)}c((i=i.apply(e,t||[])).next())})};const E=new f("abstract-signer/5.7.0"),T=["accessList","ccipReadEnabled","chainId","customData","data","from","gasLimit","gasPrice","maxFeePerGas","maxPriorityFeePerGas","nonce","to","type","value"],M=[f.errors.INSUFFICIENT_FUNDS,f.errors.NONCE_EXPIRED,f.errors.REPLACEMENT_UNDERPRICED];class k{constructor(){E.checkAbstract(new.target,k),g(this,"_isSigner",!0)}getBalance(e){return R(this,void 0,void 0,function*(){return this._checkProvider("getBalance"),yield this.provider.getBalance(this.getAddress(),e)})}getTransactionCount(e){return R(this,void 0,void 0,function*(){return this._checkProvider("getTransactionCount"),yield this.provider.getTransactionCount(this.getAddress(),e)})}estimateGas(e){return R(this,void 0,void 0,function*(){this._checkProvider("estimateGas");const t=yield y(this.checkTransaction(e));return yield this.provider.estimateGas(t)})}call(e,t){return R(this,void 0,void 0,function*(){this._checkProvider("call");const r=yield y(this.checkTransaction(e));return yield this.provider.call(r,t)})}sendTransaction(e){return R(this,void 0,void 0,function*(){this._checkProvider("sendTransaction");const t=yield this.populateTransaction(e),r=yield this.signTransaction(t);return yield this.provider.sendTransaction(r)})}getChainId(){return R(this,void 0,void 0,function*(){return this._checkProvider("getChainId"),(yield this.provider.getNetwork()).chainId})}getGasPrice(){return R(this,void 0,void 0,function*(){return this._checkProvider("getGasPrice"),yield this.provider.getGasPrice()})}getFeeData(){return R(this,void 0,void 0,function*(){return this._checkProvider("getFeeData"),yield this.provider.getFeeData()})}resolveName(e){return R(this,void 0,void 0,function*(){return this._checkProvider("resolveName"),yield this.provider.resolveName(e)})}checkTransaction(e){for(const t in e)-1===T.indexOf(t)&&E.throwArgumentError("invalid transaction key: "+t,"transaction",e);const t=b(e);return null==t.from?t.from=this.getAddress():t.from=Promise.all([Promise.resolve(t.from),this.getAddress()]).then(t=>(t[0].toLowerCase()!==t[1].toLowerCase()&&E.throwArgumentError("from address mismatch","transaction",e),t[0])),t}populateTransaction(e){return R(this,void 0,void 0,function*(){const t=yield y(this.checkTransaction(e));null!=t.to&&(t.to=Promise.resolve(t.to).then(e=>R(this,void 0,void 0,function*(){if(null==e)return null;const t=yield this.resolveName(e);return null==t&&E.throwArgumentError("provided ENS name resolves to null","tx.to",e),t})),t.to.catch(e=>{}));const r=null!=t.maxFeePerGas||null!=t.maxPriorityFeePerGas;if(null==t.gasPrice||2!==t.type&&!r?0!==t.type&&1!==t.type||!r||E.throwArgumentError("pre-eip-1559 transaction do not support maxFeePerGas/maxPriorityFeePerGas","transaction",e):E.throwArgumentError("eip-1559 transaction do not support gasPrice","transaction",e),2!==t.type&&null!=t.type||null==t.maxFeePerGas||null==t.maxPriorityFeePerGas)if(0===t.type||1===t.type)null==t.gasPrice&&(t.gasPrice=this.getGasPrice());else{const e=yield this.getFeeData();if(null==t.type)if(null!=e.maxFeePerGas&&null!=e.maxPriorityFeePerGas)if(t.type=2,null!=t.gasPrice){const e=t.gasPrice;delete t.gasPrice,t.maxFeePerGas=e,t.maxPriorityFeePerGas=e}else null==t.maxFeePerGas&&(t.maxFeePerGas=e.maxFeePerGas),null==t.maxPriorityFeePerGas&&(t.maxPriorityFeePerGas=e.maxPriorityFeePerGas);else null!=e.gasPrice?(r&&E.throwError("network does not support EIP-1559",f.errors.UNSUPPORTED_OPERATION,{operation:"populateTransaction"}),null==t.gasPrice&&(t.gasPrice=e.gasPrice),t.type=0):E.throwError("failed to get consistent fee data",f.errors.UNSUPPORTED_OPERATION,{operation:"signer.getFeeData"});else 2===t.type&&(null==t.maxFeePerGas&&(t.maxFeePerGas=e.maxFeePerGas),null==t.maxPriorityFeePerGas&&(t.maxPriorityFeePerGas=e.maxPriorityFeePerGas))}else t.type=2;return null==t.nonce&&(t.nonce=this.getTransactionCount("pending")),null==t.gasLimit&&(t.gasLimit=this.estimateGas(t).catch(e=>{if(M.indexOf(e.code)>=0)throw e;return E.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",f.errors.UNPREDICTABLE_GAS_LIMIT,{error:e,tx:t})})),null==t.chainId?t.chainId=this.getChainId():t.chainId=Promise.all([Promise.resolve(t.chainId),this.getChainId()]).then(t=>(0!==t[1]&&t[0]!==t[1]&&E.throwArgumentError("chainId address mismatch","transaction",e),t[0])),yield y(t)})}_checkProvider(e){this.provider||E.throwError("missing provider",f.errors.UNSUPPORTED_OPERATION,{operation:e||"_checkProvider"})}static isSigner(e){return!(!e||!e._isSigner)}}var O=o(9404),_=o.n(O);const x=new f("bytes/5.7.0");function N(e){return!!e.toHexString}function D(e){return e.slice||(e.slice=function(){const t=Array.prototype.slice.call(arguments);return D(new Uint8Array(Array.prototype.slice.apply(e,t)))}),e}function z(e){return q(e)&&!(e.length%2)||B(e)}function L(e){return"number"==typeof e&&e==e&&e%1==0}function B(e){if(null==e)return!1;if(e.constructor===Uint8Array)return!0;if("string"==typeof e)return!1;if(!L(e.length)||e.length<0)return!1;for(let t=0;t<e.length;t++){const r=e[t];if(!L(r)||r<0||r>=256)return!1}return!0}function F(e,t){if(t||(t={}),"number"==typeof e){x.checkSafeUint53(e,"invalid arrayify value");const t=[];for(;e;)t.unshift(255&e),e=parseInt(String(e/256));return 0===t.length&&t.push(0),D(new Uint8Array(t))}if(t.allowMissingPrefix&&"string"==typeof e&&"0x"!==e.substring(0,2)&&(e="0x"+e),N(e)&&(e=e.toHexString()),q(e)){let r=e.substring(2);r.length%2&&("left"===t.hexPad?r="0"+r:"right"===t.hexPad?r+="0":x.throwArgumentError("hex data is odd-length","value",e));const i=[];for(let e=0;e<r.length;e+=2)i.push(parseInt(r.substring(e,e+2),16));return D(new Uint8Array(i))}return B(e)?D(new Uint8Array(e)):x.throwArgumentError("invalid arrayify value","value",e)}function j(e){const t=e.map(e=>F(e)),r=t.reduce((e,t)=>e+t.length,0),i=new Uint8Array(r);return t.reduce((e,t)=>(i.set(t,e),e+t.length),0),D(i)}function U(e){let t=F(e);if(0===t.length)return t;let r=0;for(;r<t.length&&0===t[r];)r++;return r&&(t=t.slice(r)),t}function q(e,t){return!("string"!=typeof e||!e.match(/^0x[0-9A-Fa-f]*$/)||t&&e.length!==2+2*t)}const W="0123456789abcdef";function K(e,t){if(t||(t={}),"number"==typeof e){x.checkSafeUint53(e,"invalid hexlify value");let t="";for(;e;)t=W[15&e]+t,e=Math.floor(e/16);return t.length?(t.length%2&&(t="0"+t),"0x"+t):"0x00"}if("bigint"==typeof e)return(e=e.toString(16)).length%2?"0x0"+e:"0x"+e;if(t.allowMissingPrefix&&"string"==typeof e&&"0x"!==e.substring(0,2)&&(e="0x"+e),N(e))return e.toHexString();if(q(e))return e.length%2&&("left"===t.hexPad?e="0x0"+e.substring(2):"right"===t.hexPad?e+="0":x.throwArgumentError("hex data is odd-length","value",e)),e.toLowerCase();if(B(e)){let t="0x";for(let r=0;r<e.length;r++){let i=e[r];t+=W[(240&i)>>4]+W[15&i]}return t}return x.throwArgumentError("invalid hexlify value","value",e)}function H(e){if("string"!=typeof e)e=K(e);else if(!q(e)||e.length%2)return null;return(e.length-2)/2}function V(e,t,r){return"string"!=typeof e?e=K(e):(!q(e)||e.length%2)&&x.throwArgumentError("invalid hexData","value",e),t=2+2*t,null!=r?"0x"+e.substring(t,2+2*r):"0x"+e.substring(t)}function G(e){let t="0x";return e.forEach(e=>{t+=K(e).substring(2)}),t}function J(e){const t=function(e){"string"!=typeof e&&(e=K(e)),q(e)||x.throwArgumentError("invalid hex string","value",e),e=e.substring(2);let t=0;for(;t<e.length&&"0"===e[t];)t++;return"0x"+e.substring(t)}(K(e,{hexPad:"left"}));return"0x"===t?"0x0":t}function $(e,t){for("string"!=typeof e?e=K(e):q(e)||x.throwArgumentError("invalid hex string","value",e),e.length>2*t+2&&x.throwArgumentError("value out of range","value",arguments[1]);e.length<2*t+2;)e="0x0"+e.substring(2);return e}function Q(e){const t={r:"0x",s:"0x",_vs:"0x",recoveryParam:0,v:0,yParityAndS:"0x",compact:"0x"};if(z(e)){let r=F(e);64===r.length?(t.v=27+(r[32]>>7),r[32]&=127,t.r=K(r.slice(0,32)),t.s=K(r.slice(32,64))):65===r.length?(t.r=K(r.slice(0,32)),t.s=K(r.slice(32,64)),t.v=r[64]):x.throwArgumentError("invalid signature string","signature",e),t.v<27&&(0===t.v||1===t.v?t.v+=27:x.throwArgumentError("signature invalid v byte","signature",e)),t.recoveryParam=1-t.v%2,t.recoveryParam&&(r[32]|=128),t._vs=K(r.slice(32,64))}else{if(t.r=e.r,t.s=e.s,t.v=e.v,t.recoveryParam=e.recoveryParam,t._vs=e._vs,null!=t._vs){const r=function(e,t){(e=F(e)).length>t&&x.throwArgumentError("value out of range","value",arguments[0]);const r=new Uint8Array(t);return r.set(e,t-e.length),D(r)}(F(t._vs),32);t._vs=K(r);const i=r[0]>=128?1:0;null==t.recoveryParam?t.recoveryParam=i:t.recoveryParam!==i&&x.throwArgumentError("signature recoveryParam mismatch _vs","signature",e),r[0]&=127;const n=K(r);null==t.s?t.s=n:t.s!==n&&x.throwArgumentError("signature v mismatch _vs","signature",e)}if(null==t.recoveryParam)null==t.v?x.throwArgumentError("signature missing v and recoveryParam","signature",e):0===t.v||1===t.v?t.recoveryParam=t.v:t.recoveryParam=1-t.v%2;else if(null==t.v)t.v=27+t.recoveryParam;else{const r=0===t.v||1===t.v?t.v:1-t.v%2;t.recoveryParam!==r&&x.throwArgumentError("signature recoveryParam mismatch v","signature",e)}null!=t.r&&q(t.r)?t.r=$(t.r,32):x.throwArgumentError("signature missing or invalid r","signature",e),null!=t.s&&q(t.s)?t.s=$(t.s,32):x.throwArgumentError("signature missing or invalid s","signature",e);const r=F(t.s);r[0]>=128&&x.throwArgumentError("signature s out of range","signature",e),t.recoveryParam&&(r[0]|=128);const i=K(r);t._vs&&(q(t._vs)||x.throwArgumentError("signature invalid _vs","signature",e),t._vs=$(t._vs,32)),null==t._vs?t._vs=i:t._vs!==i&&x.throwArgumentError("signature _vs mismatch v and s","signature",e)}return t.yParityAndS=t._vs,t.compact=t.r+t.yParityAndS.substring(2),t}var Y=_().BN;const X=new f("bignumber/5.7.0"),Z={},ee=9007199254740991;let te=!1;class re{constructor(e,t){e!==Z&&X.throwError("cannot call constructor directly; use BigNumber.from",f.errors.UNSUPPORTED_OPERATION,{operation:"new (BigNumber)"}),this._hex=t,this._isBigNumber=!0,Object.freeze(this)}fromTwos(e){return ne(oe(this).fromTwos(e))}toTwos(e){return ne(oe(this).toTwos(e))}abs(){return"-"===this._hex[0]?re.from(this._hex.substring(1)):this}add(e){return ne(oe(this).add(oe(e)))}sub(e){return ne(oe(this).sub(oe(e)))}div(e){return re.from(e).isZero()&&se("division-by-zero","div"),ne(oe(this).div(oe(e)))}mul(e){return ne(oe(this).mul(oe(e)))}mod(e){const t=oe(e);return t.isNeg()&&se("division-by-zero","mod"),ne(oe(this).umod(t))}pow(e){const t=oe(e);return t.isNeg()&&se("negative-power","pow"),ne(oe(this).pow(t))}and(e){const t=oe(e);return(this.isNegative()||t.isNeg())&&se("unbound-bitwise-result","and"),ne(oe(this).and(t))}or(e){const t=oe(e);return(this.isNegative()||t.isNeg())&&se("unbound-bitwise-result","or"),ne(oe(this).or(t))}xor(e){const t=oe(e);return(this.isNegative()||t.isNeg())&&se("unbound-bitwise-result","xor"),ne(oe(this).xor(t))}mask(e){return(this.isNegative()||e<0)&&se("negative-width","mask"),ne(oe(this).maskn(e))}shl(e){return(this.isNegative()||e<0)&&se("negative-width","shl"),ne(oe(this).shln(e))}shr(e){return(this.isNegative()||e<0)&&se("negative-width","shr"),ne(oe(this).shrn(e))}eq(e){return oe(this).eq(oe(e))}lt(e){return oe(this).lt(oe(e))}lte(e){return oe(this).lte(oe(e))}gt(e){return oe(this).gt(oe(e))}gte(e){return oe(this).gte(oe(e))}isNegative(){return"-"===this._hex[0]}isZero(){return oe(this).isZero()}toNumber(){try{return oe(this).toNumber()}catch(e){se("overflow","toNumber",this.toString())}return null}toBigInt(){try{return BigInt(this.toString())}catch(e){}return X.throwError("this platform does not support BigInt",f.errors.UNSUPPORTED_OPERATION,{value:this.toString()})}toString(){return arguments.length>0&&(10===arguments[0]?te||(te=!0,X.warn("BigNumber.toString does not accept any parameters; base-10 is assumed")):16===arguments[0]?X.throwError("BigNumber.toString does not accept any parameters; use bigNumber.toHexString()",f.errors.UNEXPECTED_ARGUMENT,{}):X.throwError("BigNumber.toString does not accept parameters",f.errors.UNEXPECTED_ARGUMENT,{})),oe(this).toString(10)}toHexString(){return this._hex}toJSON(e){return{type:"BigNumber",hex:this.toHexString()}}static from(e){if(e instanceof re)return e;if("string"==typeof e)return e.match(/^-?0x[0-9a-f]+$/i)?new re(Z,ie(e)):e.match(/^-?[0-9]+$/)?new re(Z,ie(new Y(e))):X.throwArgumentError("invalid BigNumber string","value",e);if("number"==typeof e)return e%1&&se("underflow","BigNumber.from",e),(e>=ee||e<=-ee)&&se("overflow","BigNumber.from",e),re.from(String(e));const t=e;if("bigint"==typeof t)return re.from(t.toString());if(B(t))return re.from(K(t));if(t)if(t.toHexString){const e=t.toHexString();if("string"==typeof e)return re.from(e)}else{let e=t._hex;if(null==e&&"BigNumber"===t.type&&(e=t.hex),"string"==typeof e&&(q(e)||"-"===e[0]&&q(e.substring(1))))return re.from(e)}return X.throwArgumentError("invalid BigNumber value","value",e)}static isBigNumber(e){return!(!e||!e._isBigNumber)}}function ie(e){if("string"!=typeof e)return ie(e.toString(16));if("-"===e[0])return"-"===(e=e.substring(1))[0]&&X.throwArgumentError("invalid hex","value",e),"0x00"===(e=ie(e))?e:"-"+e;if("0x"!==e.substring(0,2)&&(e="0x"+e),"0x"===e)return"0x00";for(e.length%2&&(e="0x0"+e.substring(2));e.length>4&&"0x00"===e.substring(0,4);)e="0x"+e.substring(4);return e}function ne(e){return re.from(ie(e))}function oe(e){const t=re.from(e).toHexString();return"-"===t[0]?new Y("-"+t.substring(3),16):new Y(t.substring(2),16)}function se(e,t,r){const i={fault:e,operation:t};return null!=r&&(i.value=r),X.throwError(e,f.errors.NUMERIC_FAULT,i)}var ae=o(1176),ce=o.n(ae);function ue(e){return"0x"+ce().keccak_256(F(e))}const he=new f("rlp/5.7.0");function de(e){const t=[];for(;e;)t.unshift(255&e),e>>=8;return t}function le(e,t,r){let i=0;for(let n=0;n<r;n++)i=256*i+e[t+n];return i}function pe(e){if(Array.isArray(e)){let t=[];if(e.forEach(function(e){t=t.concat(pe(e))}),t.length<=55)return t.unshift(192+t.length),t;const r=de(t.length);return r.unshift(247+r.length),r.concat(t)}z(e)||he.throwArgumentError("RLP object must be BytesLike","object",e);const t=Array.prototype.slice.call(F(e));if(1===t.length&&t[0]<=127)return t;if(t.length<=55)return t.unshift(128+t.length),t;const r=de(t.length);return r.unshift(183+r.length),r.concat(t)}function fe(e){return K(pe(e))}function ve(e,t,r,i){const n=[];for(;r<t+1+i;){const o=ge(e,r);n.push(o.result),(r+=o.consumed)>t+1+i&&he.throwError("child data too short",f.errors.BUFFER_OVERRUN,{})}return{consumed:1+i,result:n}}function ge(e,t){if(0===e.length&&he.throwError("data too short",f.errors.BUFFER_OVERRUN,{}),e[t]>=248){const r=e[t]-247;t+1+r>e.length&&he.throwError("data short segment too short",f.errors.BUFFER_OVERRUN,{});const i=le(e,t+1,r);return t+1+r+i>e.length&&he.throwError("data long segment too short",f.errors.BUFFER_OVERRUN,{}),ve(e,t,t+1+r,r+i)}if(e[t]>=192){const r=e[t]-192;return t+1+r>e.length&&he.throwError("data array too short",f.errors.BUFFER_OVERRUN,{}),ve(e,t,t+1,r)}if(e[t]>=184){const r=e[t]-183;t+1+r>e.length&&he.throwError("data array too short",f.errors.BUFFER_OVERRUN,{});const i=le(e,t+1,r);return t+1+r+i>e.length&&he.throwError("data array too short",f.errors.BUFFER_OVERRUN,{}),{consumed:1+r+i,result:K(e.slice(t+1+r,t+1+r+i))}}if(e[t]>=128){const r=e[t]-128;return t+1+r>e.length&&he.throwError("data too short",f.errors.BUFFER_OVERRUN,{}),{consumed:1+r,result:K(e.slice(t+1,t+1+r))}}return{consumed:1,result:K(e[t])}}function me(e){const t=F(e),r=ge(t,0);return r.consumed!==t.length&&he.throwArgumentError("invalid rlp data","data",e),r.result}const ye=new f("address/5.7.0");function be(e){q(e,20)||ye.throwArgumentError("invalid address","address",e);const t=(e=e.toLowerCase()).substring(2).split(""),r=new Uint8Array(40);for(let e=0;e<40;e++)r[e]=t[e].charCodeAt(0);const i=F(ue(r));for(let e=0;e<40;e+=2)i[e>>1]>>4>=8&&(t[e]=t[e].toUpperCase()),(15&i[e>>1])>=8&&(t[e+1]=t[e+1].toUpperCase());return"0x"+t.join("")}const Se={};for(let e=0;e<10;e++)Se[String(e)]=String(e);for(let e=0;e<26;e++)Se[String.fromCharCode(65+e)]=String(10+e);const Ce=Math.floor((we=9007199254740991,Math.log10?Math.log10(we):Math.log(we)/Math.LN10));var we;function Pe(e){let t=null;if("string"!=typeof e&&ye.throwArgumentError("invalid address","address",e),e.match(/^(0x)?[0-9a-fA-F]{40}$/))"0x"!==e.substring(0,2)&&(e="0x"+e),t=be(e),e.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&t!==e&&ye.throwArgumentError("bad address checksum","address",e);else if(e.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){for(e.substring(2,4)!==function(e){let t=(e=(e=e.toUpperCase()).substring(4)+e.substring(0,2)+"00").split("").map(e=>Se[e]).join("");for(;t.length>=Ce;){let e=t.substring(0,Ce);t=parseInt(e,10)%97+t.substring(e.length)}let r=String(98-parseInt(t,10)%97);for(;r.length<2;)r="0"+r;return r}(e)&&ye.throwArgumentError("bad icap checksum","address",e),r=e.substring(4),t=new Y(r,36).toString(16);t.length<40;)t="0"+t;t=be("0x"+t)}else ye.throwArgumentError("invalid address","address",e);var r;return t}const Ae="hash/5.7.0",Ie=new f("strings/5.7.0");var Re,Ee;function Te(e,t,r,i,n){if(e===Ee.BAD_PREFIX||e===Ee.UNEXPECTED_CONTINUE){let e=0;for(let i=t+1;i<r.length&&r[i]>>6==2;i++)e++;return e}return e===Ee.OVERRUN?r.length-t-1:0}!function(e){e.current="",e.NFC="NFC",e.NFD="NFD",e.NFKC="NFKC",e.NFKD="NFKD"}(Re||(Re={})),function(e){e.UNEXPECTED_CONTINUE="unexpected continuation byte",e.BAD_PREFIX="bad codepoint prefix",e.OVERRUN="string overrun",e.MISSING_CONTINUE="missing continuation byte",e.OUT_OF_RANGE="out of UTF-8 range",e.UTF16_SURROGATE="UTF-16 surrogate",e.OVERLONG="overlong representation"}(Ee||(Ee={}));const Me=Object.freeze({error:function(e,t,r,i,n){return Ie.throwArgumentError(`invalid codepoint at offset ${t}; ${e}`,"bytes",r)},ignore:Te,replace:function(e,t,r,i,n){return e===Ee.OVERLONG?(i.push(n),0):(i.push(65533),Te(e,t,r))}});function ke(e,t){null==t&&(t=Me.error),e=F(e);const r=[];let i=0;for(;i<e.length;){const n=e[i++];if(!(n>>7)){r.push(n);continue}let o=null,s=null;if(192==(224&n))o=1,s=127;else if(224==(240&n))o=2,s=2047;else{if(240!=(248&n)){i+=t(128==(192&n)?Ee.UNEXPECTED_CONTINUE:Ee.BAD_PREFIX,i-1,e,r);continue}o=3,s=65535}if(i-1+o>=e.length){i+=t(Ee.OVERRUN,i-1,e,r);continue}let a=n&(1<<8-o-1)-1;for(let n=0;n<o;n++){let n=e[i];if(128!=(192&n)){i+=t(Ee.MISSING_CONTINUE,i,e,r),a=null;break}a=a<<6|63&n,i++}null!==a&&(a>1114111?i+=t(Ee.OUT_OF_RANGE,i-1-o,e,r,a):a>=55296&&a<=57343?i+=t(Ee.UTF16_SURROGATE,i-1-o,e,r,a):a<=s?i+=t(Ee.OVERLONG,i-1-o,e,r,a):r.push(a))}return r}function Oe(e,t=Re.current){t!=Re.current&&(Ie.checkNormalize(),e=e.normalize(t));let r=[];for(let t=0;t<e.length;t++){const i=e.charCodeAt(t);if(i<128)r.push(i);else if(i<2048)r.push(i>>6|192),r.push(63&i|128);else if(55296==(64512&i)){t++;const n=e.charCodeAt(t);if(t>=e.length||56320!=(64512&n))throw new Error("invalid utf-8 string");const o=65536+((1023&i)<<10)+(1023&n);r.push(o>>18|240),r.push(o>>12&63|128),r.push(o>>6&63|128),r.push(63&o|128)}else r.push(i>>12|224),r.push(i>>6&63|128),r.push(63&i|128)}return F(r)}function _e(e,t){return ke(e,t).map(e=>e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode(55296+(e>>10&1023),56320+(1023&e)))).join("")}function xe(e){return ue(Oe(e))}const Ne=new f(Ae),De=new Uint8Array(32);De.fill(0);const ze=re.from(-1),Le=re.from(0),Be=re.from(1),Fe=re.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),je=$(Be.toHexString(),32),Ue=$(Le.toHexString(),32),qe={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},We=["name","version","chainId","verifyingContract","salt"];function Ke(e){return function(t){return"string"!=typeof t&&Ne.throwArgumentError(`invalid domain value for ${JSON.stringify(e)}`,`domain.${e}`,t),t}}const He={name:Ke("name"),version:Ke("version"),chainId:function(e){try{return re.from(e).toString()}catch(e){}return Ne.throwArgumentError('invalid domain value for "chainId"',"domain.chainId",e)},verifyingContract:function(e){try{return Pe(e).toLowerCase()}catch(e){}return Ne.throwArgumentError('invalid domain value "verifyingContract"',"domain.verifyingContract",e)},salt:function(e){try{const t=F(e);if(32!==t.length)throw new Error("bad length");return K(t)}catch(e){}return Ne.throwArgumentError('invalid domain value "salt"',"domain.salt",e)}};function Ve(e){{const t=e.match(/^(u?)int(\d*)$/);if(t){const r=""===t[1],i=parseInt(t[2]||"256");(i%8!=0||i>256||t[2]&&t[2]!==String(i))&&Ne.throwArgumentError("invalid numeric width","type",e);const n=Fe.mask(r?i-1:i),o=r?n.add(Be).mul(ze):Le;return function(t){const r=re.from(t);return(r.lt(o)||r.gt(n))&&Ne.throwArgumentError(`value out-of-bounds for ${e}`,"value",t),$(r.toTwos(256).toHexString(),32)}}}{const t=e.match(/^bytes(\d+)$/);if(t){const r=parseInt(t[1]);return(0===r||r>32||t[1]!==String(r))&&Ne.throwArgumentError("invalid bytes width","type",e),function(t){return F(t).length!==r&&Ne.throwArgumentError(`invalid length for ${e}`,"value",t),function(e){const t=F(e),r=t.length%32;return r?G([t,De.slice(r)]):K(t)}(t)}}}switch(e){case"address":return function(e){return $(Pe(e),32)};case"bool":return function(e){return e?je:Ue};case"bytes":return function(e){return ue(e)};case"string":return function(e){return xe(e)}}return null}function Ge(e,t){return`${e}(${t.map(({name:e,type:t})=>t+" "+e).join(",")})`}class Je{constructor(e){g(this,"types",Object.freeze(P(e))),g(this,"_encoderCache",{}),g(this,"_types",{});const t={},r={},i={};Object.keys(e).forEach(e=>{t[e]={},r[e]=[],i[e]={}});for(const i in e){const n={};e[i].forEach(o=>{n[o.name]&&Ne.throwArgumentError(`duplicate variable name ${JSON.stringify(o.name)} in ${JSON.stringify(i)}`,"types",e),n[o.name]=!0;const s=o.type.match(/^([^\x5b]*)(\x5b|$)/)[1];s===i&&Ne.throwArgumentError(`circular type reference to ${JSON.stringify(s)}`,"types",e),Ve(s)||(r[s]||Ne.throwArgumentError(`unknown type ${JSON.stringify(s)}`,"types",e),r[s].push(i),t[i][s]=!0)})}const n=Object.keys(r).filter(e=>0===r[e].length);0===n.length?Ne.throwArgumentError("missing primary type","types",e):n.length>1&&Ne.throwArgumentError(`ambiguous primary types or unused types: ${n.map(e=>JSON.stringify(e)).join(", ")}`,"types",e),g(this,"primaryType",n[0]),function n(o,s){s[o]&&Ne.throwArgumentError(`circular type reference to ${JSON.stringify(o)}`,"types",e),s[o]=!0,Object.keys(t[o]).forEach(e=>{r[e]&&(n(e,s),Object.keys(s).forEach(t=>{i[t][e]=!0}))}),delete s[o]}(this.primaryType,{});for(const t in i){const r=Object.keys(i[t]);r.sort(),this._types[t]=Ge(t,e[t])+r.map(t=>Ge(t,e[t])).join("")}}getEncoder(e){let t=this._encoderCache[e];return t||(t=this._encoderCache[e]=this._getEncoder(e)),t}_getEncoder(e){{const t=Ve(e);if(t)return t}const t=e.match(/^(.*)(\x5b(\d*)\x5d)$/);if(t){const e=t[1],r=this.getEncoder(e),i=parseInt(t[3]);return t=>{i>=0&&t.length!==i&&Ne.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",t);let n=t.map(r);return this._types[e]&&(n=n.map(ue)),ue(G(n))}}const r=this.types[e];if(r){const t=xe(this._types[e]);return e=>{const i=r.map(({name:t,type:r})=>{const i=this.getEncoder(r)(e[t]);return this._types[r]?ue(i):i});return i.unshift(t),G(i)}}return Ne.throwArgumentError(`unknown type: ${e}`,"type",e)}encodeType(e){const t=this._types[e];return t||Ne.throwArgumentError(`unknown type: ${JSON.stringify(e)}`,"name",e),t}encodeData(e,t){return this.getEncoder(e)(t)}hashStruct(e,t){return ue(this.encodeData(e,t))}encode(e){return this.encodeData(this.primaryType,e)}hash(e){return this.hashStruct(this.primaryType,e)}_visit(e,t,r){if(Ve(e))return r(e,t);const i=e.match(/^(.*)(\x5b(\d*)\x5d)$/);if(i){const e=i[1],n=parseInt(i[3]);return n>=0&&t.length!==n&&Ne.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",t),t.map(t=>this._visit(e,t,r))}const n=this.types[e];return n?n.reduce((e,{name:i,type:n})=>(e[i]=this._visit(n,t[i],r),e),{}):Ne.throwArgumentError(`unknown type: ${e}`,"type",e)}visit(e,t){return this._visit(this.primaryType,e,t)}static from(e){return new Je(e)}static getPrimaryType(e){return Je.from(e).primaryType}static hashStruct(e,t,r){return Je.from(t).hashStruct(e,r)}static hashDomain(e){const t=[];for(const r in e){const i=qe[r];i||Ne.throwArgumentError(`invalid typed-data domain key: ${JSON.stringify(r)}`,"domain",e),t.push({name:r,type:i})}return t.sort((e,t)=>We.indexOf(e.name)-We.indexOf(t.name)),Je.hashStruct("EIP712Domain",{EIP712Domain:t},e)}static encode(e,t,r){return G(["0x1901",Je.hashDomain(e),Je.from(t).hash(r)])}static hash(e,t,r){return ue(Je.encode(e,t,r))}static resolveNames(e,t,r,i){return n=this,o=void 0,a=function*(){e=b(e);const n={};e.verifyingContract&&!q(e.verifyingContract,20)&&(n[e.verifyingContract]="0x");const o=Je.from(t);o.visit(r,(e,t)=>("address"!==e||q(t,20)||(n[t]="0x"),t));for(const e in n)n[e]=yield i(e);return e.verifyingContract&&n[e.verifyingContract]&&(e.verifyingContract=n[e.verifyingContract]),r=o.visit(r,(e,t)=>"address"===e&&n[t]?n[t]:t),{domain:e,value:r}},new((s=void 0)||(s=Promise))(function(e,t){function r(e){try{c(a.next(e))}catch(e){t(e)}}function i(e){try{c(a.throw(e))}catch(e){t(e)}}function c(t){var n;t.done?e(t.value):(n=t.value,n instanceof s?n:new s(function(e){e(n)})).then(r,i)}c((a=a.apply(n,o||[])).next())});var n,o,s,a}static getPayload(e,t,r){Je.hashDomain(e);const i={},n=[];We.forEach(t=>{const r=e[t];null!=r&&(i[t]=He[t](r),n.push({name:t,type:qe[t]}))});const o=Je.from(t),s=b(t);return s.EIP712Domain?Ne.throwArgumentError("types must not contain EIP712Domain type","types.EIP712Domain",t):s.EIP712Domain=n,o.encode(r),{types:s,domain:i,primaryType:o.primaryType,message:o.visit(r,(e,t)=>{if(e.match(/^bytes(\d*)/))return K(F(t));if(e.match(/^u?int/))return re.from(t).toString();switch(e){case"address":return t.toLowerCase();case"bool":return!!t;case"string":return"string"!=typeof t&&Ne.throwArgumentError("invalid string","value",t),t}return Ne.throwArgumentError("unsupported type","type",e)})}}}const $e=re.from(0);var Qe=o(7952),Ye=o.n(Qe);function Xe(e,t,r){return r={path:t,exports:{},require:function(e,t){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(null==t&&r.path)}},e(r,r.exports),r.exports}"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==o.g?o.g:"undefined"!=typeof self&&self;var Ze=et;function et(e,t){if(!e)throw new Error(t||"Assertion failed")}et.equal=function(e,t,r){if(e!=t)throw new Error(r||"Assertion failed: "+e+" != "+t)};var tt=Xe(function(e,t){var r=t;function i(e){return 1===e.length?"0"+e:e}function n(e){for(var t="",r=0;r<e.length;r++)t+=i(e[r].toString(16));return t}r.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var r=[];if("string"!=typeof e){for(var i=0;i<e.length;i++)r[i]=0|e[i];return r}if("hex"===t)for((e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e),i=0;i<e.length;i+=2)r.push(parseInt(e[i]+e[i+1],16));else for(i=0;i<e.length;i++){var n=e.charCodeAt(i),o=n>>8,s=255&n;o?r.push(o,s):r.push(s)}return r},r.zero2=i,r.toHex=n,r.encode=function(e,t){return"hex"===t?n(e):e}}),rt=Xe(function(e,t){var r=t;r.assert=Ze,r.toArray=tt.toArray,r.zero2=tt.zero2,r.toHex=tt.toHex,r.encode=tt.encode,r.getNAF=function(e,t,r){var i=new Array(Math.max(e.bitLength(),r)+1);i.fill(0);for(var n=1<<t+1,o=e.clone(),s=0;s<i.length;s++){var a,c=o.andln(n-1);o.isOdd()?(a=c>(n>>1)-1?(n>>1)-c:c,o.isubn(a)):a=0,i[s]=a,o.iushrn(1)}return i},r.getJSF=function(e,t){var r=[[],[]];e=e.clone(),t=t.clone();for(var i,n=0,o=0;e.cmpn(-n)>0||t.cmpn(-o)>0;){var s,a,c=e.andln(3)+n&3,u=t.andln(3)+o&3;3===c&&(c=-1),3===u&&(u=-1),s=1&c?3!=(i=e.andln(7)+n&7)&&5!==i||2!==u?c:-c:0,r[0].push(s),a=1&u?3!=(i=t.andln(7)+o&7)&&5!==i||2!==c?u:-u:0,r[1].push(a),2*n===s+1&&(n=1-n),2*o===a+1&&(o=1-o),e.iushrn(1),t.iushrn(1)}return r},r.cachedProperty=function(e,t,r){var i="_"+t;e.prototype[t]=function(){return void 0!==this[i]?this[i]:this[i]=r.call(this)}},r.parseBytes=function(e){return"string"==typeof e?r.toArray(e,"hex"):e},r.intFromLE=function(e){return new(_())(e,"hex","le")}}),it=rt.getNAF,nt=rt.getJSF,ot=rt.assert;function st(e,t){this.type=e,this.p=new(_())(t.p,16),this.red=t.prime?_().red(t.prime):_().mont(this.p),this.zero=new(_())(0).toRed(this.red),this.one=new(_())(1).toRed(this.red),this.two=new(_())(2).toRed(this.red),this.n=t.n&&new(_())(t.n,16),this.g=t.g&&this.pointFromJSON(t.g,t.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var r=this.n&&this.p.div(this.n);!r||r.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}var at=st;function ct(e,t){this.curve=e,this.type=t,this.precomputed=null}st.prototype.point=function(){throw new Error("Not implemented")},st.prototype.validate=function(){throw new Error("Not implemented")},st.prototype._fixedNafMul=function(e,t){ot(e.precomputed);var r=e._getDoubles(),i=it(t,1,this._bitLength),n=(1<<r.step+1)-(r.step%2==0?2:1);n/=3;var o,s,a=[];for(o=0;o<i.length;o+=r.step){s=0;for(var c=o+r.step-1;c>=o;c--)s=(s<<1)+i[c];a.push(s)}for(var u=this.jpoint(null,null,null),h=this.jpoint(null,null,null),d=n;d>0;d--){for(o=0;o<a.length;o++)(s=a[o])===d?h=h.mixedAdd(r.points[o]):s===-d&&(h=h.mixedAdd(r.points[o].neg()));u=u.add(h)}return u.toP()},st.prototype._wnafMul=function(e,t){var r=4,i=e._getNAFPoints(r);r=i.wnd;for(var n=i.points,o=it(t,r,this._bitLength),s=this.jpoint(null,null,null),a=o.length-1;a>=0;a--){for(var c=0;a>=0&&0===o[a];a--)c++;if(a>=0&&c++,s=s.dblp(c),a<0)break;var u=o[a];ot(0!==u),s="affine"===e.type?u>0?s.mixedAdd(n[u-1>>1]):s.mixedAdd(n[-u-1>>1].neg()):u>0?s.add(n[u-1>>1]):s.add(n[-u-1>>1].neg())}return"affine"===e.type?s.toP():s},st.prototype._wnafMulAdd=function(e,t,r,i,n){var o,s,a,c=this._wnafT1,u=this._wnafT2,h=this._wnafT3,d=0;for(o=0;o<i;o++){var l=(a=t[o])._getNAFPoints(e);c[o]=l.wnd,u[o]=l.points}for(o=i-1;o>=1;o-=2){var p=o-1,f=o;if(1===c[p]&&1===c[f]){var v=[t[p],null,null,t[f]];0===t[p].y.cmp(t[f].y)?(v[1]=t[p].add(t[f]),v[2]=t[p].toJ().mixedAdd(t[f].neg())):0===t[p].y.cmp(t[f].y.redNeg())?(v[1]=t[p].toJ().mixedAdd(t[f]),v[2]=t[p].add(t[f].neg())):(v[1]=t[p].toJ().mixedAdd(t[f]),v[2]=t[p].toJ().mixedAdd(t[f].neg()));var g=[-3,-1,-5,-7,0,7,5,1,3],m=nt(r[p],r[f]);for(d=Math.max(m[0].length,d),h[p]=new Array(d),h[f]=new Array(d),s=0;s<d;s++){var y=0|m[0][s],b=0|m[1][s];h[p][s]=g[3*(y+1)+(b+1)],h[f][s]=0,u[p]=v}}else h[p]=it(r[p],c[p],this._bitLength),h[f]=it(r[f],c[f],this._bitLength),d=Math.max(h[p].length,d),d=Math.max(h[f].length,d)}var S=this.jpoint(null,null,null),C=this._wnafT4;for(o=d;o>=0;o--){for(var w=0;o>=0;){var P=!0;for(s=0;s<i;s++)C[s]=0|h[s][o],0!==C[s]&&(P=!1);if(!P)break;w++,o--}if(o>=0&&w++,S=S.dblp(w),o<0)break;for(s=0;s<i;s++){var A=C[s];0!==A&&(A>0?a=u[s][A-1>>1]:A<0&&(a=u[s][-A-1>>1].neg()),S="affine"===a.type?S.mixedAdd(a):S.add(a))}}for(o=0;o<i;o++)u[o]=null;return n?S:S.toP()},st.BasePoint=ct,ct.prototype.eq=function(){throw new Error("Not implemented")},ct.prototype.validate=function(){return this.curve.validate(this)},st.prototype.decodePoint=function(e,t){e=rt.toArray(e,t);var r=this.p.byteLength();if((4===e[0]||6===e[0]||7===e[0])&&e.length-1==2*r)return 6===e[0]?ot(e[e.length-1]%2==0):7===e[0]&&ot(e[e.length-1]%2==1),this.point(e.slice(1,1+r),e.slice(1+r,1+2*r));if((2===e[0]||3===e[0])&&e.length-1===r)return this.pointFromX(e.slice(1,1+r),3===e[0]);throw new Error("Unknown point format")},ct.prototype.encodeCompressed=function(e){return this.encode(e,!0)},ct.prototype._encode=function(e){var t=this.curve.p.byteLength(),r=this.getX().toArray("be",t);return e?[this.getY().isEven()?2:3].concat(r):[4].concat(r,this.getY().toArray("be",t))},ct.prototype.encode=function(e,t){return rt.encode(this._encode(t),e)},ct.prototype.precompute=function(e){if(this.precomputed)return this;var t={doubles:null,naf:null,beta:null};return t.naf=this._getNAFPoints(8),t.doubles=this._getDoubles(4,e),t.beta=this._getBeta(),this.precomputed=t,this},ct.prototype._hasDoubles=function(e){if(!this.precomputed)return!1;var t=this.precomputed.doubles;return!!t&&t.points.length>=Math.ceil((e.bitLength()+1)/t.step)},ct.prototype._getDoubles=function(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],i=this,n=0;n<t;n+=e){for(var o=0;o<e;o++)i=i.dbl();r.push(i)}return{step:e,points:r}},ct.prototype._getNAFPoints=function(e){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var t=[this],r=(1<<e)-1,i=1===r?null:this.dbl(),n=1;n<r;n++)t[n]=t[n-1].add(i);return{wnd:e,points:t}},ct.prototype._getBeta=function(){return null},ct.prototype.dblp=function(e){for(var t=this,r=0;r<e;r++)t=t.dbl();return t};var ut=Xe(function(e){"function"==typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}}}),ht=rt.assert;function dt(e){at.call(this,"short",e),this.a=new(_())(e.a,16).toRed(this.red),this.b=new(_())(e.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=0===this.a.fromRed().cmpn(0),this.threeA=0===this.a.fromRed().sub(this.p).cmpn(-3),this.endo=this._getEndomorphism(e),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}ut(dt,at);var lt=dt;function pt(e,t,r,i){at.BasePoint.call(this,e,"affine"),null===t&&null===r?(this.x=null,this.y=null,this.inf=!0):(this.x=new(_())(t,16),this.y=new(_())(r,16),i&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}function ft(e,t,r,i){at.BasePoint.call(this,e,"jacobian"),null===t&&null===r&&null===i?(this.x=this.curve.one,this.y=this.curve.one,this.z=new(_())(0)):(this.x=new(_())(t,16),this.y=new(_())(r,16),this.z=new(_())(i,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}dt.prototype._getEndomorphism=function(e){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var t,r;if(e.beta)t=new(_())(e.beta,16).toRed(this.red);else{var i=this._getEndoRoots(this.p);t=(t=i[0].cmp(i[1])<0?i[0]:i[1]).toRed(this.red)}if(e.lambda)r=new(_())(e.lambda,16);else{var n=this._getEndoRoots(this.n);0===this.g.mul(n[0]).x.cmp(this.g.x.redMul(t))?r=n[0]:(r=n[1],ht(0===this.g.mul(r).x.cmp(this.g.x.redMul(t))))}return{beta:t,lambda:r,basis:e.basis?e.basis.map(function(e){return{a:new(_())(e.a,16),b:new(_())(e.b,16)}}):this._getEndoBasis(r)}}},dt.prototype._getEndoRoots=function(e){var t=e===this.p?this.red:_().mont(e),r=new(_())(2).toRed(t).redInvm(),i=r.redNeg(),n=new(_())(3).toRed(t).redNeg().redSqrt().redMul(r);return[i.redAdd(n).fromRed(),i.redSub(n).fromRed()]},dt.prototype._getEndoBasis=function(e){for(var t,r,i,n,o,s,a,c,u,h=this.n.ushrn(Math.floor(this.n.bitLength()/2)),d=e,l=this.n.clone(),p=new(_())(1),f=new(_())(0),v=new(_())(0),g=new(_())(1),m=0;0!==d.cmpn(0);){var y=l.div(d);c=l.sub(y.mul(d)),u=v.sub(y.mul(p));var b=g.sub(y.mul(f));if(!i&&c.cmp(h)<0)t=a.neg(),r=p,i=c.neg(),n=u;else if(i&&2===++m)break;a=c,l=d,d=c,v=p,p=u,g=f,f=b}o=c.neg(),s=u;var S=i.sqr().add(n.sqr());return o.sqr().add(s.sqr()).cmp(S)>=0&&(o=t,s=r),i.negative&&(i=i.neg(),n=n.neg()),o.negative&&(o=o.neg(),s=s.neg()),[{a:i,b:n},{a:o,b:s}]},dt.prototype._endoSplit=function(e){var t=this.endo.basis,r=t[0],i=t[1],n=i.b.mul(e).divRound(this.n),o=r.b.neg().mul(e).divRound(this.n),s=n.mul(r.a),a=o.mul(i.a),c=n.mul(r.b),u=o.mul(i.b);return{k1:e.sub(s).sub(a),k2:c.add(u).neg()}},dt.prototype.pointFromX=function(e,t){(e=new(_())(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),i=r.redSqrt();if(0!==i.redSqr().redSub(r).cmp(this.zero))throw new Error("invalid point");var n=i.fromRed().isOdd();return(t&&!n||!t&&n)&&(i=i.redNeg()),this.point(e,i)},dt.prototype.validate=function(e){if(e.inf)return!0;var t=e.x,r=e.y,i=this.a.redMul(t),n=t.redSqr().redMul(t).redIAdd(i).redIAdd(this.b);return 0===r.redSqr().redISub(n).cmpn(0)},dt.prototype._endoWnafMulAdd=function(e,t,r){for(var i=this._endoWnafT1,n=this._endoWnafT2,o=0;o<e.length;o++){var s=this._endoSplit(t[o]),a=e[o],c=a._getBeta();s.k1.negative&&(s.k1.ineg(),a=a.neg(!0)),s.k2.negative&&(s.k2.ineg(),c=c.neg(!0)),i[2*o]=a,i[2*o+1]=c,n[2*o]=s.k1,n[2*o+1]=s.k2}for(var u=this._wnafMulAdd(1,i,n,2*o,r),h=0;h<2*o;h++)i[h]=null,n[h]=null;return u},ut(pt,at.BasePoint),dt.prototype.point=function(e,t,r){return new pt(this,e,t,r)},dt.prototype.pointFromJSON=function(e,t){return pt.fromJSON(this,e,t)},pt.prototype._getBeta=function(){if(this.curve.endo){var e=this.precomputed;if(e&&e.beta)return e.beta;var t=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(e){var r=this.curve,i=function(e){return r.point(e.x.redMul(r.endo.beta),e.y)};e.beta=t,t.precomputed={beta:null,naf:e.naf&&{wnd:e.naf.wnd,points:e.naf.points.map(i)},doubles:e.doubles&&{step:e.doubles.step,points:e.doubles.points.map(i)}}}return t}},pt.prototype.toJSON=function(){return this.precomputed?[this.x,this.y,this.precomputed&&{doubles:this.precomputed.doubles&&{step:this.precomputed.doubles.step,points:this.precomputed.doubles.points.slice(1)},naf:this.precomputed.naf&&{wnd:this.precomputed.naf.wnd,points:this.precomputed.naf.points.slice(1)}}]:[this.x,this.y]},pt.fromJSON=function(e,t,r){"string"==typeof t&&(t=JSON.parse(t));var i=e.point(t[0],t[1],r);if(!t[2])return i;function n(t){return e.point(t[0],t[1],r)}var o=t[2];return i.precomputed={beta:null,doubles:o.doubles&&{step:o.doubles.step,points:[i].concat(o.doubles.points.map(n))},naf:o.naf&&{wnd:o.naf.wnd,points:[i].concat(o.naf.points.map(n))}},i},pt.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"},pt.prototype.isInfinity=function(){return this.inf},pt.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(0===this.x.cmp(e.x))return this.curve.point(null,null);var t=this.y.redSub(e.y);0!==t.cmpn(0)&&(t=t.redMul(this.x.redSub(e.x).redInvm()));var r=t.redSqr().redISub(this.x).redISub(e.x),i=t.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,i)},pt.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(0===e.cmpn(0))return this.curve.point(null,null);var t=this.curve.a,r=this.x.redSqr(),i=e.redInvm(),n=r.redAdd(r).redIAdd(r).redIAdd(t).redMul(i),o=n.redSqr().redISub(this.x.redAdd(this.x)),s=n.redMul(this.x.redSub(o)).redISub(this.y);return this.curve.point(o,s)},pt.prototype.getX=function(){return this.x.fromRed()},pt.prototype.getY=function(){return this.y.fromRed()},pt.prototype.mul=function(e){return e=new(_())(e,16),this.isInfinity()?this:this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)},pt.prototype.mulAdd=function(e,t,r){var i=[this,t],n=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(i,n):this.curve._wnafMulAdd(1,i,n,2)},pt.prototype.jmulAdd=function(e,t,r){var i=[this,t],n=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(i,n,!0):this.curve._wnafMulAdd(1,i,n,2,!0)},pt.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||0===this.x.cmp(e.x)&&0===this.y.cmp(e.y))},pt.prototype.neg=function(e){if(this.inf)return this;var t=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var r=this.precomputed,i=function(e){return e.neg()};t.precomputed={naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(i)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(i)}}}return t},pt.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},ut(ft,at.BasePoint),dt.prototype.jpoint=function(e,t,r){return new ft(this,e,t,r)},ft.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),t=e.redSqr(),r=this.x.redMul(t),i=this.y.redMul(t).redMul(e);return this.curve.point(r,i)},ft.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},ft.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.z.redSqr(),r=this.z.redSqr(),i=this.x.redMul(t),n=e.x.redMul(r),o=this.y.redMul(t.redMul(e.z)),s=e.y.redMul(r.redMul(this.z)),a=i.redSub(n),c=o.redSub(s);if(0===a.cmpn(0))return 0!==c.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var u=a.redSqr(),h=u.redMul(a),d=i.redMul(u),l=c.redSqr().redIAdd(h).redISub(d).redISub(d),p=c.redMul(d.redISub(l)).redISub(o.redMul(h)),f=this.z.redMul(e.z).redMul(a);return this.curve.jpoint(l,p,f)},ft.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var t=this.z.redSqr(),r=this.x,i=e.x.redMul(t),n=this.y,o=e.y.redMul(t).redMul(this.z),s=r.redSub(i),a=n.redSub(o);if(0===s.cmpn(0))return 0!==a.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var c=s.redSqr(),u=c.redMul(s),h=r.redMul(c),d=a.redSqr().redIAdd(u).redISub(h).redISub(h),l=a.redMul(h.redISub(d)).redISub(n.redMul(u)),p=this.z.redMul(s);return this.curve.jpoint(d,l,p)},ft.prototype.dblp=function(e){if(0===e)return this;if(this.isInfinity())return this;if(!e)return this.dbl();var t;if(this.curve.zeroA||this.curve.threeA){var r=this;for(t=0;t<e;t++)r=r.dbl();return r}var i=this.curve.a,n=this.curve.tinv,o=this.x,s=this.y,a=this.z,c=a.redSqr().redSqr(),u=s.redAdd(s);for(t=0;t<e;t++){var h=o.redSqr(),d=u.redSqr(),l=d.redSqr(),p=h.redAdd(h).redIAdd(h).redIAdd(i.redMul(c)),f=o.redMul(d),v=p.redSqr().redISub(f.redAdd(f)),g=f.redISub(v),m=p.redMul(g);m=m.redIAdd(m).redISub(l);var y=u.redMul(a);t+1<e&&(c=c.redMul(l)),o=v,a=y,u=m}return this.curve.jpoint(o,u.redMul(n),a)},ft.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},ft.prototype._zeroDbl=function(){var e,t,r;if(this.zOne){var i=this.x.redSqr(),n=this.y.redSqr(),o=n.redSqr(),s=this.x.redAdd(n).redSqr().redISub(i).redISub(o);s=s.redIAdd(s);var a=i.redAdd(i).redIAdd(i),c=a.redSqr().redISub(s).redISub(s),u=o.redIAdd(o);u=(u=u.redIAdd(u)).redIAdd(u),e=c,t=a.redMul(s.redISub(c)).redISub(u),r=this.y.redAdd(this.y)}else{var h=this.x.redSqr(),d=this.y.redSqr(),l=d.redSqr(),p=this.x.redAdd(d).redSqr().redISub(h).redISub(l);p=p.redIAdd(p);var f=h.redAdd(h).redIAdd(h),v=f.redSqr(),g=l.redIAdd(l);g=(g=g.redIAdd(g)).redIAdd(g),e=v.redISub(p).redISub(p),t=f.redMul(p.redISub(e)).redISub(g),r=(r=this.y.redMul(this.z)).redIAdd(r)}return this.curve.jpoint(e,t,r)},ft.prototype._threeDbl=function(){var e,t,r;if(this.zOne){var i=this.x.redSqr(),n=this.y.redSqr(),o=n.redSqr(),s=this.x.redAdd(n).redSqr().redISub(i).redISub(o);s=s.redIAdd(s);var a=i.redAdd(i).redIAdd(i).redIAdd(this.curve.a),c=a.redSqr().redISub(s).redISub(s);e=c;var u=o.redIAdd(o);u=(u=u.redIAdd(u)).redIAdd(u),t=a.redMul(s.redISub(c)).redISub(u),r=this.y.redAdd(this.y)}else{var h=this.z.redSqr(),d=this.y.redSqr(),l=this.x.redMul(d),p=this.x.redSub(h).redMul(this.x.redAdd(h));p=p.redAdd(p).redIAdd(p);var f=l.redIAdd(l),v=(f=f.redIAdd(f)).redAdd(f);e=p.redSqr().redISub(v),r=this.y.redAdd(this.z).redSqr().redISub(d).redISub(h);var g=d.redSqr();g=(g=(g=g.redIAdd(g)).redIAdd(g)).redIAdd(g),t=p.redMul(f.redISub(e)).redISub(g)}return this.curve.jpoint(e,t,r)},ft.prototype._dbl=function(){var e=this.curve.a,t=this.x,r=this.y,i=this.z,n=i.redSqr().redSqr(),o=t.redSqr(),s=r.redSqr(),a=o.redAdd(o).redIAdd(o).redIAdd(e.redMul(n)),c=t.redAdd(t),u=(c=c.redIAdd(c)).redMul(s),h=a.redSqr().redISub(u.redAdd(u)),d=u.redISub(h),l=s.redSqr();l=(l=(l=l.redIAdd(l)).redIAdd(l)).redIAdd(l);var p=a.redMul(d).redISub(l),f=r.redAdd(r).redMul(i);return this.curve.jpoint(h,p,f)},ft.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var e=this.x.redSqr(),t=this.y.redSqr(),r=this.z.redSqr(),i=t.redSqr(),n=e.redAdd(e).redIAdd(e),o=n.redSqr(),s=this.x.redAdd(t).redSqr().redISub(e).redISub(i),a=(s=(s=(s=s.redIAdd(s)).redAdd(s).redIAdd(s)).redISub(o)).redSqr(),c=i.redIAdd(i);c=(c=(c=c.redIAdd(c)).redIAdd(c)).redIAdd(c);var u=n.redIAdd(s).redSqr().redISub(o).redISub(a).redISub(c),h=t.redMul(u);h=(h=h.redIAdd(h)).redIAdd(h);var d=this.x.redMul(a).redISub(h);d=(d=d.redIAdd(d)).redIAdd(d);var l=this.y.redMul(u.redMul(c.redISub(u)).redISub(s.redMul(a)));l=(l=(l=l.redIAdd(l)).redIAdd(l)).redIAdd(l);var p=this.z.redAdd(s).redSqr().redISub(r).redISub(a);return this.curve.jpoint(d,l,p)},ft.prototype.mul=function(e,t){return e=new(_())(e,t),this.curve._wnafMul(this,e)},ft.prototype.eq=function(e){if("affine"===e.type)return this.eq(e.toJ());if(this===e)return!0;var t=this.z.redSqr(),r=e.z.redSqr();if(0!==this.x.redMul(r).redISub(e.x.redMul(t)).cmpn(0))return!1;var i=t.redMul(this.z),n=r.redMul(e.z);return 0===this.y.redMul(n).redISub(e.y.redMul(i)).cmpn(0)},ft.prototype.eqXToP=function(e){var t=this.z.redSqr(),r=e.toRed(this.curve.red).redMul(t);if(0===this.x.cmp(r))return!0;for(var i=e.clone(),n=this.curve.redN.redMul(t);;){if(i.iadd(this.curve.n),i.cmp(this.curve.p)>=0)return!1;if(r.redIAdd(n),0===this.x.cmp(r))return!0}},ft.prototype.inspect=function(){return this.isInfinity()?"<EC JPoint Infinity>":"<EC JPoint x: "+this.x.toString(16,2)+" y: "+this.y.toString(16,2)+" z: "+this.z.toString(16,2)+">"},ft.prototype.isInfinity=function(){return 0===this.z.cmpn(0)};var vt=Xe(function(e,t){var r=t;r.base=at,r.short=lt,r.mont=null,r.edwards=null}),gt=Xe(function(e,t){var r,i=t,n=rt.assert;function o(e){"short"===e.type?this.curve=new vt.short(e):"edwards"===e.type?this.curve=new vt.edwards(e):this.curve=new vt.mont(e),this.g=this.curve.g,this.n=this.curve.n,this.hash=e.hash,n(this.g.validate(),"Invalid curve"),n(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function s(e,t){Object.defineProperty(i,e,{configurable:!0,enumerable:!0,get:function(){var r=new o(t);return Object.defineProperty(i,e,{configurable:!0,enumerable:!0,value:r}),r}})}i.PresetCurve=o,s("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:Ye().sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),s("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:Ye().sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),s("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:Ye().sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),s("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:Ye().sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),s("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:Ye().sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),s("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:Ye().sha256,gRed:!1,g:["9"]}),s("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:Ye().sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{r=null.crash()}catch(e){r=void 0}s("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:Ye().sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",r]})});function mt(e){if(!(this instanceof mt))return new mt(e);this.hash=e.hash,this.predResist=!!e.predResist,this.outLen=this.hash.outSize,this.minEntropy=e.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var t=tt.toArray(e.entropy,e.entropyEnc||"hex"),r=tt.toArray(e.nonce,e.nonceEnc||"hex"),i=tt.toArray(e.pers,e.persEnc||"hex");Ze(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,r,i)}var yt=mt;mt.prototype._init=function(e,t,r){var i=e.concat(t).concat(r);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var n=0;n<this.V.length;n++)this.K[n]=0,this.V[n]=1;this._update(i),this._reseed=1,this.reseedInterval=281474976710656},mt.prototype._hmac=function(){return new(Ye().hmac)(this.hash,this.K)},mt.prototype._update=function(e){var t=this._hmac().update(this.V).update([0]);e&&(t=t.update(e)),this.K=t.digest(),this.V=this._hmac().update(this.V).digest(),e&&(this.K=this._hmac().update(this.V).update([1]).update(e).digest(),this.V=this._hmac().update(this.V).digest())},mt.prototype.reseed=function(e,t,r,i){"string"!=typeof t&&(i=r,r=t,t=null),e=tt.toArray(e,t),r=tt.toArray(r,i),Ze(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(r||[])),this._reseed=1},mt.prototype.generate=function(e,t,r,i){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof t&&(i=r,r=t,t=null),r&&(r=tt.toArray(r,i||"hex"),this._update(r));for(var n=[];n.length<e;)this.V=this._hmac().update(this.V).digest(),n=n.concat(this.V);var o=n.slice(0,e);return this._update(r),this._reseed++,tt.encode(o,t)};var bt=rt.assert;function St(e,t){this.ec=e,this.priv=null,this.pub=null,t.priv&&this._importPrivate(t.priv,t.privEnc),t.pub&&this._importPublic(t.pub,t.pubEnc)}var Ct=St;St.fromPublic=function(e,t,r){return t instanceof St?t:new St(e,{pub:t,pubEnc:r})},St.fromPrivate=function(e,t,r){return t instanceof St?t:new St(e,{priv:t,privEnc:r})},St.prototype.validate=function(){var e=this.getPublic();return e.isInfinity()?{result:!1,reason:"Invalid public key"}:e.validate()?e.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},St.prototype.getPublic=function(e,t){return"string"==typeof e&&(t=e,e=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),t?this.pub.encode(t,e):this.pub},St.prototype.getPrivate=function(e){return"hex"===e?this.priv.toString(16,2):this.priv},St.prototype._importPrivate=function(e,t){this.priv=new(_())(e,t||16),this.priv=this.priv.umod(this.ec.curve.n)},St.prototype._importPublic=function(e,t){if(e.x||e.y)return"mont"===this.ec.curve.type?bt(e.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||bt(e.x&&e.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(e.x,e.y));this.pub=this.ec.curve.decodePoint(e,t)},St.prototype.derive=function(e){return e.validate()||bt(e.validate(),"public point not validated"),e.mul(this.priv).getX()},St.prototype.sign=function(e,t,r){return this.ec.sign(e,this,t,r)},St.prototype.verify=function(e,t){return this.ec.verify(e,t,this)},St.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"};var wt=rt.assert;function Pt(e,t){if(e instanceof Pt)return e;this._importDER(e,t)||(wt(e.r&&e.s,"Signature without r or s"),this.r=new(_())(e.r,16),this.s=new(_())(e.s,16),void 0===e.recoveryParam?this.recoveryParam=null:this.recoveryParam=e.recoveryParam)}var At=Pt;function It(){this.place=0}function Rt(e,t){var r=e[t.place++];if(!(128&r))return r;var i=15&r;if(0===i||i>4)return!1;for(var n=0,o=0,s=t.place;o<i;o++,s++)n<<=8,n|=e[s],n>>>=0;return!(n<=127)&&(t.place=s,n)}function Et(e){for(var t=0,r=e.length-1;!e[t]&&!(128&e[t+1])&&t<r;)t++;return 0===t?e:e.slice(t)}function Tt(e,t){if(t<128)e.push(t);else{var r=1+(Math.log(t)/Math.LN2>>>3);for(e.push(128|r);--r;)e.push(t>>>(r<<3)&255);e.push(t)}}Pt.prototype._importDER=function(e,t){e=rt.toArray(e,t);var r=new It;if(48!==e[r.place++])return!1;var i=Rt(e,r);if(!1===i)return!1;if(i+r.place!==e.length)return!1;if(2!==e[r.place++])return!1;var n=Rt(e,r);if(!1===n)return!1;var o=e.slice(r.place,n+r.place);if(r.place+=n,2!==e[r.place++])return!1;var s=Rt(e,r);if(!1===s)return!1;if(e.length!==s+r.place)return!1;var a=e.slice(r.place,s+r.place);if(0===o[0]){if(!(128&o[1]))return!1;o=o.slice(1)}if(0===a[0]){if(!(128&a[1]))return!1;a=a.slice(1)}return this.r=new(_())(o),this.s=new(_())(a),this.recoveryParam=null,!0},Pt.prototype.toDER=function(e){var t=this.r.toArray(),r=this.s.toArray();for(128&t[0]&&(t=[0].concat(t)),128&r[0]&&(r=[0].concat(r)),t=Et(t),r=Et(r);!(r[0]||128&r[1]);)r=r.slice(1);var i=[2];Tt(i,t.length),(i=i.concat(t)).push(2),Tt(i,r.length);var n=i.concat(r),o=[48];return Tt(o,n.length),o=o.concat(n),rt.encode(o,e)};var Mt=function(){throw new Error("unsupported")},kt=rt.assert;function Ot(e){if(!(this instanceof Ot))return new Ot(e);"string"==typeof e&&(kt(Object.prototype.hasOwnProperty.call(gt,e),"Unknown curve "+e),e=gt[e]),e instanceof gt.PresetCurve&&(e={curve:e}),this.curve=e.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=e.curve.g,this.g.precompute(e.curve.n.bitLength()+1),this.hash=e.hash||e.curve.hash}var _t=Ot;Ot.prototype.keyPair=function(e){return new Ct(this,e)},Ot.prototype.keyFromPrivate=function(e,t){return Ct.fromPrivate(this,e,t)},Ot.prototype.keyFromPublic=function(e,t){return Ct.fromPublic(this,e,t)},Ot.prototype.genKeyPair=function(e){e||(e={});for(var t=new yt({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||Mt(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),r=this.n.byteLength(),i=this.n.sub(new(_())(2));;){var n=new(_())(t.generate(r));if(!(n.cmp(i)>0))return n.iaddn(1),this.keyFromPrivate(n)}},Ot.prototype._truncateToN=function(e,t){var r=8*e.byteLength()-this.n.bitLength();return r>0&&(e=e.ushrn(r)),!t&&e.cmp(this.n)>=0?e.sub(this.n):e},Ot.prototype.sign=function(e,t,r,i){"object"==typeof r&&(i=r,r=null),i||(i={}),t=this.keyFromPrivate(t,r),e=this._truncateToN(new(_())(e,16));for(var n=this.n.byteLength(),o=t.getPrivate().toArray("be",n),s=e.toArray("be",n),a=new yt({hash:this.hash,entropy:o,nonce:s,pers:i.pers,persEnc:i.persEnc||"utf8"}),c=this.n.sub(new(_())(1)),u=0;;u++){var h=i.k?i.k(u):new(_())(a.generate(this.n.byteLength()));if(!((h=this._truncateToN(h,!0)).cmpn(1)<=0||h.cmp(c)>=0)){var d=this.g.mul(h);if(!d.isInfinity()){var l=d.getX(),p=l.umod(this.n);if(0!==p.cmpn(0)){var f=h.invm(this.n).mul(p.mul(t.getPrivate()).iadd(e));if(0!==(f=f.umod(this.n)).cmpn(0)){var v=(d.getY().isOdd()?1:0)|(0!==l.cmp(p)?2:0);return i.canonical&&f.cmp(this.nh)>0&&(f=this.n.sub(f),v^=1),new At({r:p,s:f,recoveryParam:v})}}}}}},Ot.prototype.verify=function(e,t,r,i){e=this._truncateToN(new(_())(e,16)),r=this.keyFromPublic(r,i);var n=(t=new At(t,"hex")).r,o=t.s;if(n.cmpn(1)<0||n.cmp(this.n)>=0)return!1;if(o.cmpn(1)<0||o.cmp(this.n)>=0)return!1;var s,a=o.invm(this.n),c=a.mul(e).umod(this.n),u=a.mul(n).umod(this.n);return this.curve._maxwellTrick?!(s=this.g.jmulAdd(c,r.getPublic(),u)).isInfinity()&&s.eqXToP(n):!(s=this.g.mulAdd(c,r.getPublic(),u)).isInfinity()&&0===s.getX().umod(this.n).cmp(n)},Ot.prototype.recoverPubKey=function(e,t,r,i){kt((3&r)===r,"The recovery param is more than two bits"),t=new At(t,i);var n=this.n,o=new(_())(e),s=t.r,a=t.s,c=1&r,u=r>>1;if(s.cmp(this.curve.p.umod(this.curve.n))>=0&&u)throw new Error("Unable to find sencond key candinate");s=u?this.curve.pointFromX(s.add(this.curve.n),c):this.curve.pointFromX(s,c);var h=t.r.invm(n),d=n.sub(o).mul(h).umod(n),l=a.mul(h).umod(n);return this.g.mulAdd(d,s,l)},Ot.prototype.getKeyRecoveryParam=function(e,t,r,i){if(null!==(t=new At(t,i)).recoveryParam)return t.recoveryParam;for(var n=0;n<4;n++){var o;try{o=this.recoverPubKey(e,t,n)}catch(e){continue}if(o.eq(r))return n}throw new Error("Unable to find valid recovery factor")};var xt=Xe(function(e,t){var r=t;r.version="6.5.4",r.utils=rt,r.rand=function(){throw new Error("unsupported")},r.curve=vt,r.curves=gt,r.ec=_t,r.eddsa=null}).ec;const Nt=new f("signing-key/5.7.0");let Dt=null;function zt(){return Dt||(Dt=new xt("secp256k1")),Dt}class Lt{constructor(e){g(this,"curve","secp256k1"),g(this,"privateKey",K(e)),32!==H(this.privateKey)&&Nt.throwArgumentError("invalid private key","privateKey","[[ REDACTED ]]");const t=zt().keyFromPrivate(F(this.privateKey));g(this,"publicKey","0x"+t.getPublic(!1,"hex")),g(this,"compressedPublicKey","0x"+t.getPublic(!0,"hex")),g(this,"_isSigningKey",!0)}_addPoint(e){const t=zt().keyFromPublic(F(this.publicKey)),r=zt().keyFromPublic(F(e));return"0x"+t.pub.add(r.pub).encodeCompressed("hex")}signDigest(e){const t=zt().keyFromPrivate(F(this.privateKey)),r=F(e);32!==r.length&&Nt.throwArgumentError("bad digest length","digest",e);const i=t.sign(r,{canonical:!0});return Q({recoveryParam:i.recoveryParam,r:$("0x"+i.r.toString(16),32),s:$("0x"+i.s.toString(16),32)})}computeSharedSecret(e){const t=zt().keyFromPrivate(F(this.privateKey)),r=zt().keyFromPublic(F(Bt(e)));return $("0x"+t.derive(r.getPublic()).toString(16),32)}static isSigningKey(e){return!(!e||!e._isSigningKey)}}function Bt(e,t){const r=F(e);if(32===r.length){const e=new Lt(r);return t?"0x"+zt().keyFromPrivate(r).getPublic(!0,"hex"):e.publicKey}return 33===r.length?t?K(r):"0x"+zt().keyFromPublic(r).getPublic(!1,"hex"):65===r.length?t?"0x"+zt().keyFromPublic(r).getPublic(!0,"hex"):K(r):Nt.throwArgumentError("invalid public or private key","key","[REDACTED]")}const Ft=new f("transactions/5.7.0");var jt;function Ut(e){return"0x"===e?null:Pe(e)}function qt(e){return"0x"===e?$e:re.from(e)}function Wt(e,t){return function(e){return Pe(V(ue(V(Bt(e),1)),12))}(function(e,t){const r=Q(t),i={r:F(r.r),s:F(r.s)};return"0x"+zt().recoverPubKey(F(e),i,r.recoveryParam).encode("hex",!1)}(F(e),t))}function Kt(e,t){const r=U(re.from(e).toHexString());return r.length>32&&Ft.throwArgumentError("invalid length for "+t,"transaction:"+t,e),r}function Ht(e,t){return{address:Pe(e),storageKeys:(t||[]).map((t,r)=>(32!==H(t)&&Ft.throwArgumentError("invalid access list storageKey",`accessList[${e}:${r}]`,t),t.toLowerCase()))}}function Vt(e){if(Array.isArray(e))return e.map((e,t)=>Array.isArray(e)?(e.length>2&&Ft.throwArgumentError("access list expected to be [ address, storageKeys[] ]",`value[${t}]`,e),Ht(e[0],e[1])):Ht(e.address,e.storageKeys));const t=Object.keys(e).map(t=>{const r=e[t].reduce((e,t)=>(e[t]=!0,e),{});return Ht(t,Object.keys(r).sort())});return t.sort((e,t)=>e.address.localeCompare(t.address)),t}function Gt(e){return Vt(e).map(e=>[e.address,e.storageKeys])}function Jt(e,t){if(null!=e.gasPrice){const t=re.from(e.gasPrice),r=re.from(e.maxFeePerGas||0);t.eq(r)||Ft.throwArgumentError("mismatch EIP-1559 gasPrice != maxFeePerGas","tx",{gasPrice:t,maxFeePerGas:r})}const r=[Kt(e.chainId||0,"chainId"),Kt(e.nonce||0,"nonce"),Kt(e.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),Kt(e.maxFeePerGas||0,"maxFeePerGas"),Kt(e.gasLimit||0,"gasLimit"),null!=e.to?Pe(e.to):"0x",Kt(e.value||0,"value"),e.data||"0x",Gt(e.accessList||[])];if(t){const e=Q(t);r.push(Kt(e.recoveryParam,"recoveryParam")),r.push(U(e.r)),r.push(U(e.s))}return G(["0x02",fe(r)])}function $t(e,t){const r=[Kt(e.chainId||0,"chainId"),Kt(e.nonce||0,"nonce"),Kt(e.gasPrice||0,"gasPrice"),Kt(e.gasLimit||0,"gasLimit"),null!=e.to?Pe(e.to):"0x",Kt(e.value||0,"value"),e.data||"0x",Gt(e.accessList||[])];if(t){const e=Q(t);r.push(Kt(e.recoveryParam,"recoveryParam")),r.push(U(e.r)),r.push(U(e.s))}return G(["0x01",fe(r)])}function Qt(e,t,r){try{const r=qt(t[0]).toNumber();if(0!==r&&1!==r)throw new Error("bad recid");e.v=r}catch(e){Ft.throwArgumentError("invalid v for transaction type: 1","v",t[0])}e.r=$(t[1],32),e.s=$(t[2],32);try{const t=ue(r(e));e.from=Wt(t,{r:e.r,s:e.s,recoveryParam:e.v})}catch(e){}}function Yt(e){e=atob(e);const t=[];for(let r=0;r<e.length;r++)t.push(e.charCodeAt(r));return F(t)}function Xt(e){e=F(e);let t="";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return btoa(t)}!function(e){e[e.legacy=0]="legacy",e[e.eip2930=1]="eip2930",e[e.eip1559=2]="eip1559"}(jt||(jt={}));function Zt(e,t){return r=this,i=void 0,o=function*(){null==t&&(t={});const r={method:t.method||"GET",headers:t.headers||{},body:t.body||void 0};if(!0!==t.skipFetchSetup&&(r.mode="cors",r.cache="no-cache",r.credentials="same-origin",r.redirect="follow",r.referrer="client"),null!=t.fetchOptions){const e=t.fetchOptions;e.mode&&(r.mode=e.mode),e.cache&&(r.cache=e.cache),e.credentials&&(r.credentials=e.credentials),e.redirect&&(r.redirect=e.redirect),e.referrer&&(r.referrer=e.referrer)}const i=yield fetch(e,r),n=yield i.arrayBuffer(),o={};return i.headers.forEach?i.headers.forEach((e,t)=>{o[t.toLowerCase()]=e}):i.headers.keys().forEach(e=>{o[e.toLowerCase()]=i.headers.get(e)}),{headers:o,statusCode:i.status,statusMessage:i.statusText,body:F(new Uint8Array(n))}},new((n=void 0)||(n=Promise))(function(e,t){function s(e){try{c(o.next(e))}catch(e){t(e)}}function a(e){try{c(o.throw(e))}catch(e){t(e)}}function c(t){var r;t.done?e(t.value):(r=t.value,r instanceof n?r:new n(function(e){e(r)})).then(s,a)}c((o=o.apply(r,i||[])).next())});var r,i,n,o}const er=new f("web/5.7.0");function tr(e){return new Promise(t=>{setTimeout(t,e)})}function rr(e,t){if(null==e)return null;if("string"==typeof e)return e;if(z(e)){if(t&&("text"===t.split("/")[0]||"application/json"===t.split(";")[0].trim()))try{return _e(e)}catch(e){}return K(e)}return e}function ir(e,t,r){let i=null;if(null!=t){i=Oe(t);const r="string"==typeof e?{url:e}:b(e);r.headers?0!==Object.keys(r.headers).filter(e=>"content-type"===e.toLowerCase()).length||(r.headers=b(r.headers),r.headers["content-type"]="application/json"):r.headers={"content-type":"application/json"},e=r}return function(e,t,r){const i="object"==typeof e&&null!=e.throttleLimit?e.throttleLimit:12;er.assertArgument(i>0&&i%1==0,"invalid connection throttle limit","connection.throttleLimit",i);const n="object"==typeof e?e.throttleCallback:null,o="object"==typeof e&&"number"==typeof e.throttleSlotInterval?e.throttleSlotInterval:100;er.assertArgument(o>0&&o%1==0,"invalid connection throttle slot interval","connection.throttleSlotInterval",o);const s="object"==typeof e&&!!e.errorPassThrough,a={};let c=null;const u={method:"GET"};let h=!1,d=12e4;if("string"==typeof e)c=e;else if("object"==typeof e){if(null!=e&&null!=e.url||er.throwArgumentError("missing URL","connection.url",e),c=e.url,"number"==typeof e.timeout&&e.timeout>0&&(d=e.timeout),e.headers)for(const t in e.headers)a[t.toLowerCase()]={key:t,value:String(e.headers[t])},["if-none-match","if-modified-since"].indexOf(t.toLowerCase())>=0&&(h=!0);if(u.allowGzip=!!e.allowGzip,null!=e.user&&null!=e.password){"https:"!==c.substring(0,6)&&!0!==e.allowInsecureAuthentication&&er.throwError("basic authentication requires a secure https url",f.errors.INVALID_ARGUMENT,{argument:"url",url:c,user:e.user,password:"[REDACTED]"});const t=e.user+":"+e.password;a.authorization={key:"Authorization",value:"Basic "+Xt(Oe(t))}}null!=e.skipFetchSetup&&(u.skipFetchSetup=!!e.skipFetchSetup),null!=e.fetchOptions&&(u.fetchOptions=b(e.fetchOptions))}const l=new RegExp("^data:([a-z0-9-]+/[a-z0-9-]+);base64,(.*)$","i"),p=c?c.match(l):null;if(p)try{const e={statusCode:200,statusMessage:"OK",headers:{"content-type":p[1]},body:Yt(p[2])};let t=e.body;return r&&(t=r(e.body,e)),Promise.resolve(t)}catch(e){er.throwError("processing response error",f.errors.SERVER_ERROR,{body:rr(p[1],p[2]),error:e,requestBody:null,requestMethod:"GET",url:c})}t&&(u.method="POST",u.body=t,null==a["content-type"]&&(a["content-type"]={key:"Content-Type",value:"application/octet-stream"}),null==a["content-length"]&&(a["content-length"]={key:"Content-Length",value:String(t.length)}));const v={};Object.keys(a).forEach(e=>{const t=a[e];v[t.key]=t.value}),u.headers=v;const g=function(){let e=null;return{promise:new Promise(function(t,r){d&&(e=setTimeout(()=>{null!=e&&(e=null,r(er.makeError("timeout",f.errors.TIMEOUT,{requestBody:rr(u.body,v["content-type"]),requestMethod:u.method,timeout:d,url:c})))},d))}),cancel:function(){null!=e&&(clearTimeout(e),e=null)}}}(),m=function(){return e=this,t=void 0,d=function*(){for(let e=0;e<i;e++){let t=null;try{if(t=yield Zt(c,u),e<i)if(301===t.statusCode||302===t.statusCode){const e=t.headers.location||"";if("GET"===u.method&&e.match(/^https:/)){c=t.headers.location;continue}}else if(429===t.statusCode){let r=!0;if(n&&(r=yield n(e,c)),r){let r=0;const i=t.headers["retry-after"];r="string"==typeof i&&i.match(/^[1-9][0-9]*$/)?1e3*parseInt(i):o*parseInt(String(Math.random()*Math.pow(2,e))),yield tr(r);continue}}}catch(e){t=e.response,null==t&&(g.cancel(),er.throwError("missing response",f.errors.SERVER_ERROR,{requestBody:rr(u.body,v["content-type"]),requestMethod:u.method,serverError:e,url:c}))}let a=t.body;if(h&&304===t.statusCode?a=null:!s&&(t.statusCode<200||t.statusCode>=300)&&(g.cancel(),er.throwError("bad response",f.errors.SERVER_ERROR,{status:t.statusCode,headers:t.headers,body:rr(a,t.headers?t.headers["content-type"]:null),requestBody:rr(u.body,v["content-type"]),requestMethod:u.method,url:c})),r)try{const e=yield r(a,t);return g.cancel(),e}catch(r){if(r.throttleRetry&&e<i){let t=!0;if(n&&(t=yield n(e,c)),t){const t=o*parseInt(String(Math.random()*Math.pow(2,e)));yield tr(t);continue}}g.cancel(),er.throwError("processing response error",f.errors.SERVER_ERROR,{body:rr(a,t.headers?t.headers["content-type"]:null),error:r,requestBody:rr(u.body,v["content-type"]),requestMethod:u.method,url:c})}return g.cancel(),a}return er.throwError("failed response",f.errors.SERVER_ERROR,{requestBody:rr(u.body,v["content-type"]),requestMethod:u.method,url:c})},new((a=void 0)||(a=Promise))(function(r,i){function n(e){try{s(d.next(e))}catch(e){i(e)}}function o(e){try{s(d.throw(e))}catch(e){i(e)}}function s(e){var t;e.done?r(e.value):(t=e.value,t instanceof a?t:new a(function(e){e(t)})).then(n,o)}s((d=d.apply(e,t||[])).next())});var e,t,a,d}();return Promise.race([g.promise,m])}(e,i,(e,t)=>{let i=null;if(null!=e)try{i=JSON.parse(_e(e))}catch(t){er.throwError("invalid JSON",f.errors.SERVER_ERROR,{body:e,error:t})}return r&&(i=r(i,t)),i})}function nr(e,t){return t||(t={}),null==(t=b(t)).floor&&(t.floor=0),null==t.ceiling&&(t.ceiling=1e4),null==t.interval&&(t.interval=250),new Promise(function(r,i){let n=null,o=!1;const s=()=>!o&&(o=!0,n&&clearTimeout(n),!0);t.timeout&&(n=setTimeout(()=>{s()&&i(new Error("timeout"))},t.timeout));const a=t.retryLimit;let c=0;!function n(){return e().then(function(e){if(void 0!==e)s()&&r(e);else if(t.oncePoll)t.oncePoll.once("poll",n);else if(t.onceBlock)t.onceBlock.once("block",n);else if(!o){if(c++,c>a)return void(s()&&i(new Error("retry limit reached")));let e=t.interval*parseInt(String(Math.random()*Math.pow(2,c)));e<t.floor&&(e=t.floor),e>t.ceiling&&(e=t.ceiling),setTimeout(n,e)}return null},function(e){s()&&i(e)})}()})}const or=new f("abstract-provider/5.7.0");class sr extends A{static isForkEvent(e){return!(!e||!e._isForkEvent)}}class ar{constructor(){or.checkAbstract(new.target,ar),g(this,"_isProvider",!0)}getFeeData(){return e=this,t=void 0,i=function*(){const{block:e,gasPrice:t}=yield y({block:this.getBlock("latest"),gasPrice:this.getGasPrice().catch(e=>null)});let r=null,i=null,n=null;return e&&e.baseFeePerGas&&(r=e.baseFeePerGas,n=re.from("1500000000"),i=e.baseFeePerGas.mul(2).add(n)),{lastBaseFeePerGas:r,maxFeePerGas:i,maxPriorityFeePerGas:n,gasPrice:t}},new((r=void 0)||(r=Promise))(function(n,o){function s(e){try{c(i.next(e))}catch(e){o(e)}}function a(e){try{c(i.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?n(e.value):(t=e.value,t instanceof r?t:new r(function(e){e(t)})).then(s,a)}c((i=i.apply(e,t||[])).next())});var e,t,r,i}addListener(e,t){return this.on(e,t)}removeListener(e,t){return this.off(e,t)}static isProvider(e){return!(!e||!e._isProvider)}}class cr{constructor(e){g(this,"alphabet",e),g(this,"base",e.length),g(this,"_alphabetMap",{}),g(this,"_leader",e.charAt(0));for(let t=0;t<e.length;t++)this._alphabetMap[e.charAt(t)]=t}encode(e){let t=F(e);if(0===t.length)return"";let r=[0];for(let e=0;e<t.length;++e){let i=t[e];for(let e=0;e<r.length;++e)i+=r[e]<<8,r[e]=i%this.base,i=i/this.base|0;for(;i>0;)r.push(i%this.base),i=i/this.base|0}let i="";for(let e=0;0===t[e]&&e<t.length-1;++e)i+=this._leader;for(let e=r.length-1;e>=0;--e)i+=this.alphabet[r[e]];return i}decode(e){if("string"!=typeof e)throw new TypeError("Expected String");let t=[];if(0===e.length)return new Uint8Array(t);t.push(0);for(let r=0;r<e.length;r++){let i=this._alphabetMap[e[r]];if(void 0===i)throw new Error("Non-base"+this.base+" character");let n=i;for(let e=0;e<t.length;++e)n+=t[e]*this.base,t[e]=255&n,n>>=8;for(;n>0;)t.push(255&n),n>>=8}for(let r=0;e[r]===this._leader&&r<e.length-1;++r)t.push(0);return F(new Uint8Array(t.reverse()))}}new cr("abcdefghijklmnopqrstuvwxyz234567");const ur=new cr("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz");function hr(e,t){null==t&&(t=1);const r=[],i=r.forEach,n=function(e,t){i.call(e,function(e){t>0&&Array.isArray(e)?n(e,t-1):r.push(e)})};return n(e,t),r}function dr(e){return 1&e?~e>>1:e>>1}function lr(e,t){let r=Array(e);for(let i=0,n=-1;i<e;i++)r[i]=n+=1+t();return r}function pr(e,t){let r=Array(e);for(let i=0,n=0;i<e;i++)r[i]=n+=dr(t());return r}function fr(e,t){let r=lr(e(),e),i=e(),n=lr(i,e),o=function(e,t){let r=Array(e);for(let i=0;i<e;i++)r[i]=1+t();return r}(i,e);for(let e=0;e<i;e++)for(let t=0;t<o[e];t++)r.push(n[e]+t);return t?r.map(e=>t[e]):r}function vr(e,t,r){let i=Array(e).fill(void 0).map(()=>[]);for(let n=0;n<t;n++)pr(e,r).forEach((e,t)=>i[t].push(e));return i}function gr(e,t){let r=1+t(),i=t(),n=function(e){let t=[];for(;;){let r=e();if(0==r)break;t.push(r)}return t}(t);return hr(vr(n.length,1+e,t).map((e,t)=>{const o=e[0],s=e.slice(1);return Array(n[t]).fill(void 0).map((e,t)=>{let n=t*i;return[o+t*r,s.map(e=>e+n)]})}))}function mr(e,t){return vr(1+t(),1+e,t).map(e=>[e[0],e.slice(1)])}const yr=function(e){let t=0;return()=>e[t++]}(function(e){let t=0;function r(){return e[t++]<<8|e[t++]}let i=r(),n=1,o=[0,1];for(let e=1;e<i;e++)o.push(n+=r());let s=r(),a=t;t+=s;let c=0,u=0;function h(){return 0==c&&(u=u<<8|e[t++],c=8),u>>--c&1}const d=Math.pow(2,31),l=d>>>1,p=l>>1,f=d-1;let v=0;for(let e=0;e<31;e++)v=v<<1|h();let g=[],m=0,y=d;for(;;){let e=Math.floor(((v-m+1)*n-1)/y),t=0,r=i;for(;r-t>1;){let i=t+r>>>1;e<o[i]?r=i:t=i}if(0==t)break;g.push(t);let s=m+Math.floor(y*o[t]/n),a=m+Math.floor(y*o[t+1]/n)-1;for(;0==((s^a)&l);)v=v<<1&f|h(),s=s<<1&f,a=a<<1&f|1;for(;s&~a&p;)v=v&l|v<<1&f>>>1|h(),s=s<<1^l,a=(a^l)<<1|l|1;m=s,y=1+a-s}let b=i-4;return g.map(t=>{switch(t-b){case 3:return b+65792+(e[a++]<<16|e[a++]<<8|e[a++]);case 2:return b+256+(e[a++]<<8|e[a++]);case 1:return b+e[a++];default:return t-1}})}(Yt("AEQF2AO2DEsA2wIrAGsBRABxAN8AZwCcAEwAqgA0AGwAUgByADcATAAVAFYAIQAyACEAKAAYAFgAGwAjABQAMAAmADIAFAAfABQAKwATACoADgAbAA8AHQAYABoAGQAxADgALAAoADwAEwA9ABMAGgARAA4ADwAWABMAFgAIAA8AHgQXBYMA5BHJAS8JtAYoAe4AExozi0UAH21tAaMnBT8CrnIyhrMDhRgDygIBUAEHcoFHUPe8AXBjAewCjgDQR8IICIcEcQLwATXCDgzvHwBmBoHNAqsBdBcUAykgDhAMShskMgo8AY8jqAQfAUAfHw8BDw87MioGlCIPBwZCa4ELatMAAMspJVgsDl8AIhckSg8XAHdvTwBcIQEiDT4OPhUqbyECAEoAS34Aej8Ybx83JgT/Xw8gHxZ/7w8RICxPHA9vBw+Pfw8PHwAPFv+fAsAvCc8vEr8ivwD/EQ8Bol8OEBa/A78hrwAPCU8vESNvvwWfHwNfAVoDHr+ZAAED34YaAdJPAK7PLwSEgDLHAGo1Pz8Pvx9fUwMrpb8O/58VTzAPIBoXIyQJNF8hpwIVAT8YGAUADDNBaX3RAMomJCg9EhUeA29MABsZBTMNJipjOhc19gcIDR8bBwQHEggCWi6DIgLuAQYA+BAFCha3A5XiAEsqM7UFFgFLhAMjFTMYE1Klnw74nRVBG/ASCm0BYRN/BrsU3VoWy+S0vV8LQx+vN8gF2AC2AK5EAWwApgYDKmAAroQ0NDQ0AT+OCg7wAAIHRAbpNgVcBV0APTA5BfbPFgMLzcYL/QqqA82eBALKCjQCjqYCht0/k2+OAsXQAoP3ASTKDgDw6ACKAUYCMpIKJpRaAE4A5womABzZvs0REEKiACIQAd5QdAECAj4Ywg/wGqY2AVgAYADYvAoCGAEubA0gvAY2ALAAbpbvqpyEAGAEpgQAJgAG7gAgAEACmghUFwCqAMpAINQIwC4DthRAAPcycKgApoIdABwBfCisABoATwBqASIAvhnSBP8aH/ECeAKXAq40NjgDBTwFYQU6AXs3oABgAD4XNgmcCY1eCl5tIFZeUqGgyoNHABgAEQAaABNwWQAmABMATPMa3T34ADldyprmM1M2XociUQgLzvwAXT3xABgAEQAaABNwIGFAnADD8AAgAD4BBJWzaCcIAIEBFMAWwKoAAdq9BWAF5wLQpALEtQAKUSGkahR4GnJM+gsAwCgeFAiUAECQ0BQuL8AAIAAAADKeIheclvFqQAAETr4iAMxIARMgAMIoHhQIAn0E0pDQFC4HhznoAAAAIAI2C0/4lvFqQAAETgBJJwYCAy4ABgYAFAA8MBKYEH4eRhTkAjYeFcgACAYAeABsOqyQ5gRwDayqugEgaIIAtgoACgDmEABmBAWGme5OBJJA2m4cDeoAmITWAXwrMgOgAGwBCh6CBXYF1Tzg1wKAAFdiuABRAFwAXQBsAG8AdgBrAHYAbwCEAHEwfxQBVE5TEQADVFhTBwBDANILAqcCzgLTApQCrQL6vAAMAL8APLhNBKkE6glGKTAU4Dr4N2EYEwBCkABKk8rHAbYBmwIoAiU4Ajf/Aq4CowCAANIChzgaNBsCsTgeODcFXrgClQKdAqQBiQGYAqsCsjTsNHsfNPA0ixsAWTWiOAMFPDQSNCk2BDZHNow2TTZUNhk28Jk9VzI3QkEoAoICoQKwAqcAQAAxBV4FXbS9BW47YkIXP1ciUqs05DS/FwABUwJW11e6nHuYZmSh/RAYA8oMKvZ8KASoUAJYWAJ6ILAsAZSoqjpgA0ocBIhmDgDWAAawRDQoAAcuAj5iAHABZiR2AIgiHgCaAU68ACxuHAG0ygM8MiZIAlgBdF4GagJqAPZOHAMuBgoATkYAsABiAHgAMLoGDPj0HpKEBAAOJgAuALggTAHWAeAMEDbd20Uege0ADwAWADkAQgA9OHd+2MUQZBBhBgNNDkxxPxUQArEPqwvqERoM1irQ090ANK4H8ANYB/ADWANYB/AH8ANYB/ADWANYA1gDWBwP8B/YxRBkD00EcgWTBZAE2wiIJk4RhgctCNdUEnQjHEwDSgEBIypJITuYMxAlR0wRTQgIATZHbKx9PQNMMbBU+pCnA9AyVDlxBgMedhKlAC8PeCE1uk6DekxxpQpQT7NX9wBFBgASqwAS5gBJDSgAUCwGPQBI4zTYABNGAE2bAE3KAExdGABKaAbgAFBXAFCOAFBJABI2SWdObALDOq0//QomCZhvwHdTBkIQHCemEPgMNAG2ATwN7kvZBPIGPATKH34ZGg/OlZ0Ipi3eDO4m5C6igFsj9iqEBe5L9TzeC05RaQ9aC2YJ5DpkgU8DIgEOIowK3g06CG4Q9ArKbA3mEUYHOgPWSZsApgcCCxIdNhW2JhFirQsKOXgG/Br3C5AmsBMqev0F1BoiBk4BKhsAANAu6IWxWjJcHU9gBgQLJiPIFKlQIQ0mQLh4SRocBxYlqgKSQ3FKiFE3HpQh9zw+DWcuFFF9B/Y8BhlQC4I8n0asRQ8R0z6OPUkiSkwtBDaALDAnjAnQD4YMunxzAVoJIgmyDHITMhEYN8YIOgcaLpclJxYIIkaWYJsE+KAD9BPSAwwFQAlCBxQDthwuEy8VKgUOgSXYAvQ21i60ApBWgQEYBcwPJh/gEFFH4Q7qCJwCZgOEJewALhUiABginAhEZABgj9lTBi7MCMhqbSN1A2gU6GIRdAeSDlgHqBw0FcAc4nDJXgyGCSiksAlcAXYJmgFgBOQICjVcjKEgQmdUi1kYnCBiQUBd/QIyDGYVoES+h3kCjA9sEhwBNgF0BzoNAgJ4Ee4RbBCWCOyGBTW2M/k6JgRQIYQgEgooA1BszwsoJvoM+WoBpBJjAw00PnfvZ6xgtyUX/gcaMsZBYSHyC5NPzgydGsIYQ1QvGeUHwAP0GvQn60FYBgADpAQUOk4z7wS+C2oIjAlAAEoOpBgH2BhrCnKM0QEyjAG4mgNYkoQCcJAGOAcMAGgMiAV65gAeAqgIpAAGANADWAA6Aq4HngAaAIZCAT4DKDABIuYCkAOUCDLMAZYwAfQqBBzEDBYA+DhuSwLDsgKAa2ajBd5ZAo8CSjYBTiYEBk9IUgOwcuIA3ABMBhTgSAEWrEvMG+REAeBwLADIAPwABjYHBkIBzgH0bgC4AWALMgmjtLYBTuoqAIQAFmwB2AKKAN4ANgCA8gFUAE4FWvoF1AJQSgESMhksWGIBvAMgATQBDgB6BsyOpsoIIARuB9QCEBwV4gLvLwe2AgMi4BPOQsYCvd9WADIXUu5eZwqoCqdeaAC0YTQHMnM9UQAPH6k+yAdy/BZIiQImSwBQ5gBQQzSaNTFWSTYBpwGqKQK38AFtqwBI/wK37gK3rQK3sAK6280C0gK33AK3zxAAUEIAUD9SklKDArekArw5AEQAzAHCO147WTteO1k7XjtZO147WTteO1kDmChYI03AVU0oJqkKbV9GYewMpw3VRMk6ShPcYFJgMxPJLbgUwhXPJVcZPhq9JwYl5VUKDwUt1GYxCC00dhe9AEApaYNCY4ceMQpMHOhTklT5LRwAskujM7ANrRsWREEFSHXuYisWDwojAmSCAmJDXE6wXDchAqH4AmiZAmYKAp+FOBwMAmY8AmYnBG8EgAN/FAN+kzkHOXgYOYM6JCQCbB4CMjc4CwJtyAJtr/CLADRoRiwBaADfAOIASwYHmQyOAP8MwwAOtgJ3MAJ2o0ACeUxEAni7Hl3cRa9G9AJ8QAJ6yQJ9CgJ88UgBSH5kJQAsFklZSlwWGErNAtECAtDNSygDiFADh+dExpEzAvKiXQQDA69Lz0wuJgTQTU1NsAKLQAKK2cIcCB5EaAa4Ao44Ao5dQZiCAo7aAo5deVG1UzYLUtVUhgKT/AKTDQDqAB1VH1WwVdEHLBwplocy4nhnRTw6ApegAu+zWCKpAFomApaQApZ9nQCqWa1aCoJOADwClrYClk9cRVzSApnMApllXMtdCBoCnJw5wzqeApwXAp+cAp65iwAeEDIrEAKd8gKekwC2PmE1YfACntQCoG8BqgKeoCACnk+mY8lkKCYsAiewAiZ/AqD8AqBN2AKmMAKlzwKoAAB+AqfzaH1osgAESmodatICrOQCrK8CrWgCrQMCVx4CVd0CseLYAx9PbJgCsr4OArLpGGzhbWRtSWADJc4Ctl08QG6RAylGArhfArlIFgK5K3hwN3DiAr0aAy2zAzISAr6JcgMDM3ICvhtzI3NQAsPMAsMFc4N0TDZGdOEDPKgDPJsDPcACxX0CxkgCxhGKAshqUgLIRQLJUALJLwJkngLd03h6YniveSZL0QMYpGcDAmH1GfSVJXsMXpNevBICz2wCz20wTFTT9BSgAMeuAs90ASrrA04TfkwGAtwoAtuLAtJQA1JdA1NgAQIDVY2AikABzBfuYUZ2AILPg44C2sgC2d+EEYRKpz0DhqYAMANkD4ZyWvoAVgLfZgLeuXR4AuIw7RUB8zEoAfScAfLTiALr9ALpcXoAAur6AurlAPpIAboC7ooC652Wq5cEAu5AA4XhmHpw4XGiAvMEAGoDjheZlAL3FAORbwOSiAL3mQL52gL4Z5odmqy8OJsfA52EAv77ARwAOp8dn7QDBY4DpmsDptoA0sYDBmuhiaIGCgMMSgFgASACtgNGAJwEgLpoBgC8BGzAEowcggCEDC6kdjoAJAM0C5IKRoABZCgiAIzw3AYBLACkfng9ogigkgNmWAN6AEQCvrkEVqTGAwCsBRbAA+4iQkMCHR072jI2PTbUNsk2RjY5NvA23TZKNiU3EDcZN5I+RTxDRTBCJkK5VBYKFhZfwQCWygU3AJBRHpu+OytgNxa61A40GMsYjsn7BVwFXQVcBV0FaAVdBVwFXQVcBV0FXAVdBVwFXUsaCNyKAK4AAQUHBwKU7oICoW1e7jAEzgPxA+YDwgCkBFDAwADABKzAAOxFLhitA1UFTDeyPkM+bj51QkRCuwTQWWQ8X+0AWBYzsACNA8xwzAGm7EZ/QisoCTAbLDs6fnLfb8H2GccsbgFw13M1HAVkBW/Jxsm9CNRO8E8FDD0FBQw9FkcClOYCoMFegpDfADgcMiA2AJQACB8AsigKAIzIEAJKeBIApY5yPZQIAKQiHb4fvj5BKSRPQrZCOz0oXyxgOywfKAnGbgMClQaCAkILXgdeCD9IIGUgQj5fPoY+dT52Ao5CM0dAX9BTVG9SDzFwWTQAbxBzJF/lOEIQQglCCkKJIAls5AcClQICoKPMODEFxhi6KSAbiyfIRrMjtCgdWCAkPlFBIitCsEJRzAbMAV/OEyQzDg0OAQQEJ36i328/Mk9AybDJsQlq3tDRApUKAkFzXf1d/j9uALYP6hCoFgCTGD8kPsFKQiobrm0+zj0KSD8kPnVCRBwMDyJRTHFgMTJa5rwXQiQ2YfI/JD7BMEJEHGINTw4TOFlIRzwJO0icMQpyPyQ+wzJCRBv6DVgnKB01NgUKj2bwYzMqCoBkznBgEF+zYDIocwRIX+NgHj4HICNfh2C4CwdwFWpTG/lgUhYGAwRfv2Ts8mAaXzVgml/XYIJfuWC4HI1gUF9pYJZgMR6ilQHMAOwLAlDRefC0in4AXAEJA6PjCwc0IamOANMMCAECRQDFNRTZBgd+CwQlRA+r6+gLBDEFBnwUBXgKATIArwAGRAAHA3cDdAN2A3kDdwN9A3oDdQN7A30DfAN4A3oDfQAYEAAlAtYASwMAUAFsAHcKAHcAmgB3AHUAdQB2AHVu8UgAygDAAHcAdQB1AHYAdQALCgB3AAsAmgB3AAsCOwB3AAtu8UgAygDAAHgKAJoAdwB3AHUAdQB2AHUAeAB1AHUAdgB1bvFIAMoAwAALCgCaAHcACwB3AAsCOwB3AAtu8UgAygDAAH4ACwGgALcBpwC6AahdAu0COwLtbvFIAMoAwAALCgCaAu0ACwLtAAsCOwLtAAtu8UgAygDAA24ACwNvAAu0VsQAAzsAABCkjUIpAAsAUIusOggWcgMeBxVsGwL67U/2HlzmWOEeOgALASvuAAseAfpKUpnpGgYJDCIZM6YyARUE9ThqAD5iXQgnAJYJPnOzw0ZAEZxEKsIAkA4DhAHnTAIDxxUDK0lxCQlPYgIvIQVYJQBVqE1GakUAKGYiDToSBA1EtAYAXQJYAIF8GgMHRyAAIAjOe9YncekRAA0KACUrjwE7Ayc6AAYWAqaiKG4McEcqANoN3+Mg9TwCBhIkuCny+JwUQ29L008JluRxu3K+oAdqiHOqFH0AG5SUIfUJ5SxCGfxdipRzqTmT4V5Zb+r1Uo4Vm+NqSSEl2mNvR2JhIa8SpYO6ntdwFXHCWTCK8f2+Hxo7uiG3drDycAuKIMP5bhi06ACnqArH1rz4Rqg//lm6SgJGEVbF9xJHISaR6HxqxSnkw6shDnelHKNEfGUXSJRJ1GcsmtJw25xrZMDK9gXSm1/YMkdX4/6NKYOdtk/NQ3/NnDASjTc3fPjIjW/5sVfVObX2oTDWkr1dF9f3kxBsD3/3aQO8hPfRz+e0uEiJqt1161griu7gz8hDDwtpy+F+BWtefnKHZPAxcZoWbnznhJpy0e842j36bcNzGnIEusgGX0a8ZxsnjcSsPDZ09yZ36fCQbriHeQ72JRMILNl6ePPf2HWoVwgWAm1fb3V2sAY0+B6rAXqSwPBgseVmoqsBTSrm91+XasMYYySI8eeRxH3ZvHkMz3BQ5aJ3iUVbYPNM3/7emRtjlsMgv/9VyTsyt/mK+8fgWeT6SoFaclXqn42dAIsvAarF5vNNWHzKSkKQ/8Hfk5ZWK7r9yliOsooyBjRhfkHP4Q2DkWXQi6FG/9r/IwbmkV5T7JSopHKn1pJwm9tb5Ot0oyN1Z2mPpKXHTxx2nlK08fKk1hEYA8WgVVWL5lgx0iTv+KdojJeU23ZDjmiubXOxVXJKKi2Wjuh2HLZOFLiSC7Tls5SMh4f+Pj6xUSrNjFqLGehRNB8lC0QSLNmkJJx/wSG3MnjE9T1CkPwJI0wH2lfzwETIiVqUxg0dfu5q39Gt+hwdcxkhhNvQ4TyrBceof3Mhs/IxFci1HmHr4FMZgXEEczPiGCx0HRwzAqDq2j9AVm1kwN0mRVLWLylgtoPNapF5cY4Y1wJh/e0BBwZj44YgZrDNqvD/9Hv7GFYdUQeDJuQ3EWI4HaKqavU1XjC/n41kT4L79kqGq0kLhdTZvgP3TA3fS0ozVz+5piZsoOtIvBUFoMKbNcmBL6YxxaUAusHB38XrS8dQMnQwJfUUkpRoGr5AUeWicvBTzyK9g77+yCkf5PAysL7r/JjcZgrbvRpMW9iyaxZvKO6ceZN2EwIxKwVFPuvFuiEPGCoagbMo+SpydLrXqBzNCDGFCrO/rkcwa2xhokQZ5CdZ0AsU3JfSqJ6n5I14YA+P/uAgfhPU84Tlw7cEFfp7AEE8ey4sP12PTt4Cods1GRgDOB5xvyiR5m+Bx8O5nBCNctU8BevfV5A08x6RHd5jcwPTMDSZJOedIZ1cGQ704lxbAzqZOP05ZxaOghzSdvFBHYqomATARyAADK4elP8Ly3IrUZKfWh23Xy20uBUmLS4Pfagu9+oyVa2iPgqRP3F2CTUsvJ7+RYnN8fFZbU/HVvxvcFFDKkiTqV5UBZ3Gz54JAKByi9hkKMZJvuGgcSYXFmw08UyoQyVdfTD1/dMkCHXcTGAKeROgArsvmRrQTLUOXioOHGK2QkjHuoYFgXciZoTJd6Fs5q1QX1G+p/e26hYsEf7QZD1nnIyl/SFkNtYYmmBhpBrxl9WbY0YpHWRuw2Ll/tj9mD8P4snVzJl4F9J+1arVeTb9E5r2ILH04qStjxQNwn3m4YNqxmaNbLAqW2TN6LidwuJRqS+NXbtqxoeDXpxeGWmxzSkWxjkyCkX4NQRme6q5SAcC+M7+9ETfA/EwrzQajKakCwYyeunP6ZFlxU2oMEn1Pz31zeStW74G406ZJFCl1wAXIoUKkWotYEpOuXB1uVNxJ63dpJEqfxBeptwIHNrPz8BllZoIcBoXwgfJ+8VAUnVPvRvexnw0Ma/WiGYuJO5y8QTvEYBigFmhUxY5RqzE8OcywN/8m4UYrlaniJO75XQ6KSo9+tWHlu+hMi0UVdiKQp7NelnoZUzNaIyBPVeOwK6GNp+FfHuPOoyhaWuNvTYFkvxscMQWDh+zeFCFkgwbXftiV23ywJ4+uwRqmg9k3KzwIQpzppt8DBBOMbrqwQM5Gb05sEwdKzMiAqOloaA/lr0KA+1pr0/+HiWoiIjHA/wir2nIuS3PeU/ji3O6ZwoxcR1SZ9FhtLC5S0FIzFhbBWcGVP/KpxOPSiUoAdWUpqKH++6Scz507iCcxYI6rdMBICPJZea7OcmeFw5mObJSiqpjg2UoWNIs+cFhyDSt6geV5qgi3FunmwwDoGSMgerFOZGX1m0dMCYo5XOruxO063dwENK9DbnVM9wYFREzh4vyU1WYYJ/LRRp6oxgjqP/X5a8/4Af6p6NWkQferzBmXme0zY/4nwMJm/wd1tIqSwGz+E3xPEAOoZlJit3XddD7/BT1pllzOx+8bmQtANQ/S6fZexc6qi3W+Q2xcmXTUhuS5mpHQRvcxZUN0S5+PL9lXWUAaRZhEH8hTdAcuNMMCuVNKTEGtSUKNi3O6KhSaTzck8csZ2vWRZ+d7mW8c4IKwXIYd25S/zIftPkwPzufjEvOHWVD1m+FjpDVUTV0DGDuHj6QnaEwLu/dEgdLQOg9E1Sro9XHJ8ykLAwtPu+pxqKDuFexqON1sKQm7rwbE1E68UCfA/erovrTCG+DBSNg0l4goDQvZN6uNlbyLpcZAwj2UclycvLpIZMgv4yRlpb3YuMftozorbcGVHt/VeDV3+Fdf1TP0iuaCsPi2G4XeGhsyF1ubVDxkoJhmniQ0/jSg/eYML9KLfnCFgISWkp91eauR3IQvED0nAPXK+6hPCYs+n3+hCZbiskmVMG2da+0EsZPonUeIY8EbfusQXjsK/eFDaosbPjEfQS0RKG7yj5GG69M7MeO1HmiUYocgygJHL6M1qzUDDwUSmr99V7Sdr2F3JjQAJY+F0yH33Iv3+C9M38eML7gTgmNu/r2bUMiPvpYbZ6v1/IaESirBHNa7mPKn4dEmYg7v/+HQgPN1G79jBQ1+soydfDC2r+h2Bl/KIc5KjMK7OH6nb1jLsNf0EHVe2KBiE51ox636uyG6Lho0t3J34L5QY/ilE3mikaF4HKXG1mG1rCevT1Vv6GavltxoQe/bMrpZvRggnBxSEPEeEzkEdOxTnPXHVjUYdw8JYvjB/o7Eegc3Ma+NUxLLnsK0kJlinPmUHzHGtrk5+CAbVzFOBqpyy3QVUnzTDfC/0XD94/okH+OB+i7g9lolhWIjSnfIb+Eq43ZXOWmwvjyV/qqD+t0e+7mTEM74qP/Ozt8nmC7mRpyu63OB4KnUzFc074SqoyPUAgM+/TJGFo6T44EHnQU4X4z6qannVqgw/U7zCpwcmXV1AubIrvOmkKHazJAR55ePjp5tLBsN8vAqs3NAHdcEHOR2xQ0lsNAFzSUuxFQCFYvXLZJdOj9p4fNq6p0HBGUik2YzaI4xySy91KzhQ0+q1hjxvImRwPRf76tChlRkhRCi74NXZ9qUNeIwP+s5p+3m5nwPdNOHgSLD79n7O9m1n1uDHiMntq4nkYwV5OZ1ENbXxFd4PgrlvavZsyUO4MqYlqqn1O8W/I1dEZq5dXhrbETLaZIbC2Kj/Aa/QM+fqUOHdf0tXAQ1huZ3cmWECWSXy/43j35+Mvq9xws7JKseriZ1pEWKc8qlzNrGPUGcVgOa9cPJYIJsGnJTAUsEcDOEVULO5x0rXBijc1lgXEzQQKhROf8zIV82w8eswc78YX11KYLWQRcgHNJElBxfXr72lS2RBSl07qTKorO2uUDZr3sFhYsvnhLZn0A94KRzJ/7DEGIAhW5ZWFpL8gEwu1aLA9MuWZzNwl8Oze9Y+bX+v9gywRVnoB5I/8kXTXU3141yRLYrIOOz6SOnyHNy4SieqzkBXharjfjqq1q6tklaEbA8Qfm2DaIPs7OTq/nvJBjKfO2H9bH2cCMh1+5gspfycu8f/cuuRmtDjyqZ7uCIMyjdV3a+p3fqmXsRx4C8lujezIFHnQiVTXLXuI1XrwN3+siYYj2HHTvESUx8DlOTXpak9qFRK+L3mgJ1WsD7F4cu1aJoFoYQnu+wGDMOjJM3kiBQWHCcvhJ/HRdxodOQp45YZaOTA22Nb4XKCVxqkbwMYFhzYQYIAnCW8FW14uf98jhUG2zrKhQQ0q0CEq0t5nXyvUyvR8DvD69LU+g3i+HFWQMQ8PqZuHD+sNKAV0+M6EJC0szq7rEr7B5bQ8BcNHzvDMc9eqB5ZCQdTf80Obn4uzjwpYU7SISdtV0QGa9D3Wrh2BDQtpBKxaNFV+/Cy2P/Sv+8s7Ud0Fd74X4+o/TNztWgETUapy+majNQ68Lq3ee0ZO48VEbTZYiH1Co4OlfWef82RWeyUXo7woM03PyapGfikTnQinoNq5z5veLpeMV3HCAMTaZmA1oGLAn7XS3XYsz+XK7VMQsc4XKrmDXOLU/pSXVNUq8dIqTba///3x6LiLS6xs1xuCAYSfcQ3+rQgmu7uvf3THKt5Ooo97TqcbRqxx7EASizaQCBQllG/rYxVapMLgtLbZS64w1MDBMXX+PQpBKNwqUKOf2DDRDUXQf9EhOS0Qj4nTmlA8dzSLz/G1d+Ud8MTy/6ghhdiLpeerGY/UlDOfiuqFsMUU5/UYlP+BAmgRLuNpvrUaLlVkrqDievNVEAwF+4CoM1MZTmjxjJMsKJq+u8Zd7tNCUFy6LiyYXRJQ4VyvEQFFaCGKsxIwQkk7EzZ6LTJq2hUuPhvAW+gQnSG6J+MszC+7QCRHcnqDdyNRJ6T9xyS87A6MDutbzKGvGktpbXqtzWtXb9HsfK2cBMomjN9a4y+TaJLnXxAeX/HWzmf4cR4vALt/P4w4qgKY04ml4ZdLOinFYS6cup3G/1ie4+t1eOnpBNlqGqs75ilzkT4+DsZQxNvaSKJ//6zIbbk/M7LOhFmRc/1R+kBtz7JFGdZm/COotIdvQoXpTqP/1uqEUmCb/QWoGLMwO5ANcHzxdY48IGP5+J+zKOTBFZ4Pid+GTM+Wq12MV/H86xEJptBa6T+p3kgpwLedManBHC2GgNrFpoN2xnrMz9WFWX/8/ygSBkavq2Uv7FdCsLEYLu9LLIvAU0bNRDtzYl+/vXmjpIvuJFYjmI0im6QEYqnIeMsNjXG4vIutIGHijeAG/9EDBozKV5cldkHbLxHh25vT+ZEzbhXlqvpzKJwcEgfNwLAKFeo0/pvEE10XDB+EXRTXtSzJozQKFFAJhMxYkVaCW+E9AL7tMeU8acxidHqzb6lX4691UsDpy/LLRmT+epgW56+5Cw8tB4kMUv6s9lh3eRKbyGs+H/4mQMaYzPTf2OOdokEn+zzgvoD3FqNKk8QqGAXVsqcGdXrT62fSPkR2vROFi68A6se86UxRUk4cajfPyCC4G5wDhD+zNq4jodQ4u4n/m37Lr36n4LIAAsVr02dFi9AiwA81MYs2rm4eDlDNmdMRvEKRHfBwW5DdMNp0jPFZMeARqF/wL4XBfd+EMLBfMzpH5GH6NaW+1vrvMdg+VxDzatk3MXgO3ro3P/DpcC6+Mo4MySJhKJhSR01SGGGp5hPWmrrUgrv3lDnP+HhcI3nt3YqBoVAVTBAQT5iuhTg8nvPtd8ZeYj6w1x6RqGUBrSku7+N1+BaasZvjTk64RoIDlL8brpEcJx3OmY7jLoZsswdtmhfC/G21llXhITOwmvRDDeTTPbyASOa16cF5/A1fZAidJpqju3wYAy9avPR1ya6eNp9K8XYrrtuxlqi+bDKwlfrYdR0RRiKRVTLOH85+ZY7XSmzRpfZBJjaTa81VDcJHpZnZnSQLASGYW9l51ZV/h7eVzTi3Hv6hUsgc/51AqJRTkpbFVLXXszoBL8nBX0u/0jBLT8nH+fJePbrwURT58OY+UieRjd1vs04w0VG5VN2U6MoGZkQzKN/ptz0Q366dxoTGmj7i1NQGHi9GgnquXFYdrCfZBmeb7s0T6yrdlZH5cZuwHFyIJ/kAtGsTg0xH5taAAq44BAk1CPk9KVVbqQzrCUiFdF/6gtlPQ8bHHc1G1W92MXGZ5HEHftyLYs8mbD/9xYRUWkHmlM0zC2ilJlnNgV4bfALpQghxOUoZL7VTqtCHIaQSXm+YUMnpkXybnV+A6xlm2CVy8fn0Xlm2XRa0+zzOa21JWWmixfiPMSCZ7qA4rS93VN3pkpF1s5TonQjisHf7iU9ZGvUPOAKZcR1pbeVf/Ul7OhepGCaId9wOtqo7pJ7yLcBZ0pFkOF28y4zEI/kcUNmutBHaQpBdNM8vjCS6HZRokkeo88TBAjGyG7SR+6vUgTcyK9Imalj0kuxz0wmK+byQU11AiJFk/ya5dNduRClcnU64yGu/ieWSeOos1t3ep+RPIWQ2pyTYVbZltTbsb7NiwSi3AV+8KLWk7LxCnfZUetEM8ThnsSoGH38/nyAwFguJp8FjvlHtcWZuU4hPva0rHfr0UhOOJ/F6vS62FW7KzkmRll2HEc7oUq4fyi5T70Vl7YVIfsPHUCdHesf9Lk7WNVWO75JDkYbMI8TOW8JKVtLY9d6UJRITO8oKo0xS+o99Yy04iniGHAaGj88kEWgwv0OrHdY/nr76DOGNS59hXCGXzTKUvDl9iKpLSWYN1lxIeyywdNpTkhay74w2jFT6NS8qkjo5CxA1yfSYwp6AJIZNKIeEK5PJAW7ORgWgwp0VgzYpqovMrWxbu+DGZ6Lhie1RAqpzm8VUzKJOH3mCzWuTOLsN3VT/dv2eeYe9UjbR8YTBsLz7q60VN1sU51k+um1f8JxD5pPhbhSC8rRaB454tmh6YUWrJI3+GWY0qeWioj/tbkYITOkJaeuGt4JrJvHA+l0Gu7kY7XOaa05alMnRWVCXqFgLIwSY4uF59Ue5SU4QKuc/HamDxbr0x6csCetXGoP7Qn1Bk/J9DsynO/UD6iZ1Hyrz+jit0hDCwi/E9OjgKTbB3ZQKQ/0ZOvevfNHG0NK4Aj3Cp7NpRk07RT1i/S0EL93Ag8GRgKI9CfpajKyK6+Jj/PI1KO5/85VAwz2AwzP8FTBb075IxCXv6T9RVvWT2tUaqxDS92zrGUbWzUYk9mSs82pECH+fkqsDt93VW++4YsR/dHCYcQSYTO/KaBMDj9LSD/J/+z20Kq8XvZUAIHtm9hRPP3ItbuAu2Hm5lkPs92pd7kCxgRs0xOVBnZ13ccdA0aunrwv9SdqElJRC3g+oCu+nXyCgmXUs9yMjTMAIHfxZV+aPKcZeUBWt057Xo85Ks1Ir5gzEHCWqZEhrLZMuF11ziGtFQUds/EESajhagzcKsxamcSZxGth4UII+adPhQkUnx2WyN+4YWR+r3f8MnkyGFuR4zjzxJS8WsQYR5PTyRaD9ixa6Mh741nBHbzfjXHskGDq179xaRNrCIB1z1xRfWfjqw2pHc1zk9xlPpL8sQWAIuETZZhbnmL54rceXVNRvUiKrrqIkeogsl0XXb17ylNb0f4GA9Wd44vffEG8FSZGHEL2fbaTGRcSiCeA8PmA/f6Hz8HCS76fXUHwgwkzSwlI71ekZ7Fapmlk/KC+Hs8hUcw3N2LN5LhkVYyizYFl/uPeVP5lsoJHhhfWvvSWruCUW1ZcJOeuTbrDgywJ/qG07gZJplnTvLcYdNaH0KMYOYMGX+rB4NGPFmQsNaIwlWrfCezxre8zXBrsMT+edVLbLqN1BqB76JH4BvZTqUIMfGwPGEn+EnmTV86fPBaYbFL3DFEhjB45CewkXEAtJxk4/Ms2pPXnaRqdky0HOYdcUcE2zcXq4vaIvW2/v0nHFJH2XXe22ueDmq/18XGtELSq85j9X8q0tcNSSKJIX8FTuJF/Pf8j5PhqG2u+osvsLxYrvvfeVJL+4tkcXcr9JV7v0ERmj/X6fM3NC4j6dS1+9Umr2oPavqiAydTZPLMNRGY23LO9zAVDly7jD+70G5TPPLdhRIl4WxcYjLnM+SNcJ26FOrkrISUtPObIz5Zb3AG612krnpy15RMW+1cQjlnWFI6538qky9axd2oJmHIHP08KyP0ubGO+TQNOYuv2uh17yCIvR8VcStw7o1g0NM60sk+8Tq7YfIBJrtp53GkvzXH7OA0p8/n/u1satf/VJhtR1l8Wa6Gmaug7haSpaCaYQax6ta0mkutlb+eAOSG1aobM81D9A4iS1RRlzBBoVX6tU1S6WE2N9ORY6DfeLRC4l9Rvr5h95XDWB2mR1d4WFudpsgVYwiTwT31ljskD8ZyDOlm5DkGh9N/UB/0AI5Xvb8ZBmai2hQ4BWMqFwYnzxwB26YHSOv9WgY3JXnvoN+2R4rqGVh/LLDMtpFP+SpMGJNWvbIl5SOodbCczW2RKleksPoUeGEzrjtKHVdtZA+kfqO+rVx/iclCqwoopepvJpSTDjT+b9GWylGRF8EDbGlw6eUzmJM95Ovoz+kwLX3c2fTjFeYEsE7vUZm3mqdGJuKh2w9/QGSaqRHs99aScGOdDqkFcACoqdbBoQqqjamhH6Q9ng39JCg3lrGJwd50Qk9ovnqBTr8MME7Ps2wiVfygUmPoUBJJfJWX5Nda0nuncbFkA=="))),br=new Set(fr(yr)),Sr=new Set(fr(yr)),Cr=function(e){let t=[];for(;;){let r=e();if(0==r)break;t.push(gr(r,e))}for(;;){let r=e()-1;if(r<0)break;t.push(mr(r,e))}return function(e){const t={};for(let r=0;r<e.length;r++){const i=e[r];t[i[0]]=i[1]}return t}(hr(t))}(yr),wr=function(e){let t=fr(e).sort((e,t)=>e-t);return function r(){let i=[];for(;;){let n=fr(e,t);if(0==n.length)break;i.push({set:new Set(n),node:r()})}i.sort((e,t)=>t.set.size-e.set.size);let n=e(),o=n%3;n=n/3|0;let s=!!(1&n);return n>>=1,{branches:i,valid:o,fe0f:s,save:1==n,check:2==n}}()}(yr);function Pr(e){return function(e,t=Re.current){return ke(Oe(e,t))}(e)}function Ar(e){return e.filter(e=>65039!=e)}function Ir(e){for(let t of e.split(".")){let e=Pr(t);try{for(let t=e.lastIndexOf(95)-1;t>=0;t--)if(95!==e[t])throw new Error("underscore only allowed at start");if(e.length>=4&&e.every(e=>e<128)&&45===e[2]&&45===e[3])throw new Error("invalid label extension")}catch(e){throw new Error(`Invalid label "${t}": ${e.message}`)}}return e}function Rr(e,t){var r;let i,n,o=wr,s=[],a=e.length;for(t&&(t.length=0);a;){let c=e[--a];if(o=null===(r=o.branches.find(e=>e.set.has(c)))||void 0===r?void 0:r.node,!o)break;if(o.save)n=c;else if(o.check&&c===n)break;s.push(c),o.fe0f&&(s.push(65039),a>0&&65039==e[a-1]&&a--),o.valid&&(i=s.slice(),2==o.valid&&i.splice(1,1),t&&t.push(...e.slice(a).reverse()),e.length=a)}return i}const Er=new f(Ae),Tr=new Uint8Array(32);function Mr(e){if(0===e.length)throw new Error("invalid ENS name; empty component");return e}function kr(e){const t=Oe(function(e){return Ir(function(e,t){let r=Pr(e).reverse(),i=[];for(;r.length;){let e=Rr(r);if(e){i.push(...t(e));continue}let n=r.pop();if(br.has(n)){i.push(n);continue}if(Sr.has(n))continue;let o=Cr[n];if(!o)throw new Error(`Disallowed codepoint: 0x${n.toString(16).toUpperCase()}`);i.push(...o)}return Ir(String.fromCodePoint(...i).normalize("NFC"))}(e,Ar))}(e)),r=[];if(0===e.length)return r;let i=0;for(let e=0;e<t.length;e++)46===t[e]&&(r.push(Mr(t.slice(i,e))),i=e+1);if(i>=t.length)throw new Error("invalid ENS name; empty component");return r.push(Mr(t.slice(i))),r}function Or(e){"string"!=typeof e&&Er.throwArgumentError("invalid ENS name; not a string","name",e);let t=Tr;const r=kr(e);for(;r.length;)t=ue(j([t,ue(r.pop())]));return K(t)}Tr.fill(0);const _r=new f("networks/5.7.0");function xr(e){const t=function(t,r){null==r&&(r={});const i=[];if(t.InfuraProvider&&"-"!==r.infura)try{i.push(new t.InfuraProvider(e,r.infura))}catch(e){}if(t.EtherscanProvider&&"-"!==r.etherscan)try{i.push(new t.EtherscanProvider(e,r.etherscan))}catch(e){}if(t.AlchemyProvider&&"-"!==r.alchemy)try{i.push(new t.AlchemyProvider(e,r.alchemy))}catch(e){}if(t.PocketProvider&&"-"!==r.pocket){const n=["goerli","ropsten","rinkeby"];try{const o=new t.PocketProvider(e,r.pocket);o.network&&-1===n.indexOf(o.network.name)&&i.push(o)}catch(e){}}if(t.CloudflareProvider&&"-"!==r.cloudflare)try{i.push(new t.CloudflareProvider(e))}catch(e){}if(t.AnkrProvider&&"-"!==r.ankr)try{const n=["ropsten"],o=new t.AnkrProvider(e,r.ankr);o.network&&-1===n.indexOf(o.network.name)&&i.push(o)}catch(e){}if(0===i.length)return null;if(t.FallbackProvider){let n=1;return null!=r.quorum?n=r.quorum:"homestead"===e&&(n=2),new t.FallbackProvider(i,n)}return i[0]};return t.renetwork=function(e){return xr(e)},t}function Nr(e,t){const r=function(r,i){return r.JsonRpcProvider?new r.JsonRpcProvider(e,t):null};return r.renetwork=function(t){return Nr(e,t)},r}const Dr={chainId:1,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"homestead",_defaultProvider:xr("homestead")},zr={chainId:3,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"ropsten",_defaultProvider:xr("ropsten")},Lr={chainId:63,name:"classicMordor",_defaultProvider:Nr("https://www.ethercluster.com/mordor","classicMordor")},Br={unspecified:{chainId:0,name:"unspecified"},homestead:Dr,mainnet:Dr,morden:{chainId:2,name:"morden"},ropsten:zr,testnet:zr,rinkeby:{chainId:4,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"rinkeby",_defaultProvider:xr("rinkeby")},kovan:{chainId:42,name:"kovan",_defaultProvider:xr("kovan")},goerli:{chainId:5,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"goerli",_defaultProvider:xr("goerli")},kintsugi:{chainId:1337702,name:"kintsugi"},classic:{chainId:61,name:"classic",_defaultProvider:Nr("https://www.ethercluster.com/etc","classic")},classicMorden:{chainId:62,name:"classicMorden"},classicMordor:Lr,classicTestnet:Lr,classicKotti:{chainId:6,name:"classicKotti",_defaultProvider:Nr("https://www.ethercluster.com/kotti","classicKotti")},xdai:{chainId:100,name:"xdai"},matic:{chainId:137,name:"matic",_defaultProvider:xr("matic")},maticmum:{chainId:80001,name:"maticmum"},optimism:{chainId:10,name:"optimism",_defaultProvider:xr("optimism")},"optimism-kovan":{chainId:69,name:"optimism-kovan"},"optimism-goerli":{chainId:420,name:"optimism-goerli"},arbitrum:{chainId:42161,name:"arbitrum"},"arbitrum-rinkeby":{chainId:421611,name:"arbitrum-rinkeby"},"arbitrum-goerli":{chainId:421613,name:"arbitrum-goerli"},bnb:{chainId:56,name:"bnb"},bnbt:{chainId:97,name:"bnbt"}};function Fr(e){return"0x"+Ye().sha256().update(F(e)).digest("hex")}new f("sha2/5.7.0");var jr=o(9674),Ur=o.n(jr);const qr=new f(I);class Wr{constructor(){this.formats=this.getDefaultFormats()}getDefaultFormats(){const e={},t=this.address.bind(this),r=this.bigNumber.bind(this),i=this.blockTag.bind(this),n=this.data.bind(this),o=this.hash.bind(this),s=this.hex.bind(this),a=this.number.bind(this),c=this.type.bind(this);return e.transaction={hash:o,type:c,accessList:Wr.allowNull(this.accessList.bind(this),null),blockHash:Wr.allowNull(o,null),blockNumber:Wr.allowNull(a,null),transactionIndex:Wr.allowNull(a,null),confirmations:Wr.allowNull(a,null),from:t,gasPrice:Wr.allowNull(r),maxPriorityFeePerGas:Wr.allowNull(r),maxFeePerGas:Wr.allowNull(r),gasLimit:r,to:Wr.allowNull(t,null),value:r,nonce:a,data:n,r:Wr.allowNull(this.uint256),s:Wr.allowNull(this.uint256),v:Wr.allowNull(a),creates:Wr.allowNull(t,null),raw:Wr.allowNull(n)},e.transactionRequest={from:Wr.allowNull(t),nonce:Wr.allowNull(a),gasLimit:Wr.allowNull(r),gasPrice:Wr.allowNull(r),maxPriorityFeePerGas:Wr.allowNull(r),maxFeePerGas:Wr.allowNull(r),to:Wr.allowNull(t),value:Wr.allowNull(r),data:Wr.allowNull(e=>this.data(e,!0)),type:Wr.allowNull(a),accessList:Wr.allowNull(this.accessList.bind(this),null)},e.receiptLog={transactionIndex:a,blockNumber:a,transactionHash:o,address:t,topics:Wr.arrayOf(o),data:n,logIndex:a,blockHash:o},e.receipt={to:Wr.allowNull(this.address,null),from:Wr.allowNull(this.address,null),contractAddress:Wr.allowNull(t,null),transactionIndex:a,root:Wr.allowNull(s),gasUsed:r,logsBloom:Wr.allowNull(n),blockHash:o,transactionHash:o,logs:Wr.arrayOf(this.receiptLog.bind(this)),blockNumber:a,confirmations:Wr.allowNull(a,null),cumulativeGasUsed:r,effectiveGasPrice:Wr.allowNull(r),status:Wr.allowNull(a),type:c},e.block={hash:Wr.allowNull(o),parentHash:o,number:a,timestamp:a,nonce:Wr.allowNull(s),difficulty:this.difficulty.bind(this),gasLimit:r,gasUsed:r,miner:Wr.allowNull(t),extraData:n,transactions:Wr.allowNull(Wr.arrayOf(o)),baseFeePerGas:Wr.allowNull(r)},e.blockWithTransactions=b(e.block),e.blockWithTransactions.transactions=Wr.allowNull(Wr.arrayOf(this.transactionResponse.bind(this))),e.filter={fromBlock:Wr.allowNull(i,void 0),toBlock:Wr.allowNull(i,void 0),blockHash:Wr.allowNull(o,void 0),address:Wr.allowNull(t,void 0),topics:Wr.allowNull(this.topics.bind(this),void 0)},e.filterLog={blockNumber:Wr.allowNull(a),blockHash:Wr.allowNull(o),transactionIndex:a,removed:Wr.allowNull(this.boolean.bind(this)),address:t,data:Wr.allowFalsish(n,"0x"),topics:Wr.arrayOf(o),transactionHash:o,logIndex:a},e}accessList(e){return Vt(e||[])}number(e){return"0x"===e?0:re.from(e).toNumber()}type(e){return"0x"===e||null==e?0:re.from(e).toNumber()}bigNumber(e){return re.from(e)}boolean(e){if("boolean"==typeof e)return e;if("string"==typeof e){if("true"===(e=e.toLowerCase()))return!0;if("false"===e)return!1}throw new Error("invalid boolean - "+e)}hex(e,t){return"string"==typeof e&&(t||"0x"===e.substring(0,2)||(e="0x"+e),q(e))?e.toLowerCase():qr.throwArgumentError("invalid hash","value",e)}data(e,t){const r=this.hex(e,t);if(r.length%2!=0)throw new Error("invalid data; odd-length - "+e);return r}address(e){return Pe(e)}callAddress(e){if(!q(e,32))return null;const t=Pe(V(e,12));return"0x0000000000000000000000000000000000000000"===t?null:t}contractAddress(e){return function(e){let t=null;try{t=Pe(e.from)}catch(t){ye.throwArgumentError("missing from address","transaction",e)}return Pe(V(ue(fe([t,U(F(re.from(e.nonce).toHexString()))])),12))}(e)}blockTag(e){if(null==e)return"latest";if("earliest"===e)return"0x0";switch(e){case"earliest":return"0x0";case"latest":case"pending":case"safe":case"finalized":return e}if("number"==typeof e||q(e))return J(e);throw new Error("invalid blockTag")}hash(e,t){const r=this.hex(e,t);return 32!==H(r)?qr.throwArgumentError("invalid hash","value",e):r}difficulty(e){if(null==e)return null;const t=re.from(e);try{return t.toNumber()}catch(e){}return null}uint256(e){if(!q(e))throw new Error("invalid uint256");return $(e,32)}_block(e,t){null!=e.author&&null==e.miner&&(e.miner=e.author);const r=null!=e._difficulty?e._difficulty:e.difficulty,i=Wr.check(t,e);return i._difficulty=null==r?null:re.from(r),i}block(e){return this._block(e,this.formats.block)}blockWithTransactions(e){return this._block(e,this.formats.blockWithTransactions)}transactionRequest(e){return Wr.check(this.formats.transactionRequest,e)}transactionResponse(e){null!=e.gas&&null==e.gasLimit&&(e.gasLimit=e.gas),e.to&&re.from(e.to).isZero()&&(e.to="0x0000000000000000000000000000000000000000"),null!=e.input&&null==e.data&&(e.data=e.input),null==e.to&&null==e.creates&&(e.creates=this.contractAddress(e)),1!==e.type&&2!==e.type||null!=e.accessList||(e.accessList=[]);const t=Wr.check(this.formats.transaction,e);if(null!=e.chainId){let r=e.chainId;q(r)&&(r=re.from(r).toNumber()),t.chainId=r}else{let r=e.networkId;null==r&&null==t.v&&(r=e.chainId),q(r)&&(r=re.from(r).toNumber()),"number"!=typeof r&&null!=t.v&&(r=(t.v-35)/2,r<0&&(r=0),r=parseInt(r)),"number"!=typeof r&&(r=0),t.chainId=r}return t.blockHash&&"x"===t.blockHash.replace(/0/g,"")&&(t.blockHash=null),t}transaction(e){return function(e){const t=F(e);if(t[0]>127)return function(e){const t=me(e);9!==t.length&&6!==t.length&&Ft.throwArgumentError("invalid raw transaction","rawTransaction",e);const r={nonce:qt(t[0]).toNumber(),gasPrice:qt(t[1]),gasLimit:qt(t[2]),to:Ut(t[3]),value:qt(t[4]),data:t[5],chainId:0};if(6===t.length)return r;try{r.v=re.from(t[6]).toNumber()}catch(e){return r}if(r.r=$(t[7],32),r.s=$(t[8],32),re.from(r.r).isZero()&&re.from(r.s).isZero())r.chainId=r.v,r.v=0;else{r.chainId=Math.floor((r.v-35)/2),r.chainId<0&&(r.chainId=0);let i=r.v-27;const n=t.slice(0,6);0!==r.chainId&&(n.push(K(r.chainId)),n.push("0x"),n.push("0x"),i-=2*r.chainId+8);const o=ue(fe(n));try{r.from=Wt(o,{r:K(r.r),s:K(r.s),recoveryParam:i})}catch(e){}r.hash=ue(e)}return r.type=null,r}(t);switch(t[0]){case 1:return function(e){const t=me(e.slice(1));8!==t.length&&11!==t.length&&Ft.throwArgumentError("invalid component count for transaction type: 1","payload",K(e));const r={type:1,chainId:qt(t[0]).toNumber(),nonce:qt(t[1]).toNumber(),gasPrice:qt(t[2]),gasLimit:qt(t[3]),to:Ut(t[4]),value:qt(t[5]),data:t[6],accessList:Vt(t[7])};return 8===t.length||(r.hash=ue(e),Qt(r,t.slice(8),$t)),r}(t);case 2:return function(e){const t=me(e.slice(1));9!==t.length&&12!==t.length&&Ft.throwArgumentError("invalid component count for transaction type: 2","payload",K(e));const r=qt(t[2]),i=qt(t[3]),n={type:2,chainId:qt(t[0]).toNumber(),nonce:qt(t[1]).toNumber(),maxPriorityFeePerGas:r,maxFeePerGas:i,gasPrice:null,gasLimit:qt(t[4]),to:Ut(t[5]),value:qt(t[6]),data:t[7],accessList:Vt(t[8])};return 9===t.length||(n.hash=ue(e),Qt(n,t.slice(9),Jt)),n}(t)}return Ft.throwError(`unsupported transaction type: ${t[0]}`,f.errors.UNSUPPORTED_OPERATION,{operation:"parseTransaction",transactionType:t[0]})}(e)}receiptLog(e){return Wr.check(this.formats.receiptLog,e)}receipt(e){const t=Wr.check(this.formats.receipt,e);if(null!=t.root)if(t.root.length<=4){const e=re.from(t.root).toNumber();0===e||1===e?(null!=t.status&&t.status!==e&&qr.throwArgumentError("alt-root-status/status mismatch","value",{root:t.root,status:t.status}),t.status=e,delete t.root):qr.throwArgumentError("invalid alt-root-status","value.root",t.root)}else 66!==t.root.length&&qr.throwArgumentError("invalid root hash","value.root",t.root);return null!=t.status&&(t.byzantium=!0),t}topics(e){return Array.isArray(e)?e.map(e=>this.topics(e)):null!=e?this.hash(e,!0):null}filter(e){return Wr.check(this.formats.filter,e)}filterLog(e){return Wr.check(this.formats.filterLog,e)}static check(e,t){const r={};for(const i in e)try{const n=e[i](t[i]);void 0!==n&&(r[i]=n)}catch(e){throw e.checkKey=i,e.checkValue=t[i],e}return r}static allowNull(e,t){return function(r){return null==r?t:e(r)}}static allowFalsish(e,t){return function(r){return r?e(r):t}}static arrayOf(e){return function(t){if(!Array.isArray(t))throw new Error("not an array");const r=[];return t.forEach(function(t){r.push(e(t))}),r}}}var Kr=function(e,t,r,i){return new(r||(r=Promise))(function(n,o){function s(e){try{c(i.next(e))}catch(e){o(e)}}function a(e){try{c(i.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?n(e.value):(t=e.value,t instanceof r?t:new r(function(e){e(t)})).then(s,a)}c((i=i.apply(e,t||[])).next())})};const Hr=new f(I);function Vr(e){return null==e?"null":(32!==H(e)&&Hr.throwArgumentError("invalid topic","topic",e),e.toLowerCase())}function Gr(e){for(e=e.slice();e.length>0&&null==e[e.length-1];)e.pop();return e.map(e=>{if(Array.isArray(e)){const t={};e.forEach(e=>{t[Vr(e)]=!0});const r=Object.keys(t);return r.sort(),r.join("|")}return Vr(e)}).join("&")}function Jr(e){if("string"==typeof e){if(32===H(e=e.toLowerCase()))return"tx:"+e;if(-1===e.indexOf(":"))return e}else{if(Array.isArray(e))return"filter:*:"+Gr(e);if(sr.isForkEvent(e))throw Hr.warn("not implemented"),new Error("not implemented");if(e&&"object"==typeof e)return"filter:"+(e.address||"*")+":"+Gr(e.topics||[])}throw new Error("invalid event - "+e)}function $r(){return(new Date).getTime()}function Qr(e){return new Promise(t=>{setTimeout(t,e)})}const Yr=["block","network","pending","poll"];class Xr{constructor(e,t,r){g(this,"tag",e),g(this,"listener",t),g(this,"once",r),this._lastBlockNumber=-2,this._inflight=!1}get event(){switch(this.type){case"tx":return this.hash;case"filter":return this.filter}return this.tag}get type(){return this.tag.split(":")[0]}get hash(){const e=this.tag.split(":");return"tx"!==e[0]?null:e[1]}get filter(){const e=this.tag.split(":");if("filter"!==e[0])return null;const t=e[1],r=""===(i=e[2])?[]:i.split(/&/g).map(e=>{if(""===e)return[];const t=e.split("|").map(e=>"null"===e?null:e);return 1===t.length?t[0]:t});var i;const n={};return r.length>0&&(n.topics=r),t&&"*"!==t&&(n.address=t),n}pollable(){return this.tag.indexOf(":")>=0||Yr.indexOf(this.tag)>=0}}const Zr={0:{symbol:"btc",p2pkh:0,p2sh:5,prefix:"bc"},2:{symbol:"ltc",p2pkh:48,p2sh:50,prefix:"ltc"},3:{symbol:"doge",p2pkh:30,p2sh:22},60:{symbol:"eth",ilk:"eth"},61:{symbol:"etc",ilk:"eth"},700:{symbol:"xdai",ilk:"eth"}};function ei(e){return $(re.from(e).toHexString(),32)}function ti(e){return ur.encode(j([e,V(Fr(Fr(e)),0,4)]))}const ri=new RegExp("^(ipfs)://(.*)$","i"),ii=[new RegExp("^(https)://(.*)$","i"),new RegExp("^(data):(.*)$","i"),ri,new RegExp("^eip155:[0-9]+/(erc[0-9]+):(.*)$","i")];function ni(e,t){try{return _e(oi(e,t))}catch(e){}return null}function oi(e,t){if("0x"===e)return null;const r=re.from(V(e,t,t+32)).toNumber(),i=re.from(V(e,r,r+32)).toNumber();return V(e,r+32,r+32+i)}function si(e){return e.match(/^ipfs:\/\/ipfs\//i)?e=e.substring(12):e.match(/^ipfs:\/\//i)?e=e.substring(7):Hr.throwArgumentError("unsupported IPFS format","link",e),`https://gateway.ipfs.io/ipfs/${e}`}function ai(e){const t=F(e);if(t.length>32)throw new Error("internal; should not happen");const r=new Uint8Array(32);return r.set(t,32-t.length),r}function ci(e){if(e.length%32==0)return e;const t=new Uint8Array(32*Math.ceil(e.length/32));return t.set(e),t}function ui(e){const t=[];let r=0;for(let i=0;i<e.length;i++)t.push(null),r+=32;for(let i=0;i<e.length;i++){const n=F(e[i]);t[i]=ai(r),t.push(ai(n.length)),t.push(ci(n)),r+=32+32*Math.ceil(n.length/32)}return G(t)}class hi{constructor(e,t,r,i){g(this,"provider",e),g(this,"name",r),g(this,"address",e.formatter.address(t)),g(this,"_resolvedAddress",i)}supportsWildcard(){return this._supportsEip2544||(this._supportsEip2544=this.provider.call({to:this.address,data:"0x01ffc9a79061b92300000000000000000000000000000000000000000000000000000000"}).then(e=>re.from(e).eq(1)).catch(e=>{if(e.code===f.errors.CALL_EXCEPTION)return!1;throw this._supportsEip2544=null,e})),this._supportsEip2544}_fetch(e,t){return Kr(this,void 0,void 0,function*(){const r={to:this.address,ccipReadEnabled:!0,data:G([e,Or(this.name),t||"0x"])};let i=!1;var n;(yield this.supportsWildcard())&&(i=!0,r.data=G(["0x9061b923",ui([(n=this.name,K(j(kr(n).map(e=>{if(e.length>63)throw new Error("invalid DNS encoded entry; length exceeds 63 bytes");const t=new Uint8Array(e.length+1);return t.set(e,1),t[0]=t.length-1,t})))+"00"),r.data])]));try{let e=yield this.provider.call(r);return F(e).length%32==4&&Hr.throwError("resolver threw error",f.errors.CALL_EXCEPTION,{transaction:r,data:e}),i&&(e=oi(e,0)),e}catch(e){if(e.code===f.errors.CALL_EXCEPTION)return null;throw e}})}_fetchBytes(e,t){return Kr(this,void 0,void 0,function*(){const r=yield this._fetch(e,t);return null!=r?oi(r,0):null})}_getAddress(e,t){const r=Zr[String(e)];if(null==r&&Hr.throwError(`unsupported coin type: ${e}`,f.errors.UNSUPPORTED_OPERATION,{operation:`getAddress(${e})`}),"eth"===r.ilk)return this.provider.formatter.address(t);const i=F(t);if(null!=r.p2pkh){const e=t.match(/^0x76a9([0-9a-f][0-9a-f])([0-9a-f]*)88ac$/);if(e){const t=parseInt(e[1],16);if(e[2].length===2*t&&t>=1&&t<=75)return ti(j([[r.p2pkh],"0x"+e[2]]))}}if(null!=r.p2sh){const e=t.match(/^0xa9([0-9a-f][0-9a-f])([0-9a-f]*)87$/);if(e){const t=parseInt(e[1],16);if(e[2].length===2*t&&t>=1&&t<=75)return ti(j([[r.p2sh],"0x"+e[2]]))}}if(null!=r.prefix){const e=i[1];let t=i[0];if(0===t?20!==e&&32!==e&&(t=-1):t=-1,t>=0&&i.length===2+e&&e>=1&&e<=75){const e=Ur().toWords(i.slice(2));return e.unshift(t),Ur().encode(r.prefix,e)}}return null}getAddress(e){return Kr(this,void 0,void 0,function*(){if(null==e&&(e=60),60===e)try{const e=yield this._fetch("0x3b3b57de");return"0x"===e||"0x0000000000000000000000000000000000000000000000000000000000000000"===e?null:this.provider.formatter.callAddress(e)}catch(e){if(e.code===f.errors.CALL_EXCEPTION)return null;throw e}const t=yield this._fetchBytes("0xf1cb7e06",ei(e));if(null==t||"0x"===t)return null;const r=this._getAddress(e,t);return null==r&&Hr.throwError("invalid or unsupported coin data",f.errors.UNSUPPORTED_OPERATION,{operation:`getAddress(${e})`,coinType:e,data:t}),r})}getAvatar(){return Kr(this,void 0,void 0,function*(){const e=[{type:"name",content:this.name}];try{const t=yield this.getText("avatar");if(null==t)return null;for(let r=0;r<ii.length;r++){const i=t.match(ii[r]);if(null==i)continue;const n=i[1].toLowerCase();switch(n){case"https":return e.push({type:"url",content:t}),{linkage:e,url:t};case"data":return e.push({type:"data",content:t}),{linkage:e,url:t};case"ipfs":return e.push({type:"ipfs",content:t}),{linkage:e,url:si(t)};case"erc721":case"erc1155":{const r="erc721"===n?"0xc87b56dd":"0x0e89341c";e.push({type:n,content:t});const o=this._resolvedAddress||(yield this.getAddress()),s=(i[2]||"").split("/");if(2!==s.length)return null;const a=yield this.provider.formatter.address(s[0]),c=$(re.from(s[1]).toHexString(),32);if("erc721"===n){const t=this.provider.formatter.callAddress(yield this.provider.call({to:a,data:G(["0x6352211e",c])}));if(o!==t)return null;e.push({type:"owner",content:t})}else if("erc1155"===n){const t=re.from(yield this.provider.call({to:a,data:G(["0x00fdd58e",$(o,32),c])}));if(t.isZero())return null;e.push({type:"balance",content:t.toString()})}const u={to:this.provider.formatter.address(s[0]),data:G([r,c])};let h=ni(yield this.provider.call(u),0);if(null==h)return null;e.push({type:"metadata-url-base",content:h}),"erc1155"===n&&(h=h.replace("{id}",c.substring(2)),e.push({type:"metadata-url-expanded",content:h})),h.match(/^ipfs:/i)&&(h=si(h)),e.push({type:"metadata-url",content:h});const d=yield ir(h);if(!d)return null;e.push({type:"metadata",content:JSON.stringify(d)});let l=d.image;if("string"!=typeof l)return null;if(l.match(/^(https:\/\/|data:)/i));else{if(null==l.match(ri))return null;e.push({type:"url-ipfs",content:l}),l=si(l)}return e.push({type:"url",content:l}),{linkage:e,url:l}}}}}catch(e){}return null})}getContentHash(){return Kr(this,void 0,void 0,function*(){const e=yield this._fetchBytes("0xbc1c58d1");if(null==e||"0x"===e)return null;const t=e.match(/^0xe3010170(([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f]*))$/);if(t){const e=parseInt(t[3],16);if(t[4].length===2*e)return"ipfs://"+ur.encode("0x"+t[1])}const r=e.match(/^0xe5010172(([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f]*))$/);if(r){const e=parseInt(r[3],16);if(r[4].length===2*e)return"ipns://"+ur.encode("0x"+r[1])}const i=e.match(/^0xe40101fa011b20([0-9a-f]*)$/);if(i&&64===i[1].length)return"bzz://"+i[1];const n=e.match(/^0x90b2c605([0-9a-f]*)$/);if(n&&68===n[1].length){const e={"=":"","+":"-","/":"_"};return"sia://"+Xt("0x"+n[1]).replace(/[=+\/]/g,t=>e[t])}return Hr.throwError("invalid or unsupported content hash data",f.errors.UNSUPPORTED_OPERATION,{operation:"getContentHash()",data:e})})}getText(e){return Kr(this,void 0,void 0,function*(){let t=Oe(e);t=j([ei(64),ei(t.length),t]),t.length%32!=0&&(t=j([t,$("0x",32-e.length%32)]));const r=yield this._fetchBytes("0x59d1d43c",K(t));return null==r||"0x"===r?null:_e(r)})}}let di=null,li=1;class pi extends ar{constructor(e){if(super(),this._events=[],this._emitted={block:-2},this.disableCcipRead=!1,this.formatter=new.target.getFormatter(),g(this,"anyNetwork","any"===e),this.anyNetwork&&(e=this.detectNetwork()),e instanceof Promise)this._networkPromise=e,e.catch(e=>{}),this._ready().catch(e=>{});else{const t=m(new.target,"getNetwork")(e);t?(g(this,"_network",t),this.emit("network",t,null)):Hr.throwArgumentError("invalid network","network",e)}this._maxInternalBlockNumber=-1024,this._lastBlockNumber=-2,this._maxFilterBlockRange=10,this._pollingInterval=4e3,this._fastQueryDate=0}_ready(){return Kr(this,void 0,void 0,function*(){if(null==this._network){let e=null;if(this._networkPromise)try{e=yield this._networkPromise}catch(e){}null==e&&(e=yield this.detectNetwork()),e||Hr.throwError("no network detected",f.errors.UNKNOWN_ERROR,{}),null==this._network&&(this.anyNetwork?this._network=e:g(this,"_network",e),this.emit("network",e,null))}return this._network})}get ready(){return nr(()=>this._ready().then(e=>e,e=>{if(e.code!==f.errors.NETWORK_ERROR||"noNetwork"!==e.event)throw e}))}static getFormatter(){return null==di&&(di=new Wr),di}static getNetwork(e){return function(e){if(null==e)return null;if("number"==typeof e){for(const t in Br){const r=Br[t];if(r.chainId===e)return{name:r.name,chainId:r.chainId,ensAddress:r.ensAddress||null,_defaultProvider:r._defaultProvider||null}}return{chainId:e,name:"unknown"}}if("string"==typeof e){const t=Br[e];return null==t?null:{name:t.name,chainId:t.chainId,ensAddress:t.ensAddress,_defaultProvider:t._defaultProvider||null}}const t=Br[e.name];if(!t)return"number"!=typeof e.chainId&&_r.throwArgumentError("invalid network chainId","network",e),e;0!==e.chainId&&e.chainId!==t.chainId&&_r.throwArgumentError("network chainId mismatch","network",e);let r=e._defaultProvider||null;var i;return null==r&&t._defaultProvider&&(r=(i=t._defaultProvider)&&"function"==typeof i.renetwork?t._defaultProvider.renetwork(e):t._defaultProvider),{name:e.name,chainId:t.chainId,ensAddress:e.ensAddress||t.ensAddress||null,_defaultProvider:r}}(null==e?"homestead":e)}ccipReadFetch(e,t,r){return Kr(this,void 0,void 0,function*(){if(this.disableCcipRead||0===r.length)return null;const i=e.to.toLowerCase(),n=t.toLowerCase(),o=[];for(let e=0;e<r.length;e++){const t=r[e],s=t.replace("{sender}",i).replace("{data}",n),a=t.indexOf("{data}")>=0?null:JSON.stringify({data:n,sender:i}),c=yield ir({url:s,errorPassThrough:!0},a,(e,t)=>(e.status=t.statusCode,e));if(c.data)return c.data;const u=c.message||"unknown error";if(c.status>=400&&c.status<500)return Hr.throwError(`response not found during CCIP fetch: ${u}`,f.errors.SERVER_ERROR,{url:t,errorMessage:u});o.push(u)}return Hr.throwError(`error encountered during CCIP fetch: ${o.map(e=>JSON.stringify(e)).join(", ")}`,f.errors.SERVER_ERROR,{urls:r,errorMessages:o})})}_getInternalBlockNumber(e){return Kr(this,void 0,void 0,function*(){if(yield this._ready(),e>0)for(;this._internalBlockNumber;){const t=this._internalBlockNumber;try{const r=yield t;if($r()-r.respTime<=e)return r.blockNumber;break}catch(e){if(this._internalBlockNumber===t)break}}const t=$r(),r=y({blockNumber:this.perform("getBlockNumber",{}),networkError:this.getNetwork().then(e=>null,e=>e)}).then(({blockNumber:e,networkError:i})=>{if(i)throw this._internalBlockNumber===r&&(this._internalBlockNumber=null),i;const n=$r();return(e=re.from(e).toNumber())<this._maxInternalBlockNumber&&(e=this._maxInternalBlockNumber),this._maxInternalBlockNumber=e,this._setFastBlockNumber(e),{blockNumber:e,reqTime:t,respTime:n}});return this._internalBlockNumber=r,r.catch(e=>{this._internalBlockNumber===r&&(this._internalBlockNumber=null)}),(yield r).blockNumber})}poll(){return Kr(this,void 0,void 0,function*(){const e=li++,t=[];let r=null;try{r=yield this._getInternalBlockNumber(100+this.pollingInterval/2)}catch(e){return void this.emit("error",e)}if(this._setFastBlockNumber(r),this.emit("poll",e,r),r!==this._lastBlockNumber){if(-2===this._emitted.block&&(this._emitted.block=r-1),Math.abs(this._emitted.block-r)>1e3)Hr.warn(`network block skew detected; skipping block events (emitted=${this._emitted.block} blockNumber${r})`),this.emit("error",Hr.makeError("network block skew detected",f.errors.NETWORK_ERROR,{blockNumber:r,event:"blockSkew",previousBlockNumber:this._emitted.block})),this.emit("block",r);else for(let e=this._emitted.block+1;e<=r;e++)this.emit("block",e);this._emitted.block!==r&&(this._emitted.block=r,Object.keys(this._emitted).forEach(e=>{if("block"===e)return;const t=this._emitted[e];"pending"!==t&&r-t>12&&delete this._emitted[e]})),-2===this._lastBlockNumber&&(this._lastBlockNumber=r-1),this._events.forEach(e=>{switch(e.type){case"tx":{const r=e.hash;let i=this.getTransactionReceipt(r).then(e=>e&&null!=e.blockNumber?(this._emitted["t:"+r]=e.blockNumber,this.emit(r,e),null):null).catch(e=>{this.emit("error",e)});t.push(i);break}case"filter":if(!e._inflight){e._inflight=!0,-2===e._lastBlockNumber&&(e._lastBlockNumber=r-1);const i=e.filter;i.fromBlock=e._lastBlockNumber+1,i.toBlock=r;const n=i.toBlock-this._maxFilterBlockRange;n>i.fromBlock&&(i.fromBlock=n),i.fromBlock<0&&(i.fromBlock=0);const o=this.getLogs(i).then(t=>{e._inflight=!1,0!==t.length&&t.forEach(t=>{t.blockNumber>e._lastBlockNumber&&(e._lastBlockNumber=t.blockNumber),this._emitted["b:"+t.blockHash]=t.blockNumber,this._emitted["t:"+t.transactionHash]=t.blockNumber,this.emit(i,t)})}).catch(t=>{this.emit("error",t),e._inflight=!1});t.push(o)}}}),this._lastBlockNumber=r,Promise.all(t).then(()=>{this.emit("didPoll",e)}).catch(e=>{this.emit("error",e)})}else this.emit("didPoll",e)})}resetEventsBlock(e){this._lastBlockNumber=e-1,this.polling&&this.poll()}get network(){return this._network}detectNetwork(){return Kr(this,void 0,void 0,function*(){return Hr.throwError("provider does not support network detection",f.errors.UNSUPPORTED_OPERATION,{operation:"provider.detectNetwork"})})}getNetwork(){return Kr(this,void 0,void 0,function*(){const e=yield this._ready(),t=yield this.detectNetwork();if(e.chainId!==t.chainId){if(this.anyNetwork)return this._network=t,this._lastBlockNumber=-2,this._fastBlockNumber=null,this._fastBlockNumberPromise=null,this._fastQueryDate=0,this._emitted.block=-2,this._maxInternalBlockNumber=-1024,this._internalBlockNumber=null,this.emit("network",t,e),yield Qr(0),this._network;const r=Hr.makeError("underlying network changed",f.errors.NETWORK_ERROR,{event:"changed",network:e,detectedNetwork:t});throw this.emit("error",r),r}return e})}get blockNumber(){return this._getInternalBlockNumber(100+this.pollingInterval/2).then(e=>{this._setFastBlockNumber(e)},e=>{}),null!=this._fastBlockNumber?this._fastBlockNumber:-1}get polling(){return null!=this._poller}set polling(e){e&&!this._poller?(this._poller=setInterval(()=>{this.poll()},this.pollingInterval),this._bootstrapPoll||(this._bootstrapPoll=setTimeout(()=>{this.poll(),this._bootstrapPoll=setTimeout(()=>{this._poller||this.poll(),this._bootstrapPoll=null},this.pollingInterval)},0))):!e&&this._poller&&(clearInterval(this._poller),this._poller=null)}get pollingInterval(){return this._pollingInterval}set pollingInterval(e){if("number"!=typeof e||e<=0||parseInt(String(e))!=e)throw new Error("invalid polling interval");this._pollingInterval=e,this._poller&&(clearInterval(this._poller),this._poller=setInterval(()=>{this.poll()},this._pollingInterval))}_getFastBlockNumber(){const e=$r();return e-this._fastQueryDate>2*this._pollingInterval&&(this._fastQueryDate=e,this._fastBlockNumberPromise=this.getBlockNumber().then(e=>((null==this._fastBlockNumber||e>this._fastBlockNumber)&&(this._fastBlockNumber=e),this._fastBlockNumber))),this._fastBlockNumberPromise}_setFastBlockNumber(e){null!=this._fastBlockNumber&&e<this._fastBlockNumber||(this._fastQueryDate=$r(),(null==this._fastBlockNumber||e>this._fastBlockNumber)&&(this._fastBlockNumber=e,this._fastBlockNumberPromise=Promise.resolve(e)))}waitForTransaction(e,t,r){return Kr(this,void 0,void 0,function*(){return this._waitForTransaction(e,null==t?1:t,r||0,null)})}_waitForTransaction(e,t,r,i){return Kr(this,void 0,void 0,function*(){const n=yield this.getTransactionReceipt(e);return(n?n.confirmations:0)>=t?n:new Promise((n,o)=>{const s=[];let a=!1;const c=function(){return!!a||(a=!0,s.forEach(e=>{e()}),!1)},u=e=>{e.confirmations<t||c()||n(e)};if(this.on(e,u),s.push(()=>{this.removeListener(e,u)}),i){let r=i.startBlock,n=null;const u=s=>Kr(this,void 0,void 0,function*(){a||(yield Qr(1e3),this.getTransactionCount(i.from).then(h=>Kr(this,void 0,void 0,function*(){if(!a){if(h<=i.nonce)r=s;else{{const t=yield this.getTransaction(e);if(t&&null!=t.blockNumber)return}for(null==n&&(n=r-3,n<i.startBlock&&(n=i.startBlock));n<=s;){if(a)return;const r=yield this.getBlockWithTransactions(n);for(let n=0;n<r.transactions.length;n++){const s=r.transactions[n];if(s.hash===e)return;if(s.from===i.from&&s.nonce===i.nonce){if(a)return;const r=yield this.waitForTransaction(s.hash,t);if(c())return;let n="replaced";return s.data===i.data&&s.to===i.to&&s.value.eq(i.value)?n="repriced":"0x"===s.data&&s.from===s.to&&s.value.isZero()&&(n="cancelled"),void o(Hr.makeError("transaction was replaced",f.errors.TRANSACTION_REPLACED,{cancelled:"replaced"===n||"cancelled"===n,reason:n,replacement:this._wrapTransaction(s),hash:e,receipt:r}))}}n++}}a||this.once("block",u)}}),e=>{a||this.once("block",u)}))});if(a)return;this.once("block",u),s.push(()=>{this.removeListener("block",u)})}if("number"==typeof r&&r>0){const e=setTimeout(()=>{c()||o(Hr.makeError("timeout exceeded",f.errors.TIMEOUT,{timeout:r}))},r);e.unref&&e.unref(),s.push(()=>{clearTimeout(e)})}})})}getBlockNumber(){return Kr(this,void 0,void 0,function*(){return this._getInternalBlockNumber(0)})}getGasPrice(){return Kr(this,void 0,void 0,function*(){yield this.getNetwork();const e=yield this.perform("getGasPrice",{});try{return re.from(e)}catch(t){return Hr.throwError("bad result from backend",f.errors.SERVER_ERROR,{method:"getGasPrice",result:e,error:t})}})}getBalance(e,t){return Kr(this,void 0,void 0,function*(){yield this.getNetwork();const r=yield y({address:this._getAddress(e),blockTag:this._getBlockTag(t)}),i=yield this.perform("getBalance",r);try{return re.from(i)}catch(e){return Hr.throwError("bad result from backend",f.errors.SERVER_ERROR,{method:"getBalance",params:r,result:i,error:e})}})}getTransactionCount(e,t){return Kr(this,void 0,void 0,function*(){yield this.getNetwork();const r=yield y({address:this._getAddress(e),blockTag:this._getBlockTag(t)}),i=yield this.perform("getTransactionCount",r);try{return re.from(i).toNumber()}catch(e){return Hr.throwError("bad result from backend",f.errors.SERVER_ERROR,{method:"getTransactionCount",params:r,result:i,error:e})}})}getCode(e,t){return Kr(this,void 0,void 0,function*(){yield this.getNetwork();const r=yield y({address:this._getAddress(e),blockTag:this._getBlockTag(t)}),i=yield this.perform("getCode",r);try{return K(i)}catch(e){return Hr.throwError("bad result from backend",f.errors.SERVER_ERROR,{method:"getCode",params:r,result:i,error:e})}})}getStorageAt(e,t,r){return Kr(this,void 0,void 0,function*(){yield this.getNetwork();const i=yield y({address:this._getAddress(e),blockTag:this._getBlockTag(r),position:Promise.resolve(t).then(e=>J(e))}),n=yield this.perform("getStorageAt",i);try{return K(n)}catch(e){return Hr.throwError("bad result from backend",f.errors.SERVER_ERROR,{method:"getStorageAt",params:i,result:n,error:e})}})}_wrapTransaction(e,t,r){if(null!=t&&32!==H(t))throw new Error("invalid response - sendTransaction");const i=e;return null!=t&&e.hash!==t&&Hr.throwError("Transaction hash mismatch from Provider.sendTransaction.",f.errors.UNKNOWN_ERROR,{expectedHash:e.hash,returnedHash:t}),i.wait=(t,i)=>Kr(this,void 0,void 0,function*(){let n;null==t&&(t=1),null==i&&(i=0),0!==t&&null!=r&&(n={data:e.data,from:e.from,nonce:e.nonce,to:e.to,value:e.value,startBlock:r});const o=yield this._waitForTransaction(e.hash,t,i,n);return null==o&&0===t?null:(this._emitted["t:"+e.hash]=o.blockNumber,0===o.status&&Hr.throwError("transaction failed",f.errors.CALL_EXCEPTION,{transactionHash:e.hash,transaction:e,receipt:o}),o)}),i}sendTransaction(e){return Kr(this,void 0,void 0,function*(){yield this.getNetwork();const t=yield Promise.resolve(e).then(e=>K(e)),r=this.formatter.transaction(e);null==r.confirmations&&(r.confirmations=0);const i=yield this._getInternalBlockNumber(100+2*this.pollingInterval);try{const e=yield this.perform("sendTransaction",{signedTransaction:t});return this._wrapTransaction(r,e,i)}catch(e){throw e.transaction=r,e.transactionHash=r.hash,e}})}_getTransactionRequest(e){return Kr(this,void 0,void 0,function*(){const t=yield e,r={};return["from","to"].forEach(e=>{null!=t[e]&&(r[e]=Promise.resolve(t[e]).then(e=>e?this._getAddress(e):null))}),["gasLimit","gasPrice","maxFeePerGas","maxPriorityFeePerGas","value"].forEach(e=>{null!=t[e]&&(r[e]=Promise.resolve(t[e]).then(e=>e?re.from(e):null))}),["type"].forEach(e=>{null!=t[e]&&(r[e]=Promise.resolve(t[e]).then(e=>null!=e?e:null))}),t.accessList&&(r.accessList=this.formatter.accessList(t.accessList)),["data"].forEach(e=>{null!=t[e]&&(r[e]=Promise.resolve(t[e]).then(e=>e?K(e):null))}),this.formatter.transactionRequest(yield y(r))})}_getFilter(e){return Kr(this,void 0,void 0,function*(){e=yield e;const t={};return null!=e.address&&(t.address=this._getAddress(e.address)),["blockHash","topics"].forEach(r=>{null!=e[r]&&(t[r]=e[r])}),["fromBlock","toBlock"].forEach(r=>{null!=e[r]&&(t[r]=this._getBlockTag(e[r]))}),this.formatter.filter(yield y(t))})}_call(e,t,r){return Kr(this,void 0,void 0,function*(){r>=10&&Hr.throwError("CCIP read exceeded maximum redirections",f.errors.SERVER_ERROR,{redirects:r,transaction:e});const i=e.to,n=yield this.perform("call",{transaction:e,blockTag:t});if(r>=0&&"latest"===t&&null!=i&&"0x556f1830"===n.substring(0,10)&&H(n)%32==4)try{const o=V(n,4),s=V(o,0,32);re.from(s).eq(i)||Hr.throwError("CCIP Read sender did not match",f.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:e,data:n});const a=[],c=re.from(V(o,32,64)).toNumber(),u=re.from(V(o,c,c+32)).toNumber(),h=V(o,c+32);for(let t=0;t<u;t++){const r=ni(h,32*t);null==r&&Hr.throwError("CCIP Read contained corrupt URL string",f.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:e,data:n}),a.push(r)}const d=oi(o,64);re.from(V(o,100,128)).isZero()||Hr.throwError("CCIP Read callback selector included junk",f.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:e,data:n});const l=V(o,96,100),p=oi(o,128),v=yield this.ccipReadFetch(e,d,a);null==v&&Hr.throwError("CCIP Read disabled or provided no URLs",f.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:e,data:n});const g={to:i,data:G([l,ui([v,p])])};return this._call(g,t,r+1)}catch(e){if(e.code===f.errors.SERVER_ERROR)throw e}try{return K(n)}catch(r){return Hr.throwError("bad result from backend",f.errors.SERVER_ERROR,{method:"call",params:{transaction:e,blockTag:t},result:n,error:r})}})}call(e,t){return Kr(this,void 0,void 0,function*(){yield this.getNetwork();const r=yield y({transaction:this._getTransactionRequest(e),blockTag:this._getBlockTag(t),ccipReadEnabled:Promise.resolve(e.ccipReadEnabled)});return this._call(r.transaction,r.blockTag,r.ccipReadEnabled?0:-1)})}estimateGas(e){return Kr(this,void 0,void 0,function*(){yield this.getNetwork();const t=yield y({transaction:this._getTransactionRequest(e)}),r=yield this.perform("estimateGas",t);try{return re.from(r)}catch(e){return Hr.throwError("bad result from backend",f.errors.SERVER_ERROR,{method:"estimateGas",params:t,result:r,error:e})}})}_getAddress(e){return Kr(this,void 0,void 0,function*(){"string"!=typeof(e=yield e)&&Hr.throwArgumentError("invalid address or ENS name","name",e);const t=yield this.resolveName(e);return null==t&&Hr.throwError("ENS name not configured",f.errors.UNSUPPORTED_OPERATION,{operation:`resolveName(${JSON.stringify(e)})`}),t})}_getBlock(e,t){return Kr(this,void 0,void 0,function*(){yield this.getNetwork(),e=yield e;let r=-128;const i={includeTransactions:!!t};if(q(e,32))i.blockHash=e;else try{i.blockTag=yield this._getBlockTag(e),q(i.blockTag)&&(r=parseInt(i.blockTag.substring(2),16))}catch(t){Hr.throwArgumentError("invalid block hash or block tag","blockHashOrBlockTag",e)}return nr(()=>Kr(this,void 0,void 0,function*(){const e=yield this.perform("getBlock",i);if(null==e)return null!=i.blockHash&&null==this._emitted["b:"+i.blockHash]||null!=i.blockTag&&r>this._emitted.block?null:void 0;if(t){let t=null;for(let r=0;r<e.transactions.length;r++){const i=e.transactions[r];if(null==i.blockNumber)i.confirmations=0;else if(null==i.confirmations){null==t&&(t=yield this._getInternalBlockNumber(100+2*this.pollingInterval));let e=t-i.blockNumber+1;e<=0&&(e=1),i.confirmations=e}}const r=this.formatter.blockWithTransactions(e);return r.transactions=r.transactions.map(e=>this._wrapTransaction(e)),r}return this.formatter.block(e)}),{oncePoll:this})})}getBlock(e){return this._getBlock(e,!1)}getBlockWithTransactions(e){return this._getBlock(e,!0)}getTransaction(e){return Kr(this,void 0,void 0,function*(){yield this.getNetwork(),e=yield e;const t={transactionHash:this.formatter.hash(e,!0)};return nr(()=>Kr(this,void 0,void 0,function*(){const r=yield this.perform("getTransaction",t);if(null==r)return null==this._emitted["t:"+e]?null:void 0;const i=this.formatter.transactionResponse(r);if(null==i.blockNumber)i.confirmations=0;else if(null==i.confirmations){let e=(yield this._getInternalBlockNumber(100+2*this.pollingInterval))-i.blockNumber+1;e<=0&&(e=1),i.confirmations=e}return this._wrapTransaction(i)}),{oncePoll:this})})}getTransactionReceipt(e){return Kr(this,void 0,void 0,function*(){yield this.getNetwork(),e=yield e;const t={transactionHash:this.formatter.hash(e,!0)};return nr(()=>Kr(this,void 0,void 0,function*(){const r=yield this.perform("getTransactionReceipt",t);if(null==r)return null==this._emitted["t:"+e]?null:void 0;if(null==r.blockHash)return;const i=this.formatter.receipt(r);if(null==i.blockNumber)i.confirmations=0;else if(null==i.confirmations){let e=(yield this._getInternalBlockNumber(100+2*this.pollingInterval))-i.blockNumber+1;e<=0&&(e=1),i.confirmations=e}return i}),{oncePoll:this})})}getLogs(e){return Kr(this,void 0,void 0,function*(){yield this.getNetwork();const t=yield y({filter:this._getFilter(e)}),r=yield this.perform("getLogs",t);return r.forEach(e=>{null==e.removed&&(e.removed=!1)}),Wr.arrayOf(this.formatter.filterLog.bind(this.formatter))(r)})}getEtherPrice(){return Kr(this,void 0,void 0,function*(){return yield this.getNetwork(),this.perform("getEtherPrice",{})})}_getBlockTag(e){return Kr(this,void 0,void 0,function*(){if("number"==typeof(e=yield e)&&e<0){e%1&&Hr.throwArgumentError("invalid BlockTag","blockTag",e);let t=yield this._getInternalBlockNumber(100+2*this.pollingInterval);return t+=e,t<0&&(t=0),this.formatter.blockTag(t)}return this.formatter.blockTag(e)})}getResolver(e){return Kr(this,void 0,void 0,function*(){let t=e;for(;;){if(""===t||"."===t)return null;if("eth"!==e&&"eth"===t)return null;const r=yield this._getResolver(t,"getResolver");if(null!=r){const i=new hi(this,r,e);return t===e||(yield i.supportsWildcard())?i:null}t=t.split(".").slice(1).join(".")}})}_getResolver(e,t){return Kr(this,void 0,void 0,function*(){null==t&&(t="ENS");const r=yield this.getNetwork();r.ensAddress||Hr.throwError("network does not support ENS",f.errors.UNSUPPORTED_OPERATION,{operation:t,network:r.name});try{const t=yield this.call({to:r.ensAddress,data:"0x0178b8bf"+Or(e).substring(2)});return this.formatter.callAddress(t)}catch(e){}return null})}resolveName(e){return Kr(this,void 0,void 0,function*(){e=yield e;try{return Promise.resolve(this.formatter.address(e))}catch(t){if(q(e))throw t}"string"!=typeof e&&Hr.throwArgumentError("invalid ENS name","name",e);const t=yield this.getResolver(e);return t?yield t.getAddress():null})}lookupAddress(e){return Kr(this,void 0,void 0,function*(){e=yield e;const t=(e=this.formatter.address(e)).substring(2).toLowerCase()+".addr.reverse",r=yield this._getResolver(t,"lookupAddress");if(null==r)return null;const i=ni(yield this.call({to:r,data:"0x691f3431"+Or(t).substring(2)}),0);return(yield this.resolveName(i))!=e?null:i})}getAvatar(e){return Kr(this,void 0,void 0,function*(){let t=null;if(q(e)){const r=this.formatter.address(e).substring(2).toLowerCase()+".addr.reverse",i=yield this._getResolver(r,"getAvatar");if(!i)return null;t=new hi(this,i,r);try{const e=yield t.getAvatar();if(e)return e.url}catch(e){if(e.code!==f.errors.CALL_EXCEPTION)throw e}try{const e=ni(yield this.call({to:i,data:"0x691f3431"+Or(r).substring(2)}),0);t=yield this.getResolver(e)}catch(e){if(e.code!==f.errors.CALL_EXCEPTION)throw e;return null}}else if(t=yield this.getResolver(e),!t)return null;const r=yield t.getAvatar();return null==r?null:r.url})}perform(e,t){return Hr.throwError(e+" not implemented",f.errors.NOT_IMPLEMENTED,{operation:e})}_startEvent(e){this.polling=this._events.filter(e=>e.pollable()).length>0}_stopEvent(e){this.polling=this._events.filter(e=>e.pollable()).length>0}_addEventListener(e,t,r){const i=new Xr(Jr(e),t,r);return this._events.push(i),this._startEvent(i),this}on(e,t){return this._addEventListener(e,t,!1)}once(e,t){return this._addEventListener(e,t,!0)}emit(e,...t){let r=!1,i=[],n=Jr(e);return this._events=this._events.filter(e=>e.tag!==n||(setTimeout(()=>{e.listener.apply(this,t)},0),r=!0,!e.once||(i.push(e),!1))),i.forEach(e=>{this._stopEvent(e)}),r}listenerCount(e){if(!e)return this._events.length;let t=Jr(e);return this._events.filter(e=>e.tag===t).length}listeners(e){if(null==e)return this._events.map(e=>e.listener);let t=Jr(e);return this._events.filter(e=>e.tag===t).map(e=>e.listener)}off(e,t){if(null==t)return this.removeAllListeners(e);const r=[];let i=!1,n=Jr(e);return this._events=this._events.filter(e=>e.tag!==n||e.listener!=t||!!i||(i=!0,r.push(e),!1)),r.forEach(e=>{this._stopEvent(e)}),this}removeAllListeners(e){let t=[];if(null==e)t=this._events,this._events=[];else{const r=Jr(e);this._events=this._events.filter(e=>e.tag!==r||(t.push(e),!1))}return t.forEach(e=>{this._stopEvent(e)}),this}}var fi=function(e,t,r,i){return new(r||(r=Promise))(function(n,o){function s(e){try{c(i.next(e))}catch(e){o(e)}}function a(e){try{c(i.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?n(e.value):(t=e.value,t instanceof r?t:new r(function(e){e(t)})).then(s,a)}c((i=i.apply(e,t||[])).next())})};const vi=new f(I),gi=["call","estimateGas"];function mi(e,t){if(null==e)return null;if("string"==typeof e.message&&e.message.match("reverted")){const r=q(e.data)?e.data:null;if(!t||r)return{message:e.message,data:r}}if("object"==typeof e){for(const r in e){const i=mi(e[r],t);if(i)return i}return null}if("string"==typeof e)try{return mi(JSON.parse(e),t)}catch(e){}return null}function yi(e,t,r){const i=r.transaction||r.signedTransaction;if("call"===e){const e=mi(t,!0);if(e)return e.data;vi.throwError("missing revert data in call exception; Transaction reverted without a reason string",f.errors.CALL_EXCEPTION,{data:"0x",transaction:i,error:t})}if("estimateGas"===e){let r=mi(t.body,!1);null==r&&(r=mi(t,!1)),r&&vi.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",f.errors.UNPREDICTABLE_GAS_LIMIT,{reason:r.message,method:e,transaction:i,error:t})}let n=t.message;throw t.code===f.errors.SERVER_ERROR&&t.error&&"string"==typeof t.error.message?n=t.error.message:"string"==typeof t.body?n=t.body:"string"==typeof t.responseText&&(n=t.responseText),n=(n||"").toLowerCase(),n.match(/insufficient funds|base fee exceeds gas limit/i)&&vi.throwError("insufficient funds for intrinsic transaction cost",f.errors.INSUFFICIENT_FUNDS,{error:t,method:e,transaction:i}),n.match(/nonce (is )?too low/i)&&vi.throwError("nonce has already been used",f.errors.NONCE_EXPIRED,{error:t,method:e,transaction:i}),n.match(/replacement transaction underpriced|transaction gas price.*too low/i)&&vi.throwError("replacement fee too low",f.errors.REPLACEMENT_UNDERPRICED,{error:t,method:e,transaction:i}),n.match(/only replay-protected/i)&&vi.throwError("legacy pre-eip-155 transactions not supported",f.errors.UNSUPPORTED_OPERATION,{error:t,method:e,transaction:i}),gi.indexOf(e)>=0&&n.match(/gas required exceeds allowance|always failing transaction|execution reverted/)&&vi.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",f.errors.UNPREDICTABLE_GAS_LIMIT,{error:t,method:e,transaction:i}),t}function bi(e){return new Promise(function(t){setTimeout(t,e)})}function Si(e){if(e.error){const t=new Error(e.error.message);throw t.code=e.error.code,t.data=e.error.data,t}return e.result}function Ci(e){return e?e.toLowerCase():e}const wi={};class Pi extends k{constructor(e,t,r){if(super(),e!==wi)throw new Error("do not call the JsonRpcSigner constructor directly; use provider.getSigner");g(this,"provider",t),null==r&&(r=0),"string"==typeof r?(g(this,"_address",this.provider.formatter.address(r)),g(this,"_index",null)):"number"==typeof r?(g(this,"_index",r),g(this,"_address",null)):vi.throwArgumentError("invalid address or index","addressOrIndex",r)}connect(e){return vi.throwError("cannot alter JSON-RPC Signer connection",f.errors.UNSUPPORTED_OPERATION,{operation:"connect"})}connectUnchecked(){return new Ai(wi,this.provider,this._address||this._index)}getAddress(){return this._address?Promise.resolve(this._address):this.provider.send("eth_accounts",[]).then(e=>(e.length<=this._index&&vi.throwError("unknown account #"+this._index,f.errors.UNSUPPORTED_OPERATION,{operation:"getAddress"}),this.provider.formatter.address(e[this._index])))}sendUncheckedTransaction(e){e=b(e);const t=this.getAddress().then(e=>(e&&(e=e.toLowerCase()),e));if(null==e.gasLimit){const r=b(e);r.from=t,e.gasLimit=this.provider.estimateGas(r)}return null!=e.to&&(e.to=Promise.resolve(e.to).then(e=>fi(this,void 0,void 0,function*(){if(null==e)return null;const t=yield this.provider.resolveName(e);return null==t&&vi.throwArgumentError("provided ENS name resolves to null","tx.to",e),t}))),y({tx:y(e),sender:t}).then(({tx:t,sender:r})=>{null!=t.from?t.from.toLowerCase()!==r&&vi.throwArgumentError("from address mismatch","transaction",e):t.from=r;const i=this.provider.constructor.hexlifyTransaction(t,{from:!0});return this.provider.send("eth_sendTransaction",[i]).then(e=>e,e=>("string"==typeof e.message&&e.message.match(/user denied/i)&&vi.throwError("user rejected transaction",f.errors.ACTION_REJECTED,{action:"sendTransaction",transaction:t}),yi("sendTransaction",e,i)))})}signTransaction(e){return vi.throwError("signing transactions is unsupported",f.errors.UNSUPPORTED_OPERATION,{operation:"signTransaction"})}sendTransaction(e){return fi(this,void 0,void 0,function*(){const t=yield this.provider._getInternalBlockNumber(100+2*this.provider.pollingInterval),r=yield this.sendUncheckedTransaction(e);try{return yield nr(()=>fi(this,void 0,void 0,function*(){const e=yield this.provider.getTransaction(r);if(null!==e)return this.provider._wrapTransaction(e,r,t)}),{oncePoll:this.provider})}catch(e){throw e.transactionHash=r,e}})}signMessage(e){return fi(this,void 0,void 0,function*(){const t="string"==typeof e?Oe(e):e,r=yield this.getAddress();try{return yield this.provider.send("personal_sign",[K(t),r.toLowerCase()])}catch(e){throw"string"==typeof e.message&&e.message.match(/user denied/i)&&vi.throwError("user rejected signing",f.errors.ACTION_REJECTED,{action:"signMessage",from:r,message:t}),e}})}_legacySignMessage(e){return fi(this,void 0,void 0,function*(){const t="string"==typeof e?Oe(e):e,r=yield this.getAddress();try{return yield this.provider.send("eth_sign",[r.toLowerCase(),K(t)])}catch(e){throw"string"==typeof e.message&&e.message.match(/user denied/i)&&vi.throwError("user rejected signing",f.errors.ACTION_REJECTED,{action:"_legacySignMessage",from:r,message:t}),e}})}_signTypedData(e,t,r){return fi(this,void 0,void 0,function*(){const i=yield Je.resolveNames(e,t,r,e=>this.provider.resolveName(e)),n=yield this.getAddress();try{return yield this.provider.send("eth_signTypedData_v4",[n.toLowerCase(),JSON.stringify(Je.getPayload(i.domain,t,i.value))])}catch(e){throw"string"==typeof e.message&&e.message.match(/user denied/i)&&vi.throwError("user rejected signing",f.errors.ACTION_REJECTED,{action:"_signTypedData",from:n,message:{domain:i.domain,types:t,value:i.value}}),e}})}unlock(e){return fi(this,void 0,void 0,function*(){const t=this.provider,r=yield this.getAddress();return t.send("personal_unlockAccount",[r.toLowerCase(),e,null])})}}class Ai extends Pi{sendTransaction(e){return this.sendUncheckedTransaction(e).then(e=>({hash:e,nonce:null,gasLimit:null,gasPrice:null,data:null,value:null,chainId:null,confirmations:0,from:null,wait:t=>this.provider.waitForTransaction(e,t)}))}}const Ii={chainId:!0,data:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,value:!0,type:!0,accessList:!0,maxFeePerGas:!0,maxPriorityFeePerGas:!0};class Ri extends pi{constructor(e,t){let r=t;null==r&&(r=new Promise((e,t)=>{setTimeout(()=>{this.detectNetwork().then(t=>{e(t)},e=>{t(e)})},0)})),super(r),e||(e=m(this.constructor,"defaultUrl")()),g(this,"connection","string"==typeof e?Object.freeze({url:e}):Object.freeze(b(e))),this._nextId=42}get _cache(){return null==this._eventLoopCache&&(this._eventLoopCache={}),this._eventLoopCache}static defaultUrl(){return"http://localhost:8545"}detectNetwork(){return this._cache.detectNetwork||(this._cache.detectNetwork=this._uncachedDetectNetwork(),setTimeout(()=>{this._cache.detectNetwork=null},0)),this._cache.detectNetwork}_uncachedDetectNetwork(){return fi(this,void 0,void 0,function*(){yield bi(0);let e=null;try{e=yield this.send("eth_chainId",[])}catch(t){try{e=yield this.send("net_version",[])}catch(e){}}if(null!=e){const t=m(this.constructor,"getNetwork");try{return t(re.from(e).toNumber())}catch(t){return vi.throwError("could not detect network",f.errors.NETWORK_ERROR,{chainId:e,event:"invalidNetwork",serverError:t})}}return vi.throwError("could not detect network",f.errors.NETWORK_ERROR,{event:"noNetwork"})})}getSigner(e){return new Pi(wi,this,e)}getUncheckedSigner(e){return this.getSigner(e).connectUnchecked()}listAccounts(){return this.send("eth_accounts",[]).then(e=>e.map(e=>this.formatter.address(e)))}send(e,t){const r={method:e,params:t,id:this._nextId++,jsonrpc:"2.0"};this.emit("debug",{action:"request",request:P(r),provider:this});const i=["eth_chainId","eth_blockNumber"].indexOf(e)>=0;if(i&&this._cache[e])return this._cache[e];const n=ir(this.connection,JSON.stringify(r),Si).then(e=>(this.emit("debug",{action:"response",request:r,response:e,provider:this}),e),e=>{throw this.emit("debug",{action:"response",error:e,request:r,provider:this}),e});return i&&(this._cache[e]=n,setTimeout(()=>{this._cache[e]=null},0)),n}prepareRequest(e,t){switch(e){case"getBlockNumber":return["eth_blockNumber",[]];case"getGasPrice":return["eth_gasPrice",[]];case"getBalance":return["eth_getBalance",[Ci(t.address),t.blockTag]];case"getTransactionCount":return["eth_getTransactionCount",[Ci(t.address),t.blockTag]];case"getCode":return["eth_getCode",[Ci(t.address),t.blockTag]];case"getStorageAt":return["eth_getStorageAt",[Ci(t.address),$(t.position,32),t.blockTag]];case"sendTransaction":return["eth_sendRawTransaction",[t.signedTransaction]];case"getBlock":return t.blockTag?["eth_getBlockByNumber",[t.blockTag,!!t.includeTransactions]]:t.blockHash?["eth_getBlockByHash",[t.blockHash,!!t.includeTransactions]]:null;case"getTransaction":return["eth_getTransactionByHash",[t.transactionHash]];case"getTransactionReceipt":return["eth_getTransactionReceipt",[t.transactionHash]];case"call":return["eth_call",[m(this.constructor,"hexlifyTransaction")(t.transaction,{from:!0}),t.blockTag]];case"estimateGas":return["eth_estimateGas",[m(this.constructor,"hexlifyTransaction")(t.transaction,{from:!0})]];case"getLogs":return t.filter&&null!=t.filter.address&&(t.filter.address=Ci(t.filter.address)),["eth_getLogs",[t.filter]]}return null}perform(e,t){return fi(this,void 0,void 0,function*(){if("call"===e||"estimateGas"===e){const e=t.transaction;if(e&&null!=e.type&&re.from(e.type).isZero()&&null==e.maxFeePerGas&&null==e.maxPriorityFeePerGas){const r=yield this.getFeeData();null==r.maxFeePerGas&&null==r.maxPriorityFeePerGas&&((t=b(t)).transaction=b(e),delete t.transaction.type)}}const r=this.prepareRequest(e,t);null==r&&vi.throwError(e+" not implemented",f.errors.NOT_IMPLEMENTED,{operation:e});try{return yield this.send(r[0],r[1])}catch(r){return yi(e,r,t)}})}_startEvent(e){"pending"===e.tag&&this._startPending(),super._startEvent(e)}_startPending(){if(null!=this._pendingFilter)return;const e=this,t=this.send("eth_newPendingTransactionFilter",[]);this._pendingFilter=t,t.then(function(r){return function i(){e.send("eth_getFilterChanges",[r]).then(function(r){if(e._pendingFilter!=t)return null;let i=Promise.resolve();return r.forEach(function(t){e._emitted["t:"+t.toLowerCase()]="pending",i=i.then(function(){return e.getTransaction(t).then(function(t){return e.emit("pending",t),null})})}),i.then(function(){return bi(1e3)})}).then(function(){if(e._pendingFilter==t)return setTimeout(function(){i()},0),null;e.send("eth_uninstallFilter",[r])}).catch(e=>{})}(),r}).catch(e=>{})}_stopEvent(e){"pending"===e.tag&&0===this.listenerCount("pending")&&(this._pendingFilter=null),super._stopEvent(e)}static hexlifyTransaction(e,t){const r=b(Ii);if(t)for(const e in t)t[e]&&(r[e]=!0);!function(e,t){e&&"object"==typeof e||v.throwArgumentError("invalid object","object",e),Object.keys(e).forEach(r=>{t[r]||v.throwArgumentError("invalid object key - "+r,"transaction:"+r,e)})}(e,r);const i={};return["chainId","gasLimit","gasPrice","type","maxFeePerGas","maxPriorityFeePerGas","nonce","value"].forEach(function(t){if(null==e[t])return;const r=J(re.from(e[t]));"gasLimit"===t&&(t="gas"),i[t]=r}),["from","to","data"].forEach(function(t){null!=e[t]&&(i[t]=K(e[t]))}),e.accessList&&(i.accessList=Vt(e.accessList)),i}}const Ei=new f(I);let Ti=1;function Mi(e,t){const r="Web3LegacyFetcher";return function(e,i){const n={method:e,params:i,id:Ti++,jsonrpc:"2.0"};return new Promise((e,i)=>{this.emit("debug",{action:"request",fetcher:r,request:P(n),provider:this}),t(n,(t,o)=>{if(t)return this.emit("debug",{action:"response",fetcher:r,error:t,request:n,provider:this}),i(t);if(this.emit("debug",{action:"response",fetcher:r,request:n,response:o,provider:this}),o.error){const e=new Error(o.error.message);return e.code=o.error.code,e.data=o.error.data,i(e)}e(o.result)})})}}class ki extends Ri{constructor(e,t){null==e&&Ei.throwArgumentError("missing provider","provider",e);let r=null,i=null,n=null;"function"==typeof e?(r="unknown:",i=e):(r=e.host||e.path||"",!r&&e.isMetaMask&&(r="metamask"),n=e,e.request?(""===r&&(r="eip-1193:"),i=function(e){return function(t,r){null==r&&(r=[]);const i={method:t,params:r};return this.emit("debug",{action:"request",fetcher:"Eip1193Fetcher",request:P(i),provider:this}),e.request(i).then(e=>(this.emit("debug",{action:"response",fetcher:"Eip1193Fetcher",request:i,response:e,provider:this}),e),e=>{throw this.emit("debug",{action:"response",fetcher:"Eip1193Fetcher",request:i,error:e,provider:this}),e})}}(e)):e.sendAsync?i=Mi(0,e.sendAsync.bind(e)):e.send?i=Mi(0,e.send.bind(e)):Ei.throwArgumentError("unsupported provider","provider",e),r||(r="unknown:")),super(r,t),g(this,"jsonRpcFetchFunc",i),g(this,"provider",n)}send(e,t){return this.jsonRpcFetchFunc(e,t)}}var Oi=o(2492),_i=o.n(Oi);const xi={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};let Ni;const Di=new Uint8Array(16),zi=[];for(let e=0;e<256;++e)zi.push((e+256).toString(16).slice(1));const Li=function(e,t,r){if(xi.randomUUID&&!t&&!e)return xi.randomUUID();const i=(e=e||{}).random??e.rng?.()??function(){if(!Ni){if("undefined"==typeof crypto||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");Ni=crypto.getRandomValues.bind(crypto)}return Ni(Di)}();if(i.length<16)throw new Error("Random bytes length must be >= 16");if(i[6]=15&i[6]|64,i[8]=63&i[8]|128,t){if((r=r||0)<0||r+16>t.length)throw new RangeError(`UUID byte range ${r}:${r+15} is out of buffer bounds`);for(let e=0;e<16;++e)t[r+e]=i[e];return t}return function(e,t=0){return(zi[e[t+0]]+zi[e[t+1]]+zi[e[t+2]]+zi[e[t+3]]+"-"+zi[e[t+4]]+zi[e[t+5]]+"-"+zi[e[t+6]]+zi[e[t+7]]+"-"+zi[e[t+8]]+zi[e[t+9]]+"-"+zi[e[t+10]]+zi[e[t+11]]+zi[e[t+12]]+zi[e[t+13]]+zi[e[t+14]]+zi[e[t+15]]).toLowerCase()}(i)},Bi="https://ai-agent.nxtlinq.ai",Fi="https://staging-ait-service.nxtlinq.ai",ji=()=>{const e=localStorage.getItem("nxtlinqAITServiceAccessToken");return e?{Authorization:`Bearer ${JSON.parse(e)}`}:{}},Ui=async(e,t,r,i)=>(await fetch(e,{...t,headers:{"X-API-Key":r,"X-API-Secret":i,...ji(),...t.headers}})).json(),qi=(e,t)=>({getAITByServiceIdAndController:async(r,i)=>Ui(`${Fi}/api/ait/service/${r.serviceId}/controller/${r.controller}`,{method:"GET"},e,t),createAIT:async(r,i)=>Ui(`${Fi}/api/ait`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(r)},e,t)}),Wi=(e,t)=>({verifyWallet:async(r,i)=>Ui(`${Fi}/api/wallet`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(r)},e,t),getWallet:async(r,i)=>Ui(`${Fi}/api/wallet/address/${r.address}`,{method:"GET"},e,t)}),Ki=(e,t)=>({createMetadata:async(r,i)=>Ui(`${Fi}/api/metadata`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(r)},e,t)}),Hi=(e,t)=>({getNonce:async r=>Ui(`${Fi}/api/auth/address/${r.address}/nonce`,{method:"GET"},e,t),signIn:async r=>Ui(`${Fi}/api/auth`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(r)},e,t)}),Vi=(e,t)=>({getServicePermissions:async r=>{try{const i=new URL(`${Bi}/api/permissions/service/${r.serviceId}`);r.groupName&&i.searchParams.append("groupName",r.groupName);const n=await fetch(i.toString(),{method:"GET",headers:{"X-API-Key":e,"X-API-Secret":t,"Content-Type":"application/json",...ji()}});if(!n.ok)throw new Error("Failed to fetch permissions");return await n.json()}catch(e){return console.error("Failed to fetch permissions:",e),{error:e instanceof Error?e.message:"Failed to fetch permissions"}}}}),Gi=(e,t)=>({getCognitiveToken:async()=>{try{const r=new URL(`${Bi}/api/cognitive/token`),i=await fetch(r.toString(),{method:"GET",headers:{"X-API-Key":e,"X-API-Secret":t,"Content-Type":"application/json",...ji()}});if(!i.ok)throw new Error("Failed to fetch permissions");return await i.json()}catch(e){return console.error("Failed to fetch cognitive token:",e),{error:e instanceof Error?e.message:"Failed to fetch cognitive token"}}}}),Ji=(e,t)=>({ait:qi(e,t),wallet:Wi(e,t),metadata:Ki(e,t),auth:Hi(e,t),agent:{sendMessage:async e=>{try{const t=e.model||"nova",r=localStorage.getItem("walletAddress"),i=localStorage.getItem("nxtlinqAITServiceAccessToken"),n=i?JSON.parse(i):null;console.log("=== SDK sendMessage AIT Info ==="),console.log("Wallet Address:",r),console.log("AIT Token Raw:",i),console.log("AIT Token Parsed:",n);const o=await fetch(`${Bi}/api/${t}`,{method:"POST",headers:{"Content-Type":"application/json","X-Wallet-Address":r||"","X-AIT-Token":n||""},body:JSON.stringify({apiKey:e.apiKey,apiSecret:e.apiSecret,pseudoId:e.pseudoId,externalId:e.externalId,message:e.message,walletAddress:r||void 0,aitToken:n||void 0})});if(!o.ok)throw new Error("Failed to send message");return await o.json()}catch(e){return console.error("Failed to send message:",e),{error:e instanceof Error?e.message:"Failed to send message"}}},generateSuggestions:async e=>{try{const t=await fetch(`${Bi}/api/suggestions`,{method:"POST",headers:{"Content-Type":"application/json","X-API-Key":e.apiKey,"X-API-Secret":e.apiSecret,...ji()},body:JSON.stringify({apiKey:e.apiKey,apiSecret:e.apiSecret,pseudoId:e.pseudoId,externalId:e.externalId||void 0})});if(!t.ok)throw new Error("Failed to generate suggestions");return await t.json()}catch(e){return console.error("Failed to generate suggestions:",e),{error:e instanceof Error?e.message:"Failed to generate suggestions"}}},updateMessagesExternalIdByPseudoId:async e=>{try{const t=await fetch(`${Bi}/api/message/pseudoId/${e.pseudoId}`,{method:"PUT",headers:{"Content-Type":"application/json","X-API-Key":e.apiKey,"X-API-Secret":e.apiSecret,...ji()},body:JSON.stringify({apiKey:e.apiKey,apiSecret:e.apiSecret,externalId:e.externalId})});if(!t.ok)throw new Error("Failed to update message history");return await t.json()}catch(e){return console.error("Failed to update message history:",e),{error:e instanceof Error?e.message:"Failed to update message history"}}},cloneUserProfileByPseudoId:async e=>{try{const t=await fetch(`${Bi}/api/userProfile/pseudoId/${e.pseudoId}`,{method:"PUT",headers:{"Content-Type":"application/json","X-API-Key":e.apiKey,"X-API-Secret":e.apiSecret,...ji()},body:JSON.stringify({apiKey:e.apiKey,apiSecret:e.apiSecret,externalId:e.externalId})});if(!t.ok)throw new Error("Failed to clone user profile");return await t.json()}catch(e){return console.error("Failed to clone user profile:",e),{error:e instanceof Error?e.message:"Failed to clone user profile"}}},cloneUserTopicByPseudoId:async e=>{try{const t=await fetch(`${Bi}/api/userTopic/pseudoId/${e.pseudoId}`,{method:"PUT",headers:{"Content-Type":"application/json","X-API-Key":e.apiKey,"X-API-Secret":e.apiSecret,...ji()},body:JSON.stringify({apiKey:e.apiKey,apiSecret:e.apiSecret,externalId:e.externalId})});if(!t.ok)throw new Error("Failed to clone user topic");return await t.json()}catch(e){return console.error("Failed to clone user topic:",e),{error:e instanceof Error?e.message:"Failed to clone user topic"}}}},permissions:Vi(e,t),cognitive:Gi(e,t)});function $i(t,r){const[i,n]=(0,e.useState)(r),[o,s]=(0,e.useState)(!1);return(0,e.useEffect)(()=>{const e=localStorage.getItem(t);e&&n(JSON.parse(e)),s(!0)},[t]),(0,e.useEffect)(()=>{o&&localStorage.setItem(t,JSON.stringify(i))},[i,o,t]),[i,n,o]}var Qi,Yi=o(9738),Xi={},Zi=function(){if(Qi)return Xi;Qi=1,Object.defineProperty(Xi,"__esModule",{value:!0}),Xi.parse=function(e,t){const r=new o,i=e.length;if(i<2)return r;const n=t?.decode||c;let u=0;do{const t=e.indexOf("=",u);if(-1===t)break;const o=e.indexOf(";",u),c=-1===o?i:o;if(t>c){u=e.lastIndexOf(";",t-1)+1;continue}const h=s(e,u,t),d=a(e,t,h),l=e.slice(h,d);if(void 0===r[l]){let i=s(e,t+1,c),o=a(e,c,i);const u=n(e.slice(i,o));r[l]=u}u=c+1}while(u<i);return r},Xi.serialize=function(o,s,a){const c=a?.encode||encodeURIComponent;if(!e.test(o))throw new TypeError(`argument name is invalid: ${o}`);const u=c(s);if(!t.test(u))throw new TypeError(`argument val is invalid: ${s}`);let h=o+"="+u;if(!a)return h;if(void 0!==a.maxAge){if(!Number.isInteger(a.maxAge))throw new TypeError(`option maxAge is invalid: ${a.maxAge}`);h+="; Max-Age="+a.maxAge}if(a.domain){if(!r.test(a.domain))throw new TypeError(`option domain is invalid: ${a.domain}`);h+="; Domain="+a.domain}if(a.path){if(!i.test(a.path))throw new TypeError(`option path is invalid: ${a.path}`);h+="; Path="+a.path}if(a.expires){if(!function(e){return"[object Date]"===n.call(e)}(a.expires)||!Number.isFinite(a.expires.valueOf()))throw new TypeError(`option expires is invalid: ${a.expires}`);h+="; Expires="+a.expires.toUTCString()}if(a.httpOnly&&(h+="; HttpOnly"),a.secure&&(h+="; Secure"),a.partitioned&&(h+="; Partitioned"),a.priority)switch("string"==typeof a.priority?a.priority.toLowerCase():void 0){case"low":h+="; Priority=Low";break;case"medium":h+="; Priority=Medium";break;case"high":h+="; Priority=High";break;default:throw new TypeError(`option priority is invalid: ${a.priority}`)}if(a.sameSite)switch("string"==typeof a.sameSite?a.sameSite.toLowerCase():a.sameSite){case!0:case"strict":h+="; SameSite=Strict";break;case"lax":h+="; SameSite=Lax";break;case"none":h+="; SameSite=None";break;default:throw new TypeError(`option sameSite is invalid: ${a.sameSite}`)}return h};const e=/^[\u0021-\u003A\u003C\u003E-\u007E]+$/,t=/^[\u0021-\u003A\u003C-\u007E]*$/,r=/^([.]?[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)([.][a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)*$/i,i=/^[\u0020-\u003A\u003D-\u007E]*$/,n=Object.prototype.toString,o=(()=>{const e=function(){};return e.prototype=Object.create(null),e})();function s(e,t,r){do{const r=e.charCodeAt(t);if(32!==r&&9!==r)return t}while(++t<r);return r}function a(e,t,r){for(;t>r;){const r=e.charCodeAt(--t);if(32!==r&&9!==r)return t+1}return r}function c(e){if(-1===e.indexOf("%"))return e;try{return decodeURIComponent(e)}catch(t){return e}}return Xi}();function en(e,t={}){const r=function(e){return e&&"j"===e[0]&&":"===e[1]?e.substr(2):e}(e);if(!t.doNotParse)try{return JSON.parse(r)}catch(e){}return e}class tn{constructor(e,t={}){this.changeListeners=[],this.HAS_DOCUMENT_COOKIE=!1,this.update=()=>{if(!this.HAS_DOCUMENT_COOKIE)return;const e=this.cookies;this.cookies=Zi.parse(document.cookie),this._checkChanges(e)};const r="undefined"==typeof document?"":document.cookie;this.cookies=function(e){return"string"==typeof e?Zi.parse(e):"object"==typeof e&&null!==e?e:{}}(e||r),this.defaultSetOptions=t,this.HAS_DOCUMENT_COOKIE=function(){const e="undefined"==typeof global?void 0:global.TEST_HAS_DOCUMENT_COOKIE;return"boolean"==typeof e?e:"object"==typeof document&&"string"==typeof document.cookie}()}_emitChange(e){for(let t=0;t<this.changeListeners.length;++t)this.changeListeners[t](e)}_checkChanges(e){new Set(Object.keys(e).concat(Object.keys(this.cookies))).forEach(t=>{e[t]!==this.cookies[t]&&this._emitChange({name:t,value:en(this.cookies[t])})})}_startPolling(){this.pollingInterval=setInterval(this.update,300)}_stopPolling(){this.pollingInterval&&clearInterval(this.pollingInterval)}get(e,t={}){return t.doNotUpdate||this.update(),en(this.cookies[e],t)}getAll(e={}){e.doNotUpdate||this.update();const t={};for(let r in this.cookies)t[r]=en(this.cookies[r],e);return t}set(e,t,r){r=r?Object.assign(Object.assign({},this.defaultSetOptions),r):this.defaultSetOptions;const i="string"==typeof t?t:JSON.stringify(t);this.cookies=Object.assign(Object.assign({},this.cookies),{[e]:i}),this.HAS_DOCUMENT_COOKIE&&(document.cookie=Zi.serialize(e,i,r)),this._emitChange({name:e,value:t,options:r})}remove(e,t){const r=t=Object.assign(Object.assign(Object.assign({},this.defaultSetOptions),t),{expires:new Date(1970,1,1,0,0,1),maxAge:0});this.cookies=Object.assign({},this.cookies),delete this.cookies[e],this.HAS_DOCUMENT_COOKIE&&(document.cookie=Zi.serialize(e,"",r)),this._emitChange({name:e,value:void 0,options:t})}addChangeListener(e){this.changeListeners.push(e),this.HAS_DOCUMENT_COOKIE&&1===this.changeListeners.length&&("object"==typeof window&&"cookieStore"in window?window.cookieStore.addEventListener("change",this.update):this._startPolling())}removeChangeListener(e){const t=this.changeListeners.indexOf(e);t>=0&&this.changeListeners.splice(t,1),this.HAS_DOCUMENT_COOKIE&&0===this.changeListeners.length&&("object"==typeof window&&"cookieStore"in window?window.cookieStore.removeEventListener("change",this.update):this._stopPolling())}removeAllChangeListeners(){for(;this.changeListeners.length>0;)this.removeChangeListener(this.changeListeners[0])}}let rn;const nn=async(e,t)=>{const r=await async function(e,t){const r=Ji(e,t),i=new tn,n=i.get("speech-token");if(void 0!==n){const e=n.indexOf(":");return{authToken:n.slice(e+1),region:n.slice(0,e)}}try{const e=await r.cognitive.getCognitiveToken();if("error"in e)throw new Error(e.error);const t=e.token,n=e.region;return i.set("speech-token",n+":"+t,{maxAge:540,path:"/"}),{authToken:t,region:n}}catch(e){const t=e;return console.log(t.response.data),{authToken:null,error:t.response.data}}}(t.apiKey,t.apiSecret),i=Yi.SpeechConfig.fromAuthorizationToken(r.authToken,r.region);i.speechRecognitionLanguage="en-US",i.setProperty(Yi.PropertyId.SpeechServiceConnection_InitialSilenceTimeoutMs,"10000"),i.setProperty(Yi.PropertyId.SpeechServiceConnection_EndSilenceTimeoutMs,"86400000"),i.setProperty(Yi.PropertyId.Speech_SegmentationSilenceTimeoutMs,"2500");const n=Yi.AudioConfig.fromDefaultMicrophoneInput();rn=new Yi.SpeechRecognizer(i,n);const o=[];let s=0;return rn.recognizing=(t,r)=>{console.log(`RECOGNIZING: Text=${r.result.text}`),o[s]=r.result.text,e([...o])},rn.recognized=(t,r)=>{r.result.reason===Yi.ResultReason.RecognizedSpeech&&(console.log(`RECOGNIZED: Text=${r.result.text}`),o[s]=r.result.text,e([...o]),s+=1)},rn.canceled=(e,t)=>{console.log(`CANCELED: Reason=${t.reason}`),t.reason===Yi.CancellationReason.Error&&(console.error(`CANCELED: ErrorCode=${t.errorCode}`),console.error(`CANCELED: ErrorDetails=${t.errorDetails}`),console.error("CANCELED: Did you set the speech resource key and region values?")),on(rn)},rn.startContinuousRecognitionAsync(),rn},on=e=>{e&&e.stopContinuousRecognitionAsync()};function sn({apiKey:t,apiSecret:r}){const[i,n]=(0,e.useState)(!1),[o,s]=(0,e.useState)([]),[a,c]=(0,e.useState)(),u=(0,e.useRef)();return{start:async()=>{await async function(){if("wakeLock"in navigator)try{u.current=await navigator.wakeLock.request("screen"),u.current.addEventListener("release",()=>{console.log("Wake lock released")})}catch(e){console.error("Wake lock error:",e)}}(),n(!0);const e=await nn(s,{apiKey:t,apiSecret:r});c(e)},stop:()=>{u.current?.release(),on(a),n(!1),c(void 0)},isRecording:i,transcript:o.join(" ")}}const an=new(o(4521).MetaKeep)({appId:"e7d521f7-3eea-42d7-af42-4d8b962d9a6d",chainId:80002,rpcNodeUrls:{80002:"https://rpc-amoy.polygon.technology"}}),cn=e=>new Promise(t=>setTimeout(t,e)),un=[{label:"Claude",value:"claude"},{label:"ChatGPT",value:"open-ai"},{label:"Llama",value:"llama"},{label:"Gemini",value:"gemini"}],hn={claude:"Claude","open-ai":"ChatGPT",llama:"Llama",gemini:"Gemini",nova:"Nova","v1.1/open-ai":"ChatGPT-v1.1","v1.2/open-ai":"ChatGPT-v1.2","v2/claude":"Claude-v2","v2/open-ai":"ChatGPT-v2","v2/llama":"Llama-v2","v2/gemini":"Gemini-v2","v2/nova":"Nova-v2"},dn=e.createContext(void 0),ln=()=>{const t=e.useContext(dn);if(!t)throw new Error("useChatBot must be used within a ChatBotProvider");return t},pn=({onMessage:t,onError:r,onToolUse:i,presetMessages:n=[],placeholder:o="Type a message...",className:s="",maxRetries:a=3,retryDelay:c=2e3,serviceId:u,apiKey:h,apiSecret:d,onVerifyWallet:l,permissionGroup:p,children:f,availableModels:v=un,defaultModelIndex:g=0,showModelSelector:m=!0,onModelChange:y})=>{const b=e.useMemo(()=>Ji(h,d),[h,d]),{isRecording:S,transcript:C,start:w,stop:P}=sn({apiKey:h,apiSecret:d}),[A,I]=e.useState([]),[R,E]=e.useState(""),[T,M]=e.useState(!1),[k,O]=e.useState(!1),[_,x]=e.useState(null),[N,D]=e.useState(null),[z,L]=e.useState([]),[B,F]=e.useState([]),[j,U]=e.useState(!1),[q,W]=e.useState(!1),[K,H]=e.useState(!1),[V,G]=e.useState(!0),[J,$]=e.useState(null),[Q,Y]=e.useState(null),[X,Z]=e.useState(!1),[ee,te]=e.useState(!1),[re,ie]=e.useState(!1),[ne,oe]=$i("nxtlinqAITServiceAccessToken",""),[se,ae]=e.useState(n),[ce,he]=e.useState(!1),[de,le]=$i("pseudoId",Li()),pe=e.useRef(_),fe=e.useRef(N),ve=e.useRef(z),ge=e.useRef(ne),me=e.useRef(J),ye=e.useRef(!1),be=e.useRef(null);e.useEffect(()=>{pe.current=_},[_]),e.useEffect(()=>{fe.current=N},[N]),e.useEffect(()=>{ve.current=z},[z]),e.useEffect(()=>{ge.current=ne},[ne]),e.useEffect(()=>{me.current=J},[J]),e.useEffect(()=>{C&&E(C)},[C]),e.useEffect(()=>{ye.current=S},[S]);const[Se,Ce]=e.useState({show:!1,type:"info",message:"",autoHide:!0,duration:5e3}),[we,Pe]=$i("selectedAIModelIndex",g),[Ae,Ie]=e.useState(m);e.useEffect(()=>{we>=v.length?Pe(g):v[we]?(g>=v.length||!v[g])&&Pe(0):Pe(g)},[v,we,g,Pe]);const Re=(e,t,r=5e3)=>{Ce({show:!0,type:e,message:t,autoHide:!0,duration:r}),r>0&&setTimeout(()=>{Ce(e=>({...e,show:!1}))},r)},Ee=e=>Re("success",e,3e3),Te=e=>Re("error",e,5e3),Me=async(e=!1)=>{if(!_)return D(null),L([]),void Y(null);H(!0);try{if(ne)try{const e=await b.wallet.getWallet({address:_},ne);"error"in e?(console.log("Failed to get wallet info:",e.error),e.error.includes("Invalid or expired token")&&(console.log("Token appears to be invalid during wallet info fetch, clearing it"),oe(""))):(Y(e),console.log("Wallet info updated:",e))}catch(e){console.error("Failed to fetch wallet info:",e)}else console.log("No access token available for wallet info fetch");const t=await b.ait.getAITByServiceIdAndController({serviceId:u,controller:_},ne||"");if("error"in t)return console.error("Failed to fetch AIT:",t.error),D(null),void L([]);if(D(t),!q||e){const e=t.metadata?.permissions||[];L(e)}}catch(e){console.error("Failed to fetch AIT:",e),D(null),L([])}finally{H(!1)}},ke=e.useMemo(()=>{if(!_)return!1;if(!ne)return!0;try{const e=JSON.parse(atob(ne.split(".")[1]));return 1e3*e.exp<Date.now()||e.address!==_}catch(e){return console.error("Error parsing token:",e),!0}},[_,ne]),_e=e.useCallback(async(e=!0)=>{if("undefined"!=typeof window)try{const t=await an.ethereum;if(!t)throw new Error("Web3 provider not available");await t.enable();const r=new ki(t),i=await r.getSigner(),n=await i.getAddress();if(localStorage.setItem("walletAddress",n),x(n),$(i),ne)try{const e=JSON.parse(atob(ne.split(".")[1])),t=1e3*e.exp,r=Date.now(),i=e.address;t<r||i!==n?(console.log("Token is expired or address mismatch, clearing token"),oe("")):(await Me(),await cn(1e3))}catch(e){console.error("Error parsing token during wallet connection:",e),oe("")}return e&&(ke?I(e=>[...e,{id:Date.now().toString(),content:"Please sign in with your wallet to continue.",role:"assistant",timestamp:(new Date).toISOString(),button:"signIn"}]):Ee("Successfully connected your HIT wallet. You are already signed in and can use the AI agent.")),n}catch(t){if(console.error("Failed to connect wallet:",t),localStorage.removeItem("walletAddress"),x(null),$(null),e)throw t}else console.error("Web3 is not available in server-side rendering")},[ne,Me,ke]),xe=async(e=!0)=>{const t=pe.current,r=me.current;if(console.log("signInWallet called: currentHitAddress =",t,"currentSigner =",!!r),!t)return console.log("No currentHitAddress, returning early"),void(e&&Te("Please connect your wallet first."));if(!r)return console.log("No currentSigner, returning early"),void(e&&Te("Please connect your wallet first."));try{const i=await b.auth.getNonce({address:t});if("error"in i)return void(e&&Te(i.error));const n={address:t,code:i.code,timestamp:i.timestamp},o=_i()(n),s=await r.signMessage(o||""),a=await b.auth.signIn({...n,signature:s});if("error"in a)return void(e&&Te(a.error));const{accessToken:c}=a;oe(c),await new Promise(e=>setTimeout(e,100)),await Me(),e&&Ee("Successfully signed in with your HIT wallet. You can now use the AI agent.")}catch(t){console.error("Failed to sign in:",t),e&&Te("Failed to sign in. Please try again.")}},Ne=async(e,t=!0,r)=>{const i=pe.current,n=fe.current,o=ve.current,s=ge.current;if(!i){if(t){M(!1),I(e=>[...e,{id:Date.now().toString(),content:"Please connect your HIT wallet to continue.",role:"assistant",timestamp:(new Date).toISOString(),button:"connect"}]);try{if(te(!0),await _e(!1),te(!1),ie(!0),console.log("Set justAutoConnected to true after auto-connect"),Ee("Auto wallet connection successful"),setTimeout(()=>{ie(!1)},15e3),r?.(),await new Promise(e=>setTimeout(e,2e3)),!ge.current){te(!0),await xe(!1),te(!1),Ee("Auto sign-in successful after wallet connect"),await Me();let e=0;const t=5;for(;!fe.current&&e<t;)await new Promise(e=>setTimeout(e,2e3)),e++}return await Ne(e,!1)}catch(e){return console.error("Failed to auto-connect wallet:",e),te(!1),!1}}return!1}if(!s){if(t){console.log("Auto sign-in triggered: currentHitAddress =",i,"currentToken =",s),M(!1),I(e=>[...e,{id:Date.now().toString(),content:"Please sign in with your HIT wallet to continue.",role:"assistant",timestamp:(new Date).toISOString(),button:"signIn"}]);try{te(!0),console.log("Starting auto sign-in..."),await xe(!1),console.log("Auto sign-in completed"),te(!1),Ee("Auto sign-in successful"),await Me();let t=0;const r=5;for(;!fe.current&&t<r;)await new Promise(e=>setTimeout(e,2e3)),t++;return fe.current?(console.log("AIT loaded successfully after sign-in, continuing permission check"),await new Promise(e=>setTimeout(e,2e3)),await Ne(e,!1)):(console.log("AIT failed to load after sign-in, returning false"),!1)}catch(e){return console.error("Failed to auto-sign-in wallet:",e),te(!1),!1}}return!1}try{const r=JSON.parse(atob(s.split(".")[1]));if(1e3*r.exp<Date.now()){if(oe(""),t){M(!1),I(e=>[...e,{id:Date.now().toString(),content:"Your wallet session has expired. Please sign in again.",role:"assistant",timestamp:(new Date).toISOString(),button:"signIn"}]);try{te(!0),await xe(!1),te(!1),Ee("Auto sign-in successful after session expiry"),await Me();let t=0;const r=5;for(;!fe.current&&t<r;)await new Promise(e=>setTimeout(e,2e3)),t++;return fe.current?(console.log("AIT loaded successfully after session expiry, continuing permission check"),await new Promise(e=>setTimeout(e,2e3)),await Ne(e,!1)):(console.log("AIT failed to load after session expiry, returning false"),!1)}catch(e){return console.error("Failed to auto-sign-in after session expiry:",e),te(!1),!1}}return!1}if(r.address!==i){if(oe(""),t){M(!1),I(e=>[...e,{id:Date.now().toString(),content:"Wallet address mismatch. Please sign in with the correct wallet.",role:"assistant",timestamp:(new Date).toISOString(),button:"signIn"}]);try{te(!0),await xe(!1),te(!1),Ee("Auto sign-in successful after address mismatch"),await Me();let t=0;const r=5;for(;!fe.current&&t<r;)await new Promise(e=>setTimeout(e,2e3)),t++;return fe.current?(console.log("AIT loaded successfully after address mismatch, continuing permission check"),await new Promise(e=>setTimeout(e,2e3)),await Ne(e,!1)):(console.log("AIT failed to load after address mismatch, returning false"),!1)}catch(e){return console.error("Failed to auto-sign-in after address mismatch:",e),te(!1),!1}}return!1}}catch(r){if(console.error("Error parsing token:",r),oe(""),t){M(!1),I(e=>[...e,{id:Date.now().toString(),content:"Invalid wallet session. Please sign in again.",role:"assistant",timestamp:(new Date).toISOString(),button:"signIn"}]);try{te(!0),await xe(!1),te(!1),Ee("Auto sign-in successful after token error"),await Me();let t=0;const r=5;for(;!fe.current&&t<r;)await new Promise(e=>setTimeout(e,2e3)),t++;return fe.current?(console.log("AIT loaded successfully after token error, continuing permission check"),await new Promise(e=>setTimeout(e,2e3)),await Ne(e,!1)):(console.log("AIT failed to load after token error, returning false"),!1)}catch(e){return console.error("Failed to auto-sign-in after token parse error:",e),te(!1),!1}}return!1}if(!n){if(K)return M(!1),I(e=>[...e,{id:Date.now().toString(),content:"Loading your wallet configuration... Please wait a moment.",role:"assistant",timestamp:(new Date).toISOString()}]),!1;if(!s||K)return M(!1),I(e=>[...e,{id:Date.now().toString(),content:"No AIT found for your wallet. Please click the settings button (⚙️) to configure your AIT permissions.",role:"assistant",timestamp:(new Date).toISOString()}]),!1;try{await Me();let e=0;const t=5;for(;!fe.current&&e<t;)await new Promise(e=>setTimeout(e,2e3)),e++;if(!fe.current)return M(!1),I(e=>[...e,{id:Date.now().toString(),content:"No AIT found for your wallet. Please click the settings button (⚙️) to configure your AIT permissions.",role:"assistant",timestamp:(new Date).toISOString()}]),!1}catch(e){return console.error("Failed to refresh AIT during permission check:",e),M(!1),I(e=>[...e,{id:Date.now().toString(),content:"No AIT found for your wallet. Please click the settings button (⚙️) to configure your AIT permissions.",role:"assistant",timestamp:(new Date).toISOString()}]),!1}}const a=B.map(e=>e.label);if(0===B.length)return M(!1),I(e=>[...e,{id:Date.now().toString(),content:`No permissions available for your current identity provider. Please check your service configuration or contact support. Service ID: ${u}, Permission Group: ${p||"None"}`,role:"assistant",timestamp:(new Date).toISOString()}]),!1;if(!a.includes(e))return M(!1),I(t=>[...t,{id:Date.now().toString(),content:`This tool (${e}) is not available for your current identity provider.`,role:"assistant",timestamp:(new Date).toISOString()}]),!1;if(!o.includes(e)){if(K||ee)return M(!1),I(e=>[...e,{id:Date.now().toString(),content:"Loading your wallet configuration... Please wait a moment.",role:"assistant",timestamp:(new Date).toISOString()}]),!1;if(n&&0===o.length)return M(!1),I(e=>[...e,{id:Date.now().toString(),content:"No AIT found for your wallet. Please click the settings button (⚙️) to configure your AIT permissions.",role:"assistant",timestamp:(new Date).toISOString()}]),!1;M(!1);const t=`You don't have the required AIT permission: ${e}. Would you like to enable AIT permission?`;return I(r=>[...r,{id:Date.now().toString(),content:t,role:"assistant",timestamp:(new Date).toISOString(),button:"enableAIT",metadata:{toolName:e}}]),!1}return!0},De=e.useCallback(e=>{Pe(e);const t=v[e];y?.(t)},[v,y]),ze=e.useCallback(()=>{let e=we;return we>=v.length&&(e=g),e>=v.length&&(e=0),0===v.length?{label:"Unknown",value:"unknown"}:v[e]},[v,we,g]),Le=e.useCallback(async(e,t)=>{const r=await b.agent.generateSuggestions({apiKey:h,apiSecret:d,pseudoId:e,externalId:t});if("error"in r)return console.error("Failed to fetch suggestions:",r.error),void ae([]);ae(r.suggestions.map(e=>({text:e,autoSend:!0})))},[]),Be=async(e,t=0,n=!1)=>{if(!e.trim()||T)return;const o=ze();if(0===t&&!n){const t={id:Date.now().toString(),content:e,role:"user",timestamp:(new Date).toISOString(),metadata:{model:o.value,permissions:z,issuedBy:_||""}};I(e=>[...e,t]),E("")}M(!0);try{const r=await b.agent.sendMessage({model:o.value,apiKey:h,apiSecret:d,pseudoId:de,externalId:localStorage.getItem("walletAddress")||void 0,message:e});if("error"in r){const e=r;if(e.requiresWalletConnection)return M(!1),void I(t=>[...t,{id:Date.now().toString(),content:e.message,role:"assistant",timestamp:(new Date).toISOString(),button:"connectWallet",metadata:{requiresWalletConnection:!0,toolName:e.toolName}}]);if(e.requiresPermissionUpdate)return M(!1),void I(t=>[...t,{id:Date.now().toString(),content:e.message,role:"assistant",timestamp:(new Date).toISOString(),button:"enableAIT",metadata:{requiresPermissionUpdate:!0,toolName:e.toolName,requiredPermission:e.requiredPermission}}]);throw new Error(e.error||e.message)}let s;if(r.toolCall?.toolUse){const a=r.toolCall.toolUse;let c="";if(i){let r=!1,o=!1;const s=await Ne(a.name,!0,()=>{r=!0});if(s||z.includes(a.name)||!B.map(e=>e.label).includes(a.name)||(o=!0),!s)return o?void M(!1):void(r&&t<1?(console.log("Auto-connected, retrying message..."),M(!1),ge.current?setTimeout(async()=>{!fe.current&&ge.current&&await Me();let r=0;for(;!fe.current&&r<5;)await new Promise(e=>setTimeout(e,2e3)),r++;fe.current?(console.log("AIT loaded successfully, retrying message"),await new Promise(e=>setTimeout(e,3e3)),Be(e,t+1,n)):console.log("AIT failed to load, not retrying")},2e3):(console.log("Wallet connected but not signed in, retrying message directly"),setTimeout(()=>{Be(e,t+1,n)},2e3))):console.log("Permission denied, not retrying. wasAutoConnected:",r,"retryCount:",t));const u=await i(a);c=u?.content||`Tool ${a.name} executed successfully`}else c=`Tool ${a.name} executed successfully`;let u="";r.reply?u=Array.isArray(r.reply)?r.reply.map(e=>e.text).join(" ")||"":r.reply||"":r.fullResponse?.output?.message?.content&&(u=r.fullResponse.output.message.content?.find(e=>e.text)?.text||"");let h="";c&&(h+=c),u&&u.trim()&&(h+=`\n\n${u}`),Le(de,localStorage.getItem("walletAddress")||void 0),s={id:(Date.now()+1).toString(),content:h,role:"assistant",timestamp:(new Date).toISOString(),metadata:{model:o.value,permissions:z,issuedBy:_||"",toolUse:a}},I(e=>[...e,s])}else if(r.reply){const e=Array.isArray(r.reply)?r.reply.map(e=>e.text).join(" ")||"Sorry, I cannot understand your question":r.reply||"Sorry, I cannot understand your question";Le(de,localStorage.getItem("walletAddress")||void 0),s={id:(Date.now()+1).toString(),content:e,role:"assistant",timestamp:(new Date).toISOString(),metadata:{model:o.value,permissions:z,issuedBy:_||""}},I(e=>[...e,s])}else{const e=r.fullResponse?.output?.message?.content?.find(e=>e.text)?.text||"Sorry, I cannot understand your question";s={id:(Date.now()+1).toString(),content:e,role:"assistant",timestamp:(new Date).toISOString(),metadata:{model:o.value,permissions:z,issuedBy:_||""}},I(e=>[...e,s])}}catch(i){if(console.error("Failed to send message:",i),t<a){const r={id:`retry-${Date.now()}-${t}`,content:`Retrying... (Attempt ${t+1}/${a})`,role:"assistant",timestamp:(new Date).toISOString(),metadata:{model:o.value,permissions:z,issuedBy:_||"",isRetry:!0}};return I(e=>[...e,r]),void setTimeout(()=>{I(e=>e.filter(e=>e.id!==r.id)),Be(e,t+1,n)},c)}const s={id:(Date.now()+1).toString(),content:i instanceof Error?i.message:"An error occurred while sending the message",role:"assistant",timestamp:(new Date).toISOString(),metadata:{model:o.value,permissions:z,issuedBy:_||""}};I(e=>[...e,s]),r?.(i instanceof Error?i:new Error("Unknown error"))}finally{M(!1)}},Fe=async(e,t=!1)=>{if(!J||!_)throw new Error("Missing signer or wallet address");if(t&&!N)throw new Error("You must have an existing AIT before AI Agent can create new AITs");const r=Math.floor(Date.now()/1e3),i=`did:polygon:nxtlinq:${_}:${r}`,n={model:"gpt-4",permissions:e||z,issuedBy:_},o=ue(Oe(_i()(n))),s=await b.metadata.createMetadata(n,ne||"");if("error"in s)throw new Error(`Failed to upload metadata: ${s.error}`);const{metadataCid:a}=s,c={aitId:i,controller:_,serviceId:u,metadataHash:o,metadataCid:a,isFromAIAgent:t,parentAITId:t?N?.aitId:void 0};console.log("createAIT params:",c);const h=await b.ait.createAIT(c,ne||"");if("error"in h)throw new Error(`Failed to create AIT: ${h.error}`);D({aitId:i,controller:_,metadata:n,metadataHash:o,metadataCid:a}),L(z)},je=async e=>{G(!0);try{await Fe(e,!1),Ee("AIT permissions saved successfully! You can now use the AI agent with your configured permissions."),U(!1),W(!1),await Me(!0)}catch(e){console.error("Failed to generate AIT:",e),G(!1),e instanceof Error?Te(e.message):Te("Failed to save permissions. Please try again.")}},Ue=async()=>{if(_)try{if(l){M(!0);const e=await l();if(!e)return void M(!1);const{token:t}=e,r=_;if(t&&r){const e={address:_,token:t,timestamp:Date.now(),method:"berifyme"};try{const i=await b.wallet.verifyWallet({...e},t);if("error"in i){if("Wallet already exists"===i.error){Z(!0);try{const e=await b.wallet.getWallet({address:r},t);if(!("error"in e)){Y(e);const i=await b.ait.getAITByServiceIdAndController({serviceId:u,controller:r},t);"error"in i||D(i)}}finally{Z(!1)}if("undefined"!=typeof window)try{const e=new URL(window.location.href);e.searchParams.delete("token"),e.searchParams.delete("isAutoConnect"),e.searchParams.delete("method"),e.searchParams.delete("returnUrl"),window.history.replaceState({},"",e.toString())}catch(e){console.error("Failed to clean URL:",e)}return M(!1),Ee("Wallet verification completed successfully! Your wallet is now verified and ready to use."),void Me()}return Te(i.error),void M(!1)}Z(!0);try{const e=await b.wallet.getWallet({address:r},t);if(!("error"in e)){Y(e);const i=await b.ait.getAITByServiceIdAndController({serviceId:u,controller:r},t);"error"in i||D(i)}}finally{Z(!1)}if("undefined"!=typeof window)try{const e=new URL(window.location.href);e.searchParams.delete("token"),e.searchParams.delete("isAutoConnect"),e.searchParams.delete("method"),e.searchParams.delete("returnUrl"),window.history.replaceState({},"",e.toString())}catch(e){console.error("Failed to clean URL:",e)}return M(!1),Ee("Wallet verification completed successfully! Your wallet is now verified and ready to use."),void Me()}catch(e){let t="Verification failed";throw"object"==typeof e&&null!==e&&"response"in e?t=e.response?.data?.error||e.message||t:e instanceof Error&&(t=e.message),console.error("Wallet verification failed:",e),Te(t),M(!1),e}}return void M(!1)}}catch(e){throw console.error("Failed to verify wallet:",e),M(!1),Te("Failed to verify wallet. Please try again."),e}else Te("Please connect your wallet first.")};e.useEffect(()=>{_&&ne&&Me()},[_,ne]),e.useEffect(()=>{(async()=>{if(u)try{const e=await b.permissions.getServicePermissions({serviceId:u,...p&&{groupName:p}});if("error"in e)return void console.error("Failed to fetch permissions:",e.error);F(e.permissions)}catch(e){console.error("Error fetching permissions:",e)}})()},[u,p]),e.useEffect(()=>{if("undefined"!=typeof window)try{new URLSearchParams(window.location.search).get("token")&&_&&Ue()}catch(e){console.error("Failed to get URL params:",e)}},[_]),e.useEffect(()=>{if(A.length>0){const e=A[A.length-1];t?.(e)}},[A,t]),e.useEffect(()=>{_&&(async()=>{await b.agent.updateMessagesExternalIdByPseudoId({apiKey:h,apiSecret:d,pseudoId:de,externalId:_}),await b.agent.cloneUserProfileByPseudoId({apiKey:h,apiSecret:d,pseudoId:de,externalId:_}),await b.agent.cloneUserTopicByPseudoId({apiKey:h,apiSecret:d,pseudoId:de,externalId:_})})()},[_,b,h,d,de]);const qe={messages:A,inputValue:R,isLoading:T,isOpen:k,hitAddress:_,ait:N,permissions:z,availablePermissions:B,showPermissionForm:j,isPermissionFormOpen:q,isAITLoading:K,isDisabled:V,walletInfo:Q,isWalletLoading:X,isAutoConnecting:ee,notification:Se,isRecording:S,transcript:C,textInputRef:be,availableModels:v,selectedModelIndex:we,showModelSelector:Ae,suggestions:se,isAITEnabling:ce,setInputValue:E,setIsOpen:O,setShowPermissionForm:U,setIsPermissionFormOpen:W,setPermissions:L,setIsDisabled:G,setIsWalletLoading:Z,setNotification:Ce,setSelectedModelIndex:Pe,setShowModelSelector:Ie,setSuggestions:ae,connectWallet:_e,signInWallet:xe,sendMessage:Be,handleSubmit:async e=>{for(e.preventDefault();ye.current;)P(),await cn(1e3);if(be.current&&be.current.value.trim()&&!T){if(K){const e={id:Date.now().toString(),content:"Loading your wallet configuration... Please wait a moment.",role:"assistant",timestamp:(new Date).toISOString(),metadata:{model:ze().value,permissions:z,issuedBy:_||""}};return void I(t=>[...t,e])}try{await Be(be.current.value)}catch(e){console.error("Failed to send message:",e),r?.(e instanceof Error?e:new Error("Failed to send message"));const t={id:Date.now().toString(),content:"Sorry, there was an error processing your message. Please try again.",role:"assistant",timestamp:(new Date).toISOString(),metadata:{model:ze().value,permissions:z,issuedBy:_||""}};I(e=>[...e,t])}}},handlePresetMessage:e=>{if(e.autoSend){const t={id:Date.now().toString(),content:e.text,role:"user",timestamp:(new Date).toISOString(),metadata:{model:ze().value,permissions:z,issuedBy:_||""}};I(e=>[...e,t]),Be(e.text,0,!0)}else E(e.text)},savePermissions:je,autoEnableAIT:async e=>{if(ce)return!1;if(he(!0),console.log("autoEnableAIT called with toolName:",e,"isFromAIAgent will be set to true"),!J||!_)return Te("Please connect your wallet first"),he(!1),!1;try{if(!B.map(e=>e.label).includes(e))return Te(`Tool ${e} is not available for your current identity provider`),he(!1),!1;const t=[...z];return t.includes(e)||t.push(e),await Fe(t,!0),Ee("AIT permission enabled successfully! You can now use the AI agent."),await Me(!0),he(!1),!0}catch(e){return console.error("Failed to auto-enable AIT:",e),he(!1),e instanceof Error?Te(e.message):Te("Failed to enable AIT permission. Please try again."),!1}},handleVerifyWalletClick:Ue,showSuccess:Ee,showError:Te,showWarning:e=>Re("warning",e,4e3),showInfo:e=>Re("info",e,3e3),refreshAIT:Me,startRecording:w,stopRecording:P,handleModelChange:De,getCurrentModel:ze,onSave:je,onConnectWallet:()=>_e(!1),onSignIn:()=>xe(!1),isNeedSignInWithWallet:ke,onVerifyWallet:Ue,serviceId:u,permissionGroup:p,props:{onMessage:t,onError:r,onToolUse:i,presetMessages:n,placeholder:o,className:s,maxRetries:a,retryDelay:c,serviceId:u,apiKey:h,apiSecret:d,onVerifyWallet:l,permissionGroup:p,availableModels:v,defaultModelIndex:g,showModelSelector:m,onModelChange:y},nxtlinqApi:b};return e.createElement(dn.Provider,{value:qe},f)},fn=({onClose:t,onOpen:r})=>{const{hitAddress:i,permissions:n,setPermissions:o,setIsDisabled:s,onSave:a,onConnectWallet:c,onSignIn:u,isNeedSignInWithWallet:h,walletInfo:d,onVerifyWallet:l,serviceId:p,nxtlinqApi:f,permissionGroup:v,isAITLoading:g,isWalletLoading:m=!1,refreshAIT:y}=ln(),[b,S]=e.useState([]),[C,w]=e.useState(!1),[P,A]=e.useState(n);e.useEffect(()=>{A(n)},[n]),e.useEffect(()=>{(async()=>{if(p)try{const e=await f.permissions.getServicePermissions({serviceId:p,...v&&{groupName:v}});if("error"in e)return void console.error("Failed to fetch permissions:",e.error);S(e.permissions)}catch(e){console.error("Error fetching permissions:",e)}})()},[p,f,v]),e.useEffect(()=>{i&&(async()=>{try{await y()}catch(e){console.error("Failed to refresh wallet info:",e)}})()},[i]);const I=Boolean(d?.id),R=()=>P.length!==n.length||P.some(e=>!n.includes(e))||n.some(e=>!P.includes(e));return m?e.createElement("div",{style:{backgroundColor:"white",padding:"24px",borderRadius:"12px",width:"480px",maxWidth:"90%",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.1)"}},e.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"24px"}},e.createElement("h3",{style:{margin:0,fontSize:"20px",fontWeight:"600",color:"#1a1a1a"}},"AIT Settings"),e.createElement("button",{onClick:t,style:{background:"none",border:"none",fontSize:"24px",cursor:"pointer",color:"#666",padding:"4px",display:"flex",alignItems:"center",justifyContent:"center"}},"×")),e.createElement("div",{style:{textAlign:"center",padding:"32px 0"}},e.createElement("div",{style:{width:"64px",height:"64px",margin:"0 auto 16px",backgroundColor:"#f5f5f5",borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center"}},e.createElement("div",{style:{width:"32px",height:"32px",border:"3px solid #e3e3e3",borderTop:"3px solid #007bff",borderRadius:"50%",animation:"spin 1s linear infinite"}})),e.createElement("p",{style:{marginBottom:"24px",fontSize:"16px",color:"#666"}},"Checking wallet status...")),e.createElement("style",null,"\n @keyframes spin {\n 0% { transform: rotate(0deg); }\n 100% { transform: rotate(360deg); }\n }\n ")):e.createElement("div",{style:{backgroundColor:"white",padding:"24px",borderRadius:"12px",width:"480px",maxWidth:"90%",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.1)"}},e.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"24px"}},e.createElement("h3",{style:{margin:0,fontSize:"20px",fontWeight:"600",color:"#1a1a1a"}},"AIT Settings"),e.createElement("button",{onClick:t,style:{background:"none",border:"none",fontSize:"24px",cursor:"pointer",color:"#666",padding:"4px",display:"flex",alignItems:"center",justifyContent:"center"}},"×")),i?h?e.createElement("div",{style:{textAlign:"center",padding:"32px 0"}},e.createElement("div",{style:{marginBottom:"24px"}},e.createElement("h4",{style:{marginBottom:"12px",fontSize:"16px",color:"#666"}},"Connected Wallet"),e.createElement("p",{style:{wordBreak:"break-all",backgroundColor:"#f8f9fa",padding:"12px",borderRadius:"8px",fontSize:"14px",color:"#333",border:"1px solid #e9ecef"}},i)),e.createElement("p",{style:{marginBottom:"24px",fontSize:"16px",color:"#666"}},"Please sign in to continue"),e.createElement("button",{onClick:u,disabled:!h,style:{padding:"12px 24px",backgroundColor:h?"#007bff":"#28a745",color:"white",border:"none",borderRadius:"8px",cursor:h?"pointer":"not-allowed",fontSize:"16px",fontWeight:"500",transition:"background-color 0.2s",opacity:h?1:.8},onMouseOver:e=>{h&&(e.currentTarget.style.backgroundColor="#0056b3")},onMouseOut:e=>{h&&(e.currentTarget.style.backgroundColor="#007bff")}},h?"Sign In":"Signed In")):I?e.createElement(e.Fragment,null,e.createElement("div",{style:{marginBottom:"24px"}},e.createElement("h4",{style:{marginBottom:"12px",fontSize:"16px",color:"#666"}},"Connected Wallet"),e.createElement("p",{style:{wordBreak:"break-all",backgroundColor:"#f8f9fa",padding:"12px",borderRadius:"8px",fontSize:"14px",color:"#333",border:"1px solid #e9ecef"}},i)),e.createElement("div",{style:{marginBottom:"24px"}},e.createElement("h4",{style:{marginBottom:"12px",fontSize:"16px",color:"#666"}},"Permissions"),g?e.createElement("div",{style:{backgroundColor:"#f8f9fa",padding:"16px",borderRadius:"8px",border:"1px solid #e9ecef",textAlign:"center",color:"#666"}},"Loading permissions..."):e.createElement("div",{style:{backgroundColor:"#f8f9fa",padding:"16px",borderRadius:"8px",border:"1px solid #e9ecef"}},b.map(t=>e.createElement("div",{key:t.id,style:{marginBottom:"12px"}},e.createElement("label",{style:{display:"flex",alignItems:"center",gap:"12px",cursor:g?"not-allowed":"pointer",padding:"8px",borderRadius:"6px",transition:"background-color 0.2s",opacity:g?.6:1},onMouseOver:e=>{g||(e.currentTarget.style.backgroundColor="#e9ecef")},onMouseOut:e=>{g||(e.currentTarget.style.backgroundColor="transparent")}},e.createElement("input",{type:"checkbox",checked:P.includes(t.label),onChange:()=>{if(!g){const e=P.includes(t.label)?P.filter(e=>e!==t.label):[...P,t.label].sort();A(e),s(!1)}},disabled:g,style:{margin:0,width:"18px",height:"18px",cursor:g?"not-allowed":"pointer"}}),e.createElement("span",{style:{fontSize:"14px",color:"#333"}},t.label)))))),e.createElement("div",{style:{display:"flex",justifyContent:"flex-end",gap:"12px",borderTop:"1px solid #e9ecef",paddingTop:"24px"}},e.createElement("button",{onClick:()=>{A(n),t()},style:{padding:"10px 20px",backgroundColor:"#f8f9fa",color:"#666",border:"1px solid #dee2e6",borderRadius:"8px",cursor:"pointer",fontSize:"14px",fontWeight:"500",transition:"all 0.2s"},onMouseOver:e=>{e.currentTarget.style.backgroundColor="#e9ecef",e.currentTarget.style.borderColor="#ced4da"},onMouseOut:e=>{e.currentTarget.style.backgroundColor="#f8f9fa",e.currentTarget.style.borderColor="#dee2e6"}},"Cancel"),e.createElement("button",{onClick:async()=>{w(!0);try{o(P),await a(P)}finally{w(!1)}},disabled:!R()||C||g,style:{padding:"10px 20px",backgroundColor:!R()||C||g?"#e9ecef":"#007bff",color:!R()||C||g?"#6c757d":"white",border:"none",borderRadius:"8px",cursor:!R()||C||g?"not-allowed":"pointer",fontSize:"14px",fontWeight:"500",transition:"background-color 0.2s"},onMouseOver:e=>{!R()||C||g||(e.currentTarget.style.backgroundColor="#0056b3")},onMouseOut:e=>{!R()||C||g||(e.currentTarget.style.backgroundColor="#007bff")}},C?"Saving...":"Save"))):e.createElement("div",{style:{textAlign:"center",padding:"32px 0"}},e.createElement("div",{style:{marginBottom:"24px"}},e.createElement("h4",{style:{marginBottom:"12px",fontSize:"16px",color:"#666"}},"Connected Wallet"),e.createElement("p",{style:{wordBreak:"break-all",backgroundColor:"#f8f9fa",padding:"12px",borderRadius:"8px",fontSize:"14px",color:"#333",border:"1px solid #e9ecef"}},i)),e.createElement("p",{style:{marginBottom:"24px",fontSize:"16px",color:"#666"}},"Please verify your wallet to continue"),e.createElement("button",{onClick:l,style:{padding:"12px 24px",backgroundColor:"#007bff",color:"white",border:"none",borderRadius:"8px",cursor:"pointer",fontSize:"16px",fontWeight:"500",transition:"background-color 0.2s"},onMouseOver:e=>e.currentTarget.style.backgroundColor="#0056b3",onMouseOut:e=>e.currentTarget.style.backgroundColor="#007bff"},"Verify your wallet")):e.createElement("div",{style:{textAlign:"center",padding:"32px 0"}},e.createElement("div",{style:{width:"64px",height:"64px",margin:"0 auto 16px",backgroundColor:"#f5f5f5",borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center"}},e.createElement("span",{style:{fontSize:"32px"}},"👛")),e.createElement("p",{style:{marginBottom:"24px",fontSize:"16px",color:"#666"}},"Please connect your wallet first"),e.createElement("button",{onClick:c,disabled:Boolean(i),style:{padding:"12px 24px",backgroundColor:Boolean(i)?"#28a745":"#007bff",color:"white",border:"none",borderRadius:"8px",cursor:Boolean(i)?"not-allowed":"pointer",fontSize:"16px",fontWeight:"500",transition:"background-color 0.2s",opacity:Boolean(i)?.8:1},onMouseOver:e=>{Boolean(i)||(e.currentTarget.style.backgroundColor="#0056b3")},onMouseOut:e=>{Boolean(i)||(e.currentTarget.style.backgroundColor="#007bff")}},Boolean(i)?"Connected":"Connect Wallet")))},vn=()=>{const{messages:t,isLoading:r,connectWallet:i,signInWallet:n,hitAddress:o,ait:s,setShowPermissionForm:a,isWalletLoading:c,isAutoConnecting:u,isNeedSignInWithWallet:h,autoEnableAIT:d,isAITLoading:l,isAITEnabling:p,sendMessage:f}=ln(),v=e.useRef(null);return e.useEffect(()=>{v.current?.scrollIntoView({behavior:"smooth"})},[t]),e.createElement("div",{style:{flex:1,padding:"15px",overflowY:"auto",display:"flex",flexDirection:"column",gap:"10px"}},t.map(r=>{return e.createElement("div",{key:r.id,style:{alignSelf:"user"===r.role?"flex-end":"flex-start",maxWidth:"80%",marginBottom:"10px"}},e.createElement("div",{style:{backgroundColor:"user"===r.role?"#007bff":r.metadata?.isRetry?"#fff3cd":"#f1f1f1",color:"user"===r.role?"white":r.metadata?.isRetry?"#856404":"#333",padding:"10px 15px",borderRadius:"15px",wordWrap:"break-word",position:"relative",border:r.metadata?.isRetry?"1px solid #ffeaa7":"none"}},r.metadata?.isRetry&&e.createElement("span",{style:{marginRight:"8px",fontSize:"14px"}},"🔄"),r.content,r.button&&e.createElement("div",{style:{marginTop:"10px"}},e.createElement("button",{onClick:()=>(async(e,r)=>{if("connect"===e)i(!0);else if("connectWallet"===e)i(!0);else if("signIn"===e)n(!0);else if("enableAIT"===e){const e=r.metadata?.toolName;if(e&&await d(e)){const e=[...t].reverse().find(e=>"user"===e.role);e&&e.content&&await f(e.content)}}})(r.button,r),disabled:u||"connect"===r.button&&Boolean(o)||"connectWallet"===r.button&&Boolean(o)||"signIn"===r.button&&!h||"enableAIT"===r.button&&(l||p),style:{padding:"8px 16px",backgroundColor:"user"===r.role?"rgba(255, 255, 255, 0.2)":u?"#6c757d":"connect"===r.button&&Boolean(o)||"connectWallet"===r.button&&Boolean(o)?"#28a745":"signIn"!==r.button||h?"enableAIT"===r.button&&(l||p)?"#6c757d":"#007bff":"#28a745",color:(r.role,"white"),border:"none",borderRadius:"5px",cursor:u||"connect"===r.button&&Boolean(o)||"connectWallet"===r.button&&Boolean(o)||"signIn"===r.button&&!h||"enableAIT"===r.button&&(l||p)?"not-allowed":"pointer",fontSize:"14px",opacity:u||"connect"===r.button&&Boolean(o)||"connectWallet"===r.button&&Boolean(o)||"signIn"===r.button&&!h||"enableAIT"===r.button&&(l||p)?.8:1}},u?"Connecting...":"connect"===r.button||"connectWallet"===r.button?Boolean(o)?"Connected":"Connect Wallet":"signIn"===r.button?h?"Sign In":"Signed In":"enableAIT"===r.button?l||p?"Enabling...":"Enable AIT Permissions":r.button))),"assistant"===r.role&&r.metadata?.model&&e.createElement("div",{style:{display:"flex",alignItems:"center",marginTop:"4px",marginLeft:"8px"}},e.createElement("div",{style:{backgroundColor:"#e3f2fd",color:"#1976d2",padding:"2px 8px",borderRadius:"10px",fontSize:"10px",fontWeight:"500",border:"1px solid #bbdefb",display:"flex",alignItems:"center",gap:"4px"}},e.createElement("span",{style:{width:"6px",height:"6px",backgroundColor:"#1976d2",borderRadius:"50%",display:"inline-block"}}),(s=r.metadata.model)?hn[s]||s:"")));var s}),r&&e.createElement("div",{style:{alignSelf:"flex-start",backgroundColor:"#f1f1f1",color:"#333",padding:"10px 15px",borderRadius:"15px",maxWidth:"80%"}},"Thinking..."),e.createElement("div",{ref:v}))};function gn(e){var t,r,i="";if("string"==typeof e||"number"==typeof e)i+=e;else if("object"==typeof e)if(Array.isArray(e)){var n=e.length;for(t=0;t<n;t++)e[t]&&(r=gn(e[t]))&&(i&&(i+=" "),i+=r)}else for(r in e)e[r]&&(i&&(i+=" "),i+=r);return i}const mn=function(){for(var e,t,r=0,i="",n=arguments.length;r<n;r++)(e=arguments[r])&&(t=gn(e))&&(i&&(i+=" "),i+=t);return i};function yn(e,t,r=void 0){const i={};for(const n in e){const o=e[n];let s="",a=!0;for(let e=0;e<o.length;e+=1){const i=o[e];i&&(s+=(!0===a?"":" ")+t(i),a=!1,r&&r[i]&&(s+=" "+r[i]))}i[n]=s}return i}function bn(e,...t){const r=new URL(`https://mui.com/production-error/?code=${e}`);return t.forEach(e=>r.searchParams.append("args[]",e)),`Minified MUI error #${e}; visit ${r} for the full message.`}function Sn(e){if("string"!=typeof e)throw new Error(bn(7));return e.charAt(0).toUpperCase()+e.slice(1)}const Cn=Sn;function wn(){return wn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var i in r)({}).hasOwnProperty.call(r,i)&&(e[i]=r[i])}return e},wn.apply(null,arguments)}var Pn=function(){function e(e){var t=this;this._insertTag=function(e){var r;r=0===t.tags.length?t.insertionPoint?t.insertionPoint.nextSibling:t.prepend?t.container.firstChild:t.before:t.tags[t.tags.length-1].nextSibling,t.container.insertBefore(e,r),t.tags.push(e)},this.isSpeedy=void 0===e.speedy||e.speedy,this.tags=[],this.ctr=0,this.nonce=e.nonce,this.key=e.key,this.container=e.container,this.prepend=e.prepend,this.insertionPoint=e.insertionPoint,this.before=null}var t=e.prototype;return t.hydrate=function(e){e.forEach(this._insertTag)},t.insert=function(e){this.ctr%(this.isSpeedy?65e3:1)==0&&this._insertTag(function(e){var t=document.createElement("style");return t.setAttribute("data-emotion",e.key),void 0!==e.nonce&&t.setAttribute("nonce",e.nonce),t.appendChild(document.createTextNode("")),t.setAttribute("data-s",""),t}(this));var t=this.tags[this.tags.length-1];if(this.isSpeedy){var r=function(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t++)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]}(t);try{r.insertRule(e,r.cssRules.length)}catch(e){}}else t.appendChild(document.createTextNode(e));this.ctr++},t.flush=function(){this.tags.forEach(function(e){var t;return null==(t=e.parentNode)?void 0:t.removeChild(e)}),this.tags=[],this.ctr=0},e}(),An=Math.abs,In=String.fromCharCode,Rn=Object.assign;function En(e){return e.trim()}function Tn(e,t,r){return e.replace(t,r)}function Mn(e,t){return e.indexOf(t)}function kn(e,t){return 0|e.charCodeAt(t)}function On(e,t,r){return e.slice(t,r)}function _n(e){return e.length}function xn(e){return e.length}function Nn(e,t){return t.push(e),e}var Dn=1,zn=1,Ln=0,Bn=0,Fn=0,jn="";function Un(e,t,r,i,n,o,s){return{value:e,root:t,parent:r,type:i,props:n,children:o,line:Dn,column:zn,length:s,return:""}}function qn(e,t){return Rn(Un("",null,null,"",null,null,0),e,{length:-e.length},t)}function Wn(){return Fn=Bn>0?kn(jn,--Bn):0,zn--,10===Fn&&(zn=1,Dn--),Fn}function Kn(){return Fn=Bn<Ln?kn(jn,Bn++):0,zn++,10===Fn&&(zn=1,Dn++),Fn}function Hn(){return kn(jn,Bn)}function Vn(){return Bn}function Gn(e,t){return On(jn,e,t)}function Jn(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function $n(e){return Dn=zn=1,Ln=_n(jn=e),Bn=0,[]}function Qn(e){return jn="",e}function Yn(e){return En(Gn(Bn-1,eo(91===e?e+2:40===e?e+1:e)))}function Xn(e){for(;(Fn=Hn())&&Fn<33;)Kn();return Jn(e)>2||Jn(Fn)>3?"":" "}function Zn(e,t){for(;--t&&Kn()&&!(Fn<48||Fn>102||Fn>57&&Fn<65||Fn>70&&Fn<97););return Gn(e,Vn()+(t<6&&32==Hn()&&32==Kn()))}function eo(e){for(;Kn();)switch(Fn){case e:return Bn;case 34:case 39:34!==e&&39!==e&&eo(Fn);break;case 40:41===e&&eo(e);break;case 92:Kn()}return Bn}function to(e,t){for(;Kn()&&e+Fn!==57&&(e+Fn!==84||47!==Hn()););return"/*"+Gn(t,Bn-1)+"*"+In(47===e?e:Kn())}function ro(e){for(;!Jn(Hn());)Kn();return Gn(e,Bn)}var io="-ms-",no="-moz-",oo="-webkit-",so="comm",ao="rule",co="decl",uo="@keyframes";function ho(e,t){for(var r="",i=xn(e),n=0;n<i;n++)r+=t(e[n],n,e,t)||"";return r}function lo(e,t,r,i){switch(e.type){case"@layer":if(e.children.length)break;case"@import":case co:return e.return=e.return||e.value;case so:return"";case uo:return e.return=e.value+"{"+ho(e.children,i)+"}";case ao:e.value=e.props.join(",")}return _n(r=ho(e.children,i))?e.return=e.value+"{"+r+"}":""}function po(e){return Qn(fo("",null,null,null,[""],e=$n(e),0,[0],e))}function fo(e,t,r,i,n,o,s,a,c){for(var u=0,h=0,d=s,l=0,p=0,f=0,v=1,g=1,m=1,y=0,b="",S=n,C=o,w=i,P=b;g;)switch(f=y,y=Kn()){case 40:if(108!=f&&58==kn(P,d-1)){-1!=Mn(P+=Tn(Yn(y),"&","&\f"),"&\f")&&(m=-1);break}case 34:case 39:case 91:P+=Yn(y);break;case 9:case 10:case 13:case 32:P+=Xn(f);break;case 92:P+=Zn(Vn()-1,7);continue;case 47:switch(Hn()){case 42:case 47:Nn(go(to(Kn(),Vn()),t,r),c);break;default:P+="/"}break;case 123*v:a[u++]=_n(P)*m;case 125*v:case 59:case 0:switch(y){case 0:case 125:g=0;case 59+h:-1==m&&(P=Tn(P,/\f/g,"")),p>0&&_n(P)-d&&Nn(p>32?mo(P+";",i,r,d-1):mo(Tn(P," ","")+";",i,r,d-2),c);break;case 59:P+=";";default:if(Nn(w=vo(P,t,r,u,h,n,a,b,S=[],C=[],d),o),123===y)if(0===h)fo(P,t,w,w,S,o,d,a,C);else switch(99===l&&110===kn(P,3)?100:l){case 100:case 108:case 109:case 115:fo(e,w,w,i&&Nn(vo(e,w,w,0,0,n,a,b,n,S=[],d),C),n,C,d,a,i?S:C);break;default:fo(P,w,w,w,[""],C,0,a,C)}}u=h=p=0,v=m=1,b=P="",d=s;break;case 58:d=1+_n(P),p=f;default:if(v<1)if(123==y)--v;else if(125==y&&0==v++&&125==Wn())continue;switch(P+=In(y),y*v){case 38:m=h>0?1:(P+="\f",-1);break;case 44:a[u++]=(_n(P)-1)*m,m=1;break;case 64:45===Hn()&&(P+=Yn(Kn())),l=Hn(),h=d=_n(b=P+=ro(Vn())),y++;break;case 45:45===f&&2==_n(P)&&(v=0)}}return o}function vo(e,t,r,i,n,o,s,a,c,u,h){for(var d=n-1,l=0===n?o:[""],p=xn(l),f=0,v=0,g=0;f<i;++f)for(var m=0,y=On(e,d+1,d=An(v=s[f])),b=e;m<p;++m)(b=En(v>0?l[m]+" "+y:Tn(y,/&\f/g,l[m])))&&(c[g++]=b);return Un(e,t,r,0===n?ao:a,c,u,h)}function go(e,t,r){return Un(e,t,r,so,In(Fn),On(e,2,-2),0)}function mo(e,t,r,i){return Un(e,t,r,co,On(e,0,i),On(e,i+1,-1),i)}var yo=function(e,t,r){for(var i=0,n=0;i=n,n=Hn(),38===i&&12===n&&(t[r]=1),!Jn(n);)Kn();return Gn(e,Bn)},bo=new WeakMap,So=function(e){if("rule"===e.type&&e.parent&&!(e.length<1)){for(var t=e.value,r=e.parent,i=e.column===r.column&&e.line===r.line;"rule"!==r.type;)if(!(r=r.parent))return;if((1!==e.props.length||58===t.charCodeAt(0)||bo.get(r))&&!i){bo.set(e,!0);for(var n=[],o=function(e,t){return Qn(function(e,t){var r=-1,i=44;do{switch(Jn(i)){case 0:38===i&&12===Hn()&&(t[r]=1),e[r]+=yo(Bn-1,t,r);break;case 2:e[r]+=Yn(i);break;case 4:if(44===i){e[++r]=58===Hn()?"&\f":"",t[r]=e[r].length;break}default:e[r]+=In(i)}}while(i=Kn());return e}($n(e),t))}(t,n),s=r.props,a=0,c=0;a<o.length;a++)for(var u=0;u<s.length;u++,c++)e.props[c]=n[a]?o[a].replace(/&\f/g,s[u]):s[u]+" "+o[a]}}},Co=function(e){if("decl"===e.type){var t=e.value;108===t.charCodeAt(0)&&98===t.charCodeAt(2)&&(e.return="",e.value="")}};function wo(e,t){switch(function(e,t){return 45^kn(e,0)?(((t<<2^kn(e,0))<<2^kn(e,1))<<2^kn(e,2))<<2^kn(e,3):0}(e,t)){case 5103:return oo+"print-"+e+e;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return oo+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return oo+e+no+e+io+e+e;case 6828:case 4268:return oo+e+io+e+e;case 6165:return oo+e+io+"flex-"+e+e;case 5187:return oo+e+Tn(e,/(\w+).+(:[^]+)/,oo+"box-$1$2"+io+"flex-$1$2")+e;case 5443:return oo+e+io+"flex-item-"+Tn(e,/flex-|-self/,"")+e;case 4675:return oo+e+io+"flex-line-pack"+Tn(e,/align-content|flex-|-self/,"")+e;case 5548:return oo+e+io+Tn(e,"shrink","negative")+e;case 5292:return oo+e+io+Tn(e,"basis","preferred-size")+e;case 6060:return oo+"box-"+Tn(e,"-grow","")+oo+e+io+Tn(e,"grow","positive")+e;case 4554:return oo+Tn(e,/([^-])(transform)/g,"$1"+oo+"$2")+e;case 6187:return Tn(Tn(Tn(e,/(zoom-|grab)/,oo+"$1"),/(image-set)/,oo+"$1"),e,"")+e;case 5495:case 3959:return Tn(e,/(image-set\([^]*)/,oo+"$1$`$1");case 4968:return Tn(Tn(e,/(.+:)(flex-)?(.*)/,oo+"box-pack:$3"+io+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+oo+e+e;case 4095:case 3583:case 4068:case 2532:return Tn(e,/(.+)-inline(.+)/,oo+"$1$2")+e;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(_n(e)-1-t>6)switch(kn(e,t+1)){case 109:if(45!==kn(e,t+4))break;case 102:return Tn(e,/(.+:)(.+)-([^]+)/,"$1"+oo+"$2-$3$1"+no+(108==kn(e,t+3)?"$3":"$2-$3"))+e;case 115:return~Mn(e,"stretch")?wo(Tn(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(115!==kn(e,t+1))break;case 6444:switch(kn(e,_n(e)-3-(~Mn(e,"!important")&&10))){case 107:return Tn(e,":",":"+oo)+e;case 101:return Tn(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+oo+(45===kn(e,14)?"inline-":"")+"box$3$1"+oo+"$2$3$1"+io+"$2box$3")+e}break;case 5936:switch(kn(e,t+11)){case 114:return oo+e+io+Tn(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return oo+e+io+Tn(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return oo+e+io+Tn(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return oo+e+io+e+e}return e}var Po=[function(e,t,r,i){if(e.length>-1&&!e.return)switch(e.type){case co:e.return=wo(e.value,e.length);break;case uo:return ho([qn(e,{value:Tn(e.value,"@","@"+oo)})],i);case ao:if(e.length)return function(e,t){return e.map(t).join("")}(e.props,function(t){switch(function(e){return(e=/(::plac\w+|:read-\w+)/.exec(e))?e[0]:e}(t)){case":read-only":case":read-write":return ho([qn(e,{props:[Tn(t,/:(read-\w+)/,":-moz-$1")]})],i);case"::placeholder":return ho([qn(e,{props:[Tn(t,/:(plac\w+)/,":"+oo+"input-$1")]}),qn(e,{props:[Tn(t,/:(plac\w+)/,":-moz-$1")]}),qn(e,{props:[Tn(t,/:(plac\w+)/,io+"input-$1")]})],i)}return""})}}],Ao=function(e){var t=e.key;if("css"===t){var r=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(r,function(e){-1!==e.getAttribute("data-emotion").indexOf(" ")&&(document.head.appendChild(e),e.setAttribute("data-s",""))})}var i,n,o=e.stylisPlugins||Po,s={},a=[];i=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+t+' "]'),function(e){for(var t=e.getAttribute("data-emotion").split(" "),r=1;r<t.length;r++)s[t[r]]=!0;a.push(e)});var c,u,h,d,l=[lo,(d=function(e){c.insert(e)},function(e){e.root||(e=e.return)&&d(e)})],p=(u=[So,Co].concat(o,l),h=xn(u),function(e,t,r,i){for(var n="",o=0;o<h;o++)n+=u[o](e,t,r,i)||"";return n});n=function(e,t,r,i){c=r,ho(po(e?e+"{"+t.styles+"}":t.styles),p),i&&(f.inserted[t.name]=!0)};var f={key:t,sheet:new Pn({key:t,container:i,nonce:e.nonce,speedy:e.speedy,prepend:e.prepend,insertionPoint:e.insertionPoint}),nonce:e.nonce,inserted:s,registered:{},insert:n};return f.sheet.hydrate(a),f};function Io(e,t,r){var i="";return r.split(" ").forEach(function(r){void 0!==e[r]?t.push(e[r]+";"):r&&(i+=r+" ")}),i}var Ro=function(e,t,r){var i=e.key+"-"+t.name;!1===r&&void 0===e.registered[i]&&(e.registered[i]=t.styles)},Eo=function(e,t,r){Ro(e,t,r);var i=e.key+"-"+t.name;if(void 0===e.inserted[t.name]){var n=t;do{e.insert(t===n?"."+i:"",n,e.sheet,!0),n=n.next}while(void 0!==n)}},To={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,scale:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1};function Mo(e){var t=Object.create(null);return function(r){return void 0===t[r]&&(t[r]=e(r)),t[r]}}var ko=/[A-Z]|^ms/g,Oo=/_EMO_([^_]+?)_([^]*?)_EMO_/g,_o=function(e){return 45===e.charCodeAt(1)},xo=function(e){return null!=e&&"boolean"!=typeof e},No=Mo(function(e){return _o(e)?e:e.replace(ko,"-$&").toLowerCase()}),Do=function(e,t){switch(e){case"animation":case"animationName":if("string"==typeof t)return t.replace(Oo,function(e,t,r){return Lo={name:t,styles:r,next:Lo},t})}return 1===To[e]||_o(e)||"number"!=typeof t||0===t?t:t+"px"};function zo(e,t,r){if(null==r)return"";var i=r;if(void 0!==i.__emotion_styles)return i;switch(typeof r){case"boolean":return"";case"object":var n=r;if(1===n.anim)return Lo={name:n.name,styles:n.styles,next:Lo},n.name;var o=r;if(void 0!==o.styles){var s=o.next;if(void 0!==s)for(;void 0!==s;)Lo={name:s.name,styles:s.styles,next:Lo},s=s.next;return o.styles+";"}return function(e,t,r){var i="";if(Array.isArray(r))for(var n=0;n<r.length;n++)i+=zo(e,t,r[n])+";";else for(var o in r){var s=r[o];if("object"!=typeof s){var a=s;null!=t&&void 0!==t[a]?i+=o+"{"+t[a]+"}":xo(a)&&(i+=No(o)+":"+Do(o,a)+";")}else if(!Array.isArray(s)||"string"!=typeof s[0]||null!=t&&void 0!==t[s[0]]){var c=zo(e,t,s);switch(o){case"animation":case"animationName":i+=No(o)+":"+c+";";break;default:i+=o+"{"+c+"}"}}else for(var u=0;u<s.length;u++)xo(s[u])&&(i+=No(o)+":"+Do(o,s[u])+";")}return i}(e,t,r);case"function":if(void 0!==e){var a=Lo,c=r(e);return Lo=a,zo(e,t,c)}}var u=r;if(null==t)return u;var h=t[u];return void 0!==h?h:u}var Lo,Bo=/label:\s*([^\s;{]+)\s*(;|$)/g;function Fo(e,t,r){if(1===e.length&&"object"==typeof e[0]&&null!==e[0]&&void 0!==e[0].styles)return e[0];var i=!0,n="";Lo=void 0;var o=e[0];null==o||void 0===o.raw?(i=!1,n+=zo(r,t,o)):n+=o[0];for(var s=1;s<e.length;s++)n+=zo(r,t,e[s]),i&&(n+=o[s]);Bo.lastIndex=0;for(var a,c="";null!==(a=Bo.exec(n));)c+="-"+a[1];var u=function(e){for(var t,r=0,i=0,n=e.length;n>=4;++i,n-=4)t=1540483477*(65535&(t=255&e.charCodeAt(i)|(255&e.charCodeAt(++i))<<8|(255&e.charCodeAt(++i))<<16|(255&e.charCodeAt(++i))<<24))+(59797*(t>>>16)<<16),r=1540483477*(65535&(t^=t>>>24))+(59797*(t>>>16)<<16)^1540483477*(65535&r)+(59797*(r>>>16)<<16);switch(n){case 3:r^=(255&e.charCodeAt(i+2))<<16;case 2:r^=(255&e.charCodeAt(i+1))<<8;case 1:r=1540483477*(65535&(r^=255&e.charCodeAt(i)))+(59797*(r>>>16)<<16)}return(((r=1540483477*(65535&(r^=r>>>13))+(59797*(r>>>16)<<16))^r>>>15)>>>0).toString(36)}(n)+c;return{name:u,styles:n,next:Lo}}var jo=!!e.useInsertionEffect&&e.useInsertionEffect,Uo=jo||function(e){return e()},qo=jo||e.useLayoutEffect,Wo=e.createContext("undefined"!=typeof HTMLElement?Ao({key:"css"}):null),Ko=(Wo.Provider,function(t){return(0,e.forwardRef)(function(r,i){var n=(0,e.useContext)(Wo);return t(r,n,i)})}),Ho=e.createContext({}),Vo={}.hasOwnProperty,Go="__EMOTION_TYPE_PLEASE_DO_NOT_USE__",Jo=function(e){var t=e.cache,r=e.serialized,i=e.isStringTag;return Ro(t,r,i),Uo(function(){return Eo(t,r,i)}),null},$o=Ko(function(t,r,i){var n=t.css;"string"==typeof n&&void 0!==r.registered[n]&&(n=r.registered[n]);var o=t[Go],s=[n],a="";"string"==typeof t.className?a=Io(r.registered,s,t.className):null!=t.className&&(a=t.className+" ");var c=Fo(s,void 0,e.useContext(Ho));a+=r.key+"-"+c.name;var u={};for(var h in t)Vo.call(t,h)&&"css"!==h&&h!==Go&&(u[h]=t[h]);return u.className=a,i&&(u.ref=i),e.createElement(e.Fragment,null,e.createElement(Jo,{cache:r,serialized:c,isStringTag:"string"==typeof o}),e.createElement(o,u))}),Qo=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|disableRemotePlayback|download|draggable|encType|enterKeyHint|fetchpriority|fetchPriority|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,Yo=Mo(function(e){return Qo.test(e)||111===e.charCodeAt(0)&&110===e.charCodeAt(1)&&e.charCodeAt(2)<91}),Xo=function(e){return"theme"!==e},Zo=function(e){return"string"==typeof e&&e.charCodeAt(0)>96?Yo:Xo},es=function(e,t,r){var i;if(t){var n=t.shouldForwardProp;i=e.__emotion_forwardProp&&n?function(t){return e.__emotion_forwardProp(t)&&n(t)}:n}return"function"!=typeof i&&r&&(i=e.__emotion_forwardProp),i},ts=function(e){var t=e.cache,r=e.serialized,i=e.isStringTag;return Ro(t,r,i),Uo(function(){return Eo(t,r,i)}),null},rs=function t(r,i){var n,o,s=r.__emotion_real===r,a=s&&r.__emotion_base||r;void 0!==i&&(n=i.label,o=i.target);var c=es(r,i,s),u=c||Zo(a),h=!u("as");return function(){var d=arguments,l=s&&void 0!==r.__emotion_styles?r.__emotion_styles.slice(0):[];if(void 0!==n&&l.push("label:"+n+";"),null==d[0]||void 0===d[0].raw)l.push.apply(l,d);else{var p=d[0];l.push(p[0]);for(var f=d.length,v=1;v<f;v++)l.push(d[v],p[v])}var g=Ko(function(t,r,i){var n=h&&t.as||a,s="",d=[],p=t;if(null==t.theme){for(var f in p={},t)p[f]=t[f];p.theme=e.useContext(Ho)}"string"==typeof t.className?s=Io(r.registered,d,t.className):null!=t.className&&(s=t.className+" ");var v=Fo(l.concat(d),r.registered,p);s+=r.key+"-"+v.name,void 0!==o&&(s+=" "+o);var g=h&&void 0===c?Zo(n):u,m={};for(var y in t)h&&"as"===y||g(y)&&(m[y]=t[y]);return m.className=s,i&&(m.ref=i),e.createElement(e.Fragment,null,e.createElement(ts,{cache:r,serialized:v,isStringTag:"string"==typeof n}),e.createElement(n,m))});return g.displayName=void 0!==n?n:"Styled("+("string"==typeof a?a:a.displayName||a.name||"Component")+")",g.defaultProps=r.defaultProps,g.__emotion_real=g,g.__emotion_base=a,g.__emotion_styles=l,g.__emotion_forwardProp=c,Object.defineProperty(g,"toString",{value:function(){return"."+o}}),g.withComponent=function(e,r){return t(e,wn({},i,r,{shouldForwardProp:es(g,r,!0)})).apply(void 0,l)},g}}.bind(null);["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","marquee","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"].forEach(function(e){rs[e]=rs(e)});const is=[];function ns(e){return is[0]=e,Fo(is)}var os=o(4405);function ss(e){if("object"!=typeof e||null===e)return!1;const t=Object.getPrototypeOf(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||Symbol.toStringTag in e||Symbol.iterator in e)}function as(t){if(e.isValidElement(t)||(0,os.Hy)(t)||!ss(t))return t;const r={};return Object.keys(t).forEach(e=>{r[e]=as(t[e])}),r}function cs(t,r,i={clone:!0}){const n=i.clone?{...t}:t;return ss(t)&&ss(r)&&Object.keys(r).forEach(o=>{e.isValidElement(r[o])||(0,os.Hy)(r[o])?n[o]=r[o]:ss(r[o])&&Object.prototype.hasOwnProperty.call(t,o)&&ss(t[o])?n[o]=cs(t[o],r[o],i):i.clone?n[o]=ss(r[o])?as(r[o]):r[o]:n[o]=r[o]}),n}function us(e){const{values:t={xs:0,sm:600,md:900,lg:1200,xl:1536},unit:r="px",step:i=5,...n}=e,o=(e=>{const t=Object.keys(e).map(t=>({key:t,val:e[t]}))||[];return t.sort((e,t)=>e.val-t.val),t.reduce((e,t)=>({...e,[t.key]:t.val}),{})})(t),s=Object.keys(o);function a(e){return`@media (min-width:${"number"==typeof t[e]?t[e]:e}${r})`}function c(e){return`@media (max-width:${("number"==typeof t[e]?t[e]:e)-i/100}${r})`}function u(e,n){const o=s.indexOf(n);return`@media (min-width:${"number"==typeof t[e]?t[e]:e}${r}) and (max-width:${(-1!==o&&"number"==typeof t[s[o]]?t[s[o]]:n)-i/100}${r})`}return{keys:s,values:o,up:a,down:c,between:u,only:function(e){return s.indexOf(e)+1<s.length?u(e,s[s.indexOf(e)+1]):a(e)},not:function(e){const t=s.indexOf(e);return 0===t?a(s[1]):t===s.length-1?c(s[t]):u(e,s[s.indexOf(e)+1]).replace("@media","@media not all and")},unit:r,...n}}function hs(e,t){if(!e.containerQueries)return t;const r=Object.keys(t).filter(e=>e.startsWith("@container")).sort((e,t)=>{const r=/min-width:\s*([0-9.]+)/;return+(e.match(r)?.[1]||0)-+(t.match(r)?.[1]||0)});return r.length?r.reduce((e,r)=>{const i=t[r];return delete e[r],e[r]=i,e},{...t}):t}const ds={borderRadius:4},ls={xs:0,sm:600,md:900,lg:1200,xl:1536},ps={keys:["xs","sm","md","lg","xl"],up:e=>`@media (min-width:${ls[e]}px)`},fs={containerQueries:e=>({up:t=>{let r="number"==typeof t?t:ls[t]||t;return"number"==typeof r&&(r=`${r}px`),e?`@container ${e} (min-width:${r})`:`@container (min-width:${r})`}})};function vs(e,t,r){const i=e.theme||{};if(Array.isArray(t)){const e=i.breakpoints||ps;return t.reduce((i,n,o)=>(i[e.up(e.keys[o])]=r(t[o]),i),{})}if("object"==typeof t){const e=i.breakpoints||ps;return Object.keys(t).reduce((n,o)=>{if(s=e.keys,"@"===(a=o)||a.startsWith("@")&&(s.some(e=>a.startsWith(`@${e}`))||a.match(/^@\d/))){const e=function(e,t){const r=t.match(/^@([^/]+)?\/?(.+)?$/);if(!r)return null;const[,i,n]=r,o=Number.isNaN(+i)?i||0:+i;return e.containerQueries(n).up(o)}(i.containerQueries?i:fs,o);e&&(n[e]=r(t[o],o))}else if(Object.keys(e.values||ls).includes(o))n[e.up(o)]=r(t[o],o);else{const e=o;n[e]=t[e]}var s,a;return n},{})}return r(t)}function gs(e,t){return e.reduce((e,t)=>{const r=e[t];return(!r||0===Object.keys(r).length)&&delete e[t],e},t)}function ms(e,t,r=!0){if(!t||"string"!=typeof t)return null;if(e&&e.vars&&r){const r=`vars.${t}`.split(".").reduce((e,t)=>e&&e[t]?e[t]:null,e);if(null!=r)return r}return t.split(".").reduce((e,t)=>e&&null!=e[t]?e[t]:null,e)}function ys(e,t,r,i=r){let n;return n="function"==typeof e?e(r):Array.isArray(e)?e[r]||i:ms(e,r)||i,t&&(n=t(n,i,e)),n}const bs=function(e){const{prop:t,cssProperty:r=e.prop,themeKey:i,transform:n}=e,o=e=>{if(null==e[t])return null;const o=e[t],s=ms(e.theme,i)||{};return vs(e,o,e=>{let i=ys(s,n,e);return e===i&&"string"==typeof e&&(i=ys(s,n,`${t}${"default"===e?"":Sn(e)}`,e)),!1===r?i:{[r]:i}})};return o.propTypes={},o.filterProps=[t],o},Ss=function(e,t){return t?cs(e,t,{clone:!1}):e},Cs={m:"margin",p:"padding"},ws={t:"Top",r:"Right",b:"Bottom",l:"Left",x:["Left","Right"],y:["Top","Bottom"]},Ps={marginX:"mx",marginY:"my",paddingX:"px",paddingY:"py"},As=function(){const e={};return t=>(void 0===e[t]&&(e[t]=(e=>{if(e.length>2){if(!Ps[e])return[e];e=Ps[e]}const[t,r]=e.split(""),i=Cs[t],n=ws[r]||"";return Array.isArray(n)?n.map(e=>i+e):[i+n]})(t)),e[t])}(),Is=["m","mt","mr","mb","ml","mx","my","margin","marginTop","marginRight","marginBottom","marginLeft","marginX","marginY","marginInline","marginInlineStart","marginInlineEnd","marginBlock","marginBlockStart","marginBlockEnd"],Rs=["p","pt","pr","pb","pl","px","py","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingX","paddingY","paddingInline","paddingInlineStart","paddingInlineEnd","paddingBlock","paddingBlockStart","paddingBlockEnd"],Es=[...Is,...Rs];function Ts(e,t,r,i){const n=ms(e,t,!0)??r;return"number"==typeof n||"string"==typeof n?e=>"string"==typeof e?e:"string"==typeof n?n.startsWith("var(")&&0===e?0:n.startsWith("var(")&&1===e?n:`calc(${e} * ${n})`:n*e:Array.isArray(n)?e=>{if("string"==typeof e)return e;const t=Math.abs(e),r=n[t];return e>=0?r:"number"==typeof r?-r:"string"==typeof r&&r.startsWith("var(")?`calc(-1 * ${r})`:`-${r}`}:"function"==typeof n?n:()=>{}}function Ms(e){return Ts(e,"spacing",8)}function ks(e,t){return"string"==typeof t||null==t?t:e(t)}function Os(e,t){const r=Ms(e.theme);return Object.keys(e).map(i=>function(e,t,r,i){if(!t.includes(r))return null;const n=function(e,t){return r=>e.reduce((e,i)=>(e[i]=ks(t,r),e),{})}(As(r),i);return vs(e,e[r],n)}(e,t,i,r)).reduce(Ss,{})}function _s(e){return Os(e,Is)}function xs(e){return Os(e,Rs)}function Ns(e){return Os(e,Es)}function Ds(e=8,t=Ms({spacing:e})){if(e.mui)return e;const r=(...e)=>(0===e.length?[1]:e).map(e=>{const r=t(e);return"number"==typeof r?`${r}px`:r}).join(" ");return r.mui=!0,r}_s.propTypes={},_s.filterProps=Is,xs.propTypes={},xs.filterProps=Rs,Ns.propTypes={},Ns.filterProps=Es;const zs=function(...e){const t=e.reduce((e,t)=>(t.filterProps.forEach(r=>{e[r]=t}),e),{}),r=e=>Object.keys(e).reduce((r,i)=>t[i]?Ss(r,t[i](e)):r,{});return r.propTypes={},r.filterProps=e.reduce((e,t)=>e.concat(t.filterProps),[]),r};function Ls(e){return"number"!=typeof e?e:`${e}px solid`}function Bs(e,t){return bs({prop:e,themeKey:"borders",transform:t})}const Fs=Bs("border",Ls),js=Bs("borderTop",Ls),Us=Bs("borderRight",Ls),qs=Bs("borderBottom",Ls),Ws=Bs("borderLeft",Ls),Ks=Bs("borderColor"),Hs=Bs("borderTopColor"),Vs=Bs("borderRightColor"),Gs=Bs("borderBottomColor"),Js=Bs("borderLeftColor"),$s=Bs("outline",Ls),Qs=Bs("outlineColor"),Ys=e=>{if(void 0!==e.borderRadius&&null!==e.borderRadius){const t=Ts(e.theme,"shape.borderRadius",4),r=e=>({borderRadius:ks(t,e)});return vs(e,e.borderRadius,r)}return null};Ys.propTypes={},Ys.filterProps=["borderRadius"],zs(Fs,js,Us,qs,Ws,Ks,Hs,Vs,Gs,Js,Ys,$s,Qs);const Xs=e=>{if(void 0!==e.gap&&null!==e.gap){const t=Ts(e.theme,"spacing",8),r=e=>({gap:ks(t,e)});return vs(e,e.gap,r)}return null};Xs.propTypes={},Xs.filterProps=["gap"];const Zs=e=>{if(void 0!==e.columnGap&&null!==e.columnGap){const t=Ts(e.theme,"spacing",8),r=e=>({columnGap:ks(t,e)});return vs(e,e.columnGap,r)}return null};Zs.propTypes={},Zs.filterProps=["columnGap"];const ea=e=>{if(void 0!==e.rowGap&&null!==e.rowGap){const t=Ts(e.theme,"spacing",8),r=e=>({rowGap:ks(t,e)});return vs(e,e.rowGap,r)}return null};function ta(e,t){return"grey"===t?t:e}function ra(e){return e<=1&&0!==e?100*e+"%":e}ea.propTypes={},ea.filterProps=["rowGap"],zs(Xs,Zs,ea,bs({prop:"gridColumn"}),bs({prop:"gridRow"}),bs({prop:"gridAutoFlow"}),bs({prop:"gridAutoColumns"}),bs({prop:"gridAutoRows"}),bs({prop:"gridTemplateColumns"}),bs({prop:"gridTemplateRows"}),bs({prop:"gridTemplateAreas"}),bs({prop:"gridArea"})),zs(bs({prop:"color",themeKey:"palette",transform:ta}),bs({prop:"bgcolor",cssProperty:"backgroundColor",themeKey:"palette",transform:ta}),bs({prop:"backgroundColor",themeKey:"palette",transform:ta}));const ia=bs({prop:"width",transform:ra}),na=e=>{if(void 0!==e.maxWidth&&null!==e.maxWidth){const t=t=>{const r=e.theme?.breakpoints?.values?.[t]||ls[t];return r?"px"!==e.theme?.breakpoints?.unit?{maxWidth:`${r}${e.theme.breakpoints.unit}`}:{maxWidth:r}:{maxWidth:ra(t)}};return vs(e,e.maxWidth,t)}return null};na.filterProps=["maxWidth"];const oa=bs({prop:"minWidth",transform:ra}),sa=bs({prop:"height",transform:ra}),aa=bs({prop:"maxHeight",transform:ra}),ca=bs({prop:"minHeight",transform:ra}),ua=(bs({prop:"size",cssProperty:"width",transform:ra}),bs({prop:"size",cssProperty:"height",transform:ra}),zs(ia,na,oa,sa,aa,ca,bs({prop:"boxSizing"})),{border:{themeKey:"borders",transform:Ls},borderTop:{themeKey:"borders",transform:Ls},borderRight:{themeKey:"borders",transform:Ls},borderBottom:{themeKey:"borders",transform:Ls},borderLeft:{themeKey:"borders",transform:Ls},borderColor:{themeKey:"palette"},borderTopColor:{themeKey:"palette"},borderRightColor:{themeKey:"palette"},borderBottomColor:{themeKey:"palette"},borderLeftColor:{themeKey:"palette"},outline:{themeKey:"borders",transform:Ls},outlineColor:{themeKey:"palette"},borderRadius:{themeKey:"shape.borderRadius",style:Ys},color:{themeKey:"palette",transform:ta},bgcolor:{themeKey:"palette",cssProperty:"backgroundColor",transform:ta},backgroundColor:{themeKey:"palette",transform:ta},p:{style:xs},pt:{style:xs},pr:{style:xs},pb:{style:xs},pl:{style:xs},px:{style:xs},py:{style:xs},padding:{style:xs},paddingTop:{style:xs},paddingRight:{style:xs},paddingBottom:{style:xs},paddingLeft:{style:xs},paddingX:{style:xs},paddingY:{style:xs},paddingInline:{style:xs},paddingInlineStart:{style:xs},paddingInlineEnd:{style:xs},paddingBlock:{style:xs},paddingBlockStart:{style:xs},paddingBlockEnd:{style:xs},m:{style:_s},mt:{style:_s},mr:{style:_s},mb:{style:_s},ml:{style:_s},mx:{style:_s},my:{style:_s},margin:{style:_s},marginTop:{style:_s},marginRight:{style:_s},marginBottom:{style:_s},marginLeft:{style:_s},marginX:{style:_s},marginY:{style:_s},marginInline:{style:_s},marginInlineStart:{style:_s},marginInlineEnd:{style:_s},marginBlock:{style:_s},marginBlockStart:{style:_s},marginBlockEnd:{style:_s},displayPrint:{cssProperty:!1,transform:e=>({"@media print":{display:e}})},display:{},overflow:{},textOverflow:{},visibility:{},whiteSpace:{},flexBasis:{},flexDirection:{},flexWrap:{},justifyContent:{},alignItems:{},alignContent:{},order:{},flex:{},flexGrow:{},flexShrink:{},alignSelf:{},justifyItems:{},justifySelf:{},gap:{style:Xs},rowGap:{style:ea},columnGap:{style:Zs},gridColumn:{},gridRow:{},gridAutoFlow:{},gridAutoColumns:{},gridAutoRows:{},gridTemplateColumns:{},gridTemplateRows:{},gridTemplateAreas:{},gridArea:{},position:{},zIndex:{themeKey:"zIndex"},top:{},right:{},bottom:{},left:{},boxShadow:{themeKey:"shadows"},width:{transform:ra},maxWidth:{style:na},minWidth:{transform:ra},height:{transform:ra},maxHeight:{transform:ra},minHeight:{transform:ra},boxSizing:{},font:{themeKey:"font"},fontFamily:{themeKey:"typography"},fontSize:{themeKey:"typography"},fontStyle:{themeKey:"typography"},fontWeight:{themeKey:"typography"},letterSpacing:{},textTransform:{},lineHeight:{},textAlign:{},typography:{cssProperty:!1,themeKey:"typography"}}),ha=function(){function e(e,t,r,i){const n={[e]:t,theme:r},o=i[e];if(!o)return{[e]:t};const{cssProperty:s=e,themeKey:a,transform:c,style:u}=o;if(null==t)return null;if("typography"===a&&"inherit"===t)return{[e]:t};const h=ms(r,a)||{};return u?u(n):vs(n,t,t=>{let r=ys(h,c,t);return t===r&&"string"==typeof t&&(r=ys(h,c,`${e}${"default"===t?"":Sn(t)}`,t)),!1===s?r:{[s]:r}})}return function t(r){const{sx:i,theme:n={},nested:o}=r||{};if(!i)return null;const s=n.unstable_sxConfig??ua;function a(r){let i=r;if("function"==typeof r)i=r(n);else if("object"!=typeof r)return r;if(!i)return null;const a=function(e={}){const t=e.keys?.reduce((t,r)=>(t[e.up(r)]={},t),{});return t||{}}(n.breakpoints),c=Object.keys(a);let u=a;return Object.keys(i).forEach(r=>{const o=function(e,t){return"function"==typeof e?e(t):e}(i[r],n);if(null!=o)if("object"==typeof o)if(s[r])u=Ss(u,e(r,o,n,s));else{const e=vs({theme:n},o,e=>({[r]:e}));!function(...e){const t=e.reduce((e,t)=>e.concat(Object.keys(t)),[]),r=new Set(t);return e.every(e=>r.size===Object.keys(e).length)}(e,o)?u=Ss(u,e):u[r]=t({sx:o,theme:n,nested:!0})}else u=Ss(u,e(r,o,n,s))}),!o&&n.modularCssLayers?{"@layer sx":hs(n,gs(c,u))}:hs(n,gs(c,u))}return Array.isArray(i)?i.map(a):a(i)}}();ha.filterProps=["sx"];const da=ha;function la(e,t){const r=this;if(r.vars){if(!r.colorSchemes?.[e]||"function"!=typeof r.getColorSchemeSelector)return{};let i=r.getColorSchemeSelector(e);return"&"===i?t:((i.includes("data-")||i.includes("."))&&(i=`*:where(${i.replace(/\s*&$/,"")}) &`),{[i]:t})}return r.palette.mode===e?t:{}}const pa=function(e={},...t){const{breakpoints:r={},palette:i={},spacing:n,shape:o={},...s}=e;let a=cs({breakpoints:us(r),direction:"ltr",components:{},palette:{mode:"light",...i},spacing:Ds(n),shape:{...ds,...o}},s);return a=function(e){const t=(e,t)=>e.replace("@media",t?`@container ${t}`:"@container");function r(r,i){r.up=(...r)=>t(e.breakpoints.up(...r),i),r.down=(...r)=>t(e.breakpoints.down(...r),i),r.between=(...r)=>t(e.breakpoints.between(...r),i),r.only=(...r)=>t(e.breakpoints.only(...r),i),r.not=(...r)=>{const n=t(e.breakpoints.not(...r),i);return n.includes("not all and")?n.replace("not all and ","").replace("min-width:","width<").replace("max-width:","width>").replace("and","or"):n}}const i={},n=e=>(r(i,e),i);return r(n),{...e,containerQueries:n}}(a),a.applyStyles=la,a=t.reduce((e,t)=>cs(e,t),a),a.unstable_sxConfig={...ua,...s?.unstable_sxConfig},a.unstable_sx=function(e){return da({sx:e,theme:this})},a};function fa(e){const{variants:t,...r}=e,i={variants:t,style:ns(r),isProcessed:!0};return i.style===r||t&&t.forEach(e=>{"function"!=typeof e.style&&(e.style=ns(e.style))}),i}const va=pa();function ga(e){return"ownerState"!==e&&"theme"!==e&&"sx"!==e&&"as"!==e}function ma(e,t){return t&&e&&"object"==typeof e&&e.styles&&!e.styles.startsWith("@layer")&&(e.styles=`@layer ${t}{${String(e.styles)}}`),e}function ya(e){return e?(t,r)=>r[e]:null}function ba(e,t,r){const i="function"==typeof t?t(e):t;if(Array.isArray(i))return i.flatMap(t=>ba(e,t,r));if(Array.isArray(i?.variants)){let t;if(i.isProcessed)t=r?ma(i.style,r):i.style;else{const{variants:e,...n}=i;t=r?ma(ns(n),r):n}return Sa(e,i.variants,[t],r)}return i?.isProcessed?r?ma(ns(i.style),r):i.style:r?ma(ns(i),r):i}function Sa(e,t,r=[],i=void 0){let n;e:for(let o=0;o<t.length;o+=1){const s=t[o];if("function"==typeof s.props){if(n??={...e,...e.ownerState,ownerState:e.ownerState},!s.props(n))continue}else for(const t in s.props)if(e[t]!==s.props[t]&&e.ownerState?.[t]!==s.props[t])continue e;"function"==typeof s.style?(n??={...e,...e.ownerState,ownerState:e.ownerState},r.push(i?ma(ns(s.style(n)),i):s.style(n))):r.push(i?ma(ns(s.style),i):s.style)}return r}function Ca(e){return e?e.charAt(0).toLowerCase()+e.slice(1):e}function wa(e,t=0,r=1){return function(e,t=Number.MIN_SAFE_INTEGER,r=Number.MAX_SAFE_INTEGER){return Math.max(t,Math.min(e,r))}(e,t,r)}function Pa(e){if(e.type)return e;if("#"===e.charAt(0))return Pa(function(e){e=e.slice(1);const t=new RegExp(`.{1,${e.length>=6?2:1}}`,"g");let r=e.match(t);return r&&1===r[0].length&&(r=r.map(e=>e+e)),r?`rgb${4===r.length?"a":""}(${r.map((e,t)=>t<3?parseInt(e,16):Math.round(parseInt(e,16)/255*1e3)/1e3).join(", ")})`:""}(e));const t=e.indexOf("("),r=e.substring(0,t);if(!["rgb","rgba","hsl","hsla","color"].includes(r))throw new Error(bn(9,e));let i,n=e.substring(t+1,e.length-1);if("color"===r){if(n=n.split(" "),i=n.shift(),4===n.length&&"/"===n[3].charAt(0)&&(n[3]=n[3].slice(1)),!["srgb","display-p3","a98-rgb","prophoto-rgb","rec-2020"].includes(i))throw new Error(bn(10,i))}else n=n.split(",");return n=n.map(e=>parseFloat(e)),{type:r,values:n,colorSpace:i}}const Aa=(e,t)=>{try{return(e=>{const t=Pa(e);return t.values.slice(0,3).map((e,r)=>t.type.includes("hsl")&&0!==r?`${e}%`:e).join(" ")})(e)}catch(t){return e}};function Ia(e){const{type:t,colorSpace:r}=e;let{values:i}=e;return t.includes("rgb")?i=i.map((e,t)=>t<3?parseInt(e,10):e):t.includes("hsl")&&(i[1]=`${i[1]}%`,i[2]=`${i[2]}%`),i=t.includes("color")?`${r} ${i.join(" ")}`:`${i.join(", ")}`,`${t}(${i})`}function Ra(e){e=Pa(e);const{values:t}=e,r=t[0],i=t[1]/100,n=t[2]/100,o=i*Math.min(n,1-n),s=(e,t=(e+r/30)%12)=>n-o*Math.max(Math.min(t-3,9-t,1),-1);let a="rgb";const c=[Math.round(255*s(0)),Math.round(255*s(8)),Math.round(255*s(4))];return"hsla"===e.type&&(a+="a",c.push(t[3])),Ia({type:a,values:c})}function Ea(e){let t="hsl"===(e=Pa(e)).type||"hsla"===e.type?Pa(Ra(e)).values:e.values;return t=t.map(t=>("color"!==e.type&&(t/=255),t<=.03928?t/12.92:((t+.055)/1.055)**2.4)),Number((.2126*t[0]+.7152*t[1]+.0722*t[2]).toFixed(3))}function Ta(e,t){return e=Pa(e),t=wa(t),"rgb"!==e.type&&"hsl"!==e.type||(e.type+="a"),"color"===e.type?e.values[3]=`/${t}`:e.values[3]=t,Ia(e)}function Ma(e,t,r){try{return Ta(e,t)}catch(t){return e}}function ka(e,t){if(e=Pa(e),t=wa(t),e.type.includes("hsl"))e.values[2]*=1-t;else if(e.type.includes("rgb")||e.type.includes("color"))for(let r=0;r<3;r+=1)e.values[r]*=1-t;return Ia(e)}function Oa(e,t,r){try{return ka(e,t)}catch(t){return e}}function _a(e,t){if(e=Pa(e),t=wa(t),e.type.includes("hsl"))e.values[2]+=(100-e.values[2])*t;else if(e.type.includes("rgb"))for(let r=0;r<3;r+=1)e.values[r]+=(255-e.values[r])*t;else if(e.type.includes("color"))for(let r=0;r<3;r+=1)e.values[r]+=(1-e.values[r])*t;return Ia(e)}function xa(e,t,r){try{return _a(e,t)}catch(t){return e}}function Na(e,t,r){try{return function(e,t=.15){return Ea(e)>.5?ka(e,t):_a(e,t)}(e,t)}catch(t){return e}}const Da={black:"#000",white:"#fff"},za={50:"#fafafa",100:"#f5f5f5",200:"#eeeeee",300:"#e0e0e0",400:"#bdbdbd",500:"#9e9e9e",600:"#757575",700:"#616161",800:"#424242",900:"#212121",A100:"#f5f5f5",A200:"#eeeeee",A400:"#bdbdbd",A700:"#616161"},La="#f3e5f5",Ba="#ce93d8",Fa="#ba68c8",ja="#ab47bc",Ua="#9c27b0",qa="#7b1fa2",Wa="#e57373",Ka="#ef5350",Ha="#f44336",Va="#d32f2f",Ga="#c62828",Ja="#ffb74d",$a="#ffa726",Qa="#ff9800",Ya="#f57c00",Xa="#e65100",Za="#e3f2fd",ec="#90caf9",tc="#42a5f5",rc="#1976d2",ic="#1565c0",nc="#4fc3f7",oc="#29b6f6",sc="#03a9f4",ac="#0288d1",cc="#01579b",uc="#81c784",hc="#66bb6a",dc="#4caf50",lc="#388e3c",pc="#2e7d32",fc="#1b5e20";function vc(){return{text:{primary:"rgba(0, 0, 0, 0.87)",secondary:"rgba(0, 0, 0, 0.6)",disabled:"rgba(0, 0, 0, 0.38)"},divider:"rgba(0, 0, 0, 0.12)",background:{paper:Da.white,default:Da.white},action:{active:"rgba(0, 0, 0, 0.54)",hover:"rgba(0, 0, 0, 0.04)",hoverOpacity:.04,selected:"rgba(0, 0, 0, 0.08)",selectedOpacity:.08,disabled:"rgba(0, 0, 0, 0.26)",disabledBackground:"rgba(0, 0, 0, 0.12)",disabledOpacity:.38,focus:"rgba(0, 0, 0, 0.12)",focusOpacity:.12,activatedOpacity:.12}}}const gc=vc();function mc(){return{text:{primary:Da.white,secondary:"rgba(255, 255, 255, 0.7)",disabled:"rgba(255, 255, 255, 0.5)",icon:"rgba(255, 255, 255, 0.5)"},divider:"rgba(255, 255, 255, 0.12)",background:{paper:"#121212",default:"#121212"},action:{active:Da.white,hover:"rgba(255, 255, 255, 0.08)",hoverOpacity:.08,selected:"rgba(255, 255, 255, 0.16)",selectedOpacity:.16,disabled:"rgba(255, 255, 255, 0.3)",disabledBackground:"rgba(255, 255, 255, 0.12)",disabledOpacity:.38,focus:"rgba(255, 255, 255, 0.12)",focusOpacity:.12,activatedOpacity:.24}}}const yc=mc();function bc(e,t,r,i){const n=i.light||i,o=i.dark||1.5*i;e[t]||(e.hasOwnProperty(r)?e[t]=e[r]:"light"===t?e.light=_a(e.main,n):"dark"===t&&(e.dark=ka(e.main,o)))}function Sc(e,t,r,i,n){const o=n.light||n,s=n.dark||1.5*n;t[r]||(t.hasOwnProperty(i)?t[r]=t[i]:"light"===r?t.light=`color-mix(in ${e}, ${t.main}, #fff ${(100*o).toFixed(0)}%)`:"dark"===r&&(t.dark=`color-mix(in ${e}, ${t.main}, #000 ${(100*s).toFixed(0)}%)`))}function Cc(e){const{mode:t="light",contrastThreshold:r=3,tonalOffset:i=.2,colorSpace:n,...o}=e,s=e.primary||function(e="light"){return"dark"===e?{main:ec,light:Za,dark:tc}:{main:rc,light:tc,dark:ic}}(t),a=e.secondary||function(e="light"){return"dark"===e?{main:Ba,light:La,dark:ja}:{main:Ua,light:Fa,dark:qa}}(t),c=e.error||function(e="light"){return"dark"===e?{main:Ha,light:Wa,dark:Va}:{main:Va,light:Ka,dark:Ga}}(t),u=e.info||function(e="light"){return"dark"===e?{main:oc,light:nc,dark:ac}:{main:ac,light:sc,dark:cc}}(t),h=e.success||function(e="light"){return"dark"===e?{main:hc,light:uc,dark:lc}:{main:pc,light:dc,dark:fc}}(t),d=e.warning||function(e="light"){return"dark"===e?{main:$a,light:Ja,dark:Ya}:{main:"#ed6c02",light:Qa,dark:Xa}}(t);function l(e){if(n)return function(e){return`oklch(from ${e} var(--__l) 0 h / var(--__a))`}(e);const t=function(e,t){const r=Ea(e),i=Ea(t);return(Math.max(r,i)+.05)/(Math.min(r,i)+.05)}(e,yc.text.primary)>=r?yc.text.primary:gc.text.primary;return t}const p=({color:e,name:t,mainShade:r=500,lightShade:o=300,darkShade:s=700})=>{if(!(e={...e}).main&&e[r]&&(e.main=e[r]),!e.hasOwnProperty("main"))throw new Error(bn(11,t?` (${t})`:"",r));if("string"!=typeof e.main)throw new Error(bn(12,t?` (${t})`:"",JSON.stringify(e.main)));return n?(Sc(n,e,"light",o,i),Sc(n,e,"dark",s,i)):(bc(e,"light",o,i),bc(e,"dark",s,i)),e.contrastText||(e.contrastText=l(e.main)),e};let f;return"light"===t?f=vc():"dark"===t&&(f=mc()),cs({common:{...Da},mode:t,primary:p({color:s,name:"primary"}),secondary:p({color:a,name:"secondary",mainShade:"A400",lightShade:"A200",darkShade:"A700"}),error:p({color:c,name:"error"}),warning:p({color:d,name:"warning"}),info:p({color:u,name:"info"}),success:p({color:h,name:"success"}),grey:za,contrastThreshold:r,getContrastText:l,augmentColor:p,tonalOffset:i,...f},o)}function wc(e=""){function t(...r){if(!r.length)return"";const i=r[0];return"string"!=typeof i||i.match(/(#|\(|\)|(-?(\d*\.)?\d+)(px|em|%|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc))|^(-?(\d*\.)?\d+)$|(\d+ \d+ \d+)/)?`, ${i}`:`, var(--${e?`${e}-`:""}${i}${t(...r.slice(1))})`}return(r,...i)=>`var(--${e?`${e}-`:""}${r}${t(...i)})`}function Pc(e){const t={};return Object.entries(e).forEach(e=>{const[r,i]=e;"object"==typeof i&&(t[r]=`${i.fontStyle?`${i.fontStyle} `:""}${i.fontVariant?`${i.fontVariant} `:""}${i.fontWeight?`${i.fontWeight} `:""}${i.fontStretch?`${i.fontStretch} `:""}${i.fontSize||""}${i.lineHeight?`/${i.lineHeight} `:""}${i.fontFamily||""}`)}),t}const Ac=(e,t,r,i=[])=>{let n=e;t.forEach((e,o)=>{o===t.length-1?Array.isArray(n)?n[Number(e)]=r:n&&"object"==typeof n&&(n[e]=r):n&&"object"==typeof n&&(n[e]||(n[e]=i.includes(e)?[]:{}),n=n[e])})};function Ic(e,t){const{prefix:r,shouldSkipGeneratingVar:i}=t||{},n={},o={},s={};var a,c;return a=(e,t,a)=>{if(!("string"!=typeof t&&"number"!=typeof t||i&&i(e,t))){const i=`--${r?`${r}-`:""}${e.join("-")}`,c=((e,t)=>"number"==typeof t?["lineHeight","fontWeight","opacity","zIndex"].some(t=>e.includes(t))||e[e.length-1].toLowerCase().includes("opacity")?t:`${t}px`:t)(e,t);Object.assign(n,{[i]:c}),Ac(o,e,`var(${i})`,a),Ac(s,e,`var(${i}, ${c})`,a)}},c=e=>"vars"===e[0],function e(t,r=[],i=[]){Object.entries(t).forEach(([t,n])=>{(!c||c&&!c([...r,t]))&&null!=n&&("object"==typeof n&&Object.keys(n).length>0?e(n,[...r,t],Array.isArray(n)?[...i,t]:i):a([...r,t],n,i))})}(e),{css:n,vars:o,varsWithDefaults:s}}const Rc={textTransform:"uppercase"},Ec='"Roboto", "Helvetica", "Arial", sans-serif';function Tc(e,t){const{fontFamily:r=Ec,fontSize:i=14,fontWeightLight:n=300,fontWeightRegular:o=400,fontWeightMedium:s=500,fontWeightBold:a=700,htmlFontSize:c=16,allVariants:u,pxToRem:h,...d}="function"==typeof t?t(e):t,l=i/14,p=h||(e=>e/c*l+"rem"),f=(e,t,i,n,o)=>{return{fontFamily:r,fontWeight:e,fontSize:p(t),lineHeight:i,...r===Ec?{letterSpacing:(s=n/t,Math.round(1e5*s)/1e5+"em")}:{},...o,...u};var s},v={h1:f(n,96,1.167,-1.5),h2:f(n,60,1.2,-.5),h3:f(o,48,1.167,0),h4:f(o,34,1.235,.25),h5:f(o,24,1.334,0),h6:f(s,20,1.6,.15),subtitle1:f(o,16,1.75,.15),subtitle2:f(s,14,1.57,.1),body1:f(o,16,1.5,.15),body2:f(o,14,1.43,.15),button:f(s,14,1.75,.4,Rc),caption:f(o,12,1.66,.4),overline:f(o,12,2.66,1,Rc),inherit:{fontFamily:"inherit",fontWeight:"inherit",fontSize:"inherit",lineHeight:"inherit",letterSpacing:"inherit"}};return cs({htmlFontSize:c,pxToRem:p,fontFamily:r,fontSize:i,fontWeightLight:n,fontWeightRegular:o,fontWeightMedium:s,fontWeightBold:a,...v},d,{clone:!1})}function Mc(...e){return[`${e[0]}px ${e[1]}px ${e[2]}px ${e[3]}px rgba(0,0,0,0.2)`,`${e[4]}px ${e[5]}px ${e[6]}px ${e[7]}px rgba(0,0,0,0.14)`,`${e[8]}px ${e[9]}px ${e[10]}px ${e[11]}px rgba(0,0,0,0.12)`].join(",")}const kc=["none",Mc(0,2,1,-1,0,1,1,0,0,1,3,0),Mc(0,3,1,-2,0,2,2,0,0,1,5,0),Mc(0,3,3,-2,0,3,4,0,0,1,8,0),Mc(0,2,4,-1,0,4,5,0,0,1,10,0),Mc(0,3,5,-1,0,5,8,0,0,1,14,0),Mc(0,3,5,-1,0,6,10,0,0,1,18,0),Mc(0,4,5,-2,0,7,10,1,0,2,16,1),Mc(0,5,5,-3,0,8,10,1,0,3,14,2),Mc(0,5,6,-3,0,9,12,1,0,3,16,2),Mc(0,6,6,-3,0,10,14,1,0,4,18,3),Mc(0,6,7,-4,0,11,15,1,0,4,20,3),Mc(0,7,8,-4,0,12,17,2,0,5,22,4),Mc(0,7,8,-4,0,13,19,2,0,5,24,4),Mc(0,7,9,-4,0,14,21,2,0,5,26,4),Mc(0,8,9,-5,0,15,22,2,0,6,28,5),Mc(0,8,10,-5,0,16,24,2,0,6,30,5),Mc(0,8,11,-5,0,17,26,2,0,6,32,5),Mc(0,9,11,-5,0,18,28,2,0,7,34,6),Mc(0,9,12,-6,0,19,29,2,0,7,36,6),Mc(0,10,13,-6,0,20,31,3,0,8,38,7),Mc(0,10,13,-6,0,21,33,3,0,8,40,7),Mc(0,10,14,-6,0,22,35,3,0,8,42,7),Mc(0,11,14,-7,0,23,36,3,0,9,44,8),Mc(0,11,15,-7,0,24,38,3,0,9,46,8)],Oc={easeInOut:"cubic-bezier(0.4, 0, 0.2, 1)",easeOut:"cubic-bezier(0.0, 0, 0.2, 1)",easeIn:"cubic-bezier(0.4, 0, 1, 1)",sharp:"cubic-bezier(0.4, 0, 0.6, 1)"},_c={shortest:150,shorter:200,short:250,standard:300,complex:375,enteringScreen:225,leavingScreen:195};function xc(e){return`${Math.round(e)}ms`}function Nc(e){if(!e)return 0;const t=e/36;return Math.min(Math.round(10*(4+15*t**.25+t/5)),3e3)}function Dc(e){const t={...Oc,...e.easing},r={..._c,...e.duration};return{getAutoHeightDuration:Nc,create:(e=["all"],i={})=>{const{duration:n=r.standard,easing:o=t.easeInOut,delay:s=0,...a}=i;return(Array.isArray(e)?e:[e]).map(e=>`${e} ${"string"==typeof n?n:xc(n)} ${o} ${"string"==typeof s?s:xc(s)}`).join(",")},...e,easing:t,duration:r}}const zc={mobileStepper:1e3,fab:1050,speedDial:1050,appBar:1100,drawer:1200,modal:1300,snackbar:1400,tooltip:1500};function Lc(e){return ss(e)||void 0===e||"string"==typeof e||"boolean"==typeof e||"number"==typeof e||Array.isArray(e)}function Bc(e={}){const t={...e};return function e(t){const r=Object.entries(t);for(let i=0;i<r.length;i++){const[n,o]=r[i];!Lc(o)||n.startsWith("unstable_")?delete t[n]:ss(o)&&(t[n]={...o},e(t[n]))}}(t),`import { unstable_createBreakpoints as createBreakpoints, createTransitions } from '@mui/material/styles';\n\nconst theme = ${JSON.stringify(t,null,2)};\n\ntheme.breakpoints = createBreakpoints(theme.breakpoints || {});\ntheme.transitions = createTransitions(theme.transitions || {});\n\nexport default theme;`}function Fc(e){return"number"==typeof e?`${(100*e).toFixed(0)}%`:`calc((${e}) * 100%)`}const jc=function(e={},...t){const{breakpoints:r,mixins:i={},spacing:n,palette:o={},transitions:s={},typography:a={},shape:c,colorSpace:u,...h}=e;if(e.vars&&void 0===e.generateThemeVars)throw new Error(bn(20));const d=Cc({...o,colorSpace:u}),l=pa(e);let p=cs(l,{mixins:(f=l.breakpoints,v=i,{toolbar:{minHeight:56,[f.up("xs")]:{"@media (orientation: landscape)":{minHeight:48}},[f.up("sm")]:{minHeight:64}},...v}),palette:d,shadows:kc.slice(),typography:Tc(d,a),transitions:Dc(s),zIndex:{...zc}});var f,v,g;return p=cs(p,h),p=t.reduce((e,t)=>cs(e,t),p),p.unstable_sxConfig={...ua,...h?.unstable_sxConfig},p.unstable_sx=function(e){return da({sx:e,theme:this})},p.toRuntimeSource=Bc,g=p,Object.assign(g,{alpha(e,t){const r=this||g;return r.colorSpace?`oklch(from ${e} l c h / ${"string"==typeof t?`calc(${t})`:t})`:r.vars?`rgba(${e.replace(/var\(--([^,\s)]+)(?:,[^)]+)?\)+/g,"var(--$1Channel)")} / ${"string"==typeof t?`calc(${t})`:t})`:Ta(e,(e=>{if(!Number.isNaN(+e))return+e;const t=e.match(/\d*\.?\d+/g);if(!t)return 0;let r=0;for(let e=0;e<t.length;e+=1)r+=+t[e];return r})(t))},lighten(e,t){const r=this||g;return r.colorSpace?`color-mix(in ${r.colorSpace}, ${e}, #fff ${Fc(t)})`:_a(e,t)},darken(e,t){const r=this||g;return r.colorSpace?`color-mix(in ${r.colorSpace}, ${e}, #000 ${Fc(t)})`:ka(e,t)}}),p},Uc=[...Array(25)].map((e,t)=>{if(0===t)return"none";const r=function(e){let t;return t=e<1?5.11916*e**2:4.5*Math.log(e+1)+2,Math.round(10*t)/1e3}(t);return`linear-gradient(rgba(255 255 255 / ${r}), rgba(255 255 255 / ${r}))`});function qc(e){return{inputPlaceholder:"dark"===e?.5:.42,inputUnderline:"dark"===e?.7:.42,switchTrackDisabled:"dark"===e?.2:.12,switchTrack:"dark"===e?.3:.38}}function Wc(e){return"dark"===e?Uc:[]}function Kc(e){return!!e[0].match(/(cssVarPrefix|colorSchemeSelector|modularCssLayers|rootSelector|typography|mixins|breakpoints|direction|transitions)/)||!!e[0].match(/sxConfig$/)||"palette"===e[0]&&!!e[1]?.match(/(mode|contrastThreshold|tonalOffset)/)}const Hc=e=>(t,r)=>{const i=e.rootSelector||":root",n=e.colorSchemeSelector;let o=n;if("class"===n&&(o=".%s"),"data"===n&&(o="[data-%s]"),n?.startsWith("data-")&&!n.includes("%s")&&(o=`[${n}="%s"]`),e.defaultColorScheme===t){if("dark"===t){const n={};return(s=e.cssVarPrefix,[...[...Array(25)].map((e,t)=>`--${s?`${s}-`:""}overlays-${t}`),`--${s?`${s}-`:""}palette-AppBar-darkBg`,`--${s?`${s}-`:""}palette-AppBar-darkColor`]).forEach(e=>{n[e]=r[e],delete r[e]}),"media"===o?{[i]:r,"@media (prefers-color-scheme: dark)":{[i]:n}}:o?{[o.replace("%s",t)]:n,[`${i}, ${o.replace("%s",t)}`]:r}:{[i]:{...r,...n}}}if(o&&"media"!==o)return`${i}, ${o.replace("%s",String(t))}`}else if(t){if("media"===o)return{[`@media (prefers-color-scheme: ${String(t)})`]:{[i]:r}};if(o)return o.replace("%s",String(t))}var s;return i};function Vc(e,t,r){!e[t]&&r&&(e[t]=r)}function Gc(e){return"string"==typeof e&&e.startsWith("hsl")?Ra(e):e}function Jc(e,t){`${t}Channel`in e||(e[`${t}Channel`]=Aa(Gc(e[t])))}const $c=e=>{try{return e()}catch(e){}};function Qc(e,t,r,i,n){if(!r)return;r=!0===r?{}:r;const o="dark"===n?"dark":"light";if(!i)return void(t[n]=function(e){const{palette:t={mode:"light"},opacity:r,overlays:i,colorSpace:n,...o}=e,s=Cc({...t,colorSpace:n});return{palette:s,opacity:{...qc(s.mode),...r},overlays:i||Wc(s.mode),...o}}({...r,palette:{mode:o,...r?.palette},colorSpace:e}));const{palette:s,...a}=jc({...i,palette:{mode:o,...r?.palette},colorSpace:e});return t[n]={...r,palette:s,opacity:{...qc(o),...r?.opacity},overlays:r?.overlays||Wc(o)},a}function Yc(e={},...t){const{colorSchemes:r={light:!0},defaultColorScheme:i,disableCssColorScheme:n=!1,cssVarPrefix:o="mui",nativeColor:s=!1,shouldSkipGeneratingVar:a=Kc,colorSchemeSelector:c=(r.light&&r.dark?"media":void 0),rootSelector:u=":root",...h}=e,d=Object.keys(r)[0],l=i||(r.light&&"light"!==d?"light":d),p=((e="mui")=>wc(e))(o),{[l]:f,light:v,dark:g,...m}=r,y={...m};let b,S=f;if(("dark"===l&&!("dark"in r)||"light"===l&&!("light"in r))&&(S=!0),!S)throw new Error(bn(21,l));s&&(b="oklch");const C=Qc(b,y,S,h,l);v&&!y.light&&Qc(b,y,v,void 0,"light"),g&&!y.dark&&Qc(b,y,g,void 0,"dark");let w={defaultColorScheme:l,...C,cssVarPrefix:o,colorSchemeSelector:c,rootSelector:u,getCssVar:p,colorSchemes:y,font:{...Pc(C.typography),...C.font},spacing:(P=h.spacing,"number"==typeof P?`${P}px`:"string"==typeof P||"function"==typeof P||Array.isArray(P)?P:"8px")};var P;Object.keys(w.colorSchemes).forEach(e=>{const t=w.colorSchemes[e].palette,r=e=>{const r=e.split("-"),i=r[1],n=r[2];return p(e,t[i][n])};function i(e,t,r){if(b){let i;return e===Ma&&(i=`transparent ${(100*(1-r)).toFixed(0)}%`),e===Oa&&(i=`#000 ${(100*r).toFixed(0)}%`),e===xa&&(i=`#fff ${(100*r).toFixed(0)}%`),`color-mix(in ${b}, ${t}, ${i})`}return e(t,r)}var n;if("light"===t.mode&&(Vc(t.common,"background","#fff"),Vc(t.common,"onBackground","#000")),"dark"===t.mode&&(Vc(t.common,"background","#000"),Vc(t.common,"onBackground","#fff")),n=t,["Alert","AppBar","Avatar","Button","Chip","FilledInput","LinearProgress","Skeleton","Slider","SnackbarContent","SpeedDialAction","StepConnector","StepContent","Switch","TableCell","Tooltip"].forEach(e=>{n[e]||(n[e]={})}),"light"===t.mode){Vc(t.Alert,"errorColor",i(Oa,t.error.light,.6)),Vc(t.Alert,"infoColor",i(Oa,t.info.light,.6)),Vc(t.Alert,"successColor",i(Oa,t.success.light,.6)),Vc(t.Alert,"warningColor",i(Oa,t.warning.light,.6)),Vc(t.Alert,"errorFilledBg",r("palette-error-main")),Vc(t.Alert,"infoFilledBg",r("palette-info-main")),Vc(t.Alert,"successFilledBg",r("palette-success-main")),Vc(t.Alert,"warningFilledBg",r("palette-warning-main")),Vc(t.Alert,"errorFilledColor",$c(()=>t.getContrastText(t.error.main))),Vc(t.Alert,"infoFilledColor",$c(()=>t.getContrastText(t.info.main))),Vc(t.Alert,"successFilledColor",$c(()=>t.getContrastText(t.success.main))),Vc(t.Alert,"warningFilledColor",$c(()=>t.getContrastText(t.warning.main))),Vc(t.Alert,"errorStandardBg",i(xa,t.error.light,.9)),Vc(t.Alert,"infoStandardBg",i(xa,t.info.light,.9)),Vc(t.Alert,"successStandardBg",i(xa,t.success.light,.9)),Vc(t.Alert,"warningStandardBg",i(xa,t.warning.light,.9)),Vc(t.Alert,"errorIconColor",r("palette-error-main")),Vc(t.Alert,"infoIconColor",r("palette-info-main")),Vc(t.Alert,"successIconColor",r("palette-success-main")),Vc(t.Alert,"warningIconColor",r("palette-warning-main")),Vc(t.AppBar,"defaultBg",r("palette-grey-100")),Vc(t.Avatar,"defaultBg",r("palette-grey-400")),Vc(t.Button,"inheritContainedBg",r("palette-grey-300")),Vc(t.Button,"inheritContainedHoverBg",r("palette-grey-A100")),Vc(t.Chip,"defaultBorder",r("palette-grey-400")),Vc(t.Chip,"defaultAvatarColor",r("palette-grey-700")),Vc(t.Chip,"defaultIconColor",r("palette-grey-700")),Vc(t.FilledInput,"bg","rgba(0, 0, 0, 0.06)"),Vc(t.FilledInput,"hoverBg","rgba(0, 0, 0, 0.09)"),Vc(t.FilledInput,"disabledBg","rgba(0, 0, 0, 0.12)"),Vc(t.LinearProgress,"primaryBg",i(xa,t.primary.main,.62)),Vc(t.LinearProgress,"secondaryBg",i(xa,t.secondary.main,.62)),Vc(t.LinearProgress,"errorBg",i(xa,t.error.main,.62)),Vc(t.LinearProgress,"infoBg",i(xa,t.info.main,.62)),Vc(t.LinearProgress,"successBg",i(xa,t.success.main,.62)),Vc(t.LinearProgress,"warningBg",i(xa,t.warning.main,.62)),Vc(t.Skeleton,"bg",b?i(Ma,t.text.primary,.11):`rgba(${r("palette-text-primaryChannel")} / 0.11)`),Vc(t.Slider,"primaryTrack",i(xa,t.primary.main,.62)),Vc(t.Slider,"secondaryTrack",i(xa,t.secondary.main,.62)),Vc(t.Slider,"errorTrack",i(xa,t.error.main,.62)),Vc(t.Slider,"infoTrack",i(xa,t.info.main,.62)),Vc(t.Slider,"successTrack",i(xa,t.success.main,.62)),Vc(t.Slider,"warningTrack",i(xa,t.warning.main,.62));const e=b?i(Oa,t.background.default,.6825):Na(t.background.default,.8);Vc(t.SnackbarContent,"bg",e),Vc(t.SnackbarContent,"color",$c(()=>b?yc.text.primary:t.getContrastText(e))),Vc(t.SpeedDialAction,"fabHoverBg",Na(t.background.paper,.15)),Vc(t.StepConnector,"border",r("palette-grey-400")),Vc(t.StepContent,"border",r("palette-grey-400")),Vc(t.Switch,"defaultColor",r("palette-common-white")),Vc(t.Switch,"defaultDisabledColor",r("palette-grey-100")),Vc(t.Switch,"primaryDisabledColor",i(xa,t.primary.main,.62)),Vc(t.Switch,"secondaryDisabledColor",i(xa,t.secondary.main,.62)),Vc(t.Switch,"errorDisabledColor",i(xa,t.error.main,.62)),Vc(t.Switch,"infoDisabledColor",i(xa,t.info.main,.62)),Vc(t.Switch,"successDisabledColor",i(xa,t.success.main,.62)),Vc(t.Switch,"warningDisabledColor",i(xa,t.warning.main,.62)),Vc(t.TableCell,"border",i(xa,i(Ma,t.divider,1),.88)),Vc(t.Tooltip,"bg",i(Ma,t.grey[700],.92))}if("dark"===t.mode){Vc(t.Alert,"errorColor",i(xa,t.error.light,.6)),Vc(t.Alert,"infoColor",i(xa,t.info.light,.6)),Vc(t.Alert,"successColor",i(xa,t.success.light,.6)),Vc(t.Alert,"warningColor",i(xa,t.warning.light,.6)),Vc(t.Alert,"errorFilledBg",r("palette-error-dark")),Vc(t.Alert,"infoFilledBg",r("palette-info-dark")),Vc(t.Alert,"successFilledBg",r("palette-success-dark")),Vc(t.Alert,"warningFilledBg",r("palette-warning-dark")),Vc(t.Alert,"errorFilledColor",$c(()=>t.getContrastText(t.error.dark))),Vc(t.Alert,"infoFilledColor",$c(()=>t.getContrastText(t.info.dark))),Vc(t.Alert,"successFilledColor",$c(()=>t.getContrastText(t.success.dark))),Vc(t.Alert,"warningFilledColor",$c(()=>t.getContrastText(t.warning.dark))),Vc(t.Alert,"errorStandardBg",i(Oa,t.error.light,.9)),Vc(t.Alert,"infoStandardBg",i(Oa,t.info.light,.9)),Vc(t.Alert,"successStandardBg",i(Oa,t.success.light,.9)),Vc(t.Alert,"warningStandardBg",i(Oa,t.warning.light,.9)),Vc(t.Alert,"errorIconColor",r("palette-error-main")),Vc(t.Alert,"infoIconColor",r("palette-info-main")),Vc(t.Alert,"successIconColor",r("palette-success-main")),Vc(t.Alert,"warningIconColor",r("palette-warning-main")),Vc(t.AppBar,"defaultBg",r("palette-grey-900")),Vc(t.AppBar,"darkBg",r("palette-background-paper")),Vc(t.AppBar,"darkColor",r("palette-text-primary")),Vc(t.Avatar,"defaultBg",r("palette-grey-600")),Vc(t.Button,"inheritContainedBg",r("palette-grey-800")),Vc(t.Button,"inheritContainedHoverBg",r("palette-grey-700")),Vc(t.Chip,"defaultBorder",r("palette-grey-700")),Vc(t.Chip,"defaultAvatarColor",r("palette-grey-300")),Vc(t.Chip,"defaultIconColor",r("palette-grey-300")),Vc(t.FilledInput,"bg","rgba(255, 255, 255, 0.09)"),Vc(t.FilledInput,"hoverBg","rgba(255, 255, 255, 0.13)"),Vc(t.FilledInput,"disabledBg","rgba(255, 255, 255, 0.12)"),Vc(t.LinearProgress,"primaryBg",i(Oa,t.primary.main,.5)),Vc(t.LinearProgress,"secondaryBg",i(Oa,t.secondary.main,.5)),Vc(t.LinearProgress,"errorBg",i(Oa,t.error.main,.5)),Vc(t.LinearProgress,"infoBg",i(Oa,t.info.main,.5)),Vc(t.LinearProgress,"successBg",i(Oa,t.success.main,.5)),Vc(t.LinearProgress,"warningBg",i(Oa,t.warning.main,.5)),Vc(t.Skeleton,"bg",b?i(Ma,t.text.primary,.13):`rgba(${r("palette-text-primaryChannel")} / 0.13)`),Vc(t.Slider,"primaryTrack",i(Oa,t.primary.main,.5)),Vc(t.Slider,"secondaryTrack",i(Oa,t.secondary.main,.5)),Vc(t.Slider,"errorTrack",i(Oa,t.error.main,.5)),Vc(t.Slider,"infoTrack",i(Oa,t.info.main,.5)),Vc(t.Slider,"successTrack",i(Oa,t.success.main,.5)),Vc(t.Slider,"warningTrack",i(Oa,t.warning.main,.5));const e=b?i(xa,t.background.default,.985):Na(t.background.default,.98);Vc(t.SnackbarContent,"bg",e),Vc(t.SnackbarContent,"color",$c(()=>b?gc.text.primary:t.getContrastText(e))),Vc(t.SpeedDialAction,"fabHoverBg",Na(t.background.paper,.15)),Vc(t.StepConnector,"border",r("palette-grey-600")),Vc(t.StepContent,"border",r("palette-grey-600")),Vc(t.Switch,"defaultColor",r("palette-grey-300")),Vc(t.Switch,"defaultDisabledColor",r("palette-grey-600")),Vc(t.Switch,"primaryDisabledColor",i(Oa,t.primary.main,.55)),Vc(t.Switch,"secondaryDisabledColor",i(Oa,t.secondary.main,.55)),Vc(t.Switch,"errorDisabledColor",i(Oa,t.error.main,.55)),Vc(t.Switch,"infoDisabledColor",i(Oa,t.info.main,.55)),Vc(t.Switch,"successDisabledColor",i(Oa,t.success.main,.55)),Vc(t.Switch,"warningDisabledColor",i(Oa,t.warning.main,.55)),Vc(t.TableCell,"border",i(Oa,i(Ma,t.divider,1),.68)),Vc(t.Tooltip,"bg",i(Ma,t.grey[700],.92))}Jc(t.background,"default"),Jc(t.background,"paper"),Jc(t.common,"background"),Jc(t.common,"onBackground"),Jc(t,"divider"),Object.keys(t).forEach(e=>{const r=t[e];"tonalOffset"!==e&&r&&"object"==typeof r&&(r.main&&Vc(t[e],"mainChannel",Aa(Gc(r.main))),r.light&&Vc(t[e],"lightChannel",Aa(Gc(r.light))),r.dark&&Vc(t[e],"darkChannel",Aa(Gc(r.dark))),r.contrastText&&Vc(t[e],"contrastTextChannel",Aa(Gc(r.contrastText))),"text"===e&&(Jc(t[e],"primary"),Jc(t[e],"secondary")),"action"===e&&(r.active&&Jc(t[e],"active"),r.selected&&Jc(t[e],"selected")))})}),w=t.reduce((e,t)=>cs(e,t),w);const A={prefix:o,disableCssColorScheme:n,shouldSkipGeneratingVar:a,getSelector:Hc(w),enableContrastVars:s},{vars:I,generateThemeVars:R,generateStyleSheets:E}=function(e,t={}){const{getSelector:r=m,disableCssColorScheme:i,colorSchemeSelector:n,enableContrastVars:o}=t,{colorSchemes:s={},components:a,defaultColorScheme:c="light",...u}=e,{vars:h,css:d,varsWithDefaults:l}=Ic(u,t);let p=l;const f={},{[c]:v,...g}=s;if(Object.entries(g||{}).forEach(([e,r])=>{const{vars:i,css:n,varsWithDefaults:o}=Ic(r,t);p=cs(p,o),f[e]={css:n,vars:i}}),v){const{css:e,vars:r,varsWithDefaults:i}=Ic(v,t);p=cs(p,i),f[c]={css:e,vars:r}}function m(t,r){let i=n;if("class"===n&&(i=".%s"),"data"===n&&(i="[data-%s]"),n?.startsWith("data-")&&!n.includes("%s")&&(i=`[${n}="%s"]`),t){if("media"===i){if(e.defaultColorScheme===t)return":root";const i=s[t]?.palette?.mode||t;return{[`@media (prefers-color-scheme: ${i})`]:{":root":r}}}if(i)return e.defaultColorScheme===t?`:root, ${i.replace("%s",String(t))}`:i.replace("%s",String(t))}return":root"}return{vars:p,generateThemeVars:()=>{let e={...h};return Object.entries(f).forEach(([,{vars:t}])=>{e=cs(e,t)}),e},generateStyleSheets:()=>{const t=[],n=e.defaultColorScheme||"light";function a(e,r){Object.keys(r).length&&t.push("string"==typeof e?{[e]:{...r}}:e)}a(r(void 0,{...d}),d);const{[n]:c,...u}=f;if(c){const{css:e}=c,t=s[n]?.palette?.mode,o=!i&&t?{colorScheme:t,...e}:{...e};a(r(n,{...o}),o)}return Object.entries(u).forEach(([e,{css:t}])=>{const n=s[e]?.palette?.mode,o=!i&&n?{colorScheme:n,...t}:{...t};a(r(e,{...o}),o)}),o&&t.push({":root":{"--__l-threshold":"0.7","--__l":"clamp(0, (l / var(--__l-threshold) - 1) * -infinity, 1)","--__a":"clamp(0.87, (l / var(--__l-threshold) - 1) * -infinity, 1)"}}),t}}}(w,A);return w.vars=I,Object.entries(w.colorSchemes[w.defaultColorScheme]).forEach(([e,t])=>{w[e]=t}),w.generateThemeVars=R,w.generateStyleSheets=E,w.generateSpacing=function(){return Ds(h.spacing,Ms(this))},w.getColorSchemeSelector=function(e){return function(t){return"media"===e?`@media (prefers-color-scheme: ${t})`:e?e.startsWith("data-")&&!e.includes("%s")?`[${e}="${t}"] &`:"class"===e?`.${t} &`:"data"===e?`[data-${t}] &`:`${e.replace("%s",t)} &`:"&"}}(c),w.spacing=w.generateSpacing(),w.shouldSkipGeneratingVar=a,w.unstable_sxConfig={...ua,...h?.unstable_sxConfig},w.unstable_sx=function(e){return da({sx:e,theme:this})},w.toRuntimeSource=Bc,w}function Xc(e,t,r){e.colorSchemes&&r&&(e.colorSchemes[t]={...!0!==r&&r,palette:Cc({...!0===r?{}:r.palette,mode:t})})}const Zc=function(e={},...t){const{palette:r,cssVariables:i=!1,colorSchemes:n=(r?void 0:{light:!0}),defaultColorScheme:o=r?.mode,...s}=e,a=o||"light",c=n?.[a],u={...n,...r?{[a]:{..."boolean"!=typeof c&&c,palette:r}}:void 0};if(!1===i){if(!("colorSchemes"in e))return jc(e,...t);let i=r;"palette"in e||u[a]&&(!0!==u[a]?i=u[a].palette:"dark"===a&&(i={mode:"dark"}));const n=jc({...e,palette:i},...t);return n.defaultColorScheme=a,n.colorSchemes=u,"light"===n.palette.mode&&(n.colorSchemes.light={...!0!==u.light&&u.light,palette:n.palette},Xc(n,"dark",u.dark)),"dark"===n.palette.mode&&(n.colorSchemes.dark={...!0!==u.dark&&u.dark,palette:n.palette},Xc(n,"light",u.light)),n}return r||"light"in u||"light"!==a||(u.light=!0),Yc({...s,colorSchemes:u,defaultColorScheme:a,..."boolean"!=typeof i&&i},...t)}(),eu="$$material",tu=function(e={}){const{themeId:t,defaultTheme:r=va,rootShouldForwardProp:i=ga,slotShouldForwardProp:n=ga}=e;function o(e){!function(e,t,r){e.theme=function(e){for(const t in e)return!1;return!0}(e.theme)?r:e.theme[t]||e.theme}(e,t,r)}return(e,t={})=>{!function(e){Array.isArray(e.__emotion_styles)&&(e.__emotion_styles=e.__emotion_styles.filter(e=>e!==da))}(e);const{name:r,slot:s,skipVariantsResolver:a,skipSx:c,overridesResolver:u=ya(Ca(s)),...h}=t,d=r&&r.startsWith("Mui")||s?"components":"custom",l=void 0!==a?a:s&&"Root"!==s&&"root"!==s||!1,p=c||!1;let f=ga;"Root"===s||"root"===s?f=i:s?f=n:function(e){return"string"==typeof e&&e.charCodeAt(0)>96}(e)&&(f=void 0);const v=function(e,t){return rs(e,t)}(e,{shouldForwardProp:f,label:void 0,...h}),g=e=>{if(e.__emotion_real===e)return e;if("function"==typeof e)return function(t){return ba(t,e,t.theme.modularCssLayers?d:void 0)};if(ss(e)){const t=fa(e);return function(e){return t.variants?ba(e,t,e.theme.modularCssLayers?d:void 0):e.theme.modularCssLayers?ma(t.style,d):t.style}}return e},m=(...t)=>{const i=[],n=t.map(g),s=[];if(i.push(o),r&&u&&s.push(function(e){const t=e.theme,i=t.components?.[r]?.styleOverrides;if(!i)return null;const n={};for(const t in i)n[t]=ba(e,i[t],e.theme.modularCssLayers?"theme":void 0);return u(e,n)}),r&&!l&&s.push(function(e){const t=e.theme,i=t?.components?.[r]?.variants;return i?Sa(e,i,[],e.theme.modularCssLayers?"theme":void 0):null}),p||s.push(da),Array.isArray(n[0])){const e=n.shift(),t=new Array(i.length).fill(""),r=new Array(s.length).fill("");let o;o=[...t,...e,...r],o.raw=[...t,...e.raw,...r],i.unshift(o)}const a=[...i,...n,...s],c=v(...a);return e.muiName&&(c.muiName=e.muiName),c};return v.withConfig&&(m.withConfig=v.withConfig),m}}({themeId:eu,defaultTheme:Zc,rootShouldForwardProp:e=>function(e){return"ownerState"!==e&&"theme"!==e&&"sx"!==e&&"as"!==e}(e)&&"classes"!==e}),ru=tu,iu={theme:void 0},nu=function(e){let t,r;return function(i){let n=t;return void 0!==n&&i.theme===r||(iu.theme=i.theme,n=fa(e(iu)),t=n,r=i.theme),n}};function ou(e,t,r=!1){const i={...t};for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)){const o=n;if("components"===o||"slots"===o)i[o]={...e[o],...i[o]};else if("componentsProps"===o||"slotProps"===o){const n=e[o],s=t[o];if(s)if(n){i[o]={...s};for(const e in n)if(Object.prototype.hasOwnProperty.call(n,e)){const t=e;i[o][t]=ou(n[t],s[t],r)}}else i[o]=s;else i[o]=n||{}}else"className"===o&&r&&t.className?i.className=mn(e?.className,t?.className):"style"===o&&r&&t.style?i.style={...e?.style,...t?.style}:void 0===i[o]&&(i[o]=e[o])}return i}var su=o(4848);const au=e.createContext(void 0);function cu(t){return function({props:t,name:r}){return function(e){const{theme:t,name:r,props:i}=e;if(!t||!t.components||!t.components[r])return i;const n=t.components[r];return n.defaultProps?ou(n.defaultProps,i,t.components.mergeClassNameAndStyle):n.styleOverrides||n.variants?i:ou(n,i,t.components.mergeClassNameAndStyle)}({props:t,name:r,theme:{components:e.useContext(au)}})}(t)}const uu=e=>e,hu=(()=>{let e=uu;return{configure(t){e=t},generate:t=>e(t),reset(){e=uu}}})(),du={active:"active",checked:"checked",completed:"completed",disabled:"disabled",error:"error",expanded:"expanded",focused:"focused",focusVisible:"focusVisible",open:"open",readOnly:"readOnly",required:"required",selected:"selected"};function lu(e,t,r="Mui"){const i=du[t];return i?`${r}-${i}`:`${hu.generate(e)}-${t}`}function pu(e,t,r="Mui"){const i={};return t.forEach(t=>{i[t]=lu(e,t,r)}),i}function fu(e){return lu("MuiSvgIcon",e)}pu("MuiSvgIcon",["root","colorPrimary","colorSecondary","colorAction","colorError","colorDisabled","fontSizeInherit","fontSizeSmall","fontSizeMedium","fontSizeLarge"]);const vu=ru("svg",{name:"MuiSvgIcon",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,"inherit"!==r.color&&t[`color${Cn(r.color)}`],t[`fontSize${Cn(r.fontSize)}`]]}})(nu(({theme:e})=>({userSelect:"none",width:"1em",height:"1em",display:"inline-block",flexShrink:0,transition:e.transitions?.create?.("fill",{duration:(e.vars??e).transitions?.duration?.shorter}),variants:[{props:e=>!e.hasSvgAsChild,style:{fill:"currentColor"}},{props:{fontSize:"inherit"},style:{fontSize:"inherit"}},{props:{fontSize:"small"},style:{fontSize:e.typography?.pxToRem?.(20)||"1.25rem"}},{props:{fontSize:"medium"},style:{fontSize:e.typography?.pxToRem?.(24)||"1.5rem"}},{props:{fontSize:"large"},style:{fontSize:e.typography?.pxToRem?.(35)||"2.1875rem"}},...Object.entries((e.vars??e).palette).filter(([,e])=>e&&e.main).map(([t])=>({props:{color:t},style:{color:(e.vars??e).palette?.[t]?.main}})),{props:{color:"action"},style:{color:(e.vars??e).palette?.action?.active}},{props:{color:"disabled"},style:{color:(e.vars??e).palette?.action?.disabled}},{props:{color:"inherit"},style:{color:void 0}}]}))),gu=e.forwardRef(function(t,r){const i=cu({props:t,name:"MuiSvgIcon"}),{children:n,className:o,color:s="inherit",component:a="svg",fontSize:c="medium",htmlColor:u,inheritViewBox:h=!1,titleAccess:d,viewBox:l="0 0 24 24",...p}=i,f=e.isValidElement(n)&&"svg"===n.type,v={...i,color:s,component:a,fontSize:c,instanceFontSize:t.fontSize,inheritViewBox:h,viewBox:l,hasSvgAsChild:f},g={};h||(g.viewBox=l);const m=(e=>{const{color:t,fontSize:r,classes:i}=e;return yn({root:["root","inherit"!==t&&`color${Cn(t)}`,`fontSize${Cn(r)}`]},fu,i)})(v);return(0,su.jsxs)(vu,{as:a,className:mn(m.root,o),focusable:"false",color:u,"aria-hidden":!d||void 0,role:d?"img":void 0,ref:r,...g,...p,...f&&n.props,ownerState:v,children:[f?n.props.children:n,d?(0,su.jsx)("title",{children:d}):null]})});gu.muiName="SvgIcon";const mu=gu;function yu(t,r){function i(e,r){return(0,su.jsx)(mu,{"data-testid":void 0,ref:r,...e,children:t})}return i.muiName=mu.muiName,e.memo(e.forwardRef(i))}const bu=yu((0,su.jsx)("path",{d:"M12 14c1.66 0 2.99-1.34 2.99-3L15 5c0-1.66-1.34-3-3-3S9 3.34 9 5v6c0 1.66 1.34 3 3 3m5.3-3c0 3-2.54 5.1-5.3 5.1S6.7 14 6.7 11H5c0 3.41 2.72 6.23 6 6.72V21h2v-3.28c3.28-.48 6-3.3 6-6.72z"})),Su=yu((0,su.jsx)("path",{d:"M19 11h-1.7c0 .74-.16 1.43-.43 2.05l1.23 1.23c.56-.98.9-2.09.9-3.28m-4.02.17c0-.06.02-.11.02-.17V5c0-1.66-1.34-3-3-3S9 3.34 9 5v.18zM4.27 3 3 4.27l6.01 6.01V11c0 1.66 1.33 3 2.99 3 .22 0 .44-.03.65-.08l1.66 1.66c-.71.33-1.5.52-2.31.52-2.76 0-5.3-2.1-5.3-5.1H5c0 3.41 2.72 6.23 6 6.72V21h2v-3.28c.91-.13 1.77-.45 2.54-.9L19.73 21 21 19.73z"}));function Cu(...t){const r=e.useRef(void 0),i=e.useCallback(e=>{const r=t.map(t=>{if(null==t)return null;if("function"==typeof t){const r=t,i=r(e);return"function"==typeof i?i:()=>{r(null)}}return t.current=e,()=>{t.current=null}});return()=>{r.forEach(e=>e?.())}},t);return e.useMemo(()=>t.every(e=>null==e)?null:e=>{r.current&&(r.current(),r.current=void 0),null!=e&&(r.current=i(e))},t)}const wu="undefined"!=typeof window?e.useLayoutEffect:e.useEffect,Pu=function(t){const r=e.useRef(t);return wu(()=>{r.current=t}),e.useRef((...e)=>(0,r.current)(...e)).current};function Au(e){const t=function(e){return e&&e.ownerDocument||document}(e);return t.defaultView||window}function Iu(e){return parseInt(e,10)||0}const Ru={visibility:"hidden",position:"absolute",overflow:"hidden",height:0,top:0,left:0,transform:"translateZ(0)"};function Eu(e){return function(e){for(const t in e)return!1;return!0}(e)||0===e.outerHeightStyle&&!e.overflowing}const Tu=e.forwardRef(function(t,r){const{onChange:i,maxRows:n,minRows:o=1,style:s,value:a,...c}=t,{current:u}=e.useRef(null!=a),h=e.useRef(null),d=Cu(r,h),l=e.useRef(null),p=e.useRef(null),f=e.useCallback(()=>{const e=h.current,r=p.current;if(!e||!r)return;const i=Au(e).getComputedStyle(e);if("0px"===i.width)return{outerHeightStyle:0,overflowing:!1};r.style.width=i.width,r.value=e.value||t.placeholder||"x","\n"===r.value.slice(-1)&&(r.value+=" ");const s=i.boxSizing,a=Iu(i.paddingBottom)+Iu(i.paddingTop),c=Iu(i.borderBottomWidth)+Iu(i.borderTopWidth),u=r.scrollHeight;r.value="x";const d=r.scrollHeight;let l=u;return o&&(l=Math.max(Number(o)*d,l)),n&&(l=Math.min(Number(n)*d,l)),l=Math.max(l,d),{outerHeightStyle:l+("border-box"===s?a+c:0),overflowing:Math.abs(l-u)<=1}},[n,o,t.placeholder]),v=Pu(()=>{const e=h.current,t=f();if(!e||!t||Eu(t))return!1;const r=t.outerHeightStyle;return null!=l.current&&l.current!==r}),g=e.useCallback(()=>{const e=h.current,t=f();if(!e||!t||Eu(t))return;const r=t.outerHeightStyle;l.current!==r&&(l.current=r,e.style.height=`${r}px`),e.style.overflow=t.overflowing?"hidden":""},[f]),m=e.useRef(-1);return wu(()=>{const e=function(e,t=166){let r;function i(...i){clearTimeout(r),r=setTimeout(()=>{e.apply(this,i)},t)}return i.clear=()=>{clearTimeout(r)},i}(g),t=h?.current;if(!t)return;const r=Au(t);let i;return r.addEventListener("resize",e),"undefined"!=typeof ResizeObserver&&(i=new ResizeObserver(()=>{v()&&(i.unobserve(t),cancelAnimationFrame(m.current),g(),m.current=requestAnimationFrame(()=>{i.observe(t)}))}),i.observe(t)),()=>{e.clear(),cancelAnimationFrame(m.current),r.removeEventListener("resize",e),i&&i.disconnect()}},[f,g,v]),wu(()=>{g()}),(0,su.jsxs)(e.Fragment,{children:[(0,su.jsx)("textarea",{value:a,onChange:e=>{u||g();const t=e.target,r=t.value.length,n=t.value.endsWith("\n"),o=t.selectionStart===r;n&&o&&t.setSelectionRange(r,r),i&&i(e)},ref:d,rows:o,style:s,...c}),(0,su.jsx)("textarea",{"aria-hidden":!0,className:t.className,readOnly:!0,ref:p,tabIndex:-1,style:{...Ru,...s,paddingTop:0,paddingBottom:0}})]})}),Mu=Tu,ku=function(e){return"string"==typeof e},Ou=e.createContext(void 0);o(1765);var _u,xu,Nu=function(t,r){var i=arguments;if(null==r||!Vo.call(r,"css"))return e.createElement.apply(void 0,i);var n=i.length,o=new Array(n);o[0]=$o,o[1]=function(e,t){var r={};for(var i in t)Vo.call(t,i)&&(r[i]=t[i]);return r[Go]=e,r}(t,r);for(var s=2;s<n;s++)o[s]=i[s];return e.createElement.apply(null,o)};_u=Nu||(Nu={}),xu||(xu=_u.JSX||(_u.JSX={}));var Du=Ko(function(t,r){var i=Fo([t.styles],void 0,e.useContext(Ho)),n=e.useRef();return qo(function(){var e=r.key+"-global",t=new r.sheet.constructor({key:e,nonce:r.sheet.nonce,container:r.sheet.container,speedy:r.sheet.isSpeedy}),o=!1,s=document.querySelector('style[data-emotion="'+e+" "+i.name+'"]');return r.sheet.tags.length&&(t.before=r.sheet.tags[0]),null!==s&&(o=!0,s.setAttribute("data-emotion",e),t.hydrate([s])),n.current=[t,o],function(){t.flush()}},[r]),qo(function(){var e=n.current,t=e[0];if(e[1])e[1]=!1;else{if(void 0!==i.next&&Eo(r,i.next,!0),t.tags.length){var o=t.tags[t.tags.length-1].nextElementSibling;t.before=o,t.flush()}r.insert("",i,t,!1)}},[r,i.name]),null});function zu(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return Fo(t)}function Lu(){var e=zu.apply(void 0,arguments),t="animation-"+e.name;return{name:t,styles:"@keyframes "+t+"{"+e.styles+"}",anim:1,toString:function(){return"_EMO_"+this.name+"_"+this.styles+"_EMO_"}}}function Bu(e){const{styles:t,defaultTheme:r={}}=e,i="function"==typeof t?e=>{return t(null==(i=e)||0===Object.keys(i).length?r:e);var i}:t;return(0,su.jsx)(Du,{styles:i})}const Fu=pa(),ju=function(t=Fu){return function(t=null){const r=e.useContext(Ho);return r&&(i=r,0!==Object.keys(i).length)?r:t;var i}(t)};function Uu(e){const t=ns(e);return e!==t&&t.styles?(t.styles.match(/^@layer\s+[^{]*$/)||(t.styles=`@layer global{${t.styles}}`),t):e}const qu=function({styles:e,themeId:t,defaultTheme:r={}}){const i=ju(r),n=t&&i[t]||i;let o="function"==typeof e?e(n):e;return n.modularCssLayers&&(o=Array.isArray(o)?o.map(e=>Uu("function"==typeof e?e(n):e)):Uu(o)),(0,su.jsx)(Bu,{styles:o})},Wu=function(e){return(0,su.jsx)(qu,{...e,defaultTheme:Zc,themeId:eu})},Ku=Cu,Hu=wu;function Vu(e){return null!=e&&!(Array.isArray(e)&&0===e.length)}function Gu(e){return lu("MuiInputBase",e)}const Ju=pu("MuiInputBase",["root","formControl","focused","disabled","adornedStart","adornedEnd","error","sizeSmall","multiline","colorSecondary","fullWidth","hiddenLabel","readOnly","input","inputSizeSmall","inputMultiline","inputTypeSearch","inputAdornedStart","inputAdornedEnd","inputHiddenLabel"]);var $u;const Qu=ru("div",{name:"MuiInputBase",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,r.formControl&&t.formControl,r.startAdornment&&t.adornedStart,r.endAdornment&&t.adornedEnd,r.error&&t.error,"small"===r.size&&t.sizeSmall,r.multiline&&t.multiline,r.color&&t[`color${Cn(r.color)}`],r.fullWidth&&t.fullWidth,r.hiddenLabel&&t.hiddenLabel]}})(nu(({theme:e})=>({...e.typography.body1,color:(e.vars||e).palette.text.primary,lineHeight:"1.4375em",boxSizing:"border-box",position:"relative",cursor:"text",display:"inline-flex",alignItems:"center",[`&.${Ju.disabled}`]:{color:(e.vars||e).palette.text.disabled,cursor:"default"},variants:[{props:({ownerState:e})=>e.multiline,style:{padding:"4px 0 5px"}},{props:({ownerState:e,size:t})=>e.multiline&&"small"===t,style:{paddingTop:1}},{props:({ownerState:e})=>e.fullWidth,style:{width:"100%"}}]}))),Yu=ru("input",{name:"MuiInputBase",slot:"Input",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.input,"small"===r.size&&t.inputSizeSmall,r.multiline&&t.inputMultiline,"search"===r.type&&t.inputTypeSearch,r.startAdornment&&t.inputAdornedStart,r.endAdornment&&t.inputAdornedEnd,r.hiddenLabel&&t.inputHiddenLabel]}})(nu(({theme:e})=>{const t="light"===e.palette.mode,r={color:"currentColor",...e.vars?{opacity:e.vars.opacity.inputPlaceholder}:{opacity:t?.42:.5},transition:e.transitions.create("opacity",{duration:e.transitions.duration.shorter})},i={opacity:"0 !important"},n=e.vars?{opacity:e.vars.opacity.inputPlaceholder}:{opacity:t?.42:.5};return{font:"inherit",letterSpacing:"inherit",color:"currentColor",padding:"4px 0 5px",border:0,boxSizing:"content-box",background:"none",height:"1.4375em",margin:0,WebkitTapHighlightColor:"transparent",display:"block",minWidth:0,width:"100%","&::-webkit-input-placeholder":r,"&::-moz-placeholder":r,"&::-ms-input-placeholder":r,"&:focus":{outline:0},"&:invalid":{boxShadow:"none"},"&::-webkit-search-decoration":{WebkitAppearance:"none"},[`label[data-shrink=false] + .${Ju.formControl} &`]:{"&::-webkit-input-placeholder":i,"&::-moz-placeholder":i,"&::-ms-input-placeholder":i,"&:focus::-webkit-input-placeholder":n,"&:focus::-moz-placeholder":n,"&:focus::-ms-input-placeholder":n},[`&.${Ju.disabled}`]:{opacity:1,WebkitTextFillColor:(e.vars||e).palette.text.disabled},variants:[{props:({ownerState:e})=>!e.disableInjectingGlobalStyles,style:{animationName:"mui-auto-fill-cancel",animationDuration:"10ms","&:-webkit-autofill":{animationDuration:"5000s",animationName:"mui-auto-fill"}}},{props:{size:"small"},style:{paddingTop:1}},{props:({ownerState:e})=>e.multiline,style:{height:"auto",resize:"none",padding:0,paddingTop:0}},{props:{type:"search"},style:{MozAppearance:"textfield"}}]}})),Xu=(th={"@keyframes mui-auto-fill":{from:{display:"block"}},"@keyframes mui-auto-fill-cancel":{from:{display:"block"}}},function(e){return(0,su.jsx)(Wu,{styles:"function"==typeof th?t=>th({theme:t,...e}):th})}),Zu=e.forwardRef(function(t,r){const i=cu({props:t,name:"MuiInputBase"}),{"aria-describedby":n,autoComplete:o,autoFocus:s,className:a,color:c,components:u={},componentsProps:h={},defaultValue:d,disabled:l,disableInjectingGlobalStyles:p,endAdornment:f,error:v,fullWidth:g=!1,id:m,inputComponent:y="input",inputProps:b={},inputRef:S,margin:C,maxRows:w,minRows:P,multiline:A=!1,name:I,onBlur:R,onChange:E,onClick:T,onFocus:M,onKeyDown:k,onKeyUp:O,placeholder:_,readOnly:x,renderSuffix:N,rows:D,size:z,slotProps:L={},slots:B={},startAdornment:F,type:j="text",value:U,...q}=i,W=null!=b.value?b.value:U,{current:K}=e.useRef(null!=W),H=e.useRef(),V=e.useCallback(e=>{},[]),G=Ku(H,S,b.ref,V),[J,$]=e.useState(!1),Q=e.useContext(Ou),Y=function({props:e,states:t,muiFormControl:r}){return t.reduce((t,i)=>(t[i]=e[i],r&&void 0===e[i]&&(t[i]=r[i]),t),{})}({props:i,muiFormControl:Q,states:["color","disabled","error","hiddenLabel","size","required","filled"]});Y.focused=Q?Q.focused:J,e.useEffect(()=>{!Q&&l&&J&&($(!1),R&&R())},[Q,l,J,R]);const X=Q&&Q.onFilled,Z=Q&&Q.onEmpty,ee=e.useCallback(e=>{!function(e,t=!1){return e&&(Vu(e.value)&&""!==e.value||t&&Vu(e.defaultValue)&&""!==e.defaultValue)}(e)?Z&&Z():X&&X()},[X,Z]);Hu(()=>{K&&ee({value:W})},[W,ee,K]),e.useEffect(()=>{ee(H.current)},[]);let te=y,re=b;A&&"input"===te&&(re=D?{type:void 0,minRows:D,maxRows:D,...re}:{type:void 0,maxRows:w,minRows:P,...re},te=Mu),e.useEffect(()=>{Q&&Q.setAdornedStart(Boolean(F))},[Q,F]);const ie={...i,color:Y.color||"primary",disabled:Y.disabled,endAdornment:f,error:Y.error,focused:Y.focused,formControl:Q,fullWidth:g,hiddenLabel:Y.hiddenLabel,multiline:A,size:Y.size,startAdornment:F,type:j},ne=(e=>{const{classes:t,color:r,disabled:i,error:n,endAdornment:o,focused:s,formControl:a,fullWidth:c,hiddenLabel:u,multiline:h,readOnly:d,size:l,startAdornment:p,type:f}=e;return yn({root:["root",`color${Cn(r)}`,i&&"disabled",n&&"error",c&&"fullWidth",s&&"focused",a&&"formControl",l&&"medium"!==l&&`size${Cn(l)}`,h&&"multiline",p&&"adornedStart",o&&"adornedEnd",u&&"hiddenLabel",d&&"readOnly"],input:["input",i&&"disabled","search"===f&&"inputTypeSearch",h&&"inputMultiline","small"===l&&"inputSizeSmall",u&&"inputHiddenLabel",p&&"inputAdornedStart",o&&"inputAdornedEnd",d&&"readOnly"]},Gu,t)})(ie),oe=B.root||u.Root||Qu,se=L.root||h.root||{},ae=B.input||u.Input||Yu;return re={...re,...L.input??h.input},(0,su.jsxs)(e.Fragment,{children:[!p&&"function"==typeof Xu&&($u||($u=(0,su.jsx)(Xu,{}))),(0,su.jsxs)(oe,{...se,ref:r,onClick:e=>{H.current&&e.currentTarget===e.target&&H.current.focus(),T&&T(e)},...q,...!ku(oe)&&{ownerState:{...ie,...se.ownerState}},className:mn(ne.root,se.className,a,x&&"MuiInputBase-readOnly"),children:[F,(0,su.jsx)(Ou.Provider,{value:null,children:(0,su.jsx)(ae,{"aria-invalid":Y.error,"aria-describedby":n,autoComplete:o,autoFocus:s,defaultValue:d,disabled:Y.disabled,id:m,onAnimationStart:e=>{ee("mui-auto-fill-cancel"===e.animationName?H.current:{value:"x"})},name:I,placeholder:_,readOnly:x,required:Y.required,rows:D,value:W,onKeyDown:k,onKeyUp:O,type:j,...re,...!ku(ae)&&{as:te,ownerState:{...ie,...re.ownerState}},ref:G,className:mn(ne.input,re.className,x&&"MuiInputBase-readOnly"),onBlur:e=>{R&&R(e),b.onBlur&&b.onBlur(e),Q&&Q.onBlur?Q.onBlur(e):$(!1)},onChange:(e,...t)=>{if(!K){const t=e.target||H.current;if(null==t)throw new Error(bn(1));ee({value:t.value})}b.onChange&&b.onChange(e,...t),E&&E(e,...t)},onFocus:e=>{M&&M(e),b.onFocus&&b.onFocus(e),Q&&Q.onFocus?Q.onFocus(e):$(!0)}})}),f,N?N({...Y,startAdornment:F}):null]})]})}),eh=Zu;var th;let rh=0;const ih={...t}.useId;function nh(e=[]){return([,t])=>t&&function(e,t=[]){if(!function(e){return"string"==typeof e.main}(e))return!1;for(const r of t)if(!e.hasOwnProperty(r)||"string"!=typeof e[r])return!1;return!0}(t,e)}function oh(e){try{return e.matches(":focus-visible")}catch(e){}return!1}const sh=Pu,ah={};function ch(t,r){const i=e.useRef(ah);return i.current===ah&&(i.current=t(r)),i}class uh{static create(){return new uh}static use(){const t=ch(uh.create).current,[r,i]=e.useState(!1);return t.shouldMount=r,t.setShouldMount=i,e.useEffect(t.mountEffect,[r]),t}constructor(){this.ref={current:null},this.mounted=null,this.didMount=!1,this.shouldMount=!1,this.setShouldMount=null}mount(){return this.mounted||(this.mounted=function(){let e,t;const r=new Promise((r,i)=>{e=r,t=i});return r.resolve=e,r.reject=t,r}(),this.shouldMount=!0,this.setShouldMount(this.shouldMount)),this.mounted}mountEffect=()=>{this.shouldMount&&!this.didMount&&null!==this.ref.current&&(this.didMount=!0,this.mounted.resolve())};start(...e){this.mount().then(()=>this.ref.current?.start(...e))}stop(...e){this.mount().then(()=>this.ref.current?.stop(...e))}pulsate(...e){this.mount().then(()=>this.ref.current?.pulsate(...e))}}function hh(e,t){return hh=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},hh(e,t)}const dh=r().createContext(null);function lh(t,r){var i=Object.create(null);return t&&e.Children.map(t,function(e){return e}).forEach(function(t){i[t.key]=function(t){return r&&(0,e.isValidElement)(t)?r(t):t}(t)}),i}function ph(e,t,r){return null!=r[t]?r[t]:e.props[t]}function fh(t,r,i){var n=lh(t.children),o=function(e,t){function r(r){return r in t?t[r]:e[r]}e=e||{},t=t||{};var i,n=Object.create(null),o=[];for(var s in e)s in t?o.length&&(n[s]=o,o=[]):o.push(s);var a={};for(var c in t){if(n[c])for(i=0;i<n[c].length;i++){var u=n[c][i];a[n[c][i]]=r(u)}a[c]=r(c)}for(i=0;i<o.length;i++)a[o[i]]=r(o[i]);return a}(r,n);return Object.keys(o).forEach(function(s){var a=o[s];if((0,e.isValidElement)(a)){var c=s in r,u=s in n,h=r[s],d=(0,e.isValidElement)(h)&&!h.props.in;!u||c&&!d?u||!c||d?u&&c&&(0,e.isValidElement)(h)&&(o[s]=(0,e.cloneElement)(a,{onExited:i.bind(null,a),in:h.props.in,exit:ph(a,"exit",t),enter:ph(a,"enter",t)})):o[s]=(0,e.cloneElement)(a,{in:!1}):o[s]=(0,e.cloneElement)(a,{onExited:i.bind(null,a),in:!0,exit:ph(a,"exit",t),enter:ph(a,"enter",t)})}}),o}var vh=Object.values||function(e){return Object.keys(e).map(function(t){return e[t]})},gh=function(t){var i,n;function o(e,r){var i,n=(i=t.call(this,e,r)||this).handleExited.bind(function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(i));return i.state={contextValue:{isMounting:!0},handleExited:n,firstRender:!0},i}n=t,(i=o).prototype=Object.create(n.prototype),i.prototype.constructor=i,hh(i,n);var s=o.prototype;return s.componentDidMount=function(){this.mounted=!0,this.setState({contextValue:{isMounting:!1}})},s.componentWillUnmount=function(){this.mounted=!1},o.getDerivedStateFromProps=function(t,r){var i,n,o=r.children,s=r.handleExited;return{children:r.firstRender?(i=t,n=s,lh(i.children,function(t){return(0,e.cloneElement)(t,{onExited:n.bind(null,t),in:!0,appear:ph(t,"appear",i),enter:ph(t,"enter",i),exit:ph(t,"exit",i)})})):fh(t,o,s),firstRender:!1}},s.handleExited=function(e,t){var r=lh(this.props.children);e.key in r||(e.props.onExited&&e.props.onExited(t),this.mounted&&this.setState(function(t){var r=wn({},t.children);return delete r[e.key],{children:r}}))},s.render=function(){var e=this.props,t=e.component,i=e.childFactory,n=function(e,t){if(null==e)return{};var r={};for(var i in e)if({}.hasOwnProperty.call(e,i)){if(-1!==t.indexOf(i))continue;r[i]=e[i]}return r}(e,["component","childFactory"]),o=this.state.contextValue,s=vh(this.state.children).map(i);return delete n.appear,delete n.enter,delete n.exit,null===t?r().createElement(dh.Provider,{value:o},s):r().createElement(dh.Provider,{value:o},r().createElement(t,n,s))},o}(r().Component);gh.propTypes={},gh.defaultProps={component:"div",childFactory:function(e){return e}};const mh=gh,yh=[];class bh{static create(){return new bh}currentId=null;start(e,t){this.clear(),this.currentId=setTimeout(()=>{this.currentId=null,t()},e)}clear=()=>{null!==this.currentId&&(clearTimeout(this.currentId),this.currentId=null)};disposeEffect=()=>this.clear}const Sh=pu("MuiTouchRipple",["root","ripple","rippleVisible","ripplePulsate","child","childLeaving","childPulsate"]),Ch=Lu`
3
+ 0% {
4
+ transform: scale(0);
5
+ opacity: 0.1;
6
+ }
7
+
8
+ 100% {
9
+ transform: scale(1);
10
+ opacity: 0.3;
11
+ }
12
+ `,wh=Lu`
13
+ 0% {
14
+ opacity: 1;
15
+ }
16
+
17
+ 100% {
18
+ opacity: 0;
19
+ }
20
+ `,Ph=Lu`
21
+ 0% {
22
+ transform: scale(1);
23
+ }
24
+
25
+ 50% {
26
+ transform: scale(0.92);
27
+ }
28
+
29
+ 100% {
30
+ transform: scale(1);
31
+ }
32
+ `,Ah=ru("span",{name:"MuiTouchRipple",slot:"Root"})({overflow:"hidden",pointerEvents:"none",position:"absolute",zIndex:0,top:0,right:0,bottom:0,left:0,borderRadius:"inherit"}),Ih=ru(function(t){const{className:r,classes:i,pulsate:n=!1,rippleX:o,rippleY:s,rippleSize:a,in:c,onExited:u,timeout:h}=t,[d,l]=e.useState(!1),p=mn(r,i.ripple,i.rippleVisible,n&&i.ripplePulsate),f={width:a,height:a,top:-a/2+s,left:-a/2+o},v=mn(i.child,d&&i.childLeaving,n&&i.childPulsate);return c||d||l(!0),e.useEffect(()=>{if(!c&&null!=u){const e=setTimeout(u,h);return()=>{clearTimeout(e)}}},[u,c,h]),(0,su.jsx)("span",{className:p,style:f,children:(0,su.jsx)("span",{className:v})})},{name:"MuiTouchRipple",slot:"Ripple"})`
33
+ opacity: 0;
34
+ position: absolute;
35
+
36
+ &.${Sh.rippleVisible} {
37
+ opacity: 0.3;
38
+ transform: scale(1);
39
+ animation-name: ${Ch};
40
+ animation-duration: ${550}ms;
41
+ animation-timing-function: ${({theme:e})=>e.transitions.easing.easeInOut};
42
+ }
43
+
44
+ &.${Sh.ripplePulsate} {
45
+ animation-duration: ${({theme:e})=>e.transitions.duration.shorter}ms;
46
+ }
47
+
48
+ & .${Sh.child} {
49
+ opacity: 1;
50
+ display: block;
51
+ width: 100%;
52
+ height: 100%;
53
+ border-radius: 50%;
54
+ background-color: currentColor;
55
+ }
56
+
57
+ & .${Sh.childLeaving} {
58
+ opacity: 0;
59
+ animation-name: ${wh};
60
+ animation-duration: ${550}ms;
61
+ animation-timing-function: ${({theme:e})=>e.transitions.easing.easeInOut};
62
+ }
63
+
64
+ & .${Sh.childPulsate} {
65
+ position: absolute;
66
+ /* @noflip */
67
+ left: 0px;
68
+ top: 0;
69
+ animation-name: ${Ph};
70
+ animation-duration: 2500ms;
71
+ animation-timing-function: ${({theme:e})=>e.transitions.easing.easeInOut};
72
+ animation-iteration-count: infinite;
73
+ animation-delay: 200ms;
74
+ }
75
+ `,Rh=e.forwardRef(function(t,r){const i=cu({props:t,name:"MuiTouchRipple"}),{center:n=!1,classes:o={},className:s,...a}=i,[c,u]=e.useState([]),h=e.useRef(0),d=e.useRef(null);e.useEffect(()=>{d.current&&(d.current(),d.current=null)},[c]);const l=e.useRef(!1),p=function(){const t=ch(bh.create).current;var r;return r=t.disposeEffect,e.useEffect(r,yh),t}(),f=e.useRef(null),v=e.useRef(null),g=e.useCallback(e=>{const{pulsate:t,rippleX:r,rippleY:i,rippleSize:n,cb:s}=e;u(e=>[...e,(0,su.jsx)(Ih,{classes:{ripple:mn(o.ripple,Sh.ripple),rippleVisible:mn(o.rippleVisible,Sh.rippleVisible),ripplePulsate:mn(o.ripplePulsate,Sh.ripplePulsate),child:mn(o.child,Sh.child),childLeaving:mn(o.childLeaving,Sh.childLeaving),childPulsate:mn(o.childPulsate,Sh.childPulsate)},timeout:550,pulsate:t,rippleX:r,rippleY:i,rippleSize:n},h.current)]),h.current+=1,d.current=s},[o]),m=e.useCallback((e={},t={},r=()=>{})=>{const{pulsate:i=!1,center:o=n||t.pulsate,fakeElement:s=!1}=t;if("mousedown"===e?.type&&l.current)return void(l.current=!1);"touchstart"===e?.type&&(l.current=!0);const a=s?null:v.current,c=a?a.getBoundingClientRect():{width:0,height:0,left:0,top:0};let u,h,d;if(o||void 0===e||0===e.clientX&&0===e.clientY||!e.clientX&&!e.touches)u=Math.round(c.width/2),h=Math.round(c.height/2);else{const{clientX:t,clientY:r}=e.touches&&e.touches.length>0?e.touches[0]:e;u=Math.round(t-c.left),h=Math.round(r-c.top)}if(o)d=Math.sqrt((2*c.width**2+c.height**2)/3),d%2==0&&(d+=1);else{const e=2*Math.max(Math.abs((a?a.clientWidth:0)-u),u)+2,t=2*Math.max(Math.abs((a?a.clientHeight:0)-h),h)+2;d=Math.sqrt(e**2+t**2)}e?.touches?null===f.current&&(f.current=()=>{g({pulsate:i,rippleX:u,rippleY:h,rippleSize:d,cb:r})},p.start(80,()=>{f.current&&(f.current(),f.current=null)})):g({pulsate:i,rippleX:u,rippleY:h,rippleSize:d,cb:r})},[n,g,p]),y=e.useCallback(()=>{m({},{pulsate:!0})},[m]),b=e.useCallback((e,t)=>{if(p.clear(),"touchend"===e?.type&&f.current)return f.current(),f.current=null,void p.start(0,()=>{b(e,t)});f.current=null,u(e=>e.length>0?e.slice(1):e),d.current=t},[p]);return e.useImperativeHandle(r,()=>({pulsate:y,start:m,stop:b}),[y,m,b]),(0,su.jsx)(Ah,{className:mn(Sh.root,o.root,s),ref:v,...a,children:(0,su.jsx)(mh,{component:null,exit:!0,children:c})})});function Eh(e){return lu("MuiButtonBase",e)}const Th=pu("MuiButtonBase",["root","disabled","focusVisible"]),Mh=ru("button",{name:"MuiButtonBase",slot:"Root"})({display:"inline-flex",alignItems:"center",justifyContent:"center",position:"relative",boxSizing:"border-box",WebkitTapHighlightColor:"transparent",backgroundColor:"transparent",outline:0,border:0,margin:0,borderRadius:0,padding:0,cursor:"pointer",userSelect:"none",verticalAlign:"middle",MozAppearance:"none",WebkitAppearance:"none",textDecoration:"none",color:"inherit","&::-moz-focus-inner":{borderStyle:"none"},[`&.${Th.disabled}`]:{pointerEvents:"none",cursor:"default"},"@media print":{colorAdjust:"exact"}});function kh(e,t,r,i=!1){return sh(n=>(r&&r(n),i||e[t](n),!0))}const Oh=e.forwardRef(function(t,r){const i=cu({props:t,name:"MuiButtonBase"}),{action:n,centerRipple:o=!1,children:s,className:a,component:c="button",disabled:u=!1,disableRipple:h=!1,disableTouchRipple:d=!1,focusRipple:l=!1,focusVisibleClassName:p,LinkComponent:f="a",onBlur:v,onClick:g,onContextMenu:m,onDragLeave:y,onFocus:b,onFocusVisible:S,onKeyDown:C,onKeyUp:w,onMouseDown:P,onMouseLeave:A,onMouseUp:I,onTouchEnd:R,onTouchMove:E,onTouchStart:T,tabIndex:M=0,TouchRippleProps:k,touchRippleRef:O,type:_,...x}=i,N=e.useRef(null),D=uh.use(),z=Ku(D.ref,O),[L,B]=e.useState(!1);u&&L&&B(!1),e.useImperativeHandle(n,()=>({focusVisible:()=>{B(!0),N.current.focus()}}),[]);const F=D.shouldMount&&!h&&!u;e.useEffect(()=>{L&&l&&!h&&D.pulsate()},[h,l,L,D]);const j=kh(D,"start",P,d),U=kh(D,"stop",m,d),q=kh(D,"stop",y,d),W=kh(D,"stop",I,d),K=kh(D,"stop",e=>{L&&e.preventDefault(),A&&A(e)},d),H=kh(D,"start",T,d),V=kh(D,"stop",R,d),G=kh(D,"stop",E,d),J=kh(D,"stop",e=>{oh(e.target)||B(!1),v&&v(e)},!1),$=sh(e=>{N.current||(N.current=e.currentTarget),oh(e.target)&&(B(!0),S&&S(e)),b&&b(e)}),Q=()=>{const e=N.current;return c&&"button"!==c&&!("A"===e.tagName&&e.href)},Y=sh(e=>{l&&!e.repeat&&L&&" "===e.key&&D.stop(e,()=>{D.start(e)}),e.target===e.currentTarget&&Q()&&" "===e.key&&e.preventDefault(),C&&C(e),e.target===e.currentTarget&&Q()&&"Enter"===e.key&&!u&&(e.preventDefault(),g&&g(e))}),X=sh(e=>{l&&" "===e.key&&L&&!e.defaultPrevented&&D.stop(e,()=>{D.pulsate(e)}),w&&w(e),g&&e.target===e.currentTarget&&Q()&&" "===e.key&&!e.defaultPrevented&&g(e)});let Z=c;"button"===Z&&(x.href||x.to)&&(Z=f);const ee={};"button"===Z?(ee.type=void 0===_?"button":_,ee.disabled=u):(x.href||x.to||(ee.role="button"),u&&(ee["aria-disabled"]=u));const te=Ku(r,N),re={...i,centerRipple:o,component:c,disabled:u,disableRipple:h,disableTouchRipple:d,focusRipple:l,tabIndex:M,focusVisible:L},ie=(e=>{const{disabled:t,focusVisible:r,focusVisibleClassName:i,classes:n}=e,o=yn({root:["root",t&&"disabled",r&&"focusVisible"]},Eh,n);return r&&i&&(o.root+=` ${i}`),o})(re);return(0,su.jsxs)(Mh,{as:Z,className:mn(ie.root,a),ownerState:re,onBlur:J,onClick:g,onContextMenu:U,onFocus:$,onKeyDown:Y,onKeyUp:X,onMouseDown:j,onMouseLeave:K,onMouseUp:W,onDragLeave:q,onTouchEnd:V,onTouchMove:G,onTouchStart:H,ref:te,tabIndex:u?-1:M,type:_,...ee,...x,children:[s,F?(0,su.jsx)(Rh,{ref:z,center:o,...k}):null]})});function _h(e){return lu("MuiCircularProgress",e)}pu("MuiCircularProgress",["root","determinate","indeterminate","colorPrimary","colorSecondary","svg","circle","circleDeterminate","circleIndeterminate","circleDisableShrink"]);const xh=Lu`
76
+ 0% {
77
+ transform: rotate(0deg);
78
+ }
79
+
80
+ 100% {
81
+ transform: rotate(360deg);
82
+ }
83
+ `,Nh=Lu`
84
+ 0% {
85
+ stroke-dasharray: 1px, 200px;
86
+ stroke-dashoffset: 0;
87
+ }
88
+
89
+ 50% {
90
+ stroke-dasharray: 100px, 200px;
91
+ stroke-dashoffset: -15px;
92
+ }
93
+
94
+ 100% {
95
+ stroke-dasharray: 1px, 200px;
96
+ stroke-dashoffset: -126px;
97
+ }
98
+ `,Dh="string"!=typeof xh?zu`
99
+ animation: ${xh} 1.4s linear infinite;
100
+ `:null,zh="string"!=typeof Nh?zu`
101
+ animation: ${Nh} 1.4s ease-in-out infinite;
102
+ `:null,Lh=ru("span",{name:"MuiCircularProgress",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,t[r.variant],t[`color${Cn(r.color)}`]]}})(nu(({theme:e})=>({display:"inline-block",variants:[{props:{variant:"determinate"},style:{transition:e.transitions.create("transform")}},{props:{variant:"indeterminate"},style:Dh||{animation:`${xh} 1.4s linear infinite`}},...Object.entries(e.palette).filter(nh()).map(([t])=>({props:{color:t},style:{color:(e.vars||e).palette[t].main}}))]}))),Bh=ru("svg",{name:"MuiCircularProgress",slot:"Svg"})({display:"block"}),Fh=ru("circle",{name:"MuiCircularProgress",slot:"Circle",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.circle,t[`circle${Cn(r.variant)}`],r.disableShrink&&t.circleDisableShrink]}})(nu(({theme:e})=>({stroke:"currentColor",variants:[{props:{variant:"determinate"},style:{transition:e.transitions.create("stroke-dashoffset")}},{props:{variant:"indeterminate"},style:{strokeDasharray:"80px, 200px",strokeDashoffset:0}},{props:({ownerState:e})=>"indeterminate"===e.variant&&!e.disableShrink,style:zh||{animation:`${Nh} 1.4s ease-in-out infinite`}}]}))),jh=e.forwardRef(function(e,t){const r=cu({props:e,name:"MuiCircularProgress"}),{className:i,color:n="primary",disableShrink:o=!1,size:s=40,style:a,thickness:c=3.6,value:u=0,variant:h="indeterminate",...d}=r,l={...r,color:n,disableShrink:o,size:s,thickness:c,value:u,variant:h},p=(e=>{const{classes:t,variant:r,color:i,disableShrink:n}=e;return yn({root:["root",r,`color${Cn(i)}`],svg:["svg"],circle:["circle",`circle${Cn(r)}`,n&&"circleDisableShrink"]},_h,t)})(l),f={},v={},g={};if("determinate"===h){const e=2*Math.PI*((44-c)/2);f.strokeDasharray=e.toFixed(3),g["aria-valuenow"]=Math.round(u),f.strokeDashoffset=`${((100-u)/100*e).toFixed(3)}px`,v.transform="rotate(-90deg)"}return(0,su.jsx)(Lh,{className:mn(p.root,i),style:{width:s,height:s,...v,...a},ownerState:l,ref:t,role:"progressbar",...g,...d,children:(0,su.jsx)(Bh,{className:p.svg,ownerState:l,viewBox:"22 22 44 44",children:(0,su.jsx)(Fh,{className:p.circle,style:f,ownerState:l,cx:44,cy:44,r:(44-c)/2,fill:"none",strokeWidth:c})})})});function Uh(e){return lu("MuiIconButton",e)}const qh=pu("MuiIconButton",["root","disabled","colorInherit","colorPrimary","colorSecondary","colorError","colorInfo","colorSuccess","colorWarning","edgeStart","edgeEnd","sizeSmall","sizeMedium","sizeLarge","loading","loadingIndicator","loadingWrapper"]),Wh=ru(Oh,{name:"MuiIconButton",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,r.loading&&t.loading,"default"!==r.color&&t[`color${Cn(r.color)}`],r.edge&&t[`edge${Cn(r.edge)}`],t[`size${Cn(r.size)}`]]}})(nu(({theme:e})=>({textAlign:"center",flex:"0 0 auto",fontSize:e.typography.pxToRem(24),padding:8,borderRadius:"50%",color:(e.vars||e).palette.action.active,transition:e.transitions.create("background-color",{duration:e.transitions.duration.shortest}),variants:[{props:e=>!e.disableRipple,style:{"--IconButton-hoverBg":e.alpha((e.vars||e).palette.action.active,(e.vars||e).palette.action.hoverOpacity),"&:hover":{backgroundColor:"var(--IconButton-hoverBg)","@media (hover: none)":{backgroundColor:"transparent"}}}},{props:{edge:"start"},style:{marginLeft:-12}},{props:{edge:"start",size:"small"},style:{marginLeft:-3}},{props:{edge:"end"},style:{marginRight:-12}},{props:{edge:"end",size:"small"},style:{marginRight:-3}}]})),nu(({theme:e})=>({variants:[{props:{color:"inherit"},style:{color:"inherit"}},...Object.entries(e.palette).filter(nh()).map(([t])=>({props:{color:t},style:{color:(e.vars||e).palette[t].main}})),...Object.entries(e.palette).filter(nh()).map(([t])=>({props:{color:t},style:{"--IconButton-hoverBg":e.alpha((e.vars||e).palette[t].main,(e.vars||e).palette.action.hoverOpacity)}})),{props:{size:"small"},style:{padding:5,fontSize:e.typography.pxToRem(18)}},{props:{size:"large"},style:{padding:12,fontSize:e.typography.pxToRem(28)}}],[`&.${qh.disabled}`]:{backgroundColor:"transparent",color:(e.vars||e).palette.action.disabled},[`&.${qh.loading}`]:{color:"transparent"}}))),Kh=ru("span",{name:"MuiIconButton",slot:"LoadingIndicator"})(({theme:e})=>({display:"none",position:"absolute",visibility:"visible",top:"50%",left:"50%",transform:"translate(-50%, -50%)",color:(e.vars||e).palette.action.disabled,variants:[{props:{loading:!0},style:{display:"flex"}}]})),Hh=e.forwardRef(function(t,r){const i=cu({props:t,name:"MuiIconButton"}),{edge:n=!1,children:o,className:s,color:a="default",disabled:c=!1,disableFocusRipple:u=!1,size:h="medium",id:d,loading:l=null,loadingIndicator:p,...f}=i,v=function(t){if(void 0!==ih){const e=ih();return t??e}return function(t){const[r,i]=e.useState(t),n=t||r;return e.useEffect(()=>{null==r&&(rh+=1,i(`mui-${rh}`))},[r]),n}(t)}(d),g=p??(0,su.jsx)(jh,{"aria-labelledby":v,color:"inherit",size:16}),m={...i,edge:n,color:a,disabled:c,disableFocusRipple:u,loading:l,loadingIndicator:g,size:h},y=(e=>{const{classes:t,disabled:r,color:i,edge:n,size:o,loading:s}=e;return yn({root:["root",s&&"loading",r&&"disabled","default"!==i&&`color${Cn(i)}`,n&&`edge${Cn(n)}`,`size${Cn(o)}`],loadingIndicator:["loadingIndicator"],loadingWrapper:["loadingWrapper"]},Uh,t)})(m);return(0,su.jsxs)(Wh,{id:l?v:d,className:mn(y.root,s),centerRipple:!0,focusRipple:!u,disabled:c||l,ref:r,...f,ownerState:m,children:["boolean"==typeof l&&(0,su.jsx)("span",{className:y.loadingWrapper,style:{display:"contents"},children:(0,su.jsx)(Kh,{className:y.loadingIndicator,ownerState:m,children:l&&g})}),o]})}),Vh=Hh,Gh=()=>{const{inputValue:t,setInputValue:r,isLoading:i,isAITLoading:n,handleSubmit:o,isRecording:s,startRecording:a,stopRecording:c,textInputRef:u,props:{placeholder:h="Type a message..."}}=ln(),d=i||n,l=n?"Loading wallet configuration...":h;return e.createElement("div",{style:{padding:"15px",display:"flex",gap:"10px",borderTop:"1px solid #eee"}},e.createElement(eh,{value:t,onChange:e=>r(e.target.value),onKeyPress:e=>{"Enter"!==e.key||e.shiftKey||(e.preventDefault(),o(e))},placeholder:l,disabled:d,fullWidth:!0,inputProps:{ref:u},endAdornment:e.createElement(Vh,{onClick:()=>s?c():a(),disabled:d},s?e.createElement(bu,null):e.createElement(Su,null)),onFocus:()=>c(),style:{flex:1,padding:"10px",border:"1px solid #ddd",borderRadius:"20px",outline:"none",fontSize:"14px",backgroundColor:d?"#f8f9fa":"#fff"}}),e.createElement("button",{onClick:e=>o(e),disabled:d||!t.trim(),style:{backgroundColor:d||!t.trim()?"#e9ecef":"#007bff",color:d||!t.trim()?"#6c757d":"white",border:"none",padding:"10px 20px",borderRadius:"20px",cursor:d||!t.trim()?"not-allowed":"pointer",fontSize:"14px",fontWeight:"500",transition:"background-color 0.3s",position:"relative",display:"flex",alignItems:"center",justifyContent:"center"},onMouseOver:e=>{!d&&t.trim()&&(e.currentTarget.style.backgroundColor="#0056b3")},onMouseOut:e=>{!d&&t.trim()&&(e.currentTarget.style.backgroundColor="#007bff")}},"Send",(i||n)&&e.createElement("span",{style:{marginLeft:8,display:"flex",alignItems:"center"}},e.createElement("svg",{width:"16",height:"16",viewBox:"0 0 50 50"},e.createElement("circle",{cx:"25",cy:"25",r:"20",fill:"none",stroke:"#fff",strokeWidth:"4",strokeDasharray:"31.4 31.4",strokeLinecap:"round"},e.createElement("animateTransform",{attributeName:"transform",type:"rotate",from:"0 25 25",to:"360 25 25",dur:"1s",repeatCount:"indefinite"}))))))},Jh=()=>{const{suggestions:t,handlePresetMessage:r}=ln();return t&&0!==t.length?e.createElement("div",{style:{padding:"10px 15px",borderTop:"1px solid #eee",overflowX:"auto",whiteSpace:"nowrap",display:"flex",gap:"10px",alignItems:"center"}},t.map((t,i)=>e.createElement("button",{key:i,onClick:()=>r(t),style:{backgroundColor:"#007bff",color:"white",border:"none",borderRadius:"5px",padding:"5px 10px",fontSize:"12px",cursor:"pointer",transition:"background-color 0.3s",whiteSpace:"nowrap",flexShrink:0},onMouseOver:e=>{e.currentTarget.style.backgroundColor="#0056b3"},onMouseOut:e=>{e.currentTarget.style.backgroundColor="#007bff"},onMouseDown:e=>{e.currentTarget.style.backgroundColor="#004085"}},t.text))):null},$h=()=>{const{availableModels:t,selectedModelIndex:r,showModelSelector:i,handleModelChange:n}=ln(),o=r>=t.length?0:r,s=t.length>0?t[0].label:"Unknown",[a,c]=e.useState(null),u=Boolean(a);return i?e.createElement("div",{style:{display:"flex",alignItems:"center"}},e.createElement("div",{style:{display:"flex",alignItems:"center",cursor:"pointer",padding:"4px 8px",borderRadius:"4px",backgroundColor:"rgba(255, 255, 255, 0.1)",transition:"background-color 0.2s",fontSize:"12px",fontWeight:"500"},onClick:e=>{c(e.currentTarget)},onMouseOver:e=>e.currentTarget.style.backgroundColor="rgba(255, 255, 255, 0.2)",onMouseOut:e=>e.currentTarget.style.backgroundColor="rgba(255, 255, 255, 0.1)",title:"Change AI Model"},e.createElement("span",{style:{marginRight:"4px"}},t[o]?.label||s),e.createElement("span",{style:{fontSize:"10px"}},"▼")),u&&e.createElement("div",{style:{position:"absolute",top:"100%",left:"0",backgroundColor:"white",border:"1px solid #ddd",borderRadius:"4px",boxShadow:"0 2px 8px rgba(0,0,0,0.1)",zIndex:1e3,minWidth:"120px",marginTop:"4px"}},t.map((r,i)=>e.createElement("div",{key:r.value,style:{padding:"8px 12px",cursor:"pointer",backgroundColor:i===o?"#f0f0f0":"transparent",color:i===o?"#007bff":"#333",fontSize:"12px",borderBottom:i<t.length-1?"1px solid #eee":"none"},onClick:e=>((e,t)=>{n(t),c(null)})(0,i),onMouseOver:e=>{i!==o&&(e.currentTarget.style.backgroundColor="#f8f9fa")},onMouseOut:e=>{i!==o&&(e.currentTarget.style.backgroundColor="transparent")}},r.label))),u&&e.createElement("div",{style:{position:"fixed",top:0,left:0,right:0,bottom:0,zIndex:999},onClick:()=>{c(null)}})):null},Qh=({type:t,message:r,onClose:i,isChatOpen:n=!1})=>e.createElement("div",{style:(()=>{const e={position:"fixed",padding:"12px 24px",borderRadius:8,zIndex:2e3,fontWeight:600,boxShadow:"0 4px 12px rgba(0, 0, 0, 0.15)",transition:"all 0.3s ease",display:"flex",alignItems:"center",gap:"12px",minWidth:"300px",maxWidth:"500px"};switch(n?Object.assign(e,{top:20,right:20,maxWidth:"480px"}):Object.assign(e,{bottom:20,right:20}),t){case"success":return{...e,background:"#4caf50",color:"white"};case"error":return{...e,background:"#f44336",color:"white"};case"warning":return{...e,background:"#ff9800",color:"white"};default:return{...e,background:"#2196f3",color:"white"}}})()},e.createElement("span",{style:{fontSize:"18px"}},(()=>{switch(t){case"success":return"✅";case"error":return"❌";case"warning":return"⚠️";default:return"ℹ️"}})()),e.createElement("span",{style:{flex:1}},r),e.createElement("button",{onClick:i,style:{background:"none",border:"none",color:"white",fontSize:"18px",cursor:"pointer",padding:"4px",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"4px",transition:"background-color 0.2s"},onMouseOver:e=>e.currentTarget.style.backgroundColor="rgba(255, 255, 255, 0.2)",onMouseOut:e=>e.currentTarget.style.backgroundColor="transparent"},"×")),Yh=()=>{const{isOpen:t,setIsOpen:r,showPermissionForm:i,setShowPermissionForm:n,notification:o,setNotification:s,isAITLoading:a,props:{className:c=""}}=ln();e.useEffect(()=>{const e=document.createElement("style");return e.textContent="\n @keyframes spin {\n 0% { transform: rotate(0deg); }\n 100% { transform: rotate(360deg); }\n }\n ",document.head.appendChild(e),()=>{document.head.removeChild(e)}},[]);const u=()=>{s(e=>({...e,show:!1}))};return t?e.createElement(e.Fragment,null,e.createElement("div",{style:{position:"fixed",bottom:"20px",right:"20px",width:"500px",height:"600px",backgroundColor:"white",borderRadius:"10px",boxShadow:"0 5px 15px rgba(0,0,0,0.2)",display:"flex",flexDirection:"column",zIndex:1001,overflow:"hidden"},className:c},e.createElement("div",{style:{padding:"15px",backgroundColor:"#007bff",color:"white",borderRadius:"10px 10px 0 0",display:"flex",justifyContent:"space-between",alignItems:"center"}},e.createElement("div",{style:{display:"flex",alignItems:"center",gap:"10px"}},e.createElement("h3",{style:{margin:0,fontSize:"16px",fontWeight:"600"}},"AI Agent"),e.createElement("div",{style:{position:"relative"}},e.createElement($h,null)),a&&e.createElement("div",{style:{display:"flex",alignItems:"center",gap:"5px",fontSize:"12px",opacity:"0.8"}},e.createElement("div",{style:{width:"12px",height:"12px",border:"2px solid rgba(255, 255, 255, 0.3)",borderTop:"2px solid white",borderRadius:"50%",animation:"spin 1s linear infinite"}}),"Loading...")),e.createElement("div",{style:{display:"flex",alignItems:"center",gap:"10px"}},e.createElement("button",{onClick:()=>{n(!0)},style:{background:"none",border:"none",color:"white",fontSize:"16px",cursor:"pointer",padding:"4px",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"4px",transition:"background-color 0.2s"},onMouseOver:e=>e.currentTarget.style.backgroundColor="rgba(255, 255, 255, 0.2)",onMouseOut:e=>e.currentTarget.style.backgroundColor="transparent",title:"AIT Settings"},"⚙️"),e.createElement("button",{onClick:()=>{r(!1)},style:{background:"none",border:"none",color:"white",fontSize:"24px",cursor:"pointer",padding:"0",display:"flex",alignItems:"center",justifyContent:"center"}},"×"))),e.createElement(vn,null),e.createElement(Jh,null),e.createElement(Gh,null)),i&&e.createElement("div",{style:{position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0, 0, 0, 0.5)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:1002}},e.createElement(fn,{onClose:()=>n(!1),onOpen:()=>n(!0)})),o.show&&e.createElement(Qh,{type:o.type,message:o.message,onClose:u,isChatOpen:t})):e.createElement(e.Fragment,null,e.createElement("button",{onClick:()=>{r(!0)},style:{position:"fixed",bottom:"20px",right:"20px",backgroundColor:"#007bff",color:"white",border:"none",padding:"10px 20px",borderRadius:"20px",cursor:"pointer",boxShadow:"0 2px 5px rgba(0,0,0,0.2)",transition:"all 0.3s ease",zIndex:1e3,fontSize:"14px",fontWeight:"500"},onMouseOver:e=>{e.currentTarget.style.backgroundColor="#0056b3",e.currentTarget.style.transform="translateY(-2px)"},onMouseOut:e=>{e.currentTarget.style.backgroundColor="#007bff",e.currentTarget.style.transform="translateY(0)"},title:"Open AI Agent Chat"},"AI Agent"),o.show&&e.createElement(Qh,{type:o.type,message:o.message,onClose:u,isChatOpen:t}))},Xh=(e,t,r=5e3)=>({show:!0,type:e,message:t,autoHide:!0,duration:r}),Zh=e=>{switch(e){case"success":return"✅";case"error":return"❌";case"warning":return"⚠️";default:return"ℹ️"}},ed=e=>`did:polygon:nxtlinq:${e}:${Math.floor(Date.now()/1e3)}`,td=(e,t)=>({model:"gpt-4",permissions:e,issuedBy:t}),rd={ChatBot:t=>e.createElement(pn,{...t},e.createElement(Yh,null)),ChatBotProvider:pn,useChatBot:ln,ChatBotUI:Yh,MessageInput:Gh,MessageList:vn,ModelSelector:$h,NotificationModal:({type:t,title:r,message:i,onClose:n,onConfirm:o,showConfirm:s=!1,confirmText:a="Confirm",cancelText:c="Cancel"})=>{const u=Zh(t);return Xh(t,i),e.createElement("div",{style:{position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0, 0, 0, 0.5)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:1e3}},e.createElement("div",{style:{backgroundColor:"white",padding:"24px",borderRadius:"12px",width:"400px",maxWidth:"90%",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.1)",textAlign:"center"}},e.createElement("div",{style:{fontSize:"48px",marginBottom:"16px"}},u),e.createElement("h3",{style:{margin:"0 0 12px 0",fontSize:"20px",fontWeight:"600",color:"#1a1a1a"}},r),e.createElement("p",{style:{margin:"0 0 24px 0",fontSize:"16px",color:"#666",lineHeight:"1.5"}},i),e.createElement("div",{style:{display:"flex",justifyContent:"center",gap:"12px"}},s&&o&&e.createElement("button",{onClick:o,style:{padding:"10px 20px",backgroundColor:"error"===t?"#dc3545":"#007bff",color:"white",border:"none",borderRadius:"8px",cursor:"pointer",fontSize:"14px",fontWeight:"500",transition:"background-color 0.2s"},onMouseOver:e=>e.currentTarget.style.backgroundColor="error"===t?"#c82333":"#0056b3",onMouseOut:e=>e.currentTarget.style.backgroundColor="error"===t?"#dc3545":"#007bff"},a),e.createElement("button",{onClick:n,style:{padding:"10px 20px",backgroundColor:s?"#f8f9fa":"#007bff",color:s?"#666":"white",border:s?"1px solid #dee2e6":"none",borderRadius:"8px",cursor:"pointer",fontSize:"14px",fontWeight:"500",transition:"all 0.2s"},onMouseOver:e=>{s?(e.currentTarget.style.backgroundColor="#e9ecef",e.currentTarget.style.borderColor="#ced4da"):e.currentTarget.style.backgroundColor="#0056b3"},onMouseOut:e=>{s?(e.currentTarget.style.backgroundColor="#f8f9fa",e.currentTarget.style.borderColor="#dee2e6"):e.currentTarget.style.backgroundColor="#007bff"}},c))))},PermissionForm:fn,PresetMessages:Jh,connectWallet:async()=>{if("undefined"==typeof window)throw new Error("Web3 is not available in server-side rendering");const e=await an.ethereum;if(!e)throw new Error("Web3 provider not available");await e.enable();const t=new ki(e),r=await t.getSigner(),i=await r.getAddress();return localStorage.setItem("walletAddress",i),{address:i,signer:r}},disconnectWallet:()=>{localStorage.removeItem("walletAddress")},validateToken:(e,t)=>{try{const r=JSON.parse(atob(e.split(".")[1]));return!(1e3*r.exp<Date.now())&&r.address===t}catch(e){return console.error("Error parsing token:",e),!1}},createAITMetadata:td,generateAITId:ed,prepareAITCreation:(e,t,r,i=!1,n)=>{const o=ed(e),s=td(t,e),a=(e=>ue(Oe(_i()(e))))(s);return{aitId:o,metadata:s,metadataHash:a,createAITParams:{aitId:o,controller:e,serviceId:r,metadataHash:a,metadataCid:"",isFromAIAgent:i,parentAITId:n}}},createNotification:Xh,getNotificationIcon:Zh,createNxtlinqApi:Ji,useLocalStorage:$i,AI_MODEL_MAP:{"gpt-4":"gpt-4","gpt-3.5-turbo":"gpt-3.5-turbo","claude-3-opus":"claude-3-opus","claude-3-sonnet":"claude-3-sonnet","claude-3-haiku":"claude-3-haiku"},ALL_AVAILABLE_MODELS:["gpt-4","gpt-3.5-turbo","claude-3-opus","claude-3-sonnet","claude-3-haiku"],DEFAULT_AI_MODELS:["gpt-4","gpt-3.5-turbo","claude-3-opus","claude-3-sonnet","claude-3-haiku"]},id=rd})(),s.default})());