@botfabrik/engine-webclient 4.100.4 → 4.100.7
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.
|
@@ -99,7 +99,7 @@ For more details see https://formatjs.github.io/docs/getting-started/message-dis
|
|
|
99
99
|
`).map(function(g){return Pb(g,h,m,!0)})})(n[3],a,i):[],f=Pb(n[1],a,i,!!u.length);return i.inline=!1,u.length?{align:s,cells:u,header:f,type:"25"}:{children:f,type:"21"}}function Xb(n,a){return n.align[a]==null?{}:{textAlign:n.align[a]}}function Di(n){return n.inline=1,n}function Br(n){return Di(function(a,i){return i.inline?n.exec(a):null})}function sr(n){return Di(function(a,i){return i.inline||i.simple?n.exec(a):null})}function xa(n){return function(a,i){return i.inline||i.simple?null:n.exec(a)}}function Po(n){return Di(function(a){return n.exec(a)})}const sR=/(javascript|vbscript|data(?!:image)):/i;function oR(n){try{const a=decodeURIComponent(n).replace(/[^A-Za-z0-9/:]/g,"");if(sR.test(a))return null}catch{return null}return n}function Zn(n){return n&&n.replace(XC,"$1")}function tu(n,a,i){const s=i.inline||!1,u=i.simple||!1;i.inline=!0,i.simple=!0;const f=n(a,i);return i.inline=s,i.simple=u,f}function uR(n,a,i){const s=i.inline||!1,u=i.simple||!1;i.inline=!1,i.simple=!0;const f=n(a,i);return i.inline=s,i.simple=u,f}function cR(n,a,i){const s=i.inline||!1;i.inline=!1;const u=n(a,i);return i.inline=s,u}const Td=(n,a,i)=>({children:tu(a,n[2],i)});function Ad(){return{}}function Od(){return null}function fR(...n){return n.filter(Boolean).join(" ")}function xd(n,a,i){let s=n;const u=a.split(".");for(;u.length&&(s=s[u[0]],s!==void 0);)u.shift();return s||i}function dR(n="",a={}){a.overrides=a.overrides||{},a.namedCodesToUnicode=a.namedCodesToUnicode?zr({},Ub,a.namedCodesToUnicode):Ub;const i=a.slugify||Gl,s=a.sanitizer||oR,u=a.createElement||B.createElement,f=[jb,Hb,Ib,a.enforceAtxHeadings?Gb:zb,kb,Fb,c_,f_],d=[...f,MC,Ed,qb,Sd];function h(E,C){for(let S=0;S<E.length;S++)if(E[S].test(C))return!0;return!1}function m(E,C,...S){const H=xd(a.overrides,E+".props",{});return u((function(N,Z){const X=xd(Z,N);return X?typeof X=="function"||typeof X=="object"&&"render"in X?X:xd(Z,N+".component",N):N})(E,a.overrides),zr({},C,H,{className:fR(C?.className,H.className)||void 0}),...S)}function g(E){E=E.replace(TC,"");let C=!1;a.forceInline?C=!0:a.forceBlock||(C=UC.test(E)===!1);const S=k(x(C?E:Jl(E).replace(QC,"")+`
|
|
100
100
|
|
|
101
101
|
`,{inline:C}));for(;Yb(S[S.length-1])&&!S[S.length-1].trim();)S.pop();if(a.wrapper===null)return S;const H=a.wrapper||(C?"span":"div");let N;if(S.length>1||a.forceWrapper)N=S;else{if(S.length===1)return N=S[0],typeof N=="string"?m("span",{key:"outer"},N):N;N=null}return u(H,{key:"outer"},N)}function b(E,C){if(!C||!C.trim())return null;const S=C.match(fC);return S?S.reduce(function(H,N){const Z=N.indexOf("=");if(Z!==-1){const X=(function(re){return re.indexOf("-")!==-1&&re.match(xC)===null&&(re=re.replace(NC,function(pe,ce){return ce.toUpperCase()})),re})(N.slice(0,Z)).trim(),te=(function(re){const pe=re[0];return(pe==='"'||pe==="'")&&re.length>=2&&re[re.length-1]===pe?re.slice(1,-1):re})(N.slice(Z+1).trim()),de=Bb[X]||X;if(de==="ref")return H;const ye=H[de]=(function(re,pe,ce,Xe){return pe==="style"?(function(Ne){const G=[];let $="",ne=!1,Se=!1,Ae="";if(!Ne)return G;for(let q=0;q<Ne.length;q++){const P=Ne[q];if(P!=='"'&&P!=="'"||ne||(Se?P===Ae&&(Se=!1,Ae=""):(Se=!0,Ae=P)),P==="("&&$.endsWith("url")?ne=!0:P===")"&&ne&&(ne=!1),P!==";"||Se||ne)$+=P;else{const W=$.trim();if(W){const J=W.indexOf(":");if(J>0){const fe=W.slice(0,J).trim(),_e=W.slice(J+1).trim();G.push([fe,_e])}}$=""}}const O=$.trim();if(O){const q=O.indexOf(":");if(q>0){const P=O.slice(0,q).trim(),W=O.slice(q+1).trim();G.push([P,W])}}return G})(ce).reduce(function(Ne,[G,$]){return Ne[G.replace(/(-[a-z])/g,ne=>ne[1].toUpperCase())]=Xe($,re,G),Ne},{}):cC.indexOf(pe)!==-1?Xe(Zn(ce),re,pe):(ce.match(CC)&&(ce=Zn(ce.slice(1,ce.length-1))),ce==="true"||ce!=="false"&&ce)})(E,X,te,s);typeof ye=="string"&&(Ed.test(ye)||Sd.test(ye))&&(H[de]=g(ye.trim()))}else N!=="style"&&(H[Bb[N]||N]=!0);return H},{}):null}const _=[],A={},U={0:{t:[">"],o:xa(jb),i:1,u(E,C,S){const[,H,N]=E[0].replace(hC,"").match(mC);return{alert:H,children:C(N,S)}},l(E,C,S){const H={key:S.key};return E.alert&&(H.className="markdown-alert-"+i(E.alert.toLowerCase(),Gl),E.children.unshift({attrs:{},children:[{type:"27",text:E.alert}],noInnerParse:!0,type:"11",tag:"header"})),m("blockquote",H,C(E.children,S))}},1:{t:[" "],o:Po(pC),i:1,u:Ad,l:(E,C,S)=>m("br",{key:S.key})},2:{t:["--","__","**","- ","* ","_ "],o:xa(gC),i:1,u:Ad,l:(E,C,S)=>m("hr",{key:S.key})},3:{t:[" "],o:xa(Ib),i:0,u:E=>({lang:void 0,text:Zn(Jl(E[0].replace(/^ {4}/gm,"")))}),l:(E,C,S)=>m("pre",{key:S.key},m("code",zr({},E.attrs,{className:E.lang?"lang-"+E.lang:""}),E.text))},4:{t:["```","~~~"],o:xa(Hb),i:0,u:E=>({attrs:b("code",E[3]||""),lang:E[2]||void 0,text:E[4],type:"3"})},5:{t:["`"],o:sr(yC),i:3,u:E=>({text:Zn(E[2])}),l:(E,C,S)=>m("code",{key:S.key},E.text)},6:{t:["[^"],o:xa(_C),i:0,u:E=>(_.push({footnote:E[2],identifier:E[1]}),{}),l:Od},7:{t:["[^"],o:Br(EC),i:1,u:E=>({target:"#"+i(E[1],Gl),text:E[1]}),l:(E,C,S)=>m("a",{key:S.key,href:s(E.target,"a","href")},m("sup",{key:S.key},E.text))},8:{t:["[ ]","[x]"],o:Br(AC),i:1,u:E=>({completed:E[1].toLowerCase()==="x"}),l:(E,C,S)=>m("input",{checked:E.completed,key:S.key,readOnly:!0,type:"checkbox"})},9:{t:["#"],o:xa(a.enforceAtxHeadings?Gb:zb),i:1,u:(E,C,S)=>({children:tu(C,E[2],S),id:i(E[2],Gl),level:E[1].length}),l:(E,C,S)=>m("h"+E.level,{id:E.id,key:S.key},C(E.children,S))},10:{t:E=>{const C=E.indexOf(`
|
|
102
|
-
`);return C>0&&C<E.length-1&&(E[C+1]==="="||E[C+1]==="-")},o:xa(kb),i:
|
|
102
|
+
`);return C>0&&C<E.length-1&&(E[C+1]==="="||E[C+1]==="-")},o:xa(kb),i:1,u:(E,C,S)=>({children:tu(C,E[1],S),level:E[2]==="="?1:2,type:"9"})},11:{t:["<"],o:Po(Ed),i:1,u(E,C,S){const[,H]=E[3].match(KC),N=RegExp("^"+H,"gm"),Z=E[3].replace(N,""),X=h(d,Z)?cR:tu,te=E[1].toLowerCase(),de=uC.indexOf(te)!==-1,ye=(de?te:E[1]).trim(),re={attrs:b(ye,E[2]),noInnerParse:de,tag:ye};if(S.inAnchor=S.inAnchor||te==="a",de)re.text=E[3];else{const pe=S.inHTML;S.inHTML=!0,re.children=X(C,Z,S),S.inHTML=pe}return S.inAnchor=!1,re},l:(E,C,S)=>m(E.tag,zr({key:S.key},E.attrs),E.text||(E.children?C(E.children,S):""))},13:{t:["<"],o:Po(Sd),i:1,u(E){const C=E[1].trim();return{attrs:b(C,E[2]||""),tag:C}},l:(E,C,S)=>m(E.tag,zr({},E.attrs,{key:S.key}))},12:{t:["<!--"],o:Po(qb),i:1,u:()=>({}),l:Od},14:{t:["!["],o:sr(aR),i:1,u:E=>({alt:Zn(E[1]),target:Zn(E[2]),title:Zn(E[3])}),l:(E,C,S)=>m("img",{key:S.key,alt:E.alt||void 0,title:E.title||void 0,src:s(E.target,"img","src")})},15:{t:["["],o:Br(nR),i:3,u:(E,C,S)=>({children:uR(C,E[1],S),target:Zn(E[2]),title:Zn(E[3])}),l:(E,C,S)=>m("a",{key:S.key,href:s(E.target,"a","href"),title:E.title},C(E.children,S))},16:{t:["<"],o:Br(wC),i:0,u(E){let C=E[1],S=!1;return C.indexOf("@")!==-1&&C.indexOf("//")===-1&&(S=!0,C=C.replace("mailto:","")),{children:[{text:C,type:"27"}],target:S?"mailto:"+C:C,type:"15"}}},17:{t:(E,C)=>!C.inAnchor&&!a.disableAutoLink&&(eu(E,"http://")||eu(E,"https://")),o:Br(RC),i:0,u:E=>({children:[{text:E[1],type:"27"}],target:E[1],title:void 0,type:"15"})},20:Vb(m,1),33:Vb(m,2),19:{t:[`
|
|
103
103
|
`],o:xa(bC),i:3,u:Ad,l:()=>`
|
|
104
104
|
`},21:{o:Di(function(E,C){if(C.inline||C.simple||C.inHTML&&E.indexOf(`
|
|
105
105
|
|
|
@@ -122,4 +122,4 @@ For more details see https://formatjs.github.io/docs/getting-started/message-dis
|
|
|
122
122
|
|
|
123
123
|
- La cronologia delle chat è memorizzata nell'area UE e può essere visualizzata solo da persone autorizzate.
|
|
124
124
|
- Non inserire dati personali nella finestra di chat (password, data di nascita, ecc.).`,"general-conditions.accept-conditions-note":"Utilizzando la chat si accettano le condizioni d'uso.","block-user-input.title":"Attendere la risposta del chatbot.","conversation-rating.call-to-action.title":"Valuta questa chat","conversation-rating.overlay.title":"Quanto sei soddisfatto di questa chat?","conversation-rating.overlay.guest-feedback.input-placeholder":"Inserisci qui il tuo feedback (opzionale)","conversation-rating.overlay.star.very-bad":"Molto male","conversation-rating.overlay.star.very-good":"Molto buono","conversation-rating.overlay.bot-message.rate-feedback.value-1":"Oh, non suona bene. Vi prego di darmi un feedback in modo che possa imparare di più.","conversation-rating.overlay.bot-message.rate-feedback.value-2":"Oh, non suona bene. Vi prego di darmi un feedback in modo che possa imparare di più.","conversation-rating.overlay.bot-message.rate-feedback.value-3":"La media non è il mio obiettivo, cosa posso ancora migliorare?","conversation-rating.overlay.bot-message.rate-feedback.value-4":"Anche l'assenza è finita. Cosa posso migliorare per ottenere tutte le stelle la prossima volta?","conversation-rating.overlay.bot-message.rate-feedback.value-5":"Perfetto! Allora spero di potervi consigliare ancora una volta bene.","conversation-rating.overlay.bot-message.submit-feedback":"Grazie mille per il feedback. Mi impegno costantemente per migliorare.","conversation-rating.overlay.action.submit":"Invia","conversation-rating.overlay.action.back-to-chat":"Chiudere","conversation-rating.overlay.action.close-chat":"Minimizzare la chat","conversation-rating.overlay.action.restart-chat":"Riavviare la chat","conversation-rating.overlay.action.cancel":"Annulla","start-screen.intro":"","start-screen.start-chat":"Avviare la chat","start-screen.waiting-for-login":"In attesa di login ...","header.close-chat":"Minimizzare la chat","header.menu.title":"Menu","header.menu.restart-chat":"Riavviare la chat","header.menu.expand-chat-window":"Espandere la finestra","header.menu.download-transcript":"Scaricare la trascrizione","header.menu.send-transcript":"Inviare la trascrizione","header.menu.export-transcript":"Esportare la trascrizione","header.menu.rate-conversation":"Valutare la conversazione","source-infos.close":"Chiudere","source-infos.open-source":"Fonte aperta","source-infos.error.title":"Errore","source-infos.error.info":"Ops! Qualcosa è andato storto. Riprovare o contattare l'assistenza se il problema persiste.","source-infos.highlight-loading.title":"Il contenuto rilevante è evidenziato...","source-infos.highlight-loading.description":"Un momento - la fonte è in fase di analisi","commands.show-more.action":"Di più","commands.show-more.tooltip":"Mostra più comandi","commands.show-less.action":"Meno","commands.show-less.tooltip":"Mostra meno comandi"},U8=["de","en","fr","it"],M_={locale:"de",messages:N_},j8=(n,a)=>{if(U8.includes(n)){const i=H8(n),s=M8(a);return{...i,...s}}return a},H8=n=>{switch(n.toString()){case"en":return D8;case"fr":return L8;case"it":return B8;default:return N_}},I8=(n=z8,a)=>{switch(a.type){case Jh:return Object.assign({},n,{connectionState:kr.CONNECTING});case em:return Object.assign({},n,{connectionState:kr.CONNECTED});case tm:return Object.assign({},n,{connectionState:kr.DISCONNECTED});case nm:return Object.assign({},n,{connectionState:kr.RECONNECTED});case am:return Object.assign({},n,{sessionId:a.sessionId});case Cu:return Object.assign({},n,{sessionId:a.payload.sessionId,userId:a.payload.userId});case Ru:return Object.assign({},n,{sessionId:void 0});default:return n}},z8={connectionState:kr.DISCONNECTED,sessionId:void 0,userId:void 0},G8=(n=Dv,a)=>{switch(a.type){case $1:return Dv;case Cu:return Hr({type:"webclient.chat.started"}),n;case Ru:return Hr({type:"webclient.chat.ended"}),n;case Te.ActionTypes.TYPING_ON:return Object.assign({},n,{isBotTyping:!0});case Te.ActionTypes.TYPING_OFF:return Object.assign({},n,{isBotTyping:!1});case Te.ActionTypes.MESSAGE_FROM_GUEST:case Te.ActionTypes.MESSAGE_WITHOUT_ANALYSIS_FROM_GUEST:return Mv(n,a.message);case Te.ActionTypes.MESSAGE_TO_GUEST:{Hr(a);const i=Object.assign({},a.message,{_id:a.meta.actionId}),s=n.messages.filter(u=>u._id===a.meta.actionId).length>0;return Object.assign({},n,{isBotTyping:!1,messages:s?n.messages:n.messages.concat([i]),quickReplies:i.quickReplies?i.quickReplies:[]})}case Gh:{const i=a.messages,s=i.length?i[i.length-1]:void 0;return Object.assign({},n,{isBotTyping:!1,messages:i,quickReplies:s?.quickReplies||[]})}case zh:return Hr(a.message),n;case Te.ActionTypes.EVENT_TO_GUEST:return Hr(a.event),n;case Te.ActionTypes.DRAWER_OPEN:return Object.assign({},n,{drawerContentUrl:a.payload.parameters.contentUrl});case Te.ActionTypes.DRAWER_CLOSE:return Object.assign({},n,{drawerContentUrl:void 0});case Te.ActionTypes.GUEST_LOCALE_CHANGED:return Object.assign({},n,{locale:a.payload.locale});case D1:return Hr(a),n;case L1:return Hr(a),{...n,conversationRating:{...n.conversationRating,opener:void 0}};case qh:{const i=new Te.TextMessage(a.transcription,new Te.GuestUser),s=Object.assign({},i,{_id:ou()});return Mv(n,s)}case Te.ActionTypes.TRANSCRIPT_ITEM_GUEST_REACTION:{const i=n.messages.map(s=>s._id===a.payload.actionId?Object.assign({},s,a.payload.reaction?{reaction:{type:a.payload.reaction,category:a.payload.category,comment:a.payload.comment}}:{reaction:void 0}):s);return Object.assign({},n,{messages:i})}case Fh:{const i={enabled:!0,rating:a.payload.rating};return Object.assign({},n,{conversationRating:i})}case Te.ActionTypes.CONVERSATION_RATING_FROM_GUEST:{const i={...n.conversationRating,rating:a.payload};return Object.assign({},n,{conversationRating:i})}case J1:{const i={...n.conversationRating,opener:a.payload.opener,...a.payload.defaultRating?{rating:{value:a.payload.defaultRating,feedback:n.conversationRating.rating?.feedback||""}}:{}};return Object.assign({},n,{conversationRating:i})}case e_:{const i={...n.conversationRating,opener:void 0};return Object.assign({},n,{conversationRating:i})}case Yh:return{...n,sourceInfos:{type:"loading",chunkId:a.payload.chunkId}};case Vh:{const{highlighted:i}=a.payload;return n.sourceInfos?.type==="loaded"&&i?{...n,sourceInfos:{...n.sourceInfos,highlighted:!0}}:{...n,sourceInfos:{type:"loading-error"}}}case M1:{const i=n.sourceInfos?.type,{chunkId:s,knowledgeBaseType:u,title:f,content:d,highlighted:h,url:m}=a.payload,g=n.sourceInfos?.type==="loading"||n.sourceInfos?.type==="loaded"?n.sourceInfos?.chunkId:void 0;return g&&g!==s?n:i==="loading"||i==="loaded"&&h?{...n,sourceInfos:{type:"loaded",chunkId:s,knowledgeBaseType:u,title:f,content:d,highlighted:h,url:m}}:n}case Ph:return{...n,sourceInfos:void 0};case W1:return{...n,showTranscriptMailOverlay:!n.showTranscriptMailOverlay,conversationRating:{...n.conversationRating,opener:void 0}};default:return n}},Mv=(n,a)=>{const i=n.messages[n.messages.length-1],s=i?.text===a.text;return i&&i.sender.type===a.sender.type&&s?n:Object.assign({},n,{messages:n.messages.concat([a]),quickReplies:[]})},Hr=n=>{k8()?window.top?.postMessage(n,"*"):n.type==="webclient.change.url"&&window.open(n.url)},k8=()=>typeof window<"u"&&window.self!==window.top,Dv={messages:[],quickReplies:[],isBotTyping:!1,showTranscriptMailOverlay:!1,conversationRating:{enabled:!1}},D_=$h({name:"intl",initialState:M_,reducers:{updateIntl:(n,a)=>{n.locale=a.payload.language,n.messages=a.payload.messages}}}),{updateIntl:q8}=D_.actions,F8=D_.reducer,V8={version:void 0,requiresUserAuthentication:!1,enableStartScreen:void 0,enableStandaloneView:!1,enableTranscriptExportEmail:!1,enableTranscriptExportPdf:!1,enableGeneralConditions:!1,enableSpeechSupport:!1,commands:[],menuItems:[]},L_=$h({name:"settings",initialState:V8,reducers:{setSettings(n,a){n.version&&n.version!==a.payload.version?(console.log("version changed, reloading chat window"),window.location.reload()):(n.version=a.payload.version,n.requiresUserAuthentication=a.payload.requiresUserAuthentication,n.enableStartScreen=a.payload.enableStartScreen,n.enableStandaloneView=a.payload.enableStandaloneView,n.enableTranscriptExportEmail=a.payload.enableTranscriptExportEmail,n.enableTranscriptExportPdf=a.payload.enableTranscriptExportPdf,n.enableGeneralConditions=a.payload.enableGeneralConditions,n.enableSpeechSupport=a.payload.enableSpeechSupport,n.commands=a.payload.commands,n.menuItems=a.payload.menuItems||[])}}}),{setSettings:Y8}=L_.actions,P8=L_.reducer,X8=z1({settings:P8,chat:G8,startScreen:Vx,connection:I8,intl:F8}),Z8="bubble-chat",B_="state-last-saved-at",U_="state",Q8=n=>{try{if(!W8())return;const a=Lv(n,B_);if($8(a))return;{const i=Lv(n,U_);return i===null?void 0:JSON.parse(i)}}catch(a){console.error(a);return}},K8=(n,a)=>{try{const i=JSON.stringify(a);Bv(n,U_,i);const s=new Date().toISOString();Bv(n,B_,s)}catch(i){console.error(i)}},$8=n=>{if(n===null)return!1;const a=new Date(n);return a.setHours(a.getHours()+12),new Date>a},W8=()=>typeof localStorage<"u",Lv=(n,a)=>{const i=j_(n,a);return localStorage.getItem(i)},Bv=(n,a,i)=>{const s=j_(n,a);return localStorage.setItem(s,i)},j_=(n,a)=>`${Z8}-${n}-${a}`,ea=Object.create(null);ea.open="0";ea.close="1";ea.ping="2";ea.pong="3";ea.message="4";ea.upgrade="5";ea.noop="6";const au=Object.create(null);Object.keys(ea).forEach(n=>{au[ea[n]]=n});const Th={type:"error",data:"parser error"},H_=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",I_=typeof ArrayBuffer=="function",z_=n=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(n):n&&n.buffer instanceof ArrayBuffer,cm=({type:n,data:a},i,s)=>H_&&a instanceof Blob?i?s(a):Uv(a,s):I_&&(a instanceof ArrayBuffer||z_(a))?i?s(a):Uv(new Blob([a]),s):s(ea[n]+(a||"")),Uv=(n,a)=>{const i=new FileReader;return i.onload=function(){const s=i.result.split(",")[1];a("b"+(s||""))},i.readAsDataURL(n)};function jv(n){return n instanceof Uint8Array?n:n instanceof ArrayBuffer?new Uint8Array(n):new Uint8Array(n.buffer,n.byteOffset,n.byteLength)}let Kd;function J8(n,a){if(H_&&n.data instanceof Blob)return n.data.arrayBuffer().then(jv).then(a);if(I_&&(n.data instanceof ArrayBuffer||z_(n.data)))return a(jv(n.data));cm(n,!1,i=>{Kd||(Kd=new TextEncoder),a(Kd.encode(i))})}const Hv="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Wl=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let n=0;n<Hv.length;n++)Wl[Hv.charCodeAt(n)]=n;const eM=n=>{let a=n.length*.75,i=n.length,s,u=0,f,d,h,m;n[n.length-1]==="="&&(a--,n[n.length-2]==="="&&a--);const g=new ArrayBuffer(a),b=new Uint8Array(g);for(s=0;s<i;s+=4)f=Wl[n.charCodeAt(s)],d=Wl[n.charCodeAt(s+1)],h=Wl[n.charCodeAt(s+2)],m=Wl[n.charCodeAt(s+3)],b[u++]=f<<2|d>>4,b[u++]=(d&15)<<4|h>>2,b[u++]=(h&3)<<6|m&63;return g},tM=typeof ArrayBuffer=="function",fm=(n,a)=>{if(typeof n!="string")return{type:"message",data:G_(n,a)};const i=n.charAt(0);return i==="b"?{type:"message",data:nM(n.substring(1),a)}:au[i]?n.length>1?{type:au[i],data:n.substring(1)}:{type:au[i]}:Th},nM=(n,a)=>{if(tM){const i=eM(n);return G_(i,a)}else return{base64:!0,data:n}},G_=(n,a)=>{switch(a){case"blob":return n instanceof Blob?n:new Blob([n]);case"arraybuffer":default:return n instanceof ArrayBuffer?n:n.buffer}},k_="",aM=(n,a)=>{const i=n.length,s=new Array(i);let u=0;n.forEach((f,d)=>{cm(f,!1,h=>{s[d]=h,++u===i&&a(s.join(k_))})})},rM=(n,a)=>{const i=n.split(k_),s=[];for(let u=0;u<i.length;u++){const f=fm(i[u],a);if(s.push(f),f.type==="error")break}return s};function iM(){return new TransformStream({transform(n,a){J8(n,i=>{const s=i.length;let u;if(s<126)u=new Uint8Array(1),new DataView(u.buffer).setUint8(0,s);else if(s<65536){u=new Uint8Array(3);const f=new DataView(u.buffer);f.setUint8(0,126),f.setUint16(1,s)}else{u=new Uint8Array(9);const f=new DataView(u.buffer);f.setUint8(0,127),f.setBigUint64(1,BigInt(s))}n.data&&typeof n.data!="string"&&(u[0]|=128),a.enqueue(u),a.enqueue(i)})}})}let $d;function $o(n){return n.reduce((a,i)=>a+i.length,0)}function Wo(n,a){if(n[0].length===a)return n.shift();const i=new Uint8Array(a);let s=0;for(let u=0;u<a;u++)i[u]=n[0][s++],s===n[0].length&&(n.shift(),s=0);return n.length&&s<n[0].length&&(n[0]=n[0].slice(s)),i}function lM(n,a){$d||($d=new TextDecoder);const i=[];let s=0,u=-1,f=!1;return new TransformStream({transform(d,h){for(i.push(d);;){if(s===0){if($o(i)<1)break;const m=Wo(i,1);f=(m[0]&128)===128,u=m[0]&127,u<126?s=3:u===126?s=1:s=2}else if(s===1){if($o(i)<2)break;const m=Wo(i,2);u=new DataView(m.buffer,m.byteOffset,m.length).getUint16(0),s=3}else if(s===2){if($o(i)<8)break;const m=Wo(i,8),g=new DataView(m.buffer,m.byteOffset,m.length),b=g.getUint32(0);if(b>Math.pow(2,21)-1){h.enqueue(Th);break}u=b*Math.pow(2,32)+g.getUint32(4),s=3}else{if($o(i)<u)break;const m=Wo(i,u);h.enqueue(fm(f?m:$d.decode(m),a)),s=0}if(u===0||u>n){h.enqueue(Th);break}}}})}const q_=4;function bt(n){if(n)return sM(n)}function sM(n){for(var a in bt.prototype)n[a]=bt.prototype[a];return n}bt.prototype.on=bt.prototype.addEventListener=function(n,a){return this._callbacks=this._callbacks||{},(this._callbacks["$"+n]=this._callbacks["$"+n]||[]).push(a),this};bt.prototype.once=function(n,a){function i(){this.off(n,i),a.apply(this,arguments)}return i.fn=a,this.on(n,i),this};bt.prototype.off=bt.prototype.removeListener=bt.prototype.removeAllListeners=bt.prototype.removeEventListener=function(n,a){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var i=this._callbacks["$"+n];if(!i)return this;if(arguments.length==1)return delete this._callbacks["$"+n],this;for(var s,u=0;u<i.length;u++)if(s=i[u],s===a||s.fn===a){i.splice(u,1);break}return i.length===0&&delete this._callbacks["$"+n],this};bt.prototype.emit=function(n){this._callbacks=this._callbacks||{};for(var a=new Array(arguments.length-1),i=this._callbacks["$"+n],s=1;s<arguments.length;s++)a[s-1]=arguments[s];if(i){i=i.slice(0);for(var s=0,u=i.length;s<u;++s)i[s].apply(this,a)}return this};bt.prototype.emitReserved=bt.prototype.emit;bt.prototype.listeners=function(n){return this._callbacks=this._callbacks||{},this._callbacks["$"+n]||[]};bt.prototype.hasListeners=function(n){return!!this.listeners(n).length};const Du=typeof Promise=="function"&&typeof Promise.resolve=="function"?a=>Promise.resolve().then(a):(a,i)=>i(a,0),xn=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),oM="arraybuffer";function F_(n,...a){return a.reduce((i,s)=>(n.hasOwnProperty(s)&&(i[s]=n[s]),i),{})}const uM=xn.setTimeout,cM=xn.clearTimeout;function Lu(n,a){a.useNativeTimers?(n.setTimeoutFn=uM.bind(xn),n.clearTimeoutFn=cM.bind(xn)):(n.setTimeoutFn=xn.setTimeout.bind(xn),n.clearTimeoutFn=xn.clearTimeout.bind(xn))}const fM=1.33;function dM(n){return typeof n=="string"?hM(n):Math.ceil((n.byteLength||n.size)*fM)}function hM(n){let a=0,i=0;for(let s=0,u=n.length;s<u;s++)a=n.charCodeAt(s),a<128?i+=1:a<2048?i+=2:a<55296||a>=57344?i+=3:(s++,i+=4);return i}function V_(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function mM(n){let a="";for(let i in n)n.hasOwnProperty(i)&&(a.length&&(a+="&"),a+=encodeURIComponent(i)+"="+encodeURIComponent(n[i]));return a}function pM(n){let a={},i=n.split("&");for(let s=0,u=i.length;s<u;s++){let f=i[s].split("=");a[decodeURIComponent(f[0])]=decodeURIComponent(f[1])}return a}class gM extends Error{constructor(a,i,s){super(a),this.description=i,this.context=s,this.type="TransportError"}}class dm extends bt{constructor(a){super(),this.writable=!1,Lu(this,a),this.opts=a,this.query=a.query,this.socket=a.socket,this.supportsBinary=!a.forceBase64}onError(a,i,s){return super.emitReserved("error",new gM(a,i,s)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(a){this.readyState==="open"&&this.write(a)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(a){const i=fm(a,this.socket.binaryType);this.onPacket(i)}onPacket(a){super.emitReserved("packet",a)}onClose(a){this.readyState="closed",super.emitReserved("close",a)}pause(a){}createUri(a,i={}){return a+"://"+this._hostname()+this._port()+this.opts.path+this._query(i)}_hostname(){const a=this.opts.hostname;return a.indexOf(":")===-1?a:"["+a+"]"}_port(){return this.opts.port&&(this.opts.secure&&+(this.opts.port!==443)||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(a){const i=mM(a);return i.length?"?"+i:""}}class yM extends dm{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(a){this.readyState="pausing";const i=()=>{this.readyState="paused",a()};if(this._polling||!this.writable){let s=0;this._polling&&(s++,this.once("pollComplete",function(){--s||i()})),this.writable||(s++,this.once("drain",function(){--s||i()}))}else i()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(a){const i=s=>{if(this.readyState==="opening"&&s.type==="open"&&this.onOpen(),s.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(s)};rM(a,this.socket.binaryType).forEach(i),this.readyState!=="closed"&&(this._polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this._poll())}doClose(){const a=()=>{this.write([{type:"close"}])};this.readyState==="open"?a():this.once("open",a)}write(a){this.writable=!1,aM(a,i=>{this.doWrite(i,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const a=this.opts.secure?"https":"http",i=this.query||{};return this.opts.timestampRequests!==!1&&(i[this.opts.timestampParam]=V_()),!this.supportsBinary&&!i.sid&&(i.b64=1),this.createUri(a,i)}}let Y_=!1;try{Y_=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const bM=Y_;function vM(){}class _M extends yM{constructor(a){if(super(a),typeof location<"u"){const i=location.protocol==="https:";let s=location.port;s||(s=i?"443":"80"),this.xd=typeof location<"u"&&a.hostname!==location.hostname||s!==a.port}}doWrite(a,i){const s=this.request({method:"POST",data:a});s.on("success",i),s.on("error",(u,f)=>{this.onError("xhr post error",u,f)})}doPoll(){const a=this.request();a.on("data",this.onData.bind(this)),a.on("error",(i,s)=>{this.onError("xhr poll error",i,s)}),this.pollXhr=a}}class Wn extends bt{constructor(a,i,s){super(),this.createRequest=a,Lu(this,s),this._opts=s,this._method=s.method||"GET",this._uri=i,this._data=s.data!==void 0?s.data:null,this._create()}_create(){var a;const i=F_(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");i.xdomain=!!this._opts.xd;const s=this._xhr=this.createRequest(i);try{s.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){s.setDisableHeaderCheck&&s.setDisableHeaderCheck(!0);for(let u in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(u)&&s.setRequestHeader(u,this._opts.extraHeaders[u])}}catch{}if(this._method==="POST")try{s.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{s.setRequestHeader("Accept","*/*")}catch{}(a=this._opts.cookieJar)===null||a===void 0||a.addCookies(s),"withCredentials"in s&&(s.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(s.timeout=this._opts.requestTimeout),s.onreadystatechange=()=>{var u;s.readyState===3&&((u=this._opts.cookieJar)===null||u===void 0||u.parseCookies(s.getResponseHeader("set-cookie"))),s.readyState===4&&(s.status===200||s.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof s.status=="number"?s.status:0)},0))},s.send(this._data)}catch(u){this.setTimeoutFn(()=>{this._onError(u)},0);return}typeof document<"u"&&(this._index=Wn.requestsCount++,Wn.requests[this._index]=this)}_onError(a){this.emitReserved("error",a,this._xhr),this._cleanup(!0)}_cleanup(a){if(!(typeof this._xhr>"u"||this._xhr===null)){if(this._xhr.onreadystatechange=vM,a)try{this._xhr.abort()}catch{}typeof document<"u"&&delete Wn.requests[this._index],this._xhr=null}}_onLoad(){const a=this._xhr.responseText;a!==null&&(this.emitReserved("data",a),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}}Wn.requestsCount=0;Wn.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",Iv);else if(typeof addEventListener=="function"){const n="onpagehide"in xn?"pagehide":"unload";addEventListener(n,Iv,!1)}}function Iv(){for(let n in Wn.requests)Wn.requests.hasOwnProperty(n)&&Wn.requests[n].abort()}const EM=(function(){const n=P_({xdomain:!1});return n&&n.responseType!==null})();class SM extends _M{constructor(a){super(a);const i=a&&a.forceBase64;this.supportsBinary=EM&&!i}request(a={}){return Object.assign(a,{xd:this.xd},this.opts),new Wn(P_,this.uri(),a)}}function P_(n){const a=n.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!a||bM))return new XMLHttpRequest}catch{}if(!a)try{return new xn[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const X_=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class TM extends dm{get name(){return"websocket"}doOpen(){const a=this.uri(),i=this.opts.protocols,s=X_?{}:F_(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(s.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(a,i,s)}catch(u){return this.emitReserved("error",u)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=a=>this.onClose({description:"websocket connection closed",context:a}),this.ws.onmessage=a=>this.onData(a.data),this.ws.onerror=a=>this.onError("websocket error",a)}write(a){this.writable=!1;for(let i=0;i<a.length;i++){const s=a[i],u=i===a.length-1;cm(s,this.supportsBinary,f=>{try{this.doWrite(s,f)}catch{}u&&Du(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){const a=this.opts.secure?"wss":"ws",i=this.query||{};return this.opts.timestampRequests&&(i[this.opts.timestampParam]=V_()),this.supportsBinary||(i.b64=1),this.createUri(a,i)}}const Wd=xn.WebSocket||xn.MozWebSocket;class AM extends TM{createSocket(a,i,s){return X_?new Wd(a,i,s):i?new Wd(a,i):new Wd(a)}doWrite(a,i){this.ws.send(i)}}class OM extends dm{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(a){return this.emitReserved("error",a)}this._transport.closed.then(()=>{this.onClose()}).catch(a=>{this.onError("webtransport error",a)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(a=>{const i=lM(Number.MAX_SAFE_INTEGER,this.socket.binaryType),s=a.readable.pipeThrough(i).getReader(),u=iM();u.readable.pipeTo(a.writable),this._writer=u.writable.getWriter();const f=()=>{s.read().then(({done:h,value:m})=>{h||(this.onPacket(m),f())}).catch(h=>{})};f();const d={type:"open"};this.query.sid&&(d.data=`{"sid":"${this.query.sid}"}`),this._writer.write(d).then(()=>this.onOpen())})})}write(a){this.writable=!1;for(let i=0;i<a.length;i++){const s=a[i],u=i===a.length-1;this._writer.write(s).then(()=>{u&&Du(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var a;(a=this._transport)===null||a===void 0||a.close()}}const xM={websocket:AM,webtransport:OM,polling:SM},CM=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,RM=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function Ah(n){if(n.length>8e3)throw"URI too long";const a=n,i=n.indexOf("["),s=n.indexOf("]");i!=-1&&s!=-1&&(n=n.substring(0,i)+n.substring(i,s).replace(/:/g,";")+n.substring(s,n.length));let u=CM.exec(n||""),f={},d=14;for(;d--;)f[RM[d]]=u[d]||"";return i!=-1&&s!=-1&&(f.source=a,f.host=f.host.substring(1,f.host.length-1).replace(/;/g,":"),f.authority=f.authority.replace("[","").replace("]","").replace(/;/g,":"),f.ipv6uri=!0),f.pathNames=wM(f,f.path),f.queryKey=NM(f,f.query),f}function wM(n,a){const i=/\/{2,9}/g,s=a.replace(i,"/").split("/");return(a.slice(0,1)=="/"||a.length===0)&&s.splice(0,1),a.slice(-1)=="/"&&s.splice(s.length-1,1),s}function NM(n,a){const i={};return a.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(s,u,f){u&&(i[u]=f)}),i}const Oh=typeof addEventListener=="function"&&typeof removeEventListener=="function",ru=[];Oh&&addEventListener("offline",()=>{ru.forEach(n=>n())},!1);class ur extends bt{constructor(a,i){if(super(),this.binaryType=oM,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,a&&typeof a=="object"&&(i=a,a=null),a){const s=Ah(a);i.hostname=s.host,i.secure=s.protocol==="https"||s.protocol==="wss",i.port=s.port,s.query&&(i.query=s.query)}else i.host&&(i.hostname=Ah(i.host).host);Lu(this,i),this.secure=i.secure!=null?i.secure:typeof location<"u"&&location.protocol==="https:",i.hostname&&!i.port&&(i.port=this.secure?"443":"80"),this.hostname=i.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=i.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},i.transports.forEach(s=>{const u=s.prototype.name;this.transports.push(u),this._transportsByName[u]=s}),this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},i),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=pM(this.opts.query)),Oh&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this._beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this._offlineEventListener=()=>{this._onClose("transport close",{description:"network connection lost"})},ru.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(a){const i=Object.assign({},this.opts.query);i.EIO=q_,i.transport=a,this.id&&(i.sid=this.id);const s=Object.assign({},this.opts,{query:i,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[a]);return new this._transportsByName[a](s)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}const a=this.opts.rememberUpgrade&&ur.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";const i=this.createTransport(a);i.open(),this.setTransport(i)}setTransport(a){this.transport&&this.transport.removeAllListeners(),this.transport=a,a.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",i=>this._onClose("transport close",i))}onOpen(){this.readyState="open",ur.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(a){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",a),this.emitReserved("heartbeat"),a.type){case"open":this.onHandshake(JSON.parse(a.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":const i=new Error("server error");i.code=a.data,this._onError(i);break;case"message":this.emitReserved("data",a.data),this.emitReserved("message",a.data);break}}onHandshake(a){this.emitReserved("handshake",a),this.id=a.sid,this.transport.query.sid=a.sid,this._pingInterval=a.pingInterval,this._pingTimeout=a.pingTimeout,this._maxPayload=a.maxPayload,this.onOpen(),this.readyState!=="closed"&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);const a=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+a,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},a),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const a=this._getWritablePackets();this.transport.send(a),this._prevBufferLen=a.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let i=1;for(let s=0;s<this.writeBuffer.length;s++){const u=this.writeBuffer[s].data;if(u&&(i+=dM(u)),s>0&&i>this._maxPayload)return this.writeBuffer.slice(0,s);i+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;const a=Date.now()>this._pingTimeoutTime;return a&&(this._pingTimeoutTime=0,Du(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),a}write(a,i,s){return this._sendPacket("message",a,i,s),this}send(a,i,s){return this._sendPacket("message",a,i,s),this}_sendPacket(a,i,s,u){if(typeof i=="function"&&(u=i,i=void 0),typeof s=="function"&&(u=s,s=null),this.readyState==="closing"||this.readyState==="closed")return;s=s||{},s.compress=s.compress!==!1;const f={type:a,data:i,options:s};this.emitReserved("packetCreate",f),this.writeBuffer.push(f),u&&this.once("flush",u),this.flush()}close(){const a=()=>{this._onClose("forced close"),this.transport.close()},i=()=>{this.off("upgrade",i),this.off("upgradeError",i),a()},s=()=>{this.once("upgrade",i),this.once("upgradeError",i)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?s():a()}):this.upgrading?s():a()),this}_onError(a){if(ur.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState==="opening")return this.transports.shift(),this._open();this.emitReserved("error",a),this._onClose("transport error",a)}_onClose(a,i){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing"){if(this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),Oh&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const s=ru.indexOf(this._offlineEventListener);s!==-1&&ru.splice(s,1)}this.readyState="closed",this.id=null,this.emitReserved("close",a,i),this.writeBuffer=[],this._prevBufferLen=0}}}ur.protocol=q_;class MM extends ur{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade)for(let a=0;a<this._upgrades.length;a++)this._probe(this._upgrades[a])}_probe(a){let i=this.createTransport(a),s=!1;ur.priorWebsocketSuccess=!1;const u=()=>{s||(i.send([{type:"ping",data:"probe"}]),i.once("packet",_=>{if(!s)if(_.type==="pong"&&_.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",i),!i)return;ur.priorWebsocketSuccess=i.name==="websocket",this.transport.pause(()=>{s||this.readyState!=="closed"&&(b(),this.setTransport(i),i.send([{type:"upgrade"}]),this.emitReserved("upgrade",i),i=null,this.upgrading=!1,this.flush())})}else{const A=new Error("probe error");A.transport=i.name,this.emitReserved("upgradeError",A)}}))};function f(){s||(s=!0,b(),i.close(),i=null)}const d=_=>{const A=new Error("probe error: "+_);A.transport=i.name,f(),this.emitReserved("upgradeError",A)};function h(){d("transport closed")}function m(){d("socket closed")}function g(_){i&&_.name!==i.name&&f()}const b=()=>{i.removeListener("open",u),i.removeListener("error",d),i.removeListener("close",h),this.off("close",m),this.off("upgrading",g)};i.once("open",u),i.once("error",d),i.once("close",h),this.once("close",m),this.once("upgrading",g),this._upgrades.indexOf("webtransport")!==-1&&a!=="webtransport"?this.setTimeoutFn(()=>{s||i.open()},200):i.open()}onHandshake(a){this._upgrades=this._filterUpgrades(a.upgrades),super.onHandshake(a)}_filterUpgrades(a){const i=[];for(let s=0;s<a.length;s++)~this.transports.indexOf(a[s])&&i.push(a[s]);return i}}let DM=class extends MM{constructor(a,i={}){const s=typeof a=="object"?a:i;(!s.transports||s.transports&&typeof s.transports[0]=="string")&&(s.transports=(s.transports||["polling","websocket","webtransport"]).map(u=>xM[u]).filter(u=>!!u)),super(a,s)}};function LM(n,a="",i){let s=n;i=i||typeof location<"u"&&location,n==null&&(n=i.protocol+"//"+i.host),typeof n=="string"&&(n.charAt(0)==="/"&&(n.charAt(1)==="/"?n=i.protocol+n:n=i.host+n),/^(https?|wss?):\/\//.test(n)||(typeof i<"u"?n=i.protocol+"//"+n:n="https://"+n),s=Ah(n)),s.port||(/^(http|ws)$/.test(s.protocol)?s.port="80":/^(http|ws)s$/.test(s.protocol)&&(s.port="443")),s.path=s.path||"/";const f=s.host.indexOf(":")!==-1?"["+s.host+"]":s.host;return s.id=s.protocol+"://"+f+":"+s.port+a,s.href=s.protocol+"://"+f+(i&&i.port===s.port?"":":"+s.port),s}const BM=typeof ArrayBuffer=="function",UM=n=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(n):n.buffer instanceof ArrayBuffer,Z_=Object.prototype.toString,jM=typeof Blob=="function"||typeof Blob<"u"&&Z_.call(Blob)==="[object BlobConstructor]",HM=typeof File=="function"||typeof File<"u"&&Z_.call(File)==="[object FileConstructor]";function hm(n){return BM&&(n instanceof ArrayBuffer||UM(n))||jM&&n instanceof Blob||HM&&n instanceof File}function iu(n,a){if(!n||typeof n!="object")return!1;if(Array.isArray(n)){for(let i=0,s=n.length;i<s;i++)if(iu(n[i]))return!0;return!1}if(hm(n))return!0;if(n.toJSON&&typeof n.toJSON=="function"&&arguments.length===1)return iu(n.toJSON(),!0);for(const i in n)if(Object.prototype.hasOwnProperty.call(n,i)&&iu(n[i]))return!0;return!1}function IM(n){const a=[],i=n.data,s=n;return s.data=xh(i,a),s.attachments=a.length,{packet:s,buffers:a}}function xh(n,a){if(!n)return n;if(hm(n)){const i={_placeholder:!0,num:a.length};return a.push(n),i}else if(Array.isArray(n)){const i=new Array(n.length);for(let s=0;s<n.length;s++)i[s]=xh(n[s],a);return i}else if(typeof n=="object"&&!(n instanceof Date)){const i={};for(const s in n)Object.prototype.hasOwnProperty.call(n,s)&&(i[s]=xh(n[s],a));return i}return n}function zM(n,a){return n.data=Ch(n.data,a),delete n.attachments,n}function Ch(n,a){if(!n)return n;if(n&&n._placeholder===!0){if(typeof n.num=="number"&&n.num>=0&&n.num<a.length)return a[n.num];throw new Error("illegal attachments")}else if(Array.isArray(n))for(let i=0;i<n.length;i++)n[i]=Ch(n[i],a);else if(typeof n=="object")for(const i in n)Object.prototype.hasOwnProperty.call(n,i)&&(n[i]=Ch(n[i],a));return n}const GM=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"],kM=5;var Le;(function(n){n[n.CONNECT=0]="CONNECT",n[n.DISCONNECT=1]="DISCONNECT",n[n.EVENT=2]="EVENT",n[n.ACK=3]="ACK",n[n.CONNECT_ERROR=4]="CONNECT_ERROR",n[n.BINARY_EVENT=5]="BINARY_EVENT",n[n.BINARY_ACK=6]="BINARY_ACK"})(Le||(Le={}));class qM{constructor(a){this.replacer=a}encode(a){return(a.type===Le.EVENT||a.type===Le.ACK)&&iu(a)?this.encodeAsBinary({type:a.type===Le.EVENT?Le.BINARY_EVENT:Le.BINARY_ACK,nsp:a.nsp,data:a.data,id:a.id}):[this.encodeAsString(a)]}encodeAsString(a){let i=""+a.type;return(a.type===Le.BINARY_EVENT||a.type===Le.BINARY_ACK)&&(i+=a.attachments+"-"),a.nsp&&a.nsp!=="/"&&(i+=a.nsp+","),a.id!=null&&(i+=a.id),a.data!=null&&(i+=JSON.stringify(a.data,this.replacer)),i}encodeAsBinary(a){const i=IM(a),s=this.encodeAsString(i.packet),u=i.buffers;return u.unshift(s),u}}function zv(n){return Object.prototype.toString.call(n)==="[object Object]"}class mm extends bt{constructor(a){super(),this.reviver=a}add(a){let i;if(typeof a=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");i=this.decodeString(a);const s=i.type===Le.BINARY_EVENT;s||i.type===Le.BINARY_ACK?(i.type=s?Le.EVENT:Le.ACK,this.reconstructor=new FM(i),i.attachments===0&&super.emitReserved("decoded",i)):super.emitReserved("decoded",i)}else if(hm(a)||a.base64)if(this.reconstructor)i=this.reconstructor.takeBinaryData(a),i&&(this.reconstructor=null,super.emitReserved("decoded",i));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+a)}decodeString(a){let i=0;const s={type:Number(a.charAt(0))};if(Le[s.type]===void 0)throw new Error("unknown packet type "+s.type);if(s.type===Le.BINARY_EVENT||s.type===Le.BINARY_ACK){const f=i+1;for(;a.charAt(++i)!=="-"&&i!=a.length;);const d=a.substring(f,i);if(d!=Number(d)||a.charAt(i)!=="-")throw new Error("Illegal attachments");s.attachments=Number(d)}if(a.charAt(i+1)==="/"){const f=i+1;for(;++i&&!(a.charAt(i)===","||i===a.length););s.nsp=a.substring(f,i)}else s.nsp="/";const u=a.charAt(i+1);if(u!==""&&Number(u)==u){const f=i+1;for(;++i;){const d=a.charAt(i);if(d==null||Number(d)!=d){--i;break}if(i===a.length)break}s.id=Number(a.substring(f,i+1))}if(a.charAt(++i)){const f=this.tryParse(a.substr(i));if(mm.isPayloadValid(s.type,f))s.data=f;else throw new Error("invalid payload")}return s}tryParse(a){try{return JSON.parse(a,this.reviver)}catch{return!1}}static isPayloadValid(a,i){switch(a){case Le.CONNECT:return zv(i);case Le.DISCONNECT:return i===void 0;case Le.CONNECT_ERROR:return typeof i=="string"||zv(i);case Le.EVENT:case Le.BINARY_EVENT:return Array.isArray(i)&&(typeof i[0]=="number"||typeof i[0]=="string"&&GM.indexOf(i[0])===-1);case Le.ACK:case Le.BINARY_ACK:return Array.isArray(i)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class FM{constructor(a){this.packet=a,this.buffers=[],this.reconPack=a}takeBinaryData(a){if(this.buffers.push(a),this.buffers.length===this.reconPack.attachments){const i=zM(this.reconPack,this.buffers);return this.finishedReconstruction(),i}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const VM=Object.freeze(Object.defineProperty({__proto__:null,Decoder:mm,Encoder:qM,get PacketType(){return Le},protocol:kM},Symbol.toStringTag,{value:"Module"}));function Gn(n,a,i){return n.on(a,i),function(){n.off(a,i)}}const YM=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class Q_ extends bt{constructor(a,i,s){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=a,this.nsp=i,s&&s.auth&&(this.auth=s.auth),this._opts=Object.assign({},s),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const a=this.io;this.subs=[Gn(a,"open",this.onopen.bind(this)),Gn(a,"packet",this.onpacket.bind(this)),Gn(a,"error",this.onerror.bind(this)),Gn(a,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...a){return a.unshift("message"),this.emit.apply(this,a),this}emit(a,...i){var s,u,f;if(YM.hasOwnProperty(a))throw new Error('"'+a.toString()+'" is a reserved event name');if(i.unshift(a),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(i),this;const d={type:Le.EVENT,data:i};if(d.options={},d.options.compress=this.flags.compress!==!1,typeof i[i.length-1]=="function"){const b=this.ids++,_=i.pop();this._registerAckCallback(b,_),d.id=b}const h=(u=(s=this.io.engine)===null||s===void 0?void 0:s.transport)===null||u===void 0?void 0:u.writable,m=this.connected&&!(!((f=this.io.engine)===null||f===void 0)&&f._hasPingExpired());return this.flags.volatile&&!h||(m?(this.notifyOutgoingListeners(d),this.packet(d)):this.sendBuffer.push(d)),this.flags={},this}_registerAckCallback(a,i){var s;const u=(s=this.flags.timeout)!==null&&s!==void 0?s:this._opts.ackTimeout;if(u===void 0){this.acks[a]=i;return}const f=this.io.setTimeoutFn(()=>{delete this.acks[a];for(let h=0;h<this.sendBuffer.length;h++)this.sendBuffer[h].id===a&&this.sendBuffer.splice(h,1);i.call(this,new Error("operation has timed out"))},u),d=(...h)=>{this.io.clearTimeoutFn(f),i.apply(this,h)};d.withError=!0,this.acks[a]=d}emitWithAck(a,...i){return new Promise((s,u)=>{const f=(d,h)=>d?u(d):s(h);f.withError=!0,i.push(f),this.emit(a,...i)})}_addToQueue(a){let i;typeof a[a.length-1]=="function"&&(i=a.pop());const s={id:this._queueSeq++,tryCount:0,pending:!1,args:a,flags:Object.assign({fromQueue:!0},this.flags)};a.push((u,...f)=>s!==this._queue[0]?void 0:(u!==null?s.tryCount>this._opts.retries&&(this._queue.shift(),i&&i(u)):(this._queue.shift(),i&&i(null,...f)),s.pending=!1,this._drainQueue())),this._queue.push(s),this._drainQueue()}_drainQueue(a=!1){if(!this.connected||this._queue.length===0)return;const i=this._queue[0];i.pending&&!a||(i.pending=!0,i.tryCount++,this.flags=i.flags,this.emit.apply(this,i.args))}packet(a){a.nsp=this.nsp,this.io._packet(a)}onopen(){typeof this.auth=="function"?this.auth(a=>{this._sendConnectPacket(a)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(a){this.packet({type:Le.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},a):a})}onerror(a){this.connected||this.emitReserved("connect_error",a)}onclose(a,i){this.connected=!1,delete this.id,this.emitReserved("disconnect",a,i),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(a=>{if(!this.sendBuffer.some(s=>String(s.id)===a)){const s=this.acks[a];delete this.acks[a],s.withError&&s.call(this,new Error("socket has been disconnected"))}})}onpacket(a){if(a.nsp===this.nsp)switch(a.type){case Le.CONNECT:a.data&&a.data.sid?this.onconnect(a.data.sid,a.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case Le.EVENT:case Le.BINARY_EVENT:this.onevent(a);break;case Le.ACK:case Le.BINARY_ACK:this.onack(a);break;case Le.DISCONNECT:this.ondisconnect();break;case Le.CONNECT_ERROR:this.destroy();const s=new Error(a.data.message);s.data=a.data.data,this.emitReserved("connect_error",s);break}}onevent(a){const i=a.data||[];a.id!=null&&i.push(this.ack(a.id)),this.connected?this.emitEvent(i):this.receiveBuffer.push(Object.freeze(i))}emitEvent(a){if(this._anyListeners&&this._anyListeners.length){const i=this._anyListeners.slice();for(const s of i)s.apply(this,a)}super.emit.apply(this,a),this._pid&&a.length&&typeof a[a.length-1]=="string"&&(this._lastOffset=a[a.length-1])}ack(a){const i=this;let s=!1;return function(...u){s||(s=!0,i.packet({type:Le.ACK,id:a,data:u}))}}onack(a){const i=this.acks[a.id];typeof i=="function"&&(delete this.acks[a.id],i.withError&&a.data.unshift(null),i.apply(this,a.data))}onconnect(a,i){this.id=a,this.recovered=i&&this._pid===i,this._pid=i,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this._drainQueue(!0)}emitBuffered(){this.receiveBuffer.forEach(a=>this.emitEvent(a)),this.receiveBuffer=[],this.sendBuffer.forEach(a=>{this.notifyOutgoingListeners(a),this.packet(a)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(a=>a()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:Le.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(a){return this.flags.compress=a,this}get volatile(){return this.flags.volatile=!0,this}timeout(a){return this.flags.timeout=a,this}onAny(a){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(a),this}prependAny(a){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(a),this}offAny(a){if(!this._anyListeners)return this;if(a){const i=this._anyListeners;for(let s=0;s<i.length;s++)if(a===i[s])return i.splice(s,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(a){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(a),this}prependAnyOutgoing(a){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(a),this}offAnyOutgoing(a){if(!this._anyOutgoingListeners)return this;if(a){const i=this._anyOutgoingListeners;for(let s=0;s<i.length;s++)if(a===i[s])return i.splice(s,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(a){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const i=this._anyOutgoingListeners.slice();for(const s of i)s.apply(this,a.data)}}}function Bi(n){n=n||{},this.ms=n.min||100,this.max=n.max||1e4,this.factor=n.factor||2,this.jitter=n.jitter>0&&n.jitter<=1?n.jitter:0,this.attempts=0}Bi.prototype.duration=function(){var n=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var a=Math.random(),i=Math.floor(a*this.jitter*n);n=(Math.floor(a*10)&1)==0?n-i:n+i}return Math.min(n,this.max)|0};Bi.prototype.reset=function(){this.attempts=0};Bi.prototype.setMin=function(n){this.ms=n};Bi.prototype.setMax=function(n){this.max=n};Bi.prototype.setJitter=function(n){this.jitter=n};class Rh extends bt{constructor(a,i){var s;super(),this.nsps={},this.subs=[],a&&typeof a=="object"&&(i=a,a=void 0),i=i||{},i.path=i.path||"/socket.io",this.opts=i,Lu(this,i),this.reconnection(i.reconnection!==!1),this.reconnectionAttempts(i.reconnectionAttempts||1/0),this.reconnectionDelay(i.reconnectionDelay||1e3),this.reconnectionDelayMax(i.reconnectionDelayMax||5e3),this.randomizationFactor((s=i.randomizationFactor)!==null&&s!==void 0?s:.5),this.backoff=new Bi({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(i.timeout==null?2e4:i.timeout),this._readyState="closed",this.uri=a;const u=i.parser||VM;this.encoder=new u.Encoder,this.decoder=new u.Decoder,this._autoConnect=i.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(a){return arguments.length?(this._reconnection=!!a,a||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(a){return a===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=a,this)}reconnectionDelay(a){var i;return a===void 0?this._reconnectionDelay:(this._reconnectionDelay=a,(i=this.backoff)===null||i===void 0||i.setMin(a),this)}randomizationFactor(a){var i;return a===void 0?this._randomizationFactor:(this._randomizationFactor=a,(i=this.backoff)===null||i===void 0||i.setJitter(a),this)}reconnectionDelayMax(a){var i;return a===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=a,(i=this.backoff)===null||i===void 0||i.setMax(a),this)}timeout(a){return arguments.length?(this._timeout=a,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(a){if(~this._readyState.indexOf("open"))return this;this.engine=new DM(this.uri,this.opts);const i=this.engine,s=this;this._readyState="opening",this.skipReconnect=!1;const u=Gn(i,"open",function(){s.onopen(),a&&a()}),f=h=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",h),a?a(h):this.maybeReconnectOnOpen()},d=Gn(i,"error",f);if(this._timeout!==!1){const h=this._timeout,m=this.setTimeoutFn(()=>{u(),f(new Error("timeout")),i.close()},h);this.opts.autoUnref&&m.unref(),this.subs.push(()=>{this.clearTimeoutFn(m)})}return this.subs.push(u),this.subs.push(d),this}connect(a){return this.open(a)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const a=this.engine;this.subs.push(Gn(a,"ping",this.onping.bind(this)),Gn(a,"data",this.ondata.bind(this)),Gn(a,"error",this.onerror.bind(this)),Gn(a,"close",this.onclose.bind(this)),Gn(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(a){try{this.decoder.add(a)}catch(i){this.onclose("parse error",i)}}ondecoded(a){Du(()=>{this.emitReserved("packet",a)},this.setTimeoutFn)}onerror(a){this.emitReserved("error",a)}socket(a,i){let s=this.nsps[a];return s?this._autoConnect&&!s.active&&s.connect():(s=new Q_(this,a,i),this.nsps[a]=s),s}_destroy(a){const i=Object.keys(this.nsps);for(const s of i)if(this.nsps[s].active)return;this._close()}_packet(a){const i=this.encoder.encode(a);for(let s=0;s<i.length;s++)this.engine.write(i[s],a.options)}cleanup(){this.subs.forEach(a=>a()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(a,i){var s;this.cleanup(),(s=this.engine)===null||s===void 0||s.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",a,i),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const a=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const i=this.backoff.duration();this._reconnecting=!0;const s=this.setTimeoutFn(()=>{a.skipReconnect||(this.emitReserved("reconnect_attempt",a.backoff.attempts),!a.skipReconnect&&a.open(u=>{u?(a._reconnecting=!1,a.reconnect(),this.emitReserved("reconnect_error",u)):a.onreconnect()}))},i);this.opts.autoUnref&&s.unref(),this.subs.push(()=>{this.clearTimeoutFn(s)})}}onreconnect(){const a=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",a)}}const Ql={};function lu(n,a){typeof n=="object"&&(a=n,n=void 0),a=a||{};const i=LM(n,a.path||"/socket.io"),s=i.source,u=i.id,f=i.path,d=Ql[u]&&f in Ql[u].nsps,h=a.forceNew||a["force new connection"]||a.multiplex===!1||d;let m;return h?m=new Rh(s,a):(Ql[u]||(Ql[u]=new Rh(s,a)),m=Ql[u]),i.query&&!a.query&&(a.query=i.queryKey),m.socket(i.path,a)}Object.assign(lu,{Manager:Rh,Socket:Q_,io:lu,connect:lu});const PM=[Te.ActionTypes.MESSAGE_TO_GUEST,Te.ActionTypes.EVENT_TO_GUEST,Te.ActionTypes.TYPING_ON,Te.ActionTypes.TYPING_OFF,Te.ActionTypes.RESTART_CHAT_REQUEST,...Zx,...kO,"@@localize/SET_ACTIVE_LANGUAGE","@@localize/ADD_TRANSLATION_FOR_LANGUAGE"],XM=({dispatch:n,getState:a})=>i=>{let s=null;return u=>{const f=i(u);if(u.type===Wh){s?.disconnect(),n($x());const d=`/chat?${Su.stringify(u.querystrings)}`;s=lu(`/${u.clientName}${d}`),s.on("action",n),s.on("connect",()=>n(Wx())),s.on("disconnect",()=>n(Jx())),s.on("reconnect",()=>n(eC())),s.on("set-translations",(h,m)=>{n(q8({language:h,messages:j8(h,m)}))}),s.on("set-settings",h=>{n(Y8(h))}),s.on("enable-conversation-rating",h=>n(PO(h))),s.on("speech-transcription",h=>n(FO(h))),s.on("restore-client-state",h=>{n(Kx(h.sessionId)),n(ZO(h.messages))}),s.on("expand-window",({devices:h,initial:m=!1})=>{n({type:D1,devices:h,initial:m})}),s.on("restart-chat",()=>{n(ls())}),s.on("login-success",h=>{n(Gx({loginToken:h.loginToken}))})}else if(u.type==="start-screen/requestLogin")s?.emit("login-requested",u.payload);else if(u.type===Cu)s?.emit("start-chat",u.payload);else if(u.type===Ru)s?.emit("terminate-session",u.payload);else if(u.type===GO)s?.emit("get-started",JSON.stringify(u));else if(u.type===kh)s?.emit("audio-message",u.buffer);else if(u.type===Te.ActionTypes.CONVERSATION_RATING_FROM_GUEST)s?.emit("conversation-rating",u.payload);else if(u.type===B1){const{connection:{sessionId:d}}=a();window.location.href=`/transcript-pdf/${d}`}else PM.indexOf(u.type)===-1&&u.meta===void 0&&s&&s.emit("action",JSON.stringify(u));return f}},K_=Xh(),ZM={...Q8(K_),intl:M_},wh=xx({middleware:n=>n().concat(XM),reducer:X8,preloadedState:ZM});wh.subscribe(R8(()=>{const n=wh.getState();K8(K_,{connection:n.connection,startScreen:n.startScreen})},1e3));const QM=document.getElementById("root"),KM=mS.createRoot(QM);KM.render(y.jsx(hT,{store:wh,children:y.jsx(O8,{})}));
|
|
125
|
-
//# sourceMappingURL=index-
|
|
125
|
+
//# sourceMappingURL=index-x4vggU9m.js.map
|