@seamly/web-ui 23.0.0-alpha.2 → 23.0.0-alpha.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/dist/lib/components.js +58 -75
- package/build/dist/lib/components.js.map +1 -1
- package/build/dist/lib/components.min.js +1 -1
- package/build/dist/lib/components.min.js.map +1 -1
- package/build/dist/lib/hooks.js +55 -72
- package/build/dist/lib/hooks.js.map +1 -1
- package/build/dist/lib/hooks.min.js +1 -1
- package/build/dist/lib/hooks.min.js.map +1 -1
- package/build/dist/lib/index.debug.js +8 -8
- package/build/dist/lib/index.debug.min.js +1 -1
- package/build/dist/lib/index.debug.min.js.map +1 -1
- package/build/dist/lib/index.js +42 -63
- package/build/dist/lib/index.js.map +1 -1
- package/build/dist/lib/index.min.js +1 -1
- package/build/dist/lib/index.min.js.map +1 -1
- package/build/dist/lib/standalone.js +52 -74
- package/build/dist/lib/standalone.js.map +1 -1
- package/build/dist/lib/standalone.min.js +1 -1
- package/build/dist/lib/standalone.min.js.map +1 -1
- package/build/dist/lib/style-guide.js +51 -68
- package/build/dist/lib/style-guide.js.map +1 -1
- package/build/dist/lib/style-guide.min.js +1 -1
- package/build/dist/lib/style-guide.min.js.map +1 -1
- package/build/dist/lib/utils.js +63 -99
- package/build/dist/lib/utils.js.map +1 -1
- package/build/dist/lib/utils.min.js +1 -1
- package/build/dist/lib/utils.min.js.map +1 -1
- package/package.json +1 -1
- package/src/javascripts/api/index.ts +2 -18
- package/src/javascripts/domains/config/actions.ts +3 -0
- package/src/javascripts/domains/config/slice.ts +3 -0
- package/src/javascripts/domains/i18n/slice.ts +1 -1
- package/src/javascripts/domains/translations/components/options-dialog/translation-options.tsx +1 -1
- package/src/javascripts/domains/translations/hooks.ts +1 -1
- package/src/javascripts/domains/translations/middleware.ts +4 -10
- package/src/javascripts/domains/translations/slice.ts +2 -2
- package/src/javascripts/style-guide/states.js +4 -0
- package/src/javascripts/style-guide/style-guide-engine.js +1 -1
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/*! For license information please see utils.min.js.LICENSE.txt */
|
|
2
|
-
(()=>{var e={8412:(e,t,n)=>{"use strict";n.d(t,{c:()=>P});var r,s,o,i,a=e=>"function"==typeof e?e:function(){return e},c="undefined"!=typeof self?self:null,l="undefined"!=typeof window?window:null,u=c||l||u,d="closed",p="errored",h="joined",f="joining",m="leaving",v="phx_close",g="phx_error",y="phx_reply",b="phx_leave",w="websocket",x=class{constructor(e,t,n,r){this.channel=e,this.event=t,this.payload=n||function(){return{}},this.receivedResp=null,this.timeout=r,this.timeoutTimer=null,this.recHooks=[],this.sent=!1}resend(e){this.timeout=e,this.reset(),this.send()}send(){this.hasReceived("timeout")||(this.startTimeout(),this.sent=!0,this.channel.socket.push({topic:this.channel.topic,event:this.event,payload:this.payload(),ref:this.ref,join_ref:this.channel.joinRef()}))}receive(e,t){return this.hasReceived(e)&&t(this.receivedResp.response),this.recHooks.push({status:e,callback:t}),this}reset(){this.cancelRefEvent(),this.ref=null,this.refEvent=null,this.receivedResp=null,this.sent=!1}matchReceive({status:e,response:t,_ref:n}){this.recHooks.filter((t=>t.status===e)).forEach((e=>e.callback(t)))}cancelRefEvent(){this.refEvent&&this.channel.off(this.refEvent)}cancelTimeout(){clearTimeout(this.timeoutTimer),this.timeoutTimer=null}startTimeout(){this.timeoutTimer&&this.cancelTimeout(),this.ref=this.channel.socket.makeRef(),this.refEvent=this.channel.replyEventName(this.ref),this.channel.on(this.refEvent,(e=>{this.cancelRefEvent(),this.cancelTimeout(),this.receivedResp=e,this.matchReceive(e)})),this.timeoutTimer=setTimeout((()=>{this.trigger("timeout",{})}),this.timeout)}hasReceived(e){return this.receivedResp&&this.receivedResp.status===e}trigger(e,t){this.channel.trigger(this.refEvent,{status:e,response:t})}},C=class{constructor(e,t){this.callback=e,this.timerCalc=t,this.timer=null,this.tries=0}reset(){this.tries=0,clearTimeout(this.timer)}scheduleTimeout(){clearTimeout(this.timer),this.timer=setTimeout((()=>{this.tries=this.tries+1,this.callback()}),this.timerCalc(this.tries+1))}},_=class{constructor(e,t,n){this.state=d,this.topic=e,this.params=a(t||{}),this.socket=n,this.bindings=[],this.bindingRef=0,this.timeout=this.socket.timeout,this.joinedOnce=!1,this.joinPush=new x(this,"phx_join",this.params,this.timeout),this.pushBuffer=[],this.stateChangeRefs=[],this.rejoinTimer=new C((()=>{this.socket.isConnected()&&this.rejoin()}),this.socket.rejoinAfterMs),this.stateChangeRefs.push(this.socket.onError((()=>this.rejoinTimer.reset()))),this.stateChangeRefs.push(this.socket.onOpen((()=>{this.rejoinTimer.reset(),this.isErrored()&&this.rejoin()}))),this.joinPush.receive("ok",(()=>{this.state=h,this.rejoinTimer.reset(),this.pushBuffer.forEach((e=>e.send())),this.pushBuffer=[]})),this.joinPush.receive("error",(()=>{this.state=p,this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()})),this.onClose((()=>{this.rejoinTimer.reset(),this.socket.hasLogger()&&this.socket.log("channel",`close ${this.topic} ${this.joinRef()}`),this.state=d,this.socket.remove(this)})),this.onError((e=>{this.socket.hasLogger()&&this.socket.log("channel",`error ${this.topic}`,e),this.isJoining()&&this.joinPush.reset(),this.state=p,this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()})),this.joinPush.receive("timeout",(()=>{this.socket.hasLogger()&&this.socket.log("channel",`timeout ${this.topic} (${this.joinRef()})`,this.joinPush.timeout),new x(this,b,a({}),this.timeout).send(),this.state=p,this.joinPush.reset(),this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()})),this.on(y,((e,t)=>{this.trigger(this.replyEventName(t),e)}))}join(e=this.timeout){if(this.joinedOnce)throw new Error("tried to join multiple times. 'join' can only be called a single time per channel instance");return this.timeout=e,this.joinedOnce=!0,this.rejoin(),this.joinPush}onClose(e){this.on(v,e)}onError(e){return this.on(g,(t=>e(t)))}on(e,t){let n=this.bindingRef++;return this.bindings.push({event:e,ref:n,callback:t}),n}off(e,t){this.bindings=this.bindings.filter((n=>!(n.event===e&&(void 0===t||t===n.ref))))}canPush(){return this.socket.isConnected()&&this.isJoined()}push(e,t,n=this.timeout){if(t=t||{},!this.joinedOnce)throw new Error(`tried to push '${e}' to '${this.topic}' before joining. Use channel.join() before pushing events`);let r=new x(this,e,(function(){return t}),n);return this.canPush()?r.send():(r.startTimeout(),this.pushBuffer.push(r)),r}leave(e=this.timeout){this.rejoinTimer.reset(),this.joinPush.cancelTimeout(),this.state=m;let t=()=>{this.socket.hasLogger()&&this.socket.log("channel",`leave ${this.topic}`),this.trigger(v,"leave")},n=new x(this,b,a({}),e);return n.receive("ok",(()=>t())).receive("timeout",(()=>t())),n.send(),this.canPush()||n.trigger("ok",{}),n}onMessage(e,t,n){return t}isMember(e,t,n,r){return!(this.topic!==e||r&&r!==this.joinRef()&&(this.socket.hasLogger()&&this.socket.log("channel","dropping outdated message",{topic:e,event:t,payload:n,joinRef:r}),1))}joinRef(){return this.joinPush.ref}rejoin(e=this.timeout){this.isLeaving()||(this.socket.leaveOpenTopic(this.topic),this.state=f,this.joinPush.resend(e))}trigger(e,t,n,r){let s=this.onMessage(e,t,n,r);if(t&&!s)throw new Error("channel onMessage callbacks must return the payload, modified or unmodified");let o=this.bindings.filter((t=>t.event===e));for(let e=0;e<o.length;e++)o[e].callback(s,n,r||this.joinRef())}replyEventName(e){return`chan_reply_${e}`}isClosed(){return this.state===d}isErrored(){return this.state===p}isJoined(){return this.state===h}isJoining(){return this.state===f}isLeaving(){return this.state===m}},j=class{static request(e,t,n,r,s,o,i){if(u.XDomainRequest){let n=new u.XDomainRequest;return this.xdomainRequest(n,e,t,r,s,o,i)}{let a=new u.XMLHttpRequest;return this.xhrRequest(a,e,t,n,r,s,o,i)}}static xdomainRequest(e,t,n,r,s,o,i){return e.timeout=s,e.open(t,n),e.onload=()=>{let t=this.parseJSON(e.responseText);i&&i(t)},o&&(e.ontimeout=o),e.onprogress=()=>{},e.send(r),e}static xhrRequest(e,t,n,r,s,o,i,a){return e.open(t,n,!0),e.timeout=o,e.setRequestHeader("Content-Type",r),e.onerror=()=>a&&a(null),e.onreadystatechange=()=>{if(4===e.readyState&&a){let t=this.parseJSON(e.responseText);a(t)}},i&&(e.ontimeout=i),e.send(s),e}static parseJSON(e){if(!e||""===e)return null;try{return JSON.parse(e)}catch(t){return console&&console.log("failed to parse JSON response",e),null}}static serialize(e,t){let n=[];for(var r in e){if(!Object.prototype.hasOwnProperty.call(e,r))continue;let s=t?`${t}[${r}]`:r,o=e[r];"object"==typeof o?n.push(this.serialize(o,s)):n.push(encodeURIComponent(s)+"="+encodeURIComponent(o))}return n.join("&")}static appendParams(e,t){if(0===Object.keys(t).length)return e;let n=e.match(/\?/)?"&":"?";return`${e}${n}${this.serialize(t)}`}},E=class{constructor(e){this.endPoint=null,this.token=null,this.skipHeartbeat=!0,this.reqs=new Set,this.awaitingBatchAck=!1,this.currentBatch=null,this.currentBatchTimer=null,this.batchBuffer=[],this.onopen=function(){},this.onerror=function(){},this.onmessage=function(){},this.onclose=function(){},this.pollEndpoint=this.normalizeEndpoint(e),this.readyState=0,setTimeout((()=>this.poll()),0)}normalizeEndpoint(e){return e.replace("ws://","http://").replace("wss://","https://").replace(new RegExp("(.*)/"+w),"$1/longpoll")}endpointURL(){return j.appendParams(this.pollEndpoint,{token:this.token})}closeAndRetry(e,t,n){this.close(e,t,n),this.readyState=0}ontimeout(){this.onerror("timeout"),this.closeAndRetry(1005,"timeout",!1)}isActive(){return 1===this.readyState||0===this.readyState}poll(){this.ajax("GET","application/json",null,(()=>this.ontimeout()),(e=>{if(e){var{status:t,token:n,messages:r}=e;this.token=n}else t=0;switch(t){case 200:r.forEach((e=>{setTimeout((()=>this.onmessage({data:e})),0)})),this.poll();break;case 204:this.poll();break;case 410:this.readyState=1,this.onopen({}),this.poll();break;case 403:this.onerror(403),this.close(1008,"forbidden",!1);break;case 0:case 500:this.onerror(500),this.closeAndRetry(1011,"internal server error",500);break;default:throw new Error(`unhandled poll status ${t}`)}}))}send(e){"string"!=typeof e&&(e=(e=>{let t="",n=new Uint8Array(e),r=n.byteLength;for(let e=0;e<r;e++)t+=String.fromCharCode(n[e]);return btoa(t)})(e)),this.currentBatch?this.currentBatch.push(e):this.awaitingBatchAck?this.batchBuffer.push(e):(this.currentBatch=[e],this.currentBatchTimer=setTimeout((()=>{this.batchSend(this.currentBatch),this.currentBatch=null}),0))}batchSend(e){this.awaitingBatchAck=!0,this.ajax("POST","application/x-ndjson",e.join("\n"),(()=>this.onerror("timeout")),(e=>{this.awaitingBatchAck=!1,e&&200===e.status?this.batchBuffer.length>0&&(this.batchSend(this.batchBuffer),this.batchBuffer=[]):(this.onerror(e&&e.status),this.closeAndRetry(1011,"internal server error",!1))}))}close(e,t,n){for(let e of this.reqs)e.abort();this.readyState=3;let r=Object.assign({code:1e3,reason:void 0,wasClean:!0},{code:e,reason:t,wasClean:n});this.batchBuffer=[],clearTimeout(this.currentBatchTimer),this.currentBatchTimer=null,"undefined"!=typeof CloseEvent?this.onclose(new CloseEvent("close",r)):this.onclose(r)}ajax(e,t,n,r,s){let o;o=j.request(e,this.endpointURL(),t,n,this.timeout,(()=>{this.reqs.delete(o),r()}),(e=>{this.reqs.delete(o),this.isActive()&&s(e)})),this.reqs.add(o)}},S={HEADER_LENGTH:1,META_LENGTH:4,KINDS:{push:0,reply:1,broadcast:2},encode(e,t){if(e.payload.constructor===ArrayBuffer)return t(this.binaryEncode(e));{let n=[e.join_ref,e.ref,e.topic,e.event,e.payload];return t(JSON.stringify(n))}},decode(e,t){if(e.constructor===ArrayBuffer)return t(this.binaryDecode(e));{let[n,r,s,o,i]=JSON.parse(e);return t({join_ref:n,ref:r,topic:s,event:o,payload:i})}},binaryEncode(e){let{join_ref:t,ref:n,event:r,topic:s,payload:o}=e,i=this.META_LENGTH+t.length+n.length+s.length+r.length,a=new ArrayBuffer(this.HEADER_LENGTH+i),c=new DataView(a),l=0;c.setUint8(l++,this.KINDS.push),c.setUint8(l++,t.length),c.setUint8(l++,n.length),c.setUint8(l++,s.length),c.setUint8(l++,r.length),Array.from(t,(e=>c.setUint8(l++,e.charCodeAt(0)))),Array.from(n,(e=>c.setUint8(l++,e.charCodeAt(0)))),Array.from(s,(e=>c.setUint8(l++,e.charCodeAt(0)))),Array.from(r,(e=>c.setUint8(l++,e.charCodeAt(0))));var u=new Uint8Array(a.byteLength+o.byteLength);return u.set(new Uint8Array(a),0),u.set(new Uint8Array(o),a.byteLength),u.buffer},binaryDecode(e){let t=new DataView(e),n=t.getUint8(0),r=new TextDecoder;switch(n){case this.KINDS.push:return this.decodePush(e,t,r);case this.KINDS.reply:return this.decodeReply(e,t,r);case this.KINDS.broadcast:return this.decodeBroadcast(e,t,r)}},decodePush(e,t,n){let r=t.getUint8(1),s=t.getUint8(2),o=t.getUint8(3),i=this.HEADER_LENGTH+this.META_LENGTH-1,a=n.decode(e.slice(i,i+r));i+=r;let c=n.decode(e.slice(i,i+s));i+=s;let l=n.decode(e.slice(i,i+o));return i+=o,{join_ref:a,ref:null,topic:c,event:l,payload:e.slice(i,e.byteLength)}},decodeReply(e,t,n){let r=t.getUint8(1),s=t.getUint8(2),o=t.getUint8(3),i=t.getUint8(4),a=this.HEADER_LENGTH+this.META_LENGTH,c=n.decode(e.slice(a,a+r));a+=r;let l=n.decode(e.slice(a,a+s));a+=s;let u=n.decode(e.slice(a,a+o));a+=o;let d=n.decode(e.slice(a,a+i));a+=i;let p=e.slice(a,e.byteLength);return{join_ref:c,ref:l,topic:u,event:y,payload:{status:d,response:p}}},decodeBroadcast(e,t,n){let r=t.getUint8(1),s=t.getUint8(2),o=this.HEADER_LENGTH+2,i=n.decode(e.slice(o,o+r));o+=r;let a=n.decode(e.slice(o,o+s));return o+=s,{join_ref:null,ref:null,topic:i,event:a,payload:e.slice(o,e.byteLength)}}},T=class{constructor(e,t={}){this.stateChangeCallbacks={open:[],close:[],error:[],message:[]},this.channels=[],this.sendBuffer=[],this.ref=0,this.timeout=t.timeout||1e4,this.transport=t.transport||u.WebSocket||E,this.longPollFallbackMs=t.longPollFallbackMs,this.fallbackTimer=null,this.sessionStore=t.sessionStorage||u.sessionStorage,this.establishedConnections=0,this.defaultEncoder=S.encode.bind(S),this.defaultDecoder=S.decode.bind(S),this.closeWasClean=!1,this.binaryType=t.binaryType||"arraybuffer",this.connectClock=1,this.transport!==E?(this.encode=t.encode||this.defaultEncoder,this.decode=t.decode||this.defaultDecoder):(this.encode=this.defaultEncoder,this.decode=this.defaultDecoder);let n=null;l&&l.addEventListener&&(l.addEventListener("pagehide",(e=>{this.conn&&(this.disconnect(),n=this.connectClock)})),l.addEventListener("pageshow",(e=>{n===this.connectClock&&(n=null,this.connect())}))),this.heartbeatIntervalMs=t.heartbeatIntervalMs||3e4,this.rejoinAfterMs=e=>t.rejoinAfterMs?t.rejoinAfterMs(e):[1e3,2e3,5e3][e-1]||1e4,this.reconnectAfterMs=e=>t.reconnectAfterMs?t.reconnectAfterMs(e):[10,50,100,150,200,250,500,1e3,2e3][e-1]||5e3,this.logger=t.logger||null,!this.logger&&t.debug&&(this.logger=(e,t,n)=>{console.log(`${e}: ${t}`,n)}),this.longpollerTimeout=t.longpollerTimeout||2e4,this.params=a(t.params||{}),this.endPoint=`${e}/${w}`,this.vsn=t.vsn||"2.0.0",this.heartbeatTimeoutTimer=null,this.heartbeatTimer=null,this.pendingHeartbeatRef=null,this.reconnectTimer=new C((()=>{this.teardown((()=>this.connect()))}),this.reconnectAfterMs)}getLongPollTransport(){return E}replaceTransport(e){this.connectClock++,this.closeWasClean=!0,clearTimeout(this.fallbackTimer),this.reconnectTimer.reset(),this.conn&&(this.conn.close(),this.conn=null),this.transport=e}protocol(){return location.protocol.match(/^https/)?"wss":"ws"}endPointURL(){let e=j.appendParams(j.appendParams(this.endPoint,this.params()),{vsn:this.vsn});return"/"!==e.charAt(0)?e:"/"===e.charAt(1)?`${this.protocol()}:${e}`:`${this.protocol()}://${location.host}${e}`}disconnect(e,t,n){this.connectClock++,this.closeWasClean=!0,clearTimeout(this.fallbackTimer),this.reconnectTimer.reset(),this.teardown(e,t,n)}connect(e){e&&(console&&console.log("passing params to connect is deprecated. Instead pass :params to the Socket constructor"),this.params=a(e)),this.conn||(this.longPollFallbackMs&&this.transport!==E?this.connectWithFallback(E,this.longPollFallbackMs):this.transportConnect())}log(e,t,n){this.logger&&this.logger(e,t,n)}hasLogger(){return null!==this.logger}onOpen(e){let t=this.makeRef();return this.stateChangeCallbacks.open.push([t,e]),t}onClose(e){let t=this.makeRef();return this.stateChangeCallbacks.close.push([t,e]),t}onError(e){let t=this.makeRef();return this.stateChangeCallbacks.error.push([t,e]),t}onMessage(e){let t=this.makeRef();return this.stateChangeCallbacks.message.push([t,e]),t}ping(e){if(!this.isConnected())return!1;let t=this.makeRef(),n=Date.now();this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:t});let r=this.onMessage((s=>{s.ref===t&&(this.off([r]),e(Date.now()-n))}));return!0}transportConnect(){this.connectClock++,this.closeWasClean=!1,this.conn=new this.transport(this.endPointURL()),this.conn.binaryType=this.binaryType,this.conn.timeout=this.longpollerTimeout,this.conn.onopen=()=>this.onConnOpen(),this.conn.onerror=e=>this.onConnError(e),this.conn.onmessage=e=>this.onConnMessage(e),this.conn.onclose=e=>this.onConnClose(e)}getSession(e){return this.sessionStore&&this.sessionStore.getItem(e)}storeSession(e,t){this.sessionStore&&this.sessionStore.setItem(e,t)}connectWithFallback(e,t=2500){clearTimeout(this.fallbackTimer);let n,r=!1,s=!0,o=t=>{this.log("transport",`falling back to ${e.name}...`,t),this.off([void 0,n]),s=!1,this.storeSession("phx:longpoll","true"),this.replaceTransport(e),this.transportConnect()};if(this.getSession("phx:longpoll"))return o("memorized");this.fallbackTimer=setTimeout(o,t),n=this.onError((e=>{this.log("transport","error",e),s&&!r&&(clearTimeout(this.fallbackTimer),o(e))})),this.onOpen((()=>{if(r=!0,!s)return console.log("transport",`established ${e.name} fallback`);clearTimeout(this.fallbackTimer),this.fallbackTimer=setTimeout(o,t),this.ping((e=>{this.log("transport","connected to primary after",e),clearTimeout(this.fallbackTimer)}))})),this.transportConnect()}clearHeartbeats(){clearTimeout(this.heartbeatTimer),clearTimeout(this.heartbeatTimeoutTimer)}onConnOpen(){this.hasLogger()&&this.log("transport",`${this.transport.name} connected to ${this.endPointURL()}`),this.closeWasClean=!1,this.establishedConnections++,this.flushSendBuffer(),this.reconnectTimer.reset(),this.resetHeartbeat(),this.stateChangeCallbacks.open.forEach((([,e])=>e()))}heartbeatTimeout(){this.pendingHeartbeatRef&&(this.pendingHeartbeatRef=null,this.hasLogger()&&this.log("transport","heartbeat timeout. Attempting to re-establish connection"),this.triggerChanError(),this.closeWasClean=!1,this.teardown((()=>this.reconnectTimer.scheduleTimeout()),1e3,"heartbeat timeout"))}resetHeartbeat(){this.conn&&this.conn.skipHeartbeat||(this.pendingHeartbeatRef=null,this.clearHeartbeats(),this.heartbeatTimer=setTimeout((()=>this.sendHeartbeat()),this.heartbeatIntervalMs))}teardown(e,t,n){if(!this.conn)return e&&e();this.waitForBufferDone((()=>{this.conn&&(t?this.conn.close(t,n||""):this.conn.close()),this.waitForSocketClosed((()=>{this.conn&&(this.conn.onopen=function(){},this.conn.onerror=function(){},this.conn.onmessage=function(){},this.conn.onclose=function(){},this.conn=null),e&&e()}))}))}waitForBufferDone(e,t=1){5!==t&&this.conn&&this.conn.bufferedAmount?setTimeout((()=>{this.waitForBufferDone(e,t+1)}),150*t):e()}waitForSocketClosed(e,t=1){5!==t&&this.conn&&3!==this.conn.readyState?setTimeout((()=>{this.waitForSocketClosed(e,t+1)}),150*t):e()}onConnClose(e){let t=e&&e.code;this.hasLogger()&&this.log("transport","close",e),this.triggerChanError(),this.clearHeartbeats(),this.closeWasClean||1e3===t||this.reconnectTimer.scheduleTimeout(),this.stateChangeCallbacks.close.forEach((([,t])=>t(e)))}onConnError(e){this.hasLogger()&&this.log("transport",e);let t=this.transport,n=this.establishedConnections;this.stateChangeCallbacks.error.forEach((([,r])=>{r(e,t,n)})),(t===this.transport||n>0)&&this.triggerChanError()}triggerChanError(){this.channels.forEach((e=>{e.isErrored()||e.isLeaving()||e.isClosed()||e.trigger(g)}))}connectionState(){switch(this.conn&&this.conn.readyState){case 0:return"connecting";case 1:return"open";case 2:return"closing";default:return"closed"}}isConnected(){return"open"===this.connectionState()}remove(e){this.off(e.stateChangeRefs),this.channels=this.channels.filter((t=>t.joinRef()!==e.joinRef()))}off(e){for(let t in this.stateChangeCallbacks)this.stateChangeCallbacks[t]=this.stateChangeCallbacks[t].filter((([t])=>-1===e.indexOf(t)))}channel(e,t={}){let n=new _(e,t,this);return this.channels.push(n),n}push(e){if(this.hasLogger()){let{topic:t,event:n,payload:r,ref:s,join_ref:o}=e;this.log("push",`${t} ${n} (${o}, ${s})`,r)}this.isConnected()?this.encode(e,(e=>this.conn.send(e))):this.sendBuffer.push((()=>this.encode(e,(e=>this.conn.send(e)))))}makeRef(){let e=this.ref+1;return e===this.ref?this.ref=0:this.ref=e,this.ref.toString()}sendHeartbeat(){this.pendingHeartbeatRef&&!this.isConnected()||(this.pendingHeartbeatRef=this.makeRef(),this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:this.pendingHeartbeatRef}),this.heartbeatTimeoutTimer=setTimeout((()=>this.heartbeatTimeout()),this.heartbeatIntervalMs))}flushSendBuffer(){this.isConnected()&&this.sendBuffer.length>0&&(this.sendBuffer.forEach((e=>e())),this.sendBuffer=[])}onConnMessage(e){this.decode(e.data,(e=>{let{topic:t,event:n,payload:r,ref:s,join_ref:o}=e;s&&s===this.pendingHeartbeatRef&&(this.clearHeartbeats(),this.pendingHeartbeatRef=null,this.heartbeatTimer=setTimeout((()=>this.sendHeartbeat()),this.heartbeatIntervalMs)),this.hasLogger()&&this.log("receive",`${r.status||""} ${t} ${n} ${s&&"("+s+")"||""}`,r);for(let e=0;e<this.channels.length;e++){const i=this.channels[e];i.isMember(t,n,r,o)&&i.trigger(n,r,s,o)}for(let t=0;t<this.stateChangeCallbacks.message.length;t++){let[,n]=this.stateChangeCallbacks.message[t];n(e)}}))}leaveOpenTopic(e){let t=this.channels.find((t=>t.topic===e&&(t.isJoined()||t.isJoining())));t&&(this.hasLogger()&&this.log("transport",`leaving duplicate topic "${e}"`),t.leave())}},k=n(7548),O=n(5576),N=n.n(O),I=n(5968),U=function(e,t,n,r){if("a"===n&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?r:"a"===n?r.call(e):r?r.value:t.get(e)},A=function(e,t,n,r,s){if("m"===r)throw new TypeError("Private method is not writable");if("a"===r&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!s:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?s.call(e,n):s?s.value=n:t.set(e,n),n};const R=N()("seamly"),M=new Set;s=new WeakMap,r=new WeakSet,o=function(...e){e.forEach((e=>{this.channel.on(e,(t=>{R("[RECEIVE]",e,t)}))}))},i=function(e){A(this,s,U(this,s,"f").filter((t=>!t(e))),"f"),M.forEach((e=>e()))};const P=class{constructor(){r.add(this),s.set(this,[])}connect(e,t,n,s){return a=this,c=void 0,u=function*(){this.url=e,this.accessToken=s,this.channelName=t,this.channelTopic=n;const{url:a,params:c}=(0,I.c)(this.url);this.socket=new T(a,{params:Object.assign(Object.assign({},c),{v:k.kR}),reconnectAfterMs:e=>{const t=250*Math.pow(2,e);return Math.min(t,1e4)}}),this.socket.onError((e=>{R("[SOCKET][ERROR]",e)})),this.socket.onOpen((()=>{R("[SOCKET]OPEN")})),this.socket.onClose((()=>{R("[SOCKET]CLOSE"),U(this,r,"m",i).call(this,{connected:!1,ready:!1,currentState:"socket_closed"})})),this.socket.connect(),this.channel=this.socket.channel(this.channelTopic,{authorization:`Bearer ${this.accessToken}`,channelName:this.channelName}),this.start(),this.channel.on("system",(e=>{"attach_channel_succeeded"===e.type&&U(this,r,"m",i).call(this,{connected:!0,ready:!0,currentState:"attach_channel_succeeded"})})),this.channel.onClose((()=>{R("[CHANNEL]CLOSE"),U(this,r,"m",i).call(this,{connected:!1,ready:!1,currentState:"channel_closed"})})),this.channel.onError((e=>{R("[CHANNEL][ERROR]",e),U(this,r,"m",i).call(this,{connected:!1,ready:!1,currentState:"channel_erred"})})),U(this,r,"m",o).call(this,"ack","ui","error","participant","message","service_data","system","info","sync")},new((l=void 0)||(l=Promise))((function(e,t){function n(e){try{s(u.next(e))}catch(e){t(e)}}function r(e){try{s(u.throw(e))}catch(e){t(e)}}function s(t){var s;t.done?e(t.value):(s=t.value,s instanceof l?s:new l((function(e){e(s)}))).then(n,r)}s((u=u.apply(a,c||[])).next())}));var a,c,l,u}start(){this.channel.join().receive("ok",(()=>{R("[CHANNEL][JOIN] OK"),U(this,r,"m",i).call(this,{connected:!0,ready:!1,currentState:"join_channel_succeeded"})})).receive("error",(e=>{R("[CHANNEL][JOIN] ERROR",e),U(this,r,"m",i).call(this,{connected:!1,ready:!1,currentState:"join_channel_erred"})})).receive("timeout",(()=>{R("[CHANEL][JOIN] Networking issue. Still waiting...")}))}disconnect(){var e;null===(e=this.channel)||void 0===e||e.leave().receive("ok",(()=>{var e;null===(e=this.socket)||void 0===e||e.disconnect(),R("[CHANNEL][LEAVE] OK"),A(this,s,[],"f")}))}onConnection(e){U(this,s,"f").push(e)}pushToChannel(e,t,n=1e4){this.channel.push(e,t,n)}static subscribe(e){return M.add(e),()=>M.delete(e)}}},7548:(e,t,n)=>{"use strict";n.d(t,{Ag:()=>f,GS:()=>a,e:()=>h,es:()=>i,gJ:()=>u,kR:()=>s,kr:()=>o,oP:()=>l,sB:()=>c,uY:()=>p,us:()=>d,wm:()=>r});const r="cvco",s="3",o="seamly-client-participant",i=2e3,a=1e3,c=10,l=15e3,u=50,d=300,p=300,h=2e3,f={namespace:"default",layoutMode:"window",messages:{agent:{showAvatar:!1,showName:!1},user:{showAvatar:!1,showName:!1},timeIndicator:{enabled:!1,threshold:36e5}}}},232:(e,t,n)=>{"use strict";n.d(t,{m:()=>u,C:()=>d});var r=n(3120),s=n(6232),o=n(6280),i=n(712);var a=n(2948),c=n(6244),l=function(e,t,n,r){return new(n||(n=Promise))((function(s,o){function i(e){try{c(r.next(e))}catch(e){o(e)}}function a(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?s(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(i,a)}c((r=r.apply(e,t||[])).next())}))};const u=(0,r.aw)("initializeApp",((e,{extra:{api:t,config:n},rejectWithValue:r})=>l(void 0,void 0,void 0,(function*(){var e,i,a;let l=null===(e=null==n?void 0:n.context)||void 0===e?void 0:e.contentLocale,u=null===(i=null==n?void 0:n.context)||void 0===i?void 0:i.userLocale;const d=!1!==n.api.sendEnvironment?t.getEnvironment():n.api.sendEnvironment;try{if(t.hasConversation()){const e=yield t.getConversationIntitialState();return l=e.context.contentLocale||l,u=e.context.userLocale||u,t.sendContext(Object.assign(Object.assign({},e.context),{environment:d})),{initialState:e,contentLocale:l,userLocale:u,config:n}}return(null===(a=null==n?void 0:n.context)||void 0===a?void 0:a.topic)&&t.send("action",{type:c.w$.setTopic,body:{name:n.context.topic,fallbackMessage:n.context.topic}}),t.sendContext(Object.assign(Object.assign({},n.context),{environment:d})),{initialState:void 0,contentLocale:l,userLocale:u,config:n}}catch(e){if(e instanceof s.c){const e=new s.c;return r({name:e.name,message:e.message,originalEvent:e.originalEvent,originalError:e.originalError,action:e.action})}const t=new o.c;return r({name:t.name,message:t.message,langKey:t.langKey})}})))),d=((e,t,n)=>{const{wait:s=300,maxWait:o=0,leading:i=!1}=null!=n?n:{};let a,c=null,l=null;const u=()=>{clearTimeout(l),l=void 0,a&&(a(!0),a=void 0)};return(0,r.aw)(e,t,{condition:()=>{const e=i&&!c;return clearTimeout(c),c=setTimeout((()=>{u(),c=null}),s),!!e||(a&&(a(!1),a=void 0),o&&!l&&(l=setTimeout(u,o)),new Promise((e=>{a=e})))}})})("resetApp",((e,{dispatch:t,extra:{api:n}})=>l(void 0,void 0,void 0,(function*(){yield n.disconnect(),n.clearStore(),t((0,i.O)()),yield t((0,i.A)()),yield t(u()),t((0,a.i)())}))),{wait:2e3,leading:!0})},1060:(e,t,n)=>{"use strict";n.d(t,{E:()=>r});const r=(0,n(8888).M3)((({app:e})=>e),(({userHasResponded:e})=>e))},428:(e,t,n)=>{"use strict";n.d(t,{N8:()=>a,cp:()=>c});var r=n(3120),s=n(232);const o={userHasResponded:!1},i=(0,r.is)({name:"app",initialState:o,reducers:{setHasResponded:(e,{payload:t})=>{e.userHasResponded=t}},extraReducers:e=>{e.addCase(s.C.pending,(()=>o)).addCase(s.m.fulfilled,((e,{payload:t})=>{var n;t.initialState&&"userResponded"in t.initialState&&(e.userHasResponded=null===(n=t.initialState)||void 0===n?void 0:n.userResponded)}))}}),{setHasResponded:a}=i.actions,c=i.reducer},712:(e,t,n)=>{"use strict";n.d(t,{A:()=>o,O:()=>i});var r=n(3120),s=function(e,t,n,r){return new(n||(n=Promise))((function(s,o){function i(e){try{c(r.next(e))}catch(e){o(e)}}function a(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?s(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(i,a)}c((r=r.apply(e,t||[])).next())}))};const o=(0,r.aw)("initializeConfig",((e,{extra:{api:t,config:n},rejectWithValue:r})=>s(void 0,void 0,void 0,(function*(){var e;try{const{features:r,defaultLocale:s,preChat:o,agentParticipant:i,userParticipant:a,startChatIcon:c}=yield t.getConfig(),l=(null===(e=null==n?void 0:n.context)||void 0===e?void 0:e.contentLocale)||s,{connectWhenInView:u}=n;return{features:r,defaultLocale:s,preChat:o,agentParticipant:i,userParticipant:a,startChatIcon:c,defaultContentLocale:l,connectWhenInView:u}}catch(e){return r(e)}})))),i=(0,r.aw)("resetConfig",((e,{extra:{config:t}})=>s(void 0,void 0,void 0,(function*(){return t}))))},5352:(e,t,n)=>{"use strict";n.d(t,{E3:()=>i,EV:()=>o});var r=n(2328),s=n(5368);const o=()=>(0,r.w1)(s.g);function i(){const{startChatIcon:e}=o();return e}},5368:(e,t,n)=>{"use strict";n.d(t,{g:()=>o});var r=n(8888),s=n(8536);const o=(0,r.M3)((({config:e})=>e),(e=>{let t=Object.assign({visible:"inline"===(null==e?void 0:e.layoutMode)?s.I.open:s.I.minimized,appContainerClassNames:(null==e?void 0:e.appContainerClassNames)||[]},e);return"function"==typeof t.appContainerClassNames&&(t=Object.assign(Object.assign({},t),{appContainerClassNames:t.appContainerClassNames(t)})),t}))},7452:(e,t,n)=>{"use strict";n.d(t,{Lp:()=>p,_U:()=>d,cp:()=>f});var r=n(3120),s=n(7548),o=n(712),i=n(8760);const a=Object.assign(Object.assign({},s.Ag),{api:{domain:"",key:"",secure:!0,sendEnvironment:!0},notificationAudioURL:void 0,hideOnNoUserResponse:!1,connectWhenInView:!0,showDisclaimer:!1,showSuggestions:!0,preChat:{enterDelay:1e3,exitAfter:4e3},continueChat:{enterDelay:0,exitAfter:2e3},customComponents:{},defaults:{visible:null},preChatEvents:[]}),c=["hideOnNoUserResponse","connectWhenInView","showDisclaimer","showSuggestions","continueChat","preChat","namespace","customComponents","defaults","layoutMode","api","zIndex","context","appContainerClassNames","messages","visible","visibilityCallback","errorCallback","agentParticipant","userParticipant","startChatIcon","notificationAudioURL"],l=(e,t)=>{const n=(0,i.gl)(t,c),{messages:r}=n,s=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var s=0;for(r=Object.getOwnPropertySymbols(e);s<r.length;s++)t.indexOf(r[s])<0&&Object.prototype.propertyIsEnumerable.call(e,r[s])&&(n[r[s]]=e[r[s]])}return n}(n,["messages"]);let o=e;return Object.keys(s).length>0&&(o=Object.assign(Object.assign({},o),s)),r&&(o=Object.assign(Object.assign({},o),{messages:Object.assign(Object.assign({},o.messages),r)})),o},u=(0,r.is)({name:"config",initialState:a,reducers:{setConfig:(e,{payload:t})=>l(e,t),updateConfig:(e,{payload:t})=>l(e,t),setPreChatEvents:(e,{payload:t})=>{e.preChatEvents=t}},extraReducers:e=>{e.addCase(o.O.fulfilled,(e=>e)).addCase(o.A.fulfilled,((e,{payload:{preChat:t,agentParticipant:n,userParticipant:r,startChatIcon:s,defaultContentLocale:o}})=>{e.preChatEvents=t.map((e=>({type:"message",payload:e}))),e.context.contentLocale=o,e.agentParticipant=n,e.userParticipant=r,e.startChatIcon=s}))}}),{setConfig:d,updateConfig:p,setPreChatEvents:h}=u.actions,f=u.reducer},1364:(e,t,n)=>{"use strict";n.d(t,{U:()=>f,a:()=>h});var r=n(3120),s=n(2309),o=n(3872),i=n(2704),a=n(8132),c=n(6232),l=n(1120),u=n(6280),d=n(5368);const p={SeamlyGeneralError:i.c,SeamlyConfigurationError:o.c,SeamlySessionExpiredError:c.c,SeamlyOfflineError:a.c,SeamlyUnauthorizedError:l.c,SeamlyUnavailableError:u.c},h=(0,r.Uh)("catch-error",(e=>({payload:e})));function f({api:e}){return({getState:t})=>{const n=n=>{const{errorCallback:r,namespace:o,api:i,layoutMode:a}=(0,d.g)(t()),{error:c,type:l}=n,u=p[null==c?void 0:c.name]?new p[c.name](c):new s.c(c);null==r||r(u,{namespace:o,api:i,layoutMode:a,conversationUrl:e.getConversationUrl(),action:l?n:void 0})};return e=>t=>{var r,s,o,i,a,c;try{return(null===(s=null===(r=t.payload)||void 0===r?void 0:r.originalEvent)||void 0===s?void 0:s.payload)?n({error:t.payload,type:null===(a=null===(i=null===(o=t.payload)||void 0===o?void 0:o.originalEvent)||void 0===i?void 0:i.payload)||void 0===a?void 0:a.type}):(null===(c=t.payload)||void 0===c?void 0:c.originalError)&&n({error:t.payload,type:void 0}),e(t)}catch(e){throw n({error:e}),e}}}}},2620:(e,t,n)=>{"use strict";n.d(t,{A$:()=>p,K0:()=>u,OI:()=>h,YJ:()=>d,cp:()=>m,e8:()=>l,mq:()=>f});var r=n(3120),s=n(232);const o={controls:{}},i={value:"",touched:!1},a={controls:i},c=(0,r.is)({name:"forms",initialState:a,reducers:{registerForm:(e,{payload:{persistData:t,formId:n}})=>{var r;const s=t&&null!==(r=e[n])&&void 0!==r?r:Object.assign(Object.assign({},o),{persistData:t});e[n]=s},deregisterForm:(e,{payload:{formId:t}})=>{var n;return(null===(n=e[t])||void 0===n?void 0:n.persistData)||delete e[t],e},registerControl:(e,{payload:{name:t,formId:n}})=>{e[n].controls={[t]:i}},deregisterControl:(e,{payload:{name:t,formId:n}})=>{const r=e[n];if(!r)return e;if(r.persistData)return e;const s=Object.assign({},r.controls);return delete s[t],Object.assign(Object.assign({},e),{[n]:Object.assign(Object.assign({},r),{controls:s})})},updateControlValue:(e,{payload:{formId:t,name:n,value:r}})=>{var s;(null===(s=e[t])||void 0===s?void 0:s.controls)&&(e[t].controls[n].value=r)},updateControlTouched:(e,{payload:{formId:t,name:n,touched:r}})=>{var s;(null===(s=e[t])||void 0===s?void 0:s.controls[n])&&(e[t].controls[n].touched=r)}},extraReducers:e=>{e.addCase(s.C.pending,(()=>a))}}),{registerForm:l,deregisterForm:u,registerControl:d,deregisterControl:p,updateControlValue:h,updateControlTouched:f}=c.actions,m=c.reducer},4528:(e,t,n)=>{"use strict";n.d(t,{K:()=>s});var r=n(3120);const s=(0,r.aw)("setLocale",((e,{extra:{api:t},rejectWithValue:n})=>{return r=void 0,s=void 0,i=function*(){try{return{translations:yield t.getTranslations(e),userLocale:e}}catch(e){return n(e)}},new((o=void 0)||(o=Promise))((function(e,t){function n(e){try{c(i.next(e))}catch(e){t(e)}}function a(e){try{c(i.throw(e))}catch(e){t(e)}}function c(t){var r;t.done?e(t.value):(r=t.value,r instanceof o?r:new o((function(e){e(r)}))).then(n,a)}c((i=i.apply(r,s||[])).next())}));var r,s,o,i}),{condition:(e,{getState:t})=>{const{i18n:{isLoading:n,userLocale:r}}=t();return e!==r&&!n}})},4640:(e,t,n)=>{"use strict";function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function s(e){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},s(e)}function o(e){var t=function(e,t){if("object"!=s(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=s(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==s(t)?t:String(t)}function i(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,o(r.key),r)}}function a(e,t,n){return(t=o(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function c(e){return e.reduce((function(e,t){return e.concat(Array.isArray(t)?c(t):t)}),[])}function l(e){for(var t=function(e){return/\s/.test(e)},n=[],r={},s=0,o=null,i=!1,a=0;a<e.length;){if(i&&(t(e[a])||"{"===e[a]))i=!1,o=e.slice(s,a),"{"===e[a]&&a--;else if(!i&&!t(e[a])){var c="{"===e[a];if(o&&c){var l=u(e,a);if(-1===l)throw new Error('Unbalanced curly braces in string: "'.concat(e,'"'));r[o]=e.slice(a+1,l),a=l,o=null}else o&&(n.push(o),o=null),i=!0,s=a}a++}return i&&(o=e.slice(s)),o&&n.push(o),{args:n,cases:r}}function u(e,t){for(var n=0,r=t+1;r<e.length;r++){var s=e.charAt(r);if("}"===s){if(0===n)return r;n--}else"{"===s&&n++}return-1}function d(e){return p(e.slice(1,-1),",",3)}function p(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];if(!e)return r;if(1===n)return r.push(e),r;var s=e.indexOf(t);if(-1===s)return r.push(e),r;var o=e.substring(0,s).trim(),i=e.substring(s+t.length+1).trim();return r.push(o),p(i,t,n-1,r)}n.d(t,{g:()=>E});var h,f=function(){function e(t){var n,r,s=this,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),a(this,"format",(n=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return c(s.process(e,t)).join("")},r={},function(){for(var e=arguments.length,t=new Array(e),s=0;s<e;s++)t[s]=arguments[s];var o=t.length?t.map((function(e){return null===e?"null":void 0===e?"undefined":"function"==typeof e?e.toString():e instanceof Date?e.toISOString():JSON.stringify(e)})).join("|"):"_(no-args)_";if(Object.prototype.hasOwnProperty.call(r,o))return r[o];var i=n.apply(void 0,t);return r[o]=i,i})),this.locale=t,this.typeHandlers=o}var t,n;return t=e,n=[{key:"process",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!e)return[];var n,s,o=e.indexOf("{");if(-1!==o){var i=u(e,o);if(-1===i)throw new Error('Unbalanced curly braces in string: "'.concat(e,'"'));var a=e.substring(o,i+1);if(a){var c=[],l=e.substring(0,o);l&&c.push(l);var p=(n=d(a),s=3,function(e){if(Array.isArray(e))return e}(n)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,s,o,i,a=[],c=!0,l=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=o.call(n)).done)&&(a.push(r.value),a.length!==t);c=!0);}catch(e){l=!0,s=e}finally{try{if(!c&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(l)throw s}}return a}}(n,s)||function(e,t){if(e){if("string"==typeof e)return r(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(e,t):void 0}}(n,s)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),h=p[0],f=p[1],m=p[2],v=t[h];null==v&&(v="");var g=f&&this.typeHandlers[f];c.push(g?g(v,m,this.locale,t,this.process.bind(this)):v);var y=e.substring(i+1);return y&&c.push(this.process(y,t)),c}}return[e]}}],n&&i(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),e}();function m(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function v(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?m(Object(n),!0).forEach((function(t){a(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):m(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var g=0,y="other";function b(e,t){for(var n=0,r="",s=0,o={};n<e.length;){if("#"!==e[n]||s)r+=e[n];else{var i="__hashToken".concat(g++);r+="{".concat(i,", number}"),o[i]=t}"{"===e[n]?s++:"}"===e[n]&&s--,n++}return{caseBody:r,numberValues:o}}var w="other",x=n(8056),C=n(2328),_=n(9144);const j=new f("en-GB",{plural:function(e){var t=arguments.length>2?arguments[2]:void 0,n=arguments.length>3?arguments[3]:void 0,r=arguments.length>4?arguments[4]:void 0,s=l(arguments.length>1&&void 0!==arguments[1]?arguments[1]:""),o=s.args,i=s.cases,a=parseInt(e);o.forEach((function(e){e.startsWith("offset:")&&(a-=parseInt(e.slice(7)))}));var c=[];if("PluralRules"in Intl){void 0!==h&&h.resolvedOptions().locale===t||(h=new Intl.PluralRules(t));var u=h.select(a);u!==y&&c.push(u)}1===a&&c.push("one"),c.push("=".concat(a),y);for(var d=0;d<c.length;d++){var p=c[d];if(p in i){var f=b(i[p],a),m=f.caseBody,g=f.numberValues;return r(m,v(v({},n),g))}}return e},select:function(e){var t=arguments.length>3?arguments[3]:void 0,n=arguments.length>4?arguments[4]:void 0,r=l(arguments.length>1&&void 0!==arguments[1]?arguments[1]:"").cases;return e in r?n(r[e],t):w in r?n(r[w],t):e}});function E(){const e=(0,C.w1)(_.UO),t=(0,C.w1)(_.Oo),n=(0,C.w1)(_.E$),r=(0,C.w1)(_.Ir);return{t:(0,x.useCallback)(((n,s={})=>{const o=e[n];return o?j.format(o,s):(r||console.warn(`Translation key: ${n} is missing in locale: ${t}`),null)}),[e,t,r]),userLocale:t,initialLocale:n}}},9144:(e,t,n)=>{"use strict";n.d(t,{E$:()=>o,Ir:()=>a,Oo:()=>i,UO:()=>s});var r=n(8888);const s=(0,r.M3)((({i18n:e})=>e),(({translations:e})=>e)),o=(0,r.M3)((({i18n:e})=>e),(({initialLocale:e})=>e)),i=(0,r.M3)((({i18n:e})=>e),(({userLocale:e})=>e)),a=(0,r.M3)((({i18n:e})=>e),(({isLoading:e})=>e))},9748:(e,t,n)=>{"use strict";n.d(t,{q:()=>a});var r=n(8056),s=n(2328),o=n(4640),i=n(5768);function a(){const{t:e}=(0,o.g)(),t=(0,s.w1)(i.c),n=(0,s.w1)(i.Y),a=(0,r.useMemo)((()=>{if(!n)return{title:void 0,message:void 0,srText:void 0,buttonText:void 0,originalError:void 0};const{langKey:r,action:s}=t,o=e(`${r}.title`),i=e(`${r}.message`),a=e(`${r}.srText`),c=s?e(`${r}.buttonText`):null;return Object.assign(Object.assign(Object.assign(Object.assign({},r?{title:o,message:i,srText:a}:{}),s?{action:s}:{}),s&&r?{buttonText:c}:{}),{originalError:t})}),[n,t,e]);return{hasError:n,meta:a,error:t}}},5768:(e,t,n)=>{"use strict";n.d(t,{Y:()=>o,c:()=>s});var r=n(8888);const s=(0,r.M3)((({interrupt:e})=>e),(({error:e})=>e)),o=(0,r.M3)(s,(e=>Boolean(e)))},1880:(e,t,n)=>{"use strict";n.d(t,{aI:()=>p,cp:()=>h,yA:()=>d});var r=n(3120),s=n(232),o=n(712),i=n(4528),a=n(7468),c=n(2948);const l={error:void 0},u=(0,r.is)({name:"interrupt",initialState:l,reducers:{setInterrupt:(e,t)=>{e.error=t.payload},clearInterrupt:()=>l},extraReducers:e=>{e.addCase(o.A.pending,(()=>l)).addMatcher((0,r.CF)(s.m.rejected,o.A.rejected,i.K.rejected,c.c.rejected,c.i.rejected,a.m.rejected),((e,{payload:t})=>{e.error=t}))}}),{setInterrupt:d,clearInterrupt:p}=u.actions,h=u.reducer},7468:(e,t,n)=>{"use strict";n.d(t,{m:()=>s});var r=n(3120);const s=(0,r.aw)("getConversation",((e,{extra:{api:t},rejectWithValue:n})=>{return r=void 0,s=void 0,i=function*(){try{return t.getConversation()}catch(e){return n({name:null==e?void 0:e.name,message:null==e?void 0:e.message,langKey:null==e?void 0:e.langKey,action:null==e?void 0:e.action,originalEvent:null==e?void 0:e.originalEvent,originalError:null==e?void 0:e.originalError})}},new((o=void 0)||(o=Promise))((function(e,t){function n(e){try{c(i.next(e))}catch(e){t(e)}}function a(e){try{c(i.throw(e))}catch(e){t(e)}}function c(t){var r;t.done?e(t.value):(r=t.value,r instanceof o?r:new o((function(e){e(r)}))).then(n,a)}c((i=i.apply(r,s||[])).next())}));var r,s,o,i}),{condition(e,{getState:t}){var n;const{state:{events:r}}=t(),s=r[r.length-1],o=null===(n=null==e?void 0:e.lastEvent)||void 0===n?void 0:n.id;return s&&o!==s.payload.id}})},1760:(e,t,n)=>{"use strict";n.d(t,{e:()=>T,A:()=>k});var r=n(8608),s=n(3120),o=n(2328),i=n(428),a=n(7452),c=n(1364),l=n(2620),u=n(232),d=n(712),p=n(4528);const h={translations:{"errors.configError.message":"We are sorry this happened, please retry at a later time.","errors.configError.srText":"A chat configuration error occurred. Our apologies, please retry at a later time.","errors.configError.title":"Chat configuration error.","errors.general.buttonText":"Restart chat","errors.general.message":"Do you want to start a new chat session?","errors.general.srText":"Something went wrong with the chat session. You can restart the chat.","errors.general.title":"Something went wrong","errors.seamlyOffline.message":"There might be a problem with your or our network connection. The chat session should resume as soon the connection is available again.","errors.seamlyOffline.srText":"The chat has connection issues. There might be a problem with your or our network connection. The chat session should resume as soon as the connection is available again.","errors.seamlyOffline.title":"Connection issues","errors.seamlyUnavailable.buttonText":"Try again","errors.seamlyUnavailable.message":"The server could not be reached. Try again in a little while.","errors.seamlyUnavailable.srText":"The chat server could not be reached. Try again in a little while.","errors.seamlyUnavailable.title":"Server unavailable"},isLoading:!1,initialLocale:void 0,userLocale:void 0},f=(0,s.is)({name:"app",initialState:h,reducers:{setInitialLocale:(e,t)=>{e.initialLocale=t.payload},setTranslations:(e,{payload:t})=>{e.translations=t}},extraReducers:e=>{e.addCase(u.C.pending,(()=>h)).addCase(d.A.fulfilled,((e,{payload:t})=>{e.initialLocale=t.defaultContentLocale})).addCase(p.K.pending,(e=>{e.isLoading=!0})).addCase(p.K.rejected,(e=>{e.isLoading=!1})).addCase(p.K.fulfilled,((e,{payload:t})=>{e.isLoading=!1,(null==t?void 0:t.translations)&&(e.userLocale=t.userLocale,e.translations=Object.keys(t.translations).sort().reduce(((e,n)=>Object.assign(Object.assign({},e),{[n]:t.translations[n]})),{}))}))}}),{setInitialLocale:m,setTranslations:v}=f.actions,g=f.reducer;var y=n(2704),b=n(1880);const w=["SeamlyGeneralError","SeamlyConfigurationError","SeamlySessionExpiredError","SeamlyOfflineError","SeamlyUnauthorizedError","SeamlyUnavailableError"];var x=n(3332),C=n(9144),_=n(8456);const j=({dispatch:e,getState:t})=>n=>r=>{var s,o,i,a,c,l,h;const f=n(r);if(x.Yh.match(r)&&(null===(o=null===(s=r.payload)||void 0===s?void 0:s.translation)||void 0===o?void 0:o.enabled))return e((0,_._k)(r.payload.translation.locale)),e((0,p.K)(r.payload.translation.locale)),f;if(d.A.fulfilled.match(r)&&r.payload.defaultContentLocale)return e((0,p.K)(r.payload.defaultContentLocale)),f;if(u.m.fulfilled.match(r))return r.payload.contentLocale&&e((0,p.K)(r.payload.contentLocale)),f;if(x.Ux.match(r)&&"info"===r.payload.type&&(null===(a=null===(i=r.payload)||void 0===i?void 0:i.payload)||void 0===a?void 0:a.body)&&"subtype"in r.payload.payload.body&&"new_translation"===(null===(h=null===(l=null===(c=r.payload)||void 0===c?void 0:c.payload)||void 0===l?void 0:l.body)||void 0===h?void 0:h.subtype)&&r.payload.payload.body.translationEnabled)return e((0,p.K)(r.payload.payload.body.translationLocale)),f;if(_.If.match(r)){const n=(0,C.E$)(t());return e((0,p.K)(n)),f}return f};var E=n(1756);const S=(0,r.TL)({state:x.cp,app:i.cp,config:a.cp,i18n:g,translations:_.cp,visibility:E.cp,forms:l.cp,interrupt:b.cp});function T({initialState:e,api:t,eventBus:n,config:r}){const o=(0,s.eS)({reducer:S,preloadedState:e,middleware:e=>e({thunk:{extraArgument:{api:t,eventBus:n,config:r}},serializableCheck:!1}).concat((0,c.U)({api:t}),function({api:e}){return()=>t=>n=>{const{payload:r,type:s}=n;if(s===b.yA.type){if(!w.includes(r.name))throw new y.c(r);"reset"===r.action&&e.disconnect().then((()=>{e.clearStore()}))}return t(n)}}({api:t}),function({api:e}){return()=>t=>n=>{const r=t(n);switch(n.type){case x.IF.toString():e.store.set("options",n.payload);break;case x.eK.toString():e.store.set("options",{...e.store.get("options")||{},[n.payload.option]:n.payload.value})}return r}}({api:t}),j)});return o}const k=o.OY},3332:(e,t,n)=>{"use strict";n.d(t,{A1:()=>I,AH:()=>q,E1:()=>R,ER:()=>Z,I1:()=>C,IF:()=>Q,M5:()=>x,ML:()=>g,Oo:()=>Y,Qb:()=>W,Qr:()=>l,SM:()=>S,UD:()=>V,Ur:()=>_,Ux:()=>v,Yh:()=>P,Yr:()=>H,_8:()=>te,aD:()=>w,ai:()=>$,cB:()=>F,cN:()=>L,cj:()=>k,cp:()=>ne,eK:()=>X,e_:()=>ee,ec:()=>G,gB:()=>j,gz:()=>J,hB:()=>D,kV:()=>y,kl:()=>N,mw:()=>K,nC:()=>O,od:()=>z,op:()=>E,q_:()=>m,uE:()=>B,us:()=>U});var r=n(3120),s=n(232),o=n(712),i=n(1676),a=n(8760),c=n(6244);const l=({type:e,payload:t})=>"hidden"===document.visibilityState||e===c.Iz.message&&!t.fromClient||e===c.Iz.info&&t.type===c.ay.text,u=e=>e.sort((({payload:{occurredAt:e}},{payload:{occurredAt:t}})=>e-t)),d=(e,t)=>{if(!e)return{participants:{},currentAgent:""};const{participants:n}=e||{participants:{}},{id:r,avatar:s,name:o,introduction:i}=t.participant,a=n[r],c=Object.assign(Object.assign({},n),{[r]:a?Object.assign(Object.assign(Object.assign(Object.assign({},a),s?{avatar:s}:{}),o?{name:o}:{}),i?{introduction:i}:{}):t.participant});return Object.assign(Object.assign({},e),{participants:c,currentAgent:e.currentAgent===r||t.fromClient?e.currentAgent:r})},p=(e,t)=>{var n,r;const s="message"===(null==t?void 0:t.type)?(null==t?void 0:t.payload.translatedEntry)||(null==t?void 0:t.payload.entry):{},{blockAutoEntrySwitch:o}=e,i=(null===(n=null==t?void 0:t.payload)||void 0===n?void 0:n.actions)||{},a=(null===(r=null==t?void 0:t.payload)||void 0===r?void 0:r.translatedActions)||{};if(!s)return Object.assign(Object.assign({},e),{optionsOverride:{},actions:i,translatedActions:a});const{type:c,options:l}=s;let u=e.active;return o||c===e.userSelected||(u=c),Object.assign(Object.assign({},e),{active:u,optionsOverride:Object.assign(Object.assign({},e.optionsOverride||{}),c?{[c]:l}:{}),actions:i,translatedActions:a})},h={events:[],isLastEventFromClient:!1,initialState:{userResponded:!1},unreadEvents:0,userHasResponded:!1,loadedImageEventIds:[],isLoading:!1,idleDetachCountdown:{hasCountdown:!1,isActive:!1,remaining:void 0,wasStopped:void 0,count:void 0,timer:void 0},resumeConversationPrompt:!1,serviceInfo:{activeServiceSessionId:"",proactiveMessages:!1},participantInfo:{participants:{},currentAgent:""},headerTitles:{title:null,subTitle:""},historyLoaded:!1,skiplinkTargetId:(0,i.s)(),optionsButtonId:(0,i.s)(),headerCollapseButtonId:(0,i.s)(),serviceData:{},options:{features:{webNotifications:{enabled:!1}},panelActive:!1,optionActive:"",userSelectedOptions:{}},showFileUpload:!1,currentUploads:[],processingFileUploads:[],entryMeta:{default:c.uG.text,active:c.uG.text,userSelected:null,blockAutoEntrySwitch:!1,options:{},optionsOverride:{},actions:{},translatedActions:{}},seamlyContainerElement:null},f=(0,r.is)({name:"store",initialState:h,reducers:{addEvent:(e,t)=>{var n,r;const{type:s,payload:o}=t.payload,a=e.options.features.hasOwnProperty(c.gn.uploads);let u=Object.assign({},e.options);if(a&&(s===c.Iz.message||s===c.Iz.participant)&&!o.fromClient){const e="message"===s?null===(n=o.entry)||void 0===n?void 0:n.type:{};u=Object.assign(Object.assign({},u),{features:Object.assign(Object.assign({},u.features),{uploads:Object.assign(Object.assign({},null===(r=u.features)||void 0===r?void 0:r.uploads),{enabledFromEntry:e===c.uG.upload})})})}const d=l(t.payload);if(e.events.find((e=>e.payload.id===o.id)))return;const h=p(e.entryMeta,t.payload);e.entryMeta=a||h.active!==c.uG.upload?h:Object.assign({},e.entryMeta),e.options=u,d&&(e.unreadEvents+=1,"service_data"!==s&&(t.payload.payload.messageStatus=o.fromClient?c.eg.read:c.eg.received)),t.payload.payload.key=(0,i.s)(),e.events.push(t.payload),e.isLastEventFromClient=o.fromClient},ackEvent:(e,{payload:{payload:t}})=>{if(!t.transactionId)return void console.warn("ACK received without transaction ID.");const n=e.events.find((e=>e.payload.transactionId===t.transactionId&&(!t.type||e.type===t.type))),{id:r,occurredAt:s}=t;n&&(n.payload.id=r,n.payload.occurredAt=s,e.events=u(e.events))},clearEvents:e=>{e.unreadEvents=0,e.loadedImageEventIds=[],e.events=[]},setEventsRead:(e,{payload:t})=>{e.unreadEvents=0,e.events.forEach((e=>(-1!==t.indexOf(e.payload.id)&&(e.payload=Object.assign(Object.assign({},e.payload),"service_data"!==e.type&&e.payload.messageStatus===c.eg.received&&{messageStatus:c.eg.read})),e)))},setLoadedImageEventIds:(e,{payload:t})=>{e.loadedImageEventIds.push(t)},setHistory:(e,{payload:{events:t,participants:n,activeServiceSessionId:r,activeServiceSettings:s={},serviceData:o,resumeConversationPrompt:i}})=>{var a,l,h;const f=((e,t)=>{const n=e.filter((e=>"message"===e.type&&!e.payload.optimisticallyInjected&&!t.some((t=>t.payload.id===e.payload.id)))),r=t.filter((e=>!("participant"===e.type&&!e.payload.participant.introduction))).reverse();return u([...r,...n])})(e.events,t),m=Object.assign(Object.assign({},e.participantInfo.participants),n),v=f.slice().reverse().find((e=>("message"===e.type||"participant"===e.type)&&!e.payload.fromClient));let g=null;v&&("message"===v.type&&(g=v.payload.participant),"participant"===v.type&&(g=v.payload.participant.id));const{entry:y}=s,b=null===(a=null==y?void 0:y.options)||void 0===a?void 0:a.upload,w=p(Object.assign(Object.assign(Object.assign({},e.entryMeta),y),{active:(null==y?void 0:y.default)||c.ay.text,options:Object.assign({},(null==y?void 0:y.options)?y.options:{})}),f[f.length-1]);let x=Object.assign({},e.options.features);const C=x.hasOwnProperty(c.gn.uploads);if(C&&"message"===(null==v?void 0:v.type)){const{payload:e}=v,t=(null===(l=null==e?void 0:e.entry)||void 0===l?void 0:l.type)||{};x=Object.assign(Object.assign({},x),{uploads:{enabled:!(!b||!(null==b?void 0:b.enabled)),enabledFromEntry:t===c.uG.upload}})}e.unreadEvents=f.filter((e=>"message"===e.type&&e.payload.messageStatus===c.eg.received)).length,e.events=f.filter((e=>"participant"!==e.type||!!e.payload.participant.introduction)),e.participantInfo=Object.assign(Object.assign(Object.assign({},e.participantInfo),g?d(e.participantInfo,{participant:m[g]}):{}),{participants:m}),e.historyLoaded=!0,e.serviceInfo=Object.assign(Object.assign({},e.serviceInfo),{activeServiceSessionId:r,proactiveMessages:(null===(h=null==s?void 0:s.proactiveMessages)||void 0===h?void 0:h.enabled)||!1}),e.serviceData=Object.assign(Object.assign({},e.serviceData),o),e.options=Object.assign(Object.assign({},e.options),{features:x}),e.entryMeta=C||w.active!==c.uG.upload?w:Object.assign({},e.entryMeta),e.resumeConversationPrompt=i||!1,g&&(e.headerTitles.subTitle=m[g].name)},resetHistoryLoadedFlag:e=>{e.historyLoaded=!1},setIsLoading:(e,{payload:t})=>{e.isLoading=t},initIdleDetachCountdown:(e,{payload:t})=>{const{delaySeconds:n,delayTime:r}=t;e.idleDetachCountdown={hasCountdown:!0,isActive:!0,wasStopped:!1,count:n,remaining:n,timer:r}},decrementIdleDetachCountdownCounter:e=>{const{idleDetachCountdown:t}=e,{remaining:n}=t,r=n-1;e.idleDetachCountdown.remaining=r,e.idleDetachCountdown.timer=(0,a.s3)(r)},stopIdleDetachCountdownCounter:e=>{e.idleDetachCountdown.isActive=!1,e.idleDetachCountdown.wasStopped=!0},clearIdleDetachCountdown:e=>{e.idleDetachCountdown.hasCountdown=!1,e.idleDetachCountdown.isActive=!1},initResumeConversationPrompt:e=>{e.resumeConversationPrompt=!0},clearResumeConversationPrompt:e=>{e.resumeConversationPrompt=!1},setParticipant:(e,{payload:t})=>{e.participantInfo=d(e.participantInfo,{participant:t.participant,fromClient:t.fromClient})},setActiveService:(e,{payload:t})=>{e.serviceInfo.activeServiceSessionId!==t&&(e.serviceInfo.activeServiceSessionId=t)},setHeaderTitle:(e,{payload:t})=>{e.headerTitles.title=t},setHeaderSubTitle:(e,{payload:t})=>{e.headerTitles.subTitle=t},setInitialState:(e,{payload:t})=>{e.initialState=t,e.unreadEvents=h.unreadEvents},setServiceDataItem:(e,{payload:t})=>{e.serviceData[t.type]=t},setFeatures:(e,{payload:t})=>{t.features&&(e.options.features=t.features)},setFeatureEnabledState:(e,{payload:t})=>{e.options.features.hasOwnProperty(t.key)&&(e.options.features[t.key].enabled=t.enabled)},clearFeatures:e=>{e.options.features={webNotifications:e.options.features.webNotifications}},showOption:(e,{payload:t})=>{e.options.panelActive=!0,e.options.optionActive=t},hideOption:e=>{e.options.panelActive=!1,e.options.optionActive=""},setUserSelectedOptions:(e,{payload:t})=>{e.options.userSelectedOptions=t},setUserSelectedOption:(e,{payload:t})=>{const{option:n,value:r}=t;e.options.userSelectedOptions[n]=r},setBlockAutoEntrySwitch:(e,{payload:t})=>{e.entryMeta.blockAutoEntrySwitch=t},setServiceEntryMetadata:(e,{payload:t})=>{e.entryMeta.active=t.default,e.entryMeta.options=t.options||{},e.entryMeta.optionsOverride={},e.entryMeta.actions={},e.entryMeta.translatedActions={}},setActiveEntryType:(e,{payload:t})=>{e.entryMeta.active=t},setUserEntryType:(e,{payload:t})=>{e.entryMeta.userSelected=t},clearAbortTransaction:e=>{e.entryMeta.actions={},e.entryMeta.translatedActions={}},registerUpload:(e,{payload:t})=>{e.currentUploads.push({id:t.fileId,name:t.fileName,progress:1,uploading:!0,complete:!1,error:"",uploadHandle:t.uploadHandle})},setUploadProgress:(e,{payload:t})=>{e.currentUploads=e.currentUploads.map((e=>e.id===t.fileId?Object.assign(Object.assign({},e),{progress:t.progress,uploading:100!==t.progress,uploadHandle:100===t.progress?null:e.uploadHandle}):e))},startProcessingImage:(e,{payload:t})=>{e.processingFileUploads.push(t)},doneProcessingImage:(e,{payload:t})=>{e.processingFileUploads=e.processingFileUploads.filter((e=>e!==t))},setUploadError:(e,{payload:t})=>{e.currentUploads=e.currentUploads.map((e=>e.id===t.fileId?Object.assign(Object.assign({},e),{error:t.errorText,progress:0,uploading:!1,uploadHandle:null}):e))},setUploadComplete:(e,{payload:t})=>{e.currentUploads=e.currentUploads.map((e=>e.id===t?Object.assign(Object.assign({},e),{complete:!0}):e))},clearAllUploads:e=>{e.currentUploads=[]},setSeamlyContainerElement:(e,{payload:t})=>{e.seamlyContainerElement=t},setProactiveMessages:(e,{payload:t})=>{e.serviceInfo.proactiveMessages=t}},extraReducers:e=>{e.addCase(s.C.pending,(()=>h)).addCase(s.m.pending,(e=>{e.isLoading=!0})).addCase(o.A.fulfilled,((e,{payload:t})=>{var n;e.headerTitles.subTitle=null===(n=t.agentParticipant)||void 0===n?void 0:n.name,t.features&&(e.options.features=t.features)})).addCase(s.m.fulfilled,((e,{payload:t})=>{e.isLoading=!1,t.initialState&&(e.initialState=t.initialState)})).addMatcher((0,r.CF)(j,E),(e=>{e.isLastEventFromClient=!1}))}}),{ackEvent:m,addEvent:v,clearAllUploads:g,clearEvents:y,clearFeatures:b,clearIdleDetachCountdown:w,clearResumeConversationPrompt:x,decrementIdleDetachCountdownCounter:C,hideOption:_,initIdleDetachCountdown:j,initResumeConversationPrompt:E,registerUpload:S,resetHistoryLoadedFlag:T,setActiveEntryType:k,setActiveService:O,setBlockAutoEntrySwitch:N,setEventsRead:I,setFeatureEnabledState:U,setFeatures:A,setHeaderSubTitle:R,setHeaderTitle:M,setHistory:P,setInitialState:L,setIsLoading:D,setLoadedImageEventIds:F,setParticipant:B,setSeamlyContainerElement:z,setServiceDataItem:$,setServiceEntryMetadata:V,clearAbortTransaction:H,setUploadComplete:K,setUploadError:W,setUploadProgress:q,startProcessingImage:G,doneProcessingImage:Y,setUserEntryType:J,setUserSelectedOption:X,setUserSelectedOptions:Q,showOption:Z,stopIdleDetachCountdownCounter:ee,setProactiveMessages:te}=f.actions,ne=f.reducer},7456:(e,t,n)=>{"use strict";n.d(t,{EI:()=>v,kx:()=>f,ol:()=>g,A1:()=>h,im:()=>m});var r=n(8056),s=n(2328),o=n(5352),i=n(4640),a=n(8888);const c=e=>(0,a.M3)((e=>e.translations.translatedEventGroups),(t=>Object.values(t).every((t=>{var n;return!t.includes(null===(n=null==e?void 0:e.payload)||void 0===n?void 0:n.id)}))));var l=n(8456),u=n(8632),d=n(6204),p=n(6244);function h(){const{sendContext:e}=(0,d.wv)(),t=(0,s.OY)(),n=(0,o.EV)(),i=(0,r.useCallback)((t=>{e({userLocale:t})}),[e]),a=(0,r.useCallback)((()=>{e({userLocale:n.context.userLocale}),t((0,l.If)())}),[n.context,t,e]),{languages:c,isActive:u,isAvailable:p,currentLocale:h}=(0,s.w1)((({translations:e})=>e));return{languages:c,isActive:u,isAvailable:p,currentLocale:h,enableTranslations:i,disableTranslations:a}}function f(e){const{translatedBody:t,translation:n,body:r}=(null==e?void 0:e.payload)?"participant"===e.type?{body:null===(o=e.payload)||void 0===o?void 0:o.participant.introduction,translatedBody:null===(a=null===(i=e.payload)||void 0===i?void 0:i.participant)||void 0===a?void 0:a.translatedIntroduction,translation:null===(u=null===(l=e.payload)||void 0===l?void 0:l.participant)||void 0===u?void 0:u.translation}:{body:e.payload.body,translatedBody:e.payload.translatedBody,translation:null===(d=null==e?void 0:e.payload)||void 0===d?void 0:d.translation}:{body:void 0,translatedBody:void 0};var o,i,a,l,u,d;const p=!!t,h=(0,s.w1)(c(e));return{body:p&&h?t:r,hasTranslation:p,isTranslated:h&&p,locale:null==n?void 0:n.locale}}function m(){const e=(0,s.w1)((({translations:e})=>e.containerId));return{id:e,focusContainer:(0,d.kX)(e)}}function v(e){const{languages:t}=h();return(0,r.useMemo)((()=>{var n;return null===(n=null==t?void 0:t.find((t=>t.locale===e)))||void 0===n?void 0:n.nativeName}),[e,t])}const g=()=>{const{isActive:e,languages:t}=h(),n=(0,s.OY)(),{sendAction:o}=(0,d.wv)(),{translationProposal:a}=(0,s.w1)((e=>e.translations)),{enableTranslations:c}=h(),{isOpen:f}=(0,u.uu)(),{userLocale:m}=(0,i.g)(),g=null==a?void 0:a.proposedLocale,y=v(g),b=(0,r.useMemo)((()=>null!==a&&!e&&f&&m!==g&&t.some((e=>e.locale===g))),[a,e,f,m,g,t]);return{activateTranslationProposal:()=>{c(null==a?void 0:a.proposedLocale)},dismissTranslationProposal:()=>{o({type:p.w$.dismiss,body:{type:p.wb}}),n((0,l.yE)())},proposedLocale:g,proposedLocaleNativeName:y,showProposal:b,translationProposal:a}}},8456:(e,t,n)=>{"use strict";n.d(t,{If:()=>p,Mt:()=>f,_k:()=>d,cp:()=>g,kx:()=>m,wr:()=>h,yE:()=>v});var r=n(3120),s=n(232),o=n(712),i=n(4528),a=n(3332);const c={isActive:!1,currentLocale:void 0,isAvailable:!1,languages:[],containerId:(0,r.i0)(),translatedEventGroups:{},translationProposal:null},l=(e,t)=>{const n=[...e].reduce(((e,{payload:n},r,s)=>{var o;if(e[t]){if("divider"===(null==n?void 0:n.type)&&(null===(o=null==n?void 0:n.body)||void 0===o?void 0:o.translationEnabled))return s.splice(0),e;e[t].push(n.id)}return n.id===t&&(e[t]=[]),e}),{}),[[r,s]]=Object.entries(n);return{lastGroupId:e.filter((e=>{var t;return"divider"===(null===(t=e.payload)||void 0===t?void 0:t.type)})).map((e=>e.payload.id)).at(-1),groupId:r,eventIds:s}},u=(0,r.is)({name:"translation",initialState:c,reducers:{enableTranslation:(e,{payload:t})=>{e.isActive=!0,e.currentLocale=t},disableTranslation:e=>{e.isActive=!1,e.currentLocale=void 0},enableEventsTranslation:(e,{payload:{events:t,id:n}})=>{delete e.translatedEventGroups[n];const{lastGroupId:r}=l(t,n);e.lastGroupId=r},disableEventsTranslation:(e,{payload:{events:t,id:n}})=>{const{lastGroupId:r,groupId:s,eventIds:o}=l(t,n);e.lastGroupId=r,e.translatedEventGroups[s]=o},disableTranslationProposalPrompt:e=>{e.translationProposal=null},setTranslationProposalPrompt:(e,{payload:t})=>{e.translationProposal=t}},extraReducers:e=>{e.addCase(s.C.pending,(()=>c)).addCase(o.A.fulfilled,((e,{payload:t})=>{var n;const r=null===(n=null==t?void 0:t.features)||void 0===n?void 0:n.translation;r&&(e.isAvailable=!0===r.enabled,e.languages=[...r.languages].sort(((e,n)=>e.locale===t.defaultContentLocale?-1:n.locale===t.defaultContentLocale?1:e.nativeName.localeCompare(n.nativeName,void 0,{sensitivity:"base"}))))})).addCase(a.Yh,((e,{payload:t})=>{e.translationProposal=t.translationProposal})).addCase(i.K.fulfilled,((e,{payload:t})=>{e.currentLocale=t.userLocale})).addCase(a.Ux,((e,{payload:t})=>{e.translatedEventGroups[e.lastGroupId]&&e.translatedEventGroups[e.lastGroupId].push(t.payload.id)}))}}),{enableTranslation:d,disableTranslation:p,enableEventsTranslation:h,disableEventsTranslation:f,setTranslationProposalPrompt:m,disableTranslationProposalPrompt:v}=u.actions,g=u.reducer},2948:(e,t,n)=>{"use strict";n.d(t,{c:()=>d,i:()=>p});var r=n(3120),s=n(1060),o=n(5368),i=n(3576),a=n(6736),c=n(8536),l=n(5376);const u=[c.I.open,c.I.minimized,c.I.hidden],d=(0,r.aw)("setVisibility",((e,{getState:t,extra:{api:n,eventBus:r}})=>{const d=t(),p=l._(d),h=(0,s.E)(d),f=n.hasConversation(),m=o.g(d),{visibilityCallback:v=i.g,layoutMode:g}=m,{unreadEvents:y}=(0,a.cV)(d),b=v({hasResponded:h,previousVisibility:p,requestedVisibility:e,config:m});if(!u.includes(b))return void console.error('The visibilityCallback function should return "open", "minimized" or "hidden".');if(p===b)return;const w=n.store.get(c.M);return n.store.set(c.M,Object.assign(Object.assign({},w||{}),{[g]:e})),e&&r.emit("ui.visible",e,{visibility:e,hasConversation:f,hasResponded:h,unreadMessageCount:y}),b})),p=(0,r.aw)("initialize",((e,{dispatch:t,getState:n,extra:{api:r}})=>{return s=void 0,i=void 0,l=function*(){var e;const{layoutMode:s}=o.g(n()),i=(null===(e=r.store.get(c.M))||void 0===e?void 0:e[s])||c.I.initialize;return t(d(i)),i},new((a=void 0)||(a=Promise))((function(e,t){function n(e){try{o(l.next(e))}catch(e){t(e)}}function r(e){try{o(l.throw(e))}catch(e){t(e)}}function o(t){var s;t.done?e(t.value):(s=t.value,s instanceof a?s:new a((function(e){e(s)}))).then(n,r)}o((l=l.apply(s,i||[])).next())}));var s,i,a,l}))},8536:(e,t,n)=>{"use strict";n.d(t,{I:()=>s,M:()=>r});const r="visibility",s={hidden:"hidden",minimized:"minimized",open:"open",initialize:null}},8632:(e,t,n)=>{"use strict";n.d(t,{ae:()=>f,mo:()=>h,uu:()=>p});var r=n(9150),s=n(8056),o=n(2328),i=n(5352),a=n(1760),c=n(2948),l=n(1756),u=n(8536),d=n(5376);const p=()=>{const e=(0,a.A)(),t=(0,o.w1)(d._),n=!!t&&t!==u.I.hidden,r=t===u.I.open,i=t===u.I.minimized,l=(0,s.useCallback)((t=>e((0,c.c)(t))),[e]);return{isVisible:n,isOpen:r,isMinimized:i,visible:t,setVisibility:l,openChat:()=>{l(u.I.open)},closeChat:()=>{l(u.I.minimized)}}},h=({freezeOnceVisible:e=!1,enabled:t=!0,containerRef:n=(0,r.createRef)()})=>{const[o,i]=(0,s.useState)(null),a=!!(null==o?void 0:o.isIntersecting)||!t,c=a&&e,l=([e])=>i(e);return(0,s.useEffect)((()=>{const e=null==n?void 0:n.current;if(!window.IntersectionObserver||c||!e||!t)return()=>{};const r=new IntersectionObserver(l,{threshold:0,root:null,rootMargin:"0%"});return r.observe(e),()=>r.disconnect()}),[n,t,c]),{isVisible:a,containerRef:n}},f=()=>{const e=(0,o.OY)(),{connectWhenInView:t}=(0,i.EV)(),n=(0,o.w1)(d.e),{containerRef:r,isVisible:a}=h({enabled:t,freezeOnceVisible:!0});return(0,s.useEffect)((()=>{a&&e((0,l.g9)())}),[e,a]),{containerRef:r,showInlineView:n}}},5376:(e,t,n)=>{"use strict";n.d(t,{_:()=>s,e:()=>o});var r=n(8888);const s=(0,r.M3)((({visibility:e})=>e),(e=>e.visibility)),o=(0,r.M3)((({visibility:e})=>e),(e=>e.showInlineView))},1756:(e,t,n)=>{"use strict";n.d(t,{cp:()=>l,g9:()=>c});var r=n(3120),s=n(712),o=n(2948);const i={visibility:n(8536).I.initialize,showInlineView:!1},a=(0,r.is)({name:"visibility",initialState:i,reducers:{setShowInlineView:e=>{e.showInlineView=!0}},extraReducers:e=>{e.addCase(o.c.fulfilled,((e,{payload:t})=>{t&&(e.visibility=t)})).addCase(s.A.fulfilled,((e,{payload:t})=>{t.connectWhenInView||(e.showInlineView=!t.connectWhenInView)}))}}),{setShowInlineView:c}=a.actions,l=a.reducer},5308:(e,t,n)=>{"use strict";n.d(t,{E:()=>o,c:()=>s});var r=n(9150);const s=(0,r.createContext)(null),o=(0,r.createContext)(null)},9320:(e,t,n)=>{"use strict";n.d(t,{Ml:()=>o,Y5:()=>a,aJ:()=>c,cb:()=>i});var r=n(8056),s=n(5308);const o=()=>(0,r.useContext)(s.c),i=()=>o().store,a=()=>{const{get:e}=i();return e?e("conversationUrl"):null},c=()=>{const e=o();return(0,r.useCallback)((()=>e.hasConversation()),[e])}},6736:(e,t,n)=>{"use strict";n.d(t,{Ce:()=>j,E1:()=>y,GW:()=>p,I7:()=>m,Ip:()=>b,Ir:()=>C,KC:()=>_,OK:()=>g,SS:()=>x,cV:()=>l,gf:()=>u,kV:()=>h,qo:()=>E,sJ:()=>f,w1:()=>v,y2:()=>S});var r=n(8888),s=n(2328),o=n(1060),i=n(5352),a=n(5368),c=n(8760);const l=({state:e})=>e,u=()=>(0,s.w1)(l),d=(0,r.M3)(l,a.g,o.E,(({events:e,serviceData:t},n,r)=>{var s;if(r||"inline"===n.layoutMode||!(null==t?void 0:t.suggestion)||!(null===(s=null==t?void 0:t.suggestion)||void 0===s?void 0:s.body.length))return e;const o={type:"service_data",payload:t.suggestion};return[...e,o]})),p=(0,r.M3)(d,a.g,((e,t)=>{var n,r;const{enabled:s,threshold:o}=null!==(r=null===(n=null==t?void 0:t.messages)||void 0===n?void 0:n.timeIndicator)&&void 0!==r?r:{};if(!s)return e;const i=[];let a=null;return e.forEach(((e,t)=>{if(0===t)i.push(Object.assign(Object.assign({},e),{timeIndicator:e.payload.occurredAt}));else{const t=a&&(0,c.Qv)(e.payload.occurredAt-a.payload.occurredAt)>=o?e.payload.occurredAt:void 0;i.push(Object.assign(Object.assign({},e),{timeIndicator:t}))}a=e})),i})),h=()=>(0,s.w1)(p),f=((0,r.M3)(p,(e=>e.map((e=>e.payload.id)))),()=>u().isLoading),m=()=>u().unreadEvents,v=()=>u().loadedImageEventIds,g=()=>u().skiplinkTargetId,y=e=>u().participantInfo.participants[e],b=()=>u().serviceInfo,w=(0,r.M3)(p,(e=>{var t;const n=e.filter((e=>"message"===e.type));return null===(t=n[n.length-1])||void 0===t?void 0:t.payload.id})),x=()=>(0,s.w1)(w),C=()=>u().historyLoaded,_=()=>{const{participants:e,currentAgent:t}=u().participantInfo;return t?e[t]:null},j=e=>u().serviceData[e],E=()=>{const{entryMeta:{options:{text:e},optionsOverride:{text:t}}}=u(),{limit:n}=t||e||{limit:null};return{hasLimit:null!==n,limit:null!==n?n:null}},S=()=>{const{layoutMode:e}=(0,i.EV)();return{isInline:"inline"===e,isWindow:"window"===e,isApp:"app"===e,isResolving:!e}}},3460:(e,t,n)=>{"use strict";n.d(t,{c:()=>m});var r=n(8056),s=n(2328),o=n(4640),i=n(8632),a=n(8416),c=n(5376),l=n(8384),u=n(6736),d=n(2704),p=n(9748),h=n(1880),f=n(1760);const m=()=>{const{t:e}=(0,o.g)(),{isInline:t,isWindow:n,isApp:m}=(0,u.y2)(),{isOpen:v,isVisible:g}=(0,i.uu)(),y=(0,s.w1)(c.e),{start:b,connect:w,apiConfigReady:x,apiConnected:C}=(0,a.c)(),_=(0,r.useRef)(!1),{sendAssertive:j}=(0,l.C)();!function(){const{meta:{originalError:e,action:t}}=(0,p.q)(),n=(0,f.A)(),{reset:s}=(0,a.c)(),o="SeamlySessionExpiredError"===(null==e?void 0:e.name),i=(0,r.useRef)(0),c=(0,r.useRef)(null);(0,r.useEffect)((()=>{if(o&&"reset"===t){if(i.current>=10){c.current=setTimeout((()=>{i.current=0}),1e4);const e=new d.c;return n((0,h.yA)({name:e.name,message:e.message,langKey:e.langKey,originalEvent:e.originalEvent,originalError:e.originalError,action:e.action})),()=>{}}i.current+=1,s()}return()=>{c.current&&clearTimeout(c.current)}}),[t,s,o,n])}(),(0,r.useEffect)((()=>{g&&setTimeout((()=>{j(e("window.srTexts.onLoad"))}),500)}),[g,j,e]),(0,r.useEffect)((()=>{g&&j(e(v?"window.srTexts.onOpen":"window.srTexts.onClose"))}),[v,g,j,e]),(0,r.useEffect)((()=>{x&&C||(_.current=!1)}),[x,C]);const E=(0,r.useCallback)((()=>{return e=void 0,n=void 0,s=function*(){C||(_.current=!0,yield w()),(m||v||g&&t)&&b()},new((r=void 0)||(r=Promise))((function(t,o){function i(e){try{c(s.next(e))}catch(e){o(e)}}function a(e){try{c(s.throw(e))}catch(e){o(e)}}function c(e){var n;e.done?t(e.value):(n=e.value,n instanceof r?n:new r((function(e){e(n)}))).then(i,a)}c((s=s.apply(e,n||[])).next())}));var e,n,r,s}),[C,w,m,t,v,g,b]);(0,r.useEffect)((()=>{!x||_.current||n&&!v||!(!t||g&&y)||E()}),[x,E,t,v,g,n,y])}},9816:(e,t,n)=>{"use strict";n.d(t,{c:()=>i});var r=n(1864),s=n(8412),o=n(9320);const i=()=>{const e=(0,o.Ml)();return(0,r.useSyncExternalStore)(s.c.subscribe,(()=>e.conversation))}},6244:(e,t,n)=>{"use strict";n.d(t,{Iz:()=>r,MJ:()=>p,Qv:()=>f,ay:()=>s,eg:()=>i,gn:()=>h,ic:()=>l,kD:()=>d,mS:()=>u,uG:()=>o,w$:()=>a,wb:()=>c});const r={info:"info",message:"message",participant:"participant",system:"system"},s={choicePrompt:"choice_prompt",text:"text",image:"image",video:"video",participant:"participant",divider:"divider",translation:"translation",message:"message",countdown:"countdown",upload:"upload",cta:"cta",splash:"splash"},o={text:"text",upload:"upload"},i={received:"received",read:"read"},a={pickChoice:"pick_choice",navigate:"navigate",custom:"custom",typing:"typing",read:"read",detachService:"detach_service",interactivityUpdate:"interactivity_update",dismiss:"dismiss",sendTranscript:"send_transcript",setTopic:"set_topic",setTranslation:"set_translation",setContext:"set_context",clickCta:"click_cta",clickCard:"click_card"},c="translation_proposal",l={resumeConversationPrompt:"resume_conversation_prompt",translationProposal:c},u={translationProposal:c,translationChoice:"translation_choice",windowApi:"window_api"},d={assertive:"assertive",polite:"polite"},p={new_topic:"newTopic",new_translation:"newTranslation"},h={sendTranscript:"sendTranscript",typingPeekahead:"typingPeekahead",uploads:"uploads"},f={ask:"ask",navigate:"navigate",topic:"topic"}},2309:(e,t,n)=>{"use strict";n.d(t,{c:()=>r});class r extends Error{action="";langKey="";constructor(e,...t){if(super(...t),Error.captureStackTrace&&Error.captureStackTrace(this,Object.getPrototypeOf(this)),this.originalError=e,e?.payload&&(this.originalEvent=e,this.originalError=e.payload.error,this.message=`Event of type ${e.payload.type} encountered`),!this.message&&e?.message){const t=function(e){try{return JSON.parse(e).error}catch(t){return e}}(e.message);this.message=t}e?.error&&(this.originalError=e.error)}}},3872:(e,t,n)=>{"use strict";n.d(t,{c:()=>s});var r=n(2309);class s extends r.c{constructor(e,...t){super(e,...t),this.name="SeamlyConfigurationError",this.langKey="errors.configError"}}},2704:(e,t,n)=>{"use strict";n.d(t,{c:()=>s});var r=n(2309);class s extends r.c{constructor(e,...t){super(e,...t),this.name="SeamlyGeneralError",this.langKey="errors.general",this.action="reset"}}},8132:(e,t,n)=>{"use strict";n.d(t,{c:()=>s});var r=n(2309);class s extends r.c{constructor(e,...t){super(e,...t),this.name="SeamlyOfflineError",this.langKey="errors.seamlyOffline"}}},6232:(e,t,n)=>{"use strict";n.d(t,{c:()=>s});var r=n(2309);class s extends r.c{constructor(e,...t){super(e,...t),this.name="SeamlySessionExpiredError",this.action="reset"}}},1120:(e,t,n)=>{"use strict";n.d(t,{c:()=>s});var r=n(2309);class s extends r.c{constructor(e,...t){super(e,...t),this.name="SeamlyUnauthorizedError",this.langKey="errors.general",this.action="reset"}}},6280:(e,t,n)=>{"use strict";n.d(t,{c:()=>s});var r=n(2309);class s extends r.c{constructor(e,...t){super(e,...t),this.name="SeamlyUnavailableError",this.langKey="errors.seamlyUnavailable"}}},1888:(e,t,n)=>{"use strict";n.d(t,{w:()=>o});var r=n(2328),s=n(1060);const o=()=>(0,r.w1)(s.E)},3576:(e,t,n)=>{"use strict";n.d(t,{g:()=>s});var r=n(8536);const s=({hasResponded:e,previousVisibility:t,requestedVisibility:n,config:s})=>{const{defaults:o,layoutMode:i,hideOnNoUserResponse:a}=s,{visible:c}=o||{};if("app"===i&&!t)return r.I.open;if("window"===i&&a&&n!==r.I.open)return e?n||t||r.I.open:r.I.hidden;if("inline"===i&&e&&!n)return t||r.I.open;const l=r.I.minimized;return n||t||c||l}},8544:(e,t,n)=>{"use strict";n.d(t,{U:()=>s});var r=n(7548);const s=(...e)=>e.flat().map((e=>"object"==typeof e?Object.entries(e).map((([e,t])=>t?e:"")).join(" "):e)).filter((e=>"string"==typeof e)).map((e=>e.split(" "))).flat().filter((e=>e.length)).map((e=>e.indexOf(r.wm)>-1?e:[r.wm,e].join("-"))).join(" ")},5576:e=>{e.exports=()=>()=>null},1676:(e,t,n)=>{"use strict";function r(){return`_${(Number(String(Math.random()).slice(2))+Date.now()+Math.round(performance.now())).toString(36)}`}n.d(t,{s:()=>r})},5968:(e,t,n)=>{"use strict";n.d(t,{c:()=>r});const r=e=>{const t=e.indexOf("?");return t<0?{url:e,params:{}}:{url:e.slice(0,t),params:e.slice(t+1).split("&").reduce((function(e,t){const[n,r]=t.split("=");return{...e,[n]:decodeURIComponent(r)}}),{})}}},92:(e,t,n)=>{"use strict";n.d(t,{useI18n:()=>r.g,useTranslatedEventData:()=>s.kx});var r=n(4640),s=n(7456);n(2080),n(6204),n(6736),n(3460),n(8416),n(1100)},2080:(e,t,n)=>{"use strict";n.d(t,{c:()=>f});var r=n(9150),s=n(8056),o=n(4640),i=n(7456),a=n(8544),c=n(1676),l=n(7800),u=n(7888),d=n(6204),p=n(6244),h=n(784);const f=({event:e,children:t,...n})=>{const{t:f}=(0,o.g)(),m=(0,d.k3)(),{body:v,subEvent:g,showOptions:y,chooseAgain:b,onChoiceClickHandler:w,onChooseAgainClickHandler:x}=(e=>{const{payload:t}=e,[n,r]=(0,s.useState)(!1),{sendAction:o,addMessageBubble:a,addDivider:l}=(0,d.wv)(),{activeServiceSessionId:u}=(0,d.Ip)(),h=(0,d.SS)(),{body:f}=(0,i.kx)(e),{service:m}=t,v=(0,s.useMemo)((()=>({...e,payload:{...e.payload,body:e.payload.body?.prompt,translatedBody:e.payload.translatedBody&&{...e.payload.translatedBody,data:e.payload.translatedBody.prompt}}})),[e]),g=f.chooseAgain&&u===m.serviceSessionId&&t.id!==h;return(0,s.useEffect)((()=>{r(t.id===h)}),[t,h]),{body:f,subEvent:v,showOptions:n,chooseAgain:g,onChoiceClickHandler:e=>{const n=(0,c.s)();g&&l("new_topic",n),a(e.text,n),o({type:p.w$.pickChoice,originMessage:t.id,choice:{id:e.id,text:e.text,chooseAgain:g},transactionId:n}),r(!1)},onChooseAgainClickHandler:()=>{r((e=>!e))}}})(e);return(0,h.jsxs)(h.Fragment,{children:[(0,r.toChildArray)(t).map((e=>(e.props={...e.props,event:g,descriptorId:m,showTranslationToggle:!1},e))),b&&(0,h.jsxs)("button",{type:"button",className:(0,a.U)("button","button--secondary","button--choose-again"),"aria-expanded":y?"true":"false",onClick:x,"aria-describedby":m,children:[f(y?"message.choicePrompts.cancelChooseAgain":"message.choicePrompts.chooseAgain"),(0,h.jsx)(u.c,{name:"chevronDown",size:"8",alt:""})]}),y&&(0,h.jsx)(l.c,{type:"choice-prompt",showParticipant:!1,event:e,...n,children:(0,h.jsx)("ul",{className:(0,a.U)("choice-prompt","choice-prompt--many"),children:v.choices.map((e=>(0,h.jsx)("li",{className:(0,a.U)("choice-prompt__item",{[`choice-prompt__item--${e.category}`]:e.category}),children:(0,h.jsx)("button",{type:"button",className:(0,a.U)("button","button--primary"),onClick:()=>{w(e)},children:e.text})},e.id)))})})]})}},3792:(e,t,n)=>{"use strict";n.d(t,{c:()=>c});var r=n(5352),s=n(4640),o=n(8544),i=n(6204),a=n(784);const c=({eventPayload:e})=>{const{t}=(0,s.g)(),{fromClient:n,participant:c}=e,l=(0,i.E1)(c)||{},{messages:u}=(0,r.EV)(),d=n?t("participants.user.name"):l&&l.name,{showAvatar:p,showName:h}=u[n?"user":"agent"]||{};if(!p&&!h)return null;const f=[];return p&&d&&l.avatar&&f.push((0,a.jsx)("span",{className:(0,o.U)("message__avatar"),children:(0,a.jsx)("img",{src:l.avatar,className:(0,o.U)("avatar"),alt:""})})),h&&d&&f.push((0,a.jsx)("span",{className:(0,o.U)("message__author-name"),children:d})),f.length>0&&(0,a.jsx)("div",{className:(0,o.U)("message__author"),children:f})}},7800:(e,t,n)=>{"use strict";n.d(t,{c:()=>c});var r=n(7456),s=n(8544),o=n(2796),i=n(3792),a=n(784);const c=function({showParticipant:e=!0,event:t,type:n,modifiers:c,children:l,bodyProps:u={},info:d,...p}){const h=(0,o.l)(t),{hasTranslation:f,isTranslated:m,locale:v}=(0,r.kx)(t);return n&&h.push(`message--type-${n}`),c&&("string"==typeof c&&(c=c.split(" ").filter((e=>e.length))),c.forEach((e=>{h.push(`message--${e}`)}))),m&&h.push("message--is-translated"),f&&h.push("message--has-translation"),m&&(u={...u,lang:v}),(0,a.jsx)(a.Fragment,{children:(0,a.jsxs)("div",{className:(0,s.U)(h),...p,children:[e&&(0,a.jsx)(i.c,{eventPayload:t.payload}),(0,a.jsx)("div",{className:(0,s.U)("message__body"),...u,children:l}),d&&(0,a.jsx)("div",{"aria-hidden":"true",className:(0,s.U)("message__info"),children:d})]})})}},9500:(e,t,n)=>{"use strict";n.d(t,{c:()=>r});const r=(0,n(9150).createContext)(null)},9056:(e,t,n)=>{"use strict";n.d(t,{c:()=>r});const r=(0,n(9150).createContext)({})},6612:(e,t,n)=>{"use strict";n.d(t,{e:()=>r});const r=(0,n(9150).createContext)(null)},2796:(e,t,n)=>{"use strict";n.d(t,{E:()=>s,l:()=>o});var r=n(5352);const s=()=>(0,r.EV)().appContainerClassNames,o=e=>{const{fromClient:t}=e.payload,n=["message"];return"info"===e.type?n.push("message--source-info"):t?n.push("message--source-user"):n.push("message--source-agent"),n}},3480:(e,t,n)=>{"use strict";n.d(t,{Yf:()=>l,e6:()=>d,kX:()=>u,me:()=>c});var r=n(8056),s=n(2328),o=n(3332),i=n(8760),a=n(6736);const c=(e=0)=>new Promise((t=>{setTimeout(t,e)})),l=()=>{const{seamlyContainerElement:e}=(0,a.gf)(),t=(0,s.OY)();return[e,(0,r.useCallback)((e=>{t((0,o.od)(e))}),[t])]},u=e=>(0,r.useCallback)((()=>{var t;t=e,requestAnimationFrame((async()=>{await c(180);const e="string"==typeof t?document.getElementById(t):t;(0,i.O8)(e)}))}),[e]),d=()=>{const e=(0,a.OK)();return u(e)}},8384:(e,t,n)=>{"use strict";n.d(t,{C:()=>i});var r=n(8056),s=n(6612),o=n(6244);const i=()=>{const e=(0,r.useContext)(s.e);return{sendPolite:(0,r.useCallback)((t=>{t&&e({ariaLive:o.kD.polite,messageText:t})}),[e]),sendAssertive:(0,r.useCallback)((t=>{t&&e({ariaLive:o.kD.assertive,messageText:t})}),[e])}}},6204:(e,t,n)=>{"use strict";n.d(t,{kX:()=>s.kX,kV:()=>l.kV,A9:()=>u,uc:()=>d,k3:()=>x.k3,SS:()=>l.SS,CE:()=>p.C,a:()=>v,GU:()=>g.c,Ml:()=>h.Ml,EF:()=>o.E,wv:()=>y.c,Y5:()=>h.Y5,KC:()=>l.KC,sD:()=>b.c,Ir:()=>l.Ir,sJ:()=>l.sJ,y2:()=>l.y2,li:()=>o.l,Yj:()=>m,E1:()=>l.E1,AL:()=>w.c,Ip:()=>l.Ip,I7:()=>l.I7,OK:()=>l.OK,e6:()=>s.e6,W_:()=>x.W_});var r=n(8056),s=(n(9816),n(3480)),o=n(2796),i=n(2328),a=n(3332),c=n(9056),l=n(6736);const u=()=>{const{showFileUpload:e,entryMeta:{options:t,optionsOverride:n},options:{features:{uploads:r}}}=(0,l.gf)(),{allowedMimeTypes:s,maxSize:o}=n.upload||{},{enabled:i,enabledFromEntry:a}=r||{},{allowedMimeTypes:c,maxSize:u}={...t.upload||{allowedMimeTypes:[],maxSize:0},...s?{allowedMimeTypes:s}:{},...o?{maxSize:o}:{}};return{showFileUpload:e,accountAllowsUploads:!!r,serviceAllowsUploads:a||i,allowedMimeTypes:c,maxSize:u}},d=()=>{const{currentUploads:e}=(0,l.gf)(),t=(0,i.OY)(),n=(0,r.useContext)(c.c);return{uploadFile:(0,r.useCallback)((e=>{n(e)}),[n]),clearUploads:(0,r.useCallback)((()=>{t((0,a.ML)())}),[t]),currentUploads:e,isUploading:e.some((e=>e.uploading)),isComplete:e.every((e=>e.complete))}};var p=n(8384),h=n(9320),f=n(4640);const m=()=>{const{t:e}=(0,f.g)(),{options:t}=(0,l.gf)(),{panelActive:n,optionActive:s,userSelectedOptions:o,features:c}=t,{extraMenuItem:u,sendTranscript:d}=c,p={extraMenuItem:u,sendTranscript:d},m=t=>"extraMenuItem"===t?"Extra menu item":e(`options.${t}.menuTitle`),v=Object.keys(p).filter((e=>p[e])).map((e=>({name:e,title:m(e),available:p[e].enabled}))),g=u||d,y=(0,i.OY)(),{get:b,set:w}=(0,h.cb)();return{allowOptionSelection:g,userSelectedOptions:o,features:c,menuOptions:v,initUserSelectedOptions:(0,r.useCallback)((()=>{const e=b("options")||{};y((0,a.IF)(e))}),[b,y]),setUserSelectedOptions:(0,r.useCallback)((e=>{y((0,a.IF)(e)),w("options",e)}),[w,y]),setUserSelectedOption:(0,r.useCallback)(((e,t)=>{const n=b("options")||{};w("options",{...n,[e]:t}),y((0,a.eK)({option:e,value:t}))}),[y,b,w]),showOption:e=>{y((0,a.ER)(e))},hideOption:()=>{y((0,a.Ur)())},panelActive:n,optionActive:s}},v=()=>{const{optionsButtonId:e}=(0,l.gf)();return{id:e,focusButton:(0,s.kX)(e)}};var g=n(7268),y=(n(3460),n(8416)),b=n(952),w=n(152),x=n(1100)},7268:(e,t,n)=>{"use strict";n.d(t,{c:()=>o});var r=n(8056),s=n(9500);const o=()=>(0,r.useContext)(s.c)},8416:(e,t,n)=>{"use strict";n.d(t,{c:()=>y});var r=n(8056),s=n(2328),o=n(7548),i=n(232),a=n(1888),c=n(428),l=n(1880),u=n(3332),d=n(8536),p=n(8632),h=n(1676),f=n(5308),m=n(6244),v=n(9320),g=n(6736);const y=()=>{const e=(0,v.Ml)(),t=(0,s.OY)(),n=(0,r.useContext)(f.E),y=(0,a.w)(),b=(0,v.aJ)(),{visible:w,setVisibility:x}=(0,p.uu)(),C=(0,g.I7)(),_=(0,r.useCallback)(((...e)=>{n.emit(...e)}),[n]),j=(0,r.useCallback)((()=>{_("ui.beforeStart",{visibility:w,hasConversation:b(),hasResponded:y,unreadMessageCount:C}),e.send("start"),_("ui.start",{visibility:w,hasConversation:b(),hasResponded:y,unreadMessageCount:C})}),[e,_,b,y,C,w]),E=(0,r.useCallback)((async()=>{t(i.C())}),[t]),S=(0,r.useCallback)((e=>({type:e,id:(0,h.s)(),transactionId:(0,h.s)(),participant:o.kr,fromClient:!0,occurredAt:1e3*Date.now(),meta:{}})),[]),T=(0,r.useCallback)((e=>({...S("text"),body:{text:e}})),[S]),k=(0,r.useCallback)((({body:n,config:r={}})=>{if(""===n.trim())return;const s={...T(n),...r};e.send("message",s),_("message",s),t((0,u.Ux)({type:"message",payload:{...s,optimisticallyInjected:!0}}))}),[e,t,_,T]),O=(0,r.useCallback)(((e,n=(0,h.s)())=>{t((0,u.Ux)({type:"message",payload:{...T(e),transactionId:n}}))}),[t,T]),N=(0,r.useCallback)(((e,n,r,s,i,a,c)=>{t((0,u.Ux)({type:"message",payload:{type:"upload",id:e,transactionId:n,participant:o.kr,fromClient:!0,occurredAt:r,meta:{},body:{contentType:s,filename:i,filesize:a,url:c}}}))}),[t]),I=(0,r.useCallback)(((e,n=(0,h.s)())=>{const r={body:{subtype:e,type:"divider"},fromClient:!1,fromHistory:!0,id:(0,h.s)(),transactionId:n,type:"divider"};t((0,u.Ux)({type:"info",payload:r}))}),[t]),U=(0,r.useCallback)((t=>{if(!t)return;e.send("action",t);const{type:n}=t;n!==m.w$.typing&&n!==m.w$.read&&_(`action.${n}`,t)}),[e,_]),A=(0,r.useCallback)((t=>{e.sendContext(t)}),[e]);return{connect:(0,r.useCallback)((()=>e.connected?Promise.reject(new Error("The API is already connected")):e.connect().then((e=>{e&&(t((0,u.cN)(e)),e.userResponded&&(t((0,c.N8)(e.userResponded)),x(d.I.open)))})).catch((e=>{t((0,l.yA)({name:e?.name,message:e?.message,langKey:e?.langKey,action:e?.action,originalEvent:e?.originalEvent,originalError:e?.originalError}))}))),[e,t,x]),start:j,sendMessage:k,sendAction:U,sendContext:A,reset:E,emitEvent:_,addMessageBubble:O,addUploadBubble:N,addDivider:I,apiConnected:e.connected,apiConfigReady:e.configReady}}},952:(e,t,n)=>{"use strict";n.d(t,{c:()=>f});var r=n(8056),s=n(2328),o=n(7548),i=n(4640),a=n(3332),c=n(8632),l=n(8760),u=n(6244),d=n(8384),p=n(6736),h=n(8416);const f=()=>{const e=(0,s.OY)(),{idleDetachCountdown:t}=(0,p.gf)(),{isOpen:n}=(0,c.uu)(),f=(0,r.useRef)({});f.current={hasCountdown:t.hasCountdown,isActive:t.isActive,remaining:t.remaining,wasStopped:t.wasStopped,isOpen:n};const{emitEvent:m,sendAction:v}=(0,h.c)(),{t:g}=(0,i.g)(),{sendAssertive:y,sendPolite:b}=(0,d.C)(),w=(0,r.useCallback)((e=>{const{isOpen:t}=f.current;t&&y(e)}),[y]),x=(0,r.useCallback)((e=>{const{isOpen:t}=f.current;t&&b(e)}),[b]),C=(0,r.useCallback)((t=>{const n=(0,l.Ub)(t),r=(0,l.s3)(n);e((0,a.gB)({delaySeconds:n,delayTime:r})),m("idleTimer.start"),w(`${g("idleDetachWarning.countdownTitle")} ${g("idleDetachWarning.countdownText")} ${g("idleDetachWarning.countdownTimer",r)}`)}),[e,m,w,g]),_=(0,r.useCallback)(((t,n)=>{const{hasCountdown:r,wasStopped:s}=f.current;r&&(t||(n||v({type:u.w$.detachService}),w(g("idleDetachWarning.notifyTransferText"))),s||m("idleTimer.stop"),e((0,a.aD)()))}),[e,v,m,w,g]),j=(0,r.useCallback)((()=>{const{remaining:t}=f.current;if(t<=0)return;const n=t-1;n%o.sB==0&&w(`${g("idleDetachWarning.countdownText")} ${g("idleDetachWarning.countdownTimer",(0,l.s3)(n))}`),e((0,a.I1)())}),[e,w,g]),E=(0,r.useCallback)((()=>{const{isActive:t,remaining:n}=f.current;t&&(e((0,a.e_)()),n&&(m("idleTimer.stop"),x(g("idleDetachWarning.srCountDownStoppedText"))))}),[e,m,x,g]);return{...t,initCountdown:C,endCountdown:_,decrementCountdown:j,stopCountdown:E}}},152:(e,t,n)=>{"use strict";n.d(t,{c:()=>u});var r=n(2328),s=n(4640),o=n(3332),i=n(6244),a=n(8384),c=n(6736),l=n(8416);const u=()=>{const e=(0,r.OY)(),t=(0,c.gf)().resumeConversationPrompt,{sendAction:n}=(0,l.c)(),{t:u}=(0,s.g)(),{sendAssertive:d}=(0,a.C)();return{continueChat:()=>{n({type:i.w$.dismiss,body:{type:i.ic.resumeConversationPrompt}}),e((0,o.M5)())},hasPrompt:t,restartChat:()=>{d(u("resumeConversationPrompt.srNotifyRestartText")),n({type:i.w$.detachService}),e((0,o.M5)())}}}},1100:(e,t,n)=>{"use strict";n.d(t,{W_:()=>a,ei:()=>o,k3:()=>i});var r=n(8056),s=n(1676);const o=()=>{const[e,t]=(0,r.useReducer)((e=>e+1),0);return(0,r.useCallback)((()=>{setTimeout((()=>{t()}))}),[])},i=()=>{const[e]=(0,r.useState)((()=>(0,s.s)()));return e},a=e=>{const t=(0,r.useRef)(null);t.current=e;const n="function"==typeof e;return(0,r.useMemo)((()=>n?(...e)=>t.current(...e):void 0),[n])}},8760:(e,t,n)=>{"use strict";n.d(t,{Av:()=>s,Cu:()=>r,IB:()=>c,O8:()=>p,Qv:()=>i,Ub:()=>o,aG:()=>f,gP:()=>d,gl:()=>m,qn:()=>v,s3:()=>a,sH:()=>u,wN:()=>h});const r=(e,t)=>{let n;return function(...r){let s=!1;return clearTimeout(n),n=setTimeout((()=>{n=null,s||e.apply(this,r),s=!1}),t),t=>{s=!0,t&&e.apply(this,r)}}},s=()=>{const e=[],t=[];return document.querySelectorAll('body > *:not([role="dialog"])').forEach((n=>{const r=n.getAttribute("aria-hidden");null!==r&&"false"!==r||(e.push(r),t.push(n),n.setAttribute("aria-hidden","true"))})),()=>{t.forEach(((t,n)=>{const r=e[n];null===r?t.removeAttribute("aria-hidden"):t.setAttribute("aria-hidden",r)}))}},o=e=>Math.ceil(e/1e3),i=e=>Math.ceil(e/1e3),a=e=>{const t=Math.floor(e/60);return{minutes:t,seconds:e-60*t}},c=(e,t=2)=>{if(0===e)return"0 Bytes";const n=t<0?0:t,r=Math.floor(Math.log(e)/Math.log(1024));return`${parseFloat((e/1024**r).toFixed(n))} ${["Bytes","KB","MB","GB","TB","PB","EB","ZB","YB"][r]}`},l={27:"Escape",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown"},u={Escape:"Escape",End:"End",Home:"Home",ArrowLeft:"ArrowLeft",ArrowUp:"ArrowUp",ArrowRight:"ArrowRight",ArrowDown:"ArrowDown"},d=e=>e.code?u[e.code]:l[e.keyCode],p=e=>{e&&e.focus()},h=(e,t)=>{e&&(e.contains(document.activeElement)||e===document.activeElement)&&t()},f=(e,t)=>{const n=new Date(t).setHours(0,0,0,0),r=e.getTime(),s=864e5;return r>=n+s?e:r>n?"today":r>n-s?"yesterday":e},m=(e,t)=>t.reduce(((t,n)=>(n in e&&(t[n]=e[n]),t)),{}),v=(e,t)=>Object.keys(e).reduce(((n,r)=>(t.includes(r)||(n[r]=e[r]),n)),{})},1792:e=>{e.exports=function(e){var t={},n=[];(e=e||this).on=function(n,r,s){return(t[n]=t[n]||[]).push([r,s]),e},e.off=function(r,s){r||(t={});for(var o=t[r]||n,i=o.length=s?o.length:0;i--;)s==o[i][0]&&o.splice(i,1);return e},e.emit=function(r){for(var s,o=t[r]||n,i=o.length>0?o.slice(0,o.length):o,a=0;s=i[a++];)s[0].apply(s[1],n.slice.call(arguments,1));return e}}},144:(e,t,n)=>{"use strict";n.r(t),n.d(t,{Children:()=>f,Component:()=>r.Component,Fragment:()=>r.Fragment,PureComponent:()=>c,StrictMode:()=>ee,Suspense:()=>b,SuspenseList:()=>C,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:()=>H,cloneElement:()=>Y,createContext:()=>r.createContext,createElement:()=>r.createElement,createFactory:()=>W,createPortal:()=>S,createRef:()=>r.createRef,default:()=>ce,findDOMNode:()=>X,flushSync:()=>Z,forwardRef:()=>p,hydrate:()=>R,isElement:()=>oe,isFragment:()=>G,isValidElement:()=>q,lazy:()=>x,memo:()=>l,render:()=>A,startTransition:()=>te,unmountComponentAtNode:()=>J,unstable_batchedUpdates:()=>Q,useDeferredValue:()=>ne,useInsertionEffect:()=>se,useSyncExternalStore:()=>ie,useTransition:()=>re,version:()=>K});var r=n(9150),s=n(8056),o={};for(const e in s)["default","Component","Fragment","createContext","createElement","createRef","Children","PureComponent","StrictMode","Suspense","SuspenseList","__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED","cloneElement","createFactory","createPortal","findDOMNode","flushSync","forwardRef","hydrate","isElement","isFragment","isValidElement","lazy","memo","render","startTransition","unmountComponentAtNode","unstable_batchedUpdates","useDeferredValue","useInsertionEffect","useSyncExternalStore","useTransition","version"].indexOf(e)<0&&(o[e]=()=>s[e]);function i(e,t){for(var n in t)e[n]=t[n];return e}function a(e,t){for(var n in e)if("__source"!==n&&!(n in t))return!0;for(var r in t)if("__source"!==r&&e[r]!==t[r])return!0;return!1}function c(e){this.props=e}function l(e,t){function n(e){var n=this.props.ref,r=n==e.ref;return!r&&n&&(n.call?n(null):n.current=null),t?!t(this.props,e)||!r:a(this.props,e)}function s(t){return this.shouldComponentUpdate=n,(0,r.createElement)(e,t)}return s.displayName="Memo("+(e.displayName||e.name)+")",s.prototype.isReactComponent=!0,s.__f=!0,s}n.d(t,o),(c.prototype=new r.Component).isPureReactComponent=!0,c.prototype.shouldComponentUpdate=function(e,t){return a(this.props,e)||a(this.state,t)};var u=r.options.__b;r.options.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),u&&u(e)};var d="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.forward_ref")||3911;function p(e){function t(t){var n=i({},t);return delete n.ref,e(n,t.ref||null)}return t.$$typeof=d,t.render=t,t.prototype.isReactComponent=t.__f=!0,t.displayName="ForwardRef("+(e.displayName||e.name)+")",t}var h=function(e,t){return null==e?null:(0,r.toChildArray)((0,r.toChildArray)(e).map(t))},f={map:h,forEach:h,count:function(e){return e?(0,r.toChildArray)(e).length:0},only:function(e){var t=(0,r.toChildArray)(e);if(1!==t.length)throw"Children.only";return t[0]},toArray:r.toChildArray},m=r.options.__e;r.options.__e=function(e,t,n,r){if(e.then)for(var s,o=t;o=o.__;)if((s=o.__c)&&s.__c)return null==t.__e&&(t.__e=n.__e,t.__k=n.__k),s.__c(e,t);m(e,t,n,r)};var v=r.options.unmount;function g(e,t,n){return e&&(e.__c&&e.__c.__H&&(e.__c.__H.__.forEach((function(e){"function"==typeof e.__c&&e.__c()})),e.__c.__H=null),null!=(e=i({},e)).__c&&(e.__c.__P===n&&(e.__c.__P=t),e.__c=null),e.__k=e.__k&&e.__k.map((function(e){return g(e,t,n)}))),e}function y(e,t,n){return e&&n&&(e.__v=null,e.__k=e.__k&&e.__k.map((function(e){return y(e,t,n)})),e.__c&&e.__c.__P===t&&(e.__e&&n.appendChild(e.__e),e.__c.__e=!0,e.__c.__P=n)),e}function b(){this.__u=0,this.t=null,this.__b=null}function w(e){var t=e.__.__c;return t&&t.__a&&t.__a(e)}function x(e){var t,n,s;function o(o){if(t||(t=e()).then((function(e){n=e.default||e}),(function(e){s=e})),s)throw s;if(!n)throw t;return(0,r.createElement)(n,o)}return o.displayName="Lazy",o.__f=!0,o}function C(){this.u=null,this.o=null}r.options.unmount=function(e){var t=e.__c;t&&t.__R&&t.__R(),t&&32&e.__u&&(e.type=null),v&&v(e)},(b.prototype=new r.Component).__c=function(e,t){var n=t.__c,r=this;null==r.t&&(r.t=[]),r.t.push(n);var s=w(r.__v),o=!1,i=function(){o||(o=!0,n.__R=null,s?s(a):a())};n.__R=i;var a=function(){if(! --r.__u){if(r.state.__a){var e=r.state.__a;r.__v.__k[0]=y(e,e.__c.__P,e.__c.__O)}var t;for(r.setState({__a:r.__b=null});t=r.t.pop();)t.forceUpdate()}};r.__u++||32&t.__u||r.setState({__a:r.__b=r.__v.__k[0]}),e.then(i,i)},b.prototype.componentWillUnmount=function(){this.t=[]},b.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var n=document.createElement("div"),s=this.__v.__k[0].__c;this.__v.__k[0]=g(this.__b,n,s.__O=s.__P)}this.__b=null}var o=t.__a&&(0,r.createElement)(r.Fragment,null,e.fallback);return o&&(o.__u&=-33),[(0,r.createElement)(r.Fragment,null,t.__a?null:e.children),o]};var _=function(e,t,n){if(++n[1]===n[0]&&e.o.delete(t),e.props.revealOrder&&("t"!==e.props.revealOrder[0]||!e.o.size))for(n=e.u;n;){for(;n.length>3;)n.pop()();if(n[1]<n[0])break;e.u=n=n[2]}};function j(e){return this.getChildContext=function(){return e.context},e.children}function E(e){var t=this,n=e.i;t.componentWillUnmount=function(){(0,r.render)(null,t.l),t.l=null,t.i=null},t.i&&t.i!==n&&t.componentWillUnmount(),t.l||(t.i=n,t.l={nodeType:1,parentNode:n,childNodes:[],appendChild:function(e){this.childNodes.push(e),t.i.appendChild(e)},insertBefore:function(e,n){this.childNodes.push(e),t.i.appendChild(e)},removeChild:function(e){this.childNodes.splice(this.childNodes.indexOf(e)>>>1,1),t.i.removeChild(e)}}),(0,r.render)((0,r.createElement)(j,{context:t.context},e.__v),t.l)}function S(e,t){var n=(0,r.createElement)(E,{__v:e,i:t});return n.containerInfo=t,n}(C.prototype=new r.Component).__a=function(e){var t=this,n=w(t.__v),r=t.o.get(e);return r[0]++,function(s){var o=function(){t.props.revealOrder?(r.push(s),_(t,e,r)):s()};n?n(o):o()}},C.prototype.render=function(e){this.u=null,this.o=new Map;var t=(0,r.toChildArray)(e.children);e.revealOrder&&"b"===e.revealOrder[0]&&t.reverse();for(var n=t.length;n--;)this.o.set(t[n],this.u=[1,0,this.u]);return e.children},C.prototype.componentDidUpdate=C.prototype.componentDidMount=function(){var e=this;this.o.forEach((function(t,n){_(e,n,t)}))};var T="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,k=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,O=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,N=/[A-Z0-9]/g,I="undefined"!=typeof document,U=function(e){return("undefined"!=typeof Symbol&&"symbol"==typeof Symbol()?/fil|che|rad/:/fil|che|ra/).test(e)};function A(e,t,n){return null==t.__k&&(t.textContent=""),(0,r.render)(e,t),"function"==typeof n&&n(),e?e.__c:null}function R(e,t,n){return(0,r.hydrate)(e,t),"function"==typeof n&&n(),e?e.__c:null}r.Component.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach((function(e){Object.defineProperty(r.Component.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})}));var M=r.options.event;function P(){}function L(){return this.cancelBubble}function D(){return this.defaultPrevented}r.options.event=function(e){return M&&(e=M(e)),e.persist=P,e.isPropagationStopped=L,e.isDefaultPrevented=D,e.nativeEvent=e};var F,B={enumerable:!1,configurable:!0,get:function(){return this.class}},z=r.options.vnode;r.options.vnode=function(e){"string"==typeof e.type&&function(e){var t=e.props,n=e.type,s={};for(var o in t){var i=t[o];if(!("value"===o&&"defaultValue"in t&&null==i||I&&"children"===o&&"noscript"===n||"class"===o||"className"===o)){var a=o.toLowerCase();"defaultValue"===o&&"value"in t&&null==t.value?o="value":"download"===o&&!0===i?i="":"ondoubleclick"===a?o="ondblclick":"onchange"!==a||"input"!==n&&"textarea"!==n||U(t.type)?"onfocus"===a?o="onfocusin":"onblur"===a?o="onfocusout":O.test(o)?o=a:-1===n.indexOf("-")&&k.test(o)?o=o.replace(N,"-$&").toLowerCase():null===i&&(i=void 0):a=o="oninput","oninput"===a&&s[o=a]&&(o="oninputCapture"),s[o]=i}}"select"==n&&s.multiple&&Array.isArray(s.value)&&(s.value=(0,r.toChildArray)(t.children).forEach((function(e){e.props.selected=-1!=s.value.indexOf(e.props.value)}))),"select"==n&&null!=s.defaultValue&&(s.value=(0,r.toChildArray)(t.children).forEach((function(e){e.props.selected=s.multiple?-1!=s.defaultValue.indexOf(e.props.value):s.defaultValue==e.props.value}))),t.class&&!t.className?(s.class=t.class,Object.defineProperty(s,"className",B)):(t.className&&!t.class||t.class&&t.className)&&(s.class=s.className=t.className),e.props=s}(e),e.$$typeof=T,z&&z(e)};var $=r.options.__r;r.options.__r=function(e){$&&$(e),F=e.__c};var V=r.options.diffed;r.options.diffed=function(e){V&&V(e);var t=e.props,n=e.__e;null!=n&&"textarea"===e.type&&"value"in t&&t.value!==n.value&&(n.value=null==t.value?"":t.value),F=null};var H={ReactCurrentDispatcher:{current:{readContext:function(e){return F.__n[e.__c].props.value}}}},K="17.0.2";function W(e){return r.createElement.bind(null,e)}function q(e){return!!e&&e.$$typeof===T}function G(e){return q(e)&&e.type===r.Fragment}function Y(e){return q(e)?r.cloneElement.apply(null,arguments):e}function J(e){return!!e.__k&&((0,r.render)(null,e),!0)}function X(e){return e&&(e.base||1===e.nodeType&&e)||null}var Q=function(e,t){return e(t)},Z=function(e,t){return e(t)},ee=r.Fragment;function te(e){e()}function ne(e){return e}function re(){return[!1,te]}var se=s.useLayoutEffect,oe=q;function ie(e,t){var n=t(),r=(0,s.useState)({h:{__:n,v:t}}),o=r[0].h,i=r[1];return(0,s.useLayoutEffect)((function(){o.__=n,o.v=t,ae(o)&&i({h:o})}),[e,n,t]),(0,s.useEffect)((function(){return ae(o)&&i({h:o}),e((function(){ae(o)&&i({h:o})}))}),[e]),n}function ae(e){var t,n,r=e.v,s=e.__;try{var o=r();return!((t=s)===(n=o)&&(0!==t||1/t==1/n)||t!=t&&n!=n)}catch(e){return!0}}var ce={useState:s.useState,useId:s.useId,useReducer:s.useReducer,useEffect:s.useEffect,useLayoutEffect:s.useLayoutEffect,useInsertionEffect:se,useTransition:re,useDeferredValue:ne,useSyncExternalStore:ie,startTransition:te,useRef:s.useRef,useImperativeHandle:s.useImperativeHandle,useMemo:s.useMemo,useCallback:s.useCallback,useContext:s.useContext,useDebugValue:s.useDebugValue,version:"17.0.2",Children:f,render:A,hydrate:R,unmountComponentAtNode:J,createPortal:S,createElement:r.createElement,createContext:r.createContext,createFactory:W,cloneElement:Y,createRef:r.createRef,Fragment:r.Fragment,isValidElement:q,isElement:oe,isFragment:G,findDOMNode:X,Component:r.Component,PureComponent:c,memo:l,forwardRef:p,flushSync:Z,unstable_batchedUpdates:Q,StrictMode:ee,Suspense:b,SuspenseList:C,lazy:x,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:H}},7888:(e,t,n)=>{"use strict";n.d(t,{c:()=>i});var r=n(784),s=n(8544);const o={send:{32:'<svg xmlns="http://www.w3.org/2000/svg" width="32px" height="32px" x="0px" y="0px" viewBox="0 0 32 32"><defs/><path fill="#4A48C1" d="M6.714,14.985l17.837-7.906c0.681-0.302,1.414,0.301,1.25,1.027L22.273,23.59\tc-0.13,0.566-0.751,0.865-1.275,0.613l-3.623-1.752l-2.334,2.287c-0.572,0.562-1.538,0.156-1.538-0.645V21.01\tc0-0.217,0.078-0.43,0.222-0.594l7.676-8.841l-10.414,7.472l-4.351-2.445C5.987,16.236,6.033,15.287,6.714,14.985L6.714,14.985z"/></svg>'},balloon:{32:'<svg xmlns="http://www.w3.org/2000/svg" width="32px" height="32px" x="0px" y="0px" viewBox="0 0 32 32"><defs/><path fill="#4A48C1" d="M24,10.824v10.375c0,1.104-0.896,2-2,2h-4.694l-4.931,3.625v-3.625H10c-1.104,0-2-0.896-2-2V10.824\tc0-1.104,0.896-2,2-2h12C23.104,8.824,24,9.719,24,10.824z"/></svg>'},newTopic:{32:'<svg xmlns="http://www.w3.org/2000/svg" width="32px" height="32px" x="0px" y="0px" viewBox="0 0 32 32"><path fill="#4A48C1" d="M16,8.593l2.407,4.573l5.093,0.876l-3.604,3.702l0.74,5.115L16,20.574l-4.634,2.285l0.739-5.115L8.5,14.042\tl5.094-0.876L16,8.593z"/></svg>'},newTranslation:{16:'<svg xmlns="http://www.w3.org/2000/svg" x="0px" y="0px" viewBox="0 0 16 16"><path fill="#4A48C1" d="M8,0C3.6,0,0,3.6,0,8s3.6,8,8,8s8-3.6,8-8S12.4,0,8,0z M14.1,7.1h-1.4c-0.1-1.5-0.4-2.9-1-4\tC13,4,13.9,5.4,14.1,7.1z M7.1,2.1v5H5C5.2,4.7,6.1,2.9,7.1,2.1z M7.1,8.9v5c-1-0.7-1.9-2.5-2.1-5H7.1z M8.9,13.9v-5H11\tC10.8,11.3,9.9,13.2,8.9,13.9z M8.9,7.1v-5c1,0.7,1.9,2.5,2.1,5H8.9z M4.2,3.1c-0.5,1.1-0.9,2.5-1,4H1.9C2.1,5.4,3,4,4.2,3.1z M1.9,8.9h1.4c0.1,1.5,0.4,2.9,1,4C3,12,2.1,10.5,1.9,8.9z M11.8,12.9c0.5-1.1,0.9-2.5,1-4h1.4C13.9,10.5,13,12,11.8,12.9z"/></svg>',32:'<svg xmlns="http://www.w3.org/2000/svg" x="0px" y="0px" viewBox="0 0 32 32"><path fill="#4A48C1" d="M16,7c-4.9,0-9,4.1-9,9s4.1,9,9,9s9-4.1,9-9S20.9,7,16,7z M22.9,15h-1.6c-0.1-1.7-0.5-3.3-1.1-4.5\tC21.6,11.5,22.6,13.1,22.9,15z M15,9.4V15h-2.3C12.9,12.3,13.9,10.2,15,9.4z M15,17v5.6c-1.1-0.8-2.1-2.9-2.3-5.6H15z M17,22.6V17\th2.3C19.1,19.8,18.1,21.8,17,22.6z M17,15V9.4c1.1,0.8,2.1,2.9,2.3,5.6H17z M11.8,10.4c-0.6,1.3-1,2.8-1.1,4.5H9.1\tC9.4,13.1,10.4,11.5,11.8,10.4z M9.1,17h1.6c0.1,1.7,0.5,3.3,1.1,4.5C10.4,20.5,9.4,18.9,9.1,17z M20.2,21.5c0.6-1.3,1-2.8,1.1-4.5\th1.6C22.6,18.8,21.6,20.5,20.2,21.5z"/></svg>'},avatar:{32:'<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"\n\t viewBox="0 0 32 32" enable-background="new 0 0 32 32" xml:space="preserve">\n<path fill="#4A48C1" d="M10,14.8c-1.1,0-2-0.9-2-2s0.9-2,2-2s2,0.9,2,2S11.1,14.8,10,14.8z M15.9,14.8c1.1,0,2-0.9,2-2s-0.9-2-2-2\n\ts-2,0.9-2,2S14.8,14.8,15.9,14.8z M21.8,10.8c-1.1,0-2,0.9-2,2s0.9,2,2,2s2-0.9,2-2S22.9,10.8,21.8,10.8z M21.3,18.1H10.7\n\tC11.7,23.9,20.2,23.9,21.3,18.1z"/>\n</svg>\n'},chevronDown:{8:'<svg xmlns="http://www.w3.org/2000/svg" width="8px" height="8px" x="0px" y="0px" viewBox="0 0 8 8"><defs/><path fill="#4A48C1" d="M-0.001,2.876c0-0.247,0.091-0.494,0.273-0.688c0.38-0.401,1.013-0.418,1.414-0.039l1.938,1.834\tc0.199,0.188,0.547,0.188,0.746,0L6.31,2.15c0.401-0.379,1.034-0.362,1.414,0.04c0.379,0.401,0.361,1.034-0.04,1.414L5.745,5.437\tC4.782,6.35,3.213,6.35,2.249,5.436L0.311,3.603C0.103,3.406-0.001,3.142-0.001,2.876z"/></svg>',32:'<svg xmlns="http://www.w3.org/2000/svg" width="32px" height="32px" x="0px" y="0px" viewBox="0 0 32 32"><defs/><path fill="#4A48C1" d="M16,20.425c-0.782,0-1.563-0.291-2.159-0.874l-6.541-6.408c-0.395-0.387-0.401-1.02-0.015-1.414\tc0.387-0.394,1.021-0.4,1.414-0.015l6.541,6.408c0.42,0.409,1.102,0.409,1.52-0.001l6.541-6.407c0.396-0.386,1.028-0.38,1.414,0.015\tc0.387,0.395,0.381,1.027-0.014,1.414l-6.541,6.407C17.563,20.133,16.782,20.425,16,20.425z"/></svg>'},chevronRight:{8:'<svg xmlns="http://www.w3.org/2000/svg" width="8px" height="8px" x="0px" y="0px" viewBox="0 0 8 8"><defs/><path fill="#4A48C1" d="M2.875,7.998c-0.247,0-0.494-0.091-0.688-0.273c-0.401-0.38-0.418-1.013-0.039-1.414l1.834-1.938\tc0.188-0.199,0.188-0.547,0-0.746l-1.835-1.94c-0.379-0.401-0.362-1.034,0.04-1.414s1.034-0.361,1.414,0.04l1.834,1.939\tc0.913,0.963,0.913,2.532-0.001,3.496L3.601,7.686C3.405,7.894,3.14,7.998,2.875,7.998z"/></svg>',16:'<svg xmlns="http://www.w3.org/2000/svg" width="16px" height="16px" x="0px" y="0px" viewBox="0 0 16 16"><defs/><path fill="#4A48C1" d="M6.5,13c-0.247,0-0.494-0.091-0.687-0.273c-0.401-0.38-0.419-1.013-0.04-1.414L8.22,8.727\tc0.373-0.394,0.373-1.06,0-1.454L5.773,4.687c-0.379-0.401-0.362-1.034,0.04-1.414c0.4-0.378,1.034-0.362,1.414,0.04l2.446,2.586\tc1.096,1.159,1.096,3.043,0,4.203l-2.446,2.586C7.03,12.896,6.765,13,6.5,13z"/></svg>'},close:{8:'<svg xmlns="http://www.w3.org/2000/svg" width="8px" height="8px" x="0px" y="0px" viewBox="0 0 8 8"><defs/><path fill="#4A48C1" d="M7.705,7.729C7.511,7.923,7.255,8.02,7,8.02c-0.257,0-0.514-0.099-0.709-0.295L4,5.423L1.709,7.725\tC1.513,7.921,1.257,8.02,1,8.02c-0.255,0-0.51-0.097-0.706-0.291c-0.391-0.39-0.393-1.022-0.003-1.414l2.298-2.309l-2.27-2.28\tC-0.07,1.334-0.068,0.701,0.323,0.311c0.392-0.389,1.024-0.387,1.415,0.003L4,2.587l2.263-2.274C6.653-0.077,7.287-0.079,7.677,0.31\tC8.068,0.7,8.07,1.333,7.681,1.725l-2.27,2.281l2.298,2.309C8.099,6.705,8.097,7.339,7.705,7.729z"/></svg>',16:'<svg xmlns="http://www.w3.org/2000/svg" width="16px" height="16px" x="0px" y="0px" viewBox="0 0 16 16"><defs/><path fill="#4A48C1" d="M12.709,11.295L9.411,7.982l3.262-3.276c0.39-0.392,0.388-1.024-0.004-1.414\tc-0.39-0.39-1.023-0.388-1.414,0.003L8,6.564L4.746,3.295C4.357,2.904,3.724,2.903,3.332,3.292C2.94,3.682,2.939,4.315,3.329,4.707\tl3.261,3.275l-3.298,3.313c-0.39,0.391-0.388,1.024,0.003,1.414C3.49,12.903,3.745,13,4,13c0.257,0,0.513-0.099,0.708-0.295L8,9.399\tl3.291,3.306C11.486,12.901,11.743,13,12,13c0.255,0,0.511-0.097,0.705-0.291C13.097,12.319,13.099,11.686,12.709,11.295z"/></svg>'},enlarge:{32:'<svg xmlns="http://www.w3.org/2000/svg" width="32px" height="32px" x="0px" y="0px" viewBox="0 0 32 32"><defs/><path fill="#4A48C1" d="M24,9v6.5c0,0.552-0.447,1-1,1s-1-0.448-1-1v-4.086L11.414,22H15.5c0.552,0,1,0.447,1,1s-0.448,1-1,1H9\tc-0.13,0-0.26-0.026-0.382-0.077c-0.245-0.102-0.439-0.296-0.541-0.541C8.026,23.26,8,23.13,8,23v-6.5c0-0.552,0.448-1,1-1\ts1,0.448,1,1v4.085L20.586,10H16.5c-0.552,0-1-0.448-1-1s0.448-1,1-1H23c0.13,0,0.26,0.026,0.382,0.077\tc0.245,0.102,0.439,0.296,0.541,0.541C23.974,8.74,24,8.87,24,9z"/></svg>'},options:{32:'<svg xmlns="http://www.w3.org/2000/svg" width="32px" height="32px" x="0px" y="0px" viewBox="0 0 32 32"><defs/><path fill="#4A48C1" d="M26.1,21.383c0.334-0.625,0.602-1.279,0.812-1.949L32,18.609V13.51l-5.058-0.846\tc-0.208-0.67-0.468-1.325-0.795-1.956l3.009-4.145l-3.604-3.634L21.38,5.903c-0.626-0.333-1.276-0.602-1.948-0.81L18.609,0\tl-5.098,0.001l-0.847,5.061c-0.669,0.203-1.326,0.465-1.957,0.794L6.562,2.847L2.929,6.449l2.973,4.171\tC5.569,11.247,5.3,11.9,5.091,12.569L0,13.373v5.099l5.06,0.866c0.204,0.669,0.467,1.324,0.796,1.955l-3.009,4.146l3.601,3.635\tl4.171-2.975c0.627,0.335,1.282,0.603,1.951,0.811L13.372,32h5.118l0.849-5.057c0.668-0.207,1.323-0.469,1.953-0.795l4.144,3.01\tl3.639-3.604L26.1,21.383z M19.01,19.035c-1.675,1.663-4.381,1.652-6.041-0.025c-1.662-1.675-1.649-4.381,0.024-6.042\tc1.676-1.661,4.382-1.648,6.043,0.025C20.699,14.67,20.686,17.377,19.01,19.035z"/></svg>'},file:{32:'<svg xmlns="http://www.w3.org/2000/svg" xml:space="preserve" x="0px" y="0px" version="1.1" viewBox="0 0 32 32"><path fill="#4A48C1" d="M16,28.5c-3.6,0-6.5-3-6.5-6.6V9.6c0-0.6,0.4-1,1-1s1,0.4,1,1v12.3c0,2.5,2,4.6,4.5,4.6\tc2.5,0,4.5-2.1,4.5-4.6V8.3c0-1.5-1.2-2.8-2.7-2.8c-1.5,0-2.7,1.3-2.7,2.8v13.5c0,0.6,0.5,1.1,1,1.1c0.6,0,1-0.5,1-1.1v-10\tc0-0.6,0.4-1,1-1s1,0.4,1,1v10c0,1.7-1.4,3.1-3,3.1s-3-1.4-3-3.1V8.3c0-2.6,2.1-4.8,4.7-4.8c2.6,0,4.7,2.2,4.7,4.8v13.6\tC22.5,25.5,19.6,28.5,16,28.5z"/></svg>'},upload:{32:'<svg xmlns="http://www.w3.org/2000/svg" width="32px" height="32px" x="0px" y="0px" viewBox="0 0 32 32"><defs/><path fill="#4A48C1" d="M9.488,13.481c-0.391-0.391-0.391-1.023,0-1.414l5.805-5.805c0.026-0.026,0.06-0.036,0.088-0.058\tc0.073-0.06,0.146-0.119,0.235-0.156c0.246-0.103,0.522-0.103,0.769,0c0.093,0.039,0.171,0.101,0.249,0.165\tc0.023,0.02,0.053,0.027,0.074,0.049l5.805,5.805c0.391,0.391,0.391,1.023,0,1.414c-0.195,0.195-0.451,0.293-0.707,0.293\ts-0.512-0.098-0.707-0.293L17,9.383V20.33c0,0.553-0.447,1-1,1c-0.552,0-1-0.447-1-1V9.383l-4.098,4.098\tC10.512,13.872,9.879,13.872,9.488,13.481z M22.819,24.031H9.181c-0.552,0-1,0.447-1,1s0.448,1,1,1h13.639c0.553,0,1-0.447,1-1\tS23.372,24.031,22.819,24.031z"/></svg>'},download:{16:'<svg xmlns="http://www.w3.org/2000/svg" width="16px" height="16px" x="0px" y="0px" viewBox="0 0 16 16"><defs/><path fill="#FFF" d="M3.175,7.726c-0.413-0.367-0.45-0.999-0.083-1.412c0.367-0.413,0.999-0.45,1.412-0.083L7,8.45V1.5\tc0-0.552,0.448-1,1-1c0.553,0,1,0.448,1,1v6.95l2.496-2.219c0.412-0.367,1.044-0.331,1.411,0.083\tc0.367,0.413,0.33,1.045-0.083,1.412l-4.16,3.698c-0.047,0.041-0.103,0.062-0.154,0.094c-0.047,0.028-0.089,0.064-0.141,0.085\tC8.25,11.649,8.125,11.677,8,11.677c-0.126,0-0.25-0.027-0.369-0.074c-0.05-0.021-0.09-0.055-0.136-0.083\tc-0.053-0.031-0.111-0.053-0.159-0.096L3.175,7.726z M12.018,13.5H3.983c-0.552,0-1,0.447-1,1s0.448,1,1,1h8.035\tc0.553,0,1-0.447,1-1S12.57,13.5,12.018,13.5z"/></svg>'},error:{16:'<svg xmlns="http://www.w3.org/2000/svg" width="16px" height="16px" x="0px" y="0px" viewBox="0 0 16 16"><defs/><path fill="#ad001f" d="M15.744,13.104L9.097,1.47c-0.604-1.055-1.59-1.055-2.193,0L0.256,13.104\tc-0.604,1.056-0.102,1.919,1.113,1.919H14.63C15.847,15.022,16.348,14.159,15.744,13.104z M7,5.045c0-0.552,0.448-1,1-1s1,0.448,1,1\tv3.656c0,0.552-0.448,1-1,1s-1-0.448-1-1V5.045z M8,13.212c-0.748,0-1.354-0.607-1.354-1.354c0-0.748,0.606-1.354,1.354-1.354\ts1.354,0.606,1.354,1.354C9.354,12.604,8.748,13.212,8,13.212z"/></svg>'},arrowLeft:{16:'<?xml version="1.0" encoding="utf-8"?>\n\x3c!-- Generator: Adobe Illustrator 25.2.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) --\x3e\n<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"\n\t viewBox="0 0 16 16" enable-background="new 0 0 16 16" xml:space="preserve">\n<path fill="#5053A4" d="M13.6,8c0,0.6-0.4,1-1,1h-7l2.2,2.5c0.4,0.4,0.3,1-0.1,1.4c-0.2,0.2-0.4,0.2-0.7,0.2c-0.3,0-0.6-0.1-0.8-0.3\n\tL2.6,8.6c0,0-0.1-0.1-0.1-0.2c0,0-0.1-0.1-0.1-0.1c0-0.1-0.1-0.2-0.1-0.3c0,0,0,0,0,0c0,0,0,0,0,0c0-0.1,0-0.3,0.1-0.4\n\tc0,0,0.1-0.1,0.1-0.1c0-0.1,0.1-0.1,0.1-0.2l3.7-4.1c0.4-0.4,1-0.4,1.4-0.1c0.4,0.4,0.4,1,0.1,1.4L5.6,7h7C13.2,7,13.6,7.4,13.6,8z"\n\t/>\n</svg>\n'},arrowRight:{16:'<?xml version="1.0" encoding="utf-8"?>\n\x3c!-- Generator: Adobe Illustrator 25.2.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) --\x3e\n<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"\n\t viewBox="0 0 16 16" enable-background="new 0 0 16 16" xml:space="preserve">\n<path fill="#5053A4" d="M2.4,8.1c0-0.6,0.4-1,1-1h7L8.1,4.5c-0.4-0.4-0.3-1,0.1-1.4c0.2-0.2,0.4-0.2,0.7-0.2c0.3,0,0.6,0.1,0.8,0.3\n\tl3.7,4.2c0,0,0.1,0.1,0.1,0.2c0,0,0.1,0.1,0.1,0.1c0,0.1,0.1,0.2,0.1,0.3c0,0,0,0,0,0c0,0,0,0,0,0c0,0.1,0,0.3-0.1,0.4\n\tc0,0-0.1,0.1-0.1,0.1c0,0.1-0.1,0.1-0.1,0.2l-3.7,4.1c-0.4,0.4-1,0.4-1.4,0.1c-0.4-0.4-0.4-1-0.1-1.4l2.2-2.4h-7\n\tC2.8,9.1,2.4,8.6,2.4,8.1z"/>\n</svg>\n'},check:{16:'<svg\n xmlns="http://www.w3.org/2000/svg"\n width="16px"\n height="16px"\n x="0px"\n y="0px"\n viewBox="0 0 16 16"\n>\n <path\n fill="currentColor"\n d="M11.6,4.3l-5,5L4.9,7.5C4.4,7,3.7,7,3.2,7.5l0,0C2.8,8,2.8,8.7,3.2,9.2l1.7,1.7l0,0l0.8,0.8\n\tc0.5,0.5,1.2,0.5,1.7,0l0.8-0.8l5-5c0.5-0.5,0.5-1.2,0-1.7l0,0C12.8,3.8,12.1,3.8,11.6,4.3z"\n />\n</svg>\n',32:'<svg\n xmlns="http://www.w3.org/2000/svg"\n width="32px"\n height="32px"\n x="0px"\n y="0px"\n viewBox="0 0 32 32"\n>\n <path\n fill="currentColor"\n d="M22.9,9.3l-9.3,9.3l-3.2-3.2c-0.9-0.9-2.3-0.9-3.2,0l0,0c-0.9,0.9-0.9,2.3,0,3.2l3.2,3.2l0,0l1.6,1.6\n\tc0.9,0.9,2.3,0.9,3.2,0l1.6-1.6l9.3-9.3c0.9-0.9,0.9-2.3,0-3.2l0,0C25.2,8.4,23.7,8.4,22.9,9.3z"\n />\n</svg>\n'}},i=({name:e,size:t="32",className:n,alt:i})=>(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{"aria-hidden":"true",className:n||(0,s.U)("icon"),dangerouslySetInnerHTML:{__html:o[e][t]}}),i&&(0,r.jsx)("span",{className:(0,s.U)("visually-hidden"),children:i})]})},7556:(e,t,n)=>{"use strict";var r=n(144),s="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},o=r.useSyncExternalStore,i=r.useRef,a=r.useEffect,c=r.useMemo,l=r.useDebugValue;t.useSyncExternalStoreWithSelector=function(e,t,n,r,u){var d=i(null);if(null===d.current){var p={hasValue:!1,value:null};d.current=p}else p=d.current;d=c((function(){function e(e){if(!a){if(a=!0,o=e,e=r(e),void 0!==u&&p.hasValue){var t=p.value;if(u(t,e))return i=t}return i=e}if(t=i,s(o,e))return t;var n=r(e);return void 0!==u&&u(t,n)?t:(o=e,i=n)}var o,i,a=!1,c=void 0===n?null:n;return[function(){return e(t())},null===c?void 0:function(){return e(c())}]}),[t,n,r,u]);var h=o(e,d[0],d[1]);return a((function(){p.hasValue=!0,p.value=h}),[h]),l(h),h}},6728:(e,t,n)=>{"use strict";e.exports=n(7556)},9150:e=>{"use strict";e.exports=require("preact")},1864:e=>{"use strict";e.exports=require("preact/compat")},8056:e=>{"use strict";e.exports=require("preact/hooks")},784:e=>{"use strict";e.exports=require("preact/jsx-runtime")},3120:(e,t,n)=>{"use strict";n.d(t,{eS:()=>ae,Uh:()=>Q,aw:()=>ve,is:()=>xe,CF:()=>de,i0:()=>le});var r=Symbol.for("immer-nothing"),s=Symbol.for("immer-draftable"),o=Symbol.for("immer-state");function i(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var a=Object.getPrototypeOf;function c(e){return!!e&&!!e[o]}function l(e){return!!e&&(d(e)||Array.isArray(e)||!!e[s]||!!e.constructor?.[s]||v(e)||g(e))}var u=Object.prototype.constructor.toString();function d(e){if(!e||"object"!=typeof e)return!1;const t=a(e);if(null===t)return!0;const n=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return n===Object||"function"==typeof n&&Function.toString.call(n)===u}function p(e,t){0===h(e)?Object.entries(e).forEach((([n,r])=>{t(n,r,e)})):e.forEach(((n,r)=>t(r,n,e)))}function h(e){const t=e[o];return t?t.type_:Array.isArray(e)?1:v(e)?2:g(e)?3:0}function f(e,t){return 2===h(e)?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function m(e,t,n){const r=h(e);2===r?e.set(t,n):3===r?e.add(n):e[t]=n}function v(e){return e instanceof Map}function g(e){return e instanceof Set}function y(e){return e.copy_||e.base_}function b(e,t){if(v(e))return new Map(e);if(g(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);if(!t&&d(e)){if(!a(e)){const t=Object.create(null);return Object.assign(t,e)}return{...e}}const n=Object.getOwnPropertyDescriptors(e);delete n[o];let r=Reflect.ownKeys(n);for(let t=0;t<r.length;t++){const s=r[t],o=n[s];!1===o.writable&&(o.writable=!0,o.configurable=!0),(o.get||o.set)&&(n[s]={configurable:!0,writable:!0,enumerable:o.enumerable,value:e[s]})}return Object.create(a(e),n)}function w(e,t=!1){return C(e)||c(e)||!l(e)||(h(e)>1&&(e.set=e.add=e.clear=e.delete=x),Object.freeze(e),t&&p(e,((e,t)=>w(t,!0)))),e}function x(){i(2)}function C(e){return Object.isFrozen(e)}var _,j={};function E(e){const t=j[e];return t||i(0),t}function S(){return _}function T(e,t){t&&(E("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function k(e){O(e),e.drafts_.forEach(I),e.drafts_=null}function O(e){e===_&&(_=e.parent_)}function N(e){return _={drafts_:[],parent_:_,immer_:e,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function I(e){const t=e[o];0===t.type_||1===t.type_?t.revoke_():t.revoked_=!0}function U(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];return void 0!==e&&e!==n?(n[o].modified_&&(k(t),i(4)),l(e)&&(e=A(t,e),t.parent_||M(t,e)),t.patches_&&E("Patches").generateReplacementPatches_(n[o].base_,e,t.patches_,t.inversePatches_)):e=A(t,n,[]),k(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==r?e:void 0}function A(e,t,n){if(C(t))return t;const r=t[o];if(!r)return p(t,((s,o)=>R(e,r,t,s,o,n))),t;if(r.scope_!==e)return t;if(!r.modified_)return M(e,r.base_,!0),r.base_;if(!r.finalized_){r.finalized_=!0,r.scope_.unfinalizedDrafts_--;const t=r.copy_;let s=t,o=!1;3===r.type_&&(s=new Set(t),t.clear(),o=!0),p(s,((s,i)=>R(e,r,t,s,i,n,o))),M(e,t,!1),n&&e.patches_&&E("Patches").generatePatches_(r,n,e.patches_,e.inversePatches_)}return r.copy_}function R(e,t,n,r,s,o,i){if(c(s)){const i=A(e,s,o&&t&&3!==t.type_&&!f(t.assigned_,r)?o.concat(r):void 0);if(m(n,r,i),!c(i))return;e.canAutoFreeze_=!1}else i&&n.add(s);if(l(s)&&!C(s)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;A(e,s),t&&t.scope_.parent_||M(e,s)}}function M(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&w(t,n)}var P={get(e,t){if(t===o)return e;const n=y(e);if(!f(n,t))return function(e,t,n){const r=F(t,n);return r?"value"in r?r.value:r.get?.call(e.draft_):void 0}(e,n,t);const r=n[t];return e.finalized_||!l(r)?r:r===D(e.base_,t)?(z(e),e.copy_[t]=$(r,e)):r},has:(e,t)=>t in y(e),ownKeys:e=>Reflect.ownKeys(y(e)),set(e,t,n){const r=F(y(e),t);if(r?.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const r=D(y(e),t),a=r?.[o];if(a&&a.base_===n)return e.copy_[t]=n,e.assigned_[t]=!1,!0;if(((s=n)===(i=r)?0!==s||1/s==1/i:s!=s&&i!=i)&&(void 0!==n||f(e.base_,t)))return!0;z(e),B(e)}var s,i;return e.copy_[t]===n&&(void 0!==n||t in e.copy_)||Number.isNaN(n)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=n,e.assigned_[t]=!0),!0},deleteProperty:(e,t)=>(void 0!==D(e.base_,t)||t in e.base_?(e.assigned_[t]=!1,z(e),B(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0),getOwnPropertyDescriptor(e,t){const n=y(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r?{writable:!0,configurable:1!==e.type_||"length"!==t,enumerable:r.enumerable,value:n[t]}:r},defineProperty(){i(11)},getPrototypeOf:e=>a(e.base_),setPrototypeOf(){i(12)}},L={};function D(e,t){const n=e[o];return(n?y(n):e)[t]}function F(e,t){if(!(t in e))return;let n=a(e);for(;n;){const e=Object.getOwnPropertyDescriptor(n,t);if(e)return e;n=a(n)}}function B(e){e.modified_||(e.modified_=!0,e.parent_&&B(e.parent_))}function z(e){e.copy_||(e.copy_=b(e.base_,e.scope_.immer_.useStrictShallowCopy_))}function $(e,t){const n=v(e)?E("MapSet").proxyMap_(e,t):g(e)?E("MapSet").proxySet_(e,t):function(e,t){const n=Array.isArray(e),r={type_:n?1:0,scope_:t?t.scope_:S(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let s=r,o=P;n&&(s=[r],o=L);const{revoke:i,proxy:a}=Proxy.revocable(s,o);return r.draft_=a,r.revoke_=i,a}(e,t);return(t?t.scope_:S()).drafts_.push(n),n}function V(e){return c(e)||i(10),H(e)}function H(e){if(!l(e)||C(e))return e;const t=e[o];let n;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=b(e,t.scope_.immer_.useStrictShallowCopy_)}else n=b(e,!0);return p(n,((e,t)=>{m(n,e,H(t))})),t&&(t.finalized_=!1),n}p(P,((e,t)=>{L[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}})),L.deleteProperty=function(e,t){return L.set.call(this,e,t,void 0)},L.set=function(e,t,n){return P.set.call(this,e[0],t,n,e[0])};var K=new class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(e,t,n)=>{if("function"==typeof e&&"function"!=typeof t){const n=t;t=e;const r=this;return function(e=n,...s){return r.produce(e,(e=>t.call(this,e,...s)))}}let s;if("function"!=typeof t&&i(6),void 0!==n&&"function"!=typeof n&&i(7),l(e)){const r=N(this),o=$(e,void 0);let i=!0;try{s=t(o),i=!1}finally{i?k(r):O(r)}return T(r,n),U(s,r)}if(!e||"object"!=typeof e){if(s=t(e),void 0===s&&(s=e),s===r&&(s=void 0),this.autoFreeze_&&w(s,!0),n){const t=[],r=[];E("Patches").generateReplacementPatches_(e,s,t,r),n(t,r)}return s}i(1)},this.produceWithPatches=(e,t)=>{if("function"==typeof e)return(t,...n)=>this.produceWithPatches(t,(t=>e(t,...n)));let n,r;return[this.produce(e,t,((e,t)=>{n=e,r=t})),n,r]},"boolean"==typeof e?.autoFreeze&&this.setAutoFreeze(e.autoFreeze),"boolean"==typeof e?.useStrictShallowCopy&&this.setUseStrictShallowCopy(e.useStrictShallowCopy)}createDraft(e){l(e)||i(8),c(e)&&(e=V(e));const t=N(this),n=$(e,void 0);return n[o].isManual_=!0,O(t),n}finishDraft(e,t){const n=e&&e[o];n&&n.isManual_||i(9);const{scope_:r}=n;return T(r,t),U(void 0,r)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}applyPatches(e,t){let n;for(n=t.length-1;n>=0;n--){const r=t[n];if(0===r.path.length&&"replace"===r.op){e=r.value;break}}n>-1&&(t=t.slice(n+1));const r=E("Patches").applyPatches_;return c(e)?r(e,t):this.produce(e,(e=>r(e,t)))}},W=K.produce;K.produceWithPatches.bind(K),K.setAutoFreeze.bind(K),K.setUseStrictShallowCopy.bind(K),K.applyPatches.bind(K),K.createDraft.bind(K),K.finishDraft.bind(K);var q=n(8888),G=n(8608),Y=n(9272),J=(((...e)=>{const t=(0,q.qu)(...e),n=Object.assign(((...e)=>{const n=t(...e),r=(e,...t)=>n(c(e)?V(e):e,...t);return Object.assign(r,n),r}),{withTypes:()=>n})})(q.$S),"undefined"!=typeof window&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(0!==arguments.length)return"object"==typeof arguments[0]?G.Jn:G.Jn.apply(null,arguments)}),X=("undefined"!=typeof window&&window.__REDUX_DEVTOOLS_EXTENSION__&&window.__REDUX_DEVTOOLS_EXTENSION__,e=>e&&"function"==typeof e.match);function Q(e,t){function n(...n){if(t){let r=t(...n);if(!r)throw new Error(Oe(0));return{type:e,payload:r.payload,..."meta"in r&&{meta:r.meta},..."error"in r&&{error:r.error}}}return{type:e,payload:n[0]}}return n.toString=()=>`${e}`,n.type=e,n.match=t=>(0,G.Eh)(t)&&t.type===e,n}var Z=class e extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,e.prototype)}static get[Symbol.species](){return e}concat(...e){return super.concat.apply(this,e)}prepend(...t){return 1===t.length&&Array.isArray(t[0])?new e(...t[0].concat(this)):new e(...t.concat(this))}};function ee(e){return l(e)?W(e,(()=>{})):e}function te(e,t,n){if(e.has(t)){let r=e.get(t);return n.update&&(r=n.update(r,t,e),e.set(t,r)),r}if(!n.insert)throw new Error(Oe(10));const r=n.insert(t,e);return e.set(t,r),r}var ne=()=>function(e){const{thunk:t=!0,immutableCheck:n=!0,serializableCheck:r=!0,actionCreatorCheck:s=!0}=e??{};let o=new Z;return t&&("boolean"==typeof t?o.push(Y.y):o.push((0,Y.g)(t.extraArgument))),o},re=e=>t=>{setTimeout(t,e)},se="undefined"!=typeof window&&window.requestAnimationFrame?window.requestAnimationFrame:re(10),oe=e=>function(t){const{autoBatch:n=!0}=t??{};let r=new Z(e);return n&&r.push(((e={type:"raf"})=>t=>(...n)=>{const r=t(...n);let s=!0,o=!1,i=!1;const a=new Set,c="tick"===e.type?queueMicrotask:"raf"===e.type?se:"callback"===e.type?e.queueNotification:re(e.timeout),l=()=>{i=!1,o&&(o=!1,a.forEach((e=>e())))};return Object.assign({},r,{subscribe(e){const t=r.subscribe((()=>s&&e()));return a.add(e),()=>{t(),a.delete(e)}},dispatch(e){try{return s=!e?.meta?.RTK_autoBatch,o=!s,o&&(i||(i=!0,c(l))),r.dispatch(e)}finally{s=!0}}})})("object"==typeof n?n:void 0)),r},ie=!0;function ae(e){const t=ne(),{reducer:n,middleware:r,devTools:s=!0,preloadedState:o,enhancers:i}=e||{};let a,c;if("function"==typeof n)a=n;else{if(!(0,G.oF)(n))throw new Error(Oe(1));a=(0,G.TL)(n)}if(!ie&&r&&"function"!=typeof r)throw new Error(Oe(2));if("function"==typeof r){if(c=r(t),!ie&&!Array.isArray(c))throw new Error(Oe(3))}else c=t();if(!ie&&c.some((e=>"function"!=typeof e)))throw new Error(Oe(4));let l=G.Jn;s&&(l=J({trace:!ie,..."object"==typeof s&&s}));const u=(0,G.d4)(...c),d=oe(u);if(!ie&&i&&"function"!=typeof i)throw new Error(Oe(5));let p="function"==typeof i?i(d):d();if(!ie&&!Array.isArray(p))throw new Error(Oe(6));if(!ie&&p.some((e=>"function"!=typeof e)))throw new Error(Oe(7));ie||!c.length||p.includes(u)||console.error("middlewares were provided, but middleware enhancer was not included in final enhancers - make sure to call `getDefaultEnhancers`");const h=l(...p);return(0,G.eC)(a,o,h)}function ce(e){const t={},n=[];let r;const s={addCase(e,n){const r="string"==typeof e?e:e.type;if(!r)throw new Error(Oe(28));if(r in t)throw new Error(Oe(29));return t[r]=n,s},addMatcher:(e,t)=>(n.push({matcher:e,reducer:t}),s),addDefaultCase:e=>(r=e,s)};return e(s),[t,n,r]}var le=(e=21)=>{let t="",n=e;for(;n--;)t+="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW"[64*Math.random()|0];return t},ue=(e,t)=>X(e)?e.match(t):e(t);function de(...e){return t=>e.some((e=>ue(e,t)))}var pe=["name","message","stack","code"],he=class{constructor(e,t){this.payload=e,this.meta=t}_type},fe=class{constructor(e,t){this.payload=e,this.meta=t}_type},me=e=>{if("object"==typeof e&&null!==e){const t={};for(const n of pe)"string"==typeof e[n]&&(t[n]=e[n]);return t}return{message:String(e)}},ve=(()=>{function e(e,t,n){const r=Q(e+"/fulfilled",((e,t,n,r)=>({payload:e,meta:{...r||{},arg:n,requestId:t,requestStatus:"fulfilled"}}))),s=Q(e+"/pending",((e,t,n)=>({payload:void 0,meta:{...n||{},arg:t,requestId:e,requestStatus:"pending"}}))),o=Q(e+"/rejected",((e,t,r,s,o)=>({payload:s,error:(n&&n.serializeError||me)(e||"Rejected"),meta:{...o||{},arg:r,requestId:t,rejectedWithValue:!!s,requestStatus:"rejected",aborted:"AbortError"===e?.name,condition:"ConditionError"===e?.name}})));return Object.assign((function(e){return(i,a,c)=>{const l=n?.idGenerator?n.idGenerator(e):le(),u=new AbortController;let d,p;function h(e){p=e,u.abort()}const f=async function(){let f;try{let o=n?.condition?.(e,{getState:a,extra:c});if(null!==(m=o)&&"object"==typeof m&&"function"==typeof m.then&&(o=await o),!1===o||u.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};const v=new Promise(((e,t)=>{d=()=>{t({name:"AbortError",message:p||"Aborted"})},u.signal.addEventListener("abort",d)}));i(s(l,e,n?.getPendingMeta?.({requestId:l,arg:e},{getState:a,extra:c}))),f=await Promise.race([v,Promise.resolve(t(e,{dispatch:i,getState:a,extra:c,requestId:l,signal:u.signal,abort:h,rejectWithValue:(e,t)=>new he(e,t),fulfillWithValue:(e,t)=>new fe(e,t)})).then((t=>{if(t instanceof he)throw t;return t instanceof fe?r(t.payload,l,e,t.meta):r(t,l,e)}))])}catch(t){f=t instanceof he?o(null,l,e,t.payload,t.meta):o(t,l,e)}finally{d&&u.signal.removeEventListener("abort",d)}var m;return n&&!n.dispatchConditionRejection&&o.match(f)&&f.meta.condition||i(f),f}();return Object.assign(f,{abort:h,requestId:l,arg:e,unwrap:()=>f.then(ge)})}}),{pending:s,rejected:o,fulfilled:r,settled:de(o,r),typePrefix:e})}return e.withTypes=()=>e,e})();function ge(e){if(e.meta&&e.meta.rejectedWithValue)throw e.payload;if(e.error)throw e.error;return e.payload}var ye=Symbol.for("rtk-slice-createasyncthunk");function be(e,t){return`${e}/${t}`}function we(e,t,n,r){function s(s,...o){let i=t(s);return void 0===i&&r&&(i=n()),e(i,...o)}return s.unwrapped=e,s}var xe=function({creators:e}={}){const t=e?.asyncThunk?.[ye];return function(e){const{name:n,reducerPath:r=n}=e;if(!n)throw new Error(Oe(11));const s=("function"==typeof e.reducers?e.reducers(function(){function e(e,t){return{_reducerDefinitionType:"asyncThunk",payloadCreator:e,...t}}return e.withTypes=()=>e,{reducer:e=>Object.assign({[e.name]:(...t)=>e(...t)}[e.name],{_reducerDefinitionType:"reducer"}),preparedReducer:(e,t)=>({_reducerDefinitionType:"reducerWithPrepare",prepare:e,reducer:t}),asyncThunk:e}}()):e.reducers)||{},o=Object.keys(s),i={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},a={addCase(e,t){const n="string"==typeof e?e:e.type;if(!n)throw new Error(Oe(12));if(n in i.sliceCaseReducersByType)throw new Error(Oe(13));return i.sliceCaseReducersByType[n]=t,a},addMatcher:(e,t)=>(i.sliceMatchers.push({matcher:e,reducer:t}),a),exposeAction:(e,t)=>(i.actionCreators[e]=t,a),exposeCaseReducer:(e,t)=>(i.sliceCaseReducersByName[e]=t,a)};function u(){const[t={},n=[],r]="function"==typeof e.extraReducers?ce(e.extraReducers):[e.extraReducers],s={...t,...i.sliceCaseReducersByType};return function(e,t){let o,[a,u,d]=ce((e=>{for(let t in s)e.addCase(t,s[t]);for(let t of i.sliceMatchers)e.addMatcher(t.matcher,t.reducer);for(let t of n)e.addMatcher(t.matcher,t.reducer);r&&e.addDefaultCase(r)}));if("function"==typeof e)o=()=>ee(e());else{const t=ee(e);o=()=>t}function p(e=o(),t){let n=[a[t.type],...u.filter((({matcher:e})=>e(t))).map((({reducer:e})=>e))];return 0===n.filter((e=>!!e)).length&&(n=[d]),n.reduce(((e,n)=>{if(n){if(c(e)){const r=n(e,t);return void 0===r?e:r}if(l(e))return W(e,(e=>n(e,t)));{const r=n(e,t);if(void 0===r){if(null===e)return e;throw new Error(Oe(9))}return r}}return e}),e)}return p.getInitialState=o,p}(e.initialState)}o.forEach((r=>{const o=s[r],i={reducerName:r,type:be(n,r),createNotation:"function"==typeof e.reducers};!function(e){return"asyncThunk"===e._reducerDefinitionType}(o)?function({type:e,reducerName:t,createNotation:n},r,s){let o,i;if("reducer"in r){if(n&&!function(e){return"reducerWithPrepare"===e._reducerDefinitionType}(r))throw new Error(Oe(17));o=r.reducer,i=r.prepare}else o=r;s.addCase(e,o).exposeCaseReducer(t,o).exposeAction(t,i?Q(e,i):Q(e))}(i,o,a):function({type:e,reducerName:t},n,r,s){if(!s)throw new Error(Oe(18));const{payloadCreator:o,fulfilled:i,pending:a,rejected:c,settled:l,options:u}=n,d=s(e,o,u);r.exposeAction(t,d),i&&r.addCase(d.fulfilled,i),a&&r.addCase(d.pending,a),c&&r.addCase(d.rejected,c),l&&r.addMatcher(d.settled,l),r.exposeCaseReducer(t,{fulfilled:i||Ce,pending:a||Ce,rejected:c||Ce,settled:l||Ce})}(i,o,a,t)}));const d=e=>e,p=new Map;let h;function f(e,t){return h||(h=u()),h(e,t)}function m(){return h||(h=u()),h.getInitialState()}function v(t,n=!1){function r(e){let r=e[t];return void 0===r&&n&&(r=m()),r}function s(t=d){const r=te(p,n,{insert:()=>new WeakMap});return te(r,t,{insert:()=>{const r={};for(const[s,o]of Object.entries(e.selectors??{}))r[s]=we(o,t,m,n);return r}})}return{reducerPath:t,getSelectors:s,get selectors(){return s(r)},selectSlice:r}}const g={name:n,reducer:f,actions:i.actionCreators,caseReducers:i.sliceCaseReducersByName,getInitialState:m,...v(r),injectInto(e,{reducerPath:t,...n}={}){const s=t??r;return e.inject({reducerPath:s,reducer:f},n),{...g,...v(s,!0)}}};return g}}();function Ce(){}var{assign:_e}=Object,je="listenerMiddleware",Ee=e=>{let{type:t,actionCreator:n,matcher:r,predicate:s,effect:o}=e;if(t)s=Q(t).match;else if(n)t=n.type,s=n.match;else if(r)s=r;else if(!s)throw new Error(Oe(21));return((e,t)=>{if("function"!=typeof e)throw new Error(Oe(32))})(o),{predicate:s,type:t,effect:o}},Se=Object.assign((e=>{const{type:t,predicate:n,effect:r}=Ee(e);return{id:le(),effect:r,type:t,predicate:n,pending:new Set,unsubscribe:()=>{throw new Error(Oe(22))}}}),{withTypes:()=>Se}),Te=Object.assign(Q(`${je}/add`),{withTypes:()=>Te}),ke=(Q(`${je}/removeAll`),Object.assign(Q(`${je}/remove`),{withTypes:()=>ke}));function Oe(e){return`Minified Redux Toolkit error #${e}; visit https://redux-toolkit.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}Symbol.for("rtk-state-proxy-original")},2328:(e,t,n)=>{"use strict";n.d(t,{C_:()=>y,OY:()=>_,w1:()=>m});var r=n(144),s=n(6728),o=r.default,i=Symbol.for("react-redux-context"),a="undefined"!=typeof globalThis?globalThis:{};function c(){if(!o.createContext)return{};const e=a[i]??(a[i]=new Map);let t=e.get(o.createContext);return t||(t=o.createContext(null),e.set(o.createContext,t)),t}var l=c();function u(e=l){return function(){return o.useContext(e)}}var d=u(),p=()=>{throw new Error("uSES not initialized!")},h=(e,t)=>e===t;function f(e=l){const t=e===l?d:u(e),n=(e,n={})=>{const{equalityFn:r=h,devModeChecks:s={}}="function"==typeof n?{equalityFn:n}:n,{store:i,subscription:a,getServerState:c,stabilityCheck:l,identityFunctionCheck:u}=t(),d=(o.useRef(!0),o.useCallback({[e.name]:t=>e(t)}[e.name],[e,l,s.stabilityCheck])),f=p(a.addNestedSub,i.getState,c||i.getState,d,r);return o.useDebugValue(f),f};return Object.assign(n,{withTypes:()=>n}),n}var m=f();Symbol.for("react.element"),Symbol.for("react.portal"),Symbol.for("react.fragment"),Symbol.for("react.strict_mode"),Symbol.for("react.profiler"),Symbol.for("react.provider"),Symbol.for("react.context"),Symbol.for("react.server_context"),Symbol.for("react.forward_ref"),Symbol.for("react.suspense"),Symbol.for("react.suspense_list"),Symbol.for("react.memo"),Symbol.for("react.lazy"),Symbol.for("react.offscreen"),Symbol.for("react.client.reference");var v={notify(){},get:()=>[]};var g="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?o.useLayoutEffect:o.useEffect;Object.defineProperty,Object.getOwnPropertyNames,Object.getOwnPropertySymbols,Object.getOwnPropertyDescriptor,Object.getPrototypeOf,Object.prototype;var y=function({store:e,context:t,children:n,serverState:r,stabilityCheck:s="once",identityFunctionCheck:i="once"}){const a=o.useMemo((()=>{const t=function(e,t){let n,r=v,s=0,o=!1;function i(){l.onStateChange&&l.onStateChange()}function a(){s++,n||(n=t?t.addNestedSub(i):e.subscribe(i),r=function(){let e=null,t=null;return{clear(){e=null,t=null},notify(){(()=>{let t=e;for(;t;)t.callback(),t=t.next})()},get(){const t=[];let n=e;for(;n;)t.push(n),n=n.next;return t},subscribe(n){let r=!0;const s=t={callback:n,next:null,prev:t};return s.prev?s.prev.next=s:e=s,function(){r&&null!==e&&(r=!1,s.next?s.next.prev=s.prev:t=s.prev,s.prev?s.prev.next=s.next:e=s.next)}}}}())}function c(){s--,n&&0===s&&(n(),n=void 0,r.clear(),r=v)}const l={addNestedSub:function(e){a();const t=r.subscribe(e);let n=!1;return()=>{n||(n=!0,t(),c())}},notifyNestedSubs:function(){r.notify()},handleChangeWrapper:i,isSubscribed:function(){return o},trySubscribe:function(){o||(o=!0,a())},tryUnsubscribe:function(){o&&(o=!1,c())},getListeners:()=>r};return l}(e);return{store:e,subscription:t,getServerState:r?()=>r:void 0,stabilityCheck:s,identityFunctionCheck:i}}),[e,r,s,i]),c=o.useMemo((()=>e.getState()),[e]);g((()=>{const{subscription:t}=a;return t.onStateChange=t.notifyNestedSubs,t.trySubscribe(),c!==e.getState()&&t.notifyNestedSubs(),()=>{t.tryUnsubscribe(),t.onStateChange=void 0}}),[a,c]);const u=t||l;return o.createElement(u.Provider,{value:a},n)};function b(e=l){const t=e===l?d:u(e),n=()=>{const{store:e}=t();return e};return Object.assign(n,{withTypes:()=>n}),n}var w=b();function x(e=l){const t=e===l?w:b(e),n=()=>t().dispatch;return Object.assign(n,{withTypes:()=>n}),n}var C,_=x();C=s.useSyncExternalStoreWithSelector,p=C,r.useSyncExternalStore},9272:(e,t,n)=>{"use strict";function r(e){return({dispatch:t,getState:n})=>r=>s=>"function"==typeof s?s(t,n,e):r(s)}n.d(t,{g:()=>o,y:()=>s});var s=r(),o=r},8608:(e,t,n)=>{"use strict";function r(e){return`Minified Redux error #${e}; visit https://redux.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}n.d(t,{Eh:()=>p,Jn:()=>u,TL:()=>l,d4:()=>d,eC:()=>c,oF:()=>a});var s=(()=>"function"==typeof Symbol&&Symbol.observable||"@@observable")(),o=()=>Math.random().toString(36).substring(7).split("").join("."),i={INIT:`@@redux/INIT${o()}`,REPLACE:`@@redux/REPLACE${o()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${o()}`};function a(e){if("object"!=typeof e||null===e)return!1;let t=e;for(;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||null===Object.getPrototypeOf(e)}function c(e,t,n){if("function"!=typeof e)throw new Error(r(2));if("function"==typeof t&&"function"==typeof n||"function"==typeof n&&"function"==typeof arguments[3])throw new Error(r(0));if("function"==typeof t&&void 0===n&&(n=t,t=void 0),void 0!==n){if("function"!=typeof n)throw new Error(r(1));return n(c)(e,t)}let o=e,l=t,u=new Map,d=u,p=0,h=!1;function f(){d===u&&(d=new Map,u.forEach(((e,t)=>{d.set(t,e)})))}function m(){if(h)throw new Error(r(3));return l}function v(e){if("function"!=typeof e)throw new Error(r(4));if(h)throw new Error(r(5));let t=!0;f();const n=p++;return d.set(n,e),function(){if(t){if(h)throw new Error(r(6));t=!1,f(),d.delete(n),u=null}}}function g(e){if(!a(e))throw new Error(r(7));if(void 0===e.type)throw new Error(r(8));if("string"!=typeof e.type)throw new Error(r(17));if(h)throw new Error(r(9));try{h=!0,l=o(l,e)}finally{h=!1}return(u=d).forEach((e=>{e()})),e}return g({type:i.INIT}),{dispatch:g,subscribe:v,getState:m,replaceReducer:function(e){if("function"!=typeof e)throw new Error(r(10));o=e,g({type:i.REPLACE})},[s]:function(){const e=v;return{subscribe(t){if("object"!=typeof t||null===t)throw new Error(r(11));function n(){const e=t;e.next&&e.next(m())}return n(),{unsubscribe:e(n)}},[s](){return this}}}}}function l(e){const t=Object.keys(e),n={};for(let r=0;r<t.length;r++){const s=t[r];"function"==typeof e[s]&&(n[s]=e[s])}const s=Object.keys(n);let o;try{!function(e){Object.keys(e).forEach((t=>{const n=e[t];if(void 0===n(void 0,{type:i.INIT}))throw new Error(r(12));if(void 0===n(void 0,{type:i.PROBE_UNKNOWN_ACTION()}))throw new Error(r(13))}))}(n)}catch(e){o=e}return function(e={},t){if(o)throw o;let i=!1;const a={};for(let o=0;o<s.length;o++){const c=s[o],l=n[c],u=e[c],d=l(u,t);if(void 0===d)throw t&&t.type,new Error(r(14));a[c]=d,i=i||d!==u}return i=i||s.length!==Object.keys(e).length,i?a:e}}function u(...e){return 0===e.length?e=>e:1===e.length?e[0]:e.reduce(((e,t)=>(...n)=>e(t(...n))))}function d(...e){return t=>(n,s)=>{const o=t(n,s);let i=()=>{throw new Error(r(15))};const a={getState:o.getState,dispatch:(e,...t)=>i(e,...t)},c=e.map((e=>e(a)));return i=u(...c)(o.dispatch),{...o,dispatch:i}}}function p(e){return a(e)&&"type"in e&&"string"==typeof e.type}},8888:(e,t,n)=>{"use strict";n.d(t,{$S:()=>c,M3:()=>u,qu:()=>l});var r=e=>Array.isArray(e)?e:[e];Symbol(),Object.getPrototypeOf({});var s="undefined"!=typeof WeakRef?WeakRef:class{constructor(e){this.value=e}deref(){return this.value}},o=0,i=1;function a(){return{s:o,v:void 0,o:null,p:null}}function c(e,t={}){let n=a();const{resultEqualityCheck:r}=t;let o,c=0;function l(){let t=n;const{length:l}=arguments;for(let e=0,n=l;e<n;e++){const n=arguments[e];if("function"==typeof n||"object"==typeof n&&null!==n){let e=t.o;null===e&&(t.o=e=new WeakMap);const r=e.get(n);void 0===r?(t=a(),e.set(n,t)):t=r}else{let e=t.p;null===e&&(t.p=e=new Map);const r=e.get(n);void 0===r?(t=a(),e.set(n,t)):t=r}}const u=t;let d;if(t.s===i?d=t.v:(d=e.apply(null,arguments),c++),u.s=i,r){const e=o?.deref?.()??o;null!=e&&r(e,d)&&(d=e,0!==c&&c--),o="object"==typeof d&&null!==d||"function"==typeof d?new s(d):d}return u.v=d,d}return l.clearCache=()=>{n=a(),l.resetResultsCount()},l.resultsCount=()=>c,l.resetResultsCount=()=>{c=0},l}function l(e,...t){const n="function"==typeof e?{memoize:e,memoizeOptions:t}:e,s=(...e)=>{let t,s=0,o=0,i={},a=e.pop();"object"==typeof a&&(i=a,a=e.pop()),function(e,t="expected a function, instead received "+typeof e){if("function"!=typeof e)throw new TypeError(t)}(a,`createSelector expects an output function after the inputs, but received: [${typeof a}]`);const l={...n,...i},{memoize:u,memoizeOptions:d=[],argsMemoize:p=c,argsMemoizeOptions:h=[],devModeChecks:f={}}=l,m=r(d),v=r(h),g=function(e){const t=Array.isArray(e[0])?e[0]:e;return function(e,t="expected all items to be functions, instead received the following types: "){if(!e.every((e=>"function"==typeof e))){const n=e.map((e=>"function"==typeof e?`function ${e.name||"unnamed"}()`:typeof e)).join(", ");throw new TypeError(`${t}[${n}]`)}}(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}(e),y=u((function(){return s++,a.apply(null,arguments)}),...m),b=p((function(){o++;const e=function(e,t){const n=[],{length:r}=e;for(let s=0;s<r;s++)n.push(e[s].apply(null,t));return n}(g,arguments);return t=y.apply(null,e),t}),...v);return Object.assign(b,{resultFunc:a,memoizedResultFunc:y,dependencies:g,dependencyRecomputations:()=>o,resetDependencyRecomputations:()=>{o=0},lastResult:()=>t,recomputations:()=>s,resetRecomputations:()=>{s=0},memoize:u,argsMemoize:p})};return Object.assign(s,{withTypes:()=>s}),s}var u=l(c),d=Object.assign(((e,t=u)=>{!function(e,t="expected an object, instead received "+typeof e){if("object"!=typeof e)throw new TypeError(t)}(e,"createStructuredSelector expects first argument to be an object where each property is a selector, instead received a "+typeof e);const n=Object.keys(e);return t(n.map((t=>e[t])),((...e)=>e.reduce(((e,t,r)=>(e[n[r]]=t,e)),{})))}),{withTypes:()=>d})}},t={};function n(r){var s=t[r];if(void 0!==s)return s.exports;var o=t[r]={exports:{}};return e[r](o,o.exports,n),o.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;n.g.importScripts&&(e=n.g.location+"");var t=n.g.document;if(!e&&t&&(t.currentScript&&(e=t.currentScript.src),!e)){var r=t.getElementsByTagName("script");if(r.length)for(var s=r.length-1;s>-1&&!e;)e=r[s--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),n.p=e})();var r={};(()=>{"use strict";n.r(r),n.d(r,{Engine:()=>Wr,ExternalApi:()=>Yr,calculateVisibility:()=>e.g,className:()=>t.U,eventTypes:()=>re.Iz,getSearchParamsByKeys:()=>Jr,initResetSearchParams:()=>Qr,randomId:()=>v.s,replaceSearchParams:()=>Xr});var e=n(3576),t=n(8544),s=n(784),o=n(1792),i=n.n(o),a=n(9150);class c extends Error{constructor(e,t){super(e,{cause:null==t?void 0:t.cause}),this.status=null==t?void 0:t.status}}var l=n(3872),u=n(2704),d=n(6232),p=n(1120),h=n(7548),f=n(5576),m=n.n(f),v=n(1676);function g(e){const t=`cvco.${e}`;return{get(){const e=[t,t.split(".").slice(0,-1).join(".")];let n;do{n=sessionStorage.getItem(e[0])}while(e.shift()&&!n);return JSON.parse(n)},set(e){e&&sessionStorage.setItem(t,JSON.stringify(e))}}}var y,b,w,x,C,_,j,E,S,T,k,O,N,I,U,A=n(8760),R=n(8412),M=function(e,t,n,r){return new(n||(n=Promise))((function(s,o){function i(e){try{c(r.next(e))}catch(e){o(e)}}function a(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?s(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(i,a)}c((r=r.apply(e,t||[])).next())}))},P=function(e,t,n,r,s){if("m"===r)throw new TypeError("Private method is not writable");if("a"===r&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!s:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?s.call(e,n):s?s.value=n:t.set(e,n),n},L=function(e,t,n,r){if("a"===n&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?r:"a"===n?r.call(e):r?r.value:t.get(e)};const D=m()("seamly"),F=(e,t)=>M(void 0,void 0,void 0,(function*(){const n=new URL(e);n.searchParams.set("v",h.kR);const r=yield fetch(n.href,Object.assign({mode:"cors"},t));if(!r.ok)throw new c(r.statusText||`Request failed with status: ${r.status}`,{status:r.status});return r}));function B(){if(!Intl||"undefined"==typeof Intl||void 0===Intl.DateTimeFormat)return null;const e=Intl.DateTimeFormat();if(void 0===e||void 0===e.resolvedOptions)return null;const t=e.resolvedOptions().timeZone;return t&&(t.indexOf("/")>-1||"UTC"===t)?t:null}class z{constructor({layoutMode:e,namespace:t,config:n,context:r}){var s;y.add(this),b.set(this,void 0),w.set(this,void 0),x.set(this,void 0),C.set(this,void 0),_.set(this,void 0),this.conversation=new R.c,O.set(this,(e=>e||this.locale)),this.store=function(e,t){const n=t(e),r=n.get()||{};return{get:e=>void 0===e?r:r[e],set:(e,t)=>(r[e]=t,n.set(r),t),delete(e){const t=this.get(e);return delete r[e],n.set(r),t}}}(`${t}.connection${r.contentLocale?`.${r.contentLocale}`:""}`,n.storageProvider||g),this.connectionInfo={apiKey:n.key,domain:n.domain||"api.seamly-app.com",secure:!1!==n.secure&&(n.secure||!0)},P(this,_,Object.assign(Object.assign({},n),{sendEnvironment:null===(s=n.sendEnvironment)||void 0===s||s,context:Object.assign(Object.assign({},r),{channelName:r.channelName||"web"})}),"f"),P(this,b,!1,"f"),this.connected=!1,this.configReady=!1,P(this,w,n.externalId,"f"),P(this,C,e,"f"),this.userResponded=!1,this.URLS={},window.addEventListener("pageshow",(e=>{e.persisted&&this.connected&&this.connect()}))}getConversationUrl(){return this.store.get("conversationUrl")}hasConversation(){return!!this.getConversationUrl()}clearStore(){this.store.delete("accessToken"),this.store.delete("conversationUrl"),this.store.delete("channelName"),this.store.delete("channelTopic")}reset(){return M(this,void 0,void 0,(function*(){return yield this.disconnect(),this.clearStore(),this.getConfig()}))}disconnect(){var e;return M(this,void 0,void 0,(function*(){(null===(e=this.conversation)||void 0===e?void 0:e.disconnect)&&this.conversation.disconnect(),this.connected=!1,this.configReady=!1}))}getConfig(){return M(this,void 0,void 0,(function*(){try{const e=yield F(`${L(this,y,"m",N).call(this,"http")}/client/${this.connectionInfo.apiKey}/configs`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({context:Object.assign(Object.assign({},L(this,_,"f").context),{environment:!0===L(this,_,"f").sendEnvironment?this.getEnvironment():L(this,_,"f").sendEnvironment})})}),t=yield e.json();return L(this,y,"m",I).call(this,t),this.configReady=!0,t.config}catch(e){if(404===e.status)throw new l.c(e);if(e.status>=500)throw new u.c(e);throw e}}))}getConversation(){return M(this,void 0,void 0,(function*(){if(!this.hasConversation())return null;try{const e=yield F(`${L(this,y,"m",N).call(this,"http")}${this.URLS.history}`,{method:"GET",headers:{Authorization:`Bearer ${L(this,y,"m",j).call(this)}`}}),t=yield e.json();L(this,y,"m",I).call(this,t);const{messages:n,participants:r,activeServiceSessionId:s,activeServiceSettings:o,serviceData:i,ui:a,translation:c}=t.history;return{events:n.map((([e,t])=>({type:e,payload:Object.assign(Object.assign({},t),{type:"participant"===e?e:t.type})}))),participants:r,activeServiceSessionId:s,activeServiceSettings:o,serviceData:i,resumeConversationPrompt:!!a&&Boolean(a.resumeConversationPrompt),translationProposal:a.translationProposal,translation:c}}catch(e){if(401===e.status)throw new p.c(e);if(404===e.status)throw new d.c(e);if(e.status>=500)throw new u.c(e);throw new c(e)}}))}connect(){return M(this,void 0,void 0,(function*(){this.connected=!1;let e={};return this.hasConversation()||(e=yield L(this,y,"m",U).call(this)),this.conversation.connect(`${L(this,y,"m",N).call(this,"ws")}${this.URLS.socket}`,L(this,_,"f").context.channelName,L(this,y,"m",T).call(this),L(this,y,"m",j).call(this)),this.conversation.onConnection((({connected:e,ready:t})=>{this.connected=e,P(this,b,t,"f")})),e}))}uploadFile(e,t,n,r){const s=new FormData;s.append("upload",e);const o=new XMLHttpRequest;return o.open("POST",`${L(this,y,"m",N).call(this,"http")}${this.URLS.uploads}`),o.setRequestHeader("Authorization",`Bearer ${L(this,y,"m",j).call(this)}`),o.upload.onprogress=e=>{if("function"==typeof t){const n=Math.ceil(e.loaded/e.total*100);t(n)}},o.onloadend=()=>{if(0!==o.status)if(200!==o.status&&201!==o.status||!n){if(!r)throw new Error(o.response);try{r(JSON.parse(o.response))}catch(e){r(o.response)}}else try{n(JSON.parse(o.response))}catch(e){n(o.response)}},o.send(s),o}getConversationIntitialState(){return M(this,void 0,void 0,(function*(){try{const e=yield F(`${L(this,y,"m",N).call(this,"http")}${this.getConversationUrl()}`,{method:"GET",headers:{Authorization:`Bearer ${L(this,y,"m",j).call(this)}`}}),t=yield e.json();return L(this,y,"m",I).call(this,t),this.userResponded=t.conversation.userResponded,(0,A.qn)(t.conversation,["accessToken","channelTopic"])}catch(e){if(401===e.status)throw new p.c(e);if(404===e.status)throw new d.c(e);if(e.status>=500)throw new u.c(e);throw e}}))}getTranslations(e){return M(this,void 0,void 0,(function*(){try{if(!this.URLS.translations)throw new l.c;const t=`${L(this,y,"m",N).call(this,"http")}${this.URLS.translations}`.replace("{version}",String(4)).replace("{locale}",L(this,O,"f").call(this,e)),n=yield F(t,{method:"GET"});return(yield n.json()).translations}catch(e){if(e.status>=500)throw new u.c(e);throw new c(e)}}))}send(e,t,n=!0){var r;!this.connected||n&&!L(this,b,"f")?null===(r=this.conversation)||void 0===r||r.onConnection((({connected:r,ready:s})=>(this.connected=r,P(this,b,s,"f"),!!(n?s:r)&&(this.send(e,t,n),!0)))):(D("[SEND]",e,t),this.conversation.pushToChannel(e,function(e,t){if("message"!==e)return t;const{type:n,body:r}=t;let{transactionId:s}=t;return s||(s=(0,v.s)()),{type:n,body:r,transactionId:s}}(e,t),1e4))}sendContext(e){var t,n;const{contentLocale:r,userLocale:s,variables:o,environment:i}=e,a={};if(i&&(a.environment=i),r){if("string"!=typeof r)throw new Error("Content locale must be a string");a.contentLocale=r}if(s){if("string"!=typeof s)throw new Error("User locale must be a string");a.userLocale=s}if(o){if("object"!=typeof o)throw new Error("Variables must be an object");a.variables=o}if(0===Object.keys(a).length&&a.constructor===Object)return;const{contentLocale:c}=a,l=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var s=0;for(r=Object.getOwnPropertySymbols(e);s<r.length;s++)t.indexOf(r[s])<0&&Object.prototype.propertyIsEnumerable.call(e,r[s])&&(n[r[s]]=e[r[s]])}return n}(a,["contentLocale"]),u=null===(t=L(this,_,"f").context)||void 0===t?void 0:t.contentLocale,d=null===(n=L(this,_,"f").context)||void 0===n?void 0:n.userLocale;this.send("context",Object.assign(Object.assign({},u?{contentLocale:u,userLocale:d}:{}),l),!1)}getEnvironment(){return{clientName:"@seamly/web-ui",clientVariant:L(this,C,"f"),clientVersion:"23.0.0-alpha.2",currentUrl:window.location.toString(),screenResolution:`${window.screen.width}x${window.screen.height}`,timezone:B(),userAgent:navigator.userAgent,preferredLocale:navigator.language}}}b=new WeakMap,w=new WeakMap,x=new WeakMap,C=new WeakMap,_=new WeakMap,O=new WeakMap,y=new WeakSet,j=function(){return this.store.get("accessToken")},E=function(e){this.store.set("accessToken",e)},S=function(e){this.store.set("conversationUrl",e)},T=function(){return this.store.get("channelTopic")||this.store.get("channelName")},k=function(e){this.store.set("channelTopic",e)},N=function(e){return`${this.connectionInfo.secure?`${e}s`:e}://${this.connectionInfo.domain}`},I=function({_links:e}){this.URLS=Object.entries(e).filter((([e])=>"self"!==e)).reduce(((e,[t,{href:n}])=>Object.assign(Object.assign({},e),{[t]:n})),this.URLS)},U=function(){var e,t;return M(this,void 0,void 0,(function*(){try{"function"==typeof(null===(e=L(this,_,"f"))||void 0===e?void 0:e.getConversationAuthToken)&&P(this,x,yield L(this,_,"f").getConversationAuthToken(),"f");const n=yield F(`${L(this,y,"m",N).call(this,"http")}${this.URLS.conversations}`,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({externalId:L(this,x,"f")?void 0:L(this,w,"f"),token:L(this,x,"f")})}),r=yield n.json(),{conversation:s}=r,o=Object.assign({},s);return delete o.accessToken,delete o.channelTopic,L(this,y,"m",E).call(this,s.accessToken),L(this,y,"m",k).call(this,s.channelTopic),L(this,y,"m",I).call(this,r),L(this,y,"m",S).call(this,this.URLS.conversation),this.locale=null===(t=s.translation)||void 0===t?void 0:t.locale,this.userResponded=s.userResponded,o}catch(e){if(e.status>=500)throw new u.c(e);if(400===e.status)throw new p.c(e);if(404===e.status)throw new l.c(e);throw e}}))};var $=n(232),V=n(712),H=n(7452),K=n(1760),W=n(2948),q=n(8056),G=n(2328),Y=n(1364),J=n(3460);const X=({children:e})=>((0,J.c)(),(0,s.jsx)(s.Fragment,{children:e}));var Q=n(5352);const Z=(0,a.createContext)({});var ee=n(7456),te=n(7800),ne=n(6204),re=n(6244);const se=({id:e,action:n,buttonText:r,description:o,hasFocus:i,image:a,title:c,isCarouselItem:l})=>{const u=(0,q.useRef)(null),{sendMessage:d,sendAction:p,emitEvent:h}=(0,ne.wv)(),f=(0,ne.k3)(),m=(0,q.useRef)(!1),v=n.type===re.Qv.navigate?"a":"button",g=(0,q.useCallback)((()=>h(`action.${re.w$.clickCard}`,{type:re.w$.clickCta,originMessage:e,action:n})),[h,e,n]),y=(0,q.useCallback)((()=>{if(g(),n.type===re.Qv.ask)d({body:n.ask});else if(n.type===re.Qv.topic){const{topic:e,fallbackMessage:t}=n;p({type:re.w$.setTopic,body:{name:e,fallbackMessage:t}})}}),[d,n,p,g]),b=(0,q.useMemo)((()=>n.type===re.Qv.navigate?{href:n.link,rel:"noopener noreferrer",target:n.newTab?"_blank":"_self",onClick:g}:{onClick:y}),[n,y,g]);return(0,q.useEffect)((()=>{l&&(i&&m.current?window.requestAnimationFrame((()=>u.current.focus())):u.current.blur()),m.current=!0}),[i,l]),(0,s.jsxs)("div",{className:(0,t.U)("card__wrapper"),id:e,tabIndex:-1,ref:u,children:[a?(0,s.jsx)("img",{className:(0,t.U)("card__image"),src:a,alt:""}):null,(0,s.jsxs)("div",{className:(0,t.U)("card__content"),id:e,children:[c&&(0,s.jsx)("h2",{className:(0,t.U)("card__title"),children:c}),o&&(0,s.jsx)("div",{className:(0,t.U)("card__description"),dangerouslySetInnerHTML:{__html:o}}),(0,s.jsx)(v,Object.assign({tabIndex:l&&!i?-1:void 0,className:(0,t.U)("button","button--primary"),"aria-describedby":f},b,{children:r}))]})]})};var oe=n(4640);function ie({item:e,items:n,index:r,isActive:o}){const{t:i}=(0,oe.g)();return(0,s.jsx)("div",{className:(0,t.U)("carousel-item",`carousel-item--${e.type}`),role:"group","aria-roledescription":"slide","aria-label":i("carousel.slide.label",{index:r+1,total:n.length}),children:(0,s.jsx)(se,{...e,isCarouselItem:!0,hasFocus:o})})}var ae=n(1100),ce=n(7888);function le({items:e,currentIndex:n,onChange:r,children:o}){const{t:i}=(0,oe.g)(),a=e.length;return(0,s.jsxs)("div",{className:(0,t.U)("carousel-controls"),children:[(0,s.jsx)("button",{className:(0,t.U)("button","button--previous"),"aria-label":i("carousel.controls.previous"),onClick:()=>{r((n-1+a)%a)},children:(0,s.jsx)(ce.c,{name:"arrowLeft",size:"16",alt:""})}),o,(0,s.jsx)("button",{className:(0,t.U)("button","button--next"),"aria-label":i("carousel.controls.next"),onClick:()=>{r((n+1)%a)},children:(0,s.jsx)(ce.c,{name:"arrowRight",size:"16",alt:""})})]})}function ue({items:e,currentIndex:n,onChange:r,getItemKey:o,getItemLabel:i}){const a=e.length,c=(0,q.useCallback)((e=>{const t=Number(e.target.dataset.item||"0"),s=Math.min(a-1,Math.max(0,t));s!==n&&r(s)}),[a,n,r]);return(0,s.jsx)("div",{className:(0,t.U)("carousel-pagination__wrapper"),role:"group",children:(0,s.jsx)("ul",{className:(0,t.U)("carousel-pagination"),children:e.map(((e,r)=>{const a=n===r;return(0,s.jsx)("li",{className:(0,t.U)("carousel-pagination__item",a?"is-active":void 0),children:(0,s.jsx)("button",{className:(0,t.U)("carousel-pagination__button"),type:"button",onClick:c,"data-item":r,"aria-disabled":a?"true":void 0,"aria-label":i(e,r)})},o(e,r,"pagination-item-"))}))})})}const de=(e,t,n)=>`${n}${t}`,pe=e=>e.label,he=({target:e})=>{e.scrollLeft=0};function fe({currentIndex:e,onChange:n,getItemKey:r=de,getItemLabel:o=pe,items:i}){const c=(0,ae.k3)(),l=i.length,[u,d]=(0,q.useState)(Number(e||"0"));(0,q.useEffect)((()=>{d(Number(e||"0"))}),[d,e]);const p=(0,q.useRef)([]);p.current=(0,q.useMemo)((()=>Array(l).fill(1).map((()=>(0,a.createRef)()))),[l]);const h=(0,q.useRef)(!0),f=(0,q.useRef)();return f.current=n,(0,q.useEffect)((()=>{h.current?h.current=!1:f.current&&f.current(u)}),[u]),(0,s.jsxs)("div",{className:(0,t.U)("carousel"),role:"group","aria-roledescription":"carousel",children:[(0,s.jsx)("div",{className:(0,t.U)("carousel__slides-wrapper"),onScroll:he,children:(0,s.jsx)("div",{id:c,className:(0,t.U)("carousel__slides"),style:{width:100*l+"%",left:-100*u+"%"},"aria-live":"polite","aria-atomic":"false",children:i.map(((e,n)=>{const o=u===n;return(0,s.jsx)("div",{ref:p.current[n],className:(0,t.U)("carousel__slide",o?"is-active":void 0),"aria-hidden":o?void 0:"true",children:(0,s.jsx)(ie,{item:e,items:i,currentIndex:u,index:n,isActive:o})},r(e,n,"item-"))}))})}),(0,s.jsx)("div",{className:(0,t.U)("carousel__controls"),children:(0,s.jsx)(le,{currentIndex:u,items:i,onChange:d,controlId:c,children:(0,s.jsx)("div",{className:(0,t.U)("carousel__pagination"),children:(0,s.jsx)(ue,{currentIndex:u,items:i,onChange:d,getItemKey:r,getItemLabel:o})})})})]})}const me=(e,t,n="")=>`${n}${e.title}:${t}`,ve=e=>e.title;var ge=n(2080),ye=n(1888),be=n(428);const we=e=>`suggestions__item--${String(e).toLowerCase().replace(/[^a-z0-9_\\-]/,"")}`,xe=({id:e,categories:n=[],question:r,onClick:o,hasIcon:i})=>{const a=(0,q.useMemo)((()=>["suggestions__item",...n.map(we)]),[n]),c=(0,q.useCallback)((()=>{o&&o({id:e,question:r})}),[e,r,o]);return(0,s.jsx)("li",{className:(0,t.U)(a),children:(0,s.jsxs)("button",{type:"button",onClick:c,className:(0,t.U)("button","button--primary"),children:[i&&(0,s.jsx)(ce.c,{name:"chevronRight",size:"8",alt:""}),r]})})},Ce=({className:e,suggestions:n=[],onClickSuggestion:r,hasIcon:o=!0})=>(0,s.jsx)("ul",{className:(0,t.U)("suggestions__list",e),children:n.map((e=>(0,s.jsx)(xe,{hasIcon:o,onClick:r,...e},e.id)))}),_e=e=>{const{sendAction:t}=(0,ne.wv)();return n=>{n.target&&n.target.dataset.linkId&&t({type:re.w$.navigate,originMessage:e,link:{id:n.target.dataset.linkId,url:n.target.getAttribute("href")}})}};function je({children:e,childrenHTML:n,className:r,graphicSrc:o,graphicType:i="icon",iconName:a,iconSize:c,iconClassName:l,dividerType:u}){const d=Boolean(a||o),p=n?{dangerouslySetInnerHTML:{__html:n}}:{children:e};return(0,s.jsxs)("div",{className:(0,t.U)("divider",u&&`divider--type-${u}`,r),children:[d&&(0,s.jsx)("span",{className:(0,t.U)("divider__graphic"),children:a?(0,s.jsx)(ce.c,{name:a,size:c,className:l,alt:""}):(0,s.jsx)("img",{src:o,className:(0,t.U)({icon:"icon"===i,avatar:"avatar"===i},l)})}),(0,s.jsx)("div",{className:(0,t.U)("divider__body"),...p})]})}const Ee={[re.MJ.new_topic]:"newtopic"};var Se=n(8456),Te=n(6736);const ke={default:({event:e})=>{const{t}=(0,oe.g)(),{subtype:n}=e.payload.body,r=Ee[re.MJ[n]];return(0,s.jsx)(je,{dividerType:r,iconName:re.MJ[n],children:(0,s.jsx)("p",{children:t(`dividerKeys.${re.MJ[n]}`)})})},[re.MJ.new_translation]:({event:e})=>{const{t:n}=(0,oe.g)(),r=(0,Te.kV)(),{body:{translationEnabled:o,text:i,title:a},id:c}=e.payload,l=(0,G.w1)((e=>e.translations.translatedEventGroups)),u=(0,G.OY)(),d=(0,q.useCallback)((()=>{l[c]?u((0,Se.wr)({events:r,id:c})):u((0,Se.Mt)({events:r,id:c}))}),[u,r,c,l]);return(0,s.jsxs)(je,{iconName:"newTranslation",dividerType:"newtranslation",children:[(0,s.jsx)("p",{className:(0,t.U)("divider__title"),children:a}),i&&(0,s.jsx)("p",{children:i}),o?(0,s.jsx)(s.Fragment,{children:(0,s.jsx)("button",{className:(0,t.U)("button","button--secondary"),onClick:d,children:n(l[c]?"translations.toggle.showTranslationsButtonText":"translations.toggle.hideTranslationsButtonText")})}):null]})}},Oe={month:"long",day:"numeric",year:"numeric"},Ne={hour:"numeric",minute:"numeric"},Ie=({event:e})=>{const n=(0,ae.ei)(),{date:r,time:o,timeUntilMidnight:i,srText:a}=(e=>{const{t}=(0,oe.g)(),n=(0,Q.EV)(),r=n?.context?.locale??[],s=new Date(e),o=new Date,i=new Date(o);i.setHours(24,0,0,0);const a=i-o,c=s.toString(),l=new Intl.DateTimeFormat(r,Ne).format(s);let u=(0,A.aG)(s,o);switch(u){case"today":u=t("dateTime.today");break;case"yesterday":u=t("dateTime.yesterday");break;default:u=new Intl.DateTimeFormat(r,Oe).format(s)}return{date:u,srText:t("dateTime.srText",{date:u,time:l}),time:l,fullDateTime:c,timeUntilMidnight:a}})((0,A.Qv)(e.timeIndicator));return(0,q.useEffect)((()=>{const e=setTimeout((()=>{n()}),i);return()=>{clearTimeout(e)}}),[n,i]),(0,s.jsxs)(je,{dividerType:"time-indicator",children:[(0,s.jsxs)("p",{className:(0,t.U)("divider__time"),"aria-hidden":"true",children:[(0,s.jsx)("span",{children:r}),(0,s.jsx)("span",{children:o})]}),(0,s.jsx)("p",{className:(0,t.U)("visually-hidden"),children:a})]})};var Ue=n(3332),Ae=["input:not([inert])","select:not([inert])","textarea:not([inert])","a[href]:not([inert])","button:not([inert])","[tabindex]:not(slot):not([inert])","audio[controls]:not([inert])","video[controls]:not([inert])",'[contenteditable]:not([contenteditable="false"]):not([inert])',"details>summary:first-of-type:not([inert])","details:not([inert])"],Re=Ae.join(","),Me="undefined"==typeof Element,Pe=Me?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Le=!Me&&Element.prototype.getRootNode?function(e){var t;return null==e||null===(t=e.getRootNode)||void 0===t?void 0:t.call(e)}:function(e){return null==e?void 0:e.ownerDocument},De=function e(t,n){var r;void 0===n&&(n=!0);var s=null==t||null===(r=t.getAttribute)||void 0===r?void 0:r.call(t,"inert");return""===s||"true"===s||n&&t&&e(t.parentNode)},Fe=function(e,t,n){if(De(e))return[];var r=Array.prototype.slice.apply(e.querySelectorAll(Re));return t&&Pe.call(e,Re)&&r.unshift(e),r.filter(n)},Be=function e(t,n,r){for(var s=[],o=Array.from(t);o.length;){var i=o.shift();if(!De(i,!1))if("SLOT"===i.tagName){var a=i.assignedElements(),c=e(a.length?a:i.children,!0,r);r.flatten?s.push.apply(s,c):s.push({scopeParent:i,candidates:c})}else{Pe.call(i,Re)&&r.filter(i)&&(n||!t.includes(i))&&s.push(i);var l=i.shadowRoot||"function"==typeof r.getShadowRoot&&r.getShadowRoot(i),u=!De(l,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(i));if(l&&u){var d=e(!0===l?i.children:l.children,!0,r);r.flatten?s.push.apply(s,d):s.push({scopeParent:i,candidates:d})}else o.unshift.apply(o,i.children)}}return s},ze=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},$e=function(e){if(!e)throw new Error("No node provided");return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||function(e){var t,n=null==e||null===(t=e.getAttribute)||void 0===t?void 0:t.call(e,"contenteditable");return""===n||"true"===n}(e))&&!ze(e)?0:e.tabIndex},Ve=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},He=function(e){return"INPUT"===e.tagName},Ke=function(e){var t=e.getBoundingClientRect(),n=t.width,r=t.height;return 0===n&&0===r},We=function(e,t){return!(t.disabled||De(t)||function(e){return He(e)&&"hidden"===e.type}(t)||function(e,t){var n=t.displayCheck,r=t.getShadowRoot;if("hidden"===getComputedStyle(e).visibility)return!0;var s=Pe.call(e,"details>summary:first-of-type")?e.parentElement:e;if(Pe.call(s,"details:not([open]) *"))return!0;if(n&&"full"!==n&&"legacy-full"!==n){if("non-zero-area"===n)return Ke(e)}else{if("function"==typeof r){for(var o=e;e;){var i=e.parentElement,a=Le(e);if(i&&!i.shadowRoot&&!0===r(i))return Ke(e);e=e.assignedSlot?e.assignedSlot:i||a===e.ownerDocument?i:a.host}e=o}if(function(e){var t,n,r,s,o=e&&Le(e),i=null===(t=o)||void 0===t?void 0:t.host,a=!1;if(o&&o!==e)for(a=!!(null!==(n=i)&&void 0!==n&&null!==(r=n.ownerDocument)&&void 0!==r&&r.contains(i)||null!=e&&null!==(s=e.ownerDocument)&&void 0!==s&&s.contains(e));!a&&i;){var c,l,u;a=!(null===(l=i=null===(c=o=Le(i))||void 0===c?void 0:c.host)||void 0===l||null===(u=l.ownerDocument)||void 0===u||!u.contains(i))}return a}(e))return!e.getClientRects().length;if("legacy-full"!==n)return!0}return!1}(t,e)||function(e){return"DETAILS"===e.tagName&&Array.prototype.slice.apply(e.children).some((function(e){return"SUMMARY"===e.tagName}))}(t)||function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var t=e.parentElement;t;){if("FIELDSET"===t.tagName&&t.disabled){for(var n=0;n<t.children.length;n++){var r=t.children.item(n);if("LEGEND"===r.tagName)return!!Pe.call(t,"fieldset[disabled] *")||!r.contains(e)}return!0}t=t.parentElement}return!1}(t))},qe=function(e,t){return!(function(e){return function(e){return He(e)&&"radio"===e.type}(e)&&!function(e){if(!e.name)return!0;var t,n=e.form||Le(e),r=function(e){return n.querySelectorAll('input[type="radio"][name="'+e+'"]')};if("undefined"!=typeof window&&void 0!==window.CSS&&"function"==typeof window.CSS.escape)t=r(window.CSS.escape(e.name));else try{t=r(e.name)}catch(e){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",e.message),!1}var s=function(e,t){for(var n=0;n<e.length;n++)if(e[n].checked&&e[n].form===t)return e[n]}(t,e.form);return!s||s===e}(e)}(t)||$e(t)<0||!We(e,t))},Ge=function(e){var t=parseInt(e.getAttribute("tabindex"),10);return!!(isNaN(t)||t>=0)},Ye=function e(t){var n=[],r=[];return t.forEach((function(t,s){var o=!!t.scopeParent,i=o?t.scopeParent:t,a=function(e,t){var n=$e(e);return n<0&&t&&!ze(e)?0:n}(i,o),c=o?e(t.candidates):i;0===a?o?n.push.apply(n,c):n.push(i):r.push({documentOrder:s,tabIndex:a,item:t,isScope:o,content:c})})),r.sort(Ve).reduce((function(e,t){return t.isScope?e.push.apply(e,t.content):e.push(t.content),e}),[]).concat(n)},Je=function(e,t){if(t=t||{},!e)throw new Error("No node provided");return!1!==Pe.call(e,Re)&&qe(t,e)},Xe=Ae.concat("iframe").join(","),Qe=function(e,t){if(t=t||{},!e)throw new Error("No node provided");return!1!==Pe.call(e,Xe)&&We(t,e)};function Ze(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function et(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ze(Object(n),!0).forEach((function(t){var r,s,o;r=e,s=t,o=n[t],s=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(s),s in r?Object.defineProperty(r,s,{value:o,enumerable:!0,configurable:!0,writable:!0}):r[s]=o})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ze(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var tt=function(e){return"Tab"===(null==e?void 0:e.key)||9===(null==e?void 0:e.keyCode)},nt=function(e){return tt(e)&&!e.shiftKey},rt=function(e){return tt(e)&&e.shiftKey},st=function(e){return setTimeout(e,0)},ot=function(e,t){var n=-1;return e.every((function(e,r){return!t(e)||(n=r,!1)})),n},it=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return"function"==typeof e?e.apply(void 0,n):e},at=function(e){return e.target.shadowRoot&&"function"==typeof e.composedPath?e.composedPath()[0]:e.target},ct=[],lt=function(e,t){var n,r=(null==t?void 0:t.document)||document,s=(null==t?void 0:t.trapStack)||ct,o=et({returnFocusOnDeactivate:!0,escapeDeactivates:!0,delayInitialFocus:!0,isKeyForward:nt,isKeyBackward:rt},t),i={containers:[],containerGroups:[],tabbableGroups:[],nodeFocusedBeforeActivation:null,mostRecentlyFocusedNode:null,active:!1,paused:!1,delayInitialFocusTimer:void 0,recentNavEvent:void 0},a=function(e,t,n){return e&&void 0!==e[t]?e[t]:o[n||t]},c=function(e,t){var n="function"==typeof(null==t?void 0:t.composedPath)?t.composedPath():void 0;return i.containerGroups.findIndex((function(t){var r=t.container,s=t.tabbableNodes;return r.contains(e)||(null==n?void 0:n.includes(r))||s.find((function(t){return t===e}))}))},l=function(e){var t=o[e];if("function"==typeof t){for(var n=arguments.length,s=new Array(n>1?n-1:0),i=1;i<n;i++)s[i-1]=arguments[i];t=t.apply(void 0,s)}if(!0===t&&(t=void 0),!t){if(void 0===t||!1===t)return t;throw new Error("`".concat(e,"` was specified but was not a node, or did not return a node"))}var a=t;if("string"==typeof t&&!(a=r.querySelector(t)))throw new Error("`".concat(e,"` as selector refers to no known node"));return a},u=function(){var e=l("initialFocus");if(!1===e)return!1;if(void 0===e||!Qe(e,o.tabbableOptions))if(c(r.activeElement)>=0)e=r.activeElement;else{var t=i.tabbableGroups[0];e=t&&t.firstTabbableNode||l("fallbackFocus")}if(!e)throw new Error("Your focus-trap needs to have at least one focusable element");return e},d=function(){if(i.containerGroups=i.containers.map((function(e){var t=function(e,t){var n;return n=(t=t||{}).getShadowRoot?Be([e],t.includeContainer,{filter:qe.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:Ge}):Fe(e,t.includeContainer,qe.bind(null,t)),Ye(n)}(e,o.tabbableOptions),n=function(e,t){return(t=t||{}).getShadowRoot?Be([e],t.includeContainer,{filter:We.bind(null,t),flatten:!0,getShadowRoot:t.getShadowRoot}):Fe(e,t.includeContainer,We.bind(null,t))}(e,o.tabbableOptions),r=t.length>0?t[0]:void 0,s=t.length>0?t[t.length-1]:void 0,i=n.find((function(e){return Je(e)})),a=n.slice().reverse().find((function(e){return Je(e)})),c=!!t.find((function(e){return $e(e)>0}));return{container:e,tabbableNodes:t,focusableNodes:n,posTabIndexesFound:c,firstTabbableNode:r,lastTabbableNode:s,firstDomTabbableNode:i,lastDomTabbableNode:a,nextTabbableNode:function(e){var r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],s=t.indexOf(e);return s<0?r?n.slice(n.indexOf(e)+1).find((function(e){return Je(e)})):n.slice(0,n.indexOf(e)).reverse().find((function(e){return Je(e)})):t[s+(r?1:-1)]}}})),i.tabbableGroups=i.containerGroups.filter((function(e){return e.tabbableNodes.length>0})),i.tabbableGroups.length<=0&&!l("fallbackFocus"))throw new Error("Your focus-trap must have at least one container with at least one tabbable node in it at all times");if(i.containerGroups.find((function(e){return e.posTabIndexesFound}))&&i.containerGroups.length>1)throw new Error("At least one node with a positive tabindex was found in one of your focus-trap's multiple containers. Positive tabindexes are only supported in single-container focus-traps.")},p=function e(t){var n=t.activeElement;if(n)return n.shadowRoot&&null!==n.shadowRoot.activeElement?e(n.shadowRoot):n},h=function e(t){!1!==t&&t!==p(document)&&(t&&t.focus?(t.focus({preventScroll:!!o.preventScroll}),i.mostRecentlyFocusedNode=t,function(e){return e.tagName&&"input"===e.tagName.toLowerCase()&&"function"==typeof e.select}(t)&&t.select()):e(u()))},f=function(e){var t=l("setReturnFocus",e);return t||!1!==t&&e},m=function(e){var t=e.target,n=e.event,r=e.isBackward,s=void 0!==r&&r;t=t||at(n),d();var a=null;if(i.tabbableGroups.length>0){var u=c(t,n),p=u>=0?i.containerGroups[u]:void 0;if(u<0)a=s?i.tabbableGroups[i.tabbableGroups.length-1].lastTabbableNode:i.tabbableGroups[0].firstTabbableNode;else if(s){var h=ot(i.tabbableGroups,(function(e){var n=e.firstTabbableNode;return t===n}));if(h<0&&(p.container===t||Qe(t,o.tabbableOptions)&&!Je(t,o.tabbableOptions)&&!p.nextTabbableNode(t,!1))&&(h=u),h>=0){var f=0===h?i.tabbableGroups.length-1:h-1,m=i.tabbableGroups[f];a=$e(t)>=0?m.lastTabbableNode:m.lastDomTabbableNode}else tt(n)||(a=p.nextTabbableNode(t,!1))}else{var v=ot(i.tabbableGroups,(function(e){var n=e.lastTabbableNode;return t===n}));if(v<0&&(p.container===t||Qe(t,o.tabbableOptions)&&!Je(t,o.tabbableOptions)&&!p.nextTabbableNode(t))&&(v=u),v>=0){var g=v===i.tabbableGroups.length-1?0:v+1,y=i.tabbableGroups[g];a=$e(t)>=0?y.firstTabbableNode:y.firstDomTabbableNode}else tt(n)||(a=p.nextTabbableNode(t))}}else a=l("fallbackFocus");return a},v=function(e){var t=at(e);c(t,e)>=0||(it(o.clickOutsideDeactivates,e)?n.deactivate({returnFocus:o.returnFocusOnDeactivate}):it(o.allowOutsideClick,e)||e.preventDefault())},g=function(e){var t=at(e),n=c(t,e)>=0;if(n||t instanceof Document)n&&(i.mostRecentlyFocusedNode=t);else{var r;e.stopImmediatePropagation();var s=!0;if(i.mostRecentlyFocusedNode)if($e(i.mostRecentlyFocusedNode)>0){var a=c(i.mostRecentlyFocusedNode),l=i.containerGroups[a].tabbableNodes;if(l.length>0){var d=l.findIndex((function(e){return e===i.mostRecentlyFocusedNode}));d>=0&&(o.isKeyForward(i.recentNavEvent)?d+1<l.length&&(r=l[d+1],s=!1):d-1>=0&&(r=l[d-1],s=!1))}}else i.containerGroups.some((function(e){return e.tabbableNodes.some((function(e){return $e(e)>0}))}))||(s=!1);else s=!1;s&&(r=m({target:i.mostRecentlyFocusedNode,isBackward:o.isKeyBackward(i.recentNavEvent)})),h(r||i.mostRecentlyFocusedNode||u())}i.recentNavEvent=void 0},y=function(e){if(("Escape"===(null==(t=e)?void 0:t.key)||"Esc"===(null==t?void 0:t.key)||27===(null==t?void 0:t.keyCode))&&!1!==it(o.escapeDeactivates,e))return e.preventDefault(),void n.deactivate();var t;(o.isKeyForward(e)||o.isKeyBackward(e))&&function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];i.recentNavEvent=e;var n=m({event:e,isBackward:t});n&&(tt(e)&&e.preventDefault(),h(n))}(e,o.isKeyBackward(e))},b=function(e){var t=at(e);c(t,e)>=0||it(o.clickOutsideDeactivates,e)||it(o.allowOutsideClick,e)||(e.preventDefault(),e.stopImmediatePropagation())},w=function(){if(i.active)return function(e,t){if(e.length>0){var n=e[e.length-1];n!==t&&n.pause()}var r=e.indexOf(t);-1===r||e.splice(r,1),e.push(t)}(s,n),i.delayInitialFocusTimer=o.delayInitialFocus?st((function(){h(u())})):h(u()),r.addEventListener("focusin",g,!0),r.addEventListener("mousedown",v,{capture:!0,passive:!1}),r.addEventListener("touchstart",v,{capture:!0,passive:!1}),r.addEventListener("click",b,{capture:!0,passive:!1}),r.addEventListener("keydown",y,{capture:!0,passive:!1}),n},x=function(){if(i.active)return r.removeEventListener("focusin",g,!0),r.removeEventListener("mousedown",v,!0),r.removeEventListener("touchstart",v,!0),r.removeEventListener("click",b,!0),r.removeEventListener("keydown",y,!0),n},C="undefined"!=typeof window&&"MutationObserver"in window?new MutationObserver((function(e){e.some((function(e){return Array.from(e.removedNodes).some((function(e){return e===i.mostRecentlyFocusedNode}))}))&&h(u())})):void 0,_=function(){C&&(C.disconnect(),i.active&&!i.paused&&i.containers.map((function(e){C.observe(e,{subtree:!0,childList:!0})})))};return n={get active(){return i.active},get paused(){return i.paused},activate:function(e){if(i.active)return this;var t=a(e,"onActivate"),n=a(e,"onPostActivate"),s=a(e,"checkCanFocusTrap");s||d(),i.active=!0,i.paused=!1,i.nodeFocusedBeforeActivation=r.activeElement,null==t||t();var o=function(){s&&d(),w(),_(),null==n||n()};return s?(s(i.containers.concat()).then(o,o),this):(o(),this)},deactivate:function(e){if(!i.active)return this;var t=et({onDeactivate:o.onDeactivate,onPostDeactivate:o.onPostDeactivate,checkCanReturnFocus:o.checkCanReturnFocus},e);clearTimeout(i.delayInitialFocusTimer),i.delayInitialFocusTimer=void 0,x(),i.active=!1,i.paused=!1,_(),function(e,t){var n=e.indexOf(t);-1!==n&&e.splice(n,1),e.length>0&&e[e.length-1].unpause()}(s,n);var r=a(t,"onDeactivate"),c=a(t,"onPostDeactivate"),l=a(t,"checkCanReturnFocus"),u=a(t,"returnFocus","returnFocusOnDeactivate");null==r||r();var d=function(){st((function(){u&&h(f(i.nodeFocusedBeforeActivation)),null==c||c()}))};return u&&l?(l(f(i.nodeFocusedBeforeActivation)).then(d,d),this):(d(),this)},pause:function(e){if(i.paused||!i.active)return this;var t=a(e,"onPause"),n=a(e,"onPostPause");return i.paused=!0,null==t||t(),x(),_(),null==n||n(),this},unpause:function(e){if(!i.paused||!i.active)return this;var t=a(e,"onUnpause"),n=a(e,"onPostUnpause");return i.paused=!1,null==t||t(),d(),w(),_(),null==n||n(),this},updateContainerElements:function(e){var t=[].concat(e).filter(Boolean);return i.containers=t.map((function(e){return"string"==typeof e?r.querySelector(e):e})),i.active&&d(),_(),this}},n.updateContainerElements(e),n};const ut=({children:e,onClose:t,"aria-label":n,"aria-labelledby":r,fallBackFocusRef:s})=>{const o=(0,ne.k3)(),i=(0,q.useRef)(null),c=(0,q.useRef)(null),[l,u]=(0,q.useState)(!1);return(0,q.useEffect)((()=>(l&&(c.current=lt(i.current,{initialFocus:s&&s.current?s.current:null}),c.current.activate()),()=>{c.current&&c.current.deactivate()})),[l,s]),(0,q.useEffect)((()=>{const e=(0,A.Av)();return()=>{e()}}),[l]),(0,q.useEffect)((()=>{l&&i.current.addEventListener("keydown",(e=>{(e.code&&"Escape"===e.code||27===e.keyCode)&&t()}))}),[l,t]),(0,q.useLayoutEffect)((()=>{const e=document.getElementsByTagName("body")[0],t=document.createElement("div");return t.setAttribute("id",o),t.setAttribute("role","dialog"),t.setAttribute("data-nosnippet","true"),t.setAttribute("aria-modal","true"),n&&t.setAttribute("aria-label",n),r&&t.setAttribute("aria-labelledby",r),e.appendChild(t),i.current=t,u(!0),()=>{i.current&&(e.removeChild(i.current),i.current=null)}}),[n,r,o]),"function"==typeof e?e({onClose:t,modalRenderFn:e=>i.current&&(0,a.render)(e,i.current)}):i.current&&(0,a.render)((0,a.toChildArray)(e).map((e=>(e.props={...e.props,onClose:t},e))),i.current)},dt=({url:e,description:n,onClose:r})=>{const{zIndex:o,layoutMode:i,namespace:a}=(0,Q.EV)(),c=(0,ne.GU)(),l=(0,ne.EF)(),u=(0,q.useRef)(null),{t:d}=(0,oe.g)(),p=["modal",`app--layout-${i}`,`namespace--${a}`,...l],h=e=>{e.stopPropagation()},f=()=>{r()},m=o?{zIndex:o+1}:void 0;return(0,s.jsx)(ut,{onClose:r,"aria-label":d("lightbox.heading"),fallBackFocusRef:u,children:({onClose:r,modalRenderFn:o})=>o((r=>(0,s.jsx)("div",{className:(0,t.U)(p),onClick:f,style:m,children:(0,s.jsxs)("div",{className:(0,t.U)("modal__float"),tabIndex:"-1",onMouseDown:c,onKeyDown:c,onTouchStart:c,onMouseMove:c,onWheel:c,onPointerDown:c,onPointerMove:c,ref:u,children:[(0,s.jsx)("div",{className:(0,t.U)("modal__inner"),onClick:h,children:(0,s.jsx)("img",{className:(0,t.U)("modal__image"),src:e,alt:n})}),(0,s.jsxs)("button",{type:"button",className:(0,t.U)("modal__close"),onClick:r,children:[(0,s.jsx)(ce.c,{name:"close",size:"16",alt:""}),d("lightbox.closeLabel")]})]})}))(r))})},pt=({description:e,url:n})=>{const{t:r}=(0,oe.g)(),[o,i]=(0,q.useState)(!1);return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("button",{type:"button",className:(0,t.U)("modal__enlarge"),onClick:()=>{i(!0)},children:[r("message.image.srTextEnlargeButtonLabel",{description:e}),(0,s.jsx)(ce.c,{name:"enlarge",size:"32",alt:""})]}),o&&(0,s.jsx)(dt,{url:n,description:e,onClose:()=>{i(!1)}})]})},ht=({event:e,...t})=>{const{body:n}=(0,ee.kx)(e),r=_e(e.payload.id),o=(0,q.useMemo)((()=>e.payload.optimisticallyInjected?{children:(0,s.jsx)("p",{children:n.text})}:{bodyProps:{dangerouslySetInnerHTML:{__html:n?.data?.text||n.text}}}),[n,e]);return(0,s.jsx)(te.c,{type:"text",event:e,onClick:r,...t,...o})},ft="PROCESSING_IMAGE",mt=({img:e,filename:n})=>{const{t:r}=(0,oe.g)(),o=r("fileUpload.srFileUploadedText",{fileName:n});return(0,s.jsx)(s.Fragment,{children:(0,s.jsxs)("span",{className:(0,t.U)(["download","download--preview"]),children:[(0,s.jsx)("img",{src:e,alt:o}),(0,s.jsx)("span",{"aria-hidden":"true",className:(0,t.U)("file-download"),children:n})]})})},vt=({children:e,url:n,target:r})=>n?(0,s.jsx)("a",{href:n,download:!0,target:r,className:(0,t.U)(["download","download-link"]),children:e}):(0,s.jsx)("span",{className:(0,t.U)("download"),children:e}),gt={message:{choice_prompt:ge.c,text:ht,image:({event:e,descriptorId:t,...n})=>{const{body:r}=(0,ee.kx)(e),{description:o,url:i,isZoomable:a}=r,[c,l]=(0,q.useState)(!1),u=(0,G.OY)();return(0,s.jsxs)(te.c,{event:e,type:"image",...n,children:[(0,s.jsx)("img",{src:i,id:t,alt:o,onLoad:()=>{u((0,Ue.cB)(e.payload.id)),l(!0)}}),a&&c&&(0,s.jsx)(pt,{description:o,url:i})]})},splash:({event:e,...t})=>{const{payload:n}=e,{body:r}=(0,ee.kx)(e),o=_e(n.id);return(0,s.jsx)(te.c,{type:"splash",event:e,onClick:o,...t,bodyProps:{dangerouslySetInnerHTML:{__html:r.text}}})},video:({event:e,descriptorId:n,...r})=>{const{body:o}=(0,ee.kx)(e),{description:i,url:a}=o;return(0,ne.li)(e).push("message--type-video"),(0,s.jsxs)(te.c,{event:e,type:"video",...r,children:[(0,s.jsx)("div",{id:n,className:(0,t.U)("visually-hidden"),children:i}),(0,s.jsx)("iframe",{title:i,src:a,allow:"autoplay; encrypted-media",allowFullScreen:!0})]})},upload:({event:e,...n})=>{const{t:r}=(0,oe.g)(),{body:o}=(0,ee.kx)(e),{fromClient:i,id:a}=e.payload,{filename:c,url:l}=o,u=(e=>{const{processingFileUploads:t}=(0,G.w1)((({state:e})=>e));return(0,q.useMemo)((()=>{if(t.some((t=>t===e)))return ft;try{return sessionStorage.getItem(`image-${e}`)}catch(e){return}}),[e,t])})(a),d=(0,q.useMemo)((()=>r(l?"fileUpload.srFileDownloadText":"fileUpload.srFileUploadedText",{fileName:c})),[l,c,r]);return(0,s.jsx)(te.c,{event:e,type:"upload",...n,children:u&&u!==ft?(0,s.jsx)(mt,{img:u,filename:c}):(0,s.jsxs)(vt,{url:l,target:i?void 0:"_blank",children:[(0,s.jsx)(ce.c,{name:"download",size:"16",alt:d}),(0,s.jsx)("span",{"aria-hidden":"true",className:(0,t.U)("file-download"),children:c})]})})},cta:({event:e})=>{const{body:n}=(0,ee.kx)(e),r=_e(e.payload.id),{emitEvent:o}=(0,ne.wv)(),i=(0,ne.k3)(),a=(0,q.useCallback)((()=>o(`action.${re.w$.clickCta}`,{type:re.w$.clickCta,originMessage:e.payload.id,link:{url:n.buttonLink}})),[o,n,e]);return(0,s.jsxs)(te.c,{type:"cta",event:e,children:[(0,s.jsx)("div",{className:(0,t.U)("cta__content"),id:i,dangerouslySetInnerHTML:{__html:n.description},onClick:r}),(0,s.jsx)("a",{className:(0,t.U)("button","button--primary"),"aria-describedby":i,href:n.buttonLink,rel:"noreferrer",target:n.buttonNewTab?"_blank":"_self",onClick:a,children:n.buttonText})]})},carousel:({event:e})=>{const{body:t}=(0,ee.kx)(e),n=t.cards;return(0,s.jsx)(te.c,{event:e,modifiers:"type-carousel",children:(0,s.jsx)(fe,{items:n,ItemComponent:ie,getItemKey:me,getItemLabel:ve})})},card:({event:e})=>{const{body:t}=(0,ee.kx)(e),n=(0,ne.k3)();return(0,s.jsx)(te.c,{type:"card",event:e,children:(0,s.jsx)(se,{id:n,...t})})}},info:{text:ht,divider:({event:e,...t})=>{const n=ke[re.MJ[e.payload.body.subtype]]||ke.default;return(0,s.jsx)(n,{event:e,...t})},translation:({event:e,...t})=>{const{t:n}=(0,oe.g)(),{body:r}=(0,ee.kx)(e);return(0,s.jsx)(te.c,{type:"text",event:e,...t,children:n(r.key.join("."),r.variables)})},timeIndicator:Ie},participant:{participant:({event:e})=>{const{participant:t}=e.payload,{body:n}=(0,ee.kx)(e);return n?(0,s.jsx)(je,{graphicSrc:t.avatar,graphicType:t.avatar?"avatar":void 0,iconName:t.avatar?void 0:"balloon",childrenHTML:n,dividerType:"participant"}):null}},service_data:{suggestion:({event:e,...n})=>{const[r,o]=(0,q.useState)(!0),i=(0,G.OY)(),a=(0,ye.w)(),{sendAction:c,addMessageBubble:l}=(0,ne.wv)(),{suggestions:u,payload:d}=(e=>{const{payload:t}=e,{body:n}=(0,ee.kx)(e);return{suggestions:n,payload:t}})(e),{showSuggestions:p}=(0,Q.EV)(),h=(0,ne.kV)(),{t:f}=(0,oe.g)(),m=f("suggestions.headingText"),v=f("suggestions.footerText"),g=(0,q.useMemo)((()=>h.some((({payload:e})=>e?.transactionLast))),[h]),y=(0,q.useCallback)((({id:e,question:t})=>{o(!1),i((0,be.N8)(!0)),c({type:re.w$.custom,originMessage:d.id,body:{type:"faqclick",body:{faqId:e,faqQuestion:t}}}),l(t)}),[i,c,d.id,l]);return r&&!a&&g&&p?(0,s.jsxs)("div",{className:(0,t.U)("suggestions","suggestions--conversation"),children:[m&&(0,s.jsx)("p",{className:(0,t.U)("suggestions__heading"),children:m}),(0,s.jsxs)(te.c,{type:"suggestions",showParticipant:!1,event:e,...n,children:[(0,s.jsx)(Ce,{className:"suggestions__list--conversation",onClickSuggestion:y,suggestions:u}),v&&(0,s.jsx)("p",{className:(0,t.U)("suggestions__footer"),children:v})]})]}):null}}},yt=({children:e})=>{const{customComponents:t}=(0,Q.EV)(),n=(0,q.useMemo)((()=>Object.keys(gt).reduce(((e,n)=>({...e,[n]:{...gt[n],...t?t[n]:{}}})),{fallback:ht})),[t]);return(0,s.jsx)(Z.Provider,{value:n,children:e})};var bt=n(8632),wt=n(9500);const xt=({children:e})=>{const{isMinimized:n}=(0,bt.uu)(),r=(0,q.useRef)(0),{sendAction:o}=(0,ne.wv)(),{hasCountdown:i,isActive:a,stopCountdown:c}=(0,ne.sD)(),l=(0,q.useCallback)((()=>{if(n)return;const e=(new Date).getTime(),t=()=>{o({type:re.w$.interactivityUpdate}),r.current=e};i&&a&&(t(),c()),e-r.current>h.oP&&t()}),[o,i,a,c,n]);return(0,s.jsx)("div",{className:(0,t.U)("activity-monitor"),tabIndex:-1,onMouseDown:l,onKeyUp:l,onTouchStart:l,onMouseMove:l,onWheel:l,onPointerDown:l,onPointerMove:l,children:(0,s.jsx)(wt.c.Provider,{value:l,children:e})})};var Ct=n(5308),_t=n(8132),jt=n(4528),Et=n(1880),St=n(7468),Tt=n(9816);const kt=["text","choice_prompt","image","video"],Ot=()=>{const e=(0,Tt.c)(),t=(0,q.useRef)(),n=(0,q.useRef)(),r=(0,K.A)(),s=(0,q.useContext)(Ct.E),o=(0,q.useRef)(null),{initCountdown:i,endCountdown:a}=(0,ne.sD)(),{emitEvent:c}=(0,ne.wv)();return(0,q.useEffect)((()=>{if(e.socket){const{socket:t}=e;t.onError((e=>{const t=new _t.c(e);r((0,Et.yA)({name:t.name,message:t.message,langKey:t.langKey,originalEvent:t.originalEvent,originalError:t.originalError})),r((0,Ue.kV)())})),t.onOpen((()=>{r((0,Et.aI)())}))}}),[e,r]),(0,q.useEffect)((()=>{e.socket&&e.onConnection((({currentState:e})=>{if("join_channel_erred"===e){const e=new u.c;return r((0,Et.yA)({name:e.name,message:e.message,langKey:e.langKey,originalEvent:e.originalEvent,originalError:e.originalError,action:e.action})),!0}return!1}))}),[e,r]),(0,q.useEffect)((()=>{const t=e=>{if("participant"!==e.type)return;const{payload:t}=e;if(!t||!t.participant)return;const{fromClient:n,participant:s}=t;!n&&"string"!=typeof s&&(null==s?void 0:s.name)&&r((0,Ue.E1)(s.name)),r((0,Ue.uE)({participant:s,fromClient:n})),"string"!=typeof s&&s.introduction&&r((0,Ue.Ux)(e))};e.onConnection((({connected:n})=>{if(!n)return!1;const{channel:o}=e;return o.onMessage=(e,n)=>{const o={type:e,payload:n};switch(e){case"ui":switch(n.state&&n.state.hasOwnProperty("loading")&&r((0,Ue.hB)(n.state.loading)),n.type){case"idle_detach_countdown":i(n.body.duration);break;case"idle_detach_countdown_elapsed":a(void 0,!0);break;case"resume_conversation_prompt":r((0,Ue.op)());break;case"translation_proposal":r((0,Se.kx)(n.body));break;case"user_first_response":r((0,be.N8)(!0)),s.emit("system.userFirstResponse",n.body)}break;case"context":n.contentLocale&&n.userLocale&&r((0,jt.K)(n.userLocale));break;case"message":switch(t(n),n.type){case"text":case"choice_prompt":case"splash":case"image":case"upload":case"video":case"cta":case"custom":case"carousel":case"card":n.service&&n.service.serviceSessionId&&r((0,Ue.nC)(n.service.serviceSessionId)),r((0,Ue.Ux)(o))}break;case"participant":t(o);break;case"service_data":n.persist&&r((0,Ue.ai)(n));break;case"ack":r((0,Ue.q_)(o));break;case"system":if("service_changed"===n.type){const{serviceSettings:e}=n,t=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var s=0;for(r=Object.getOwnPropertySymbols(e);s<r.length;s++)t.indexOf(r[s])<0&&Object.prototype.propertyIsEnumerable.call(e,r[s])&&(n[r[s]]=e[r[s]])}return n}(n,["serviceSettings"]),{entry:s,proactiveMessages:o}=e,{upload:i}=s.options;r((0,Ue.us)({key:re.gn.uploads,enabled:!(!i||!i.enabled)})),r((0,Ue._8)(o.enabled||!1)),r((0,Ue.UD)(s)),n.serviceSessionId&&r((0,Ue.nC)(n.serviceSessionId)),c("system.serviceChanged",t)}break;case"info":"divider"!==n.type&&"text"!==n.type&&"translation"!==n.type||r((0,Ue.Ux)(o));break;case"error":switch(n.type){case"find_conversation_erred":const e=new d.c(o);r((0,Et.yA)({name:e.name,action:e.action,message:e.message,originalEvent:e.originalEvent,originalError:e.originalError}));break;case"conversation_erred":case"attach_channel_erred":const t=new u.c(o);r((0,Et.yA)({name:t.name,message:t.message,langKey:t.langKey,originalEvent:t.originalEvent,originalError:t.originalError,action:t.action}))}}return n},!1}))}),[e,r,c,a,s,i]),(0,q.useEffect)((()=>{e.onConnection((({connected:t})=>{if(!t)return!1;const{channel:r}=e;return n.current&&r.off("message",n.current),n.current=r.on("message",(e=>kt.includes(e.type)?(e.id!==o.current&&s.emit("message",e),o.current=e.id,e):e)),!0}))}),[e,s]),(0,q.useEffect)((()=>{e.onConnection((({connected:n})=>!!n&&(t.current&&e.channel.off("sync",t.current),t.current=e.channel.on("sync",(e=>{return t=void 0,n=void 0,o=function*(){try{const t=yield r((0,St.m)(e)).unwrap();if(!t)return;r((0,Ue.Yh)(t))}catch(e){}},new((s=void 0)||(s=Promise))((function(e,r){function i(e){try{c(o.next(e))}catch(e){r(e)}}function a(e){try{c(o.throw(e))}catch(e){r(e)}}function c(t){var n;t.done?e(t.value):(n=t.value,n instanceof s?n:new s((function(e){e(n)}))).then(i,a)}c((o=o.apply(t,n||[])).next())}));var t,n,s,o})),!0)))}),[e,r]),null};var Nt=n(9056),It=function(e,t,n,r){return new(n||(n=Promise))((function(s,o){function i(e){try{c(r.next(e))}catch(e){o(e)}}function a(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?s(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(i,a)}c((r=r.apply(e,t||[])).next())}))};const Ut=({children:e})=>{const{t}=(0,oe.g)(),n=(0,G.OY)(),r=(0,ne.Ml)(),{addUploadBubble:o}=(0,ne.wv)(),i=(0,q.useCallback)(((e,t)=>It(void 0,void 0,void 0,(function*(){n((0,Ue.ec)(t));const r=yield(e=>new Promise(((t,n)=>{const r=new FileReader;r.readAsDataURL(e),r.onload=()=>"string"==typeof r.result?t(r.result):void 0,r.onerror=e=>n(e)})))(e),s=new Image;s.src=r,yield s.decode();const o=(e=>{const t=document.createElement("canvas"),n=t.getContext("2d"),[r,s]=(e=>{const{height:t,width:n}=e;return n>t&&n>600?[600,600*t/n]:t>600?[600*n/t,600]:[n,t]})(e);return t.width=r,t.height=s,n.drawImage(e,0,0,r,s),t.toDataURL()})(s);try{sessionStorage.setItem(`image-${t}`,o)}catch(e){}finally{n((0,Ue.Oo)(t))}}))),[n]),a=(0,q.useCallback)((e=>{const s=(0,v.s)(),a=r.uploadFile(e,(e=>{n((0,Ue.AH)({fileId:s,progress:Math.ceil(e)}))}),(t=>It(void 0,void 0,void 0,(function*(){const{id:r,transactionId:a,occurredAt:c,body:{contentType:l,filename:u,filesize:d,url:p}}=t;n((0,Ue.mw)(s)),o(r,a,c,l,u,d,p),yield i(e,r)}))),(e=>{let r;switch((null==e?void 0:e.error)||""){case"file_uploads_are_disabled":r=t("fileUpload.errors.unavailable");break;case"request_entity_too_large":r=t("fileUpload.errors.tooLarge");break;case"file_has_invalid_mime_type":r=t("fileUpload.errors.wrongType");break;case"virus_found":r=t("fileUpload.errors.virusFound");break;default:r=t("fileUpload.errors.general")}n((0,Ue.Qb)({fileId:s,errorText:r}))}));n((0,Ue.SM)({fileId:s,fileName:e.name,uploadHandle:a}))}),[i,o,r,n,t]);return(0,s.jsx)(Nt.c.Provider,{value:a,children:e})};var At=n(952);const Rt=()=>{const{hasCountdown:e,isActive:t,remaining:n,decrementCountdown:r}=(0,At.c)();return((e,t)=>{const n=(0,q.useRef)(e);(0,q.useEffect)((()=>{n.current=e}),[e]),(0,q.useEffect)((()=>{if(null!==t){const e=setInterval((function(){n.current()}),t);return()=>clearInterval(e)}}),[t])})((()=>{r()}),e&&t&&n>0?1e3:null),null},Mt=()=>{const{initUserSelectedOptions:e}=(0,ne.Yj)(),t=(0,q.useRef)(!1),n=(0,Q.EV)();return(0,q.useEffect)((()=>{n.api&&!t.current&&(t.current=!0,e())}),[e,n]),null};var Pt=n(5768),Lt=n(8536);function Dt(e,t,n=[]){const r=(0,q.useContext)(Ct.E),s=(0,q.useRef)();s.current=t,(0,q.useEffect)((()=>{if(!n.every(Boolean))return;const t=(...e)=>s.current?.(...e);return r.emit("function.register",e,t),()=>r.emit("function.unregister",e,t)}),[r,e,...n])}const Ft=()=>{const e=(0,Q.EV)(),{sendMessage:t,sendContext:n,sendAction:r}=(0,ne.wv)(),s=(0,G.OY)(),{setVisibility:o,visible:i}=(0,bt.uu)(),a=(0,q.useRef)(i),c=(0,q.useContext)(Ct.E),l=(0,ne.Ml)(),u=(0,ne.I7)(),d=(0,q.useRef)(null),p=(0,q.useRef)(null),{isInline:f,isResolving:m}=(0,ne.y2)(),v=(0,G.w1)(Pt.Y),g=(0,ne.Y5)(),y=(0,q.useRef)(null),b=(0,ne.GU)(),{enableTranslations:w,disableTranslations:x}=(0,ee.A1)();return(0,q.useEffect)((()=>{a.current=i}),[i]),Dt("askText",(e=>{t({body:e})}),[l.send]),Dt("setVariables",(e=>{n({variables:e})}),[l.send]),Dt("getVisibility",(e=>{e?e(a.current):console.warn("A callback function is required for the getVisibility action.")})),Dt("setVisibility",(e=>{Object.values(Lt.I).includes(e)?(b(),o(e)):console.error('Requested visibility states should be "open", "minimized" ,"hidden" or null.')}),[e?.api]),Dt("sendCustomAction",((e,t)=>{r({type:"custom",body:{type:e,body:t}})}),[l.send]),Dt("setTopic",(({name:e,fallbackMessage:t,userTriggered:n})=>{if(n&&s((0,H.Lp)({showSuggestions:!1})),e&&t){const s=n?h.kr:void 0;r({type:re.w$.setTopic,body:{name:e,fallbackMessage:t,participant:s}})}else console.warn("A name and a fallbackMessage are required for the setTopic action.")}),[l.send]),Dt("setContext",(e=>{n(e)}),[l.send]),Dt("setTranslation",(({enabled:e,locale:t})=>{e?w(t,re.mS.windowApi):x()}),[l.send]),(0,q.useEffect)((()=>{m||v||(y.current&&y.current!==g&&c.emit("unreadMessageCount",u),i===Lt.I.open&&i!==p.current&&0!==d.current&&c.emit("unreadMessageCount",0),i!==Lt.I.open&&u!==d.current&&c.emit("unreadMessageCount",u),p.current=i,d.current=u,y.current=g)}),[u,i,c,f,m,v,g]),null};var Bt=n(6612);const zt=({children:e})=>{const n=(0,q.useContext)(Ct.E),[r,o]=(0,q.useState)({}),i=(0,q.useRef)(!0),a=(0,q.useCallback)((e=>{i.current&&(o(e),n.emit("aria-live",e))}),[o,n]);(0,q.useEffect)((()=>{let e=null;return r&&r.messageText&&(e=setTimeout((()=>{a({}),clearTimeout(e)}),600)),()=>{clearTimeout(e)}}),[r,a]),(0,q.useEffect)((()=>()=>{i.current=!1}),[]);const{ariaLive:c,messageText:l}=r;return(0,s.jsxs)(Bt.e.Provider,{value:a,children:[e,(0,s.jsxs)("div",{className:(0,t.U)("app__live-container"),children:[(0,s.jsx)("div",{"aria-live":"assertive","aria-atomic":"true",className:(0,t.U)("visually-hidden"),children:c===re.kD.assertive?l:null}),(0,s.jsx)("div",{"aria-live":"polite","aria-atomic":"true",className:(0,t.U)("visually-hidden"),children:c===re.kD.polite?l:null})]})]})},$t=()=>{const{t:e}=(0,oe.g)(),t=(0,ne.kV)(),n=(0,q.useRef)(0),r=(0,q.useRef)(0),s=(0,ne.Ir)(),{sendPolite:o}=(0,ne.CE)(),{isOpen:i}=(0,bt.uu)(),a=(0,q.useRef)(null),c=(0,q.useRef)(null),l=(0,q.useMemo)((()=>(0,A.Cu)((t=>{const n=t.filter((({payload:e})=>!e.fromClient&&!e.fromHistory)).length;n>r.current&&(o(e("message.srNewEventCount",{newCount:n-r.current})),r.current=n)}),h.GS)),[o,e]);return(0,q.useEffect)((()=>{t.length>n.current&&(i&&(c.current=l(t)),n.current=t.length)}),[t,l,i]),(0,q.useEffect)((()=>{a.current&&!i&&c.current&&(c.current(!0),c.current=null)}),[i]),(0,q.useEffect)((()=>{s&&setTimeout((()=>{o(e("window.srTexts.onHistoryLoad"))}),500)}),[s,e,o]),null},Vt=()=>{const{t:e}=(0,oe.g)(),{isOpen:t,isVisible:n}=(0,bt.uu)(),r=(0,ne.I7)(),{sendPolite:s}=(0,ne.CE)(),o=(0,q.useMemo)((()=>(0,A.Cu)(s,h.es)),[s]),i=(0,q.useRef)(null),a=(0,q.useRef)(null);return(0,q.useEffect)((()=>{i.current!==n&&!n&&a.current&&a.current(),0!==r&&!t&&n&&(a.current=o(e("message.srTextUnreadCount",{unreadCount:r}))),i.current=n}),[r,t,n,o,e]),null},Ht=({store:e,children:t,eventBus:n,api:r})=>((0,q.useErrorBoundary)((t=>{e.dispatch((0,Y.a)(t))})),(0,s.jsx)(G.C_,{store:e,children:(0,s.jsx)(Ct.E.Provider,{value:n,children:(0,s.jsx)(Ct.c.Provider,{value:r,children:(0,s.jsx)(zt,{children:(0,s.jsx)(X,{children:(0,s.jsxs)(yt,{children:[(0,s.jsx)(Mt,{}),(0,s.jsx)(Ot,{}),(0,s.jsx)(Vt,{}),(0,s.jsx)($t,{}),(0,s.jsx)(Rt,{}),(0,s.jsxs)(xt,{children:[(0,s.jsx)(Ft,{}),(0,s.jsx)(Ut,{children:t})]})]})})})})})}));var Kt=n(8888);const Wt=(0,Kt.M3)(Te.GW,(e=>e.filter((e=>{var t;return(0,Ue.Qr)(e)&&"service_data"!==e.type&&(null===(t=e.payload)||void 0===t?void 0:t.messageStatus)===re.eg.received})))),qt=(0,Kt.M3)(Wt,(e=>e.at(-1))),Gt=(0,Kt.M3)(Wt,(e=>e.map((e=>e.payload.id)))),Yt=(0,Kt.M3)((({state:e})=>{var t;return null===(t=e.options.features)||void 0===t?void 0:t.webNotifications}),(e=>null==e?void 0:e.enabled));var Jt=n(92);const Xt=()=>{const{t:e}=(0,oe.g)(),{showDisclaimer:n}=(0,Q.EV)();return n&&(0,s.jsxs)("div",{className:(0,t.U)("disclaimer"),tabIndex:"0",children:[(0,s.jsx)("h2",{className:(0,t.U)("disclaimer__title"),children:e("disclaimer.title")}),(0,s.jsx)("div",{className:(0,t.U)("disclaimer__message"),dangerouslySetInnerHTML:{__html:e("disclaimer.content")}})]})};var Qt=n(9320);const Zt=(0,Kt.M3)([({forms:e})=>e,(e,{formId:t})=>t],((e,t)=>e[t])),en=(0,Kt.M3)(Zt,(e=>(null==e?void 0:e.controls)||{})),tn=(0,Kt.M3)(en,(e=>{const t={};return Object.entries(e).forEach((([e,{value:n}])=>{t[e]=n})),t})),nn=(0,Kt.M3)([en,(e,{name:t})=>t],((e,t)=>{var n;return null===(n=e[t])||void 0===n?void 0:n.value})),rn=(0,Kt.M3)([en,(e,{name:t})=>t],((e,t)=>{var n;return null===(n=e[t])||void 0===n?void 0:n.touched}));var sn=n(2620);const on=(0,a.createContext)({handleSubmit:()=>{},isSubmitted:!1,isValid:!1,updateControlValue:()=>{},updateControlTouched:()=>{},errors:void 0}),an=on,{Provider:cn,Consumer:ln}=on;function un(){return(0,q.useContext)(an)}function dn(e){const t=(0,G.OY)(),{formId:n,updateControlValue:r,updateControlTouched:s,errors:o}=un(),i=!!(0,G.w1)((e=>Zt(e,{formId:n}))),a=(0,G.w1)((t=>nn(t,{formId:n,name:e}))),c=(0,G.w1)((t=>rn(t,{formId:n,name:e}))),l=null==o?void 0:o[e],u=!l;(0,q.useEffect)((()=>{i&&t((0,sn.YJ)({formId:n,name:e}))}),[i,n,e,t]),(0,q.useLayoutEffect)((()=>()=>{t((0,sn.A$)({formId:n,name:e}))}),[i,n,e,t]);const d=(0,q.useCallback)((t=>r(e,t.target.value)),[e,r]),p=(0,q.useCallback)((()=>{s(e,!0)}),[s,e]);return[(0,q.useMemo)((()=>({name:e,onInput:d,onBlur:p,value:a})),[e,d,p,a]),(0,q.useMemo)((()=>({isValid:u,error:l,touched:c})),[u,l,c])]}var pn=n(8384);function hn(e){const{t}=(0,oe.g)(),{sendAssertive:n}=(0,pn.C)(),{hasLimit:r,limit:s}=(0,Te.qo)(),o=(0,q.useMemo)((()=>(0,A.Cu)(n,h.us)),[n]),i=(0,q.useMemo)((()=>(0,A.Cu)(((e,n)=>{e&&o(t("input.srCharacterLimitText",{limit:n}))}),h.us)),[o,t]),[{value:a}]=dn(e),c=r&&a?s-a.length:s,l=!!r&&c<=h.gJ,u=!!r&&c<0;return(0,q.useEffect)((()=>{i(l,c)}),[l,c,i]),{hasCharacterLimit:r,characterLimit:s,reachedCharacterWarning:l,reachedCharacterLimit:u,remainingChars:c}}const fn=e=>{const{hasCharacterLimit:t,characterLimit:n}=hn(e),{entryMeta:{optionsOverride:{text:r}}}=(0,Te.gf)(),{t:s}=(0,oe.g)();return{placeholder:(0,q.useMemo)((()=>s("input.inputPlaceholder",{hasLimit:t,text:(null==r?void 0:r.placeholder)||s("input.inputPlaceholderText"),limit:t?n:null})),[s,t,n,null==r?void 0:r.placeholder]),label:(0,q.useMemo)((()=>s("input.inputLabel",{hasLimit:!(null==r?void 0:r.label)&&t,text:(null==r?void 0:r.label)||s("input.inputLabelText"),limit:!(null==r?void 0:r.label)&&t?n:null})),[s,t,n,null==r?void 0:r.label]),labelClass:(0,q.useMemo)((()=>(null==r?void 0:r.label)?"label":"visually-hidden"),[null==r?void 0:r.label])}};function mn(){const{abortTransaction:e,clearEntryAbortTransaction:n}=(()=>{const e=(0,G.OY)(),{entryMeta:{actions:t,translatedActions:n}}=(0,Te.gf)();return{abortTransaction:(null==n?void 0:n.abortTransaction)||(null==t?void 0:t.abortTransaction),clearEntryAbortTransaction:()=>{e((0,Ue.Yr)())}}})(),r=(0,Qt.Ml)();return e?(0,s.jsx)("li",{className:(0,t.U)(["cvco-conversation__item","cvco-conversation__item--abort-transaction"]),children:(0,s.jsx)("button",{className:(0,t.U)(["button","button--secondary","abort-transaction__button"]),type:"button",onClick:()=>{r.send("action",{type:re.w$.setTopic,body:{name:e.topicName,fallbackMessage:e.topicFallbackMessage}}),n()},children:e.label})}):null}var vn=n(1864);const gn=(0,a.createContext)(null),yn=e=>{const t=(0,q.useContext)(Z),n=t[e.type];let r=n[e.payload.type],s=null;return e.payload.type===re.ay.choicePrompt&&(s=n[e.payload.body.prompt.type]),"participant"===e.type&&(r=n[e.type]),r&&"function"!=typeof r&&(r=r[e.payload.body.type]),[r||t?.fallback,s]},bn=({event:e,newParticipant:n})=>{const{eventRefs:r,unreadIds:o}=(0,vn.useContext)(gn),{sendAction:i}=(0,ne.wv)(),a=r[e.payload.id],{containerRef:c,isVisible:l}=(0,bt.mo)({containerRef:a,freezeOnceVisible:!0}),u=(0,G.OY)(),[d,p]=yn(e);if((0,vn.useEffect)((()=>{if(l&&(null==o?void 0:o.includes(e.payload.id))){const t=o.reduce(((t,n)=>t.includes(e.payload.id)?t:t.concat(n)),[]);u((0,Ue.A1)(t)),i({type:re.w$.read,events:t})}}),[u,e.payload.id,l,i,o]),!d)return null;const h=["conversation__item"];return"info"===e.type?h.push("conversation__item--source-info"):e.payload.fromClient?h.push("conversation__item--source-user"):h.push("conversation__item--source-agent"),n&&h.push("conversation__item--new-participant"),(0,s.jsxs)("li",{className:(0,t.U)(h),ref:c,children:[e.timeIndicator&&(0,s.jsx)(Ie,{event:e}),(0,s.jsx)(d,{event:e,children:(0,s.jsx)(p,{event:e})})]})};var wn=n(3792);const xn=()=>{const{id:e}=(0,ne.KC)()||{};return(0,s.jsx)("li",{className:(0,t.U)("conversation__item","conversation__item--source-agent"),children:(0,s.jsxs)("div",{className:(0,t.U)("message","message--source-agent","message--type-loading"),children:[(0,s.jsx)(wn.c,{eventPayload:{fromClient:!1,participant:e}}),(0,s.jsx)("div",{className:(0,t.U)("message__body"),children:(0,s.jsxs)("span",{className:(0,t.U)("loader"),children:[(0,s.jsx)("span",{className:(0,t.U)("loader__part","one")}),(0,s.jsx)("span",{className:(0,t.U)("loader__part","two")}),(0,s.jsx)("span",{className:(0,t.U)("loader__part","three")}),(0,s.jsx)("span",{className:(0,t.U)("loader__part","four")})]})})]})})},Cn=()=>{const e=(0,Te.kV)();let t=null;return(0,s.jsx)(s.Fragment,{children:e.map((e=>{const{type:n,payload:r}=e;let o=!1;if("participant"!==n&&"service_data"!==n){const{participant:n,fromClient:s}=r,i=s?"seamly-client-participant":n;"info"!==e.type&&t!==i&&(o=!0),t=i}return(0,s.jsx)(bn,{event:e,newParticipant:o},e.payload.key||e.payload.id)}))})},_n=()=>{const{t:e}=(0,oe.g)(),n=(0,ne.sJ)(),r=((e,t=20)=>{const[n,r]=(0,q.useState)(e),s=(0,q.useRef)(null);return(0,q.useEffect)((()=>(s.current=setTimeout((()=>r(e)),t),()=>{clearTimeout(s.current)})),[e,t]),n})(n,n?0:20),{isOpen:o}=(0,bt.uu)(),i=(0,ne.OK)(),a=(0,ne.e6)();return(0,s.jsxs)(s.Fragment,{children:[o&&(0,s.jsx)("a",{className:(0,t.U)("skip-link"),href:`#${i}`,onClick:e=>{e.preventDefault(),a()},children:e("skiplinkText")}),(0,s.jsx)("div",{className:(0,t.U)("chat__body"),children:(0,s.jsxs)("div",{className:(0,t.U)("conversation__container"),children:[(0,s.jsx)(Xt,{}),(0,s.jsxs)("ol",{className:(0,t.U)("conversation"),children:[(0,s.jsx)(yt,{children:(0,s.jsx)(Cn,{})}),r?(0,s.jsx)(xn,{}):null,(0,s.jsx)(mn,{})]})]})})]})};function jn(e,t){const n=(0,q.useRef)(null),r=(0,q.useRef)(e);return(0,q.useEffect)((()=>{r.current=e}),[e]),(0,q.useEffect)((()=>"number"!=typeof t?()=>{}:(n.current=setTimeout(r.current,t),()=>clearTimeout(n.current))),[t]),n}function En(e){return"object"==typeof e}const Sn={visible:(0,t.U)("transition--visible"),in:(0,t.U)("transition--in"),visuallyHidden:(0,t.U)("visually-hidden")},Tn=Object.values(Sn),kn={notRendered:"notRendered",rendered:"rendered",visuallyHidden:"visuallyHidden"},On=({children:e,isActive:t,timeout:n=h.uY,transitionStartState:r=kn.notRendered,onInTransitionComplete:o=(()=>{}),onOutTransitionComplete:i=(()=>{}),exitAfter:c,enterDelay:l=0})=>{const u=(0,q.useRef)(!1),d=r===kn.visuallyHidden,[p,f]=(0,q.useState)((()=>d?[Sn.visuallyHidden]:[])),[m,v]=(0,q.useState)((()=>0===l)),g=(0,q.useMemo)((()=>c?c+l:c),[l,c]);jn((()=>v(!1)),t?g:void 0),jn((()=>v(!0)),t?l:void 0);const y=(0,q.useMemo)((()=>m&&t),[t,m]),b=(0,ne.W_)(o),w=(0,ne.W_)(i),x="notRendered"!==r||p.length>0;return(0,q.useEffect)((()=>{let e=null,t=null;return u.current&&!y&&(f([Sn.visible]),e=setTimeout((()=>{f([...d?[Sn.visuallyHidden]:[]]),w&&(t=requestAnimationFrame((()=>{w()})))}),n)),!u.current&&y&&(f([Sn.visible]),t=requestAnimationFrame((()=>{t=requestAnimationFrame((()=>{f([Sn.visible,Sn.in]),b&&(e=setTimeout((()=>{b()}),n))}))}))),u.current=y,()=>{clearTimeout(e),cancelAnimationFrame(t)}}),[d,b,w,n,y]),(0,s.jsx)(s.Fragment,{children:x&&(0,a.toChildArray)(e).filter(En).map((e=>{const{className:t=""}=e.props,n=t.split(" ").filter((e=>!Tn.includes(e)));return(0,a.cloneElement)(e,{className:[...n,...p].join(" ")})}))})};var Nn=n(3480),In=n(8416),Un=n(152);const An=({isAside:e=!1})=>{const{isInline:n}=(0,Te.y2)(),{t:r}=(0,oe.g)(),{sendAction:o,addMessageBubble:i}=(0,In.c)(),{isOpen:a,setVisibility:c}=(0,bt.uu)(),{showSuggestions:l}=(0,Q.EV)(),u=(0,ae.k3)(),d=(0,Nn.e6)(),p=(0,q.useRef)(null),{sendPolite:h}=(0,pn.C)(),f=(0,G.w1)(Pt.Y),{hasCountdown:m,endCountdown:v}=(0,At.c)(),{hasPrompt:g,continueChat:y}=(0,Un.c)(),b=(0,ye.w)(),w=(0,Te.Ce)("suggestion"),{body:x}=(0,ee.kx)({payload:w}),C=(0,q.useMemo)((()=>w&&!f?x:[]),[w,f,x]),_=(0,q.useRef)(null),j=(0,q.useRef)(!1),E=(0,q.useRef)([]),S=!!C.length,T=n?(b||a)&&!e:b,k=(0,q.useRef)(T),O=S&&!T&&l,N=S?C:E.current;E.current=N;const I=(0,q.useMemo)((()=>{const n=["suggestions"];return e&&n.push("suggestions--aside"),(0,t.U)(n)}),[e]),U=(0,q.useCallback)((({id:e,question:t})=>{m&&v(!0),g&&y(),o({type:re.w$.custom,originMessage:w.id,body:{type:"faqclick",body:{faqId:e,faqQuestion:t}}}),i(t),a||c(Lt.I.open),d()}),[i,y,v,d,m,g,w,o,c,a]);(0,q.useEffect)((()=>{if(_.current!==C&&!T){if(S){const e=j.current?r("suggestions.srUpdatedText"):r("suggestions.srAvailableText");setTimeout((()=>{h(e)}),30)}else j.current&&h(r("suggestions.srUnavailableText"));_.current=C}!k.current&&T?((0,A.wN)(p.current,d),h(r("suggestions.srUnavailableText"))):!S&&j.current&&(0,A.wN)(p.current,d),j.current=S,k.current=T}),[C,S,T,d,h,r]);const R=r("suggestions.headingText"),M=r("suggestions.footerText"),P=R?"section":"div";return(0,s.jsx)(On,{isActive:O,transitionStartState:kn.notRendered,children:(0,s.jsxs)(P,{className:I,"aria-labelledby":R?u:null,ref:p,children:[R&&(0,s.jsx)("p",{id:u,className:(0,t.U)("suggestions__heading"),children:R}),!!N.length&&(0,s.jsx)(Ce,{suggestions:N,onClickSuggestion:U}),M&&!a&&(0,s.jsx)("p",{className:(0,t.U)("suggestions__footer"),children:M})]})})};var Rn=n(2796);const Mn=(0,vn.forwardRef)((({children:e,className:n=""},r)=>{const{isOpen:o,isVisible:i,setVisibility:a}=(0,bt.uu)(),{namespace:c,layoutMode:l}=(0,Q.EV)(),{isInline:u}=(0,Te.y2)(),d=(0,Rn.E)(),p=(0,ye.w)(),{t:h}=(0,oe.g)(),f=["chat",`chat--layout-${l}`,`namespace--${c}`,...d,n];return o||"app"===l||f.push("chat--collapsed"),p&&f.push("chat--user-responded"),i&&(0,s.jsxs)("section",{className:(0,t.U)(f),onKeyDown:e=>{(e.code&&"Escape"===e.code||27===e.keyCode)&&!u&&o&&a(Lt.I.minimized)},tabIndex:"-1",ref:r,"aria-label":h("chat.srLabel"),children:[(0,s.jsx)("div",{className:(0,t.U)("chat-wrapper"),children:e}),"inline"===l&&o&&(0,s.jsx)(An,{isAside:!0})]})})),Pn=({children:e,handleClose:n,title:r,closeButtonText:o,srCloseButtonText:i,id:a})=>{const c=(0,ae.k3)();return(0,s.jsxs)("section",{tabIndex:-1,id:a,"aria-labelledby":r?c:void 0,className:(0,t.U)("chat-status",!r&&"chat-status--condensed"),children:[(0,s.jsxs)("div",{className:(0,t.U)("chat-status__body"),children:[r?(0,s.jsx)("h2",{className:(0,t.U)("chat-status__title"),id:c,children:r}):null,e]}),"function"==typeof n&&(0,s.jsxs)("button",{type:"button",onClick:n,className:(0,t.U)("button","button--tertiary","chat-status__close"),children:[o||(0,s.jsx)(ce.c,{name:"close",size:"16",alt:""}),i&&(0,s.jsx)("span",{className:(0,t.U)("visually-hidden"),children:i})]})]})},Ln=({handleClick:e,icon:n,title:r,srButtonText:o})=>(0,s.jsxs)("button",{type:"button",onClick:e,className:(0,t.U)("button","button--primary","chat-status__button"),children:[(0,s.jsx)(ce.c,{name:n,size:"16",alt:""}),r,o&&(0,s.jsx)("span",{className:(0,t.U)("visually-hidden"),children:o})]});function Dn(){const{showProposal:e,translationProposal:t,dismissTranslationProposal:n,activateTranslationProposal:r}=(0,ee.ol)(),{id:o}=(0,ee.im)();return e?(0,s.jsx)(Pn,{handleClose:n,srCloseButtonText:t.srDismissButtonText,id:o,title:t.titleLabel,children:(0,s.jsx)(Ln,{handleClick:r,icon:"newTranslation",title:t.buttonLabel})}):null}function Fn(){const e=(0,G.w1)(Pt.Y),{isActive:t}=(0,ee.A1)();return e||t?null:(0,s.jsx)(Dn,{})}const Bn=({label:e,checked:n,description:r,onChange:o,id:i,itemClassName:a})=>(0,s.jsxs)("li",{className:(0,t.U)([a,"translation-options__item"]),"aria-selected":n,role:"option",tabIndex:0,onClick:o,onKeyDown:e=>{"Space"!==e.code&&"Enter"!==e.code||(e.preventDefault(),o())},id:i,children:[(0,s.jsx)(ce.c,{name:"check",size:"16",alt:""}),e," ",r&&(0,s.jsxs)("span",{children:["(",r,")"]})]}),zn=({onChange:e,describedById:n})=>{const{context:{userLocale:r,contentLocale:o}}=(0,Q.EV)(),{t:i}=(0,oe.g)(),{languages:a,currentLocale:c,enableTranslations:l,disableTranslations:u}=(0,ee.A1)(),d=(0,Nn.e6)(),p=t=>()=>{t===c||r===t?u():l(t),e(),d()},{primaryLanguages:h,remainingLanguages:f}=(0,vn.useMemo)((()=>a.reduce(((e,t)=>{const n=t.locale===o,r=((e,t,n)=>t===e.locale||!t&&n)(t,c,n);t.locale!==o&&e.remainingLanguages.push(Object.assign(Object.assign({},t),{checked:r,isOriginal:n}));const s=e.remainingLanguages.findIndex((e=>e.locale===c));return(n||r&&s>4)&&e.primaryLanguages.push(Object.assign(Object.assign({},t),{checked:r,isOriginal:n})),e}),{primaryLanguages:[],remainingLanguages:[]})),[c,o,a]);return(0,s.jsxs)("ul",{"aria-describedby":n,role:"listbox",tabIndex:-1,className:(0,t.U)("translation-options"),children:[h.map((({locale:e,nativeName:n,checked:r,isOriginal:o},a)=>(0,s.jsx)(Bn,{id:e,label:n,checked:r,description:o&&i("translations.settings.original"),onChange:p(e),itemClassName:(0,t.U)({"translation-options__item--original":o,"translation-options__item--selected":r&&0!==a})},e))),f.map((({locale:e,nativeName:t,checked:n,isOriginal:r})=>(0,s.jsx)(Bn,{id:e,label:t,checked:n,description:r&&i("translations.settings.original"),onChange:p(e)},e)))]})},$n=({className:e,children:n,onCancel:r,headingText:o,description:i,descriptionId:a,cancelButtonText:c,cancelButtonRef:l,disableButtonFocusing:u,position:d={horizontal:"left",vertical:"top"}})=>{const p=(0,ne.k3)(),{hideOption:h}=(0,ne.Yj)(),{focusButton:f}=(0,ne.a)(),m=(0,q.useCallback)((()=>{h(),u||f()}),[u,f,h]),v=(0,q.useCallback)((()=>{r&&r(),m()}),[m,r]),g=(e=>{const t=(0,q.useRef)(null);return(0,q.useEffect)((()=>{const n=n=>{t.current&&n.target instanceof HTMLElement&&!t.current.contains(n.target)&&(n.preventDefault(),n.stopPropagation(),e())};return document.addEventListener("click",n,!0),document.addEventListener("touchstart",n,!0),()=>{document.removeEventListener("click",n,!0),document.removeEventListener("touchstart",n,!0)}}),[e,t]),t})(v);return(0,q.useEffect)((()=>{(0,A.O8)(g.current)}),[g]),(0,s.jsx)("section",{className:(0,t.U)("options",{"options--right":"right"===d.horizontal,"options--left":"left"===d.horizontal,"options--top":"top"===d.vertical,"options--bottom":"bottom"===d.vertical},e),"aria-labelledby":p,tabIndex:-1,ref:g,children:(0,s.jsxs)("div",{className:(0,t.U)("options__body"),children:[(0,s.jsx)("h2",{id:p,className:(0,t.U)("options__title"),children:o}),(0,s.jsxs)("button",{type:"button",onClick:v,"aria-describedby":p,className:(0,t.U)("button","options__close"),ref:e=>{l&&(l.current=e)},children:[(0,s.jsx)(ce.c,{name:"close",size:"16",alt:""}),(0,s.jsx)("span",{children:c})]}),i?(0,s.jsx)("p",{className:(0,t.U)("options__description"),id:a,children:i}):null,(0,s.jsx)("div",{className:(0,t.U)("options__wrapper"),children:n})]})})},Vn=function({onClose:e,position:t}){const{t:n}=(0,oe.g)(),r=(0,ne.k3)();return(0,s.jsx)($n,{onCancel:e,headingText:n("translations.menu.title"),cancelButtonText:n("translations.settings.cancelButtonText"),description:n("translations.menu.description"),descriptionId:r,position:t,disableButtonFocusing:!0,children:(0,s.jsx)(zn,{describedById:r,onChange:e})})};function Hn({children:e,position:n={horizontal:"left",vertical:"top"},classNames:r}){const[o,i]=(0,q.useState)(!1),a=(0,q.useRef)(null),c=(0,ne.k3)();return(0,s.jsxs)("div",{className:(0,t.U)("translations__container"),onKeyDown:e=>{o&&(0,A.gP)(e)===A.sH.Escape&&(i(!1),(0,A.O8)(a.current))},children:[(0,s.jsx)(On,{transitionStartState:kn.notRendered,isActive:o,children:(0,s.jsx)("div",{className:(0,t.U)("options__dialog"),role:"dialog",children:(0,s.jsx)(Vn,{onClose:()=>{i(!1)},position:n})})}),(0,s.jsx)("button",{type:"button",className:(0,t.U)(["button","chat__options__button",...r]),id:c,onClick:()=>{i(!o)},onKeyDown:e=>{(0,A.gP)(e)===A.sH.ArrowDown&&(i(!0),e.preventDefault())},ref:a,"aria-haspopup":"dialog","aria-expanded":o,children:e})]})}var Kn=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var s=0;for(r=Object.getOwnPropertySymbols(e);s<r.length;s++)t.indexOf(r[s])<0&&Object.prototype.propertyIsEnumerable.call(e,r[s])&&(n[r[s]]=e[r[s]])}return n};function Wn(e){var{children:t,formId:n,persistData:r,onError:o,onSubmit:i,validationSchema:a}=e,c=Kn(e,["children","formId","persistData","onError","onSubmit","validationSchema"]);const l=(0,G.OY)(),u=(0,G.w1)((e=>tn(e,{formId:n}))),[d,p]=(0,q.useState)(!1),[h,f]=(0,q.useState)({}),{isValid:m,errors:v}=function(e,t){const n=(0,q.useMemo)((()=>function(e,t={}){return Object.entries(t).reduce(((t,[n,r])=>{var s;const o=Array.isArray(r)?r:[r];for(let r=0;null!==(s=r<(null==o?void 0:o.length))&&void 0!==s&&s;r++)if(!o[r].fn(e[n],o[r].compareValue)){t[n]=o[r].errorText;break}return t}),{})}(e,t)),[e,t]);return{isValid:0===Object.keys(n).length,errors:n}}(u,a),g=(0,q.useMemo)((()=>Object.assign(Object.assign({},v),h)),[v,h]);(0,q.useLayoutEffect)((()=>{l((0,sn.e8)({formId:n,persistData:r}))}),[n,r,l]),(0,q.useEffect)((()=>()=>{l((0,sn.K0)({formId:n}))}),[n,r,l]);const y=(0,q.useCallback)(((e,t)=>{l((0,sn.OI)({formId:n,name:e,value:t}))}),[n,l]),b=(0,q.useCallback)(((e,t)=>{l((0,sn.mq)({formId:n,name:e,touched:t}))}),[l,n]),w=(0,q.useCallback)(((e,t)=>{f((n=>Object.assign(Object.assign({},n),{[e]:t})))}),[f]),x=(0,q.useCallback)((e=>{e.preventDefault();const t="true"===e.submitter.getAttribute("aria-disabled");p(!t),!t&&m&&(l((0,be.N8)(!0)),i(u,{updateControlValue:y,setError:w}))}),[m,l,i,u,y,w]);(0,q.useEffect)((()=>{o&&o({errors:g,isSubmitted:d,isValid:0===Object.keys(g).length})}),[d,g,o]);const C=(0,q.useMemo)((()=>({formId:n,values:u,errors:g,isValid:0===Object.keys(g).length,isSubmitted:d,handleSubmit:x,validationSchema:a,updateControlValue:y,updateControlTouched:b})),[n,u,g,d,x,a,y,b]);return n?i?(0,s.jsx)(cn,Object.assign({},c,{value:C,children:t})):(console.error('"onSubmit" is required.'),null):(console.error('"formId" is required.'),null)}const qn=(e,t,n=null)=>({fn:e,errorText:t,compareValue:n}),Gn=(e,t)=>{let n=!0;for(let r=0;r<e.length;r++)e[r].size>t&&(n=!1);return n},Yn=e=>!!e?.length>0,Jn=e=>{const t=e&&e.trim();return!(!t||!t.match(/^(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\[(?:(?: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]?|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])$/i))},Xn=e=>!!e,Qn=function({className:e,disableValidationClasses:n,...r}){const{handleSubmit:o,isValid:i,isSubmitted:a}=function(){const{handleSubmit:e,isSubmitted:t,isValid:n}=un();return{handleSubmit:e,isSubmitted:t,isValid:n}}(),c=["form"];return!n&&a&&(c.push("form--submitted"),i?c.push("form--valid"):c.push("form--invalid")),(0,s.jsx)("form",{onSubmit:o,className:(0,t.U)([...c,e]),...r})};function Zn({id:e,error:n}){const[r,o]=(0,q.useState)(!1);return(0,q.useEffect)((()=>{const e=setTimeout((()=>o(!0)),300);return()=>clearTimeout(e)}),[]),(0,s.jsx)("div",{className:(0,t.U)("error"),"aria-live":"assertive","aria-atomic":"true",children:r&&n&&(0,s.jsxs)("span",{id:e,className:(0,t.U)("error__message"),children:[(0,s.jsx)(ce.c,{name:"error",size:"16",alt:""}),n]})})}const er=({contentHint:e,id:n,labelText:r,labelClass:o,validity:i,errorText:a,children:c})=>(0,s.jsxs)(s.Fragment,{children:[e&&(0,s.jsx)("span",{id:`${n}-content-hint`,className:(0,t.U)("input__content-hint"),children:e}),(0,s.jsx)(Zn,{id:`${n}-error`,error:!i&&a}),(0,s.jsxs)("div",{className:(0,t.U)("form-control__wrapper"),children:[(0,s.jsx)("label",{htmlFor:n,className:(0,t.U)(o),children:r}),c]})]});const tr=function(e){var{id:t,name:n,type:r,labelText:o,labelClass:i,contentHint:a=null,"aria-describedby":c}=e,l=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var s=0;for(r=Object.getOwnPropertySymbols(e);s<r.length;s++)t.indexOf(r[s])<0&&Object.prototype.propertyIsEnumerable.call(e,r[s])&&(n[r[s]]=e[r[s]])}return n}(e,["id","name","type","labelText","labelClass","contentHint","aria-describedby"]);const{isSubmitted:u}=un(),[d,{error:p}]=dn(n),h=u&&p,f=[];return c&&f.push(c),a&&f.push(`${t}-content-hint`),h&&f.push(`${t}-error`),(0,s.jsx)(er,{id:t,contentHint:a,validity:!h,errorText:p,labelText:o,labelClass:i,children:(0,s.jsx)("input",Object.assign({id:t,name:n,type:r,"aria-invalid":h?"true":"false","aria-describedby":f.join(" ")||null},d,l))})};function nr({controlName:e,describedById:n}){const{t:r}=(0,oe.g)();return(0,s.jsxs)(Qn,{noValidate:"true",className:(0,t.U)("options__form"),children:[(0,s.jsx)(tr,{name:e,type:"email",className:(0,t.U)("transcript__input"),"aria-describedby":n,labelClass:(0,t.U)("label"),labelText:r("options.sendTranscript.label")}),(0,s.jsx)("div",{className:(0,t.U)("options__actions"),children:(0,s.jsx)("button",{type:"submit",className:(0,t.U)("button","button--primary","options__submit"),children:r("options.sendTranscript.sendButtonText")})})]})}const rr="email",sr={sendTranscript:()=>{const[e,t]=(0,q.useState)(void 0),{hideOption:n}=(0,ne.Yj)(),{focusButton:r}=(0,ne.a)(),{t:o}=(0,oe.g)(),i=(0,ne.k3)(),{sendAction:a}=(0,ne.wv)(),c=(0,q.useMemo)((()=>({[rr]:[qn(Xn,o("options.sendTranscript.noEmailText")),qn(Jn,o("options.sendTranscript.invalidEmailText"))]})),[o]),l=(0,q.useCallback)((e=>{const t=e[rr].trim();a({type:re.w$.sendTranscript,body:{emailAddress:t}}),n(),r()}),[a,n,r]),u=(0,q.useCallback)((({isValid:e,isSubmitted:n})=>{t(n&&!e?"options--error":void 0)}),[t]);return(0,s.jsx)($n,{className:e,headingText:o("options.sendTranscript.title"),cancelButtonText:o("options.cancelButtonText"),description:o("options.sendTranscript.description"),descriptionId:i,position:{vertical:"top",horizontal:"right"},children:(0,s.jsx)(Wn,{formId:"sendTranscript",onSubmit:l,validationSchema:c,onError:u,children:(0,s.jsx)(nr,{controlName:rr,describedById:i})})})}},or=()=>{const{optionActive:e}=(0,ne.Yj)(),t=(0,q.useRef)(null),n=sr[e||t.current];return e&&(t.current=e),n?(0,s.jsx)(n,{}):null},ir=()=>{const{t:e}=(0,oe.g)(),{menuOptions:n,showOption:r,panelActive:o,hideOption:i}=(0,ne.Yj)(),{id:c}=(0,ne.a)(),l=(0,q.useRef)(null),[u,d]=(0,q.useState)(!1),p=(0,q.useRef)(null),h=n.length,f=(0,q.useRef)(Array.from({length:h},(()=>(0,a.createRef)()))),m=(0,q.useRef)(!1),v=h>1,g=n[0],y=(0,q.useMemo)((()=>g?.name?.trim().replace(/\s+/g,"")),[g]);return(0,q.useEffect)((()=>()=>{clearTimeout(l.current)}),[]),(0,q.useEffect)((()=>{u&&!m.current&&requestAnimationFrame((async()=>{await(0,Nn.me)(60);const e=n.findIndex((e=>e.available)),t=-1===e?0:e;(0,A.O8)(f.current[t])})),m.current=u}),[u,n]),h?(0,s.jsxs)("div",{className:(0,t.U)("options__container"),onKeyDown:e=>{u&&((0,A.gP)(e)===A.sH.Escape&&(d(!1),(0,A.O8)(p.current)),(0,A.gP)(e)===A.sH.Home&&((0,A.O8)(f.current[0]),e.preventDefault()),(0,A.gP)(e)===A.sH.End&&((0,A.O8)(f.current[h-1]),e.preventDefault()))},onfocusout:()=>{v&&(l.current=setTimeout((()=>{d(!1)}),200))},onfocusin:()=>{clearTimeout(l.current)},children:[(0,s.jsx)(On,{transitionStartState:kn.notRendered,isActive:o,children:(0,s.jsx)("div",{className:(0,t.U)("options__dialog"),children:(0,s.jsx)(or,{})})}),v&&(0,s.jsx)(On,{isActive:u,transitionStartState:kn.notRendered,children:(0,s.jsx)("ul",{className:(0,t.U)(["options__menu"]),role:"menu",tabIndex:"-1","aria-labelledby":c,children:n.map((({name:o,title:i,available:a},c)=>(0,s.jsx)("li",{className:(0,t.U)("options__menu__item"),role:"menuitem","data-testid":o,children:(0,s.jsxs)("button",{type:"button",ref:e=>{f.current[c]=e},className:(0,t.U)(["button","button--secondary"]),onKeyDown:e=>((e,t)=>{if((0,A.gP)(e)===A.sH.ArrowDown){const n=Math.min(h-1,t+1);(0,A.O8)(f.current[t===n?0:n]),e.preventDefault()}if((0,A.gP)(e)===A.sH.ArrowUp){const n=Math.max(0,t-1);(0,A.O8)(f.current[t===n?h-1:n]),e.preventDefault()}})(e,c),onKeyPress:e=>((e,t)=>{const r=String.fromCharCode(e.charCode);if(1!==r.length||!r.match(/\S/))return;let s=-1;n.forEach(((e,n)=>{n>t&&e.title.charAt(0).toLowerCase()===r.toLowerCase()&&-1===s&&(s=n)})),-1!==s&&(0,A.O8)(f.current[s])})(e,c),onClick:()=>((e,t)=>{t&&(d(!1),r(e))})(o,a),"aria-disabled":a?null:"true",children:[(0,s.jsxs)("span",{className:(0,t.U)("button__text"),children:[i,!a&&" "]}),!a&&(0,s.jsx)("span",{className:(0,t.U)("button__state"),children:e("options.unavailableText")})]})},o)))})}),(0,s.jsxs)("button",{type:"button",className:(0,t.U)(["button","button--secondary","chat__options__button",...!v&&y?[`chat__options__button--${y}`]:[]]),id:c,onClick:()=>{o&&i(),v?d((e=>!e)):g.available&&!o&&r(g.name)},onKeyDown:v?e=>{(0,A.gP)(e)===A.sH.ArrowDown&&(d(!0),e.preventDefault())}:null,ref:p,"aria-haspopup":v?"menu":null,"aria-expanded":v?u.toString():null,"aria-disabled":v||g.available?null:"true",children:[v&&(0,s.jsx)(ce.c,{name:"options",size:"32",alt:""}),(0,s.jsx)("span",{className:(0,t.U)("button__text"),children:v?e("options.openButtonText"):`${g.title}${g.available?"":" "}`}),!v&&!g.available&&(0,s.jsx)("span",{className:(0,t.U)("button__state"),children:e("options.unavailableText")})]})]}):null};function ar(){const{menuOptions:e,allowOptionSelection:n}=(0,ne.Yj)(),{isAvailable:r}=(0,ee.A1)(),o=(0,G.w1)(Pt.Y),{t:i,locale:a}=(0,oe.g)(),c=(0,ee.EI)(a);if(!r&&(!n||!e.length)||o)return null;const l=i("translations.settings.openButtonText",{hasLanguage:!!c,language:c});return(0,s.jsxs)("div",{className:(0,t.U)("chat__options"),children:[r&&(0,s.jsx)("div",{className:(0,t.U)("chat__options-item","chat__options-item--left"),children:(0,s.jsxs)(Hn,{classNames:["button--secondary"],children:[(0,s.jsx)(ce.c,{alt:l,name:"newTranslation",size:"16"}),(0,s.jsx)("span",{className:(0,t.U)("button__text"),children:l})]})}),n&&(0,s.jsx)("div",{className:(0,t.U)("chat__options-item","chat__options-item--right"),children:(0,s.jsx)(ir,{})})]})}const cr=()=>{const{scrollToRef:e,unreadIds:n}=(0,q.useContext)(gn),{isMinimized:r}=(0,bt.uu)(),{t:o}=(0,oe.g)();return(0,s.jsx)(On,{isActive:!!n.length&&!r,children:(0,s.jsx)("div",{className:(0,t.U)("unread-messages"),children:(0,s.jsxs)("button",{type:"button",className:(0,t.U)("button","button--primary"),onClick:e,children:[o("message.unreadMessagesCount",{unreadCount:n.length}),(0,s.jsx)(ce.c,{name:"chevronDown",size:"32",alt:""})]})})})};const lr=e=>{const t=(0,q.useRef)(),[n,r]=(0,q.useState)(!0),s=(0,G.w1)(Gt),o=(0,Te.kV)(),i=(0,Te.sJ)(),{isOpen:a}=(0,bt.uu)(),c=(0,Te.w1)(),{processingFileUploads:l,isLastEventFromClient:u}=(0,G.w1)((({state:e})=>e));(0,q.useEffect)((()=>{const e=t.current,n=()=>{const{scrollHeight:t,scrollTop:n,clientHeight:s}=e,o=Math.abs(t-n-s)>10;r(!o)};return e.addEventListener("scroll",n),()=>e.removeEventListener("scroll",n)}),[]);const d=(0,q.useCallback)((()=>{requestAnimationFrame((()=>{return e=void 0,n=void 0,s=function*(){var e,n;yield(0,Nn.me)(30),null===(e=t.current)||void 0===e||e.scrollTo({top:null===(n=t.current)||void 0===n?void 0:n.scrollHeight,left:0,behavior:"auto"})},new((r=void 0)||(r=Promise))((function(t,o){function i(e){try{c(s.next(e))}catch(e){o(e)}}function a(e){try{c(s.throw(e))}catch(e){o(e)}}function c(e){var n;e.done?t(e.value):(n=e.value,n instanceof r?n:new r((function(e){e(n)}))).then(i,a)}c((s=s.apply(e,n||[])).next())}));var e,n,r,s}))}),[]);return(0,q.useEffect)((()=>{u&&d()}),[u,d]),(0,q.useEffect)((()=>{n&&d()}),[n,s,o,i,a,c,l,d]),{containerRef:t,unreadIds:s,scrollToRef:()=>{var n,r;const o=null===(n=e[null==s?void 0:s.at(0)])||void 0===n?void 0:n.current;null===(r=t.current)||void 0===r||r.scrollTo({top:null==o?void 0:o.offsetTop,behavior:"auto",left:0})},scrollToBottom:d}},ur=({children:e})=>{const n=(0,ne.kV)(),r=(0,q.useMemo)((()=>n.reduce(((e,t)=>t.payload.id?(e[t.payload.id]=(0,a.createRef)(),e):e),{})),[n]),{scrollToRef:o,scrollToBottom:i,containerRef:c,unreadIds:l}=lr(r);return(0,s.jsx)(gn.Provider,{value:{eventRefs:r,unreadIds:l,scrollToRef:o,scrollToBottom:i,containerRef:c},children:(0,s.jsxs)("div",{className:(0,t.U)("chat__container"),children:[(0,s.jsx)("div",{className:(0,t.U)("chat__container__scroll-area"),ref:c,children:e}),(0,s.jsx)(cr,{})]})})};var dr=n(7268);const pr=({baseClassName:e,children:n,title:r})=>{const o=(0,ne.OK)(),i=(0,ne.k3)();return(0,s.jsxs)("section",{id:o,className:(0,t.U)(e),"aria-describedby":i,tabIndex:"-1",children:[(0,s.jsx)("h2",{className:(0,t.U)(`${e}__title`),id:i,children:r}),n]})},hr=()=>{const{t:e}=(0,oe.g)(),n=(0,Nn.e6)(),r=(0,dr.c)(),{emitEvent:o}=(0,In.c)(),{isActive:i,remaining:a,timer:c,endCountdown:l}=(0,At.c)(),u=a>0,d=e(u?"idleDetachWarning.countdownTitle":"idleDetachWarning.notifyTransferText");return(0,s.jsx)(pr,{baseClassName:"idle",title:d,children:u&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:(0,t.U)("idle__count-container"),children:i&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("span",{className:(0,t.U)("idle__count-text"),children:e("idleDetachWarning.countdownText")}),(0,s.jsx)("span",{className:(0,t.U)("idle__count-timer"),children:e("idleDetachWarning.countdownTimer",c)})]})}),(0,s.jsxs)("div",{className:(0,t.U)("idle__options"),children:[(0,s.jsx)("button",{type:"button",className:(0,t.U)("button","button--primary"),onClick:()=>{r(),l(!0),n(),o("idleTimer.selectContinue")},children:e("idleDetachWarning.continueButton")}),(0,s.jsx)("button",{type:"button",className:(0,t.U)("button","button--primary"),onClick:()=>{l(),n(),o("idleTimer.selectEnd")},children:e("idleDetachWarning.detachButton")})]})]})})},fr=()=>{const{t:e}=(0,oe.g)(),n=(0,dr.c)(),{name:r}=(0,Te.KC)()||{},{continueChat:o,restartChat:i}=(0,Un.c)();return(0,s.jsx)(pr,{baseClassName:"prompt",title:e("resumeConversationPrompt.title",{name:r}),children:(0,s.jsxs)("div",{className:(0,t.U)("prompt__options"),children:[(0,s.jsx)("button",{type:"button",className:(0,t.U)("button","button--primary"),onClick:()=>{n(),o()},children:e("resumeConversationPrompt.continueButton")}),(0,s.jsx)("button",{type:"button",className:(0,t.U)("button","button--primary"),onClick:i,children:e("resumeConversationPrompt.detachButton")})]})})},mr=()=>{const{sendAction:e}=(0,ne.wv)(),{features:t}=(0,ne.Yj)(),{typingPeekahead:n}=t||{},r=(0,q.useRef)(null),s=(0,q.useRef)(null),o=(0,q.useRef)(!1),i=(0,q.useRef)(null);(0,q.useEffect)((()=>()=>{clearInterval(i.current),clearTimeout(r.current),clearTimeout(s.current)}),[]);const a=(t,r)=>{e({type:re.w$.typing,state:t,...n&&n.enabled?{body:{currentMessage:r}}:{}})};return e=>{e.code&&"Enter"===e.code||13===e.keyCode||(o.current=!0,i.current||(a(!0,e.target.value),i.current=setInterval((()=>{o.current?n&&n.enabled&&a(!0,e.target.value):(clearInterval(i.current),i.current=null)}),h.e)),clearTimeout(r.current),clearTimeout(s.current),r.current=setTimeout((()=>{o.current=!1}),300),s.current=setTimeout((()=>{a(!1,e.target.value)}),h.e))}},vr=()=>{const{default:e,active:t,userSelected:n,options:r,optionsOverride:s}=(0,Te.gf)().entryMeta,o=(0,G.OY)(),i=n||t||e,a=s[i]||r[i]||{},c=(0,q.useCallback)((e=>{o((0,Ue.kl)(e))}),[o]),l=(0,q.useCallback)((e=>{o((0,Ue.cj)(e))}),[o]),u=(0,q.useCallback)((e=>{o((0,Ue.gz)(e))}),[o]),d=(0,q.useCallback)((()=>{n?u(null):l(e)}),[n,e,u,l]);return{activeEntry:i,activeEntryOptions:a,setActiveEntryType:l,setUserEntryType:u,cancelEntrySelection:d,setBlockAutoEntrySwitch:c}};function gr({controlName:e,skipLinkId:n}){const{t:r}=(0,oe.g)(),{sendAssertive:o}=(0,ne.CE)(),{emitEvent:i}=(0,ne.wv)(),a=mr(),{setBlockAutoEntrySwitch:c}=vr(),{placeholder:l,label:u,labelClass:d}=fn(e),{hasCharacterLimit:p,reachedCharacterWarning:h,reachedCharacterLimit:f,remainingChars:m}=hn(e),[{value:v}]=dn(e),g=!!v,y=(0,q.useCallback)((()=>{h&&o(r("input.srCharacterLimitText",{limit:m})),i("ui.inputFocus")}),[r,o,h,m,i]);return(0,q.useLayoutEffect)((()=>(c(g),()=>{c(!1)})),[c,g]),(0,s.jsxs)(Qn,{className:(0,t.U)("entry-form"),disableValidationClasses:!0,noValidate:"true",children:[(0,s.jsxs)("div",{className:(0,t.U)(["input--text__container",...h&&!f?["character-warning"]:[],...f?["character-exceeded"]:[]]),children:[(0,s.jsx)(tr,{id:n,type:"text",name:e,className:(0,t.U)("input__text"),autocomplete:"off",placeholder:l,labelText:u,labelClass:(0,t.U)(d),"aria-invalid":p?f:null,onKeyUp:a,onFocus:y}),(0,s.jsx)("div",{className:(0,t.U)("character-count"),children:h&&(0,s.jsx)("span",{children:m})})]}),(0,s.jsx)("button",{className:(0,t.U)("button","input__submit"),type:"submit",onPointerDown:e=>{e.preventDefault()},"aria-disabled":!g||f?"true":null,children:(0,s.jsx)(ce.c,{name:"send",size:"32",alt:r("input.sendMessage")})})]})}const yr="textMessageEntry";function br({...e}){const{isOpen:t,setVisibility:n}=(0,bt.uu)(),r=(0,ne.OK)(),o=(0,ne.e6)(),{sendMessage:i}=(0,ne.wv)(),a=(0,q.useCallback)(((e,{updateControlValue:r})=>{i({body:e[yr]}),r(yr,""),o(),t||n(Lt.I.open)}),[i,o,t,n]);return(0,s.jsx)(Wn,{...e,formId:"textEntry",persistData:!0,onSubmit:a,children:(0,s.jsx)(gr,{controlName:yr,skipLinkId:r})})}const wr=()=>{const{t:e}=(0,oe.g)(),{currentUploads:n}=(0,ne.uc)();return(0,s.jsx)("div",{className:(0,t.U)("progress"),children:n.map((({id:n,name:r,progress:o,uploading:i,error:a})=>(0,s.jsxs)("div",{className:(0,t.U)("progress_container"),children:[(0,s.jsxs)("div",{className:(0,t.U)("progress__text"),children:[(0,s.jsx)("span",{className:(0,t.U)("progress__text--file-name"),children:r}),(0,s.jsx)("span",{className:(0,t.U)("progress__text--percentage"),children:`${o}%`})]}),(0,s.jsx)(Zn,{error:a}),(0,s.jsx)("progress",{className:(0,t.U)("progress__bar"),role:"progressbar","aria-valuemin":"0","aria-valuemax":"100","aria-label":e("fileUpload.srProgressLabel",{fileName:r}),max:"100","aria-valuenow":o,value:o,"aria-busy":i,children:`${o}%`})]},n)))})};function xr({id:e,name:n,labelText:r,contentHint:o,outputText:i,accept:a}){const{isSubmitted:c}=un(),[l,u]=(0,q.useState)(!1),[{onInput:d,onBlur:p},{error:h}]=dn(n),f=(0,ne.k3)(),m=(0,ne.k3)(),v=(0,ne.k3)(),g=c&&h,y=[v];o&&y.push(m),g&&y.push(f);const b=(0,q.useCallback)((()=>{u(!0)}),[u]),w=(0,q.useCallback)((()=>{u(!1),p()}),[u,p]),x=(0,q.useCallback)((e=>{const t={target:{value:e.target.files}};d(t)}),[d]);return(0,s.jsxs)("div",{className:(0,t.U)("upload__container"),children:[o&&(0,s.jsx)("span",{className:(0,t.U)("upload__content-hint"),id:m,children:o}),(0,s.jsx)(Zn,{id:f,error:g&&h}),(0,s.jsx)("div",{className:(0,t.U)(["file-upload",...l?["focus-within"]:[]]),children:(0,s.jsxs)("label",{htmlFor:e,className:(0,t.U)("upload__label"),children:[(0,s.jsx)(ce.c,{name:"upload",size:"32",alt:""}),(0,s.jsxs)("div",{children:[(0,s.jsx)("span",{className:(0,t.U)(["upload__label--text"]),children:r}),(0,s.jsx)("input",{id:e,className:(0,t.U)("upload__input"),type:"file",name:n,onChange:x,"aria-invalid":g?"true":"false","aria-describedby":y.join(" "),accept:a||null,onFocus:b,onBlur:w}),(0,s.jsx)("span",{className:(0,t.U)("upload__output"),"aria-hidden":"true",id:v,children:i})]})]})})]})}function Cr({skiplinkId:e,controlName:n,accept:r,contentHint:o,isUploading:i,isComplete:a,onClickCancel:c}){const{t:l}=(0,oe.g)(),[{value:u}]=dn(n),d=u&&u.length>0,p=d?u[0].name:"";return(0,s.jsxs)(Qn,{className:(0,t.U)("upload-form"),children:[(0,s.jsx)(xr,{name:n,id:e,accept:r,labelText:l("fileUpload.labelText"),outputText:l("fileUpload.selectedText",{hasFile:d,filename:p}),contentHint:o}),(0,s.jsxs)("div",{className:(0,t.U)("upload__button-container"),children:[(0,s.jsx)("button",{id:i||!a?e:void 0,type:"button",onClick:c,className:(0,t.U)("button","button--secondary","upload__cancel"),children:l("fileUpload.cancelButtonText")}),(0,s.jsx)("button",{className:(0,t.U)("button","button--primary"),type:"submit",children:l("fileUpload.uploadButtonText")})]})]})}const _r="fileListForm",jr="fileList",Er=()=>{const{t:e}=(0,oe.g)(),{sendPolite:n,sendAssertive:r}=(0,ne.CE)(),o=(0,ne.OK)(),i=(0,ne.e6)(),{serviceAllowsUploads:a,allowedMimeTypes:c,maxSize:l}=(0,ne.A9)(),u=(0,q.useRef)(null),d=(0,q.useRef)(a),{cancelEntrySelection:p}=vr(),{uploadFile:h,clearUploads:f,isUploading:m,isComplete:v}=(0,ne.uc)(),{hasFile:g,selectedFileName:y,uploadHandle:b,hasServerError:w,progress:x}=((e,t)=>{const n=(0,G.w1)((n=>nn(n,{formId:e,name:t}))),{currentUploads:r}=(0,ne.uc)(),s=n&&n.length>0;let o=null,i=!1,a=0;if(r&&r.length>0){const e=r[0];o=e.uploadHandle,i=!!e.error,a=e.progress}return{hasFile:s,selectedFileName:s?n[0].name:"",uploadHandle:o,hasServerError:i,progress:a}})(_r,jr),C=(0,ne.k3)(),_=(0,q.useRef)(!0),j=e("fileUpload.contentHint",{size:(0,A.IB)(l)}),E=(0,q.useRef)(""),S=(0,q.useRef)(null);(0,q.useEffect)((()=>{E.current&&S.current?.contains(document.activeElement)&&"INPUT"===document.activeElement.tagName&&r(j),E.current=j}),[j,r]),(0,q.useEffect)((()=>{x>0&&n(1===x?e("fileUpload.srStartedText"):`${x}%`)}),[x,n,e]),(0,q.useEffect)((()=>{_.current||m||!v||(f(),p(),i(),setTimeout((()=>{n(e("fileUpload.srCompleteText"))}),300)),_.current=v}),[m,v,f,p,i,n,e]);const T=(0,q.useCallback)((({fileList:e})=>{h(e[0]),i()}),[h,!1,i]),k=(0,q.useCallback)((()=>{b&&b.abort(),f(),p(),i()}),[b,f,p,i]),O=(0,q.useMemo)((()=>({[jr]:[qn((()=>a),e("fileUpload.errors.unavailable")),qn(Yn,e("fileUpload.errors.noFile")),qn(Gn,e("fileUpload.errors.tooLarge"),l)]})),[l,a,e]);return(0,s.jsx)("div",{className:(0,t.U)(["upload",...w?["upload--error"]:[]]),ref:S,children:(0,s.jsxs)(Wn,{formId:_r,persistData:!0,onSubmit:T,validationSchema:O,children:[(m||!v)&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(wr,{}),(0,s.jsx)("div",{className:(0,t.U)("upload__button-container"),children:(0,s.jsx)("button",{id:m||!v?o:void 0,type:"button",onClick:k,ref:u,className:(0,t.U)("button","button--secondary","upload__cancel"),children:e("fileUpload.cancelButtonText")})})]}),!m&&v&&(0,s.jsx)(Cr,{controlName:jr,skiplinkId:o,accept:c.join(", "),contentHint:j,isComplete:v,isUploading:m,outputText:e("fileUpload.selectedText",{hasFile:g,filename:y}),onClickCancel:k}),!d.current&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("span",{className:(0,t.U)("notification"),id:C,children:e("fileUpload.unavailableText")}),(0,s.jsx)("div",{className:(0,t.U)("upload__button-container"),children:(0,s.jsx)("button",{id:m||!v?o:void 0,type:"button",onClick:k,className:(0,t.U)("button","button--secondary","upload__cancel"),children:e("fileUpload.cancelButtonText")})})]})]})})},Sr=()=>{const{t:e}=(0,oe.g)(),{showFileUpload:n,serviceAllowsUploads:r}=(0,ne.A9)(),[o,i]=(0,q.useState)(r),a=(0,ne.e6)(),c=(0,q.useRef)(null),{setUserEntryType:l,activeEntry:u}=vr(),d=(0,q.useRef)(null),{sendPolite:p}=(0,ne.CE)(),h=!!(0,ne.KC)();return(0,q.useEffect)((()=>{(0,A.wN)(d.current,(()=>{r||a()})),i(r)}),[r,a]),(0,q.useEffect)((()=>{c.current&&!r&&p(e("fileUpload.srUnavailableText")),!1===c.current&&r&&p(e("fileUpload.srAvailableText")),h&&(c.current=r)}),[r,h,p,e]),!n&&u!==re.uG.upload&&(0,s.jsx)(On,{isActive:o,transitionStartState:kn.rendered,children:(0,s.jsx)("div",{className:(0,t.U)("upload-toggle-wrapper"),children:(0,s.jsx)(On,{isActive:o,transitionStartState:kn.visuallyHidden,children:(0,s.jsx)("button",{className:(0,t.U)(["button","button--secondary","upload-toggle"]),ref:d,"aria-disabled":o?null:"true",type:"button",onClick:o?()=>{l(re.uG.upload),a()}:null,children:(0,s.jsx)(ce.c,{name:"file",size:"32",alt:e("fileUpload.toggleButtonText")})})})})})},Tr=()=>{const{isOpen:e}=(0,bt.uu)(),n=(0,q.useRef)(null),{hasCountdown:r}=(0,ne.sD)(),[o,i]=(0,q.useState)(r),{hasPrompt:a}=(0,ne.AL)(),[c,l]=(0,q.useState)(a),u=(0,ne.e6)(),d=(0,q.useRef)(!1),{activeEntry:p}=vr(),[h,f]=(0,q.useState)({text:br,upload:Er}),[m,v]=(0,q.useState)((()=>p)),g=(0,Q.EV)(),{accountAllowsUploads:y}=(0,ne.A9)(),b=(0,q.useCallback)((()=>{(0,A.wN)(n.current,u)}),[u]);(0,q.useEffect)((()=>{const{customComponents:e}=g,{entry:t}=e||{};t&&f((e=>({...e,...t})))}),[g]),(0,q.useEffect)((()=>{b(),i(r),l(a)}),[r,a,b]),(0,q.useEffect)((()=>{v(p),b()}),[p,b,n]),d.current=!(!n.current||!n.current.contains(document.activeElement));const w=h[m];return(0,s.jsxs)("div",{className:(0,t.U)("chat__entry"),ref:n,children:[o&&(0,s.jsx)(hr,{}),c&&(0,s.jsx)(fr,{}),(0,s.jsxs)("div",{className:(0,t.U)(["entry__body",...r||a?["entry__body--hidden"]:[]]),children:[m!==re.uG.upload&&y&&e&&(0,s.jsx)(Sr,{}),(0,s.jsx)(w,{})]})]})},kr=()=>{const{t:e}=(0,oe.g)(),{isOpen:n,closeChat:r}=(0,bt.uu)(),{isWindow:o}=(0,Te.y2)();return n&&o?(0,s.jsx)("button",{type:"button",className:(0,t.U)("button","collapse-button"),onClick:r,children:(0,s.jsx)(ce.c,{name:"chevronDown",size:"32",alt:e("window.srCollapseButton")})}):null};var Or=n(9748);const Nr=()=>{const{meta:{originalError:e,title:n,message:r,buttonText:o,action:i,srText:a}}=(0,Or.q)(),c=(0,ne.wv)(),l=(0,ne.k3)(),{sendPolite:u}=(0,ne.CE)(),d=(0,ne.e6)(),p="SeamlySessionExpiredError"===e?.name;return(0,q.useEffect)((()=>{!p&&a&&setTimeout((()=>{u(a)}),200)}),[u,a,p]),p?(0,s.jsx)(s.Fragment,{}):(0,s.jsxs)("section",{className:(0,t.U)("interrupt"),"aria-labelledby":l,children:[(0,s.jsx)(kr,{}),(0,s.jsxs)("div",{className:(0,t.U)("interrupt__body"),children:[(0,s.jsx)("h2",{id:l,className:(0,t.U)("interrupt__title"),children:n}),(0,s.jsx)("p",{className:(0,t.U)("interrupt__message"),children:r}),o&&i&&(0,s.jsx)("div",{className:(0,t.U)("interrupt__actions"),children:(0,s.jsx)("button",{type:"button",className:(0,t.U)("button","button--primary"),onClick:()=>{c[i]&&c[i](),d()},children:o})})]})]})},Ir=function({children:e}){const n=(0,G.w1)(Pt.Y),{isOpen:r}=(0,bt.uu)();return n?(0,s.jsx)(Nr,{}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(ur,{children:[(0,s.jsxs)("div",{className:(0,t.U)("chat__container__header"),children:[(0,s.jsx)(Fn,{}),(0,s.jsx)(kr,{})]}),e]}),(0,s.jsx)(Tr,{}),r&&(0,s.jsx)(ar,{})]})};function Ur({event:e}){const[t]=yn(e);return(0,s.jsx)("li",{children:(0,s.jsx)(t,{event:e})})}function Ar({events:e}){return(0,s.jsx)("ul",{className:(0,t.U)("collapsed-chat-messages"),children:e.map((e=>(0,s.jsx)(Ur,{event:e},e.payload.id)))})}function Rr(){const{preChatEvents:e}=(0,Q.EV)(),t=(0,G.w1)(Pt.Y),{isOpen:n}=(0,bt.uu)();return!(t||!(null==e?void 0:e.length)||n)&&(0,s.jsx)(Ar,{events:e})}function Mr(){const{t:e}=(0,Jt.useI18n)(),t=e("window.chat.continue"),n=(0,q.useMemo)((()=>({type:"message",payload:{body:{text:t}}})),[t]);return(0,s.jsx)(Ar,{events:[n]})}const Pr=()=>{const e=(0,Q.E3)(),n=(0,Te.KC)(),r=(0,G.w1)(Pt.Y),o=n&&!r,i=o?n.avatar:e;return i?(0,s.jsx)("img",{className:(0,t.U)(o?"avatar":"icon"),src:i,alt:""}):(0,s.jsx)(ce.c,{name:"avatar",size:"32",alt:""})},Lr=({onClick:e})=>{const n=(0,Qt.aJ)(),{t:r}=(0,oe.g)(),o=n()?r("window.openButton.srContinue"):r("window.openButton.srStart"),i=(0,Nn.e6)(),{isOpen:a}=(0,bt.uu)(),c=(0,Te.I7)(),l=(0,q.useCallback)((()=>{e(),i()}),[i,e]);return(0,s.jsx)(On,{isActive:!a,transitionStartState:kn.rendered,children:(0,s.jsxs)("button",{className:(0,t.U)("window-open-button"),"aria-label":o,"aria-hidden":a,onClick:l,children:[(0,s.jsx)(On,{isActive:!!c,transitionStartState:kn.notRendered,children:(0,s.jsx)("span",{className:(0,t.U)("message-count"),"aria-hidden":"true",children:c})}),(0,s.jsx)(Pr,{})]})})},Dr=(e,t,n)=>"object"==typeof e?e[t]:n,Fr=n.p+"sounds/beep.mp3";var Br=function(e,t,n,r){return new(n||(n=Promise))((function(s,o){function i(e){try{c(r.next(e))}catch(e){o(e)}}function a(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?s(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(i,a)}c((r=r.apply(e,t||[])).next())}))};const zr=!!window.Notification,$r={app:()=>(0,s.jsx)(Mn,{children:(0,s.jsx)(Ir,{children:(0,s.jsx)(_n,{})})}),inline:()=>{const{showInlineView:e,containerRef:n}=(0,bt.ae)(),{isOpen:r}=(0,bt.uu)();return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(On,{isActive:!r,transitionStartState:kn.rendered,children:(0,s.jsxs)("div",{ref:n,className:(0,t.U)("unstarted-wrapper","unstarted-wrapper--inline"),children:[(0,s.jsx)(Rr,{}),(0,s.jsx)(An,{})]})}),(0,s.jsx)(On,{isActive:r,transitionStartState:kn.rendered,children:(0,s.jsx)(Mn,{ref:n,children:e&&(0,s.jsx)(Ir,{children:r&&(0,s.jsx)(_n,{})})})})]})},window:()=>{const{isOpen:e,openChat:n}=(0,bt.uu)(),r=(0,ye.w)(),{continueChat:o,preChat:i}=(0,Q.EV)();return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(Lr,{onClick:n}),(0,s.jsx)(On,{isActive:i&&!e&&!r,exitAfter:Dr(i,"exitAfter"),enterDelay:Dr(i,"enterDelay"),transitionStartState:kn.notRendered,children:(0,s.jsx)("div",{className:(0,t.U)("unstarted-wrapper","unstarted-wrapper--window"),children:(0,s.jsx)(Rr,{})})}),(0,s.jsx)(On,{isActive:o&&!e&&r,exitAfter:Dr(o,"exitAfter"),enterDelay:Dr(o,"enterDelay"),transitionStartState:kn.notRendered,children:(0,s.jsx)("div",{className:(0,t.U)("unstarted-wrapper","unstarted-wrapper--window","unstarted-wrapper--continue"),children:(0,s.jsx)(Mr,{})})}),(0,s.jsx)(On,{isActive:e,transitionStartState:kn.notRendered,children:(0,s.jsx)(Mn,{children:(0,s.jsx)(Ir,{children:(0,s.jsx)(_n,{})})})})]})}},Vr=({children:e})=>{const{sendNotification:n}=(()=>{const{proactiveMessages:e}=(0,Te.Ip)(),{notificationAudioURL:t}=(0,Q.EV)(),[n,r]=(0,q.useState)(zr?Notification.permission:"default"),[s,o]=(0,q.useState)(document.visibilityState),i=(0,G.w1)(Yt),a=(0,q.useCallback)((()=>Br(void 0,void 0,void 0,(function*(){if(zr&&"granted"!==n){const e=yield Notification.requestPermission();r(e)}}))),[n]),c=(0,q.useMemo)((()=>"granted"===n),[n]),l=(0,q.useMemo)((()=>"hidden"===s),[s]);(0,q.useEffect)((()=>{"default"===n&&e&&a()}),[n,e,a]);const u=(0,q.useCallback)(((e,r)=>Br(void 0,void 0,void 0,(function*(){if(i&&zr){if("default"===n&&a(),!1!==t&&!c&&(l||!document.hasFocus()))try{const e=new Audio(t||Fr);yield e.play()}catch(e){console.warn(e)}if(c&&(l||!document.hasFocus())){const t=new Notification(e,r);t.onclick=function(){window.parent.focus(),window.focus(),t.close();const e=document.querySelector(`input[name=${yr}]`);e&&e.focus()}}}}))),[t,n,c,a,i,l]);return(0,q.useEffect)((()=>{if(!i)return()=>{};function e(){o(document.visibilityState)}return document.addEventListener("visibilitychange",e,!1),()=>{document.removeEventListener("visibilitychange",e)}}),[i]),{permission:n,requestPermission:a,sendNotification:u}})(),[,r]=(0,Nn.Yf)(),{namespace:o,layoutMode:i,zIndex:a}=(0,Q.EV)(),c=(0,Te.KC)(),{proactiveMessages:l}=(0,Te.Ip)(),{isOpen:u,isVisible:d}=(0,bt.uu)(),p=(0,Rn.E)(),h=(0,ye.w)(),f=(0,G.w1)(qt),{body:m}=(0,Jt.useTranslatedEventData)(f),{userLocale:v}=(0,oe.g)(),g=(0,q.useRef)(void 0),y=(0,q.useMemo)((()=>{var e;return m?function(e){const t=document.createElement("div");return t.innerHTML=e,t.textContent||t.innerText||""}((null==m?void 0:m.text)||(null===(e=null==m?void 0:m.prompt)||void 0===e?void 0:e.text)||m):void 0}),[m]);(0,q.useEffect)((()=>{var e;(null==c?void 0:c.name)&&y&&l&&f&&g.current!==(null===(e=f.payload)||void 0===e?void 0:e.id)&&(n(c.name,{body:y,icon:null==c?void 0:c.avatar}),g.current=f.payload.id)}),[null==c?void 0:c.avatar,null==c?void 0:c.name,f,y,l,n]);const b=$r[i],w=(0,q.useCallback)((e=>{"function"==typeof r&&r(e)}),[r]),x=(0,q.useMemo)((()=>{if(v&&document.querySelector("html").getAttribute("lang")!==v)return v}),[v]);if(!b)return console.warn('"layoutMode" should be one of "app", "inline" or "window"'),null;const C=["app",`app--layout-${i}`,`namespace--${o}`];return"function"!=typeof p&&C.push(...p),u||"app"===i||C.push("app--collapsed"),h&&C.push("app--user-responded"),d&&(0,s.jsx)("div",{className:(0,t.U)(C),lang:x,tabIndex:-1,"data-nosnippet":!0,style:{zIndex:a},ref:w,children:e||(0,s.jsx)(b,{})})},Hr=e=>(0,s.jsx)(Ht,{...e,children:(0,s.jsx)(Vr,{})});var Kr=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var s=0;for(r=Object.getOwnPropertySymbols(e);s<r.length;s++)t.indexOf(r[s])<0&&Object.prototype.propertyIsEnumerable.call(e,r[s])&&(n[r[s]]=e[r[s]])}return n};class Wr{constructor(e,t){const{namespace:n="",parentElement:r}=e,s=Kr(e,["namespace","parentElement"]);this.config=Object.assign(Object.assign({},s),{namespace:n}),this.namespace=n,this.parentElement=r,this.externalApi=t,this.api=new z({layoutMode:e.layoutMode,namespace:e.namespace,config:e.api,context:e.context}),this.eventBus=new(i()),this.functions={},this.registerFunctions({on:this.eventBus.on,off:this.eventBus.off}),this.eventBus.on("function.register",((e,t)=>this.registerFunction(e,t))),this.eventBus.on("function.unregister",((e,t)=>this.unregisterFunction(e,t)))}render(){return e=this,t=void 0,r=function*(){const e=this.config.customComponents||{},{view:t}=e,n=Kr(e,["view"]),r=Object.assign(Object.assign({},this.config),{customComponents:Object.keys(n).length?n:void 0}),o=(0,K.e)({api:this.api,eventBus:this.eventBus,config:r,initialState:void 0});o.dispatch((0,H._U)(r)),yield o.dispatch((0,V.A)()),yield o.dispatch((0,$.m)()),o.dispatch((0,W.i)()),t?(0,a.render)((0,s.jsx)(Ht,{eventBus:this.eventBus,store:o,api:this.api,children:(0,s.jsx)(t,{})}),this.parentElement):(0,a.render)((0,s.jsx)(Hr,{config:r,eventBus:this.eventBus,store:o,api:this.api}),this.parentElement)},new((n=void 0)||(n=Promise))((function(s,o){function i(e){try{c(r.next(e))}catch(e){o(e)}}function a(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?s(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(i,a)}c((r=r.apply(e,t||[])).next())}));var e,t,n,r}destroy(){(0,a.render)(null,this.parentElement),this.eventBus.off(),this.api.disconnect(),delete this.functions}registerFunctions(e){Object.entries(e).forEach((([e,t])=>{this.registerFunction(e,t)}))}registerFunction(e,t){this.functions[e]=this.functions[e]||[],this.functions[e].push(t),this.externalApi.handleActions()}unregisterFunction(e,t){const n=this.functions[e];n&&n.length&&(this.functions[e]=n.filter((e=>e!==t)))}execFunction(e,...t){const n=this.functions[e];return!(!n||!n.length||(n.forEach((n=>{try{n(...t)}catch(t){console.error(`Action(${e}) failed: `,t)}})),0))}}const qr=e=>"object"==typeof e&&"action"in e,Gr=e=>({...e,args:Array.isArray(e.args)?e.args:[e.args]}),Yr=class{constructor(e){this._waitingActions=[],this._instances={},this.appConfig=e,this.context={}}push(...e){(e=e.filter(qr).map(Gr)).length&&(this._waitingActions.push(...e),this.handleActions())}handleActions(){const e=this._waitingActions;this._waitingActions=[],e.forEach((e=>{switch(e.action){case"init":this.handleInit(e);break;case"destroy":this.handleDestroy(e);break;default:this.handleAction(e)||this.setContext(e.action,...e.args)||this._waitingActions.push(e)}}))}instanceInitializing(e){const t=Object.keys(this._instances);return!e&&t.length>0||t.includes(e)}setContext(e,t){const{instance:n}=t;if(this.instanceInitializing(n))return!1;switch(e){case"setTopic":const{name:e}=t;return e&&(this.context.topic=e),!0;case"setTranslation":const{enabled:n,locale:r}=t;return n&&r&&(this.context.userLocale=r),!0;case"setContext":const{userLocale:s,contentLocale:o}=t;return this.context.userLocale=s,this.context.contentLocale=o,!0;case"setVariables":return Object.keys(t).length>0&&(this.context.variables={...t}),!0;default:return!1}}handleInit(e){const t=this.getUserConfig(...e.args),n=this.getCombinedConfig(t),{parentElement:r,namespace:s}=n||t;if(s?Object.values(this._instances).forEach((e=>{e.parentElement!==r&&e.namespace!==s||this.destroy(e)})):this.destroy(),n){const e=this.createInstance(n);this._instances[n.namespace]=e,this.context={},e.render()}}handleDestroy(e){this.destroy(e.instance)}handleAction(e){const{action:t,instance:n,args:r}=e,s=Object.values(this._instances);return!n&&s.length>1&&console.warn(`Multiple instances detected. Due to potential race conditions, it is recommended to target a specific instance with the action: ${t}`),s.map((e=>(!n||e.namespace===n)&&e.execFunction(t,...r))).some(Boolean)}createInstance(e){return new Wr(e,this)}destroy(e){e?("string"==typeof e&&(e=this._instances[e]),e&&(e.destroy(),delete this._instances[e.namespace])):Object.entries(this._instances).forEach((([e,t])=>{t.destroy(),delete this._instances[e]}))}getUserConfig(e={}){return e}getCombinedConfig(e){const t={...e.context||this.appConfig.context,...this.context},n=this.getMergedVariables(e);Object.keys(n).length>0&&(t.variables=n);const r={...this.appConfig.defaults,...e.defaults},s={...this.appConfig,...e,api:{...this.appConfig.api,...e.api},context:Object.keys(t).length?t:void 0,defaults:Object.keys(r).length?r:void 0};return"function"==typeof this.appConfig?this.appConfig(s):s}getMergedVariables(e){return{...this.appConfig.context?.variables||{},...e.context?.variables||{},...this.context.variables||{}}}},Jr=(...e)=>{const t=new URL(window.location.href);return e.reduce(((e,n)=>{const r=t.searchParams.get(n)||sessionStorage.getItem(n);return r&&(e[n]=r),e}),{})},Xr=(...e)=>{const t=new URL(window.location.href),n=e.reduce(((e,n)=>{const r=t.searchParams.get(n),s=r||sessionStorage.getItem(n);return r&&sessionStorage.setItem(n,r),s?(e.set(n,s),e):e}),new URLSearchParams),r=new URLSearchParams(Object.assign(Object.assign({},Object.fromEntries(t.searchParams)),Object.fromEntries(n)));return r.toString()&&window.history.replaceState(null,null,`?${r}`),Jr(...n.keys())},Qr=(...e)=>{const t=document.querySelector("[data-reset-search-params]");t&&t.addEventListener("click",(t=>{t.preventDefault();const n=new URL(window.location.href);e.forEach((e=>{sessionStorage.removeItem(e),n.searchParams.delete(e)})),window.location.href=n.toString()}))}})(),module.exports=r})();
|
|
2
|
+
(()=>{var e={8412:(e,t,n)=>{"use strict";n.d(t,{c:()=>P});var r,s,o,i,a=e=>"function"==typeof e?e:function(){return e},c="undefined"!=typeof self?self:null,l="undefined"!=typeof window?window:null,u=c||l||u,d="closed",p="errored",h="joined",f="joining",m="leaving",v="phx_close",g="phx_error",y="phx_reply",b="phx_leave",w="websocket",x=class{constructor(e,t,n,r){this.channel=e,this.event=t,this.payload=n||function(){return{}},this.receivedResp=null,this.timeout=r,this.timeoutTimer=null,this.recHooks=[],this.sent=!1}resend(e){this.timeout=e,this.reset(),this.send()}send(){this.hasReceived("timeout")||(this.startTimeout(),this.sent=!0,this.channel.socket.push({topic:this.channel.topic,event:this.event,payload:this.payload(),ref:this.ref,join_ref:this.channel.joinRef()}))}receive(e,t){return this.hasReceived(e)&&t(this.receivedResp.response),this.recHooks.push({status:e,callback:t}),this}reset(){this.cancelRefEvent(),this.ref=null,this.refEvent=null,this.receivedResp=null,this.sent=!1}matchReceive({status:e,response:t,_ref:n}){this.recHooks.filter((t=>t.status===e)).forEach((e=>e.callback(t)))}cancelRefEvent(){this.refEvent&&this.channel.off(this.refEvent)}cancelTimeout(){clearTimeout(this.timeoutTimer),this.timeoutTimer=null}startTimeout(){this.timeoutTimer&&this.cancelTimeout(),this.ref=this.channel.socket.makeRef(),this.refEvent=this.channel.replyEventName(this.ref),this.channel.on(this.refEvent,(e=>{this.cancelRefEvent(),this.cancelTimeout(),this.receivedResp=e,this.matchReceive(e)})),this.timeoutTimer=setTimeout((()=>{this.trigger("timeout",{})}),this.timeout)}hasReceived(e){return this.receivedResp&&this.receivedResp.status===e}trigger(e,t){this.channel.trigger(this.refEvent,{status:e,response:t})}},C=class{constructor(e,t){this.callback=e,this.timerCalc=t,this.timer=null,this.tries=0}reset(){this.tries=0,clearTimeout(this.timer)}scheduleTimeout(){clearTimeout(this.timer),this.timer=setTimeout((()=>{this.tries=this.tries+1,this.callback()}),this.timerCalc(this.tries+1))}},_=class{constructor(e,t,n){this.state=d,this.topic=e,this.params=a(t||{}),this.socket=n,this.bindings=[],this.bindingRef=0,this.timeout=this.socket.timeout,this.joinedOnce=!1,this.joinPush=new x(this,"phx_join",this.params,this.timeout),this.pushBuffer=[],this.stateChangeRefs=[],this.rejoinTimer=new C((()=>{this.socket.isConnected()&&this.rejoin()}),this.socket.rejoinAfterMs),this.stateChangeRefs.push(this.socket.onError((()=>this.rejoinTimer.reset()))),this.stateChangeRefs.push(this.socket.onOpen((()=>{this.rejoinTimer.reset(),this.isErrored()&&this.rejoin()}))),this.joinPush.receive("ok",(()=>{this.state=h,this.rejoinTimer.reset(),this.pushBuffer.forEach((e=>e.send())),this.pushBuffer=[]})),this.joinPush.receive("error",(()=>{this.state=p,this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()})),this.onClose((()=>{this.rejoinTimer.reset(),this.socket.hasLogger()&&this.socket.log("channel",`close ${this.topic} ${this.joinRef()}`),this.state=d,this.socket.remove(this)})),this.onError((e=>{this.socket.hasLogger()&&this.socket.log("channel",`error ${this.topic}`,e),this.isJoining()&&this.joinPush.reset(),this.state=p,this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()})),this.joinPush.receive("timeout",(()=>{this.socket.hasLogger()&&this.socket.log("channel",`timeout ${this.topic} (${this.joinRef()})`,this.joinPush.timeout),new x(this,b,a({}),this.timeout).send(),this.state=p,this.joinPush.reset(),this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()})),this.on(y,((e,t)=>{this.trigger(this.replyEventName(t),e)}))}join(e=this.timeout){if(this.joinedOnce)throw new Error("tried to join multiple times. 'join' can only be called a single time per channel instance");return this.timeout=e,this.joinedOnce=!0,this.rejoin(),this.joinPush}onClose(e){this.on(v,e)}onError(e){return this.on(g,(t=>e(t)))}on(e,t){let n=this.bindingRef++;return this.bindings.push({event:e,ref:n,callback:t}),n}off(e,t){this.bindings=this.bindings.filter((n=>!(n.event===e&&(void 0===t||t===n.ref))))}canPush(){return this.socket.isConnected()&&this.isJoined()}push(e,t,n=this.timeout){if(t=t||{},!this.joinedOnce)throw new Error(`tried to push '${e}' to '${this.topic}' before joining. Use channel.join() before pushing events`);let r=new x(this,e,(function(){return t}),n);return this.canPush()?r.send():(r.startTimeout(),this.pushBuffer.push(r)),r}leave(e=this.timeout){this.rejoinTimer.reset(),this.joinPush.cancelTimeout(),this.state=m;let t=()=>{this.socket.hasLogger()&&this.socket.log("channel",`leave ${this.topic}`),this.trigger(v,"leave")},n=new x(this,b,a({}),e);return n.receive("ok",(()=>t())).receive("timeout",(()=>t())),n.send(),this.canPush()||n.trigger("ok",{}),n}onMessage(e,t,n){return t}isMember(e,t,n,r){return!(this.topic!==e||r&&r!==this.joinRef()&&(this.socket.hasLogger()&&this.socket.log("channel","dropping outdated message",{topic:e,event:t,payload:n,joinRef:r}),1))}joinRef(){return this.joinPush.ref}rejoin(e=this.timeout){this.isLeaving()||(this.socket.leaveOpenTopic(this.topic),this.state=f,this.joinPush.resend(e))}trigger(e,t,n,r){let s=this.onMessage(e,t,n,r);if(t&&!s)throw new Error("channel onMessage callbacks must return the payload, modified or unmodified");let o=this.bindings.filter((t=>t.event===e));for(let e=0;e<o.length;e++)o[e].callback(s,n,r||this.joinRef())}replyEventName(e){return`chan_reply_${e}`}isClosed(){return this.state===d}isErrored(){return this.state===p}isJoined(){return this.state===h}isJoining(){return this.state===f}isLeaving(){return this.state===m}},j=class{static request(e,t,n,r,s,o,i){if(u.XDomainRequest){let n=new u.XDomainRequest;return this.xdomainRequest(n,e,t,r,s,o,i)}{let a=new u.XMLHttpRequest;return this.xhrRequest(a,e,t,n,r,s,o,i)}}static xdomainRequest(e,t,n,r,s,o,i){return e.timeout=s,e.open(t,n),e.onload=()=>{let t=this.parseJSON(e.responseText);i&&i(t)},o&&(e.ontimeout=o),e.onprogress=()=>{},e.send(r),e}static xhrRequest(e,t,n,r,s,o,i,a){return e.open(t,n,!0),e.timeout=o,e.setRequestHeader("Content-Type",r),e.onerror=()=>a&&a(null),e.onreadystatechange=()=>{if(4===e.readyState&&a){let t=this.parseJSON(e.responseText);a(t)}},i&&(e.ontimeout=i),e.send(s),e}static parseJSON(e){if(!e||""===e)return null;try{return JSON.parse(e)}catch(t){return console&&console.log("failed to parse JSON response",e),null}}static serialize(e,t){let n=[];for(var r in e){if(!Object.prototype.hasOwnProperty.call(e,r))continue;let s=t?`${t}[${r}]`:r,o=e[r];"object"==typeof o?n.push(this.serialize(o,s)):n.push(encodeURIComponent(s)+"="+encodeURIComponent(o))}return n.join("&")}static appendParams(e,t){if(0===Object.keys(t).length)return e;let n=e.match(/\?/)?"&":"?";return`${e}${n}${this.serialize(t)}`}},E=class{constructor(e){this.endPoint=null,this.token=null,this.skipHeartbeat=!0,this.reqs=new Set,this.awaitingBatchAck=!1,this.currentBatch=null,this.currentBatchTimer=null,this.batchBuffer=[],this.onopen=function(){},this.onerror=function(){},this.onmessage=function(){},this.onclose=function(){},this.pollEndpoint=this.normalizeEndpoint(e),this.readyState=0,setTimeout((()=>this.poll()),0)}normalizeEndpoint(e){return e.replace("ws://","http://").replace("wss://","https://").replace(new RegExp("(.*)/"+w),"$1/longpoll")}endpointURL(){return j.appendParams(this.pollEndpoint,{token:this.token})}closeAndRetry(e,t,n){this.close(e,t,n),this.readyState=0}ontimeout(){this.onerror("timeout"),this.closeAndRetry(1005,"timeout",!1)}isActive(){return 1===this.readyState||0===this.readyState}poll(){this.ajax("GET","application/json",null,(()=>this.ontimeout()),(e=>{if(e){var{status:t,token:n,messages:r}=e;this.token=n}else t=0;switch(t){case 200:r.forEach((e=>{setTimeout((()=>this.onmessage({data:e})),0)})),this.poll();break;case 204:this.poll();break;case 410:this.readyState=1,this.onopen({}),this.poll();break;case 403:this.onerror(403),this.close(1008,"forbidden",!1);break;case 0:case 500:this.onerror(500),this.closeAndRetry(1011,"internal server error",500);break;default:throw new Error(`unhandled poll status ${t}`)}}))}send(e){"string"!=typeof e&&(e=(e=>{let t="",n=new Uint8Array(e),r=n.byteLength;for(let e=0;e<r;e++)t+=String.fromCharCode(n[e]);return btoa(t)})(e)),this.currentBatch?this.currentBatch.push(e):this.awaitingBatchAck?this.batchBuffer.push(e):(this.currentBatch=[e],this.currentBatchTimer=setTimeout((()=>{this.batchSend(this.currentBatch),this.currentBatch=null}),0))}batchSend(e){this.awaitingBatchAck=!0,this.ajax("POST","application/x-ndjson",e.join("\n"),(()=>this.onerror("timeout")),(e=>{this.awaitingBatchAck=!1,e&&200===e.status?this.batchBuffer.length>0&&(this.batchSend(this.batchBuffer),this.batchBuffer=[]):(this.onerror(e&&e.status),this.closeAndRetry(1011,"internal server error",!1))}))}close(e,t,n){for(let e of this.reqs)e.abort();this.readyState=3;let r=Object.assign({code:1e3,reason:void 0,wasClean:!0},{code:e,reason:t,wasClean:n});this.batchBuffer=[],clearTimeout(this.currentBatchTimer),this.currentBatchTimer=null,"undefined"!=typeof CloseEvent?this.onclose(new CloseEvent("close",r)):this.onclose(r)}ajax(e,t,n,r,s){let o;o=j.request(e,this.endpointURL(),t,n,this.timeout,(()=>{this.reqs.delete(o),r()}),(e=>{this.reqs.delete(o),this.isActive()&&s(e)})),this.reqs.add(o)}},S={HEADER_LENGTH:1,META_LENGTH:4,KINDS:{push:0,reply:1,broadcast:2},encode(e,t){if(e.payload.constructor===ArrayBuffer)return t(this.binaryEncode(e));{let n=[e.join_ref,e.ref,e.topic,e.event,e.payload];return t(JSON.stringify(n))}},decode(e,t){if(e.constructor===ArrayBuffer)return t(this.binaryDecode(e));{let[n,r,s,o,i]=JSON.parse(e);return t({join_ref:n,ref:r,topic:s,event:o,payload:i})}},binaryEncode(e){let{join_ref:t,ref:n,event:r,topic:s,payload:o}=e,i=this.META_LENGTH+t.length+n.length+s.length+r.length,a=new ArrayBuffer(this.HEADER_LENGTH+i),c=new DataView(a),l=0;c.setUint8(l++,this.KINDS.push),c.setUint8(l++,t.length),c.setUint8(l++,n.length),c.setUint8(l++,s.length),c.setUint8(l++,r.length),Array.from(t,(e=>c.setUint8(l++,e.charCodeAt(0)))),Array.from(n,(e=>c.setUint8(l++,e.charCodeAt(0)))),Array.from(s,(e=>c.setUint8(l++,e.charCodeAt(0)))),Array.from(r,(e=>c.setUint8(l++,e.charCodeAt(0))));var u=new Uint8Array(a.byteLength+o.byteLength);return u.set(new Uint8Array(a),0),u.set(new Uint8Array(o),a.byteLength),u.buffer},binaryDecode(e){let t=new DataView(e),n=t.getUint8(0),r=new TextDecoder;switch(n){case this.KINDS.push:return this.decodePush(e,t,r);case this.KINDS.reply:return this.decodeReply(e,t,r);case this.KINDS.broadcast:return this.decodeBroadcast(e,t,r)}},decodePush(e,t,n){let r=t.getUint8(1),s=t.getUint8(2),o=t.getUint8(3),i=this.HEADER_LENGTH+this.META_LENGTH-1,a=n.decode(e.slice(i,i+r));i+=r;let c=n.decode(e.slice(i,i+s));i+=s;let l=n.decode(e.slice(i,i+o));return i+=o,{join_ref:a,ref:null,topic:c,event:l,payload:e.slice(i,e.byteLength)}},decodeReply(e,t,n){let r=t.getUint8(1),s=t.getUint8(2),o=t.getUint8(3),i=t.getUint8(4),a=this.HEADER_LENGTH+this.META_LENGTH,c=n.decode(e.slice(a,a+r));a+=r;let l=n.decode(e.slice(a,a+s));a+=s;let u=n.decode(e.slice(a,a+o));a+=o;let d=n.decode(e.slice(a,a+i));a+=i;let p=e.slice(a,e.byteLength);return{join_ref:c,ref:l,topic:u,event:y,payload:{status:d,response:p}}},decodeBroadcast(e,t,n){let r=t.getUint8(1),s=t.getUint8(2),o=this.HEADER_LENGTH+2,i=n.decode(e.slice(o,o+r));o+=r;let a=n.decode(e.slice(o,o+s));return o+=s,{join_ref:null,ref:null,topic:i,event:a,payload:e.slice(o,e.byteLength)}}},T=class{constructor(e,t={}){this.stateChangeCallbacks={open:[],close:[],error:[],message:[]},this.channels=[],this.sendBuffer=[],this.ref=0,this.timeout=t.timeout||1e4,this.transport=t.transport||u.WebSocket||E,this.longPollFallbackMs=t.longPollFallbackMs,this.fallbackTimer=null,this.sessionStore=t.sessionStorage||u.sessionStorage,this.establishedConnections=0,this.defaultEncoder=S.encode.bind(S),this.defaultDecoder=S.decode.bind(S),this.closeWasClean=!1,this.binaryType=t.binaryType||"arraybuffer",this.connectClock=1,this.transport!==E?(this.encode=t.encode||this.defaultEncoder,this.decode=t.decode||this.defaultDecoder):(this.encode=this.defaultEncoder,this.decode=this.defaultDecoder);let n=null;l&&l.addEventListener&&(l.addEventListener("pagehide",(e=>{this.conn&&(this.disconnect(),n=this.connectClock)})),l.addEventListener("pageshow",(e=>{n===this.connectClock&&(n=null,this.connect())}))),this.heartbeatIntervalMs=t.heartbeatIntervalMs||3e4,this.rejoinAfterMs=e=>t.rejoinAfterMs?t.rejoinAfterMs(e):[1e3,2e3,5e3][e-1]||1e4,this.reconnectAfterMs=e=>t.reconnectAfterMs?t.reconnectAfterMs(e):[10,50,100,150,200,250,500,1e3,2e3][e-1]||5e3,this.logger=t.logger||null,!this.logger&&t.debug&&(this.logger=(e,t,n)=>{console.log(`${e}: ${t}`,n)}),this.longpollerTimeout=t.longpollerTimeout||2e4,this.params=a(t.params||{}),this.endPoint=`${e}/${w}`,this.vsn=t.vsn||"2.0.0",this.heartbeatTimeoutTimer=null,this.heartbeatTimer=null,this.pendingHeartbeatRef=null,this.reconnectTimer=new C((()=>{this.teardown((()=>this.connect()))}),this.reconnectAfterMs)}getLongPollTransport(){return E}replaceTransport(e){this.connectClock++,this.closeWasClean=!0,clearTimeout(this.fallbackTimer),this.reconnectTimer.reset(),this.conn&&(this.conn.close(),this.conn=null),this.transport=e}protocol(){return location.protocol.match(/^https/)?"wss":"ws"}endPointURL(){let e=j.appendParams(j.appendParams(this.endPoint,this.params()),{vsn:this.vsn});return"/"!==e.charAt(0)?e:"/"===e.charAt(1)?`${this.protocol()}:${e}`:`${this.protocol()}://${location.host}${e}`}disconnect(e,t,n){this.connectClock++,this.closeWasClean=!0,clearTimeout(this.fallbackTimer),this.reconnectTimer.reset(),this.teardown(e,t,n)}connect(e){e&&(console&&console.log("passing params to connect is deprecated. Instead pass :params to the Socket constructor"),this.params=a(e)),this.conn||(this.longPollFallbackMs&&this.transport!==E?this.connectWithFallback(E,this.longPollFallbackMs):this.transportConnect())}log(e,t,n){this.logger&&this.logger(e,t,n)}hasLogger(){return null!==this.logger}onOpen(e){let t=this.makeRef();return this.stateChangeCallbacks.open.push([t,e]),t}onClose(e){let t=this.makeRef();return this.stateChangeCallbacks.close.push([t,e]),t}onError(e){let t=this.makeRef();return this.stateChangeCallbacks.error.push([t,e]),t}onMessage(e){let t=this.makeRef();return this.stateChangeCallbacks.message.push([t,e]),t}ping(e){if(!this.isConnected())return!1;let t=this.makeRef(),n=Date.now();this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:t});let r=this.onMessage((s=>{s.ref===t&&(this.off([r]),e(Date.now()-n))}));return!0}transportConnect(){this.connectClock++,this.closeWasClean=!1,this.conn=new this.transport(this.endPointURL()),this.conn.binaryType=this.binaryType,this.conn.timeout=this.longpollerTimeout,this.conn.onopen=()=>this.onConnOpen(),this.conn.onerror=e=>this.onConnError(e),this.conn.onmessage=e=>this.onConnMessage(e),this.conn.onclose=e=>this.onConnClose(e)}getSession(e){return this.sessionStore&&this.sessionStore.getItem(e)}storeSession(e,t){this.sessionStore&&this.sessionStore.setItem(e,t)}connectWithFallback(e,t=2500){clearTimeout(this.fallbackTimer);let n,r=!1,s=!0,o=t=>{this.log("transport",`falling back to ${e.name}...`,t),this.off([void 0,n]),s=!1,this.storeSession("phx:longpoll","true"),this.replaceTransport(e),this.transportConnect()};if(this.getSession("phx:longpoll"))return o("memorized");this.fallbackTimer=setTimeout(o,t),n=this.onError((e=>{this.log("transport","error",e),s&&!r&&(clearTimeout(this.fallbackTimer),o(e))})),this.onOpen((()=>{if(r=!0,!s)return console.log("transport",`established ${e.name} fallback`);clearTimeout(this.fallbackTimer),this.fallbackTimer=setTimeout(o,t),this.ping((e=>{this.log("transport","connected to primary after",e),clearTimeout(this.fallbackTimer)}))})),this.transportConnect()}clearHeartbeats(){clearTimeout(this.heartbeatTimer),clearTimeout(this.heartbeatTimeoutTimer)}onConnOpen(){this.hasLogger()&&this.log("transport",`${this.transport.name} connected to ${this.endPointURL()}`),this.closeWasClean=!1,this.establishedConnections++,this.flushSendBuffer(),this.reconnectTimer.reset(),this.resetHeartbeat(),this.stateChangeCallbacks.open.forEach((([,e])=>e()))}heartbeatTimeout(){this.pendingHeartbeatRef&&(this.pendingHeartbeatRef=null,this.hasLogger()&&this.log("transport","heartbeat timeout. Attempting to re-establish connection"),this.triggerChanError(),this.closeWasClean=!1,this.teardown((()=>this.reconnectTimer.scheduleTimeout()),1e3,"heartbeat timeout"))}resetHeartbeat(){this.conn&&this.conn.skipHeartbeat||(this.pendingHeartbeatRef=null,this.clearHeartbeats(),this.heartbeatTimer=setTimeout((()=>this.sendHeartbeat()),this.heartbeatIntervalMs))}teardown(e,t,n){if(!this.conn)return e&&e();this.waitForBufferDone((()=>{this.conn&&(t?this.conn.close(t,n||""):this.conn.close()),this.waitForSocketClosed((()=>{this.conn&&(this.conn.onopen=function(){},this.conn.onerror=function(){},this.conn.onmessage=function(){},this.conn.onclose=function(){},this.conn=null),e&&e()}))}))}waitForBufferDone(e,t=1){5!==t&&this.conn&&this.conn.bufferedAmount?setTimeout((()=>{this.waitForBufferDone(e,t+1)}),150*t):e()}waitForSocketClosed(e,t=1){5!==t&&this.conn&&3!==this.conn.readyState?setTimeout((()=>{this.waitForSocketClosed(e,t+1)}),150*t):e()}onConnClose(e){let t=e&&e.code;this.hasLogger()&&this.log("transport","close",e),this.triggerChanError(),this.clearHeartbeats(),this.closeWasClean||1e3===t||this.reconnectTimer.scheduleTimeout(),this.stateChangeCallbacks.close.forEach((([,t])=>t(e)))}onConnError(e){this.hasLogger()&&this.log("transport",e);let t=this.transport,n=this.establishedConnections;this.stateChangeCallbacks.error.forEach((([,r])=>{r(e,t,n)})),(t===this.transport||n>0)&&this.triggerChanError()}triggerChanError(){this.channels.forEach((e=>{e.isErrored()||e.isLeaving()||e.isClosed()||e.trigger(g)}))}connectionState(){switch(this.conn&&this.conn.readyState){case 0:return"connecting";case 1:return"open";case 2:return"closing";default:return"closed"}}isConnected(){return"open"===this.connectionState()}remove(e){this.off(e.stateChangeRefs),this.channels=this.channels.filter((t=>t.joinRef()!==e.joinRef()))}off(e){for(let t in this.stateChangeCallbacks)this.stateChangeCallbacks[t]=this.stateChangeCallbacks[t].filter((([t])=>-1===e.indexOf(t)))}channel(e,t={}){let n=new _(e,t,this);return this.channels.push(n),n}push(e){if(this.hasLogger()){let{topic:t,event:n,payload:r,ref:s,join_ref:o}=e;this.log("push",`${t} ${n} (${o}, ${s})`,r)}this.isConnected()?this.encode(e,(e=>this.conn.send(e))):this.sendBuffer.push((()=>this.encode(e,(e=>this.conn.send(e)))))}makeRef(){let e=this.ref+1;return e===this.ref?this.ref=0:this.ref=e,this.ref.toString()}sendHeartbeat(){this.pendingHeartbeatRef&&!this.isConnected()||(this.pendingHeartbeatRef=this.makeRef(),this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:this.pendingHeartbeatRef}),this.heartbeatTimeoutTimer=setTimeout((()=>this.heartbeatTimeout()),this.heartbeatIntervalMs))}flushSendBuffer(){this.isConnected()&&this.sendBuffer.length>0&&(this.sendBuffer.forEach((e=>e())),this.sendBuffer=[])}onConnMessage(e){this.decode(e.data,(e=>{let{topic:t,event:n,payload:r,ref:s,join_ref:o}=e;s&&s===this.pendingHeartbeatRef&&(this.clearHeartbeats(),this.pendingHeartbeatRef=null,this.heartbeatTimer=setTimeout((()=>this.sendHeartbeat()),this.heartbeatIntervalMs)),this.hasLogger()&&this.log("receive",`${r.status||""} ${t} ${n} ${s&&"("+s+")"||""}`,r);for(let e=0;e<this.channels.length;e++){const i=this.channels[e];i.isMember(t,n,r,o)&&i.trigger(n,r,s,o)}for(let t=0;t<this.stateChangeCallbacks.message.length;t++){let[,n]=this.stateChangeCallbacks.message[t];n(e)}}))}leaveOpenTopic(e){let t=this.channels.find((t=>t.topic===e&&(t.isJoined()||t.isJoining())));t&&(this.hasLogger()&&this.log("transport",`leaving duplicate topic "${e}"`),t.leave())}},k=n(7548),O=n(5576),N=n.n(O),I=n(5968),U=function(e,t,n,r){if("a"===n&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?r:"a"===n?r.call(e):r?r.value:t.get(e)},A=function(e,t,n,r,s){if("m"===r)throw new TypeError("Private method is not writable");if("a"===r&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!s:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?s.call(e,n):s?s.value=n:t.set(e,n),n};const R=N()("seamly"),M=new Set;s=new WeakMap,r=new WeakSet,o=function(...e){e.forEach((e=>{this.channel.on(e,(t=>{R("[RECEIVE]",e,t)}))}))},i=function(e){A(this,s,U(this,s,"f").filter((t=>!t(e))),"f"),M.forEach((e=>e()))};const P=class{constructor(){r.add(this),s.set(this,[])}connect(e,t,n,s){return a=this,c=void 0,u=function*(){this.url=e,this.accessToken=s,this.channelName=t,this.channelTopic=n;const{url:a,params:c}=(0,I.c)(this.url);this.socket=new T(a,{params:Object.assign(Object.assign({},c),{v:k.kR}),reconnectAfterMs:e=>{const t=250*Math.pow(2,e);return Math.min(t,1e4)}}),this.socket.onError((e=>{R("[SOCKET][ERROR]",e)})),this.socket.onOpen((()=>{R("[SOCKET]OPEN")})),this.socket.onClose((()=>{R("[SOCKET]CLOSE"),U(this,r,"m",i).call(this,{connected:!1,ready:!1,currentState:"socket_closed"})})),this.socket.connect(),this.channel=this.socket.channel(this.channelTopic,{authorization:`Bearer ${this.accessToken}`,channelName:this.channelName}),this.start(),this.channel.on("system",(e=>{"attach_channel_succeeded"===e.type&&U(this,r,"m",i).call(this,{connected:!0,ready:!0,currentState:"attach_channel_succeeded"})})),this.channel.onClose((()=>{R("[CHANNEL]CLOSE"),U(this,r,"m",i).call(this,{connected:!1,ready:!1,currentState:"channel_closed"})})),this.channel.onError((e=>{R("[CHANNEL][ERROR]",e),U(this,r,"m",i).call(this,{connected:!1,ready:!1,currentState:"channel_erred"})})),U(this,r,"m",o).call(this,"ack","ui","error","participant","message","service_data","system","info","sync")},new((l=void 0)||(l=Promise))((function(e,t){function n(e){try{s(u.next(e))}catch(e){t(e)}}function r(e){try{s(u.throw(e))}catch(e){t(e)}}function s(t){var s;t.done?e(t.value):(s=t.value,s instanceof l?s:new l((function(e){e(s)}))).then(n,r)}s((u=u.apply(a,c||[])).next())}));var a,c,l,u}start(){this.channel.join().receive("ok",(()=>{R("[CHANNEL][JOIN] OK"),U(this,r,"m",i).call(this,{connected:!0,ready:!1,currentState:"join_channel_succeeded"})})).receive("error",(e=>{R("[CHANNEL][JOIN] ERROR",e),U(this,r,"m",i).call(this,{connected:!1,ready:!1,currentState:"join_channel_erred"})})).receive("timeout",(()=>{R("[CHANEL][JOIN] Networking issue. Still waiting...")}))}disconnect(){var e;null===(e=this.channel)||void 0===e||e.leave().receive("ok",(()=>{var e;null===(e=this.socket)||void 0===e||e.disconnect(),R("[CHANNEL][LEAVE] OK"),A(this,s,[],"f")}))}onConnection(e){U(this,s,"f").push(e)}pushToChannel(e,t,n=1e4){this.channel.push(e,t,n)}static subscribe(e){return M.add(e),()=>M.delete(e)}}},7548:(e,t,n)=>{"use strict";n.d(t,{Ag:()=>f,GS:()=>a,e:()=>h,es:()=>i,gJ:()=>u,kR:()=>s,kr:()=>o,oP:()=>l,sB:()=>c,uY:()=>p,us:()=>d,wm:()=>r});const r="cvco",s="3",o="seamly-client-participant",i=2e3,a=1e3,c=10,l=15e3,u=50,d=300,p=300,h=2e3,f={namespace:"default",layoutMode:"window",messages:{agent:{showAvatar:!1,showName:!1},user:{showAvatar:!1,showName:!1},timeIndicator:{enabled:!1,threshold:36e5}}}},232:(e,t,n)=>{"use strict";n.d(t,{m:()=>u,C:()=>d});var r=n(3120),s=n(6232),o=n(6280),i=n(712);var a=n(2948),c=n(6244),l=function(e,t,n,r){return new(n||(n=Promise))((function(s,o){function i(e){try{c(r.next(e))}catch(e){o(e)}}function a(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?s(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(i,a)}c((r=r.apply(e,t||[])).next())}))};const u=(0,r.aw)("initializeApp",((e,{extra:{api:t,config:n},rejectWithValue:r})=>l(void 0,void 0,void 0,(function*(){var e,i,a;let l=null===(e=null==n?void 0:n.context)||void 0===e?void 0:e.contentLocale,u=null===(i=null==n?void 0:n.context)||void 0===i?void 0:i.userLocale;const d=!1!==n.api.sendEnvironment?t.getEnvironment():n.api.sendEnvironment;try{if(t.hasConversation()){const e=yield t.getConversationIntitialState();return l=e.context.contentLocale||l,u=e.context.userLocale||u,t.sendContext(Object.assign(Object.assign({},e.context),{environment:d})),{initialState:e,contentLocale:l,userLocale:u,config:n}}return(null===(a=null==n?void 0:n.context)||void 0===a?void 0:a.topic)&&t.send("action",{type:c.w$.setTopic,body:{name:n.context.topic,fallbackMessage:n.context.topic}}),t.sendContext(Object.assign(Object.assign({},n.context),{environment:d})),{initialState:void 0,contentLocale:l,userLocale:u,config:n}}catch(e){if(e instanceof s.c){const e=new s.c;return r({name:e.name,message:e.message,originalEvent:e.originalEvent,originalError:e.originalError,action:e.action})}const t=new o.c;return r({name:t.name,message:t.message,langKey:t.langKey})}})))),d=((e,t,n)=>{const{wait:s=300,maxWait:o=0,leading:i=!1}=null!=n?n:{};let a,c=null,l=null;const u=()=>{clearTimeout(l),l=void 0,a&&(a(!0),a=void 0)};return(0,r.aw)(e,t,{condition:()=>{const e=i&&!c;return clearTimeout(c),c=setTimeout((()=>{u(),c=null}),s),!!e||(a&&(a(!1),a=void 0),o&&!l&&(l=setTimeout(u,o)),new Promise((e=>{a=e})))}})})("resetApp",((e,{dispatch:t,extra:{api:n}})=>l(void 0,void 0,void 0,(function*(){yield n.disconnect(),n.clearStore(),t((0,i.O)()),yield t((0,i.A)()),yield t(u()),t((0,a.i)())}))),{wait:2e3,leading:!0})},1060:(e,t,n)=>{"use strict";n.d(t,{E:()=>r});const r=(0,n(8888).M3)((({app:e})=>e),(({userHasResponded:e})=>e))},428:(e,t,n)=>{"use strict";n.d(t,{N8:()=>a,cp:()=>c});var r=n(3120),s=n(232);const o={userHasResponded:!1},i=(0,r.is)({name:"app",initialState:o,reducers:{setHasResponded:(e,{payload:t})=>{e.userHasResponded=t}},extraReducers:e=>{e.addCase(s.C.pending,(()=>o)).addCase(s.m.fulfilled,((e,{payload:t})=>{var n;t.initialState&&"userResponded"in t.initialState&&(e.userHasResponded=null===(n=t.initialState)||void 0===n?void 0:n.userResponded)}))}}),{setHasResponded:a}=i.actions,c=i.reducer},712:(e,t,n)=>{"use strict";n.d(t,{A:()=>o,O:()=>i});var r=n(3120),s=function(e,t,n,r){return new(n||(n=Promise))((function(s,o){function i(e){try{c(r.next(e))}catch(e){o(e)}}function a(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?s(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(i,a)}c((r=r.apply(e,t||[])).next())}))};const o=(0,r.aw)("initializeConfig",((e,{extra:{api:t,config:n},rejectWithValue:r})=>s(void 0,void 0,void 0,(function*(){var e,s;try{const{features:r,defaultLocale:o,preChat:i,agentParticipant:a,userParticipant:c,startChatIcon:l}=yield t.getConfig(),u=(null===(e=null==n?void 0:n.context)||void 0===e?void 0:e.userLocale)||o,d=(null===(s=null==n?void 0:n.context)||void 0===s?void 0:s.contentLocale)||o,{connectWhenInView:p}=n;return{features:r,defaultLocale:o,preChat:i,agentParticipant:a,userParticipant:c,startChatIcon:l,defaultUserLocale:u,defaultContentLocale:d,connectWhenInView:p}}catch(e){return r(e)}})))),i=(0,r.aw)("resetConfig",((e,{extra:{config:t}})=>s(void 0,void 0,void 0,(function*(){return t}))))},5352:(e,t,n)=>{"use strict";n.d(t,{E3:()=>i,EV:()=>o});var r=n(2328),s=n(5368);const o=()=>(0,r.w1)(s.g);function i(){const{startChatIcon:e}=o();return e}},5368:(e,t,n)=>{"use strict";n.d(t,{g:()=>o});var r=n(8888),s=n(8536);const o=(0,r.M3)((({config:e})=>e),(e=>{let t=Object.assign({visible:"inline"===(null==e?void 0:e.layoutMode)?s.I.open:s.I.minimized,appContainerClassNames:(null==e?void 0:e.appContainerClassNames)||[]},e);return"function"==typeof t.appContainerClassNames&&(t=Object.assign(Object.assign({},t),{appContainerClassNames:t.appContainerClassNames(t)})),t}))},7452:(e,t,n)=>{"use strict";n.d(t,{Lp:()=>p,_U:()=>d,cp:()=>f});var r=n(3120),s=n(7548),o=n(712),i=n(8760);const a=Object.assign(Object.assign({},s.Ag),{api:{domain:"",key:"",secure:!0,sendEnvironment:!0},notificationAudioURL:void 0,hideOnNoUserResponse:!1,connectWhenInView:!0,showDisclaimer:!1,showSuggestions:!0,preChat:{enterDelay:1e3,exitAfter:4e3},continueChat:{enterDelay:0,exitAfter:2e3},customComponents:{},defaults:{visible:null},preChatEvents:[]}),c=["hideOnNoUserResponse","connectWhenInView","showDisclaimer","showSuggestions","continueChat","preChat","namespace","customComponents","defaults","layoutMode","api","zIndex","context","appContainerClassNames","messages","visible","visibilityCallback","errorCallback","agentParticipant","userParticipant","startChatIcon","notificationAudioURL"],l=(e,t)=>{const n=(0,i.gl)(t,c),{messages:r}=n,s=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var s=0;for(r=Object.getOwnPropertySymbols(e);s<r.length;s++)t.indexOf(r[s])<0&&Object.prototype.propertyIsEnumerable.call(e,r[s])&&(n[r[s]]=e[r[s]])}return n}(n,["messages"]);let o=e;return Object.keys(s).length>0&&(o=Object.assign(Object.assign({},o),s)),r&&(o=Object.assign(Object.assign({},o),{messages:Object.assign(Object.assign({},o.messages),r)})),o},u=(0,r.is)({name:"config",initialState:a,reducers:{setConfig:(e,{payload:t})=>l(e,t),updateConfig:(e,{payload:t})=>l(e,t),setPreChatEvents:(e,{payload:t})=>{e.preChatEvents=t}},extraReducers:e=>{e.addCase(o.O.fulfilled,(e=>e)).addCase(o.A.fulfilled,((e,{payload:{preChat:t,agentParticipant:n,userParticipant:r,startChatIcon:s,defaultUserLocale:o,defaultContentLocale:i}})=>{e.preChatEvents=t.map((e=>({type:"message",payload:e}))),e.context.userLocale=o,e.context.contentLocale=i,e.agentParticipant=n,e.userParticipant=r,e.startChatIcon=s}))}}),{setConfig:d,updateConfig:p,setPreChatEvents:h}=u.actions,f=u.reducer},1364:(e,t,n)=>{"use strict";n.d(t,{U:()=>f,a:()=>h});var r=n(3120),s=n(2309),o=n(3872),i=n(2704),a=n(8132),c=n(6232),l=n(1120),u=n(6280),d=n(5368);const p={SeamlyGeneralError:i.c,SeamlyConfigurationError:o.c,SeamlySessionExpiredError:c.c,SeamlyOfflineError:a.c,SeamlyUnauthorizedError:l.c,SeamlyUnavailableError:u.c},h=(0,r.Uh)("catch-error",(e=>({payload:e})));function f({api:e}){return({getState:t})=>{const n=n=>{const{errorCallback:r,namespace:o,api:i,layoutMode:a}=(0,d.g)(t()),{error:c,type:l}=n,u=p[null==c?void 0:c.name]?new p[c.name](c):new s.c(c);null==r||r(u,{namespace:o,api:i,layoutMode:a,conversationUrl:e.getConversationUrl(),action:l?n:void 0})};return e=>t=>{var r,s,o,i,a,c;try{return(null===(s=null===(r=t.payload)||void 0===r?void 0:r.originalEvent)||void 0===s?void 0:s.payload)?n({error:t.payload,type:null===(a=null===(i=null===(o=t.payload)||void 0===o?void 0:o.originalEvent)||void 0===i?void 0:i.payload)||void 0===a?void 0:a.type}):(null===(c=t.payload)||void 0===c?void 0:c.originalError)&&n({error:t.payload,type:void 0}),e(t)}catch(e){throw n({error:e}),e}}}}},2620:(e,t,n)=>{"use strict";n.d(t,{A$:()=>p,K0:()=>u,OI:()=>h,YJ:()=>d,cp:()=>m,e8:()=>l,mq:()=>f});var r=n(3120),s=n(232);const o={controls:{}},i={value:"",touched:!1},a={controls:i},c=(0,r.is)({name:"forms",initialState:a,reducers:{registerForm:(e,{payload:{persistData:t,formId:n}})=>{var r;const s=t&&null!==(r=e[n])&&void 0!==r?r:Object.assign(Object.assign({},o),{persistData:t});e[n]=s},deregisterForm:(e,{payload:{formId:t}})=>{var n;return(null===(n=e[t])||void 0===n?void 0:n.persistData)||delete e[t],e},registerControl:(e,{payload:{name:t,formId:n}})=>{e[n].controls={[t]:i}},deregisterControl:(e,{payload:{name:t,formId:n}})=>{const r=e[n];if(!r)return e;if(r.persistData)return e;const s=Object.assign({},r.controls);return delete s[t],Object.assign(Object.assign({},e),{[n]:Object.assign(Object.assign({},r),{controls:s})})},updateControlValue:(e,{payload:{formId:t,name:n,value:r}})=>{var s;(null===(s=e[t])||void 0===s?void 0:s.controls)&&(e[t].controls[n].value=r)},updateControlTouched:(e,{payload:{formId:t,name:n,touched:r}})=>{var s;(null===(s=e[t])||void 0===s?void 0:s.controls[n])&&(e[t].controls[n].touched=r)}},extraReducers:e=>{e.addCase(s.C.pending,(()=>a))}}),{registerForm:l,deregisterForm:u,registerControl:d,deregisterControl:p,updateControlValue:h,updateControlTouched:f}=c.actions,m=c.reducer},4528:(e,t,n)=>{"use strict";n.d(t,{K:()=>s});var r=n(3120);const s=(0,r.aw)("setLocale",((e,{extra:{api:t},rejectWithValue:n})=>{return r=void 0,s=void 0,i=function*(){try{return{translations:yield t.getTranslations(e),userLocale:e}}catch(e){return n(e)}},new((o=void 0)||(o=Promise))((function(e,t){function n(e){try{c(i.next(e))}catch(e){t(e)}}function a(e){try{c(i.throw(e))}catch(e){t(e)}}function c(t){var r;t.done?e(t.value):(r=t.value,r instanceof o?r:new o((function(e){e(r)}))).then(n,a)}c((i=i.apply(r,s||[])).next())}));var r,s,o,i}),{condition:(e,{getState:t})=>{const{i18n:{isLoading:n,userLocale:r}}=t();return e!==r&&!n}})},1800:(e,t,n)=>{"use strict";function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function s(e){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},s(e)}function o(e){var t=function(e,t){if("object"!=s(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=s(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==s(t)?t:String(t)}function i(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,o(r.key),r)}}function a(e,t,n){return(t=o(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function c(e){return e.reduce((function(e,t){return e.concat(Array.isArray(t)?c(t):t)}),[])}function l(e){for(var t=function(e){return/\s/.test(e)},n=[],r={},s=0,o=null,i=!1,a=0;a<e.length;){if(i&&(t(e[a])||"{"===e[a]))i=!1,o=e.slice(s,a),"{"===e[a]&&a--;else if(!i&&!t(e[a])){var c="{"===e[a];if(o&&c){var l=u(e,a);if(-1===l)throw new Error('Unbalanced curly braces in string: "'.concat(e,'"'));r[o]=e.slice(a+1,l),a=l,o=null}else o&&(n.push(o),o=null),i=!0,s=a}a++}return i&&(o=e.slice(s)),o&&n.push(o),{args:n,cases:r}}function u(e,t){for(var n=0,r=t+1;r<e.length;r++){var s=e.charAt(r);if("}"===s){if(0===n)return r;n--}else"{"===s&&n++}return-1}function d(e){return p(e.slice(1,-1),",",3)}function p(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];if(!e)return r;if(1===n)return r.push(e),r;var s=e.indexOf(t);if(-1===s)return r.push(e),r;var o=e.substring(0,s).trim(),i=e.substring(s+t.length+1).trim();return r.push(o),p(i,t,n-1,r)}n.d(t,{g:()=>O});var h,f=function(){function e(t){var n,r,s=this,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),a(this,"format",(n=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return c(s.process(e,t)).join("")},r={},function(){for(var e=arguments.length,t=new Array(e),s=0;s<e;s++)t[s]=arguments[s];var o=t.length?t.map((function(e){return null===e?"null":void 0===e?"undefined":"function"==typeof e?e.toString():e instanceof Date?e.toISOString():JSON.stringify(e)})).join("|"):"_(no-args)_";if(Object.prototype.hasOwnProperty.call(r,o))return r[o];var i=n.apply(void 0,t);return r[o]=i,i})),this.locale=t,this.typeHandlers=o}var t,n;return t=e,n=[{key:"process",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!e)return[];var n,s,o=e.indexOf("{");if(-1!==o){var i=u(e,o);if(-1===i)throw new Error('Unbalanced curly braces in string: "'.concat(e,'"'));var a=e.substring(o,i+1);if(a){var c=[],l=e.substring(0,o);l&&c.push(l);var p=(n=d(a),s=3,function(e){if(Array.isArray(e))return e}(n)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,s,o,i,a=[],c=!0,l=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=o.call(n)).done)&&(a.push(r.value),a.length!==t);c=!0);}catch(e){l=!0,s=e}finally{try{if(!c&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(l)throw s}}return a}}(n,s)||function(e,t){if(e){if("string"==typeof e)return r(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(e,t):void 0}}(n,s)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),h=p[0],f=p[1],m=p[2],v=t[h];null==v&&(v="");var g=f&&this.typeHandlers[f];c.push(g?g(v,m,this.locale,t,this.process.bind(this)):v);var y=e.substring(i+1);return y&&c.push(this.process(y,t)),c}}return[e]}}],n&&i(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),e}();function m(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function v(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?m(Object(n),!0).forEach((function(t){a(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):m(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var g=0,y="other";function b(e,t){for(var n=0,r="",s=0,o={};n<e.length;){if("#"!==e[n]||s)r+=e[n];else{var i="__hashToken".concat(g++);r+="{".concat(i,", number}"),o[i]=t}"{"===e[n]?s++:"}"===e[n]&&s--,n++}return{caseBody:r,numberValues:o}}var w="other",x=n(8056),C=n(2328),_=n(8888);const j=(0,_.M3)((({i18n:e})=>e),(({translations:e})=>e)),E=(0,_.M3)((({i18n:e})=>e),(({initialLocale:e})=>e)),S=(0,_.M3)((({i18n:e})=>e),(({userLocale:e})=>e)),T=(0,_.M3)((({i18n:e})=>e),(({isLoading:e})=>e)),k=new f("en-GB",{plural:function(e){var t=arguments.length>2?arguments[2]:void 0,n=arguments.length>3?arguments[3]:void 0,r=arguments.length>4?arguments[4]:void 0,s=l(arguments.length>1&&void 0!==arguments[1]?arguments[1]:""),o=s.args,i=s.cases,a=parseInt(e);o.forEach((function(e){e.startsWith("offset:")&&(a-=parseInt(e.slice(7)))}));var c=[];if("PluralRules"in Intl){void 0!==h&&h.resolvedOptions().locale===t||(h=new Intl.PluralRules(t));var u=h.select(a);u!==y&&c.push(u)}1===a&&c.push("one"),c.push("=".concat(a),y);for(var d=0;d<c.length;d++){var p=c[d];if(p in i){var f=b(i[p],a),m=f.caseBody,g=f.numberValues;return r(m,v(v({},n),g))}}return e},select:function(e){var t=arguments.length>3?arguments[3]:void 0,n=arguments.length>4?arguments[4]:void 0,r=l(arguments.length>1&&void 0!==arguments[1]?arguments[1]:"").cases;return e in r?n(r[e],t):w in r?n(r[w],t):e}});function O(){const e=(0,C.w1)(j),t=(0,C.w1)(S),n=(0,C.w1)(E),r=(0,C.w1)(T);return{t:(0,x.useCallback)(((n,s={})=>{const o=e[n];return o?k.format(o,s):(r||console.warn(`Translation key: ${n} is missing in locale: ${t}`),null)}),[e,t,r]),userLocale:t,initialLocale:n}}},9748:(e,t,n)=>{"use strict";n.d(t,{q:()=>a});var r=n(8056),s=n(2328),o=n(1800),i=n(5768);function a(){const{t:e}=(0,o.g)(),t=(0,s.w1)(i.c),n=(0,s.w1)(i.Y),a=(0,r.useMemo)((()=>{if(!n)return{title:void 0,message:void 0,srText:void 0,buttonText:void 0,originalError:void 0};const{langKey:r,action:s}=t,o=e(`${r}.title`),i=e(`${r}.message`),a=e(`${r}.srText`),c=s?e(`${r}.buttonText`):null;return Object.assign(Object.assign(Object.assign(Object.assign({},r?{title:o,message:i,srText:a}:{}),s?{action:s}:{}),s&&r?{buttonText:c}:{}),{originalError:t})}),[n,t,e]);return{hasError:n,meta:a,error:t}}},5768:(e,t,n)=>{"use strict";n.d(t,{Y:()=>o,c:()=>s});var r=n(8888);const s=(0,r.M3)((({interrupt:e})=>e),(({error:e})=>e)),o=(0,r.M3)(s,(e=>Boolean(e)))},1880:(e,t,n)=>{"use strict";n.d(t,{aI:()=>p,cp:()=>h,yA:()=>d});var r=n(3120),s=n(232),o=n(712),i=n(4528),a=n(7468),c=n(2948);const l={error:void 0},u=(0,r.is)({name:"interrupt",initialState:l,reducers:{setInterrupt:(e,t)=>{e.error=t.payload},clearInterrupt:()=>l},extraReducers:e=>{e.addCase(o.A.pending,(()=>l)).addMatcher((0,r.CF)(s.m.rejected,o.A.rejected,i.K.rejected,c.c.rejected,c.i.rejected,a.m.rejected),((e,{payload:t})=>{e.error=t}))}}),{setInterrupt:d,clearInterrupt:p}=u.actions,h=u.reducer},7468:(e,t,n)=>{"use strict";n.d(t,{m:()=>s});var r=n(3120);const s=(0,r.aw)("getConversation",((e,{extra:{api:t},rejectWithValue:n})=>{return r=void 0,s=void 0,i=function*(){try{return t.getConversation()}catch(e){return n({name:null==e?void 0:e.name,message:null==e?void 0:e.message,langKey:null==e?void 0:e.langKey,action:null==e?void 0:e.action,originalEvent:null==e?void 0:e.originalEvent,originalError:null==e?void 0:e.originalError})}},new((o=void 0)||(o=Promise))((function(e,t){function n(e){try{c(i.next(e))}catch(e){t(e)}}function a(e){try{c(i.throw(e))}catch(e){t(e)}}function c(t){var r;t.done?e(t.value):(r=t.value,r instanceof o?r:new o((function(e){e(r)}))).then(n,a)}c((i=i.apply(r,s||[])).next())}));var r,s,o,i}),{condition(e,{getState:t}){var n;const{state:{events:r}}=t(),s=r[r.length-1],o=null===(n=null==e?void 0:e.lastEvent)||void 0===n?void 0:n.id;return s&&o!==s.payload.id}})},1760:(e,t,n)=>{"use strict";n.d(t,{e:()=>S,A:()=>T});var r=n(8608),s=n(3120),o=n(2328),i=n(428),a=n(7452),c=n(1364),l=n(2620),u=n(232),d=n(712),p=n(4528);const h={translations:{"errors.configError.message":"We are sorry this happened, please retry at a later time.","errors.configError.srText":"A chat configuration error occurred. Our apologies, please retry at a later time.","errors.configError.title":"Chat configuration error.","errors.general.buttonText":"Restart chat","errors.general.message":"Do you want to start a new chat session?","errors.general.srText":"Something went wrong with the chat session. You can restart the chat.","errors.general.title":"Something went wrong","errors.seamlyOffline.message":"There might be a problem with your or our network connection. The chat session should resume as soon the connection is available again.","errors.seamlyOffline.srText":"The chat has connection issues. There might be a problem with your or our network connection. The chat session should resume as soon as the connection is available again.","errors.seamlyOffline.title":"Connection issues","errors.seamlyUnavailable.buttonText":"Try again","errors.seamlyUnavailable.message":"The server could not be reached. Try again in a little while.","errors.seamlyUnavailable.srText":"The chat server could not be reached. Try again in a little while.","errors.seamlyUnavailable.title":"Server unavailable"},isLoading:!1,initialLocale:void 0,userLocale:void 0},f=(0,s.is)({name:"app",initialState:h,reducers:{setInitialLocale:(e,t)=>{e.initialLocale=t.payload},setTranslations:(e,{payload:t})=>{e.translations=t}},extraReducers:e=>{e.addCase(u.C.pending,(()=>h)).addCase(d.A.fulfilled,((e,{payload:t})=>{e.initialLocale=t.defaultUserLocale})).addCase(p.K.pending,(e=>{e.isLoading=!0})).addCase(p.K.rejected,(e=>{e.isLoading=!1})).addCase(p.K.fulfilled,((e,{payload:t})=>{e.isLoading=!1,(null==t?void 0:t.translations)&&(e.userLocale=t.userLocale,e.translations=Object.keys(t.translations).sort().reduce(((e,n)=>Object.assign(Object.assign({},e),{[n]:t.translations[n]})),{}))}))}}),{setInitialLocale:m,setTranslations:v}=f.actions,g=f.reducer;var y=n(2704),b=n(1880);const w=["SeamlyGeneralError","SeamlyConfigurationError","SeamlySessionExpiredError","SeamlyOfflineError","SeamlyUnauthorizedError","SeamlyUnavailableError"];var x=n(3332),C=n(8456);const _=({dispatch:e,getState:t})=>t=>n=>{var r,s,o,i,a,c,l;const h=t(n);return x.Yh.match(n)&&(null===(s=null===(r=n.payload)||void 0===r?void 0:r.translation)||void 0===s?void 0:s.enabled)?(e((0,C._k)(n.payload.translation.locale)),e((0,p.K)(n.payload.translation.locale)),h):d.A.fulfilled.match(n)&&n.payload.defaultUserLocale?(e((0,p.K)(n.payload.defaultUserLocale)),h):u.m.fulfilled.match(n)?(n.payload.userLocale&&e((0,p.K)(n.payload.userLocale)),h):x.Ux.match(n)&&"info"===n.payload.type&&(null===(i=null===(o=n.payload)||void 0===o?void 0:o.payload)||void 0===i?void 0:i.body)&&"subtype"in n.payload.payload.body&&"new_translation"===(null===(l=null===(c=null===(a=n.payload)||void 0===a?void 0:a.payload)||void 0===c?void 0:c.body)||void 0===l?void 0:l.subtype)&&n.payload.payload.body.translationEnabled?(e((0,p.K)(n.payload.payload.body.translationLocale)),h):h};var j=n(1756);const E=(0,r.TL)({state:x.cp,app:i.cp,config:a.cp,i18n:g,translations:C.cp,visibility:j.cp,forms:l.cp,interrupt:b.cp});function S({initialState:e,api:t,eventBus:n,config:r}){const o=(0,s.eS)({reducer:E,preloadedState:e,middleware:e=>e({thunk:{extraArgument:{api:t,eventBus:n,config:r}},serializableCheck:!1}).concat((0,c.U)({api:t}),function({api:e}){return()=>t=>n=>{const{payload:r,type:s}=n;if(s===b.yA.type){if(!w.includes(r.name))throw new y.c(r);"reset"===r.action&&e.disconnect().then((()=>{e.clearStore()}))}return t(n)}}({api:t}),function({api:e}){return()=>t=>n=>{const r=t(n);switch(n.type){case x.IF.toString():e.store.set("options",n.payload);break;case x.eK.toString():e.store.set("options",{...e.store.get("options")||{},[n.payload.option]:n.payload.value})}return r}}({api:t}),_)});return o}const T=o.OY},3332:(e,t,n)=>{"use strict";n.d(t,{A1:()=>I,AH:()=>q,E1:()=>R,ER:()=>Z,I1:()=>C,IF:()=>Q,M5:()=>x,ML:()=>g,Oo:()=>Y,Qb:()=>W,Qr:()=>l,SM:()=>S,UD:()=>V,Ur:()=>_,Ux:()=>v,Yh:()=>P,Yr:()=>H,_8:()=>te,aD:()=>w,ai:()=>$,cB:()=>F,cN:()=>L,cj:()=>k,cp:()=>ne,eK:()=>X,e_:()=>ee,ec:()=>G,gB:()=>j,gz:()=>J,hB:()=>D,kV:()=>y,kl:()=>N,mw:()=>K,nC:()=>O,od:()=>z,op:()=>E,q_:()=>m,uE:()=>B,us:()=>U});var r=n(3120),s=n(232),o=n(712),i=n(1676),a=n(8760),c=n(6244);const l=({type:e,payload:t})=>"hidden"===document.visibilityState||e===c.Iz.message&&!t.fromClient||e===c.Iz.info&&t.type===c.ay.text,u=e=>e.sort((({payload:{occurredAt:e}},{payload:{occurredAt:t}})=>e-t)),d=(e,t)=>{if(!e)return{participants:{},currentAgent:""};const{participants:n}=e||{participants:{}},{id:r,avatar:s,name:o,introduction:i}=t.participant,a=n[r],c=Object.assign(Object.assign({},n),{[r]:a?Object.assign(Object.assign(Object.assign(Object.assign({},a),s?{avatar:s}:{}),o?{name:o}:{}),i?{introduction:i}:{}):t.participant});return Object.assign(Object.assign({},e),{participants:c,currentAgent:e.currentAgent===r||t.fromClient?e.currentAgent:r})},p=(e,t)=>{var n,r;const s="message"===(null==t?void 0:t.type)?(null==t?void 0:t.payload.translatedEntry)||(null==t?void 0:t.payload.entry):{},{blockAutoEntrySwitch:o}=e,i=(null===(n=null==t?void 0:t.payload)||void 0===n?void 0:n.actions)||{},a=(null===(r=null==t?void 0:t.payload)||void 0===r?void 0:r.translatedActions)||{};if(!s)return Object.assign(Object.assign({},e),{optionsOverride:{},actions:i,translatedActions:a});const{type:c,options:l}=s;let u=e.active;return o||c===e.userSelected||(u=c),Object.assign(Object.assign({},e),{active:u,optionsOverride:Object.assign(Object.assign({},e.optionsOverride||{}),c?{[c]:l}:{}),actions:i,translatedActions:a})},h={events:[],isLastEventFromClient:!1,initialState:{userResponded:!1},unreadEvents:0,userHasResponded:!1,loadedImageEventIds:[],isLoading:!1,idleDetachCountdown:{hasCountdown:!1,isActive:!1,remaining:void 0,wasStopped:void 0,count:void 0,timer:void 0},resumeConversationPrompt:!1,serviceInfo:{activeServiceSessionId:"",proactiveMessages:!1},participantInfo:{participants:{},currentAgent:""},headerTitles:{title:null,subTitle:""},historyLoaded:!1,skiplinkTargetId:(0,i.s)(),optionsButtonId:(0,i.s)(),headerCollapseButtonId:(0,i.s)(),serviceData:{},options:{features:{webNotifications:{enabled:!1}},panelActive:!1,optionActive:"",userSelectedOptions:{}},showFileUpload:!1,currentUploads:[],processingFileUploads:[],entryMeta:{default:c.uG.text,active:c.uG.text,userSelected:null,blockAutoEntrySwitch:!1,options:{},optionsOverride:{},actions:{},translatedActions:{}},seamlyContainerElement:null},f=(0,r.is)({name:"store",initialState:h,reducers:{addEvent:(e,t)=>{var n,r;const{type:s,payload:o}=t.payload,a=e.options.features.hasOwnProperty(c.gn.uploads);let u=Object.assign({},e.options);if(a&&(s===c.Iz.message||s===c.Iz.participant)&&!o.fromClient){const e="message"===s?null===(n=o.entry)||void 0===n?void 0:n.type:{};u=Object.assign(Object.assign({},u),{features:Object.assign(Object.assign({},u.features),{uploads:Object.assign(Object.assign({},null===(r=u.features)||void 0===r?void 0:r.uploads),{enabledFromEntry:e===c.uG.upload})})})}const d=l(t.payload);if(e.events.find((e=>e.payload.id===o.id)))return;const h=p(e.entryMeta,t.payload);e.entryMeta=a||h.active!==c.uG.upload?h:Object.assign({},e.entryMeta),e.options=u,d&&(e.unreadEvents+=1,"service_data"!==s&&(t.payload.payload.messageStatus=o.fromClient?c.eg.read:c.eg.received)),t.payload.payload.key=(0,i.s)(),e.events.push(t.payload),e.isLastEventFromClient=o.fromClient},ackEvent:(e,{payload:{payload:t}})=>{if(!t.transactionId)return void console.warn("ACK received without transaction ID.");const n=e.events.find((e=>e.payload.transactionId===t.transactionId&&(!t.type||e.type===t.type))),{id:r,occurredAt:s}=t;n&&(n.payload.id=r,n.payload.occurredAt=s,e.events=u(e.events))},clearEvents:e=>{e.unreadEvents=0,e.loadedImageEventIds=[],e.events=[]},setEventsRead:(e,{payload:t})=>{e.unreadEvents=0,e.events.forEach((e=>(-1!==t.indexOf(e.payload.id)&&(e.payload=Object.assign(Object.assign({},e.payload),"service_data"!==e.type&&e.payload.messageStatus===c.eg.received&&{messageStatus:c.eg.read})),e)))},setLoadedImageEventIds:(e,{payload:t})=>{e.loadedImageEventIds.push(t)},setHistory:(e,{payload:{events:t,participants:n,activeServiceSessionId:r,activeServiceSettings:s={},serviceData:o,resumeConversationPrompt:i}})=>{var a,l,h;const f=((e,t)=>{const n=e.filter((e=>"message"===e.type&&!e.payload.optimisticallyInjected&&!t.some((t=>t.payload.id===e.payload.id)))),r=t.filter((e=>!("participant"===e.type&&!e.payload.participant.introduction))).reverse();return u([...r,...n])})(e.events,t),m=Object.assign(Object.assign({},e.participantInfo.participants),n),v=f.slice().reverse().find((e=>("message"===e.type||"participant"===e.type)&&!e.payload.fromClient));let g=null;v&&("message"===v.type&&(g=v.payload.participant),"participant"===v.type&&(g=v.payload.participant.id));const{entry:y}=s,b=null===(a=null==y?void 0:y.options)||void 0===a?void 0:a.upload,w=p(Object.assign(Object.assign(Object.assign({},e.entryMeta),y),{active:(null==y?void 0:y.default)||c.ay.text,options:Object.assign({},(null==y?void 0:y.options)?y.options:{})}),f[f.length-1]);let x=Object.assign({},e.options.features);const C=x.hasOwnProperty(c.gn.uploads);if(C&&"message"===(null==v?void 0:v.type)){const{payload:e}=v,t=(null===(l=null==e?void 0:e.entry)||void 0===l?void 0:l.type)||{};x=Object.assign(Object.assign({},x),{uploads:{enabled:!(!b||!(null==b?void 0:b.enabled)),enabledFromEntry:t===c.uG.upload}})}e.unreadEvents=f.filter((e=>"message"===e.type&&e.payload.messageStatus===c.eg.received)).length,e.events=f.filter((e=>"participant"!==e.type||!!e.payload.participant.introduction)),e.participantInfo=Object.assign(Object.assign(Object.assign({},e.participantInfo),g?d(e.participantInfo,{participant:m[g]}):{}),{participants:m}),e.historyLoaded=!0,e.serviceInfo=Object.assign(Object.assign({},e.serviceInfo),{activeServiceSessionId:r,proactiveMessages:(null===(h=null==s?void 0:s.proactiveMessages)||void 0===h?void 0:h.enabled)||!1}),e.serviceData=Object.assign(Object.assign({},e.serviceData),o),e.options=Object.assign(Object.assign({},e.options),{features:x}),e.entryMeta=C||w.active!==c.uG.upload?w:Object.assign({},e.entryMeta),e.resumeConversationPrompt=i||!1,g&&(e.headerTitles.subTitle=m[g].name)},resetHistoryLoadedFlag:e=>{e.historyLoaded=!1},setIsLoading:(e,{payload:t})=>{e.isLoading=t},initIdleDetachCountdown:(e,{payload:t})=>{const{delaySeconds:n,delayTime:r}=t;e.idleDetachCountdown={hasCountdown:!0,isActive:!0,wasStopped:!1,count:n,remaining:n,timer:r}},decrementIdleDetachCountdownCounter:e=>{const{idleDetachCountdown:t}=e,{remaining:n}=t,r=n-1;e.idleDetachCountdown.remaining=r,e.idleDetachCountdown.timer=(0,a.s3)(r)},stopIdleDetachCountdownCounter:e=>{e.idleDetachCountdown.isActive=!1,e.idleDetachCountdown.wasStopped=!0},clearIdleDetachCountdown:e=>{e.idleDetachCountdown.hasCountdown=!1,e.idleDetachCountdown.isActive=!1},initResumeConversationPrompt:e=>{e.resumeConversationPrompt=!0},clearResumeConversationPrompt:e=>{e.resumeConversationPrompt=!1},setParticipant:(e,{payload:t})=>{e.participantInfo=d(e.participantInfo,{participant:t.participant,fromClient:t.fromClient})},setActiveService:(e,{payload:t})=>{e.serviceInfo.activeServiceSessionId!==t&&(e.serviceInfo.activeServiceSessionId=t)},setHeaderTitle:(e,{payload:t})=>{e.headerTitles.title=t},setHeaderSubTitle:(e,{payload:t})=>{e.headerTitles.subTitle=t},setInitialState:(e,{payload:t})=>{e.initialState=t,e.unreadEvents=h.unreadEvents},setServiceDataItem:(e,{payload:t})=>{e.serviceData[t.type]=t},setFeatures:(e,{payload:t})=>{t.features&&(e.options.features=t.features)},setFeatureEnabledState:(e,{payload:t})=>{e.options.features.hasOwnProperty(t.key)&&(e.options.features[t.key].enabled=t.enabled)},clearFeatures:e=>{e.options.features={webNotifications:e.options.features.webNotifications}},showOption:(e,{payload:t})=>{e.options.panelActive=!0,e.options.optionActive=t},hideOption:e=>{e.options.panelActive=!1,e.options.optionActive=""},setUserSelectedOptions:(e,{payload:t})=>{e.options.userSelectedOptions=t},setUserSelectedOption:(e,{payload:t})=>{const{option:n,value:r}=t;e.options.userSelectedOptions[n]=r},setBlockAutoEntrySwitch:(e,{payload:t})=>{e.entryMeta.blockAutoEntrySwitch=t},setServiceEntryMetadata:(e,{payload:t})=>{e.entryMeta.active=t.default,e.entryMeta.options=t.options||{},e.entryMeta.optionsOverride={},e.entryMeta.actions={},e.entryMeta.translatedActions={}},setActiveEntryType:(e,{payload:t})=>{e.entryMeta.active=t},setUserEntryType:(e,{payload:t})=>{e.entryMeta.userSelected=t},clearAbortTransaction:e=>{e.entryMeta.actions={},e.entryMeta.translatedActions={}},registerUpload:(e,{payload:t})=>{e.currentUploads.push({id:t.fileId,name:t.fileName,progress:1,uploading:!0,complete:!1,error:"",uploadHandle:t.uploadHandle})},setUploadProgress:(e,{payload:t})=>{e.currentUploads=e.currentUploads.map((e=>e.id===t.fileId?Object.assign(Object.assign({},e),{progress:t.progress,uploading:100!==t.progress,uploadHandle:100===t.progress?null:e.uploadHandle}):e))},startProcessingImage:(e,{payload:t})=>{e.processingFileUploads.push(t)},doneProcessingImage:(e,{payload:t})=>{e.processingFileUploads=e.processingFileUploads.filter((e=>e!==t))},setUploadError:(e,{payload:t})=>{e.currentUploads=e.currentUploads.map((e=>e.id===t.fileId?Object.assign(Object.assign({},e),{error:t.errorText,progress:0,uploading:!1,uploadHandle:null}):e))},setUploadComplete:(e,{payload:t})=>{e.currentUploads=e.currentUploads.map((e=>e.id===t?Object.assign(Object.assign({},e),{complete:!0}):e))},clearAllUploads:e=>{e.currentUploads=[]},setSeamlyContainerElement:(e,{payload:t})=>{e.seamlyContainerElement=t},setProactiveMessages:(e,{payload:t})=>{e.serviceInfo.proactiveMessages=t}},extraReducers:e=>{e.addCase(s.C.pending,(()=>h)).addCase(s.m.pending,(e=>{e.isLoading=!0})).addCase(o.A.fulfilled,((e,{payload:t})=>{var n;e.headerTitles.subTitle=null===(n=t.agentParticipant)||void 0===n?void 0:n.name,t.features&&(e.options.features=t.features)})).addCase(s.m.fulfilled,((e,{payload:t})=>{e.isLoading=!1,t.initialState&&(e.initialState=t.initialState)})).addMatcher((0,r.CF)(j,E),(e=>{e.isLastEventFromClient=!1}))}}),{ackEvent:m,addEvent:v,clearAllUploads:g,clearEvents:y,clearFeatures:b,clearIdleDetachCountdown:w,clearResumeConversationPrompt:x,decrementIdleDetachCountdownCounter:C,hideOption:_,initIdleDetachCountdown:j,initResumeConversationPrompt:E,registerUpload:S,resetHistoryLoadedFlag:T,setActiveEntryType:k,setActiveService:O,setBlockAutoEntrySwitch:N,setEventsRead:I,setFeatureEnabledState:U,setFeatures:A,setHeaderSubTitle:R,setHeaderTitle:M,setHistory:P,setInitialState:L,setIsLoading:D,setLoadedImageEventIds:F,setParticipant:B,setSeamlyContainerElement:z,setServiceDataItem:$,setServiceEntryMetadata:V,clearAbortTransaction:H,setUploadComplete:K,setUploadError:W,setUploadProgress:q,startProcessingImage:G,doneProcessingImage:Y,setUserEntryType:J,setUserSelectedOption:X,setUserSelectedOptions:Q,showOption:Z,stopIdleDetachCountdownCounter:ee,setProactiveMessages:te}=f.actions,ne=f.reducer},7456:(e,t,n)=>{"use strict";n.d(t,{EI:()=>v,kx:()=>f,ol:()=>g,A1:()=>h,im:()=>m});var r=n(8056),s=n(2328),o=n(5352),i=n(1800),a=n(8888);const c=e=>(0,a.M3)((e=>e.translations.translatedEventGroups),(t=>Object.values(t).every((t=>{var n;return!t.includes(null===(n=null==e?void 0:e.payload)||void 0===n?void 0:n.id)}))));var l=n(8456),u=n(8632),d=n(6204),p=n(6244);function h(){const{sendContext:e}=(0,d.wv)(),t=(0,s.OY)(),n=(0,o.EV)(),i=(0,r.useCallback)((t=>{e({userLocale:t})}),[e]),a=(0,r.useCallback)((()=>{e({userLocale:n.context.contentLocale}),t((0,l.If)())}),[n.context,t,e]),{languages:c,isActive:u,isAvailable:p,currentLocale:h}=(0,s.w1)((({translations:e})=>e));return{languages:c,isActive:u,isAvailable:p,currentLocale:h,enableTranslations:i,disableTranslations:a}}function f(e){const{translatedBody:t,translation:n,body:r}=(null==e?void 0:e.payload)?"participant"===e.type?{body:null===(o=e.payload)||void 0===o?void 0:o.participant.introduction,translatedBody:null===(a=null===(i=e.payload)||void 0===i?void 0:i.participant)||void 0===a?void 0:a.translatedIntroduction,translation:null===(u=null===(l=e.payload)||void 0===l?void 0:l.participant)||void 0===u?void 0:u.translation}:{body:e.payload.body,translatedBody:e.payload.translatedBody,translation:null===(d=null==e?void 0:e.payload)||void 0===d?void 0:d.translation}:{body:void 0,translatedBody:void 0};var o,i,a,l,u,d;const p=!!t,h=(0,s.w1)(c(e));return{body:p&&h?t:r,hasTranslation:p,isTranslated:h&&p,locale:null==n?void 0:n.locale}}function m(){const e=(0,s.w1)((({translations:e})=>e.containerId));return{id:e,focusContainer:(0,d.kX)(e)}}function v(e){const{languages:t}=h();return(0,r.useMemo)((()=>{var n;return null===(n=null==t?void 0:t.find((t=>t.locale===e)))||void 0===n?void 0:n.nativeName}),[e,t])}const g=()=>{const{isActive:e,languages:t}=h(),n=(0,s.OY)(),{sendAction:o}=(0,d.wv)(),{translationProposal:a}=(0,s.w1)((e=>e.translations)),{enableTranslations:c}=h(),{isOpen:f}=(0,u.uu)(),{userLocale:m}=(0,i.g)(),g=null==a?void 0:a.proposedLocale,y=v(g),b=(0,r.useMemo)((()=>null!==a&&!e&&f&&m!==g&&t.some((e=>e.locale===g))),[a,e,f,m,g,t]);return{activateTranslationProposal:()=>{c(null==a?void 0:a.proposedLocale)},dismissTranslationProposal:()=>{o({type:p.w$.dismiss,body:{type:p.wb}}),n((0,l.yE)())},proposedLocale:g,proposedLocaleNativeName:y,showProposal:b,translationProposal:a}}},8456:(e,t,n)=>{"use strict";n.d(t,{If:()=>p,Mt:()=>f,_k:()=>d,cp:()=>g,kx:()=>m,wr:()=>h,yE:()=>v});var r=n(3120),s=n(232),o=n(712),i=n(4528),a=n(3332);const c={isActive:!1,currentLocale:void 0,isAvailable:!1,languages:[],containerId:(0,r.i0)(),translatedEventGroups:{},translationProposal:null},l=(e,t)=>{const n=[...e].reduce(((e,{payload:n},r,s)=>{var o;if(e[t]){if("divider"===(null==n?void 0:n.type)&&(null===(o=null==n?void 0:n.body)||void 0===o?void 0:o.translationEnabled))return s.splice(0),e;e[t].push(n.id)}return n.id===t&&(e[t]=[]),e}),{}),[[r,s]]=Object.entries(n);return{lastGroupId:e.filter((e=>{var t;return"divider"===(null===(t=e.payload)||void 0===t?void 0:t.type)})).map((e=>e.payload.id)).at(-1),groupId:r,eventIds:s}},u=(0,r.is)({name:"translation",initialState:c,reducers:{enableTranslation:(e,{payload:t})=>{e.isActive=!0,e.currentLocale=t},disableTranslation:e=>{e.isActive=!1,e.currentLocale=void 0},enableEventsTranslation:(e,{payload:{events:t,id:n}})=>{delete e.translatedEventGroups[n];const{lastGroupId:r}=l(t,n);e.lastGroupId=r},disableEventsTranslation:(e,{payload:{events:t,id:n}})=>{const{lastGroupId:r,groupId:s,eventIds:o}=l(t,n);e.lastGroupId=r,e.translatedEventGroups[s]=o},disableTranslationProposalPrompt:e=>{e.translationProposal=null},setTranslationProposalPrompt:(e,{payload:t})=>{e.translationProposal=t}},extraReducers:e=>{e.addCase(s.C.pending,(()=>c)).addCase(o.A.fulfilled,((e,{payload:t})=>{var n;const r=null===(n=null==t?void 0:t.features)||void 0===n?void 0:n.translation;r&&(e.isAvailable=!0===r.enabled,e.languages=[...r.languages].sort(((e,n)=>e.locale===t.defaultUserLocale?-1:n.locale===t.defaultUserLocale?1:e.nativeName.localeCompare(n.nativeName,void 0,{sensitivity:"base"}))))})).addCase(a.Yh,((e,{payload:t})=>{e.translationProposal=t.translationProposal})).addCase(i.K.fulfilled,((e,{payload:t})=>{e.currentLocale=t.userLocale})).addCase(a.Ux,((e,{payload:t})=>{e.translatedEventGroups[e.lastGroupId]&&e.translatedEventGroups[e.lastGroupId].push(t.payload.id)}))}}),{enableTranslation:d,disableTranslation:p,enableEventsTranslation:h,disableEventsTranslation:f,setTranslationProposalPrompt:m,disableTranslationProposalPrompt:v}=u.actions,g=u.reducer},2948:(e,t,n)=>{"use strict";n.d(t,{c:()=>d,i:()=>p});var r=n(3120),s=n(1060),o=n(5368),i=n(3576),a=n(6736),c=n(8536),l=n(5376);const u=[c.I.open,c.I.minimized,c.I.hidden],d=(0,r.aw)("setVisibility",((e,{getState:t,extra:{api:n,eventBus:r}})=>{const d=t(),p=l._(d),h=(0,s.E)(d),f=n.hasConversation(),m=o.g(d),{visibilityCallback:v=i.g,layoutMode:g}=m,{unreadEvents:y}=(0,a.cV)(d),b=v({hasResponded:h,previousVisibility:p,requestedVisibility:e,config:m});if(!u.includes(b))return void console.error('The visibilityCallback function should return "open", "minimized" or "hidden".');if(p===b)return;const w=n.store.get(c.M);return n.store.set(c.M,Object.assign(Object.assign({},w||{}),{[g]:e})),e&&r.emit("ui.visible",e,{visibility:e,hasConversation:f,hasResponded:h,unreadMessageCount:y}),b})),p=(0,r.aw)("initialize",((e,{dispatch:t,getState:n,extra:{api:r}})=>{return s=void 0,i=void 0,l=function*(){var e;const{layoutMode:s}=o.g(n()),i=(null===(e=r.store.get(c.M))||void 0===e?void 0:e[s])||c.I.initialize;return t(d(i)),i},new((a=void 0)||(a=Promise))((function(e,t){function n(e){try{o(l.next(e))}catch(e){t(e)}}function r(e){try{o(l.throw(e))}catch(e){t(e)}}function o(t){var s;t.done?e(t.value):(s=t.value,s instanceof a?s:new a((function(e){e(s)}))).then(n,r)}o((l=l.apply(s,i||[])).next())}));var s,i,a,l}))},8536:(e,t,n)=>{"use strict";n.d(t,{I:()=>s,M:()=>r});const r="visibility",s={hidden:"hidden",minimized:"minimized",open:"open",initialize:null}},8632:(e,t,n)=>{"use strict";n.d(t,{ae:()=>f,mo:()=>h,uu:()=>p});var r=n(9150),s=n(8056),o=n(2328),i=n(5352),a=n(1760),c=n(2948),l=n(1756),u=n(8536),d=n(5376);const p=()=>{const e=(0,a.A)(),t=(0,o.w1)(d._),n=!!t&&t!==u.I.hidden,r=t===u.I.open,i=t===u.I.minimized,l=(0,s.useCallback)((t=>e((0,c.c)(t))),[e]);return{isVisible:n,isOpen:r,isMinimized:i,visible:t,setVisibility:l,openChat:()=>{l(u.I.open)},closeChat:()=>{l(u.I.minimized)}}},h=({freezeOnceVisible:e=!1,enabled:t=!0,containerRef:n=(0,r.createRef)()})=>{const[o,i]=(0,s.useState)(null),a=!!(null==o?void 0:o.isIntersecting)||!t,c=a&&e,l=([e])=>i(e);return(0,s.useEffect)((()=>{const e=null==n?void 0:n.current;if(!window.IntersectionObserver||c||!e||!t)return()=>{};const r=new IntersectionObserver(l,{threshold:0,root:null,rootMargin:"0%"});return r.observe(e),()=>r.disconnect()}),[n,t,c]),{isVisible:a,containerRef:n}},f=()=>{const e=(0,o.OY)(),{connectWhenInView:t}=(0,i.EV)(),n=(0,o.w1)(d.e),{containerRef:r,isVisible:a}=h({enabled:t,freezeOnceVisible:!0});return(0,s.useEffect)((()=>{a&&e((0,l.g9)())}),[e,a]),{containerRef:r,showInlineView:n}}},5376:(e,t,n)=>{"use strict";n.d(t,{_:()=>s,e:()=>o});var r=n(8888);const s=(0,r.M3)((({visibility:e})=>e),(e=>e.visibility)),o=(0,r.M3)((({visibility:e})=>e),(e=>e.showInlineView))},1756:(e,t,n)=>{"use strict";n.d(t,{cp:()=>l,g9:()=>c});var r=n(3120),s=n(712),o=n(2948);const i={visibility:n(8536).I.initialize,showInlineView:!1},a=(0,r.is)({name:"visibility",initialState:i,reducers:{setShowInlineView:e=>{e.showInlineView=!0}},extraReducers:e=>{e.addCase(o.c.fulfilled,((e,{payload:t})=>{t&&(e.visibility=t)})).addCase(s.A.fulfilled,((e,{payload:t})=>{t.connectWhenInView||(e.showInlineView=!t.connectWhenInView)}))}}),{setShowInlineView:c}=a.actions,l=a.reducer},5308:(e,t,n)=>{"use strict";n.d(t,{E:()=>o,c:()=>s});var r=n(9150);const s=(0,r.createContext)(null),o=(0,r.createContext)(null)},9320:(e,t,n)=>{"use strict";n.d(t,{Ml:()=>o,Y5:()=>a,aJ:()=>c,cb:()=>i});var r=n(8056),s=n(5308);const o=()=>(0,r.useContext)(s.c),i=()=>o().store,a=()=>{const{get:e}=i();return e?e("conversationUrl"):null},c=()=>{const e=o();return(0,r.useCallback)((()=>e.hasConversation()),[e])}},6736:(e,t,n)=>{"use strict";n.d(t,{Ce:()=>j,E1:()=>y,GW:()=>p,I7:()=>m,Ip:()=>b,Ir:()=>C,KC:()=>_,OK:()=>g,SS:()=>x,cV:()=>l,gf:()=>u,kV:()=>h,qo:()=>E,sJ:()=>f,w1:()=>v,y2:()=>S});var r=n(8888),s=n(2328),o=n(1060),i=n(5352),a=n(5368),c=n(8760);const l=({state:e})=>e,u=()=>(0,s.w1)(l),d=(0,r.M3)(l,a.g,o.E,(({events:e,serviceData:t},n,r)=>{var s;if(r||"inline"===n.layoutMode||!(null==t?void 0:t.suggestion)||!(null===(s=null==t?void 0:t.suggestion)||void 0===s?void 0:s.body.length))return e;const o={type:"service_data",payload:t.suggestion};return[...e,o]})),p=(0,r.M3)(d,a.g,((e,t)=>{var n,r;const{enabled:s,threshold:o}=null!==(r=null===(n=null==t?void 0:t.messages)||void 0===n?void 0:n.timeIndicator)&&void 0!==r?r:{};if(!s)return e;const i=[];let a=null;return e.forEach(((e,t)=>{if(0===t)i.push(Object.assign(Object.assign({},e),{timeIndicator:e.payload.occurredAt}));else{const t=a&&(0,c.Qv)(e.payload.occurredAt-a.payload.occurredAt)>=o?e.payload.occurredAt:void 0;i.push(Object.assign(Object.assign({},e),{timeIndicator:t}))}a=e})),i})),h=()=>(0,s.w1)(p),f=((0,r.M3)(p,(e=>e.map((e=>e.payload.id)))),()=>u().isLoading),m=()=>u().unreadEvents,v=()=>u().loadedImageEventIds,g=()=>u().skiplinkTargetId,y=e=>u().participantInfo.participants[e],b=()=>u().serviceInfo,w=(0,r.M3)(p,(e=>{var t;const n=e.filter((e=>"message"===e.type));return null===(t=n[n.length-1])||void 0===t?void 0:t.payload.id})),x=()=>(0,s.w1)(w),C=()=>u().historyLoaded,_=()=>{const{participants:e,currentAgent:t}=u().participantInfo;return t?e[t]:null},j=e=>u().serviceData[e],E=()=>{const{entryMeta:{options:{text:e},optionsOverride:{text:t}}}=u(),{limit:n}=t||e||{limit:null};return{hasLimit:null!==n,limit:null!==n?n:null}},S=()=>{const{layoutMode:e}=(0,i.EV)();return{isInline:"inline"===e,isWindow:"window"===e,isApp:"app"===e,isResolving:!e}}},3460:(e,t,n)=>{"use strict";n.d(t,{c:()=>m});var r=n(8056),s=n(2328),o=n(1800),i=n(8632),a=n(8416),c=n(5376),l=n(8384),u=n(6736),d=n(2704),p=n(9748),h=n(1880),f=n(1760);const m=()=>{const{t:e}=(0,o.g)(),{isInline:t,isWindow:n,isApp:m}=(0,u.y2)(),{isOpen:v,isVisible:g}=(0,i.uu)(),y=(0,s.w1)(c.e),{start:b,connect:w,apiConfigReady:x,apiConnected:C}=(0,a.c)(),_=(0,r.useRef)(!1),{sendAssertive:j}=(0,l.C)();!function(){const{meta:{originalError:e,action:t}}=(0,p.q)(),n=(0,f.A)(),{reset:s}=(0,a.c)(),o="SeamlySessionExpiredError"===(null==e?void 0:e.name),i=(0,r.useRef)(0),c=(0,r.useRef)(null);(0,r.useEffect)((()=>{if(o&&"reset"===t){if(i.current>=10){c.current=setTimeout((()=>{i.current=0}),1e4);const e=new d.c;return n((0,h.yA)({name:e.name,message:e.message,langKey:e.langKey,originalEvent:e.originalEvent,originalError:e.originalError,action:e.action})),()=>{}}i.current+=1,s()}return()=>{c.current&&clearTimeout(c.current)}}),[t,s,o,n])}(),(0,r.useEffect)((()=>{g&&setTimeout((()=>{j(e("window.srTexts.onLoad"))}),500)}),[g,j,e]),(0,r.useEffect)((()=>{g&&j(e(v?"window.srTexts.onOpen":"window.srTexts.onClose"))}),[v,g,j,e]),(0,r.useEffect)((()=>{x&&C||(_.current=!1)}),[x,C]);const E=(0,r.useCallback)((()=>{return e=void 0,n=void 0,s=function*(){C||(_.current=!0,yield w()),(m||v||g&&t)&&b()},new((r=void 0)||(r=Promise))((function(t,o){function i(e){try{c(s.next(e))}catch(e){o(e)}}function a(e){try{c(s.throw(e))}catch(e){o(e)}}function c(e){var n;e.done?t(e.value):(n=e.value,n instanceof r?n:new r((function(e){e(n)}))).then(i,a)}c((s=s.apply(e,n||[])).next())}));var e,n,r,s}),[C,w,m,t,v,g,b]);(0,r.useEffect)((()=>{!x||_.current||n&&!v||!(!t||g&&y)||E()}),[x,E,t,v,g,n,y])}},9816:(e,t,n)=>{"use strict";n.d(t,{c:()=>i});var r=n(1864),s=n(8412),o=n(9320);const i=()=>{const e=(0,o.Ml)();return(0,r.useSyncExternalStore)(s.c.subscribe,(()=>e.conversation))}},6244:(e,t,n)=>{"use strict";n.d(t,{Iz:()=>r,MJ:()=>p,Qv:()=>f,ay:()=>s,eg:()=>i,gn:()=>h,ic:()=>l,kD:()=>d,mS:()=>u,uG:()=>o,w$:()=>a,wb:()=>c});const r={info:"info",message:"message",participant:"participant",system:"system"},s={choicePrompt:"choice_prompt",text:"text",image:"image",video:"video",participant:"participant",divider:"divider",translation:"translation",message:"message",countdown:"countdown",upload:"upload",cta:"cta",splash:"splash"},o={text:"text",upload:"upload"},i={received:"received",read:"read"},a={pickChoice:"pick_choice",navigate:"navigate",custom:"custom",typing:"typing",read:"read",detachService:"detach_service",interactivityUpdate:"interactivity_update",dismiss:"dismiss",sendTranscript:"send_transcript",setTopic:"set_topic",setTranslation:"set_translation",setContext:"set_context",clickCta:"click_cta",clickCard:"click_card"},c="translation_proposal",l={resumeConversationPrompt:"resume_conversation_prompt",translationProposal:c},u={translationProposal:c,translationChoice:"translation_choice",windowApi:"window_api"},d={assertive:"assertive",polite:"polite"},p={new_topic:"newTopic",new_translation:"newTranslation"},h={sendTranscript:"sendTranscript",typingPeekahead:"typingPeekahead",uploads:"uploads"},f={ask:"ask",navigate:"navigate",topic:"topic"}},2309:(e,t,n)=>{"use strict";n.d(t,{c:()=>r});class r extends Error{action="";langKey="";constructor(e,...t){if(super(...t),Error.captureStackTrace&&Error.captureStackTrace(this,Object.getPrototypeOf(this)),this.originalError=e,e?.payload&&(this.originalEvent=e,this.originalError=e.payload.error,this.message=`Event of type ${e.payload.type} encountered`),!this.message&&e?.message){const t=function(e){try{return JSON.parse(e).error}catch(t){return e}}(e.message);this.message=t}e?.error&&(this.originalError=e.error)}}},3872:(e,t,n)=>{"use strict";n.d(t,{c:()=>s});var r=n(2309);class s extends r.c{constructor(e,...t){super(e,...t),this.name="SeamlyConfigurationError",this.langKey="errors.configError"}}},2704:(e,t,n)=>{"use strict";n.d(t,{c:()=>s});var r=n(2309);class s extends r.c{constructor(e,...t){super(e,...t),this.name="SeamlyGeneralError",this.langKey="errors.general",this.action="reset"}}},8132:(e,t,n)=>{"use strict";n.d(t,{c:()=>s});var r=n(2309);class s extends r.c{constructor(e,...t){super(e,...t),this.name="SeamlyOfflineError",this.langKey="errors.seamlyOffline"}}},6232:(e,t,n)=>{"use strict";n.d(t,{c:()=>s});var r=n(2309);class s extends r.c{constructor(e,...t){super(e,...t),this.name="SeamlySessionExpiredError",this.action="reset"}}},1120:(e,t,n)=>{"use strict";n.d(t,{c:()=>s});var r=n(2309);class s extends r.c{constructor(e,...t){super(e,...t),this.name="SeamlyUnauthorizedError",this.langKey="errors.general",this.action="reset"}}},6280:(e,t,n)=>{"use strict";n.d(t,{c:()=>s});var r=n(2309);class s extends r.c{constructor(e,...t){super(e,...t),this.name="SeamlyUnavailableError",this.langKey="errors.seamlyUnavailable"}}},1888:(e,t,n)=>{"use strict";n.d(t,{w:()=>o});var r=n(2328),s=n(1060);const o=()=>(0,r.w1)(s.E)},3576:(e,t,n)=>{"use strict";n.d(t,{g:()=>s});var r=n(8536);const s=({hasResponded:e,previousVisibility:t,requestedVisibility:n,config:s})=>{const{defaults:o,layoutMode:i,hideOnNoUserResponse:a}=s,{visible:c}=o||{};if("app"===i&&!t)return r.I.open;if("window"===i&&a&&n!==r.I.open)return e?n||t||r.I.open:r.I.hidden;if("inline"===i&&e&&!n)return t||r.I.open;const l=r.I.minimized;return n||t||c||l}},8544:(e,t,n)=>{"use strict";n.d(t,{U:()=>s});var r=n(7548);const s=(...e)=>e.flat().map((e=>"object"==typeof e?Object.entries(e).map((([e,t])=>t?e:"")).join(" "):e)).filter((e=>"string"==typeof e)).map((e=>e.split(" "))).flat().filter((e=>e.length)).map((e=>e.indexOf(r.wm)>-1?e:[r.wm,e].join("-"))).join(" ")},5576:e=>{e.exports=()=>()=>null},1676:(e,t,n)=>{"use strict";function r(){return`_${(Number(String(Math.random()).slice(2))+Date.now()+Math.round(performance.now())).toString(36)}`}n.d(t,{s:()=>r})},5968:(e,t,n)=>{"use strict";n.d(t,{c:()=>r});const r=e=>{const t=e.indexOf("?");return t<0?{url:e,params:{}}:{url:e.slice(0,t),params:e.slice(t+1).split("&").reduce((function(e,t){const[n,r]=t.split("=");return{...e,[n]:decodeURIComponent(r)}}),{})}}},92:(e,t,n)=>{"use strict";n.d(t,{useI18n:()=>r.g,useTranslatedEventData:()=>s.kx});var r=n(1800),s=n(7456);n(2080),n(6204),n(6736),n(3460),n(8416),n(1100)},2080:(e,t,n)=>{"use strict";n.d(t,{c:()=>f});var r=n(9150),s=n(8056),o=n(1800),i=n(7456),a=n(8544),c=n(1676),l=n(7800),u=n(7888),d=n(6204),p=n(6244),h=n(784);const f=({event:e,children:t,...n})=>{const{t:f}=(0,o.g)(),m=(0,d.k3)(),{body:v,subEvent:g,showOptions:y,chooseAgain:b,onChoiceClickHandler:w,onChooseAgainClickHandler:x}=(e=>{const{payload:t}=e,[n,r]=(0,s.useState)(!1),{sendAction:o,addMessageBubble:a,addDivider:l}=(0,d.wv)(),{activeServiceSessionId:u}=(0,d.Ip)(),h=(0,d.SS)(),{body:f}=(0,i.kx)(e),{service:m}=t,v=(0,s.useMemo)((()=>({...e,payload:{...e.payload,body:e.payload.body?.prompt,translatedBody:e.payload.translatedBody&&{...e.payload.translatedBody,data:e.payload.translatedBody.prompt}}})),[e]),g=f.chooseAgain&&u===m.serviceSessionId&&t.id!==h;return(0,s.useEffect)((()=>{r(t.id===h)}),[t,h]),{body:f,subEvent:v,showOptions:n,chooseAgain:g,onChoiceClickHandler:e=>{const n=(0,c.s)();g&&l("new_topic",n),a(e.text,n),o({type:p.w$.pickChoice,originMessage:t.id,choice:{id:e.id,text:e.text,chooseAgain:g},transactionId:n}),r(!1)},onChooseAgainClickHandler:()=>{r((e=>!e))}}})(e);return(0,h.jsxs)(h.Fragment,{children:[(0,r.toChildArray)(t).map((e=>(e.props={...e.props,event:g,descriptorId:m,showTranslationToggle:!1},e))),b&&(0,h.jsxs)("button",{type:"button",className:(0,a.U)("button","button--secondary","button--choose-again"),"aria-expanded":y?"true":"false",onClick:x,"aria-describedby":m,children:[f(y?"message.choicePrompts.cancelChooseAgain":"message.choicePrompts.chooseAgain"),(0,h.jsx)(u.c,{name:"chevronDown",size:"8",alt:""})]}),y&&(0,h.jsx)(l.c,{type:"choice-prompt",showParticipant:!1,event:e,...n,children:(0,h.jsx)("ul",{className:(0,a.U)("choice-prompt","choice-prompt--many"),children:v.choices.map((e=>(0,h.jsx)("li",{className:(0,a.U)("choice-prompt__item",{[`choice-prompt__item--${e.category}`]:e.category}),children:(0,h.jsx)("button",{type:"button",className:(0,a.U)("button","button--primary"),onClick:()=>{w(e)},children:e.text})},e.id)))})})]})}},3792:(e,t,n)=>{"use strict";n.d(t,{c:()=>c});var r=n(5352),s=n(1800),o=n(8544),i=n(6204),a=n(784);const c=({eventPayload:e})=>{const{t}=(0,s.g)(),{fromClient:n,participant:c}=e,l=(0,i.E1)(c)||{},{messages:u}=(0,r.EV)(),d=n?t("participants.user.name"):l&&l.name,{showAvatar:p,showName:h}=u[n?"user":"agent"]||{};if(!p&&!h)return null;const f=[];return p&&d&&l.avatar&&f.push((0,a.jsx)("span",{className:(0,o.U)("message__avatar"),children:(0,a.jsx)("img",{src:l.avatar,className:(0,o.U)("avatar"),alt:""})})),h&&d&&f.push((0,a.jsx)("span",{className:(0,o.U)("message__author-name"),children:d})),f.length>0&&(0,a.jsx)("div",{className:(0,o.U)("message__author"),children:f})}},7800:(e,t,n)=>{"use strict";n.d(t,{c:()=>c});var r=n(7456),s=n(8544),o=n(2796),i=n(3792),a=n(784);const c=function({showParticipant:e=!0,event:t,type:n,modifiers:c,children:l,bodyProps:u={},info:d,...p}){const h=(0,o.l)(t),{hasTranslation:f,isTranslated:m,locale:v}=(0,r.kx)(t);return n&&h.push(`message--type-${n}`),c&&("string"==typeof c&&(c=c.split(" ").filter((e=>e.length))),c.forEach((e=>{h.push(`message--${e}`)}))),m&&h.push("message--is-translated"),f&&h.push("message--has-translation"),m&&(u={...u,lang:v}),(0,a.jsx)(a.Fragment,{children:(0,a.jsxs)("div",{className:(0,s.U)(h),...p,children:[e&&(0,a.jsx)(i.c,{eventPayload:t.payload}),(0,a.jsx)("div",{className:(0,s.U)("message__body"),...u,children:l}),d&&(0,a.jsx)("div",{"aria-hidden":"true",className:(0,s.U)("message__info"),children:d})]})})}},9500:(e,t,n)=>{"use strict";n.d(t,{c:()=>r});const r=(0,n(9150).createContext)(null)},9056:(e,t,n)=>{"use strict";n.d(t,{c:()=>r});const r=(0,n(9150).createContext)({})},6612:(e,t,n)=>{"use strict";n.d(t,{e:()=>r});const r=(0,n(9150).createContext)(null)},2796:(e,t,n)=>{"use strict";n.d(t,{E:()=>s,l:()=>o});var r=n(5352);const s=()=>(0,r.EV)().appContainerClassNames,o=e=>{const{fromClient:t}=e.payload,n=["message"];return"info"===e.type?n.push("message--source-info"):t?n.push("message--source-user"):n.push("message--source-agent"),n}},3480:(e,t,n)=>{"use strict";n.d(t,{Yf:()=>l,e6:()=>d,kX:()=>u,me:()=>c});var r=n(8056),s=n(2328),o=n(3332),i=n(8760),a=n(6736);const c=(e=0)=>new Promise((t=>{setTimeout(t,e)})),l=()=>{const{seamlyContainerElement:e}=(0,a.gf)(),t=(0,s.OY)();return[e,(0,r.useCallback)((e=>{t((0,o.od)(e))}),[t])]},u=e=>(0,r.useCallback)((()=>{var t;t=e,requestAnimationFrame((async()=>{await c(180);const e="string"==typeof t?document.getElementById(t):t;(0,i.O8)(e)}))}),[e]),d=()=>{const e=(0,a.OK)();return u(e)}},8384:(e,t,n)=>{"use strict";n.d(t,{C:()=>i});var r=n(8056),s=n(6612),o=n(6244);const i=()=>{const e=(0,r.useContext)(s.e);return{sendPolite:(0,r.useCallback)((t=>{t&&e({ariaLive:o.kD.polite,messageText:t})}),[e]),sendAssertive:(0,r.useCallback)((t=>{t&&e({ariaLive:o.kD.assertive,messageText:t})}),[e])}}},6204:(e,t,n)=>{"use strict";n.d(t,{kX:()=>s.kX,kV:()=>l.kV,A9:()=>u,uc:()=>d,k3:()=>x.k3,SS:()=>l.SS,CE:()=>p.C,a:()=>v,GU:()=>g.c,Ml:()=>h.Ml,EF:()=>o.E,wv:()=>y.c,Y5:()=>h.Y5,KC:()=>l.KC,sD:()=>b.c,Ir:()=>l.Ir,sJ:()=>l.sJ,y2:()=>l.y2,li:()=>o.l,Yj:()=>m,E1:()=>l.E1,AL:()=>w.c,Ip:()=>l.Ip,I7:()=>l.I7,OK:()=>l.OK,e6:()=>s.e6,W_:()=>x.W_});var r=n(8056),s=(n(9816),n(3480)),o=n(2796),i=n(2328),a=n(3332),c=n(9056),l=n(6736);const u=()=>{const{showFileUpload:e,entryMeta:{options:t,optionsOverride:n},options:{features:{uploads:r}}}=(0,l.gf)(),{allowedMimeTypes:s,maxSize:o}=n.upload||{},{enabled:i,enabledFromEntry:a}=r||{},{allowedMimeTypes:c,maxSize:u}={...t.upload||{allowedMimeTypes:[],maxSize:0},...s?{allowedMimeTypes:s}:{},...o?{maxSize:o}:{}};return{showFileUpload:e,accountAllowsUploads:!!r,serviceAllowsUploads:a||i,allowedMimeTypes:c,maxSize:u}},d=()=>{const{currentUploads:e}=(0,l.gf)(),t=(0,i.OY)(),n=(0,r.useContext)(c.c);return{uploadFile:(0,r.useCallback)((e=>{n(e)}),[n]),clearUploads:(0,r.useCallback)((()=>{t((0,a.ML)())}),[t]),currentUploads:e,isUploading:e.some((e=>e.uploading)),isComplete:e.every((e=>e.complete))}};var p=n(8384),h=n(9320),f=n(1800);const m=()=>{const{t:e}=(0,f.g)(),{options:t}=(0,l.gf)(),{panelActive:n,optionActive:s,userSelectedOptions:o,features:c}=t,{extraMenuItem:u,sendTranscript:d}=c,p={extraMenuItem:u,sendTranscript:d},m=t=>"extraMenuItem"===t?"Extra menu item":e(`options.${t}.menuTitle`),v=Object.keys(p).filter((e=>p[e])).map((e=>({name:e,title:m(e),available:p[e].enabled}))),g=u||d,y=(0,i.OY)(),{get:b,set:w}=(0,h.cb)();return{allowOptionSelection:g,userSelectedOptions:o,features:c,menuOptions:v,initUserSelectedOptions:(0,r.useCallback)((()=>{const e=b("options")||{};y((0,a.IF)(e))}),[b,y]),setUserSelectedOptions:(0,r.useCallback)((e=>{y((0,a.IF)(e)),w("options",e)}),[w,y]),setUserSelectedOption:(0,r.useCallback)(((e,t)=>{const n=b("options")||{};w("options",{...n,[e]:t}),y((0,a.eK)({option:e,value:t}))}),[y,b,w]),showOption:e=>{y((0,a.ER)(e))},hideOption:()=>{y((0,a.Ur)())},panelActive:n,optionActive:s}},v=()=>{const{optionsButtonId:e}=(0,l.gf)();return{id:e,focusButton:(0,s.kX)(e)}};var g=n(7268),y=(n(3460),n(8416)),b=n(952),w=n(152),x=n(1100)},7268:(e,t,n)=>{"use strict";n.d(t,{c:()=>o});var r=n(8056),s=n(9500);const o=()=>(0,r.useContext)(s.c)},8416:(e,t,n)=>{"use strict";n.d(t,{c:()=>y});var r=n(8056),s=n(2328),o=n(7548),i=n(232),a=n(1888),c=n(428),l=n(1880),u=n(3332),d=n(8536),p=n(8632),h=n(1676),f=n(5308),m=n(6244),v=n(9320),g=n(6736);const y=()=>{const e=(0,v.Ml)(),t=(0,s.OY)(),n=(0,r.useContext)(f.E),y=(0,a.w)(),b=(0,v.aJ)(),{visible:w,setVisibility:x}=(0,p.uu)(),C=(0,g.I7)(),_=(0,r.useCallback)(((...e)=>{n.emit(...e)}),[n]),j=(0,r.useCallback)((()=>{_("ui.beforeStart",{visibility:w,hasConversation:b(),hasResponded:y,unreadMessageCount:C}),e.send("start"),_("ui.start",{visibility:w,hasConversation:b(),hasResponded:y,unreadMessageCount:C})}),[e,_,b,y,C,w]),E=(0,r.useCallback)((async()=>{t(i.C())}),[t]),S=(0,r.useCallback)((e=>({type:e,id:(0,h.s)(),transactionId:(0,h.s)(),participant:o.kr,fromClient:!0,occurredAt:1e3*Date.now(),meta:{}})),[]),T=(0,r.useCallback)((e=>({...S("text"),body:{text:e}})),[S]),k=(0,r.useCallback)((({body:n,config:r={}})=>{if(""===n.trim())return;const s={...T(n),...r};e.send("message",s),_("message",s),t((0,u.Ux)({type:"message",payload:{...s,optimisticallyInjected:!0}}))}),[e,t,_,T]),O=(0,r.useCallback)(((e,n=(0,h.s)())=>{t((0,u.Ux)({type:"message",payload:{...T(e),transactionId:n}}))}),[t,T]),N=(0,r.useCallback)(((e,n,r,s,i,a,c)=>{t((0,u.Ux)({type:"message",payload:{type:"upload",id:e,transactionId:n,participant:o.kr,fromClient:!0,occurredAt:r,meta:{},body:{contentType:s,filename:i,filesize:a,url:c}}}))}),[t]),I=(0,r.useCallback)(((e,n=(0,h.s)())=>{const r={body:{subtype:e,type:"divider"},fromClient:!1,fromHistory:!0,id:(0,h.s)(),transactionId:n,type:"divider"};t((0,u.Ux)({type:"info",payload:r}))}),[t]),U=(0,r.useCallback)((t=>{if(!t)return;e.send("action",t);const{type:n}=t;n!==m.w$.typing&&n!==m.w$.read&&_(`action.${n}`,t)}),[e,_]),A=(0,r.useCallback)((t=>{e.sendContext(t)}),[e]);return{connect:(0,r.useCallback)((()=>e.connected?Promise.reject(new Error("The API is already connected")):e.connect().then((e=>{e&&(t((0,u.cN)(e)),e.userResponded&&(t((0,c.N8)(e.userResponded)),x(d.I.open)))})).catch((e=>{t((0,l.yA)({name:e?.name,message:e?.message,langKey:e?.langKey,action:e?.action,originalEvent:e?.originalEvent,originalError:e?.originalError}))}))),[e,t,x]),start:j,sendMessage:k,sendAction:U,sendContext:A,reset:E,emitEvent:_,addMessageBubble:O,addUploadBubble:N,addDivider:I,apiConnected:e.connected,apiConfigReady:e.configReady}}},952:(e,t,n)=>{"use strict";n.d(t,{c:()=>f});var r=n(8056),s=n(2328),o=n(7548),i=n(1800),a=n(3332),c=n(8632),l=n(8760),u=n(6244),d=n(8384),p=n(6736),h=n(8416);const f=()=>{const e=(0,s.OY)(),{idleDetachCountdown:t}=(0,p.gf)(),{isOpen:n}=(0,c.uu)(),f=(0,r.useRef)({});f.current={hasCountdown:t.hasCountdown,isActive:t.isActive,remaining:t.remaining,wasStopped:t.wasStopped,isOpen:n};const{emitEvent:m,sendAction:v}=(0,h.c)(),{t:g}=(0,i.g)(),{sendAssertive:y,sendPolite:b}=(0,d.C)(),w=(0,r.useCallback)((e=>{const{isOpen:t}=f.current;t&&y(e)}),[y]),x=(0,r.useCallback)((e=>{const{isOpen:t}=f.current;t&&b(e)}),[b]),C=(0,r.useCallback)((t=>{const n=(0,l.Ub)(t),r=(0,l.s3)(n);e((0,a.gB)({delaySeconds:n,delayTime:r})),m("idleTimer.start"),w(`${g("idleDetachWarning.countdownTitle")} ${g("idleDetachWarning.countdownText")} ${g("idleDetachWarning.countdownTimer",r)}`)}),[e,m,w,g]),_=(0,r.useCallback)(((t,n)=>{const{hasCountdown:r,wasStopped:s}=f.current;r&&(t||(n||v({type:u.w$.detachService}),w(g("idleDetachWarning.notifyTransferText"))),s||m("idleTimer.stop"),e((0,a.aD)()))}),[e,v,m,w,g]),j=(0,r.useCallback)((()=>{const{remaining:t}=f.current;if(t<=0)return;const n=t-1;n%o.sB==0&&w(`${g("idleDetachWarning.countdownText")} ${g("idleDetachWarning.countdownTimer",(0,l.s3)(n))}`),e((0,a.I1)())}),[e,w,g]),E=(0,r.useCallback)((()=>{const{isActive:t,remaining:n}=f.current;t&&(e((0,a.e_)()),n&&(m("idleTimer.stop"),x(g("idleDetachWarning.srCountDownStoppedText"))))}),[e,m,x,g]);return{...t,initCountdown:C,endCountdown:_,decrementCountdown:j,stopCountdown:E}}},152:(e,t,n)=>{"use strict";n.d(t,{c:()=>u});var r=n(2328),s=n(1800),o=n(3332),i=n(6244),a=n(8384),c=n(6736),l=n(8416);const u=()=>{const e=(0,r.OY)(),t=(0,c.gf)().resumeConversationPrompt,{sendAction:n}=(0,l.c)(),{t:u}=(0,s.g)(),{sendAssertive:d}=(0,a.C)();return{continueChat:()=>{n({type:i.w$.dismiss,body:{type:i.ic.resumeConversationPrompt}}),e((0,o.M5)())},hasPrompt:t,restartChat:()=>{d(u("resumeConversationPrompt.srNotifyRestartText")),n({type:i.w$.detachService}),e((0,o.M5)())}}}},1100:(e,t,n)=>{"use strict";n.d(t,{W_:()=>a,ei:()=>o,k3:()=>i});var r=n(8056),s=n(1676);const o=()=>{const[e,t]=(0,r.useReducer)((e=>e+1),0);return(0,r.useCallback)((()=>{setTimeout((()=>{t()}))}),[])},i=()=>{const[e]=(0,r.useState)((()=>(0,s.s)()));return e},a=e=>{const t=(0,r.useRef)(null);t.current=e;const n="function"==typeof e;return(0,r.useMemo)((()=>n?(...e)=>t.current(...e):void 0),[n])}},8760:(e,t,n)=>{"use strict";n.d(t,{Av:()=>s,Cu:()=>r,IB:()=>c,O8:()=>p,Qv:()=>i,Ub:()=>o,aG:()=>f,gP:()=>d,gl:()=>m,qn:()=>v,s3:()=>a,sH:()=>u,wN:()=>h});const r=(e,t)=>{let n;return function(...r){let s=!1;return clearTimeout(n),n=setTimeout((()=>{n=null,s||e.apply(this,r),s=!1}),t),t=>{s=!0,t&&e.apply(this,r)}}},s=()=>{const e=[],t=[];return document.querySelectorAll('body > *:not([role="dialog"])').forEach((n=>{const r=n.getAttribute("aria-hidden");null!==r&&"false"!==r||(e.push(r),t.push(n),n.setAttribute("aria-hidden","true"))})),()=>{t.forEach(((t,n)=>{const r=e[n];null===r?t.removeAttribute("aria-hidden"):t.setAttribute("aria-hidden",r)}))}},o=e=>Math.ceil(e/1e3),i=e=>Math.ceil(e/1e3),a=e=>{const t=Math.floor(e/60);return{minutes:t,seconds:e-60*t}},c=(e,t=2)=>{if(0===e)return"0 Bytes";const n=t<0?0:t,r=Math.floor(Math.log(e)/Math.log(1024));return`${parseFloat((e/1024**r).toFixed(n))} ${["Bytes","KB","MB","GB","TB","PB","EB","ZB","YB"][r]}`},l={27:"Escape",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown"},u={Escape:"Escape",End:"End",Home:"Home",ArrowLeft:"ArrowLeft",ArrowUp:"ArrowUp",ArrowRight:"ArrowRight",ArrowDown:"ArrowDown"},d=e=>e.code?u[e.code]:l[e.keyCode],p=e=>{e&&e.focus()},h=(e,t)=>{e&&(e.contains(document.activeElement)||e===document.activeElement)&&t()},f=(e,t)=>{const n=new Date(t).setHours(0,0,0,0),r=e.getTime(),s=864e5;return r>=n+s?e:r>n?"today":r>n-s?"yesterday":e},m=(e,t)=>t.reduce(((t,n)=>(n in e&&(t[n]=e[n]),t)),{}),v=(e,t)=>Object.keys(e).reduce(((n,r)=>(t.includes(r)||(n[r]=e[r]),n)),{})},1792:e=>{e.exports=function(e){var t={},n=[];(e=e||this).on=function(n,r,s){return(t[n]=t[n]||[]).push([r,s]),e},e.off=function(r,s){r||(t={});for(var o=t[r]||n,i=o.length=s?o.length:0;i--;)s==o[i][0]&&o.splice(i,1);return e},e.emit=function(r){for(var s,o=t[r]||n,i=o.length>0?o.slice(0,o.length):o,a=0;s=i[a++];)s[0].apply(s[1],n.slice.call(arguments,1));return e}}},144:(e,t,n)=>{"use strict";n.r(t),n.d(t,{Children:()=>f,Component:()=>r.Component,Fragment:()=>r.Fragment,PureComponent:()=>c,StrictMode:()=>ee,Suspense:()=>b,SuspenseList:()=>C,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:()=>H,cloneElement:()=>Y,createContext:()=>r.createContext,createElement:()=>r.createElement,createFactory:()=>W,createPortal:()=>S,createRef:()=>r.createRef,default:()=>ce,findDOMNode:()=>X,flushSync:()=>Z,forwardRef:()=>p,hydrate:()=>R,isElement:()=>oe,isFragment:()=>G,isValidElement:()=>q,lazy:()=>x,memo:()=>l,render:()=>A,startTransition:()=>te,unmountComponentAtNode:()=>J,unstable_batchedUpdates:()=>Q,useDeferredValue:()=>ne,useInsertionEffect:()=>se,useSyncExternalStore:()=>ie,useTransition:()=>re,version:()=>K});var r=n(9150),s=n(8056),o={};for(const e in s)["default","Component","Fragment","createContext","createElement","createRef","Children","PureComponent","StrictMode","Suspense","SuspenseList","__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED","cloneElement","createFactory","createPortal","findDOMNode","flushSync","forwardRef","hydrate","isElement","isFragment","isValidElement","lazy","memo","render","startTransition","unmountComponentAtNode","unstable_batchedUpdates","useDeferredValue","useInsertionEffect","useSyncExternalStore","useTransition","version"].indexOf(e)<0&&(o[e]=()=>s[e]);function i(e,t){for(var n in t)e[n]=t[n];return e}function a(e,t){for(var n in e)if("__source"!==n&&!(n in t))return!0;for(var r in t)if("__source"!==r&&e[r]!==t[r])return!0;return!1}function c(e){this.props=e}function l(e,t){function n(e){var n=this.props.ref,r=n==e.ref;return!r&&n&&(n.call?n(null):n.current=null),t?!t(this.props,e)||!r:a(this.props,e)}function s(t){return this.shouldComponentUpdate=n,(0,r.createElement)(e,t)}return s.displayName="Memo("+(e.displayName||e.name)+")",s.prototype.isReactComponent=!0,s.__f=!0,s}n.d(t,o),(c.prototype=new r.Component).isPureReactComponent=!0,c.prototype.shouldComponentUpdate=function(e,t){return a(this.props,e)||a(this.state,t)};var u=r.options.__b;r.options.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),u&&u(e)};var d="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.forward_ref")||3911;function p(e){function t(t){var n=i({},t);return delete n.ref,e(n,t.ref||null)}return t.$$typeof=d,t.render=t,t.prototype.isReactComponent=t.__f=!0,t.displayName="ForwardRef("+(e.displayName||e.name)+")",t}var h=function(e,t){return null==e?null:(0,r.toChildArray)((0,r.toChildArray)(e).map(t))},f={map:h,forEach:h,count:function(e){return e?(0,r.toChildArray)(e).length:0},only:function(e){var t=(0,r.toChildArray)(e);if(1!==t.length)throw"Children.only";return t[0]},toArray:r.toChildArray},m=r.options.__e;r.options.__e=function(e,t,n,r){if(e.then)for(var s,o=t;o=o.__;)if((s=o.__c)&&s.__c)return null==t.__e&&(t.__e=n.__e,t.__k=n.__k),s.__c(e,t);m(e,t,n,r)};var v=r.options.unmount;function g(e,t,n){return e&&(e.__c&&e.__c.__H&&(e.__c.__H.__.forEach((function(e){"function"==typeof e.__c&&e.__c()})),e.__c.__H=null),null!=(e=i({},e)).__c&&(e.__c.__P===n&&(e.__c.__P=t),e.__c=null),e.__k=e.__k&&e.__k.map((function(e){return g(e,t,n)}))),e}function y(e,t,n){return e&&n&&(e.__v=null,e.__k=e.__k&&e.__k.map((function(e){return y(e,t,n)})),e.__c&&e.__c.__P===t&&(e.__e&&n.appendChild(e.__e),e.__c.__e=!0,e.__c.__P=n)),e}function b(){this.__u=0,this.t=null,this.__b=null}function w(e){var t=e.__.__c;return t&&t.__a&&t.__a(e)}function x(e){var t,n,s;function o(o){if(t||(t=e()).then((function(e){n=e.default||e}),(function(e){s=e})),s)throw s;if(!n)throw t;return(0,r.createElement)(n,o)}return o.displayName="Lazy",o.__f=!0,o}function C(){this.u=null,this.o=null}r.options.unmount=function(e){var t=e.__c;t&&t.__R&&t.__R(),t&&32&e.__u&&(e.type=null),v&&v(e)},(b.prototype=new r.Component).__c=function(e,t){var n=t.__c,r=this;null==r.t&&(r.t=[]),r.t.push(n);var s=w(r.__v),o=!1,i=function(){o||(o=!0,n.__R=null,s?s(a):a())};n.__R=i;var a=function(){if(! --r.__u){if(r.state.__a){var e=r.state.__a;r.__v.__k[0]=y(e,e.__c.__P,e.__c.__O)}var t;for(r.setState({__a:r.__b=null});t=r.t.pop();)t.forceUpdate()}};r.__u++||32&t.__u||r.setState({__a:r.__b=r.__v.__k[0]}),e.then(i,i)},b.prototype.componentWillUnmount=function(){this.t=[]},b.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var n=document.createElement("div"),s=this.__v.__k[0].__c;this.__v.__k[0]=g(this.__b,n,s.__O=s.__P)}this.__b=null}var o=t.__a&&(0,r.createElement)(r.Fragment,null,e.fallback);return o&&(o.__u&=-33),[(0,r.createElement)(r.Fragment,null,t.__a?null:e.children),o]};var _=function(e,t,n){if(++n[1]===n[0]&&e.o.delete(t),e.props.revealOrder&&("t"!==e.props.revealOrder[0]||!e.o.size))for(n=e.u;n;){for(;n.length>3;)n.pop()();if(n[1]<n[0])break;e.u=n=n[2]}};function j(e){return this.getChildContext=function(){return e.context},e.children}function E(e){var t=this,n=e.i;t.componentWillUnmount=function(){(0,r.render)(null,t.l),t.l=null,t.i=null},t.i&&t.i!==n&&t.componentWillUnmount(),t.l||(t.i=n,t.l={nodeType:1,parentNode:n,childNodes:[],appendChild:function(e){this.childNodes.push(e),t.i.appendChild(e)},insertBefore:function(e,n){this.childNodes.push(e),t.i.appendChild(e)},removeChild:function(e){this.childNodes.splice(this.childNodes.indexOf(e)>>>1,1),t.i.removeChild(e)}}),(0,r.render)((0,r.createElement)(j,{context:t.context},e.__v),t.l)}function S(e,t){var n=(0,r.createElement)(E,{__v:e,i:t});return n.containerInfo=t,n}(C.prototype=new r.Component).__a=function(e){var t=this,n=w(t.__v),r=t.o.get(e);return r[0]++,function(s){var o=function(){t.props.revealOrder?(r.push(s),_(t,e,r)):s()};n?n(o):o()}},C.prototype.render=function(e){this.u=null,this.o=new Map;var t=(0,r.toChildArray)(e.children);e.revealOrder&&"b"===e.revealOrder[0]&&t.reverse();for(var n=t.length;n--;)this.o.set(t[n],this.u=[1,0,this.u]);return e.children},C.prototype.componentDidUpdate=C.prototype.componentDidMount=function(){var e=this;this.o.forEach((function(t,n){_(e,n,t)}))};var T="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,k=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,O=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,N=/[A-Z0-9]/g,I="undefined"!=typeof document,U=function(e){return("undefined"!=typeof Symbol&&"symbol"==typeof Symbol()?/fil|che|rad/:/fil|che|ra/).test(e)};function A(e,t,n){return null==t.__k&&(t.textContent=""),(0,r.render)(e,t),"function"==typeof n&&n(),e?e.__c:null}function R(e,t,n){return(0,r.hydrate)(e,t),"function"==typeof n&&n(),e?e.__c:null}r.Component.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach((function(e){Object.defineProperty(r.Component.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})}));var M=r.options.event;function P(){}function L(){return this.cancelBubble}function D(){return this.defaultPrevented}r.options.event=function(e){return M&&(e=M(e)),e.persist=P,e.isPropagationStopped=L,e.isDefaultPrevented=D,e.nativeEvent=e};var F,B={enumerable:!1,configurable:!0,get:function(){return this.class}},z=r.options.vnode;r.options.vnode=function(e){"string"==typeof e.type&&function(e){var t=e.props,n=e.type,s={};for(var o in t){var i=t[o];if(!("value"===o&&"defaultValue"in t&&null==i||I&&"children"===o&&"noscript"===n||"class"===o||"className"===o)){var a=o.toLowerCase();"defaultValue"===o&&"value"in t&&null==t.value?o="value":"download"===o&&!0===i?i="":"ondoubleclick"===a?o="ondblclick":"onchange"!==a||"input"!==n&&"textarea"!==n||U(t.type)?"onfocus"===a?o="onfocusin":"onblur"===a?o="onfocusout":O.test(o)?o=a:-1===n.indexOf("-")&&k.test(o)?o=o.replace(N,"-$&").toLowerCase():null===i&&(i=void 0):a=o="oninput","oninput"===a&&s[o=a]&&(o="oninputCapture"),s[o]=i}}"select"==n&&s.multiple&&Array.isArray(s.value)&&(s.value=(0,r.toChildArray)(t.children).forEach((function(e){e.props.selected=-1!=s.value.indexOf(e.props.value)}))),"select"==n&&null!=s.defaultValue&&(s.value=(0,r.toChildArray)(t.children).forEach((function(e){e.props.selected=s.multiple?-1!=s.defaultValue.indexOf(e.props.value):s.defaultValue==e.props.value}))),t.class&&!t.className?(s.class=t.class,Object.defineProperty(s,"className",B)):(t.className&&!t.class||t.class&&t.className)&&(s.class=s.className=t.className),e.props=s}(e),e.$$typeof=T,z&&z(e)};var $=r.options.__r;r.options.__r=function(e){$&&$(e),F=e.__c};var V=r.options.diffed;r.options.diffed=function(e){V&&V(e);var t=e.props,n=e.__e;null!=n&&"textarea"===e.type&&"value"in t&&t.value!==n.value&&(n.value=null==t.value?"":t.value),F=null};var H={ReactCurrentDispatcher:{current:{readContext:function(e){return F.__n[e.__c].props.value}}}},K="17.0.2";function W(e){return r.createElement.bind(null,e)}function q(e){return!!e&&e.$$typeof===T}function G(e){return q(e)&&e.type===r.Fragment}function Y(e){return q(e)?r.cloneElement.apply(null,arguments):e}function J(e){return!!e.__k&&((0,r.render)(null,e),!0)}function X(e){return e&&(e.base||1===e.nodeType&&e)||null}var Q=function(e,t){return e(t)},Z=function(e,t){return e(t)},ee=r.Fragment;function te(e){e()}function ne(e){return e}function re(){return[!1,te]}var se=s.useLayoutEffect,oe=q;function ie(e,t){var n=t(),r=(0,s.useState)({h:{__:n,v:t}}),o=r[0].h,i=r[1];return(0,s.useLayoutEffect)((function(){o.__=n,o.v=t,ae(o)&&i({h:o})}),[e,n,t]),(0,s.useEffect)((function(){return ae(o)&&i({h:o}),e((function(){ae(o)&&i({h:o})}))}),[e]),n}function ae(e){var t,n,r=e.v,s=e.__;try{var o=r();return!((t=s)===(n=o)&&(0!==t||1/t==1/n)||t!=t&&n!=n)}catch(e){return!0}}var ce={useState:s.useState,useId:s.useId,useReducer:s.useReducer,useEffect:s.useEffect,useLayoutEffect:s.useLayoutEffect,useInsertionEffect:se,useTransition:re,useDeferredValue:ne,useSyncExternalStore:ie,startTransition:te,useRef:s.useRef,useImperativeHandle:s.useImperativeHandle,useMemo:s.useMemo,useCallback:s.useCallback,useContext:s.useContext,useDebugValue:s.useDebugValue,version:"17.0.2",Children:f,render:A,hydrate:R,unmountComponentAtNode:J,createPortal:S,createElement:r.createElement,createContext:r.createContext,createFactory:W,cloneElement:Y,createRef:r.createRef,Fragment:r.Fragment,isValidElement:q,isElement:oe,isFragment:G,findDOMNode:X,Component:r.Component,PureComponent:c,memo:l,forwardRef:p,flushSync:Z,unstable_batchedUpdates:Q,StrictMode:ee,Suspense:b,SuspenseList:C,lazy:x,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:H}},7888:(e,t,n)=>{"use strict";n.d(t,{c:()=>i});var r=n(784),s=n(8544);const o={send:{32:'<svg xmlns="http://www.w3.org/2000/svg" width="32px" height="32px" x="0px" y="0px" viewBox="0 0 32 32"><defs/><path fill="#4A48C1" d="M6.714,14.985l17.837-7.906c0.681-0.302,1.414,0.301,1.25,1.027L22.273,23.59\tc-0.13,0.566-0.751,0.865-1.275,0.613l-3.623-1.752l-2.334,2.287c-0.572,0.562-1.538,0.156-1.538-0.645V21.01\tc0-0.217,0.078-0.43,0.222-0.594l7.676-8.841l-10.414,7.472l-4.351-2.445C5.987,16.236,6.033,15.287,6.714,14.985L6.714,14.985z"/></svg>'},balloon:{32:'<svg xmlns="http://www.w3.org/2000/svg" width="32px" height="32px" x="0px" y="0px" viewBox="0 0 32 32"><defs/><path fill="#4A48C1" d="M24,10.824v10.375c0,1.104-0.896,2-2,2h-4.694l-4.931,3.625v-3.625H10c-1.104,0-2-0.896-2-2V10.824\tc0-1.104,0.896-2,2-2h12C23.104,8.824,24,9.719,24,10.824z"/></svg>'},newTopic:{32:'<svg xmlns="http://www.w3.org/2000/svg" width="32px" height="32px" x="0px" y="0px" viewBox="0 0 32 32"><path fill="#4A48C1" d="M16,8.593l2.407,4.573l5.093,0.876l-3.604,3.702l0.74,5.115L16,20.574l-4.634,2.285l0.739-5.115L8.5,14.042\tl5.094-0.876L16,8.593z"/></svg>'},newTranslation:{16:'<svg xmlns="http://www.w3.org/2000/svg" x="0px" y="0px" viewBox="0 0 16 16"><path fill="#4A48C1" d="M8,0C3.6,0,0,3.6,0,8s3.6,8,8,8s8-3.6,8-8S12.4,0,8,0z M14.1,7.1h-1.4c-0.1-1.5-0.4-2.9-1-4\tC13,4,13.9,5.4,14.1,7.1z M7.1,2.1v5H5C5.2,4.7,6.1,2.9,7.1,2.1z M7.1,8.9v5c-1-0.7-1.9-2.5-2.1-5H7.1z M8.9,13.9v-5H11\tC10.8,11.3,9.9,13.2,8.9,13.9z M8.9,7.1v-5c1,0.7,1.9,2.5,2.1,5H8.9z M4.2,3.1c-0.5,1.1-0.9,2.5-1,4H1.9C2.1,5.4,3,4,4.2,3.1z M1.9,8.9h1.4c0.1,1.5,0.4,2.9,1,4C3,12,2.1,10.5,1.9,8.9z M11.8,12.9c0.5-1.1,0.9-2.5,1-4h1.4C13.9,10.5,13,12,11.8,12.9z"/></svg>',32:'<svg xmlns="http://www.w3.org/2000/svg" x="0px" y="0px" viewBox="0 0 32 32"><path fill="#4A48C1" d="M16,7c-4.9,0-9,4.1-9,9s4.1,9,9,9s9-4.1,9-9S20.9,7,16,7z M22.9,15h-1.6c-0.1-1.7-0.5-3.3-1.1-4.5\tC21.6,11.5,22.6,13.1,22.9,15z M15,9.4V15h-2.3C12.9,12.3,13.9,10.2,15,9.4z M15,17v5.6c-1.1-0.8-2.1-2.9-2.3-5.6H15z M17,22.6V17\th2.3C19.1,19.8,18.1,21.8,17,22.6z M17,15V9.4c1.1,0.8,2.1,2.9,2.3,5.6H17z M11.8,10.4c-0.6,1.3-1,2.8-1.1,4.5H9.1\tC9.4,13.1,10.4,11.5,11.8,10.4z M9.1,17h1.6c0.1,1.7,0.5,3.3,1.1,4.5C10.4,20.5,9.4,18.9,9.1,17z M20.2,21.5c0.6-1.3,1-2.8,1.1-4.5\th1.6C22.6,18.8,21.6,20.5,20.2,21.5z"/></svg>'},avatar:{32:'<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"\n\t viewBox="0 0 32 32" enable-background="new 0 0 32 32" xml:space="preserve">\n<path fill="#4A48C1" d="M10,14.8c-1.1,0-2-0.9-2-2s0.9-2,2-2s2,0.9,2,2S11.1,14.8,10,14.8z M15.9,14.8c1.1,0,2-0.9,2-2s-0.9-2-2-2\n\ts-2,0.9-2,2S14.8,14.8,15.9,14.8z M21.8,10.8c-1.1,0-2,0.9-2,2s0.9,2,2,2s2-0.9,2-2S22.9,10.8,21.8,10.8z M21.3,18.1H10.7\n\tC11.7,23.9,20.2,23.9,21.3,18.1z"/>\n</svg>\n'},chevronDown:{8:'<svg xmlns="http://www.w3.org/2000/svg" width="8px" height="8px" x="0px" y="0px" viewBox="0 0 8 8"><defs/><path fill="#4A48C1" d="M-0.001,2.876c0-0.247,0.091-0.494,0.273-0.688c0.38-0.401,1.013-0.418,1.414-0.039l1.938,1.834\tc0.199,0.188,0.547,0.188,0.746,0L6.31,2.15c0.401-0.379,1.034-0.362,1.414,0.04c0.379,0.401,0.361,1.034-0.04,1.414L5.745,5.437\tC4.782,6.35,3.213,6.35,2.249,5.436L0.311,3.603C0.103,3.406-0.001,3.142-0.001,2.876z"/></svg>',32:'<svg xmlns="http://www.w3.org/2000/svg" width="32px" height="32px" x="0px" y="0px" viewBox="0 0 32 32"><defs/><path fill="#4A48C1" d="M16,20.425c-0.782,0-1.563-0.291-2.159-0.874l-6.541-6.408c-0.395-0.387-0.401-1.02-0.015-1.414\tc0.387-0.394,1.021-0.4,1.414-0.015l6.541,6.408c0.42,0.409,1.102,0.409,1.52-0.001l6.541-6.407c0.396-0.386,1.028-0.38,1.414,0.015\tc0.387,0.395,0.381,1.027-0.014,1.414l-6.541,6.407C17.563,20.133,16.782,20.425,16,20.425z"/></svg>'},chevronRight:{8:'<svg xmlns="http://www.w3.org/2000/svg" width="8px" height="8px" x="0px" y="0px" viewBox="0 0 8 8"><defs/><path fill="#4A48C1" d="M2.875,7.998c-0.247,0-0.494-0.091-0.688-0.273c-0.401-0.38-0.418-1.013-0.039-1.414l1.834-1.938\tc0.188-0.199,0.188-0.547,0-0.746l-1.835-1.94c-0.379-0.401-0.362-1.034,0.04-1.414s1.034-0.361,1.414,0.04l1.834,1.939\tc0.913,0.963,0.913,2.532-0.001,3.496L3.601,7.686C3.405,7.894,3.14,7.998,2.875,7.998z"/></svg>',16:'<svg xmlns="http://www.w3.org/2000/svg" width="16px" height="16px" x="0px" y="0px" viewBox="0 0 16 16"><defs/><path fill="#4A48C1" d="M6.5,13c-0.247,0-0.494-0.091-0.687-0.273c-0.401-0.38-0.419-1.013-0.04-1.414L8.22,8.727\tc0.373-0.394,0.373-1.06,0-1.454L5.773,4.687c-0.379-0.401-0.362-1.034,0.04-1.414c0.4-0.378,1.034-0.362,1.414,0.04l2.446,2.586\tc1.096,1.159,1.096,3.043,0,4.203l-2.446,2.586C7.03,12.896,6.765,13,6.5,13z"/></svg>'},close:{8:'<svg xmlns="http://www.w3.org/2000/svg" width="8px" height="8px" x="0px" y="0px" viewBox="0 0 8 8"><defs/><path fill="#4A48C1" d="M7.705,7.729C7.511,7.923,7.255,8.02,7,8.02c-0.257,0-0.514-0.099-0.709-0.295L4,5.423L1.709,7.725\tC1.513,7.921,1.257,8.02,1,8.02c-0.255,0-0.51-0.097-0.706-0.291c-0.391-0.39-0.393-1.022-0.003-1.414l2.298-2.309l-2.27-2.28\tC-0.07,1.334-0.068,0.701,0.323,0.311c0.392-0.389,1.024-0.387,1.415,0.003L4,2.587l2.263-2.274C6.653-0.077,7.287-0.079,7.677,0.31\tC8.068,0.7,8.07,1.333,7.681,1.725l-2.27,2.281l2.298,2.309C8.099,6.705,8.097,7.339,7.705,7.729z"/></svg>',16:'<svg xmlns="http://www.w3.org/2000/svg" width="16px" height="16px" x="0px" y="0px" viewBox="0 0 16 16"><defs/><path fill="#4A48C1" d="M12.709,11.295L9.411,7.982l3.262-3.276c0.39-0.392,0.388-1.024-0.004-1.414\tc-0.39-0.39-1.023-0.388-1.414,0.003L8,6.564L4.746,3.295C4.357,2.904,3.724,2.903,3.332,3.292C2.94,3.682,2.939,4.315,3.329,4.707\tl3.261,3.275l-3.298,3.313c-0.39,0.391-0.388,1.024,0.003,1.414C3.49,12.903,3.745,13,4,13c0.257,0,0.513-0.099,0.708-0.295L8,9.399\tl3.291,3.306C11.486,12.901,11.743,13,12,13c0.255,0,0.511-0.097,0.705-0.291C13.097,12.319,13.099,11.686,12.709,11.295z"/></svg>'},enlarge:{32:'<svg xmlns="http://www.w3.org/2000/svg" width="32px" height="32px" x="0px" y="0px" viewBox="0 0 32 32"><defs/><path fill="#4A48C1" d="M24,9v6.5c0,0.552-0.447,1-1,1s-1-0.448-1-1v-4.086L11.414,22H15.5c0.552,0,1,0.447,1,1s-0.448,1-1,1H9\tc-0.13,0-0.26-0.026-0.382-0.077c-0.245-0.102-0.439-0.296-0.541-0.541C8.026,23.26,8,23.13,8,23v-6.5c0-0.552,0.448-1,1-1\ts1,0.448,1,1v4.085L20.586,10H16.5c-0.552,0-1-0.448-1-1s0.448-1,1-1H23c0.13,0,0.26,0.026,0.382,0.077\tc0.245,0.102,0.439,0.296,0.541,0.541C23.974,8.74,24,8.87,24,9z"/></svg>'},options:{32:'<svg xmlns="http://www.w3.org/2000/svg" width="32px" height="32px" x="0px" y="0px" viewBox="0 0 32 32"><defs/><path fill="#4A48C1" d="M26.1,21.383c0.334-0.625,0.602-1.279,0.812-1.949L32,18.609V13.51l-5.058-0.846\tc-0.208-0.67-0.468-1.325-0.795-1.956l3.009-4.145l-3.604-3.634L21.38,5.903c-0.626-0.333-1.276-0.602-1.948-0.81L18.609,0\tl-5.098,0.001l-0.847,5.061c-0.669,0.203-1.326,0.465-1.957,0.794L6.562,2.847L2.929,6.449l2.973,4.171\tC5.569,11.247,5.3,11.9,5.091,12.569L0,13.373v5.099l5.06,0.866c0.204,0.669,0.467,1.324,0.796,1.955l-3.009,4.146l3.601,3.635\tl4.171-2.975c0.627,0.335,1.282,0.603,1.951,0.811L13.372,32h5.118l0.849-5.057c0.668-0.207,1.323-0.469,1.953-0.795l4.144,3.01\tl3.639-3.604L26.1,21.383z M19.01,19.035c-1.675,1.663-4.381,1.652-6.041-0.025c-1.662-1.675-1.649-4.381,0.024-6.042\tc1.676-1.661,4.382-1.648,6.043,0.025C20.699,14.67,20.686,17.377,19.01,19.035z"/></svg>'},file:{32:'<svg xmlns="http://www.w3.org/2000/svg" xml:space="preserve" x="0px" y="0px" version="1.1" viewBox="0 0 32 32"><path fill="#4A48C1" d="M16,28.5c-3.6,0-6.5-3-6.5-6.6V9.6c0-0.6,0.4-1,1-1s1,0.4,1,1v12.3c0,2.5,2,4.6,4.5,4.6\tc2.5,0,4.5-2.1,4.5-4.6V8.3c0-1.5-1.2-2.8-2.7-2.8c-1.5,0-2.7,1.3-2.7,2.8v13.5c0,0.6,0.5,1.1,1,1.1c0.6,0,1-0.5,1-1.1v-10\tc0-0.6,0.4-1,1-1s1,0.4,1,1v10c0,1.7-1.4,3.1-3,3.1s-3-1.4-3-3.1V8.3c0-2.6,2.1-4.8,4.7-4.8c2.6,0,4.7,2.2,4.7,4.8v13.6\tC22.5,25.5,19.6,28.5,16,28.5z"/></svg>'},upload:{32:'<svg xmlns="http://www.w3.org/2000/svg" width="32px" height="32px" x="0px" y="0px" viewBox="0 0 32 32"><defs/><path fill="#4A48C1" d="M9.488,13.481c-0.391-0.391-0.391-1.023,0-1.414l5.805-5.805c0.026-0.026,0.06-0.036,0.088-0.058\tc0.073-0.06,0.146-0.119,0.235-0.156c0.246-0.103,0.522-0.103,0.769,0c0.093,0.039,0.171,0.101,0.249,0.165\tc0.023,0.02,0.053,0.027,0.074,0.049l5.805,5.805c0.391,0.391,0.391,1.023,0,1.414c-0.195,0.195-0.451,0.293-0.707,0.293\ts-0.512-0.098-0.707-0.293L17,9.383V20.33c0,0.553-0.447,1-1,1c-0.552,0-1-0.447-1-1V9.383l-4.098,4.098\tC10.512,13.872,9.879,13.872,9.488,13.481z M22.819,24.031H9.181c-0.552,0-1,0.447-1,1s0.448,1,1,1h13.639c0.553,0,1-0.447,1-1\tS23.372,24.031,22.819,24.031z"/></svg>'},download:{16:'<svg xmlns="http://www.w3.org/2000/svg" width="16px" height="16px" x="0px" y="0px" viewBox="0 0 16 16"><defs/><path fill="#FFF" d="M3.175,7.726c-0.413-0.367-0.45-0.999-0.083-1.412c0.367-0.413,0.999-0.45,1.412-0.083L7,8.45V1.5\tc0-0.552,0.448-1,1-1c0.553,0,1,0.448,1,1v6.95l2.496-2.219c0.412-0.367,1.044-0.331,1.411,0.083\tc0.367,0.413,0.33,1.045-0.083,1.412l-4.16,3.698c-0.047,0.041-0.103,0.062-0.154,0.094c-0.047,0.028-0.089,0.064-0.141,0.085\tC8.25,11.649,8.125,11.677,8,11.677c-0.126,0-0.25-0.027-0.369-0.074c-0.05-0.021-0.09-0.055-0.136-0.083\tc-0.053-0.031-0.111-0.053-0.159-0.096L3.175,7.726z M12.018,13.5H3.983c-0.552,0-1,0.447-1,1s0.448,1,1,1h8.035\tc0.553,0,1-0.447,1-1S12.57,13.5,12.018,13.5z"/></svg>'},error:{16:'<svg xmlns="http://www.w3.org/2000/svg" width="16px" height="16px" x="0px" y="0px" viewBox="0 0 16 16"><defs/><path fill="#ad001f" d="M15.744,13.104L9.097,1.47c-0.604-1.055-1.59-1.055-2.193,0L0.256,13.104\tc-0.604,1.056-0.102,1.919,1.113,1.919H14.63C15.847,15.022,16.348,14.159,15.744,13.104z M7,5.045c0-0.552,0.448-1,1-1s1,0.448,1,1\tv3.656c0,0.552-0.448,1-1,1s-1-0.448-1-1V5.045z M8,13.212c-0.748,0-1.354-0.607-1.354-1.354c0-0.748,0.606-1.354,1.354-1.354\ts1.354,0.606,1.354,1.354C9.354,12.604,8.748,13.212,8,13.212z"/></svg>'},arrowLeft:{16:'<?xml version="1.0" encoding="utf-8"?>\n\x3c!-- Generator: Adobe Illustrator 25.2.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) --\x3e\n<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"\n\t viewBox="0 0 16 16" enable-background="new 0 0 16 16" xml:space="preserve">\n<path fill="#5053A4" d="M13.6,8c0,0.6-0.4,1-1,1h-7l2.2,2.5c0.4,0.4,0.3,1-0.1,1.4c-0.2,0.2-0.4,0.2-0.7,0.2c-0.3,0-0.6-0.1-0.8-0.3\n\tL2.6,8.6c0,0-0.1-0.1-0.1-0.2c0,0-0.1-0.1-0.1-0.1c0-0.1-0.1-0.2-0.1-0.3c0,0,0,0,0,0c0,0,0,0,0,0c0-0.1,0-0.3,0.1-0.4\n\tc0,0,0.1-0.1,0.1-0.1c0-0.1,0.1-0.1,0.1-0.2l3.7-4.1c0.4-0.4,1-0.4,1.4-0.1c0.4,0.4,0.4,1,0.1,1.4L5.6,7h7C13.2,7,13.6,7.4,13.6,8z"\n\t/>\n</svg>\n'},arrowRight:{16:'<?xml version="1.0" encoding="utf-8"?>\n\x3c!-- Generator: Adobe Illustrator 25.2.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) --\x3e\n<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"\n\t viewBox="0 0 16 16" enable-background="new 0 0 16 16" xml:space="preserve">\n<path fill="#5053A4" d="M2.4,8.1c0-0.6,0.4-1,1-1h7L8.1,4.5c-0.4-0.4-0.3-1,0.1-1.4c0.2-0.2,0.4-0.2,0.7-0.2c0.3,0,0.6,0.1,0.8,0.3\n\tl3.7,4.2c0,0,0.1,0.1,0.1,0.2c0,0,0.1,0.1,0.1,0.1c0,0.1,0.1,0.2,0.1,0.3c0,0,0,0,0,0c0,0,0,0,0,0c0,0.1,0,0.3-0.1,0.4\n\tc0,0-0.1,0.1-0.1,0.1c0,0.1-0.1,0.1-0.1,0.2l-3.7,4.1c-0.4,0.4-1,0.4-1.4,0.1c-0.4-0.4-0.4-1-0.1-1.4l2.2-2.4h-7\n\tC2.8,9.1,2.4,8.6,2.4,8.1z"/>\n</svg>\n'},check:{16:'<svg\n xmlns="http://www.w3.org/2000/svg"\n width="16px"\n height="16px"\n x="0px"\n y="0px"\n viewBox="0 0 16 16"\n>\n <path\n fill="currentColor"\n d="M11.6,4.3l-5,5L4.9,7.5C4.4,7,3.7,7,3.2,7.5l0,0C2.8,8,2.8,8.7,3.2,9.2l1.7,1.7l0,0l0.8,0.8\n\tc0.5,0.5,1.2,0.5,1.7,0l0.8-0.8l5-5c0.5-0.5,0.5-1.2,0-1.7l0,0C12.8,3.8,12.1,3.8,11.6,4.3z"\n />\n</svg>\n',32:'<svg\n xmlns="http://www.w3.org/2000/svg"\n width="32px"\n height="32px"\n x="0px"\n y="0px"\n viewBox="0 0 32 32"\n>\n <path\n fill="currentColor"\n d="M22.9,9.3l-9.3,9.3l-3.2-3.2c-0.9-0.9-2.3-0.9-3.2,0l0,0c-0.9,0.9-0.9,2.3,0,3.2l3.2,3.2l0,0l1.6,1.6\n\tc0.9,0.9,2.3,0.9,3.2,0l1.6-1.6l9.3-9.3c0.9-0.9,0.9-2.3,0-3.2l0,0C25.2,8.4,23.7,8.4,22.9,9.3z"\n />\n</svg>\n'}},i=({name:e,size:t="32",className:n,alt:i})=>(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{"aria-hidden":"true",className:n||(0,s.U)("icon"),dangerouslySetInnerHTML:{__html:o[e][t]}}),i&&(0,r.jsx)("span",{className:(0,s.U)("visually-hidden"),children:i})]})},7556:(e,t,n)=>{"use strict";var r=n(144),s="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},o=r.useSyncExternalStore,i=r.useRef,a=r.useEffect,c=r.useMemo,l=r.useDebugValue;t.useSyncExternalStoreWithSelector=function(e,t,n,r,u){var d=i(null);if(null===d.current){var p={hasValue:!1,value:null};d.current=p}else p=d.current;d=c((function(){function e(e){if(!a){if(a=!0,o=e,e=r(e),void 0!==u&&p.hasValue){var t=p.value;if(u(t,e))return i=t}return i=e}if(t=i,s(o,e))return t;var n=r(e);return void 0!==u&&u(t,n)?t:(o=e,i=n)}var o,i,a=!1,c=void 0===n?null:n;return[function(){return e(t())},null===c?void 0:function(){return e(c())}]}),[t,n,r,u]);var h=o(e,d[0],d[1]);return a((function(){p.hasValue=!0,p.value=h}),[h]),l(h),h}},6728:(e,t,n)=>{"use strict";e.exports=n(7556)},9150:e=>{"use strict";e.exports=require("preact")},1864:e=>{"use strict";e.exports=require("preact/compat")},8056:e=>{"use strict";e.exports=require("preact/hooks")},784:e=>{"use strict";e.exports=require("preact/jsx-runtime")},3120:(e,t,n)=>{"use strict";n.d(t,{eS:()=>ae,Uh:()=>Q,aw:()=>ve,is:()=>xe,CF:()=>de,i0:()=>le});var r=Symbol.for("immer-nothing"),s=Symbol.for("immer-draftable"),o=Symbol.for("immer-state");function i(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var a=Object.getPrototypeOf;function c(e){return!!e&&!!e[o]}function l(e){return!!e&&(d(e)||Array.isArray(e)||!!e[s]||!!e.constructor?.[s]||v(e)||g(e))}var u=Object.prototype.constructor.toString();function d(e){if(!e||"object"!=typeof e)return!1;const t=a(e);if(null===t)return!0;const n=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return n===Object||"function"==typeof n&&Function.toString.call(n)===u}function p(e,t){0===h(e)?Object.entries(e).forEach((([n,r])=>{t(n,r,e)})):e.forEach(((n,r)=>t(r,n,e)))}function h(e){const t=e[o];return t?t.type_:Array.isArray(e)?1:v(e)?2:g(e)?3:0}function f(e,t){return 2===h(e)?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function m(e,t,n){const r=h(e);2===r?e.set(t,n):3===r?e.add(n):e[t]=n}function v(e){return e instanceof Map}function g(e){return e instanceof Set}function y(e){return e.copy_||e.base_}function b(e,t){if(v(e))return new Map(e);if(g(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);if(!t&&d(e)){if(!a(e)){const t=Object.create(null);return Object.assign(t,e)}return{...e}}const n=Object.getOwnPropertyDescriptors(e);delete n[o];let r=Reflect.ownKeys(n);for(let t=0;t<r.length;t++){const s=r[t],o=n[s];!1===o.writable&&(o.writable=!0,o.configurable=!0),(o.get||o.set)&&(n[s]={configurable:!0,writable:!0,enumerable:o.enumerable,value:e[s]})}return Object.create(a(e),n)}function w(e,t=!1){return C(e)||c(e)||!l(e)||(h(e)>1&&(e.set=e.add=e.clear=e.delete=x),Object.freeze(e),t&&p(e,((e,t)=>w(t,!0)))),e}function x(){i(2)}function C(e){return Object.isFrozen(e)}var _,j={};function E(e){const t=j[e];return t||i(0),t}function S(){return _}function T(e,t){t&&(E("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function k(e){O(e),e.drafts_.forEach(I),e.drafts_=null}function O(e){e===_&&(_=e.parent_)}function N(e){return _={drafts_:[],parent_:_,immer_:e,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function I(e){const t=e[o];0===t.type_||1===t.type_?t.revoke_():t.revoked_=!0}function U(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];return void 0!==e&&e!==n?(n[o].modified_&&(k(t),i(4)),l(e)&&(e=A(t,e),t.parent_||M(t,e)),t.patches_&&E("Patches").generateReplacementPatches_(n[o].base_,e,t.patches_,t.inversePatches_)):e=A(t,n,[]),k(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==r?e:void 0}function A(e,t,n){if(C(t))return t;const r=t[o];if(!r)return p(t,((s,o)=>R(e,r,t,s,o,n))),t;if(r.scope_!==e)return t;if(!r.modified_)return M(e,r.base_,!0),r.base_;if(!r.finalized_){r.finalized_=!0,r.scope_.unfinalizedDrafts_--;const t=r.copy_;let s=t,o=!1;3===r.type_&&(s=new Set(t),t.clear(),o=!0),p(s,((s,i)=>R(e,r,t,s,i,n,o))),M(e,t,!1),n&&e.patches_&&E("Patches").generatePatches_(r,n,e.patches_,e.inversePatches_)}return r.copy_}function R(e,t,n,r,s,o,i){if(c(s)){const i=A(e,s,o&&t&&3!==t.type_&&!f(t.assigned_,r)?o.concat(r):void 0);if(m(n,r,i),!c(i))return;e.canAutoFreeze_=!1}else i&&n.add(s);if(l(s)&&!C(s)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;A(e,s),t&&t.scope_.parent_||M(e,s)}}function M(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&w(t,n)}var P={get(e,t){if(t===o)return e;const n=y(e);if(!f(n,t))return function(e,t,n){const r=F(t,n);return r?"value"in r?r.value:r.get?.call(e.draft_):void 0}(e,n,t);const r=n[t];return e.finalized_||!l(r)?r:r===D(e.base_,t)?(z(e),e.copy_[t]=$(r,e)):r},has:(e,t)=>t in y(e),ownKeys:e=>Reflect.ownKeys(y(e)),set(e,t,n){const r=F(y(e),t);if(r?.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const r=D(y(e),t),a=r?.[o];if(a&&a.base_===n)return e.copy_[t]=n,e.assigned_[t]=!1,!0;if(((s=n)===(i=r)?0!==s||1/s==1/i:s!=s&&i!=i)&&(void 0!==n||f(e.base_,t)))return!0;z(e),B(e)}var s,i;return e.copy_[t]===n&&(void 0!==n||t in e.copy_)||Number.isNaN(n)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=n,e.assigned_[t]=!0),!0},deleteProperty:(e,t)=>(void 0!==D(e.base_,t)||t in e.base_?(e.assigned_[t]=!1,z(e),B(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0),getOwnPropertyDescriptor(e,t){const n=y(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r?{writable:!0,configurable:1!==e.type_||"length"!==t,enumerable:r.enumerable,value:n[t]}:r},defineProperty(){i(11)},getPrototypeOf:e=>a(e.base_),setPrototypeOf(){i(12)}},L={};function D(e,t){const n=e[o];return(n?y(n):e)[t]}function F(e,t){if(!(t in e))return;let n=a(e);for(;n;){const e=Object.getOwnPropertyDescriptor(n,t);if(e)return e;n=a(n)}}function B(e){e.modified_||(e.modified_=!0,e.parent_&&B(e.parent_))}function z(e){e.copy_||(e.copy_=b(e.base_,e.scope_.immer_.useStrictShallowCopy_))}function $(e,t){const n=v(e)?E("MapSet").proxyMap_(e,t):g(e)?E("MapSet").proxySet_(e,t):function(e,t){const n=Array.isArray(e),r={type_:n?1:0,scope_:t?t.scope_:S(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let s=r,o=P;n&&(s=[r],o=L);const{revoke:i,proxy:a}=Proxy.revocable(s,o);return r.draft_=a,r.revoke_=i,a}(e,t);return(t?t.scope_:S()).drafts_.push(n),n}function V(e){return c(e)||i(10),H(e)}function H(e){if(!l(e)||C(e))return e;const t=e[o];let n;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=b(e,t.scope_.immer_.useStrictShallowCopy_)}else n=b(e,!0);return p(n,((e,t)=>{m(n,e,H(t))})),t&&(t.finalized_=!1),n}p(P,((e,t)=>{L[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}})),L.deleteProperty=function(e,t){return L.set.call(this,e,t,void 0)},L.set=function(e,t,n){return P.set.call(this,e[0],t,n,e[0])};var K=new class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(e,t,n)=>{if("function"==typeof e&&"function"!=typeof t){const n=t;t=e;const r=this;return function(e=n,...s){return r.produce(e,(e=>t.call(this,e,...s)))}}let s;if("function"!=typeof t&&i(6),void 0!==n&&"function"!=typeof n&&i(7),l(e)){const r=N(this),o=$(e,void 0);let i=!0;try{s=t(o),i=!1}finally{i?k(r):O(r)}return T(r,n),U(s,r)}if(!e||"object"!=typeof e){if(s=t(e),void 0===s&&(s=e),s===r&&(s=void 0),this.autoFreeze_&&w(s,!0),n){const t=[],r=[];E("Patches").generateReplacementPatches_(e,s,t,r),n(t,r)}return s}i(1)},this.produceWithPatches=(e,t)=>{if("function"==typeof e)return(t,...n)=>this.produceWithPatches(t,(t=>e(t,...n)));let n,r;return[this.produce(e,t,((e,t)=>{n=e,r=t})),n,r]},"boolean"==typeof e?.autoFreeze&&this.setAutoFreeze(e.autoFreeze),"boolean"==typeof e?.useStrictShallowCopy&&this.setUseStrictShallowCopy(e.useStrictShallowCopy)}createDraft(e){l(e)||i(8),c(e)&&(e=V(e));const t=N(this),n=$(e,void 0);return n[o].isManual_=!0,O(t),n}finishDraft(e,t){const n=e&&e[o];n&&n.isManual_||i(9);const{scope_:r}=n;return T(r,t),U(void 0,r)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}applyPatches(e,t){let n;for(n=t.length-1;n>=0;n--){const r=t[n];if(0===r.path.length&&"replace"===r.op){e=r.value;break}}n>-1&&(t=t.slice(n+1));const r=E("Patches").applyPatches_;return c(e)?r(e,t):this.produce(e,(e=>r(e,t)))}},W=K.produce;K.produceWithPatches.bind(K),K.setAutoFreeze.bind(K),K.setUseStrictShallowCopy.bind(K),K.applyPatches.bind(K),K.createDraft.bind(K),K.finishDraft.bind(K);var q=n(8888),G=n(8608),Y=n(9272),J=(((...e)=>{const t=(0,q.qu)(...e),n=Object.assign(((...e)=>{const n=t(...e),r=(e,...t)=>n(c(e)?V(e):e,...t);return Object.assign(r,n),r}),{withTypes:()=>n})})(q.$S),"undefined"!=typeof window&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(0!==arguments.length)return"object"==typeof arguments[0]?G.Jn:G.Jn.apply(null,arguments)}),X=("undefined"!=typeof window&&window.__REDUX_DEVTOOLS_EXTENSION__&&window.__REDUX_DEVTOOLS_EXTENSION__,e=>e&&"function"==typeof e.match);function Q(e,t){function n(...n){if(t){let r=t(...n);if(!r)throw new Error(Oe(0));return{type:e,payload:r.payload,..."meta"in r&&{meta:r.meta},..."error"in r&&{error:r.error}}}return{type:e,payload:n[0]}}return n.toString=()=>`${e}`,n.type=e,n.match=t=>(0,G.Eh)(t)&&t.type===e,n}var Z=class e extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,e.prototype)}static get[Symbol.species](){return e}concat(...e){return super.concat.apply(this,e)}prepend(...t){return 1===t.length&&Array.isArray(t[0])?new e(...t[0].concat(this)):new e(...t.concat(this))}};function ee(e){return l(e)?W(e,(()=>{})):e}function te(e,t,n){if(e.has(t)){let r=e.get(t);return n.update&&(r=n.update(r,t,e),e.set(t,r)),r}if(!n.insert)throw new Error(Oe(10));const r=n.insert(t,e);return e.set(t,r),r}var ne=()=>function(e){const{thunk:t=!0,immutableCheck:n=!0,serializableCheck:r=!0,actionCreatorCheck:s=!0}=e??{};let o=new Z;return t&&("boolean"==typeof t?o.push(Y.y):o.push((0,Y.g)(t.extraArgument))),o},re=e=>t=>{setTimeout(t,e)},se="undefined"!=typeof window&&window.requestAnimationFrame?window.requestAnimationFrame:re(10),oe=e=>function(t){const{autoBatch:n=!0}=t??{};let r=new Z(e);return n&&r.push(((e={type:"raf"})=>t=>(...n)=>{const r=t(...n);let s=!0,o=!1,i=!1;const a=new Set,c="tick"===e.type?queueMicrotask:"raf"===e.type?se:"callback"===e.type?e.queueNotification:re(e.timeout),l=()=>{i=!1,o&&(o=!1,a.forEach((e=>e())))};return Object.assign({},r,{subscribe(e){const t=r.subscribe((()=>s&&e()));return a.add(e),()=>{t(),a.delete(e)}},dispatch(e){try{return s=!e?.meta?.RTK_autoBatch,o=!s,o&&(i||(i=!0,c(l))),r.dispatch(e)}finally{s=!0}}})})("object"==typeof n?n:void 0)),r},ie=!0;function ae(e){const t=ne(),{reducer:n,middleware:r,devTools:s=!0,preloadedState:o,enhancers:i}=e||{};let a,c;if("function"==typeof n)a=n;else{if(!(0,G.oF)(n))throw new Error(Oe(1));a=(0,G.TL)(n)}if(!ie&&r&&"function"!=typeof r)throw new Error(Oe(2));if("function"==typeof r){if(c=r(t),!ie&&!Array.isArray(c))throw new Error(Oe(3))}else c=t();if(!ie&&c.some((e=>"function"!=typeof e)))throw new Error(Oe(4));let l=G.Jn;s&&(l=J({trace:!ie,..."object"==typeof s&&s}));const u=(0,G.d4)(...c),d=oe(u);if(!ie&&i&&"function"!=typeof i)throw new Error(Oe(5));let p="function"==typeof i?i(d):d();if(!ie&&!Array.isArray(p))throw new Error(Oe(6));if(!ie&&p.some((e=>"function"!=typeof e)))throw new Error(Oe(7));ie||!c.length||p.includes(u)||console.error("middlewares were provided, but middleware enhancer was not included in final enhancers - make sure to call `getDefaultEnhancers`");const h=l(...p);return(0,G.eC)(a,o,h)}function ce(e){const t={},n=[];let r;const s={addCase(e,n){const r="string"==typeof e?e:e.type;if(!r)throw new Error(Oe(28));if(r in t)throw new Error(Oe(29));return t[r]=n,s},addMatcher:(e,t)=>(n.push({matcher:e,reducer:t}),s),addDefaultCase:e=>(r=e,s)};return e(s),[t,n,r]}var le=(e=21)=>{let t="",n=e;for(;n--;)t+="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW"[64*Math.random()|0];return t},ue=(e,t)=>X(e)?e.match(t):e(t);function de(...e){return t=>e.some((e=>ue(e,t)))}var pe=["name","message","stack","code"],he=class{constructor(e,t){this.payload=e,this.meta=t}_type},fe=class{constructor(e,t){this.payload=e,this.meta=t}_type},me=e=>{if("object"==typeof e&&null!==e){const t={};for(const n of pe)"string"==typeof e[n]&&(t[n]=e[n]);return t}return{message:String(e)}},ve=(()=>{function e(e,t,n){const r=Q(e+"/fulfilled",((e,t,n,r)=>({payload:e,meta:{...r||{},arg:n,requestId:t,requestStatus:"fulfilled"}}))),s=Q(e+"/pending",((e,t,n)=>({payload:void 0,meta:{...n||{},arg:t,requestId:e,requestStatus:"pending"}}))),o=Q(e+"/rejected",((e,t,r,s,o)=>({payload:s,error:(n&&n.serializeError||me)(e||"Rejected"),meta:{...o||{},arg:r,requestId:t,rejectedWithValue:!!s,requestStatus:"rejected",aborted:"AbortError"===e?.name,condition:"ConditionError"===e?.name}})));return Object.assign((function(e){return(i,a,c)=>{const l=n?.idGenerator?n.idGenerator(e):le(),u=new AbortController;let d,p;function h(e){p=e,u.abort()}const f=async function(){let f;try{let o=n?.condition?.(e,{getState:a,extra:c});if(null!==(m=o)&&"object"==typeof m&&"function"==typeof m.then&&(o=await o),!1===o||u.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};const v=new Promise(((e,t)=>{d=()=>{t({name:"AbortError",message:p||"Aborted"})},u.signal.addEventListener("abort",d)}));i(s(l,e,n?.getPendingMeta?.({requestId:l,arg:e},{getState:a,extra:c}))),f=await Promise.race([v,Promise.resolve(t(e,{dispatch:i,getState:a,extra:c,requestId:l,signal:u.signal,abort:h,rejectWithValue:(e,t)=>new he(e,t),fulfillWithValue:(e,t)=>new fe(e,t)})).then((t=>{if(t instanceof he)throw t;return t instanceof fe?r(t.payload,l,e,t.meta):r(t,l,e)}))])}catch(t){f=t instanceof he?o(null,l,e,t.payload,t.meta):o(t,l,e)}finally{d&&u.signal.removeEventListener("abort",d)}var m;return n&&!n.dispatchConditionRejection&&o.match(f)&&f.meta.condition||i(f),f}();return Object.assign(f,{abort:h,requestId:l,arg:e,unwrap:()=>f.then(ge)})}}),{pending:s,rejected:o,fulfilled:r,settled:de(o,r),typePrefix:e})}return e.withTypes=()=>e,e})();function ge(e){if(e.meta&&e.meta.rejectedWithValue)throw e.payload;if(e.error)throw e.error;return e.payload}var ye=Symbol.for("rtk-slice-createasyncthunk");function be(e,t){return`${e}/${t}`}function we(e,t,n,r){function s(s,...o){let i=t(s);return void 0===i&&r&&(i=n()),e(i,...o)}return s.unwrapped=e,s}var xe=function({creators:e}={}){const t=e?.asyncThunk?.[ye];return function(e){const{name:n,reducerPath:r=n}=e;if(!n)throw new Error(Oe(11));const s=("function"==typeof e.reducers?e.reducers(function(){function e(e,t){return{_reducerDefinitionType:"asyncThunk",payloadCreator:e,...t}}return e.withTypes=()=>e,{reducer:e=>Object.assign({[e.name]:(...t)=>e(...t)}[e.name],{_reducerDefinitionType:"reducer"}),preparedReducer:(e,t)=>({_reducerDefinitionType:"reducerWithPrepare",prepare:e,reducer:t}),asyncThunk:e}}()):e.reducers)||{},o=Object.keys(s),i={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},a={addCase(e,t){const n="string"==typeof e?e:e.type;if(!n)throw new Error(Oe(12));if(n in i.sliceCaseReducersByType)throw new Error(Oe(13));return i.sliceCaseReducersByType[n]=t,a},addMatcher:(e,t)=>(i.sliceMatchers.push({matcher:e,reducer:t}),a),exposeAction:(e,t)=>(i.actionCreators[e]=t,a),exposeCaseReducer:(e,t)=>(i.sliceCaseReducersByName[e]=t,a)};function u(){const[t={},n=[],r]="function"==typeof e.extraReducers?ce(e.extraReducers):[e.extraReducers],s={...t,...i.sliceCaseReducersByType};return function(e,t){let o,[a,u,d]=ce((e=>{for(let t in s)e.addCase(t,s[t]);for(let t of i.sliceMatchers)e.addMatcher(t.matcher,t.reducer);for(let t of n)e.addMatcher(t.matcher,t.reducer);r&&e.addDefaultCase(r)}));if("function"==typeof e)o=()=>ee(e());else{const t=ee(e);o=()=>t}function p(e=o(),t){let n=[a[t.type],...u.filter((({matcher:e})=>e(t))).map((({reducer:e})=>e))];return 0===n.filter((e=>!!e)).length&&(n=[d]),n.reduce(((e,n)=>{if(n){if(c(e)){const r=n(e,t);return void 0===r?e:r}if(l(e))return W(e,(e=>n(e,t)));{const r=n(e,t);if(void 0===r){if(null===e)return e;throw new Error(Oe(9))}return r}}return e}),e)}return p.getInitialState=o,p}(e.initialState)}o.forEach((r=>{const o=s[r],i={reducerName:r,type:be(n,r),createNotation:"function"==typeof e.reducers};!function(e){return"asyncThunk"===e._reducerDefinitionType}(o)?function({type:e,reducerName:t,createNotation:n},r,s){let o,i;if("reducer"in r){if(n&&!function(e){return"reducerWithPrepare"===e._reducerDefinitionType}(r))throw new Error(Oe(17));o=r.reducer,i=r.prepare}else o=r;s.addCase(e,o).exposeCaseReducer(t,o).exposeAction(t,i?Q(e,i):Q(e))}(i,o,a):function({type:e,reducerName:t},n,r,s){if(!s)throw new Error(Oe(18));const{payloadCreator:o,fulfilled:i,pending:a,rejected:c,settled:l,options:u}=n,d=s(e,o,u);r.exposeAction(t,d),i&&r.addCase(d.fulfilled,i),a&&r.addCase(d.pending,a),c&&r.addCase(d.rejected,c),l&&r.addMatcher(d.settled,l),r.exposeCaseReducer(t,{fulfilled:i||Ce,pending:a||Ce,rejected:c||Ce,settled:l||Ce})}(i,o,a,t)}));const d=e=>e,p=new Map;let h;function f(e,t){return h||(h=u()),h(e,t)}function m(){return h||(h=u()),h.getInitialState()}function v(t,n=!1){function r(e){let r=e[t];return void 0===r&&n&&(r=m()),r}function s(t=d){const r=te(p,n,{insert:()=>new WeakMap});return te(r,t,{insert:()=>{const r={};for(const[s,o]of Object.entries(e.selectors??{}))r[s]=we(o,t,m,n);return r}})}return{reducerPath:t,getSelectors:s,get selectors(){return s(r)},selectSlice:r}}const g={name:n,reducer:f,actions:i.actionCreators,caseReducers:i.sliceCaseReducersByName,getInitialState:m,...v(r),injectInto(e,{reducerPath:t,...n}={}){const s=t??r;return e.inject({reducerPath:s,reducer:f},n),{...g,...v(s,!0)}}};return g}}();function Ce(){}var{assign:_e}=Object,je="listenerMiddleware",Ee=e=>{let{type:t,actionCreator:n,matcher:r,predicate:s,effect:o}=e;if(t)s=Q(t).match;else if(n)t=n.type,s=n.match;else if(r)s=r;else if(!s)throw new Error(Oe(21));return((e,t)=>{if("function"!=typeof e)throw new Error(Oe(32))})(o),{predicate:s,type:t,effect:o}},Se=Object.assign((e=>{const{type:t,predicate:n,effect:r}=Ee(e);return{id:le(),effect:r,type:t,predicate:n,pending:new Set,unsubscribe:()=>{throw new Error(Oe(22))}}}),{withTypes:()=>Se}),Te=Object.assign(Q(`${je}/add`),{withTypes:()=>Te}),ke=(Q(`${je}/removeAll`),Object.assign(Q(`${je}/remove`),{withTypes:()=>ke}));function Oe(e){return`Minified Redux Toolkit error #${e}; visit https://redux-toolkit.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}Symbol.for("rtk-state-proxy-original")},2328:(e,t,n)=>{"use strict";n.d(t,{C_:()=>y,OY:()=>_,w1:()=>m});var r=n(144),s=n(6728),o=r.default,i=Symbol.for("react-redux-context"),a="undefined"!=typeof globalThis?globalThis:{};function c(){if(!o.createContext)return{};const e=a[i]??(a[i]=new Map);let t=e.get(o.createContext);return t||(t=o.createContext(null),e.set(o.createContext,t)),t}var l=c();function u(e=l){return function(){return o.useContext(e)}}var d=u(),p=()=>{throw new Error("uSES not initialized!")},h=(e,t)=>e===t;function f(e=l){const t=e===l?d:u(e),n=(e,n={})=>{const{equalityFn:r=h,devModeChecks:s={}}="function"==typeof n?{equalityFn:n}:n,{store:i,subscription:a,getServerState:c,stabilityCheck:l,identityFunctionCheck:u}=t(),d=(o.useRef(!0),o.useCallback({[e.name]:t=>e(t)}[e.name],[e,l,s.stabilityCheck])),f=p(a.addNestedSub,i.getState,c||i.getState,d,r);return o.useDebugValue(f),f};return Object.assign(n,{withTypes:()=>n}),n}var m=f();Symbol.for("react.element"),Symbol.for("react.portal"),Symbol.for("react.fragment"),Symbol.for("react.strict_mode"),Symbol.for("react.profiler"),Symbol.for("react.provider"),Symbol.for("react.context"),Symbol.for("react.server_context"),Symbol.for("react.forward_ref"),Symbol.for("react.suspense"),Symbol.for("react.suspense_list"),Symbol.for("react.memo"),Symbol.for("react.lazy"),Symbol.for("react.offscreen"),Symbol.for("react.client.reference");var v={notify(){},get:()=>[]};var g="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?o.useLayoutEffect:o.useEffect;Object.defineProperty,Object.getOwnPropertyNames,Object.getOwnPropertySymbols,Object.getOwnPropertyDescriptor,Object.getPrototypeOf,Object.prototype;var y=function({store:e,context:t,children:n,serverState:r,stabilityCheck:s="once",identityFunctionCheck:i="once"}){const a=o.useMemo((()=>{const t=function(e,t){let n,r=v,s=0,o=!1;function i(){l.onStateChange&&l.onStateChange()}function a(){s++,n||(n=t?t.addNestedSub(i):e.subscribe(i),r=function(){let e=null,t=null;return{clear(){e=null,t=null},notify(){(()=>{let t=e;for(;t;)t.callback(),t=t.next})()},get(){const t=[];let n=e;for(;n;)t.push(n),n=n.next;return t},subscribe(n){let r=!0;const s=t={callback:n,next:null,prev:t};return s.prev?s.prev.next=s:e=s,function(){r&&null!==e&&(r=!1,s.next?s.next.prev=s.prev:t=s.prev,s.prev?s.prev.next=s.next:e=s.next)}}}}())}function c(){s--,n&&0===s&&(n(),n=void 0,r.clear(),r=v)}const l={addNestedSub:function(e){a();const t=r.subscribe(e);let n=!1;return()=>{n||(n=!0,t(),c())}},notifyNestedSubs:function(){r.notify()},handleChangeWrapper:i,isSubscribed:function(){return o},trySubscribe:function(){o||(o=!0,a())},tryUnsubscribe:function(){o&&(o=!1,c())},getListeners:()=>r};return l}(e);return{store:e,subscription:t,getServerState:r?()=>r:void 0,stabilityCheck:s,identityFunctionCheck:i}}),[e,r,s,i]),c=o.useMemo((()=>e.getState()),[e]);g((()=>{const{subscription:t}=a;return t.onStateChange=t.notifyNestedSubs,t.trySubscribe(),c!==e.getState()&&t.notifyNestedSubs(),()=>{t.tryUnsubscribe(),t.onStateChange=void 0}}),[a,c]);const u=t||l;return o.createElement(u.Provider,{value:a},n)};function b(e=l){const t=e===l?d:u(e),n=()=>{const{store:e}=t();return e};return Object.assign(n,{withTypes:()=>n}),n}var w=b();function x(e=l){const t=e===l?w:b(e),n=()=>t().dispatch;return Object.assign(n,{withTypes:()=>n}),n}var C,_=x();C=s.useSyncExternalStoreWithSelector,p=C,r.useSyncExternalStore},9272:(e,t,n)=>{"use strict";function r(e){return({dispatch:t,getState:n})=>r=>s=>"function"==typeof s?s(t,n,e):r(s)}n.d(t,{g:()=>o,y:()=>s});var s=r(),o=r},8608:(e,t,n)=>{"use strict";function r(e){return`Minified Redux error #${e}; visit https://redux.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}n.d(t,{Eh:()=>p,Jn:()=>u,TL:()=>l,d4:()=>d,eC:()=>c,oF:()=>a});var s=(()=>"function"==typeof Symbol&&Symbol.observable||"@@observable")(),o=()=>Math.random().toString(36).substring(7).split("").join("."),i={INIT:`@@redux/INIT${o()}`,REPLACE:`@@redux/REPLACE${o()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${o()}`};function a(e){if("object"!=typeof e||null===e)return!1;let t=e;for(;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||null===Object.getPrototypeOf(e)}function c(e,t,n){if("function"!=typeof e)throw new Error(r(2));if("function"==typeof t&&"function"==typeof n||"function"==typeof n&&"function"==typeof arguments[3])throw new Error(r(0));if("function"==typeof t&&void 0===n&&(n=t,t=void 0),void 0!==n){if("function"!=typeof n)throw new Error(r(1));return n(c)(e,t)}let o=e,l=t,u=new Map,d=u,p=0,h=!1;function f(){d===u&&(d=new Map,u.forEach(((e,t)=>{d.set(t,e)})))}function m(){if(h)throw new Error(r(3));return l}function v(e){if("function"!=typeof e)throw new Error(r(4));if(h)throw new Error(r(5));let t=!0;f();const n=p++;return d.set(n,e),function(){if(t){if(h)throw new Error(r(6));t=!1,f(),d.delete(n),u=null}}}function g(e){if(!a(e))throw new Error(r(7));if(void 0===e.type)throw new Error(r(8));if("string"!=typeof e.type)throw new Error(r(17));if(h)throw new Error(r(9));try{h=!0,l=o(l,e)}finally{h=!1}return(u=d).forEach((e=>{e()})),e}return g({type:i.INIT}),{dispatch:g,subscribe:v,getState:m,replaceReducer:function(e){if("function"!=typeof e)throw new Error(r(10));o=e,g({type:i.REPLACE})},[s]:function(){const e=v;return{subscribe(t){if("object"!=typeof t||null===t)throw new Error(r(11));function n(){const e=t;e.next&&e.next(m())}return n(),{unsubscribe:e(n)}},[s](){return this}}}}}function l(e){const t=Object.keys(e),n={};for(let r=0;r<t.length;r++){const s=t[r];"function"==typeof e[s]&&(n[s]=e[s])}const s=Object.keys(n);let o;try{!function(e){Object.keys(e).forEach((t=>{const n=e[t];if(void 0===n(void 0,{type:i.INIT}))throw new Error(r(12));if(void 0===n(void 0,{type:i.PROBE_UNKNOWN_ACTION()}))throw new Error(r(13))}))}(n)}catch(e){o=e}return function(e={},t){if(o)throw o;let i=!1;const a={};for(let o=0;o<s.length;o++){const c=s[o],l=n[c],u=e[c],d=l(u,t);if(void 0===d)throw t&&t.type,new Error(r(14));a[c]=d,i=i||d!==u}return i=i||s.length!==Object.keys(e).length,i?a:e}}function u(...e){return 0===e.length?e=>e:1===e.length?e[0]:e.reduce(((e,t)=>(...n)=>e(t(...n))))}function d(...e){return t=>(n,s)=>{const o=t(n,s);let i=()=>{throw new Error(r(15))};const a={getState:o.getState,dispatch:(e,...t)=>i(e,...t)},c=e.map((e=>e(a)));return i=u(...c)(o.dispatch),{...o,dispatch:i}}}function p(e){return a(e)&&"type"in e&&"string"==typeof e.type}},8888:(e,t,n)=>{"use strict";n.d(t,{$S:()=>c,M3:()=>u,qu:()=>l});var r=e=>Array.isArray(e)?e:[e];Symbol(),Object.getPrototypeOf({});var s="undefined"!=typeof WeakRef?WeakRef:class{constructor(e){this.value=e}deref(){return this.value}},o=0,i=1;function a(){return{s:o,v:void 0,o:null,p:null}}function c(e,t={}){let n=a();const{resultEqualityCheck:r}=t;let o,c=0;function l(){let t=n;const{length:l}=arguments;for(let e=0,n=l;e<n;e++){const n=arguments[e];if("function"==typeof n||"object"==typeof n&&null!==n){let e=t.o;null===e&&(t.o=e=new WeakMap);const r=e.get(n);void 0===r?(t=a(),e.set(n,t)):t=r}else{let e=t.p;null===e&&(t.p=e=new Map);const r=e.get(n);void 0===r?(t=a(),e.set(n,t)):t=r}}const u=t;let d;if(t.s===i?d=t.v:(d=e.apply(null,arguments),c++),u.s=i,r){const e=o?.deref?.()??o;null!=e&&r(e,d)&&(d=e,0!==c&&c--),o="object"==typeof d&&null!==d||"function"==typeof d?new s(d):d}return u.v=d,d}return l.clearCache=()=>{n=a(),l.resetResultsCount()},l.resultsCount=()=>c,l.resetResultsCount=()=>{c=0},l}function l(e,...t){const n="function"==typeof e?{memoize:e,memoizeOptions:t}:e,s=(...e)=>{let t,s=0,o=0,i={},a=e.pop();"object"==typeof a&&(i=a,a=e.pop()),function(e,t="expected a function, instead received "+typeof e){if("function"!=typeof e)throw new TypeError(t)}(a,`createSelector expects an output function after the inputs, but received: [${typeof a}]`);const l={...n,...i},{memoize:u,memoizeOptions:d=[],argsMemoize:p=c,argsMemoizeOptions:h=[],devModeChecks:f={}}=l,m=r(d),v=r(h),g=function(e){const t=Array.isArray(e[0])?e[0]:e;return function(e,t="expected all items to be functions, instead received the following types: "){if(!e.every((e=>"function"==typeof e))){const n=e.map((e=>"function"==typeof e?`function ${e.name||"unnamed"}()`:typeof e)).join(", ");throw new TypeError(`${t}[${n}]`)}}(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}(e),y=u((function(){return s++,a.apply(null,arguments)}),...m),b=p((function(){o++;const e=function(e,t){const n=[],{length:r}=e;for(let s=0;s<r;s++)n.push(e[s].apply(null,t));return n}(g,arguments);return t=y.apply(null,e),t}),...v);return Object.assign(b,{resultFunc:a,memoizedResultFunc:y,dependencies:g,dependencyRecomputations:()=>o,resetDependencyRecomputations:()=>{o=0},lastResult:()=>t,recomputations:()=>s,resetRecomputations:()=>{s=0},memoize:u,argsMemoize:p})};return Object.assign(s,{withTypes:()=>s}),s}var u=l(c),d=Object.assign(((e,t=u)=>{!function(e,t="expected an object, instead received "+typeof e){if("object"!=typeof e)throw new TypeError(t)}(e,"createStructuredSelector expects first argument to be an object where each property is a selector, instead received a "+typeof e);const n=Object.keys(e);return t(n.map((t=>e[t])),((...e)=>e.reduce(((e,t,r)=>(e[n[r]]=t,e)),{})))}),{withTypes:()=>d})}},t={};function n(r){var s=t[r];if(void 0!==s)return s.exports;var o=t[r]={exports:{}};return e[r](o,o.exports,n),o.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;n.g.importScripts&&(e=n.g.location+"");var t=n.g.document;if(!e&&t&&(t.currentScript&&(e=t.currentScript.src),!e)){var r=t.getElementsByTagName("script");if(r.length)for(var s=r.length-1;s>-1&&!e;)e=r[s--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),n.p=e})();var r={};(()=>{"use strict";n.r(r),n.d(r,{Engine:()=>Wr,ExternalApi:()=>Yr,calculateVisibility:()=>e.g,className:()=>t.U,eventTypes:()=>re.Iz,getSearchParamsByKeys:()=>Jr,initResetSearchParams:()=>Qr,randomId:()=>v.s,replaceSearchParams:()=>Xr});var e=n(3576),t=n(8544),s=n(784),o=n(1792),i=n.n(o),a=n(9150);class c extends Error{constructor(e,t){super(e,{cause:null==t?void 0:t.cause}),this.status=null==t?void 0:t.status}}var l=n(3872),u=n(2704),d=n(6232),p=n(1120),h=n(7548),f=n(5576),m=n.n(f),v=n(1676);function g(e){const t=`cvco.${e}`;return{get(){const e=[t,t.split(".").slice(0,-1).join(".")];let n;do{n=sessionStorage.getItem(e[0])}while(e.shift()&&!n);return JSON.parse(n)},set(e){e&&sessionStorage.setItem(t,JSON.stringify(e))}}}var y,b,w,x,C,_,j,E,S,T,k,O,N,I,U,A=n(8760),R=n(8412),M=function(e,t,n,r){return new(n||(n=Promise))((function(s,o){function i(e){try{c(r.next(e))}catch(e){o(e)}}function a(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?s(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(i,a)}c((r=r.apply(e,t||[])).next())}))},P=function(e,t,n,r,s){if("m"===r)throw new TypeError("Private method is not writable");if("a"===r&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!s:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?s.call(e,n):s?s.value=n:t.set(e,n),n},L=function(e,t,n,r){if("a"===n&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?r:"a"===n?r.call(e):r?r.value:t.get(e)};const D=m()("seamly"),F=(e,t)=>M(void 0,void 0,void 0,(function*(){const n=new URL(e);n.searchParams.set("v",h.kR);const r=yield fetch(n.href,Object.assign({mode:"cors"},t));if(!r.ok)throw new c(r.statusText||`Request failed with status: ${r.status}`,{status:r.status});return r}));function B(){if(!Intl||"undefined"==typeof Intl||void 0===Intl.DateTimeFormat)return null;const e=Intl.DateTimeFormat();if(void 0===e||void 0===e.resolvedOptions)return null;const t=e.resolvedOptions().timeZone;return t&&(t.indexOf("/")>-1||"UTC"===t)?t:null}class z{constructor({layoutMode:e,namespace:t,config:n,context:r}){var s;y.add(this),b.set(this,void 0),w.set(this,void 0),x.set(this,void 0),C.set(this,void 0),_.set(this,void 0),this.conversation=new R.c,O.set(this,(e=>e||this.locale)),this.store=function(e,t){const n=t(e),r=n.get()||{};return{get:e=>void 0===e?r:r[e],set:(e,t)=>(r[e]=t,n.set(r),t),delete(e){const t=this.get(e);return delete r[e],n.set(r),t}}}(`${t}.connection${r.userLocale?`.${r.userLocale}`:""}`,n.storageProvider||g),this.connectionInfo={apiKey:n.key,domain:n.domain||"api.seamly-app.com",secure:!1!==n.secure&&(n.secure||!0)},P(this,_,Object.assign(Object.assign({},n),{sendEnvironment:null===(s=n.sendEnvironment)||void 0===s||s,context:Object.assign(Object.assign({},r),{channelName:r.channelName||"web"})}),"f"),P(this,b,!1,"f"),this.connected=!1,this.configReady=!1,P(this,w,n.externalId,"f"),P(this,C,e,"f"),this.userResponded=!1,this.URLS={},window.addEventListener("pageshow",(e=>{e.persisted&&this.connected&&this.connect()}))}getConversationUrl(){return this.store.get("conversationUrl")}hasConversation(){return!!this.getConversationUrl()}clearStore(){this.store.delete("accessToken"),this.store.delete("conversationUrl"),this.store.delete("channelName"),this.store.delete("channelTopic")}reset(){return M(this,void 0,void 0,(function*(){return yield this.disconnect(),this.clearStore(),this.getConfig()}))}disconnect(){var e;return M(this,void 0,void 0,(function*(){(null===(e=this.conversation)||void 0===e?void 0:e.disconnect)&&this.conversation.disconnect(),this.connected=!1,this.configReady=!1}))}getConfig(){return M(this,void 0,void 0,(function*(){try{const e=yield F(`${L(this,y,"m",N).call(this,"http")}/client/${this.connectionInfo.apiKey}/configs`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({context:Object.assign(Object.assign({},L(this,_,"f").context),{environment:!0===L(this,_,"f").sendEnvironment?this.getEnvironment():L(this,_,"f").sendEnvironment})})}),t=yield e.json();return L(this,y,"m",I).call(this,t),this.configReady=!0,t.config}catch(e){if(404===e.status)throw new l.c(e);if(e.status>=500)throw new u.c(e);throw e}}))}getConversation(){return M(this,void 0,void 0,(function*(){if(!this.hasConversation())return null;try{const e=yield F(`${L(this,y,"m",N).call(this,"http")}${this.URLS.history}`,{method:"GET",headers:{Authorization:`Bearer ${L(this,y,"m",j).call(this)}`}}),t=yield e.json();L(this,y,"m",I).call(this,t);const{messages:n,participants:r,activeServiceSessionId:s,activeServiceSettings:o,serviceData:i,ui:a,translation:c}=t.history;return{events:n.map((([e,t])=>({type:e,payload:Object.assign(Object.assign({},t),{type:"participant"===e?e:t.type})}))),participants:r,activeServiceSessionId:s,activeServiceSettings:o,serviceData:i,resumeConversationPrompt:!!a&&Boolean(a.resumeConversationPrompt),translationProposal:a.translationProposal,translation:c}}catch(e){if(401===e.status)throw new p.c(e);if(404===e.status)throw new d.c(e);if(e.status>=500)throw new u.c(e);throw new c(e)}}))}connect(){return M(this,void 0,void 0,(function*(){this.connected=!1;let e={};return this.hasConversation()||(e=yield L(this,y,"m",U).call(this)),this.conversation.connect(`${L(this,y,"m",N).call(this,"ws")}${this.URLS.socket}`,L(this,_,"f").context.channelName,L(this,y,"m",T).call(this),L(this,y,"m",j).call(this)),this.conversation.onConnection((({connected:e,ready:t})=>{this.connected=e,P(this,b,t,"f")})),e}))}uploadFile(e,t,n,r){const s=new FormData;s.append("upload",e);const o=new XMLHttpRequest;return o.open("POST",`${L(this,y,"m",N).call(this,"http")}${this.URLS.uploads}`),o.setRequestHeader("Authorization",`Bearer ${L(this,y,"m",j).call(this)}`),o.upload.onprogress=e=>{if("function"==typeof t){const n=Math.ceil(e.loaded/e.total*100);t(n)}},o.onloadend=()=>{if(0!==o.status)if(200!==o.status&&201!==o.status||!n){if(!r)throw new Error(o.response);try{r(JSON.parse(o.response))}catch(e){r(o.response)}}else try{n(JSON.parse(o.response))}catch(e){n(o.response)}},o.send(s),o}getConversationIntitialState(){return M(this,void 0,void 0,(function*(){try{const e=yield F(`${L(this,y,"m",N).call(this,"http")}${this.getConversationUrl()}`,{method:"GET",headers:{Authorization:`Bearer ${L(this,y,"m",j).call(this)}`}}),t=yield e.json();return L(this,y,"m",I).call(this,t),this.userResponded=t.conversation.userResponded,(0,A.qn)(t.conversation,["accessToken","channelTopic"])}catch(e){if(401===e.status)throw new p.c(e);if(404===e.status)throw new d.c(e);if(e.status>=500)throw new u.c(e);throw e}}))}getTranslations(e){return M(this,void 0,void 0,(function*(){try{if(!this.URLS.translations)throw new l.c;const t=`${L(this,y,"m",N).call(this,"http")}${this.URLS.translations}`.replace("{version}",String(4)).replace("{locale}",L(this,O,"f").call(this,e)),n=yield F(t,{method:"GET"});return(yield n.json()).translations}catch(e){if(e.status>=500)throw new u.c(e);throw new c(e)}}))}send(e,t,n=!0){var r;!this.connected||n&&!L(this,b,"f")?null===(r=this.conversation)||void 0===r||r.onConnection((({connected:r,ready:s})=>(this.connected=r,P(this,b,s,"f"),!!(n?s:r)&&(this.send(e,t,n),!0)))):(D("[SEND]",e,t),this.conversation.pushToChannel(e,function(e,t){if("message"!==e)return t;const{type:n,body:r}=t;let{transactionId:s}=t;return s||(s=(0,v.s)()),{type:n,body:r,transactionId:s}}(e,t),1e4))}sendContext(e){const{contentLocale:t,userLocale:n,variables:r,environment:s}=e,o={};if(s&&(o.environment=s),t){if("string"!=typeof t)throw new Error("Content locale must be a string");o.contentLocale=t}if(n){if("string"!=typeof n)throw new Error("User locale must be a string");o.userLocale=n}if(r){if("object"!=typeof r)throw new Error("Variables must be an object");o.variables=r}0===Object.keys(o).length&&o.constructor===Object||this.send("context",o,!1)}getEnvironment(){return{clientName:"@seamly/web-ui",clientVariant:L(this,C,"f"),clientVersion:"22.3.6",currentUrl:window.location.toString(),screenResolution:`${window.screen.width}x${window.screen.height}`,timezone:B(),userAgent:navigator.userAgent,preferredLocale:navigator.language}}}b=new WeakMap,w=new WeakMap,x=new WeakMap,C=new WeakMap,_=new WeakMap,O=new WeakMap,y=new WeakSet,j=function(){return this.store.get("accessToken")},E=function(e){this.store.set("accessToken",e)},S=function(e){this.store.set("conversationUrl",e)},T=function(){return this.store.get("channelTopic")||this.store.get("channelName")},k=function(e){this.store.set("channelTopic",e)},N=function(e){return`${this.connectionInfo.secure?`${e}s`:e}://${this.connectionInfo.domain}`},I=function({_links:e}){this.URLS=Object.entries(e).filter((([e])=>"self"!==e)).reduce(((e,[t,{href:n}])=>Object.assign(Object.assign({},e),{[t]:n})),this.URLS)},U=function(){var e,t;return M(this,void 0,void 0,(function*(){try{"function"==typeof(null===(e=L(this,_,"f"))||void 0===e?void 0:e.getConversationAuthToken)&&P(this,x,yield L(this,_,"f").getConversationAuthToken(),"f");const n=yield F(`${L(this,y,"m",N).call(this,"http")}${this.URLS.conversations}`,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({externalId:L(this,x,"f")?void 0:L(this,w,"f"),token:L(this,x,"f")})}),r=yield n.json(),{conversation:s}=r,o=Object.assign({},s);return delete o.accessToken,delete o.channelTopic,L(this,y,"m",E).call(this,s.accessToken),L(this,y,"m",k).call(this,s.channelTopic),L(this,y,"m",I).call(this,r),L(this,y,"m",S).call(this,this.URLS.conversation),this.locale=null===(t=s.translation)||void 0===t?void 0:t.locale,this.userResponded=s.userResponded,o}catch(e){if(e.status>=500)throw new u.c(e);if(400===e.status)throw new p.c(e);if(404===e.status)throw new l.c(e);throw e}}))};var $=n(232),V=n(712),H=n(7452),K=n(1760),W=n(2948),q=n(8056),G=n(2328),Y=n(1364),J=n(3460);const X=({children:e})=>((0,J.c)(),(0,s.jsx)(s.Fragment,{children:e}));var Q=n(5352);const Z=(0,a.createContext)({});var ee=n(7456),te=n(7800),ne=n(6204),re=n(6244);const se=({id:e,action:n,buttonText:r,description:o,hasFocus:i,image:a,title:c,isCarouselItem:l})=>{const u=(0,q.useRef)(null),{sendMessage:d,sendAction:p,emitEvent:h}=(0,ne.wv)(),f=(0,ne.k3)(),m=(0,q.useRef)(!1),v=n.type===re.Qv.navigate?"a":"button",g=(0,q.useCallback)((()=>h(`action.${re.w$.clickCard}`,{type:re.w$.clickCta,originMessage:e,action:n})),[h,e,n]),y=(0,q.useCallback)((()=>{if(g(),n.type===re.Qv.ask)d({body:n.ask});else if(n.type===re.Qv.topic){const{topic:e,fallbackMessage:t}=n;p({type:re.w$.setTopic,body:{name:e,fallbackMessage:t}})}}),[d,n,p,g]),b=(0,q.useMemo)((()=>n.type===re.Qv.navigate?{href:n.link,rel:"noopener noreferrer",target:n.newTab?"_blank":"_self",onClick:g}:{onClick:y}),[n,y,g]);return(0,q.useEffect)((()=>{l&&(i&&m.current?window.requestAnimationFrame((()=>u.current.focus())):u.current.blur()),m.current=!0}),[i,l]),(0,s.jsxs)("div",{className:(0,t.U)("card__wrapper"),id:e,tabIndex:-1,ref:u,children:[a?(0,s.jsx)("img",{className:(0,t.U)("card__image"),src:a,alt:""}):null,(0,s.jsxs)("div",{className:(0,t.U)("card__content"),id:e,children:[c&&(0,s.jsx)("h2",{className:(0,t.U)("card__title"),children:c}),o&&(0,s.jsx)("div",{className:(0,t.U)("card__description"),dangerouslySetInnerHTML:{__html:o}}),(0,s.jsx)(v,Object.assign({tabIndex:l&&!i?-1:void 0,className:(0,t.U)("button","button--primary"),"aria-describedby":f},b,{children:r}))]})]})};var oe=n(1800);function ie({item:e,items:n,index:r,isActive:o}){const{t:i}=(0,oe.g)();return(0,s.jsx)("div",{className:(0,t.U)("carousel-item",`carousel-item--${e.type}`),role:"group","aria-roledescription":"slide","aria-label":i("carousel.slide.label",{index:r+1,total:n.length}),children:(0,s.jsx)(se,{...e,isCarouselItem:!0,hasFocus:o})})}var ae=n(1100),ce=n(7888);function le({items:e,currentIndex:n,onChange:r,children:o}){const{t:i}=(0,oe.g)(),a=e.length;return(0,s.jsxs)("div",{className:(0,t.U)("carousel-controls"),children:[(0,s.jsx)("button",{className:(0,t.U)("button","button--previous"),"aria-label":i("carousel.controls.previous"),onClick:()=>{r((n-1+a)%a)},children:(0,s.jsx)(ce.c,{name:"arrowLeft",size:"16",alt:""})}),o,(0,s.jsx)("button",{className:(0,t.U)("button","button--next"),"aria-label":i("carousel.controls.next"),onClick:()=>{r((n+1)%a)},children:(0,s.jsx)(ce.c,{name:"arrowRight",size:"16",alt:""})})]})}function ue({items:e,currentIndex:n,onChange:r,getItemKey:o,getItemLabel:i}){const a=e.length,c=(0,q.useCallback)((e=>{const t=Number(e.target.dataset.item||"0"),s=Math.min(a-1,Math.max(0,t));s!==n&&r(s)}),[a,n,r]);return(0,s.jsx)("div",{className:(0,t.U)("carousel-pagination__wrapper"),role:"group",children:(0,s.jsx)("ul",{className:(0,t.U)("carousel-pagination"),children:e.map(((e,r)=>{const a=n===r;return(0,s.jsx)("li",{className:(0,t.U)("carousel-pagination__item",a?"is-active":void 0),children:(0,s.jsx)("button",{className:(0,t.U)("carousel-pagination__button"),type:"button",onClick:c,"data-item":r,"aria-disabled":a?"true":void 0,"aria-label":i(e,r)})},o(e,r,"pagination-item-"))}))})})}const de=(e,t,n)=>`${n}${t}`,pe=e=>e.label,he=({target:e})=>{e.scrollLeft=0};function fe({currentIndex:e,onChange:n,getItemKey:r=de,getItemLabel:o=pe,items:i}){const c=(0,ae.k3)(),l=i.length,[u,d]=(0,q.useState)(Number(e||"0"));(0,q.useEffect)((()=>{d(Number(e||"0"))}),[d,e]);const p=(0,q.useRef)([]);p.current=(0,q.useMemo)((()=>Array(l).fill(1).map((()=>(0,a.createRef)()))),[l]);const h=(0,q.useRef)(!0),f=(0,q.useRef)();return f.current=n,(0,q.useEffect)((()=>{h.current?h.current=!1:f.current&&f.current(u)}),[u]),(0,s.jsxs)("div",{className:(0,t.U)("carousel"),role:"group","aria-roledescription":"carousel",children:[(0,s.jsx)("div",{className:(0,t.U)("carousel__slides-wrapper"),onScroll:he,children:(0,s.jsx)("div",{id:c,className:(0,t.U)("carousel__slides"),style:{width:100*l+"%",left:-100*u+"%"},"aria-live":"polite","aria-atomic":"false",children:i.map(((e,n)=>{const o=u===n;return(0,s.jsx)("div",{ref:p.current[n],className:(0,t.U)("carousel__slide",o?"is-active":void 0),"aria-hidden":o?void 0:"true",children:(0,s.jsx)(ie,{item:e,items:i,currentIndex:u,index:n,isActive:o})},r(e,n,"item-"))}))})}),(0,s.jsx)("div",{className:(0,t.U)("carousel__controls"),children:(0,s.jsx)(le,{currentIndex:u,items:i,onChange:d,controlId:c,children:(0,s.jsx)("div",{className:(0,t.U)("carousel__pagination"),children:(0,s.jsx)(ue,{currentIndex:u,items:i,onChange:d,getItemKey:r,getItemLabel:o})})})})]})}const me=(e,t,n="")=>`${n}${e.title}:${t}`,ve=e=>e.title;var ge=n(2080),ye=n(1888),be=n(428);const we=e=>`suggestions__item--${String(e).toLowerCase().replace(/[^a-z0-9_\\-]/,"")}`,xe=({id:e,categories:n=[],question:r,onClick:o,hasIcon:i})=>{const a=(0,q.useMemo)((()=>["suggestions__item",...n.map(we)]),[n]),c=(0,q.useCallback)((()=>{o&&o({id:e,question:r})}),[e,r,o]);return(0,s.jsx)("li",{className:(0,t.U)(a),children:(0,s.jsxs)("button",{type:"button",onClick:c,className:(0,t.U)("button","button--primary"),children:[i&&(0,s.jsx)(ce.c,{name:"chevronRight",size:"8",alt:""}),r]})})},Ce=({className:e,suggestions:n=[],onClickSuggestion:r,hasIcon:o=!0})=>(0,s.jsx)("ul",{className:(0,t.U)("suggestions__list",e),children:n.map((e=>(0,s.jsx)(xe,{hasIcon:o,onClick:r,...e},e.id)))}),_e=e=>{const{sendAction:t}=(0,ne.wv)();return n=>{n.target&&n.target.dataset.linkId&&t({type:re.w$.navigate,originMessage:e,link:{id:n.target.dataset.linkId,url:n.target.getAttribute("href")}})}};function je({children:e,childrenHTML:n,className:r,graphicSrc:o,graphicType:i="icon",iconName:a,iconSize:c,iconClassName:l,dividerType:u}){const d=Boolean(a||o),p=n?{dangerouslySetInnerHTML:{__html:n}}:{children:e};return(0,s.jsxs)("div",{className:(0,t.U)("divider",u&&`divider--type-${u}`,r),children:[d&&(0,s.jsx)("span",{className:(0,t.U)("divider__graphic"),children:a?(0,s.jsx)(ce.c,{name:a,size:c,className:l,alt:""}):(0,s.jsx)("img",{src:o,className:(0,t.U)({icon:"icon"===i,avatar:"avatar"===i},l)})}),(0,s.jsx)("div",{className:(0,t.U)("divider__body"),...p})]})}const Ee={[re.MJ.new_topic]:"newtopic"};var Se=n(8456),Te=n(6736);const ke={default:({event:e})=>{const{t}=(0,oe.g)(),{subtype:n}=e.payload.body,r=Ee[re.MJ[n]];return(0,s.jsx)(je,{dividerType:r,iconName:re.MJ[n],children:(0,s.jsx)("p",{children:t(`dividerKeys.${re.MJ[n]}`)})})},[re.MJ.new_translation]:({event:e})=>{const{t:n}=(0,oe.g)(),r=(0,Te.kV)(),{body:{translationEnabled:o,text:i,title:a},id:c}=e.payload,l=(0,G.w1)((e=>e.translations.translatedEventGroups)),u=(0,G.OY)(),d=(0,q.useCallback)((()=>{l[c]?u((0,Se.wr)({events:r,id:c})):u((0,Se.Mt)({events:r,id:c}))}),[u,r,c,l]);return(0,s.jsxs)(je,{iconName:"newTranslation",dividerType:"newtranslation",children:[(0,s.jsx)("p",{className:(0,t.U)("divider__title"),children:a}),i&&(0,s.jsx)("p",{children:i}),o?(0,s.jsx)(s.Fragment,{children:(0,s.jsx)("button",{className:(0,t.U)("button","button--secondary"),onClick:d,children:n(l[c]?"translations.toggle.showTranslationsButtonText":"translations.toggle.hideTranslationsButtonText")})}):null]})}},Oe={month:"long",day:"numeric",year:"numeric"},Ne={hour:"numeric",minute:"numeric"},Ie=({event:e})=>{const n=(0,ae.ei)(),{date:r,time:o,timeUntilMidnight:i,srText:a}=(e=>{const{t}=(0,oe.g)(),n=(0,Q.EV)(),r=n?.context?.locale??[],s=new Date(e),o=new Date,i=new Date(o);i.setHours(24,0,0,0);const a=i-o,c=s.toString(),l=new Intl.DateTimeFormat(r,Ne).format(s);let u=(0,A.aG)(s,o);switch(u){case"today":u=t("dateTime.today");break;case"yesterday":u=t("dateTime.yesterday");break;default:u=new Intl.DateTimeFormat(r,Oe).format(s)}return{date:u,srText:t("dateTime.srText",{date:u,time:l}),time:l,fullDateTime:c,timeUntilMidnight:a}})((0,A.Qv)(e.timeIndicator));return(0,q.useEffect)((()=>{const e=setTimeout((()=>{n()}),i);return()=>{clearTimeout(e)}}),[n,i]),(0,s.jsxs)(je,{dividerType:"time-indicator",children:[(0,s.jsxs)("p",{className:(0,t.U)("divider__time"),"aria-hidden":"true",children:[(0,s.jsx)("span",{children:r}),(0,s.jsx)("span",{children:o})]}),(0,s.jsx)("p",{className:(0,t.U)("visually-hidden"),children:a})]})};var Ue=n(3332),Ae=["input:not([inert])","select:not([inert])","textarea:not([inert])","a[href]:not([inert])","button:not([inert])","[tabindex]:not(slot):not([inert])","audio[controls]:not([inert])","video[controls]:not([inert])",'[contenteditable]:not([contenteditable="false"]):not([inert])',"details>summary:first-of-type:not([inert])","details:not([inert])"],Re=Ae.join(","),Me="undefined"==typeof Element,Pe=Me?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Le=!Me&&Element.prototype.getRootNode?function(e){var t;return null==e||null===(t=e.getRootNode)||void 0===t?void 0:t.call(e)}:function(e){return null==e?void 0:e.ownerDocument},De=function e(t,n){var r;void 0===n&&(n=!0);var s=null==t||null===(r=t.getAttribute)||void 0===r?void 0:r.call(t,"inert");return""===s||"true"===s||n&&t&&e(t.parentNode)},Fe=function(e,t,n){if(De(e))return[];var r=Array.prototype.slice.apply(e.querySelectorAll(Re));return t&&Pe.call(e,Re)&&r.unshift(e),r.filter(n)},Be=function e(t,n,r){for(var s=[],o=Array.from(t);o.length;){var i=o.shift();if(!De(i,!1))if("SLOT"===i.tagName){var a=i.assignedElements(),c=e(a.length?a:i.children,!0,r);r.flatten?s.push.apply(s,c):s.push({scopeParent:i,candidates:c})}else{Pe.call(i,Re)&&r.filter(i)&&(n||!t.includes(i))&&s.push(i);var l=i.shadowRoot||"function"==typeof r.getShadowRoot&&r.getShadowRoot(i),u=!De(l,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(i));if(l&&u){var d=e(!0===l?i.children:l.children,!0,r);r.flatten?s.push.apply(s,d):s.push({scopeParent:i,candidates:d})}else o.unshift.apply(o,i.children)}}return s},ze=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},$e=function(e){if(!e)throw new Error("No node provided");return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||function(e){var t,n=null==e||null===(t=e.getAttribute)||void 0===t?void 0:t.call(e,"contenteditable");return""===n||"true"===n}(e))&&!ze(e)?0:e.tabIndex},Ve=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},He=function(e){return"INPUT"===e.tagName},Ke=function(e){var t=e.getBoundingClientRect(),n=t.width,r=t.height;return 0===n&&0===r},We=function(e,t){return!(t.disabled||De(t)||function(e){return He(e)&&"hidden"===e.type}(t)||function(e,t){var n=t.displayCheck,r=t.getShadowRoot;if("hidden"===getComputedStyle(e).visibility)return!0;var s=Pe.call(e,"details>summary:first-of-type")?e.parentElement:e;if(Pe.call(s,"details:not([open]) *"))return!0;if(n&&"full"!==n&&"legacy-full"!==n){if("non-zero-area"===n)return Ke(e)}else{if("function"==typeof r){for(var o=e;e;){var i=e.parentElement,a=Le(e);if(i&&!i.shadowRoot&&!0===r(i))return Ke(e);e=e.assignedSlot?e.assignedSlot:i||a===e.ownerDocument?i:a.host}e=o}if(function(e){var t,n,r,s,o=e&&Le(e),i=null===(t=o)||void 0===t?void 0:t.host,a=!1;if(o&&o!==e)for(a=!!(null!==(n=i)&&void 0!==n&&null!==(r=n.ownerDocument)&&void 0!==r&&r.contains(i)||null!=e&&null!==(s=e.ownerDocument)&&void 0!==s&&s.contains(e));!a&&i;){var c,l,u;a=!(null===(l=i=null===(c=o=Le(i))||void 0===c?void 0:c.host)||void 0===l||null===(u=l.ownerDocument)||void 0===u||!u.contains(i))}return a}(e))return!e.getClientRects().length;if("legacy-full"!==n)return!0}return!1}(t,e)||function(e){return"DETAILS"===e.tagName&&Array.prototype.slice.apply(e.children).some((function(e){return"SUMMARY"===e.tagName}))}(t)||function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var t=e.parentElement;t;){if("FIELDSET"===t.tagName&&t.disabled){for(var n=0;n<t.children.length;n++){var r=t.children.item(n);if("LEGEND"===r.tagName)return!!Pe.call(t,"fieldset[disabled] *")||!r.contains(e)}return!0}t=t.parentElement}return!1}(t))},qe=function(e,t){return!(function(e){return function(e){return He(e)&&"radio"===e.type}(e)&&!function(e){if(!e.name)return!0;var t,n=e.form||Le(e),r=function(e){return n.querySelectorAll('input[type="radio"][name="'+e+'"]')};if("undefined"!=typeof window&&void 0!==window.CSS&&"function"==typeof window.CSS.escape)t=r(window.CSS.escape(e.name));else try{t=r(e.name)}catch(e){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",e.message),!1}var s=function(e,t){for(var n=0;n<e.length;n++)if(e[n].checked&&e[n].form===t)return e[n]}(t,e.form);return!s||s===e}(e)}(t)||$e(t)<0||!We(e,t))},Ge=function(e){var t=parseInt(e.getAttribute("tabindex"),10);return!!(isNaN(t)||t>=0)},Ye=function e(t){var n=[],r=[];return t.forEach((function(t,s){var o=!!t.scopeParent,i=o?t.scopeParent:t,a=function(e,t){var n=$e(e);return n<0&&t&&!ze(e)?0:n}(i,o),c=o?e(t.candidates):i;0===a?o?n.push.apply(n,c):n.push(i):r.push({documentOrder:s,tabIndex:a,item:t,isScope:o,content:c})})),r.sort(Ve).reduce((function(e,t){return t.isScope?e.push.apply(e,t.content):e.push(t.content),e}),[]).concat(n)},Je=function(e,t){if(t=t||{},!e)throw new Error("No node provided");return!1!==Pe.call(e,Re)&&qe(t,e)},Xe=Ae.concat("iframe").join(","),Qe=function(e,t){if(t=t||{},!e)throw new Error("No node provided");return!1!==Pe.call(e,Xe)&&We(t,e)};function Ze(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function et(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ze(Object(n),!0).forEach((function(t){var r,s,o;r=e,s=t,o=n[t],s=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(s),s in r?Object.defineProperty(r,s,{value:o,enumerable:!0,configurable:!0,writable:!0}):r[s]=o})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ze(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var tt=function(e){return"Tab"===(null==e?void 0:e.key)||9===(null==e?void 0:e.keyCode)},nt=function(e){return tt(e)&&!e.shiftKey},rt=function(e){return tt(e)&&e.shiftKey},st=function(e){return setTimeout(e,0)},ot=function(e,t){var n=-1;return e.every((function(e,r){return!t(e)||(n=r,!1)})),n},it=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return"function"==typeof e?e.apply(void 0,n):e},at=function(e){return e.target.shadowRoot&&"function"==typeof e.composedPath?e.composedPath()[0]:e.target},ct=[],lt=function(e,t){var n,r=(null==t?void 0:t.document)||document,s=(null==t?void 0:t.trapStack)||ct,o=et({returnFocusOnDeactivate:!0,escapeDeactivates:!0,delayInitialFocus:!0,isKeyForward:nt,isKeyBackward:rt},t),i={containers:[],containerGroups:[],tabbableGroups:[],nodeFocusedBeforeActivation:null,mostRecentlyFocusedNode:null,active:!1,paused:!1,delayInitialFocusTimer:void 0,recentNavEvent:void 0},a=function(e,t,n){return e&&void 0!==e[t]?e[t]:o[n||t]},c=function(e,t){var n="function"==typeof(null==t?void 0:t.composedPath)?t.composedPath():void 0;return i.containerGroups.findIndex((function(t){var r=t.container,s=t.tabbableNodes;return r.contains(e)||(null==n?void 0:n.includes(r))||s.find((function(t){return t===e}))}))},l=function(e){var t=o[e];if("function"==typeof t){for(var n=arguments.length,s=new Array(n>1?n-1:0),i=1;i<n;i++)s[i-1]=arguments[i];t=t.apply(void 0,s)}if(!0===t&&(t=void 0),!t){if(void 0===t||!1===t)return t;throw new Error("`".concat(e,"` was specified but was not a node, or did not return a node"))}var a=t;if("string"==typeof t&&!(a=r.querySelector(t)))throw new Error("`".concat(e,"` as selector refers to no known node"));return a},u=function(){var e=l("initialFocus");if(!1===e)return!1;if(void 0===e||!Qe(e,o.tabbableOptions))if(c(r.activeElement)>=0)e=r.activeElement;else{var t=i.tabbableGroups[0];e=t&&t.firstTabbableNode||l("fallbackFocus")}if(!e)throw new Error("Your focus-trap needs to have at least one focusable element");return e},d=function(){if(i.containerGroups=i.containers.map((function(e){var t=function(e,t){var n;return n=(t=t||{}).getShadowRoot?Be([e],t.includeContainer,{filter:qe.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:Ge}):Fe(e,t.includeContainer,qe.bind(null,t)),Ye(n)}(e,o.tabbableOptions),n=function(e,t){return(t=t||{}).getShadowRoot?Be([e],t.includeContainer,{filter:We.bind(null,t),flatten:!0,getShadowRoot:t.getShadowRoot}):Fe(e,t.includeContainer,We.bind(null,t))}(e,o.tabbableOptions),r=t.length>0?t[0]:void 0,s=t.length>0?t[t.length-1]:void 0,i=n.find((function(e){return Je(e)})),a=n.slice().reverse().find((function(e){return Je(e)})),c=!!t.find((function(e){return $e(e)>0}));return{container:e,tabbableNodes:t,focusableNodes:n,posTabIndexesFound:c,firstTabbableNode:r,lastTabbableNode:s,firstDomTabbableNode:i,lastDomTabbableNode:a,nextTabbableNode:function(e){var r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],s=t.indexOf(e);return s<0?r?n.slice(n.indexOf(e)+1).find((function(e){return Je(e)})):n.slice(0,n.indexOf(e)).reverse().find((function(e){return Je(e)})):t[s+(r?1:-1)]}}})),i.tabbableGroups=i.containerGroups.filter((function(e){return e.tabbableNodes.length>0})),i.tabbableGroups.length<=0&&!l("fallbackFocus"))throw new Error("Your focus-trap must have at least one container with at least one tabbable node in it at all times");if(i.containerGroups.find((function(e){return e.posTabIndexesFound}))&&i.containerGroups.length>1)throw new Error("At least one node with a positive tabindex was found in one of your focus-trap's multiple containers. Positive tabindexes are only supported in single-container focus-traps.")},p=function e(t){var n=t.activeElement;if(n)return n.shadowRoot&&null!==n.shadowRoot.activeElement?e(n.shadowRoot):n},h=function e(t){!1!==t&&t!==p(document)&&(t&&t.focus?(t.focus({preventScroll:!!o.preventScroll}),i.mostRecentlyFocusedNode=t,function(e){return e.tagName&&"input"===e.tagName.toLowerCase()&&"function"==typeof e.select}(t)&&t.select()):e(u()))},f=function(e){var t=l("setReturnFocus",e);return t||!1!==t&&e},m=function(e){var t=e.target,n=e.event,r=e.isBackward,s=void 0!==r&&r;t=t||at(n),d();var a=null;if(i.tabbableGroups.length>0){var u=c(t,n),p=u>=0?i.containerGroups[u]:void 0;if(u<0)a=s?i.tabbableGroups[i.tabbableGroups.length-1].lastTabbableNode:i.tabbableGroups[0].firstTabbableNode;else if(s){var h=ot(i.tabbableGroups,(function(e){var n=e.firstTabbableNode;return t===n}));if(h<0&&(p.container===t||Qe(t,o.tabbableOptions)&&!Je(t,o.tabbableOptions)&&!p.nextTabbableNode(t,!1))&&(h=u),h>=0){var f=0===h?i.tabbableGroups.length-1:h-1,m=i.tabbableGroups[f];a=$e(t)>=0?m.lastTabbableNode:m.lastDomTabbableNode}else tt(n)||(a=p.nextTabbableNode(t,!1))}else{var v=ot(i.tabbableGroups,(function(e){var n=e.lastTabbableNode;return t===n}));if(v<0&&(p.container===t||Qe(t,o.tabbableOptions)&&!Je(t,o.tabbableOptions)&&!p.nextTabbableNode(t))&&(v=u),v>=0){var g=v===i.tabbableGroups.length-1?0:v+1,y=i.tabbableGroups[g];a=$e(t)>=0?y.firstTabbableNode:y.firstDomTabbableNode}else tt(n)||(a=p.nextTabbableNode(t))}}else a=l("fallbackFocus");return a},v=function(e){var t=at(e);c(t,e)>=0||(it(o.clickOutsideDeactivates,e)?n.deactivate({returnFocus:o.returnFocusOnDeactivate}):it(o.allowOutsideClick,e)||e.preventDefault())},g=function(e){var t=at(e),n=c(t,e)>=0;if(n||t instanceof Document)n&&(i.mostRecentlyFocusedNode=t);else{var r;e.stopImmediatePropagation();var s=!0;if(i.mostRecentlyFocusedNode)if($e(i.mostRecentlyFocusedNode)>0){var a=c(i.mostRecentlyFocusedNode),l=i.containerGroups[a].tabbableNodes;if(l.length>0){var d=l.findIndex((function(e){return e===i.mostRecentlyFocusedNode}));d>=0&&(o.isKeyForward(i.recentNavEvent)?d+1<l.length&&(r=l[d+1],s=!1):d-1>=0&&(r=l[d-1],s=!1))}}else i.containerGroups.some((function(e){return e.tabbableNodes.some((function(e){return $e(e)>0}))}))||(s=!1);else s=!1;s&&(r=m({target:i.mostRecentlyFocusedNode,isBackward:o.isKeyBackward(i.recentNavEvent)})),h(r||i.mostRecentlyFocusedNode||u())}i.recentNavEvent=void 0},y=function(e){if(("Escape"===(null==(t=e)?void 0:t.key)||"Esc"===(null==t?void 0:t.key)||27===(null==t?void 0:t.keyCode))&&!1!==it(o.escapeDeactivates,e))return e.preventDefault(),void n.deactivate();var t;(o.isKeyForward(e)||o.isKeyBackward(e))&&function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];i.recentNavEvent=e;var n=m({event:e,isBackward:t});n&&(tt(e)&&e.preventDefault(),h(n))}(e,o.isKeyBackward(e))},b=function(e){var t=at(e);c(t,e)>=0||it(o.clickOutsideDeactivates,e)||it(o.allowOutsideClick,e)||(e.preventDefault(),e.stopImmediatePropagation())},w=function(){if(i.active)return function(e,t){if(e.length>0){var n=e[e.length-1];n!==t&&n.pause()}var r=e.indexOf(t);-1===r||e.splice(r,1),e.push(t)}(s,n),i.delayInitialFocusTimer=o.delayInitialFocus?st((function(){h(u())})):h(u()),r.addEventListener("focusin",g,!0),r.addEventListener("mousedown",v,{capture:!0,passive:!1}),r.addEventListener("touchstart",v,{capture:!0,passive:!1}),r.addEventListener("click",b,{capture:!0,passive:!1}),r.addEventListener("keydown",y,{capture:!0,passive:!1}),n},x=function(){if(i.active)return r.removeEventListener("focusin",g,!0),r.removeEventListener("mousedown",v,!0),r.removeEventListener("touchstart",v,!0),r.removeEventListener("click",b,!0),r.removeEventListener("keydown",y,!0),n},C="undefined"!=typeof window&&"MutationObserver"in window?new MutationObserver((function(e){e.some((function(e){return Array.from(e.removedNodes).some((function(e){return e===i.mostRecentlyFocusedNode}))}))&&h(u())})):void 0,_=function(){C&&(C.disconnect(),i.active&&!i.paused&&i.containers.map((function(e){C.observe(e,{subtree:!0,childList:!0})})))};return n={get active(){return i.active},get paused(){return i.paused},activate:function(e){if(i.active)return this;var t=a(e,"onActivate"),n=a(e,"onPostActivate"),s=a(e,"checkCanFocusTrap");s||d(),i.active=!0,i.paused=!1,i.nodeFocusedBeforeActivation=r.activeElement,null==t||t();var o=function(){s&&d(),w(),_(),null==n||n()};return s?(s(i.containers.concat()).then(o,o),this):(o(),this)},deactivate:function(e){if(!i.active)return this;var t=et({onDeactivate:o.onDeactivate,onPostDeactivate:o.onPostDeactivate,checkCanReturnFocus:o.checkCanReturnFocus},e);clearTimeout(i.delayInitialFocusTimer),i.delayInitialFocusTimer=void 0,x(),i.active=!1,i.paused=!1,_(),function(e,t){var n=e.indexOf(t);-1!==n&&e.splice(n,1),e.length>0&&e[e.length-1].unpause()}(s,n);var r=a(t,"onDeactivate"),c=a(t,"onPostDeactivate"),l=a(t,"checkCanReturnFocus"),u=a(t,"returnFocus","returnFocusOnDeactivate");null==r||r();var d=function(){st((function(){u&&h(f(i.nodeFocusedBeforeActivation)),null==c||c()}))};return u&&l?(l(f(i.nodeFocusedBeforeActivation)).then(d,d),this):(d(),this)},pause:function(e){if(i.paused||!i.active)return this;var t=a(e,"onPause"),n=a(e,"onPostPause");return i.paused=!0,null==t||t(),x(),_(),null==n||n(),this},unpause:function(e){if(!i.paused||!i.active)return this;var t=a(e,"onUnpause"),n=a(e,"onPostUnpause");return i.paused=!1,null==t||t(),d(),w(),_(),null==n||n(),this},updateContainerElements:function(e){var t=[].concat(e).filter(Boolean);return i.containers=t.map((function(e){return"string"==typeof e?r.querySelector(e):e})),i.active&&d(),_(),this}},n.updateContainerElements(e),n};const ut=({children:e,onClose:t,"aria-label":n,"aria-labelledby":r,fallBackFocusRef:s})=>{const o=(0,ne.k3)(),i=(0,q.useRef)(null),c=(0,q.useRef)(null),[l,u]=(0,q.useState)(!1);return(0,q.useEffect)((()=>(l&&(c.current=lt(i.current,{initialFocus:s&&s.current?s.current:null}),c.current.activate()),()=>{c.current&&c.current.deactivate()})),[l,s]),(0,q.useEffect)((()=>{const e=(0,A.Av)();return()=>{e()}}),[l]),(0,q.useEffect)((()=>{l&&i.current.addEventListener("keydown",(e=>{(e.code&&"Escape"===e.code||27===e.keyCode)&&t()}))}),[l,t]),(0,q.useLayoutEffect)((()=>{const e=document.getElementsByTagName("body")[0],t=document.createElement("div");return t.setAttribute("id",o),t.setAttribute("role","dialog"),t.setAttribute("data-nosnippet","true"),t.setAttribute("aria-modal","true"),n&&t.setAttribute("aria-label",n),r&&t.setAttribute("aria-labelledby",r),e.appendChild(t),i.current=t,u(!0),()=>{i.current&&(e.removeChild(i.current),i.current=null)}}),[n,r,o]),"function"==typeof e?e({onClose:t,modalRenderFn:e=>i.current&&(0,a.render)(e,i.current)}):i.current&&(0,a.render)((0,a.toChildArray)(e).map((e=>(e.props={...e.props,onClose:t},e))),i.current)},dt=({url:e,description:n,onClose:r})=>{const{zIndex:o,layoutMode:i,namespace:a}=(0,Q.EV)(),c=(0,ne.GU)(),l=(0,ne.EF)(),u=(0,q.useRef)(null),{t:d}=(0,oe.g)(),p=["modal",`app--layout-${i}`,`namespace--${a}`,...l],h=e=>{e.stopPropagation()},f=()=>{r()},m=o?{zIndex:o+1}:void 0;return(0,s.jsx)(ut,{onClose:r,"aria-label":d("lightbox.heading"),fallBackFocusRef:u,children:({onClose:r,modalRenderFn:o})=>o((r=>(0,s.jsx)("div",{className:(0,t.U)(p),onClick:f,style:m,children:(0,s.jsxs)("div",{className:(0,t.U)("modal__float"),tabIndex:"-1",onMouseDown:c,onKeyDown:c,onTouchStart:c,onMouseMove:c,onWheel:c,onPointerDown:c,onPointerMove:c,ref:u,children:[(0,s.jsx)("div",{className:(0,t.U)("modal__inner"),onClick:h,children:(0,s.jsx)("img",{className:(0,t.U)("modal__image"),src:e,alt:n})}),(0,s.jsxs)("button",{type:"button",className:(0,t.U)("modal__close"),onClick:r,children:[(0,s.jsx)(ce.c,{name:"close",size:"16",alt:""}),d("lightbox.closeLabel")]})]})}))(r))})},pt=({description:e,url:n})=>{const{t:r}=(0,oe.g)(),[o,i]=(0,q.useState)(!1);return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("button",{type:"button",className:(0,t.U)("modal__enlarge"),onClick:()=>{i(!0)},children:[r("message.image.srTextEnlargeButtonLabel",{description:e}),(0,s.jsx)(ce.c,{name:"enlarge",size:"32",alt:""})]}),o&&(0,s.jsx)(dt,{url:n,description:e,onClose:()=>{i(!1)}})]})},ht=({event:e,...t})=>{const{body:n}=(0,ee.kx)(e),r=_e(e.payload.id),o=(0,q.useMemo)((()=>e.payload.optimisticallyInjected?{children:(0,s.jsx)("p",{children:n.text})}:{bodyProps:{dangerouslySetInnerHTML:{__html:n?.data?.text||n.text}}}),[n,e]);return(0,s.jsx)(te.c,{type:"text",event:e,onClick:r,...t,...o})},ft="PROCESSING_IMAGE",mt=({img:e,filename:n})=>{const{t:r}=(0,oe.g)(),o=r("fileUpload.srFileUploadedText",{fileName:n});return(0,s.jsx)(s.Fragment,{children:(0,s.jsxs)("span",{className:(0,t.U)(["download","download--preview"]),children:[(0,s.jsx)("img",{src:e,alt:o}),(0,s.jsx)("span",{"aria-hidden":"true",className:(0,t.U)("file-download"),children:n})]})})},vt=({children:e,url:n,target:r})=>n?(0,s.jsx)("a",{href:n,download:!0,target:r,className:(0,t.U)(["download","download-link"]),children:e}):(0,s.jsx)("span",{className:(0,t.U)("download"),children:e}),gt={message:{choice_prompt:ge.c,text:ht,image:({event:e,descriptorId:t,...n})=>{const{body:r}=(0,ee.kx)(e),{description:o,url:i,isZoomable:a}=r,[c,l]=(0,q.useState)(!1),u=(0,G.OY)();return(0,s.jsxs)(te.c,{event:e,type:"image",...n,children:[(0,s.jsx)("img",{src:i,id:t,alt:o,onLoad:()=>{u((0,Ue.cB)(e.payload.id)),l(!0)}}),a&&c&&(0,s.jsx)(pt,{description:o,url:i})]})},splash:({event:e,...t})=>{const{payload:n}=e,{body:r}=(0,ee.kx)(e),o=_e(n.id);return(0,s.jsx)(te.c,{type:"splash",event:e,onClick:o,...t,bodyProps:{dangerouslySetInnerHTML:{__html:r.text}}})},video:({event:e,descriptorId:n,...r})=>{const{body:o}=(0,ee.kx)(e),{description:i,url:a}=o;return(0,ne.li)(e).push("message--type-video"),(0,s.jsxs)(te.c,{event:e,type:"video",...r,children:[(0,s.jsx)("div",{id:n,className:(0,t.U)("visually-hidden"),children:i}),(0,s.jsx)("iframe",{title:i,src:a,allow:"autoplay; encrypted-media",allowFullScreen:!0})]})},upload:({event:e,...n})=>{const{t:r}=(0,oe.g)(),{body:o}=(0,ee.kx)(e),{fromClient:i,id:a}=e.payload,{filename:c,url:l}=o,u=(e=>{const{processingFileUploads:t}=(0,G.w1)((({state:e})=>e));return(0,q.useMemo)((()=>{if(t.some((t=>t===e)))return ft;try{return sessionStorage.getItem(`image-${e}`)}catch(e){return}}),[e,t])})(a),d=(0,q.useMemo)((()=>r(l?"fileUpload.srFileDownloadText":"fileUpload.srFileUploadedText",{fileName:c})),[l,c,r]);return(0,s.jsx)(te.c,{event:e,type:"upload",...n,children:u&&u!==ft?(0,s.jsx)(mt,{img:u,filename:c}):(0,s.jsxs)(vt,{url:l,target:i?void 0:"_blank",children:[(0,s.jsx)(ce.c,{name:"download",size:"16",alt:d}),(0,s.jsx)("span",{"aria-hidden":"true",className:(0,t.U)("file-download"),children:c})]})})},cta:({event:e})=>{const{body:n}=(0,ee.kx)(e),r=_e(e.payload.id),{emitEvent:o}=(0,ne.wv)(),i=(0,ne.k3)(),a=(0,q.useCallback)((()=>o(`action.${re.w$.clickCta}`,{type:re.w$.clickCta,originMessage:e.payload.id,link:{url:n.buttonLink}})),[o,n,e]);return(0,s.jsxs)(te.c,{type:"cta",event:e,children:[(0,s.jsx)("div",{className:(0,t.U)("cta__content"),id:i,dangerouslySetInnerHTML:{__html:n.description},onClick:r}),(0,s.jsx)("a",{className:(0,t.U)("button","button--primary"),"aria-describedby":i,href:n.buttonLink,rel:"noreferrer",target:n.buttonNewTab?"_blank":"_self",onClick:a,children:n.buttonText})]})},carousel:({event:e})=>{const{body:t}=(0,ee.kx)(e),n=t.cards;return(0,s.jsx)(te.c,{event:e,modifiers:"type-carousel",children:(0,s.jsx)(fe,{items:n,ItemComponent:ie,getItemKey:me,getItemLabel:ve})})},card:({event:e})=>{const{body:t}=(0,ee.kx)(e),n=(0,ne.k3)();return(0,s.jsx)(te.c,{type:"card",event:e,children:(0,s.jsx)(se,{id:n,...t})})}},info:{text:ht,divider:({event:e,...t})=>{const n=ke[re.MJ[e.payload.body.subtype]]||ke.default;return(0,s.jsx)(n,{event:e,...t})},translation:({event:e,...t})=>{const{t:n}=(0,oe.g)(),{body:r}=(0,ee.kx)(e);return(0,s.jsx)(te.c,{type:"text",event:e,...t,children:n(r.key.join("."),r.variables)})},timeIndicator:Ie},participant:{participant:({event:e})=>{const{participant:t}=e.payload,{body:n}=(0,ee.kx)(e);return n?(0,s.jsx)(je,{graphicSrc:t.avatar,graphicType:t.avatar?"avatar":void 0,iconName:t.avatar?void 0:"balloon",childrenHTML:n,dividerType:"participant"}):null}},service_data:{suggestion:({event:e,...n})=>{const[r,o]=(0,q.useState)(!0),i=(0,G.OY)(),a=(0,ye.w)(),{sendAction:c,addMessageBubble:l}=(0,ne.wv)(),{suggestions:u,payload:d}=(e=>{const{payload:t}=e,{body:n}=(0,ee.kx)(e);return{suggestions:n,payload:t}})(e),{showSuggestions:p}=(0,Q.EV)(),h=(0,ne.kV)(),{t:f}=(0,oe.g)(),m=f("suggestions.headingText"),v=f("suggestions.footerText"),g=(0,q.useMemo)((()=>h.some((({payload:e})=>e?.transactionLast))),[h]),y=(0,q.useCallback)((({id:e,question:t})=>{o(!1),i((0,be.N8)(!0)),c({type:re.w$.custom,originMessage:d.id,body:{type:"faqclick",body:{faqId:e,faqQuestion:t}}}),l(t)}),[i,c,d.id,l]);return r&&!a&&g&&p?(0,s.jsxs)("div",{className:(0,t.U)("suggestions","suggestions--conversation"),children:[m&&(0,s.jsx)("p",{className:(0,t.U)("suggestions__heading"),children:m}),(0,s.jsxs)(te.c,{type:"suggestions",showParticipant:!1,event:e,...n,children:[(0,s.jsx)(Ce,{className:"suggestions__list--conversation",onClickSuggestion:y,suggestions:u}),v&&(0,s.jsx)("p",{className:(0,t.U)("suggestions__footer"),children:v})]})]}):null}}},yt=({children:e})=>{const{customComponents:t}=(0,Q.EV)(),n=(0,q.useMemo)((()=>Object.keys(gt).reduce(((e,n)=>({...e,[n]:{...gt[n],...t?t[n]:{}}})),{fallback:ht})),[t]);return(0,s.jsx)(Z.Provider,{value:n,children:e})};var bt=n(8632),wt=n(9500);const xt=({children:e})=>{const{isMinimized:n}=(0,bt.uu)(),r=(0,q.useRef)(0),{sendAction:o}=(0,ne.wv)(),{hasCountdown:i,isActive:a,stopCountdown:c}=(0,ne.sD)(),l=(0,q.useCallback)((()=>{if(n)return;const e=(new Date).getTime(),t=()=>{o({type:re.w$.interactivityUpdate}),r.current=e};i&&a&&(t(),c()),e-r.current>h.oP&&t()}),[o,i,a,c,n]);return(0,s.jsx)("div",{className:(0,t.U)("activity-monitor"),tabIndex:-1,onMouseDown:l,onKeyUp:l,onTouchStart:l,onMouseMove:l,onWheel:l,onPointerDown:l,onPointerMove:l,children:(0,s.jsx)(wt.c.Provider,{value:l,children:e})})};var Ct=n(5308),_t=n(8132),jt=n(4528),Et=n(1880),St=n(7468),Tt=n(9816);const kt=["text","choice_prompt","image","video"],Ot=()=>{const e=(0,Tt.c)(),t=(0,q.useRef)(),n=(0,q.useRef)(),r=(0,K.A)(),s=(0,q.useContext)(Ct.E),o=(0,q.useRef)(null),{initCountdown:i,endCountdown:a}=(0,ne.sD)(),{emitEvent:c}=(0,ne.wv)();return(0,q.useEffect)((()=>{if(e.socket){const{socket:t}=e;t.onError((e=>{const t=new _t.c(e);r((0,Et.yA)({name:t.name,message:t.message,langKey:t.langKey,originalEvent:t.originalEvent,originalError:t.originalError})),r((0,Ue.kV)())})),t.onOpen((()=>{r((0,Et.aI)())}))}}),[e,r]),(0,q.useEffect)((()=>{e.socket&&e.onConnection((({currentState:e})=>{if("join_channel_erred"===e){const e=new u.c;return r((0,Et.yA)({name:e.name,message:e.message,langKey:e.langKey,originalEvent:e.originalEvent,originalError:e.originalError,action:e.action})),!0}return!1}))}),[e,r]),(0,q.useEffect)((()=>{const t=e=>{if("participant"!==e.type)return;const{payload:t}=e;if(!t||!t.participant)return;const{fromClient:n,participant:s}=t;!n&&"string"!=typeof s&&(null==s?void 0:s.name)&&r((0,Ue.E1)(s.name)),r((0,Ue.uE)({participant:s,fromClient:n})),"string"!=typeof s&&s.introduction&&r((0,Ue.Ux)(e))};e.onConnection((({connected:n})=>{if(!n)return!1;const{channel:o}=e;return o.onMessage=(e,n)=>{const o={type:e,payload:n};switch(e){case"ui":switch(n.state&&n.state.hasOwnProperty("loading")&&r((0,Ue.hB)(n.state.loading)),n.type){case"idle_detach_countdown":i(n.body.duration);break;case"idle_detach_countdown_elapsed":a(void 0,!0);break;case"resume_conversation_prompt":r((0,Ue.op)());break;case"translation_proposal":r((0,Se.kx)(n.body));break;case"user_first_response":r((0,be.N8)(!0)),s.emit("system.userFirstResponse",n.body)}break;case"context":n.contentLocale&&n.userLocale&&r((0,jt.K)(n.userLocale));break;case"message":switch(t(n),n.type){case"text":case"choice_prompt":case"splash":case"image":case"upload":case"video":case"cta":case"custom":case"carousel":case"card":n.service&&n.service.serviceSessionId&&r((0,Ue.nC)(n.service.serviceSessionId)),r((0,Ue.Ux)(o))}break;case"participant":t(o);break;case"service_data":n.persist&&r((0,Ue.ai)(n));break;case"ack":r((0,Ue.q_)(o));break;case"system":if("service_changed"===n.type){const{serviceSettings:e}=n,t=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var s=0;for(r=Object.getOwnPropertySymbols(e);s<r.length;s++)t.indexOf(r[s])<0&&Object.prototype.propertyIsEnumerable.call(e,r[s])&&(n[r[s]]=e[r[s]])}return n}(n,["serviceSettings"]),{entry:s,proactiveMessages:o}=e,{upload:i}=s.options;r((0,Ue.us)({key:re.gn.uploads,enabled:!(!i||!i.enabled)})),r((0,Ue._8)(o.enabled||!1)),r((0,Ue.UD)(s)),n.serviceSessionId&&r((0,Ue.nC)(n.serviceSessionId)),c("system.serviceChanged",t)}break;case"info":"divider"!==n.type&&"text"!==n.type&&"translation"!==n.type||r((0,Ue.Ux)(o));break;case"error":switch(n.type){case"find_conversation_erred":const e=new d.c(o);r((0,Et.yA)({name:e.name,action:e.action,message:e.message,originalEvent:e.originalEvent,originalError:e.originalError}));break;case"conversation_erred":case"attach_channel_erred":const t=new u.c(o);r((0,Et.yA)({name:t.name,message:t.message,langKey:t.langKey,originalEvent:t.originalEvent,originalError:t.originalError,action:t.action}))}}return n},!1}))}),[e,r,c,a,s,i]),(0,q.useEffect)((()=>{e.onConnection((({connected:t})=>{if(!t)return!1;const{channel:r}=e;return n.current&&r.off("message",n.current),n.current=r.on("message",(e=>kt.includes(e.type)?(e.id!==o.current&&s.emit("message",e),o.current=e.id,e):e)),!0}))}),[e,s]),(0,q.useEffect)((()=>{e.onConnection((({connected:n})=>!!n&&(t.current&&e.channel.off("sync",t.current),t.current=e.channel.on("sync",(e=>{return t=void 0,n=void 0,o=function*(){try{const t=yield r((0,St.m)(e)).unwrap();if(!t)return;r((0,Ue.Yh)(t))}catch(e){}},new((s=void 0)||(s=Promise))((function(e,r){function i(e){try{c(o.next(e))}catch(e){r(e)}}function a(e){try{c(o.throw(e))}catch(e){r(e)}}function c(t){var n;t.done?e(t.value):(n=t.value,n instanceof s?n:new s((function(e){e(n)}))).then(i,a)}c((o=o.apply(t,n||[])).next())}));var t,n,s,o})),!0)))}),[e,r]),null};var Nt=n(9056),It=function(e,t,n,r){return new(n||(n=Promise))((function(s,o){function i(e){try{c(r.next(e))}catch(e){o(e)}}function a(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?s(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(i,a)}c((r=r.apply(e,t||[])).next())}))};const Ut=({children:e})=>{const{t}=(0,oe.g)(),n=(0,G.OY)(),r=(0,ne.Ml)(),{addUploadBubble:o}=(0,ne.wv)(),i=(0,q.useCallback)(((e,t)=>It(void 0,void 0,void 0,(function*(){n((0,Ue.ec)(t));const r=yield(e=>new Promise(((t,n)=>{const r=new FileReader;r.readAsDataURL(e),r.onload=()=>"string"==typeof r.result?t(r.result):void 0,r.onerror=e=>n(e)})))(e),s=new Image;s.src=r,yield s.decode();const o=(e=>{const t=document.createElement("canvas"),n=t.getContext("2d"),[r,s]=(e=>{const{height:t,width:n}=e;return n>t&&n>600?[600,600*t/n]:t>600?[600*n/t,600]:[n,t]})(e);return t.width=r,t.height=s,n.drawImage(e,0,0,r,s),t.toDataURL()})(s);try{sessionStorage.setItem(`image-${t}`,o)}catch(e){}finally{n((0,Ue.Oo)(t))}}))),[n]),a=(0,q.useCallback)((e=>{const s=(0,v.s)(),a=r.uploadFile(e,(e=>{n((0,Ue.AH)({fileId:s,progress:Math.ceil(e)}))}),(t=>It(void 0,void 0,void 0,(function*(){const{id:r,transactionId:a,occurredAt:c,body:{contentType:l,filename:u,filesize:d,url:p}}=t;n((0,Ue.mw)(s)),o(r,a,c,l,u,d,p),yield i(e,r)}))),(e=>{let r;switch((null==e?void 0:e.error)||""){case"file_uploads_are_disabled":r=t("fileUpload.errors.unavailable");break;case"request_entity_too_large":r=t("fileUpload.errors.tooLarge");break;case"file_has_invalid_mime_type":r=t("fileUpload.errors.wrongType");break;case"virus_found":r=t("fileUpload.errors.virusFound");break;default:r=t("fileUpload.errors.general")}n((0,Ue.Qb)({fileId:s,errorText:r}))}));n((0,Ue.SM)({fileId:s,fileName:e.name,uploadHandle:a}))}),[i,o,r,n,t]);return(0,s.jsx)(Nt.c.Provider,{value:a,children:e})};var At=n(952);const Rt=()=>{const{hasCountdown:e,isActive:t,remaining:n,decrementCountdown:r}=(0,At.c)();return((e,t)=>{const n=(0,q.useRef)(e);(0,q.useEffect)((()=>{n.current=e}),[e]),(0,q.useEffect)((()=>{if(null!==t){const e=setInterval((function(){n.current()}),t);return()=>clearInterval(e)}}),[t])})((()=>{r()}),e&&t&&n>0?1e3:null),null},Mt=()=>{const{initUserSelectedOptions:e}=(0,ne.Yj)(),t=(0,q.useRef)(!1),n=(0,Q.EV)();return(0,q.useEffect)((()=>{n.api&&!t.current&&(t.current=!0,e())}),[e,n]),null};var Pt=n(5768),Lt=n(8536);function Dt(e,t,n=[]){const r=(0,q.useContext)(Ct.E),s=(0,q.useRef)();s.current=t,(0,q.useEffect)((()=>{if(!n.every(Boolean))return;const t=(...e)=>s.current?.(...e);return r.emit("function.register",e,t),()=>r.emit("function.unregister",e,t)}),[r,e,...n])}const Ft=()=>{const e=(0,Q.EV)(),{sendMessage:t,sendContext:n,sendAction:r}=(0,ne.wv)(),s=(0,G.OY)(),{setVisibility:o,visible:i}=(0,bt.uu)(),a=(0,q.useRef)(i),c=(0,q.useContext)(Ct.E),l=(0,ne.Ml)(),u=(0,ne.I7)(),d=(0,q.useRef)(null),p=(0,q.useRef)(null),{isInline:f,isResolving:m}=(0,ne.y2)(),v=(0,G.w1)(Pt.Y),g=(0,ne.Y5)(),y=(0,q.useRef)(null),b=(0,ne.GU)(),{enableTranslations:w,disableTranslations:x}=(0,ee.A1)();return(0,q.useEffect)((()=>{a.current=i}),[i]),Dt("askText",(e=>{t({body:e})}),[l.send]),Dt("setVariables",(e=>{n({variables:e})}),[l.send]),Dt("getVisibility",(e=>{e?e(a.current):console.warn("A callback function is required for the getVisibility action.")})),Dt("setVisibility",(e=>{Object.values(Lt.I).includes(e)?(b(),o(e)):console.error('Requested visibility states should be "open", "minimized" ,"hidden" or null.')}),[e?.api]),Dt("sendCustomAction",((e,t)=>{r({type:"custom",body:{type:e,body:t}})}),[l.send]),Dt("setTopic",(({name:e,fallbackMessage:t,userTriggered:n})=>{if(n&&s((0,H.Lp)({showSuggestions:!1})),e&&t){const s=n?h.kr:void 0;r({type:re.w$.setTopic,body:{name:e,fallbackMessage:t,participant:s}})}else console.warn("A name and a fallbackMessage are required for the setTopic action.")}),[l.send]),Dt("setContext",(e=>{n(e)}),[l.send]),Dt("setTranslation",(({enabled:e,locale:t})=>{e?w(t,re.mS.windowApi):x()}),[l.send]),(0,q.useEffect)((()=>{m||v||(y.current&&y.current!==g&&c.emit("unreadMessageCount",u),i===Lt.I.open&&i!==p.current&&0!==d.current&&c.emit("unreadMessageCount",0),i!==Lt.I.open&&u!==d.current&&c.emit("unreadMessageCount",u),p.current=i,d.current=u,y.current=g)}),[u,i,c,f,m,v,g]),null};var Bt=n(6612);const zt=({children:e})=>{const n=(0,q.useContext)(Ct.E),[r,o]=(0,q.useState)({}),i=(0,q.useRef)(!0),a=(0,q.useCallback)((e=>{i.current&&(o(e),n.emit("aria-live",e))}),[o,n]);(0,q.useEffect)((()=>{let e=null;return r&&r.messageText&&(e=setTimeout((()=>{a({}),clearTimeout(e)}),600)),()=>{clearTimeout(e)}}),[r,a]),(0,q.useEffect)((()=>()=>{i.current=!1}),[]);const{ariaLive:c,messageText:l}=r;return(0,s.jsxs)(Bt.e.Provider,{value:a,children:[e,(0,s.jsxs)("div",{className:(0,t.U)("app__live-container"),children:[(0,s.jsx)("div",{"aria-live":"assertive","aria-atomic":"true",className:(0,t.U)("visually-hidden"),children:c===re.kD.assertive?l:null}),(0,s.jsx)("div",{"aria-live":"polite","aria-atomic":"true",className:(0,t.U)("visually-hidden"),children:c===re.kD.polite?l:null})]})]})},$t=()=>{const{t:e}=(0,oe.g)(),t=(0,ne.kV)(),n=(0,q.useRef)(0),r=(0,q.useRef)(0),s=(0,ne.Ir)(),{sendPolite:o}=(0,ne.CE)(),{isOpen:i}=(0,bt.uu)(),a=(0,q.useRef)(null),c=(0,q.useRef)(null),l=(0,q.useMemo)((()=>(0,A.Cu)((t=>{const n=t.filter((({payload:e})=>!e.fromClient&&!e.fromHistory)).length;n>r.current&&(o(e("message.srNewEventCount",{newCount:n-r.current})),r.current=n)}),h.GS)),[o,e]);return(0,q.useEffect)((()=>{t.length>n.current&&(i&&(c.current=l(t)),n.current=t.length)}),[t,l,i]),(0,q.useEffect)((()=>{a.current&&!i&&c.current&&(c.current(!0),c.current=null)}),[i]),(0,q.useEffect)((()=>{s&&setTimeout((()=>{o(e("window.srTexts.onHistoryLoad"))}),500)}),[s,e,o]),null},Vt=()=>{const{t:e}=(0,oe.g)(),{isOpen:t,isVisible:n}=(0,bt.uu)(),r=(0,ne.I7)(),{sendPolite:s}=(0,ne.CE)(),o=(0,q.useMemo)((()=>(0,A.Cu)(s,h.es)),[s]),i=(0,q.useRef)(null),a=(0,q.useRef)(null);return(0,q.useEffect)((()=>{i.current!==n&&!n&&a.current&&a.current(),0!==r&&!t&&n&&(a.current=o(e("message.srTextUnreadCount",{unreadCount:r}))),i.current=n}),[r,t,n,o,e]),null},Ht=({store:e,children:t,eventBus:n,api:r})=>((0,q.useErrorBoundary)((t=>{e.dispatch((0,Y.a)(t))})),(0,s.jsx)(G.C_,{store:e,children:(0,s.jsx)(Ct.E.Provider,{value:n,children:(0,s.jsx)(Ct.c.Provider,{value:r,children:(0,s.jsx)(zt,{children:(0,s.jsx)(X,{children:(0,s.jsxs)(yt,{children:[(0,s.jsx)(Mt,{}),(0,s.jsx)(Ot,{}),(0,s.jsx)(Vt,{}),(0,s.jsx)($t,{}),(0,s.jsx)(Rt,{}),(0,s.jsxs)(xt,{children:[(0,s.jsx)(Ft,{}),(0,s.jsx)(Ut,{children:t})]})]})})})})})}));var Kt=n(8888);const Wt=(0,Kt.M3)(Te.GW,(e=>e.filter((e=>{var t;return(0,Ue.Qr)(e)&&"service_data"!==e.type&&(null===(t=e.payload)||void 0===t?void 0:t.messageStatus)===re.eg.received})))),qt=(0,Kt.M3)(Wt,(e=>e.at(-1))),Gt=(0,Kt.M3)(Wt,(e=>e.map((e=>e.payload.id)))),Yt=(0,Kt.M3)((({state:e})=>{var t;return null===(t=e.options.features)||void 0===t?void 0:t.webNotifications}),(e=>null==e?void 0:e.enabled));var Jt=n(92);const Xt=()=>{const{t:e}=(0,oe.g)(),{showDisclaimer:n}=(0,Q.EV)();return n&&(0,s.jsxs)("div",{className:(0,t.U)("disclaimer"),tabIndex:"0",children:[(0,s.jsx)("h2",{className:(0,t.U)("disclaimer__title"),children:e("disclaimer.title")}),(0,s.jsx)("div",{className:(0,t.U)("disclaimer__message"),dangerouslySetInnerHTML:{__html:e("disclaimer.content")}})]})};var Qt=n(9320);const Zt=(0,Kt.M3)([({forms:e})=>e,(e,{formId:t})=>t],((e,t)=>e[t])),en=(0,Kt.M3)(Zt,(e=>(null==e?void 0:e.controls)||{})),tn=(0,Kt.M3)(en,(e=>{const t={};return Object.entries(e).forEach((([e,{value:n}])=>{t[e]=n})),t})),nn=(0,Kt.M3)([en,(e,{name:t})=>t],((e,t)=>{var n;return null===(n=e[t])||void 0===n?void 0:n.value})),rn=(0,Kt.M3)([en,(e,{name:t})=>t],((e,t)=>{var n;return null===(n=e[t])||void 0===n?void 0:n.touched}));var sn=n(2620);const on=(0,a.createContext)({handleSubmit:()=>{},isSubmitted:!1,isValid:!1,updateControlValue:()=>{},updateControlTouched:()=>{},errors:void 0}),an=on,{Provider:cn,Consumer:ln}=on;function un(){return(0,q.useContext)(an)}function dn(e){const t=(0,G.OY)(),{formId:n,updateControlValue:r,updateControlTouched:s,errors:o}=un(),i=!!(0,G.w1)((e=>Zt(e,{formId:n}))),a=(0,G.w1)((t=>nn(t,{formId:n,name:e}))),c=(0,G.w1)((t=>rn(t,{formId:n,name:e}))),l=null==o?void 0:o[e],u=!l;(0,q.useEffect)((()=>{i&&t((0,sn.YJ)({formId:n,name:e}))}),[i,n,e,t]),(0,q.useLayoutEffect)((()=>()=>{t((0,sn.A$)({formId:n,name:e}))}),[i,n,e,t]);const d=(0,q.useCallback)((t=>r(e,t.target.value)),[e,r]),p=(0,q.useCallback)((()=>{s(e,!0)}),[s,e]);return[(0,q.useMemo)((()=>({name:e,onInput:d,onBlur:p,value:a})),[e,d,p,a]),(0,q.useMemo)((()=>({isValid:u,error:l,touched:c})),[u,l,c])]}var pn=n(8384);function hn(e){const{t}=(0,oe.g)(),{sendAssertive:n}=(0,pn.C)(),{hasLimit:r,limit:s}=(0,Te.qo)(),o=(0,q.useMemo)((()=>(0,A.Cu)(n,h.us)),[n]),i=(0,q.useMemo)((()=>(0,A.Cu)(((e,n)=>{e&&o(t("input.srCharacterLimitText",{limit:n}))}),h.us)),[o,t]),[{value:a}]=dn(e),c=r&&a?s-a.length:s,l=!!r&&c<=h.gJ,u=!!r&&c<0;return(0,q.useEffect)((()=>{i(l,c)}),[l,c,i]),{hasCharacterLimit:r,characterLimit:s,reachedCharacterWarning:l,reachedCharacterLimit:u,remainingChars:c}}const fn=e=>{const{hasCharacterLimit:t,characterLimit:n}=hn(e),{entryMeta:{optionsOverride:{text:r}}}=(0,Te.gf)(),{t:s}=(0,oe.g)();return{placeholder:(0,q.useMemo)((()=>s("input.inputPlaceholder",{hasLimit:t,text:(null==r?void 0:r.placeholder)||s("input.inputPlaceholderText"),limit:t?n:null})),[s,t,n,null==r?void 0:r.placeholder]),label:(0,q.useMemo)((()=>s("input.inputLabel",{hasLimit:!(null==r?void 0:r.label)&&t,text:(null==r?void 0:r.label)||s("input.inputLabelText"),limit:!(null==r?void 0:r.label)&&t?n:null})),[s,t,n,null==r?void 0:r.label]),labelClass:(0,q.useMemo)((()=>(null==r?void 0:r.label)?"label":"visually-hidden"),[null==r?void 0:r.label])}};function mn(){const{abortTransaction:e,clearEntryAbortTransaction:n}=(()=>{const e=(0,G.OY)(),{entryMeta:{actions:t,translatedActions:n}}=(0,Te.gf)();return{abortTransaction:(null==n?void 0:n.abortTransaction)||(null==t?void 0:t.abortTransaction),clearEntryAbortTransaction:()=>{e((0,Ue.Yr)())}}})(),r=(0,Qt.Ml)();return e?(0,s.jsx)("li",{className:(0,t.U)(["cvco-conversation__item","cvco-conversation__item--abort-transaction"]),children:(0,s.jsx)("button",{className:(0,t.U)(["button","button--secondary","abort-transaction__button"]),type:"button",onClick:()=>{r.send("action",{type:re.w$.setTopic,body:{name:e.topicName,fallbackMessage:e.topicFallbackMessage}}),n()},children:e.label})}):null}var vn=n(1864);const gn=(0,a.createContext)(null),yn=e=>{const t=(0,q.useContext)(Z),n=t[e.type];let r=n[e.payload.type],s=null;return e.payload.type===re.ay.choicePrompt&&(s=n[e.payload.body.prompt.type]),"participant"===e.type&&(r=n[e.type]),r&&"function"!=typeof r&&(r=r[e.payload.body.type]),[r||t?.fallback,s]},bn=({event:e,newParticipant:n})=>{const{eventRefs:r,unreadIds:o}=(0,vn.useContext)(gn),{sendAction:i}=(0,ne.wv)(),a=r[e.payload.id],{containerRef:c,isVisible:l}=(0,bt.mo)({containerRef:a,freezeOnceVisible:!0}),u=(0,G.OY)(),[d,p]=yn(e);if((0,vn.useEffect)((()=>{if(l&&(null==o?void 0:o.includes(e.payload.id))){const t=o.reduce(((t,n)=>t.includes(e.payload.id)?t:t.concat(n)),[]);u((0,Ue.A1)(t)),i({type:re.w$.read,events:t})}}),[u,e.payload.id,l,i,o]),!d)return null;const h=["conversation__item"];return"info"===e.type?h.push("conversation__item--source-info"):e.payload.fromClient?h.push("conversation__item--source-user"):h.push("conversation__item--source-agent"),n&&h.push("conversation__item--new-participant"),(0,s.jsxs)("li",{className:(0,t.U)(h),ref:c,children:[e.timeIndicator&&(0,s.jsx)(Ie,{event:e}),(0,s.jsx)(d,{event:e,children:(0,s.jsx)(p,{event:e})})]})};var wn=n(3792);const xn=()=>{const{id:e}=(0,ne.KC)()||{};return(0,s.jsx)("li",{className:(0,t.U)("conversation__item","conversation__item--source-agent"),children:(0,s.jsxs)("div",{className:(0,t.U)("message","message--source-agent","message--type-loading"),children:[(0,s.jsx)(wn.c,{eventPayload:{fromClient:!1,participant:e}}),(0,s.jsx)("div",{className:(0,t.U)("message__body"),children:(0,s.jsxs)("span",{className:(0,t.U)("loader"),children:[(0,s.jsx)("span",{className:(0,t.U)("loader__part","one")}),(0,s.jsx)("span",{className:(0,t.U)("loader__part","two")}),(0,s.jsx)("span",{className:(0,t.U)("loader__part","three")}),(0,s.jsx)("span",{className:(0,t.U)("loader__part","four")})]})})]})})},Cn=()=>{const e=(0,Te.kV)();let t=null;return(0,s.jsx)(s.Fragment,{children:e.map((e=>{const{type:n,payload:r}=e;let o=!1;if("participant"!==n&&"service_data"!==n){const{participant:n,fromClient:s}=r,i=s?"seamly-client-participant":n;"info"!==e.type&&t!==i&&(o=!0),t=i}return(0,s.jsx)(bn,{event:e,newParticipant:o},e.payload.key||e.payload.id)}))})},_n=()=>{const{t:e}=(0,oe.g)(),n=(0,ne.sJ)(),r=((e,t=20)=>{const[n,r]=(0,q.useState)(e),s=(0,q.useRef)(null);return(0,q.useEffect)((()=>(s.current=setTimeout((()=>r(e)),t),()=>{clearTimeout(s.current)})),[e,t]),n})(n,n?0:20),{isOpen:o}=(0,bt.uu)(),i=(0,ne.OK)(),a=(0,ne.e6)();return(0,s.jsxs)(s.Fragment,{children:[o&&(0,s.jsx)("a",{className:(0,t.U)("skip-link"),href:`#${i}`,onClick:e=>{e.preventDefault(),a()},children:e("skiplinkText")}),(0,s.jsx)("div",{className:(0,t.U)("chat__body"),children:(0,s.jsxs)("div",{className:(0,t.U)("conversation__container"),children:[(0,s.jsx)(Xt,{}),(0,s.jsxs)("ol",{className:(0,t.U)("conversation"),children:[(0,s.jsx)(yt,{children:(0,s.jsx)(Cn,{})}),r?(0,s.jsx)(xn,{}):null,(0,s.jsx)(mn,{})]})]})})]})};function jn(e,t){const n=(0,q.useRef)(null),r=(0,q.useRef)(e);return(0,q.useEffect)((()=>{r.current=e}),[e]),(0,q.useEffect)((()=>"number"!=typeof t?()=>{}:(n.current=setTimeout(r.current,t),()=>clearTimeout(n.current))),[t]),n}function En(e){return"object"==typeof e}const Sn={visible:(0,t.U)("transition--visible"),in:(0,t.U)("transition--in"),visuallyHidden:(0,t.U)("visually-hidden")},Tn=Object.values(Sn),kn={notRendered:"notRendered",rendered:"rendered",visuallyHidden:"visuallyHidden"},On=({children:e,isActive:t,timeout:n=h.uY,transitionStartState:r=kn.notRendered,onInTransitionComplete:o=(()=>{}),onOutTransitionComplete:i=(()=>{}),exitAfter:c,enterDelay:l=0})=>{const u=(0,q.useRef)(!1),d=r===kn.visuallyHidden,[p,f]=(0,q.useState)((()=>d?[Sn.visuallyHidden]:[])),[m,v]=(0,q.useState)((()=>0===l)),g=(0,q.useMemo)((()=>c?c+l:c),[l,c]);jn((()=>v(!1)),t?g:void 0),jn((()=>v(!0)),t?l:void 0);const y=(0,q.useMemo)((()=>m&&t),[t,m]),b=(0,ne.W_)(o),w=(0,ne.W_)(i),x="notRendered"!==r||p.length>0;return(0,q.useEffect)((()=>{let e=null,t=null;return u.current&&!y&&(f([Sn.visible]),e=setTimeout((()=>{f([...d?[Sn.visuallyHidden]:[]]),w&&(t=requestAnimationFrame((()=>{w()})))}),n)),!u.current&&y&&(f([Sn.visible]),t=requestAnimationFrame((()=>{t=requestAnimationFrame((()=>{f([Sn.visible,Sn.in]),b&&(e=setTimeout((()=>{b()}),n))}))}))),u.current=y,()=>{clearTimeout(e),cancelAnimationFrame(t)}}),[d,b,w,n,y]),(0,s.jsx)(s.Fragment,{children:x&&(0,a.toChildArray)(e).filter(En).map((e=>{const{className:t=""}=e.props,n=t.split(" ").filter((e=>!Tn.includes(e)));return(0,a.cloneElement)(e,{className:[...n,...p].join(" ")})}))})};var Nn=n(3480),In=n(8416),Un=n(152);const An=({isAside:e=!1})=>{const{isInline:n}=(0,Te.y2)(),{t:r}=(0,oe.g)(),{sendAction:o,addMessageBubble:i}=(0,In.c)(),{isOpen:a,setVisibility:c}=(0,bt.uu)(),{showSuggestions:l}=(0,Q.EV)(),u=(0,ae.k3)(),d=(0,Nn.e6)(),p=(0,q.useRef)(null),{sendPolite:h}=(0,pn.C)(),f=(0,G.w1)(Pt.Y),{hasCountdown:m,endCountdown:v}=(0,At.c)(),{hasPrompt:g,continueChat:y}=(0,Un.c)(),b=(0,ye.w)(),w=(0,Te.Ce)("suggestion"),{body:x}=(0,ee.kx)({payload:w}),C=(0,q.useMemo)((()=>w&&!f?x:[]),[w,f,x]),_=(0,q.useRef)(null),j=(0,q.useRef)(!1),E=(0,q.useRef)([]),S=!!C.length,T=n?(b||a)&&!e:b,k=(0,q.useRef)(T),O=S&&!T&&l,N=S?C:E.current;E.current=N;const I=(0,q.useMemo)((()=>{const n=["suggestions"];return e&&n.push("suggestions--aside"),(0,t.U)(n)}),[e]),U=(0,q.useCallback)((({id:e,question:t})=>{m&&v(!0),g&&y(),o({type:re.w$.custom,originMessage:w.id,body:{type:"faqclick",body:{faqId:e,faqQuestion:t}}}),i(t),a||c(Lt.I.open),d()}),[i,y,v,d,m,g,w,o,c,a]);(0,q.useEffect)((()=>{if(_.current!==C&&!T){if(S){const e=j.current?r("suggestions.srUpdatedText"):r("suggestions.srAvailableText");setTimeout((()=>{h(e)}),30)}else j.current&&h(r("suggestions.srUnavailableText"));_.current=C}!k.current&&T?((0,A.wN)(p.current,d),h(r("suggestions.srUnavailableText"))):!S&&j.current&&(0,A.wN)(p.current,d),j.current=S,k.current=T}),[C,S,T,d,h,r]);const R=r("suggestions.headingText"),M=r("suggestions.footerText"),P=R?"section":"div";return(0,s.jsx)(On,{isActive:O,transitionStartState:kn.notRendered,children:(0,s.jsxs)(P,{className:I,"aria-labelledby":R?u:null,ref:p,children:[R&&(0,s.jsx)("p",{id:u,className:(0,t.U)("suggestions__heading"),children:R}),!!N.length&&(0,s.jsx)(Ce,{suggestions:N,onClickSuggestion:U}),M&&!a&&(0,s.jsx)("p",{className:(0,t.U)("suggestions__footer"),children:M})]})})};var Rn=n(2796);const Mn=(0,vn.forwardRef)((({children:e,className:n=""},r)=>{const{isOpen:o,isVisible:i,setVisibility:a}=(0,bt.uu)(),{namespace:c,layoutMode:l}=(0,Q.EV)(),{isInline:u}=(0,Te.y2)(),d=(0,Rn.E)(),p=(0,ye.w)(),{t:h}=(0,oe.g)(),f=["chat",`chat--layout-${l}`,`namespace--${c}`,...d,n];return o||"app"===l||f.push("chat--collapsed"),p&&f.push("chat--user-responded"),i&&(0,s.jsxs)("section",{className:(0,t.U)(f),onKeyDown:e=>{(e.code&&"Escape"===e.code||27===e.keyCode)&&!u&&o&&a(Lt.I.minimized)},tabIndex:"-1",ref:r,"aria-label":h("chat.srLabel"),children:[(0,s.jsx)("div",{className:(0,t.U)("chat-wrapper"),children:e}),"inline"===l&&o&&(0,s.jsx)(An,{isAside:!0})]})})),Pn=({children:e,handleClose:n,title:r,closeButtonText:o,srCloseButtonText:i,id:a})=>{const c=(0,ae.k3)();return(0,s.jsxs)("section",{tabIndex:-1,id:a,"aria-labelledby":r?c:void 0,className:(0,t.U)("chat-status",!r&&"chat-status--condensed"),children:[(0,s.jsxs)("div",{className:(0,t.U)("chat-status__body"),children:[r?(0,s.jsx)("h2",{className:(0,t.U)("chat-status__title"),id:c,children:r}):null,e]}),"function"==typeof n&&(0,s.jsxs)("button",{type:"button",onClick:n,className:(0,t.U)("button","button--tertiary","chat-status__close"),children:[o||(0,s.jsx)(ce.c,{name:"close",size:"16",alt:""}),i&&(0,s.jsx)("span",{className:(0,t.U)("visually-hidden"),children:i})]})]})},Ln=({handleClick:e,icon:n,title:r,srButtonText:o})=>(0,s.jsxs)("button",{type:"button",onClick:e,className:(0,t.U)("button","button--primary","chat-status__button"),children:[(0,s.jsx)(ce.c,{name:n,size:"16",alt:""}),r,o&&(0,s.jsx)("span",{className:(0,t.U)("visually-hidden"),children:o})]});function Dn(){const{showProposal:e,translationProposal:t,dismissTranslationProposal:n,activateTranslationProposal:r}=(0,ee.ol)(),{id:o}=(0,ee.im)();return e?(0,s.jsx)(Pn,{handleClose:n,srCloseButtonText:t.srDismissButtonText,id:o,title:t.titleLabel,children:(0,s.jsx)(Ln,{handleClick:r,icon:"newTranslation",title:t.buttonLabel})}):null}function Fn(){const e=(0,G.w1)(Pt.Y),{isActive:t}=(0,ee.A1)();return e||t?null:(0,s.jsx)(Dn,{})}const Bn=({label:e,checked:n,description:r,onChange:o,id:i,itemClassName:a})=>(0,s.jsxs)("li",{className:(0,t.U)([a,"translation-options__item"]),"aria-selected":n,role:"option",tabIndex:0,onClick:o,onKeyDown:e=>{"Space"!==e.code&&"Enter"!==e.code||(e.preventDefault(),o())},id:i,children:[(0,s.jsx)(ce.c,{name:"check",size:"16",alt:""}),e," ",r&&(0,s.jsxs)("span",{children:["(",r,")"]})]}),zn=({onChange:e,describedById:n})=>{const{context:{userLocale:r,contentLocale:o}}=(0,Q.EV)(),{t:i}=(0,oe.g)(),{languages:a,currentLocale:c,enableTranslations:l,disableTranslations:u}=(0,ee.A1)(),d=(0,Nn.e6)(),p=t=>()=>{t===c||o===t?u():l(t),e(),d()},{primaryLanguages:h,remainingLanguages:f}=(0,vn.useMemo)((()=>a.reduce(((e,t)=>{const n=t.locale===o,r=((e,t,n)=>t===e.locale||!t&&n)(t,c,n);t.locale!==o&&e.remainingLanguages.push(Object.assign(Object.assign({},t),{checked:r,isOriginal:n}));const s=e.remainingLanguages.findIndex((e=>e.locale===c));return(n||r&&s>4)&&e.primaryLanguages.push(Object.assign(Object.assign({},t),{checked:r,isOriginal:n})),e}),{primaryLanguages:[],remainingLanguages:[]})),[c,o,a]);return(0,s.jsxs)("ul",{"aria-describedby":n,role:"listbox",tabIndex:-1,className:(0,t.U)("translation-options"),children:[h.map((({locale:e,nativeName:n,checked:r,isOriginal:o},a)=>(0,s.jsx)(Bn,{id:e,label:n,checked:r,description:o&&i("translations.settings.original"),onChange:p(e),itemClassName:(0,t.U)({"translation-options__item--original":o,"translation-options__item--selected":r&&0!==a})},e))),f.map((({locale:e,nativeName:t,checked:n,isOriginal:r})=>(0,s.jsx)(Bn,{id:e,label:t,checked:n,description:r&&i("translations.settings.original"),onChange:p(e)},e)))]})},$n=({className:e,children:n,onCancel:r,headingText:o,description:i,descriptionId:a,cancelButtonText:c,cancelButtonRef:l,disableButtonFocusing:u,position:d={horizontal:"left",vertical:"top"}})=>{const p=(0,ne.k3)(),{hideOption:h}=(0,ne.Yj)(),{focusButton:f}=(0,ne.a)(),m=(0,q.useCallback)((()=>{h(),u||f()}),[u,f,h]),v=(0,q.useCallback)((()=>{r&&r(),m()}),[m,r]),g=(e=>{const t=(0,q.useRef)(null);return(0,q.useEffect)((()=>{const n=n=>{t.current&&n.target instanceof HTMLElement&&!t.current.contains(n.target)&&(n.preventDefault(),n.stopPropagation(),e())};return document.addEventListener("click",n,!0),document.addEventListener("touchstart",n,!0),()=>{document.removeEventListener("click",n,!0),document.removeEventListener("touchstart",n,!0)}}),[e,t]),t})(v);return(0,q.useEffect)((()=>{(0,A.O8)(g.current)}),[g]),(0,s.jsx)("section",{className:(0,t.U)("options",{"options--right":"right"===d.horizontal,"options--left":"left"===d.horizontal,"options--top":"top"===d.vertical,"options--bottom":"bottom"===d.vertical},e),"aria-labelledby":p,tabIndex:-1,ref:g,children:(0,s.jsxs)("div",{className:(0,t.U)("options__body"),children:[(0,s.jsx)("h2",{id:p,className:(0,t.U)("options__title"),children:o}),(0,s.jsxs)("button",{type:"button",onClick:v,"aria-describedby":p,className:(0,t.U)("button","options__close"),ref:e=>{l&&(l.current=e)},children:[(0,s.jsx)(ce.c,{name:"close",size:"16",alt:""}),(0,s.jsx)("span",{children:c})]}),i?(0,s.jsx)("p",{className:(0,t.U)("options__description"),id:a,children:i}):null,(0,s.jsx)("div",{className:(0,t.U)("options__wrapper"),children:n})]})})},Vn=function({onClose:e,position:t}){const{t:n}=(0,oe.g)(),r=(0,ne.k3)();return(0,s.jsx)($n,{onCancel:e,headingText:n("translations.menu.title"),cancelButtonText:n("translations.settings.cancelButtonText"),description:n("translations.menu.description"),descriptionId:r,position:t,disableButtonFocusing:!0,children:(0,s.jsx)(zn,{describedById:r,onChange:e})})};function Hn({children:e,position:n={horizontal:"left",vertical:"top"},classNames:r}){const[o,i]=(0,q.useState)(!1),a=(0,q.useRef)(null),c=(0,ne.k3)();return(0,s.jsxs)("div",{className:(0,t.U)("translations__container"),onKeyDown:e=>{o&&(0,A.gP)(e)===A.sH.Escape&&(i(!1),(0,A.O8)(a.current))},children:[(0,s.jsx)(On,{transitionStartState:kn.notRendered,isActive:o,children:(0,s.jsx)("div",{className:(0,t.U)("options__dialog"),role:"dialog",children:(0,s.jsx)(Vn,{onClose:()=>{i(!1)},position:n})})}),(0,s.jsx)("button",{type:"button",className:(0,t.U)(["button","chat__options__button",...r]),id:c,onClick:()=>{i(!o)},onKeyDown:e=>{(0,A.gP)(e)===A.sH.ArrowDown&&(i(!0),e.preventDefault())},ref:a,"aria-haspopup":"dialog","aria-expanded":o,children:e})]})}var Kn=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var s=0;for(r=Object.getOwnPropertySymbols(e);s<r.length;s++)t.indexOf(r[s])<0&&Object.prototype.propertyIsEnumerable.call(e,r[s])&&(n[r[s]]=e[r[s]])}return n};function Wn(e){var{children:t,formId:n,persistData:r,onError:o,onSubmit:i,validationSchema:a}=e,c=Kn(e,["children","formId","persistData","onError","onSubmit","validationSchema"]);const l=(0,G.OY)(),u=(0,G.w1)((e=>tn(e,{formId:n}))),[d,p]=(0,q.useState)(!1),[h,f]=(0,q.useState)({}),{isValid:m,errors:v}=function(e,t){const n=(0,q.useMemo)((()=>function(e,t={}){return Object.entries(t).reduce(((t,[n,r])=>{var s;const o=Array.isArray(r)?r:[r];for(let r=0;null!==(s=r<(null==o?void 0:o.length))&&void 0!==s&&s;r++)if(!o[r].fn(e[n],o[r].compareValue)){t[n]=o[r].errorText;break}return t}),{})}(e,t)),[e,t]);return{isValid:0===Object.keys(n).length,errors:n}}(u,a),g=(0,q.useMemo)((()=>Object.assign(Object.assign({},v),h)),[v,h]);(0,q.useLayoutEffect)((()=>{l((0,sn.e8)({formId:n,persistData:r}))}),[n,r,l]),(0,q.useEffect)((()=>()=>{l((0,sn.K0)({formId:n}))}),[n,r,l]);const y=(0,q.useCallback)(((e,t)=>{l((0,sn.OI)({formId:n,name:e,value:t}))}),[n,l]),b=(0,q.useCallback)(((e,t)=>{l((0,sn.mq)({formId:n,name:e,touched:t}))}),[l,n]),w=(0,q.useCallback)(((e,t)=>{f((n=>Object.assign(Object.assign({},n),{[e]:t})))}),[f]),x=(0,q.useCallback)((e=>{e.preventDefault();const t="true"===e.submitter.getAttribute("aria-disabled");p(!t),!t&&m&&(l((0,be.N8)(!0)),i(u,{updateControlValue:y,setError:w}))}),[m,l,i,u,y,w]);(0,q.useEffect)((()=>{o&&o({errors:g,isSubmitted:d,isValid:0===Object.keys(g).length})}),[d,g,o]);const C=(0,q.useMemo)((()=>({formId:n,values:u,errors:g,isValid:0===Object.keys(g).length,isSubmitted:d,handleSubmit:x,validationSchema:a,updateControlValue:y,updateControlTouched:b})),[n,u,g,d,x,a,y,b]);return n?i?(0,s.jsx)(cn,Object.assign({},c,{value:C,children:t})):(console.error('"onSubmit" is required.'),null):(console.error('"formId" is required.'),null)}const qn=(e,t,n=null)=>({fn:e,errorText:t,compareValue:n}),Gn=(e,t)=>{let n=!0;for(let r=0;r<e.length;r++)e[r].size>t&&(n=!1);return n},Yn=e=>!!e?.length>0,Jn=e=>{const t=e&&e.trim();return!(!t||!t.match(/^(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\[(?:(?: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]?|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])$/i))},Xn=e=>!!e,Qn=function({className:e,disableValidationClasses:n,...r}){const{handleSubmit:o,isValid:i,isSubmitted:a}=function(){const{handleSubmit:e,isSubmitted:t,isValid:n}=un();return{handleSubmit:e,isSubmitted:t,isValid:n}}(),c=["form"];return!n&&a&&(c.push("form--submitted"),i?c.push("form--valid"):c.push("form--invalid")),(0,s.jsx)("form",{onSubmit:o,className:(0,t.U)([...c,e]),...r})};function Zn({id:e,error:n}){const[r,o]=(0,q.useState)(!1);return(0,q.useEffect)((()=>{const e=setTimeout((()=>o(!0)),300);return()=>clearTimeout(e)}),[]),(0,s.jsx)("div",{className:(0,t.U)("error"),"aria-live":"assertive","aria-atomic":"true",children:r&&n&&(0,s.jsxs)("span",{id:e,className:(0,t.U)("error__message"),children:[(0,s.jsx)(ce.c,{name:"error",size:"16",alt:""}),n]})})}const er=({contentHint:e,id:n,labelText:r,labelClass:o,validity:i,errorText:a,children:c})=>(0,s.jsxs)(s.Fragment,{children:[e&&(0,s.jsx)("span",{id:`${n}-content-hint`,className:(0,t.U)("input__content-hint"),children:e}),(0,s.jsx)(Zn,{id:`${n}-error`,error:!i&&a}),(0,s.jsxs)("div",{className:(0,t.U)("form-control__wrapper"),children:[(0,s.jsx)("label",{htmlFor:n,className:(0,t.U)(o),children:r}),c]})]});const tr=function(e){var{id:t,name:n,type:r,labelText:o,labelClass:i,contentHint:a=null,"aria-describedby":c}=e,l=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var s=0;for(r=Object.getOwnPropertySymbols(e);s<r.length;s++)t.indexOf(r[s])<0&&Object.prototype.propertyIsEnumerable.call(e,r[s])&&(n[r[s]]=e[r[s]])}return n}(e,["id","name","type","labelText","labelClass","contentHint","aria-describedby"]);const{isSubmitted:u}=un(),[d,{error:p}]=dn(n),h=u&&p,f=[];return c&&f.push(c),a&&f.push(`${t}-content-hint`),h&&f.push(`${t}-error`),(0,s.jsx)(er,{id:t,contentHint:a,validity:!h,errorText:p,labelText:o,labelClass:i,children:(0,s.jsx)("input",Object.assign({id:t,name:n,type:r,"aria-invalid":h?"true":"false","aria-describedby":f.join(" ")||null},d,l))})};function nr({controlName:e,describedById:n}){const{t:r}=(0,oe.g)();return(0,s.jsxs)(Qn,{noValidate:"true",className:(0,t.U)("options__form"),children:[(0,s.jsx)(tr,{name:e,type:"email",className:(0,t.U)("transcript__input"),"aria-describedby":n,labelClass:(0,t.U)("label"),labelText:r("options.sendTranscript.label")}),(0,s.jsx)("div",{className:(0,t.U)("options__actions"),children:(0,s.jsx)("button",{type:"submit",className:(0,t.U)("button","button--primary","options__submit"),children:r("options.sendTranscript.sendButtonText")})})]})}const rr="email",sr={sendTranscript:()=>{const[e,t]=(0,q.useState)(void 0),{hideOption:n}=(0,ne.Yj)(),{focusButton:r}=(0,ne.a)(),{t:o}=(0,oe.g)(),i=(0,ne.k3)(),{sendAction:a}=(0,ne.wv)(),c=(0,q.useMemo)((()=>({[rr]:[qn(Xn,o("options.sendTranscript.noEmailText")),qn(Jn,o("options.sendTranscript.invalidEmailText"))]})),[o]),l=(0,q.useCallback)((e=>{const t=e[rr].trim();a({type:re.w$.sendTranscript,body:{emailAddress:t}}),n(),r()}),[a,n,r]),u=(0,q.useCallback)((({isValid:e,isSubmitted:n})=>{t(n&&!e?"options--error":void 0)}),[t]);return(0,s.jsx)($n,{className:e,headingText:o("options.sendTranscript.title"),cancelButtonText:o("options.cancelButtonText"),description:o("options.sendTranscript.description"),descriptionId:i,position:{vertical:"top",horizontal:"right"},children:(0,s.jsx)(Wn,{formId:"sendTranscript",onSubmit:l,validationSchema:c,onError:u,children:(0,s.jsx)(nr,{controlName:rr,describedById:i})})})}},or=()=>{const{optionActive:e}=(0,ne.Yj)(),t=(0,q.useRef)(null),n=sr[e||t.current];return e&&(t.current=e),n?(0,s.jsx)(n,{}):null},ir=()=>{const{t:e}=(0,oe.g)(),{menuOptions:n,showOption:r,panelActive:o,hideOption:i}=(0,ne.Yj)(),{id:c}=(0,ne.a)(),l=(0,q.useRef)(null),[u,d]=(0,q.useState)(!1),p=(0,q.useRef)(null),h=n.length,f=(0,q.useRef)(Array.from({length:h},(()=>(0,a.createRef)()))),m=(0,q.useRef)(!1),v=h>1,g=n[0],y=(0,q.useMemo)((()=>g?.name?.trim().replace(/\s+/g,"")),[g]);return(0,q.useEffect)((()=>()=>{clearTimeout(l.current)}),[]),(0,q.useEffect)((()=>{u&&!m.current&&requestAnimationFrame((async()=>{await(0,Nn.me)(60);const e=n.findIndex((e=>e.available)),t=-1===e?0:e;(0,A.O8)(f.current[t])})),m.current=u}),[u,n]),h?(0,s.jsxs)("div",{className:(0,t.U)("options__container"),onKeyDown:e=>{u&&((0,A.gP)(e)===A.sH.Escape&&(d(!1),(0,A.O8)(p.current)),(0,A.gP)(e)===A.sH.Home&&((0,A.O8)(f.current[0]),e.preventDefault()),(0,A.gP)(e)===A.sH.End&&((0,A.O8)(f.current[h-1]),e.preventDefault()))},onfocusout:()=>{v&&(l.current=setTimeout((()=>{d(!1)}),200))},onfocusin:()=>{clearTimeout(l.current)},children:[(0,s.jsx)(On,{transitionStartState:kn.notRendered,isActive:o,children:(0,s.jsx)("div",{className:(0,t.U)("options__dialog"),children:(0,s.jsx)(or,{})})}),v&&(0,s.jsx)(On,{isActive:u,transitionStartState:kn.notRendered,children:(0,s.jsx)("ul",{className:(0,t.U)(["options__menu"]),role:"menu",tabIndex:"-1","aria-labelledby":c,children:n.map((({name:o,title:i,available:a},c)=>(0,s.jsx)("li",{className:(0,t.U)("options__menu__item"),role:"menuitem","data-testid":o,children:(0,s.jsxs)("button",{type:"button",ref:e=>{f.current[c]=e},className:(0,t.U)(["button","button--secondary"]),onKeyDown:e=>((e,t)=>{if((0,A.gP)(e)===A.sH.ArrowDown){const n=Math.min(h-1,t+1);(0,A.O8)(f.current[t===n?0:n]),e.preventDefault()}if((0,A.gP)(e)===A.sH.ArrowUp){const n=Math.max(0,t-1);(0,A.O8)(f.current[t===n?h-1:n]),e.preventDefault()}})(e,c),onKeyPress:e=>((e,t)=>{const r=String.fromCharCode(e.charCode);if(1!==r.length||!r.match(/\S/))return;let s=-1;n.forEach(((e,n)=>{n>t&&e.title.charAt(0).toLowerCase()===r.toLowerCase()&&-1===s&&(s=n)})),-1!==s&&(0,A.O8)(f.current[s])})(e,c),onClick:()=>((e,t)=>{t&&(d(!1),r(e))})(o,a),"aria-disabled":a?null:"true",children:[(0,s.jsxs)("span",{className:(0,t.U)("button__text"),children:[i,!a&&" "]}),!a&&(0,s.jsx)("span",{className:(0,t.U)("button__state"),children:e("options.unavailableText")})]})},o)))})}),(0,s.jsxs)("button",{type:"button",className:(0,t.U)(["button","button--secondary","chat__options__button",...!v&&y?[`chat__options__button--${y}`]:[]]),id:c,onClick:()=>{o&&i(),v?d((e=>!e)):g.available&&!o&&r(g.name)},onKeyDown:v?e=>{(0,A.gP)(e)===A.sH.ArrowDown&&(d(!0),e.preventDefault())}:null,ref:p,"aria-haspopup":v?"menu":null,"aria-expanded":v?u.toString():null,"aria-disabled":v||g.available?null:"true",children:[v&&(0,s.jsx)(ce.c,{name:"options",size:"32",alt:""}),(0,s.jsx)("span",{className:(0,t.U)("button__text"),children:v?e("options.openButtonText"):`${g.title}${g.available?"":" "}`}),!v&&!g.available&&(0,s.jsx)("span",{className:(0,t.U)("button__state"),children:e("options.unavailableText")})]})]}):null};function ar(){const{menuOptions:e,allowOptionSelection:n}=(0,ne.Yj)(),{isAvailable:r}=(0,ee.A1)(),o=(0,G.w1)(Pt.Y),{t:i,locale:a}=(0,oe.g)(),c=(0,ee.EI)(a);if(!r&&(!n||!e.length)||o)return null;const l=i("translations.settings.openButtonText",{hasLanguage:!!c,language:c});return(0,s.jsxs)("div",{className:(0,t.U)("chat__options"),children:[r&&(0,s.jsx)("div",{className:(0,t.U)("chat__options-item","chat__options-item--left"),children:(0,s.jsxs)(Hn,{classNames:["button--secondary"],children:[(0,s.jsx)(ce.c,{alt:l,name:"newTranslation",size:"16"}),(0,s.jsx)("span",{className:(0,t.U)("button__text"),children:l})]})}),n&&(0,s.jsx)("div",{className:(0,t.U)("chat__options-item","chat__options-item--right"),children:(0,s.jsx)(ir,{})})]})}const cr=()=>{const{scrollToRef:e,unreadIds:n}=(0,q.useContext)(gn),{isMinimized:r}=(0,bt.uu)(),{t:o}=(0,oe.g)();return(0,s.jsx)(On,{isActive:!!n.length&&!r,children:(0,s.jsx)("div",{className:(0,t.U)("unread-messages"),children:(0,s.jsxs)("button",{type:"button",className:(0,t.U)("button","button--primary"),onClick:e,children:[o("message.unreadMessagesCount",{unreadCount:n.length}),(0,s.jsx)(ce.c,{name:"chevronDown",size:"32",alt:""})]})})})};const lr=e=>{const t=(0,q.useRef)(),[n,r]=(0,q.useState)(!0),s=(0,G.w1)(Gt),o=(0,Te.kV)(),i=(0,Te.sJ)(),{isOpen:a}=(0,bt.uu)(),c=(0,Te.w1)(),{processingFileUploads:l,isLastEventFromClient:u}=(0,G.w1)((({state:e})=>e));(0,q.useEffect)((()=>{const e=t.current,n=()=>{const{scrollHeight:t,scrollTop:n,clientHeight:s}=e,o=Math.abs(t-n-s)>10;r(!o)};return e.addEventListener("scroll",n),()=>e.removeEventListener("scroll",n)}),[]);const d=(0,q.useCallback)((()=>{requestAnimationFrame((()=>{return e=void 0,n=void 0,s=function*(){var e,n;yield(0,Nn.me)(30),null===(e=t.current)||void 0===e||e.scrollTo({top:null===(n=t.current)||void 0===n?void 0:n.scrollHeight,left:0,behavior:"auto"})},new((r=void 0)||(r=Promise))((function(t,o){function i(e){try{c(s.next(e))}catch(e){o(e)}}function a(e){try{c(s.throw(e))}catch(e){o(e)}}function c(e){var n;e.done?t(e.value):(n=e.value,n instanceof r?n:new r((function(e){e(n)}))).then(i,a)}c((s=s.apply(e,n||[])).next())}));var e,n,r,s}))}),[]);return(0,q.useEffect)((()=>{u&&d()}),[u,d]),(0,q.useEffect)((()=>{n&&d()}),[n,s,o,i,a,c,l,d]),{containerRef:t,unreadIds:s,scrollToRef:()=>{var n,r;const o=null===(n=e[null==s?void 0:s.at(0)])||void 0===n?void 0:n.current;null===(r=t.current)||void 0===r||r.scrollTo({top:null==o?void 0:o.offsetTop,behavior:"auto",left:0})},scrollToBottom:d}},ur=({children:e})=>{const n=(0,ne.kV)(),r=(0,q.useMemo)((()=>n.reduce(((e,t)=>t.payload.id?(e[t.payload.id]=(0,a.createRef)(),e):e),{})),[n]),{scrollToRef:o,scrollToBottom:i,containerRef:c,unreadIds:l}=lr(r);return(0,s.jsx)(gn.Provider,{value:{eventRefs:r,unreadIds:l,scrollToRef:o,scrollToBottom:i,containerRef:c},children:(0,s.jsxs)("div",{className:(0,t.U)("chat__container"),children:[(0,s.jsx)("div",{className:(0,t.U)("chat__container__scroll-area"),ref:c,children:e}),(0,s.jsx)(cr,{})]})})};var dr=n(7268);const pr=({baseClassName:e,children:n,title:r})=>{const o=(0,ne.OK)(),i=(0,ne.k3)();return(0,s.jsxs)("section",{id:o,className:(0,t.U)(e),"aria-describedby":i,tabIndex:"-1",children:[(0,s.jsx)("h2",{className:(0,t.U)(`${e}__title`),id:i,children:r}),n]})},hr=()=>{const{t:e}=(0,oe.g)(),n=(0,Nn.e6)(),r=(0,dr.c)(),{emitEvent:o}=(0,In.c)(),{isActive:i,remaining:a,timer:c,endCountdown:l}=(0,At.c)(),u=a>0,d=e(u?"idleDetachWarning.countdownTitle":"idleDetachWarning.notifyTransferText");return(0,s.jsx)(pr,{baseClassName:"idle",title:d,children:u&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:(0,t.U)("idle__count-container"),children:i&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("span",{className:(0,t.U)("idle__count-text"),children:e("idleDetachWarning.countdownText")}),(0,s.jsx)("span",{className:(0,t.U)("idle__count-timer"),children:e("idleDetachWarning.countdownTimer",c)})]})}),(0,s.jsxs)("div",{className:(0,t.U)("idle__options"),children:[(0,s.jsx)("button",{type:"button",className:(0,t.U)("button","button--primary"),onClick:()=>{r(),l(!0),n(),o("idleTimer.selectContinue")},children:e("idleDetachWarning.continueButton")}),(0,s.jsx)("button",{type:"button",className:(0,t.U)("button","button--primary"),onClick:()=>{l(),n(),o("idleTimer.selectEnd")},children:e("idleDetachWarning.detachButton")})]})]})})},fr=()=>{const{t:e}=(0,oe.g)(),n=(0,dr.c)(),{name:r}=(0,Te.KC)()||{},{continueChat:o,restartChat:i}=(0,Un.c)();return(0,s.jsx)(pr,{baseClassName:"prompt",title:e("resumeConversationPrompt.title",{name:r}),children:(0,s.jsxs)("div",{className:(0,t.U)("prompt__options"),children:[(0,s.jsx)("button",{type:"button",className:(0,t.U)("button","button--primary"),onClick:()=>{n(),o()},children:e("resumeConversationPrompt.continueButton")}),(0,s.jsx)("button",{type:"button",className:(0,t.U)("button","button--primary"),onClick:i,children:e("resumeConversationPrompt.detachButton")})]})})},mr=()=>{const{sendAction:e}=(0,ne.wv)(),{features:t}=(0,ne.Yj)(),{typingPeekahead:n}=t||{},r=(0,q.useRef)(null),s=(0,q.useRef)(null),o=(0,q.useRef)(!1),i=(0,q.useRef)(null);(0,q.useEffect)((()=>()=>{clearInterval(i.current),clearTimeout(r.current),clearTimeout(s.current)}),[]);const a=(t,r)=>{e({type:re.w$.typing,state:t,...n&&n.enabled?{body:{currentMessage:r}}:{}})};return e=>{e.code&&"Enter"===e.code||13===e.keyCode||(o.current=!0,i.current||(a(!0,e.target.value),i.current=setInterval((()=>{o.current?n&&n.enabled&&a(!0,e.target.value):(clearInterval(i.current),i.current=null)}),h.e)),clearTimeout(r.current),clearTimeout(s.current),r.current=setTimeout((()=>{o.current=!1}),300),s.current=setTimeout((()=>{a(!1,e.target.value)}),h.e))}},vr=()=>{const{default:e,active:t,userSelected:n,options:r,optionsOverride:s}=(0,Te.gf)().entryMeta,o=(0,G.OY)(),i=n||t||e,a=s[i]||r[i]||{},c=(0,q.useCallback)((e=>{o((0,Ue.kl)(e))}),[o]),l=(0,q.useCallback)((e=>{o((0,Ue.cj)(e))}),[o]),u=(0,q.useCallback)((e=>{o((0,Ue.gz)(e))}),[o]),d=(0,q.useCallback)((()=>{n?u(null):l(e)}),[n,e,u,l]);return{activeEntry:i,activeEntryOptions:a,setActiveEntryType:l,setUserEntryType:u,cancelEntrySelection:d,setBlockAutoEntrySwitch:c}};function gr({controlName:e,skipLinkId:n}){const{t:r}=(0,oe.g)(),{sendAssertive:o}=(0,ne.CE)(),{emitEvent:i}=(0,ne.wv)(),a=mr(),{setBlockAutoEntrySwitch:c}=vr(),{placeholder:l,label:u,labelClass:d}=fn(e),{hasCharacterLimit:p,reachedCharacterWarning:h,reachedCharacterLimit:f,remainingChars:m}=hn(e),[{value:v}]=dn(e),g=!!v,y=(0,q.useCallback)((()=>{h&&o(r("input.srCharacterLimitText",{limit:m})),i("ui.inputFocus")}),[r,o,h,m,i]);return(0,q.useLayoutEffect)((()=>(c(g),()=>{c(!1)})),[c,g]),(0,s.jsxs)(Qn,{className:(0,t.U)("entry-form"),disableValidationClasses:!0,noValidate:"true",children:[(0,s.jsxs)("div",{className:(0,t.U)(["input--text__container",...h&&!f?["character-warning"]:[],...f?["character-exceeded"]:[]]),children:[(0,s.jsx)(tr,{id:n,type:"text",name:e,className:(0,t.U)("input__text"),autocomplete:"off",placeholder:l,labelText:u,labelClass:(0,t.U)(d),"aria-invalid":p?f:null,onKeyUp:a,onFocus:y}),(0,s.jsx)("div",{className:(0,t.U)("character-count"),children:h&&(0,s.jsx)("span",{children:m})})]}),(0,s.jsx)("button",{className:(0,t.U)("button","input__submit"),type:"submit",onPointerDown:e=>{e.preventDefault()},"aria-disabled":!g||f?"true":null,children:(0,s.jsx)(ce.c,{name:"send",size:"32",alt:r("input.sendMessage")})})]})}const yr="textMessageEntry";function br({...e}){const{isOpen:t,setVisibility:n}=(0,bt.uu)(),r=(0,ne.OK)(),o=(0,ne.e6)(),{sendMessage:i}=(0,ne.wv)(),a=(0,q.useCallback)(((e,{updateControlValue:r})=>{i({body:e[yr]}),r(yr,""),o(),t||n(Lt.I.open)}),[i,o,t,n]);return(0,s.jsx)(Wn,{...e,formId:"textEntry",persistData:!0,onSubmit:a,children:(0,s.jsx)(gr,{controlName:yr,skipLinkId:r})})}const wr=()=>{const{t:e}=(0,oe.g)(),{currentUploads:n}=(0,ne.uc)();return(0,s.jsx)("div",{className:(0,t.U)("progress"),children:n.map((({id:n,name:r,progress:o,uploading:i,error:a})=>(0,s.jsxs)("div",{className:(0,t.U)("progress_container"),children:[(0,s.jsxs)("div",{className:(0,t.U)("progress__text"),children:[(0,s.jsx)("span",{className:(0,t.U)("progress__text--file-name"),children:r}),(0,s.jsx)("span",{className:(0,t.U)("progress__text--percentage"),children:`${o}%`})]}),(0,s.jsx)(Zn,{error:a}),(0,s.jsx)("progress",{className:(0,t.U)("progress__bar"),role:"progressbar","aria-valuemin":"0","aria-valuemax":"100","aria-label":e("fileUpload.srProgressLabel",{fileName:r}),max:"100","aria-valuenow":o,value:o,"aria-busy":i,children:`${o}%`})]},n)))})};function xr({id:e,name:n,labelText:r,contentHint:o,outputText:i,accept:a}){const{isSubmitted:c}=un(),[l,u]=(0,q.useState)(!1),[{onInput:d,onBlur:p},{error:h}]=dn(n),f=(0,ne.k3)(),m=(0,ne.k3)(),v=(0,ne.k3)(),g=c&&h,y=[v];o&&y.push(m),g&&y.push(f);const b=(0,q.useCallback)((()=>{u(!0)}),[u]),w=(0,q.useCallback)((()=>{u(!1),p()}),[u,p]),x=(0,q.useCallback)((e=>{const t={target:{value:e.target.files}};d(t)}),[d]);return(0,s.jsxs)("div",{className:(0,t.U)("upload__container"),children:[o&&(0,s.jsx)("span",{className:(0,t.U)("upload__content-hint"),id:m,children:o}),(0,s.jsx)(Zn,{id:f,error:g&&h}),(0,s.jsx)("div",{className:(0,t.U)(["file-upload",...l?["focus-within"]:[]]),children:(0,s.jsxs)("label",{htmlFor:e,className:(0,t.U)("upload__label"),children:[(0,s.jsx)(ce.c,{name:"upload",size:"32",alt:""}),(0,s.jsxs)("div",{children:[(0,s.jsx)("span",{className:(0,t.U)(["upload__label--text"]),children:r}),(0,s.jsx)("input",{id:e,className:(0,t.U)("upload__input"),type:"file",name:n,onChange:x,"aria-invalid":g?"true":"false","aria-describedby":y.join(" "),accept:a||null,onFocus:b,onBlur:w}),(0,s.jsx)("span",{className:(0,t.U)("upload__output"),"aria-hidden":"true",id:v,children:i})]})]})})]})}function Cr({skiplinkId:e,controlName:n,accept:r,contentHint:o,isUploading:i,isComplete:a,onClickCancel:c}){const{t:l}=(0,oe.g)(),[{value:u}]=dn(n),d=u&&u.length>0,p=d?u[0].name:"";return(0,s.jsxs)(Qn,{className:(0,t.U)("upload-form"),children:[(0,s.jsx)(xr,{name:n,id:e,accept:r,labelText:l("fileUpload.labelText"),outputText:l("fileUpload.selectedText",{hasFile:d,filename:p}),contentHint:o}),(0,s.jsxs)("div",{className:(0,t.U)("upload__button-container"),children:[(0,s.jsx)("button",{id:i||!a?e:void 0,type:"button",onClick:c,className:(0,t.U)("button","button--secondary","upload__cancel"),children:l("fileUpload.cancelButtonText")}),(0,s.jsx)("button",{className:(0,t.U)("button","button--primary"),type:"submit",children:l("fileUpload.uploadButtonText")})]})]})}const _r="fileListForm",jr="fileList",Er=()=>{const{t:e}=(0,oe.g)(),{sendPolite:n,sendAssertive:r}=(0,ne.CE)(),o=(0,ne.OK)(),i=(0,ne.e6)(),{serviceAllowsUploads:a,allowedMimeTypes:c,maxSize:l}=(0,ne.A9)(),u=(0,q.useRef)(null),d=(0,q.useRef)(a),{cancelEntrySelection:p}=vr(),{uploadFile:h,clearUploads:f,isUploading:m,isComplete:v}=(0,ne.uc)(),{hasFile:g,selectedFileName:y,uploadHandle:b,hasServerError:w,progress:x}=((e,t)=>{const n=(0,G.w1)((n=>nn(n,{formId:e,name:t}))),{currentUploads:r}=(0,ne.uc)(),s=n&&n.length>0;let o=null,i=!1,a=0;if(r&&r.length>0){const e=r[0];o=e.uploadHandle,i=!!e.error,a=e.progress}return{hasFile:s,selectedFileName:s?n[0].name:"",uploadHandle:o,hasServerError:i,progress:a}})(_r,jr),C=(0,ne.k3)(),_=(0,q.useRef)(!0),j=e("fileUpload.contentHint",{size:(0,A.IB)(l)}),E=(0,q.useRef)(""),S=(0,q.useRef)(null);(0,q.useEffect)((()=>{E.current&&S.current?.contains(document.activeElement)&&"INPUT"===document.activeElement.tagName&&r(j),E.current=j}),[j,r]),(0,q.useEffect)((()=>{x>0&&n(1===x?e("fileUpload.srStartedText"):`${x}%`)}),[x,n,e]),(0,q.useEffect)((()=>{_.current||m||!v||(f(),p(),i(),setTimeout((()=>{n(e("fileUpload.srCompleteText"))}),300)),_.current=v}),[m,v,f,p,i,n,e]);const T=(0,q.useCallback)((({fileList:e})=>{h(e[0]),i()}),[h,!1,i]),k=(0,q.useCallback)((()=>{b&&b.abort(),f(),p(),i()}),[b,f,p,i]),O=(0,q.useMemo)((()=>({[jr]:[qn((()=>a),e("fileUpload.errors.unavailable")),qn(Yn,e("fileUpload.errors.noFile")),qn(Gn,e("fileUpload.errors.tooLarge"),l)]})),[l,a,e]);return(0,s.jsx)("div",{className:(0,t.U)(["upload",...w?["upload--error"]:[]]),ref:S,children:(0,s.jsxs)(Wn,{formId:_r,persistData:!0,onSubmit:T,validationSchema:O,children:[(m||!v)&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(wr,{}),(0,s.jsx)("div",{className:(0,t.U)("upload__button-container"),children:(0,s.jsx)("button",{id:m||!v?o:void 0,type:"button",onClick:k,ref:u,className:(0,t.U)("button","button--secondary","upload__cancel"),children:e("fileUpload.cancelButtonText")})})]}),!m&&v&&(0,s.jsx)(Cr,{controlName:jr,skiplinkId:o,accept:c.join(", "),contentHint:j,isComplete:v,isUploading:m,outputText:e("fileUpload.selectedText",{hasFile:g,filename:y}),onClickCancel:k}),!d.current&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("span",{className:(0,t.U)("notification"),id:C,children:e("fileUpload.unavailableText")}),(0,s.jsx)("div",{className:(0,t.U)("upload__button-container"),children:(0,s.jsx)("button",{id:m||!v?o:void 0,type:"button",onClick:k,className:(0,t.U)("button","button--secondary","upload__cancel"),children:e("fileUpload.cancelButtonText")})})]})]})})},Sr=()=>{const{t:e}=(0,oe.g)(),{showFileUpload:n,serviceAllowsUploads:r}=(0,ne.A9)(),[o,i]=(0,q.useState)(r),a=(0,ne.e6)(),c=(0,q.useRef)(null),{setUserEntryType:l,activeEntry:u}=vr(),d=(0,q.useRef)(null),{sendPolite:p}=(0,ne.CE)(),h=!!(0,ne.KC)();return(0,q.useEffect)((()=>{(0,A.wN)(d.current,(()=>{r||a()})),i(r)}),[r,a]),(0,q.useEffect)((()=>{c.current&&!r&&p(e("fileUpload.srUnavailableText")),!1===c.current&&r&&p(e("fileUpload.srAvailableText")),h&&(c.current=r)}),[r,h,p,e]),!n&&u!==re.uG.upload&&(0,s.jsx)(On,{isActive:o,transitionStartState:kn.rendered,children:(0,s.jsx)("div",{className:(0,t.U)("upload-toggle-wrapper"),children:(0,s.jsx)(On,{isActive:o,transitionStartState:kn.visuallyHidden,children:(0,s.jsx)("button",{className:(0,t.U)(["button","button--secondary","upload-toggle"]),ref:d,"aria-disabled":o?null:"true",type:"button",onClick:o?()=>{l(re.uG.upload),a()}:null,children:(0,s.jsx)(ce.c,{name:"file",size:"32",alt:e("fileUpload.toggleButtonText")})})})})})},Tr=()=>{const{isOpen:e}=(0,bt.uu)(),n=(0,q.useRef)(null),{hasCountdown:r}=(0,ne.sD)(),[o,i]=(0,q.useState)(r),{hasPrompt:a}=(0,ne.AL)(),[c,l]=(0,q.useState)(a),u=(0,ne.e6)(),d=(0,q.useRef)(!1),{activeEntry:p}=vr(),[h,f]=(0,q.useState)({text:br,upload:Er}),[m,v]=(0,q.useState)((()=>p)),g=(0,Q.EV)(),{accountAllowsUploads:y}=(0,ne.A9)(),b=(0,q.useCallback)((()=>{(0,A.wN)(n.current,u)}),[u]);(0,q.useEffect)((()=>{const{customComponents:e}=g,{entry:t}=e||{};t&&f((e=>({...e,...t})))}),[g]),(0,q.useEffect)((()=>{b(),i(r),l(a)}),[r,a,b]),(0,q.useEffect)((()=>{v(p),b()}),[p,b,n]),d.current=!(!n.current||!n.current.contains(document.activeElement));const w=h[m];return(0,s.jsxs)("div",{className:(0,t.U)("chat__entry"),ref:n,children:[o&&(0,s.jsx)(hr,{}),c&&(0,s.jsx)(fr,{}),(0,s.jsxs)("div",{className:(0,t.U)(["entry__body",...r||a?["entry__body--hidden"]:[]]),children:[m!==re.uG.upload&&y&&e&&(0,s.jsx)(Sr,{}),(0,s.jsx)(w,{})]})]})},kr=()=>{const{t:e}=(0,oe.g)(),{isOpen:n,closeChat:r}=(0,bt.uu)(),{isWindow:o}=(0,Te.y2)();return n&&o?(0,s.jsx)("button",{type:"button",className:(0,t.U)("button","collapse-button"),onClick:r,children:(0,s.jsx)(ce.c,{name:"chevronDown",size:"32",alt:e("window.srCollapseButton")})}):null};var Or=n(9748);const Nr=()=>{const{meta:{originalError:e,title:n,message:r,buttonText:o,action:i,srText:a}}=(0,Or.q)(),c=(0,ne.wv)(),l=(0,ne.k3)(),{sendPolite:u}=(0,ne.CE)(),d=(0,ne.e6)(),p="SeamlySessionExpiredError"===e?.name;return(0,q.useEffect)((()=>{!p&&a&&setTimeout((()=>{u(a)}),200)}),[u,a,p]),p?(0,s.jsx)(s.Fragment,{}):(0,s.jsxs)("section",{className:(0,t.U)("interrupt"),"aria-labelledby":l,children:[(0,s.jsx)(kr,{}),(0,s.jsxs)("div",{className:(0,t.U)("interrupt__body"),children:[(0,s.jsx)("h2",{id:l,className:(0,t.U)("interrupt__title"),children:n}),(0,s.jsx)("p",{className:(0,t.U)("interrupt__message"),children:r}),o&&i&&(0,s.jsx)("div",{className:(0,t.U)("interrupt__actions"),children:(0,s.jsx)("button",{type:"button",className:(0,t.U)("button","button--primary"),onClick:()=>{c[i]&&c[i](),d()},children:o})})]})]})},Ir=function({children:e}){const n=(0,G.w1)(Pt.Y),{isOpen:r}=(0,bt.uu)();return n?(0,s.jsx)(Nr,{}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(ur,{children:[(0,s.jsxs)("div",{className:(0,t.U)("chat__container__header"),children:[(0,s.jsx)(Fn,{}),(0,s.jsx)(kr,{})]}),e]}),(0,s.jsx)(Tr,{}),r&&(0,s.jsx)(ar,{})]})};function Ur({event:e}){const[t]=yn(e);return(0,s.jsx)("li",{children:(0,s.jsx)(t,{event:e})})}function Ar({events:e}){return(0,s.jsx)("ul",{className:(0,t.U)("collapsed-chat-messages"),children:e.map((e=>(0,s.jsx)(Ur,{event:e},e.payload.id)))})}function Rr(){const{preChatEvents:e}=(0,Q.EV)(),t=(0,G.w1)(Pt.Y),{isOpen:n}=(0,bt.uu)();return!(t||!(null==e?void 0:e.length)||n)&&(0,s.jsx)(Ar,{events:e})}function Mr(){const{t:e}=(0,Jt.useI18n)(),t=e("window.chat.continue"),n=(0,q.useMemo)((()=>({type:"message",payload:{body:{text:t}}})),[t]);return(0,s.jsx)(Ar,{events:[n]})}const Pr=()=>{const e=(0,Q.E3)(),n=(0,Te.KC)(),r=(0,G.w1)(Pt.Y),o=n&&!r,i=o?n.avatar:e;return i?(0,s.jsx)("img",{className:(0,t.U)(o?"avatar":"icon"),src:i,alt:""}):(0,s.jsx)(ce.c,{name:"avatar",size:"32",alt:""})},Lr=({onClick:e})=>{const n=(0,Qt.aJ)(),{t:r}=(0,oe.g)(),o=n()?r("window.openButton.srContinue"):r("window.openButton.srStart"),i=(0,Nn.e6)(),{isOpen:a}=(0,bt.uu)(),c=(0,Te.I7)(),l=(0,q.useCallback)((()=>{e(),i()}),[i,e]);return(0,s.jsx)(On,{isActive:!a,transitionStartState:kn.rendered,children:(0,s.jsxs)("button",{className:(0,t.U)("window-open-button"),"aria-label":o,"aria-hidden":a,onClick:l,children:[(0,s.jsx)(On,{isActive:!!c,transitionStartState:kn.notRendered,children:(0,s.jsx)("span",{className:(0,t.U)("message-count"),"aria-hidden":"true",children:c})}),(0,s.jsx)(Pr,{})]})})},Dr=(e,t,n)=>"object"==typeof e?e[t]:n,Fr=n.p+"sounds/beep.mp3";var Br=function(e,t,n,r){return new(n||(n=Promise))((function(s,o){function i(e){try{c(r.next(e))}catch(e){o(e)}}function a(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?s(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(i,a)}c((r=r.apply(e,t||[])).next())}))};const zr=!!window.Notification,$r={app:()=>(0,s.jsx)(Mn,{children:(0,s.jsx)(Ir,{children:(0,s.jsx)(_n,{})})}),inline:()=>{const{showInlineView:e,containerRef:n}=(0,bt.ae)(),{isOpen:r}=(0,bt.uu)();return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(On,{isActive:!r,transitionStartState:kn.rendered,children:(0,s.jsxs)("div",{ref:n,className:(0,t.U)("unstarted-wrapper","unstarted-wrapper--inline"),children:[(0,s.jsx)(Rr,{}),(0,s.jsx)(An,{})]})}),(0,s.jsx)(On,{isActive:r,transitionStartState:kn.rendered,children:(0,s.jsx)(Mn,{ref:n,children:e&&(0,s.jsx)(Ir,{children:r&&(0,s.jsx)(_n,{})})})})]})},window:()=>{const{isOpen:e,openChat:n}=(0,bt.uu)(),r=(0,ye.w)(),{continueChat:o,preChat:i}=(0,Q.EV)();return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(Lr,{onClick:n}),(0,s.jsx)(On,{isActive:i&&!e&&!r,exitAfter:Dr(i,"exitAfter"),enterDelay:Dr(i,"enterDelay"),transitionStartState:kn.notRendered,children:(0,s.jsx)("div",{className:(0,t.U)("unstarted-wrapper","unstarted-wrapper--window"),children:(0,s.jsx)(Rr,{})})}),(0,s.jsx)(On,{isActive:o&&!e&&r,exitAfter:Dr(o,"exitAfter"),enterDelay:Dr(o,"enterDelay"),transitionStartState:kn.notRendered,children:(0,s.jsx)("div",{className:(0,t.U)("unstarted-wrapper","unstarted-wrapper--window","unstarted-wrapper--continue"),children:(0,s.jsx)(Mr,{})})}),(0,s.jsx)(On,{isActive:e,transitionStartState:kn.notRendered,children:(0,s.jsx)(Mn,{children:(0,s.jsx)(Ir,{children:(0,s.jsx)(_n,{})})})})]})}},Vr=({children:e})=>{const{sendNotification:n}=(()=>{const{proactiveMessages:e}=(0,Te.Ip)(),{notificationAudioURL:t}=(0,Q.EV)(),[n,r]=(0,q.useState)(zr?Notification.permission:"default"),[s,o]=(0,q.useState)(document.visibilityState),i=(0,G.w1)(Yt),a=(0,q.useCallback)((()=>Br(void 0,void 0,void 0,(function*(){if(zr&&"granted"!==n){const e=yield Notification.requestPermission();r(e)}}))),[n]),c=(0,q.useMemo)((()=>"granted"===n),[n]),l=(0,q.useMemo)((()=>"hidden"===s),[s]);(0,q.useEffect)((()=>{"default"===n&&e&&a()}),[n,e,a]);const u=(0,q.useCallback)(((e,r)=>Br(void 0,void 0,void 0,(function*(){if(i&&zr){if("default"===n&&a(),!1!==t&&!c&&(l||!document.hasFocus()))try{const e=new Audio(t||Fr);yield e.play()}catch(e){console.warn(e)}if(c&&(l||!document.hasFocus())){const t=new Notification(e,r);t.onclick=function(){window.parent.focus(),window.focus(),t.close();const e=document.querySelector(`input[name=${yr}]`);e&&e.focus()}}}}))),[t,n,c,a,i,l]);return(0,q.useEffect)((()=>{if(!i)return()=>{};function e(){o(document.visibilityState)}return document.addEventListener("visibilitychange",e,!1),()=>{document.removeEventListener("visibilitychange",e)}}),[i]),{permission:n,requestPermission:a,sendNotification:u}})(),[,r]=(0,Nn.Yf)(),{namespace:o,layoutMode:i,zIndex:a}=(0,Q.EV)(),c=(0,Te.KC)(),{proactiveMessages:l}=(0,Te.Ip)(),{isOpen:u,isVisible:d}=(0,bt.uu)(),p=(0,Rn.E)(),h=(0,ye.w)(),f=(0,G.w1)(qt),{body:m}=(0,Jt.useTranslatedEventData)(f),{userLocale:v}=(0,oe.g)(),g=(0,q.useRef)(void 0),y=(0,q.useMemo)((()=>{var e;return m?function(e){const t=document.createElement("div");return t.innerHTML=e,t.textContent||t.innerText||""}((null==m?void 0:m.text)||(null===(e=null==m?void 0:m.prompt)||void 0===e?void 0:e.text)||m):void 0}),[m]);(0,q.useEffect)((()=>{var e;(null==c?void 0:c.name)&&y&&l&&f&&g.current!==(null===(e=f.payload)||void 0===e?void 0:e.id)&&(n(c.name,{body:y,icon:null==c?void 0:c.avatar}),g.current=f.payload.id)}),[null==c?void 0:c.avatar,null==c?void 0:c.name,f,y,l,n]);const b=$r[i],w=(0,q.useCallback)((e=>{"function"==typeof r&&r(e)}),[r]),x=(0,q.useMemo)((()=>{if(v&&document.querySelector("html").getAttribute("lang")!==v)return v}),[v]);if(!b)return console.warn('"layoutMode" should be one of "app", "inline" or "window"'),null;const C=["app",`app--layout-${i}`,`namespace--${o}`];return"function"!=typeof p&&C.push(...p),u||"app"===i||C.push("app--collapsed"),h&&C.push("app--user-responded"),d&&(0,s.jsx)("div",{className:(0,t.U)(C),lang:x,tabIndex:-1,"data-nosnippet":!0,style:{zIndex:a},ref:w,children:e||(0,s.jsx)(b,{})})},Hr=e=>(0,s.jsx)(Ht,{...e,children:(0,s.jsx)(Vr,{})});var Kr=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var s=0;for(r=Object.getOwnPropertySymbols(e);s<r.length;s++)t.indexOf(r[s])<0&&Object.prototype.propertyIsEnumerable.call(e,r[s])&&(n[r[s]]=e[r[s]])}return n};class Wr{constructor(e,t){const{namespace:n="",parentElement:r}=e,s=Kr(e,["namespace","parentElement"]);this.config=Object.assign(Object.assign({},s),{namespace:n}),this.namespace=n,this.parentElement=r,this.externalApi=t,this.api=new z({layoutMode:e.layoutMode,namespace:e.namespace,config:e.api,context:e.context}),this.eventBus=new(i()),this.functions={},this.registerFunctions({on:this.eventBus.on,off:this.eventBus.off}),this.eventBus.on("function.register",((e,t)=>this.registerFunction(e,t))),this.eventBus.on("function.unregister",((e,t)=>this.unregisterFunction(e,t)))}render(){return e=this,t=void 0,r=function*(){const e=this.config.customComponents||{},{view:t}=e,n=Kr(e,["view"]),r=Object.assign(Object.assign({},this.config),{customComponents:Object.keys(n).length?n:void 0}),o=(0,K.e)({api:this.api,eventBus:this.eventBus,config:r,initialState:void 0});o.dispatch((0,H._U)(r)),yield o.dispatch((0,V.A)()),yield o.dispatch((0,$.m)()),o.dispatch((0,W.i)()),t?(0,a.render)((0,s.jsx)(Ht,{eventBus:this.eventBus,store:o,api:this.api,children:(0,s.jsx)(t,{})}),this.parentElement):(0,a.render)((0,s.jsx)(Hr,{config:r,eventBus:this.eventBus,store:o,api:this.api}),this.parentElement)},new((n=void 0)||(n=Promise))((function(s,o){function i(e){try{c(r.next(e))}catch(e){o(e)}}function a(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?s(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(i,a)}c((r=r.apply(e,t||[])).next())}));var e,t,n,r}destroy(){(0,a.render)(null,this.parentElement),this.eventBus.off(),this.api.disconnect(),delete this.functions}registerFunctions(e){Object.entries(e).forEach((([e,t])=>{this.registerFunction(e,t)}))}registerFunction(e,t){this.functions[e]=this.functions[e]||[],this.functions[e].push(t),this.externalApi.handleActions()}unregisterFunction(e,t){const n=this.functions[e];n&&n.length&&(this.functions[e]=n.filter((e=>e!==t)))}execFunction(e,...t){const n=this.functions[e];return!(!n||!n.length||(n.forEach((n=>{try{n(...t)}catch(t){console.error(`Action(${e}) failed: `,t)}})),0))}}const qr=e=>"object"==typeof e&&"action"in e,Gr=e=>({...e,args:Array.isArray(e.args)?e.args:[e.args]}),Yr=class{constructor(e){this._waitingActions=[],this._instances={},this.appConfig=e,this.context={}}push(...e){(e=e.filter(qr).map(Gr)).length&&(this._waitingActions.push(...e),this.handleActions())}handleActions(){const e=this._waitingActions;this._waitingActions=[],e.forEach((e=>{switch(e.action){case"init":this.handleInit(e);break;case"destroy":this.handleDestroy(e);break;default:this.handleAction(e)||this.setContext(e.action,...e.args)||this._waitingActions.push(e)}}))}instanceInitializing(e){const t=Object.keys(this._instances);return!e&&t.length>0||t.includes(e)}setContext(e,t){const{instance:n}=t;if(this.instanceInitializing(n))return!1;switch(e){case"setTopic":const{name:e}=t;return e&&(this.context.topic=e),!0;case"setTranslation":const{enabled:n,locale:r}=t;return n&&r&&(this.context.userLocale=r),!0;case"setContext":const{userLocale:s,contentLocale:o}=t;return this.context.userLocale=s,this.context.contentLocale=o,!0;case"setVariables":return Object.keys(t).length>0&&(this.context.variables={...t}),!0;default:return!1}}handleInit(e){const t=this.getUserConfig(...e.args),n=this.getCombinedConfig(t),{parentElement:r,namespace:s}=n||t;if(s?Object.values(this._instances).forEach((e=>{e.parentElement!==r&&e.namespace!==s||this.destroy(e)})):this.destroy(),n){const e=this.createInstance(n);this._instances[n.namespace]=e,this.context={},e.render()}}handleDestroy(e){this.destroy(e.instance)}handleAction(e){const{action:t,instance:n,args:r}=e,s=Object.values(this._instances);return!n&&s.length>1&&console.warn(`Multiple instances detected. Due to potential race conditions, it is recommended to target a specific instance with the action: ${t}`),s.map((e=>(!n||e.namespace===n)&&e.execFunction(t,...r))).some(Boolean)}createInstance(e){return new Wr(e,this)}destroy(e){e?("string"==typeof e&&(e=this._instances[e]),e&&(e.destroy(),delete this._instances[e.namespace])):Object.entries(this._instances).forEach((([e,t])=>{t.destroy(),delete this._instances[e]}))}getUserConfig(e={}){return e}getCombinedConfig(e){const t={...e.context||this.appConfig.context,...this.context},n=this.getMergedVariables(e);Object.keys(n).length>0&&(t.variables=n);const r={...this.appConfig.defaults,...e.defaults},s={...this.appConfig,...e,api:{...this.appConfig.api,...e.api},context:Object.keys(t).length?t:void 0,defaults:Object.keys(r).length?r:void 0};return"function"==typeof this.appConfig?this.appConfig(s):s}getMergedVariables(e){return{...this.appConfig.context?.variables||{},...e.context?.variables||{},...this.context.variables||{}}}},Jr=(...e)=>{const t=new URL(window.location.href);return e.reduce(((e,n)=>{const r=t.searchParams.get(n)||sessionStorage.getItem(n);return r&&(e[n]=r),e}),{})},Xr=(...e)=>{const t=new URL(window.location.href),n=e.reduce(((e,n)=>{const r=t.searchParams.get(n),s=r||sessionStorage.getItem(n);return r&&sessionStorage.setItem(n,r),s?(e.set(n,s),e):e}),new URLSearchParams),r=new URLSearchParams(Object.assign(Object.assign({},Object.fromEntries(t.searchParams)),Object.fromEntries(n)));return r.toString()&&window.history.replaceState(null,null,`?${r}`),Jr(...n.keys())},Qr=(...e)=>{const t=document.querySelector("[data-reset-search-params]");t&&t.addEventListener("click",(t=>{t.preventDefault();const n=new URL(window.location.href);e.forEach((e=>{sessionStorage.removeItem(e),n.searchParams.delete(e)})),window.location.href=n.toString()}))}})(),module.exports=r})();
|
|
3
3
|
//# sourceMappingURL=~/utils.min.js.map
|