@botfabrik/engine-webclient 4.77.4-alpha.6 → 4.77.4-alpha.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -94,7 +94,7 @@ For more details see https://formatjs.github.io/docs/getting-started/message-dis
94
94
  `,{inline:w}));for(;typeof v[v.length-1]=="string"&&!v[v.length-1].trim();)v.pop();if(r.wrapper===null)return v;const S=r.wrapper||(w?"span":"div");let R;if(v.length>1||r.forceWrapper)R=v;else{if(v.length===1)return R=v[0],typeof R=="string"?i("span",{key:"outer"},R):R;R=null}return r.createElement(S,{key:"outer"},R)}function l(m,w){const v=w.match(Jb);return v?v.reduce(function(S,R){const O=R.indexOf("=");if(O!==-1){const N=function(L){return L.indexOf("-")!==-1&&L.match(m2)===null&&(L=L.replace(E2,function(z,q){return q.toUpperCase()})),L}(R.slice(0,O)).trim(),b=function(L){const z=L[0];return(z==='"'||z==="'")&&L.length>=2&&L[L.length-1]===z?L.slice(1,-1):L}(R.slice(O+1).trim()),k=Zm[N]||N;if(k==="ref")return S;const T=S[k]=function(L,z,q,fe){return z==="style"?q.split(/;\s?/).reduce(function(te,oe){const pe=oe.slice(0,oe.indexOf(":"));return te[pe.trim().replace(/(-[a-z])/g,ue=>ue[1].toUpperCase())]=oe.slice(pe.length+1).trim(),te},{}):z==="href"||z==="src"?fe(q,L,z):(q.match(g2)&&(q=q.slice(1,q.length-1)),q==="true"||q!=="false"&&q)}(m,N,b,r.sanitizer);typeof T=="string"&&(Mc.test(T)||Fc.test(T))&&(S[k]=s(T.trim()))}else R!=="style"&&(S[Zm[R]||R]=!0);return S},{}):null}r.overrides=r.overrides||{},r.sanitizer=r.sanitizer||Z2,r.slugify=r.slugify||Vi,r.namedCodesToUnicode=r.namedCodesToUnicode?_r({},Qm,r.namedCodesToUnicode):Qm,r.createElement=r.createElement||B.createElement;const u=[],f={},h={[se.blockQuote]:{match:Sn(py),order:1,parse(m,w,v){const[,S,R]=m[0].replace(n2,"").match(r2);return{alert:S,children:w(R,v)}},render(m,w,v){const S={key:v.key};return m.alert&&(S.className="markdown-alert-"+r.slugify(m.alert.toLowerCase(),Vi),m.children.unshift({attrs:{},children:[{type:se.text,text:m.alert}],noInnerParse:!0,type:se.htmlBlock,tag:"header"})),i("blockquote",S,w(m.children,v))}},[se.breakLine]:{match:qi(i2),order:1,parse:Bu,render:(m,w,v)=>i("br",{key:v.key})},[se.breakThematic]:{match:Sn(o2),order:1,parse:Bu,render:(m,w,v)=>i("hr",{key:v.key})},[se.codeBlock]:{match:Sn(gy),order:0,parse:m=>({lang:void 0,text:m[0].replace(/^ {4}/gm,"").replace(/\n+$/,"")}),render:(m,w,v)=>i("pre",{key:v.key},i("code",_r({},m.attrs,{className:m.lang?`lang-${m.lang}`:""}),m.text))},[se.codeFenced]:{match:Sn(my),order:0,parse:m=>({attrs:l("code",m[3]||""),lang:m[2]||void 0,text:m[4],type:se.codeBlock})},[se.codeInline]:{match:Qn(s2),order:3,parse:m=>({text:m[2]}),render:(m,w,v)=>i("code",{key:v.key},m.text)},[se.footnote]:{match:Sn(u2),order:0,parse:m=>(u.push({footnote:m[2],identifier:m[1]}),{}),render:ju},[se.footnoteReference]:{match:Zn(c2),order:1,parse:m=>({target:`#${r.slugify(m[1],Vi)}`,text:m[1]}),render:(m,w,v)=>i("a",{key:v.key,href:r.sanitizer(m.target,"a","href")},i("sup",{key:v.key},m.text))},[se.gfmTask]:{match:Zn(h2),order:1,parse:m=>({completed:m[1].toLowerCase()==="x"}),render:(m,w,v)=>i("input",{checked:m.completed,key:v.key,readOnly:!0,type:"checkbox"})},[se.heading]:{match:Sn(r.enforceAtxHeadings?vy:yy),order:1,parse:(m,w,v)=>({children:Vs(w,m[2],v),id:r.slugify(m[2],Vi),level:m[1].length}),render:(m,w,v)=>i(`h${m.level}`,{id:m.id,key:v.key},w(m.children,v))},[se.headingSetext]:{match:Sn(_y),order:0,parse:(m,w,v)=>({children:Vs(w,m[1],v),level:m[2]==="="?1:2,type:se.heading})},[se.htmlBlock]:{match:qi(Mc),order:1,parse(m,w,v){const[,S]=m[3].match(L2),R=new RegExp(`^${S}`,"gm"),O=m[3].replace(R,""),N=(b=O,$2.some(q=>q.test(b))?K2:Vs);var b;const k=m[1].toLowerCase(),T=Yb.indexOf(k)!==-1,L=(T?k:m[1]).trim(),z={attrs:l(L,m[2]),noInnerParse:T,tag:L};return v.inAnchor=v.inAnchor||k==="a",T?z.text=m[3]:z.children=N(w,O,v),v.inAnchor=!1,z},render:(m,w,v)=>i(m.tag,_r({key:v.key},m.attrs),m.text||(m.children?w(m.children,v):""))},[se.htmlSelfClosing]:{match:qi(Fc),order:1,parse(m){const w=m[1].trim();return{attrs:l(w,m[2]||""),tag:w}},render:(m,w,v)=>i(m.tag,_r({},m.attrs,{key:v.key}))},[se.htmlComment]:{match:qi(Ey),order:1,parse:()=>({}),render:ju},[se.image]:{match:Qn(G2),order:1,parse:m=>({alt:m[1],target:e0(m[2]),title:m[3]}),render:(m,w,v)=>i("img",{key:v.key,alt:m.alt||void 0,title:m.title||void 0,src:r.sanitizer(m.target,"img","src")})},[se.link]:{match:Zn(z2),order:3,parse:(m,w,v)=>({children:Q2(w,m[1],v),target:e0(m[2]),title:m[3]}),render:(m,w,v)=>i("a",{key:v.key,href:r.sanitizer(m.target,"a","href"),title:m.title},w(m.children,v))},[se.linkAngleBraceStyleDetector]:{match:Zn(_2),order:0,parse:m=>({children:[{text:m[1],type:se.text}],target:m[1],type:se.link})},[se.linkBareUrlDetector]:{match:(m,w)=>w.inAnchor||r.disableAutoLink?null:Zn(y2)(m,w),order:0,parse:m=>({children:[{text:m[1],type:se.text}],target:m[1],title:void 0,type:se.link})},[se.linkMailtoDetector]:{match:Zn(v2),order:0,parse(m){let w=m[1],v=m[1];return e2.test(v)||(v="mailto:"+v),{children:[{text:w.replace("mailto:",""),type:se.text}],target:v,type:se.link}}},[se.orderedList]:Xm(i,1),[se.unorderedList]:Xm(i,2),[se.newlineCoalescer]:{match:Sn(a2),order:3,parse:Bu,render:()=>`
95
95
  `},[se.paragraph]:{match:W2,order:3,parse:Lu,render:(m,w,v)=>i("p",{key:v.key},w(m.children,v))},[se.ref]:{match:Zn(w2),order:0,parse:m=>(f[m[1]]={target:m[2],title:m[4]},{}),render:ju},[se.refImage]:{match:Qn(S2),order:0,parse:m=>({alt:m[1]||void 0,ref:m[2]}),render:(m,w,v)=>f[m.ref]?i("img",{key:v.key,alt:m.alt,src:r.sanitizer(f[m.ref].target,"img","src"),title:f[m.ref].title}):null},[se.refLink]:{match:Zn(b2),order:0,parse:(m,w,v)=>({children:w(m[1],v),fallbackChildren:m[0],ref:m[2]}),render:(m,w,v)=>f[m.ref]?i("a",{key:v.key,href:r.sanitizer(f[m.ref].target,"a","href"),title:f[m.ref].title},w(m.children,v)):i("span",{key:v.key},m.fallbackChildren)},[se.table]:{match:Sn(wy),order:1,parse:q2,render(m,w,v){const S=m;return i("table",{key:v.key},i("thead",null,i("tr",null,S.header.map(function(R,O){return i("th",{key:O,style:Jm(S,O)},w(R,v))}))),i("tbody",null,S.cells.map(function(R,O){return i("tr",{key:O},R.map(function(N,b){return i("td",{key:b,style:Jm(S,b)},w(N,v))}))})))}},[se.text]:{match:qi(M2),order:4,parse:m=>({text:m[0].replace(p2,(w,v)=>r.namedCodesToUnicode[v]?r.namedCodesToUnicode[v]:w)}),render:m=>m.text},[se.textBolded]:{match:Qn(N2),order:2,parse:(m,w,v)=>({children:w(m[2],v)}),render:(m,w,v)=>i("strong",{key:v.key},w(m.children,v))},[se.textEmphasized]:{match:Qn(A2),order:3,parse:(m,w,v)=>({children:w(m[2],v)}),render:(m,w,v)=>i("em",{key:v.key},w(m.children,v))},[se.textEscaped]:{match:Qn(P2),order:1,parse:m=>({text:m[1],type:se.text})},[se.textMarked]:{match:Qn(I2),order:3,parse:Lu,render:(m,w,v)=>i("mark",{key:v.key},w(m.children,v))},[se.textStrikethroughed]:{match:Qn(D2),order:3,parse:Lu,render:(m,w,v)=>i("del",{key:v.key},w(m.children,v))}};r.disableParsingRawHTML===!0&&(delete h[se.htmlBlock],delete h[se.htmlSelfClosing]);const p=function(m){let w=Object.keys(m);function v(S,R){let O=[];for(R.prevCapture=R.prevCapture||"";S;){let N=0;for(;N<w.length;){const b=w[N],k=m[b],T=k.match(S,R);if(T){const L=T[0];R.prevCapture+=L,S=S.substring(L.length);const z=k.parse(T,v,R);z.type==null&&(z.type=b),O.push(z);break}N++}}return R.prevCapture="",O}return w.sort(function(S,R){let O=m[S].order,N=m[R].order;return O!==N?O-N:S<R?-1:1}),function(S,R){return v(function(O){return O.replace(l2,`
