@botfabrik/engine-webclient 4.100.10 → 4.100.11
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.
|
@@ -107,7 +107,7 @@ For more details see https://formatjs.github.io/docs/getting-started/message-dis
|
|
|
107
107
|
|
|
108
108
|
`)===-1)return null;let S="",H=0;for(;;){const Z=E.indexOf(`
|
|
109
109
|
`,H),X=E.slice(H,Z===-1?void 0:Z+1);if(h(f,X)||(S+=X,Z===-1||!X.trim()))break;H=Z+1}const N=Wl(S);return N===""?null:[S,,N]}),i:3,u:Sd,l:(E,R,S)=>m("p",{key:S.key},R(E.children,S))},22:{t:["["],o:Lr(DC),i:0,u:E=>(T[E[1]]={target:E[2],title:E[4]},{}),l:Ad},23:{t:["!["],o:lr(LC),i:0,u:E=>({alt:E[1]?Xn(E[1]):void 0,ref:E[2]}),l:(E,R,S)=>T[E.ref]?m("img",{key:S.key,alt:E.alt,src:s(T[E.ref].target,"img","src"),title:T[E.ref].title}):null},24:{t:E=>E[0]==="["&&E.indexOf("](")===-1,o:Lr(BC),i:0,u:(E,R,S)=>({children:R(E[1],S),fallbackChildren:E[0],ref:E[2]}),l:(E,R,S)=>T[E.ref]?m("a",{key:S.key,href:s(T[E.ref].target,"a","href"),title:T[E.ref].title},R(E.children,S)):m("span",{key:S.key},E.fallbackChildren)},25:{t:["|"],o:Oa(Fb),i:1,u:lR,l(E,R,S){const H=E;return m("table",{key:S.key},m("thead",null,m("tr",null,H.header.map(function(N,Z){return m("th",{key:Z,style:Xb(H,Z)},R(N,S))}))),m("tbody",null,H.cells.map(function(N,Z){return m("tr",{key:Z},N.map(function(X,te){return m("td",{key:te,style:Xb(H,te)},R(X,S))}))})))}},27:{o:Mi(function(E,R){let S;return tu(E,":")&&(S=YC.exec(E)),S||ZC.exec(E)}),i:4,u(E){const R=E[0];return{text:R.indexOf("&")===-1?R:R.replace(OC,(S,H)=>a.namedCodesToUnicode[H]||S)}},l:E=>E.text},28:{t:["**","__"],o:lr(kC),i:2,u:(E,R,S)=>({children:R(E[2],S)}),l:(E,R,S)=>m("strong",{key:S.key},R(E.children,S))},29:{t:E=>{const R=E[0];return(R==="*"||R==="_")&&E[1]!==R},o:lr(qC),i:3,u:(E,R,S)=>({children:R(E[2],S)}),l:(E,R,S)=>m("em",{key:S.key},R(E.children,S))},30:{t:["\\"],o:lr(PC),i:1,u:E=>({text:E[1],type:"27"})},31:{t:["=="],o:lr(FC),i:3,u:Sd,l:(E,R,S)=>m("mark",{key:S.key},R(E.children,S))},32:{t:["~~"],o:lr(VC),i:3,u:Sd,l:(E,R,S)=>m("del",{key:S.key},R(E.children,S))}};a.disableParsingRawHTML===!0&&(delete U[11],delete U[13]);const x=(function(E){var R=Object.keys(E);function S(H,N){var Z=[];if(N.prevCapture=N.prevCapture||"",H.trim())for(;H;)for(var X=0;X<R.length;){var te=R[X],de=E[te];if(!de.t||rR(H,N,de.t)){var ye=de.o(H,N);if(ye&&ye[0]){H=H.substring(ye[0].length);var re=de.u(ye,S,N);N.prevCapture+=ye[0],re.type||(re.type=te),Z.push(re);break}X++}else X++}return N.prevCapture="",Z}return R.sort(function(H,N){return E[H].i-E[N].i||(H<N?-1:1)}),function(H,N){return S((function(Z){return Z.replace(vC,`
|
|
110
|
-
`).replace(SC,"").replace(jC," ")})(H),N)}})(U),k=(function(E,R){return function S(H,N={}){if(Array.isArray(H)){const Z=N.key,X=[];let te=!1;for(let de=0;de<H.length;de++){N.key=de;const ye=S(H[de],N),re=Yb(ye);re&&te?X[X.length-1]+=ye:ye!==null&&X.push(ye),te=re}return N.key=Z,X}return(function(Z,X,te){const de=E[Z.type].l;return R?R(()=>de(Z,X,te),Z,X,te):de(Z,X,te)})(H,S,N)}})(U,a.renderRule),I=g(n);return _.length?m("div",null,I,m("footer",{key:"footer"},_.map(function(E){return m("div",{id:i(E.identifier,zl),key:E.identifier},E.identifier,k(x(E.footnote,{inline:!0})))}))):I}const Ra=n=>{let{children:a="",options:i}=n,s=(function(u,f){if(u==null)return{};var d,h,m={},g=Object.keys(u);for(h=0;h<g.length;h++)f.indexOf(d=g[h])>=0||(m[d]=u[d]);return m})(n,sC);return B.cloneElement(dR(a,i),s)},hR="_generalConditionsContainer_55hjg_1",mR="_generalConditions_55hjg_1",pR="_generalConditionsHeader_55hjg_15",gR="_generalConditionsBody_55hjg_26",yR="_generalConditionsAccept_55hjg_35",Gl={generalConditionsContainer:hR,generalConditions:mR,generalConditionsHeader:pR,generalConditionsBody:gR,generalConditionsAccept:yR},bR=()=>y.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1rem",height:"1rem",fill:"currentColor",viewBox:"0 0 256 256",children:y.jsx("path",{d:"M212.24,100.24l-80,80a6,6,0,0,1-8.48,0l-80-80a6,6,0,0,1,8.48-8.48L128,167.51l75.76-75.75a6,6,0,0,1,8.48,8.48Z"})}),vR=()=>y.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1rem",height:"1rem",fill:"currentColor",viewBox:"0 0 256 256",children:y.jsx("path",{d:"M212.24,164.24a6,6,0,0,1-8.48,0L128,88.49,52.24,164.24a6,6,0,0,1-8.48-8.48l80-80a6,6,0,0,1,8.48,0l80,80A6,6,0,0,1,212.24,164.24Z"})}),_R="general-conditions.header",ER="general-conditions.body",Zb="general-conditions.accept-conditions-note",SR=()=>{const n=tt(),[a,i]=B.useState(!1),s=()=>i(!a),u=h=>{h.key==="ArrowDown"||h.key==="ArrowRight"?i(!0):h.key==="ArrowUp"||h.key==="ArrowLeft"||h.key==="Escape"?i(!1):(h.key==="Enter"||h.key==="Space"||h.key===" ")&&s()},f=n(_R),d=n(Zb);return y.jsxs("div",{className:K(Gl.generalConditionsContainer,"chat__generalConditions"),children:[!!f?.length&&y.jsxs("div",{className:Gl.generalConditions,children:[y.jsxs("div",{role:"button",onClick:s,onKeyDown:u,tabIndex:0,className:K(Gl.generalConditionsHeader,"chat__generalConditions__header"),"aria-controls":"general-conditions-body","aria-expanded":a?"true":"false","aria-pressed":a?"true":"false",children:[y.jsx(Ra,{children:f}),a?y.jsx(vR,{}):y.jsx(bR,{})]}),y.jsx("div",{className:K(Gl.generalConditionsBody,"chat__generalConditions__body"),id:"general-conditions-body",role:"region",tabIndex:-1,children:a&&y.jsx(Ra,{children:n(ER)||""})})]}),!!d?.length&&y.jsx("div",{className:K(Gl.generalConditionsAccept,"chat__generalConditions__accept"),tabIndex:0,children:y.jsx(Ra,{children:n(Zb)||""})})]})},TR="_messageContainer_1rxi5_1",AR="_message_1rxi5_1",OR="_messageBot_1rxi5_14",xR="_messageBotLast_1rxi5_45",CR="_avatar_1rxi5_45",RR="_messageBotFirst_1rxi5_54",wR="_messageBotAnimated_1rxi5_67",NR="_messageGuest_1rxi5_78",MR="_messageGuestFirst_1rxi5_84",DR="_messageGuestLast_1rxi5_90",LR="_botAvatar_1rxi5_104",BR="_agentAvatar_1rxi5_108",UR="_bubble_1rxi5_112",jR="_bubbleContent_1rxi5_118",HR="_bubbleLeft_1rxi5_132",IR="_leftText_1rxi5_143",zR="_bubbleRight_1rxi5_150",GR="_rightText_1rxi5_160",kR="_sourceInfoReference_1rxi5_192",qR="_sourceInfoReferenceActive_1rxi5_204",ge={messageContainer:TR,message:AR,messageBot:OR,messageBotLast:xR,avatar:CR,messageBotFirst:RR,messageBotAnimated:wR,messageGuest:NR,messageGuestFirst:MR,messageGuestLast:DR,botAvatar:LR,agentAvatar:BR,bubble:UR,bubbleContent:jR,bubbleLeft:HR,leftText:IR,bubbleRight:zR,rightText:GR,sourceInfoReference:kR,sourceInfoReferenceActive:qR},lm=(n,a)=>{B.useEffect(()=>{const i=s=>{n.current&&!n.current.contains(s.target)&&a()};return document.addEventListener("mousedown",i),()=>document.removeEventListener("mousedown",i)},[n,a])};var xd,Qb;function sm(){if(Qb)return xd;Qb=1;function n(a){var i=typeof a;return a!=null&&(i=="object"||i=="function")}return xd=n,xd}var Cd,Kb;function FR(){if(Kb)return Cd;Kb=1;var n=typeof Co=="object"&&Co&&Co.Object===Object&&Co;return Cd=n,Cd}var Rd,$b;function d_(){if($b)return Rd;$b=1;var n=FR(),a=typeof self=="object"&&self&&self.Object===Object&&self,i=n||a||Function("return this")();return Rd=i,Rd}var wd,Wb;function VR(){if(Wb)return wd;Wb=1;var n=d_(),a=function(){return n.Date.now()};return wd=a,wd}var Nd,Jb;function YR(){if(Jb)return Nd;Jb=1;var n=/\s/;function a(i){for(var s=i.length;s--&&n.test(i.charAt(s)););return s}return Nd=a,Nd}var Md,ev;function PR(){if(ev)return Md;ev=1;var n=YR(),a=/^\s+/;function i(s){return s&&s.slice(0,n(s)+1).replace(a,"")}return Md=i,Md}var Dd,tv;function h_(){if(tv)return Dd;tv=1;var n=d_(),a=n.Symbol;return Dd=a,Dd}var Ld,nv;function XR(){if(nv)return Ld;nv=1;var n=h_(),a=Object.prototype,i=a.hasOwnProperty,s=a.toString,u=n?n.toStringTag:void 0;function f(d){var h=i.call(d,u),m=d[u];try{d[u]=void 0;var g=!0}catch{}var b=s.call(d);return g&&(h?d[u]=m:delete d[u]),b}return Ld=f,Ld}var Bd,av;function ZR(){if(av)return Bd;av=1;var n=Object.prototype,a=n.toString;function i(s){return a.call(s)}return Bd=i,Bd}var Ud,rv;function QR(){if(rv)return Ud;rv=1;var n=h_(),a=XR(),i=ZR(),s="[object Null]",u="[object Undefined]",f=n?n.toStringTag:void 0;function d(h){return h==null?h===void 0?u:s:f&&f in Object(h)?a(h):i(h)}return Ud=d,Ud}var jd,iv;function KR(){if(iv)return jd;iv=1;function n(a){return a!=null&&typeof a=="object"}return jd=n,jd}var Hd,lv;function $R(){if(lv)return Hd;lv=1;var n=QR(),a=KR(),i="[object Symbol]";function s(u){return typeof u=="symbol"||a(u)&&n(u)==i}return Hd=s,Hd}var Id,sv;function WR(){if(sv)return Id;sv=1;var n=PR(),a=sm(),i=$R(),s=NaN,u=/^[-+]0x[0-9a-f]+$/i,f=/^0b[01]+$/i,d=/^0o[0-7]+$/i,h=parseInt;function m(g){if(typeof g=="number")return g;if(i(g))return s;if(a(g)){var b=typeof g.valueOf=="function"?g.valueOf():g;g=a(b)?b+"":b}if(typeof g!="string")return g===0?g:+g;g=n(g);var _=f.test(g);return _||d.test(g)?h(g.slice(2),_?2:8):u.test(g)?s:+g}return Id=m,Id}var zd,ov;function m_(){if(ov)return zd;ov=1;var n=sm(),a=VR(),i=WR(),s="Expected a function",u=Math.max,f=Math.min;function d(h,m,g){var b,_,T,U,x,k,I=0,E=!1,R=!1,S=!0;if(typeof h!="function")throw new TypeError(s);m=i(m)||0,n(g)&&(E=!!g.leading,R="maxWait"in g,T=R?u(i(g.maxWait)||0,m):T,S="trailing"in g?!!g.trailing:S);function H(ce){var Xe=b,Ne=_;return b=_=void 0,I=ce,U=h.apply(Ne,Xe),U}function N(ce){return I=ce,x=setTimeout(te,m),E?H(ce):U}function Z(ce){var Xe=ce-k,Ne=ce-I,G=m-Xe;return R?f(G,T-Ne):G}function X(ce){var Xe=ce-k,Ne=ce-I;return k===void 0||Xe>=m||Xe<0||R&&Ne>=T}function te(){var ce=a();if(X(ce))return de(ce);x=setTimeout(te,Z(ce))}function de(ce){return x=void 0,S&&b?H(ce):(b=_=void 0,U)}function ye(){x!==void 0&&clearTimeout(x),I=0,b=k=_=x=void 0}function re(){return x===void 0?U:de(a())}function pe(){var ce=a(),Xe=X(ce);if(b=arguments,_=this,k=ce,Xe){if(x===void 0)return N(k);if(R)return clearTimeout(x),x=setTimeout(te,m),H(k)}return x===void 0&&(x=setTimeout(te,m)),U}return pe.cancel=ye,pe.flush=re,pe}return zd=d,zd}var JR=m_();const e6=vu(JR),t6="_container_131ib_1",n6="_categoryContainer_131ib_13",a6="_categoryButton_131ib_20",r6="_active_131ib_35",i6="_commentTextarea_131ib_44",kl={container:t6,categoryContainer:n6,categoryButton:a6,active:r6,commentTextarea:i6},l6=(n,a,i)=>{B.useEffect(()=>{if(n){const s=()=>{const f=["button:not([disabled])","textarea:not([disabled])",'[tabindex]:not([tabindex="-1"])',"a[href]","input:not([disabled])","select:not([disabled])"].join(","),d=a.current?Array.from(a.current.querySelectorAll(f)):[],h=i.current?Array.from(i.current.querySelectorAll(f)):[];return[...d,...h]},u=f=>{if(f.key==="Tab"){const d=s();if(d.length>0){const h=d[0],m=d[d.length-1],g=document.activeElement;!f.shiftKey&&g===m?(f.preventDefault(),h.focus()):f.shiftKey&&g===h&&(f.preventDefault(),m.focus())}}};return document.addEventListener("keydown",u,!0),()=>{document.removeEventListener("keydown",u,!0)}}},[n,a,i])},s6=({open:n,actionsRef:a,reaction:i,onReaction:s})=>{const u=tt(),f=B.useRef(null),d=e6(g=>{s({...i,comment:g})},300);B.useEffect(()=>()=>d.flush(),[d]),l6(n,a,f);const h=g=>{s({...i,category:i.category===g?void 0:g})},m=g=>d(g.target.value);return n?y.jsxs("div",{ref:f,className:kl.container,role:"dialog","aria-modal":"true","aria-labelledby":"bad-reaction-title",children:[y.jsx("h2",{id:"bad-reaction-title",children:u("bot-bubble.reaction.say-more")}),y.jsx("div",{className:kl.categoryContainer,role:"radiogroup",children:["WRONG_INFORMATION","MISSING_INFORMATION","OLD_INFORMATION","UNCLEAR","OFF_TOPIC"].map(g=>y.jsx("button",{className:K(kl.categoryButton,i?.category===g&&kl.active),onClick:()=>h(g),"aria-pressed":i?.category===g,"aria-label":u(`bot-bubble.reaction.category.${g}`),tabIndex:0,role:"radio",children:u(`bot-bubble.reaction.category.${g}`)},g))}),y.jsx("textarea",{id:"comment",name:"comment",placeholder:u("bot-bubble.reaction.comment"),defaultValue:i?.comment,onChange:m,className:kl.commentTextarea,rows:3,"aria-label":u("bot-bubble.reaction.comment")})]}):null},o6="_botMessageActionContainer_18fjb_1",u6="_alwaysVisible_18fjb_15",c6="_active_18fjb_19",f6="_botMessageActionInnerContainer_18fjb_27",d6="_header_18fjb_52",h6="_botMessageActions_18fjb_57",m6="_reported_18fjb_68",p6="_action_18fjb_72",g6="_wave_18fjb_86",y6="_anyReport_18fjb_156",b6="_closeButton_18fjb_172",lt={botMessageActionContainer:o6,alwaysVisible:u6,active:c6,botMessageActionInnerContainer:f6,header:d6,botMessageActions:h6,reported:m6,action:p6,wave:g6,anyReport:y6,closeButton:b6},v6=({isSubmitting:n,onClick:a})=>{const i=tt();return y.jsx("button",{className:K(lt.action,lt.closeButton,"tooltip--bottom-left"),"aria-label":i("bot-bubble.reaction.close"),"data-title":i("bot-bubble.reaction.close"),tabIndex:0,onClick:a,children:y.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 256 256",children:n?y.jsx("path",{d:"M229.66,77.66l-128,128a8,8,0,0,1-11.32,0l-56-56a8,8,0,0,1,11.32-11.32L96,188.69,218.34,66.34a8,8,0,0,1,11.32,11.32Z"}):y.jsx("path",{d:"M205.66,194.34a8,8,0,0,1-11.32,11.32L128,139.31,61.66,205.66a8,8,0,0,1-11.32-11.32L116.69,128,50.34,61.66A8,8,0,0,1,61.66,50.34L128,116.69l66.34-66.35a8,8,0,0,1,11.32,11.32L139.31,128Z"})})})},_6=({alwaysVisible:n,senderType:a,reaction:i,botMessageRef:s,message:u,animated:f,onReaction:d})=>{const h=tt(),[m,g]=B.useState(!1),[b,_]=B.useState(!1),[T,U]=B.useState(!1),x=B.useRef(null),k=B.useRef(null);lm(x,()=>{U(!1)});const I=Z=>{Z.key==="Escape"&&U(!1)};B.useEffect(()=>(document.addEventListener("keydown",I),()=>{document.removeEventListener("keydown",I)}),[]),B.useEffect(()=>{T&&x.current?.scrollIntoView({behavior:"smooth",block:"nearest",inline:"nearest"})},[T]);const E=Z=>{k.current&&clearTimeout(k.current),_(!0),d(Z),k.current=setTimeout(()=>{_(!1)},1e3)},R=B.useCallback(async()=>{if(s.current)try{g(!0);const Z=s.current.innerHTML,X=s.current.innerText;await navigator.clipboard.write([new ClipboardItem({"text/html":new Blob([Z],{type:"text/html"}),"text/plain":new Blob([X],{type:"text/plain"})})]),await new Promise(te=>setTimeout(te,1500))}finally{g(!1)}},[s]),S=()=>{U(!1),d(i?.type==="GOOD"?null:{type:"GOOD"})},H=()=>{d({...u.reaction,type:"BAD"}),U(!T)},N=Z=>X=>{(X.key==="Enter"||X.key===" ")&&Z()};return y.jsx("div",{ref:x,className:K(lt.botMessageActionContainer,n&<.alwaysVisible,T&<.active),children:y.jsxs("div",{className:K(lt.botMessageActionInnerContainer,n&<.alwaysVisible,T&<.active,i&<.reported),role:"group",children:[y.jsxs("div",{className:lt.header,children:[y.jsxs("div",{className:K(lt.botMessageActions,i&<.reported),children:[a===gu.BOT&&y.jsx("button",{className:K(lt.action,f&<.wave,i?.type&<.anyReport,i?.type==="GOOD"&<.reported,"tooltip--top-right"),tabIndex:0,"aria-label":h(i?.type==="GOOD"?"bot-bubble.reaction.remove":"bot-bubble.reaction.good"),"aria-pressed":i?.type==="GOOD","data-title":h(i?.type==="GOOD"?"bot-bubble.reaction.remove":"bot-bubble.reaction.good"),onPointerDown:S,onKeyDown:N(S),children:y.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 256 256",children:i?.type==="GOOD"?y.jsx("path",{d:"M234,80.12A24,24,0,0,0,216,72H160V56a40,40,0,0,0-40-40,8,8,0,0,0-7.16,4.42L75.06,96H32a16,16,0,0,0-16,16v88a16,16,0,0,0,16,16H204a24,24,0,0,0,23.82-21l12-96A24,24,0,0,0,234,80.12ZM32,112H72v88H32Z"}):y.jsx("path",{d:"M234,80.12A24,24,0,0,0,216,72H160V56a40,40,0,0,0-40-40,8,8,0,0,0-7.16,4.42L75.06,96H32a16,16,0,0,0-16,16v88a16,16,0,0,0,16,16H204a24,24,0,0,0,23.82-21l12-96A24,24,0,0,0,234,80.12ZM32,112H72v88H32ZM223.94,97l-12,96a8,8,0,0,1-7.94,7H88V105.89l36.71-73.43A24,24,0,0,1,144,56V80a8,8,0,0,0,8,8h64a8,8,0,0,1,7.94,9Z"})})}),a===gu.BOT&&y.jsx("button",{className:K(lt.action,f&<.wave,i?.type&<.anyReport,i?.type==="BAD"&<.reported,"tooltip--top-right"),tabIndex:0,"aria-label":h("bot-bubble.reaction.bad"),"aria-pressed":i?.type==="BAD","data-title":h("bot-bubble.reaction.bad"),onPointerDown:H,onKeyDown:N(H),children:y.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 256 256",children:i?.type==="BAD"?y.jsx("path",{d:"M239.82,157l-12-96A24,24,0,0,0,204,40H32A16,16,0,0,0,16,56v88a16,16,0,0,0,16,16H75.06l37.78,75.58A8,8,0,0,0,120,240a40,40,0,0,0,40-40V184h56a24,24,0,0,0,23.82-27ZM72,144H32V56H72Z"}):y.jsx("path",{d:"M239.82,157l-12-96A24,24,0,0,0,204,40H32A16,16,0,0,0,16,56v88a16,16,0,0,0,16,16H75.06l37.78,75.58A8,8,0,0,0,120,240a40,40,0,0,0,40-40V184h56a24,24,0,0,0,23.82-27ZM72,144H32V56H72Zm150,21.29a7.88,7.88,0,0,1-6,2.71H152a8,8,0,0,0-8,8v24a24,24,0,0,1-19.29,23.54L88,150.11V56H204a8,8,0,0,1,7.94,7l12,96A7.87,7.87,0,0,1,222,165.29Z"})})}),y.jsx("button",{className:K(lt.action,f&<.wave,"tooltip--top-right"),style:{visibility:T?"hidden":"visible"},tabIndex:0,"aria-label":h("bot-bubble.copy"),"data-title":h("bot-bubble.copy"),onClick:R,children:y.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 256 256",children:m?y.jsx("path",{d:"M229.66,77.66l-128,128a8,8,0,0,1-11.32,0l-56-56a8,8,0,0,1,11.32-11.32L96,188.69,218.34,66.34a8,8,0,0,1,11.32,11.32Z"}):y.jsx("path",{d:"M216,32H88a8,8,0,0,0-8,8V80H40a8,8,0,0,0-8,8V216a8,8,0,0,0,8,8H168a8,8,0,0,0,8-8V176h40a8,8,0,0,0,8-8V40A8,8,0,0,0,216,32ZM160,208H48V96H160Zm48-48H176V88a8,8,0,0,0-8-8H96V48H208Z"})})})]}),T&&y.jsx(v6,{isSubmitting:b,onClick:()=>U(!1)})]}),u.reaction&&y.jsx(s6,{open:T,actionsRef:x,reaction:u.reaction,onReaction:E})]})})},p_=B.forwardRef(({message:n,isAnimated:a,isFirstMessage:i,isLastMessage:s,isFirstMessageBySender:u,isLastMessageBySender:f,children:d,onReaction:h},m)=>{const g=tt(),b=B.useRef(null),_=n.sender.type===Te.UserType.BOT;return y.jsxs("li",{ref:m,className:K(ge.message,ge.messageBot,s&&ge.lastMessage,u&&ge.messageBotFirst,f&&ge.messageBotLast,"chat__bubbleContainer",a&&ge.messageBotAnimated,a&&"chat__bubbleContainer--animated",_?"chat__botBubbleContainer":"chat__agentBubbleContainer",u&&"chat__bubbleContainer--first",f&&"chat__bubbleContainer--last"),children:[y.jsx("img",{className:K(ge.avatar,_?ge.botAvatar:ge.agentAvatar,"chat__avatar",_?"chat__botAvatar":"chat__agentAvatar"),src:`${n.sender.avatar}`,alt:_?"Bot":"Agent",referrerPolicy:"no-referrer"}),y.jsxs("div",{className:ge.messageContainer,children:[y.jsx("div",{ref:b,className:K(ge.bubble,ge.bubbleLeft,"chat__bubble",_?"chat__botBubble":"chat__agentBubble"),tabIndex:0,"aria-label":g(_?"bot-bubble.label":"agent-bubble.label"),children:y.jsx("div",{className:K(ge.leftText),children:d})}),h&&y.jsx(_6,{alwaysVisible:s&&f,senderType:n.sender.type,reaction:n.reaction,message:n,botMessageRef:b,animated:i,onReaction:h})]})]})}),E6="_sourceList_1n31h_1",S6="_source_1n31h_1",T6="_label_1n31h_37",Gd={sourceList:E6,source:S6,label:T6},g_=n=>y.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 256 256",...n,children:y.jsx("path",{d:"M52,146H36a6,6,0,0,0-6,6v56a6,6,0,0,0,6,6H52a34,34,0,0,0,0-68Zm0,56H42V158H52a22,22,0,0,1,0,44Zm168.15-5.46a6,6,0,0,1,.18,8.48A28.06,28.06,0,0,1,200,214c-16.54,0-30-15.25-30-34s13.46-34,30-34a28.06,28.06,0,0,1,20.33,9,6,6,0,0,1-8.66,8.3A16.23,16.23,0,0,0,200,158c-9.93,0-18,9.87-18,22s8.07,22,18,22a16.23,16.23,0,0,0,11.67-5.28A6,6,0,0,1,220.15,196.54ZM128,146c-16.54,0-30,15.25-30,34s13.46,34,30,34,30-15.25,30-34S144.54,146,128,146Zm0,56c-9.93,0-18-9.87-18-22s8.07-22,18-22,18,9.87,18,22S137.93,202,128,202ZM48,118a6,6,0,0,0,6-6V40a2,2,0,0,1,2-2h90V88a6,6,0,0,0,6,6h50v18a6,6,0,0,0,12,0V88a6,6,0,0,0-1.76-4.24l-56-56A6,6,0,0,0,152,26H56A14,14,0,0,0,42,40v72A6,6,0,0,0,48,118ZM158,46.48,193.52,82H158Z"})}),y_=n=>y.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 256 256",...n,children:y.jsx("path",{d:"M212.24,83.76l-56-56A6,6,0,0,0,152,26H56A14,14,0,0,0,42,40V216a14,14,0,0,0,14,14H200a14,14,0,0,0,14-14V88A6,6,0,0,0,212.24,83.76ZM158,46.48,193.52,82H158ZM200,218H56a2,2,0,0,1-2-2V40a2,2,0,0,1,2-2h90V88a6,6,0,0,0,6,6h50V216A2,2,0,0,1,200,218Z"})}),b_=n=>y.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 256 256",...n,children:y.jsx("path",{d:"M222,152a6,6,0,0,1-6,6H190v20h18a6,6,0,0,1,0,12H190v18a6,6,0,0,1-12,0V152a6,6,0,0,1,6-6h32A6,6,0,0,1,222,152ZM90,172a26,26,0,0,1-26,26H54v10a6,6,0,0,1-12,0V152a6,6,0,0,1,6-6H64A26,26,0,0,1,90,172Zm-12,0a14,14,0,0,0-14-14H54v28H64A14,14,0,0,0,78,172Zm84,8a34,34,0,0,1-34,34H112a6,6,0,0,1-6-6V152a6,6,0,0,1,6-6h16A34,34,0,0,1,162,180Zm-12,0a22,22,0,0,0-22-22H118v44h10A22,22,0,0,0,150,180ZM42,112V40A14,14,0,0,1,56,26h96a6,6,0,0,1,4.25,1.76l56,56A6,6,0,0,1,214,88v24a6,6,0,0,1-12,0V94H152a6,6,0,0,1-6-6V38H56a2,2,0,0,0-2,2v72a6,6,0,0,1-12,0ZM158,82h35.52L158,46.48Z"})}),v_=n=>y.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 256 256",...n,children:y.jsx("path",{d:"M128,26A102,102,0,1,0,230,128,102.12,102.12,0,0,0,128,26Zm81.57,64H169.19a132.58,132.58,0,0,0-25.73-50.67A90.29,90.29,0,0,1,209.57,90ZM218,128a89.7,89.7,0,0,1-3.83,26H171.81a155.43,155.43,0,0,0,0-52h42.36A89.7,89.7,0,0,1,218,128Zm-90,87.83a110,110,0,0,1-15.19-19.45A124.24,124.24,0,0,1,99.35,166h57.3a124.24,124.24,0,0,1-13.46,30.38A110,110,0,0,1,128,215.83ZM96.45,154a139.18,139.18,0,0,1,0-52h63.1a139.18,139.18,0,0,1,0,52ZM38,128a89.7,89.7,0,0,1,3.83-26H84.19a155.43,155.43,0,0,0,0,52H41.83A89.7,89.7,0,0,1,38,128Zm90-87.83a110,110,0,0,1,15.19,19.45A124.24,124.24,0,0,1,156.65,90H99.35a124.24,124.24,0,0,1,13.46-30.38A110,110,0,0,1,128,40.17Zm-15.46-.84A132.58,132.58,0,0,0,86.81,90H46.43A90.29,90.29,0,0,1,112.54,39.33ZM46.43,166H86.81a132.58,132.58,0,0,0,25.73,50.67A90.29,90.29,0,0,1,46.43,166Zm97,50.67A132.58,132.58,0,0,0,169.19,166h40.38A90.29,90.29,0,0,1,143.46,216.67Z"})}),A6=({type:n,...a})=>{switch(n){case"WEBSITE":return y.jsx(v_,{...a});case"PDF":return y.jsx(b_,{...a});case"DOCX":return y.jsx(g_,{...a});default:return y.jsx(y_,{...a})}},om=({sources:n,onLinkClick:a})=>{const i=tt(),s=f=>()=>{a(f.url)},u=f=>d=>{(d.key==="Enter"||d.key===" ")&&a(f.url)};return n.length?y.jsx("ul",{className:Gd.sourceList,"aria-label":i("bot-bubble.sources"),children:n.map(f=>y.jsx("li",{className:Gd.source,children:y.jsxs("a",{role:"button",tabIndex:0,"aria-label":`${i("bot-bubble.source.open")}: ${f.label}`,onClick:s(f),onKeyDown:u(f),children:[y.jsx(A6,{type:f.type,"aria-hidden":"true"}),y.jsx("div",{className:Gd.label,children:f.label})]})},f.url))}):null},O6="_button_3ui4g_1",x6="_buttonDefault_3ui4g_13",C6="_buttonPrimary_3ui4g_28",ts={button:O6,buttonDefault:x6,buttonPrimary:C6},Nu=({className:n,children:a,...i})=>y.jsx("button",{className:K(ts.button,n),type:"button",role:"button",...i,children:a}),R6="_title_137pi_1",w6="_buttons_137pi_6",N6="_button_137pi_6",M6="_imageContainer_137pi_29",D6="_image_137pi_29",L6="_video_container_137pi_44",B6="_video_137pi_44",U6="_only_137pi_58",un={title:R6,buttons:w6,button:N6,imageContainer:M6,image:D6,video_container:L6,video:B6,only:U6},j6=({buttons:n,onButtonClick:a})=>y.jsx("div",{className:K(un.buttons,"chat__bubbleButtons"),children:n.map((i,s)=>y.jsx(Nu,{className:K(un.button,"chat__bubbleButton"),onClick:()=>a(i),children:i.title},s))}),uv="newtab#",__=({markdown:n,markdownOptions:a={},onLinkClick:i})=>{const s=f=>d=>(d.preventDefault(),f&&i(f),!1),u=({title:f,href:d,children:h})=>d.indexOf(uv)===0?y.jsx("a",{href:d.slice(uv.length),title:f,target:"_blank",rel:"noopener noreferrer",children:h}):y.jsx("a",{onClick:s(d),title:f,href:d,children:h});return y.jsx(Ra,{options:{...a,overrides:{a:u}},children:n})},H6=({text:n,onLinkClick:a})=>n?y.jsx("div",{children:y.jsx(__,{markdown:n,onLinkClick:a})}):null,I6=({title:n})=>n?y.jsx("h1",{className:un.title,children:n}):null,z6=({title:n,text:a,buttons:i,onButtonClick:s,onLinkClick:u})=>n?.length||a?.length||i?.length?y.jsxs("div",{className:K(ge.bubbleContent),children:[y.jsx(I6,{title:n}),y.jsx(H6,{text:a,onLinkClick:u}),y.jsx(j6,{buttons:i,onButtonClick:s})]}):null,G6=({alt:n,imageUrl:a,itemUrl:i,hasBody:s})=>a?i?i.indexOf("youtube.com")>-1?y.jsx("div",{className:un.video_container,children:y.jsx("iframe",{className:K(un.video,{[un.only]:!s}),title:"Youtube",width:"100%",src:i+"?rel=0",frameBorder:"0",allowFullScreen:!0})}):y.jsx("a",{href:i,target:"_blank",rel:"noopener noreferrer",children:y.jsx("div",{className:un.imageContainer,children:y.jsx("img",{className:K(un.image,{[un.only]:!s}),src:a,alt:n})})}):y.jsx("div",{className:un.imageContainer,children:y.jsx("img",{className:K(un.image,{[un.only]:!s}),src:a,alt:n})}):null,k6=({title:n,text:a,imageUrl:i,itemUrl:s,buttons:u,sources:f,onButtonClick:d,onLinkClick:h})=>{const m=!!n?.length||!!a?.length||!!u?.length;return y.jsxs("div",{className:K(un.detailMessage),children:[y.jsx(G6,{hasBody:m,imageUrl:i,itemUrl:s,alt:n||""}),m&&y.jsx(z6,{title:n,text:a,buttons:u,onLinkClick:h,onButtonClick:d}),y.jsx(om,{sources:f,onLinkClick:h})]})},q6=B.forwardRef(({isFirstMessageBySender:n,isLastMessageBySender:a,children:i},s)=>{const u=tt();return y.jsx("li",{ref:s,className:K(ge.message,ge.messageGuest,n&&ge.messageGuestFirst,a&&ge.messageGuestLast,"chat__bubbleContainer","chat__guestBubbleContainer",n&&"chat__bubbleContainer--first",a&&"chat__bubbleContainer--last"),children:y.jsx("div",{className:K(ge.bubble,ge.bubbleRight,"chat__bubble","chat__guestBubble"),tabIndex:0,"aria-label":u("guest-bubble.label"),children:y.jsx("div",{className:K(ge.rightText),children:i})})})}),F6="_markdown_nw7vg_1",E_={markdown:F6},um=()=>B.useMemo(()=>Xh(),[]),Zo="source-info-reference",V6=({actionId:n,markdown:a,sources:i,onLinkClick:s})=>{const u=um(),f=Da(),d=Y6(),h=st(b=>{const _=b.chat.sourceInfos;if(_?.type==="loaded"||_?.type==="loading")return _.chunkId}),m=b=>_=>{const T=_.key;(T==="ArrowDown"||T==="ArrowRight"||T==="Enter"||T===" "||T==="Space")&&(_.stopPropagation(),f(Mb(u,n,b)))},g=b=>()=>{f(Mb(u,n,b))};return B.useLayoutEffect(()=>{document.querySelectorAll(`.${Zo}`).forEach(b=>{const _=b.previousSibling;_&&_.nodeType===Node.TEXT_NODE&&_.textContent?.endsWith(" ")&&_.textContent?.trim().length&&b.classList.add(`${Zo}--before-space`);const T=b.nextSibling;T&&T.nodeType===Node.TEXT_NODE&&T.textContent?.startsWith(" ")&&T.textContent?.trim().length&&b.classList.add(`${Zo}--after-space`)})},[a]),y.jsxs("div",{className:ge.bubbleContent,children:[y.jsx("div",{className:E_.markdown,children:y.jsx(__,{markdown:a,onLinkClick:s,markdownOptions:{renderRule(b,_,T,U){if(_.type===oC.footnoteReference){const x=_.text===h;return y.jsx("span",{className:K(ge.sourceInfoReference,x&&ge.sourceInfoReferenceActive,Zo),children:y.jsx("a",{type:"button",tabIndex:0,onClick:g(_.text),onKeyDown:m(_.text),children:d(_.text)})},U.key)}return b()}}})}),y.jsx(om,{sources:i,onLinkClick:s})]})},Y6=()=>{const n=[];return i=>{const s=n.indexOf(i);return s>-1?s+1:(n.push(i),n.length)}},P6="_text_gp0s0_1",X6="_command_gp0s0_5",cv={text:P6,command:X6},Z6=({text:n,commands:a=[]})=>{const i=a.find(u=>n.startsWith(`/${u}`)),s=i?n.slice(i.length+1):n;return y.jsxs("div",{children:[i&&y.jsxs("code",{className:cv.command,children:["/",i]}),s.split(`
|
|
110
|
+
`).replace(SC,"").replace(jC," ")})(H),N)}})(U),k=(function(E,R){return function S(H,N={}){if(Array.isArray(H)){const Z=N.key,X=[];let te=!1;for(let de=0;de<H.length;de++){N.key=de;const ye=S(H[de],N),re=Yb(ye);re&&te?X[X.length-1]+=ye:ye!==null&&X.push(ye),te=re}return N.key=Z,X}return(function(Z,X,te){const de=E[Z.type].l;return R?R(()=>de(Z,X,te),Z,X,te):de(Z,X,te)})(H,S,N)}})(U,a.renderRule),I=g(n);return _.length?m("div",null,I,m("footer",{key:"footer"},_.map(function(E){return m("div",{id:i(E.identifier,zl),key:E.identifier},E.identifier,k(x(E.footnote,{inline:!0})))}))):I}const Ra=n=>{let{children:a,options:i}=n,s=(function(u,f){if(u==null)return{};var d,h,m={},g=Object.keys(u);for(h=0;h<g.length;h++)f.indexOf(d=g[h])>=0||(m[d]=u[d]);return m})(n,sC);return B.cloneElement(dR(a??"",i),s)},hR="_generalConditionsContainer_55hjg_1",mR="_generalConditions_55hjg_1",pR="_generalConditionsHeader_55hjg_15",gR="_generalConditionsBody_55hjg_26",yR="_generalConditionsAccept_55hjg_35",Gl={generalConditionsContainer:hR,generalConditions:mR,generalConditionsHeader:pR,generalConditionsBody:gR,generalConditionsAccept:yR},bR=()=>y.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1rem",height:"1rem",fill:"currentColor",viewBox:"0 0 256 256",children:y.jsx("path",{d:"M212.24,100.24l-80,80a6,6,0,0,1-8.48,0l-80-80a6,6,0,0,1,8.48-8.48L128,167.51l75.76-75.75a6,6,0,0,1,8.48,8.48Z"})}),vR=()=>y.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1rem",height:"1rem",fill:"currentColor",viewBox:"0 0 256 256",children:y.jsx("path",{d:"M212.24,164.24a6,6,0,0,1-8.48,0L128,88.49,52.24,164.24a6,6,0,0,1-8.48-8.48l80-80a6,6,0,0,1,8.48,0l80,80A6,6,0,0,1,212.24,164.24Z"})}),_R="general-conditions.header",ER="general-conditions.body",Zb="general-conditions.accept-conditions-note",SR=()=>{const n=tt(),[a,i]=B.useState(!1),s=()=>i(!a),u=h=>{h.key==="ArrowDown"||h.key==="ArrowRight"?i(!0):h.key==="ArrowUp"||h.key==="ArrowLeft"||h.key==="Escape"?i(!1):(h.key==="Enter"||h.key==="Space"||h.key===" ")&&s()},f=n(_R),d=n(Zb);return y.jsxs("div",{className:K(Gl.generalConditionsContainer,"chat__generalConditions"),children:[!!f?.length&&y.jsxs("div",{className:Gl.generalConditions,children:[y.jsxs("div",{role:"button",onClick:s,onKeyDown:u,tabIndex:0,className:K(Gl.generalConditionsHeader,"chat__generalConditions__header"),"aria-controls":"general-conditions-body","aria-expanded":a?"true":"false","aria-pressed":a?"true":"false",children:[y.jsx(Ra,{children:f}),a?y.jsx(vR,{}):y.jsx(bR,{})]}),y.jsx("div",{className:K(Gl.generalConditionsBody,"chat__generalConditions__body"),id:"general-conditions-body",role:"region",tabIndex:-1,children:a&&y.jsx(Ra,{children:n(ER)||""})})]}),!!d?.length&&y.jsx("div",{className:K(Gl.generalConditionsAccept,"chat__generalConditions__accept"),tabIndex:0,children:y.jsx(Ra,{children:n(Zb)||""})})]})},TR="_messageContainer_1rxi5_1",AR="_message_1rxi5_1",OR="_messageBot_1rxi5_14",xR="_messageBotLast_1rxi5_45",CR="_avatar_1rxi5_45",RR="_messageBotFirst_1rxi5_54",wR="_messageBotAnimated_1rxi5_67",NR="_messageGuest_1rxi5_78",MR="_messageGuestFirst_1rxi5_84",DR="_messageGuestLast_1rxi5_90",LR="_botAvatar_1rxi5_104",BR="_agentAvatar_1rxi5_108",UR="_bubble_1rxi5_112",jR="_bubbleContent_1rxi5_118",HR="_bubbleLeft_1rxi5_132",IR="_leftText_1rxi5_143",zR="_bubbleRight_1rxi5_150",GR="_rightText_1rxi5_160",kR="_sourceInfoReference_1rxi5_192",qR="_sourceInfoReferenceActive_1rxi5_204",ge={messageContainer:TR,message:AR,messageBot:OR,messageBotLast:xR,avatar:CR,messageBotFirst:RR,messageBotAnimated:wR,messageGuest:NR,messageGuestFirst:MR,messageGuestLast:DR,botAvatar:LR,agentAvatar:BR,bubble:UR,bubbleContent:jR,bubbleLeft:HR,leftText:IR,bubbleRight:zR,rightText:GR,sourceInfoReference:kR,sourceInfoReferenceActive:qR},lm=(n,a)=>{B.useEffect(()=>{const i=s=>{n.current&&!n.current.contains(s.target)&&a()};return document.addEventListener("mousedown",i),()=>document.removeEventListener("mousedown",i)},[n,a])};var xd,Qb;function sm(){if(Qb)return xd;Qb=1;function n(a){var i=typeof a;return a!=null&&(i=="object"||i=="function")}return xd=n,xd}var Cd,Kb;function FR(){if(Kb)return Cd;Kb=1;var n=typeof Co=="object"&&Co&&Co.Object===Object&&Co;return Cd=n,Cd}var Rd,$b;function d_(){if($b)return Rd;$b=1;var n=FR(),a=typeof self=="object"&&self&&self.Object===Object&&self,i=n||a||Function("return this")();return Rd=i,Rd}var wd,Wb;function VR(){if(Wb)return wd;Wb=1;var n=d_(),a=function(){return n.Date.now()};return wd=a,wd}var Nd,Jb;function YR(){if(Jb)return Nd;Jb=1;var n=/\s/;function a(i){for(var s=i.length;s--&&n.test(i.charAt(s)););return s}return Nd=a,Nd}var Md,ev;function PR(){if(ev)return Md;ev=1;var n=YR(),a=/^\s+/;function i(s){return s&&s.slice(0,n(s)+1).replace(a,"")}return Md=i,Md}var Dd,tv;function h_(){if(tv)return Dd;tv=1;var n=d_(),a=n.Symbol;return Dd=a,Dd}var Ld,nv;function XR(){if(nv)return Ld;nv=1;var n=h_(),a=Object.prototype,i=a.hasOwnProperty,s=a.toString,u=n?n.toStringTag:void 0;function f(d){var h=i.call(d,u),m=d[u];try{d[u]=void 0;var g=!0}catch{}var b=s.call(d);return g&&(h?d[u]=m:delete d[u]),b}return Ld=f,Ld}var Bd,av;function ZR(){if(av)return Bd;av=1;var n=Object.prototype,a=n.toString;function i(s){return a.call(s)}return Bd=i,Bd}var Ud,rv;function QR(){if(rv)return Ud;rv=1;var n=h_(),a=XR(),i=ZR(),s="[object Null]",u="[object Undefined]",f=n?n.toStringTag:void 0;function d(h){return h==null?h===void 0?u:s:f&&f in Object(h)?a(h):i(h)}return Ud=d,Ud}var jd,iv;function KR(){if(iv)return jd;iv=1;function n(a){return a!=null&&typeof a=="object"}return jd=n,jd}var Hd,lv;function $R(){if(lv)return Hd;lv=1;var n=QR(),a=KR(),i="[object Symbol]";function s(u){return typeof u=="symbol"||a(u)&&n(u)==i}return Hd=s,Hd}var Id,sv;function WR(){if(sv)return Id;sv=1;var n=PR(),a=sm(),i=$R(),s=NaN,u=/^[-+]0x[0-9a-f]+$/i,f=/^0b[01]+$/i,d=/^0o[0-7]+$/i,h=parseInt;function m(g){if(typeof g=="number")return g;if(i(g))return s;if(a(g)){var b=typeof g.valueOf=="function"?g.valueOf():g;g=a(b)?b+"":b}if(typeof g!="string")return g===0?g:+g;g=n(g);var _=f.test(g);return _||d.test(g)?h(g.slice(2),_?2:8):u.test(g)?s:+g}return Id=m,Id}var zd,ov;function m_(){if(ov)return zd;ov=1;var n=sm(),a=VR(),i=WR(),s="Expected a function",u=Math.max,f=Math.min;function d(h,m,g){var b,_,T,U,x,k,I=0,E=!1,R=!1,S=!0;if(typeof h!="function")throw new TypeError(s);m=i(m)||0,n(g)&&(E=!!g.leading,R="maxWait"in g,T=R?u(i(g.maxWait)||0,m):T,S="trailing"in g?!!g.trailing:S);function H(ce){var Xe=b,Ne=_;return b=_=void 0,I=ce,U=h.apply(Ne,Xe),U}function N(ce){return I=ce,x=setTimeout(te,m),E?H(ce):U}function Z(ce){var Xe=ce-k,Ne=ce-I,G=m-Xe;return R?f(G,T-Ne):G}function X(ce){var Xe=ce-k,Ne=ce-I;return k===void 0||Xe>=m||Xe<0||R&&Ne>=T}function te(){var ce=a();if(X(ce))return de(ce);x=setTimeout(te,Z(ce))}function de(ce){return x=void 0,S&&b?H(ce):(b=_=void 0,U)}function ye(){x!==void 0&&clearTimeout(x),I=0,b=k=_=x=void 0}function re(){return x===void 0?U:de(a())}function pe(){var ce=a(),Xe=X(ce);if(b=arguments,_=this,k=ce,Xe){if(x===void 0)return N(k);if(R)return clearTimeout(x),x=setTimeout(te,m),H(k)}return x===void 0&&(x=setTimeout(te,m)),U}return pe.cancel=ye,pe.flush=re,pe}return zd=d,zd}var JR=m_();const e6=vu(JR),t6="_container_131ib_1",n6="_categoryContainer_131ib_13",a6="_categoryButton_131ib_20",r6="_active_131ib_35",i6="_commentTextarea_131ib_44",kl={container:t6,categoryContainer:n6,categoryButton:a6,active:r6,commentTextarea:i6},l6=(n,a,i)=>{B.useEffect(()=>{if(n){const s=()=>{const f=["button:not([disabled])","textarea:not([disabled])",'[tabindex]:not([tabindex="-1"])',"a[href]","input:not([disabled])","select:not([disabled])"].join(","),d=a.current?Array.from(a.current.querySelectorAll(f)):[],h=i.current?Array.from(i.current.querySelectorAll(f)):[];return[...d,...h]},u=f=>{if(f.key==="Tab"){const d=s();if(d.length>0){const h=d[0],m=d[d.length-1],g=document.activeElement;!f.shiftKey&&g===m?(f.preventDefault(),h.focus()):f.shiftKey&&g===h&&(f.preventDefault(),m.focus())}}};return document.addEventListener("keydown",u,!0),()=>{document.removeEventListener("keydown",u,!0)}}},[n,a,i])},s6=({open:n,actionsRef:a,reaction:i,onReaction:s})=>{const u=tt(),f=B.useRef(null),d=e6(g=>{s({...i,comment:g})},300);B.useEffect(()=>()=>d.flush(),[d]),l6(n,a,f);const h=g=>{s({...i,category:i.category===g?void 0:g})},m=g=>d(g.target.value);return n?y.jsxs("div",{ref:f,className:kl.container,role:"dialog","aria-modal":"true","aria-labelledby":"bad-reaction-title",children:[y.jsx("h2",{id:"bad-reaction-title",children:u("bot-bubble.reaction.say-more")}),y.jsx("div",{className:kl.categoryContainer,role:"radiogroup",children:["WRONG_INFORMATION","MISSING_INFORMATION","OLD_INFORMATION","UNCLEAR","OFF_TOPIC"].map(g=>y.jsx("button",{className:K(kl.categoryButton,i?.category===g&&kl.active),onClick:()=>h(g),"aria-pressed":i?.category===g,"aria-label":u(`bot-bubble.reaction.category.${g}`),tabIndex:0,role:"radio",children:u(`bot-bubble.reaction.category.${g}`)},g))}),y.jsx("textarea",{id:"comment",name:"comment",placeholder:u("bot-bubble.reaction.comment"),defaultValue:i?.comment,onChange:m,className:kl.commentTextarea,rows:3,"aria-label":u("bot-bubble.reaction.comment")})]}):null},o6="_botMessageActionContainer_18fjb_1",u6="_alwaysVisible_18fjb_15",c6="_active_18fjb_19",f6="_botMessageActionInnerContainer_18fjb_27",d6="_header_18fjb_52",h6="_botMessageActions_18fjb_57",m6="_reported_18fjb_68",p6="_action_18fjb_72",g6="_wave_18fjb_86",y6="_anyReport_18fjb_156",b6="_closeButton_18fjb_172",lt={botMessageActionContainer:o6,alwaysVisible:u6,active:c6,botMessageActionInnerContainer:f6,header:d6,botMessageActions:h6,reported:m6,action:p6,wave:g6,anyReport:y6,closeButton:b6},v6=({isSubmitting:n,onClick:a})=>{const i=tt();return y.jsx("button",{className:K(lt.action,lt.closeButton,"tooltip--bottom-left"),"aria-label":i("bot-bubble.reaction.close"),"data-title":i("bot-bubble.reaction.close"),tabIndex:0,onClick:a,children:y.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 256 256",children:n?y.jsx("path",{d:"M229.66,77.66l-128,128a8,8,0,0,1-11.32,0l-56-56a8,8,0,0,1,11.32-11.32L96,188.69,218.34,66.34a8,8,0,0,1,11.32,11.32Z"}):y.jsx("path",{d:"M205.66,194.34a8,8,0,0,1-11.32,11.32L128,139.31,61.66,205.66a8,8,0,0,1-11.32-11.32L116.69,128,50.34,61.66A8,8,0,0,1,61.66,50.34L128,116.69l66.34-66.35a8,8,0,0,1,11.32,11.32L139.31,128Z"})})})},_6=({alwaysVisible:n,senderType:a,reaction:i,botMessageRef:s,message:u,animated:f,onReaction:d})=>{const h=tt(),[m,g]=B.useState(!1),[b,_]=B.useState(!1),[T,U]=B.useState(!1),x=B.useRef(null),k=B.useRef(null);lm(x,()=>{U(!1)});const I=Z=>{Z.key==="Escape"&&U(!1)};B.useEffect(()=>(document.addEventListener("keydown",I),()=>{document.removeEventListener("keydown",I)}),[]),B.useEffect(()=>{T&&x.current?.scrollIntoView({behavior:"smooth",block:"nearest",inline:"nearest"})},[T]);const E=Z=>{k.current&&clearTimeout(k.current),_(!0),d(Z),k.current=setTimeout(()=>{_(!1)},1e3)},R=B.useCallback(async()=>{if(s.current)try{g(!0);const Z=s.current.innerHTML,X=s.current.innerText;await navigator.clipboard.write([new ClipboardItem({"text/html":new Blob([Z],{type:"text/html"}),"text/plain":new Blob([X],{type:"text/plain"})})]),await new Promise(te=>setTimeout(te,1500))}finally{g(!1)}},[s]),S=()=>{U(!1),d(i?.type==="GOOD"?null:{type:"GOOD"})},H=()=>{d({...u.reaction,type:"BAD"}),U(!T)},N=Z=>X=>{(X.key==="Enter"||X.key===" ")&&Z()};return y.jsx("div",{ref:x,className:K(lt.botMessageActionContainer,n&<.alwaysVisible,T&<.active),children:y.jsxs("div",{className:K(lt.botMessageActionInnerContainer,n&<.alwaysVisible,T&<.active,i&<.reported),role:"group",children:[y.jsxs("div",{className:lt.header,children:[y.jsxs("div",{className:K(lt.botMessageActions,i&<.reported),children:[a===gu.BOT&&y.jsx("button",{className:K(lt.action,f&<.wave,i?.type&<.anyReport,i?.type==="GOOD"&<.reported,"tooltip--top-right"),tabIndex:0,"aria-label":h(i?.type==="GOOD"?"bot-bubble.reaction.remove":"bot-bubble.reaction.good"),"aria-pressed":i?.type==="GOOD","data-title":h(i?.type==="GOOD"?"bot-bubble.reaction.remove":"bot-bubble.reaction.good"),onPointerDown:S,onKeyDown:N(S),children:y.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 256 256",children:i?.type==="GOOD"?y.jsx("path",{d:"M234,80.12A24,24,0,0,0,216,72H160V56a40,40,0,0,0-40-40,8,8,0,0,0-7.16,4.42L75.06,96H32a16,16,0,0,0-16,16v88a16,16,0,0,0,16,16H204a24,24,0,0,0,23.82-21l12-96A24,24,0,0,0,234,80.12ZM32,112H72v88H32Z"}):y.jsx("path",{d:"M234,80.12A24,24,0,0,0,216,72H160V56a40,40,0,0,0-40-40,8,8,0,0,0-7.16,4.42L75.06,96H32a16,16,0,0,0-16,16v88a16,16,0,0,0,16,16H204a24,24,0,0,0,23.82-21l12-96A24,24,0,0,0,234,80.12ZM32,112H72v88H32ZM223.94,97l-12,96a8,8,0,0,1-7.94,7H88V105.89l36.71-73.43A24,24,0,0,1,144,56V80a8,8,0,0,0,8,8h64a8,8,0,0,1,7.94,9Z"})})}),a===gu.BOT&&y.jsx("button",{className:K(lt.action,f&<.wave,i?.type&<.anyReport,i?.type==="BAD"&<.reported,"tooltip--top-right"),tabIndex:0,"aria-label":h("bot-bubble.reaction.bad"),"aria-pressed":i?.type==="BAD","data-title":h("bot-bubble.reaction.bad"),onPointerDown:H,onKeyDown:N(H),children:y.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 256 256",children:i?.type==="BAD"?y.jsx("path",{d:"M239.82,157l-12-96A24,24,0,0,0,204,40H32A16,16,0,0,0,16,56v88a16,16,0,0,0,16,16H75.06l37.78,75.58A8,8,0,0,0,120,240a40,40,0,0,0,40-40V184h56a24,24,0,0,0,23.82-27ZM72,144H32V56H72Z"}):y.jsx("path",{d:"M239.82,157l-12-96A24,24,0,0,0,204,40H32A16,16,0,0,0,16,56v88a16,16,0,0,0,16,16H75.06l37.78,75.58A8,8,0,0,0,120,240a40,40,0,0,0,40-40V184h56a24,24,0,0,0,23.82-27ZM72,144H32V56H72Zm150,21.29a7.88,7.88,0,0,1-6,2.71H152a8,8,0,0,0-8,8v24a24,24,0,0,1-19.29,23.54L88,150.11V56H204a8,8,0,0,1,7.94,7l12,96A7.87,7.87,0,0,1,222,165.29Z"})})}),y.jsx("button",{className:K(lt.action,f&<.wave,"tooltip--top-right"),style:{visibility:T?"hidden":"visible"},tabIndex:0,"aria-label":h("bot-bubble.copy"),"data-title":h("bot-bubble.copy"),onClick:R,children:y.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 256 256",children:m?y.jsx("path",{d:"M229.66,77.66l-128,128a8,8,0,0,1-11.32,0l-56-56a8,8,0,0,1,11.32-11.32L96,188.69,218.34,66.34a8,8,0,0,1,11.32,11.32Z"}):y.jsx("path",{d:"M216,32H88a8,8,0,0,0-8,8V80H40a8,8,0,0,0-8,8V216a8,8,0,0,0,8,8H168a8,8,0,0,0,8-8V176h40a8,8,0,0,0,8-8V40A8,8,0,0,0,216,32ZM160,208H48V96H160Zm48-48H176V88a8,8,0,0,0-8-8H96V48H208Z"})})})]}),T&&y.jsx(v6,{isSubmitting:b,onClick:()=>U(!1)})]}),u.reaction&&y.jsx(s6,{open:T,actionsRef:x,reaction:u.reaction,onReaction:E})]})})},p_=B.forwardRef(({message:n,isAnimated:a,isFirstMessage:i,isLastMessage:s,isFirstMessageBySender:u,isLastMessageBySender:f,children:d,onReaction:h},m)=>{const g=tt(),b=B.useRef(null),_=n.sender.type===Te.UserType.BOT;return y.jsxs("li",{ref:m,className:K(ge.message,ge.messageBot,s&&ge.lastMessage,u&&ge.messageBotFirst,f&&ge.messageBotLast,"chat__bubbleContainer",a&&ge.messageBotAnimated,a&&"chat__bubbleContainer--animated",_?"chat__botBubbleContainer":"chat__agentBubbleContainer",u&&"chat__bubbleContainer--first",f&&"chat__bubbleContainer--last"),children:[y.jsx("img",{className:K(ge.avatar,_?ge.botAvatar:ge.agentAvatar,"chat__avatar",_?"chat__botAvatar":"chat__agentAvatar"),src:`${n.sender.avatar}`,alt:_?"Bot":"Agent",referrerPolicy:"no-referrer"}),y.jsxs("div",{className:ge.messageContainer,children:[y.jsx("div",{ref:b,className:K(ge.bubble,ge.bubbleLeft,"chat__bubble",_?"chat__botBubble":"chat__agentBubble"),tabIndex:0,"aria-label":g(_?"bot-bubble.label":"agent-bubble.label"),children:y.jsx("div",{className:K(ge.leftText),children:d})}),h&&y.jsx(_6,{alwaysVisible:s&&f,senderType:n.sender.type,reaction:n.reaction,message:n,botMessageRef:b,animated:i,onReaction:h})]})]})}),E6="_sourceList_1n31h_1",S6="_source_1n31h_1",T6="_label_1n31h_37",Gd={sourceList:E6,source:S6,label:T6},g_=n=>y.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 256 256",...n,children:y.jsx("path",{d:"M52,146H36a6,6,0,0,0-6,6v56a6,6,0,0,0,6,6H52a34,34,0,0,0,0-68Zm0,56H42V158H52a22,22,0,0,1,0,44Zm168.15-5.46a6,6,0,0,1,.18,8.48A28.06,28.06,0,0,1,200,214c-16.54,0-30-15.25-30-34s13.46-34,30-34a28.06,28.06,0,0,1,20.33,9,6,6,0,0,1-8.66,8.3A16.23,16.23,0,0,0,200,158c-9.93,0-18,9.87-18,22s8.07,22,18,22a16.23,16.23,0,0,0,11.67-5.28A6,6,0,0,1,220.15,196.54ZM128,146c-16.54,0-30,15.25-30,34s13.46,34,30,34,30-15.25,30-34S144.54,146,128,146Zm0,56c-9.93,0-18-9.87-18-22s8.07-22,18-22,18,9.87,18,22S137.93,202,128,202ZM48,118a6,6,0,0,0,6-6V40a2,2,0,0,1,2-2h90V88a6,6,0,0,0,6,6h50v18a6,6,0,0,0,12,0V88a6,6,0,0,0-1.76-4.24l-56-56A6,6,0,0,0,152,26H56A14,14,0,0,0,42,40v72A6,6,0,0,0,48,118ZM158,46.48,193.52,82H158Z"})}),y_=n=>y.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 256 256",...n,children:y.jsx("path",{d:"M212.24,83.76l-56-56A6,6,0,0,0,152,26H56A14,14,0,0,0,42,40V216a14,14,0,0,0,14,14H200a14,14,0,0,0,14-14V88A6,6,0,0,0,212.24,83.76ZM158,46.48,193.52,82H158ZM200,218H56a2,2,0,0,1-2-2V40a2,2,0,0,1,2-2h90V88a6,6,0,0,0,6,6h50V216A2,2,0,0,1,200,218Z"})}),b_=n=>y.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 256 256",...n,children:y.jsx("path",{d:"M222,152a6,6,0,0,1-6,6H190v20h18a6,6,0,0,1,0,12H190v18a6,6,0,0,1-12,0V152a6,6,0,0,1,6-6h32A6,6,0,0,1,222,152ZM90,172a26,26,0,0,1-26,26H54v10a6,6,0,0,1-12,0V152a6,6,0,0,1,6-6H64A26,26,0,0,1,90,172Zm-12,0a14,14,0,0,0-14-14H54v28H64A14,14,0,0,0,78,172Zm84,8a34,34,0,0,1-34,34H112a6,6,0,0,1-6-6V152a6,6,0,0,1,6-6h16A34,34,0,0,1,162,180Zm-12,0a22,22,0,0,0-22-22H118v44h10A22,22,0,0,0,150,180ZM42,112V40A14,14,0,0,1,56,26h96a6,6,0,0,1,4.25,1.76l56,56A6,6,0,0,1,214,88v24a6,6,0,0,1-12,0V94H152a6,6,0,0,1-6-6V38H56a2,2,0,0,0-2,2v72a6,6,0,0,1-12,0ZM158,82h35.52L158,46.48Z"})}),v_=n=>y.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 256 256",...n,children:y.jsx("path",{d:"M128,26A102,102,0,1,0,230,128,102.12,102.12,0,0,0,128,26Zm81.57,64H169.19a132.58,132.58,0,0,0-25.73-50.67A90.29,90.29,0,0,1,209.57,90ZM218,128a89.7,89.7,0,0,1-3.83,26H171.81a155.43,155.43,0,0,0,0-52h42.36A89.7,89.7,0,0,1,218,128Zm-90,87.83a110,110,0,0,1-15.19-19.45A124.24,124.24,0,0,1,99.35,166h57.3a124.24,124.24,0,0,1-13.46,30.38A110,110,0,0,1,128,215.83ZM96.45,154a139.18,139.18,0,0,1,0-52h63.1a139.18,139.18,0,0,1,0,52ZM38,128a89.7,89.7,0,0,1,3.83-26H84.19a155.43,155.43,0,0,0,0,52H41.83A89.7,89.7,0,0,1,38,128Zm90-87.83a110,110,0,0,1,15.19,19.45A124.24,124.24,0,0,1,156.65,90H99.35a124.24,124.24,0,0,1,13.46-30.38A110,110,0,0,1,128,40.17Zm-15.46-.84A132.58,132.58,0,0,0,86.81,90H46.43A90.29,90.29,0,0,1,112.54,39.33ZM46.43,166H86.81a132.58,132.58,0,0,0,25.73,50.67A90.29,90.29,0,0,1,46.43,166Zm97,50.67A132.58,132.58,0,0,0,169.19,166h40.38A90.29,90.29,0,0,1,143.46,216.67Z"})}),A6=({type:n,...a})=>{switch(n){case"WEBSITE":return y.jsx(v_,{...a});case"PDF":return y.jsx(b_,{...a});case"DOCX":return y.jsx(g_,{...a});default:return y.jsx(y_,{...a})}},om=({sources:n,onLinkClick:a})=>{const i=tt(),s=f=>()=>{a(f.url)},u=f=>d=>{(d.key==="Enter"||d.key===" ")&&a(f.url)};return n.length?y.jsx("ul",{className:Gd.sourceList,"aria-label":i("bot-bubble.sources"),children:n.map(f=>y.jsx("li",{className:Gd.source,children:y.jsxs("a",{role:"button",tabIndex:0,"aria-label":`${i("bot-bubble.source.open")}: ${f.label}`,onClick:s(f),onKeyDown:u(f),children:[y.jsx(A6,{type:f.type,"aria-hidden":"true"}),y.jsx("div",{className:Gd.label,children:f.label})]})},f.url))}):null},O6="_button_3ui4g_1",x6="_buttonDefault_3ui4g_13",C6="_buttonPrimary_3ui4g_28",ts={button:O6,buttonDefault:x6,buttonPrimary:C6},Nu=({className:n,children:a,...i})=>y.jsx("button",{className:K(ts.button,n),type:"button",role:"button",...i,children:a}),R6="_title_137pi_1",w6="_buttons_137pi_6",N6="_button_137pi_6",M6="_imageContainer_137pi_29",D6="_image_137pi_29",L6="_video_container_137pi_44",B6="_video_137pi_44",U6="_only_137pi_58",un={title:R6,buttons:w6,button:N6,imageContainer:M6,image:D6,video_container:L6,video:B6,only:U6},j6=({buttons:n,onButtonClick:a})=>y.jsx("div",{className:K(un.buttons,"chat__bubbleButtons"),children:n.map((i,s)=>y.jsx(Nu,{className:K(un.button,"chat__bubbleButton"),onClick:()=>a(i),children:i.title},s))}),uv="newtab#",__=({markdown:n,markdownOptions:a={},onLinkClick:i})=>{const s=f=>d=>(d.preventDefault(),f&&i(f),!1),u=({title:f,href:d,children:h})=>d.indexOf(uv)===0?y.jsx("a",{href:d.slice(uv.length),title:f,target:"_blank",rel:"noopener noreferrer",children:h}):y.jsx("a",{onClick:s(d),title:f,href:d,children:h});return y.jsx(Ra,{options:{...a,overrides:{a:u}},children:n})},H6=({text:n,onLinkClick:a})=>n?y.jsx("div",{children:y.jsx(__,{markdown:n,onLinkClick:a})}):null,I6=({title:n})=>n?y.jsx("h1",{className:un.title,children:n}):null,z6=({title:n,text:a,buttons:i,onButtonClick:s,onLinkClick:u})=>n?.length||a?.length||i?.length?y.jsxs("div",{className:K(ge.bubbleContent),children:[y.jsx(I6,{title:n}),y.jsx(H6,{text:a,onLinkClick:u}),y.jsx(j6,{buttons:i,onButtonClick:s})]}):null,G6=({alt:n,imageUrl:a,itemUrl:i,hasBody:s})=>a?i?i.indexOf("youtube.com")>-1?y.jsx("div",{className:un.video_container,children:y.jsx("iframe",{className:K(un.video,{[un.only]:!s}),title:"Youtube",width:"100%",src:i+"?rel=0",frameBorder:"0",allowFullScreen:!0})}):y.jsx("a",{href:i,target:"_blank",rel:"noopener noreferrer",children:y.jsx("div",{className:un.imageContainer,children:y.jsx("img",{className:K(un.image,{[un.only]:!s}),src:a,alt:n})})}):y.jsx("div",{className:un.imageContainer,children:y.jsx("img",{className:K(un.image,{[un.only]:!s}),src:a,alt:n})}):null,k6=({title:n,text:a,imageUrl:i,itemUrl:s,buttons:u,sources:f,onButtonClick:d,onLinkClick:h})=>{const m=!!n?.length||!!a?.length||!!u?.length;return y.jsxs("div",{className:K(un.detailMessage),children:[y.jsx(G6,{hasBody:m,imageUrl:i,itemUrl:s,alt:n||""}),m&&y.jsx(z6,{title:n,text:a,buttons:u,onLinkClick:h,onButtonClick:d}),y.jsx(om,{sources:f,onLinkClick:h})]})},q6=B.forwardRef(({isFirstMessageBySender:n,isLastMessageBySender:a,children:i},s)=>{const u=tt();return y.jsx("li",{ref:s,className:K(ge.message,ge.messageGuest,n&&ge.messageGuestFirst,a&&ge.messageGuestLast,"chat__bubbleContainer","chat__guestBubbleContainer",n&&"chat__bubbleContainer--first",a&&"chat__bubbleContainer--last"),children:y.jsx("div",{className:K(ge.bubble,ge.bubbleRight,"chat__bubble","chat__guestBubble"),tabIndex:0,"aria-label":u("guest-bubble.label"),children:y.jsx("div",{className:K(ge.rightText),children:i})})})}),F6="_markdown_nw7vg_1",E_={markdown:F6},um=()=>B.useMemo(()=>Xh(),[]),Zo="source-info-reference",V6=({actionId:n,markdown:a,sources:i,onLinkClick:s})=>{const u=um(),f=Da(),d=Y6(),h=st(b=>{const _=b.chat.sourceInfos;if(_?.type==="loaded"||_?.type==="loading")return _.chunkId}),m=b=>_=>{const T=_.key;(T==="ArrowDown"||T==="ArrowRight"||T==="Enter"||T===" "||T==="Space")&&(_.stopPropagation(),f(Mb(u,n,b)))},g=b=>()=>{f(Mb(u,n,b))};return B.useLayoutEffect(()=>{document.querySelectorAll(`.${Zo}`).forEach(b=>{const _=b.previousSibling;_&&_.nodeType===Node.TEXT_NODE&&_.textContent?.endsWith(" ")&&_.textContent?.trim().length&&b.classList.add(`${Zo}--before-space`);const T=b.nextSibling;T&&T.nodeType===Node.TEXT_NODE&&T.textContent?.startsWith(" ")&&T.textContent?.trim().length&&b.classList.add(`${Zo}--after-space`)})},[a]),y.jsxs("div",{className:ge.bubbleContent,children:[y.jsx("div",{className:E_.markdown,children:y.jsx(__,{markdown:a,onLinkClick:s,markdownOptions:{renderRule(b,_,T,U){if(_.type===oC.footnoteReference){const x=_.text===h;return y.jsx("span",{className:K(ge.sourceInfoReference,x&&ge.sourceInfoReferenceActive,Zo),children:y.jsx("a",{type:"button",tabIndex:0,onClick:g(_.text),onKeyDown:m(_.text),children:d(_.text)})},U.key)}return b()}}})}),y.jsx(om,{sources:i,onLinkClick:s})]})},Y6=()=>{const n=[];return i=>{const s=n.indexOf(i);return s>-1?s+1:(n.push(i),n.length)}},P6="_text_gp0s0_1",X6="_command_gp0s0_5",cv={text:P6,command:X6},Z6=({text:n,commands:a=[]})=>{const i=a.find(u=>n.startsWith(`/${u}`)),s=i?n.slice(i.length+1):n;return y.jsxs("div",{children:[i&&y.jsxs("code",{className:cv.command,children:["/",i]}),s.split(`
|
|
111
111
|
`).map((u,f)=>y.jsxs("span",{className:cv.text,children:[u,y.jsx("br",{})]},f))]})},Q6=({text:n,commands:a,sources:i,onLinkClick:s})=>y.jsxs("div",{className:ge.bubbleContent,children:[y.jsx(Z6,{text:n,commands:a}),y.jsx(om,{sources:i,onLinkClick:s})]}),K6=B.forwardRef(({message:n,commands:a,isFirstMessage:i,isLastMessage:s,isFirstMessageBySender:u,isLastMessageBySender:f,onReaction:d,onButtonClick:h,onLinkClick:m},g)=>{const b=$6(n._id,n,a,h,m),_=T=>{d(n._id,T)};switch(n.sender.type){case Te.UserType.GUEST:return y.jsx(q6,{ref:g,isFirstMessageBySender:u,isLastMessageBySender:f,children:b});default:return y.jsx(p_,{ref:g,message:n,isAnimated:!1,isFirstMessage:i,isLastMessage:s,isFirstMessageBySender:u,isLastMessageBySender:f,onReaction:_,children:b})}}),$6=(n,a,i,s,u)=>{switch(a.type){case Te.MessageTypeEnum.TEXT:{const f=a;return y.jsx(Q6,{text:f.text,commands:i,sources:a.sources||[],onLinkClick:u})}case Te.MessageTypeEnum.DETAIL:{const f=a;return y.jsx(k6,{title:f.title,text:f.text,imageUrl:f.imageUrl,itemUrl:f.itemUrl,buttons:f.buttons,sources:a.sources||[],onButtonClick:s,onLinkClick:u})}case Te.MessageTypeEnum.MARKDOWN:{const f=a;return y.jsx(V6,{actionId:n,markdown:f.markdown,sources:f.sources||[],onLinkClick:u})}}},W6=(n,a)=>n.message._id===a.message._id&&n.message.reaction===a.message.reaction&&n.isFirstMessage===a.isFirstMessage&&n.isLastMessage===a.isLastMessage&&n.isFirstMessageBySender===a.isFirstMessageBySender&&n.isLastMessageBySender===a.isLastMessageBySender,J6=Gv.memo(K6,W6),ew="_ticontainer_xg0dn_1",tw="_tiblock_xg0dn_5",nw="_tidot_xg0dn_12",ql={ticontainer:ew,tiblock:tw,tidot:nw},aw=({isTyping:n=!1})=>y.jsx("div",{className:ql.ticontainer,children:y.jsx("div",{className:ql.tiblock,children:n?y.jsxs(y.Fragment,{children:[y.jsx("div",{className:K(ql.tidot,"chat__typingIndicator")}),y.jsx("div",{className:K(ql.tidot,"chat__typingIndicator")}),y.jsx("div",{className:K(ql.tidot,"chat__typingIndicator")})]}):null})}),rw=Object.assign({_id:"typing-indicator"},new Te.TextMessage("",new Te.BotUser)),iw=({messages:n,isBotTyping:a,commands:i,onTranscriptItemReaction:s,onButtonClick:u,onLinkClick:f})=>{const d=B.useRef(0),h=B.useRef(!0),m=B.useRef(null),g=B.useRef(null),b=B.useRef(null),_=st(x=>x.settings.enableGeneralConditions);B.useLayoutEffect(()=>{if(n.length&&m.current&&(d.current<n.length||a)){if(g.current){const x=g.current.offsetTop;m.current.scrollTop=x}else if(b.current){const x=b.current.offsetTop;m.current.scrollTop=x}h.current&&(h.current=!1),d.current=n.length}},[n,h,a]);let T;const U=n.length;return y.jsxs("div",{ref:m,className:K(Lb.messageContainer,"chat__messageContainer"),style:{scrollBehavior:n.length&&h.current?"auto":"smooth"},id:"MessageContainer",role:"log","aria-live":"polite",children:[_&&y.jsx(SR,{}),y.jsxs("ul",{className:Lb.messages,children:[n.map((x,k)=>{const I=lw(x,T),E=sw(x,k,n,a);T=x.sender.type;const R=k+1===U,S=k===0,H=x._id||`added-${k}`;return y.jsx(J6,{ref:R?b:null,message:x,commands:i,isFirstMessage:S,isLastMessage:R,isFirstMessageBySender:I,isLastMessageBySender:E,onButtonClick:u,onLinkClick:f,onReaction:s},R&&!a?"last":H)}),a&&y.jsx(p_,{ref:g,message:rw,isFirstMessage:!1,isLastMessage:!1,isAnimated:!0,isFirstMessageBySender:T!==Te.UserType.BOT,isLastMessageBySender:!0,children:y.jsx(aw,{isTyping:!0})},"last")]})]})},lw=(n,a)=>!a||a!==n.sender.type,sw=(n,a,i,s)=>{const u=n.sender.type,f=i.length;return a+1===f?!(u===Te.UserType.BOT&&s):u!==i.at(a+1)?.sender.type},ow="_bottomSheet_jp8dl_1",uw="_bottomSheetOpen_jp8dl_15",cw="_bottomSheetClose_jp8dl_20",wa={bottomSheet:ow,bottomSheetOpen:uw,bottomSheetClose:cw},fw="_container_xc2nx_1",fv={container:fw},dw=({contentUrl:n})=>{const a=st(f=>f.connection.sessionId),[i,s]=B.useState(!1);B.useEffect(()=>{s(f=>f||!!n)},[n]);const u=B.useMemo(()=>{if(n&&a){const f=new URL(n,document.baseURI);return f.searchParams.set("sessionId",a),f.toString()}else return},[n,a]);return y.jsx("div",{className:K(fv.container,wa.bottomSheet,{[wa.bottomSheetOpen]:!!n,[wa.bottomSheetClose]:i&&!n}),children:u&&y.jsx("iframe",{title:"Drawer",src:u,className:fv.iframe})})},hw="_container_6tt4m_1",mw={container:hw},pw=({title:n,href:a,children:i})=>y.jsx("a",{href:a,title:n,target:"_blank",rel:"noopener noreferrer",children:i}),gw=()=>{const a=tt()("powered-by");return a&&a.length?y.jsx("div",{className:K(mw.container,"chat__poweredBy"),children:y.jsx(Ra,{options:{overrides:{a:pw}},children:a})}):null},S_=({className:n,children:a,...i})=>y.jsx(Nu,{className:K(ts.buttonDefault,n),type:"button",...i,children:a}),yu=({className:n,children:a,...i})=>y.jsx(Nu,{className:K(ts.buttonPrimary,n),...i,children:a}),yw="_container_h23mk_1",bw="_formContainer_h23mk_17",vw="_emailInput_h23mk_22",_w="_description_h23mk_52",Ew="_actions_h23mk_57",Sw="_validationError_h23mk_67",Tw="_submitted_h23mk_74",Br={container:yw,formContainer:bw,emailInput:vw,description:_w,actions:Ew,validationError:Sw,submitted:Tw},Aw=({visible:n,onEmailExport:a,onClose:i})=>{const s=tt(),[u,f]=B.useState(void 0),[d,h]=B.useState(!1),[m,g]=B.useState(void 0),b=B.useRef(null);B.useEffect(()=>{n?(b.current?.focus(),h(!1),f(n)):u===!0&&f(!1)},[n,u]);const _=U=>{U.preventDefault(),m&&m.length>0&&(a(m),h(!0),setTimeout(i,3*1e3))},T=U=>{const x=U.target.value.trim(),k=/^\w+([.-]?\w+)*@\w+([.-]?\w+)*(\.\w{2,3})+$/.test(x);g(k?x:"")};return y.jsxs("div",{className:K(Br.container,wa.bottomSheet,{[wa.bottomSheetOpen]:u===!0,[wa.bottomSheetClose]:u===!1}),children:[y.jsx("h2",{children:s("export-transcript.email.title")}),y.jsx(Ra,{className:Br.description,children:s("export-transcript.email.description")||""}),y.jsxs("form",{onSubmit:_,className:Br.formContainer,children:[y.jsxs("div",{children:[y.jsx("input",{disabled:d,ref:b,type:"email",placeholder:s("export-transcript.email.placeholder"),className:Br.emailInput,onChange:T}),m?.length===0?y.jsx("div",{className:Br.validationError,children:s("export-transcript.email.invalid")}):null]}),y.jsxs("div",{className:Br.actions,children:[y.jsx(S_,{onClick:i,children:s("export-transcript.email.cancel")}),y.jsx(yu,{type:"submit",disabled:d||m===void 0||m.length===0,children:s("export-transcript.email.send")})]})]}),d&&y.jsx("div",{className:Br.submitted,children:s("export-transcript.email.success")})]})},Ow="_inputContainer_fi5ao_1",xw={inputContainer:Ow},Cw="_blockUserInput_pot9c_1",Rw={blockUserInput:Cw},ww=({visible:n})=>{const a=tt();return n?y.jsx("div",{className:K(Rw.blockUserInput,"chat__blockUserInput"),children:a("block-user-input.title")}):null},Nw="_commandsDropdown_5ytuv_1",Mw="_commands_5ytuv_1",Dw="_command_5ytuv_1",Lw="_commandActive_5ytuv_46",Bw="_commandsSelections_5ytuv_55",Kl={commandsDropdown:Nw,commands:Mw,command:Dw,commandActive:Lw,commandsSelections:Bw},Uw=(n,a,i,s,u)=>{B.useEffect(()=>{const f=d=>{if(n.length)switch(d.key){case"Enter":i(n[a]);break;case"ArrowUp":s(h=>h>0?h-1:n.length-1);break;case"ArrowDown":s(h=>h<n.length-1?h+1:0);break;case"Escape":u([]);break}};return document.addEventListener("keydown",f),()=>{document.removeEventListener("keydown",f)}},[n,a,i,s,u])},jw=({text:n,commands:a,onSelectCommand:i,onVisibilityChange:s})=>{const u=B.useRef(null),f=tt(),[d,h]=B.useState([]),[m,g]=B.useState(dv(a)),[b,_]=B.useState(0),T=U=>i(`/${U}`);return lm(u,()=>h([])),Uw(d,b,T,_,h),B.useEffect(()=>{g(dv(a))},[a]),B.useEffect(()=>{const U=n.length||0;U===0||U>m||!n.startsWith("/")?h([]):h(a.filter(Hw(n))),_(0)},[a,n,m]),B.useEffect(()=>{s(!!d.length)},[d,s]),d.length?y.jsx("div",{ref:u,className:Kl.commandsDropdown,children:y.jsx("ul",{id:"command-list",className:Kl.commands,role:"listbox",children:d.map((U,x)=>y.jsxs("li",{className:K([Kl.command,b===x&&Kl.commandActive]),role:"option",onClick:()=>T(U),onMouseOver:()=>_(x),children:[y.jsxs("h1",{children:["/",U]}),y.jsx("p",{children:f(`commands.${U}`)})]},U))})}):null},dv=n=>Math.max(...n.map(a=>a.length+1)),Hw=n=>a=>{const i=`/${a}`;return i.startsWith(n)&&i.length>=n.length},hv=3,Iw=({commands:n,onSelectCommand:a})=>{const i=tt(),[s,u]=B.useState(!1),f=g=>()=>{a(`/${g}`),u(!1)},d=()=>{u(!0)},h=()=>{u(!1)},m=s?n:n.slice(0,hv);return y.jsxs("div",{className:Kl.commandsSelections,children:[m.map(g=>y.jsxs("button",{className:"tooltip--top-center","aria-label":i(`commands.${g}`),"data-title":i(`commands.${g}`),tabIndex:0,onClick:f(g),children:["/",g]},g)),m.length<n.length?y.jsx("button",{"aria-label":i("commands.show-more.tooltip"),"data-title":i("commands.show-more.tooltip"),tabIndex:0,onClick:d,children:i("commands.show-more.action")},"show-more"):m.length>hv?y.jsx("button",{"aria-label":i("commands.show-less.tooltip"),"data-title":i("commands.show-less.tooltip"),tabIndex:0,onClick:h,children:i("commands.show-less.action")},"show-less"):null]})},zw="_callToActionContainer_d8izj_1",Gw="_callToActionTitle_d8izj_23",kw="_rateOverlay_d8izj_30",qw="_body_d8izj_52",Fw="_footer_d8izj_60",Vw="_actions_d8izj_75",Yw="_bubbles_d8izj_89",Pw="_stars_d8izj_191",Xw="_starsSmall_d8izj_205",Zw="_starsLarge_d8izj_211",Qw="_star_d8izj_191",Kw="_starReadonly_d8izj_225",$w="_starIcon_d8izj_235",Ww="_starsDescriptionContainer_d8izj_253",Jw="_starsDescription_d8izj_253",Gt={callToActionContainer:zw,callToActionTitle:Gw,rateOverlay:kw,body:qw,footer:Fw,actions:Vw,bubbles:Yw,stars:Pw,starsSmall:Xw,starsLarge:Zw,star:Qw,starReadonly:Kw,starIcon:$w,starsDescriptionContainer:Ww,starsDescription:Jw},e3=({value:n,index:a,count:i,readonly:s,onHover:u,onClick:f})=>{const d=h=>{f&&h.key==="Enter"&&f()};return y.jsx("li",{className:K(Gt.star,{[Gt.starReadonly]:s},"chat__conversationRating__star"),children:y.jsx("div",{role:"radio","aria-checked":n>a?"true":"false","aria-posinset":a+1,"aria-setsize":i,tabIndex:0,onMouseOver:u,onKeyDown:d,onClick:f,children:y.jsx("span",{role:"img","aria-label":"Star",className:K(Gt.starIcon),children:y.jsx("svg",{viewBox:"64 64 896 896",focusable:"false","data-icon":"star",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",children:y.jsx("path",{d:"M908.1 353.1l-253.9-36.9L540.7 86.1c-3.1-6.3-8.2-11.4-14.5-14.5-15.8-7.8-35-1.3-42.9 14.5L369.8 316.2l-253.9 36.9c-7 1-13.4 4.3-18.3 9.3a32.05 32.05 0 00.6 45.3l183.7 179.1-43.4 252.9a31.95 31.95 0 0046.4 33.7L512 754l227.1 119.4c6.2 3.3 13.4 4.4 20.3 3.2 17.4-3 29.1-19.5 26.1-36.9l-43.4-252.9 183.7-179.1c5-4.9 8.3-11.3 9.3-18.3 2.7-17.5-9.5-33.7-27-36.3z"})})})})})},mv=5,T_=({value:n,size:a,readonly:i=!1,onChange:s})=>{const[u,f]=B.useState(void 0),d=()=>{f(void 0)},h=g=>()=>{if(!i){const b=g+1;f(b)}},m=g=>()=>{s&&!i&&(s(g===0&&n===1?0:g+1),f(void 0))};return y.jsx("ul",{tabIndex:0,role:"radiogroup",className:K(Gt.stars,{[Gt.starsSmall]:a==="small",[Gt.starsLarge]:a==="large"},"chat__conversationRating__stars",{chat__conversationRating__stars__small:a==="small",chat__conversationRating__stars__large:a==="large"}),onMouseOut:d,children:Array(mv).fill(0).map((g,b)=>y.jsx(e3,{value:u===void 0?n:u,index:b,count:mv,readonly:i,onHover:h(b),onClick:m(b)},b))})},t3=({visible:n,onRate:a})=>{const i=tt();return n?y.jsxs("div",{className:K(Gt.callToActionContainer,"chat__conversationRating__callToAction"),children:[y.jsx("div",{className:K(Gt.callToActionTitle,"chat__conversationRating__callToAction__title"),children:i("conversation-rating.call-to-action.title")}),y.jsx(T_,{value:0,size:"small",onChange:a})]}):null},kd=({isFirstMessageBySender:n,isLastMessageBySender:a,children:i})=>y.jsxs("div",{className:K(ge.message,ge.messageBot,n&&ge.messageBotFirst,a&&ge.messageBotLast,"chat__bubbleContainer","chat__botBubbleContainer",n&&"chat__bubbleContainer--first",a&&"chat__bubbleContainer--last"),children:[y.jsx("img",{className:K(ge.avatar,ge.botAvatar),src:"bot.svg",alt:"Bot"}),y.jsx("div",{className:K(ge.bubble,ge.bubbleLeft,"chat__bubble","chat__botBubble"),children:y.jsx("div",{className:K(ge.leftText,ge.bubbleContent),children:i})})]}),n3=({children:n})=>y.jsx("div",{className:K(ge.message,ge.messageGuest,ge.messageGuestFirst,ge.messageGuestLast,"chat__bubbleContainer","chat__guestBubbleContainer","chat__bubbleContainer--first","chat__bubbleContainer--last"),children:y.jsx("div",{className:K(ge.bubble,ge.bubbleRight,"chat__bubble","chat__guestBubble"),children:y.jsx("div",{className:K(ge.rightText,ge.bubbleContent),children:n})})}),a3=()=>{const n=tt(),a=Da(),i=st(I=>I.chat.conversationRating),[s,u]=B.useState(i.rating?.value||0),[f,d]=B.useState(void 0),[h,m]=B.useState(void 0),[g,b]=B.useState({submitted:!1,feedback:""}),_=B.useRef(null),[T,U]=B.useState(!1);B.useEffect(()=>{i.opener?(b({submitted:!1,feedback:""}),m(!0)):h===!0&&m(!1)},[i.opener,h]),B.useEffect(()=>{u(i.rating?.value||0)},[i.rating?.value,i.opener]),B.useEffect(()=>{_.current&&(_.current.value=i.rating?.feedback||"")},[i.rating?.feedback]),B.useEffect(()=>{const I=s>0?n(`conversation-rating.overlay.bot-message.rate-feedback.value-${s}`):void 0;d(I?.length?I:void 0)},[s,n]),B.useEffect(()=>{g.submitted?setTimeout(()=>U(!0),g.feedback.length?500:0):U(!1)},[g]);const x=I=>{I.preventDefault();const E=_.current?.value?.trim()||"";a(XO(s,E)),b({submitted:!0,feedback:E})},k=()=>{i.opener==="CLOSE_CHAT"?a(t_()):i.opener==="RESTART_CHAT"?a(ls()):a(Px())};return y.jsx("div",{className:K(Gt.rateOverlay,wa.bottomSheet,"chat__conversationRating__overlay",{[wa.bottomSheetOpen]:h===!0,[wa.bottomSheetClose]:h===!1}),children:y.jsxs("form",{onSubmit:x,children:[y.jsxs("div",{className:K(Gt.body,"chat__conversationRating__overlay__body"),children:[y.jsx("div",{}),y.jsx("div",{className:K(Gt.bubbles),children:i.opener&&y.jsxs(y.Fragment,{children:[y.jsxs(kd,{isFirstMessageBySender:!0,isLastMessageBySender:!f,children:[y.jsx("h2",{children:n("conversation-rating.overlay.title")}),y.jsxs("div",{className:K(Gt.starsDescriptionContainer),children:[y.jsx(T_,{value:s,size:"large",readonly:g.submitted,onChange:u}),y.jsxs("div",{className:K(Gt.starsDescription),children:[y.jsx("div",{children:n("conversation-rating.overlay.star.very-bad")}),y.jsx("div",{children:n("conversation-rating.overlay.star.very-good")})]})]})]}),f&&y.jsx(kd,{isFirstMessageBySender:!1,isLastMessageBySender:!T||!!g.feedback.length,children:y.jsx("div",{children:f})}),!!g.feedback.length&&y.jsx(n3,{children:g.feedback}),T&&y.jsx(kd,{isFirstMessageBySender:!!g.feedback.length,isLastMessageBySender:!0,children:y.jsx("div",{children:n("conversation-rating.overlay.bot-message.submit-feedback")})})]})})]}),y.jsxs("div",{className:K(Gt.footer,"chat__conversationRating__overlay__footer"),children:[!g.submitted&&y.jsx("input",{ref:_,defaultValue:i.rating?.feedback||"",placeholder:n("conversation-rating.overlay.guest-feedback.input-placeholder")}),y.jsxs("div",{className:K(Gt.actions,"chat__conversationRating__overlay__footer__actions"),children:[g.submitted?y.jsx(yu,{type:"button",disabled:!s,onClick:k,children:i.opener==="CLOSE_CHAT"?n("conversation-rating.overlay.action.close-chat"):i.opener==="RESTART_CHAT"?n("conversation-rating.overlay.action.restart-chat"):n("conversation-rating.overlay.action.back-to-chat")},"close-button"):y.jsx(yu,{type:"submit",disabled:!s,children:n("conversation-rating.overlay.action.submit")},"submit-button"),i.opener!=="CHAT"&&!g.submitted&&y.jsx(S_,{onClick:k,children:i.opener==="CLOSE_CHAT"?n("conversation-rating.overlay.action.close-chat"):i.opener==="RESTART_CHAT"?n("conversation-rating.overlay.action.restart-chat"):n("conversation-rating.overlay.action.cancel")})]})]})]})})},r3=({numberOfMessagesFromGuest:n})=>{const a=Da(),i=st(f=>f.chat.conversationRating),s=f=>{a(pu("CHAT",f))},u=!i.rating?.value&&n>=1;return i.enabled?y.jsxs(y.Fragment,{children:[y.jsx(t3,{visible:u,onRate:s}),y.jsx(a3,{})]}):null},i3=B.memo(r3),l3="_inputWrapper_e3h44_1",s3="_withOpenCommands_e3h44_14",o3="_messageInputWrapper_e3h44_20",u3="_messageInput_e3h44_20",c3="_buttons_e3h44_44",f3="_button_e3h44_44",Ci={inputWrapper:l3,withOpenCommands:s3,messageInputWrapper:o3,messageInput:u3,buttons:c3,button:f3},d3="_audioRecorder_g845f_1",h3="_audioButton_g845f_6",m3="_recorderIcon_g845f_37",p3="_spinning_g845f_60",Ur={audioRecorder:d3,audioButton:h3,recorderIcon:m3,spinning:p3},pv=2048,bu=16e3;class g3 extends Gv.Component{audioInput=null;volume=null;leftchannel=[];recorder=null;recordingLength=0;sampleRate=null;mediaStream=null;constructor(a){super(a),this.state={recordingState:"none"},this.triggerAudioRecording=this.triggerAudioRecording.bind(this),this.triggerAudioRecordingSuccess=this.triggerAudioRecordingSuccess.bind(this),this.initRecording=this.initRecording.bind(this),this.processRecordingInput=this.processRecordingInput.bind(this),this.handleClickSubmitAudio=this.handleClickSubmitAudio.bind(this),this.handleClickStopAudio=this.handleClickStopAudio.bind(this)}triggerAudioRecording(){this.setState({recordingState:"connecting"}),navigator.mediaDevices.getUserMedia({audio:!0,video:!1}).then(this.triggerAudioRecordingSuccess)}triggerAudioRecordingSuccess(a){this.mediaStream=a,this.leftchannel.length=0,this.recordingLength=0,this.initRecording(a)}initRecording(a){const i=window.AudioContext||window.webkitAudioContext,s=new i;this.sampleRate=s.sampleRate,this.volume=s.createGain(),this.audioInput=s.createMediaStreamSource(a),this.audioInput.connect(this.volume),this.recorder=s.createScriptProcessor(pv,1,1),this.recorder.onaudioprocess=this.processRecordingInput,this.volume.connect(this.recorder),this.recorder.connect(s.destination)}processRecordingInput(a){if(this.state.recordingState==="connecting"&&this.setState({recordingState:"recording"}),this.state.recordingState!=="none"){const i=a.inputBuffer.getChannelData(0);this.leftchannel.push(new Float32Array(i)),this.recordingLength+=pv}}handleClickSubmitAudio(){const a=b3(this.leftchannel,this.recordingLength),i=v3(a,this.sampleRate||0),s=y3(i);this.props.onAudioRecorded(s),this.handleClickStopAudio()}handleClickStopAudio(){this.setState({recordingState:"none"}),this.audioInput?.disconnect(),this.volume?.disconnect(),this.recorder?.disconnect(),this.mediaStream&&this.mediaStream?.getAudioTracks().forEach(a=>{a.stop()})}render(){return y.jsxs("div",{className:Ur.audioRecorder,children:[this.state.recordingState==="none"&&y.jsx("button",{className:K(Ur.audioButton,"chat__button"),type:"submit","aria-label":this.props.translate("message-input.actions.start-audio-recording.label"),"data-title":this.props.translate("message-input.actions.start-audio-recording.label"),tabIndex:0,onClick:this.triggerAudioRecording,children:y.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",children:[y.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 3zm5.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.72h-1.7z"}),y.jsx("path",{d:"M0 0h24v24H0z",fill:"none"})]})}),this.state.recordingState==="connecting"&&y.jsxs("svg",{className:Ur.spinning,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",children:[y.jsx("path",{d:"M17.65 6.35C16.2 4.9 14.21 4 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08c-.82 2.33-3.04 4-5.65 4-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4l-2.35 2.35z"}),y.jsx("path",{d:"M0 0h24v24H0z",fill:"none"})]}),this.state.recordingState==="recording"&&y.jsxs("div",{className:Ur.audioRecorder,children:[y.jsx("button",{className:K(Ur.audioButton),onClick:this.handleClickStopAudio,"aria-label":this.props.translate("message-input.actions.stop-audio-recording.label"),tabIndex:0,children:y.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",children:[y.jsx("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}),y.jsx("path",{d:"M0 0h24v24H0z",fill:"none"})]})}),y.jsx("div",{className:Ur.recorderIcon}),y.jsx("button",{className:K(Ur.audioButton),type:"submit",onClick:this.handleClickSubmitAudio,"aria-label":this.props.translate("message-input.actions.submit-audio-recording.label"),tabIndex:0,autoFocus:!0,children:y.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",children:[y.jsx("path",{d:"M0 0h24v24H0z",fill:"none"}),y.jsx("path",{d:"M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"})]})})]})]})}}const y3=n=>{const a=new ArrayBuffer(44+n.length*2),i=new DataView(a);Qo(i,0,"RIFF"),i.setUint32(4,44+n.length*2,!0),Qo(i,8,"WAVE"),Qo(i,12,"fmt "),i.setUint32(16,16,!0),i.setUint16(20,1,!0),i.setUint16(22,1,!0),i.setUint32(24,bu,!0),i.setUint32(28,bu*4,!0),i.setUint16(32,4,!0),i.setUint16(34,16,!0),Qo(i,36,"data"),i.setUint32(40,n.length*2,!0);const s=n.length;let u=44;const f=1;for(let d=0;d<s;d++)i.setInt16(u,n[d]*(32767*f),!0),u+=2;return new Blob([i],{type:"audio/wav"})},Qo=(n,a,i)=>{for(let s=0;s<i.length;s++)n.setUint8(a+s,i.charCodeAt(s))},b3=(n,a)=>{const i=new Float32Array(a);let s=0;const u=n.length;for(let f=0;f<u;f++){const d=n[f];i.set(d,s),s+=d.length}return i},v3=(n,a)=>{if(bu===a)return n;const i=a/bu,s=Math.round(n.length/i),u=new Float32Array(s);let f=0,d=0;for(;f<u.length;){const h=Math.round((f+1)*i);let m=0,g=0;for(let b=d;b<h&&b<n.length;b++)m+=n[b],g++;u[f]=m/g,f++,d=h}return u},_3=({disabled:n,textInput:a,commandsVisible:i,hasCommands:s,onTextInput:u,onTextInputSubmit:f,onAudioRecorded:d})=>{const h=tt(),m=B.useRef(null),{enableSpeechSupport:g}=st(x=>x.settings);B.useEffect(()=>{m.current?.focus()},[a]);const b=()=>{const x=m.current;x&&a.trim().length>=1&&f(a.trim())&&(x.value="",x.style.height="",x.focus())},_=x=>{x.preventDefault(),b()},T=x=>{const k=x.target.value;u(k),x.target.style.height="";const{scrollHeight:I}=x.target;x.target.style.height=`${I>150?150:I}px`},U=x=>{x.code==="Enter"&&!x.shiftKey?(x.repeat||b(),x.preventDefault()):i&&(x.code==="ArrowUp"||x.code==="ArrowDown")&&x.preventDefault()};return y.jsxs("form",{className:K(Ci.inputWrapper,i&&Ci.withOpenCommands,"chat__textInput"),onSubmit:_,children:[y.jsx("div",{className:Ci.messageInputWrapper,children:y.jsx("textarea",{id:"user_input",ref:m,className:Ci.messageInput,tabIndex:0,placeholder:h("message-input-placeholder"),value:a,onChange:T,onKeyDown:U,"aria-label":h("message-input-label"),"aria-controls":s?"command-list":void 0,"aria-haspopup":s?"listbox":void 0})}),y.jsx("div",{className:K(Ci.buttons,"chat__buttons"),children:a.length||!g||navigator.mediaDevices===void 0?y.jsx("button",{className:K(Ci.button,"chat__button"),type:"submit","aria-label":h("message-input.actions.submit.label"),"data-title":h("message-input.actions.submit.label"),tabIndex:0,disabled:n,children:y.jsx("svg",{viewBox:"64 64 896 896",focusable:"false",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",children:y.jsx("path",{d:"M931.4 498.9L94.9 79.5c-3.4-1.7-7.3-2.1-11-1.2a15.99 15.99 0 00-11.7 19.3l86.2 352.2c1.3 5.3 5.2 9.6 10.4 11.3l147.7 50.7-147.6 50.7c-5.2 1.8-9.1 6-10.3 11.3L72.2 926.5c-.9 3.7-.5 7.6 1.2 10.9 3.9 7.9 13.5 11.1 21.5 7.2l836.5-417c3.1-1.5 5.6-4.1 7.2-7.1 3.9-8 .7-17.6-7.2-21.6zM170.8 826.3l50.3-205.6 295.2-101.3c2.3-.8 4.2-2.6 5-5 1.4-4.2-.8-8.7-5-10.2L221.1 403 171 198.2l628 314.9-628.2 313.2z"})})}):g&&navigator.mediaDevices!==void 0&&y.jsx(g3,{translate:h,onAudioRecorded:d})})]})},E3="_quickReplies_83npe_1",S3="_quickReply_83npe_9",gv={quickReplies:E3,quickReply:S3},T3=({quickReplies:n,onQuickReplyClick:a})=>n.length?y.jsx("div",{className:K(gv.quickReplies,"chat__quickReplies"),children:n.map(i=>y.jsx(Nu,{tabIndex:0,className:K(gv.quickReply,"chat__button","chat__quickReply"),onClick:()=>a(i),children:i.label},i.label))}):null,yv=5e3,A3=1e3,O3=({isBotTyping:n,quickReplies:a,numberOfMessagesFromGuest:i,commands:s,onTextInput:u,onQuickReplyClick:f,onAudioRecorded:d})=>{const[h,m]=B.useState(""),[g,b]=B.useState(!1),[_,T]=B.useState(!1),U=B.useRef(0),x=B.useRef(0);B.useEffect(()=>{if(g&&!n){const E=U.current?Date.now()-U.current:0;E>yv?b(!1):setTimeout(()=>{b(!1)},yv-E)}},[g,n]),B.useEffect(()=>{g&&(U.current=Date.now())},[g]);const k=E=>{const R=Date.now()-x.current<A3;return _?!1:n||R?(b(!0),!1):(u(E),m(""),x.current=Date.now(),!0)},I=E=>{m(E+" ")};return y.jsxs("div",{className:K(xw.inputContainer),children:[y.jsx(T3,{quickReplies:a,onQuickReplyClick:f}),y.jsx(ww,{visible:g}),!g&&y.jsx(i3,{numberOfMessagesFromGuest:i}),!!s?.length&&y.jsx(jw,{text:h,commands:s,onSelectCommand:I,onVisibilityChange:T}),y.jsx(_3,{textInput:h,disabled:g,commandsVisible:_,hasCommands:!!s?.length,onTextInput:m,onTextInputSubmit:k,onAudioRecorded:d}),!!s?.length&&y.jsx(Iw,{commands:s,onSelectCommand:m})]})},x3=({clientName:n,messages:a,quickReplies:i,isBotTyping:s,drawerContentUrl:u,onMessageFromUser:f,onQuickReplyClick:d,onButtonClick:h,onLinkClick:m,onAudioRecorded:g,onTranscriptExport:b,onTranscriptItemReaction:_})=>{const T=Da(),U=st(H=>H.connection.connectionState),{enableTranscriptExportEmail:x,commands:k}=st(H=>H.settings),{showTranscriptMailOverlay:I,conversationRating:E}=st(H=>H.chat),R=a.filter(H=>H.sender.type===gu.GUEST).length;B.useEffect(()=>{U===Gr.CONNECTED&&T(a_(n))},[n,U,T]);const S=()=>{T(n_())};return y.jsxs("div",{className:vd.container,children:[y.jsxs("div",{className:K([vd.chatcontent,(I||E?.opener)&&vd.accessabilityHidden]),children:[y.jsx(iw,{messages:a,isBotTyping:s,commands:k,onButtonClick:h,onLinkClick:m,onTranscriptItemReaction:_}),y.jsx(O3,{isBotTyping:s,quickReplies:s?[]:i,numberOfMessagesFromGuest:R,commands:k,onQuickReplyClick:d,onTextInput:f,onAudioRecorded:g}),y.jsx(gw,{})]}),x&&y.jsx(Aw,{visible:!!I,onEmailExport:b,onClose:S}),y.jsx(dw,{contentUrl:u})]})},C3=n=>{const{messages:a,quickReplies:i,isBotTyping:s,drawerContentUrl:u}=n.chat;return{messages:a,quickReplies:i,isBotTyping:s,drawerContentUrl:u}},R3=n=>({onRestartChat:()=>n(ls()),onMessageFromUser:a=>n(N1(a)),onAudioRecorded:a=>n(qO(a)),onActionFromUser:a=>n(a),onQuickReplyClick:a=>n(w1(a)),onNluEvent:a=>n(U1(a)),onButtonClick:a=>n(QO(a)),onLinkClick:a=>n(j1(a)),onTranscriptExport:a=>n(VO(a)),onTranscriptItemReaction:(a,i)=>{n(Te.Actions.transcriptItemGuestReaction(a,i?.type||null,i?.category,i?.comment))}}),w3=fT(C3,R3)(x3),A_=()=>{const[n,a]=B.useState(!1);return B.useEffect(()=>{a((()=>{try{return window.self!==window.top}catch{return!0}})())},[]),n},N3=n=>a=>{const i=a.key;(i==="ArrowDown"||i==="ArrowRight"||i==="Enter"||i===" "||i==="Space")&&(a.stopPropagation(),n())},M3=({onClick:n})=>{const a=tt();return A_()?y.jsx("button",{className:"tooltip--bottom-left","aria-label":a("header.close-chat"),"data-title":a("header.close-chat"),tabIndex:0,onClick:n,onKeyDown:N3(n),children:y.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 256 256",children:y.jsx("path",{d:"M204.24,195.76a6,6,0,1,1-8.48,8.48L128,136.49,60.24,204.24a6,6,0,0,1-8.48-8.48L119.51,128,51.76,60.24a6,6,0,0,1,8.48-8.48L128,119.51l67.76-67.75a6,6,0,0,1,8.48,8.48L136.49,128Z"})})}):null},D3="_header_3gvbz_1",L3="_logoContainer_3gvbz_14",B3="_logo_3gvbz_14",U3="_actions_3gvbz_28",j3="_active_3gvbz_43",H3="_menuContainer_3gvbz_56",I3="_menu_3gvbz_56",z3="_divider_3gvbz_86",sr={header:D3,logoContainer:L3,logo:B3,actions:U3,active:j3,menuContainer:H3,menu:I3,divider:z3},G3=({icon:n})=>{switch(n){case"arrow-counter-clockwise":return y.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",viewBox:"0 0 256 256",children:y.jsx("path",{d:"M224,128a96,96,0,0,1-94.71,96H128A95.38,95.38,0,0,1,62.1,197.8a8,8,0,0,1,11-11.63A80,80,0,1,0,71.43,71.39a3.07,3.07,0,0,1-.26.25L44.59,96H72a8,8,0,0,1,0,16H24a8,8,0,0,1-8-8V56a8,8,0,0,1,16,0V85.8L60.25,60A96,96,0,0,1,224,128Z"})});case"download":return y.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",viewBox:"0 0 256 256",children:y.jsx("path",{d:"M224,144v64a8,8,0,0,1-8,8H40a8,8,0,0,1-8-8V144a8,8,0,0,1,16,0v56H208V144a8,8,0,0,1,16,0Zm-101.66,5.66a8,8,0,0,0,11.32,0l40-40a8,8,0,0,0-11.32-11.32L136,124.69V32a8,8,0,0,0-16,0v92.69L93.66,98.34a8,8,0,0,0-11.32,11.32Z"})});case"expand":return y.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",viewBox:"0 0 256 256",children:y.jsx("path",{d:"M214,48V96a6,6,0,0,1-12,0V62.48l-53.76,53.76a6,6,0,0,1-8.48-8.48L193.52,54H160a6,6,0,0,1,0-12h48A6,6,0,0,1,214,48ZM107.76,139.76,54,193.52V160a6,6,0,0,0-12,0v48a6,6,0,0,0,6,6H96a6,6,0,0,0,0-12H62.48l53.76-53.76a6,6,0,0,0-8.48-8.48Z"})});case"mail":return y.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",viewBox:"0 0 256 256",children:y.jsx("path",{d:"M224,48H32a8,8,0,0,0-8,8V192a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A8,8,0,0,0,224,48ZM203.43,64,128,133.15,52.57,64ZM216,192H40V74.19l82.59,75.71a8,8,0,0,0,10.82,0L216,74.19V192Z"})});case"phone":return y.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",viewBox:"0 0 256 256",children:y.jsx("path",{d:"M144.27,45.93a8,8,0,0,1,9.8-5.66,86.22,86.22,0,0,1,61.66,61.66,8,8,0,0,1-5.66,9.8A8.23,8.23,0,0,1,208,112a8,8,0,0,1-7.73-5.94,70.35,70.35,0,0,0-50.33-50.33A8,8,0,0,1,144.27,45.93Zm-2.33,41.8c13.79,3.68,22.65,12.54,26.33,26.33A8,8,0,0,0,176,120a8.23,8.23,0,0,0,2.07-.27,8,8,0,0,0,5.66-9.8c-5.12-19.16-18.5-32.54-37.66-37.66a8,8,0,1,0-4.13,15.46Zm81.94,95.35A56.26,56.26,0,0,1,168,232C88.6,232,24,167.4,24,88A56.26,56.26,0,0,1,72.92,32.12a16,16,0,0,1,16.62,9.52l21.12,47.15,0,.12A16,16,0,0,1,109.39,104c-.18.27-.37.52-.57.77L88,129.45c7.49,15.22,23.41,31,38.83,38.51l24.34-20.71a8.12,8.12,0,0,1,.75-.56,16,16,0,0,1,15.17-1.4l.13.06,47.11,21.11A16,16,0,0,1,223.88,183.08Zm-15.88-2s-.07,0-.11,0h0l-47-21.05-24.35,20.71a8.44,8.44,0,0,1-.74.56,16,16,0,0,1-15.75,1.14c-18.73-9.05-37.4-27.58-46.46-46.11a16,16,0,0,1,1-15.7,6.13,6.13,0,0,1,.57-.77L96,95.15l-21-47a.61.61,0,0,1,0-.12A40.2,40.2,0,0,0,40,88,128.14,128.14,0,0,0,168,216,40.21,40.21,0,0,0,208,181.07Z"})});case"scroll":return y.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",viewBox:"0 0 256 256",children:y.jsx("path",{d:"M96,104a8,8,0,0,1,8-8h64a8,8,0,0,1,0,16H104A8,8,0,0,1,96,104Zm8,40h64a8,8,0,0,0,0-16H104a8,8,0,0,0,0,16Zm128,48a32,32,0,0,1-32,32H88a32,32,0,0,1-32-32V64a16,16,0,0,0-32,0c0,5.74,4.83,9.62,4.88,9.66h0A8,8,0,0,1,24,88a7.89,7.89,0,0,1-4.79-1.61h0C18.05,85.54,8,77.61,8,64A32,32,0,0,1,40,32H176a32,32,0,0,1,32,32V168h8a8,8,0,0,1,4.8,1.6C222,170.46,232,178.39,232,192ZM96.26,173.48A8.07,8.07,0,0,1,104,168h88V64a16,16,0,0,0-16-16H67.69A31.71,31.71,0,0,1,72,64V192a16,16,0,0,0,32,0c0-5.74-4.83-9.62-4.88-9.66A7.82,7.82,0,0,1,96.26,173.48ZM216,192a12.58,12.58,0,0,0-3.23-8h-94a26.92,26.92,0,0,1,1.21,8,31.82,31.82,0,0,1-4.29,16H200A16,16,0,0,0,216,192Z"})});case"star":return y.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",viewBox:"0 0 256 256",children:y.jsx("path",{d:"M239.18,97.26A16.38,16.38,0,0,0,224.92,86l-59-4.76L143.14,26.15a16.36,16.36,0,0,0-30.27,0L90.11,81.23,31.08,86a16.46,16.46,0,0,0-9.37,28.86l45,38.83L53,211.75a16.38,16.38,0,0,0,24.5,17.82L128,198.49l50.53,31.08A16.4,16.4,0,0,0,203,211.75l-13.76-58.07,45-38.83A16.43,16.43,0,0,0,239.18,97.26Zm-15.34,5.47-48.7,42a8,8,0,0,0-2.56,7.91l14.88,62.8a.37.37,0,0,1-.17.48c-.18.14-.23.11-.38,0l-54.72-33.65a8,8,0,0,0-8.38,0L69.09,215.94c-.15.09-.19.12-.38,0a.37.37,0,0,1-.17-.48l14.88-62.8a8,8,0,0,0-2.56-7.91l-48.7-42c-.12-.1-.23-.19-.13-.5s.18-.27.33-.29l63.92-5.16A8,8,0,0,0,103,91.86l24.62-59.61c.08-.17.11-.25.35-.25s.27.08.35.25L153,91.86a8,8,0,0,0,6.75,4.92l63.92,5.16c.15,0,.24,0,.33.29S224,102.63,223.84,102.73Z"})});case"link":return y.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",viewBox:"0 0 256 256",children:y.jsx("path",{d:"M224,104a8,8,0,0,1-16,0V59.32l-66.33,66.34a8,8,0,0,1-11.32-11.32L196.68,48H152a8,8,0,0,1,0-16h64a8,8,0,0,1,8,8Zm-40,24a8,8,0,0,0-8,8v72H48V80h72a8,8,0,0,0,0-16H48A16,16,0,0,0,32,80V208a16,16,0,0,0,16,16H176a16,16,0,0,0,16-16V136A8,8,0,0,0,184,128Z"})});default:return y.jsx("div",{})}},k3=B.forwardRef(({selected:n,item:a,onClick:i},s)=>{const u=tt(),f=d=>{d.preventDefault(),i()};return y.jsx("li",{"aria-selected":n,role:"option",className:a.withDivider?sr.divider:void 0,children:y.jsxs("a",{ref:s,type:"button",role:"button",tabIndex:-1,onClick:f,children:[y.jsx(G3,{icon:a.icon}),y.jsx("span",{children:u(`header.menu.${a.id}`)})]})})}),q3=(n,a)=>{const i=A_(),{menuItems:s,enableStandaloneView:u,enableTranscriptExportPdf:f,enableTranscriptExportEmail:d}=st(g=>g.settings),h=st(g=>g.chat.conversationRating.enabled);return B.useMemo(()=>{const g=[],b=s.filter(({visibility:_})=>n?_==="always"||_==="chat-only":_==="always"||_==="start-screen-only");if(n&&(g.push({id:"restart-chat",type:"restart-chat",icon:"arrow-counter-clockwise",visibility:"chat-only"}),i&&u&&g.push({id:"expand-chat-window",type:"expand-chat-window",icon:"expand",visibility:"always"}),a&&f&&g.push({id:"download-transcript",type:"download-transcript",icon:"download",visibility:"chat-only"}),a&&d&&g.push({id:"send-transcript",type:"send-transcript",icon:"mail",visibility:"chat-only"}),a&&h&&g.push({id:"rate-conversation",type:"rate-conversation",icon:"star",visibility:"chat-only"}),g.length>0&&b.length)){const _=g.pop();_&&s.length&&g.push({..._,withDivider:!0})}return g.push(...b),g},[n,a,f,d,u,h,i,s])},F3=({chatStarted:n,hasGuestMessages:a})=>{const i=Da(),s=tt(),[u,f]=B.useState(!1),[d,h]=B.useState(-1),m=B.useRef(null),g=B.useRef(null),b=B.useRef([]),_=q3(n,a);B.useEffect(()=>{b.current[d]?.focus()},[d]);const T=B.useCallback(()=>{i(a?pu("RESTART_CHAT"):ls()),f(!1),h(0)},[a,i]),U=B.useCallback(I=>{switch(I.type){case"restart-chat":T();break;case"expand-chat-window":window.open(window.location.href,"_blank");break;case"download-transcript":i(YO());break;case"send-transcript":i(n_());break;case"rate-conversation":i(pu("MENU"));break;case"link":i(j1(I.url));break;case"action":i(JSON.parse(JSON.stringify(I.action)));break}f(!1)},[i,T,f]);B.useEffect(()=>{const I=E=>{if(u)switch(E.key){case"Enter":E.preventDefault(),U(_[d]);break;case"ArrowUp":h(R=>R>0?R-1:_.length-1);break;case"ArrowDown":h(R=>R<_.length-1?R+1:0);break;case"Escape":f(!1);break;case"Tab":d>-1&&f(!1);break}};return document.addEventListener("keydown",I),()=>{document.removeEventListener("keydown",I)}},[u,d,_,h,f,U]),B.useEffect(()=>{u||h(-1)},[u,d]),lm(g,()=>f(!1));const x=()=>{f(I=>!I)},k=()=>{setTimeout(()=>{const I=document.activeElement;g.current&&!g.current.contains(I)&&f(!1)},0)};return _.length?y.jsxs("div",{className:K(sr.menuContainer),ref:g,children:[y.jsx("button",{ref:m,className:K(u&&sr.active,u?"tooltip-hidden":"tooltip--bottom-left"),"aria-label":s("header.menu.title"),"data-title":s("header.menu.title"),onClick:x,onBlur:k,children:y.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 256 256",children:y.jsx("path",{d:"M140,128a12,12,0,1,1-12-12A12,12,0,0,1,140,128Zm56-12a12,12,0,1,0,12,12A12,12,0,0,0,196,116ZM60,116a12,12,0,1,0,12,12A12,12,0,0,0,60,116Z"})})}),u&&y.jsx("nav",{className:sr.menu,"aria-label":s("header.menu.title"),children:y.jsx("ul",{tabIndex:0,children:_.map((I,E)=>y.jsx(k3,{ref:R=>{b.current[E]=R},selected:d===E,item:I,onClick:()=>U(I)},I.id))})})]}):null},bv=({className:n,chatStarted:a,...i})=>{const s=Da(),u=st(h=>h.chat.conversationRating),f=st(h=>h.chat.messages.some(m=>m.sender.type===Te.UserType.GUEST)),d=()=>{u.enabled&&!u.opener&&f?s(pu("CLOSE_CHAT")):s(t_())};return y.jsxs("div",{className:K([sr.header,n]),...i,children:[y.jsx("div",{className:sr.logoContainer,children:y.jsx("div",{className:sr.logo})}),y.jsxs("div",{className:sr.actions,children:[y.jsx(F3,{chatStarted:a,hasGuestMessages:f}),y.jsx(M3,{onClick:d})]})]})},V3="_chatwindow_rkbir_1",Y3="_chatwindowWithAside_rkbir_21",vv={chatwindow:V3,chatwindowWithAside:Y3},O_=()=>{const[n,a]=B.useState(!1);return B.useEffect(()=>{const i=window.matchMedia("(max-width: 1023px)"),s=()=>a(i.matches);return s(),i.addEventListener("change",s),()=>i.removeEventListener("change",s)},[]),n},P3="_sourceInfos_vei0l_1",X3="_waitForLoading_vei0l_24",Z3="_loadingContent_vei0l_28",Q3="_sourceHeader_vei0l_37",K3="_sourceHeaderIcon_vei0l_57",$3="_sourceContent_vei0l_61",W3="_openSourceButton_vei0l_69",J3="_sourceButtonLabel_vei0l_79",eN="_closeSourceInfosButton_vei0l_101",tN="_loadingSourceInfos_vei0l_125",nN="_loading_vei0l_28",aN="_loadingError_vei0l_139",rN="_highlightLoadingInfo_vei0l_155",iN="_highlightLoadingInfoInnerContainer_vei0l_169",lN="_highlightLoadingInfoContent_vei0l_178",sN="_highlightLoadingInfoCloseIcon_vei0l_198",oN="_highlightLoader_vei0l_203",uN="_highlightLoaderLoading_vei0l_210",xt={sourceInfos:P3,waitForLoading:X3,loadingContent:Z3,sourceHeader:Q3,sourceHeaderIcon:K3,sourceContent:$3,openSourceButton:W3,sourceButtonLabel:J3,closeSourceInfosButton:eN,loadingSourceInfos:tN,loading:nN,loadingError:aN,highlightLoadingInfo:rN,highlightLoadingInfoInnerContainer:iN,highlightLoadingInfoContent:lN,highlightLoadingInfoCloseIcon:sN,highlightLoader:oN,highlightLoaderLoading:uN},cN=({onClick:n})=>{const a=tt();return y.jsx("button",{className:K(xt.closeSourceInfosButton,"tooltip--bottom-left"),"aria-label":a("source-infos.close"),"data-title":a("source-infos.close"),tabIndex:0,onClick:n,children:y.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 256 256",children:y.jsx("path",{d:"M205.66,194.34a8,8,0,0,1-11.32,11.32L128,139.31,61.66,205.66a8,8,0,0,1-11.32-11.32L116.69,128,50.34,61.66A8,8,0,0,1,61.66,50.34L128,116.69l66.34-66.35a8,8,0,0,1,11.32,11.32L139.31,128Z"})})})},fN=B.forwardRef(({sourceInfos:n,onClose:a,...i},s)=>y.jsxs("div",{className:xt.sourceHeader,...i,ref:s,children:[y.jsx("div",{children:n?y.jsx("p",{id:"source-info-title",children:n.title}):y.jsx("p",{children:" "})}),y.jsx(cN,{onClick:a})]})),dN=({loading:n})=>y.jsx("div",{className:xt.highlightLoader,children:n&&y.jsx("div",{className:xt.highlightLoaderLoading})});/*! @license DOMPurify 3.3.0 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.3.0/LICENSE */const{entries:x_,setPrototypeOf:_v,isFrozen:hN,getPrototypeOf:mN,getOwnPropertyDescriptor:pN}=Object;let{freeze:kt,seal:xn,create:vh}=Object,{apply:_h,construct:Eh}=typeof Reflect<"u"&&Reflect;kt||(kt=function(a){return a});xn||(xn=function(a){return a});_h||(_h=function(a,i){for(var s=arguments.length,u=new Array(s>2?s-2:0),f=2;f<s;f++)u[f-2]=arguments[f];return a.apply(i,u)});Eh||(Eh=function(a){for(var i=arguments.length,s=new Array(i>1?i-1:0),u=1;u<i;u++)s[u-1]=arguments[u];return new a(...s)});const Ko=qt(Array.prototype.forEach),gN=qt(Array.prototype.lastIndexOf),Ev=qt(Array.prototype.pop),Fl=qt(Array.prototype.push),yN=qt(Array.prototype.splice),au=qt(String.prototype.toLowerCase),qd=qt(String.prototype.toString),Fd=qt(String.prototype.match),Vl=qt(String.prototype.replace),bN=qt(String.prototype.indexOf),vN=qt(String.prototype.trim),In=qt(Object.prototype.hasOwnProperty),It=qt(RegExp.prototype.test),Yl=_N(TypeError);function qt(n){return function(a){a instanceof RegExp&&(a.lastIndex=0);for(var i=arguments.length,s=new Array(i>1?i-1:0),u=1;u<i;u++)s[u-1]=arguments[u];return _h(n,a,s)}}function _N(n){return function(){for(var a=arguments.length,i=new Array(a),s=0;s<a;s++)i[s]=arguments[s];return Eh(n,i)}}function Ce(n,a){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:au;_v&&_v(n,null);let s=a.length;for(;s--;){let u=a[s];if(typeof u=="string"){const f=i(u);f!==u&&(hN(a)||(a[s]=f),u=f)}n[u]=!0}return n}function EN(n){for(let a=0;a<n.length;a++)In(n,a)||(n[a]=null);return n}function xa(n){const a=vh(null);for(const[i,s]of x_(n))In(n,i)&&(Array.isArray(s)?a[i]=EN(s):s&&typeof s=="object"&&s.constructor===Object?a[i]=xa(s):a[i]=s);return a}function Pl(n,a){for(;n!==null;){const s=pN(n,a);if(s){if(s.get)return qt(s.get);if(typeof s.value=="function")return qt(s.value)}n=mN(n)}function i(){return null}return i}const Sv=kt(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),Vd=kt(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),Yd=kt(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),SN=kt(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),Pd=kt(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),TN=kt(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Tv=kt(["#text"]),Av=kt(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),Xd=kt(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),Ov=kt(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),$o=kt(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),AN=xn(/\{\{[\w\W]*|[\w\W]*\}\}/gm),ON=xn(/<%[\w\W]*|[\w\W]*%>/gm),xN=xn(/\$\{[\w\W]*/gm),CN=xn(/^data-[\-\w.\u00B7-\uFFFF]+$/),RN=xn(/^aria-[\-\w]+$/),C_=xn(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),wN=xn(/^(?:\w+script|data):/i),NN=xn(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),R_=xn(/^html$/i),MN=xn(/^[a-z][.\w]*(-[.\w]+)+$/i);var xv=Object.freeze({__proto__:null,ARIA_ATTR:RN,ATTR_WHITESPACE:NN,CUSTOM_ELEMENT:MN,DATA_ATTR:CN,DOCTYPE_NAME:R_,ERB_EXPR:ON,IS_ALLOWED_URI:C_,IS_SCRIPT_OR_DATA:wN,MUSTACHE_EXPR:AN,TMPLIT_EXPR:xN});const Xl={element:1,text:3,progressingInstruction:7,comment:8,document:9},DN=function(){return typeof window>"u"?null:window},LN=function(a,i){if(typeof a!="object"||typeof a.createPolicy!="function")return null;let s=null;const u="data-tt-policy-suffix";i&&i.hasAttribute(u)&&(s=i.getAttribute(u));const f="dompurify"+(s?"#"+s:"");try{return a.createPolicy(f,{createHTML(d){return d},createScriptURL(d){return d}})}catch{return console.warn("TrustedTypes policy "+f+" could not be created."),null}},Cv=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function w_(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:DN();const a=ie=>w_(ie);if(a.version="3.3.0",a.removed=[],!n||!n.document||n.document.nodeType!==Xl.document||!n.Element)return a.isSupported=!1,a;let{document:i}=n;const s=i,u=s.currentScript,{DocumentFragment:f,HTMLTemplateElement:d,Node:h,Element:m,NodeFilter:g,NamedNodeMap:b=n.NamedNodeMap||n.MozNamedAttrMap,HTMLFormElement:_,DOMParser:T,trustedTypes:U}=n,x=m.prototype,k=Pl(x,"cloneNode"),I=Pl(x,"remove"),E=Pl(x,"nextSibling"),R=Pl(x,"childNodes"),S=Pl(x,"parentNode");if(typeof d=="function"){const ie=i.createElement("template");ie.content&&ie.content.ownerDocument&&(i=ie.content.ownerDocument)}let H,N="";const{implementation:Z,createNodeIterator:X,createDocumentFragment:te,getElementsByTagName:de}=i,{importNode:ye}=s;let re=Cv();a.isSupported=typeof x_=="function"&&typeof S=="function"&&Z&&Z.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:pe,ERB_EXPR:ce,TMPLIT_EXPR:Xe,DATA_ATTR:Ne,ARIA_ATTR:G,IS_SCRIPT_OR_DATA:$,ATTR_WHITESPACE:ne,CUSTOM_ELEMENT:Se}=xv;let{IS_ALLOWED_URI:Ae}=xv,O=null;const q=Ce({},[...Sv,...Vd,...Yd,...Pd,...Tv]);let P=null;const W=Ce({},[...Av,...Xd,...Ov,...$o]);let J=Object.seal(vh(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),fe=null,_e=null;const We=Object.seal(vh(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let Ge=!0,$t=!0,La=!1,vt=!0,jt=!1,dn=!0,wn=!1,cr=!1,Bi=!1,ea=!1,Ba=!1,Ua=!1,Vr=!0,ss=!1;const Lu="user-content-";let Ct=!0,fr=!1,ta={},na=null;const dr=Ce({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let os=null;const Ui=Ce({},["audio","video","img","source","image","track"]);let ji=null;const us=Ce({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),kn="http://www.w3.org/1998/Math/MathML",St="http://www.w3.org/2000/svg",Tt="http://www.w3.org/1999/xhtml";let ct=Tt,Hi=!1,Ii=null;const Bu=Ce({},[kn,St,Tt],qd);let aa=Ce({},["mi","mo","mn","ms","mtext"]),ra=Ce({},["annotation-xml"]);const Yr=Ce({},["title","style","font","a","script"]);let Wt=null;const Pr=["application/xhtml+xml","text/html"],hr="text/html";let ft=null,ia=null;const zi=i.createElement("form"),ja=function(C){return C instanceof RegExp||C instanceof Function},Gi=function(){let C=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(ia&&ia===C)){if((!C||typeof C!="object")&&(C={}),C=xa(C),Wt=Pr.indexOf(C.PARSER_MEDIA_TYPE)===-1?hr:C.PARSER_MEDIA_TYPE,ft=Wt==="application/xhtml+xml"?qd:au,O=In(C,"ALLOWED_TAGS")?Ce({},C.ALLOWED_TAGS,ft):q,P=In(C,"ALLOWED_ATTR")?Ce({},C.ALLOWED_ATTR,ft):W,Ii=In(C,"ALLOWED_NAMESPACES")?Ce({},C.ALLOWED_NAMESPACES,qd):Bu,ji=In(C,"ADD_URI_SAFE_ATTR")?Ce(xa(us),C.ADD_URI_SAFE_ATTR,ft):us,os=In(C,"ADD_DATA_URI_TAGS")?Ce(xa(Ui),C.ADD_DATA_URI_TAGS,ft):Ui,na=In(C,"FORBID_CONTENTS")?Ce({},C.FORBID_CONTENTS,ft):dr,fe=In(C,"FORBID_TAGS")?Ce({},C.FORBID_TAGS,ft):xa({}),_e=In(C,"FORBID_ATTR")?Ce({},C.FORBID_ATTR,ft):xa({}),ta=In(C,"USE_PROFILES")?C.USE_PROFILES:!1,Ge=C.ALLOW_ARIA_ATTR!==!1,$t=C.ALLOW_DATA_ATTR!==!1,La=C.ALLOW_UNKNOWN_PROTOCOLS||!1,vt=C.ALLOW_SELF_CLOSE_IN_ATTR!==!1,jt=C.SAFE_FOR_TEMPLATES||!1,dn=C.SAFE_FOR_XML!==!1,wn=C.WHOLE_DOCUMENT||!1,ea=C.RETURN_DOM||!1,Ba=C.RETURN_DOM_FRAGMENT||!1,Ua=C.RETURN_TRUSTED_TYPE||!1,Bi=C.FORCE_BODY||!1,Vr=C.SANITIZE_DOM!==!1,ss=C.SANITIZE_NAMED_PROPS||!1,Ct=C.KEEP_CONTENT!==!1,fr=C.IN_PLACE||!1,Ae=C.ALLOWED_URI_REGEXP||C_,ct=C.NAMESPACE||Tt,aa=C.MATHML_TEXT_INTEGRATION_POINTS||aa,ra=C.HTML_INTEGRATION_POINTS||ra,J=C.CUSTOM_ELEMENT_HANDLING||{},C.CUSTOM_ELEMENT_HANDLING&&ja(C.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(J.tagNameCheck=C.CUSTOM_ELEMENT_HANDLING.tagNameCheck),C.CUSTOM_ELEMENT_HANDLING&&ja(C.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(J.attributeNameCheck=C.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),C.CUSTOM_ELEMENT_HANDLING&&typeof C.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(J.allowCustomizedBuiltInElements=C.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),jt&&($t=!1),Ba&&(ea=!0),ta&&(O=Ce({},Tv),P=[],ta.html===!0&&(Ce(O,Sv),Ce(P,Av)),ta.svg===!0&&(Ce(O,Vd),Ce(P,Xd),Ce(P,$o)),ta.svgFilters===!0&&(Ce(O,Yd),Ce(P,Xd),Ce(P,$o)),ta.mathMl===!0&&(Ce(O,Pd),Ce(P,Ov),Ce(P,$o))),C.ADD_TAGS&&(typeof C.ADD_TAGS=="function"?We.tagCheck=C.ADD_TAGS:(O===q&&(O=xa(O)),Ce(O,C.ADD_TAGS,ft))),C.ADD_ATTR&&(typeof C.ADD_ATTR=="function"?We.attributeCheck=C.ADD_ATTR:(P===W&&(P=xa(P)),Ce(P,C.ADD_ATTR,ft))),C.ADD_URI_SAFE_ATTR&&Ce(ji,C.ADD_URI_SAFE_ATTR,ft),C.FORBID_CONTENTS&&(na===dr&&(na=xa(na)),Ce(na,C.FORBID_CONTENTS,ft)),Ct&&(O["#text"]=!0),wn&&Ce(O,["html","head","body"]),O.table&&(Ce(O,["tbody"]),delete fe.tbody),C.TRUSTED_TYPES_POLICY){if(typeof C.TRUSTED_TYPES_POLICY.createHTML!="function")throw Yl('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof C.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Yl('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');H=C.TRUSTED_TYPES_POLICY,N=H.createHTML("")}else H===void 0&&(H=LN(U,u)),H!==null&&typeof N=="string"&&(N=H.createHTML(""));kt&&kt(C),ia=C}},ki=Ce({},[...Vd,...Yd,...SN]),qi=Ce({},[...Pd,...TN]),cs=function(C){let Q=S(C);(!Q||!Q.tagName)&&(Q={namespaceURI:ct,tagName:"template"});const ee=au(C.tagName),Ie=au(Q.tagName);return Ii[C.namespaceURI]?C.namespaceURI===St?Q.namespaceURI===Tt?ee==="svg":Q.namespaceURI===kn?ee==="svg"&&(Ie==="annotation-xml"||aa[Ie]):!!ki[ee]:C.namespaceURI===kn?Q.namespaceURI===Tt?ee==="math":Q.namespaceURI===St?ee==="math"&&ra[Ie]:!!qi[ee]:C.namespaceURI===Tt?Q.namespaceURI===St&&!ra[Ie]||Q.namespaceURI===kn&&!aa[Ie]?!1:!qi[ee]&&(Yr[ee]||!ki[ee]):!!(Wt==="application/xhtml+xml"&&Ii[C.namespaceURI]):!1},Ft=function(C){Fl(a.removed,{element:C});try{S(C).removeChild(C)}catch{I(C)}},Nn=function(C,Q){try{Fl(a.removed,{attribute:Q.getAttributeNode(C),from:Q})}catch{Fl(a.removed,{attribute:null,from:Q})}if(Q.removeAttribute(C),C==="is")if(ea||Ba)try{Ft(Q)}catch{}else try{Q.setAttribute(C,"")}catch{}},Fi=function(C){let Q=null,ee=null;if(Bi)C="<remove></remove>"+C;else{const Ee=Fd(C,/^[\r\n\t ]+/);ee=Ee&&Ee[0]}Wt==="application/xhtml+xml"&&ct===Tt&&(C='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+C+"</body></html>");const Ie=H?H.createHTML(C):C;if(ct===Tt)try{Q=new T().parseFromString(Ie,Wt)}catch{}if(!Q||!Q.documentElement){Q=Z.createDocument(ct,"template",null);try{Q.documentElement.innerHTML=Hi?N:Ie}catch{}}const nt=Q.body||Q.documentElement;return C&&ee&&nt.insertBefore(i.createTextNode(ee),nt.childNodes[0]||null),ct===Tt?de.call(Q,wn?"html":"body")[0]:wn?Q.documentElement:nt},Vi=function(C){return X.call(C.ownerDocument||C,C,g.SHOW_ELEMENT|g.SHOW_COMMENT|g.SHOW_TEXT|g.SHOW_PROCESSING_INSTRUCTION|g.SHOW_CDATA_SECTION,null)},hn=function(C){return C instanceof _&&(typeof C.nodeName!="string"||typeof C.textContent!="string"||typeof C.removeChild!="function"||!(C.attributes instanceof b)||typeof C.removeAttribute!="function"||typeof C.setAttribute!="function"||typeof C.namespaceURI!="string"||typeof C.insertBefore!="function"||typeof C.hasChildNodes!="function")},dt=function(C){return typeof h=="function"&&C instanceof h};function Je(ie,C,Q){Ko(ie,ee=>{ee.call(a,C,Q,ia)})}const la=function(C){let Q=null;if(Je(re.beforeSanitizeElements,C,null),hn(C))return Ft(C),!0;const ee=ft(C.nodeName);if(Je(re.uponSanitizeElement,C,{tagName:ee,allowedTags:O}),dn&&C.hasChildNodes()&&!dt(C.firstElementChild)&&It(/<[/\w!]/g,C.innerHTML)&&It(/<[/\w!]/g,C.textContent)||C.nodeType===Xl.progressingInstruction||dn&&C.nodeType===Xl.comment&&It(/<[/\w]/g,C.data))return Ft(C),!0;if(!(We.tagCheck instanceof Function&&We.tagCheck(ee))&&(!O[ee]||fe[ee])){if(!fe[ee]&&fs(ee)&&(J.tagNameCheck instanceof RegExp&&It(J.tagNameCheck,ee)||J.tagNameCheck instanceof Function&&J.tagNameCheck(ee)))return!1;if(Ct&&!na[ee]){const Ie=S(C)||C.parentNode,nt=R(C)||C.childNodes;if(nt&&Ie){const Ee=nt.length;for(let Rt=Ee-1;Rt>=0;--Rt){const mn=k(nt[Rt],!0);mn.__removalCount=(C.__removalCount||0)+1,Ie.insertBefore(mn,E(C))}}}return Ft(C),!0}return C instanceof m&&!cs(C)||(ee==="noscript"||ee==="noembed"||ee==="noframes")&&It(/<\/no(script|embed|frames)/i,C.innerHTML)?(Ft(C),!0):(jt&&C.nodeType===Xl.text&&(Q=C.textContent,Ko([pe,ce,Xe],Ie=>{Q=Vl(Q,Ie," ")}),C.textContent!==Q&&(Fl(a.removed,{element:C.cloneNode()}),C.textContent=Q)),Je(re.afterSanitizeElements,C,null),!1)},Xr=function(C,Q,ee){if(Vr&&(Q==="id"||Q==="name")&&(ee in i||ee in zi))return!1;if(!($t&&!_e[Q]&&It(Ne,Q))){if(!(Ge&&It(G,Q))){if(!(We.attributeCheck instanceof Function&&We.attributeCheck(Q,C))){if(!P[Q]||_e[Q]){if(!(fs(C)&&(J.tagNameCheck instanceof RegExp&&It(J.tagNameCheck,C)||J.tagNameCheck instanceof Function&&J.tagNameCheck(C))&&(J.attributeNameCheck instanceof RegExp&&It(J.attributeNameCheck,Q)||J.attributeNameCheck instanceof Function&&J.attributeNameCheck(Q,C))||Q==="is"&&J.allowCustomizedBuiltInElements&&(J.tagNameCheck instanceof RegExp&&It(J.tagNameCheck,ee)||J.tagNameCheck instanceof Function&&J.tagNameCheck(ee))))return!1}else if(!ji[Q]){if(!It(Ae,Vl(ee,ne,""))){if(!((Q==="src"||Q==="xlink:href"||Q==="href")&&C!=="script"&&bN(ee,"data:")===0&&os[C])){if(!(La&&!It($,Vl(ee,ne,"")))){if(ee)return!1}}}}}}}return!0},fs=function(C){return C!=="annotation-xml"&&Fd(C,Se)},ds=function(C){Je(re.beforeSanitizeAttributes,C,null);const{attributes:Q}=C;if(!Q||hn(C))return;const ee={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:P,forceKeepAttr:void 0};let Ie=Q.length;for(;Ie--;){const nt=Q[Ie],{name:Ee,namespaceURI:Rt,value:mn}=nt,Vt=ft(Ee),qn=mn;let _t=Ee==="value"?qn:vN(qn);if(ee.attrName=Vt,ee.attrValue=_t,ee.keepAttr=!0,ee.forceKeepAttr=void 0,Je(re.uponSanitizeAttribute,C,ee),_t=ee.attrValue,ss&&(Vt==="id"||Vt==="name")&&(Nn(Ee,C),_t=Lu+_t),dn&&It(/((--!?|])>)|<\/(style|title|textarea)/i,_t)){Nn(Ee,C);continue}if(Vt==="attributename"&&Fd(_t,"href")){Nn(Ee,C);continue}if(ee.forceKeepAttr)continue;if(!ee.keepAttr){Nn(Ee,C);continue}if(!vt&&It(/\/>/i,_t)){Nn(Ee,C);continue}jt&&Ko([pe,ce,Xe],Pi=>{_t=Vl(_t,Pi," ")});const Yi=ft(C.nodeName);if(!Xr(Yi,Vt,_t)){Nn(Ee,C);continue}if(H&&typeof U=="object"&&typeof U.getAttributeType=="function"&&!Rt)switch(U.getAttributeType(Yi,Vt)){case"TrustedHTML":{_t=H.createHTML(_t);break}case"TrustedScriptURL":{_t=H.createScriptURL(_t);break}}if(_t!==qn)try{Rt?C.setAttributeNS(Rt,Ee,_t):C.setAttribute(Ee,_t),hn(C)?Ft(C):Ev(a.removed)}catch{Nn(Ee,C)}}Je(re.afterSanitizeAttributes,C,null)},hs=function ie(C){let Q=null;const ee=Vi(C);for(Je(re.beforeSanitizeShadowDOM,C,null);Q=ee.nextNode();)Je(re.uponSanitizeShadowNode,Q,null),la(Q),ds(Q),Q.content instanceof f&&ie(Q.content);Je(re.afterSanitizeShadowDOM,C,null)};return a.sanitize=function(ie){let C=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Q=null,ee=null,Ie=null,nt=null;if(Hi=!ie,Hi&&(ie="<!-->"),typeof ie!="string"&&!dt(ie))if(typeof ie.toString=="function"){if(ie=ie.toString(),typeof ie!="string")throw Yl("dirty is not a string, aborting")}else throw Yl("toString is not a function");if(!a.isSupported)return ie;if(cr||Gi(C),a.removed=[],typeof ie=="string"&&(fr=!1),fr){if(ie.nodeName){const mn=ft(ie.nodeName);if(!O[mn]||fe[mn])throw Yl("root node is forbidden and cannot be sanitized in-place")}}else if(ie instanceof h)Q=Fi("<!---->"),ee=Q.ownerDocument.importNode(ie,!0),ee.nodeType===Xl.element&&ee.nodeName==="BODY"||ee.nodeName==="HTML"?Q=ee:Q.appendChild(ee);else{if(!ea&&!jt&&!wn&&ie.indexOf("<")===-1)return H&&Ua?H.createHTML(ie):ie;if(Q=Fi(ie),!Q)return ea?null:Ua?N:""}Q&&Bi&&Ft(Q.firstChild);const Ee=Vi(fr?ie:Q);for(;Ie=Ee.nextNode();)la(Ie),ds(Ie),Ie.content instanceof f&&hs(Ie.content);if(fr)return ie;if(ea){if(Ba)for(nt=te.call(Q.ownerDocument);Q.firstChild;)nt.appendChild(Q.firstChild);else nt=Q;return(P.shadowroot||P.shadowrootmode)&&(nt=ye.call(s,nt,!0)),nt}let Rt=wn?Q.outerHTML:Q.innerHTML;return wn&&O["!doctype"]&&Q.ownerDocument&&Q.ownerDocument.doctype&&Q.ownerDocument.doctype.name&&It(R_,Q.ownerDocument.doctype.name)&&(Rt="<!DOCTYPE "+Q.ownerDocument.doctype.name+`>
|
|
112
112
|
`+Rt),jt&&Ko([pe,ce,Xe],mn=>{Rt=Vl(Rt,mn," ")}),H&&Ua?H.createHTML(Rt):Rt},a.setConfig=function(){let ie=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Gi(ie),cr=!0},a.clearConfig=function(){ia=null,cr=!1},a.isValidAttribute=function(ie,C,Q){ia||Gi({});const ee=ft(ie),Ie=ft(C);return Xr(ee,Ie,Q)},a.addHook=function(ie,C){typeof C=="function"&&Fl(re[ie],C)},a.removeHook=function(ie,C){if(C!==void 0){const Q=gN(re[ie],C);return Q===-1?void 0:yN(re[ie],Q,1)[0]}return Ev(re[ie])},a.removeHooks=function(ie){re[ie]=[]},a.removeAllHooks=function(){re=Cv()},a}var BN=w_();const UN=({onClose:n})=>{const a=tt();return y.jsxs("div",{className:xt.highlightLoadingInfo,onClick:n,children:[y.jsx("div",{className:xt.highlightLoadingInfoCloseIcon,children:y.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 256 256",children:y.jsx("path",{d:"M205.66,194.34a8,8,0,0,1-11.32,11.32L128,139.31,61.66,205.66a8,8,0,0,1-11.32-11.32L116.69,128,50.34,61.66A8,8,0,0,1,61.66,50.34L128,116.69l66.34-66.35a8,8,0,0,1,11.32,11.32L139.31,128Z"})})}),y.jsxs("div",{className:xt.highlightLoadingInfoInnerContainer,children:[y.jsxs("div",{className:xt.highlightLoadingInfoContent,children:[y.jsx("h3",{children:a("source-infos.highlight-loading.title")}),y.jsx("p",{children:a("source-infos.highlight-loading.description")})]}),y.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"#000000",viewBox:"0 0 256 256",children:y.jsx("path",{d:"M253.66,106.34a8,8,0,0,0-11.32,0L192,156.69,107.31,72l50.35-50.34a8,8,0,1,0-11.32-11.32L96,60.69A16,16,0,0,0,93.18,79.5L72,100.69a16,16,0,0,0,0,22.62L76.69,128,18.34,186.34a8,8,0,0,0,3.13,13.25l72,24A7.88,7.88,0,0,0,96,224a8,8,0,0,0,5.66-2.34L136,187.31l4.69,4.69a16,16,0,0,0,22.62,0l21.19-21.18A16,16,0,0,0,203.31,168l50.35-50.34A8,8,0,0,0,253.66,106.34ZM93.84,206.85l-55-18.35L88,139.31,124.69,176ZM152,180.69,83.31,112,104,91.31,172.69,160Z"})})]})]})},jN=({title:n,href:a,children:i})=>y.jsx("a",{href:a,title:n,target:"_blank",rel:"noopener noreferrer",children:i}),HN=({className:n,children:a,...i})=>y.jsx("a",{className:K(ts.button,ts.buttonDefault,n),type:"button",role:"button",...i,children:a}),IN=n=>y.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 256 256",...n,children:y.jsx("path",{d:"M52,146H36a6,6,0,0,0-6,6v56a6,6,0,0,0,6,6H52a34,34,0,0,0,0-68Zm0,56H42V158H52a22,22,0,0,1,0,44Zm168.15-5.46a6,6,0,0,1,.18,8.48A28.06,28.06,0,0,1,200,214c-16.54,0-30-15.25-30-34s13.46-34,30-34a28.06,28.06,0,0,1,20.33,9,6,6,0,0,1-8.66,8.3A16.23,16.23,0,0,0,200,158c-9.93,0-18,9.87-18,22s8.07,22,18,22a16.23,16.23,0,0,0,11.67-5.28A6,6,0,0,1,220.15,196.54ZM128,146c-16.54,0-30,15.25-30,34s13.46,34,30,34,30-15.25,30-34S144.54,146,128,146Zm0,56c-9.93,0-18-9.87-18-22s8.07-22,18-22,18,9.87,18,22S137.93,202,128,202ZM48,118a6,6,0,0,0,6-6V40a2,2,0,0,1,2-2h90V88a6,6,0,0,0,6,6h50v18a6,6,0,0,0,12,0V88a6,6,0,0,0-1.76-4.24l-56-56A6,6,0,0,0,152,26H56A14,14,0,0,0,42,40v72A6,6,0,0,0,48,118ZM158,46.48,193.52,82H158Z"})}),zN=({type:n,...a})=>{switch(n){case"WEBSITE":return y.jsx(v_,{...a});case"PDF":return y.jsx(b_,{...a});case"DOCX":return y.jsx(g_,{...a});case"TEXT":return y.jsx(IN,{...a});default:return y.jsx(y_,{...a})}},GN=({url:n,knowledgeBaseType:a})=>{const i=tt();return y.jsx(HN,{className:xt.openSourceButton,href:n,target:"_blank",children:y.jsxs("div",{className:xt.sourceButtonLabel,children:[y.jsx("div",{className:xt.sourceHeaderIcon,children:y.jsx(zN,{type:a})}),y.jsx("p",{children:i("source-infos.open-source")})]})})},kN=({sourceInfos:{content:n,url:a,knowledgeBaseType:i,highlighted:s}})=>{const[u,f]=B.useState(!s);B.useEffect(()=>{s&&f(!1)},[s]);const d=BN.sanitize(n,{USE_PROFILES:{html:!0}});return y.jsxs(y.Fragment,{children:[y.jsxs("div",{className:K(xt.sourceContent,E_.markdown),children:[y.jsx(Ra,{options:{overrides:{a:jN}},children:d}),u&&y.jsx(UN,{onClose:()=>f(!1)})]}),y.jsx(GN,{url:a,knowledgeBaseType:i})]})},qN=""+new URL("undraw_fixing-bugs-D_eYxJc6.svg",import.meta.url).href,FN=()=>{const n=tt();return y.jsxs("div",{className:xt.loadingError,children:[y.jsx("h1",{children:n("source-infos.error.title")}),y.jsx("img",{src:qN,title:n("source-infos.error.title")}),y.jsx("p",{children:n("source-infos.error.info")})]})},VN=()=>y.jsx("div",{className:xt.loadingSourceInfos,children:y.jsx("svg",{className:xt.loading,xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 256 256",children:y.jsx("path",{d:"M230,128a102,102,0,0,1-204,0c0-40.18,23.35-76.86,59.5-93.45a6,6,0,0,1,5,10.9C58.61,60.09,38,92.49,38,128a90,90,0,0,0,180,0c0-35.51-20.61-67.91-52.5-82.55a6,6,0,0,1,5-10.9C206.65,51.14,230,87.82,230,128Z"})})});function YN({sourceInfos:n,onClose:a,threshold:i=100}){const s=B.useRef(null),[u,f]=B.useState(0),[d,h]=B.useState(!1),m=B.useRef(null),g=B.useRef(null),b=B.useCallback(x=>{m.current=x,h(!0)},[]),_=B.useCallback(x=>{if(m.current!==null&&d){const k=x-m.current;k>0&&f(k)}},[d]),T=B.useCallback(()=>{h(!1),u>i&&a(),f(0),m.current=null},[u,i,a]),U=B.useCallback(x=>{const k=N=>b(N.touches[0].clientY),I=N=>_(N.touches[0].clientY),E=()=>T(),R=N=>{N.preventDefault(),b(N.clientY),window.addEventListener("mousemove",S),window.addEventListener("mouseup",H)},S=N=>_(N.clientY),H=()=>{T(),window.removeEventListener("mousemove",S),window.removeEventListener("mouseup",H)};x.addEventListener("touchstart",k),x.addEventListener("touchmove",I),x.addEventListener("touchend",E),x.addEventListener("mousedown",R),g.current=()=>{x.removeEventListener("touchstart",k),x.removeEventListener("touchmove",I),x.removeEventListener("touchend",E),x.removeEventListener("mousedown",R),window.removeEventListener("mousemove",S),window.removeEventListener("mouseup",H)}},[b,_,T]);return B.useEffect(()=>{let x;return(()=>{s.current?(g.current?.(),U(s.current)):(x=new MutationObserver(()=>{s.current&&(g.current?.(),U(s.current),x?.disconnect())}),x.observe(document.body,{childList:!0,subtree:!0}))})(),()=>{x?.disconnect(),g.current?.()}},[U,n]),{ref:s,dragOffsetY:u,isDragging:d}}const PN=n=>{const[a,i]=B.useState(!0);return B.useEffect(()=>{let s=null;return n?.type==="loading"?(i(!0),s=setTimeout(()=>{i(!1)},300)):i(!n),()=>{s&&clearTimeout(s)}},[n]),a},XN=()=>{const n=Da(),a=st(m=>m.chat.sourceInfos),i=O_(),s=B.useRef(null),u=PN(a);B.useEffect(()=>{s.current&&a?.type==="loading"&&(i?s.current.showModal():(s.current.setAttribute("open","true"),s.current?.focus()))},[a,i]);const f=B.useCallback(()=>{s.current&&(i?s.current.close():s.current.removeAttribute("open"),n(Xx()))},[n,i]),{ref:d,dragOffsetY:h}=YN({onClose:f,sourceInfos:a});return a?y.jsx("dialog",{ref:s,className:K(xt.sourceInfos,u?xt.waitForLoading:a.type==="loading"?xt.loadingContent:""),style:i&&h?{transform:`translateY(${h}px)`}:{},onClose:f,autoFocus:!0,role:"dialog","aria-labelledby":"source-info-title",children:u?null:y.jsxs(y.Fragment,{children:[y.jsx(fN,{ref:d,tabIndex:-1,sourceInfos:a.type==="loaded"?a:void 0,onClose:f}),a.type==="loading"?y.jsx(VN,{}):a.type==="loading-error"?y.jsx(FN,{}):y.jsxs(y.Fragment,{children:[y.jsx(dN,{loading:!a.highlighted}),y.jsx(kN,{sourceInfos:a})]})]})}):null},ZN="_container_1aof3_1",QN="_body_1aof3_7",KN="_intro_1aof3_14",$N="_footer_1aof3_39",WN="_footnote_1aof3_43",JN="_containerWithFootnote_1aof3_58",e8="_startChatButton_1aof3_73",t8="_spinner_1aof3_88",n8="_formFields_1aof3_92",a8="_formField_1aof3_92",r8="_radio_1aof3_104",i8="_checkbox_1aof3_111",l8="_input_1aof3_119",s8="_inputLabel_1aof3_153",o8="_selectWrapper_1aof3_157",u8="_select_1aof3_157",c8="_selectLabel_1aof3_203",Ot={container:ZN,body:QN,intro:KN,footer:$N,footnote:WN,containerWithFootnote:JN,startChatButton:e8,spinner:t8,formFields:n8,formField:a8,radio:r8,checkbox:i8,input:l8,inputLabel:s8,selectWrapper:o8,select:u8,selectLabel:c8},f8=({name:n,label:a,defaultValue:i,required:s,onChange:u})=>{const f=d=>{u(d.currentTarget.checked?"true":"false")};return y.jsxs("label",{className:K(Ot.checkbox,"chat__startScreen__checkbox"),htmlFor:n,children:[y.jsx("input",{type:"checkbox",id:n,name:n,defaultChecked:i==="true",required:s,onChange:f}),y.jsx("div",{children:a})]})},d8=({type:n,name:a,label:i,defaultValue:s,placeholder:u,required:f,multiple:d,min:h,max:m,pattern:g,onChange:b})=>{const _=T=>{b(T.target.value)};return y.jsxs("label",{className:K(Ot.input,"chat__startScreen__input"),htmlFor:a,children:[y.jsx("div",{className:K(Ot.inputLabel),children:i}),y.jsx("input",{type:n,id:a,name:a,defaultValue:s,placeholder:u,required:f,multiple:d,min:h,max:m,pattern:g,onChange:_})]})},h8=({name:n,value:a,label:i,defaultChecked:s,required:u,onChange:f})=>{const d=`${n}-${a}`,h=m=>{f(m.target.value)};return y.jsxs("label",{className:K(Ot.radio,"chat__startScreen__radio"),htmlFor:d,children:[y.jsx("input",{id:d,type:"radio",name:n,value:a,defaultChecked:s,required:u,onChange:h}),y.jsx("span",{className:K(Ot.label),children:i})]})},m8=({name:n,label:a,defaultValue:i,required:s,multiple:u,options:f,onChange:d})=>{const h=m=>{d(m.target.value)};return y.jsxs("label",{className:K(Ot.select,"chat__startScreen__select"),htmlFor:n,children:[y.jsx("div",{className:K(Ot.selectLabel),children:a}),y.jsx("div",{className:K(Ot.selectWrapper),children:y.jsx("select",{id:n,name:n,defaultValue:i,required:s,multiple:u,onChange:h,children:Object.entries(f||{}).map(([m,g])=>y.jsx("option",{value:m,selected:g===i,children:g}))})})]})},p8="start-screen.intro",g8="start-screen.start-chat",y8="start-screen.waiting-for-login",b8="start-screen.footnote",Hn="start-screen.form",Rv=`${Hn}.fields`,v8=()=>{const n=tt(),a=Da(),i=um(),s=st(x=>x.startScreen.loginRequestToken),u=st(x=>x.settings.requiresUserAuthentication);B.useEffect(()=>{let x;if(s){const E=window.screenX+(window.outerWidth-600)/2,R=window.screenY+(window.outerHeight-700)/2,S=window.open(`/${i}/auth/login?loginRequestToken=${s}`,"Login",`width=600,height=700,left=${E},top=${R},resizable=yes,scrollbars=yes`);x=setInterval(()=>{S?.closed&&(a(Fx()),clearInterval(x))},500)}return()=>{x&&clearInterval(x)}},[i,s,a]);const[f,d]=B.useState({}),h=()=>{const x=Object.entries(f).reduce((k,[I,E])=>({...k,[I]:E.value}),{});a(u?qx({loginRequestToken:uu(),formValues:x}):zx({formValues:x}))},m=n(p8),g=n(s?y8:g8),b=n(b8),_=B.useMemo(()=>n(Rv)?.split(";").map(x=>x.trim())??[],[n(Rv)]);B.useEffect(()=>{_.length&&Object.keys(f).length===0&&d(_.reduce((x,k)=>({...x,[k]:_8(k,n)}),{}))},[n,_,f]);const T=x=>{x.preventDefault(),h()},U=x=>k=>{d(I=>({...I,[x]:{...I[x],value:k}}))};return y.jsxs("form",{onSubmit:T,className:K(Ot.container,b&&Ot.containerWithFootnote,"chat__startScreen"),children:[y.jsxs("div",{className:K(Ot.body,"chat__startScreen__body"),children:[m&&y.jsx("div",{className:K(Ot.intro,"chat__startScreen__intro"),children:y.jsx(Ra,{options:{overrides:{a:wv}},children:m})}),y.jsx("div",{className:K(Ot.formFields,"chat__startScreen__fields"),children:Object.values(f).map(({type:x,name:k,label:I,placeholder:E,defaultValue:R,options:S,required:H,multiple:N,min:Z,max:X,pattern:te})=>y.jsx("div",{className:K(Ot.formField,"chat__startScreen__field"),children:(()=>{switch(x){case"radio":return y.jsxs(y.Fragment,{children:[y.jsx("div",{children:I}),Object.entries(S||{}).map(([de,ye])=>y.jsx(h8,{name:k,value:de,label:ye,defaultChecked:de===R,required:H,onChange:U(k)},de))]});case"checkbox":return y.jsx(f8,{name:k,label:I,defaultValue:R,required:H,onChange:U(k)});case"select":return y.jsx(m8,{name:k,label:I,defaultValue:R,required:H,multiple:N,options:S,onChange:U(k)});default:return y.jsx(d8,{type:x,name:k,label:I,placeholder:E,defaultValue:R,required:H,multiple:N,min:Z,max:X,pattern:te,onChange:U(k)})}})()},k))})]}),y.jsxs("div",{className:K(Ot.footer,"chat__startScreen__footer"),children:[y.jsxs(yu,{type:"submit",className:Ot.startChatButton,disabled:!!s,children:[!!s&&y.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 256 256",className:Ot.spinner,children:y.jsx("path",{d:"M136,32V64a8,8,0,0,1-16,0V32a8,8,0,0,1,16,0Zm88,88H192a8,8,0,0,0,0,16h32a8,8,0,0,0,0-16Zm-45.09,47.6a8,8,0,0,0-11.31,11.31l22.62,22.63a8,8,0,0,0,11.32-11.32ZM128,184a8,8,0,0,0-8,8v32a8,8,0,0,0,16,0V192A8,8,0,0,0,128,184ZM77.09,167.6,54.46,190.22a8,8,0,0,0,11.32,11.32L88.4,178.91A8,8,0,0,0,77.09,167.6ZM72,128a8,8,0,0,0-8-8H32a8,8,0,0,0,0,16H64A8,8,0,0,0,72,128ZM65.78,54.46A8,8,0,0,0,54.46,65.78L77.09,88.4A8,8,0,0,0,88.4,77.09Z"})}),y.jsx("div",{children:g})]}),b&&y.jsx("div",{className:Ot.footnote,children:y.jsx(Ra,{options:{overrides:{a:wv}},children:b})})]})]})},wv=({title:n,href:a,children:i})=>y.jsx("a",{href:a,title:n,target:"_blank",rel:"noopener noreferrer",children:i}),_8=(n,a)=>{const i=a(`${Hn}.${n}.type`)||"text",s=a(`${Hn}.${n}.required`)==="true",u=a(`${Hn}.${n}.multiple`)==="true",f=a(`${Hn}.${n}.placeholder`),d=a(`${Hn}.${n}.label`)||"",h=a(`${Hn}.${n}.defaultValue`),m=a(`${Hn}.${n}.min`),g=a(`${Hn}.${n}.max`),b=a(`${Hn}.${n}.pattern`),_=S8(a(`${Hn}.${n}.options`));return{name:n,label:d,placeholder:f,value:E8(i,h,_)||"",defaultValue:h,options:_,type:i,required:s,multiple:u,min:m,max:g,pattern:b}},E8=(n,a,i)=>a||n==="select"&&Object.keys(i)[0]||"",S8=(n="")=>n.split(";").map(a=>a.trim()).reduce((a,i)=>{const[s,u]=i.split(":").map(f=>f.trim());return{...a,[s]:u}},{}),T8=()=>{const n=Su();B.useEffect(()=>{window.document.documentElement.lang=n.locale},[n.locale])},Ri={TRIGGER_ACTION:"TRIGGER_ACTION",TRIGGER_STORY:"TRIGGER_STORY",CHAT_MESSAGE_FROM_GUEST:"CHAT_MESSAGE_FROM_GUEST",ON_CHAT_WINDOW_OPEN:"ON_CHAT_WINDOW_OPEN",ON_CHAT_WINDOW_CLOSE:"ON_CHAT_WINDOW_CLOSE",RESTART_CHAT:"RESTART_CHAT"},A8=({clientName:n})=>{T8();const a=Da(),i=st(b=>b.intl.messages),s=tt(),u=st(b=>b.settings.enableStartScreen),f=st(b=>b.startScreen.startScreenStatus),d=st(b=>b.connection.queryString),h=B.useMemo(()=>new URLSearchParams(d||"?").get("cssClassName"),[d]);B.useEffect(()=>{const b=jh.parse(d||""),_=T=>{switch(T.data.type){case Ri.TRIGGER_ACTION:a(T.data.action);break;case Ri.TRIGGER_STORY:a(U1(T.data.story));break;case Ri.ON_CHAT_WINDOW_OPEN:a({type:"webclient.chatwindow.opened"});break;case Ri.ON_CHAT_WINDOW_CLOSE:a({type:"webclient.chatwindow.closed"});break;case Ri.CHAT_MESSAGE_FROM_GUEST:a(N1(T.data.text));break;case Ri.RESTART_CHAT:a(ls());break}};return a(Qx(n,b)),window.addEventListener("message",T=>_(T),!1),()=>window.removeEventListener("message",_)},[n,d,a]),B.useEffect(()=>{const b=s("page.title");b&&document&&(document.title=b)},[i,s]);const m=u===void 0,g=u===!1||f==="HIDDEN";return y.jsx("div",{className:K(vv.chatwindow,g&&vv.chatwindowWithAside,"chat__chatwindow",h),children:m?null:g?y.jsxs(y.Fragment,{children:[y.jsx("header",{children:y.jsx(bv,{chatStarted:!0})}),y.jsx("main",{children:y.jsx(w3,{clientName:n})}),y.jsx("aside",{children:y.jsx(XN,{})})]}):y.jsxs(y.Fragment,{children:[y.jsx("header",{children:y.jsx(bv,{chatStarted:!1})}),y.jsx("main",{children:y.jsx(v8,{})})]})})},O8=()=>{const n=um(),a=O_(),i=st(u=>u.intl.locale),s=st(u=>u.intl.messages);return y.jsx(KA,{locale:i,messages:s,onError:()=>{},children:y.jsx("div",{className:K([WA.app,a?"chat__small":"chat__large"]),children:y.jsx(A8,{clientName:n})})})};var Zd,Nv;function x8(){if(Nv)return Zd;Nv=1;var n=m_(),a=sm(),i="Expected a function";function s(u,f,d){var h=!0,m=!0;if(typeof u!="function")throw new TypeError(i);return a(d)&&(h="leading"in d?!!d.leading:h,m="trailing"in d?!!d.trailing:m),n(u,f,{leading:h,maxWait:f,trailing:m})}return Zd=s,Zd}var C8=x8();const R8=vu(C8);function w8(n){return n&&n.constructor&&typeof n.constructor.isBuffer=="function"&&n.constructor.isBuffer(n)}function N8(n){return n}function M8(n,a){a=a||{};const i=a.delimiter||".",s=a.maxDepth,u=a.transformKey||N8,f={};function d(h,m,g){g=g||1,Object.keys(h).forEach(function(b){const _=h[b],T=a.safe&&Array.isArray(_),U=Object.prototype.toString.call(_),x=w8(_),k=U==="[object Object]"||U==="[object Array]",I=m?m+i+u(b):u(b);if(!T&&!x&&k&&Object.keys(_).length&&(!a.maxDepth||g<s))return d(_,I,g+1);f[I]=_})}return d(n),f}const N_={"page.title":"Bubble Chat Chatbot","message-input-label":"Benutzereingabe","message-input-placeholder":"Nachricht eingeben","message-input.actions.submit.label":"Nachricht senden","message-input.actions.start-audio-recording.label":"Spracheingabe starten","message-input.actions.stop-audio-recording.label":"Spracheingabe stoppen","message-input.actions.submit-audio-recording.label":"Spracheingabe übermitteln","guest-bubble.label":"Ihre Nachricht","bot-bubble.label":"Nachricht des Chatbots","bot-bubble.reaction.good":"Gefällt mir","bot-bubble.reaction.bad":"Gefällt mir nicht","bot-bubble.reaction.remove":"Markierung entfernen","bot-bubble.reaction.say-more":"Erzähle mir bitte mehr","bot-bubble.reaction.category.WRONG_INFORMATION":"Falsch","bot-bubble.reaction.category.MISSING_INFORMATION":"Unvollständig","bot-bubble.reaction.category.OLD_INFORMATION":"Veraltet","bot-bubble.reaction.category.UNCLEAR":"Unklar","bot-bubble.reaction.category.OFF_TOPIC":"Nicht zur Frage passend","bot-bubble.reaction.comment":"Gedanken mit mir teilen...","bot-bubble.reaction.close":"Schliessen","bot-bubble.copy":"Kopieren","bot-bubble.sources":"Quellenliste","bot-bubble.source.open":"Quelle öffnen","agent-bubble.label":"Nachricht des Live-Agenten","export-transcript.email.title":"Chatverlauf per E-Mail versenden","export-transcript.email.description":"Bitte E-Mail-Adresse angeben, an die der Chatverlauf gesendet werden soll.","export-transcript.email.cancel":"Abbrechen","export-transcript.email.send":"Senden","export-transcript.email.placeholder":"E-Mail-Adresse","export-transcript.email.invalid":"Bitte gültige E-Mail-Adresse eingeben.","export-transcript.email.success":"Der Chatverlauf wurde an die hinterlegte E-Mail-Adresse übermittelt.","general-conditions.header":"**Nutzungsbedingungen**","general-conditions.body":`Bitte berücksichtigen Sie die folgenden Punkte:
|
|
113
113
|
|
|
@@ -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:Gr.CONNECTING});case em:return Object.assign({},n,{connectionState:Gr.CONNECTED});case tm:return Object.assign({},n,{connectionState:Gr.DISCONNECTED});case nm:return Object.assign({},n,{connectionState:Gr.RECONNECTED});case am:return Object.assign({},n,{sessionId:a.sessionId});case xu:return Object.assign({},n,{sessionId:a.payload.sessionId,userId:a.payload.userId});case Cu:return Object.assign({},n,{sessionId:void 0});default:return n}},z8={connectionState:Gr.DISCONNECTED,sessionId:void 0,userId:void 0,queryString:window.location.search},G8=(n=Dv,a)=>{switch(a.type){case $1:return Dv;case xu:return jr({type:"webclient.chat.started"}),n;case Cu:return jr({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:{jr(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 jr(a.message),n;case Te.ActionTypes.EVENT_TO_GUEST:return jr(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 jr(a),n;case L1:return jr(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:uu()});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:[]})},jr=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_);if(i===null)return;const s=JSON.parse(i),u=s.connection?.queryString;if(u!==void 0&&u!==window.location.search){console.log("Ignoring persisted state due to different query string");return}else return s}}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}`,Jn=Object.create(null);Jn.open="0";Jn.close="1";Jn.ping="2";Jn.pong="3";Jn.message="4";Jn.upgrade="5";Jn.noop="6";const ru=Object.create(null);Object.keys(Jn).forEach(n=>{ru[Jn[n]]=n});const Sh={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(Jn[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 Qd;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=>{Qd||(Qd=new TextEncoder),a(Qd.encode(i))})}const Hv="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",$l=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let n=0;n<Hv.length;n++)$l[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=$l[n.charCodeAt(s)],d=$l[n.charCodeAt(s+1)],h=$l[n.charCodeAt(s+2)],m=$l[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)}:ru[i]?n.length>1?{type:ru[i],data:n.substring(1)}:{type:ru[i]}:Sh},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 Kd;function Wo(n){return n.reduce((a,i)=>a+i.length,0)}function Jo(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){Kd||(Kd=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(Wo(i)<1)break;const m=Jo(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(Wo(i)<2)break;const m=Jo(i,2);u=new DataView(m.buffer,m.byteOffset,m.length).getUint16(0),s=3}else if(s===2){if(Wo(i)<8)break;const m=Jo(i,8),g=new DataView(m.buffer,m.byteOffset,m.length),b=g.getUint32(0);if(b>Math.pow(2,21)-1){h.enqueue(Sh);break}u=b*Math.pow(2,32)+g.getUint32(4),s=3}else{if(Wo(i)<u)break;const m=Jo(i,u);h.enqueue(fm(f?m:Kd.decode(m),a)),s=0}if(u===0||u>n){h.enqueue(Sh);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 Mu=typeof Promise=="function"&&typeof Promise.resolve=="function"?a=>Promise.resolve().then(a):(a,i)=>i(a,0),On=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=On.setTimeout,cM=On.clearTimeout;function Du(n,a){a.useNativeTimers?(n.setTimeoutFn=uM.bind(On),n.clearTimeoutFn=cM.bind(On)):(n.setTimeoutFn=On.setTimeout.bind(On),n.clearTimeoutFn=On.clearTimeout.bind(On))}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,Du(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 $n extends bt{constructor(a,i,s){super(),this.createRequest=a,Du(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=$n.requestsCount++,$n.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 $n.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()}}$n.requestsCount=0;$n.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",Iv);else if(typeof addEventListener=="function"){const n="onpagehide"in On?"pagehide":"unload";addEventListener(n,Iv,!1)}}function Iv(){for(let n in $n.requests)$n.requests.hasOwnProperty(n)&&$n.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 $n(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 On[["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&&Mu(()=>{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 $d=On.WebSocket||On.MozWebSocket;class AM extends TM{createSocket(a,i,s){return X_?new $d(a,i,s):i?new $d(a,i):new $d(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&&Mu(()=>{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 Th(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 Ah=typeof addEventListener=="function"&&typeof removeEventListener=="function",iu=[];Ah&&addEventListener("offline",()=>{iu.forEach(n=>n())},!1);class or 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=Th(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=Th(i.host).host);Du(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)),Ah&&(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"})},iu.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&&or.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",or.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,Mu(()=>{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(or.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(),Ah&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const s=iu.indexOf(this._offlineEventListener);s!==-1&&iu.splice(s,1)}this.readyState="closed",this.id=null,this.emitReserved("close",a,i),this.writeBuffer=[],this._prevBufferLen=0}}}or.protocol=q_;class MM extends or{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;or.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;or.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 T=new Error("probe error");T.transport=i.name,this.emitReserved("upgradeError",T)}}))};function f(){s||(s=!0,b(),i.close(),i=null)}const d=_=>{const T=new Error("probe error: "+_);T.transport=i.name,f(),this.emitReserved("upgradeError",T)};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=Th(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 lu(n,a){if(!n||typeof n!="object")return!1;if(Array.isArray(n)){for(let i=0,s=n.length;i<s;i++)if(lu(n[i]))return!0;return!1}if(hm(n))return!0;if(n.toJSON&&typeof n.toJSON=="function"&&arguments.length===1)return lu(n.toJSON(),!0);for(const i in n)if(Object.prototype.hasOwnProperty.call(n,i)&&lu(n[i]))return!0;return!1}function IM(n){const a=[],i=n.data,s=n;return s.data=Oh(i,a),s.attachments=a.length,{packet:s,buffers:a}}function Oh(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]=Oh(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]=Oh(n[s],a));return i}return n}function zM(n,a){return n.data=xh(n.data,a),delete n.attachments,n}function xh(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]=xh(n[i],a);else if(typeof n=="object")for(const i in n)Object.prototype.hasOwnProperty.call(n,i)&&(n[i]=xh(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)&&lu(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 zn(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=[zn(a,"open",this.onopen.bind(this)),zn(a,"packet",this.onpacket.bind(this)),zn(a,"error",this.onerror.bind(this)),zn(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 Li(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}Li.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};Li.prototype.reset=function(){this.attempts=0};Li.prototype.setMin=function(n){this.ms=n};Li.prototype.setMax=function(n){this.max=n};Li.prototype.setJitter=function(n){this.jitter=n};class Ch 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,Du(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 Li({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=zn(i,"open",function(){s.onopen(),a&&a()}),f=h=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",h),a?a(h):this.maybeReconnectOnOpen()},d=zn(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(zn(a,"ping",this.onping.bind(this)),zn(a,"data",this.ondata.bind(this)),zn(a,"error",this.onerror.bind(this)),zn(a,"close",this.onclose.bind(this)),zn(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){Mu(()=>{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 Zl={};function su(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=Zl[u]&&f in Zl[u].nsps,h=a.forceNew||a["force new connection"]||a.multiplex===!1||d;let m;return h?m=new Ch(s,a):(Zl[u]||(Zl[u]=new Ch(s,a)),m=Zl[u]),i.query&&!a.query&&(a.query=i.queryKey),m.socket(i.path,a)}Object.assign(su,{Manager:Ch,Socket:Q_,io:su,connect:su});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?${jh.stringify(u.querystrings)}`;s=su(`/${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===xu)s?.emit("start-chat",u.payload);else if(u.type===Cu)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_},Rh=xx({middleware:n=>n().concat(XM),reducer:X8,preloadedState:ZM});Rh.subscribe(R8(()=>{const n=Rh.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:Rh,children:y.jsx(O8,{})}));
|
|
125
|
-
//# sourceMappingURL=index-
|
|
125
|
+
//# sourceMappingURL=index-K5KL_jw_.js.map
|