@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 hooks.min.js.LICENSE.txt */
|
|
2
|
-
(()=>{var e={8412:(e,t,n)=>{"use strict";n.d(t,{c:()=>N});var r,i,o,s,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",y="leaving",v="phx_close",m="phx_error",g="phx_reply",b="phx_leave",_="websocket",C=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})}},w=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))}},E=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 C(this,"phx_join",this.params,this.timeout),this.pushBuffer=[],this.stateChangeRefs=[],this.rejoinTimer=new w((()=>{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 C(this,b,a({}),this.timeout).send(),this.state=p,this.joinPush.reset(),this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()})),this.on(g,((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(m,(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 C(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=y;let t=()=>{this.socket.hasLogger()&&this.socket.log("channel",`leave ${this.topic}`),this.trigger(v,"leave")},n=new C(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 i=this.onMessage(e,t,n,r);if(t&&!i)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(i,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===y}},O=class{static request(e,t,n,r,i,o,s){if(u.XDomainRequest){let n=new u.XDomainRequest;return this.xdomainRequest(n,e,t,r,i,o,s)}{let a=new u.XMLHttpRequest;return this.xhrRequest(a,e,t,n,r,i,o,s)}}static xdomainRequest(e,t,n,r,i,o,s){return e.timeout=i,e.open(t,n),e.onload=()=>{let t=this.parseJSON(e.responseText);s&&s(t)},o&&(e.ontimeout=o),e.onprogress=()=>{},e.send(r),e}static xhrRequest(e,t,n,r,i,o,s,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)}},s&&(e.ontimeout=s),e.send(i),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 i=t?`${t}[${r}]`:r,o=e[r];"object"==typeof o?n.push(this.serialize(o,i)):n.push(encodeURIComponent(i)+"="+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)}`}},S=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("(.*)/"+_),"$1/longpoll")}endpointURL(){return O.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,i){let o;o=O.request(e,this.endpointURL(),t,n,this.timeout,(()=>{this.reqs.delete(o),r()}),(e=>{this.reqs.delete(o),this.isActive()&&i(e)})),this.reqs.add(o)}},T={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,i,o,s]=JSON.parse(e);return t({join_ref:n,ref:r,topic:i,event:o,payload:s})}},binaryEncode(e){let{join_ref:t,ref:n,event:r,topic:i,payload:o}=e,s=this.META_LENGTH+t.length+n.length+i.length+r.length,a=new ArrayBuffer(this.HEADER_LENGTH+s),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++,i.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(i,(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),i=t.getUint8(2),o=t.getUint8(3),s=this.HEADER_LENGTH+this.META_LENGTH-1,a=n.decode(e.slice(s,s+r));s+=r;let c=n.decode(e.slice(s,s+i));s+=i;let l=n.decode(e.slice(s,s+o));return s+=o,{join_ref:a,ref:null,topic:c,event:l,payload:e.slice(s,e.byteLength)}},decodeReply(e,t,n){let r=t.getUint8(1),i=t.getUint8(2),o=t.getUint8(3),s=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+i));a+=i;let u=n.decode(e.slice(a,a+o));a+=o;let d=n.decode(e.slice(a,a+s));a+=s;let p=e.slice(a,e.byteLength);return{join_ref:c,ref:l,topic:u,event:g,payload:{status:d,response:p}}},decodeBroadcast(e,t,n){let r=t.getUint8(1),i=t.getUint8(2),o=this.HEADER_LENGTH+2,s=n.decode(e.slice(o,o+r));o+=r;let a=n.decode(e.slice(o,o+i));return o+=i,{join_ref:null,ref:null,topic:s,event:a,payload:e.slice(o,e.byteLength)}}},j=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||S,this.longPollFallbackMs=t.longPollFallbackMs,this.fallbackTimer=null,this.sessionStore=t.sessionStorage||u.sessionStorage,this.establishedConnections=0,this.defaultEncoder=T.encode.bind(T),this.defaultDecoder=T.decode.bind(T),this.closeWasClean=!1,this.binaryType=t.binaryType||"arraybuffer",this.connectClock=1,this.transport!==S?(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}/${_}`,this.vsn=t.vsn||"2.0.0",this.heartbeatTimeoutTimer=null,this.heartbeatTimer=null,this.pendingHeartbeatRef=null,this.reconnectTimer=new w((()=>{this.teardown((()=>this.connect()))}),this.reconnectAfterMs)}getLongPollTransport(){return S}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=O.appendParams(O.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!==S?this.connectWithFallback(S,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((i=>{i.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,i=!0,o=t=>{this.log("transport",`falling back to ${e.name}...`,t),this.off([void 0,n]),i=!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),i&&!r&&(clearTimeout(this.fallbackTimer),o(e))})),this.onOpen((()=>{if(r=!0,!i)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(m)}))}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(e,t,this);return this.channels.push(n),n}push(e){if(this.hasLogger()){let{topic:t,event:n,payload:r,ref:i,join_ref:o}=e;this.log("push",`${t} ${n} (${o}, ${i})`,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:i,join_ref:o}=e;i&&i===this.pendingHeartbeatRef&&(this.clearHeartbeats(),this.pendingHeartbeatRef=null,this.heartbeatTimer=setTimeout((()=>this.sendHeartbeat()),this.heartbeatIntervalMs)),this.hasLogger()&&this.log("receive",`${r.status||""} ${t} ${n} ${i&&"("+i+")"||""}`,r);for(let e=0;e<this.channels.length;e++){const s=this.channels[e];s.isMember(t,n,r,o)&&s.trigger(n,r,i,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),I=n(5576),x=n.n(I),A=n(5968),R=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)},P=function(e,t,n,r,i){if("m"===r)throw new TypeError("Private method is not writable");if("a"===r&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?i.call(e,n):i?i.value=n:t.set(e,n),n};const M=x()("seamly"),L=new Set;i=new WeakMap,r=new WeakSet,o=function(...e){e.forEach((e=>{this.channel.on(e,(t=>{M("[RECEIVE]",e,t)}))}))},s=function(e){P(this,i,R(this,i,"f").filter((t=>!t(e))),"f"),L.forEach((e=>e()))};const N=class{constructor(){r.add(this),i.set(this,[])}connect(e,t,n,i){return a=this,c=void 0,u=function*(){this.url=e,this.accessToken=i,this.channelName=t,this.channelTopic=n;const{url:a,params:c}=(0,A.c)(this.url);this.socket=new j(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=>{M("[SOCKET][ERROR]",e)})),this.socket.onOpen((()=>{M("[SOCKET]OPEN")})),this.socket.onClose((()=>{M("[SOCKET]CLOSE"),R(this,r,"m",s).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&&R(this,r,"m",s).call(this,{connected:!0,ready:!0,currentState:"attach_channel_succeeded"})})),this.channel.onClose((()=>{M("[CHANNEL]CLOSE"),R(this,r,"m",s).call(this,{connected:!1,ready:!1,currentState:"channel_closed"})})),this.channel.onError((e=>{M("[CHANNEL][ERROR]",e),R(this,r,"m",s).call(this,{connected:!1,ready:!1,currentState:"channel_erred"})})),R(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{i(u.next(e))}catch(e){t(e)}}function r(e){try{i(u.throw(e))}catch(e){t(e)}}function i(t){var i;t.done?e(t.value):(i=t.value,i instanceof l?i:new l((function(e){e(i)}))).then(n,r)}i((u=u.apply(a,c||[])).next())}));var a,c,l,u}start(){this.channel.join().receive("ok",(()=>{M("[CHANNEL][JOIN] OK"),R(this,r,"m",s).call(this,{connected:!0,ready:!1,currentState:"join_channel_succeeded"})})).receive("error",(e=>{M("[CHANNEL][JOIN] ERROR",e),R(this,r,"m",s).call(this,{connected:!1,ready:!1,currentState:"join_channel_erred"})})).receive("timeout",(()=>{M("[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(),M("[CHANNEL][LEAVE] OK"),P(this,i,[],"f")}))}onConnection(e){R(this,i,"f").push(e)}pushToChannel(e,t,n=1e4){this.channel.push(e,t,n)}static subscribe(e){return L.add(e),()=>L.delete(e)}}},7548:(e,t,n)=>{"use strict";n.d(t,{Ag:()=>s,kR:()=>r,kr:()=>i,sB:()=>o});const r="3",i="seamly-client-participant",o=10,s={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),i=n(6232),o=n(6280),s=n(712);var a=n(2948),c=n(6244),l=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(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?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,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,s,a;let l=null===(e=null==n?void 0:n.context)||void 0===e?void 0:e.contentLocale,u=null===(s=null==n?void 0:n.context)||void 0===s?void 0:s.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 i.c){const e=new i.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:i=300,maxWait:o=0,leading:s=!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=s&&!c;return clearTimeout(c),c=setTimeout((()=>{u(),c=null}),i),!!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,s.O)()),yield t((0,s.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),i=n(232);const o={userHasResponded:!1},s=(0,r.is)({name:"app",initialState:o,reducers:{setHasResponded:(e,{payload:t})=>{e.userHasResponded=t}},extraReducers:e=>{e.addCase(i.C.pending,(()=>o)).addCase(i.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}=s.actions,c=s.reducer},712:(e,t,n)=>{"use strict";n.d(t,{A:()=>o,O:()=>s});var r=n(3120),i=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(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?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))};const o=(0,r.aw)("initializeConfig",((e,{extra:{api:t,config:n},rejectWithValue:r})=>i(void 0,void 0,void 0,(function*(){var e;try{const{features:r,defaultLocale:i,preChat:o,agentParticipant:s,userParticipant:a,startChatIcon:c}=yield t.getConfig(),l=(null===(e=null==n?void 0:n.context)||void 0===e?void 0:e.contentLocale)||i,{connectWhenInView:u}=n;return{features:r,defaultLocale:i,preChat:o,agentParticipant:s,userParticipant:a,startChatIcon:c,defaultContentLocale:l,connectWhenInView:u}}catch(e){return r(e)}})))),s=(0,r.aw)("resetConfig",((e,{extra:{config:t}})=>i(void 0,void 0,void 0,(function*(){return t}))))},5352:(e,t,n)=>{"use strict";n.d(t,{EV:()=>o});var r=n(2328),i=n(5368);const o=()=>(0,r.w1)(i.g)},5368:(e,t,n)=>{"use strict";n.d(t,{g:()=>o});var r=n(8888),i=n(8536);const o=(0,r.M3)((({config:e})=>e),(e=>{let t=Object.assign({visible:"inline"===(null==e?void 0:e.layoutMode)?i.I.open:i.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,{cp:()=>f});var r=n(3120),i=n(7548),o=n(712),s=n(8760);const a=Object.assign(Object.assign({},i.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,s.gl)(t,c),{messages:r}=n,i=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 i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n}(n,["messages"]);let o=e;return Object.keys(i).length>0&&(o=Object.assign(Object.assign({},o),i)),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:i,defaultContentLocale:o}})=>{e.preChatEvents=t.map((e=>({type:"message",payload:e}))),e.context.contentLocale=o,e.agentParticipant=n,e.userParticipant=r,e.startChatIcon=i}))}}),{setConfig:d,updateConfig:p,setPreChatEvents:h}=u.actions,f=u.reducer},1364:(e,t,n)=>{"use strict";var r=n(3120),i=(n(2309),n(3872)),o=n(2704),s=n(8132),a=n(6232),c=n(1120),l=n(6280);n(5368),o.c,i.c,a.c,s.c,c.c,l.c,(0,r.Uh)("catch-error",(e=>({payload:e})))},2620:(e,t,n)=>{"use strict";n.d(t,{cp:()=>y});var r=n(3120),i=n(232);const o={controls:{}},s={value:"",touched:!1},a={controls:s},c=(0,r.is)({name:"forms",initialState:a,reducers:{registerForm:(e,{payload:{persistData:t,formId:n}})=>{var r;const i=t&&null!==(r=e[n])&&void 0!==r?r:Object.assign(Object.assign({},o),{persistData:t});e[n]=i},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]:s}},deregisterControl:(e,{payload:{name:t,formId:n}})=>{const r=e[n];if(!r)return e;if(r.persistData)return e;const i=Object.assign({},r.controls);return delete i[t],Object.assign(Object.assign({},e),{[n]:Object.assign(Object.assign({},r),{controls:i})})},updateControlValue:(e,{payload:{formId:t,name:n,value:r}})=>{var i;(null===(i=e[t])||void 0===i?void 0:i.controls)&&(e[t].controls[n].value=r)},updateControlTouched:(e,{payload:{formId:t,name:n,touched:r}})=>{var i;(null===(i=e[t])||void 0===i?void 0:i.controls[n])&&(e[t].controls[n].touched=r)}},extraReducers:e=>{e.addCase(i.C.pending,(()=>a))}}),{registerForm:l,deregisterForm:u,registerControl:d,deregisterControl:p,updateControlValue:h,updateControlTouched:f}=c.actions,y=c.reducer},4528:(e,t,n)=>{"use strict";n.d(t,{K:()=>i});var r=n(3120);const i=(0,r.aw)("setLocale",((e,{extra:{api:t},rejectWithValue:n})=>{return r=void 0,i=void 0,s=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(s.next(e))}catch(e){t(e)}}function a(e){try{c(s.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((s=s.apply(r,i||[])).next())}));var r,i,o,s}),{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 i(e){return i="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},i(e)}function o(e){var t=function(e,t){if("object"!=i(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=i(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==i(t)?t:String(t)}function s(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={},i=0,o=null,s=!1,a=0;a<e.length;){if(s&&(t(e[a])||"{"===e[a]))s=!1,o=e.slice(i,a),"{"===e[a]&&a--;else if(!s&&!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),s=!0,i=a}a++}return s&&(o=e.slice(i)),o&&n.push(o),{args:n,cases:r}}function u(e,t){for(var n=0,r=t+1;r<e.length;r++){var i=e.charAt(r);if("}"===i){if(0===n)return r;n--}else"{"===i&&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 i=e.indexOf(t);if(-1===i)return r.push(e),r;var o=e.substring(0,i).trim(),s=e.substring(i+t.length+1).trim();return r.push(o),p(s,t,n-1,r)}n.d(t,{g:()=>S});var h,f=function(){function e(t){var n,r,i=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(i.process(e,t)).join("")},r={},function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];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 s=n.apply(void 0,t);return r[o]=s,s})),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,i,o=e.indexOf("{");if(-1!==o){var s=u(e,o);if(-1===s)throw new Error('Unbalanced curly braces in string: "'.concat(e,'"'));var a=e.substring(o,s+1);if(a){var c=[],l=e.substring(0,o);l&&c.push(l);var p=(n=d(a),i=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,i,o,s,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,i=e}finally{try{if(!c&&null!=n.return&&(s=n.return(),Object(s)!==s))return}finally{if(l)throw i}}return a}}(n,i)||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,i)||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],y=p[2],v=t[h];null==v&&(v="");var m=f&&this.typeHandlers[f];c.push(m?m(v,y,this.locale,t,this.process.bind(this)):v);var g=e.substring(s+1);return g&&c.push(this.process(g,t)),c}}return[e]}}],n&&s(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),e}();function y(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?y(Object(n),!0).forEach((function(t){a(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):y(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var m=0,g="other";function b(e,t){for(var n=0,r="",i=0,o={};n<e.length;){if("#"!==e[n]||i)r+=e[n];else{var s="__hashToken".concat(m++);r+="{".concat(s,", number}"),o[s]=t}"{"===e[n]?i++:"}"===e[n]&&i--,n++}return{caseBody:r,numberValues:o}}var _="other",C=n(8056),w=n(2328),E=n(9144);const O=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,i=l(arguments.length>1&&void 0!==arguments[1]?arguments[1]:""),o=i.args,s=i.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!==g&&c.push(u)}1===a&&c.push("one"),c.push("=".concat(a),g);for(var d=0;d<c.length;d++){var p=c[d];if(p in s){var f=b(s[p],a),y=f.caseBody,m=f.numberValues;return r(y,v(v({},n),m))}}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):_ in r?n(r[_],t):e}});function S(){const e=(0,w.w1)(E.UO),t=(0,w.w1)(E.Oo),n=(0,w.w1)(E.E$),r=(0,w.w1)(E.Ir);return{t:(0,C.useCallback)(((n,i={})=>{const o=e[n];return o?O.format(o,i):(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:()=>s,UO:()=>i});var r=n(8888);const i=(0,r.M3)((({i18n:e})=>e),(({translations:e})=>e)),o=(0,r.M3)((({i18n:e})=>e),(({initialLocale:e})=>e)),s=(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),i=n(2328),o=n(4640),s=n(5768);function a(){const{t:e}=(0,o.g)(),t=(0,i.w1)(s.c),n=(0,i.w1)(s.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:i}=t,o=e(`${r}.title`),s=e(`${r}.message`),a=e(`${r}.srText`),c=i?e(`${r}.buttonText`):null;return Object.assign(Object.assign(Object.assign(Object.assign({},r?{title:o,message:s,srText:a}:{}),i?{action:i}:{}),i&&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:()=>i});var r=n(8888);const i=(0,r.M3)((({interrupt:e})=>e),(({error:e})=>e)),o=(0,r.M3)(i,(e=>Boolean(e)))},1880:(e,t,n)=>{"use strict";n.d(t,{cp:()=>h,yA:()=>d});var r=n(3120),i=n(232),o=n(712),s=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)(i.m.rejected,o.A.rejected,s.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:()=>i});var r=n(3120);const i=(0,r.aw)("getConversation",((e,{extra:{api:t},rejectWithValue:n})=>{return r=void 0,i=void 0,s=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(s.next(e))}catch(e){t(e)}}function a(e){try{c(s.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((s=s.apply(r,i||[])).next())}));var r,i,o,s}),{condition(e,{getState:t}){var n;const{state:{events:r}}=t(),i=r[r.length-1],o=null===(n=null==e?void 0:e.lastEvent)||void 0===n?void 0:n.id;return i&&o!==i.payload.id}})},1760:(e,t,n)=>{"use strict";n.d(t,{A:()=>C});var r=n(8608),i=n(2328),o=n(428),s=n(7452),a=(n(1364),n(2620)),c=n(3120),l=n(232),u=n(712),d=n(4528);const p={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},h=(0,c.is)({name:"app",initialState:p,reducers:{setInitialLocale:(e,t)=>{e.initialLocale=t.payload},setTranslations:(e,{payload:t})=>{e.translations=t}},extraReducers:e=>{e.addCase(l.C.pending,(()=>p)).addCase(u.A.fulfilled,((e,{payload:t})=>{e.initialLocale=t.defaultContentLocale})).addCase(d.K.pending,(e=>{e.isLoading=!0})).addCase(d.K.rejected,(e=>{e.isLoading=!1})).addCase(d.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:f,setTranslations:y}=h.actions,v=h.reducer;n(2704);var m=n(1880),g=n(3332);n(9144);var b=n(8456),_=n(1756);(0,r.TL)({state:g.cp,app:o.cp,config:s.cp,i18n:v,translations:b.cp,visibility:_.cp,forms:a.cp,interrupt:m.cp});const C=i.OY},3332:(e,t,n)=>{"use strict";n.d(t,{ER:()=>Q,I1:()=>C,IF:()=>X,Ur:()=>w,Ux:()=>y,Yh:()=>L,aD:()=>b,cN:()=>N,cp:()=>te,eK:()=>Y,e_:()=>Z,gB:()=>E});var r=n(3120),i=n(232),o=n(712),s=n(1676),a=n(8760),c=n(6244);const l=e=>e.sort((({payload:{occurredAt:e}},{payload:{occurredAt:t}})=>e-t)),u=(e,t)=>{if(!e)return{participants:{},currentAgent:""};const{participants:n}=e||{participants:{}},{id:r,avatar:i,name:o,introduction:s}=t.participant,a=n[r],c=Object.assign(Object.assign({},n),{[r]:a?Object.assign(Object.assign(Object.assign(Object.assign({},a),i?{avatar:i}:{}),o?{name:o}:{}),s?{introduction:s}:{}):t.participant});return Object.assign(Object.assign({},e),{participants:c,currentAgent:e.currentAgent===r||t.fromClient?e.currentAgent:r})},d=(e,t)=>{var n,r;const i="message"===(null==t?void 0:t.type)?(null==t?void 0:t.payload.translatedEntry)||(null==t?void 0:t.payload.entry):{},{blockAutoEntrySwitch:o}=e,s=(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(!i)return Object.assign(Object.assign({},e),{optionsOverride:{},actions:s,translatedActions:a});const{type:c,options:l}=i;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:s,translatedActions:a})},p={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,s.s)(),optionsButtonId:(0,s.s)(),headerCollapseButtonId:(0,s.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},h=(0,r.is)({name:"store",initialState:p,reducers:{addEvent:(e,t)=>{var n,r;const{type:i,payload:o}=t.payload,a=e.options.features.hasOwnProperty(c.gn.uploads);let l=Object.assign({},e.options);if(a&&(i===c.Iz.message||i===c.Iz.participant)&&!o.fromClient){const e="message"===i?null===(n=o.entry)||void 0===n?void 0:n.type:{};l=Object.assign(Object.assign({},l),{features:Object.assign(Object.assign({},l.features),{uploads:Object.assign(Object.assign({},null===(r=l.features)||void 0===r?void 0:r.uploads),{enabledFromEntry:e===c.uG.upload})})})}const u=(({type:e,payload:t})=>"hidden"===document.visibilityState||e===c.Iz.message&&!t.fromClient||e===c.Iz.info&&t.type===c.ay.text)(t.payload);if(e.events.find((e=>e.payload.id===o.id)))return;const p=d(e.entryMeta,t.payload);e.entryMeta=a||p.active!==c.uG.upload?p:Object.assign({},e.entryMeta),e.options=l,u&&(e.unreadEvents+=1,"service_data"!==i&&(t.payload.payload.messageStatus=o.fromClient?c.eg.read:c.eg.received)),t.payload.payload.key=(0,s.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:i}=t;n&&(n.payload.id=r,n.payload.occurredAt=i,e.events=l(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:i={},serviceData:o,resumeConversationPrompt:s}})=>{var a,p,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 l([...r,...n])})(e.events,t),y=Object.assign(Object.assign({},e.participantInfo.participants),n),v=f.slice().reverse().find((e=>("message"===e.type||"participant"===e.type)&&!e.payload.fromClient));let m=null;v&&("message"===v.type&&(m=v.payload.participant),"participant"===v.type&&(m=v.payload.participant.id));const{entry:g}=i,b=null===(a=null==g?void 0:g.options)||void 0===a?void 0:a.upload,_=d(Object.assign(Object.assign(Object.assign({},e.entryMeta),g),{active:(null==g?void 0:g.default)||c.ay.text,options:Object.assign({},(null==g?void 0:g.options)?g.options:{})}),f[f.length-1]);let C=Object.assign({},e.options.features);const w=C.hasOwnProperty(c.gn.uploads);if(w&&"message"===(null==v?void 0:v.type)){const{payload:e}=v,t=(null===(p=null==e?void 0:e.entry)||void 0===p?void 0:p.type)||{};C=Object.assign(Object.assign({},C),{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),m?u(e.participantInfo,{participant:y[m]}):{}),{participants:y}),e.historyLoaded=!0,e.serviceInfo=Object.assign(Object.assign({},e.serviceInfo),{activeServiceSessionId:r,proactiveMessages:(null===(h=null==i?void 0:i.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:C}),e.entryMeta=w||_.active!==c.uG.upload?_:Object.assign({},e.entryMeta),e.resumeConversationPrompt=s||!1,m&&(e.headerTitles.subTitle=y[m].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=u(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=p.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(i.C.pending,(()=>p)).addCase(i.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(i.m.fulfilled,((e,{payload:t})=>{e.isLoading=!1,t.initialState&&(e.initialState=t.initialState)})).addMatcher((0,r.CF)(E,O),(e=>{e.isLastEventFromClient=!1}))}}),{ackEvent:f,addEvent:y,clearAllUploads:v,clearEvents:m,clearFeatures:g,clearIdleDetachCountdown:b,clearResumeConversationPrompt:_,decrementIdleDetachCountdownCounter:C,hideOption:w,initIdleDetachCountdown:E,initResumeConversationPrompt:O,registerUpload:S,resetHistoryLoadedFlag:T,setActiveEntryType:j,setActiveService:k,setBlockAutoEntrySwitch:I,setEventsRead:x,setFeatureEnabledState:A,setFeatures:R,setHeaderSubTitle:P,setHeaderTitle:M,setHistory:L,setInitialState:N,setIsLoading:D,setLoadedImageEventIds:U,setParticipant:$,setSeamlyContainerElement:F,setServiceDataItem:B,setServiceEntryMetadata:H,clearAbortTransaction:z,setUploadComplete:V,setUploadError:W,setUploadProgress:K,startProcessingImage:q,doneProcessingImage:G,setUserEntryType:J,setUserSelectedOption:Y,setUserSelectedOptions:X,showOption:Q,stopIdleDetachCountdownCounter:Z,setProactiveMessages:ee}=h.actions,te=h.reducer},7456:(e,t,n)=>{"use strict";n.d(t,{kx:()=>d,A1:()=>u,im:()=>p});var r=n(8056),i=n(2328),o=n(5352),s=(n(4640),n(8888));const a=e=>(0,s.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 c=n(8456),l=(n(8632),n(6204));function u(){const{sendContext:e}=(0,l.wv)(),t=(0,i.OY)(),n=(0,o.EV)(),s=(0,r.useCallback)((t=>{e({userLocale:t})}),[e]),a=(0,r.useCallback)((()=>{e({userLocale:n.context.userLocale}),t((0,c.If)())}),[n.context,t,e]),{languages:u,isActive:d,isAvailable:p,currentLocale:h}=(0,i.w1)((({translations:e})=>e));return{languages:u,isActive:d,isAvailable:p,currentLocale:h,enableTranslations:s,disableTranslations:a}}function d(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===(c=null===(s=e.payload)||void 0===s?void 0:s.participant)||void 0===c?void 0:c.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,s,c,l,u,d;const p=!!t,h=(0,i.w1)(a(e));return{body:p&&h?t:r,hasTranslation:p,isTranslated:h&&p,locale:null==n?void 0:n.locale}}function p(){const e=(0,i.w1)((({translations:e})=>e.containerId));return{id:e,focusContainer:(0,l.kX)(e)}}n(6244)},8456:(e,t,n)=>{"use strict";n.d(t,{If:()=>p,cp:()=>m});var r=n(3120),i=n(232),o=n(712),s=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,i)=>{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 i.splice(0),e;e[t].push(n.id)}return n.id===t&&(e[t]=[]),e}),{}),[[r,i]]=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:i}},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:i,eventIds:o}=l(t,n);e.lastGroupId=r,e.translatedEventGroups[i]=o},disableTranslationProposalPrompt:e=>{e.translationProposal=null},setTranslationProposalPrompt:(e,{payload:t})=>{e.translationProposal=t}},extraReducers:e=>{e.addCase(i.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(s.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:y,disableTranslationProposalPrompt:v}=u.actions,m=u.reducer},2948:(e,t,n)=>{"use strict";n.d(t,{c:()=>d,i:()=>p});var r=n(3120),i=n(1060),o=n(5368),s=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,i.E)(d),f=n.hasConversation(),y=o.g(d),{visibilityCallback:v=s.g,layoutMode:m}=y,{unreadEvents:g}=(0,a.cV)(d),b=v({hasResponded:h,previousVisibility:p,requestedVisibility:e,config:y});if(!u.includes(b))return void console.error('The visibilityCallback function should return "open", "minimized" or "hidden".');if(p===b)return;const _=n.store.get(c.M);return n.store.set(c.M,Object.assign(Object.assign({},_||{}),{[m]:e})),e&&r.emit("ui.visible",e,{visibility:e,hasConversation:f,hasResponded:h,unreadMessageCount:g}),b})),p=(0,r.aw)("initialize",((e,{dispatch:t,getState:n,extra:{api:r}})=>{return i=void 0,s=void 0,l=function*(){var e;const{layoutMode:i}=o.g(n()),s=(null===(e=r.store.get(c.M))||void 0===e?void 0:e[i])||c.I.initialize;return t(d(s)),s},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 i;t.done?e(t.value):(i=t.value,i instanceof a?i:new a((function(e){e(i)}))).then(n,r)}o((l=l.apply(i,s||[])).next())}));var i,s,a,l}))},8536:(e,t,n)=>{"use strict";n.d(t,{I:()=>i,M:()=>r});const r="visibility",i={hidden:"hidden",minimized:"minimized",open:"open",initialize:null}},8632:(e,t,n)=>{"use strict";n.d(t,{uu:()=>l}),n(9150);var r=n(8056),i=n(2328),o=(n(5352),n(1760)),s=n(2948),a=(n(1756),n(8536)),c=n(5376);const l=()=>{const e=(0,o.A)(),t=(0,i.w1)(c._),n=!!t&&t!==a.I.hidden,l=t===a.I.open,u=t===a.I.minimized,d=(0,r.useCallback)((t=>e((0,s.c)(t))),[e]);return{isVisible:n,isOpen:l,isMinimized:u,visible:t,setVisibility:d,openChat:()=>{d(a.I.open)},closeChat:()=>{d(a.I.minimized)}}}},5376:(e,t,n)=>{"use strict";n.d(t,{_:()=>i,e:()=>o});var r=n(8888);const i=(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});var r=n(3120),i=n(712),o=n(2948);const s={visibility:n(8536).I.initialize,showInlineView:!1},a=(0,r.is)({name:"visibility",initialState:s,reducers:{setShowInlineView:e=>{e.showInlineView=!0}},extraReducers:e=>{e.addCase(o.c.fulfilled,((e,{payload:t})=>{t&&(e.visibility=t)})).addCase(i.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:()=>i});var r=n(9150);const i=(0,r.createContext)(null),o=(0,r.createContext)(null)},9320:(e,t,n)=>{"use strict";n.d(t,{Ml:()=>o,aJ:()=>a,cb:()=>s});var r=n(8056),i=n(5308);const o=()=>(0,r.useContext)(i.c),s=()=>o().store,a=()=>{const e=o();return(0,r.useCallback)((()=>e.hasConversation()),[e])}},6736:(e,t,n)=>{"use strict";n.d(t,{I7:()=>f,Ip:()=>y,SS:()=>m,cV:()=>l,gf:()=>u,kV:()=>h,y2:()=>g});var r=n(8888),i=n(2328),o=n(1060),s=n(5352),a=n(5368),c=n(8760);const l=({state:e})=>e,u=()=>(0,i.w1)(l),d=(0,r.M3)(l,a.g,o.E,(({events:e,serviceData:t},n,r)=>{var i;if(r||"inline"===n.layoutMode||!(null==t?void 0:t.suggestion)||!(null===(i=null==t?void 0:t.suggestion)||void 0===i?void 0:i.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:i,threshold:o}=null!==(r=null===(n=null==t?void 0:t.messages)||void 0===n?void 0:n.timeIndicator)&&void 0!==r?r:{};if(!i)return e;const s=[];let a=null;return e.forEach(((e,t)=>{if(0===t)s.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;s.push(Object.assign(Object.assign({},e),{timeIndicator:t}))}a=e})),s})),h=()=>(0,i.w1)(p),f=((0,r.M3)(p,(e=>e.map((e=>e.payload.id)))),()=>u().unreadEvents),y=()=>u().serviceInfo,v=(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})),m=()=>(0,i.w1)(v),g=()=>{const{layoutMode:e}=(0,s.EV)();return{isInline:"inline"===e,isWindow:"window"===e,isApp:"app"===e,isResolving:!e}}},3460:(e,t,n)=>{"use strict";n.d(t,{c:()=>y});var r=n(8056),i=n(2328),o=n(4640),s=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 y=()=>{const{t:e}=(0,o.g)(),{isInline:t,isWindow:n,isApp:y}=(0,u.y2)(),{isOpen:v,isVisible:m}=(0,s.uu)(),g=(0,i.w1)(c.e),{start:b,connect:_,apiConfigReady:C,apiConnected:w}=(0,a.c)(),E=(0,r.useRef)(!1),{sendAssertive:O}=(0,l.C)();!function(){const{meta:{originalError:e,action:t}}=(0,p.q)(),n=(0,f.A)(),{reset:i}=(0,a.c)(),o="SeamlySessionExpiredError"===(null==e?void 0:e.name),s=(0,r.useRef)(0),c=(0,r.useRef)(null);(0,r.useEffect)((()=>{if(o&&"reset"===t){if(s.current>=10){c.current=setTimeout((()=>{s.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})),()=>{}}s.current+=1,i()}return()=>{c.current&&clearTimeout(c.current)}}),[t,i,o,n])}(),(0,r.useEffect)((()=>{m&&setTimeout((()=>{O(e("window.srTexts.onLoad"))}),500)}),[m,O,e]),(0,r.useEffect)((()=>{m&&O(e(v?"window.srTexts.onOpen":"window.srTexts.onClose"))}),[v,m,O,e]),(0,r.useEffect)((()=>{C&&w||(E.current=!1)}),[C,w]);const S=(0,r.useCallback)((()=>{return e=void 0,n=void 0,i=function*(){w||(E.current=!0,yield _()),(y||v||m&&t)&&b()},new((r=void 0)||(r=Promise))((function(t,o){function s(e){try{c(i.next(e))}catch(e){o(e)}}function a(e){try{c(i.throw(e))}catch(e){o(e)}}function c(e){var n;e.done?t(e.value):(n=e.value,n instanceof r?n:new r((function(e){e(n)}))).then(s,a)}c((i=i.apply(e,n||[])).next())}));var e,n,r,i}),[w,_,y,t,v,m,b]);(0,r.useEffect)((()=>{!C||E.current||n&&!v||!(!t||m&&g)||S()}),[C,S,t,v,m,n,g])}},9816:(e,t,n)=>{"use strict";n.d(t,{c:()=>s});var r=n(1864),i=n(8412),o=n(9320);const s=()=>{const e=(0,o.Ml)();return(0,r.useSyncExternalStore)(i.c.subscribe,(()=>e.conversation))}},6244:(e,t,n)=>{"use strict";n.d(t,{Iz:()=>r,ay:()=>i,eg:()=>s,gn:()=>l,kD:()=>c,uG:()=>o,w$:()=>a});const r={info:"info",message:"message",participant:"participant",system:"system"},i={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"},s={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={assertive:"assertive",polite:"polite"},l={sendTranscript:"sendTranscript",typingPeekahead:"typingPeekahead",uploads:"uploads"}},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:()=>i});var r=n(2309);class i 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:()=>i});var r=n(2309);class i 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:()=>i});var r=n(2309);class i 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:()=>i});var r=n(2309);class i 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:()=>i});var r=n(2309);class i 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:()=>i});var r=n(2309);class i 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),i=n(1060);const o=()=>(0,r.w1)(i.E)},3576:(e,t,n)=>{"use strict";n.d(t,{g:()=>i});var r=n(8536);const i=({hasResponded:e,previousVisibility:t,requestedVisibility:n,config:i})=>{const{defaults:o,layoutMode:s,hideOnNoUserResponse:a}=i,{visible:c}=o||{};if("app"===s&&!t)return r.I.open;if("window"===s&&a&&n!==r.I.open)return e?n||t||r.I.open:r.I.hidden;if("inline"===s&&e&&!n)return t||r.I.open;const l=r.I.minimized;return n||t||c||l}},8544:(e,t,n)=>{"use strict";n(7548)},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)}}),{})}}},2080:(e,t,n)=>{"use strict";n.d(t,{Y:()=>c}),n(9150);var r=n(8056),i=(n(4640),n(7456)),o=(n(8544),n(1676)),s=(n(7800),n(7888),n(6204)),a=n(6244);n(784);const c=e=>{const{payload:t}=e,[n,c]=(0,r.useState)(!1),{sendAction:l,addMessageBubble:u,addDivider:d}=(0,s.wv)(),{activeServiceSessionId:p}=(0,s.Ip)(),h=(0,s.SS)(),{body:f}=(0,i.kx)(e),{service:y}=t,v=(0,r.useMemo)((()=>({...e,payload:{...e.payload,body:e.payload.body?.prompt,translatedBody:e.payload.translatedBody&&{...e.payload.translatedBody,data:e.payload.translatedBody.prompt}}})),[e]),m=f.chooseAgain&&p===y.serviceSessionId&&t.id!==h;return(0,r.useEffect)((()=>{c(t.id===h)}),[t,h]),{body:f,subEvent:v,showOptions:n,chooseAgain:m,onChoiceClickHandler:e=>{const n=(0,o.s)();m&&d("new_topic",n),u(e.text,n),l({type:a.w$.pickChoice,originMessage:t.id,choice:{id:e.id,text:e.text,chooseAgain:m},transactionId:n}),c(!1)},onChooseAgainClickHandler:()=>{c((e=>!e))}}}},3792:(e,t,n)=>{"use strict";n(5352),n(4640),n(8544),n(6204),n(784)},7800:(e,t,n)=>{"use strict";n(7456),n(8544),n(2796),n(3792),n(784)},9500:(e,t,n)=>{"use strict";(0,n(9150).createContext)(null)},9056:(e,t,n)=>{"use strict";(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,{l:()=>r}),n(5352);const r=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,{kX:()=>o});var r=n(8056),i=(n(3332),n(8760));n(6736);const o=e=>(0,r.useCallback)((()=>{var t;t=e,requestAnimationFrame((async()=>{await((e=0)=>new Promise((t=>{setTimeout(t,e)})))(180);const e="string"==typeof t?document.getElementById(t):t;(0,i.O8)(e)}))}),[e])},8384:(e,t,n)=>{"use strict";n.d(t,{C:()=>s});var r=n(8056),i=n(6612),o=n(6244);const s=()=>{const e=(0,r.useContext)(i.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:()=>o.kX,SS:()=>c.SS,wv:()=>h.c,ue:()=>y,sD:()=>f.c,li:()=>s.l,Yj:()=>p,Ip:()=>c.Ip});var r=n(8056),i=n(9816),o=n(3480),s=n(2796),a=n(3332),c=(n(9056),n(6736));n(8384);var l=n(9320),u=n(2328),d=n(4640);const p=()=>{const{t:e}=(0,d.g)(),{options:t}=(0,c.gf)(),{panelActive:n,optionActive:i,userSelectedOptions:o,features:s}=t,{extraMenuItem:p,sendTranscript:h}=s,f={extraMenuItem:p,sendTranscript:h},y=t=>"extraMenuItem"===t?"Extra menu item":e(`options.${t}.menuTitle`),v=Object.keys(f).filter((e=>f[e])).map((e=>({name:e,title:y(e),available:f[e].enabled}))),m=p||h,g=(0,u.OY)(),{get:b,set:_}=(0,l.cb)();return{allowOptionSelection:m,userSelectedOptions:o,features:s,menuOptions:v,initUserSelectedOptions:(0,r.useCallback)((()=>{const e=b("options")||{};g((0,a.IF)(e))}),[b,g]),setUserSelectedOptions:(0,r.useCallback)((e=>{g((0,a.IF)(e)),_("options",e)}),[_,g]),setUserSelectedOption:(0,r.useCallback)(((e,t)=>{const n=b("options")||{};_("options",{...n,[e]:t}),g((0,a.eK)({option:e,value:t}))}),[g,b,_]),showOption:e=>{g((0,a.ER)(e))},hideOption:()=>{g((0,a.Ur)())},panelActive:n,optionActive:i}};n(7268),n(3460);var h=n(8416),f=n(952);n(152),n(1100);const y=(e,t)=>{const n=(0,i.c)();(0,r.useEffect)((()=>{if(n.channel){const{channel:r}=n;r.onMessage=(n,r)=>(t&&!t({type:n,payload:r})||e({type:n,payload:r}),r)}}),[e,t,n])}},7268:(e,t,n)=>{"use strict";n(8056),n(9500)},8416:(e,t,n)=>{"use strict";n.d(t,{c:()=>g});var r=n(8056),i=n(2328),o=n(7548),s=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),y=n(6244),v=n(9320),m=n(6736);const g=()=>{const e=(0,v.Ml)(),t=(0,i.OY)(),n=(0,r.useContext)(f.E),g=(0,a.w)(),b=(0,v.aJ)(),{visible:_,setVisibility:C}=(0,p.uu)(),w=(0,m.I7)(),E=(0,r.useCallback)(((...e)=>{n.emit(...e)}),[n]),O=(0,r.useCallback)((()=>{E("ui.beforeStart",{visibility:_,hasConversation:b(),hasResponded:g,unreadMessageCount:w}),e.send("start"),E("ui.start",{visibility:_,hasConversation:b(),hasResponded:g,unreadMessageCount:w})}),[e,E,b,g,w,_]),S=(0,r.useCallback)((async()=>{t(s.C())}),[t]),T=(0,r.useCallback)((e=>({type:e,id:(0,h.s)(),transactionId:(0,h.s)(),participant:o.kr,fromClient:!0,occurredAt:1e3*Date.now(),meta:{}})),[]),j=(0,r.useCallback)((e=>({...T("text"),body:{text:e}})),[T]),k=(0,r.useCallback)((({body:n,config:r={}})=>{if(""===n.trim())return;const i={...j(n),...r};e.send("message",i),E("message",i),t((0,u.Ux)({type:"message",payload:{...i,optimisticallyInjected:!0}}))}),[e,t,E,j]),I=(0,r.useCallback)(((e,n=(0,h.s)())=>{t((0,u.Ux)({type:"message",payload:{...j(e),transactionId:n}}))}),[t,j]),x=(0,r.useCallback)(((e,n,r,i,s,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:i,filename:s,filesize:a,url:c}}}))}),[t]),A=(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]),R=(0,r.useCallback)((t=>{if(!t)return;e.send("action",t);const{type:n}=t;n!==y.w$.typing&&n!==y.w$.read&&E(`action.${n}`,t)}),[e,E]),P=(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)),C(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,C]),start:O,sendMessage:k,sendAction:R,sendContext:P,reset:S,emitEvent:E,addMessageBubble:I,addUploadBubble:x,addDivider:A,apiConnected:e.connected,apiConfigReady:e.configReady}}},952:(e,t,n)=>{"use strict";n.d(t,{c:()=>f});var r=n(8056),i=n(2328),o=n(7548),s=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,i.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:y,sendAction:v}=(0,h.c)(),{t:m}=(0,s.g)(),{sendAssertive:g,sendPolite:b}=(0,d.C)(),_=(0,r.useCallback)((e=>{const{isOpen:t}=f.current;t&&g(e)}),[g]),C=(0,r.useCallback)((e=>{const{isOpen:t}=f.current;t&&b(e)}),[b]),w=(0,r.useCallback)((t=>{const n=(0,l.Ub)(t),r=(0,l.s3)(n);e((0,a.gB)({delaySeconds:n,delayTime:r})),y("idleTimer.start"),_(`${m("idleDetachWarning.countdownTitle")} ${m("idleDetachWarning.countdownText")} ${m("idleDetachWarning.countdownTimer",r)}`)}),[e,y,_,m]),E=(0,r.useCallback)(((t,n)=>{const{hasCountdown:r,wasStopped:i}=f.current;r&&(t||(n||v({type:u.w$.detachService}),_(m("idleDetachWarning.notifyTransferText"))),i||y("idleTimer.stop"),e((0,a.aD)()))}),[e,v,y,_,m]),O=(0,r.useCallback)((()=>{const{remaining:t}=f.current;if(t<=0)return;const n=t-1;n%o.sB==0&&_(`${m("idleDetachWarning.countdownText")} ${m("idleDetachWarning.countdownTimer",(0,l.s3)(n))}`),e((0,a.I1)())}),[e,_,m]),S=(0,r.useCallback)((()=>{const{isActive:t,remaining:n}=f.current;t&&(e((0,a.e_)()),n&&(y("idleTimer.stop"),C(m("idleDetachWarning.srCountDownStoppedText"))))}),[e,y,C,m]);return{...t,initCountdown:w,endCountdown:E,decrementCountdown:O,stopCountdown:S}}},152:(e,t,n)=>{"use strict";n(4640),n(3332),n(6244),n(8384),n(6736),n(8416)},1100:(e,t,n)=>{"use strict";n.d(t,{k3:()=>o});var r=n(8056),i=n(1676);const o=()=>{const[e]=(0,r.useState)((()=>(0,i.s)()));return e}},8760:(e,t,n)=>{"use strict";n.d(t,{O8:()=>s,Qv:()=>i,Ub:()=>r,gl:()=>a,s3:()=>o});const r=e=>Math.ceil(e/1e3),i=e=>Math.ceil(e/1e3),o=e=>{const t=Math.floor(e/60);return{minutes:t,seconds:e-60*t}},s=e=>{e&&e.focus()},a=(e,t)=>t.reduce(((t,n)=>(n in e&&(t[n]=e[n]),t)),{})},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:()=>w,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:()=>V,cloneElement:()=>J,createContext:()=>r.createContext,createElement:()=>r.createElement,createFactory:()=>K,createPortal:()=>T,createRef:()=>r.createRef,default:()=>ce,findDOMNode:()=>X,flushSync:()=>Z,forwardRef:()=>p,hydrate:()=>M,isElement:()=>oe,isFragment:()=>G,isValidElement:()=>q,lazy:()=>C,memo:()=>l,render:()=>P,startTransition:()=>te,unmountComponentAtNode:()=>Y,unstable_batchedUpdates:()=>Q,useDeferredValue:()=>ne,useInsertionEffect:()=>ie,useSyncExternalStore:()=>se,useTransition:()=>re,version:()=>W});var r=n(9150),i=n(8056),o={};for(const e in i)["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]=()=>i[e]);function s(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 i(t){return this.shouldComponentUpdate=n,(0,r.createElement)(e,t)}return i.displayName="Memo("+(e.displayName||e.name)+")",i.prototype.isReactComponent=!0,i.__f=!0,i}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=s({},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},y=r.options.__e;r.options.__e=function(e,t,n,r){if(e.then)for(var i,o=t;o=o.__;)if((i=o.__c)&&i.__c)return null==t.__e&&(t.__e=n.__e,t.__k=n.__k),i.__c(e,t);y(e,t,n,r)};var v=r.options.unmount;function m(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=s({},e)).__c&&(e.__c.__P===n&&(e.__c.__P=t),e.__c=null),e.__k=e.__k&&e.__k.map((function(e){return m(e,t,n)}))),e}function g(e,t,n){return e&&n&&(e.__v=null,e.__k=e.__k&&e.__k.map((function(e){return g(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 _(e){var t=e.__.__c;return t&&t.__a&&t.__a(e)}function C(e){var t,n,i;function o(o){if(t||(t=e()).then((function(e){n=e.default||e}),(function(e){i=e})),i)throw i;if(!n)throw t;return(0,r.createElement)(n,o)}return o.displayName="Lazy",o.__f=!0,o}function w(){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 i=_(r.__v),o=!1,s=function(){o||(o=!0,n.__R=null,i?i(a):a())};n.__R=s;var a=function(){if(! --r.__u){if(r.state.__a){var e=r.state.__a;r.__v.__k[0]=g(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(s,s)},b.prototype.componentWillUnmount=function(){this.t=[]},b.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var n=document.createElement("div"),i=this.__v.__k[0].__c;this.__v.__k[0]=m(this.__b,n,i.__O=i.__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 E=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 O(e){return this.getChildContext=function(){return e.context},e.children}function S(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)(O,{context:t.context},e.__v),t.l)}function T(e,t){var n=(0,r.createElement)(S,{__v:e,i:t});return n.containerInfo=t,n}(w.prototype=new r.Component).__a=function(e){var t=this,n=_(t.__v),r=t.o.get(e);return r[0]++,function(i){var o=function(){t.props.revealOrder?(r.push(i),E(t,e,r)):i()};n?n(o):o()}},w.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},w.prototype.componentDidUpdate=w.prototype.componentDidMount=function(){var e=this;this.o.forEach((function(t,n){E(e,n,t)}))};var j="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]/,I=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,x=/[A-Z0-9]/g,A="undefined"!=typeof document,R=function(e){return("undefined"!=typeof Symbol&&"symbol"==typeof Symbol()?/fil|che|rad/:/fil|che|ra/).test(e)};function P(e,t,n){return null==t.__k&&(t.textContent=""),(0,r.render)(e,t),"function"==typeof n&&n(),e?e.__c:null}function M(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 L=r.options.event;function N(){}function D(){return this.cancelBubble}function U(){return this.defaultPrevented}r.options.event=function(e){return L&&(e=L(e)),e.persist=N,e.isPropagationStopped=D,e.isDefaultPrevented=U,e.nativeEvent=e};var $,F={enumerable:!1,configurable:!0,get:function(){return this.class}},B=r.options.vnode;r.options.vnode=function(e){"string"==typeof e.type&&function(e){var t=e.props,n=e.type,i={};for(var o in t){var s=t[o];if(!("value"===o&&"defaultValue"in t&&null==s||A&&"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===s?s="":"ondoubleclick"===a?o="ondblclick":"onchange"!==a||"input"!==n&&"textarea"!==n||R(t.type)?"onfocus"===a?o="onfocusin":"onblur"===a?o="onfocusout":I.test(o)?o=a:-1===n.indexOf("-")&&k.test(o)?o=o.replace(x,"-$&").toLowerCase():null===s&&(s=void 0):a=o="oninput","oninput"===a&&i[o=a]&&(o="oninputCapture"),i[o]=s}}"select"==n&&i.multiple&&Array.isArray(i.value)&&(i.value=(0,r.toChildArray)(t.children).forEach((function(e){e.props.selected=-1!=i.value.indexOf(e.props.value)}))),"select"==n&&null!=i.defaultValue&&(i.value=(0,r.toChildArray)(t.children).forEach((function(e){e.props.selected=i.multiple?-1!=i.defaultValue.indexOf(e.props.value):i.defaultValue==e.props.value}))),t.class&&!t.className?(i.class=t.class,Object.defineProperty(i,"className",F)):(t.className&&!t.class||t.class&&t.className)&&(i.class=i.className=t.className),e.props=i}(e),e.$$typeof=j,B&&B(e)};var H=r.options.__r;r.options.__r=function(e){H&&H(e),$=e.__c};var z=r.options.diffed;r.options.diffed=function(e){z&&z(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),$=null};var V={ReactCurrentDispatcher:{current:{readContext:function(e){return $.__n[e.__c].props.value}}}},W="17.0.2";function K(e){return r.createElement.bind(null,e)}function q(e){return!!e&&e.$$typeof===j}function G(e){return q(e)&&e.type===r.Fragment}function J(e){return q(e)?r.cloneElement.apply(null,arguments):e}function Y(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 ie=i.useLayoutEffect,oe=q;function se(e,t){var n=t(),r=(0,i.useState)({h:{__:n,v:t}}),o=r[0].h,s=r[1];return(0,i.useLayoutEffect)((function(){o.__=n,o.v=t,ae(o)&&s({h:o})}),[e,n,t]),(0,i.useEffect)((function(){return ae(o)&&s({h:o}),e((function(){ae(o)&&s({h:o})}))}),[e]),n}function ae(e){var t,n,r=e.v,i=e.__;try{var o=r();return!((t=i)===(n=o)&&(0!==t||1/t==1/n)||t!=t&&n!=n)}catch(e){return!0}}var ce={useState:i.useState,useId:i.useId,useReducer:i.useReducer,useEffect:i.useEffect,useLayoutEffect:i.useLayoutEffect,useInsertionEffect:ie,useTransition:re,useDeferredValue:ne,useSyncExternalStore:se,startTransition:te,useRef:i.useRef,useImperativeHandle:i.useImperativeHandle,useMemo:i.useMemo,useCallback:i.useCallback,useContext:i.useContext,useDebugValue:i.useDebugValue,version:"17.0.2",Children:f,render:P,hydrate:M,unmountComponentAtNode:Y,createPortal:T,createElement:r.createElement,createContext:r.createContext,createFactory:K,cloneElement:J,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:w,lazy:C,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:V}},7888:(e,t,n)=>{"use strict";n(784),n(8544)},7556:(e,t,n)=>{"use strict";var r=n(144),i="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,s=r.useRef,a=r.useEffect,c=r.useMemo,l=r.useDebugValue;t.useSyncExternalStoreWithSelector=function(e,t,n,r,u){var d=s(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 s=t}return s=e}if(t=s,i(o,e))return t;var n=r(e);return void 0!==u&&u(t,n)?t:(o=e,s=n)}var o,s,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,{Uh:()=>Y,aw:()=>ae,is:()=>pe,CF:()=>ne,i0:()=>ee});var r=Symbol.for("immer-nothing"),i=Symbol.for("immer-draftable"),o=Symbol.for("immer-state");function s(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[i]||!!e.constructor?.[i]||v(e)||m(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:m(e)?3:0}function f(e,t){return 2===h(e)?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function y(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 m(e){return e instanceof Set}function g(e){return e.copy_||e.base_}function b(e,t){if(v(e))return new Map(e);if(m(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 i=r[t],o=n[i];!1===o.writable&&(o.writable=!0,o.configurable=!0),(o.get||o.set)&&(n[i]={configurable:!0,writable:!0,enumerable:o.enumerable,value:e[i]})}return Object.create(a(e),n)}function _(e,t=!1){return w(e)||c(e)||!l(e)||(h(e)>1&&(e.set=e.add=e.clear=e.delete=C),Object.freeze(e),t&&p(e,((e,t)=>_(t,!0)))),e}function C(){s(2)}function w(e){return Object.isFrozen(e)}var E,O={};function S(e){const t=O[e];return t||s(0),t}function T(){return E}function j(e,t){t&&(S("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function k(e){I(e),e.drafts_.forEach(A),e.drafts_=null}function I(e){e===E&&(E=e.parent_)}function x(e){return E={drafts_:[],parent_:E,immer_:e,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function A(e){const t=e[o];0===t.type_||1===t.type_?t.revoke_():t.revoked_=!0}function R(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];return void 0!==e&&e!==n?(n[o].modified_&&(k(t),s(4)),l(e)&&(e=P(t,e),t.parent_||L(t,e)),t.patches_&&S("Patches").generateReplacementPatches_(n[o].base_,e,t.patches_,t.inversePatches_)):e=P(t,n,[]),k(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==r?e:void 0}function P(e,t,n){if(w(t))return t;const r=t[o];if(!r)return p(t,((i,o)=>M(e,r,t,i,o,n))),t;if(r.scope_!==e)return t;if(!r.modified_)return L(e,r.base_,!0),r.base_;if(!r.finalized_){r.finalized_=!0,r.scope_.unfinalizedDrafts_--;const t=r.copy_;let i=t,o=!1;3===r.type_&&(i=new Set(t),t.clear(),o=!0),p(i,((i,s)=>M(e,r,t,i,s,n,o))),L(e,t,!1),n&&e.patches_&&S("Patches").generatePatches_(r,n,e.patches_,e.inversePatches_)}return r.copy_}function M(e,t,n,r,i,o,s){if(c(i)){const s=P(e,i,o&&t&&3!==t.type_&&!f(t.assigned_,r)?o.concat(r):void 0);if(y(n,r,s),!c(s))return;e.canAutoFreeze_=!1}else s&&n.add(i);if(l(i)&&!w(i)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;P(e,i),t&&t.scope_.parent_||L(e,i)}}function L(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&_(t,n)}var N={get(e,t){if(t===o)return e;const n=g(e);if(!f(n,t))return function(e,t,n){const r=$(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===U(e.base_,t)?(B(e),e.copy_[t]=H(r,e)):r},has:(e,t)=>t in g(e),ownKeys:e=>Reflect.ownKeys(g(e)),set(e,t,n){const r=$(g(e),t);if(r?.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const r=U(g(e),t),a=r?.[o];if(a&&a.base_===n)return e.copy_[t]=n,e.assigned_[t]=!1,!0;if(((i=n)===(s=r)?0!==i||1/i==1/s:i!=i&&s!=s)&&(void 0!==n||f(e.base_,t)))return!0;B(e),F(e)}var i,s;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!==U(e.base_,t)||t in e.base_?(e.assigned_[t]=!1,B(e),F(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0),getOwnPropertyDescriptor(e,t){const n=g(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r?{writable:!0,configurable:1!==e.type_||"length"!==t,enumerable:r.enumerable,value:n[t]}:r},defineProperty(){s(11)},getPrototypeOf:e=>a(e.base_),setPrototypeOf(){s(12)}},D={};function U(e,t){const n=e[o];return(n?g(n):e)[t]}function $(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 F(e){e.modified_||(e.modified_=!0,e.parent_&&F(e.parent_))}function B(e){e.copy_||(e.copy_=b(e.base_,e.scope_.immer_.useStrictShallowCopy_))}function H(e,t){const n=v(e)?S("MapSet").proxyMap_(e,t):m(e)?S("MapSet").proxySet_(e,t):function(e,t){const n=Array.isArray(e),r={type_:n?1:0,scope_:t?t.scope_:T(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let i=r,o=N;n&&(i=[r],o=D);const{revoke:s,proxy:a}=Proxy.revocable(i,o);return r.draft_=a,r.revoke_=s,a}(e,t);return(t?t.scope_:T()).drafts_.push(n),n}function z(e){return c(e)||s(10),V(e)}function V(e){if(!l(e)||w(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)=>{y(n,e,V(t))})),t&&(t.finalized_=!1),n}p(N,((e,t)=>{D[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}})),D.deleteProperty=function(e,t){return D.set.call(this,e,t,void 0)},D.set=function(e,t,n){return N.set.call(this,e[0],t,n,e[0])};var W=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,...i){return r.produce(e,(e=>t.call(this,e,...i)))}}let i;if("function"!=typeof t&&s(6),void 0!==n&&"function"!=typeof n&&s(7),l(e)){const r=x(this),o=H(e,void 0);let s=!0;try{i=t(o),s=!1}finally{s?k(r):I(r)}return j(r,n),R(i,r)}if(!e||"object"!=typeof e){if(i=t(e),void 0===i&&(i=e),i===r&&(i=void 0),this.autoFreeze_&&_(i,!0),n){const t=[],r=[];S("Patches").generateReplacementPatches_(e,i,t,r),n(t,r)}return i}s(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)||s(8),c(e)&&(e=z(e));const t=x(this),n=H(e,void 0);return n[o].isManual_=!0,I(t),n}finishDraft(e,t){const n=e&&e[o];n&&n.isManual_||s(9);const{scope_:r}=n;return j(r,t),R(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=S("Patches").applyPatches_;return c(e)?r(e,t):this.produce(e,(e=>r(e,t)))}},K=W.produce;W.produceWithPatches.bind(W),W.setAutoFreeze.bind(W),W.setUseStrictShallowCopy.bind(W),W.applyPatches.bind(W),W.createDraft.bind(W),W.finishDraft.bind(W);var q=n(8888),G=n(8608),J=(((...e)=>{const t=(0,q.qu)(...e),n=Object.assign(((...e)=>{const n=t(...e),r=(e,...t)=>n(c(e)?z(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__,"undefined"!=typeof window&&window.__REDUX_DEVTOOLS_EXTENSION__&&window.__REDUX_DEVTOOLS_EXTENSION__,e=>e&&"function"==typeof e.match);function Y(e,t){function n(...n){if(t){let r=t(...n);if(!r)throw new Error(_e(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}function X(e){return l(e)?K(e,(()=>{})):e}function Q(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(_e(10));const r=n.insert(t,e);return e.set(t,r),r}Symbol.species;function Z(e){const t={},n=[];let r;const i={addCase(e,n){const r="string"==typeof e?e:e.type;if(!r)throw new Error(_e(28));if(r in t)throw new Error(_e(29));return t[r]=n,i},addMatcher:(e,t)=>(n.push({matcher:e,reducer:t}),i),addDefaultCase:e=>(r=e,i)};return e(i),[t,n,r]}"undefined"!=typeof window&&window.requestAnimationFrame&&window.requestAnimationFrame;var ee=(e=21)=>{let t="",n=e;for(;n--;)t+="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW"[64*Math.random()|0];return t},te=(e,t)=>J(e)?e.match(t):e(t);function ne(...e){return t=>e.some((e=>te(e,t)))}var re=["name","message","stack","code"],ie=class{constructor(e,t){this.payload=e,this.meta=t}_type},oe=class{constructor(e,t){this.payload=e,this.meta=t}_type},se=e=>{if("object"==typeof e&&null!==e){const t={};for(const n of re)"string"==typeof e[n]&&(t[n]=e[n]);return t}return{message:String(e)}},ae=(()=>{function e(e,t,n){const r=Y(e+"/fulfilled",((e,t,n,r)=>({payload:e,meta:{...r||{},arg:n,requestId:t,requestStatus:"fulfilled"}}))),i=Y(e+"/pending",((e,t,n)=>({payload:void 0,meta:{...n||{},arg:t,requestId:e,requestStatus:"pending"}}))),o=Y(e+"/rejected",((e,t,r,i,o)=>({payload:i,error:(n&&n.serializeError||se)(e||"Rejected"),meta:{...o||{},arg:r,requestId:t,rejectedWithValue:!!i,requestStatus:"rejected",aborted:"AbortError"===e?.name,condition:"ConditionError"===e?.name}})));return Object.assign((function(e){return(s,a,c)=>{const l=n?.idGenerator?n.idGenerator(e):ee(),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!==(y=o)&&"object"==typeof y&&"function"==typeof y.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)}));s(i(l,e,n?.getPendingMeta?.({requestId:l,arg:e},{getState:a,extra:c}))),f=await Promise.race([v,Promise.resolve(t(e,{dispatch:s,getState:a,extra:c,requestId:l,signal:u.signal,abort:h,rejectWithValue:(e,t)=>new ie(e,t),fulfillWithValue:(e,t)=>new oe(e,t)})).then((t=>{if(t instanceof ie)throw t;return t instanceof oe?r(t.payload,l,e,t.meta):r(t,l,e)}))])}catch(t){f=t instanceof ie?o(null,l,e,t.payload,t.meta):o(t,l,e)}finally{d&&u.signal.removeEventListener("abort",d)}var y;return n&&!n.dispatchConditionRejection&&o.match(f)&&f.meta.condition||s(f),f}();return Object.assign(f,{abort:h,requestId:l,arg:e,unwrap:()=>f.then(ce)})}}),{pending:i,rejected:o,fulfilled:r,settled:ne(o,r),typePrefix:e})}return e.withTypes=()=>e,e})();function ce(e){if(e.meta&&e.meta.rejectedWithValue)throw e.payload;if(e.error)throw e.error;return e.payload}var le=Symbol.for("rtk-slice-createasyncthunk");function ue(e,t){return`${e}/${t}`}function de(e,t,n,r){function i(i,...o){let s=t(i);return void 0===s&&r&&(s=n()),e(s,...o)}return i.unwrapped=e,i}var pe=function({creators:e}={}){const t=e?.asyncThunk?.[le];return function(e){const{name:n,reducerPath:r=n}=e;if(!n)throw new Error(_e(11));const i=("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(i),s={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},a={addCase(e,t){const n="string"==typeof e?e:e.type;if(!n)throw new Error(_e(12));if(n in s.sliceCaseReducersByType)throw new Error(_e(13));return s.sliceCaseReducersByType[n]=t,a},addMatcher:(e,t)=>(s.sliceMatchers.push({matcher:e,reducer:t}),a),exposeAction:(e,t)=>(s.actionCreators[e]=t,a),exposeCaseReducer:(e,t)=>(s.sliceCaseReducersByName[e]=t,a)};function u(){const[t={},n=[],r]="function"==typeof e.extraReducers?Z(e.extraReducers):[e.extraReducers],i={...t,...s.sliceCaseReducersByType};return function(e,t){let o,[a,u,d]=Z((e=>{for(let t in i)e.addCase(t,i[t]);for(let t of s.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=()=>X(e());else{const t=X(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 K(e,(e=>n(e,t)));{const r=n(e,t);if(void 0===r){if(null===e)return e;throw new Error(_e(9))}return r}}return e}),e)}return p.getInitialState=o,p}(e.initialState)}o.forEach((r=>{const o=i[r],s={reducerName:r,type:ue(n,r),createNotation:"function"==typeof e.reducers};!function(e){return"asyncThunk"===e._reducerDefinitionType}(o)?function({type:e,reducerName:t,createNotation:n},r,i){let o,s;if("reducer"in r){if(n&&!function(e){return"reducerWithPrepare"===e._reducerDefinitionType}(r))throw new Error(_e(17));o=r.reducer,s=r.prepare}else o=r;i.addCase(e,o).exposeCaseReducer(t,o).exposeAction(t,s?Y(e,s):Y(e))}(s,o,a):function({type:e,reducerName:t},n,r,i){if(!i)throw new Error(_e(18));const{payloadCreator:o,fulfilled:s,pending:a,rejected:c,settled:l,options:u}=n,d=i(e,o,u);r.exposeAction(t,d),s&&r.addCase(d.fulfilled,s),a&&r.addCase(d.pending,a),c&&r.addCase(d.rejected,c),l&&r.addMatcher(d.settled,l),r.exposeCaseReducer(t,{fulfilled:s||he,pending:a||he,rejected:c||he,settled:l||he})}(s,o,a,t)}));const d=e=>e,p=new Map;let h;function f(e,t){return h||(h=u()),h(e,t)}function y(){return h||(h=u()),h.getInitialState()}function v(t,n=!1){function r(e){let r=e[t];return void 0===r&&n&&(r=y()),r}function i(t=d){const r=Q(p,n,{insert:()=>new WeakMap});return Q(r,t,{insert:()=>{const r={};for(const[i,o]of Object.entries(e.selectors??{}))r[i]=de(o,t,y,n);return r}})}return{reducerPath:t,getSelectors:i,get selectors(){return i(r)},selectSlice:r}}const m={name:n,reducer:f,actions:s.actionCreators,caseReducers:s.sliceCaseReducersByName,getInitialState:y,...v(r),injectInto(e,{reducerPath:t,...n}={}){const i=t??r;return e.inject({reducerPath:i,reducer:f},n),{...m,...v(i,!0)}}};return m}}();function he(){}var{assign:fe}=Object,ye="listenerMiddleware",ve=e=>{let{type:t,actionCreator:n,matcher:r,predicate:i,effect:o}=e;if(t)i=Y(t).match;else if(n)t=n.type,i=n.match;else if(r)i=r;else if(!i)throw new Error(_e(21));return((e,t)=>{if("function"!=typeof e)throw new Error(_e(32))})(o),{predicate:i,type:t,effect:o}},me=Object.assign((e=>{const{type:t,predicate:n,effect:r}=ve(e);return{id:ee(),effect:r,type:t,predicate:n,pending:new Set,unsubscribe:()=>{throw new Error(_e(22))}}}),{withTypes:()=>me}),ge=Object.assign(Y(`${ye}/add`),{withTypes:()=>ge}),be=(Y(`${ye}/removeAll`),Object.assign(Y(`${ye}/remove`),{withTypes:()=>be}));function _e(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,{OY:()=>_,w1:()=>y});var r=n(144),i=n(6728),o=r.default,s=Symbol.for("react-redux-context"),a="undefined"!=typeof globalThis?globalThis:{};function c(){if(!o.createContext)return{};const e=a[s]??(a[s]=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:i={}}="function"==typeof n?{equalityFn:n}:n,{store:s,subscription:a,getServerState:c,stabilityCheck:l,identityFunctionCheck:u}=t(),d=(o.useRef(!0),o.useCallback({[e.name]:t=>e(t)}[e.name],[e,l,i.stabilityCheck])),f=p(a.addNestedSub,s.getState,c||s.getState,d,r);return o.useDebugValue(f),f};return Object.assign(n,{withTypes:()=>n}),n}var y=f();function v(e=l){const t=e===l?d:u(e),n=()=>{const{store:e}=t();return e};return Object.assign(n,{withTypes:()=>n}),n}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"),"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 m=v();function g(e=l){const t=e===l?m:v(e),n=()=>t().dispatch;return Object.assign(n,{withTypes:()=>n}),n}var b,_=g();b=i.useSyncExternalStoreWithSelector,p=b,r.useSyncExternalStore},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:()=>c,Jn:()=>a,TL:()=>s});var i=()=>Math.random().toString(36).substring(7).split("").join("."),o={INIT:`@@redux/INIT${i()}`,REPLACE:`@@redux/REPLACE${i()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${i()}`};function s(e){const t=Object.keys(e),n={};for(let r=0;r<t.length;r++){const i=t[r];"function"==typeof e[i]&&(n[i]=e[i])}const i=Object.keys(n);let s;try{!function(e){Object.keys(e).forEach((t=>{const n=e[t];if(void 0===n(void 0,{type:o.INIT}))throw new Error(r(12));if(void 0===n(void 0,{type:o.PROBE_UNKNOWN_ACTION()}))throw new Error(r(13))}))}(n)}catch(e){s=e}return function(e={},t){if(s)throw s;let o=!1;const a={};for(let s=0;s<i.length;s++){const c=i[s],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,o=o||d!==u}return o=o||i.length!==Object.keys(e).length,o?a:e}}function a(...e){return 0===e.length?e=>e:1===e.length?e[0]:e.reduce(((e,t)=>(...n)=>e(t(...n))))}function c(e){return function(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)}(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 i="undefined"!=typeof WeakRef?WeakRef:class{constructor(e){this.value=e}deref(){return this.value}},o=0,s=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===s?d=t.v:(d=e.apply(null,arguments),c++),u.s=s,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 i(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,i=(...e)=>{let t,i=0,o=0,s={},a=e.pop();"object"==typeof a&&(s=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,...s},{memoize:u,memoizeOptions:d=[],argsMemoize:p=c,argsMemoizeOptions:h=[],devModeChecks:f={}}=l,y=r(d),v=r(h),m=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),g=u((function(){return i++,a.apply(null,arguments)}),...y),b=p((function(){o++;const e=function(e,t){const n=[],{length:r}=e;for(let i=0;i<r;i++)n.push(e[i].apply(null,t));return n}(m,arguments);return t=g.apply(null,e),t}),...v);return Object.assign(b,{resultFunc:a,memoizedResultFunc:g,dependencies:m,dependencyRecomputations:()=>o,resetDependencyRecomputations:()=>{o=0},lastResult:()=>t,recomputations:()=>i,resetRecomputations:()=>{i=0},memoize:u,argsMemoize:p})};return Object.assign(i,{withTypes:()=>i}),i}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 i=t[r];if(void 0!==i)return i.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.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 r={};(()=>{"use strict";n.r(r),n.d(r,{useChoicePrompt:()=>i.Y,useEvents:()=>s.kV,useGeneratedId:()=>l.k3,useI18n:()=>e.g,useSeamlyChat:()=>a.c,useSeamlyCommands:()=>c.c,useSeamlyEventStream:()=>o.ue,useSeamlyIdleDetachCountdown:()=>o.sD,useSeamlyMessageContainerClassNames:()=>o.li,useSeamlyOptions:()=>o.Yj,useTranslatedEventData:()=>t.kx,useTranslations:()=>t.A1,useTranslationsContainer:()=>t.im});var e=n(4640),t=n(7456),i=n(2080),o=n(6204),s=n(6736),a=n(3460),c=n(8416),l=n(1100)})(),module.exports=r})();
|
|
2
|
+
(()=>{var e={8412:(e,t,n)=>{"use strict";n.d(t,{c:()=>N});var r,i,o,s,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",y="leaving",v="phx_close",m="phx_error",g="phx_reply",b="phx_leave",_="websocket",C=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})}},w=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))}},E=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 C(this,"phx_join",this.params,this.timeout),this.pushBuffer=[],this.stateChangeRefs=[],this.rejoinTimer=new w((()=>{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 C(this,b,a({}),this.timeout).send(),this.state=p,this.joinPush.reset(),this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()})),this.on(g,((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(m,(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 C(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=y;let t=()=>{this.socket.hasLogger()&&this.socket.log("channel",`leave ${this.topic}`),this.trigger(v,"leave")},n=new C(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 i=this.onMessage(e,t,n,r);if(t&&!i)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(i,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===y}},S=class{static request(e,t,n,r,i,o,s){if(u.XDomainRequest){let n=new u.XDomainRequest;return this.xdomainRequest(n,e,t,r,i,o,s)}{let a=new u.XMLHttpRequest;return this.xhrRequest(a,e,t,n,r,i,o,s)}}static xdomainRequest(e,t,n,r,i,o,s){return e.timeout=i,e.open(t,n),e.onload=()=>{let t=this.parseJSON(e.responseText);s&&s(t)},o&&(e.ontimeout=o),e.onprogress=()=>{},e.send(r),e}static xhrRequest(e,t,n,r,i,o,s,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)}},s&&(e.ontimeout=s),e.send(i),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 i=t?`${t}[${r}]`:r,o=e[r];"object"==typeof o?n.push(this.serialize(o,i)):n.push(encodeURIComponent(i)+"="+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)}`}},O=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("(.*)/"+_),"$1/longpoll")}endpointURL(){return S.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,i){let o;o=S.request(e,this.endpointURL(),t,n,this.timeout,(()=>{this.reqs.delete(o),r()}),(e=>{this.reqs.delete(o),this.isActive()&&i(e)})),this.reqs.add(o)}},T={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,i,o,s]=JSON.parse(e);return t({join_ref:n,ref:r,topic:i,event:o,payload:s})}},binaryEncode(e){let{join_ref:t,ref:n,event:r,topic:i,payload:o}=e,s=this.META_LENGTH+t.length+n.length+i.length+r.length,a=new ArrayBuffer(this.HEADER_LENGTH+s),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++,i.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(i,(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),i=t.getUint8(2),o=t.getUint8(3),s=this.HEADER_LENGTH+this.META_LENGTH-1,a=n.decode(e.slice(s,s+r));s+=r;let c=n.decode(e.slice(s,s+i));s+=i;let l=n.decode(e.slice(s,s+o));return s+=o,{join_ref:a,ref:null,topic:c,event:l,payload:e.slice(s,e.byteLength)}},decodeReply(e,t,n){let r=t.getUint8(1),i=t.getUint8(2),o=t.getUint8(3),s=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+i));a+=i;let u=n.decode(e.slice(a,a+o));a+=o;let d=n.decode(e.slice(a,a+s));a+=s;let p=e.slice(a,e.byteLength);return{join_ref:c,ref:l,topic:u,event:g,payload:{status:d,response:p}}},decodeBroadcast(e,t,n){let r=t.getUint8(1),i=t.getUint8(2),o=this.HEADER_LENGTH+2,s=n.decode(e.slice(o,o+r));o+=r;let a=n.decode(e.slice(o,o+i));return o+=i,{join_ref:null,ref:null,topic:s,event:a,payload:e.slice(o,e.byteLength)}}},j=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||O,this.longPollFallbackMs=t.longPollFallbackMs,this.fallbackTimer=null,this.sessionStore=t.sessionStorage||u.sessionStorage,this.establishedConnections=0,this.defaultEncoder=T.encode.bind(T),this.defaultDecoder=T.decode.bind(T),this.closeWasClean=!1,this.binaryType=t.binaryType||"arraybuffer",this.connectClock=1,this.transport!==O?(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}/${_}`,this.vsn=t.vsn||"2.0.0",this.heartbeatTimeoutTimer=null,this.heartbeatTimer=null,this.pendingHeartbeatRef=null,this.reconnectTimer=new w((()=>{this.teardown((()=>this.connect()))}),this.reconnectAfterMs)}getLongPollTransport(){return O}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=S.appendParams(S.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!==O?this.connectWithFallback(O,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((i=>{i.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,i=!0,o=t=>{this.log("transport",`falling back to ${e.name}...`,t),this.off([void 0,n]),i=!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),i&&!r&&(clearTimeout(this.fallbackTimer),o(e))})),this.onOpen((()=>{if(r=!0,!i)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(m)}))}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(e,t,this);return this.channels.push(n),n}push(e){if(this.hasLogger()){let{topic:t,event:n,payload:r,ref:i,join_ref:o}=e;this.log("push",`${t} ${n} (${o}, ${i})`,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:i,join_ref:o}=e;i&&i===this.pendingHeartbeatRef&&(this.clearHeartbeats(),this.pendingHeartbeatRef=null,this.heartbeatTimer=setTimeout((()=>this.sendHeartbeat()),this.heartbeatIntervalMs)),this.hasLogger()&&this.log("receive",`${r.status||""} ${t} ${n} ${i&&"("+i+")"||""}`,r);for(let e=0;e<this.channels.length;e++){const s=this.channels[e];s.isMember(t,n,r,o)&&s.trigger(n,r,i,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),I=n(5576),x=n.n(I),A=n(5968),R=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)},P=function(e,t,n,r,i){if("m"===r)throw new TypeError("Private method is not writable");if("a"===r&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?i.call(e,n):i?i.value=n:t.set(e,n),n};const M=x()("seamly"),L=new Set;i=new WeakMap,r=new WeakSet,o=function(...e){e.forEach((e=>{this.channel.on(e,(t=>{M("[RECEIVE]",e,t)}))}))},s=function(e){P(this,i,R(this,i,"f").filter((t=>!t(e))),"f"),L.forEach((e=>e()))};const N=class{constructor(){r.add(this),i.set(this,[])}connect(e,t,n,i){return a=this,c=void 0,u=function*(){this.url=e,this.accessToken=i,this.channelName=t,this.channelTopic=n;const{url:a,params:c}=(0,A.c)(this.url);this.socket=new j(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=>{M("[SOCKET][ERROR]",e)})),this.socket.onOpen((()=>{M("[SOCKET]OPEN")})),this.socket.onClose((()=>{M("[SOCKET]CLOSE"),R(this,r,"m",s).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&&R(this,r,"m",s).call(this,{connected:!0,ready:!0,currentState:"attach_channel_succeeded"})})),this.channel.onClose((()=>{M("[CHANNEL]CLOSE"),R(this,r,"m",s).call(this,{connected:!1,ready:!1,currentState:"channel_closed"})})),this.channel.onError((e=>{M("[CHANNEL][ERROR]",e),R(this,r,"m",s).call(this,{connected:!1,ready:!1,currentState:"channel_erred"})})),R(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{i(u.next(e))}catch(e){t(e)}}function r(e){try{i(u.throw(e))}catch(e){t(e)}}function i(t){var i;t.done?e(t.value):(i=t.value,i instanceof l?i:new l((function(e){e(i)}))).then(n,r)}i((u=u.apply(a,c||[])).next())}));var a,c,l,u}start(){this.channel.join().receive("ok",(()=>{M("[CHANNEL][JOIN] OK"),R(this,r,"m",s).call(this,{connected:!0,ready:!1,currentState:"join_channel_succeeded"})})).receive("error",(e=>{M("[CHANNEL][JOIN] ERROR",e),R(this,r,"m",s).call(this,{connected:!1,ready:!1,currentState:"join_channel_erred"})})).receive("timeout",(()=>{M("[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(),M("[CHANNEL][LEAVE] OK"),P(this,i,[],"f")}))}onConnection(e){R(this,i,"f").push(e)}pushToChannel(e,t,n=1e4){this.channel.push(e,t,n)}static subscribe(e){return L.add(e),()=>L.delete(e)}}},7548:(e,t,n)=>{"use strict";n.d(t,{Ag:()=>s,kR:()=>r,kr:()=>i,sB:()=>o});const r="3",i="seamly-client-participant",o=10,s={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),i=n(6232),o=n(6280),s=n(712);var a=n(2948),c=n(6244),l=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(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?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,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,s,a;let l=null===(e=null==n?void 0:n.context)||void 0===e?void 0:e.contentLocale,u=null===(s=null==n?void 0:n.context)||void 0===s?void 0:s.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 i.c){const e=new i.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:i=300,maxWait:o=0,leading:s=!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=s&&!c;return clearTimeout(c),c=setTimeout((()=>{u(),c=null}),i),!!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,s.O)()),yield t((0,s.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),i=n(232);const o={userHasResponded:!1},s=(0,r.is)({name:"app",initialState:o,reducers:{setHasResponded:(e,{payload:t})=>{e.userHasResponded=t}},extraReducers:e=>{e.addCase(i.C.pending,(()=>o)).addCase(i.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}=s.actions,c=s.reducer},712:(e,t,n)=>{"use strict";n.d(t,{A:()=>o,O:()=>s});var r=n(3120),i=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(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?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))};const o=(0,r.aw)("initializeConfig",((e,{extra:{api:t,config:n},rejectWithValue:r})=>i(void 0,void 0,void 0,(function*(){var e,i;try{const{features:r,defaultLocale:o,preChat:s,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===(i=null==n?void 0:n.context)||void 0===i?void 0:i.contentLocale)||o,{connectWhenInView:p}=n;return{features:r,defaultLocale:o,preChat:s,agentParticipant:a,userParticipant:c,startChatIcon:l,defaultUserLocale:u,defaultContentLocale:d,connectWhenInView:p}}catch(e){return r(e)}})))),s=(0,r.aw)("resetConfig",((e,{extra:{config:t}})=>i(void 0,void 0,void 0,(function*(){return t}))))},5352:(e,t,n)=>{"use strict";n.d(t,{EV:()=>o});var r=n(2328),i=n(5368);const o=()=>(0,r.w1)(i.g)},5368:(e,t,n)=>{"use strict";n.d(t,{g:()=>o});var r=n(8888),i=n(8536);const o=(0,r.M3)((({config:e})=>e),(e=>{let t=Object.assign({visible:"inline"===(null==e?void 0:e.layoutMode)?i.I.open:i.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,{cp:()=>f});var r=n(3120),i=n(7548),o=n(712),s=n(8760);const a=Object.assign(Object.assign({},i.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,s.gl)(t,c),{messages:r}=n,i=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 i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n}(n,["messages"]);let o=e;return Object.keys(i).length>0&&(o=Object.assign(Object.assign({},o),i)),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:i,defaultUserLocale:o,defaultContentLocale:s}})=>{e.preChatEvents=t.map((e=>({type:"message",payload:e}))),e.context.userLocale=o,e.context.contentLocale=s,e.agentParticipant=n,e.userParticipant=r,e.startChatIcon=i}))}}),{setConfig:d,updateConfig:p,setPreChatEvents:h}=u.actions,f=u.reducer},1364:(e,t,n)=>{"use strict";var r=n(3120),i=(n(2309),n(3872)),o=n(2704),s=n(8132),a=n(6232),c=n(1120),l=n(6280);n(5368),o.c,i.c,a.c,s.c,c.c,l.c,(0,r.Uh)("catch-error",(e=>({payload:e})))},2620:(e,t,n)=>{"use strict";n.d(t,{cp:()=>y});var r=n(3120),i=n(232);const o={controls:{}},s={value:"",touched:!1},a={controls:s},c=(0,r.is)({name:"forms",initialState:a,reducers:{registerForm:(e,{payload:{persistData:t,formId:n}})=>{var r;const i=t&&null!==(r=e[n])&&void 0!==r?r:Object.assign(Object.assign({},o),{persistData:t});e[n]=i},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]:s}},deregisterControl:(e,{payload:{name:t,formId:n}})=>{const r=e[n];if(!r)return e;if(r.persistData)return e;const i=Object.assign({},r.controls);return delete i[t],Object.assign(Object.assign({},e),{[n]:Object.assign(Object.assign({},r),{controls:i})})},updateControlValue:(e,{payload:{formId:t,name:n,value:r}})=>{var i;(null===(i=e[t])||void 0===i?void 0:i.controls)&&(e[t].controls[n].value=r)},updateControlTouched:(e,{payload:{formId:t,name:n,touched:r}})=>{var i;(null===(i=e[t])||void 0===i?void 0:i.controls[n])&&(e[t].controls[n].touched=r)}},extraReducers:e=>{e.addCase(i.C.pending,(()=>a))}}),{registerForm:l,deregisterForm:u,registerControl:d,deregisterControl:p,updateControlValue:h,updateControlTouched:f}=c.actions,y=c.reducer},4528:(e,t,n)=>{"use strict";n.d(t,{K:()=>i});var r=n(3120);const i=(0,r.aw)("setLocale",((e,{extra:{api:t},rejectWithValue:n})=>{return r=void 0,i=void 0,s=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(s.next(e))}catch(e){t(e)}}function a(e){try{c(s.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((s=s.apply(r,i||[])).next())}));var r,i,o,s}),{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 i(e){return i="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},i(e)}function o(e){var t=function(e,t){if("object"!=i(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=i(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==i(t)?t:String(t)}function s(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={},i=0,o=null,s=!1,a=0;a<e.length;){if(s&&(t(e[a])||"{"===e[a]))s=!1,o=e.slice(i,a),"{"===e[a]&&a--;else if(!s&&!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),s=!0,i=a}a++}return s&&(o=e.slice(i)),o&&n.push(o),{args:n,cases:r}}function u(e,t){for(var n=0,r=t+1;r<e.length;r++){var i=e.charAt(r);if("}"===i){if(0===n)return r;n--}else"{"===i&&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 i=e.indexOf(t);if(-1===i)return r.push(e),r;var o=e.substring(0,i).trim(),s=e.substring(i+t.length+1).trim();return r.push(o),p(s,t,n-1,r)}n.d(t,{g:()=>I});var h,f=function(){function e(t){var n,r,i=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(i.process(e,t)).join("")},r={},function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];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 s=n.apply(void 0,t);return r[o]=s,s})),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,i,o=e.indexOf("{");if(-1!==o){var s=u(e,o);if(-1===s)throw new Error('Unbalanced curly braces in string: "'.concat(e,'"'));var a=e.substring(o,s+1);if(a){var c=[],l=e.substring(0,o);l&&c.push(l);var p=(n=d(a),i=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,i,o,s,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,i=e}finally{try{if(!c&&null!=n.return&&(s=n.return(),Object(s)!==s))return}finally{if(l)throw i}}return a}}(n,i)||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,i)||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],y=p[2],v=t[h];null==v&&(v="");var m=f&&this.typeHandlers[f];c.push(m?m(v,y,this.locale,t,this.process.bind(this)):v);var g=e.substring(s+1);return g&&c.push(this.process(g,t)),c}}return[e]}}],n&&s(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),e}();function y(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?y(Object(n),!0).forEach((function(t){a(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):y(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var m=0,g="other";function b(e,t){for(var n=0,r="",i=0,o={};n<e.length;){if("#"!==e[n]||i)r+=e[n];else{var s="__hashToken".concat(m++);r+="{".concat(s,", number}"),o[s]=t}"{"===e[n]?i++:"}"===e[n]&&i--,n++}return{caseBody:r,numberValues:o}}var _="other",C=n(8056),w=n(2328),E=n(8888);const S=(0,E.M3)((({i18n:e})=>e),(({translations:e})=>e)),O=(0,E.M3)((({i18n:e})=>e),(({initialLocale:e})=>e)),T=(0,E.M3)((({i18n:e})=>e),(({userLocale:e})=>e)),j=(0,E.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,i=l(arguments.length>1&&void 0!==arguments[1]?arguments[1]:""),o=i.args,s=i.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!==g&&c.push(u)}1===a&&c.push("one"),c.push("=".concat(a),g);for(var d=0;d<c.length;d++){var p=c[d];if(p in s){var f=b(s[p],a),y=f.caseBody,m=f.numberValues;return r(y,v(v({},n),m))}}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):_ in r?n(r[_],t):e}});function I(){const e=(0,w.w1)(S),t=(0,w.w1)(T),n=(0,w.w1)(O),r=(0,w.w1)(j);return{t:(0,C.useCallback)(((n,i={})=>{const o=e[n];return o?k.format(o,i):(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),i=n(2328),o=n(1800),s=n(5768);function a(){const{t:e}=(0,o.g)(),t=(0,i.w1)(s.c),n=(0,i.w1)(s.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:i}=t,o=e(`${r}.title`),s=e(`${r}.message`),a=e(`${r}.srText`),c=i?e(`${r}.buttonText`):null;return Object.assign(Object.assign(Object.assign(Object.assign({},r?{title:o,message:s,srText:a}:{}),i?{action:i}:{}),i&&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:()=>i});var r=n(8888);const i=(0,r.M3)((({interrupt:e})=>e),(({error:e})=>e)),o=(0,r.M3)(i,(e=>Boolean(e)))},1880:(e,t,n)=>{"use strict";n.d(t,{cp:()=>h,yA:()=>d});var r=n(3120),i=n(232),o=n(712),s=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)(i.m.rejected,o.A.rejected,s.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:()=>i});var r=n(3120);const i=(0,r.aw)("getConversation",((e,{extra:{api:t},rejectWithValue:n})=>{return r=void 0,i=void 0,s=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(s.next(e))}catch(e){t(e)}}function a(e){try{c(s.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((s=s.apply(r,i||[])).next())}));var r,i,o,s}),{condition(e,{getState:t}){var n;const{state:{events:r}}=t(),i=r[r.length-1],o=null===(n=null==e?void 0:e.lastEvent)||void 0===n?void 0:n.id;return i&&o!==i.payload.id}})},1760:(e,t,n)=>{"use strict";n.d(t,{A:()=>C});var r=n(8608),i=n(2328),o=n(428),s=n(7452),a=(n(1364),n(2620)),c=n(3120),l=n(232),u=n(712),d=n(4528);const p={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},h=(0,c.is)({name:"app",initialState:p,reducers:{setInitialLocale:(e,t)=>{e.initialLocale=t.payload},setTranslations:(e,{payload:t})=>{e.translations=t}},extraReducers:e=>{e.addCase(l.C.pending,(()=>p)).addCase(u.A.fulfilled,((e,{payload:t})=>{e.initialLocale=t.defaultUserLocale})).addCase(d.K.pending,(e=>{e.isLoading=!0})).addCase(d.K.rejected,(e=>{e.isLoading=!1})).addCase(d.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:f,setTranslations:y}=h.actions,v=h.reducer;n(2704);var m=n(1880),g=n(3332),b=n(8456),_=n(1756);(0,r.TL)({state:g.cp,app:o.cp,config:s.cp,i18n:v,translations:b.cp,visibility:_.cp,forms:a.cp,interrupt:m.cp});const C=i.OY},3332:(e,t,n)=>{"use strict";n.d(t,{ER:()=>Q,I1:()=>C,IF:()=>X,Ur:()=>w,Ux:()=>y,Yh:()=>L,aD:()=>b,cN:()=>N,cp:()=>te,eK:()=>Y,e_:()=>Z,gB:()=>E});var r=n(3120),i=n(232),o=n(712),s=n(1676),a=n(8760),c=n(6244);const l=e=>e.sort((({payload:{occurredAt:e}},{payload:{occurredAt:t}})=>e-t)),u=(e,t)=>{if(!e)return{participants:{},currentAgent:""};const{participants:n}=e||{participants:{}},{id:r,avatar:i,name:o,introduction:s}=t.participant,a=n[r],c=Object.assign(Object.assign({},n),{[r]:a?Object.assign(Object.assign(Object.assign(Object.assign({},a),i?{avatar:i}:{}),o?{name:o}:{}),s?{introduction:s}:{}):t.participant});return Object.assign(Object.assign({},e),{participants:c,currentAgent:e.currentAgent===r||t.fromClient?e.currentAgent:r})},d=(e,t)=>{var n,r;const i="message"===(null==t?void 0:t.type)?(null==t?void 0:t.payload.translatedEntry)||(null==t?void 0:t.payload.entry):{},{blockAutoEntrySwitch:o}=e,s=(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(!i)return Object.assign(Object.assign({},e),{optionsOverride:{},actions:s,translatedActions:a});const{type:c,options:l}=i;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:s,translatedActions:a})},p={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,s.s)(),optionsButtonId:(0,s.s)(),headerCollapseButtonId:(0,s.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},h=(0,r.is)({name:"store",initialState:p,reducers:{addEvent:(e,t)=>{var n,r;const{type:i,payload:o}=t.payload,a=e.options.features.hasOwnProperty(c.gn.uploads);let l=Object.assign({},e.options);if(a&&(i===c.Iz.message||i===c.Iz.participant)&&!o.fromClient){const e="message"===i?null===(n=o.entry)||void 0===n?void 0:n.type:{};l=Object.assign(Object.assign({},l),{features:Object.assign(Object.assign({},l.features),{uploads:Object.assign(Object.assign({},null===(r=l.features)||void 0===r?void 0:r.uploads),{enabledFromEntry:e===c.uG.upload})})})}const u=(({type:e,payload:t})=>"hidden"===document.visibilityState||e===c.Iz.message&&!t.fromClient||e===c.Iz.info&&t.type===c.ay.text)(t.payload);if(e.events.find((e=>e.payload.id===o.id)))return;const p=d(e.entryMeta,t.payload);e.entryMeta=a||p.active!==c.uG.upload?p:Object.assign({},e.entryMeta),e.options=l,u&&(e.unreadEvents+=1,"service_data"!==i&&(t.payload.payload.messageStatus=o.fromClient?c.eg.read:c.eg.received)),t.payload.payload.key=(0,s.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:i}=t;n&&(n.payload.id=r,n.payload.occurredAt=i,e.events=l(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:i={},serviceData:o,resumeConversationPrompt:s}})=>{var a,p,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 l([...r,...n])})(e.events,t),y=Object.assign(Object.assign({},e.participantInfo.participants),n),v=f.slice().reverse().find((e=>("message"===e.type||"participant"===e.type)&&!e.payload.fromClient));let m=null;v&&("message"===v.type&&(m=v.payload.participant),"participant"===v.type&&(m=v.payload.participant.id));const{entry:g}=i,b=null===(a=null==g?void 0:g.options)||void 0===a?void 0:a.upload,_=d(Object.assign(Object.assign(Object.assign({},e.entryMeta),g),{active:(null==g?void 0:g.default)||c.ay.text,options:Object.assign({},(null==g?void 0:g.options)?g.options:{})}),f[f.length-1]);let C=Object.assign({},e.options.features);const w=C.hasOwnProperty(c.gn.uploads);if(w&&"message"===(null==v?void 0:v.type)){const{payload:e}=v,t=(null===(p=null==e?void 0:e.entry)||void 0===p?void 0:p.type)||{};C=Object.assign(Object.assign({},C),{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),m?u(e.participantInfo,{participant:y[m]}):{}),{participants:y}),e.historyLoaded=!0,e.serviceInfo=Object.assign(Object.assign({},e.serviceInfo),{activeServiceSessionId:r,proactiveMessages:(null===(h=null==i?void 0:i.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:C}),e.entryMeta=w||_.active!==c.uG.upload?_:Object.assign({},e.entryMeta),e.resumeConversationPrompt=s||!1,m&&(e.headerTitles.subTitle=y[m].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=u(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=p.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(i.C.pending,(()=>p)).addCase(i.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(i.m.fulfilled,((e,{payload:t})=>{e.isLoading=!1,t.initialState&&(e.initialState=t.initialState)})).addMatcher((0,r.CF)(E,S),(e=>{e.isLastEventFromClient=!1}))}}),{ackEvent:f,addEvent:y,clearAllUploads:v,clearEvents:m,clearFeatures:g,clearIdleDetachCountdown:b,clearResumeConversationPrompt:_,decrementIdleDetachCountdownCounter:C,hideOption:w,initIdleDetachCountdown:E,initResumeConversationPrompt:S,registerUpload:O,resetHistoryLoadedFlag:T,setActiveEntryType:j,setActiveService:k,setBlockAutoEntrySwitch:I,setEventsRead:x,setFeatureEnabledState:A,setFeatures:R,setHeaderSubTitle:P,setHeaderTitle:M,setHistory:L,setInitialState:N,setIsLoading:D,setLoadedImageEventIds:U,setParticipant:$,setSeamlyContainerElement:F,setServiceDataItem:B,setServiceEntryMetadata:H,clearAbortTransaction:z,setUploadComplete:V,setUploadError:W,setUploadProgress:K,startProcessingImage:q,doneProcessingImage:G,setUserEntryType:J,setUserSelectedOption:Y,setUserSelectedOptions:X,showOption:Q,stopIdleDetachCountdownCounter:Z,setProactiveMessages:ee}=h.actions,te=h.reducer},7456:(e,t,n)=>{"use strict";n.d(t,{kx:()=>d,A1:()=>u,im:()=>p});var r=n(8056),i=n(2328),o=n(5352),s=(n(1800),n(8888));const a=e=>(0,s.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 c=n(8456),l=(n(8632),n(6204));function u(){const{sendContext:e}=(0,l.wv)(),t=(0,i.OY)(),n=(0,o.EV)(),s=(0,r.useCallback)((t=>{e({userLocale:t})}),[e]),a=(0,r.useCallback)((()=>{e({userLocale:n.context.contentLocale}),t((0,c.If)())}),[n.context,t,e]),{languages:u,isActive:d,isAvailable:p,currentLocale:h}=(0,i.w1)((({translations:e})=>e));return{languages:u,isActive:d,isAvailable:p,currentLocale:h,enableTranslations:s,disableTranslations:a}}function d(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===(c=null===(s=e.payload)||void 0===s?void 0:s.participant)||void 0===c?void 0:c.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,s,c,l,u,d;const p=!!t,h=(0,i.w1)(a(e));return{body:p&&h?t:r,hasTranslation:p,isTranslated:h&&p,locale:null==n?void 0:n.locale}}function p(){const e=(0,i.w1)((({translations:e})=>e.containerId));return{id:e,focusContainer:(0,l.kX)(e)}}n(6244)},8456:(e,t,n)=>{"use strict";n.d(t,{If:()=>p,cp:()=>m});var r=n(3120),i=n(232),o=n(712),s=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,i)=>{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 i.splice(0),e;e[t].push(n.id)}return n.id===t&&(e[t]=[]),e}),{}),[[r,i]]=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:i}},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:i,eventIds:o}=l(t,n);e.lastGroupId=r,e.translatedEventGroups[i]=o},disableTranslationProposalPrompt:e=>{e.translationProposal=null},setTranslationProposalPrompt:(e,{payload:t})=>{e.translationProposal=t}},extraReducers:e=>{e.addCase(i.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(s.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:y,disableTranslationProposalPrompt:v}=u.actions,m=u.reducer},2948:(e,t,n)=>{"use strict";n.d(t,{c:()=>d,i:()=>p});var r=n(3120),i=n(1060),o=n(5368),s=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,i.E)(d),f=n.hasConversation(),y=o.g(d),{visibilityCallback:v=s.g,layoutMode:m}=y,{unreadEvents:g}=(0,a.cV)(d),b=v({hasResponded:h,previousVisibility:p,requestedVisibility:e,config:y});if(!u.includes(b))return void console.error('The visibilityCallback function should return "open", "minimized" or "hidden".');if(p===b)return;const _=n.store.get(c.M);return n.store.set(c.M,Object.assign(Object.assign({},_||{}),{[m]:e})),e&&r.emit("ui.visible",e,{visibility:e,hasConversation:f,hasResponded:h,unreadMessageCount:g}),b})),p=(0,r.aw)("initialize",((e,{dispatch:t,getState:n,extra:{api:r}})=>{return i=void 0,s=void 0,l=function*(){var e;const{layoutMode:i}=o.g(n()),s=(null===(e=r.store.get(c.M))||void 0===e?void 0:e[i])||c.I.initialize;return t(d(s)),s},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 i;t.done?e(t.value):(i=t.value,i instanceof a?i:new a((function(e){e(i)}))).then(n,r)}o((l=l.apply(i,s||[])).next())}));var i,s,a,l}))},8536:(e,t,n)=>{"use strict";n.d(t,{I:()=>i,M:()=>r});const r="visibility",i={hidden:"hidden",minimized:"minimized",open:"open",initialize:null}},8632:(e,t,n)=>{"use strict";n.d(t,{uu:()=>l}),n(9150);var r=n(8056),i=n(2328),o=(n(5352),n(1760)),s=n(2948),a=(n(1756),n(8536)),c=n(5376);const l=()=>{const e=(0,o.A)(),t=(0,i.w1)(c._),n=!!t&&t!==a.I.hidden,l=t===a.I.open,u=t===a.I.minimized,d=(0,r.useCallback)((t=>e((0,s.c)(t))),[e]);return{isVisible:n,isOpen:l,isMinimized:u,visible:t,setVisibility:d,openChat:()=>{d(a.I.open)},closeChat:()=>{d(a.I.minimized)}}}},5376:(e,t,n)=>{"use strict";n.d(t,{_:()=>i,e:()=>o});var r=n(8888);const i=(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});var r=n(3120),i=n(712),o=n(2948);const s={visibility:n(8536).I.initialize,showInlineView:!1},a=(0,r.is)({name:"visibility",initialState:s,reducers:{setShowInlineView:e=>{e.showInlineView=!0}},extraReducers:e=>{e.addCase(o.c.fulfilled,((e,{payload:t})=>{t&&(e.visibility=t)})).addCase(i.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:()=>i});var r=n(9150);const i=(0,r.createContext)(null),o=(0,r.createContext)(null)},9320:(e,t,n)=>{"use strict";n.d(t,{Ml:()=>o,aJ:()=>a,cb:()=>s});var r=n(8056),i=n(5308);const o=()=>(0,r.useContext)(i.c),s=()=>o().store,a=()=>{const e=o();return(0,r.useCallback)((()=>e.hasConversation()),[e])}},6736:(e,t,n)=>{"use strict";n.d(t,{I7:()=>f,Ip:()=>y,SS:()=>m,cV:()=>l,gf:()=>u,kV:()=>h,y2:()=>g});var r=n(8888),i=n(2328),o=n(1060),s=n(5352),a=n(5368),c=n(8760);const l=({state:e})=>e,u=()=>(0,i.w1)(l),d=(0,r.M3)(l,a.g,o.E,(({events:e,serviceData:t},n,r)=>{var i;if(r||"inline"===n.layoutMode||!(null==t?void 0:t.suggestion)||!(null===(i=null==t?void 0:t.suggestion)||void 0===i?void 0:i.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:i,threshold:o}=null!==(r=null===(n=null==t?void 0:t.messages)||void 0===n?void 0:n.timeIndicator)&&void 0!==r?r:{};if(!i)return e;const s=[];let a=null;return e.forEach(((e,t)=>{if(0===t)s.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;s.push(Object.assign(Object.assign({},e),{timeIndicator:t}))}a=e})),s})),h=()=>(0,i.w1)(p),f=((0,r.M3)(p,(e=>e.map((e=>e.payload.id)))),()=>u().unreadEvents),y=()=>u().serviceInfo,v=(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})),m=()=>(0,i.w1)(v),g=()=>{const{layoutMode:e}=(0,s.EV)();return{isInline:"inline"===e,isWindow:"window"===e,isApp:"app"===e,isResolving:!e}}},3460:(e,t,n)=>{"use strict";n.d(t,{c:()=>y});var r=n(8056),i=n(2328),o=n(1800),s=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 y=()=>{const{t:e}=(0,o.g)(),{isInline:t,isWindow:n,isApp:y}=(0,u.y2)(),{isOpen:v,isVisible:m}=(0,s.uu)(),g=(0,i.w1)(c.e),{start:b,connect:_,apiConfigReady:C,apiConnected:w}=(0,a.c)(),E=(0,r.useRef)(!1),{sendAssertive:S}=(0,l.C)();!function(){const{meta:{originalError:e,action:t}}=(0,p.q)(),n=(0,f.A)(),{reset:i}=(0,a.c)(),o="SeamlySessionExpiredError"===(null==e?void 0:e.name),s=(0,r.useRef)(0),c=(0,r.useRef)(null);(0,r.useEffect)((()=>{if(o&&"reset"===t){if(s.current>=10){c.current=setTimeout((()=>{s.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})),()=>{}}s.current+=1,i()}return()=>{c.current&&clearTimeout(c.current)}}),[t,i,o,n])}(),(0,r.useEffect)((()=>{m&&setTimeout((()=>{S(e("window.srTexts.onLoad"))}),500)}),[m,S,e]),(0,r.useEffect)((()=>{m&&S(e(v?"window.srTexts.onOpen":"window.srTexts.onClose"))}),[v,m,S,e]),(0,r.useEffect)((()=>{C&&w||(E.current=!1)}),[C,w]);const O=(0,r.useCallback)((()=>{return e=void 0,n=void 0,i=function*(){w||(E.current=!0,yield _()),(y||v||m&&t)&&b()},new((r=void 0)||(r=Promise))((function(t,o){function s(e){try{c(i.next(e))}catch(e){o(e)}}function a(e){try{c(i.throw(e))}catch(e){o(e)}}function c(e){var n;e.done?t(e.value):(n=e.value,n instanceof r?n:new r((function(e){e(n)}))).then(s,a)}c((i=i.apply(e,n||[])).next())}));var e,n,r,i}),[w,_,y,t,v,m,b]);(0,r.useEffect)((()=>{!C||E.current||n&&!v||!(!t||m&&g)||O()}),[C,O,t,v,m,n,g])}},9816:(e,t,n)=>{"use strict";n.d(t,{c:()=>s});var r=n(1864),i=n(8412),o=n(9320);const s=()=>{const e=(0,o.Ml)();return(0,r.useSyncExternalStore)(i.c.subscribe,(()=>e.conversation))}},6244:(e,t,n)=>{"use strict";n.d(t,{Iz:()=>r,ay:()=>i,eg:()=>s,gn:()=>l,kD:()=>c,uG:()=>o,w$:()=>a});const r={info:"info",message:"message",participant:"participant",system:"system"},i={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"},s={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={assertive:"assertive",polite:"polite"},l={sendTranscript:"sendTranscript",typingPeekahead:"typingPeekahead",uploads:"uploads"}},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:()=>i});var r=n(2309);class i 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:()=>i});var r=n(2309);class i 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:()=>i});var r=n(2309);class i 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:()=>i});var r=n(2309);class i 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:()=>i});var r=n(2309);class i 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:()=>i});var r=n(2309);class i 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),i=n(1060);const o=()=>(0,r.w1)(i.E)},3576:(e,t,n)=>{"use strict";n.d(t,{g:()=>i});var r=n(8536);const i=({hasResponded:e,previousVisibility:t,requestedVisibility:n,config:i})=>{const{defaults:o,layoutMode:s,hideOnNoUserResponse:a}=i,{visible:c}=o||{};if("app"===s&&!t)return r.I.open;if("window"===s&&a&&n!==r.I.open)return e?n||t||r.I.open:r.I.hidden;if("inline"===s&&e&&!n)return t||r.I.open;const l=r.I.minimized;return n||t||c||l}},8544:(e,t,n)=>{"use strict";n(7548)},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)}}),{})}}},2080:(e,t,n)=>{"use strict";n.d(t,{Y:()=>c}),n(9150);var r=n(8056),i=(n(1800),n(7456)),o=(n(8544),n(1676)),s=(n(7800),n(7888),n(6204)),a=n(6244);n(784);const c=e=>{const{payload:t}=e,[n,c]=(0,r.useState)(!1),{sendAction:l,addMessageBubble:u,addDivider:d}=(0,s.wv)(),{activeServiceSessionId:p}=(0,s.Ip)(),h=(0,s.SS)(),{body:f}=(0,i.kx)(e),{service:y}=t,v=(0,r.useMemo)((()=>({...e,payload:{...e.payload,body:e.payload.body?.prompt,translatedBody:e.payload.translatedBody&&{...e.payload.translatedBody,data:e.payload.translatedBody.prompt}}})),[e]),m=f.chooseAgain&&p===y.serviceSessionId&&t.id!==h;return(0,r.useEffect)((()=>{c(t.id===h)}),[t,h]),{body:f,subEvent:v,showOptions:n,chooseAgain:m,onChoiceClickHandler:e=>{const n=(0,o.s)();m&&d("new_topic",n),u(e.text,n),l({type:a.w$.pickChoice,originMessage:t.id,choice:{id:e.id,text:e.text,chooseAgain:m},transactionId:n}),c(!1)},onChooseAgainClickHandler:()=>{c((e=>!e))}}}},3792:(e,t,n)=>{"use strict";n(5352),n(1800),n(8544),n(6204),n(784)},7800:(e,t,n)=>{"use strict";n(7456),n(8544),n(2796),n(3792),n(784)},9500:(e,t,n)=>{"use strict";(0,n(9150).createContext)(null)},9056:(e,t,n)=>{"use strict";(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,{l:()=>r}),n(5352);const r=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,{kX:()=>o});var r=n(8056),i=(n(3332),n(8760));n(6736);const o=e=>(0,r.useCallback)((()=>{var t;t=e,requestAnimationFrame((async()=>{await((e=0)=>new Promise((t=>{setTimeout(t,e)})))(180);const e="string"==typeof t?document.getElementById(t):t;(0,i.O8)(e)}))}),[e])},8384:(e,t,n)=>{"use strict";n.d(t,{C:()=>s});var r=n(8056),i=n(6612),o=n(6244);const s=()=>{const e=(0,r.useContext)(i.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:()=>o.kX,SS:()=>c.SS,wv:()=>h.c,ue:()=>y,sD:()=>f.c,li:()=>s.l,Yj:()=>p,Ip:()=>c.Ip});var r=n(8056),i=n(9816),o=n(3480),s=n(2796),a=n(3332),c=(n(9056),n(6736));n(8384);var l=n(9320),u=n(2328),d=n(1800);const p=()=>{const{t:e}=(0,d.g)(),{options:t}=(0,c.gf)(),{panelActive:n,optionActive:i,userSelectedOptions:o,features:s}=t,{extraMenuItem:p,sendTranscript:h}=s,f={extraMenuItem:p,sendTranscript:h},y=t=>"extraMenuItem"===t?"Extra menu item":e(`options.${t}.menuTitle`),v=Object.keys(f).filter((e=>f[e])).map((e=>({name:e,title:y(e),available:f[e].enabled}))),m=p||h,g=(0,u.OY)(),{get:b,set:_}=(0,l.cb)();return{allowOptionSelection:m,userSelectedOptions:o,features:s,menuOptions:v,initUserSelectedOptions:(0,r.useCallback)((()=>{const e=b("options")||{};g((0,a.IF)(e))}),[b,g]),setUserSelectedOptions:(0,r.useCallback)((e=>{g((0,a.IF)(e)),_("options",e)}),[_,g]),setUserSelectedOption:(0,r.useCallback)(((e,t)=>{const n=b("options")||{};_("options",{...n,[e]:t}),g((0,a.eK)({option:e,value:t}))}),[g,b,_]),showOption:e=>{g((0,a.ER)(e))},hideOption:()=>{g((0,a.Ur)())},panelActive:n,optionActive:i}};n(7268),n(3460);var h=n(8416),f=n(952);n(152),n(1100);const y=(e,t)=>{const n=(0,i.c)();(0,r.useEffect)((()=>{if(n.channel){const{channel:r}=n;r.onMessage=(n,r)=>(t&&!t({type:n,payload:r})||e({type:n,payload:r}),r)}}),[e,t,n])}},7268:(e,t,n)=>{"use strict";n(8056),n(9500)},8416:(e,t,n)=>{"use strict";n.d(t,{c:()=>g});var r=n(8056),i=n(2328),o=n(7548),s=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),y=n(6244),v=n(9320),m=n(6736);const g=()=>{const e=(0,v.Ml)(),t=(0,i.OY)(),n=(0,r.useContext)(f.E),g=(0,a.w)(),b=(0,v.aJ)(),{visible:_,setVisibility:C}=(0,p.uu)(),w=(0,m.I7)(),E=(0,r.useCallback)(((...e)=>{n.emit(...e)}),[n]),S=(0,r.useCallback)((()=>{E("ui.beforeStart",{visibility:_,hasConversation:b(),hasResponded:g,unreadMessageCount:w}),e.send("start"),E("ui.start",{visibility:_,hasConversation:b(),hasResponded:g,unreadMessageCount:w})}),[e,E,b,g,w,_]),O=(0,r.useCallback)((async()=>{t(s.C())}),[t]),T=(0,r.useCallback)((e=>({type:e,id:(0,h.s)(),transactionId:(0,h.s)(),participant:o.kr,fromClient:!0,occurredAt:1e3*Date.now(),meta:{}})),[]),j=(0,r.useCallback)((e=>({...T("text"),body:{text:e}})),[T]),k=(0,r.useCallback)((({body:n,config:r={}})=>{if(""===n.trim())return;const i={...j(n),...r};e.send("message",i),E("message",i),t((0,u.Ux)({type:"message",payload:{...i,optimisticallyInjected:!0}}))}),[e,t,E,j]),I=(0,r.useCallback)(((e,n=(0,h.s)())=>{t((0,u.Ux)({type:"message",payload:{...j(e),transactionId:n}}))}),[t,j]),x=(0,r.useCallback)(((e,n,r,i,s,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:i,filename:s,filesize:a,url:c}}}))}),[t]),A=(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]),R=(0,r.useCallback)((t=>{if(!t)return;e.send("action",t);const{type:n}=t;n!==y.w$.typing&&n!==y.w$.read&&E(`action.${n}`,t)}),[e,E]),P=(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)),C(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,C]),start:S,sendMessage:k,sendAction:R,sendContext:P,reset:O,emitEvent:E,addMessageBubble:I,addUploadBubble:x,addDivider:A,apiConnected:e.connected,apiConfigReady:e.configReady}}},952:(e,t,n)=>{"use strict";n.d(t,{c:()=>f});var r=n(8056),i=n(2328),o=n(7548),s=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,i.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:y,sendAction:v}=(0,h.c)(),{t:m}=(0,s.g)(),{sendAssertive:g,sendPolite:b}=(0,d.C)(),_=(0,r.useCallback)((e=>{const{isOpen:t}=f.current;t&&g(e)}),[g]),C=(0,r.useCallback)((e=>{const{isOpen:t}=f.current;t&&b(e)}),[b]),w=(0,r.useCallback)((t=>{const n=(0,l.Ub)(t),r=(0,l.s3)(n);e((0,a.gB)({delaySeconds:n,delayTime:r})),y("idleTimer.start"),_(`${m("idleDetachWarning.countdownTitle")} ${m("idleDetachWarning.countdownText")} ${m("idleDetachWarning.countdownTimer",r)}`)}),[e,y,_,m]),E=(0,r.useCallback)(((t,n)=>{const{hasCountdown:r,wasStopped:i}=f.current;r&&(t||(n||v({type:u.w$.detachService}),_(m("idleDetachWarning.notifyTransferText"))),i||y("idleTimer.stop"),e((0,a.aD)()))}),[e,v,y,_,m]),S=(0,r.useCallback)((()=>{const{remaining:t}=f.current;if(t<=0)return;const n=t-1;n%o.sB==0&&_(`${m("idleDetachWarning.countdownText")} ${m("idleDetachWarning.countdownTimer",(0,l.s3)(n))}`),e((0,a.I1)())}),[e,_,m]),O=(0,r.useCallback)((()=>{const{isActive:t,remaining:n}=f.current;t&&(e((0,a.e_)()),n&&(y("idleTimer.stop"),C(m("idleDetachWarning.srCountDownStoppedText"))))}),[e,y,C,m]);return{...t,initCountdown:w,endCountdown:E,decrementCountdown:S,stopCountdown:O}}},152:(e,t,n)=>{"use strict";n(1800),n(3332),n(6244),n(8384),n(6736),n(8416)},1100:(e,t,n)=>{"use strict";n.d(t,{k3:()=>o});var r=n(8056),i=n(1676);const o=()=>{const[e]=(0,r.useState)((()=>(0,i.s)()));return e}},8760:(e,t,n)=>{"use strict";n.d(t,{O8:()=>s,Qv:()=>i,Ub:()=>r,gl:()=>a,s3:()=>o});const r=e=>Math.ceil(e/1e3),i=e=>Math.ceil(e/1e3),o=e=>{const t=Math.floor(e/60);return{minutes:t,seconds:e-60*t}},s=e=>{e&&e.focus()},a=(e,t)=>t.reduce(((t,n)=>(n in e&&(t[n]=e[n]),t)),{})},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:()=>w,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:()=>V,cloneElement:()=>J,createContext:()=>r.createContext,createElement:()=>r.createElement,createFactory:()=>K,createPortal:()=>T,createRef:()=>r.createRef,default:()=>ce,findDOMNode:()=>X,flushSync:()=>Z,forwardRef:()=>p,hydrate:()=>M,isElement:()=>oe,isFragment:()=>G,isValidElement:()=>q,lazy:()=>C,memo:()=>l,render:()=>P,startTransition:()=>te,unmountComponentAtNode:()=>Y,unstable_batchedUpdates:()=>Q,useDeferredValue:()=>ne,useInsertionEffect:()=>ie,useSyncExternalStore:()=>se,useTransition:()=>re,version:()=>W});var r=n(9150),i=n(8056),o={};for(const e in i)["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]=()=>i[e]);function s(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 i(t){return this.shouldComponentUpdate=n,(0,r.createElement)(e,t)}return i.displayName="Memo("+(e.displayName||e.name)+")",i.prototype.isReactComponent=!0,i.__f=!0,i}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=s({},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},y=r.options.__e;r.options.__e=function(e,t,n,r){if(e.then)for(var i,o=t;o=o.__;)if((i=o.__c)&&i.__c)return null==t.__e&&(t.__e=n.__e,t.__k=n.__k),i.__c(e,t);y(e,t,n,r)};var v=r.options.unmount;function m(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=s({},e)).__c&&(e.__c.__P===n&&(e.__c.__P=t),e.__c=null),e.__k=e.__k&&e.__k.map((function(e){return m(e,t,n)}))),e}function g(e,t,n){return e&&n&&(e.__v=null,e.__k=e.__k&&e.__k.map((function(e){return g(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 _(e){var t=e.__.__c;return t&&t.__a&&t.__a(e)}function C(e){var t,n,i;function o(o){if(t||(t=e()).then((function(e){n=e.default||e}),(function(e){i=e})),i)throw i;if(!n)throw t;return(0,r.createElement)(n,o)}return o.displayName="Lazy",o.__f=!0,o}function w(){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 i=_(r.__v),o=!1,s=function(){o||(o=!0,n.__R=null,i?i(a):a())};n.__R=s;var a=function(){if(! --r.__u){if(r.state.__a){var e=r.state.__a;r.__v.__k[0]=g(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(s,s)},b.prototype.componentWillUnmount=function(){this.t=[]},b.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var n=document.createElement("div"),i=this.__v.__k[0].__c;this.__v.__k[0]=m(this.__b,n,i.__O=i.__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 E=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 S(e){return this.getChildContext=function(){return e.context},e.children}function O(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)(S,{context:t.context},e.__v),t.l)}function T(e,t){var n=(0,r.createElement)(O,{__v:e,i:t});return n.containerInfo=t,n}(w.prototype=new r.Component).__a=function(e){var t=this,n=_(t.__v),r=t.o.get(e);return r[0]++,function(i){var o=function(){t.props.revealOrder?(r.push(i),E(t,e,r)):i()};n?n(o):o()}},w.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},w.prototype.componentDidUpdate=w.prototype.componentDidMount=function(){var e=this;this.o.forEach((function(t,n){E(e,n,t)}))};var j="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]/,I=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,x=/[A-Z0-9]/g,A="undefined"!=typeof document,R=function(e){return("undefined"!=typeof Symbol&&"symbol"==typeof Symbol()?/fil|che|rad/:/fil|che|ra/).test(e)};function P(e,t,n){return null==t.__k&&(t.textContent=""),(0,r.render)(e,t),"function"==typeof n&&n(),e?e.__c:null}function M(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 L=r.options.event;function N(){}function D(){return this.cancelBubble}function U(){return this.defaultPrevented}r.options.event=function(e){return L&&(e=L(e)),e.persist=N,e.isPropagationStopped=D,e.isDefaultPrevented=U,e.nativeEvent=e};var $,F={enumerable:!1,configurable:!0,get:function(){return this.class}},B=r.options.vnode;r.options.vnode=function(e){"string"==typeof e.type&&function(e){var t=e.props,n=e.type,i={};for(var o in t){var s=t[o];if(!("value"===o&&"defaultValue"in t&&null==s||A&&"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===s?s="":"ondoubleclick"===a?o="ondblclick":"onchange"!==a||"input"!==n&&"textarea"!==n||R(t.type)?"onfocus"===a?o="onfocusin":"onblur"===a?o="onfocusout":I.test(o)?o=a:-1===n.indexOf("-")&&k.test(o)?o=o.replace(x,"-$&").toLowerCase():null===s&&(s=void 0):a=o="oninput","oninput"===a&&i[o=a]&&(o="oninputCapture"),i[o]=s}}"select"==n&&i.multiple&&Array.isArray(i.value)&&(i.value=(0,r.toChildArray)(t.children).forEach((function(e){e.props.selected=-1!=i.value.indexOf(e.props.value)}))),"select"==n&&null!=i.defaultValue&&(i.value=(0,r.toChildArray)(t.children).forEach((function(e){e.props.selected=i.multiple?-1!=i.defaultValue.indexOf(e.props.value):i.defaultValue==e.props.value}))),t.class&&!t.className?(i.class=t.class,Object.defineProperty(i,"className",F)):(t.className&&!t.class||t.class&&t.className)&&(i.class=i.className=t.className),e.props=i}(e),e.$$typeof=j,B&&B(e)};var H=r.options.__r;r.options.__r=function(e){H&&H(e),$=e.__c};var z=r.options.diffed;r.options.diffed=function(e){z&&z(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),$=null};var V={ReactCurrentDispatcher:{current:{readContext:function(e){return $.__n[e.__c].props.value}}}},W="17.0.2";function K(e){return r.createElement.bind(null,e)}function q(e){return!!e&&e.$$typeof===j}function G(e){return q(e)&&e.type===r.Fragment}function J(e){return q(e)?r.cloneElement.apply(null,arguments):e}function Y(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 ie=i.useLayoutEffect,oe=q;function se(e,t){var n=t(),r=(0,i.useState)({h:{__:n,v:t}}),o=r[0].h,s=r[1];return(0,i.useLayoutEffect)((function(){o.__=n,o.v=t,ae(o)&&s({h:o})}),[e,n,t]),(0,i.useEffect)((function(){return ae(o)&&s({h:o}),e((function(){ae(o)&&s({h:o})}))}),[e]),n}function ae(e){var t,n,r=e.v,i=e.__;try{var o=r();return!((t=i)===(n=o)&&(0!==t||1/t==1/n)||t!=t&&n!=n)}catch(e){return!0}}var ce={useState:i.useState,useId:i.useId,useReducer:i.useReducer,useEffect:i.useEffect,useLayoutEffect:i.useLayoutEffect,useInsertionEffect:ie,useTransition:re,useDeferredValue:ne,useSyncExternalStore:se,startTransition:te,useRef:i.useRef,useImperativeHandle:i.useImperativeHandle,useMemo:i.useMemo,useCallback:i.useCallback,useContext:i.useContext,useDebugValue:i.useDebugValue,version:"17.0.2",Children:f,render:P,hydrate:M,unmountComponentAtNode:Y,createPortal:T,createElement:r.createElement,createContext:r.createContext,createFactory:K,cloneElement:J,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:w,lazy:C,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:V}},7888:(e,t,n)=>{"use strict";n(784),n(8544)},7556:(e,t,n)=>{"use strict";var r=n(144),i="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,s=r.useRef,a=r.useEffect,c=r.useMemo,l=r.useDebugValue;t.useSyncExternalStoreWithSelector=function(e,t,n,r,u){var d=s(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 s=t}return s=e}if(t=s,i(o,e))return t;var n=r(e);return void 0!==u&&u(t,n)?t:(o=e,s=n)}var o,s,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,{Uh:()=>Y,aw:()=>ae,is:()=>pe,CF:()=>ne,i0:()=>ee});var r=Symbol.for("immer-nothing"),i=Symbol.for("immer-draftable"),o=Symbol.for("immer-state");function s(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[i]||!!e.constructor?.[i]||v(e)||m(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:m(e)?3:0}function f(e,t){return 2===h(e)?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function y(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 m(e){return e instanceof Set}function g(e){return e.copy_||e.base_}function b(e,t){if(v(e))return new Map(e);if(m(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 i=r[t],o=n[i];!1===o.writable&&(o.writable=!0,o.configurable=!0),(o.get||o.set)&&(n[i]={configurable:!0,writable:!0,enumerable:o.enumerable,value:e[i]})}return Object.create(a(e),n)}function _(e,t=!1){return w(e)||c(e)||!l(e)||(h(e)>1&&(e.set=e.add=e.clear=e.delete=C),Object.freeze(e),t&&p(e,((e,t)=>_(t,!0)))),e}function C(){s(2)}function w(e){return Object.isFrozen(e)}var E,S={};function O(e){const t=S[e];return t||s(0),t}function T(){return E}function j(e,t){t&&(O("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function k(e){I(e),e.drafts_.forEach(A),e.drafts_=null}function I(e){e===E&&(E=e.parent_)}function x(e){return E={drafts_:[],parent_:E,immer_:e,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function A(e){const t=e[o];0===t.type_||1===t.type_?t.revoke_():t.revoked_=!0}function R(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];return void 0!==e&&e!==n?(n[o].modified_&&(k(t),s(4)),l(e)&&(e=P(t,e),t.parent_||L(t,e)),t.patches_&&O("Patches").generateReplacementPatches_(n[o].base_,e,t.patches_,t.inversePatches_)):e=P(t,n,[]),k(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==r?e:void 0}function P(e,t,n){if(w(t))return t;const r=t[o];if(!r)return p(t,((i,o)=>M(e,r,t,i,o,n))),t;if(r.scope_!==e)return t;if(!r.modified_)return L(e,r.base_,!0),r.base_;if(!r.finalized_){r.finalized_=!0,r.scope_.unfinalizedDrafts_--;const t=r.copy_;let i=t,o=!1;3===r.type_&&(i=new Set(t),t.clear(),o=!0),p(i,((i,s)=>M(e,r,t,i,s,n,o))),L(e,t,!1),n&&e.patches_&&O("Patches").generatePatches_(r,n,e.patches_,e.inversePatches_)}return r.copy_}function M(e,t,n,r,i,o,s){if(c(i)){const s=P(e,i,o&&t&&3!==t.type_&&!f(t.assigned_,r)?o.concat(r):void 0);if(y(n,r,s),!c(s))return;e.canAutoFreeze_=!1}else s&&n.add(i);if(l(i)&&!w(i)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;P(e,i),t&&t.scope_.parent_||L(e,i)}}function L(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&_(t,n)}var N={get(e,t){if(t===o)return e;const n=g(e);if(!f(n,t))return function(e,t,n){const r=$(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===U(e.base_,t)?(B(e),e.copy_[t]=H(r,e)):r},has:(e,t)=>t in g(e),ownKeys:e=>Reflect.ownKeys(g(e)),set(e,t,n){const r=$(g(e),t);if(r?.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const r=U(g(e),t),a=r?.[o];if(a&&a.base_===n)return e.copy_[t]=n,e.assigned_[t]=!1,!0;if(((i=n)===(s=r)?0!==i||1/i==1/s:i!=i&&s!=s)&&(void 0!==n||f(e.base_,t)))return!0;B(e),F(e)}var i,s;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!==U(e.base_,t)||t in e.base_?(e.assigned_[t]=!1,B(e),F(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0),getOwnPropertyDescriptor(e,t){const n=g(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r?{writable:!0,configurable:1!==e.type_||"length"!==t,enumerable:r.enumerable,value:n[t]}:r},defineProperty(){s(11)},getPrototypeOf:e=>a(e.base_),setPrototypeOf(){s(12)}},D={};function U(e,t){const n=e[o];return(n?g(n):e)[t]}function $(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 F(e){e.modified_||(e.modified_=!0,e.parent_&&F(e.parent_))}function B(e){e.copy_||(e.copy_=b(e.base_,e.scope_.immer_.useStrictShallowCopy_))}function H(e,t){const n=v(e)?O("MapSet").proxyMap_(e,t):m(e)?O("MapSet").proxySet_(e,t):function(e,t){const n=Array.isArray(e),r={type_:n?1:0,scope_:t?t.scope_:T(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let i=r,o=N;n&&(i=[r],o=D);const{revoke:s,proxy:a}=Proxy.revocable(i,o);return r.draft_=a,r.revoke_=s,a}(e,t);return(t?t.scope_:T()).drafts_.push(n),n}function z(e){return c(e)||s(10),V(e)}function V(e){if(!l(e)||w(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)=>{y(n,e,V(t))})),t&&(t.finalized_=!1),n}p(N,((e,t)=>{D[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}})),D.deleteProperty=function(e,t){return D.set.call(this,e,t,void 0)},D.set=function(e,t,n){return N.set.call(this,e[0],t,n,e[0])};var W=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,...i){return r.produce(e,(e=>t.call(this,e,...i)))}}let i;if("function"!=typeof t&&s(6),void 0!==n&&"function"!=typeof n&&s(7),l(e)){const r=x(this),o=H(e,void 0);let s=!0;try{i=t(o),s=!1}finally{s?k(r):I(r)}return j(r,n),R(i,r)}if(!e||"object"!=typeof e){if(i=t(e),void 0===i&&(i=e),i===r&&(i=void 0),this.autoFreeze_&&_(i,!0),n){const t=[],r=[];O("Patches").generateReplacementPatches_(e,i,t,r),n(t,r)}return i}s(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)||s(8),c(e)&&(e=z(e));const t=x(this),n=H(e,void 0);return n[o].isManual_=!0,I(t),n}finishDraft(e,t){const n=e&&e[o];n&&n.isManual_||s(9);const{scope_:r}=n;return j(r,t),R(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=O("Patches").applyPatches_;return c(e)?r(e,t):this.produce(e,(e=>r(e,t)))}},K=W.produce;W.produceWithPatches.bind(W),W.setAutoFreeze.bind(W),W.setUseStrictShallowCopy.bind(W),W.applyPatches.bind(W),W.createDraft.bind(W),W.finishDraft.bind(W);var q=n(8888),G=n(8608),J=(((...e)=>{const t=(0,q.qu)(...e),n=Object.assign(((...e)=>{const n=t(...e),r=(e,...t)=>n(c(e)?z(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__,"undefined"!=typeof window&&window.__REDUX_DEVTOOLS_EXTENSION__&&window.__REDUX_DEVTOOLS_EXTENSION__,e=>e&&"function"==typeof e.match);function Y(e,t){function n(...n){if(t){let r=t(...n);if(!r)throw new Error(_e(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}function X(e){return l(e)?K(e,(()=>{})):e}function Q(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(_e(10));const r=n.insert(t,e);return e.set(t,r),r}Symbol.species;function Z(e){const t={},n=[];let r;const i={addCase(e,n){const r="string"==typeof e?e:e.type;if(!r)throw new Error(_e(28));if(r in t)throw new Error(_e(29));return t[r]=n,i},addMatcher:(e,t)=>(n.push({matcher:e,reducer:t}),i),addDefaultCase:e=>(r=e,i)};return e(i),[t,n,r]}"undefined"!=typeof window&&window.requestAnimationFrame&&window.requestAnimationFrame;var ee=(e=21)=>{let t="",n=e;for(;n--;)t+="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW"[64*Math.random()|0];return t},te=(e,t)=>J(e)?e.match(t):e(t);function ne(...e){return t=>e.some((e=>te(e,t)))}var re=["name","message","stack","code"],ie=class{constructor(e,t){this.payload=e,this.meta=t}_type},oe=class{constructor(e,t){this.payload=e,this.meta=t}_type},se=e=>{if("object"==typeof e&&null!==e){const t={};for(const n of re)"string"==typeof e[n]&&(t[n]=e[n]);return t}return{message:String(e)}},ae=(()=>{function e(e,t,n){const r=Y(e+"/fulfilled",((e,t,n,r)=>({payload:e,meta:{...r||{},arg:n,requestId:t,requestStatus:"fulfilled"}}))),i=Y(e+"/pending",((e,t,n)=>({payload:void 0,meta:{...n||{},arg:t,requestId:e,requestStatus:"pending"}}))),o=Y(e+"/rejected",((e,t,r,i,o)=>({payload:i,error:(n&&n.serializeError||se)(e||"Rejected"),meta:{...o||{},arg:r,requestId:t,rejectedWithValue:!!i,requestStatus:"rejected",aborted:"AbortError"===e?.name,condition:"ConditionError"===e?.name}})));return Object.assign((function(e){return(s,a,c)=>{const l=n?.idGenerator?n.idGenerator(e):ee(),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!==(y=o)&&"object"==typeof y&&"function"==typeof y.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)}));s(i(l,e,n?.getPendingMeta?.({requestId:l,arg:e},{getState:a,extra:c}))),f=await Promise.race([v,Promise.resolve(t(e,{dispatch:s,getState:a,extra:c,requestId:l,signal:u.signal,abort:h,rejectWithValue:(e,t)=>new ie(e,t),fulfillWithValue:(e,t)=>new oe(e,t)})).then((t=>{if(t instanceof ie)throw t;return t instanceof oe?r(t.payload,l,e,t.meta):r(t,l,e)}))])}catch(t){f=t instanceof ie?o(null,l,e,t.payload,t.meta):o(t,l,e)}finally{d&&u.signal.removeEventListener("abort",d)}var y;return n&&!n.dispatchConditionRejection&&o.match(f)&&f.meta.condition||s(f),f}();return Object.assign(f,{abort:h,requestId:l,arg:e,unwrap:()=>f.then(ce)})}}),{pending:i,rejected:o,fulfilled:r,settled:ne(o,r),typePrefix:e})}return e.withTypes=()=>e,e})();function ce(e){if(e.meta&&e.meta.rejectedWithValue)throw e.payload;if(e.error)throw e.error;return e.payload}var le=Symbol.for("rtk-slice-createasyncthunk");function ue(e,t){return`${e}/${t}`}function de(e,t,n,r){function i(i,...o){let s=t(i);return void 0===s&&r&&(s=n()),e(s,...o)}return i.unwrapped=e,i}var pe=function({creators:e}={}){const t=e?.asyncThunk?.[le];return function(e){const{name:n,reducerPath:r=n}=e;if(!n)throw new Error(_e(11));const i=("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(i),s={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},a={addCase(e,t){const n="string"==typeof e?e:e.type;if(!n)throw new Error(_e(12));if(n in s.sliceCaseReducersByType)throw new Error(_e(13));return s.sliceCaseReducersByType[n]=t,a},addMatcher:(e,t)=>(s.sliceMatchers.push({matcher:e,reducer:t}),a),exposeAction:(e,t)=>(s.actionCreators[e]=t,a),exposeCaseReducer:(e,t)=>(s.sliceCaseReducersByName[e]=t,a)};function u(){const[t={},n=[],r]="function"==typeof e.extraReducers?Z(e.extraReducers):[e.extraReducers],i={...t,...s.sliceCaseReducersByType};return function(e,t){let o,[a,u,d]=Z((e=>{for(let t in i)e.addCase(t,i[t]);for(let t of s.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=()=>X(e());else{const t=X(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 K(e,(e=>n(e,t)));{const r=n(e,t);if(void 0===r){if(null===e)return e;throw new Error(_e(9))}return r}}return e}),e)}return p.getInitialState=o,p}(e.initialState)}o.forEach((r=>{const o=i[r],s={reducerName:r,type:ue(n,r),createNotation:"function"==typeof e.reducers};!function(e){return"asyncThunk"===e._reducerDefinitionType}(o)?function({type:e,reducerName:t,createNotation:n},r,i){let o,s;if("reducer"in r){if(n&&!function(e){return"reducerWithPrepare"===e._reducerDefinitionType}(r))throw new Error(_e(17));o=r.reducer,s=r.prepare}else o=r;i.addCase(e,o).exposeCaseReducer(t,o).exposeAction(t,s?Y(e,s):Y(e))}(s,o,a):function({type:e,reducerName:t},n,r,i){if(!i)throw new Error(_e(18));const{payloadCreator:o,fulfilled:s,pending:a,rejected:c,settled:l,options:u}=n,d=i(e,o,u);r.exposeAction(t,d),s&&r.addCase(d.fulfilled,s),a&&r.addCase(d.pending,a),c&&r.addCase(d.rejected,c),l&&r.addMatcher(d.settled,l),r.exposeCaseReducer(t,{fulfilled:s||he,pending:a||he,rejected:c||he,settled:l||he})}(s,o,a,t)}));const d=e=>e,p=new Map;let h;function f(e,t){return h||(h=u()),h(e,t)}function y(){return h||(h=u()),h.getInitialState()}function v(t,n=!1){function r(e){let r=e[t];return void 0===r&&n&&(r=y()),r}function i(t=d){const r=Q(p,n,{insert:()=>new WeakMap});return Q(r,t,{insert:()=>{const r={};for(const[i,o]of Object.entries(e.selectors??{}))r[i]=de(o,t,y,n);return r}})}return{reducerPath:t,getSelectors:i,get selectors(){return i(r)},selectSlice:r}}const m={name:n,reducer:f,actions:s.actionCreators,caseReducers:s.sliceCaseReducersByName,getInitialState:y,...v(r),injectInto(e,{reducerPath:t,...n}={}){const i=t??r;return e.inject({reducerPath:i,reducer:f},n),{...m,...v(i,!0)}}};return m}}();function he(){}var{assign:fe}=Object,ye="listenerMiddleware",ve=e=>{let{type:t,actionCreator:n,matcher:r,predicate:i,effect:o}=e;if(t)i=Y(t).match;else if(n)t=n.type,i=n.match;else if(r)i=r;else if(!i)throw new Error(_e(21));return((e,t)=>{if("function"!=typeof e)throw new Error(_e(32))})(o),{predicate:i,type:t,effect:o}},me=Object.assign((e=>{const{type:t,predicate:n,effect:r}=ve(e);return{id:ee(),effect:r,type:t,predicate:n,pending:new Set,unsubscribe:()=>{throw new Error(_e(22))}}}),{withTypes:()=>me}),ge=Object.assign(Y(`${ye}/add`),{withTypes:()=>ge}),be=(Y(`${ye}/removeAll`),Object.assign(Y(`${ye}/remove`),{withTypes:()=>be}));function _e(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,{OY:()=>_,w1:()=>y});var r=n(144),i=n(6728),o=r.default,s=Symbol.for("react-redux-context"),a="undefined"!=typeof globalThis?globalThis:{};function c(){if(!o.createContext)return{};const e=a[s]??(a[s]=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:i={}}="function"==typeof n?{equalityFn:n}:n,{store:s,subscription:a,getServerState:c,stabilityCheck:l,identityFunctionCheck:u}=t(),d=(o.useRef(!0),o.useCallback({[e.name]:t=>e(t)}[e.name],[e,l,i.stabilityCheck])),f=p(a.addNestedSub,s.getState,c||s.getState,d,r);return o.useDebugValue(f),f};return Object.assign(n,{withTypes:()=>n}),n}var y=f();function v(e=l){const t=e===l?d:u(e),n=()=>{const{store:e}=t();return e};return Object.assign(n,{withTypes:()=>n}),n}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"),"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 m=v();function g(e=l){const t=e===l?m:v(e),n=()=>t().dispatch;return Object.assign(n,{withTypes:()=>n}),n}var b,_=g();b=i.useSyncExternalStoreWithSelector,p=b,r.useSyncExternalStore},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:()=>c,Jn:()=>a,TL:()=>s});var i=()=>Math.random().toString(36).substring(7).split("").join("."),o={INIT:`@@redux/INIT${i()}`,REPLACE:`@@redux/REPLACE${i()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${i()}`};function s(e){const t=Object.keys(e),n={};for(let r=0;r<t.length;r++){const i=t[r];"function"==typeof e[i]&&(n[i]=e[i])}const i=Object.keys(n);let s;try{!function(e){Object.keys(e).forEach((t=>{const n=e[t];if(void 0===n(void 0,{type:o.INIT}))throw new Error(r(12));if(void 0===n(void 0,{type:o.PROBE_UNKNOWN_ACTION()}))throw new Error(r(13))}))}(n)}catch(e){s=e}return function(e={},t){if(s)throw s;let o=!1;const a={};for(let s=0;s<i.length;s++){const c=i[s],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,o=o||d!==u}return o=o||i.length!==Object.keys(e).length,o?a:e}}function a(...e){return 0===e.length?e=>e:1===e.length?e[0]:e.reduce(((e,t)=>(...n)=>e(t(...n))))}function c(e){return function(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)}(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 i="undefined"!=typeof WeakRef?WeakRef:class{constructor(e){this.value=e}deref(){return this.value}},o=0,s=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===s?d=t.v:(d=e.apply(null,arguments),c++),u.s=s,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 i(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,i=(...e)=>{let t,i=0,o=0,s={},a=e.pop();"object"==typeof a&&(s=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,...s},{memoize:u,memoizeOptions:d=[],argsMemoize:p=c,argsMemoizeOptions:h=[],devModeChecks:f={}}=l,y=r(d),v=r(h),m=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),g=u((function(){return i++,a.apply(null,arguments)}),...y),b=p((function(){o++;const e=function(e,t){const n=[],{length:r}=e;for(let i=0;i<r;i++)n.push(e[i].apply(null,t));return n}(m,arguments);return t=g.apply(null,e),t}),...v);return Object.assign(b,{resultFunc:a,memoizedResultFunc:g,dependencies:m,dependencyRecomputations:()=>o,resetDependencyRecomputations:()=>{o=0},lastResult:()=>t,recomputations:()=>i,resetRecomputations:()=>{i=0},memoize:u,argsMemoize:p})};return Object.assign(i,{withTypes:()=>i}),i}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 i=t[r];if(void 0!==i)return i.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.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 r={};(()=>{"use strict";n.r(r),n.d(r,{useChoicePrompt:()=>i.Y,useEvents:()=>s.kV,useGeneratedId:()=>l.k3,useI18n:()=>e.g,useSeamlyChat:()=>a.c,useSeamlyCommands:()=>c.c,useSeamlyEventStream:()=>o.ue,useSeamlyIdleDetachCountdown:()=>o.sD,useSeamlyMessageContainerClassNames:()=>o.li,useSeamlyOptions:()=>o.Yj,useTranslatedEventData:()=>t.kx,useTranslations:()=>t.A1,useTranslationsContainer:()=>t.im});var e=n(1800),t=n(7456),i=n(2080),o=n(6204),s=n(6736),a=n(3460),c=n(8416),l=n(1100)})(),module.exports=r})();
|
|
3
3
|
//# sourceMappingURL=~/hooks.min.js.map
|