96
96
  `).replace(f2,"").replace(T2," ")}(S),R)}}(h),_=(y=function(m,w){return function(v,S,R){const O=m[v.type].render;return w?w(()=>O(v,S,R),v,S,R):O(v,S,R)}}(h,r.renderRule),function m(w,v={}){if(Array.isArray(w)){const S=v.key,R=[];let O=!1;for(let N=0;N<w.length;N++){v.key=N;const b=m(w[N],v),k=typeof b=="string";k&&O?R[R.length-1]+=b:b!==null&&R.push(b),O=k}return v.key=S,R}return y(w,m,v)});var y;const x=s(e);return u.length?i("div",null,x,i("footer",{key:"footer"},u.map(function(m){return i("div",{id:r.slugify(m.identifier,Vi),key:m.identifier},m.identifier,_(p(m.footnote,{inline:!0})))}))):x}const un=e=>{let{children:r="",options:i}=e,s=function(l,u){if(l==null)return{};var f,h,p={},_=Object.keys(l);for(h=0;h<_.length;h++)u.indexOf(f=_[h])>=0||(p[f]=l[f]);return p}(e,Xb);return B.cloneElement(Y2(r,i),s)},J2="_generalConditionsContainer_55hjg_1",ex="_generalConditions_55hjg_1",tx="_generalConditionsHeader_55hjg_15",nx="_generalConditionsBody_55hjg_26",rx="_generalConditionsAccept_55hjg_35",Wi={generalConditionsContainer:J2,generalConditions:ex,generalConditionsHeader:tx,generalConditionsBody:nx,generalConditionsAccept:rx},ix=()=>E.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1rem",height:"1rem",fill:"currentColor",viewBox:"0 0 256 256",children:E.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"})}),ox=()=>E.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1rem",height:"1rem",fill:"currentColor",viewBox:"0 0 256 256",children:E.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"})}),sx="general-conditions.header",ax="general-conditions.body",t0="general-conditions.accept-conditions-note",lx=()=>{const e=Je(),[r,i]=B.useState(!1),s=()=>i(!r),l=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()},u=e(sx),f=e(t0);return E.jsxs("div",{className:V(Wi.generalConditionsContainer,"chat__generalConditions"),children:[!!(u!=null&&u.length)&&E.jsxs("div",{className:Wi.generalConditions,children:[E.jsxs("div",{role:"button",onClick:s,onKeyDown:l,tabIndex:0,className:V(Wi.generalConditionsHeader,"chat__generalConditions__header"),"aria-controls":"general-conditions-body","aria-expanded":r?"true":"false","aria-pressed":r?"true":"false",children:[E.jsx(un,{children:u}),r?E.jsx(ox,{}):E.jsx(ix,{})]}),E.jsx("div",{className:V(Wi.generalConditionsBody,"chat__generalConditions__body"),id:"general-conditions-body",role:"region",tabIndex:-1,children:r&&E.jsx(un,{children:e(ax)||""})})]}),!!(f!=null&&f.length)&&E.jsx("div",{className:V(Wi.generalConditionsAccept,"chat__generalConditions__accept"),tabIndex:0,children:E.jsx(un,{children:e(t0)||""})})]})},ux="_message_17vau_1",cx="_messageBot_17vau_9",fx="_messageBotLast_17vau_19",dx="_avatar_17vau_19",hx="_messageBotFirst_17vau_24",px="_messageBotAnimated_17vau_37",mx="_fadeInLeft_17vau_1",gx="_messageGuest_17vau_48",yx="_messageGuestFirst_17vau_54",vx="_messageGuestLast_17vau_60",_x="_botAvatar_17vau_74",Ex="_agentAvatar_17vau_78",wx="_bubble_17vau_82",Sx="_bubbleContent_17vau_88",bx="_bubbleLeft_17vau_102",xx="_leftText_17vau_113",Tx="_bubbleRight_17vau_120",Cx="_rightText_17vau_130",kx="_sourceInfoReference_17vau_146",de={message:ux,messageBot:cx,messageBotLast:fx,avatar:dx,messageBotFirst:hx,messageBotAnimated:px,fadeInLeft:mx,messageGuest:gx,messageGuestFirst:yx,messageGuestLast:vx,botAvatar:_x,agentAvatar:Ex,bubble:wx,bubbleContent:Sx,bubbleLeft:bx,leftText:xx,bubbleRight:Tx,rightText:Cx,sourceInfoReference:kx},Rx="_botMessageActions_1dl7x_1",Ox="_alwaysVisible_1dl7x_22",Nx="_reported_1dl7x_29",Ax="_action_1dl7x_33",Kn={botMessageActions:Rx,alwaysVisible:Ox,reported:Nx,action:Ax},Ix=({alwaysVisible:e,reaction:r,botMessageRef:i,onReaction:s})=>{const l=Je(),[u,f]=B.useState(!1),h=_=>()=>s(_),p=B.useCallback(async()=>{if(i.current)try{f(!0);const _=i.current.innerHTML,y=i.current.innerText;await navigator.clipboard.write([new ClipboardItem({"text/html":new Blob([_],{type:"text/html"}),"text/plain":new Blob([y],{type:"text/plain"})})]),await new Promise(x=>setTimeout(x,1500))}finally{f(!1)}},[i]);return E.jsxs("div",{className:V(Kn.botMessageActions,e&&Kn.alwaysVisible,r&&Kn.reported),children:[E.jsx("button",{className:V(Kn.action,r==="GOOD"&&Kn.reported,"tooltip--right"),tabIndex:0,"aria-label":l(r==="GOOD"?"bot-bubble.reaction.remove":"bot-bubble.reaction.good"),"data-title":l(r==="GOOD"?"bot-bubble.reaction.remove":"bot-bubble.reaction.good"),onClick:h(r==="GOOD"?null:"GOOD"),children:E.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 256 256",children:r==="GOOD"?E.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"}):E.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"})})}),E.jsx("button",{className:V(Kn.action,r==="BAD"&&Kn.reported,"tooltip--right"),tabIndex:0,"aria-label":l(r==="BAD"?"bot-bubble.reaction.remove":"bot-bubble.reaction.bad"),"data-title":l(r==="BAD"?"bot-bubble.reaction.remove":"bot-bubble.reaction.bad"),onClick:h(r==="BAD"?null:"BAD"),children:E.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 256 256",children:r==="BAD"?E.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"}):E.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"})})}),E.jsx("button",{className:V(Kn.action,"tooltip--right"),tabIndex:0,"aria-label":l("bot-bubble.copy"),"data-title":l("bot-bubble.copy"),onClick:p,children:E.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 256 256",children:u?E.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"}):E.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"})})})]})},Dy=B.forwardRef(({message:e,isAnimated:r,isLastMessage:i,isFirstMessageBySender:s,isLastMessageBySender:l,children:u,onReaction:f},h)=>{const p=Je(),_=B.useRef(null),y=e.sender.type===ge.UserType.BOT;return E.jsxs("li",{ref:h,className:V(de.message,de.messageBot,i&&de.lastMessage,s&&de.messageBotFirst,l&&de.messageBotLast,"chat__bubbleContainer",r&&de.messageBotAnimated,r&&"chat__bubbleContainer--animated",y?"chat__botBubbleContainer":"chat__agentBubbleContainer",s&&"chat__bubbleContainer--first",l&&"chat__bubbleContainer--last"),children:[E.jsx("img",{className:V(de.avatar,y?de.botAvatar:de.agentAvatar,"chat__avatar",y?"chat__botAvatar":"chat__agentAvatar"),src:`${e.sender.avatar}`,alt:y?"Bot":"Agent",referrerPolicy:"no-referrer"}),E.jsx("div",{ref:_,className:V(de.bubble,de.bubbleLeft,"chat__bubble",y?"chat__botBubble":"chat__agentBubble"),tabIndex:0,"aria-label":p(y?"bot-bubble.label":"agent-bubble.label"),children:E.jsx("div",{className:V(de.leftText),children:u})}),f&&E.jsx(Ix,{alwaysVisible:i&&l,reaction:e.reaction,botMessageRef:_,onReaction:f})]})}),Dx="_button_3ui4g_1",Px="_buttonDefault_3ui4g_13",Mx="_buttonPrimary_3ui4g_28",ro={button:Dx,buttonDefault:Px,buttonPrimary:Mx},pa=({className:e,children:r,...i})=>E.jsx("button",{className:V(ro.button,e),type:"button",...i,children:r}),Fx="_title_b904h_1",Lx="_subtitle_b904h_6",Bx="_buttons_b904h_11",jx="_button_b904h_11",Ux="_imageContainer_b904h_34",Hx="_image_b904h_34",zx="_video_container_b904h_49",Gx="_video_b904h_49",$x="_only_b904h_63",wt={title:Fx,subtitle:Lx,buttons:Bx,button:jx,imageContainer:Ux,image:Hx,video_container:zx,video:Gx,only:$x},Vx=({buttons:e,onButtonClick:r})=>E.jsx("div",{className:V(wt.buttons,"chat__bubbleButtons"),children:e.map((i,s)=>E.jsx(pa,{className:V(wt.button,"chat__bubbleButton"),onClick:()=>r(i),children:i.title},s))});var Ms={},Fs={},Ls={},n0;function qx(){if(n0)return Ls;n0=1,Object.defineProperty(Ls,"__esModule",{value:!0});var e=Yr(),r=i(e);function i(s){if(s&&s.__esModule)return s;var l={};if(s!=null)for(var u in s)Object.prototype.hasOwnProperty.call(s,u)&&(l[u]=s[u]);return l.default=s,l}return Ls.default=function(s,l,u){return r.createElement("a",{href:s,key:u},l)},Ls}var Bs={},r0;function Wx(){return r0||(r0=1,Object.defineProperty(Bs,"__esModule",{value:!0}),Bs.default=function(e){return e}),Bs}var js={},Hu,i0;function Zx(){return i0||(i0=1,Hu=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/),Hu}var zu,o0;function Qx(){return o0||(o0=1,zu=/[\0-\x1F\x7F-\x9F]/),zu}var Gu,s0;function Kx(){return s0||(s0=1,Gu=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/),Gu}var $u,a0;function Xx(){return a0||(a0=1,$u=/[!-#%-\*,-\/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4E\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDF55-\uDF59]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDF3C-\uDF3E]|\uD806[\uDC3B\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDE97-\uDE9A]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]/),$u}var Vu,l0;function Yx(){return l0||(l0=1,Vu=function(e){var r={};r.src_Any=Zx().source,r.src_Cc=Qx().source,r.src_Z=Kx().source,r.src_P=Xx().source,r.src_ZPCc=[r.src_Z,r.src_P,r.src_Cc].join("|"),r.src_ZCc=[r.src_Z,r.src_Cc].join("|");var i="[><|]";return r.src_pseudo_letter="(?:(?!"+i+"|"+r.src_ZPCc+")"+r.src_Any+")",r.src_ip4="(?:(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)",r.src_auth="(?:(?:(?!"+r.src_ZCc+"|[@/\\[\\]()]).)+@)?",r.src_port="(?::(?:6(?:[0-4]\\d{3}|5(?:[0-4]\\d{2}|5(?:[0-2]\\d|3[0-5])))|[1-5]?\\d{1,4}))?",r.src_host_terminator="(?=$|"+i+"|"+r.src_ZPCc+")(?!-|_|:\\d|\\.-|\\.(?!$|"+r.src_ZPCc+"))",r.src_path="(?:[/?#](?:(?!"+r.src_ZCc+"|"+i+`|[()[\\]{}.,"'?!\\-]).|\\[(?:(?!`+r.src_ZCc+"|\\]).)*\\]|\\((?:(?!"+r.src_ZCc+"|[)]).)*\\)|\\{(?:(?!"+r.src_ZCc+'|[}]).)*\\}|\\"(?:(?!'+r.src_ZCc+`|["]).)+\\"|\\'(?:(?!`+r.src_ZCc+"|[']).)+\\'|\\'(?="+r.src_pseudo_letter+"|[-]).|\\.{2,4}[a-zA-Z0-9%/]|\\.(?!"+r.src_ZCc+"|[.]).|"+(e&&e["---"]?"\\-(?!--(?:[^-]|$))(?:-*)|":"\\-+|")+"\\,(?!"+r.src_ZCc+").|\\!(?!"+r.src_ZCc+"|[!]).|\\?(?!"+r.src_ZCc+"|[?]).)+|\\/)?",r.src_email_name='[\\-;:&=\\+\\$,\\.a-zA-Z0-9_][\\-;:&=\\+\\$,\\"\\.a-zA-Z0-9_]*',r.src_xn="xn--[a-z0-9\\-]{1,59}",r.src_domain_root="(?:"+r.src_xn+"|"+r.src_pseudo_letter+"{1,63})",r.src_domain="(?:"+r.src_xn+"|(?:"+r.src_pseudo_letter+")|(?:"+r.src_pseudo_letter+"(?:-|"+r.src_pseudo_letter+"){0,61}"+r.src_pseudo_letter+"))",r.src_host="(?:(?:(?:(?:"+r.src_domain+")\\.)*"+r.src_domain+"))",r.tpl_host_fuzzy="(?:"+r.src_ip4+"|(?:(?:(?:"+r.src_domain+")\\.)+(?:%TLDS%)))",r.tpl_host_no_ip_fuzzy="(?:(?:(?:"+r.src_domain+")\\.)+(?:%TLDS%))",r.src_host_strict=r.src_host+r.src_host_terminator,r.tpl_host_fuzzy_strict=r.tpl_host_fuzzy+r.src_host_terminator,r.src_host_port_strict=r.src_host+r.src_port+r.src_host_terminator,r.tpl_host_port_fuzzy_strict=r.tpl_host_fuzzy+r.src_port+r.src_host_terminator,r.tpl_host_port_no_ip_fuzzy_strict=r.tpl_host_no_ip_fuzzy+r.src_port+r.src_host_terminator,r.tpl_host_fuzzy_test="localhost|www\\.|\\.\\d{1,3}\\.|(?:\\.(?:%TLDS%)(?:"+r.src_ZPCc+"|>|$))",r.tpl_email_fuzzy="(^|"+i+'|"|\\(|'+r.src_ZCc+")("+r.src_email_name+"@"+r.tpl_host_fuzzy_strict+")",r.tpl_link_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+r.src_ZPCc+"))((?![$+<=>^`||])"+r.tpl_host_port_fuzzy_strict+r.src_path+")",r.tpl_link_no_ip_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+r.src_ZPCc+"))((?![$+<=>^`||])"+r.tpl_host_port_no_ip_fuzzy_strict+r.src_path+")",r}),Vu}var qu,u0;function Jx(){if(u0)return qu;u0=1;function e(b){var k=Array.prototype.slice.call(arguments,1);return k.forEach(function(T){T&&Object.keys(T).forEach(function(L){b[L]=T[L]})}),b}function r(b){return Object.prototype.toString.call(b)}function i(b){return r(b)==="[object String]"}function s(b){return r(b)==="[object Object]"}function l(b){return r(b)==="[object RegExp]"}function u(b){return r(b)==="[object Function]"}function f(b){return b.replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}var h={fuzzyLink:!0,fuzzyEmail:!0,fuzzyIP:!1};function p(b){return Object.keys(b||{}).reduce(function(k,T){return k||h.hasOwnProperty(T)},!1)}var _={"http:":{validate:function(b,k,T){var L=b.slice(k);return T.re.http||(T.re.http=new RegExp("^\\/\\/"+T.re.src_auth+T.re.src_host_port_strict+T.re.src_path,"i")),T.re.http.test(L)?L.match(T.re.http)[0].length:0}},"https:":"http:","ftp:":"http:","//":{validate:function(b,k,T){var L=b.slice(k);return T.re.no_http||(T.re.no_http=new RegExp("^"+T.re.src_auth+"(?:localhost|(?:(?:"+T.re.src_domain+")\\.)+"+T.re.src_domain_root+")"+T.re.src_port+T.re.src_host_terminator+T.re.src_path,"i")),T.re.no_http.test(L)?k>=3&&b[k-3]===":"||k>=3&&b[k-3]==="/"?0:L.match(T.re.no_http)[0].length:0}},"mailto:":{validate:function(b,k,T){var L=b.slice(k);return T.re.mailto||(T.re.mailto=new RegExp("^"+T.re.src_email_name+"@"+T.re.src_host_strict,"i")),T.re.mailto.test(L)?L.match(T.re.mailto)[0].length:0}}},y="a[cdefgilmnoqrstuwxz]|b[abdefghijmnorstvwyz]|c[acdfghiklmnoruvwxyz]|d[ejkmoz]|e[cegrstu]|f[ijkmor]|g[abdefghilmnpqrstuwy]|h[kmnrtu]|i[delmnoqrst]|j[emop]|k[eghimnprwyz]|l[abcikrstuvy]|m[acdeghklmnopqrstuvwxyz]|n[acefgilopruz]|om|p[aefghklmnrstwy]|qa|r[eosuw]|s[abcdeghijklmnortuvxyz]|t[cdfghjklmnortvwz]|u[agksyz]|v[aceginu]|w[fs]|y[et]|z[amw]",x="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф".split("|");function m(b){b.__index__=-1,b.__text_cache__=""}function w(b){return function(k,T){var L=k.slice(T);return b.test(L)?L.match(b)[0].length:0}}function v(){return function(b,k){k.normalize(b)}}function S(b){var k=b.re=Yx()(b.__opts__),T=b.__tlds__.slice();b.onCompile(),b.__tlds_replaced__||T.push(y),T.push(k.src_xn),k.src_tlds=T.join("|");function L(te){return te.replace("%TLDS%",k.src_tlds)}k.email_fuzzy=RegExp(L(k.tpl_email_fuzzy),"i"),k.link_fuzzy=RegExp(L(k.tpl_link_fuzzy),"i"),k.link_no_ip_fuzzy=RegExp(L(k.tpl_link_no_ip_fuzzy),"i"),k.host_fuzzy_test=RegExp(L(k.tpl_host_fuzzy_test),"i");var z=[];b.__compiled__={};function q(te,oe){throw new Error('(LinkifyIt) Invalid schema "'+te+'": '+oe)}Object.keys(b.__schemas__).forEach(function(te){var oe=b.__schemas__[te];if(oe!==null){var pe={validate:null,link:null};if(b.__compiled__[te]=pe,s(oe)){l(oe.validate)?pe.validate=w(oe.validate):u(oe.validate)?pe.validate=oe.validate:q(te,oe),u(oe.normalize)?pe.normalize=oe.normalize:oe.normalize?q(te,oe):pe.normalize=v();return}if(i(oe)){z.push(te);return}q(te,oe)}}),z.forEach(function(te){b.__compiled__[b.__schemas__[te]]&&(b.__compiled__[te].validate=b.__compiled__[b.__schemas__[te]].validate,b.__compiled__[te].normalize=b.__compiled__[b.__schemas__[te]].normalize)}),b.__compiled__[""]={validate:null,normalize:v()};var fe=Object.keys(b.__compiled__).filter(function(te){return te.length>0&&b.__compiled__[te]}).map(f).join("|");b.re.schema_test=RegExp("(^|(?!_)(?:[><|]|"+k.src_ZPCc+"))("+fe+")","i"),b.re.schema_search=RegExp("(^|(?!_)(?:[><|]|"+k.src_ZPCc+"))("+fe+")","ig"),b.re.pretest=RegExp("("+b.re.schema_test.source+")|("+b.re.host_fuzzy_test.source+")|@","i"),m(b)}function R(b,k){var T=b.__index__,L=b.__last_index__,z=b.__text_cache__.slice(T,L);this.schema=b.__schema__.toLowerCase(),this.index=T+k,this.lastIndex=L+k,this.raw=z,this.text=z,this.url=z}function O(b,k){var T=new R(b,k);return b.__compiled__[T.schema].normalize(T,b),T}function N(b,k){if(!(this instanceof N))return new N(b,k);k||p(b)&&(k=b,b={}),this.__opts__=e({},h,k),this.__index__=-1,this.__last_index__=-1,this.__schema__="",this.__text_cache__="",this.__schemas__=e({},_,b),this.__compiled__={},this.__tlds__=x,this.__tlds_replaced__=!1,this.re={},S(this)}return N.prototype.add=function(k,T){return this.__schemas__[k]=T,S(this),this},N.prototype.set=function(k){return this.__opts__=e(this.__opts__,k),this},N.prototype.test=function(k){if(this.__text_cache__=k,this.__index__=-1,!k.length)return!1;var T,L,z,q,fe,te,oe,pe,ue;if(this.re.schema_test.test(k)){for(oe=this.re.schema_search,oe.lastIndex=0;(T=oe.exec(k))!==null;)if(q=this.testSchemaAt(k,T[2],oe.lastIndex),q){this.__schema__=T[2],this.__index__=T.index+T[1].length,this.__last_index__=T.index+T[0].length+q;break}}return this.__opts__.fuzzyLink&&this.__compiled__["http:"]&&(pe=k.search(this.re.host_fuzzy_test),pe>=0&&(this.__index__<0||pe<this.__index__)&&(L=k.match(this.__opts__.fuzzyIP?this.re.link_fuzzy:this.re.link_no_ip_fuzzy))!==null&&(fe=L.index+L[1].length,(this.__index__<0||fe<this.__index__)&&(this.__schema__="",this.__index__=fe,this.__last_index__=L.index+L[0].length))),this.__opts__.fuzzyEmail&&this.__compiled__["mailto:"]&&(ue=k.indexOf("@"),ue>=0&&(z=k.match(this.re.email_fuzzy))!==null&&(fe=z.index+z[1].length,te=z.index+z[0].length,(this.__index__<0||fe<this.__index__||fe===this.__index__&&te>this.__last_index__)&&(this.__schema__="mailto:",this.__index__=fe,this.__last_index__=te))),this.__index__>=0},N.prototype.pretest=function(k){return this.re.pretest.test(k)},N.prototype.testSchemaAt=function(k,T,L){return this.__compiled__[T.toLowerCase()]?this.__compiled__[T.toLowerCase()].validate(k,L,this):0},N.prototype.match=function(k){var T=0,L=[];this.__index__>=0&&this.__text_cache__===k&&(L.push(O(this,T)),T=this.__last_index__);for(var z=T?k.slice(T):k;this.test(z);)L.push(O(this,T)),z=z.slice(this.__last_index__),T+=this.__last_index__;return L.length?L:null},N.prototype.tlds=function(k,T){return k=Array.isArray(k)?k:[k],T?(this.__tlds__=this.__tlds__.concat(k).sort().filter(function(L,z,q){return L!==q[z-1]}).reverse(),S(this),this):(this.__tlds__=k.slice(),this.__tlds_replaced__=!0,S(this),this)},N.prototype.normalize=function(k){k.schema||(k.url="http://"+k.url),k.schema==="mailto:"&&!/^mailto:/i.test(k.url)&&(k.url="mailto:"+k.url)},N.prototype.onCompile=function(){},qu=N,qu}const eT=JSON.parse('["aaa","aarp","abb","abbott","abbvie","abc","able","abogado","abudhabi","ac","academy","accenture","accountant","accountants","aco","actor","ad","ads","adult","ae","aeg","aero","aetna","af","afl","africa","ag","agakhan","agency","ai","aig","airbus","airforce","airtel","akdn","al","alibaba","alipay","allfinanz","allstate","ally","alsace","alstom","am","amazon","americanexpress","americanfamily","amex","amfam","amica","amsterdam","analytics","android","anquan","anz","ao","aol","apartments","app","apple","aq","aquarelle","ar","arab","aramco","archi","army","arpa","art","arte","as","asda","asia","associates","at","athleta","attorney","au","auction","audi","audible","audio","auspost","author","auto","autos","avianca","aw","aws","ax","axa","az","azure","ba","baby","baidu","banamex","bananarepublic","band","bank","bar","barcelona","barclaycard","barclays","barefoot","bargains","baseball","basketball","bauhaus","bayern","bb","bbc","bbt","bbva","bcg","bcn","bd","be","beats","beauty","beer","bentley","berlin","best","bestbuy","bet","bf","bg","bh","bharti","bi","bible","bid","bike","bing","bingo","bio","biz","bj","black","blackfriday","blockbuster","blog","bloomberg","blue","bm","bms","bmw","bn","bnpparibas","bo","boats","boehringer","bofa","bom","bond","boo","book","booking","bosch","bostik","boston","bot","boutique","box","br","bradesco","bridgestone","broadway","broker","brother","brussels","bs","bt","build","builders","business","buy","buzz","bv","bw","by","bz","bzh","ca","cab","cafe","cal","call","calvinklein","cam","camera","camp","canon","capetown","capital","capitalone","car","caravan","cards","care","career","careers","cars","casa","case","cash","casino","cat","catering","catholic","cba","cbn","cbre","cbs","cc","cd","center","ceo","cern","cf","cfa","cfd","cg","ch","chanel","channel","charity","chase","chat","cheap","chintai","christmas","chrome","church","ci","cipriani","circle","cisco","citadel","citi","citic","city","cityeats","ck","cl","claims","cleaning","click","clinic","clinique","clothing","cloud","club","clubmed","cm","cn","co","coach","codes","coffee","college","cologne","com","comcast","commbank","community","company","compare","computer","comsec","condos","construction","consulting","contact","contractors","cooking","cool","coop","corsica","country","coupon","coupons","courses","cpa","cr","credit","creditcard","creditunion","cricket","crown","crs","cruise","cruises","cu","cuisinella","cv","cw","cx","cy","cymru","cyou","cz","dabur","dad","dance","data","date","dating","datsun","day","dclk","dds","de","deal","dealer","deals","degree","delivery","dell","deloitte","delta","democrat","dental","dentist","desi","design","dev","dhl","diamonds","diet","digital","direct","directory","discount","discover","dish","diy","dj","dk","dm","dnp","do","docs","doctor","dog","domains","dot","download","drive","dtv","dubai","dunlop","dupont","durban","dvag","dvr","dz","earth","eat","ec","eco","edeka","edu","education","ee","eg","email","emerck","energy","engineer","engineering","enterprises","epson","equipment","er","ericsson","erni","es","esq","estate","et","etisalat","eu","eurovision","eus","events","exchange","expert","exposed","express","extraspace","fage","fail","fairwinds","faith","family","fan","fans","farm","farmers","fashion","fast","fedex","feedback","ferrari","ferrero","fi","fidelity","fido","film","final","finance","financial","fire","firestone","firmdale","fish","fishing","fit","fitness","fj","fk","flickr","flights","flir","florist","flowers","fly","fm","fo","foo","food","football","ford","forex","forsale","forum","foundation","fox","fr","free","fresenius","frl","frogans","frontdoor","frontier","ftr","fujitsu","fun","fund","furniture","futbol","fyi","ga","gal","gallery","gallo","gallup","game","games","gap","garden","gay","gb","gbiz","gd","gdn","ge","gea","gent","genting","george","gf","gg","ggee","gh","gi","gift","gifts","gives","giving","gl","glass","gle","global","globo","gm","gmail","gmbh","gmo","gmx","gn","godaddy","gold","goldpoint","golf","goo","goodyear","goog","google","gop","got","gov","gp","gq","gr","grainger","graphics","gratis","green","gripe","grocery","group","gs","gt","gu","guardian","gucci","guge","guide","guitars","guru","gw","gy","hair","hamburg","hangout","haus","hbo","hdfc","hdfcbank","health","healthcare","help","helsinki","here","hermes","hiphop","hisamitsu","hitachi","hiv","hk","hkt","hm","hn","hockey","holdings","holiday","homedepot","homegoods","homes","homesense","honda","horse","hospital","host","hosting","hot","hotels","hotmail","house","how","hr","hsbc","ht","hu","hughes","hyatt","hyundai","ibm","icbc","ice","icu","id","ie","ieee","ifm","ikano","il","im","imamat","imdb","immo","immobilien","in","inc","industries","infiniti","info","ing","ink","institute","insurance","insure","int","international","intuit","investments","io","ipiranga","iq","ir","irish","is","ismaili","ist","istanbul","it","itau","itv","jaguar","java","jcb","je","jeep","jetzt","jewelry","jio","jll","jm","jmp","jnj","jo","jobs","joburg","jot","joy","jp","jpmorgan","jprs","juegos","juniper","kaufen","kddi","ke","kerryhotels","kerrylogistics","kerryproperties","kfh","kg","kh","ki","kia","kids","kim","kinder","kindle","kitchen","kiwi","km","kn","koeln","komatsu","kosher","kp","kpmg","kpn","kr","krd","kred","kuokgroup","kw","ky","kyoto","kz","la","lacaixa","lamborghini","lamer","lancaster","land","landrover","lanxess","lasalle","lat","latino","latrobe","law","lawyer","lb","lc","lds","lease","leclerc","lefrak","legal","lego","lexus","lgbt","li","lidl","life","lifeinsurance","lifestyle","lighting","like","lilly","limited","limo","lincoln","link","lipsy","live","living","lk","llc","llp","loan","loans","locker","locus","lol","london","lotte","lotto","love","lpl","lplfinancial","lr","ls","lt","ltd","ltda","lu","lundbeck","luxe","luxury","lv","ly","ma","madrid","maif","maison","makeup","man","management","mango","map","market","marketing","markets","marriott","marshalls","mattel","mba","mc","mckinsey","md","me","med","media","meet","melbourne","meme","memorial","men","menu","merckmsd","mg","mh","miami","microsoft","mil","mini","mint","mit","mitsubishi","mk","ml","mlb","mls","mm","mma","mn","mo","mobi","mobile","moda","moe","moi","mom","monash","money","monster","mormon","mortgage","moscow","moto","motorcycles","mov","movie","mp","mq","mr","ms","msd","mt","mtn","mtr","mu","museum","music","mv","mw","mx","my","mz","na","nab","nagoya","name","natura","navy","nba","nc","ne","nec","net","netbank","netflix","network","neustar","new","news","next","nextdirect","nexus","nf","nfl","ng","ngo","nhk","ni","nico","nike","nikon","ninja","nissan","nissay","nl","no","nokia","norton","now","nowruz","nowtv","np","nr","nra","nrw","ntt","nu","nyc","nz","obi","observer","office","okinawa","olayan","olayangroup","oldnavy","ollo","om","omega","one","ong","onl","online","ooo","open","oracle","orange","org","organic","origins","osaka","otsuka","ott","ovh","pa","page","panasonic","paris","pars","partners","parts","party","pay","pccw","pe","pet","pf","pfizer","pg","ph","pharmacy","phd","philips","phone","photo","photography","photos","physio","pics","pictet","pictures","pid","pin","ping","pink","pioneer","pizza","pk","pl","place","play","playstation","plumbing","plus","pm","pn","pnc","pohl","poker","politie","porn","post","pr","pramerica","praxi","press","prime","pro","prod","productions","prof","progressive","promo","properties","property","protection","pru","prudential","ps","pt","pub","pw","pwc","py","qa","qpon","quebec","quest","racing","radio","re","read","realestate","realtor","realty","recipes","red","redstone","redumbrella","rehab","reise","reisen","reit","reliance","ren","rent","rentals","repair","report","republican","rest","restaurant","review","reviews","rexroth","rich","richardli","ricoh","ril","rio","rip","ro","rocher","rocks","rodeo","rogers","room","rs","rsvp","ru","rugby","ruhr","run","rw","rwe","ryukyu","sa","saarland","safe","safety","sakura","sale","salon","samsclub","samsung","sandvik","sandvikcoromant","sanofi","sap","sarl","sas","save","saxo","sb","sbi","sbs","sc","sca","scb","schaeffler","schmidt","scholarships","school","schule","schwarz","science","scot","sd","se","search","seat","secure","security","seek","select","sener","services","seven","sew","sex","sexy","sfr","sg","sh","shangrila","sharp","shaw","shell","shia","shiksha","shoes","shop","shopping","shouji","show","showtime","si","silk","sina","singles","site","sj","sk","ski","skin","sky","skype","sl","sling","sm","smart","smile","sn","sncf","so","soccer","social","softbank","software","sohu","solar","solutions","song","sony","soy","spa","space","sport","spot","sr","srl","ss","st","stada","staples","star","statebank","statefarm","stc","stcgroup","stockholm","storage","store","stream","studio","study","style","su","sucks","supplies","supply","support","surf","surgery","suzuki","sv","swatch","swiss","sx","sy","sydney","systems","sz","tab","taipei","talk","taobao","target","tatamotors","tatar","tattoo","tax","taxi","tc","tci","td","tdk","team","tech","technology","tel","temasek","tennis","teva","tf","tg","th","thd","theater","theatre","tiaa","tickets","tienda","tips","tires","tirol","tj","tjmaxx","tjx","tk","tkmaxx","tl","tm","tmall","tn","to","today","tokyo","tools","top","toray","toshiba","total","tours","town","toyota","toys","tr","trade","trading","training","travel","travelers","travelersinsurance","trust","trv","tt","tube","tui","tunes","tushu","tv","tvs","tw","tz","ua","ubank","ubs","ug","uk","unicom","university","uno","uol","ups","us","uy","uz","va","vacations","vana","vanguard","vc","ve","vegas","ventures","verisign","vermögensberater","vermögensberatung","versicherung","vet","vg","vi","viajes","video","vig","viking","villas","vin","vip","virgin","visa","vision","viva","vivo","vlaanderen","vn","vodka","volkswagen","volvo","vote","voting","voto","voyage","vu","wales","walmart","walter","wang","wanggou","watch","watches","weather","weatherchannel","webcam","weber","website","wed","wedding","weibo","weir","wf","whoswho","wien","wiki","williamhill","win","windows","wine","winners","wme","wolterskluwer","woodside","work","works","world","wow","ws","wtc","wtf","xbox","xerox","xfinity","xihuan","xin","xxx","xyz","yachts","yahoo","yamaxun","yandex","ye","yodobashi","yoga","yokohama","you","youtube","yt","yun","za","zappos","zara","zero","zip","zm","zone","zuerich","zw","ελ","ευ","бг","бел","дети","ею","католик","ком","мкд","мон","москва","онлайн","орг","рус","рф","сайт","срб","укр","қаз","հայ","ישראל","קום","ابوظبي","اتصالات","ارامكو","الاردن","البحرين","الجزائر","السعودية","العليان","المغرب","امارات","ایران","بارت","بازار","بيتك","بھارت","تونس","سودان","سورية","شبكة","عراق","عرب","عمان","فلسطين","قطر","كاثوليك","كوم","مصر","مليسيا","موريتانيا","موقع","همراه","پاکستان","ڀارت","कॉम","नेट","भारत","भारतम्","भारोत","संगठन","বাংলা","ভারত","ভাৰত","ਭਾਰਤ","ભારત","ଭାରତ","இந்தியா","இலங்கை","சிங்கப்பூர்","భారత్","ಭಾರತ","ഭാരതം","ලංකා","คอม","ไทย","ລາວ","გე","みんな","アマゾン","クラウド","グーグル","コム","ストア","セール","ファッション","ポイント","世界","中信","中国","中國","中文网","亚马逊","企业","佛山","信息","健康","八卦","公司","公益","台湾","台灣","商城","商店","商标","嘉里","嘉里大酒店","在线","大拿","天主教","娱乐","家電","广东","微博","慈善","我爱你","手机","招聘","政务","政府","新加坡","新闻","时尚","書籍","机构","淡马锡","游戏","澳門","点看","移动","组织机构","网址","网店","网站","网络","联通","谷歌","购物","通販","集团","電訊盈科","飞利浦","食品","餐厅","香格里拉","香港","닷넷","닷컴","삼성","한국"]');var c0;function tT(){if(c0)return js;c0=1,Object.defineProperty(js,"__esModule",{value:!0});var e=Jx(),r=l(e),i=eT,s=l(i);function l(f){return f&&f.__esModule?f:{default:f}}var u=new r.default;return u.tlds(s.default),js.default=function(f){return u.match(f)},js}var Us={},f0;function nT(){return f0||(f0=1,Object.defineProperty(Us,"__esModule",{value:!0}),Us.default=function(e){return e}),Us}var d0;function rT(){if(d0)return Fs;d0=1,Object.defineProperty(Fs,"__esModule",{value:!0});var e=function(){function O(N,b){for(var k=0;k<b.length;k++){var T=b[k];T.enumerable=T.enumerable||!1,T.configurable=!0,"value"in T&&(T.writable=!0),Object.defineProperty(N,T.key,T)}}return function(N,b,k){return b&&O(N.prototype,b),k&&O(N,k),N}}(),r=Yr(),i=m(r),s=qx(),l=x(s),u=Wx(),f=x(u),h=tT(),p=x(h),_=nT(),y=x(_);function x(O){return O&&O.__esModule?O:{default:O}}function m(O){if(O&&O.__esModule)return O;var N={};if(O!=null)for(var b in O)Object.prototype.hasOwnProperty.call(O,b)&&(N[b]=O[b]);return N.default=O,N}function w(O,N){if(!(O instanceof N))throw new TypeError("Cannot call a class as a function")}function v(O,N){if(!O)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return N&&(typeof N=="object"||typeof N=="function")?N:O}function S(O,N){if(typeof N!="function"&&N!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof N);O.prototype=Object.create(N&&N.prototype,{constructor:{value:O,enumerable:!1,writable:!0,configurable:!0}}),N&&(Object.setPrototypeOf?Object.setPrototypeOf(O,N):O.__proto__=N)}var R=function(O){S(N,O);function N(){return w(this,N),v(this,(N.__proto__||Object.getPrototypeOf(N)).apply(this,arguments))}return e(N,[{key:"parseString",value:function(k){var T=this;if(k==="")return k;var L=this.props.matchDecorator(k);if(!L)return k;var z=[],q=0;return L.forEach(function(fe,te){fe.index>q&&z.push(k.substring(q,fe.index));var oe=T.props.hrefDecorator(fe.url),pe=T.props.textDecorator(fe.text),ue=T.props.componentDecorator(oe,pe,te);z.push(ue),q=fe.lastIndex}),k.length>q&&z.push(k.substring(q)),z.length===1?z[0]:z}},{key:"parse",value:function(k){var T=this,L=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return typeof k=="string"?this.parseString(k):i.isValidElement(k)&&k.type!=="a"&&k.type!=="button"?i.cloneElement(k,{key:L},this.parse(k.props.children)):Array.isArray(k)?k.map(function(z,q){return T.parse(z,q)}):k}},{key:"render",value:function(){return i.createElement(i.Fragment,null,this.parse(this.props.children))}}]),N}(i.Component);return R.defaultProps={componentDecorator:l.default,hrefDecorator:f.default,matchDecorator:p.default,textDecorator:y.default},Fs.default=R,Fs}var h0;function iT(){if(h0)return Ms;h0=1,Object.defineProperty(Ms,"__esModule",{value:!0});var e=rT(),r=i(e);function i(s){return s&&s.__esModule?s:{default:s}}return Ms.default=r.default,Ms}var oT=iT();const sT=na(oT),aT="_text_gp0s0_1",lT="_command_gp0s0_5",p0={text:aT,command:lT},Py=({text:e,commands:r=[],onLinkClick:i})=>{const s=h=>p=>(p.preventDefault(),h&&i(h),!1),l=(h,p,_)=>E.jsx("a",{onClick:s(h),role:"button",children:p},_),u=r.find(h=>e.startsWith(`/${h}`)),f=u?e.slice(u.length+1):e;return E.jsxs("div",{children:[u&&E.jsxs("code",{className:p0.command,children:["/",u]}),f.split(`
97
- `).map((h,p)=>E.jsxs("span",{className:p0.text,children:[E.jsx(sT,{componentDecorator:l,children:h}),E.jsx("br",{})]},p))]})},uT=({subtitle:e,onLinkClick:r})=>e?E.jsx("div",{className:wt.subtitle,children:E.jsx(Py,{text:e,onLinkClick:r})}):null,m0="newtab#",My=({markdown:e,markdownOptions:r={},onLinkClick:i})=>{const s=u=>f=>(f.preventDefault(),u&&i(u),!1),l=({title:u,href:f,children:h})=>f.indexOf(m0)===0?E.jsx("a",{href:f.slice(m0.length),title:u,target:"_blank",rel:"noopener noreferrer",children:h}):E.jsx("a",{onClick:s(f),title:u,href:f,children:h});return E.jsx(un,{options:{...r,overrides:{a:l}},children:e})},cT=({text:e,onLinkClick:r})=>e?E.jsx("div",{children:E.jsx(My,{markdown:e,onLinkClick:r})}):null,fT=({title:e})=>e?E.jsx("h1",{className:wt.title,children:e}):null,dT=({title:e,text:r,subtitle:i,buttons:s,onButtonClick:l,onLinkClick:u})=>(e==null?void 0:e.length)||(r==null?void 0:r.length)||(i==null?void 0:i.length)||(s==null?void 0:s.length)?E.jsxs("div",{className:V(de.bubbleContent),children:[E.jsx(fT,{title:e}),E.jsx(cT,{text:r,onLinkClick:u}),E.jsx(uT,{subtitle:i,onLinkClick:u}),E.jsx(Vx,{buttons:s,onButtonClick:l})]}):null,hT=({alt:e,imageUrl:r,itemUrl:i,hasBody:s})=>r?i?i.indexOf("youtube.com")>-1?E.jsx("div",{className:wt.video_container,children:E.jsx("iframe",{className:V(wt.video,{[wt.only]:!s}),title:"Youtube",width:"100%",src:i+"?rel=0",frameBorder:"0",allowFullScreen:!0})}):E.jsx("a",{href:i,target:"_blank",rel:"noopener noreferrer",children:E.jsx("div",{className:wt.imageContainer,children:E.jsx("img",{className:V(wt.image,{[wt.only]:!s}),src:r,alt:e})})}):E.jsx("div",{className:wt.imageContainer,children:E.jsx("img",{className:V(wt.image,{[wt.only]:!s}),src:r,alt:e})}):null,pT=({title:e,text:r,subtitle:i,imageUrl:s,itemUrl:l,buttons:u,onButtonClick:f,onLinkClick:h})=>{const p=!!(e!=null&&e.length)||!!(r!=null&&r.length)||!!(i!=null&&i.length)||!!(u!=null&&u.length);return E.jsxs("div",{className:V(wt.detailMessage),children:[E.jsx(hT,{hasBody:p,imageUrl:s,itemUrl:l,alt:e||i}),p&&E.jsx(dT,{title:e,text:r,subtitle:i,buttons:u,onLinkClick:h,onButtonClick:f})]})},mT=B.forwardRef(({isFirstMessageBySender:e,isLastMessageBySender:r,children:i},s)=>{const l=Je();return E.jsx("li",{ref:s,className:V(de.message,de.messageGuest,e&&de.messageGuestFirst,r&&de.messageGuestLast,"chat__bubbleContainer","chat__guestBubbleContainer",e&&"chat__bubbleContainer--first",r&&"chat__bubbleContainer--last"),children:E.jsx("div",{className:V(de.bubble,de.bubbleRight,"chat__bubble","chat__guestBubble"),tabIndex:0,"aria-label":l("guest-bubble.label"),children:E.jsx("div",{className:V(de.rightText),children:i})})})}),gT="_markdown_nw7vg_1",Fy={markdown:gT},yT=({markdown:e,className:r,onLinkClick:i})=>{const s=ei(),l=vT(),u=h=>p=>{const _=p.key;(_==="ArrowDown"||_==="ArrowRight"||_==="Enter"||_===" "||_==="Space")&&(p.stopPropagation(),s($m(h)))},f=h=>()=>{s($m(h))};return E.jsx("div",{className:V(de.bubbleContent,Fy.markdown,r),children:E.jsx(My,{markdown:e,onLinkClick:i,markdownOptions:{renderRule(h,p,_,y){return p.type===se.footnoteReference?E.jsx("span",{className:de.sourceInfoReference,children:E.jsx("a",{type:"button",tabIndex:0,onClick:f(p.text),onKeyDown:u(p.text),children:l(p.text)})},y.key):h()}}})})},vT=()=>{const e=[];return i=>{const s=e.indexOf(i);return s>-1?s+1:(e.push(i),e.length)}},_T=({text:e,commands:r,onLinkClick:i})=>E.jsx("div",{className:de.bubbleContent,children:E.jsx(Py,{text:e,commands:r,onLinkClick:i})}),ET=B.forwardRef(({message:e,commands:r,isLastMessage:i,isFirstMessageBySender:s,isLastMessageBySender:l,onReaction:u,onButtonClick:f,onLinkClick:h},p)=>{const _=wT(e,r,f,h);switch(e.sender.type){case ge.UserType.GUEST:return E.jsx(mT,{ref:p,isFirstMessageBySender:s,isLastMessageBySender:l,children:_});default:{const y=x=>u(e._id,x);return E.jsx(Dy,{ref:p,message:e,isAnimated:!1,isLastMessage:i,isFirstMessageBySender:s,isLastMessageBySender:l,onReaction:y,children:_})}}}),wT=(e,r,i,s)=>{switch(e.type){case ge.MessageTypeEnum.TEXT:{const l=e;return E.jsx(_T,{text:l.text,commands:r,onLinkClick:s})}case ge.MessageTypeEnum.DETAIL:{const l=e;return E.jsx(pT,{title:l.title,text:l.text,subtitle:l.subtitle,imageUrl:l.imageUrl,itemUrl:l.itemUrl,buttons:l.buttons,onButtonClick:i,onLinkClick:s})}case ge.MessageTypeEnum.MARKDOWN:{const l=e;return E.jsx(yT,{markdown:l.markdown,className:l.className,onLinkClick:s})}}},ST=(e,r)=>e.message._id===r.message._id&&e.message.reaction===r.message.reaction&&e.isLastMessage===r.isLastMessage&&e.isFirstMessageBySender===r.isFirstMessageBySender&&e.isLastMessageBySender===r.isLastMessageBySender,bT=eg.memo(ET,ST),xT="_ticontainer_xg0dn_1",TT="_tiblock_xg0dn_5",CT="_tidot_xg0dn_12",kT="_mercuryTypingAnimation_xg0dn_1",Zi={ticontainer:xT,tiblock:TT,tidot:CT,mercuryTypingAnimation:kT},RT=({isTyping:e=!1})=>E.jsx("div",{className:Zi.ticontainer,children:E.jsx("div",{className:Zi.tiblock,children:e?E.jsxs(E.Fragment,{children:[E.jsx("div",{className:V(Zi.tidot,"chat__typingIndicator")}),E.jsx("div",{className:V(Zi.tidot,"chat__typingIndicator")}),E.jsx("div",{className:V(Zi.tidot,"chat__typingIndicator")})]}):null})}),OT=Object.assign({_id:"typing-indicator"},new ge.TextMessage("",new ge.BotUser)),NT=({messages:e,isBotTyping:r,showGeneralConditions:i,commands:s,onTranscriptItemReaction:l,onButtonClick:u,onLinkClick:f})=>{const h=B.useRef(0),p=B.useRef(!0),_=B.useRef(null),y=B.useRef(null),x=B.useRef(null);B.useLayoutEffect(()=>{if(e.length&&_.current&&(h.current<e.length||r)){if(y.current){const v=y.current.offsetTop;_.current.scrollTop=v}else if(x.current){const v=x.current.offsetTop;_.current.scrollTop=v}p.current&&(p.current=!1),h.current=e.length}},[e,p,r]);let m;const w=e.length;return E.jsxs("div",{ref:_,className:V(qm.messageContainer,"chat__messageContainer"),style:{scrollBehavior:e.length&&p.current?"auto":"smooth"},id:"MessageContainer",role:"log","aria-live":"polite",children:[i&&E.jsx(lx,{}),E.jsxs("ul",{className:qm.messages,children:[e.map((v,S)=>{const R=AT(v,m),O=IT(v,S,e,r);m=v.sender.type;const N=S+1===w;return E.jsx(bT,{ref:N?x:null,message:v,commands:s,isLastMessage:N,isFirstMessageBySender:R,isLastMessageBySender:O,onButtonClick:u,onLinkClick:f,onReaction:l},N&&!r?"last":v._id)}),r&&E.jsx(Dy,{ref:y,message:OT,isLastMessage:!1,isAnimated:!0,isFirstMessageBySender:m!==ge.UserType.BOT,isLastMessageBySender:!0,children:E.jsx(RT,{isTyping:!0})},"last")]})]})},AT=(e,r)=>!r||r!==e.sender.type,IT=(e,r,i,s)=>{var h;const l=e.sender.type,u=i.length;return r+1===u?!(l===ge.UserType.BOT&&s):l!==((h=i.at(r+1))==null?void 0:h.sender.type)},DT="_bottomSheet_jp8dl_1",PT="_bottomSheetOpen_jp8dl_15",MT="_bottomSheetClose_jp8dl_20",Cn={bottomSheet:DT,bottomSheetOpen:PT,"slide-in":"_slide-in_jp8dl_1",bottomSheetClose:MT,"slide-out":"_slide-out_jp8dl_1"},FT="_container_xc2nx_1",g0={container:FT},LT=({contentUrl:e})=>{const r=Xn(u=>u.connection.sessionId),[i,s]=B.useState(!1);B.useEffect(()=>{s(u=>u||!!e)},[e]);const l=B.useMemo(()=>{if(e&&r){const u=new URL(e,document.baseURI);return u.searchParams.set("sessionId",r),u.toString()}else return},[e,r]);return E.jsx("div",{className:V(g0.container,Cn.bottomSheet,{[Cn.bottomSheetOpen]:!!e,[Cn.bottomSheetClose]:i&&!e}),children:l&&E.jsx("iframe",{title:"Drawer",src:l,className:g0.iframe})})},BT="_container_tr4tn_1",jT={container:BT},UT=({title:e,href:r,children:i})=>E.jsx("a",{href:r,title:e,target:"_blank",rel:"noopener noreferrer",children:i}),HT=()=>{const r=Je()("powered-by");return r&&r.length?E.jsx("div",{className:V(jT.container,"chat__poweredBy"),children:E.jsx(un,{options:{overrides:{a:UT}},children:r})}):null},y0=({className:e,children:r,...i})=>E.jsx(pa,{className:V(ro.buttonDefault,e),type:"button",...i,children:r}),io=({className:e,children:r,...i})=>E.jsx(pa,{className:V(ro.buttonPrimary,e),...i,children:r}),zT="_container_h23mk_1",GT="_formContainer_h23mk_17",$T="_emailInput_h23mk_22",VT="_description_h23mk_52",qT="_actions_h23mk_57",WT="_validationError_h23mk_67",ZT="_submitted_h23mk_74",bn={container:zT,formContainer:GT,emailInput:$T,description:VT,actions:qT,validationError:WT,submitted:ZT},QT=({visible:e,methods:r,onEmailExport:i,onPdfExport:s,onClose:l})=>{const u=Je(),[f,h]=B.useState(void 0),[p,_]=B.useState(!1),[y,x]=B.useState(!1),[m,w]=B.useState(void 0),v=B.useRef(null);B.useEffect(()=>{var N;e?((N=v.current)==null||N.focus(),_(!1),x(!1),h(e)):f===!0&&h(!1)},[e,f]);const S=N=>{N.preventDefault(),m&&m.length>0&&(i(m),_(!0),setTimeout(l,3*1e3))},R=N=>{const b=N.target.value.trim(),k=/^\w+([.-]?\w+)*@\w+([.-]?\w+)*(\.\w{2,3})+$/.test(b);w(k?b:"")},O=()=>{x(!0),s(),setTimeout(l,3*1e3)};return E.jsxs("div",{className:V(bn.container,Cn.bottomSheet,{[Cn.bottomSheetOpen]:f===!0,[Cn.bottomSheetClose]:f===!1}),children:[r.pdf&&E.jsxs(E.Fragment,{children:[E.jsx("h2",{children:u("export-transcript.pdf.title")}),E.jsx(un,{className:bn.description,children:u("export-transcript.pdf.description")||""}),E.jsxs("div",{className:bn.actions,children:[E.jsx(y0,{onClick:l,children:u("export-transcript.pdf.cancel")}),E.jsx(io,{onClick:O,disabled:y,children:u("export-transcript.pdf.download")})]})]}),r.email&&E.jsxs(E.Fragment,{children:[E.jsx("h2",{children:u("export-transcript.email.title")}),E.jsx(un,{className:bn.description,children:u("export-transcript.email.description")||""}),E.jsxs("form",{onSubmit:S,className:bn.formContainer,children:[E.jsxs("div",{children:[E.jsx("input",{disabled:p,ref:v,type:"email",placeholder:u("export-transcript.email.placeholder"),className:bn.emailInput,onChange:R}),(m==null?void 0:m.length)===0?E.jsx("div",{className:bn.validationError,children:u("export-transcript.email.invalid")}):null]}),E.jsxs("div",{className:bn.actions,children:[E.jsx(y0,{onClick:l,children:u("export-transcript.email.cancel")}),E.jsx(io,{type:"submit",disabled:p||m===void 0||m.length===0,children:u("export-transcript.email.send")})]})]}),p&&E.jsx("div",{className:bn.submitted,children:u("export-transcript.email.success")})]})]})},KT="_inputContainer_fi5ao_1",XT={inputContainer:KT},YT="_blockUserInput_mjy87_1",JT={blockUserInput:YT,"append-animate":"_append-animate_mjy87_1"},eC=({visible:e})=>{const r=Je();return e?E.jsx("div",{className:V(JT.blockUserInput,"chat__blockUserInput"),children:r("block-user-input.title")}):null},tC="_commandsDropdown_5ytuv_1",nC="_commands_5ytuv_1",rC="_command_5ytuv_1",iC="_commandActive_5ytuv_46",oC="_commandsSelections_5ytuv_55",Xi={commandsDropdown:tC,commands:nC,command:rC,commandActive:iC,commandsSelections:oC},sC=(e,r)=>{B.useEffect(()=>{const i=s=>{e.current&&!e.current.contains(s.target)&&r()};return document.addEventListener("mousedown",i),()=>document.removeEventListener("mousedown",i)},[e,r])},aC=(e,r,i,s,l)=>{B.useEffect(()=>{const u=f=>{if(e.length)switch(f.key){case"Enter":i(e[r]);break;case"ArrowUp":s(h=>h>0?h-1:e.length-1);break;case"ArrowDown":s(h=>h<e.length-1?h+1:0);break;case"Escape":l([]);break}};return document.addEventListener("keydown",u),()=>{document.removeEventListener("keydown",u)}},[e,r,i,s,l])},lC=({text:e,commands:r,onSelectCommand:i,onVisibilityChange:s})=>{const l=B.useRef(null),u=Je(),[f,h]=B.useState([]),[p,_]=B.useState(v0(r)),[y,x]=B.useState(0),m=w=>i(`/${w}`);return sC(l,()=>h([])),aC(f,y,m,x,h),B.useEffect(()=>{_(v0(r))},[r]),B.useEffect(()=>{const w=e.length||0;w===0||w>p||!e.startsWith("/")?h([]):h(r.filter(uC(e))),x(0)},[r,e,p]),B.useEffect(()=>{s(!!f.length)},[f,s]),f.length?E.jsx("div",{ref:l,className:Xi.commandsDropdown,children:E.jsx("ul",{className:Xi.commands,role:"listbox",children:f.map((w,v)=>E.jsxs("li",{className:V([Xi.command,y===v&&Xi.commandActive]),role:"option",onClick:()=>m(w),onMouseOver:()=>x(v),children:[E.jsxs("h1",{children:["/",w]}),E.jsx("p",{children:u(`commands.${w}`)})]},w))})}):null},v0=e=>Math.max(...e.map(r=>r.length+1)),uC=e=>r=>{const i=`/${r}`;return i.startsWith(e)&&i.length>=e.length},_0=3,cC=({commands:e,onSelectCommand:r})=>{const i=Je(),[s,l]=B.useState(!1),u=_=>()=>{r(`/${_}`),l(!1)},f=()=>{l(!0)},h=()=>{l(!1)},p=s?e:e.slice(0,_0);return E.jsxs("div",{className:Xi.commandsSelections,children:[p.map(_=>E.jsxs("button",{onClick:u(_),children:["/",_]})),p.length<e.length?E.jsx("button",{"aria-label":i("commands.show-more.tooltip"),"data-title":i("commands.show-more.tooltip"),tabIndex:0,onClick:f,children:i("commands.show-more.action")},"show-more"):p.length>_0?E.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]})},fC="_callToActionContainer_bkfcm_1",dC="_callToActionTitle_bkfcm_23",hC="_rateOverlay_bkfcm_30",pC="_body_bkfcm_52",mC="_footer_bkfcm_60",gC="_actions_bkfcm_73",yC="_bubbles_bkfcm_101",vC="_rateFeedbackBotBubble_bkfcm_130",_C="_rateFeedbackGuestBubble_bkfcm_136",EC="_avatar_bkfcm_142",wC="_fadeInLeft_bkfcm_1",SC="_bubble_bkfcm_101",bC="_appear_bkfcm_1",xC="_botBubble_bkfcm_168",TC="_guestBubble_bkfcm_179",CC="_rateText_bkfcm_198",kC="_stars_bkfcm_203",RC="_starsSmall_bkfcm_215",OC="_starsLarge_bkfcm_219",NC="_star_bkfcm_203",AC="_starReadonly_bkfcm_236",IC="_starIcon_bkfcm_246",DC="_starsDescriptionContainer_bkfcm_264",PC="_starsDescription_bkfcm_264",pt={callToActionContainer:fC,"append-animate":"_append-animate_bkfcm_1",callToActionTitle:dC,rateOverlay:hC,body:pC,footer:mC,actions:gC,bubbles:yC,rateFeedbackBotBubble:vC,rateFeedbackGuestBubble:_C,avatar:EC,fadeInLeft:wC,bubble:SC,appear:bC,botBubble:xC,guestBubble:TC,rateText:CC,stars:kC,starsSmall:RC,starsLarge:OC,star:NC,starReadonly:AC,starIcon:IC,starsDescriptionContainer:DC,starsDescription:PC},MC=({value:e,index:r,count:i,readonly:s,onHover:l,onClick:u})=>{const f=h=>{u&&h.key==="Enter"&&u()};return E.jsx("li",{className:V(pt.star,{[pt.starReadonly]:s},"chat__conversationRating__star"),children:E.jsx("div",{role:"radio","aria-checked":e>r?"true":"false","aria-posinset":r+1,"aria-setsize":i,tabIndex:0,onMouseOver:l,onKeyDown:f,onClick:u,children:E.jsx("span",{role:"img","aria-label":"Star",className:V(pt.starIcon),children:E.jsx("svg",{viewBox:"64 64 896 896",focusable:"false","data-icon":"star",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",children:E.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"})})})})})},E0=5,Ly=({value:e,size:r,readonly:i=!1,onChange:s})=>{const[l,u]=B.useState(void 0),f=()=>{u(void 0)},h=_=>()=>{if(!i){const y=_+1;u(y)}},p=_=>()=>{s&&!i&&(s(_===0&&e===1?0:_+1),u(void 0))};return E.jsx("ul",{tabIndex:0,role:"radiogroup",className:V(pt.stars,{[pt.starsSmall]:r==="small",[pt.starsLarge]:r==="large"},"chat__conversationRating__stars",{chat__conversationRating__stars__small:r==="small",chat__conversationRating__stars__large:r==="large"}),onMouseOut:f,children:Array(E0).fill(0).map((_,y)=>E.jsx(MC,{value:l===void 0?e:l,index:y,count:E0,readonly:i,onHover:h(y),onClick:p(y)},y))})},FC=({visible:e,onRate:r})=>{const i=Je();return e?E.jsxs("div",{className:V(pt.callToActionContainer,"chat__conversationRating__callToAction"),children:[E.jsx("div",{className:V(pt.callToActionTitle,"chat__conversationRating__callToAction__title"),children:i("conversation-rating.call-to-action.title")}),E.jsx(Ly,{value:0,size:"small",onChange:r})]}):null},Wu=({isFirstMessageBySender:e,isLastMessageBySender:r,children:i})=>E.jsxs("div",{className:V(de.message,de.messageBot,e&&de.messageBotFirst,r&&de.messageBotLast,"chat__bubbleContainer","chat__botBubbleContainer",e&&"chat__bubbleContainer--first",r&&"chat__bubbleContainer--last"),children:[E.jsx("img",{className:V(de.avatar,de.botAvatar),src:"bot.svg",alt:"Bot"}),E.jsx("div",{className:V(de.bubble,de.bubbleLeft,"chat__bubble","chat__botBubble"),children:E.jsx("div",{className:V(de.leftText,de.bubbleContent),children:i})})]}),LC=({children:e})=>E.jsx("div",{className:V(de.message,de.messageGuest,de.messageGuestFirst,de.messageGuestLast,"chat__bubbleContainer","chat__guestBubbleContainer","chat__bubbleContainer--first","chat__bubbleContainer--last"),children:E.jsx("div",{className:V(de.bubble,de.bubbleRight,"chat__bubble","chat__guestBubble"),children:E.jsx("div",{className:V(de.rightText,de.bubbleContent),children:e})})}),BC=({visible:e,rating:r,onRate:i,onClose:s})=>{const l=Je(),[u,f]=B.useState(r),[h,p]=B.useState(void 0),[_,y]=B.useState(void 0),[x,m]=B.useState({submitted:!1,feedback:""}),[w,v]=B.useState(!1),S=B.useRef(null);B.useEffect(()=>{e?(m({submitted:!1,feedback:""}),y(e)):_===!0&&y(!1)},[e,_]),B.useEffect(()=>{f(r)},[r]),B.useEffect(()=>{const O=l(`conversation-rating.overlay.bot-message.rate-feedback.value-${u}`);p(O!=null&&O.length?O:void 0)},[u,l]),B.useEffect(()=>{x.submitted?setTimeout(()=>v(!0),x.feedback.length?500:0):v(!1)},[x]);const R=O=>{var b,k;O.preventDefault();const N=((k=(b=S.current)==null?void 0:b.value)==null?void 0:k.trim())||"";i(u,N),m({submitted:!0,feedback:N})};return E.jsx("div",{className:V(pt.rateOverlay,Cn.bottomSheet,"chat__conversationRating__overlay",{[Cn.bottomSheetOpen]:_===!0,[Cn.bottomSheetClose]:_===!1}),children:E.jsxs("form",{onSubmit:R,children:[E.jsxs("div",{className:V(pt.body,"chat__conversationRating__overlay__body"),children:[E.jsx("div",{}),E.jsx("div",{className:V(pt.bubbles),children:e&&h&&E.jsxs(E.Fragment,{children:[E.jsxs(Wu,{isFirstMessageBySender:!0,isLastMessageBySender:!1,children:[E.jsx("h2",{children:l("conversation-rating.overlay.title")}),E.jsxs("div",{className:V(pt.starsDescriptionContainer),children:[E.jsx(Ly,{value:u,size:"large",readonly:x.submitted,onChange:f}),E.jsxs("div",{className:V(pt.starsDescription),children:[E.jsx("div",{children:l("conversation-rating.overlay.star.very-bad")}),E.jsx("div",{children:l("conversation-rating.overlay.star.very-good")})]})]})]}),E.jsx(Wu,{isFirstMessageBySender:!1,isLastMessageBySender:!w||!!x.feedback.length,children:E.jsx("div",{children:h})}),!!x.feedback.length&&E.jsx(LC,{children:x.feedback}),w&&E.jsx(Wu,{isFirstMessageBySender:!!x.feedback.length,isLastMessageBySender:!0,children:E.jsx("div",{children:l("conversation-rating.overlay.bot-message.submit-feedback")})})]})})]}),E.jsxs("div",{className:V(pt.footer,"chat__conversationRating__overlay__footer"),children:[!x.submitted&&E.jsx("input",{ref:S,placeholder:l("conversation-rating.overlay.guest-feedback.input-placeholder")}),E.jsx("div",{className:V(pt.actions,"chat__conversationRating__overlay__footer__actions"),children:x.submitted?E.jsx(io,{type:"button",onClick:s,children:l("conversation-rating.overlay.action.close")}):E.jsx(io,{type:"submit",children:l("conversation-rating.overlay.action.submit")})})]})]})})},jC=({conversationRating:{enabled:e,rating:r},numberOfMessagesFromGuest:i,showRatingOverlay:s,setShowRatingOverlay:l,onRate:u})=>{const[f,h]=B.useState(0),p=x=>{h(x),l(!0)},_=()=>l(!1),y=!r&&i>=1;return e?E.jsxs(E.Fragment,{children:[E.jsx(FC,{visible:y,onRate:p}),E.jsx(BC,{visible:s,rating:f,onRate:u,onClose:_})]}):null},UC="_inputWrapper_e3h44_1",HC="_withOpenCommands_e3h44_14",zC="_messageInputWrapper_e3h44_20",GC="_messageInput_e3h44_20",$C="_buttons_e3h44_44",VC="_button_e3h44_44",mr={inputWrapper:UC,withOpenCommands:HC,messageInputWrapper:zC,messageInput:GC,buttons:$C,button:VC},qC="_audioRecorder_g845f_1",WC="_audioButton_g845f_6",ZC="_recorderIcon_g845f_37",QC="_pulse_g845f_1",KC="_spinning_g845f_60",XC="_spin_g845f_60",gr={audioRecorder:qC,audioButton:WC,recorderIcon:ZC,pulse:QC,spinning:KC,spin:XC},w0=2048,ta=16e3;class YC extends eg.Component{constructor(i){super(i);be(this,"audioInput",null);be(this,"volume",null);be(this,"leftchannel",[]);be(this,"recorder",null);be(this,"recordingLength",0);be(this,"sampleRate",null);be(this,"mediaStream",null);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(i){this.mediaStream=i,this.leftchannel.length=0,this.recordingLength=0,this.initRecording(i)}initRecording(i){const s=window.AudioContext||window.webkitAudioContext,l=new s;this.sampleRate=l.sampleRate,this.volume=l.createGain(),this.audioInput=l.createMediaStreamSource(i),this.audioInput.connect(this.volume),this.recorder=l.createScriptProcessor(w0,1,1),this.recorder.onaudioprocess=this.processRecordingInput,this.volume.connect(this.recorder),this.recorder.connect(l.destination)}processRecordingInput(i){if(this.state.recordingState==="connecting"&&this.setState({recordingState:"recording"}),this.state.recordingState!=="none"){const s=i.inputBuffer.getChannelData(0);this.leftchannel.push(new Float32Array(s)),this.recordingLength+=w0}}handleClickSubmitAudio(){const i=ek(this.leftchannel,this.recordingLength),s=tk(i,this.sampleRate||0),l=JC(s);this.props.onAudioRecorded(l),this.handleClickStopAudio()}handleClickStopAudio(){var i,s,l,u;this.setState({recordingState:"none"}),(i=this.audioInput)==null||i.disconnect(),(s=this.volume)==null||s.disconnect(),(l=this.recorder)==null||l.disconnect(),this.mediaStream&&((u=this.mediaStream)==null||u.getAudioTracks().forEach(f=>{f.stop()}))}render(){return E.jsxs("div",{className:gr.audioRecorder,children:[this.state.recordingState==="none"&&E.jsx("button",{className:V(gr.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:E.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",children:[E.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"}),E.jsx("path",{d:"M0 0h24v24H0z",fill:"none"})]})}),this.state.recordingState==="connecting"&&E.jsxs("svg",{className:gr.spinning,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",children:[E.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"}),E.jsx("path",{d:"M0 0h24v24H0z",fill:"none"})]}),this.state.recordingState==="recording"&&E.jsxs("div",{className:gr.audioRecorder,children:[E.jsx("button",{className:V(gr.audioButton),onClick:this.handleClickStopAudio,"aria-label":this.props.translate("message-input.actions.stop-audio-recording.label"),tabIndex:0,children:E.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",children:[E.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"}),E.jsx("path",{d:"M0 0h24v24H0z",fill:"none"})]})}),E.jsx("div",{className:gr.recorderIcon}),E.jsx("button",{className:V(gr.audioButton),type:"submit",onClick:this.handleClickSubmitAudio,"aria-label":this.props.translate("message-input.actions.submit-audio-recording.label"),tabIndex:0,autoFocus:!0,children:E.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",children:[E.jsx("path",{d:"M0 0h24v24H0z",fill:"none"}),E.jsx("path",{d:"M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"})]})})]})]})}}const JC=e=>{const r=new ArrayBuffer(44+e.length*2),i=new DataView(r);Hs(i,0,"RIFF"),i.setUint32(4,44+e.length*2,!0),Hs(i,8,"WAVE"),Hs(i,12,"fmt "),i.setUint32(16,16,!0),i.setUint16(20,1,!0),i.setUint16(22,1,!0),i.setUint32(24,ta,!0),i.setUint32(28,ta*4,!0),i.setUint16(32,4,!0),i.setUint16(34,16,!0),Hs(i,36,"data"),i.setUint32(40,e.length*2,!0);const s=e.length;let l=44;const u=1;for(let f=0;f<s;f++)i.setInt16(l,e[f]*(32767*u),!0),l+=2;return new Blob([i],{type:"audio/wav"})},Hs=(e,r,i)=>{for(let s=0;s<i.length;s++)e.setUint8(r+s,i.charCodeAt(s))},ek=(e,r)=>{const i=new Float32Array(r);let s=0;const l=e.length;for(let u=0;u<l;u++){const f=e[u];i.set(f,s),s+=f.length}return i},tk=(e,r)=>{if(ta===r)return e;const i=r/ta,s=Math.round(e.length/i),l=new Float32Array(s);let u=0,f=0;for(;u<l.length;){const h=Math.round((u+1)*i);let p=0,_=0;for(let y=f;y<h&&y<e.length;y++)p+=e[y],_++;l[u]=p/_,u++,f=h}return l},nk=({speechSupport:e,transcriptExportEnabled:r,disabled:i,textInput:s,commandsVisible:l,onTextInput:u,onTextInputSubmit:f,onAudioRecorded:h,onOpenTranscriptExportModal:p})=>{const _=Je(),y=B.useRef(null);B.useEffect(()=>{var S;(S=y.current)==null||S.focus()},[s]);const x=()=>{const S=y.current;S&&s.trim().length>=1&&f(s.trim())&&(S.value="",S.style.height="",S.focus())},m=S=>{S.preventDefault(),x()},w=S=>{const R=S.target.value;u(R),S.target.style.height="";const{scrollHeight:O}=S.target;S.target.style.height=`${O>150?150:O}px`},v=S=>{S.code==="Enter"&&!S.shiftKey?(S.repeat||x(),S.preventDefault()):l&&(S.code==="ArrowUp"||S.code==="ArrowDown")&&S.preventDefault()};return E.jsxs("form",{className:V(mr.inputWrapper,l&&mr.withOpenCommands,"chat__textInput"),onSubmit:m,children:[E.jsx("div",{className:mr.messageInputWrapper,children:E.jsx("textarea",{id:"user_input",ref:y,className:mr.messageInput,tabIndex:0,placeholder:_("message-input-placeholder"),value:s,onChange:w,onKeyDown:v,"aria-label":_("message-input-label"),"aria-controls":"command-list","aria-haspopup":"listbox"})}),E.jsxs("div",{className:V(mr.buttons,"chat__buttons"),children:[!s.length&&r&&E.jsx("button",{type:"button",className:V(mr.button,"chat__button"),"aria-label":_("message-input.actions.export-transcript.label"),"data-title":_("message-input.actions.export-transcript.label"),tabIndex:0,onClick:p,children:E.jsx("svg",{viewBox:"64 64 896 896",focusable:"false",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",children:E.jsx("path",{d:"M456 231a56 56 0 10112 0 56 56 0 10-112 0zm0 280a56 56 0 10112 0 56 56 0 10-112 0zm0 280a56 56 0 10112 0 56 56 0 10-112 0z"})})}),s.length||!e||navigator.mediaDevices===void 0?E.jsx("button",{className:V(mr.button,"chat__button"),type:"submit","aria-label":_("message-input.actions.submit.label"),"data-title":_("message-input.actions.submit.label"),tabIndex:0,disabled:i,children:E.jsx("svg",{viewBox:"64 64 896 896",focusable:"false",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",children:E.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"})})}):e&&navigator.mediaDevices!==void 0&&E.jsx(YC,{translate:_,onAudioRecorded:h})]})]})},rk="_quickReplies_83npe_1",ik="_quickReply_83npe_9",S0={quickReplies:rk,quickReply:ik},ok=({quickReplies:e,onQuickReplyClick:r})=>e.length?E.jsx("div",{className:V(S0.quickReplies,"chat__quickReplies"),children:e.map(i=>E.jsx(pa,{tabIndex:0,className:V(S0.quickReply,"chat__button","chat__quickReply"),onClick:()=>r(i),children:i.label},i.label))}):null,b0=5e3,sk=1e3,ak=({isBotTyping:e,quickReplies:r,speechSupport:i,transcriptExportEnabled:s,conversationRating:l,numberOfMessagesFromGuest:u,showRatingOverlay:f,commands:h,setShowRatingOverlay:p,onTextInput:_,onRate:y,onQuickReplyClick:x,onAudioRecorded:m,onOpenTranscriptExportModal:w})=>{const[v,S]=B.useState(""),[R,O]=B.useState(!1),[N,b]=B.useState(!1),k=B.useRef(),T=B.useRef(0);B.useEffect(()=>{if(R&&!e){const q=k.current?Date.now()-k.current:0;q>b0?O(!1):setTimeout(()=>{O(!1)},b0-q)}},[R,e]),B.useEffect(()=>{R&&(k.current=Date.now())},[R]);const L=q=>{const fe=Date.now()-T.current<sk;return N?!1:e||fe?(O(!0),!1):(_(q),S(""),T.current=Date.now(),!0)},z=q=>{S(q+" ")};return E.jsxs("div",{className:V(XT.inputContainer),children:[E.jsx(ok,{quickReplies:r,onQuickReplyClick:x}),E.jsx(eC,{visible:R}),!R&&E.jsx(jC,{conversationRating:l,numberOfMessagesFromGuest:u,onRate:y,showRatingOverlay:f,setShowRatingOverlay:p}),!!(h!=null&&h.length)&&E.jsx(lC,{text:v,commands:h,onSelectCommand:z,onVisibilityChange:b}),E.jsx(nk,{textInput:v,speechSupport:i,transcriptExportEnabled:s,disabled:R,commandsVisible:N,onTextInput:S,onTextInputSubmit:L,onOpenTranscriptExportModal:w,onAudioRecorded:m}),!!(h!=null&&h.length)&&E.jsx(cC,{commands:h,onSelectCommand:S})]})},lk=({clientName:e,messages:r,quickReplies:i,isBotTyping:s,drawerContentUrl:l,speechSupport:u,transcriptExportEnabled:f,conversationRating:h,showGeneralConditions:p,commands:_,onMessageFromUser:y,onRate:x,onQuickReplyClick:m,onButtonClick:w,onLinkClick:v,onAudioRecorded:S,onTranscriptExport:R,onPdfExport:O,onTranscriptItemReaction:N})=>{const b=ei(),k=Xn(oe=>oe.connection.connectionState),[T,L]=B.useState(!1),[z,q]=B.useState(!1),fe=f.email||f.pdf,te=r.filter(oe=>oe.sender.type===hy.GUEST).length;return B.useEffect(()=>{if(k===Er.CONNECTED){const oe=oa.parse(window.location.search);b(dy(e,oe))}},[e,k,b]),E.jsxs("div",{className:Fu.container,children:[E.jsxs("div",{className:V([Fu.chatcontent,(T||z)&&Fu.accessabilityHidden]),children:[E.jsx(NT,{messages:r,isBotTyping:s,showGeneralConditions:p,commands:_,onButtonClick:w,onLinkClick:v,onTranscriptItemReaction:N}),E.jsx(ak,{isBotTyping:s,quickReplies:s?[]:i,numberOfMessagesFromGuest:te,speechSupport:u,transcriptExportEnabled:fe,conversationRating:T?{enabled:!1}:h,showRatingOverlay:z,setShowRatingOverlay:q,commands:_,onRate:x,onQuickReplyClick:m,onTextInput:y,onAudioRecorded:S,onOpenTranscriptExportModal:()=>L(!T)}),E.jsx(HT,{})]}),fe&&E.jsx(QT,{methods:f,visible:T,onEmailExport:R,onPdfExport:O,onClose:()=>L(!1)}),E.jsx(LT,{contentUrl:l})]})},uk=e=>{const{messages:r,quickReplies:i,isBotTyping:s,drawerContentUrl:l,speechSupport:u,transcriptExportEnabled:f,conversationRating:h,showGeneralConditions:p,commands:_}=e.chat;return{messages:r,quickReplies:i,isBotTyping:s,drawerContentUrl:l,speechSupport:u,transcriptExportEnabled:f,conversationRating:h,showGeneralConditions:p,commands:_}},ck=e=>({onRestartChat:(r,i)=>e(da(r,i)),onMessageFromUser:r=>e(Gg(r)),onRate:(r,i)=>e(jS(r,i)),onAudioRecorded:r=>e(NS(r)),onActionFromUser:r=>e(r),onQuickReplyClick:r=>e(zg(r)),onNluEvent:r=>e(Qg(r)),onButtonClick:r=>e(HS(r)),onLinkClick:r=>e(zS(r)),onTranscriptExport:r=>e(PS(r)),onPdfExport:()=>e(LS()),onTranscriptItemReaction:(r,i)=>e(ge.transcriptItemGuestReaction(r,i||null))}),fk=uE(uk,ck)(lk),By=()=>dk(window.location.pathname),dk=e=>{const r=e.split("/"),i=e.endsWith("/");return r[r.length-(i?2:1)]},jy=()=>B.useMemo(()=>By(),[]),hk="_header_19p33_1",pk="_logoContainer_19p33_13",mk="_logo_19p33_13",gk="_actions_19p33_26",yk="_closeButton_19p33_72",Yi={header:hk,logoContainer:pk,logo:mk,actions:gk,closeButton:yk},Uy=e=>r=>{const i=r.key;(i==="ArrowDown"||i==="ArrowRight"||i==="Enter"||i===" "||i==="Space")&&(r.stopPropagation(),e())},vk=({onClick:e})=>{const r=Je();return E.jsx("button",{className:V(Yi.closeButton,"tooltip--bottom"),"aria-label":r("header.close-chat"),"data-title":r("header.close-chat"),tabIndex:0,onClick:e,onKeyDown:Uy(e),children:E.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 256 256",children:E.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"})})})},_k=({onClick:e})=>{const r=Je();return E.jsx("button",{className:"tooltip--bottom","aria-label":r("header.restart-chat"),"data-title":r("header.restart-chat"),tabIndex:0,onClick:e,onKeyDown:Uy(e),children:E.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 32 32",children:[E.jsx("path",{d:"M14.506,23.578l-5.511,0l-3.993,3.501l-0.007,0.006c-0.302,0.261 -0.687,0.405 -1.084,0.405c-0.245,-0.001 -0.488,-0.055 -0.711,-0.161c-0.595,-0.277 -0.978,-0.886 -0.974,-1.551l-0,-19.558c-0,-0.939 0.761,-1.711 1.685,-1.711l21.189,-0c0.924,-0 1.685,0.772 1.685,1.711l0,5.104l-1.444,0l-0,-5.104c-0,-0.134 -0.109,-0.244 -0.241,-0.244l-21.189,-0c-0.132,-0 -0.24,0.11 -0.24,0.244l-0,19.558c0.001,0.133 0.109,0.242 0.24,0.242c0.056,-0 0.109,-0.019 0.152,-0.055l4.192,-3.675c0.131,-0.115 0.299,-0.179 0.472,-0.179l5.779,0l-0,1.467Z"}),E.jsx("path",{d:"M29.869,20.148c0,4.137 -3.373,7.556 -7.509,7.612l-0.102,-0c-1.943,0.004 -3.814,-0.741 -5.223,-2.078c-0.183,-0.172 -0.286,-0.412 -0.286,-0.664c-0,-0.501 0.412,-0.913 0.913,-0.913c0.233,-0 0.458,0.089 0.627,0.249c1.074,1.014 2.495,1.579 3.971,1.579c3.174,-0 5.785,-2.612 5.785,-5.785c-0,-3.173 -2.611,-5.784 -5.785,-5.784c-1.533,-0 -3.006,0.61 -4.09,1.694c-0.01,0.01 -0.019,0.019 -0.03,0.028l-1.447,1.322l1.302,0c0.502,0 0.914,0.413 0.914,0.914c-0,0.501 -0.412,0.913 -0.914,0.913l-3.653,0c-0.501,0 -0.913,-0.412 -0.913,-0.913l-0,-3.654c-0,-0.501 0.412,-0.913 0.913,-0.913c0.501,0 0.913,0.412 0.913,0.913l0,1.577l1.635,-1.496c1.426,-1.418 3.357,-2.215 5.368,-2.215c4.175,0 7.611,3.436 7.611,7.611c-0,0.001 -0,0.002 -0,0.003Z"})]})})},x0=({className:e,withActions:r=!0,...i})=>{const s=ei(),l=jy(),u=()=>{const h=oa.parse(window.location.search);s(da(l,h))},f=()=>{s(Ab())};return E.jsxs("div",{className:V([Yi.header,e]),...i,children:[E.jsx("div",{className:Yi.logoContainer,children:E.jsx("div",{className:Yi.logo})}),E.jsxs("div",{className:Yi.actions,children:[r&&E.jsx(_k,{onClick:u}),E.jsx(vk,{onClick:f})]})]})},Ek="_chatwindow_6v6ob_1",wk="_chatwindowWithAside_6v6ob_46",T0={chatwindow:Ek,chatwindowWithAside:wk},Sk="_sourceInfos_ukaw1_1",bk="_sourceDetails_ukaw1_16",xk="_sourceHeader_ukaw1_23",Tk="_sourceHeaderIcon_ukaw1_43",Ck="_openSourceButton_ukaw1_47",kk="_closeSourceInfosButton_ukaw1_70",Rk="_sourceContent_ukaw1_85",Ok="_loadingSourceInfos_ukaw1_107",Nk="_loading_ukaw1_107",Ak="_rotate_ukaw1_1",Ik="_loadingError_ukaw1_121",dn={sourceInfos:Sk,sourceDetails:bk,sourceHeader:xk,sourceHeaderIcon:Tk,openSourceButton:Ck,closeSourceInfosButton:kk,sourceContent:Rk,loadingSourceInfos:Ok,loading:Nk,rotate:Ak,loadingError:Ik},Dk=({onClick:e})=>{const r=Je();return E.jsx("button",{className:V(dn.closeSourceInfosButton,"tooltip--bottom"),"aria-label":r("source-infos.close"),"data-title":r("source-infos.close"),tabIndex:0,onClick:e,children:E.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 256 256",children:E.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"})})})},Pk=({type:e})=>{switch(e){case"WEBSITE":return E.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 256 256",children:E.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"})});case"PDF":return E.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 256 256",children:E.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"})});case"DOCX":return E.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 256 256",children:E.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"})});case"TEXT":return E.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 256 256",children:E.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"})});default:return E.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 256 256",children:E.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"})})}},Mk=({sourceInfos:e,onClose:r})=>E.jsxs("div",{className:dn.sourceHeader,children:[E.jsx("div",{className:dn.sourceHeaderIcon,children:e&&E.jsx(Pk,{type:e.knowledgeBaseType})}),E.jsx("div",{children:e&&E.jsx("h1",{children:e.title})}),E.jsx(Dk,{onClick:r})]}),Fk=({title:e,href:r,children:i})=>E.jsx("a",{href:r,title:e,target:"_blank",rel:"noopener noreferrer",children:i}),Lk=({className:e,children:r,...i})=>E.jsx("a",{className:V(ro.button,ro.buttonPrimary,e),type:"button",...i,children:r}),Bk=({label:e,url:r})=>E.jsxs(Lk,{className:dn.openSourceButton,href:r,target:"_blank",children:[E.jsx("p",{children:e}),E.jsx("div",{children:E.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"#000000",viewBox:"0 0 256 256",children:E.jsx("path",{d:"M222,104a6,6,0,0,1-12,0V54.49l-69.75,69.75a6,6,0,0,1-8.48-8.48L201.51,46H152a6,6,0,0,1,0-12h64a6,6,0,0,1,6,6Zm-38,26a6,6,0,0,0-6,6v72a2,2,0,0,1-2,2H48a2,2,0,0,1-2-2V80a2,2,0,0,1,2-2h72a6,6,0,0,0,0-12H48A14,14,0,0,0,34,80V208a14,14,0,0,0,14,14H176a14,14,0,0,0,14-14V136A6,6,0,0,0,184,130Z"})})})]}),jk=({sourceInfos:e})=>E.jsxs(E.Fragment,{children:[E.jsx("div",{className:V(dn.sourceContent,Fy.markdown),children:E.jsx(un,{options:{overrides:{a:Fk}},children:e.content})}),E.jsx(Bk,{label:e.title,url:e.url})]}),Uk=""+new URL("undraw_fixing-bugs-D_eYxJc6.svg",import.meta.url).href,Hk=()=>{const e=Je();return E.jsxs("div",{className:dn.loadingError,children:[E.jsx("h1",{children:e("source-infos.error.title")}),E.jsx("img",{src:Uk,title:e("source-infos.error.title")}),E.jsx("p",{children:e("source-infos.error.info")})]})},zk=()=>E.jsx("div",{className:dn.loadingSourceInfos,children:E.jsx("svg",{className:dn.loading,xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 256 256",children:E.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"})})}),Gk=()=>{const e=ei(),r=Xn(s=>s.chat.sourceInfos),i=()=>{e(Db())};return r?E.jsxs("div",{className:dn.sourceInfos,children:[E.jsx("div",{className:dn.sourceDetails,children:E.jsx(Mk,{sourceInfos:r.type==="loaded"?r:void 0,onClose:i})}),r.type==="loading"?E.jsx(zk,{}):r.type==="loading-error"?E.jsx(Hk,{}):E.jsx(jk,{sourceInfos:r})]}):null},$k="_container_114wy_1",Vk="_body_114wy_7",qk="_intro_114wy_14",Wk="_footer_114wy_39",Zk="_footnote_114wy_43",Qk="_containerWithFootnote_114wy_58",Kk="_startChatButton_114wy_73",Xk="_formFields_114wy_77",Yk="_formField_114wy_77",Jk="_radio_114wy_89",eR="_checkbox_114wy_96",tR="_input_114wy_104",nR="_inputLabel_114wy_138",rR="_selectWrapper_114wy_142",iR="_select_114wy_142",oR="_selectLabel_114wy_188",ot={container:$k,body:Vk,intro:qk,footer:Wk,footnote:Zk,containerWithFootnote:Qk,startChatButton:Kk,formFields:Xk,formField:Yk,radio:Jk,checkbox:eR,input:tR,inputLabel:nR,selectWrapper:rR,select:iR,selectLabel:oR},sR=({name:e,label:r,defaultValue:i,required:s,onChange:l})=>{const u=f=>{l(f.currentTarget.checked?"true":"false")};return E.jsxs("label",{className:V(ot.checkbox,"chat__startScreen__checkbox"),htmlFor:e,children:[E.jsx("input",{type:"checkbox",id:e,name:e,defaultChecked:i==="true",required:s,onChange:u}),E.jsx("div",{children:r})]})},aR=({type:e,name:r,label:i,defaultValue:s,placeholder:l,required:u,multiple:f,min:h,max:p,pattern:_,onChange:y})=>{const x=m=>{y(m.target.value)};return E.jsxs("label",{className:V(ot.input,"chat__startScreen__input"),htmlFor:r,children:[E.jsx("div",{className:V(ot.inputLabel),children:i}),E.jsx("input",{type:e,id:r,name:r,defaultValue:s,placeholder:l,required:u,multiple:f,min:h,max:p,pattern:_,onChange:x})]})},lR=({name:e,value:r,label:i,defaultChecked:s,required:l,onChange:u})=>{const f=`${e}-${r}`,h=p=>{u(p.target.value)};return E.jsxs("label",{className:V(ot.radio,"chat__startScreen__radio"),htmlFor:f,children:[E.jsx("input",{id:f,type:"radio",name:e,value:r,defaultChecked:s,required:l,onChange:h}),E.jsx("span",{className:V(ot.label),children:i})]})},uR=({name:e,label:r,defaultValue:i,required:s,multiple:l,options:u,onChange:f})=>{const h=p=>{f(p.target.value)};return E.jsxs("label",{className:V(ot.select,"chat__startScreen__select"),htmlFor:e,children:[E.jsx("div",{className:V(ot.selectLabel),children:r}),E.jsx("div",{className:V(ot.selectWrapper),children:E.jsx("select",{id:e,name:e,defaultValue:i,required:s,multiple:l,onChange:h,children:Object.entries(u||{}).map(([p,_])=>E.jsx("option",{value:p,selected:_===i,children:_}))})})]})},cR="start-screen.intro",fR="start-screen.start-chat",dR="start-screen.footnote",Kt="start-screen.form",C0=`${Kt}.fields`,hR=()=>{const e=Je(),r=ei(),[i,s]=B.useState({}),l=()=>{const x=Object.entries(i).reduce((m,[w,v])=>({...m,[w]:v.value}),{});r(Rb(x))},u=e(cR),f=e(fR),h=e(dR),p=B.useMemo(()=>{var x;return((x=e(C0))==null?void 0:x.split(";").map(m=>m.trim()))??[]},[e(C0)]);B.useEffect(()=>{p.length&&Object.keys(i).length===0&&s(p.reduce((x,m)=>({...x,[m]:pR(m,e)}),{}))},[e,p,i]);const _=x=>{x.preventDefault(),l()},y=x=>m=>{s(w=>({...w,[x]:{...w[x],value:m}}))};return E.jsxs("form",{onSubmit:_,className:V(ot.container,h&&ot.containerWithFootnote,"chat__startScreen"),children:[E.jsxs("div",{className:V(ot.body,"chat__startScreen__body"),children:[u&&E.jsx("div",{className:V(ot.intro,"chat__startScreen__intro"),children:E.jsx(un,{options:{overrides:{a:k0}},children:u})}),E.jsx("div",{className:V(ot.formFields,"chat__startScreen__fields"),children:Object.values(i).map(({type:x,name:m,label:w,placeholder:v,defaultValue:S,options:R,required:O,multiple:N,min:b,max:k,pattern:T})=>E.jsx("div",{className:V(ot.formField,"chat__startScreen__field"),children:(()=>{switch(x){case"radio":return E.jsxs(E.Fragment,{children:[E.jsx("div",{children:w}),Object.entries(R||{}).map(([L,z])=>E.jsx(lR,{name:m,value:L,label:z,defaultChecked:L===S,required:O,onChange:y(m)}))]});case"checkbox":return E.jsx(sR,{name:m,label:w,defaultValue:S,required:O,onChange:y(m)});case"select":return E.jsx(uR,{name:m,label:w,defaultValue:S,required:O,multiple:N,options:R,onChange:y(m)});default:return E.jsx(aR,{type:x,name:m,label:w,placeholder:v,defaultValue:S,required:O,multiple:N,min:b,max:k,pattern:T,onChange:y(m)})}})()},m))})]}),E.jsxs("div",{className:V(ot.footer,"chat__startScreen__footer"),children:[E.jsx(io,{type:"submit",className:ot.startChatButton,children:f}),h&&E.jsx("div",{className:ot.footnote,children:E.jsx(un,{options:{overrides:{a:k0}},children:h})})]})]})},k0=({title:e,href:r,children:i})=>E.jsx("a",{href:r,title:e,target:"_blank",rel:"noopener noreferrer",children:i}),pR=(e,r)=>{const i=r(`${Kt}.${e}.type`)||"text",s=r(`${Kt}.${e}.required`)==="true",l=r(`${Kt}.${e}.multiple`)==="true",u=r(`${Kt}.${e}.placeholder`),f=r(`${Kt}.${e}.label`)||"",h=r(`${Kt}.${e}.defaultValue`),p=r(`${Kt}.${e}.min`),_=r(`${Kt}.${e}.max`),y=r(`${Kt}.${e}.pattern`),x=gR(r(`${Kt}.${e}.options`));return{name:e,label:f,placeholder:u,value:mR(i,h,x)||"",defaultValue:h,options:x,type:i,required:s,multiple:l,min:p,max:_,pattern:y}},mR=(e,r,i)=>r||e==="select"&&Object.keys(i)[0]||"",gR=(e="")=>e.split(";").map(r=>r.trim()).reduce((r,i)=>{const[s,l]=i.split(":").map(u=>u.trim());return{...r,[s]:l}},{}),yR=()=>{const e=ia();B.useEffect(()=>{window.document.documentElement.lang=e.locale},[e.locale])},Qr={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"},vR=({clientName:e})=>{yR();const r=ei(),i=Xn(y=>y.intl.messages),s=Je(),l=Xn(y=>y.startScreen.useStartScreen),u=Xn(y=>y.startScreen.startScreenStatus),[f,h]=B.useState(void 0);B.useEffect(()=>{const y=oa.parse(window.location.search);y.cssClassName&&h(y.cssClassName);const x=m=>{switch(m.data.type){case Qr.TRIGGER_ACTION:r(m.data.action);break;case Qr.TRIGGER_STORY:r(Qg(m.data.story));break;case Qr.ON_CHAT_WINDOW_OPEN:r({type:"webclient.chatwindow.opened"});break;case Qr.ON_CHAT_WINDOW_CLOSE:r({type:"webclient.chatwindow.closed"});break;case Qr.CHAT_MESSAGE_FROM_GUEST:r(Gg(m.data.text));break;case Qr.RESTART_CHAT:r(da(e,y));break}};return r(jb(e,y)),window.addEventListener("message",m=>x(m),!1),()=>window.removeEventListener("message",x)},[e,r]),B.useEffect(()=>{const y=s("page.title");y&&document&&(document.title=y)},[i,s]);const p=l===void 0,_=l===!1||u==="HIDDEN";return E.jsx("div",{className:V(T0.chatwindow,_&&T0.chatwindowWithAside,"chat__chatwindow",f),children:p?null:_?E.jsxs(E.Fragment,{children:[E.jsx("header",{children:E.jsx(x0,{})}),E.jsx("main",{children:E.jsx(fk,{clientName:e})}),E.jsx("aside",{children:E.jsx(Gk,{})})]}):E.jsxs(E.Fragment,{children:[E.jsx("header",{children:E.jsx(x0,{withActions:!1})}),E.jsx("main",{children:E.jsx(hR,{})})]})})},_R=1024,ER=()=>{const e=jy(),r=Xn(u=>u.intl.locale),i=Xn(u=>u.intl.messages),[s,l]=B.useState(R0());return B.useEffect(()=>{const u=()=>{l(R0())};return window.addEventListener("resize",u),()=>window.removeEventListener("resize",u)},[]),E.jsx(Ww,{locale:r,messages:i,children:E.jsx("div",{className:V([Qw.app,s?"chat__large":"chat__small"]),children:E.jsx(vR,{clientName:e})})})},R0=()=>window.innerWidth>=_R;var Zu,O0;function bf(){if(O0)return Zu;O0=1;function e(r){var i=typeof r;return r!=null&&(i=="object"||i=="function")}return Zu=e,Zu}var Qu,N0;function wR(){if(N0)return Qu;N0=1;var e=typeof ys=="object"&&ys&&ys.Object===Object&&ys;return Qu=e,Qu}var Ku,A0;function Hy(){if(A0)return Ku;A0=1;var e=wR(),r=typeof self=="object"&&self&&self.Object===Object&&self,i=e||r||Function("return this")();return Ku=i,Ku}var Xu,I0;function SR(){if(I0)return Xu;I0=1;var e=Hy(),r=function(){return e.Date.now()};return Xu=r,Xu}var Yu,D0;function bR(){if(D0)return Yu;D0=1;var e=/\s/;function r(i){for(var s=i.length;s--&&e.test(i.charAt(s)););return s}return Yu=r,Yu}var Ju,P0;function xR(){if(P0)return Ju;P0=1;var e=bR(),r=/^\s+/;function i(s){return s&&s.slice(0,e(s)+1).replace(r,"")}return Ju=i,Ju}var ec,M0;function zy(){if(M0)return ec;M0=1;var e=Hy(),r=e.Symbol;return ec=r,ec}var tc,F0;function TR(){if(F0)return tc;F0=1;var e=zy(),r=Object.prototype,i=r.hasOwnProperty,s=r.toString,l=e?e.toStringTag:void 0;function u(f){var h=i.call(f,l),p=f[l];try{f[l]=void 0;var _=!0}catch{}var y=s.call(f);return _&&(h?f[l]=p:delete f[l]),y}return tc=u,tc}var nc,L0;function CR(){if(L0)return nc;L0=1;var e=Object.prototype,r=e.toString;function i(s){return r.call(s)}return nc=i,nc}var rc,B0;function kR(){if(B0)return rc;B0=1;var e=zy(),r=TR(),i=CR(),s="[object Null]",l="[object Undefined]",u=e?e.toStringTag:void 0;function f(h){return h==null?h===void 0?l:s:u&&u in Object(h)?r(h):i(h)}return rc=f,rc}var ic,j0;function RR(){if(j0)return ic;j0=1;function e(r){return r!=null&&typeof r=="object"}return ic=e,ic}var oc,U0;function OR(){if(U0)return oc;U0=1;var e=kR(),r=RR(),i="[object Symbol]";function s(l){return typeof l=="symbol"||r(l)&&e(l)==i}return oc=s,oc}var sc,H0;function NR(){if(H0)return sc;H0=1;var e=xR(),r=bf(),i=OR(),s=NaN,l=/^[-+]0x[0-9a-f]+$/i,u=/^0b[01]+$/i,f=/^0o[0-7]+$/i,h=parseInt;function p(_){if(typeof _=="number")return _;if(i(_))return s;if(r(_)){var y=typeof _.valueOf=="function"?_.valueOf():_;_=r(y)?y+"":y}if(typeof _!="string")return _===0?_:+_;_=e(_);var x=u.test(_);return x||f.test(_)?h(_.slice(2),x?2:8):l.test(_)?s:+_}return sc=p,sc}var ac,z0;function AR(){if(z0)return ac;z0=1;var e=bf(),r=SR(),i=NR(),s="Expected a function",l=Math.max,u=Math.min;function f(h,p,_){var y,x,m,w,v,S,R=0,O=!1,N=!1,b=!0;if(typeof h!="function")throw new TypeError(s);p=i(p)||0,e(_)&&(O=!!_.leading,N="maxWait"in _,m=N?l(i(_.maxWait)||0,p):m,b="trailing"in _?!!_.trailing:b);function k(ue){var Ue=y,Ie=x;return y=x=void 0,R=ue,w=h.apply(Ie,Ue),w}function T(ue){return R=ue,v=setTimeout(q,p),O?k(ue):w}function L(ue){var Ue=ue-S,Ie=ue-R,$e=p-Ue;return N?u($e,m-Ie):$e}function z(ue){var Ue=ue-S,Ie=ue-R;return S===void 0||Ue>=p||Ue<0||N&&Ie>=m}function q(){var ue=r();if(z(ue))return fe(ue);v=setTimeout(q,L(ue))}function fe(ue){return v=void 0,b&&y?k(ue):(y=x=void 0,w)}function te(){v!==void 0&&clearTimeout(v),R=0,y=S=x=v=void 0}function oe(){return v===void 0?w:fe(r())}function pe(){var ue=r(),Ue=z(ue);if(y=arguments,x=this,S=ue,Ue){if(v===void 0)return T(S);if(N)return clearTimeout(v),v=setTimeout(q,p),k(S)}return v===void 0&&(v=setTimeout(q,p)),w}return pe.cancel=te,pe.flush=oe,pe}return ac=f,ac}var lc,G0;function IR(){if(G0)return lc;G0=1;var e=AR(),r=bf(),i="Expected a function";function s(l,u,f){var h=!0,p=!0;if(typeof l!="function")throw new TypeError(i);return r(f)&&(h="leading"in f?!!f.leading:h,p="trailing"in f?!!f.trailing:p),e(l,u,{leading:h,maxWait:u,trailing:p})}return lc=s,lc}var DR=IR();const PR=na(DR);var uc,$0;function MR(){if($0)return uc;$0=1;function e(w,v){var S,R;if(typeof v=="function")R=v(w),R!==void 0&&(w=R);else if(Array.isArray(v))for(S=0;S<v.length;S++)R=v[S](w),R!==void 0&&(w=R);return w}function r(w,v){return w[0]==="-"&&Array.isArray(v)&&/^-\d+$/.test(w)?v.length+parseInt(w,10):w}function i(w){return/^\d+$/.test(w)}function s(w){return Object.prototype.toString.call(w)==="[object Object]"}function l(w){return Object(w)===w}function u(w){return Object.keys(w).length===0}var f=["__proto__","prototype","constructor"],h=function(w){return f.indexOf(w)===-1};function p(w,v){w.indexOf("[")>=0&&(w=w.replace(/\[/g,v).replace(/]/g,""));var S=w.split(v),R=S.filter(h);if(R.length!==S.length)throw Error("Refusing to update blacklisted property "+w);return S}var _=Object.prototype.hasOwnProperty;function y(w,v,S,R){if(!(this instanceof y))return new y(w,v,S,R);typeof v>"u"&&(v=!1),typeof S>"u"&&(S=!0),typeof R>"u"&&(R=!0),this.separator=w||".",this.override=v,this.useArray=S,this.useBrackets=R,this.keepArray=!1,this.cleanup=[]}var x=new y(".",!1,!0,!0);function m(w){return function(){return x[w].apply(x,arguments)}}return y.prototype._fill=function(w,v,S,R){var O=w.shift();if(w.length>0){if(v[O]=v[O]||(this.useArray&&i(w[0])?[]:{}),!l(v[O]))if(this.override)v[O]={};else{if(!(l(S)&&u(S)))throw new Error("Trying to redefine `"+O+"` which is a "+typeof v[O]);return}this._fill(w,v[O],S,R)}else{if(!this.override&&l(v[O])&&!u(v[O])){if(!(l(S)&&u(S)))throw new Error("Trying to redefine non-empty obj['"+O+"']");return}v[O]=e(S,R)}},y.prototype.object=function(w,v){var S=this;return Object.keys(w).forEach(function(R){var O=v===void 0?null:v[R],N=p(R,S.separator).join(S.separator);N.indexOf(S.separator)!==-1?(S._fill(N.split(S.separator),w,w[R],O),delete w[R]):w[R]=e(w[R],O)}),w},y.prototype.str=function(w,v,S,R){var O=p(w,this.separator).join(this.separator);return w.indexOf(this.separator)!==-1?this._fill(O.split(this.separator),S,v,R):S[w]=e(v,R),S},y.prototype.pick=function(w,v,S,R){var O,N,b,k,T;for(N=p(w,this.separator),O=0;O<N.length;O++)if(k=r(N[O],v),v&&typeof v=="object"&&k in v){if(O===N.length-1)return S?(b=v[k],R&&Array.isArray(v)?v.splice(k,1):delete v[k],Array.isArray(v)&&(T=N.slice(0,-1).join("."),this.cleanup.indexOf(T)===-1&&this.cleanup.push(T)),b):v[k];v=v[k]}else return;return S&&Array.isArray(v)&&(v=v.filter(function(L){return L!==void 0})),v},y.prototype.delete=function(w,v){return this.remove(w,v,!0)},y.prototype.remove=function(w,v,S){var R;if(this.cleanup=[],Array.isArray(w)){for(R=0;R<w.length;R++)this.pick(w[R],v,!0,S);return S||this._cleanup(v),v}else return this.pick(w,v,!0,S)},y.prototype._cleanup=function(w){var v,S,R,O;if(this.cleanup.length){for(S=0;S<this.cleanup.length;S++)R=this.cleanup[S].split("."),O=R.splice(0,-1).join("."),v=O?this.pick(O,w):w,v=v[R[0]].filter(function(N){return N!==void 0}),this.set(this.cleanup[S],v,w);this.cleanup=[]}},y.prototype.del=y.prototype.remove,y.prototype.move=function(w,v,S,R,O){return typeof R=="function"||Array.isArray(R)?this.set(v,e(this.pick(w,S,!0),R),S,O):(O=R,this.set(v,this.pick(w,S,!0),S,O)),S},y.prototype.transfer=function(w,v,S,R,O,N){return typeof O=="function"||Array.isArray(O)?this.set(v,e(this.pick(w,S,!0),O),R,N):(N=O,this.set(v,this.pick(w,S,!0),R,N)),R},y.prototype.copy=function(w,v,S,R,O,N){return typeof O=="function"||Array.isArray(O)?this.set(v,e(JSON.parse(JSON.stringify(this.pick(w,S,!1))),O),R,N):(N=O,this.set(v,this.pick(w,S,!1),R,N)),R},y.prototype.set=function(w,v,S,R){var O,N,b,k;if(typeof v>"u")return S;for(b=p(w,this.separator),O=0;O<b.length;O++){if(k=b[O],O===b.length-1)if(R&&s(v)&&s(S[k]))for(N in v)_.call(v,N)&&(S[k][N]=v[N]);else if(R&&Array.isArray(S[k])&&Array.isArray(v))for(var T=0;T<v.length;T++)S[b[O]].push(v[T]);else S[k]=v;else(!_.call(S,k)||!s(S[k])&&!Array.isArray(S[k]))&&(/^\d+$/.test(b[O+1])?S[k]=[]:S[k]={});S=S[k]}return S},y.prototype.transform=function(w,v,S){return v=v||{},S=S||{},Object.keys(w).forEach((function(R){this.set(w[R],this.pick(R,v),S)}).bind(this)),S},y.prototype.dot=function(w,v,S){v=v||{},S=S||[];var R=Array.isArray(w);return Object.keys(w).forEach((function(O){var N=R&&this.useBrackets?"["+O+"]":O;if(l(w[O])&&(s(w[O])&&!u(w[O])||Array.isArray(w[O])&&!this.keepArray&&w[O].length!==0))if(R&&this.useBrackets){var b=S[S.length-1]||"";return this.dot(w[O],v,S.slice(0,-1).concat(b+N))}else return this.dot(w[O],v,S.concat(N));else R&&this.useBrackets?v[S.join(this.separator).concat("["+O+"]")]=w[O]:v[S.concat(N).join(this.separator)]=w[O]}).bind(this)),v},y.pick=m("pick"),y.move=m("move"),y.transfer=m("transfer"),y.transform=m("transform"),y.copy=m("copy"),y.object=m("object"),y.str=m("str"),y.set=m("set"),y.delete=m("delete"),y.del=y.remove=m("remove"),y.dot=m("dot"),["override","overwrite"].forEach(function(w){Object.defineProperty(y,w,{get:function(){return x.override},set:function(v){x.override=!!v}})}),["useArray","keepArray","useBrackets"].forEach(function(w){Object.defineProperty(y,w,{get:function(){return x[w]},set:function(v){x[w]=v}})}),y._process=e,uc=y,uc}var FR=MR();const Gy={"page.title":"Bubble Chat Chatbot","message-input-label":"Benutzereingabe","message-input-placeholder":"Nachricht","message-input.actions.submit.label":"Nachricht senden","message-input.actions.export-transcript.label":"Konversation exportieren","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.copy":"Kopieren","agent-bubble.label":"Nachricht des Live-Agenten","export-transcript.email.title":"Konversation per E-Mail versenden","export-transcript.email.description":"Geben Sie Ihre E-Mail-Adresse ein, um den Chatverlauf zu erhalten.","export-transcript.email.cancel":"Abbrechen","export-transcript.email.send":"Senden","export-transcript.email.placeholder":"Ihre E-Mail-Adresse","export-transcript.email.invalid":"Bitte gültige E-Mail-Adresse eingeben.","export-transcript.email.success":"Ich habe den Chatverlauf an Ihre E-Mail-Adresse gesendet.","export-transcript.pdf.title":"Konversation als PDF erhalten","export-transcript.pdf.description":"Laden Sie die Konversation als PDF herunter.","export-transcript.pdf.cancel":"Abbrechen","export-transcript.pdf.download":"Herunterladen","general-conditions.header":"**Nutzungsbedingungen**","general-conditions.body":`Bitte berücksichtigen Sie die folgenden Punkte:
97
+ `).map((h,p)=>E.jsxs("span",{className:p0.text,children:[E.jsx(sT,{componentDecorator:l,children:h}),E.jsx("br",{})]},p))]})},uT=({subtitle:e,onLinkClick:r})=>e?E.jsx("div",{className:wt.subtitle,children:E.jsx(Py,{text:e,onLinkClick:r})}):null,m0="newtab#",My=({markdown:e,markdownOptions:r={},onLinkClick:i})=>{const s=u=>f=>(f.preventDefault(),u&&i(u),!1),l=({title:u,href:f,children:h})=>f.indexOf(m0)===0?E.jsx("a",{href:f.slice(m0.length),title:u,target:"_blank",rel:"noopener noreferrer",children:h}):E.jsx("a",{onClick:s(f),title:u,href:f,children:h});return E.jsx(un,{options:{...r,overrides:{a:l}},children:e})},cT=({text:e,onLinkClick:r})=>e?E.jsx("div",{children:E.jsx(My,{markdown:e,onLinkClick:r})}):null,fT=({title:e})=>e?E.jsx("h1",{className:wt.title,children:e}):null,dT=({title:e,text:r,subtitle:i,buttons:s,onButtonClick:l,onLinkClick:u})=>(e==null?void 0:e.length)||(r==null?void 0:r.length)||(i==null?void 0:i.length)||(s==null?void 0:s.length)?E.jsxs("div",{className:V(de.bubbleContent),children:[E.jsx(fT,{title:e}),E.jsx(cT,{text:r,onLinkClick:u}),E.jsx(uT,{subtitle:i,onLinkClick:u}),E.jsx(Vx,{buttons:s,onButtonClick:l})]}):null,hT=({alt:e,imageUrl:r,itemUrl:i,hasBody:s})=>r?i?i.indexOf("youtube.com")>-1?E.jsx("div",{className:wt.video_container,children:E.jsx("iframe",{className:V(wt.video,{[wt.only]:!s}),title:"Youtube",width:"100%",src:i+"?rel=0",frameBorder:"0",allowFullScreen:!0})}):E.jsx("a",{href:i,target:"_blank",rel:"noopener noreferrer",children:E.jsx("div",{className:wt.imageContainer,children:E.jsx("img",{className:V(wt.image,{[wt.only]:!s}),src:r,alt:e})})}):E.jsx("div",{className:wt.imageContainer,children:E.jsx("img",{className:V(wt.image,{[wt.only]:!s}),src:r,alt:e})}):null,pT=({title:e,text:r,subtitle:i,imageUrl:s,itemUrl:l,buttons:u,onButtonClick:f,onLinkClick:h})=>{const p=!!(e!=null&&e.length)||!!(r!=null&&r.length)||!!(i!=null&&i.length)||!!(u!=null&&u.length);return E.jsxs("div",{className:V(wt.detailMessage),children:[E.jsx(hT,{hasBody:p,imageUrl:s,itemUrl:l,alt:e||i}),p&&E.jsx(dT,{title:e,text:r,subtitle:i,buttons:u,onLinkClick:h,onButtonClick:f})]})},mT=B.forwardRef(({isFirstMessageBySender:e,isLastMessageBySender:r,children:i},s)=>{const l=Je();return E.jsx("li",{ref:s,className:V(de.message,de.messageGuest,e&&de.messageGuestFirst,r&&de.messageGuestLast,"chat__bubbleContainer","chat__guestBubbleContainer",e&&"chat__bubbleContainer--first",r&&"chat__bubbleContainer--last"),children:E.jsx("div",{className:V(de.bubble,de.bubbleRight,"chat__bubble","chat__guestBubble"),tabIndex:0,"aria-label":l("guest-bubble.label"),children:E.jsx("div",{className:V(de.rightText),children:i})})})}),gT="_markdown_nw7vg_1",Fy={markdown:gT},yT=({markdown:e,className:r,onLinkClick:i})=>{const s=ei(),l=vT(),u=h=>p=>{const _=p.key;(_==="ArrowDown"||_==="ArrowRight"||_==="Enter"||_===" "||_==="Space")&&(p.stopPropagation(),s($m(h)))},f=h=>()=>{s($m(h))};return E.jsx("div",{className:V(de.bubbleContent,Fy.markdown,r),children:E.jsx(My,{markdown:e,onLinkClick:i,markdownOptions:{renderRule(h,p,_,y){return p.type===se.footnoteReference?E.jsx("span",{className:de.sourceInfoReference,children:E.jsx("a",{type:"button",tabIndex:0,onClick:f(p.text),onKeyDown:u(p.text),children:l(p.text)})},y.key):h()}}})})},vT=()=>{const e=[];return i=>{const s=e.indexOf(i);return s>-1?s+1:(e.push(i),e.length)}},_T=({text:e,commands:r,onLinkClick:i})=>E.jsx("div",{className:de.bubbleContent,children:E.jsx(Py,{text:e,commands:r,onLinkClick:i})}),ET=B.forwardRef(({message:e,commands:r,isLastMessage:i,isFirstMessageBySender:s,isLastMessageBySender:l,onReaction:u,onButtonClick:f,onLinkClick:h},p)=>{const _=wT(e,r,f,h);switch(e.sender.type){case ge.UserType.GUEST:return E.jsx(mT,{ref:p,isFirstMessageBySender:s,isLastMessageBySender:l,children:_});default:{const y=x=>u(e._id,x);return E.jsx(Dy,{ref:p,message:e,isAnimated:!1,isLastMessage:i,isFirstMessageBySender:s,isLastMessageBySender:l,onReaction:y,children:_})}}}),wT=(e,r,i,s)=>{switch(e.type){case ge.MessageTypeEnum.TEXT:{const l=e;return E.jsx(_T,{text:l.text,commands:r,onLinkClick:s})}case ge.MessageTypeEnum.DETAIL:{const l=e;return E.jsx(pT,{title:l.title,text:l.text,subtitle:l.subtitle,imageUrl:l.imageUrl,itemUrl:l.itemUrl,buttons:l.buttons,onButtonClick:i,onLinkClick:s})}case ge.MessageTypeEnum.MARKDOWN:{const l=e;return E.jsx(yT,{markdown:l.markdown,className:l.className,onLinkClick:s})}}},ST=(e,r)=>e.message._id===r.message._id&&e.message.reaction===r.message.reaction&&e.isLastMessage===r.isLastMessage&&e.isFirstMessageBySender===r.isFirstMessageBySender&&e.isLastMessageBySender===r.isLastMessageBySender,bT=eg.memo(ET,ST),xT="_ticontainer_xg0dn_1",TT="_tiblock_xg0dn_5",CT="_tidot_xg0dn_12",kT="_mercuryTypingAnimation_xg0dn_1",Zi={ticontainer:xT,tiblock:TT,tidot:CT,mercuryTypingAnimation:kT},RT=({isTyping:e=!1})=>E.jsx("div",{className:Zi.ticontainer,children:E.jsx("div",{className:Zi.tiblock,children:e?E.jsxs(E.Fragment,{children:[E.jsx("div",{className:V(Zi.tidot,"chat__typingIndicator")}),E.jsx("div",{className:V(Zi.tidot,"chat__typingIndicator")}),E.jsx("div",{className:V(Zi.tidot,"chat__typingIndicator")})]}):null})}),OT=Object.assign({_id:"typing-indicator"},new ge.TextMessage("",new ge.BotUser)),NT=({messages:e,isBotTyping:r,showGeneralConditions:i,commands:s,onTranscriptItemReaction:l,onButtonClick:u,onLinkClick:f})=>{const h=B.useRef(0),p=B.useRef(!0),_=B.useRef(null),y=B.useRef(null),x=B.useRef(null);B.useLayoutEffect(()=>{if(e.length&&_.current&&(h.current<e.length||r)){if(y.current){const v=y.current.offsetTop;_.current.scrollTop=v}else if(x.current){const v=x.current.offsetTop;_.current.scrollTop=v}p.current&&(p.current=!1),h.current=e.length}},[e,p,r]);let m;const w=e.length;return E.jsxs("div",{ref:_,className:V(qm.messageContainer,"chat__messageContainer"),style:{scrollBehavior:e.length&&p.current?"auto":"smooth"},id:"MessageContainer",role:"log","aria-live":"polite",children:[i&&E.jsx(lx,{}),E.jsxs("ul",{className:qm.messages,children:[e.map((v,S)=>{const R=AT(v,m),O=IT(v,S,e,r);m=v.sender.type;const N=S+1===w;return E.jsx(bT,{ref:N?x:null,message:v,commands:s,isLastMessage:N,isFirstMessageBySender:R,isLastMessageBySender:O,onButtonClick:u,onLinkClick:f,onReaction:l},N&&!r?"last":v._id)}),r&&E.jsx(Dy,{ref:y,message:OT,isLastMessage:!1,isAnimated:!0,isFirstMessageBySender:m!==ge.UserType.BOT,isLastMessageBySender:!0,children:E.jsx(RT,{isTyping:!0})},"last")]})]})},AT=(e,r)=>!r||r!==e.sender.type,IT=(e,r,i,s)=>{var h;const l=e.sender.type,u=i.length;return r+1===u?!(l===ge.UserType.BOT&&s):l!==((h=i.at(r+1))==null?void 0:h.sender.type)},DT="_bottomSheet_jp8dl_1",PT="_bottomSheetOpen_jp8dl_15",MT="_bottomSheetClose_jp8dl_20",Cn={bottomSheet:DT,bottomSheetOpen:PT,"slide-in":"_slide-in_jp8dl_1",bottomSheetClose:MT,"slide-out":"_slide-out_jp8dl_1"},FT="_container_xc2nx_1",g0={container:FT},LT=({contentUrl:e})=>{const r=Xn(u=>u.connection.sessionId),[i,s]=B.useState(!1);B.useEffect(()=>{s(u=>u||!!e)},[e]);const l=B.useMemo(()=>{if(e&&r){const u=new URL(e,document.baseURI);return u.searchParams.set("sessionId",r),u.toString()}else return},[e,r]);return E.jsx("div",{className:V(g0.container,Cn.bottomSheet,{[Cn.bottomSheetOpen]:!!e,[Cn.bottomSheetClose]:i&&!e}),children:l&&E.jsx("iframe",{title:"Drawer",src:l,className:g0.iframe})})},BT="_container_tr4tn_1",jT={container:BT},UT=({title:e,href:r,children:i})=>E.jsx("a",{href:r,title:e,target:"_blank",rel:"noopener noreferrer",children:i}),HT=()=>{const r=Je()("powered-by");return r&&r.length?E.jsx("div",{className:V(jT.container,"chat__poweredBy"),children:E.jsx(un,{options:{overrides:{a:UT}},children:r})}):null},y0=({className:e,children:r,...i})=>E.jsx(pa,{className:V(ro.buttonDefault,e),type:"button",...i,children:r}),io=({className:e,children:r,...i})=>E.jsx(pa,{className:V(ro.buttonPrimary,e),...i,children:r}),zT="_container_h23mk_1",GT="_formContainer_h23mk_17",$T="_emailInput_h23mk_22",VT="_description_h23mk_52",qT="_actions_h23mk_57",WT="_validationError_h23mk_67",ZT="_submitted_h23mk_74",bn={container:zT,formContainer:GT,emailInput:$T,description:VT,actions:qT,validationError:WT,submitted:ZT},QT=({visible:e,methods:r,onEmailExport:i,onPdfExport:s,onClose:l})=>{const u=Je(),[f,h]=B.useState(void 0),[p,_]=B.useState(!1),[y,x]=B.useState(!1),[m,w]=B.useState(void 0),v=B.useRef(null);B.useEffect(()=>{var N;e?((N=v.current)==null||N.focus(),_(!1),x(!1),h(e)):f===!0&&h(!1)},[e,f]);const S=N=>{N.preventDefault(),m&&m.length>0&&(i(m),_(!0),setTimeout(l,3*1e3))},R=N=>{const b=N.target.value.trim(),k=/^\w+([.-]?\w+)*@\w+([.-]?\w+)*(\.\w{2,3})+$/.test(b);w(k?b:"")},O=()=>{x(!0),s(),setTimeout(l,3*1e3)};return E.jsxs("div",{className:V(bn.container,Cn.bottomSheet,{[Cn.bottomSheetOpen]:f===!0,[Cn.bottomSheetClose]:f===!1}),children:[r.pdf&&E.jsxs(E.Fragment,{children:[E.jsx("h2",{children:u("export-transcript.pdf.title")}),E.jsx(un,{className:bn.description,children:u("export-transcript.pdf.description")||""}),E.jsxs("div",{className:bn.actions,children:[E.jsx(y0,{onClick:l,children:u("export-transcript.pdf.cancel")}),E.jsx(io,{onClick:O,disabled:y,children:u("export-transcript.pdf.download")})]})]}),r.email&&E.jsxs(E.Fragment,{children:[E.jsx("h2",{children:u("export-transcript.email.title")}),E.jsx(un,{className:bn.description,children:u("export-transcript.email.description")||""}),E.jsxs("form",{onSubmit:S,className:bn.formContainer,children:[E.jsxs("div",{children:[E.jsx("input",{disabled:p,ref:v,type:"email",placeholder:u("export-transcript.email.placeholder"),className:bn.emailInput,onChange:R}),(m==null?void 0:m.length)===0?E.jsx("div",{className:bn.validationError,children:u("export-transcript.email.invalid")}):null]}),E.jsxs("div",{className:bn.actions,children:[E.jsx(y0,{onClick:l,children:u("export-transcript.email.cancel")}),E.jsx(io,{type:"submit",disabled:p||m===void 0||m.length===0,children:u("export-transcript.email.send")})]})]}),p&&E.jsx("div",{className:bn.submitted,children:u("export-transcript.email.success")})]})]})},KT="_inputContainer_fi5ao_1",XT={inputContainer:KT},YT="_blockUserInput_mjy87_1",JT={blockUserInput:YT,"append-animate":"_append-animate_mjy87_1"},eC=({visible:e})=>{const r=Je();return e?E.jsx("div",{className:V(JT.blockUserInput,"chat__blockUserInput"),children:r("block-user-input.title")}):null},tC="_commandsDropdown_5ytuv_1",nC="_commands_5ytuv_1",rC="_command_5ytuv_1",iC="_commandActive_5ytuv_46",oC="_commandsSelections_5ytuv_55",Xi={commandsDropdown:tC,commands:nC,command:rC,commandActive:iC,commandsSelections:oC},sC=(e,r)=>{B.useEffect(()=>{const i=s=>{e.current&&!e.current.contains(s.target)&&r()};return document.addEventListener("mousedown",i),()=>document.removeEventListener("mousedown",i)},[e,r])},aC=(e,r,i,s,l)=>{B.useEffect(()=>{const u=f=>{if(e.length)switch(f.key){case"Enter":i(e[r]);break;case"ArrowUp":s(h=>h>0?h-1:e.length-1);break;case"ArrowDown":s(h=>h<e.length-1?h+1:0);break;case"Escape":l([]);break}};return document.addEventListener("keydown",u),()=>{document.removeEventListener("keydown",u)}},[e,r,i,s,l])},lC=({text:e,commands:r,onSelectCommand:i,onVisibilityChange:s})=>{const l=B.useRef(null),u=Je(),[f,h]=B.useState([]),[p,_]=B.useState(v0(r)),[y,x]=B.useState(0),m=w=>i(`/${w}`);return sC(l,()=>h([])),aC(f,y,m,x,h),B.useEffect(()=>{_(v0(r))},[r]),B.useEffect(()=>{const w=e.length||0;w===0||w>p||!e.startsWith("/")?h([]):h(r.filter(uC(e))),x(0)},[r,e,p]),B.useEffect(()=>{s(!!f.length)},[f,s]),f.length?E.jsx("div",{ref:l,className:Xi.commandsDropdown,children:E.jsx("ul",{className:Xi.commands,role:"listbox",children:f.map((w,v)=>E.jsxs("li",{className:V([Xi.command,y===v&&Xi.commandActive]),role:"option",onClick:()=>m(w),onMouseOver:()=>x(v),children:[E.jsxs("h1",{children:["/",w]}),E.jsx("p",{children:u(`commands.${w}`)})]},w))})}):null},v0=e=>Math.max(...e.map(r=>r.length+1)),uC=e=>r=>{const i=`/${r}`;return i.startsWith(e)&&i.length>=e.length},_0=3,cC=({commands:e,onSelectCommand:r})=>{const i=Je(),[s,l]=B.useState(!1),u=_=>()=>{r(`/${_}`),l(!1)},f=()=>{l(!0)},h=()=>{l(!1)},p=s?e:e.slice(0,_0);return E.jsxs("div",{className:Xi.commandsSelections,children:[p.map(_=>E.jsxs("button",{onClick:u(_),children:["/",_]})),p.length<e.length?E.jsx("button",{"aria-label":i("commands.show-more.tooltip"),"data-title":i("commands.show-more.tooltip"),tabIndex:0,onClick:f,children:i("commands.show-more.action")},"show-more"):p.length>_0?E.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]})},fC="_callToActionContainer_bkfcm_1",dC="_callToActionTitle_bkfcm_23",hC="_rateOverlay_bkfcm_30",pC="_body_bkfcm_52",mC="_footer_bkfcm_60",gC="_actions_bkfcm_73",yC="_bubbles_bkfcm_101",vC="_rateFeedbackBotBubble_bkfcm_130",_C="_rateFeedbackGuestBubble_bkfcm_136",EC="_avatar_bkfcm_142",wC="_fadeInLeft_bkfcm_1",SC="_bubble_bkfcm_101",bC="_appear_bkfcm_1",xC="_botBubble_bkfcm_168",TC="_guestBubble_bkfcm_179",CC="_rateText_bkfcm_198",kC="_stars_bkfcm_203",RC="_starsSmall_bkfcm_215",OC="_starsLarge_bkfcm_219",NC="_star_bkfcm_203",AC="_starReadonly_bkfcm_236",IC="_starIcon_bkfcm_246",DC="_starsDescriptionContainer_bkfcm_264",PC="_starsDescription_bkfcm_264",pt={callToActionContainer:fC,"append-animate":"_append-animate_bkfcm_1",callToActionTitle:dC,rateOverlay:hC,body:pC,footer:mC,actions:gC,bubbles:yC,rateFeedbackBotBubble:vC,rateFeedbackGuestBubble:_C,avatar:EC,fadeInLeft:wC,bubble:SC,appear:bC,botBubble:xC,guestBubble:TC,rateText:CC,stars:kC,starsSmall:RC,starsLarge:OC,star:NC,starReadonly:AC,starIcon:IC,starsDescriptionContainer:DC,starsDescription:PC},MC=({value:e,index:r,count:i,readonly:s,onHover:l,onClick:u})=>{const f=h=>{u&&h.key==="Enter"&&u()};return E.jsx("li",{className:V(pt.star,{[pt.starReadonly]:s},"chat__conversationRating__star"),children:E.jsx("div",{role:"radio","aria-checked":e>r?"true":"false","aria-posinset":r+1,"aria-setsize":i,tabIndex:0,onMouseOver:l,onKeyDown:f,onClick:u,children:E.jsx("span",{role:"img","aria-label":"Star",className:V(pt.starIcon),children:E.jsx("svg",{viewBox:"64 64 896 896",focusable:"false","data-icon":"star",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",children:E.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"})})})})})},E0=5,Ly=({value:e,size:r,readonly:i=!1,onChange:s})=>{const[l,u]=B.useState(void 0),f=()=>{u(void 0)},h=_=>()=>{if(!i){const y=_+1;u(y)}},p=_=>()=>{s&&!i&&(s(_===0&&e===1?0:_+1),u(void 0))};return E.jsx("ul",{tabIndex:0,role:"radiogroup",className:V(pt.stars,{[pt.starsSmall]:r==="small",[pt.starsLarge]:r==="large"},"chat__conversationRating__stars",{chat__conversationRating__stars__small:r==="small",chat__conversationRating__stars__large:r==="large"}),onMouseOut:f,children:Array(E0).fill(0).map((_,y)=>E.jsx(MC,{value:l===void 0?e:l,index:y,count:E0,readonly:i,onHover:h(y),onClick:p(y)},y))})},FC=({visible:e,onRate:r})=>{const i=Je();return e?E.jsxs("div",{className:V(pt.callToActionContainer,"chat__conversationRating__callToAction"),children:[E.jsx("div",{className:V(pt.callToActionTitle,"chat__conversationRating__callToAction__title"),children:i("conversation-rating.call-to-action.title")}),E.jsx(Ly,{value:0,size:"small",onChange:r})]}):null},Wu=({isFirstMessageBySender:e,isLastMessageBySender:r,children:i})=>E.jsxs("div",{className:V(de.message,de.messageBot,e&&de.messageBotFirst,r&&de.messageBotLast,"chat__bubbleContainer","chat__botBubbleContainer",e&&"chat__bubbleContainer--first",r&&"chat__bubbleContainer--last"),children:[E.jsx("img",{className:V(de.avatar,de.botAvatar),src:"bot.svg",alt:"Bot"}),E.jsx("div",{className:V(de.bubble,de.bubbleLeft,"chat__bubble","chat__botBubble"),children:E.jsx("div",{className:V(de.leftText,de.bubbleContent),children:i})})]}),LC=({children:e})=>E.jsx("div",{className:V(de.message,de.messageGuest,de.messageGuestFirst,de.messageGuestLast,"chat__bubbleContainer","chat__guestBubbleContainer","chat__bubbleContainer--first","chat__bubbleContainer--last"),children:E.jsx("div",{className:V(de.bubble,de.bubbleRight,"chat__bubble","chat__guestBubble"),children:E.jsx("div",{className:V(de.rightText,de.bubbleContent),children:e})})}),BC=({visible:e,rating:r,onRate:i,onClose:s})=>{const l=Je(),[u,f]=B.useState(r),[h,p]=B.useState(void 0),[_,y]=B.useState(void 0),[x,m]=B.useState({submitted:!1,feedback:""}),[w,v]=B.useState(!1),S=B.useRef(null);B.useEffect(()=>{e?(m({submitted:!1,feedback:""}),y(e)):_===!0&&y(!1)},[e,_]),B.useEffect(()=>{f(r)},[r]),B.useEffect(()=>{const O=l(`conversation-rating.overlay.bot-message.rate-feedback.value-${u}`);p(O!=null&&O.length?O:void 0)},[u,l]),B.useEffect(()=>{x.submitted?setTimeout(()=>v(!0),x.feedback.length?500:0):v(!1)},[x]);const R=O=>{var b,k;O.preventDefault();const N=((k=(b=S.current)==null?void 0:b.value)==null?void 0:k.trim())||"";i(u,N),m({submitted:!0,feedback:N})};return E.jsx("div",{className:V(pt.rateOverlay,Cn.bottomSheet,"chat__conversationRating__overlay",{[Cn.bottomSheetOpen]:_===!0,[Cn.bottomSheetClose]:_===!1}),children:E.jsxs("form",{onSubmit:R,children:[E.jsxs("div",{className:V(pt.body,"chat__conversationRating__overlay__body"),children:[E.jsx("div",{}),E.jsx("div",{className:V(pt.bubbles),children:e&&h&&E.jsxs(E.Fragment,{children:[E.jsxs(Wu,{isFirstMessageBySender:!0,isLastMessageBySender:!1,children:[E.jsx("h2",{children:l("conversation-rating.overlay.title")}),E.jsxs("div",{className:V(pt.starsDescriptionContainer),children:[E.jsx(Ly,{value:u,size:"large",readonly:x.submitted,onChange:f}),E.jsxs("div",{className:V(pt.starsDescription),children:[E.jsx("div",{children:l("conversation-rating.overlay.star.very-bad")}),E.jsx("div",{children:l("conversation-rating.overlay.star.very-good")})]})]})]}),E.jsx(Wu,{isFirstMessageBySender:!1,isLastMessageBySender:!w||!!x.feedback.length,children:E.jsx("div",{children:h})}),!!x.feedback.length&&E.jsx(LC,{children:x.feedback}),w&&E.jsx(Wu,{isFirstMessageBySender:!!x.feedback.length,isLastMessageBySender:!0,children:E.jsx("div",{children:l("conversation-rating.overlay.bot-message.submit-feedback")})})]})})]}),E.jsxs("div",{className:V(pt.footer,"chat__conversationRating__overlay__footer"),children:[!x.submitted&&E.jsx("input",{ref:S,placeholder:l("conversation-rating.overlay.guest-feedback.input-placeholder")}),E.jsx("div",{className:V(pt.actions,"chat__conversationRating__overlay__footer__actions"),children:x.submitted?E.jsx(io,{type:"button",onClick:s,children:l("conversation-rating.overlay.action.close")}):E.jsx(io,{type:"submit",children:l("conversation-rating.overlay.action.submit")})})]})]})})},jC=({conversationRating:{enabled:e,rating:r},numberOfMessagesFromGuest:i,showRatingOverlay:s,setShowRatingOverlay:l,onRate:u})=>{const[f,h]=B.useState(0),p=x=>{h(x),l(!0)},_=()=>l(!1),y=!r&&i>=1;return e?E.jsxs(E.Fragment,{children:[E.jsx(FC,{visible:y,onRate:p}),E.jsx(BC,{visible:s,rating:f,onRate:u,onClose:_})]}):null},UC="_inputWrapper_e3h44_1",HC="_withOpenCommands_e3h44_14",zC="_messageInputWrapper_e3h44_20",GC="_messageInput_e3h44_20",$C="_buttons_e3h44_44",VC="_button_e3h44_44",mr={inputWrapper:UC,withOpenCommands:HC,messageInputWrapper:zC,messageInput:GC,buttons:$C,button:VC},qC="_audioRecorder_g845f_1",WC="_audioButton_g845f_6",ZC="_recorderIcon_g845f_37",QC="_pulse_g845f_1",KC="_spinning_g845f_60",XC="_spin_g845f_60",gr={audioRecorder:qC,audioButton:WC,recorderIcon:ZC,pulse:QC,spinning:KC,spin:XC},w0=2048,ta=16e3;class YC extends eg.Component{constructor(i){super(i);be(this,"audioInput",null);be(this,"volume",null);be(this,"leftchannel",[]);be(this,"recorder",null);be(this,"recordingLength",0);be(this,"sampleRate",null);be(this,"mediaStream",null);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(i){this.mediaStream=i,this.leftchannel.length=0,this.recordingLength=0,this.initRecording(i)}initRecording(i){const s=window.AudioContext||window.webkitAudioContext,l=new s;this.sampleRate=l.sampleRate,this.volume=l.createGain(),this.audioInput=l.createMediaStreamSource(i),this.audioInput.connect(this.volume),this.recorder=l.createScriptProcessor(w0,1,1),this.recorder.onaudioprocess=this.processRecordingInput,this.volume.connect(this.recorder),this.recorder.connect(l.destination)}processRecordingInput(i){if(this.state.recordingState==="connecting"&&this.setState({recordingState:"recording"}),this.state.recordingState!=="none"){const s=i.inputBuffer.getChannelData(0);this.leftchannel.push(new Float32Array(s)),this.recordingLength+=w0}}handleClickSubmitAudio(){const i=ek(this.leftchannel,this.recordingLength),s=tk(i,this.sampleRate||0),l=JC(s);this.props.onAudioRecorded(l),this.handleClickStopAudio()}handleClickStopAudio(){var i,s,l,u;this.setState({recordingState:"none"}),(i=this.audioInput)==null||i.disconnect(),(s=this.volume)==null||s.disconnect(),(l=this.recorder)==null||l.disconnect(),this.mediaStream&&((u=this.mediaStream)==null||u.getAudioTracks().forEach(f=>{f.stop()}))}render(){return E.jsxs("div",{className:gr.audioRecorder,children:[this.state.recordingState==="none"&&E.jsx("button",{className:V(gr.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:E.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",children:[E.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"}),E.jsx("path",{d:"M0 0h24v24H0z",fill:"none"})]})}),this.state.recordingState==="connecting"&&E.jsxs("svg",{className:gr.spinning,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",children:[E.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"}),E.jsx("path",{d:"M0 0h24v24H0z",fill:"none"})]}),this.state.recordingState==="recording"&&E.jsxs("div",{className:gr.audioRecorder,children:[E.jsx("button",{className:V(gr.audioButton),onClick:this.handleClickStopAudio,"aria-label":this.props.translate("message-input.actions.stop-audio-recording.label"),tabIndex:0,children:E.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",children:[E.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"}),E.jsx("path",{d:"M0 0h24v24H0z",fill:"none"})]})}),E.jsx("div",{className:gr.recorderIcon}),E.jsx("button",{className:V(gr.audioButton),type:"submit",onClick:this.handleClickSubmitAudio,"aria-label":this.props.translate("message-input.actions.submit-audio-recording.label"),tabIndex:0,autoFocus:!0,children:E.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",children:[E.jsx("path",{d:"M0 0h24v24H0z",fill:"none"}),E.jsx("path",{d:"M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"})]})})]})]})}}const JC=e=>{const r=new ArrayBuffer(44+e.length*2),i=new DataView(r);Hs(i,0,"RIFF"),i.setUint32(4,44+e.length*2,!0),Hs(i,8,"WAVE"),Hs(i,12,"fmt "),i.setUint32(16,16,!0),i.setUint16(20,1,!0),i.setUint16(22,1,!0),i.setUint32(24,ta,!0),i.setUint32(28,ta*4,!0),i.setUint16(32,4,!0),i.setUint16(34,16,!0),Hs(i,36,"data"),i.setUint32(40,e.length*2,!0);const s=e.length;let l=44;const u=1;for(let f=0;f<s;f++)i.setInt16(l,e[f]*(32767*u),!0),l+=2;return new Blob([i],{type:"audio/wav"})},Hs=(e,r,i)=>{for(let s=0;s<i.length;s++)e.setUint8(r+s,i.charCodeAt(s))},ek=(e,r)=>{const i=new Float32Array(r);let s=0;const l=e.length;for(let u=0;u<l;u++){const f=e[u];i.set(f,s),s+=f.length}return i},tk=(e,r)=>{if(ta===r)return e;const i=r/ta,s=Math.round(e.length/i),l=new Float32Array(s);let u=0,f=0;for(;u<l.length;){const h=Math.round((u+1)*i);let p=0,_=0;for(let y=f;y<h&&y<e.length;y++)p+=e[y],_++;l[u]=p/_,u++,f=h}return l},nk=({speechSupport:e,transcriptExportEnabled:r,disabled:i,textInput:s,commandsVisible:l,onTextInput:u,onTextInputSubmit:f,onAudioRecorded:h,onOpenTranscriptExportModal:p})=>{const _=Je(),y=B.useRef(null);B.useEffect(()=>{var S;(S=y.current)==null||S.focus()},[s]);const x=()=>{const S=y.current;S&&s.trim().length>=1&&f(s.trim())&&(S.value="",S.style.height="",S.focus())},m=S=>{S.preventDefault(),x()},w=S=>{const R=S.target.value;u(R),S.target.style.height="";const{scrollHeight:O}=S.target;S.target.style.height=`${O>150?150:O}px`},v=S=>{S.code==="Enter"&&!S.shiftKey?(S.repeat||x(),S.preventDefault()):l&&(S.code==="ArrowUp"||S.code==="ArrowDown")&&S.preventDefault()};return E.jsxs("form",{className:V(mr.inputWrapper,l&&mr.withOpenCommands,"chat__textInput"),onSubmit:m,children:[E.jsx("div",{className:mr.messageInputWrapper,children:E.jsx("textarea",{id:"user_input",ref:y,className:mr.messageInput,tabIndex:0,placeholder:_("message-input-placeholder"),value:s,onChange:w,onKeyDown:v,"aria-label":_("message-input-label"),"aria-controls":"command-list","aria-haspopup":"listbox"})}),E.jsxs("div",{className:V(mr.buttons,"chat__buttons"),children:[!s.length&&r&&E.jsx("button",{type:"button",className:V(mr.button,"chat__button"),"aria-label":_("message-input.actions.export-transcript.label"),"data-title":_("message-input.actions.export-transcript.label"),tabIndex:0,onClick:p,children:E.jsx("svg",{viewBox:"64 64 896 896",focusable:"false",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",children:E.jsx("path",{d:"M456 231a56 56 0 10112 0 56 56 0 10-112 0zm0 280a56 56 0 10112 0 56 56 0 10-112 0zm0 280a56 56 0 10112 0 56 56 0 10-112 0z"})})}),s.length||!e||navigator.mediaDevices===void 0?E.jsx("button",{className:V(mr.button,"chat__button"),type:"submit","aria-label":_("message-input.actions.submit.label"),"data-title":_("message-input.actions.submit.label"),tabIndex:0,disabled:i,children:E.jsx("svg",{viewBox:"64 64 896 896",focusable:"false",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",children:E.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"})})}):e&&navigator.mediaDevices!==void 0&&E.jsx(YC,{translate:_,onAudioRecorded:h})]})]})},rk="_quickReplies_83npe_1",ik="_quickReply_83npe_9",S0={quickReplies:rk,quickReply:ik},ok=({quickReplies:e,onQuickReplyClick:r})=>e.length?E.jsx("div",{className:V(S0.quickReplies,"chat__quickReplies"),children:e.map(i=>E.jsx(pa,{tabIndex:0,className:V(S0.quickReply,"chat__button","chat__quickReply"),onClick:()=>r(i),children:i.label},i.label))}):null,b0=5e3,sk=1e3,ak=({isBotTyping:e,quickReplies:r,speechSupport:i,transcriptExportEnabled:s,conversationRating:l,numberOfMessagesFromGuest:u,showRatingOverlay:f,commands:h,setShowRatingOverlay:p,onTextInput:_,onRate:y,onQuickReplyClick:x,onAudioRecorded:m,onOpenTranscriptExportModal:w})=>{const[v,S]=B.useState(""),[R,O]=B.useState(!1),[N,b]=B.useState(!1),k=B.useRef(),T=B.useRef(0);B.useEffect(()=>{if(R&&!e){const q=k.current?Date.now()-k.current:0;q>b0?O(!1):setTimeout(()=>{O(!1)},b0-q)}},[R,e]),B.useEffect(()=>{R&&(k.current=Date.now())},[R]);const L=q=>{const fe=Date.now()-T.current<sk;return N?!1:e||fe?(O(!0),!1):(_(q),S(""),T.current=Date.now(),!0)},z=q=>{S(q+" ")};return E.jsxs("div",{className:V(XT.inputContainer),children:[E.jsx(ok,{quickReplies:r,onQuickReplyClick:x}),E.jsx(eC,{visible:R}),!R&&E.jsx(jC,{conversationRating:l,numberOfMessagesFromGuest:u,onRate:y,showRatingOverlay:f,setShowRatingOverlay:p}),!!(h!=null&&h.length)&&E.jsx(lC,{text:v,commands:h,onSelectCommand:z,onVisibilityChange:b}),E.jsx(nk,{textInput:v,speechSupport:i,transcriptExportEnabled:s,disabled:R,commandsVisible:N,onTextInput:S,onTextInputSubmit:L,onOpenTranscriptExportModal:w,onAudioRecorded:m}),!!(h!=null&&h.length)&&E.jsx(cC,{commands:h,onSelectCommand:S})]})},lk=({clientName:e,messages:r,quickReplies:i,isBotTyping:s,drawerContentUrl:l,speechSupport:u,transcriptExportEnabled:f,conversationRating:h,showGeneralConditions:p,commands:_,onMessageFromUser:y,onRate:x,onQuickReplyClick:m,onButtonClick:w,onLinkClick:v,onAudioRecorded:S,onTranscriptExport:R,onPdfExport:O,onTranscriptItemReaction:N})=>{const b=ei(),k=Xn(oe=>oe.connection.connectionState),[T,L]=B.useState(!1),[z,q]=B.useState(!1),fe=f.email||f.pdf,te=r.filter(oe=>oe.sender.type===hy.GUEST).length;return B.useEffect(()=>{if(k===Er.CONNECTED){const oe=oa.parse(window.location.search);b(dy(e,oe))}},[e,k,b]),E.jsxs("div",{className:Fu.container,children:[E.jsxs("div",{className:V([Fu.chatcontent,(T||z)&&Fu.accessabilityHidden]),children:[E.jsx(NT,{messages:r,isBotTyping:s,showGeneralConditions:p,commands:_,onButtonClick:w,onLinkClick:v,onTranscriptItemReaction:N}),E.jsx(ak,{isBotTyping:s,quickReplies:s?[]:i,numberOfMessagesFromGuest:te,speechSupport:u,transcriptExportEnabled:fe,conversationRating:T?{enabled:!1}:h,showRatingOverlay:z,setShowRatingOverlay:q,commands:_,onRate:x,onQuickReplyClick:m,onTextInput:y,onAudioRecorded:S,onOpenTranscriptExportModal:()=>L(!T)}),E.jsx(HT,{})]}),fe&&E.jsx(QT,{methods:f,visible:T,onEmailExport:R,onPdfExport:O,onClose:()=>L(!1)}),E.jsx(LT,{contentUrl:l})]})},uk=e=>{const{messages:r,quickReplies:i,isBotTyping:s,drawerContentUrl:l,speechSupport:u,transcriptExportEnabled:f,conversationRating:h,showGeneralConditions:p,commands:_}=e.chat;return{messages:r,quickReplies:i,isBotTyping:s,drawerContentUrl:l,speechSupport:u,transcriptExportEnabled:f,conversationRating:h,showGeneralConditions:p,commands:_}},ck=e=>({onRestartChat:(r,i)=>e(da(r,i)),onMessageFromUser:r=>e(Gg(r)),onRate:(r,i)=>e(jS(r,i)),onAudioRecorded:r=>e(NS(r)),onActionFromUser:r=>e(r),onQuickReplyClick:r=>e(zg(r)),onNluEvent:r=>e(Qg(r)),onButtonClick:r=>e(HS(r)),onLinkClick:r=>e(zS(r)),onTranscriptExport:r=>e(PS(r)),onPdfExport:()=>e(LS()),onTranscriptItemReaction:(r,i)=>e(ge.transcriptItemGuestReaction(r,i||null))}),fk=uE(uk,ck)(lk),By=()=>dk(window.location.pathname),dk=e=>{const r=e.split("/"),i=e.endsWith("/");return r[r.length-(i?2:1)]},jy=()=>B.useMemo(()=>By(),[]),hk="_header_19p33_1",pk="_logoContainer_19p33_13",mk="_logo_19p33_13",gk="_actions_19p33_26",yk="_closeButton_19p33_72",Yi={header:hk,logoContainer:pk,logo:mk,actions:gk,closeButton:yk},Uy=e=>r=>{const i=r.key;(i==="ArrowDown"||i==="ArrowRight"||i==="Enter"||i===" "||i==="Space")&&(r.stopPropagation(),e())},vk=({onClick:e})=>{const r=Je();return E.jsx("button",{className:V(Yi.closeButton,"tooltip--bottom"),"aria-label":r("header.close-chat"),"data-title":r("header.close-chat"),tabIndex:0,onClick:e,onKeyDown:Uy(e),children:E.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 256 256",children:E.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"})})})},_k=({onClick:e})=>{const r=Je();return E.jsx("button",{className:"tooltip--bottom","aria-label":r("header.restart-chat"),"data-title":r("header.restart-chat"),tabIndex:0,onClick:e,onKeyDown:Uy(e),children:E.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 32 32",children:[E.jsx("path",{d:"M14.506,23.578l-5.511,0l-3.993,3.501l-0.007,0.006c-0.302,0.261 -0.687,0.405 -1.084,0.405c-0.245,-0.001 -0.488,-0.055 -0.711,-0.161c-0.595,-0.277 -0.978,-0.886 -0.974,-1.551l-0,-19.558c-0,-0.939 0.761,-1.711 1.685,-1.711l21.189,-0c0.924,-0 1.685,0.772 1.685,1.711l0,5.104l-1.444,0l-0,-5.104c-0,-0.134 -0.109,-0.244 -0.241,-0.244l-21.189,-0c-0.132,-0 -0.24,0.11 -0.24,0.244l-0,19.558c0.001,0.133 0.109,0.242 0.24,0.242c0.056,-0 0.109,-0.019 0.152,-0.055l4.192,-3.675c0.131,-0.115 0.299,-0.179 0.472,-0.179l5.779,0l-0,1.467Z"}),E.jsx("path",{d:"M29.869,20.148c0,4.137 -3.373,7.556 -7.509,7.612l-0.102,-0c-1.943,0.004 -3.814,-0.741 -5.223,-2.078c-0.183,-0.172 -0.286,-0.412 -0.286,-0.664c-0,-0.501 0.412,-0.913 0.913,-0.913c0.233,-0 0.458,0.089 0.627,0.249c1.074,1.014 2.495,1.579 3.971,1.579c3.174,-0 5.785,-2.612 5.785,-5.785c-0,-3.173 -2.611,-5.784 -5.785,-5.784c-1.533,-0 -3.006,0.61 -4.09,1.694c-0.01,0.01 -0.019,0.019 -0.03,0.028l-1.447,1.322l1.302,0c0.502,0 0.914,0.413 0.914,0.914c-0,0.501 -0.412,0.913 -0.914,0.913l-3.653,0c-0.501,0 -0.913,-0.412 -0.913,-0.913l-0,-3.654c-0,-0.501 0.412,-0.913 0.913,-0.913c0.501,0 0.913,0.412 0.913,0.913l0,1.577l1.635,-1.496c1.426,-1.418 3.357,-2.215 5.368,-2.215c4.175,0 7.611,3.436 7.611,7.611c-0,0.001 -0,0.002 -0,0.003Z"})]})})},x0=({className:e,withActions:r=!0,...i})=>{const s=ei(),l=jy(),u=()=>{const h=oa.parse(window.location.search);s(da(l,h))},f=()=>{s(Ab())};return E.jsxs("div",{className:V([Yi.header,e]),...i,children:[E.jsx("div",{className:Yi.logoContainer,children:E.jsx("div",{className:Yi.logo})}),E.jsxs("div",{className:Yi.actions,children:[r&&E.jsx(_k,{onClick:u}),E.jsx(vk,{onClick:f})]})]})},Ek="_chatwindow_6v6ob_1",wk="_chatwindowWithAside_6v6ob_46",T0={chatwindow:Ek,chatwindowWithAside:wk},Sk="_sourceInfos_1qwkt_1",bk="_sourceDetails_1qwkt_16",xk="_sourceHeader_1qwkt_23",Tk="_sourceHeaderIcon_1qwkt_43",Ck="_openSourceButton_1qwkt_47",kk="_closeSourceInfosButton_1qwkt_70",Rk="_sourceContent_1qwkt_85",Ok="_loadingSourceInfos_1qwkt_108",Nk="_loading_1qwkt_108",Ak="_rotate_1qwkt_1",Ik="_loadingError_1qwkt_122",dn={sourceInfos:Sk,sourceDetails:bk,sourceHeader:xk,sourceHeaderIcon:Tk,openSourceButton:Ck,closeSourceInfosButton:kk,sourceContent:Rk,loadingSourceInfos:Ok,loading:Nk,rotate:Ak,loadingError:Ik},Dk=({onClick:e})=>{const r=Je();return E.jsx("button",{className:V(dn.closeSourceInfosButton,"tooltip--bottom"),"aria-label":r("source-infos.close"),"data-title":r("source-infos.close"),tabIndex:0,onClick:e,children:E.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 256 256",children:E.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"})})})},Pk=({type:e})=>{switch(e){case"WEBSITE":return E.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 256 256",children:E.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"})});case"PDF":return E.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 256 256",children:E.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"})});case"DOCX":return E.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 256 256",children:E.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"})});case"TEXT":return E.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 256 256",children:E.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"})});default:return E.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 256 256",children:E.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"})})}},Mk=({sourceInfos:e,onClose:r})=>E.jsxs("div",{className:dn.sourceHeader,children:[E.jsx("div",{className:dn.sourceHeaderIcon,children:e&&E.jsx(Pk,{type:e.knowledgeBaseType})}),E.jsx("div",{children:e&&E.jsx("h1",{children:e.title})}),E.jsx(Dk,{onClick:r})]}),Fk=({title:e,href:r,children:i})=>E.jsx("a",{href:r,title:e,target:"_blank",rel:"noopener noreferrer",children:i}),Lk=({className:e,children:r,...i})=>E.jsx("a",{className:V(ro.button,ro.buttonPrimary,e),type:"button",...i,children:r}),Bk=({label:e,url:r})=>E.jsxs(Lk,{className:dn.openSourceButton,href:r,target:"_blank",children:[E.jsx("p",{children:e}),E.jsx("div",{children:E.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"#000000",viewBox:"0 0 256 256",children:E.jsx("path",{d:"M222,104a6,6,0,0,1-12,0V54.49l-69.75,69.75a6,6,0,0,1-8.48-8.48L201.51,46H152a6,6,0,0,1,0-12h64a6,6,0,0,1,6,6Zm-38,26a6,6,0,0,0-6,6v72a2,2,0,0,1-2,2H48a2,2,0,0,1-2-2V80a2,2,0,0,1,2-2h72a6,6,0,0,0,0-12H48A14,14,0,0,0,34,80V208a14,14,0,0,0,14,14H176a14,14,0,0,0,14-14V136A6,6,0,0,0,184,130Z"})})})]}),jk=({sourceInfos:e})=>E.jsxs(E.Fragment,{children:[E.jsx("div",{className:V(dn.sourceContent,Fy.markdown),children:E.jsx(un,{options:{overrides:{a:Fk}},children:e.content})}),E.jsx(Bk,{label:e.title,url:e.url})]}),Uk=""+new URL("undraw_fixing-bugs-D_eYxJc6.svg",import.meta.url).href,Hk=()=>{const e=Je();return E.jsxs("div",{className:dn.loadingError,children:[E.jsx("h1",{children:e("source-infos.error.title")}),E.jsx("img",{src:Uk,title:e("source-infos.error.title")}),E.jsx("p",{children:e("source-infos.error.info")})]})},zk=()=>E.jsx("div",{className:dn.loadingSourceInfos,children:E.jsx("svg",{className:dn.loading,xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 256 256",children:E.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"})})}),Gk=()=>{const e=ei(),r=Xn(s=>s.chat.sourceInfos),i=()=>{e(Db())};return r?E.jsxs("div",{className:dn.sourceInfos,children:[E.jsx("div",{className:dn.sourceDetails,children:E.jsx(Mk,{sourceInfos:r.type==="loaded"?r:void 0,onClose:i})}),r.type==="loading"?E.jsx(zk,{}):r.type==="loading-error"?E.jsx(Hk,{}):E.jsx(jk,{sourceInfos:r})]}):null},$k="_container_114wy_1",Vk="_body_114wy_7",qk="_intro_114wy_14",Wk="_footer_114wy_39",Zk="_footnote_114wy_43",Qk="_containerWithFootnote_114wy_58",Kk="_startChatButton_114wy_73",Xk="_formFields_114wy_77",Yk="_formField_114wy_77",Jk="_radio_114wy_89",eR="_checkbox_114wy_96",tR="_input_114wy_104",nR="_inputLabel_114wy_138",rR="_selectWrapper_114wy_142",iR="_select_114wy_142",oR="_selectLabel_114wy_188",ot={container:$k,body:Vk,intro:qk,footer:Wk,footnote:Zk,containerWithFootnote:Qk,startChatButton:Kk,formFields:Xk,formField:Yk,radio:Jk,checkbox:eR,input:tR,inputLabel:nR,selectWrapper:rR,select:iR,selectLabel:oR},sR=({name:e,label:r,defaultValue:i,required:s,onChange:l})=>{const u=f=>{l(f.currentTarget.checked?"true":"false")};return E.jsxs("label",{className:V(ot.checkbox,"chat__startScreen__checkbox"),htmlFor:e,children:[E.jsx("input",{type:"checkbox",id:e,name:e,defaultChecked:i==="true",required:s,onChange:u}),E.jsx("div",{children:r})]})},aR=({type:e,name:r,label:i,defaultValue:s,placeholder:l,required:u,multiple:f,min:h,max:p,pattern:_,onChange:y})=>{const x=m=>{y(m.target.value)};return E.jsxs("label",{className:V(ot.input,"chat__startScreen__input"),htmlFor:r,children:[E.jsx("div",{className:V(ot.inputLabel),children:i}),E.jsx("input",{type:e,id:r,name:r,defaultValue:s,placeholder:l,required:u,multiple:f,min:h,max:p,pattern:_,onChange:x})]})},lR=({name:e,value:r,label:i,defaultChecked:s,required:l,onChange:u})=>{const f=`${e}-${r}`,h=p=>{u(p.target.value)};return E.jsxs("label",{className:V(ot.radio,"chat__startScreen__radio"),htmlFor:f,children:[E.jsx("input",{id:f,type:"radio",name:e,value:r,defaultChecked:s,required:l,onChange:h}),E.jsx("span",{className:V(ot.label),children:i})]})},uR=({name:e,label:r,defaultValue:i,required:s,multiple:l,options:u,onChange:f})=>{const h=p=>{f(p.target.value)};return E.jsxs("label",{className:V(ot.select,"chat__startScreen__select"),htmlFor:e,children:[E.jsx("div",{className:V(ot.selectLabel),children:r}),E.jsx("div",{className:V(ot.selectWrapper),children:E.jsx("select",{id:e,name:e,defaultValue:i,required:s,multiple:l,onChange:h,children:Object.entries(u||{}).map(([p,_])=>E.jsx("option",{value:p,selected:_===i,children:_}))})})]})},cR="start-screen.intro",fR="start-screen.start-chat",dR="start-screen.footnote",Kt="start-screen.form",C0=`${Kt}.fields`,hR=()=>{const e=Je(),r=ei(),[i,s]=B.useState({}),l=()=>{const x=Object.entries(i).reduce((m,[w,v])=>({...m,[w]:v.value}),{});r(Rb(x))},u=e(cR),f=e(fR),h=e(dR),p=B.useMemo(()=>{var x;return((x=e(C0))==null?void 0:x.split(";").map(m=>m.trim()))??[]},[e(C0)]);B.useEffect(()=>{p.length&&Object.keys(i).length===0&&s(p.reduce((x,m)=>({...x,[m]:pR(m,e)}),{}))},[e,p,i]);const _=x=>{x.preventDefault(),l()},y=x=>m=>{s(w=>({...w,[x]:{...w[x],value:m}}))};return E.jsxs("form",{onSubmit:_,className:V(ot.container,h&&ot.containerWithFootnote,"chat__startScreen"),children:[E.jsxs("div",{className:V(ot.body,"chat__startScreen__body"),children:[u&&E.jsx("div",{className:V(ot.intro,"chat__startScreen__intro"),children:E.jsx(un,{options:{overrides:{a:k0}},children:u})}),E.jsx("div",{className:V(ot.formFields,"chat__startScreen__fields"),children:Object.values(i).map(({type:x,name:m,label:w,placeholder:v,defaultValue:S,options:R,required:O,multiple:N,min:b,max:k,pattern:T})=>E.jsx("div",{className:V(ot.formField,"chat__startScreen__field"),children:(()=>{switch(x){case"radio":return E.jsxs(E.Fragment,{children:[E.jsx("div",{children:w}),Object.entries(R||{}).map(([L,z])=>E.jsx(lR,{name:m,value:L,label:z,defaultChecked:L===S,required:O,onChange:y(m)}))]});case"checkbox":return E.jsx(sR,{name:m,label:w,defaultValue:S,required:O,onChange:y(m)});case"select":return E.jsx(uR,{name:m,label:w,defaultValue:S,required:O,multiple:N,options:R,onChange:y(m)});default:return E.jsx(aR,{type:x,name:m,label:w,placeholder:v,defaultValue:S,required:O,multiple:N,min:b,max:k,pattern:T,onChange:y(m)})}})()},m))})]}),E.jsxs("div",{className:V(ot.footer,"chat__startScreen__footer"),children:[E.jsx(io,{type:"submit",className:ot.startChatButton,children:f}),h&&E.jsx("div",{className:ot.footnote,children:E.jsx(un,{options:{overrides:{a:k0}},children:h})})]})]})},k0=({title:e,href:r,children:i})=>E.jsx("a",{href:r,title:e,target:"_blank",rel:"noopener noreferrer",children:i}),pR=(e,r)=>{const i=r(`${Kt}.${e}.type`)||"text",s=r(`${Kt}.${e}.required`)==="true",l=r(`${Kt}.${e}.multiple`)==="true",u=r(`${Kt}.${e}.placeholder`),f=r(`${Kt}.${e}.label`)||"",h=r(`${Kt}.${e}.defaultValue`),p=r(`${Kt}.${e}.min`),_=r(`${Kt}.${e}.max`),y=r(`${Kt}.${e}.pattern`),x=gR(r(`${Kt}.${e}.options`));return{name:e,label:f,placeholder:u,value:mR(i,h,x)||"",defaultValue:h,options:x,type:i,required:s,multiple:l,min:p,max:_,pattern:y}},mR=(e,r,i)=>r||e==="select"&&Object.keys(i)[0]||"",gR=(e="")=>e.split(";").map(r=>r.trim()).reduce((r,i)=>{const[s,l]=i.split(":").map(u=>u.trim());return{...r,[s]:l}},{}),yR=()=>{const e=ia();B.useEffect(()=>{window.document.documentElement.lang=e.locale},[e.locale])},Qr={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"},vR=({clientName:e})=>{yR();const r=ei(),i=Xn(y=>y.intl.messages),s=Je(),l=Xn(y=>y.startScreen.useStartScreen),u=Xn(y=>y.startScreen.startScreenStatus),[f,h]=B.useState(void 0);B.useEffect(()=>{const y=oa.parse(window.location.search);y.cssClassName&&h(y.cssClassName);const x=m=>{switch(m.data.type){case Qr.TRIGGER_ACTION:r(m.data.action);break;case Qr.TRIGGER_STORY:r(Qg(m.data.story));break;case Qr.ON_CHAT_WINDOW_OPEN:r({type:"webclient.chatwindow.opened"});break;case Qr.ON_CHAT_WINDOW_CLOSE:r({type:"webclient.chatwindow.closed"});break;case Qr.CHAT_MESSAGE_FROM_GUEST:r(Gg(m.data.text));break;case Qr.RESTART_CHAT:r(da(e,y));break}};return r(jb(e,y)),window.addEventListener("message",m=>x(m),!1),()=>window.removeEventListener("message",x)},[e,r]),B.useEffect(()=>{const y=s("page.title");y&&document&&(document.title=y)},[i,s]);const p=l===void 0,_=l===!1||u==="HIDDEN";return E.jsx("div",{className:V(T0.chatwindow,_&&T0.chatwindowWithAside,"chat__chatwindow",f),children:p?null:_?E.jsxs(E.Fragment,{children:[E.jsx("header",{children:E.jsx(x0,{})}),E.jsx("main",{children:E.jsx(fk,{clientName:e})}),E.jsx("aside",{children:E.jsx(Gk,{})})]}):E.jsxs(E.Fragment,{children:[E.jsx("header",{children:E.jsx(x0,{withActions:!1})}),E.jsx("main",{children:E.jsx(hR,{})})]})})},_R=1024,ER=()=>{const e=jy(),r=Xn(u=>u.intl.locale),i=Xn(u=>u.intl.messages),[s,l]=B.useState(R0());return B.useEffect(()=>{const u=()=>{l(R0())};return window.addEventListener("resize",u),()=>window.removeEventListener("resize",u)},[]),E.jsx(Ww,{locale:r,messages:i,children:E.jsx("div",{className:V([Qw.app,s?"chat__large":"chat__small"]),children:E.jsx(vR,{clientName:e})})})},R0=()=>window.innerWidth>=_R;var Zu,O0;function bf(){if(O0)return Zu;O0=1;function e(r){var i=typeof r;return r!=null&&(i=="object"||i=="function")}return Zu=e,Zu}var Qu,N0;function wR(){if(N0)return Qu;N0=1;var e=typeof ys=="object"&&ys&&ys.Object===Object&&ys;return Qu=e,Qu}var Ku,A0;function Hy(){if(A0)return Ku;A0=1;var e=wR(),r=typeof self=="object"&&self&&self.Object===Object&&self,i=e||r||Function("return this")();return Ku=i,Ku}var Xu,I0;function SR(){if(I0)return Xu;I0=1;var e=Hy(),r=function(){return e.Date.now()};return Xu=r,Xu}var Yu,D0;function bR(){if(D0)return Yu;D0=1;var e=/\s/;function r(i){for(var s=i.length;s--&&e.test(i.charAt(s)););return s}return Yu=r,Yu}var Ju,P0;function xR(){if(P0)return Ju;P0=1;var e=bR(),r=/^\s+/;function i(s){return s&&s.slice(0,e(s)+1).replace(r,"")}return Ju=i,Ju}var ec,M0;function zy(){if(M0)return ec;M0=1;var e=Hy(),r=e.Symbol;return ec=r,ec}var tc,F0;function TR(){if(F0)return tc;F0=1;var e=zy(),r=Object.prototype,i=r.hasOwnProperty,s=r.toString,l=e?e.toStringTag:void 0;function u(f){var h=i.call(f,l),p=f[l];try{f[l]=void 0;var _=!0}catch{}var y=s.call(f);return _&&(h?f[l]=p:delete f[l]),y}return tc=u,tc}var nc,L0;function CR(){if(L0)return nc;L0=1;var e=Object.prototype,r=e.toString;function i(s){return r.call(s)}return nc=i,nc}var rc,B0;function kR(){if(B0)return rc;B0=1;var e=zy(),r=TR(),i=CR(),s="[object Null]",l="[object Undefined]",u=e?e.toStringTag:void 0;function f(h){return h==null?h===void 0?l:s:u&&u in Object(h)?r(h):i(h)}return rc=f,rc}var ic,j0;function RR(){if(j0)return ic;j0=1;function e(r){return r!=null&&typeof r=="object"}return ic=e,ic}var oc,U0;function OR(){if(U0)return oc;U0=1;var e=kR(),r=RR(),i="[object Symbol]";function s(l){return typeof l=="symbol"||r(l)&&e(l)==i}return oc=s,oc}var sc,H0;function NR(){if(H0)return sc;H0=1;var e=xR(),r=bf(),i=OR(),s=NaN,l=/^[-+]0x[0-9a-f]+$/i,u=/^0b[01]+$/i,f=/^0o[0-7]+$/i,h=parseInt;function p(_){if(typeof _=="number")return _;if(i(_))return s;if(r(_)){var y=typeof _.valueOf=="function"?_.valueOf():_;_=r(y)?y+"":y}if(typeof _!="string")return _===0?_:+_;_=e(_);var x=u.test(_);return x||f.test(_)?h(_.slice(2),x?2:8):l.test(_)?s:+_}return sc=p,sc}var ac,z0;function AR(){if(z0)return ac;z0=1;var e=bf(),r=SR(),i=NR(),s="Expected a function",l=Math.max,u=Math.min;function f(h,p,_){var y,x,m,w,v,S,R=0,O=!1,N=!1,b=!0;if(typeof h!="function")throw new TypeError(s);p=i(p)||0,e(_)&&(O=!!_.leading,N="maxWait"in _,m=N?l(i(_.maxWait)||0,p):m,b="trailing"in _?!!_.trailing:b);function k(ue){var Ue=y,Ie=x;return y=x=void 0,R=ue,w=h.apply(Ie,Ue),w}function T(ue){return R=ue,v=setTimeout(q,p),O?k(ue):w}function L(ue){var Ue=ue-S,Ie=ue-R,$e=p-Ue;return N?u($e,m-Ie):$e}function z(ue){var Ue=ue-S,Ie=ue-R;return S===void 0||Ue>=p||Ue<0||N&&Ie>=m}function q(){var ue=r();if(z(ue))return fe(ue);v=setTimeout(q,L(ue))}function fe(ue){return v=void 0,b&&y?k(ue):(y=x=void 0,w)}function te(){v!==void 0&&clearTimeout(v),R=0,y=S=x=v=void 0}function oe(){return v===void 0?w:fe(r())}function pe(){var ue=r(),Ue=z(ue);if(y=arguments,x=this,S=ue,Ue){if(v===void 0)return T(S);if(N)return clearTimeout(v),v=setTimeout(q,p),k(S)}return v===void 0&&(v=setTimeout(q,p)),w}return pe.cancel=te,pe.flush=oe,pe}return ac=f,ac}var lc,G0;function IR(){if(G0)return lc;G0=1;var e=AR(),r=bf(),i="Expected a function";function s(l,u,f){var h=!0,p=!0;if(typeof l!="function")throw new TypeError(i);return r(f)&&(h="leading"in f?!!f.leading:h,p="trailing"in f?!!f.trailing:p),e(l,u,{leading:h,maxWait:u,trailing:p})}return lc=s,lc}var DR=IR();const PR=na(DR);var uc,$0;function MR(){if($0)return uc;$0=1;function e(w,v){var S,R;if(typeof v=="function")R=v(w),R!==void 0&&(w=R);else if(Array.isArray(v))for(S=0;S<v.length;S++)R=v[S](w),R!==void 0&&(w=R);return w}function r(w,v){return w[0]==="-"&&Array.isArray(v)&&/^-\d+$/.test(w)?v.length+parseInt(w,10):w}function i(w){return/^\d+$/.test(w)}function s(w){return Object.prototype.toString.call(w)==="[object Object]"}function l(w){return Object(w)===w}function u(w){return Object.keys(w).length===0}var f=["__proto__","prototype","constructor"],h=function(w){return f.indexOf(w)===-1};function p(w,v){w.indexOf("[")>=0&&(w=w.replace(/\[/g,v).replace(/]/g,""));var S=w.split(v),R=S.filter(h);if(R.length!==S.length)throw Error("Refusing to update blacklisted property "+w);return S}var _=Object.prototype.hasOwnProperty;function y(w,v,S,R){if(!(this instanceof y))return new y(w,v,S,R);typeof v>"u"&&(v=!1),typeof S>"u"&&(S=!0),typeof R>"u"&&(R=!0),this.separator=w||".",this.override=v,this.useArray=S,this.useBrackets=R,this.keepArray=!1,this.cleanup=[]}var x=new y(".",!1,!0,!0);function m(w){return function(){return x[w].apply(x,arguments)}}return y.prototype._fill=function(w,v,S,R){var O=w.shift();if(w.length>0){if(v[O]=v[O]||(this.useArray&&i(w[0])?[]:{}),!l(v[O]))if(this.override)v[O]={};else{if(!(l(S)&&u(S)))throw new Error("Trying to redefine `"+O+"` which is a "+typeof v[O]);return}this._fill(w,v[O],S,R)}else{if(!this.override&&l(v[O])&&!u(v[O])){if(!(l(S)&&u(S)))throw new Error("Trying to redefine non-empty obj['"+O+"']");return}v[O]=e(S,R)}},y.prototype.object=function(w,v){var S=this;return Object.keys(w).forEach(function(R){var O=v===void 0?null:v[R],N=p(R,S.separator).join(S.separator);N.indexOf(S.separator)!==-1?(S._fill(N.split(S.separator),w,w[R],O),delete w[R]):w[R]=e(w[R],O)}),w},y.prototype.str=function(w,v,S,R){var O=p(w,this.separator).join(this.separator);return w.indexOf(this.separator)!==-1?this._fill(O.split(this.separator),S,v,R):S[w]=e(v,R),S},y.prototype.pick=function(w,v,S,R){var O,N,b,k,T;for(N=p(w,this.separator),O=0;O<N.length;O++)if(k=r(N[O],v),v&&typeof v=="object"&&k in v){if(O===N.length-1)return S?(b=v[k],R&&Array.isArray(v)?v.splice(k,1):delete v[k],Array.isArray(v)&&(T=N.slice(0,-1).join("."),this.cleanup.indexOf(T)===-1&&this.cleanup.push(T)),b):v[k];v=v[k]}else return;return S&&Array.isArray(v)&&(v=v.filter(function(L){return L!==void 0})),v},y.prototype.delete=function(w,v){return this.remove(w,v,!0)},y.prototype.remove=function(w,v,S){var R;if(this.cleanup=[],Array.isArray(w)){for(R=0;R<w.length;R++)this.pick(w[R],v,!0,S);return S||this._cleanup(v),v}else return this.pick(w,v,!0,S)},y.prototype._cleanup=function(w){var v,S,R,O;if(this.cleanup.length){for(S=0;S<this.cleanup.length;S++)R=this.cleanup[S].split("."),O=R.splice(0,-1).join("."),v=O?this.pick(O,w):w,v=v[R[0]].filter(function(N){return N!==void 0}),this.set(this.cleanup[S],v,w);this.cleanup=[]}},y.prototype.del=y.prototype.remove,y.prototype.move=function(w,v,S,R,O){return typeof R=="function"||Array.isArray(R)?this.set(v,e(this.pick(w,S,!0),R),S,O):(O=R,this.set(v,this.pick(w,S,!0),S,O)),S},y.prototype.transfer=function(w,v,S,R,O,N){return typeof O=="function"||Array.isArray(O)?this.set(v,e(this.pick(w,S,!0),O),R,N):(N=O,this.set(v,this.pick(w,S,!0),R,N)),R},y.prototype.copy=function(w,v,S,R,O,N){return typeof O=="function"||Array.isArray(O)?this.set(v,e(JSON.parse(JSON.stringify(this.pick(w,S,!1))),O),R,N):(N=O,this.set(v,this.pick(w,S,!1),R,N)),R},y.prototype.set=function(w,v,S,R){var O,N,b,k;if(typeof v>"u")return S;for(b=p(w,this.separator),O=0;O<b.length;O++){if(k=b[O],O===b.length-1)if(R&&s(v)&&s(S[k]))for(N in v)_.call(v,N)&&(S[k][N]=v[N]);else if(R&&Array.isArray(S[k])&&Array.isArray(v))for(var T=0;T<v.length;T++)S[b[O]].push(v[T]);else S[k]=v;else(!_.call(S,k)||!s(S[k])&&!Array.isArray(S[k]))&&(/^\d+$/.test(b[O+1])?S[k]=[]:S[k]={});S=S[k]}return S},y.prototype.transform=function(w,v,S){return v=v||{},S=S||{},Object.keys(w).forEach((function(R){this.set(w[R],this.pick(R,v),S)}).bind(this)),S},y.prototype.dot=function(w,v,S){v=v||{},S=S||[];var R=Array.isArray(w);return Object.keys(w).forEach((function(O){var N=R&&this.useBrackets?"["+O+"]":O;if(l(w[O])&&(s(w[O])&&!u(w[O])||Array.isArray(w[O])&&!this.keepArray&&w[O].length!==0))if(R&&this.useBrackets){var b=S[S.length-1]||"";return this.dot(w[O],v,S.slice(0,-1).concat(b+N))}else return this.dot(w[O],v,S.concat(N));else R&&this.useBrackets?v[S.join(this.separator).concat("["+O+"]")]=w[O]:v[S.concat(N).join(this.separator)]=w[O]}).bind(this)),v},y.pick=m("pick"),y.move=m("move"),y.transfer=m("transfer"),y.transform=m("transform"),y.copy=m("copy"),y.object=m("object"),y.str=m("str"),y.set=m("set"),y.delete=m("delete"),y.del=y.remove=m("remove"),y.dot=m("dot"),["override","overwrite"].forEach(function(w){Object.defineProperty(y,w,{get:function(){return x.override},set:function(v){x.override=!!v}})}),["useArray","keepArray","useBrackets"].forEach(function(w){Object.defineProperty(y,w,{get:function(){return x[w]},set:function(v){x[w]=v}})}),y._process=e,uc=y,uc}var FR=MR();const Gy={"page.title":"Bubble Chat Chatbot","message-input-label":"Benutzereingabe","message-input-placeholder":"Nachricht","message-input.actions.submit.label":"Nachricht senden","message-input.actions.export-transcript.label":"Konversation exportieren","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.copy":"Kopieren","agent-bubble.label":"Nachricht des Live-Agenten","export-transcript.email.title":"Konversation per E-Mail versenden","export-transcript.email.description":"Geben Sie Ihre E-Mail-Adresse ein, um den Chatverlauf zu erhalten.","export-transcript.email.cancel":"Abbrechen","export-transcript.email.send":"Senden","export-transcript.email.placeholder":"Ihre E-Mail-Adresse","export-transcript.email.invalid":"Bitte gültige E-Mail-Adresse eingeben.","export-transcript.email.success":"Ich habe den Chatverlauf an Ihre E-Mail-Adresse gesendet.","export-transcript.pdf.title":"Konversation als PDF erhalten","export-transcript.pdf.description":"Laden Sie die Konversation als PDF herunter.","export-transcript.pdf.cancel":"Abbrechen","export-transcript.pdf.download":"Herunterladen","general-conditions.header":"**Nutzungsbedingungen**","general-conditions.body":`Bitte berücksichtigen Sie die folgenden Punkte:
98
98
 
99
99
  - Der Chatverlauf wird im EU-Raum gespeichert und kann nur von autorisierten Personen eingesehen werden.
100
100
  - Geben Sie im Chatfenster keine persönlichen Daten ein (Passwörter, Geburtsdatum usw.).`,"general-conditions.accept-conditions-note":"Mit der Verwendung des Chats erklären Sie sich mit den Nutzungsbedingungen einverstanden.","block-user-input.title":"Bitte auf die Antwort des Chatbots warten.","conversation-rating.call-to-action.title":"Bewerten Sie diesen Chat","conversation-rating.overlay.title":"Wie zufrieden sind Sie mit diesem Chat?","conversation-rating.overlay.guest-feedback.input-placeholder":"Feedback bitte hier eingeben (optional)","conversation-rating.overlay.star.very-bad":"Sehr schlecht","conversation-rating.overlay.star.very-good":"Sehr gut","conversation-rating.overlay.bot-message.rate-feedback.value-1":"Oh, das tönt nicht gut. Bitte geben Sie mir doch ein schriftliches Feedback, damit ich dazulernen kann.","conversation-rating.overlay.bot-message.rate-feedback.value-2":"Oh, das tönt nicht gut. Bitte geben Sie mir doch ein schriftliches Feedback, damit ich dazulernen kann.","conversation-rating.overlay.bot-message.rate-feedback.value-3":"Durchschnitt ist nicht mein Ziel, was kann ich noch verbessern?","conversation-rating.overlay.bot-message.rate-feedback.value-4":"Knapp daneben ist auch vorbei. Was kann ich noch verbessern, um das nächste Mal alle Sterne zu erreichen?","conversation-rating.overlay.bot-message.rate-feedback.value-5":"Perfekt! Dann hoffe ich, dass ich Sie wieder einmal so gut beraten kann.","conversation-rating.overlay.bot-message.submit-feedback":"Vielen Dank für die Rückmeldung. Ich bin bestrebt, mich ständig zu verbessern.","conversation-rating.overlay.action.submit":"Bewertung senden","conversation-rating.overlay.action.close":"Zurück zum Chat","start-screen.intro":"","start-screen.start-chat":"Chat starten","header.restart-chat":"Chat neu starten","header.close-chat":"Chat minimieren","source-infos.close":"Schliessen","source-infos.error.title":"Fehler","source-infos.error.info":"Oops! Etwas ist schiefgelaufen. Bitte versuche es erneut oder kontaktiere den Support, falls das Problem weiterhin besteht.","commands.show-more.action":"Weitere ...","commands.show-more.tooltip":"Weitere Befehle anzeigen","commands.show-less.action":"Weniger ...","commands.show-less.tooltip":"Weniger Befehle anzeigen"},LR={"page.title":"Bubble Chat Chatbot","message-input-label":"User input","message-input-placeholder":"Message","message-input.actions.submit.label":"Send message","message-input.actions.export-transcript.label":"Export conversation","message-input.actions.start-audio-recording.label":"Start voice input","message-input.actions.stop-audio-recording.label":"Stop voice input","message-input.actions.submit-audio-recording.label":"Transmit voice input","guest-bubble.label":"Your message","bot-bubble.label":"Message from the chatbot","bot-bubble.reaction.good":"I like","bot-bubble.reaction.bad":"I don't like it","bot-bubble.reaction.remove":"Remove marker","bot-bubble.copy":"Copy","agent-bubble.label":"Message from the live agent","export-transcript.email.title":"Receive Conversation","export-transcript.email.description":"Enter your email address to receive the chat history.","export-transcript.email.cancel":"Cancel","export-transcript.email.send":"Send","export-transcript.email.placeholder":"Your email address","export-transcript.email.invalid":"Please enter a valid e-mail address.","export-transcript.email.success":"I have sent the chat history to your email address.","export-transcript.pdf.title":"Get conversation as PDF","export-transcript.pdf.description":"Download this conversation as PDF.","export-transcript.pdf.cancel":"Cancel","export-transcript.pdf.download":"Download","general-conditions.header":"**Terms of use**","general-conditions.body":`Please consider the following points:
@@ -107,4 +107,4 @@ For more details see https://formatjs.github.io/docs/getting-started/message-dis
107
107
 
108
108
  - La cronologia delle chat è memorizzata nell'area UE e può essere visualizzata solo da persone autorizzate.
109
109
  - 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.close":"Chiudere","start-screen.intro":"","start-screen.start-chat":"Avviare la chat","header.restart-chat":"Riavviare la chat","header.close-chat":"Ridurre al minimo la chat","source-infos.close":"Chiudere","source-infos.error.title":"Errore","source-infos.error.info":"Ops! Qualcosa è andato storto. Riprovare o contattare l'assistenza se il problema persiste.","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"},UR=["de","en","fr","it"],$y={locale:"de",messages:Gy},HR=(e,r)=>{if(UR.includes(e)){const i=zR(e),s=FR.dot(r);return{...i,...s}}return r},zR=e=>{switch(e.toString()){case"en":return LR;case"fr":return BR;case"it":return jR;default:return Gy}},GR=(e=$R,r)=>{switch(r.type){case gf:return Object.assign({},e,{connectionState:Er.CONNECTING});case yf:return Object.assign({},e,{connectionState:Er.CONNECTED});case vf:return Object.assign({},e,{connectionState:Er.DISCONNECTED});case _f:return Object.assign({},e,{connectionState:Er.RECONNECTED});case Ef:return Object.assign({},e,{sessionId:r.sessionId});case ca:return Object.assign({},e,{sessionId:r.payload.sessionId,userId:r.payload.userId});case fa:return Object.assign({},e,{sessionId:void 0});default:return e}},$R={connectionState:Er.DISCONNECTED,sessionId:void 0,userId:void 0},VR=(e=q0,r)=>{switch(r.type){case fy:return q0;case ca:return yr({type:"webclient.chat.started"}),e;case fa:return yr({type:"webclient.chat.ended"}),e;case ge.ActionTypes.TYPING_ON:return Object.assign({},e,{isBotTyping:!0});case ge.ActionTypes.TYPING_OFF:return Object.assign({},e,{isBotTyping:!1});case ge.ActionTypes.MESSAGE_FROM_GUEST:case ge.ActionTypes.MESSAGE_WITHOUT_ANALYSIS_FROM_GUEST:return V0(e,r.message);case ge.ActionTypes.MESSAGE_TO_GUEST:{yr(r);const i=Object.assign({},r.message,{_id:r.meta.actionId}),s=e.messages.filter(l=>l._id===r.meta.actionId).length>0;return Object.assign({},e,{isBotTyping:!1,messages:s?e.messages:e.messages.concat([i]),quickReplies:i.quickReplies?i.quickReplies:[]})}case tf:{const i=r.messages,s=i.length?i[i.length-1]:void 0;return Object.assign({},e,{isBotTyping:!1,messages:i,quickReplies:(s==null?void 0:s.quickReplies)||[]})}case ef:return yr(r.message),e;case ge.ActionTypes.EVENT_TO_GUEST:return yr(r.event),e;case ge.ActionTypes.DRAWER_OPEN:return Object.assign({},e,{drawerContentUrl:r.payload.parameters.contentUrl});case ge.ActionTypes.DRAWER_CLOSE:return Object.assign({},e,{drawerContentUrl:void 0});case ge.ActionTypes.GUEST_LOCALE_CHANGED:return Object.assign({},e,{locale:r.payload.locale});case qg:return yr(r),e;case Wg:return yr(r),e;case rf:return Object.assign({},e,{speechSupport:!0});case sf:{const i=new ge.TextMessage(r.transcription,new ge.GuestUser),s=Object.assign({},i,{_id:Pc()});return V0(e,s)}case of:return Object.assign({},e,{transcriptExportEnabled:r.methods});case af:return Object.assign({},e,{showGeneralConditions:!0});case ge.ActionTypes.TRANSCRIPT_ITEM_GUEST_REACTION:{const i=e.messages.map(s=>s._id===r.payload.actionId?Object.assign({},s,{reaction:r.payload.reaction}):s);return Object.assign({},e,{messages:i})}case lf:{const i={enabled:!0,rating:r.payload.rating};return Object.assign({},e,{conversationRating:i})}case ge.ActionTypes.CONVERSATION_RATING_FROM_GUEST:{const i={...e.conversationRating,rating:r.payload};return Object.assign({},e,{conversationRating:i})}case uf:return{...e,commands:r.payload.commands};case cf:return{...e,sourceInfos:{type:"loading",chunkId:r.payload.chunkId}};case Vg:return{...e,sourceInfos:{type:"loading-error"}};case $g:return{...e,sourceInfos:{type:"loaded",chunkId:r.payload.chunkId,knowledgeBaseType:r.payload.knowledgeBaseType,title:r.payload.title,content:r.payload.content,url:r.payload.url}};case ff:return{...e,sourceInfos:void 0};default:return e}},V0=(e,r)=>{const i=e.messages[e.messages.length-1],s=(i==null?void 0:i.text)===r.text;return i&&i.sender.type===r.sender.type&&s?e:Object.assign({},e,{messages:e.messages.concat([r]),quickReplies:[]})},yr=e=>{var r;qR()?(r=window.top)==null||r.postMessage(e,"*"):e.type==="webclient.change.url"&&window.open(e.url)},qR=()=>typeof window<"u"&&window.self!==window.top,q0={messages:[],quickReplies:[],isBotTyping:!1,speechSupport:!1,transcriptExportEnabled:{pdf:!1,email:!1},showGeneralConditions:!1,conversationRating:{enabled:!1},commands:[]},Vy=uy({name:"intl",initialState:$y,reducers:{updateIntl:(e,r)=>{e.locale=r.payload.language,e.messages=r.payload.messages}}}),{updateIntl:WR}=Vy.actions,ZR=Vy.reducer,QR=Yg({chat:VR,startScreen:Nb,connection:GR,intl:ZR}),qy="bf-webclient-state-last-saved-at",Wy="bf-webclient-state",KR=e=>{try{if(!JR())return;const r=W0(e,qy);if(YR(r))return;{const i=W0(e,Wy);return i===null?void 0:JSON.parse(i)}}catch(r){console.error(r);return}},XR=(e,r)=>{try{const i=JSON.stringify(r);Z0(e,Wy,i);const s=new Date().toISOString();Z0(e,qy,s)}catch(i){console.error(i)}},YR=e=>{if(e===null)return!1;const r=new Date(e);return r.setHours(r.getHours()+12),new Date>r},JR=()=>typeof localStorage<"u",W0=(e,r)=>localStorage.getItem(`${e}_${r}`),Z0=(e,r,i)=>localStorage.setItem(`${e}_${r}`,i),hn=Object.create(null);hn.open="0";hn.close="1";hn.ping="2";hn.pong="3";hn.message="4";hn.upgrade="5";hn.noop="6";const qs=Object.create(null);Object.keys(hn).forEach(e=>{qs[hn[e]]=e});const Lc={type:"error",data:"parser error"},Zy=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",Qy=typeof ArrayBuffer=="function",Ky=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,xf=({type:e,data:r},i,s)=>Zy&&r instanceof Blob?i?s(r):Q0(r,s):Qy&&(r instanceof ArrayBuffer||Ky(r))?i?s(r):Q0(new Blob([r]),s):s(hn[e]+(r||"")),Q0=(e,r)=>{const i=new FileReader;return i.onload=function(){const s=i.result.split(",")[1];r("b"+(s||""))},i.readAsDataURL(e)};function K0(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}let cc;function eO(e,r){if(Zy&&e.data instanceof Blob)return e.data.arrayBuffer().then(K0).then(r);if(Qy&&(e.data instanceof ArrayBuffer||Ky(e.data)))return r(K0(e.data));xf(e,!1,i=>{cc||(cc=new TextEncoder),r(cc.encode(i))})}const X0="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Ji=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let e=0;e<X0.length;e++)Ji[X0.charCodeAt(e)]=e;const tO=e=>{let r=e.length*.75,i=e.length,s,l=0,u,f,h,p;e[e.length-1]==="="&&(r--,e[e.length-2]==="="&&r--);const _=new ArrayBuffer(r),y=new Uint8Array(_);for(s=0;s<i;s+=4)u=Ji[e.charCodeAt(s)],f=Ji[e.charCodeAt(s+1)],h=Ji[e.charCodeAt(s+2)],p=Ji[e.charCodeAt(s+3)],y[l++]=u<<2|f>>4,y[l++]=(f&15)<<4|h>>2,y[l++]=(h&3)<<6|p&63;return _},nO=typeof ArrayBuffer=="function",Tf=(e,r)=>{if(typeof e!="string")return{type:"message",data:Xy(e,r)};const i=e.charAt(0);return i==="b"?{type:"message",data:rO(e.substring(1),r)}:qs[i]?e.length>1?{type:qs[i],data:e.substring(1)}:{type:qs[i]}:Lc},rO=(e,r)=>{if(nO){const i=tO(e);return Xy(i,r)}else return{base64:!0,data:e}},Xy=(e,r)=>{switch(r){case"blob":return e instanceof Blob?e:new Blob([e]);case"arraybuffer":default:return e instanceof ArrayBuffer?e:e.buffer}},Yy="",iO=(e,r)=>{const i=e.length,s=new Array(i);let l=0;e.forEach((u,f)=>{xf(u,!1,h=>{s[f]=h,++l===i&&r(s.join(Yy))})})},oO=(e,r)=>{const i=e.split(Yy),s=[];for(let l=0;l<i.length;l++){const u=Tf(i[l],r);if(s.push(u),u.type==="error")break}return s};function sO(){return new TransformStream({transform(e,r){eO(e,i=>{const s=i.length;let l;if(s<126)l=new Uint8Array(1),new DataView(l.buffer).setUint8(0,s);else if(s<65536){l=new Uint8Array(3);const u=new DataView(l.buffer);u.setUint8(0,126),u.setUint16(1,s)}else{l=new Uint8Array(9);const u=new DataView(l.buffer);u.setUint8(0,127),u.setBigUint64(1,BigInt(s))}e.data&&typeof e.data!="string"&&(l[0]|=128),r.enqueue(l),r.enqueue(i)})}})}let fc;function zs(e){return e.reduce((r,i)=>r+i.length,0)}function Gs(e,r){if(e[0].length===r)return e.shift();const i=new Uint8Array(r);let s=0;for(let l=0;l<r;l++)i[l]=e[0][s++],s===e[0].length&&(e.shift(),s=0);return e.length&&s<e[0].length&&(e[0]=e[0].slice(s)),i}function aO(e,r){fc||(fc=new TextDecoder);const i=[];let s=0,l=-1,u=!1;return new TransformStream({transform(f,h){for(i.push(f);;){if(s===0){if(zs(i)<1)break;const p=Gs(i,1);u=(p[0]&128)===128,l=p[0]&127,l<126?s=3:l===126?s=1:s=2}else if(s===1){if(zs(i)<2)break;const p=Gs(i,2);l=new DataView(p.buffer,p.byteOffset,p.length).getUint16(0),s=3}else if(s===2){if(zs(i)<8)break;const p=Gs(i,8),_=new DataView(p.buffer,p.byteOffset,p.length),y=_.getUint32(0);if(y>Math.pow(2,21)-1){h.enqueue(Lc);break}l=y*Math.pow(2,32)+_.getUint32(4),s=3}else{if(zs(i)<l)break;const p=Gs(i,l);h.enqueue(Tf(u?p:fc.decode(p),r)),s=0}if(l===0||l>e){h.enqueue(Lc);break}}}})}const Jy=4;function We(e){if(e)return lO(e)}function lO(e){for(var r in We.prototype)e[r]=We.prototype[r];return e}We.prototype.on=We.prototype.addEventListener=function(e,r){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(r),this};We.prototype.once=function(e,r){function i(){this.off(e,i),r.apply(this,arguments)}return i.fn=r,this.on(e,i),this};We.prototype.off=We.prototype.removeListener=We.prototype.removeAllListeners=We.prototype.removeEventListener=function(e,r){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var i=this._callbacks["$"+e];if(!i)return this;if(arguments.length==1)return delete this._callbacks["$"+e],this;for(var s,l=0;l<i.length;l++)if(s=i[l],s===r||s.fn===r){i.splice(l,1);break}return i.length===0&&delete this._callbacks["$"+e],this};We.prototype.emit=function(e){this._callbacks=this._callbacks||{};for(var r=new Array(arguments.length-1),i=this._callbacks["$"+e],s=1;s<arguments.length;s++)r[s-1]=arguments[s];if(i){i=i.slice(0);for(var s=0,l=i.length;s<l;++s)i[s].apply(this,r)}return this};We.prototype.emitReserved=We.prototype.emit;We.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]};We.prototype.hasListeners=function(e){return!!this.listeners(e).length};const ma=typeof Promise=="function"&&typeof Promise.resolve=="function"?r=>Promise.resolve().then(r):(r,i)=>i(r,0),Bt=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),uO="arraybuffer";function ev(e,...r){return r.reduce((i,s)=>(e.hasOwnProperty(s)&&(i[s]=e[s]),i),{})}const cO=Bt.setTimeout,fO=Bt.clearTimeout;function ga(e,r){r.useNativeTimers?(e.setTimeoutFn=cO.bind(Bt),e.clearTimeoutFn=fO.bind(Bt)):(e.setTimeoutFn=Bt.setTimeout.bind(Bt),e.clearTimeoutFn=Bt.clearTimeout.bind(Bt))}const dO=1.33;function hO(e){return typeof e=="string"?pO(e):Math.ceil((e.byteLength||e.size)*dO)}function pO(e){let r=0,i=0;for(let s=0,l=e.length;s<l;s++)r=e.charCodeAt(s),r<128?i+=1:r<2048?i+=2:r<55296||r>=57344?i+=3:(s++,i+=4);return i}function tv(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function mO(e){let r="";for(let i in e)e.hasOwnProperty(i)&&(r.length&&(r+="&"),r+=encodeURIComponent(i)+"="+encodeURIComponent(e[i]));return r}function gO(e){let r={},i=e.split("&");for(let s=0,l=i.length;s<l;s++){let u=i[s].split("=");r[decodeURIComponent(u[0])]=decodeURIComponent(u[1])}return r}class yO extends Error{constructor(r,i,s){super(r),this.description=i,this.context=s,this.type="TransportError"}}class Cf extends We{constructor(r){super(),this.writable=!1,ga(this,r),this.opts=r,this.query=r.query,this.socket=r.socket,this.supportsBinary=!r.forceBase64}onError(r,i,s){return super.emitReserved("error",new yO(r,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(r){this.readyState==="open"&&this.write(r)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(r){const i=Tf(r,this.socket.binaryType);this.onPacket(i)}onPacket(r){super.emitReserved("packet",r)}onClose(r){this.readyState="closed",super.emitReserved("close",r)}pause(r){}createUri(r,i={}){return r+"://"+this._hostname()+this._port()+this.opts.path+this._query(i)}_hostname(){const r=this.opts.hostname;return r.indexOf(":")===-1?r:"["+r+"]"}_port(){return this.opts.port&&(this.opts.secure&&+(this.opts.port!==443)||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(r){const i=mO(r);return i.length?"?"+i:""}}class vO extends Cf{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(r){this.readyState="pausing";const i=()=>{this.readyState="paused",r()};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(r){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)};oO(r,this.socket.binaryType).forEach(i),this.readyState!=="closed"&&(this._polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this._poll())}doClose(){const r=()=>{this.write([{type:"close"}])};this.readyState==="open"?r():this.once("open",r)}write(r){this.writable=!1,iO(r,i=>{this.doWrite(i,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const r=this.opts.secure?"https":"http",i=this.query||{};return this.opts.timestampRequests!==!1&&(i[this.opts.timestampParam]=tv()),!this.supportsBinary&&!i.sid&&(i.b64=1),this.createUri(r,i)}}let nv=!1;try{nv=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const _O=nv;function EO(){}class wO extends vO{constructor(r){if(super(r),typeof location<"u"){const i=location.protocol==="https:";let s=location.port;s||(s=i?"443":"80"),this.xd=typeof location<"u"&&r.hostname!==location.hostname||s!==r.port}}doWrite(r,i){const s=this.request({method:"POST",data:r});s.on("success",i),s.on("error",(l,u)=>{this.onError("xhr post error",l,u)})}doPoll(){const r=this.request();r.on("data",this.onData.bind(this)),r.on("error",(i,s)=>{this.onError("xhr poll error",i,s)}),this.pollXhr=r}}class cn extends We{constructor(r,i,s){super(),this.createRequest=r,ga(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 r;const i=ev(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 l in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(l)&&s.setRequestHeader(l,this._opts.extraHeaders[l])}}catch{}if(this._method==="POST")try{s.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{s.setRequestHeader("Accept","*/*")}catch{}(r=this._opts.cookieJar)===null||r===void 0||r.addCookies(s),"withCredentials"in s&&(s.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(s.timeout=this._opts.requestTimeout),s.onreadystatechange=()=>{var l;s.readyState===3&&((l=this._opts.cookieJar)===null||l===void 0||l.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(l){this.setTimeoutFn(()=>{this._onError(l)},0);return}typeof document<"u"&&(this._index=cn.requestsCount++,cn.requests[this._index]=this)}_onError(r){this.emitReserved("error",r,this._xhr),this._cleanup(!0)}_cleanup(r){if(!(typeof this._xhr>"u"||this._xhr===null)){if(this._xhr.onreadystatechange=EO,r)try{this._xhr.abort()}catch{}typeof document<"u"&&delete cn.requests[this._index],this._xhr=null}}_onLoad(){const r=this._xhr.responseText;r!==null&&(this.emitReserved("data",r),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}}cn.requestsCount=0;cn.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",Y0);else if(typeof addEventListener=="function"){const e="onpagehide"in Bt?"pagehide":"unload";addEventListener(e,Y0,!1)}}function Y0(){for(let e in cn.requests)cn.requests.hasOwnProperty(e)&&cn.requests[e].abort()}const SO=function(){const e=rv({xdomain:!1});return e&&e.responseType!==null}();class bO extends wO{constructor(r){super(r);const i=r&&r.forceBase64;this.supportsBinary=SO&&!i}request(r={}){return Object.assign(r,{xd:this.xd},this.opts),new cn(rv,this.uri(),r)}}function rv(e){const r=e.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!r||_O))return new XMLHttpRequest}catch{}if(!r)try{return new Bt[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const iv=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class xO extends Cf{get name(){return"websocket"}doOpen(){const r=this.uri(),i=this.opts.protocols,s=iv?{}:ev(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(r,i,s)}catch(l){return this.emitReserved("error",l)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=r=>this.onClose({description:"websocket connection closed",context:r}),this.ws.onmessage=r=>this.onData(r.data),this.ws.onerror=r=>this.onError("websocket error",r)}write(r){this.writable=!1;for(let i=0;i<r.length;i++){const s=r[i],l=i===r.length-1;xf(s,this.supportsBinary,u=>{try{this.doWrite(s,u)}catch{}l&&ma(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.close(),this.ws=null)}uri(){const r=this.opts.secure?"wss":"ws",i=this.query||{};return this.opts.timestampRequests&&(i[this.opts.timestampParam]=tv()),this.supportsBinary||(i.b64=1),this.createUri(r,i)}}const dc=Bt.WebSocket||Bt.MozWebSocket;class TO extends xO{createSocket(r,i,s){return iv?new dc(r,i,s):i?new dc(r,i):new dc(r)}doWrite(r,i){this.ws.send(i)}}class CO extends Cf{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(r){return this.emitReserved("error",r)}this._transport.closed.then(()=>{this.onClose()}).catch(r=>{this.onError("webtransport error",r)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(r=>{const i=aO(Number.MAX_SAFE_INTEGER,this.socket.binaryType),s=r.readable.pipeThrough(i).getReader(),l=sO();l.readable.pipeTo(r.writable),this._writer=l.writable.getWriter();const u=()=>{s.read().then(({done:h,value:p})=>{h||(this.onPacket(p),u())}).catch(h=>{})};u();const f={type:"open"};this.query.sid&&(f.data=`{"sid":"${this.query.sid}"}`),this._writer.write(f).then(()=>this.onOpen())})})}write(r){this.writable=!1;for(let i=0;i<r.length;i++){const s=r[i],l=i===r.length-1;this._writer.write(s).then(()=>{l&&ma(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var r;(r=this._transport)===null||r===void 0||r.close()}}const kO={websocket:TO,webtransport:CO,polling:bO},RO=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,OO=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function Bc(e){if(e.length>8e3)throw"URI too long";const r=e,i=e.indexOf("["),s=e.indexOf("]");i!=-1&&s!=-1&&(e=e.substring(0,i)+e.substring(i,s).replace(/:/g,";")+e.substring(s,e.length));let l=RO.exec(e||""),u={},f=14;for(;f--;)u[OO[f]]=l[f]||"";return i!=-1&&s!=-1&&(u.source=r,u.host=u.host.substring(1,u.host.length-1).replace(/;/g,":"),u.authority=u.authority.replace("[","").replace("]","").replace(/;/g,":"),u.ipv6uri=!0),u.pathNames=NO(u,u.path),u.queryKey=AO(u,u.query),u}function NO(e,r){const i=/\/{2,9}/g,s=r.replace(i,"/").split("/");return(r.slice(0,1)=="/"||r.length===0)&&s.splice(0,1),r.slice(-1)=="/"&&s.splice(s.length-1,1),s}function AO(e,r){const i={};return r.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(s,l,u){l&&(i[l]=u)}),i}const jc=typeof addEventListener=="function"&&typeof removeEventListener=="function",Ws=[];jc&&addEventListener("offline",()=>{Ws.forEach(e=>e())},!1);class Yn extends We{constructor(r,i){if(super(),this.binaryType=uO,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,r&&typeof r=="object"&&(i=r,r=null),r){const s=Bc(r);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=Bc(i.host).host);ga(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 l=s.prototype.name;this.transports.push(l),this._transportsByName[l]=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=gO(this.opts.query)),jc&&(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"})},Ws.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(r){const i=Object.assign({},this.opts.query);i.EIO=Jy,i.transport=r,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[r]);return new this._transportsByName[r](s)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}const r=this.opts.rememberUpgrade&&Yn.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";const i=this.createTransport(r);i.open(),this.setTransport(i)}setTransport(r){this.transport&&this.transport.removeAllListeners(),this.transport=r,r.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",Yn.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(r){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",r),this.emitReserved("heartbeat"),r.type){case"open":this.onHandshake(JSON.parse(r.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=r.data,this._onError(i);break;case"message":this.emitReserved("data",r.data),this.emitReserved("message",r.data);break}}onHandshake(r){this.emitReserved("handshake",r),this.id=r.sid,this.transport.query.sid=r.sid,this._pingInterval=r.pingInterval,this._pingTimeout=r.pingTimeout,this._maxPayload=r.maxPayload,this.onOpen(),this.readyState!=="closed"&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);const r=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+r,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},r),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 r=this._getWritablePackets();this.transport.send(r),this._prevBufferLen=r.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 l=this.writeBuffer[s].data;if(l&&(i+=hO(l)),s>0&&i>this._maxPayload)return this.writeBuffer.slice(0,s);i+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;const r=Date.now()>this._pingTimeoutTime;return r&&(this._pingTimeoutTime=0,ma(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),r}write(r,i,s){return this._sendPacket("message",r,i,s),this}send(r,i,s){return this._sendPacket("message",r,i,s),this}_sendPacket(r,i,s,l){if(typeof i=="function"&&(l=i,i=void 0),typeof s=="function"&&(l=s,s=null),this.readyState==="closing"||this.readyState==="closed")return;s=s||{},s.compress=s.compress!==!1;const u={type:r,data:i,options:s};this.emitReserved("packetCreate",u),this.writeBuffer.push(u),l&&this.once("flush",l),this.flush()}close(){const r=()=>{this._onClose("forced close"),this.transport.close()},i=()=>{this.off("upgrade",i),this.off("upgradeError",i),r()},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():r()}):this.upgrading?s():r()),this}_onError(r){if(Yn.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState==="opening")return this.transports.shift(),this._open();this.emitReserved("error",r),this._onClose("transport error",r)}_onClose(r,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(),jc&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const s=Ws.indexOf(this._offlineEventListener);s!==-1&&Ws.splice(s,1)}this.readyState="closed",this.id=null,this.emitReserved("close",r,i),this.writeBuffer=[],this._prevBufferLen=0}}}Yn.protocol=Jy;class IO extends Yn{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade)for(let r=0;r<this._upgrades.length;r++)this._probe(this._upgrades[r])}_probe(r){let i=this.createTransport(r),s=!1;Yn.priorWebsocketSuccess=!1;const l=()=>{s||(i.send([{type:"ping",data:"probe"}]),i.once("packet",x=>{if(!s)if(x.type==="pong"&&x.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",i),!i)return;Yn.priorWebsocketSuccess=i.name==="websocket",this.transport.pause(()=>{s||this.readyState!=="closed"&&(y(),this.setTransport(i),i.send([{type:"upgrade"}]),this.emitReserved("upgrade",i),i=null,this.upgrading=!1,this.flush())})}else{const m=new Error("probe error");m.transport=i.name,this.emitReserved("upgradeError",m)}}))};function u(){s||(s=!0,y(),i.close(),i=null)}const f=x=>{const m=new Error("probe error: "+x);m.transport=i.name,u(),this.emitReserved("upgradeError",m)};function h(){f("transport closed")}function p(){f("socket closed")}function _(x){i&&x.name!==i.name&&u()}const y=()=>{i.removeListener("open",l),i.removeListener("error",f),i.removeListener("close",h),this.off("close",p),this.off("upgrading",_)};i.once("open",l),i.once("error",f),i.once("close",h),this.once("close",p),this.once("upgrading",_),this._upgrades.indexOf("webtransport")!==-1&&r!=="webtransport"?this.setTimeoutFn(()=>{s||i.open()},200):i.open()}onHandshake(r){this._upgrades=this._filterUpgrades(r.upgrades),super.onHandshake(r)}_filterUpgrades(r){const i=[];for(let s=0;s<r.length;s++)~this.transports.indexOf(r[s])&&i.push(r[s]);return i}}let DO=class extends IO{constructor(r,i={}){const s=typeof r=="object"?r:i;(!s.transports||s.transports&&typeof s.transports[0]=="string")&&(s.transports=(s.transports||["polling","websocket","webtransport"]).map(l=>kO[l]).filter(l=>!!l)),super(r,s)}};function PO(e,r="",i){let s=e;i=i||typeof location<"u"&&location,e==null&&(e=i.protocol+"//"+i.host),typeof e=="string"&&(e.charAt(0)==="/"&&(e.charAt(1)==="/"?e=i.protocol+e:e=i.host+e),/^(https?|wss?):\/\//.test(e)||(typeof i<"u"?e=i.protocol+"//"+e:e="https://"+e),s=Bc(e)),s.port||(/^(http|ws)$/.test(s.protocol)?s.port="80":/^(http|ws)s$/.test(s.protocol)&&(s.port="443")),s.path=s.path||"/";const u=s.host.indexOf(":")!==-1?"["+s.host+"]":s.host;return s.id=s.protocol+"://"+u+":"+s.port+r,s.href=s.protocol+"://"+u+(i&&i.port===s.port?"":":"+s.port),s}const MO=typeof ArrayBuffer=="function",FO=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,ov=Object.prototype.toString,LO=typeof Blob=="function"||typeof Blob<"u"&&ov.call(Blob)==="[object BlobConstructor]",BO=typeof File=="function"||typeof File<"u"&&ov.call(File)==="[object FileConstructor]";function kf(e){return MO&&(e instanceof ArrayBuffer||FO(e))||LO&&e instanceof Blob||BO&&e instanceof File}function Zs(e,r){if(!e||typeof e!="object")return!1;if(Array.isArray(e)){for(let i=0,s=e.length;i<s;i++)if(Zs(e[i]))return!0;return!1}if(kf(e))return!0;if(e.toJSON&&typeof e.toJSON=="function"&&arguments.length===1)return Zs(e.toJSON(),!0);for(const i in e)if(Object.prototype.hasOwnProperty.call(e,i)&&Zs(e[i]))return!0;return!1}function jO(e){const r=[],i=e.data,s=e;return s.data=Uc(i,r),s.attachments=r.length,{packet:s,buffers:r}}function Uc(e,r){if(!e)return e;if(kf(e)){const i={_placeholder:!0,num:r.length};return r.push(e),i}else if(Array.isArray(e)){const i=new Array(e.length);for(let s=0;s<e.length;s++)i[s]=Uc(e[s],r);return i}else if(typeof e=="object"&&!(e instanceof Date)){const i={};for(const s in e)Object.prototype.hasOwnProperty.call(e,s)&&(i[s]=Uc(e[s],r));return i}return e}function UO(e,r){return e.data=Hc(e.data,r),delete e.attachments,e}function Hc(e,r){if(!e)return e;if(e&&e._placeholder===!0){if(typeof e.num=="number"&&e.num>=0&&e.num<r.length)return r[e.num];throw new Error("illegal attachments")}else if(Array.isArray(e))for(let i=0;i<e.length;i++)e[i]=Hc(e[i],r);else if(typeof e=="object")for(const i in e)Object.prototype.hasOwnProperty.call(e,i)&&(e[i]=Hc(e[i],r));return e}const HO=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"],zO=5;var Ee;(function(e){e[e.CONNECT=0]="CONNECT",e[e.DISCONNECT=1]="DISCONNECT",e[e.EVENT=2]="EVENT",e[e.ACK=3]="ACK",e[e.CONNECT_ERROR=4]="CONNECT_ERROR",e[e.BINARY_EVENT=5]="BINARY_EVENT",e[e.BINARY_ACK=6]="BINARY_ACK"})(Ee||(Ee={}));class GO{constructor(r){this.replacer=r}encode(r){return(r.type===Ee.EVENT||r.type===Ee.ACK)&&Zs(r)?this.encodeAsBinary({type:r.type===Ee.EVENT?Ee.BINARY_EVENT:Ee.BINARY_ACK,nsp:r.nsp,data:r.data,id:r.id}):[this.encodeAsString(r)]}encodeAsString(r){let i=""+r.type;return(r.type===Ee.BINARY_EVENT||r.type===Ee.BINARY_ACK)&&(i+=r.attachments+"-"),r.nsp&&r.nsp!=="/"&&(i+=r.nsp+","),r.id!=null&&(i+=r.id),r.data!=null&&(i+=JSON.stringify(r.data,this.replacer)),i}encodeAsBinary(r){const i=jO(r),s=this.encodeAsString(i.packet),l=i.buffers;return l.unshift(s),l}}function J0(e){return Object.prototype.toString.call(e)==="[object Object]"}class Rf extends We{constructor(r){super(),this.reviver=r}add(r){let i;if(typeof r=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");i=this.decodeString(r);const s=i.type===Ee.BINARY_EVENT;s||i.type===Ee.BINARY_ACK?(i.type=s?Ee.EVENT:Ee.ACK,this.reconstructor=new $O(i),i.attachments===0&&super.emitReserved("decoded",i)):super.emitReserved("decoded",i)}else if(kf(r)||r.base64)if(this.reconstructor)i=this.reconstructor.takeBinaryData(r),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: "+r)}decodeString(r){let i=0;const s={type:Number(r.charAt(0))};if(Ee[s.type]===void 0)throw new Error("unknown packet type "+s.type);if(s.type===Ee.BINARY_EVENT||s.type===Ee.BINARY_ACK){const u=i+1;for(;r.charAt(++i)!=="-"&&i!=r.length;);const f=r.substring(u,i);if(f!=Number(f)||r.charAt(i)!=="-")throw new Error("Illegal attachments");s.attachments=Number(f)}if(r.charAt(i+1)==="/"){const u=i+1;for(;++i&&!(r.charAt(i)===","||i===r.length););s.nsp=r.substring(u,i)}else s.nsp="/";const l=r.charAt(i+1);if(l!==""&&Number(l)==l){const u=i+1;for(;++i;){const f=r.charAt(i);if(f==null||Number(f)!=f){--i;break}if(i===r.length)break}s.id=Number(r.substring(u,i+1))}if(r.charAt(++i)){const u=this.tryParse(r.substr(i));if(Rf.isPayloadValid(s.type,u))s.data=u;else throw new Error("invalid payload")}return s}tryParse(r){try{return JSON.parse(r,this.reviver)}catch{return!1}}static isPayloadValid(r,i){switch(r){case Ee.CONNECT:return J0(i);case Ee.DISCONNECT:return i===void 0;case Ee.CONNECT_ERROR:return typeof i=="string"||J0(i);case Ee.EVENT:case Ee.BINARY_EVENT:return Array.isArray(i)&&(typeof i[0]=="number"||typeof i[0]=="string"&&HO.indexOf(i[0])===-1);case Ee.ACK:case Ee.BINARY_ACK:return Array.isArray(i)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class $O{constructor(r){this.packet=r,this.buffers=[],this.reconPack=r}takeBinaryData(r){if(this.buffers.push(r),this.buffers.length===this.reconPack.attachments){const i=UO(this.reconPack,this.buffers);return this.finishedReconstruction(),i}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const VO=Object.freeze(Object.defineProperty({__proto__:null,Decoder:Rf,Encoder:GO,get PacketType(){return Ee},protocol:zO},Symbol.toStringTag,{value:"Module"}));function Xt(e,r,i){return e.on(r,i),function(){e.off(r,i)}}const qO=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class sv extends We{constructor(r,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=r,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 r=this.io;this.subs=[Xt(r,"open",this.onopen.bind(this)),Xt(r,"packet",this.onpacket.bind(this)),Xt(r,"error",this.onerror.bind(this)),Xt(r,"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(...r){return r.unshift("message"),this.emit.apply(this,r),this}emit(r,...i){var s,l,u;if(qO.hasOwnProperty(r))throw new Error('"'+r.toString()+'" is a reserved event name');if(i.unshift(r),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(i),this;const f={type:Ee.EVENT,data:i};if(f.options={},f.options.compress=this.flags.compress!==!1,typeof i[i.length-1]=="function"){const y=this.ids++,x=i.pop();this._registerAckCallback(y,x),f.id=y}const h=(l=(s=this.io.engine)===null||s===void 0?void 0:s.transport)===null||l===void 0?void 0:l.writable,p=this.connected&&!(!((u=this.io.engine)===null||u===void 0)&&u._hasPingExpired());return this.flags.volatile&&!h||(p?(this.notifyOutgoingListeners(f),this.packet(f)):this.sendBuffer.push(f)),this.flags={},this}_registerAckCallback(r,i){var s;const l=(s=this.flags.timeout)!==null&&s!==void 0?s:this._opts.ackTimeout;if(l===void 0){this.acks[r]=i;return}const u=this.io.setTimeoutFn(()=>{delete this.acks[r];for(let h=0;h<this.sendBuffer.length;h++)this.sendBuffer[h].id===r&&this.sendBuffer.splice(h,1);i.call(this,new Error("operation has timed out"))},l),f=(...h)=>{this.io.clearTimeoutFn(u),i.apply(this,h)};f.withError=!0,this.acks[r]=f}emitWithAck(r,...i){return new Promise((s,l)=>{const u=(f,h)=>f?l(f):s(h);u.withError=!0,i.push(u),this.emit(r,...i)})}_addToQueue(r){let i;typeof r[r.length-1]=="function"&&(i=r.pop());const s={id:this._queueSeq++,tryCount:0,pending:!1,args:r,flags:Object.assign({fromQueue:!0},this.flags)};r.push((l,...u)=>s!==this._queue[0]?void 0:(l!==null?s.tryCount>this._opts.retries&&(this._queue.shift(),i&&i(l)):(this._queue.shift(),i&&i(null,...u)),s.pending=!1,this._drainQueue())),this._queue.push(s),this._drainQueue()}_drainQueue(r=!1){if(!this.connected||this._queue.length===0)return;const i=this._queue[0];i.pending&&!r||(i.pending=!0,i.tryCount++,this.flags=i.flags,this.emit.apply(this,i.args))}packet(r){r.nsp=this.nsp,this.io._packet(r)}onopen(){typeof this.auth=="function"?this.auth(r=>{this._sendConnectPacket(r)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(r){this.packet({type:Ee.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},r):r})}onerror(r){this.connected||this.emitReserved("connect_error",r)}onclose(r,i){this.connected=!1,delete this.id,this.emitReserved("disconnect",r,i),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(r=>{if(!this.sendBuffer.some(s=>String(s.id)===r)){const s=this.acks[r];delete this.acks[r],s.withError&&s.call(this,new Error("socket has been disconnected"))}})}onpacket(r){if(r.nsp===this.nsp)switch(r.type){case Ee.CONNECT:r.data&&r.data.sid?this.onconnect(r.data.sid,r.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 Ee.EVENT:case Ee.BINARY_EVENT:this.onevent(r);break;case Ee.ACK:case Ee.BINARY_ACK:this.onack(r);break;case Ee.DISCONNECT:this.ondisconnect();break;case Ee.CONNECT_ERROR:this.destroy();const s=new Error(r.data.message);s.data=r.data.data,this.emitReserved("connect_error",s);break}}onevent(r){const i=r.data||[];r.id!=null&&i.push(this.ack(r.id)),this.connected?this.emitEvent(i):this.receiveBuffer.push(Object.freeze(i))}emitEvent(r){if(this._anyListeners&&this._anyListeners.length){const i=this._anyListeners.slice();for(const s of i)s.apply(this,r)}super.emit.apply(this,r),this._pid&&r.length&&typeof r[r.length-1]=="string"&&(this._lastOffset=r[r.length-1])}ack(r){const i=this;let s=!1;return function(...l){s||(s=!0,i.packet({type:Ee.ACK,id:r,data:l}))}}onack(r){const i=this.acks[r.id];typeof i=="function"&&(delete this.acks[r.id],i.withError&&r.data.unshift(null),i.apply(this,r.data))}onconnect(r,i){this.id=r,this.recovered=i&&this._pid===i,this._pid=i,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this._drainQueue(!0)}emitBuffered(){this.receiveBuffer.forEach(r=>this.emitEvent(r)),this.receiveBuffer=[],this.sendBuffer.forEach(r=>{this.notifyOutgoingListeners(r),this.packet(r)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(r=>r()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:Ee.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(r){return this.flags.compress=r,this}get volatile(){return this.flags.volatile=!0,this}timeout(r){return this.flags.timeout=r,this}onAny(r){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(r),this}prependAny(r){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(r),this}offAny(r){if(!this._anyListeners)return this;if(r){const i=this._anyListeners;for(let s=0;s<i.length;s++)if(r===i[s])return i.splice(s,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(r){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(r),this}prependAnyOutgoing(r){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(r),this}offAnyOutgoing(r){if(!this._anyOutgoingListeners)return this;if(r){const i=this._anyOutgoingListeners;for(let s=0;s<i.length;s++)if(r===i[s])return i.splice(s,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(r){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const i=this._anyOutgoingListeners.slice();for(const s of i)s.apply(this,r.data)}}}function ti(e){e=e||{},this.ms=e.min||100,this.max=e.max||1e4,this.factor=e.factor||2,this.jitter=e.jitter>0&&e.jitter<=1?e.jitter:0,this.attempts=0}ti.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var r=Math.random(),i=Math.floor(r*this.jitter*e);e=Math.floor(r*10)&1?e+i:e-i}return Math.min(e,this.max)|0};ti.prototype.reset=function(){this.attempts=0};ti.prototype.setMin=function(e){this.ms=e};ti.prototype.setMax=function(e){this.max=e};ti.prototype.setJitter=function(e){this.jitter=e};class zc extends We{constructor(r,i){var s;super(),this.nsps={},this.subs=[],r&&typeof r=="object"&&(i=r,r=void 0),i=i||{},i.path=i.path||"/socket.io",this.opts=i,ga(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 ti({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(i.timeout==null?2e4:i.timeout),this._readyState="closed",this.uri=r;const l=i.parser||VO;this.encoder=new l.Encoder,this.decoder=new l.Decoder,this._autoConnect=i.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(r){return arguments.length?(this._reconnection=!!r,r||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(r){return r===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=r,this)}reconnectionDelay(r){var i;return r===void 0?this._reconnectionDelay:(this._reconnectionDelay=r,(i=this.backoff)===null||i===void 0||i.setMin(r),this)}randomizationFactor(r){var i;return r===void 0?this._randomizationFactor:(this._randomizationFactor=r,(i=this.backoff)===null||i===void 0||i.setJitter(r),this)}reconnectionDelayMax(r){var i;return r===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=r,(i=this.backoff)===null||i===void 0||i.setMax(r),this)}timeout(r){return arguments.length?(this._timeout=r,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(r){if(~this._readyState.indexOf("open"))return this;this.engine=new DO(this.uri,this.opts);const i=this.engine,s=this;this._readyState="opening",this.skipReconnect=!1;const l=Xt(i,"open",function(){s.onopen(),r&&r()}),u=h=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",h),r?r(h):this.maybeReconnectOnOpen()},f=Xt(i,"error",u);if(this._timeout!==!1){const h=this._timeout,p=this.setTimeoutFn(()=>{l(),u(new Error("timeout")),i.close()},h);this.opts.autoUnref&&p.unref(),this.subs.push(()=>{this.clearTimeoutFn(p)})}return this.subs.push(l),this.subs.push(f),this}connect(r){return this.open(r)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const r=this.engine;this.subs.push(Xt(r,"ping",this.onping.bind(this)),Xt(r,"data",this.ondata.bind(this)),Xt(r,"error",this.onerror.bind(this)),Xt(r,"close",this.onclose.bind(this)),Xt(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(r){try{this.decoder.add(r)}catch(i){this.onclose("parse error",i)}}ondecoded(r){ma(()=>{this.emitReserved("packet",r)},this.setTimeoutFn)}onerror(r){this.emitReserved("error",r)}socket(r,i){let s=this.nsps[r];return s?this._autoConnect&&!s.active&&s.connect():(s=new sv(this,r,i),this.nsps[r]=s),s}_destroy(r){const i=Object.keys(this.nsps);for(const s of i)if(this.nsps[s].active)return;this._close()}_packet(r){const i=this.encoder.encode(r);for(let s=0;s<i.length;s++)this.engine.write(i[s],r.options)}cleanup(){this.subs.forEach(r=>r()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(r,i){var s;this.cleanup(),(s=this.engine)===null||s===void 0||s.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",r,i),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const r=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(()=>{r.skipReconnect||(this.emitReserved("reconnect_attempt",r.backoff.attempts),!r.skipReconnect&&r.open(l=>{l?(r._reconnecting=!1,r.reconnect(),this.emitReserved("reconnect_error",l)):r.onreconnect()}))},i);this.opts.autoUnref&&s.unref(),this.subs.push(()=>{this.clearTimeoutFn(s)})}}onreconnect(){const r=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",r)}}const Qi={};function Qs(e,r){typeof e=="object"&&(r=e,e=void 0),r=r||{};const i=PO(e,r.path||"/socket.io"),s=i.source,l=i.id,u=i.path,f=Qi[l]&&u in Qi[l].nsps,h=r.forceNew||r["force new connection"]||r.multiplex===!1||f;let p;return h?p=new zc(s,r):(Qi[l]||(Qi[l]=new zc(s,r)),p=Qi[l]),i.query&&!r.query&&(r.query=i.queryKey),p.socket(i.path,r)}Object.assign(Qs,{Manager:zc,Socket:sv,io:Qs,connect:Qs});const WO=[ge.ActionTypes.MESSAGE_TO_GUEST,ge.ActionTypes.EVENT_TO_GUEST,ge.ActionTypes.TYPING_ON,ge.ActionTypes.TYPING_OFF,ge.ActionTypes.RESTART_CHAT_REQUEST,...Bb,...OS,"@@localize/SET_ACTIVE_LANGUAGE","@@localize/ADD_TRANSLATION_FOR_LANGUAGE"],ZO=({dispatch:e,getState:r})=>i=>{let s=null;return l=>{const u=i(l);if(l.type===mf){s!=null&&s.disconnect(),e(Hb());const f=`/chat?${oa.stringify(l.querystrings)}`;s=Qs(`/${l.clientName}${f}`),s.on("action",e),s.on("connect",()=>e(zb())),s.on("disconnect",()=>e(Gb())),s.on("reconnect",()=>e($b())),s.on("set-use-start-screen",h=>{e(h?Cb():kb())}),s.on("set-commands",(h=[])=>{e(FS(h))}),s.on("set-translations",(h,p)=>{e(WR({language:h,messages:HR(h,p)}))}),s.on("enable-speech-support",()=>e(AS())),s.on("enable-transcript-export",h=>e(DS(h))),s.on("enable-conversation-rating",h=>e(BS(h))),s.on("speech-transcription",h=>e(IS(h))),s.on("restore-client-state",h=>{e(Ub(h.sessionId)),e(US(h.messages))}),s.on("expand-window",({devices:h})=>e({type:qg,devices:h})),s.on("show-general-conditions",()=>e(MS())),s.on("restart-chat",()=>{e(da(l.clientName,l.querystrings))})}else if(l.type===ca)s==null||s.emit("start-chat",l.payload);else if(l.type===fa)s==null||s.emit("terminate-session",l.payload);else if(l.type===RS)s==null||s.emit("get-started",JSON.stringify(l));else if(l.type===nf)s==null||s.emit("audio-message",l.buffer);else if(l.type===ge.ActionTypes.CONVERSATION_RATING_FROM_GUEST)s==null||s.emit("conversation-rating",l.payload);else if(l.type===Zg){const{connection:{sessionId:f}}=r();window.location.href=`/transcript-pdf/${f}`}else WO.indexOf(l.type)===-1&&l.meta===void 0&&s&&s.emit("action",JSON.stringify(l));return u}},av=By(),QO={...KR(av),intl:$y},Gc=hb({middleware:e=>e().concat(ZO),reducer:QR,preloadedState:QO});Gc.subscribe(PR(()=>{const e=Gc.getState();XR(av,{connection:e.connection,startScreen:e.startScreen})},1e3));const KO=document.getElementById("root"),XO=p1.createRoot(KO);XO.render(E.jsx(fE,{store:Gc,children:E.jsx(ER,{})}));
110
- //# sourceMappingURL=index-u316xvpC.js.map
110
+ //# sourceMappingURL=index-CV76okgW.js.map