@seamly/web-ui 21.0.7 → 21.0.9

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.
Files changed (44) hide show
  1. package/build/dist/lib/components.js +224 -231
  2. package/build/dist/lib/components.min.js +1 -1
  3. package/build/dist/lib/hooks.js +116 -16
  4. package/build/dist/lib/hooks.min.js +1 -1
  5. package/build/dist/lib/index.debug.js +50 -39
  6. package/build/dist/lib/index.debug.min.js +1 -1
  7. package/build/dist/lib/index.debug.min.js.LICENSE.txt +5 -1
  8. package/build/dist/lib/index.js +208 -220
  9. package/build/dist/lib/index.min.js +1 -1
  10. package/build/dist/lib/standalone.js +215 -251
  11. package/build/dist/lib/standalone.min.js +1 -1
  12. package/build/dist/lib/style-guide.js +194 -191
  13. package/build/dist/lib/style-guide.min.js +1 -1
  14. package/build/dist/lib/utils.js +192 -189
  15. package/build/dist/lib/utils.min.js +1 -1
  16. package/package.json +1 -1
  17. package/src/javascripts/domains/forms/provider.tsx +1 -1
  18. package/src/javascripts/domains/i18n/slice.ts +2 -0
  19. package/src/javascripts/domains/interrupt/hooks.ts +15 -7
  20. package/src/javascripts/domains/interrupt/middleware.ts +7 -14
  21. package/src/javascripts/domains/interrupt/selectors.ts +4 -0
  22. package/src/javascripts/domains/interrupt/slice.ts +2 -2
  23. package/src/javascripts/domains/translations/components/translation-status.tsx +4 -3
  24. package/src/javascripts/domains/translations/slice.ts +2 -0
  25. package/src/javascripts/ui/components/app-options/index.js +4 -3
  26. package/src/javascripts/ui/components/core/seamly-event-subscriber.ts +9 -13
  27. package/src/javascripts/ui/components/core/seamly-instance-functions-loader.js +5 -5
  28. package/src/javascripts/ui/components/entry/deprecated-toggle-button.js +4 -3
  29. package/src/javascripts/ui/components/faq/faq.js +5 -4
  30. package/src/javascripts/ui/components/layout/agent-info.js +4 -3
  31. package/src/javascripts/ui/components/layout/chat-frame.js +7 -8
  32. package/src/javascripts/ui/components/layout/deprecated-chat-frame.js +7 -8
  33. package/src/javascripts/ui/components/layout/interrupt.js +6 -15
  34. package/src/javascripts/ui/components/layout/pre-chat-messages.js +4 -3
  35. package/src/javascripts/ui/components/suggestions/index.js +5 -4
  36. package/src/javascripts/ui/components/translation-chat-status/index.tsx +4 -3
  37. package/src/javascripts/ui/components/view/app-view.js +1 -2
  38. package/src/javascripts/ui/components/view/deprecated-view.js +1 -2
  39. package/src/javascripts/ui/components/view/inline-view.js +1 -11
  40. package/src/javascripts/ui/components/view/window-view/index.js +1 -9
  41. package/src/javascripts/ui/components/view/window-view/window-open-button.js +4 -3
  42. package/src/javascripts/ui/hooks/{use-seamly-chat.js → use-seamly-chat.ts} +5 -1
  43. package/src/javascripts/ui/hooks/use-session-expired-command.ts +17 -0
  44. package/src/.DS_Store +0 -0
@@ -1,2 +1,2 @@
1
1
  /*! For license information please see utils.min.js.LICENSE.txt */
2
- (()=>{var e={574:e=>{"use strict";function t(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 n(){this._defaults=[]}for(var r=0,o=["use","on","once","set","query","type","accept","auth","withCredentials","sortQuery","retry","ok","redirects","timeout","buffer","serialize","parse","ca","key","pfx","cert","disableTLSCerts"];r<o.length;r++){const e=o[r];n.prototype[e]=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return this._defaults.push({fn:e,args:n}),this}}n.prototype._setDefaults=function(e){var n,r=function(e,n){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,n){if(e){if("string"==typeof e)return t(e,n);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?t(e,n):void 0}}(e))||n&&e&&"number"==typeof e.length){r&&(e=r);var o=0,i=function(){};return{s:i,n:function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,s=!0,c=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return s=e.done,e},e:function(e){c=!0,a=e},f:function(){try{s||null==r.return||r.return()}finally{if(c)throw a}}}}(this._defaults);try{for(r.s();!(n=r.n()).done;){const t=n.value;e[t.fn](...t.args)}}catch(e){r.e(e)}finally{r.f()}},e.exports=n},766:(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}let o;"undefined"!=typeof window?o=window:"undefined"==typeof self?(console.warn("Using browser-only version of superagent in non-browser environment"),o=void 0):o=self;const i=n(767),a=n(445),s=n(129),c=n(842),l=n(244),u=l.isObject,p=l.mixin,d=l.hasOwn,f=n(253),h=n(574);function y(){}e.exports=function(e,n){return"function"==typeof n?new t.Request("GET",e).end(n):1===arguments.length?new t.Request("GET",e):new t.Request(e,n)};const m=t=e.exports;t.Request=x,m.getXHR=()=>{if(o.XMLHttpRequest)return new o.XMLHttpRequest;throw new Error("Browser-only version of superagent could not find XHR")};const b="".trim?e=>e.trim():e=>e.replace(/(^\s*|\s*$)/g,"");function v(e){if(!u(e))return e;const t=[];for(const n in e)d(e,n)&&g(t,n,e[n]);return t.join("&")}function g(e,t,n){if(void 0!==n)if(null!==n)if(Array.isArray(n)){var o,i=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=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}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var o=0,i=function(){};return{s:i,n:function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,s=!0,c=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){c=!0,a=e},f:function(){try{s||null==n.return||n.return()}finally{if(c)throw a}}}}(n);try{for(i.s();!(o=i.n()).done;)g(e,t,o.value)}catch(e){i.e(e)}finally{i.f()}}else if(u(n))for(const r in n)d(n,r)&&g(e,`${t}[${r}]`,n[r]);else e.push(encodeURI(t)+"="+encodeURIComponent(n));else e.push(encodeURI(t))}function w(e){const t={},n=e.split("&");let r,o;for(let e=0,i=n.length;e<i;++e)r=n[e],o=r.indexOf("="),-1===o?t[decodeURIComponent(r)]="":t[decodeURIComponent(r.slice(0,o))]=decodeURIComponent(r.slice(o+1));return t}function j(e){return/[/+]json($|[^-\w])/i.test(e)}function O(e){this.req=e,this.xhr=this.req.xhr,this.text="HEAD"!==this.req.method&&(""===this.xhr.responseType||"text"===this.xhr.responseType)||void 0===this.xhr.responseType?this.xhr.responseText:null,this.statusText=this.req.xhr.statusText;let t=this.xhr.status;1223===t&&(t=204),this._setStatusProperties(t),this.headers=function(e){const t=e.split(/\r?\n/),n={};let r,o,i,a;for(let e=0,s=t.length;e<s;++e)o=t[e],r=o.indexOf(":"),-1!==r&&(i=o.slice(0,r).toLowerCase(),a=b(o.slice(r+1)),n[i]=a);return n}(this.xhr.getAllResponseHeaders()),this.header=this.headers,this.header["content-type"]=this.xhr.getResponseHeader("content-type"),this._setHeaderProperties(this.header),null===this.text&&e._responseType?this.body=this.xhr.response:this.body="HEAD"===this.req.method?null:this._parseBody(this.text?this.text:this.xhr.response)}function x(e,t){const n=this;this._query=this._query||[],this.method=e,this.url=t,this.header={},this._header={},this.on("end",(()=>{let e,t=null,r=null;try{r=new O(n)}catch(e){return t=new Error("Parser is unable to parse the response"),t.parse=!0,t.original=e,n.xhr?(t.rawResponse=void 0===n.xhr.responseType?n.xhr.responseText:n.xhr.response,t.status=n.xhr.status?n.xhr.status:null,t.statusCode=t.status):(t.rawResponse=null,t.status=null),n.callback(t)}n.emit("response",r);try{n._isResponseOK(r)||(e=new Error(r.statusText||r.text||"Unsuccessful HTTP response"))}catch(t){e=t}e?(e.original=t,e.response=r,e.status=e.status||r.status,n.callback(e,r)):n.callback(null,r)}))}m.serializeObject=v,m.parseString=w,m.types={html:"text/html",json:"application/json",xml:"text/xml",urlencoded:"application/x-www-form-urlencoded",form:"application/x-www-form-urlencoded","form-data":"application/x-www-form-urlencoded"},m.serialize={"application/x-www-form-urlencoded":s.stringify,"application/json":a},m.parse={"application/x-www-form-urlencoded":w,"application/json":JSON.parse},p(O.prototype,f.prototype),O.prototype._parseBody=function(e){let t=m.parse[this.type];return this.req._parser?this.req._parser(this,e):(!t&&j(this.type)&&(t=m.parse["application/json"]),t&&e&&(e.length>0||e instanceof Object)?t(e):null)},O.prototype.toError=function(){const e=this.req,t=e.method,n=e.url,r=`cannot ${t} ${n} (${this.status})`,o=new Error(r);return o.status=this.status,o.method=t,o.url=n,o},m.Response=O,i(x.prototype),p(x.prototype,c.prototype),x.prototype.type=function(e){return this.set("Content-Type",m.types[e]||e),this},x.prototype.accept=function(e){return this.set("Accept",m.types[e]||e),this},x.prototype.auth=function(e,t,n){1===arguments.length&&(t=""),"object"==typeof t&&null!==t&&(n=t,t=""),n||(n={type:"function"==typeof btoa?"basic":"auto"});const r=n.encoder?n.encoder:e=>{if("function"==typeof btoa)return btoa(e);throw new Error("Cannot use basic auth, btoa is not a function")};return this._auth(e,t,n,r)},x.prototype.query=function(e){return"string"!=typeof e&&(e=v(e)),e&&this._query.push(e),this},x.prototype.attach=function(e,t,n){if(t){if(this._data)throw new Error("superagent can't mix .send() and .attach()");this._getFormData().append(e,t,n||t.name)}return this},x.prototype._getFormData=function(){return this._formData||(this._formData=new o.FormData),this._formData},x.prototype.callback=function(e,t){if(this._shouldRetry(e,t))return this._retry();const n=this._callback;this.clearTimeout(),e&&(this._maxRetries&&(e.retries=this._retries-1),this.emit("error",e)),n(e,t)},x.prototype.crossDomainError=function(){const e=new Error("Request has been terminated\nPossible causes: the network is offline, Origin is not allowed by Access-Control-Allow-Origin, the page is being unloaded, etc.");e.crossDomain=!0,e.status=this.status,e.method=this.method,e.url=this.url,this.callback(e)},x.prototype.agent=function(){return console.warn("This is not supported in browser version of superagent"),this},x.prototype.ca=x.prototype.agent,x.prototype.buffer=x.prototype.ca,x.prototype.write=()=>{throw new Error("Streaming is not supported in browser version of superagent")},x.prototype.pipe=x.prototype.write,x.prototype._isHost=function(e){return e&&"object"==typeof e&&!Array.isArray(e)&&"[object Object]"!==Object.prototype.toString.call(e)},x.prototype.end=function(e){this._endCalled&&console.warn("Warning: .end() was called twice. This is not supported in superagent"),this._endCalled=!0,this._callback=e||y,this._finalizeQueryString(),this._end()},x.prototype._setUploadTimeout=function(){const e=this;this._uploadTimeout&&!this._uploadTimeoutTimer&&(this._uploadTimeoutTimer=setTimeout((()=>{e._timeoutError("Upload timeout of ",e._uploadTimeout,"ETIMEDOUT")}),this._uploadTimeout))},x.prototype._end=function(){if(this._aborted)return this.callback(new Error("The request has been aborted even before .end() was called"));const e=this;this.xhr=m.getXHR();const t=this.xhr;let n=this._formData||this._data;this._setTimeouts(),t.addEventListener("readystatechange",(()=>{const n=t.readyState;if(n>=2&&e._responseTimeoutTimer&&clearTimeout(e._responseTimeoutTimer),4!==n)return;let r;try{r=t.status}catch(e){r=0}if(!r){if(e.timedout||e._aborted)return;return e.crossDomainError()}e.emit("end")}));const r=(t,n)=>{n.total>0&&(n.percent=n.loaded/n.total*100,100===n.percent&&clearTimeout(e._uploadTimeoutTimer)),n.direction=t,e.emit("progress",n)};if(this.hasListeners("progress"))try{t.addEventListener("progress",r.bind(null,"download")),t.upload&&t.upload.addEventListener("progress",r.bind(null,"upload"))}catch(e){}t.upload&&this._setUploadTimeout();try{this.username&&this.password?t.open(this.method,this.url,!0,this.username,this.password):t.open(this.method,this.url,!0)}catch(e){return this.callback(e)}if(this._withCredentials&&(t.withCredentials=!0),!this._formData&&"GET"!==this.method&&"HEAD"!==this.method&&"string"!=typeof n&&!this._isHost(n)){const e=this._header["content-type"];let t=this._serializer||m.serialize[e?e.split(";")[0]:""];!t&&j(e)&&(t=m.serialize["application/json"]),t&&(n=t(n))}for(const e in this.header)null!==this.header[e]&&d(this.header,e)&&t.setRequestHeader(e,this.header[e]);this._responseType&&(t.responseType=this._responseType),this.emit("request",this),t.send(void 0===n?null:n)},m.agent=()=>new h;for(var S=0,_=["GET","POST","OPTIONS","PATCH","PUT","DELETE"];S<_.length;S++){const e=_[S];h.prototype[e.toLowerCase()]=function(t,n){const r=new m.Request(e,t);return this._setDefaults(r),n&&r.end(n),r}}function E(e,t,n){const r=m("DELETE",e);return"function"==typeof t&&(n=t,t=null),t&&r.send(t),n&&r.end(n),r}h.prototype.del=h.prototype.delete,m.get=(e,t,n)=>{const r=m("GET",e);return"function"==typeof t&&(n=t,t=null),t&&r.query(t),n&&r.end(n),r},m.head=(e,t,n)=>{const r=m("HEAD",e);return"function"==typeof t&&(n=t,t=null),t&&r.query(t),n&&r.end(n),r},m.options=(e,t,n)=>{const r=m("OPTIONS",e);return"function"==typeof t&&(n=t,t=null),t&&r.send(t),n&&r.end(n),r},m.del=E,m.delete=E,m.patch=(e,t,n)=>{const r=m("PATCH",e);return"function"==typeof t&&(n=t,t=null),t&&r.send(t),n&&r.end(n),r},m.post=(e,t,n)=>{const r=m("POST",e);return"function"==typeof t&&(n=t,t=null),t&&r.send(t),n&&r.end(n),r},m.put=(e,t,n)=>{const r=m("PUT",e);return"function"==typeof t&&(n=t,t=null),t&&r.send(t),n&&r.end(n),r}},842:(e,t,n)=>{"use strict";const r=n(695),o=n(244),i=o.isObject,a=o.hasOwn;function s(){}e.exports=s,s.prototype.clearTimeout=function(){return clearTimeout(this._timer),clearTimeout(this._responseTimeoutTimer),clearTimeout(this._uploadTimeoutTimer),delete this._timer,delete this._responseTimeoutTimer,delete this._uploadTimeoutTimer,this},s.prototype.parse=function(e){return this._parser=e,this},s.prototype.responseType=function(e){return this._responseType=e,this},s.prototype.serialize=function(e){return this._serializer=e,this},s.prototype.timeout=function(e){if(!e||"object"!=typeof e)return this._timeout=e,this._responseTimeout=0,this._uploadTimeout=0,this;for(const t in e)if(a(e,t))switch(t){case"deadline":this._timeout=e.deadline;break;case"response":this._responseTimeout=e.response;break;case"upload":this._uploadTimeout=e.upload;break;default:console.warn("Unknown timeout option",t)}return this},s.prototype.retry=function(e,t){return 0!==arguments.length&&!0!==e||(e=1),e<=0&&(e=0),this._maxRetries=e,this._retries=0,this._retryCallback=t,this};const c=new Set(["ETIMEDOUT","ECONNRESET","EADDRINUSE","ECONNREFUSED","EPIPE","ENOTFOUND","ENETUNREACH","EAI_AGAIN"]),l=new Set([408,413,429,500,502,503,504,521,522,524]);s.prototype._shouldRetry=function(e,t){if(!this._maxRetries||this._retries++>=this._maxRetries)return!1;if(this._retryCallback)try{const n=this._retryCallback(e,t);if(!0===n)return!0;if(!1===n)return!1}catch(e){console.error(e)}if(t&&t.status&&l.has(t.status))return!0;if(e){if(e.code&&c.has(e.code))return!0;if(e.timeout&&"ECONNABORTED"===e.code)return!0;if(e.crossDomain)return!0}return!1},s.prototype._retry=function(){return this.clearTimeout(),this.req&&(this.req=null,this.req=this.request()),this._aborted=!1,this.timedout=!1,this.timedoutError=null,this._end()},s.prototype.then=function(e,t){if(!this._fullfilledPromise){const e=this;this._endCalled&&console.warn("Warning: superagent request was sent twice, because both .end() and .then() were called. Never call .end() if you use promises"),this._fullfilledPromise=new Promise(((t,n)=>{e.on("abort",(()=>{if(this._maxRetries&&this._maxRetries>this._retries)return;if(this.timedout&&this.timedoutError)return void n(this.timedoutError);const e=new Error("Aborted");e.code="ABORTED",e.status=this.status,e.method=this.method,e.url=this.url,n(e)})),e.end(((e,r)=>{e?n(e):t(r)}))}))}return this._fullfilledPromise.then(e,t)},s.prototype.catch=function(e){return this.then(void 0,e)},s.prototype.use=function(e){return e(this),this},s.prototype.ok=function(e){if("function"!=typeof e)throw new Error("Callback required");return this._okCallback=e,this},s.prototype._isResponseOK=function(e){return!!e&&(this._okCallback?this._okCallback(e):e.status>=200&&e.status<300)},s.prototype.get=function(e){return this._header[e.toLowerCase()]},s.prototype.getHeader=s.prototype.get,s.prototype.set=function(e,t){if(i(e)){for(const t in e)a(e,t)&&this.set(t,e[t]);return this}return this._header[e.toLowerCase()]=t,this.header[e]=t,this},s.prototype.unset=function(e){return delete this._header[e.toLowerCase()],delete this.header[e],this},s.prototype.field=function(e,t,n){if(null==e)throw new Error(".field(name, val) name can not be empty");if(this._data)throw new Error(".field() can't be used if .send() is used. Please use only .send() or only .field() & .attach()");if(i(e)){for(const t in e)a(e,t)&&this.field(t,e[t]);return this}if(Array.isArray(t)){for(const n in t)a(t,n)&&this.field(e,t[n]);return this}if(null==t)throw new Error(".field(name, val) val can not be empty");return"boolean"==typeof t&&(t=String(t)),n?this._getFormData().append(e,t,n):this._getFormData().append(e,t),this},s.prototype.abort=function(){if(this._aborted)return this;if(this._aborted=!0,this.xhr&&this.xhr.abort(),this.req){if(r.gte(process.version,"v13.0.0")&&r.lt(process.version,"v14.0.0"))throw new Error("Superagent does not work in v13 properly with abort() due to Node.js core changes");r.gte(process.version,"v14.0.0")&&(this.req.destroyed=!0),this.req.abort()}return this.clearTimeout(),this.emit("abort"),this},s.prototype._auth=function(e,t,n,r){switch(n.type){case"basic":this.set("Authorization",`Basic ${r(`${e}:${t}`)}`);break;case"auto":this.username=e,this.password=t;break;case"bearer":this.set("Authorization",`Bearer ${e}`)}return this},s.prototype.withCredentials=function(e){return void 0===e&&(e=!0),this._withCredentials=e,this},s.prototype.redirects=function(e){return this._maxRedirects=e,this},s.prototype.maxResponseSize=function(e){if("number"!=typeof e)throw new TypeError("Invalid argument");return this._maxResponseSize=e,this},s.prototype.toJSON=function(){return{method:this.method,url:this.url,data:this._data,headers:this._header}},s.prototype.send=function(e){const t=i(e);let n=this._header["content-type"];if(this._formData)throw new Error(".send() can't be used if .attach() or .field() is used. Please use only .send() or only .field() & .attach()");if(t&&!this._data)Array.isArray(e)?this._data=[]:this._isHost(e)||(this._data={});else if(e&&this._data&&this._isHost(this._data))throw new Error("Can't merge these send calls");if(t&&i(this._data))for(const t in e)a(e,t)&&(this._data[t]=e[t]);else"string"==typeof e?(n||this.type("form"),n=this._header["content-type"],n&&(n=n.toLowerCase().trim()),this._data="application/x-www-form-urlencoded"===n?this._data?`${this._data}&${e}`:e:(this._data||"")+e):this._data=e;return!t||this._isHost(e)||n||this.type("json"),this},s.prototype.sortQuery=function(e){return this._sort=void 0===e||e,this},s.prototype._finalizeQueryString=function(){const e=this._query.join("&");if(e&&(this.url+=(this.url.includes("?")?"&":"?")+e),this._query.length=0,this._sort){const e=this.url.indexOf("?");if(e>=0){const t=this.url.slice(e+1).split("&");"function"==typeof this._sort?t.sort(this._sort):t.sort(),this.url=this.url.slice(0,e)+"?"+t.join("&")}}},s.prototype._appendQueryString=()=>{console.warn("Unsupported")},s.prototype._timeoutError=function(e,t,n){if(this._aborted)return;const r=new Error(`${e+t}ms exceeded`);r.timeout=t,r.code="ECONNABORTED",r.errno=n,this.timedout=!0,this.timedoutError=r,this.abort(),this.callback(r)},s.prototype._setTimeouts=function(){const e=this;this._timeout&&!this._timer&&(this._timer=setTimeout((()=>{e._timeoutError("Timeout of ",e._timeout,"ETIME")}),this._timeout)),this._responseTimeout&&!this._responseTimeoutTimer&&(this._responseTimeoutTimer=setTimeout((()=>{e._timeoutError("Response timeout of ",e._responseTimeout,"ETIMEDOUT")}),this._responseTimeout))}},253:(e,t,n)=>{"use strict";const r=n(244);function o(){}e.exports=o,o.prototype.get=function(e){return this.header[e.toLowerCase()]},o.prototype._setHeaderProperties=function(e){const t=e["content-type"]||"";this.type=r.type(t);const n=r.params(t);for(const e in n)Object.prototype.hasOwnProperty.call(n,e)&&(this[e]=n[e]);this.links={};try{e.link&&(this.links=r.parseLinks(e.link))}catch(e){}},o.prototype._setStatusProperties=function(e){const t=Math.trunc(e/100);this.statusCode=e,this.status=this.statusCode,this.statusType=t,this.info=1===t,this.ok=2===t,this.redirect=3===t,this.clientError=4===t,this.serverError=5===t,this.error=(4===t||5===t)&&this.toError(),this.created=201===e,this.accepted=202===e,this.noContent=204===e,this.badRequest=400===e,this.unauthorized=401===e,this.notAcceptable=406===e,this.forbidden=403===e,this.notFound=404===e,this.unprocessableEntity=422===e}},244:(e,t)=>{"use strict";function n(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=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}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var o=0,i=function(){};return{s:i,n:function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,s=!0,c=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){c=!0,a=e},f:function(){try{s||null==n.return||n.return()}finally{if(c)throw a}}}}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}t.type=e=>e.split(/ *; */).shift(),t.params=e=>{const t={};var r,o=n(e.split(/ *; */));try{for(o.s();!(r=o.n()).done;){const e=r.value.split(/ *= */),n=e.shift(),o=e.shift();n&&o&&(t[n]=o)}}catch(e){o.e(e)}finally{o.f()}return t},t.parseLinks=e=>{const t={};var r,o=n(e.split(/ *, */));try{for(o.s();!(r=o.n()).done;){const e=r.value.split(/ *; */),n=e[0].slice(1,-1);t[e[1].split(/ *= */)[1].slice(1,-1)]=n}}catch(e){o.e(e)}finally{o.f()}return t},t.cleanHeader=(e,t)=>(delete e["content-type"],delete e["content-length"],delete e["transfer-encoding"],delete e.host,t&&(delete e.authorization,delete e.cookie),e),t.isObject=e=>null!==e&&"object"==typeof e,t.hasOwn=Object.hasOwn||function(e,t){if(null==e)throw new TypeError("Cannot convert undefined or null to object");return Object.prototype.hasOwnProperty.call(new Object(e),t)},t.mixin=(e,n)=>{for(const r in n)t.hasOwn(n,r)&&(e[r]=n[r])}},905:e=>{e.exports=()=>()=>null},924:(e,t,n)=>{"use strict";var r=n(141),o=n(559),i=o(r("String.prototype.indexOf"));e.exports=function(e,t){var n=r(e,!!t);return"function"==typeof n&&i(e,".prototype.")>-1?o(n):n}},559:(e,t,n)=>{"use strict";var r=n(612),o=n(141),i=o("%Function.prototype.apply%"),a=o("%Function.prototype.call%"),s=o("%Reflect.apply%",!0)||r.call(a,i),c=o("%Object.getOwnPropertyDescriptor%",!0),l=o("%Object.defineProperty%",!0),u=o("%Math.max%");if(l)try{l({},"a",{value:1})}catch(e){l=null}e.exports=function(e){var t=s(r,a,arguments);if(c&&l){var n=c(t,"length");n.configurable&&l(t,"length",{value:1+u(0,e.length-(arguments.length-1))})}return t};var p=function(){return s(r,i,arguments)};l?l(e.exports,"apply",{value:p}):e.exports.apply=p},767:e=>{function t(e){if(e)return function(e){for(var n in t.prototype)e[n]=t.prototype[n];return e}(e)}e.exports=t,t.prototype.on=t.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this},t.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this},t.prototype.off=t.prototype.removeListener=t.prototype.removeAllListeners=t.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var n,r=this._callbacks["$"+e];if(!r)return this;if(1==arguments.length)return delete this._callbacks["$"+e],this;for(var o=0;o<r.length;o++)if((n=r[o])===t||n.fn===t){r.splice(o,1);break}return 0===r.length&&delete this._callbacks["$"+e],this},t.prototype.emit=function(e){this._callbacks=this._callbacks||{};for(var t=new Array(arguments.length-1),n=this._callbacks["$"+e],r=1;r<arguments.length;r++)t[r-1]=arguments[r];if(n){r=0;for(var o=(n=n.slice(0)).length;r<o;++r)n[r].apply(this,t)}return this},t.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]},t.prototype.hasListeners=function(e){return!!this.listeners(e).length}},445:e=>{e.exports=a,a.default=a,a.stable=u,a.stableStringify=u;var t="[...]",n="[Circular]",r=[],o=[];function i(){return{depthLimit:Number.MAX_SAFE_INTEGER,edgesLimit:Number.MAX_SAFE_INTEGER}}function a(e,t,n,a){var s;void 0===a&&(a=i()),c(e,"",0,[],void 0,0,a);try{s=0===o.length?JSON.stringify(e,t,n):JSON.stringify(e,d(t),n)}catch(e){return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;0!==r.length;){var l=r.pop();4===l.length?Object.defineProperty(l[0],l[1],l[3]):l[0][l[1]]=l[2]}}return s}function s(e,t,n,i){var a=Object.getOwnPropertyDescriptor(i,n);void 0!==a.get?a.configurable?(Object.defineProperty(i,n,{value:e}),r.push([i,n,t,a])):o.push([t,n,e]):(i[n]=e,r.push([i,n,t]))}function c(e,r,o,i,a,l,u){var p;if(l+=1,"object"==typeof e&&null!==e){for(p=0;p<i.length;p++)if(i[p]===e)return void s(n,e,r,a);if(void 0!==u.depthLimit&&l>u.depthLimit)return void s(t,e,r,a);if(void 0!==u.edgesLimit&&o+1>u.edgesLimit)return void s(t,e,r,a);if(i.push(e),Array.isArray(e))for(p=0;p<e.length;p++)c(e[p],p,p,i,e,l,u);else{var d=Object.keys(e);for(p=0;p<d.length;p++){var f=d[p];c(e[f],f,p,i,e,l,u)}}i.pop()}}function l(e,t){return e<t?-1:e>t?1:0}function u(e,t,n,a){void 0===a&&(a=i());var s,c=p(e,"",0,[],void 0,0,a)||e;try{s=0===o.length?JSON.stringify(c,t,n):JSON.stringify(c,d(t),n)}catch(e){return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;0!==r.length;){var l=r.pop();4===l.length?Object.defineProperty(l[0],l[1],l[3]):l[0][l[1]]=l[2]}}return s}function p(e,o,i,a,c,u,d){var f;if(u+=1,"object"==typeof e&&null!==e){for(f=0;f<a.length;f++)if(a[f]===e)return void s(n,e,o,c);try{if("function"==typeof e.toJSON)return}catch(e){return}if(void 0!==d.depthLimit&&u>d.depthLimit)return void s(t,e,o,c);if(void 0!==d.edgesLimit&&i+1>d.edgesLimit)return void s(t,e,o,c);if(a.push(e),Array.isArray(e))for(f=0;f<e.length;f++)p(e[f],f,f,a,e,u,d);else{var h={},y=Object.keys(e).sort(l);for(f=0;f<y.length;f++){var m=y[f];p(e[m],m,f,a,e,u,d),h[m]=e[m]}if(void 0===c)return h;r.push([c,o,e]),c[o]=h}a.pop()}}function d(e){return e=void 0!==e?e:function(e,t){return t},function(t,n){if(o.length>0)for(var r=0;r<o.length;r++){var i=o[r];if(i[1]===t&&i[0]===n){n=i[2],o.splice(r,1);break}}return e.call(this,t,n)}}},648:e=>{"use strict";var t="Function.prototype.bind called on incompatible ",n=Array.prototype.slice,r=Object.prototype.toString,o="[object Function]";e.exports=function(e){var i=this;if("function"!=typeof i||r.call(i)!==o)throw new TypeError(t+i);for(var a,s=n.call(arguments,1),c=function(){if(this instanceof a){var t=i.apply(this,s.concat(n.call(arguments)));return Object(t)===t?t:this}return i.apply(e,s.concat(n.call(arguments)))},l=Math.max(0,i.length-s.length),u=[],p=0;p<l;p++)u.push("$"+p);if(a=Function("binder","return function ("+u.join(",")+"){ return binder.apply(this,arguments); }")(c),i.prototype){var d=function(){};d.prototype=i.prototype,a.prototype=new d,d.prototype=null}return a}},612:(e,t,n)=>{"use strict";var r=n(648);e.exports=Function.prototype.bind||r},141:(e,t,n)=>{"use strict";var r,o=SyntaxError,i=Function,a=TypeError,s=function(e){try{return i('"use strict"; return ('+e+").constructor;")()}catch(e){}},c=Object.getOwnPropertyDescriptor;if(c)try{c({},"")}catch(e){c=null}var l=function(){throw new a},u=c?function(){try{return l}catch(e){try{return c(arguments,"callee").get}catch(e){return l}}}():l,p=n(405)(),d=Object.getPrototypeOf||function(e){return e.__proto__},f={},h="undefined"==typeof Uint8Array?r:d(Uint8Array),y={"%AggregateError%":"undefined"==typeof AggregateError?r:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?r:ArrayBuffer,"%ArrayIteratorPrototype%":p?d([][Symbol.iterator]()):r,"%AsyncFromSyncIteratorPrototype%":r,"%AsyncFunction%":f,"%AsyncGenerator%":f,"%AsyncGeneratorFunction%":f,"%AsyncIteratorPrototype%":f,"%Atomics%":"undefined"==typeof Atomics?r:Atomics,"%BigInt%":"undefined"==typeof BigInt?r:BigInt,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?r:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":"undefined"==typeof Float32Array?r:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?r:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?r:FinalizationRegistry,"%Function%":i,"%GeneratorFunction%":f,"%Int8Array%":"undefined"==typeof Int8Array?r:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?r:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?r:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":p?d(d([][Symbol.iterator]())):r,"%JSON%":"object"==typeof JSON?JSON:r,"%Map%":"undefined"==typeof Map?r:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&p?d((new Map)[Symbol.iterator]()):r,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?r:Promise,"%Proxy%":"undefined"==typeof Proxy?r:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":"undefined"==typeof Reflect?r:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?r:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&p?d((new Set)[Symbol.iterator]()):r,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?r:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":p?d(""[Symbol.iterator]()):r,"%Symbol%":p?Symbol:r,"%SyntaxError%":o,"%ThrowTypeError%":u,"%TypedArray%":h,"%TypeError%":a,"%Uint8Array%":"undefined"==typeof Uint8Array?r:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?r:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?r:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?r:Uint32Array,"%URIError%":URIError,"%WeakMap%":"undefined"==typeof WeakMap?r:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?r:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?r:WeakSet},m=function e(t){var n;if("%AsyncFunction%"===t)n=s("async function () {}");else if("%GeneratorFunction%"===t)n=s("function* () {}");else if("%AsyncGeneratorFunction%"===t)n=s("async function* () {}");else if("%AsyncGenerator%"===t){var r=e("%AsyncGeneratorFunction%");r&&(n=r.prototype)}else if("%AsyncIteratorPrototype%"===t){var o=e("%AsyncGenerator%");o&&(n=d(o.prototype))}return y[t]=n,n},b={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},v=n(612),g=n(642),w=v.call(Function.call,Array.prototype.concat),j=v.call(Function.apply,Array.prototype.splice),O=v.call(Function.call,String.prototype.replace),x=v.call(Function.call,String.prototype.slice),S=v.call(Function.call,RegExp.prototype.exec),_=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,E=/\\(\\)?/g,C=function(e){var t=x(e,0,1),n=x(e,-1);if("%"===t&&"%"!==n)throw new o("invalid intrinsic syntax, expected closing `%`");if("%"===n&&"%"!==t)throw new o("invalid intrinsic syntax, expected opening `%`");var r=[];return O(e,_,(function(e,t,n,o){r[r.length]=n?O(o,E,"$1"):t||e})),r},P=function(e,t){var n,r=e;if(g(b,r)&&(r="%"+(n=b[r])[0]+"%"),g(y,r)){var i=y[r];if(i===f&&(i=m(r)),void 0===i&&!t)throw new a("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:n,name:r,value:i}}throw new o("intrinsic "+e+" does not exist!")};e.exports=function(e,t){if("string"!=typeof e||0===e.length)throw new a("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof t)throw new a('"allowMissing" argument must be a boolean');if(null===S(/^%?[^%]*%?$/,e))throw new o("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=C(e),r=n.length>0?n[0]:"",i=P("%"+r+"%",t),s=i.name,l=i.value,u=!1,p=i.alias;p&&(r=p[0],j(n,w([0,1],p)));for(var d=1,f=!0;d<n.length;d+=1){var h=n[d],m=x(h,0,1),b=x(h,-1);if(('"'===m||"'"===m||"`"===m||'"'===b||"'"===b||"`"===b)&&m!==b)throw new o("property names with quotes must have matching quotes");if("constructor"!==h&&f||(u=!0),g(y,s="%"+(r+="."+h)+"%"))l=y[s];else if(null!=l){if(!(h in l)){if(!t)throw new a("base intrinsic for "+e+" exists, but the property is not available.");return}if(c&&d+1>=n.length){var v=c(l,h);l=(f=!!v)&&"get"in v&&!("originalValue"in v.get)?v.get:l[h]}else f=g(l,h),l=l[h];f&&!u&&(y[s]=l)}}return l}},405:(e,t,n)=>{"use strict";var r="undefined"!=typeof Symbol&&Symbol,o=n(419);e.exports=function(){return"function"==typeof r&&"function"==typeof Symbol&&"symbol"==typeof r("foo")&&"symbol"==typeof Symbol("bar")&&o()}},419:e=>{"use strict";e.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var e={},t=Symbol("test"),n=Object(t);if("string"==typeof t)return!1;if("[object Symbol]"!==Object.prototype.toString.call(t))return!1;if("[object Symbol]"!==Object.prototype.toString.call(n))return!1;for(t in e[t]=42,e)return!1;if("function"==typeof Object.keys&&0!==Object.keys(e).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(e).length)return!1;var r=Object.getOwnPropertySymbols(e);if(1!==r.length||r[0]!==t)return!1;if(!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var o=Object.getOwnPropertyDescriptor(e,t);if(42!==o.value||!0!==o.enumerable)return!1}return!0}},642:(e,t,n)=>{"use strict";var r=n(612);e.exports=r.call(Function.call,Object.prototype.hasOwnProperty)},679:(e,t,n)=>{"use strict";var r=n(864),o={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},i={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},a={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},s={};function c(e){return r.isMemo(e)?a:s[e.$$typeof]||o}s[r.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},s[r.Memo]=a;var l=Object.defineProperty,u=Object.getOwnPropertyNames,p=Object.getOwnPropertySymbols,d=Object.getOwnPropertyDescriptor,f=Object.getPrototypeOf,h=Object.prototype;e.exports=function e(t,n,r){if("string"!=typeof n){if(h){var o=f(n);o&&o!==h&&e(t,o,r)}var a=u(n);p&&(a=a.concat(p(n)));for(var s=c(t),y=c(n),m=0;m<a.length;++m){var b=a[m];if(!(i[b]||r&&r[b]||y&&y[b]||s&&s[b])){var v=d(n,b);try{l(t,b,v)}catch(e){}}}}return t}},554:e=>{e.exports=function(e){var t={},n=[];(e=e||this).on=function(n,r,o){return(t[n]=t[n]||[]).push([r,o]),e},e.off=function(r,o){r||(t={});for(var i=t[r]||n,a=i.length=o?i.length:0;a--;)o==i[a][0]&&i.splice(a,1);return e},e.emit=function(r){for(var o,i=t[r]||n,a=i.length>0?i.slice(0,i.length):i,s=0;o=a[s++];)o[0].apply(o[1],n.slice.call(arguments,1));return e}}},631:(e,t,n)=>{var r="function"==typeof Map&&Map.prototype,o=Object.getOwnPropertyDescriptor&&r?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,i=r&&o&&"function"==typeof o.get?o.get:null,a=r&&Map.prototype.forEach,s="function"==typeof Set&&Set.prototype,c=Object.getOwnPropertyDescriptor&&s?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,l=s&&c&&"function"==typeof c.get?c.get:null,u=s&&Set.prototype.forEach,p="function"==typeof WeakMap&&WeakMap.prototype?WeakMap.prototype.has:null,d="function"==typeof WeakSet&&WeakSet.prototype?WeakSet.prototype.has:null,f="function"==typeof WeakRef&&WeakRef.prototype?WeakRef.prototype.deref:null,h=Boolean.prototype.valueOf,y=Object.prototype.toString,m=Function.prototype.toString,b=String.prototype.match,v=String.prototype.slice,g=String.prototype.replace,w=String.prototype.toUpperCase,j=String.prototype.toLowerCase,O=RegExp.prototype.test,x=Array.prototype.concat,S=Array.prototype.join,_=Array.prototype.slice,E=Math.floor,C="function"==typeof BigInt?BigInt.prototype.valueOf:null,P=Object.getOwnPropertySymbols,T="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?Symbol.prototype.toString:null,k="function"==typeof Symbol&&"object"==typeof Symbol.iterator,A="function"==typeof Symbol&&Symbol.toStringTag&&(Symbol.toStringTag,1)?Symbol.toStringTag:null,N=Object.prototype.propertyIsEnumerable,I=("function"==typeof Reflect?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(e){return e.__proto__}:null);function R(e,t){if(e===1/0||e===-1/0||e!=e||e&&e>-1e3&&e<1e3||O.call(/e/,t))return t;var n=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if("number"==typeof e){var r=e<0?-E(-e):E(e);if(r!==e){var o=String(r),i=v.call(t,o.length+1);return g.call(o,n,"$&_")+"."+g.call(g.call(i,/([0-9]{3})/g,"$&_"),/_$/,"")}}return g.call(t,n,"$&_")}var D=n(654),M=D.custom,L=z(M)?M:null;function U(e,t,n){var r="double"===(n.quoteStyle||t)?'"':"'";return r+e+r}function F(e){return g.call(String(e),/"/g,"&quot;")}function B(e){return!("[object Array]"!==q(e)||A&&"object"==typeof e&&A in e)}function $(e){return!("[object RegExp]"!==q(e)||A&&"object"==typeof e&&A in e)}function z(e){if(k)return e&&"object"==typeof e&&e instanceof Symbol;if("symbol"==typeof e)return!0;if(!e||"object"!=typeof e||!T)return!1;try{return T.call(e),!0}catch(e){}return!1}e.exports=function e(t,n,r,o){var s=n||{};if(V(s,"quoteStyle")&&"single"!==s.quoteStyle&&"double"!==s.quoteStyle)throw new TypeError('option "quoteStyle" must be "single" or "double"');if(V(s,"maxStringLength")&&("number"==typeof s.maxStringLength?s.maxStringLength<0&&s.maxStringLength!==1/0:null!==s.maxStringLength))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var c=!V(s,"customInspect")||s.customInspect;if("boolean"!=typeof c&&"symbol"!==c)throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(V(s,"indent")&&null!==s.indent&&"\t"!==s.indent&&!(parseInt(s.indent,10)===s.indent&&s.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(V(s,"numericSeparator")&&"boolean"!=typeof s.numericSeparator)throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var y=s.numericSeparator;if(void 0===t)return"undefined";if(null===t)return"null";if("boolean"==typeof t)return t?"true":"false";if("string"==typeof t)return G(t,s);if("number"==typeof t){if(0===t)return 1/0/t>0?"0":"-0";var w=String(t);return y?R(t,w):w}if("bigint"==typeof t){var O=String(t)+"n";return y?R(t,O):O}var E=void 0===s.depth?5:s.depth;if(void 0===r&&(r=0),r>=E&&E>0&&"object"==typeof t)return B(t)?"[Array]":"[Object]";var P,M=function(e,t){var n;if("\t"===e.indent)n="\t";else{if(!("number"==typeof e.indent&&e.indent>0))return null;n=S.call(Array(e.indent+1)," ")}return{base:n,prev:S.call(Array(t+1),n)}}(s,r);if(void 0===o)o=[];else if(W(o,t)>=0)return"[Circular]";function H(t,n,i){if(n&&(o=_.call(o)).push(n),i){var a={depth:s.depth};return V(s,"quoteStyle")&&(a.quoteStyle=s.quoteStyle),e(t,a,r+1,o)}return e(t,s,r+1,o)}if("function"==typeof t&&!$(t)){var K=function(e){if(e.name)return e.name;var t=b.call(m.call(e),/^function\s*([\w$]+)/);return t?t[1]:null}(t),ee=Z(t,H);return"[Function"+(K?": "+K:" (anonymous)")+"]"+(ee.length>0?" { "+S.call(ee,", ")+" }":"")}if(z(t)){var te=k?g.call(String(t),/^(Symbol\(.*\))_[^)]*$/,"$1"):T.call(t);return"object"!=typeof t||k?te:J(te)}if((P=t)&&"object"==typeof P&&("undefined"!=typeof HTMLElement&&P instanceof HTMLElement||"string"==typeof P.nodeName&&"function"==typeof P.getAttribute)){for(var ne="<"+j.call(String(t.nodeName)),re=t.attributes||[],oe=0;oe<re.length;oe++)ne+=" "+re[oe].name+"="+U(F(re[oe].value),"double",s);return ne+=">",t.childNodes&&t.childNodes.length&&(ne+="..."),ne+"</"+j.call(String(t.nodeName))+">"}if(B(t)){if(0===t.length)return"[]";var ie=Z(t,H);return M&&!function(e){for(var t=0;t<e.length;t++)if(W(e[t],"\n")>=0)return!1;return!0}(ie)?"["+Y(ie,M)+"]":"[ "+S.call(ie,", ")+" ]"}if(function(e){return!("[object Error]"!==q(e)||A&&"object"==typeof e&&A in e)}(t)){var ae=Z(t,H);return"cause"in Error.prototype||!("cause"in t)||N.call(t,"cause")?0===ae.length?"["+String(t)+"]":"{ ["+String(t)+"] "+S.call(ae,", ")+" }":"{ ["+String(t)+"] "+S.call(x.call("[cause]: "+H(t.cause),ae),", ")+" }"}if("object"==typeof t&&c){if(L&&"function"==typeof t[L]&&D)return D(t,{depth:E-r});if("symbol"!==c&&"function"==typeof t.inspect)return t.inspect()}if(function(e){if(!i||!e||"object"!=typeof e)return!1;try{i.call(e);try{l.call(e)}catch(e){return!0}return e instanceof Map}catch(e){}return!1}(t)){var se=[];return a.call(t,(function(e,n){se.push(H(n,t,!0)+" => "+H(e,t))})),Q("Map",i.call(t),se,M)}if(function(e){if(!l||!e||"object"!=typeof e)return!1;try{l.call(e);try{i.call(e)}catch(e){return!0}return e instanceof Set}catch(e){}return!1}(t)){var ce=[];return u.call(t,(function(e){ce.push(H(e,t))})),Q("Set",l.call(t),ce,M)}if(function(e){if(!p||!e||"object"!=typeof e)return!1;try{p.call(e,p);try{d.call(e,d)}catch(e){return!0}return e instanceof WeakMap}catch(e){}return!1}(t))return X("WeakMap");if(function(e){if(!d||!e||"object"!=typeof e)return!1;try{d.call(e,d);try{p.call(e,p)}catch(e){return!0}return e instanceof WeakSet}catch(e){}return!1}(t))return X("WeakSet");if(function(e){if(!f||!e||"object"!=typeof e)return!1;try{return f.call(e),!0}catch(e){}return!1}(t))return X("WeakRef");if(function(e){return!("[object Number]"!==q(e)||A&&"object"==typeof e&&A in e)}(t))return J(H(Number(t)));if(function(e){if(!e||"object"!=typeof e||!C)return!1;try{return C.call(e),!0}catch(e){}return!1}(t))return J(H(C.call(t)));if(function(e){return!("[object Boolean]"!==q(e)||A&&"object"==typeof e&&A in e)}(t))return J(h.call(t));if(function(e){return!("[object String]"!==q(e)||A&&"object"==typeof e&&A in e)}(t))return J(H(String(t)));if(!function(e){return!("[object Date]"!==q(e)||A&&"object"==typeof e&&A in e)}(t)&&!$(t)){var le=Z(t,H),ue=I?I(t)===Object.prototype:t instanceof Object||t.constructor===Object,pe=t instanceof Object?"":"null prototype",de=!ue&&A&&Object(t)===t&&A in t?v.call(q(t),8,-1):pe?"Object":"",fe=(ue||"function"!=typeof t.constructor?"":t.constructor.name?t.constructor.name+" ":"")+(de||pe?"["+S.call(x.call([],de||[],pe||[]),": ")+"] ":"");return 0===le.length?fe+"{}":M?fe+"{"+Y(le,M)+"}":fe+"{ "+S.call(le,", ")+" }"}return String(t)};var H=Object.prototype.hasOwnProperty||function(e){return e in this};function V(e,t){return H.call(e,t)}function q(e){return y.call(e)}function W(e,t){if(e.indexOf)return e.indexOf(t);for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1}function G(e,t){if(e.length>t.maxStringLength){var n=e.length-t.maxStringLength,r="... "+n+" more character"+(n>1?"s":"");return G(v.call(e,0,t.maxStringLength),t)+r}return U(g.call(g.call(e,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,K),"single",t)}function K(e){var t=e.charCodeAt(0),n={8:"b",9:"t",10:"n",12:"f",13:"r"}[t];return n?"\\"+n:"\\x"+(t<16?"0":"")+w.call(t.toString(16))}function J(e){return"Object("+e+")"}function X(e){return e+" { ? }"}function Q(e,t,n,r){return e+" ("+t+") {"+(r?Y(n,r):S.call(n,", "))+"}"}function Y(e,t){if(0===e.length)return"";var n="\n"+t.prev+t.base;return n+S.call(e,","+n)+"\n"+t.prev}function Z(e,t){var n=B(e),r=[];if(n){r.length=e.length;for(var o=0;o<e.length;o++)r[o]=V(e,o)?t(e[o],e):""}var i,a="function"==typeof P?P(e):[];if(k){i={};for(var s=0;s<a.length;s++)i["$"+a[s]]=a[s]}for(var c in e)V(e,c)&&(n&&String(Number(c))===c&&c<e.length||k&&i["$"+c]instanceof Symbol||(O.call(/[^\w$]/,c)?r.push(t(c,e)+": "+t(e[c],e)):r.push(c+": "+t(e[c],e))));if("function"==typeof P)for(var l=0;l<a.length;l++)N.call(e,a[l])&&r.push("["+t(a[l])+"]: "+t(e[a[l]],e));return r}},661:(e,t,n)=>{"use strict";n.r(t),n.d(t,{Children:()=>y,Component:()=>r.Component,Fragment:()=>r.Fragment,PureComponent:()=>l,StrictMode:()=>Q,Suspense:()=>w,SuspenseList:()=>x,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:()=>z,cloneElement:()=>W,createContext:()=>r.createContext,createElement:()=>r.createElement,createFactory:()=>V,createPortal:()=>C,createRef:()=>r.createRef,default:()=>re,findDOMNode:()=>K,flushSync:()=>X,forwardRef:()=>f,hydrate:()=>I,isValidElement:()=>q,lazy:()=>O,memo:()=>u,render:()=>N,startTransition:()=>Y,unmountComponentAtNode:()=>G,unstable_batchedUpdates:()=>J,useDeferredValue:()=>Z,useInsertionEffect:()=>te,useSyncExternalStore:()=>ne,useTransition:()=>ee,version:()=>H});var r=n(210),o=n(207),i={};for(const e in o)["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","isValidElement","lazy","memo","render","startTransition","unmountComponentAtNode","unstable_batchedUpdates","useDeferredValue","useInsertionEffect","useSyncExternalStore","useTransition","version"].indexOf(e)<0&&(i[e]=()=>o[e]);function a(e,t){for(var n in t)e[n]=t[n];return e}function s(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,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t}function l(e){this.props=e}function u(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:s(this.props,e)}function o(t){return this.shouldComponentUpdate=n,(0,r.createElement)(e,t)}return o.displayName="Memo("+(e.displayName||e.name)+")",o.prototype.isReactComponent=!0,o.__f=!0,o}n.d(t,i),(l.prototype=new r.Component).isPureReactComponent=!0,l.prototype.shouldComponentUpdate=function(e,t){return s(this.props,e)||s(this.state,t)};var p=r.options.__b;r.options.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),p&&p(e)};var d="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.forward_ref")||3911;function f(e){function t(t){var n=a({},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))},y={map:h,forEach:h,count:function(e){return e?(0,r.toChildArray)(e).length:0},only:function(e){var t=(0,r.toChildArray)(e);if(1!==t.length)throw"Children.only";return t[0]},toArray:r.toChildArray},m=r.options.__e;r.options.__e=function(e,t,n,r){if(e.then)for(var o,i=t;i=i.__;)if((o=i.__c)&&o.__c)return null==t.__e&&(t.__e=n.__e,t.__k=n.__k),o.__c(e,t);m(e,t,n,r)};var b=r.options.unmount;function v(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=a({},e)).__c&&(e.__c.__P===n&&(e.__c.__P=t),e.__c=null),e.__k=e.__k&&e.__k.map((function(e){return v(e,t,n)}))),e}function g(e,t,n){return e&&(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.insertBefore(e.__e,e.__d),e.__c.__e=!0,e.__c.__P=n)),e}function w(){this.__u=0,this.t=null,this.__b=null}function j(e){var t=e.__.__c;return t&&t.__a&&t.__a(e)}function O(e){var t,n,o;function i(i){if(t||(t=e()).then((function(e){n=e.default||e}),(function(e){o=e})),o)throw o;if(!n)throw t;return(0,r.createElement)(n,i)}return i.displayName="Lazy",i.__f=!0,i}function x(){this.u=null,this.o=null}r.options.unmount=function(e){var t=e.__c;t&&t.__R&&t.__R(),t&&!0===e.__h&&(e.type=null),b&&b(e)},(w.prototype=new r.Component).__c=function(e,t){var n=t.__c,r=this;null==r.t&&(r.t=[]),r.t.push(n);var o=j(r.__v),i=!1,a=function(){i||(i=!0,n.__R=null,o?o(s):s())};n.__R=a;var s=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()}},c=!0===t.__h;r.__u++||c||r.setState({__a:r.__b=r.__v.__k[0]}),e.then(a,a)},w.prototype.componentWillUnmount=function(){this.t=[]},w.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var n=document.createElement("div"),o=this.__v.__k[0].__c;this.__v.__k[0]=v(this.__b,n,o.__O=o.__P)}this.__b=null}var i=t.__a&&(0,r.createElement)(r.Fragment,null,e.fallback);return i&&(i.__h=null),[(0,r.createElement)(r.Fragment,null,t.__a?null:e.children),i]};var S=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 _(e){return this.getChildContext=function(){return e.context},e.children}function E(e){var t=this,n=e.i;t.componentWillUnmount=function(){(0,r.render)(null,t.l),t.l=null,t.i=null},t.i&&t.i!==n&&t.componentWillUnmount(),e.__v?(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)(_,{context:t.context},e.__v),t.l)):t.l&&t.componentWillUnmount()}function C(e,t){var n=(0,r.createElement)(E,{__v:e,i:t});return n.containerInfo=t,n}(x.prototype=new r.Component).__a=function(e){var t=this,n=j(t.__v),r=t.o.get(e);return r[0]++,function(o){var i=function(){t.props.revealOrder?(r.push(o),S(t,e,r)):o()};n?n(i):i()}},x.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},x.prototype.componentDidUpdate=x.prototype.componentDidMount=function(){var e=this;this.o.forEach((function(t,n){S(e,n,t)}))};var P="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,T=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image|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]/,k="undefined"!=typeof document,A=function(e){return("undefined"!=typeof Symbol&&"symbol"==typeof Symbol()?/fil|che|rad/i:/fil|che|ra/i).test(e)};function N(e,t,n){return null==t.__k&&(t.textContent=""),(0,r.render)(e,t),"function"==typeof n&&n(),e?e.__c:null}function I(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 R=r.options.event;function D(){}function M(){return this.cancelBubble}function L(){return this.defaultPrevented}r.options.event=function(e){return R&&(e=R(e)),e.persist=D,e.isPropagationStopped=M,e.isDefaultPrevented=L,e.nativeEvent=e};var U,F={configurable:!0,get:function(){return this.class}},B=r.options.vnode;r.options.vnode=function(e){var t=e.type,n=e.props,o=n;if("string"==typeof t){var i=-1===t.indexOf("-");for(var a in o={},n){var s=n[a];k&&"children"===a&&"noscript"===t||"value"===a&&"defaultValue"in n&&null==s||("defaultValue"===a&&"value"in n&&null==n.value?a="value":"download"===a&&!0===s?s="":/ondoubleclick/i.test(a)?a="ondblclick":/^onchange(textarea|input)/i.test(a+t)&&!A(n.type)?a="oninput":/^onfocus$/i.test(a)?a="onfocusin":/^onblur$/i.test(a)?a="onfocusout":/^on(Ani|Tra|Tou|BeforeInp|Compo)/.test(a)?a=a.toLowerCase():i&&T.test(a)?a=a.replace(/[A-Z0-9]/g,"-$&").toLowerCase():null===s&&(s=void 0),/^oninput$/i.test(a)&&(a=a.toLowerCase(),o[a]&&(a="oninputCapture")),o[a]=s)}"select"==t&&o.multiple&&Array.isArray(o.value)&&(o.value=(0,r.toChildArray)(n.children).forEach((function(e){e.props.selected=-1!=o.value.indexOf(e.props.value)}))),"select"==t&&null!=o.defaultValue&&(o.value=(0,r.toChildArray)(n.children).forEach((function(e){e.props.selected=o.multiple?-1!=o.defaultValue.indexOf(e.props.value):o.defaultValue==e.props.value}))),e.props=o,n.class!=n.className&&(F.enumerable="className"in n,null!=n.className&&(o.class=n.className),Object.defineProperty(o,"className",F))}e.$$typeof=P,B&&B(e)};var $=r.options.__r;r.options.__r=function(e){$&&$(e),U=e.__c};var z={ReactCurrentDispatcher:{current:{readContext:function(e){return U.__n[e.__c].props.value}}}},H="17.0.2";function V(e){return r.createElement.bind(null,e)}function q(e){return!!e&&e.$$typeof===P}function W(e){return q(e)?r.cloneElement.apply(null,arguments):e}function G(e){return!!e.__k&&((0,r.render)(null,e),!0)}function K(e){return e&&(e.base||1===e.nodeType&&e)||null}var J=function(e,t){return e(t)},X=function(e,t){return e(t)},Q=r.Fragment;function Y(e){e()}function Z(e){return e}function ee(){return[!1,Y]}var te=o.useLayoutEffect;function ne(e,t){var n=t(),r=(0,o.useState)({h:{__:n,v:t}}),i=r[0].h,a=r[1];return(0,o.useLayoutEffect)((function(){i.__=n,i.v=t,c(i.__,t())||a({h:i})}),[e,n,t]),(0,o.useEffect)((function(){return c(i.__,i.v())||a({h:i}),e((function(){c(i.__,i.v())||a({h:i})}))}),[e]),n}var re={useState:o.useState,useId:o.useId,useReducer:o.useReducer,useEffect:o.useEffect,useLayoutEffect:o.useLayoutEffect,useInsertionEffect:te,useTransition:ee,useDeferredValue:Z,useSyncExternalStore:ne,startTransition:Y,useRef:o.useRef,useImperativeHandle:o.useImperativeHandle,useMemo:o.useMemo,useCallback:o.useCallback,useContext:o.useContext,useDebugValue:o.useDebugValue,version:"17.0.2",Children:y,render:N,hydrate:I,unmountComponentAtNode:G,createPortal:C,createElement:r.createElement,createContext:r.createContext,createFactory:V,cloneElement:W,createRef:r.createRef,Fragment:r.Fragment,isValidElement:q,findDOMNode:K,Component:r.Component,PureComponent:l,memo:u,forwardRef:f,flushSync:X,unstable_batchedUpdates:J,StrictMode:Q,Suspense:w,SuspenseList:x,lazy:O,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:z}},569:e=>{"use strict";var t=String.prototype.replace,n=/%20/g,r="RFC3986";e.exports={default:r,formatters:{RFC1738:function(e){return t.call(e,n,"+")},RFC3986:function(e){return String(e)}},RFC1738:"RFC1738",RFC3986:r}},129:(e,t,n)=>{"use strict";var r=n(261),o=n(235),i=n(569);e.exports={formats:i,parse:o,stringify:r}},235:(e,t,n)=>{"use strict";var r=n(769),o=Object.prototype.hasOwnProperty,i=Array.isArray,a={allowDots:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:r.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},s=function(e){return e.replace(/&#(\d+);/g,(function(e,t){return String.fromCharCode(parseInt(t,10))}))},c=function(e,t){return e&&"string"==typeof e&&t.comma&&e.indexOf(",")>-1?e.split(","):e},l=function(e,t,n,r){if(e){var i=n.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e,a=/(\[[^[\]]*])/g,s=n.depth>0&&/(\[[^[\]]*])/.exec(i),l=s?i.slice(0,s.index):i,u=[];if(l){if(!n.plainObjects&&o.call(Object.prototype,l)&&!n.allowPrototypes)return;u.push(l)}for(var p=0;n.depth>0&&null!==(s=a.exec(i))&&p<n.depth;){if(p+=1,!n.plainObjects&&o.call(Object.prototype,s[1].slice(1,-1))&&!n.allowPrototypes)return;u.push(s[1])}return s&&u.push("["+i.slice(s.index)+"]"),function(e,t,n,r){for(var o=r?t:c(t,n),i=e.length-1;i>=0;--i){var a,s=e[i];if("[]"===s&&n.parseArrays)a=[].concat(o);else{a=n.plainObjects?Object.create(null):{};var l="["===s.charAt(0)&&"]"===s.charAt(s.length-1)?s.slice(1,-1):s,u=parseInt(l,10);n.parseArrays||""!==l?!isNaN(u)&&s!==l&&String(u)===l&&u>=0&&n.parseArrays&&u<=n.arrayLimit?(a=[])[u]=o:"__proto__"!==l&&(a[l]=o):a={0:o}}o=a}return o}(u,t,n,r)}};e.exports=function(e,t){var n=function(e){if(!e)return a;if(null!==e.decoder&&void 0!==e.decoder&&"function"!=typeof e.decoder)throw new TypeError("Decoder has to be a function.");if(void 0!==e.charset&&"utf-8"!==e.charset&&"iso-8859-1"!==e.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var t=void 0===e.charset?a.charset:e.charset;return{allowDots:void 0===e.allowDots?a.allowDots:!!e.allowDots,allowPrototypes:"boolean"==typeof e.allowPrototypes?e.allowPrototypes:a.allowPrototypes,allowSparse:"boolean"==typeof e.allowSparse?e.allowSparse:a.allowSparse,arrayLimit:"number"==typeof e.arrayLimit?e.arrayLimit:a.arrayLimit,charset:t,charsetSentinel:"boolean"==typeof e.charsetSentinel?e.charsetSentinel:a.charsetSentinel,comma:"boolean"==typeof e.comma?e.comma:a.comma,decoder:"function"==typeof e.decoder?e.decoder:a.decoder,delimiter:"string"==typeof e.delimiter||r.isRegExp(e.delimiter)?e.delimiter:a.delimiter,depth:"number"==typeof e.depth||!1===e.depth?+e.depth:a.depth,ignoreQueryPrefix:!0===e.ignoreQueryPrefix,interpretNumericEntities:"boolean"==typeof e.interpretNumericEntities?e.interpretNumericEntities:a.interpretNumericEntities,parameterLimit:"number"==typeof e.parameterLimit?e.parameterLimit:a.parameterLimit,parseArrays:!1!==e.parseArrays,plainObjects:"boolean"==typeof e.plainObjects?e.plainObjects:a.plainObjects,strictNullHandling:"boolean"==typeof e.strictNullHandling?e.strictNullHandling:a.strictNullHandling}}(t);if(""===e||null==e)return n.plainObjects?Object.create(null):{};for(var u="string"==typeof e?function(e,t){var n,l={},u=t.ignoreQueryPrefix?e.replace(/^\?/,""):e,p=t.parameterLimit===1/0?void 0:t.parameterLimit,d=u.split(t.delimiter,p),f=-1,h=t.charset;if(t.charsetSentinel)for(n=0;n<d.length;++n)0===d[n].indexOf("utf8=")&&("utf8=%E2%9C%93"===d[n]?h="utf-8":"utf8=%26%2310003%3B"===d[n]&&(h="iso-8859-1"),f=n,n=d.length);for(n=0;n<d.length;++n)if(n!==f){var y,m,b=d[n],v=b.indexOf("]="),g=-1===v?b.indexOf("="):v+1;-1===g?(y=t.decoder(b,a.decoder,h,"key"),m=t.strictNullHandling?null:""):(y=t.decoder(b.slice(0,g),a.decoder,h,"key"),m=r.maybeMap(c(b.slice(g+1),t),(function(e){return t.decoder(e,a.decoder,h,"value")}))),m&&t.interpretNumericEntities&&"iso-8859-1"===h&&(m=s(m)),b.indexOf("[]=")>-1&&(m=i(m)?[m]:m),o.call(l,y)?l[y]=r.combine(l[y],m):l[y]=m}return l}(e,n):e,p=n.plainObjects?Object.create(null):{},d=Object.keys(u),f=0;f<d.length;++f){var h=d[f],y=l(h,u[h],n,"string"==typeof e);p=r.merge(p,y,n)}return!0===n.allowSparse?p:r.compact(p)}},261:(e,t,n)=>{"use strict";var r=n(478),o=n(769),i=n(569),a=Object.prototype.hasOwnProperty,s={brackets:function(e){return e+"[]"},comma:"comma",indices:function(e,t){return e+"["+t+"]"},repeat:function(e){return e}},c=Array.isArray,l=String.prototype.split,u=Array.prototype.push,p=function(e,t){u.apply(e,c(t)?t:[t])},d=Date.prototype.toISOString,f=i.default,h={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:o.encode,encodeValuesOnly:!1,format:f,formatter:i.formatters[f],indices:!1,serializeDate:function(e){return d.call(e)},skipNulls:!1,strictNullHandling:!1},y={},m=function e(t,n,i,a,s,u,d,f,m,b,v,g,w,j,O,x){for(var S,_=t,E=x,C=0,P=!1;void 0!==(E=E.get(y))&&!P;){var T=E.get(t);if(C+=1,void 0!==T){if(T===C)throw new RangeError("Cyclic object value");P=!0}void 0===E.get(y)&&(C=0)}if("function"==typeof f?_=f(n,_):_ instanceof Date?_=v(_):"comma"===i&&c(_)&&(_=o.maybeMap(_,(function(e){return e instanceof Date?v(e):e}))),null===_){if(s)return d&&!j?d(n,h.encoder,O,"key",g):n;_=""}if("string"==typeof(S=_)||"number"==typeof S||"boolean"==typeof S||"symbol"==typeof S||"bigint"==typeof S||o.isBuffer(_)){if(d){var k=j?n:d(n,h.encoder,O,"key",g);if("comma"===i&&j){for(var A=l.call(String(_),","),N="",I=0;I<A.length;++I)N+=(0===I?"":",")+w(d(A[I],h.encoder,O,"value",g));return[w(k)+(a&&c(_)&&1===A.length?"[]":"")+"="+N]}return[w(k)+"="+w(d(_,h.encoder,O,"value",g))]}return[w(n)+"="+w(String(_))]}var R,D=[];if(void 0===_)return D;if("comma"===i&&c(_))R=[{value:_.length>0?_.join(",")||null:void 0}];else if(c(f))R=f;else{var M=Object.keys(_);R=m?M.sort(m):M}for(var L=a&&c(_)&&1===_.length?n+"[]":n,U=0;U<R.length;++U){var F=R[U],B="object"==typeof F&&void 0!==F.value?F.value:_[F];if(!u||null!==B){var $=c(_)?"function"==typeof i?i(L,F):L:L+(b?"."+F:"["+F+"]");x.set(t,C);var z=r();z.set(y,x),p(D,e(B,$,i,a,s,u,d,f,m,b,v,g,w,j,O,z))}}return D};e.exports=function(e,t){var n,o=e,l=function(e){if(!e)return h;if(null!==e.encoder&&void 0!==e.encoder&&"function"!=typeof e.encoder)throw new TypeError("Encoder has to be a function.");var t=e.charset||h.charset;if(void 0!==e.charset&&"utf-8"!==e.charset&&"iso-8859-1"!==e.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var n=i.default;if(void 0!==e.format){if(!a.call(i.formatters,e.format))throw new TypeError("Unknown format option provided.");n=e.format}var r=i.formatters[n],o=h.filter;return("function"==typeof e.filter||c(e.filter))&&(o=e.filter),{addQueryPrefix:"boolean"==typeof e.addQueryPrefix?e.addQueryPrefix:h.addQueryPrefix,allowDots:void 0===e.allowDots?h.allowDots:!!e.allowDots,charset:t,charsetSentinel:"boolean"==typeof e.charsetSentinel?e.charsetSentinel:h.charsetSentinel,delimiter:void 0===e.delimiter?h.delimiter:e.delimiter,encode:"boolean"==typeof e.encode?e.encode:h.encode,encoder:"function"==typeof e.encoder?e.encoder:h.encoder,encodeValuesOnly:"boolean"==typeof e.encodeValuesOnly?e.encodeValuesOnly:h.encodeValuesOnly,filter:o,format:n,formatter:r,serializeDate:"function"==typeof e.serializeDate?e.serializeDate:h.serializeDate,skipNulls:"boolean"==typeof e.skipNulls?e.skipNulls:h.skipNulls,sort:"function"==typeof e.sort?e.sort:null,strictNullHandling:"boolean"==typeof e.strictNullHandling?e.strictNullHandling:h.strictNullHandling}}(t);"function"==typeof l.filter?o=(0,l.filter)("",o):c(l.filter)&&(n=l.filter);var u,d=[];if("object"!=typeof o||null===o)return"";u=t&&t.arrayFormat in s?t.arrayFormat:t&&"indices"in t?t.indices?"indices":"repeat":"indices";var f=s[u];if(t&&"commaRoundTrip"in t&&"boolean"!=typeof t.commaRoundTrip)throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var y="comma"===f&&t&&t.commaRoundTrip;n||(n=Object.keys(o)),l.sort&&n.sort(l.sort);for(var b=r(),v=0;v<n.length;++v){var g=n[v];l.skipNulls&&null===o[g]||p(d,m(o[g],g,f,y,l.strictNullHandling,l.skipNulls,l.encode?l.encoder:null,l.filter,l.sort,l.allowDots,l.serializeDate,l.format,l.formatter,l.encodeValuesOnly,l.charset,b))}var w=d.join(l.delimiter),j=!0===l.addQueryPrefix?"?":"";return l.charsetSentinel&&("iso-8859-1"===l.charset?j+="utf8=%26%2310003%3B&":j+="utf8=%E2%9C%93&"),w.length>0?j+w:""}},769:(e,t,n)=>{"use strict";var r=n(569),o=Object.prototype.hasOwnProperty,i=Array.isArray,a=function(){for(var e=[],t=0;t<256;++t)e.push("%"+((t<16?"0":"")+t.toString(16)).toUpperCase());return e}(),s=function(e,t){for(var n=t&&t.plainObjects?Object.create(null):{},r=0;r<e.length;++r)void 0!==e[r]&&(n[r]=e[r]);return n};e.exports={arrayToObject:s,assign:function(e,t){return Object.keys(t).reduce((function(e,n){return e[n]=t[n],e}),e)},combine:function(e,t){return[].concat(e,t)},compact:function(e){for(var t=[{obj:{o:e},prop:"o"}],n=[],r=0;r<t.length;++r)for(var o=t[r],a=o.obj[o.prop],s=Object.keys(a),c=0;c<s.length;++c){var l=s[c],u=a[l];"object"==typeof u&&null!==u&&-1===n.indexOf(u)&&(t.push({obj:a,prop:l}),n.push(u))}return function(e){for(;e.length>1;){var t=e.pop(),n=t.obj[t.prop];if(i(n)){for(var r=[],o=0;o<n.length;++o)void 0!==n[o]&&r.push(n[o]);t.obj[t.prop]=r}}}(t),e},decode:function(e,t,n){var r=e.replace(/\+/g," ");if("iso-8859-1"===n)return r.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(r)}catch(e){return r}},encode:function(e,t,n,o,i){if(0===e.length)return e;var s=e;if("symbol"==typeof e?s=Symbol.prototype.toString.call(e):"string"!=typeof e&&(s=String(e)),"iso-8859-1"===n)return escape(s).replace(/%u[0-9a-f]{4}/gi,(function(e){return"%26%23"+parseInt(e.slice(2),16)+"%3B"}));for(var c="",l=0;l<s.length;++l){var u=s.charCodeAt(l);45===u||46===u||95===u||126===u||u>=48&&u<=57||u>=65&&u<=90||u>=97&&u<=122||i===r.RFC1738&&(40===u||41===u)?c+=s.charAt(l):u<128?c+=a[u]:u<2048?c+=a[192|u>>6]+a[128|63&u]:u<55296||u>=57344?c+=a[224|u>>12]+a[128|u>>6&63]+a[128|63&u]:(l+=1,u=65536+((1023&u)<<10|1023&s.charCodeAt(l)),c+=a[240|u>>18]+a[128|u>>12&63]+a[128|u>>6&63]+a[128|63&u])}return c},isBuffer:function(e){return!(!e||"object"!=typeof e||!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e)))},isRegExp:function(e){return"[object RegExp]"===Object.prototype.toString.call(e)},maybeMap:function(e,t){if(i(e)){for(var n=[],r=0;r<e.length;r+=1)n.push(t(e[r]));return n}return t(e)},merge:function e(t,n,r){if(!n)return t;if("object"!=typeof n){if(i(t))t.push(n);else{if(!t||"object"!=typeof t)return[t,n];(r&&(r.plainObjects||r.allowPrototypes)||!o.call(Object.prototype,n))&&(t[n]=!0)}return t}if(!t||"object"!=typeof t)return[t].concat(n);var a=t;return i(t)&&!i(n)&&(a=s(t,r)),i(t)&&i(n)?(n.forEach((function(n,i){if(o.call(t,i)){var a=t[i];a&&"object"==typeof a&&n&&"object"==typeof n?t[i]=e(a,n,r):t.push(n)}else t[i]=n})),t):Object.keys(n).reduce((function(t,i){var a=n[i];return o.call(t,i)?t[i]=e(t[i],a,r):t[i]=a,t}),a)}}},921:(e,t)=>{"use strict";var n="function"==typeof Symbol&&Symbol.for,r=n?Symbol.for("react.element"):60103,o=n?Symbol.for("react.portal"):60106,i=n?Symbol.for("react.fragment"):60107,a=n?Symbol.for("react.strict_mode"):60108,s=n?Symbol.for("react.profiler"):60114,c=n?Symbol.for("react.provider"):60109,l=n?Symbol.for("react.context"):60110,u=n?Symbol.for("react.async_mode"):60111,p=n?Symbol.for("react.concurrent_mode"):60111,d=n?Symbol.for("react.forward_ref"):60112,f=n?Symbol.for("react.suspense"):60113,h=n?Symbol.for("react.suspense_list"):60120,y=n?Symbol.for("react.memo"):60115,m=n?Symbol.for("react.lazy"):60116,b=n?Symbol.for("react.block"):60121,v=n?Symbol.for("react.fundamental"):60117,g=n?Symbol.for("react.responder"):60118,w=n?Symbol.for("react.scope"):60119;function j(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case r:switch(e=e.type){case u:case p:case i:case s:case a:case f:return e;default:switch(e=e&&e.$$typeof){case l:case d:case m:case y:case c:return e;default:return t}}case o:return t}}}function O(e){return j(e)===p}t.AsyncMode=u,t.ConcurrentMode=p,t.ContextConsumer=l,t.ContextProvider=c,t.Element=r,t.ForwardRef=d,t.Fragment=i,t.Lazy=m,t.Memo=y,t.Portal=o,t.Profiler=s,t.StrictMode=a,t.Suspense=f,t.isAsyncMode=function(e){return O(e)||j(e)===u},t.isConcurrentMode=O,t.isContextConsumer=function(e){return j(e)===l},t.isContextProvider=function(e){return j(e)===c},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===r},t.isForwardRef=function(e){return j(e)===d},t.isFragment=function(e){return j(e)===i},t.isLazy=function(e){return j(e)===m},t.isMemo=function(e){return j(e)===y},t.isPortal=function(e){return j(e)===o},t.isProfiler=function(e){return j(e)===s},t.isStrictMode=function(e){return j(e)===a},t.isSuspense=function(e){return j(e)===f},t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===i||e===p||e===s||e===a||e===f||e===h||"object"==typeof e&&null!==e&&(e.$$typeof===m||e.$$typeof===y||e.$$typeof===c||e.$$typeof===l||e.$$typeof===d||e.$$typeof===v||e.$$typeof===g||e.$$typeof===w||e.$$typeof===b)},t.typeOf=j},864:(e,t,n)=>{"use strict";e.exports=n(921)},359:(e,t)=>{"use strict";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.module.reference")},973:(e,t,n)=>{"use strict";n(359)},478:(e,t,n)=>{"use strict";var r=n(141),o=n(924),i=n(631),a=r("%TypeError%"),s=r("%WeakMap%",!0),c=r("%Map%",!0),l=o("WeakMap.prototype.get",!0),u=o("WeakMap.prototype.set",!0),p=o("WeakMap.prototype.has",!0),d=o("Map.prototype.get",!0),f=o("Map.prototype.set",!0),h=o("Map.prototype.has",!0),y=function(e,t){for(var n,r=e;null!==(n=r.next);r=n)if(n.key===t)return r.next=n.next,n.next=e.next,e.next=n,n};e.exports=function(){var e,t,n,r={assert:function(e){if(!r.has(e))throw new a("Side channel does not contain "+i(e))},get:function(r){if(s&&r&&("object"==typeof r||"function"==typeof r)){if(e)return l(e,r)}else if(c){if(t)return d(t,r)}else if(n)return function(e,t){var n=y(e,t);return n&&n.value}(n,r)},has:function(r){if(s&&r&&("object"==typeof r||"function"==typeof r)){if(e)return p(e,r)}else if(c){if(t)return h(t,r)}else if(n)return function(e,t){return!!y(e,t)}(n,r);return!1},set:function(r,o){s&&r&&("object"==typeof r||"function"==typeof r)?(e||(e=new s),u(e,r,o)):c?(t||(t=new c),f(t,r,o)):(n||(n={key:{},next:null}),function(e,t,n){var r=y(e,t);r?r.value=n:e.next={key:t,next:e.next,value:n}}(n,r,o))}};return r}},250:(e,t,n)=>{"use strict";var r=n(661),o="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},i=r.useState,a=r.useEffect,s=r.useLayoutEffect,c=r.useDebugValue;function l(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!o(e,n)}catch(e){return!0}}var u="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(e,t){var n=t(),r=i({inst:{value:n,getSnapshot:t}}),o=r[0].inst,u=r[1];return s((function(){o.value=n,o.getSnapshot=t,l(o)&&u({inst:o})}),[e,n,t]),a((function(){return l(o)&&u({inst:o}),e((function(){l(o)&&u({inst:o})}))}),[e]),c(n),n};t.useSyncExternalStore=void 0!==r.useSyncExternalStore?r.useSyncExternalStore:u},139:(e,t,n)=>{"use strict";var r=n(661),o=n(688),i="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},a=o.useSyncExternalStore,s=r.useRef,c=r.useEffect,l=r.useMemo,u=r.useDebugValue;t.useSyncExternalStoreWithSelector=function(e,t,n,r,o){var p=s(null);if(null===p.current){var d={hasValue:!1,value:null};p.current=d}else d=p.current;p=l((function(){function e(e){if(!c){if(c=!0,a=e,e=r(e),void 0!==o&&d.hasValue){var t=d.value;if(o(t,e))return s=t}return s=e}if(t=s,i(a,e))return t;var n=r(e);return void 0!==o&&o(t,n)?t:(a=e,s=n)}var a,s,c=!1,l=void 0===n?null:n;return[function(){return e(t())},null===l?void 0:function(){return e(l())}]}),[t,n,r,o]);var f=a(e,p[0],p[1]);return c((function(){d.hasValue=!0,d.value=f}),[f]),u(f),f}},688:(e,t,n)=>{"use strict";e.exports=n(250)},798:(e,t,n)=>{"use strict";e.exports=n(139)},210:e=>{"use strict";e.exports=require("preact")},207:e=>{"use strict";e.exports=require("preact/hooks")},654:()=>{},695:()=>{}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var i=t[r]={exports:{}};return e[r](i,i.exports,n),i.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};(()=>{"use strict";n.r(r),n.d(r,{Engine:()=>xp,ExternalApi:()=>Tp,calculateVisibility:()=>_,className:()=>T,eventTypes:()=>e,getSearchParamsByKeys:()=>kp,initResetSearchParams:()=>Np,randomId:()=>J,replaceSearchParams:()=>Ap});const e={info:"info",message:"message",participant:"participant",system:"system"},t="text",o="text",i="upload",a="received",s="read",c="custom",l="typing",u="read",p="detach_service",d="dismiss",f="set_topic",h="set_translation",y="click_cta",m="translation_proposal",b=m,v="assertive",g="polite",w={new_topic:"newTopic",new_translation:"newTranslation"},j="uploads",O="navigate",x="visibility",S={hidden:"hidden",minimized:"minimized",open:"open",initialize:null},_=({hasResponded:e,previousVisibility:t,requestedVisibility:n,config:r})=>{const{defaults:o,layoutMode:i,hideOnNoUserResponse:a}=r,{visible:s}=o||{};return"app"!==i||t?"window"===i&&a&&n!==S.open?e?n||t||S.open:S.hidden:"inline"===i&&e&&!n?t||S.open:n||t||s||S.minimized:S.open},E="cvco",C="2",P="seamly-client-participant",T=(...e)=>e.flat().map((e=>"object"==typeof e?Object.entries(e).map((([e,t])=>t?e:"")).join(" "):e)).filter((e=>"string"==typeof e)).map((e=>e.split(" "))).flat().filter((e=>e.length)).map((e=>e.indexOf(E)>-1?e:[E,e].join("-"))).join(" "),k=require("preact/jsx-runtime");var A=n(766),N=n.n(A);class I 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)}}class R extends I{constructor(e,...t){super(e,...t),this.name="SeamlyConfigurationError",this.langKey="errors.configError"}}class D extends I{constructor(e,...t){super(e,...t),this.name="SeamlyGeneralError",this.langKey="errors.general",this.action="reset"}}class M extends I{constructor(e,...t){super(e,...t),this.name="SeamlySessionExpiredError",this.action="reset"}}class L extends I{constructor(e,...t){super(e,...t),this.name="SeamlyUnauthorizedError",this.langKey="errors.general",this.action="reset"}}const U=(e,t)=>{let n;return function(...r){let o=!1;return clearTimeout(n),n=setTimeout((()=>{n=null,o||e.apply(this,r),o=!1}),t),t=>{o=!0,t&&e.apply(this,r)}}},F=e=>Math.ceil(e/1e3),B=e=>{const t=Math.floor(e/60);return{minutes:t,seconds:e-60*t}},$=(e,t=2)=>{if(0===e)return"0 Bytes";const n=t<0?0:t,r=Math.floor(Math.log(e)/Math.log(1024));return`${parseFloat((e/1024**r).toFixed(n))} ${["Bytes","KB","MB","GB","TB","PB","EB","ZB","YB"][r]}`},z={27:"Escape",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown"},H={Escape:"Escape",End:"End",Home:"Home",ArrowLeft:"ArrowLeft",ArrowUp:"ArrowUp",ArrowRight:"ArrowRight",ArrowDown:"ArrowDown"},V=e=>e.code?H[e.code]:z[e.keyCode],q=e=>{e&&e.focus()},W=(e,t)=>{e&&(e.contains(document.activeElement)||e===document.activeElement)&&t()};var G=n(905),K=n.n(G);function J(){return`_${(Number(String(Math.random()).slice(2))+Date.now()+Math.round(performance.now())).toString(36)}`}function X(e){const t=`cvco.${e}`;return{get(){const e=[t,t.split(".").slice(0,-1).join(".")];let n;do{n=sessionStorage.getItem(e[0])}while(e.shift()&&!n);return JSON.parse(n)},set(e){e&&sessionStorage.setItem(t,JSON.stringify(e))}}}var Q=e=>"function"==typeof e?e:function(){return e},Y="undefined"!=typeof self?self:null,Z="undefined"!=typeof window?window:null,ee=Y||Z||ee,te="closed",ne="errored",re="joined",oe="joining",ie="leaving",ae="phx_close",se="phx_error",ce="phx_reply",le="phx_leave",ue="websocket",pe=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})}},de=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))}},fe=class{static request(e,t,n,r,o,i,a){if(ee.XDomainRequest){let n=new ee.XDomainRequest;return this.xdomainRequest(n,e,t,r,o,i,a)}{let s=new ee.XMLHttpRequest;return this.xhrRequest(s,e,t,n,r,o,i,a)}}static xdomainRequest(e,t,n,r,o,i,a){return e.timeout=o,e.open(t,n),e.onload=()=>{let t=this.parseJSON(e.responseText);a&&a(t)},i&&(e.ontimeout=i),e.onprogress=()=>{},e.send(r),e}static xhrRequest(e,t,n,r,o,i,a,s){return e.open(t,n,!0),e.timeout=i,e.setRequestHeader("Content-Type",r),e.onerror=()=>s&&s(null),e.onreadystatechange=()=>{if(4===e.readyState&&s){let t=this.parseJSON(e.responseText);s(t)}},a&&(e.ontimeout=a),e.send(o),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 o=t?`${t}[${r}]`:r,i=e[r];"object"==typeof i?n.push(this.serialize(i,o)):n.push(encodeURIComponent(o)+"="+encodeURIComponent(i))}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)}`}},he=class{constructor(e){this.endPoint=null,this.token=null,this.skipHeartbeat=!0,this.reqs=new Set,this.onopen=function(){},this.onerror=function(){},this.onmessage=function(){},this.onclose=function(){},this.pollEndpoint=this.normalizeEndpoint(e),this.readyState=0,this.poll()}normalizeEndpoint(e){return e.replace("ws://","http://").replace("wss://","https://").replace(new RegExp("(.*)/"+ue),"$1/longpoll")}endpointURL(){return fe.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",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){this.ajax("POST",e,(()=>this.onerror("timeout")),(e=>{e&&200===e.status||(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});"undefined"!=typeof CloseEvent?this.onclose(new CloseEvent("close",r)):this.onclose(r)}ajax(e,t,n,r){let o;o=fe.request(e,this.endpointURL(),"application/json",t,this.timeout,(()=>{this.reqs.delete(o),n()}),(e=>{this.reqs.delete(o),this.isActive()&&r(e)})),this.reqs.add(o)}},ye={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,o,i,a]=JSON.parse(e);return t({join_ref:n,ref:r,topic:o,event:i,payload:a})}},binaryEncode(e){let{join_ref:t,ref:n,event:r,topic:o,payload:i}=e,a=this.META_LENGTH+t.length+n.length+o.length+r.length,s=new ArrayBuffer(this.HEADER_LENGTH+a),c=new DataView(s),l=0;c.setUint8(l++,this.KINDS.push),c.setUint8(l++,t.length),c.setUint8(l++,n.length),c.setUint8(l++,o.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(o,(e=>c.setUint8(l++,e.charCodeAt(0)))),Array.from(r,(e=>c.setUint8(l++,e.charCodeAt(0))));var u=new Uint8Array(s.byteLength+i.byteLength);return u.set(new Uint8Array(s),0),u.set(new Uint8Array(i),s.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),o=t.getUint8(2),i=t.getUint8(3),a=this.HEADER_LENGTH+this.META_LENGTH-1,s=n.decode(e.slice(a,a+r));a+=r;let c=n.decode(e.slice(a,a+o));a+=o;let l=n.decode(e.slice(a,a+i));return a+=i,{join_ref:s,ref:null,topic:c,event:l,payload:e.slice(a,e.byteLength)}},decodeReply(e,t,n){let r=t.getUint8(1),o=t.getUint8(2),i=t.getUint8(3),a=t.getUint8(4),s=this.HEADER_LENGTH+this.META_LENGTH,c=n.decode(e.slice(s,s+r));s+=r;let l=n.decode(e.slice(s,s+o));s+=o;let u=n.decode(e.slice(s,s+i));s+=i;let p=n.decode(e.slice(s,s+a));s+=a;let d=e.slice(s,e.byteLength);return{join_ref:c,ref:l,topic:u,event:ce,payload:{status:p,response:d}}},decodeBroadcast(e,t,n){let r=t.getUint8(1),o=t.getUint8(2),i=this.HEADER_LENGTH+2,a=n.decode(e.slice(i,i+r));i+=r;let s=n.decode(e.slice(i,i+o));return i+=o,{join_ref:null,ref:null,topic:a,event:s,payload:e.slice(i,e.byteLength)}}};function me(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 be(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?me(Object(n),!0).forEach((function(t){ve(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):me(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function ve(e,t,n){return t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var ge,we,je,Oe,xe=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)},Se=function(e,t,n,r,o){if("m"===r)throw new TypeError("Private method is not writable");if("a"===r&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?o.call(e,n):o?o.value=n:t.set(e,n),n};const _e=K()("seamly");class Ee{constructor(){ge.add(this),we.set(this,[])}connect(e,t,n,r){return function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))}(this,void 0,void 0,(function*(){this.url=e,this.accessToken=r,this.channelName=t,this.channelTopic=n;const{url:o,params:i}=(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 be(be({},e),{},{[n]:decodeURIComponent(r)})}),{})}})(this.url);this.socket=new 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||ee.WebSocket||he,this.establishedConnections=0,this.defaultEncoder=ye.encode.bind(ye),this.defaultDecoder=ye.decode.bind(ye),this.closeWasClean=!1,this.binaryType=t.binaryType||"arraybuffer",this.connectClock=1,this.transport!==he?(this.encode=t.encode||this.defaultEncoder,this.decode=t.decode||this.defaultDecoder):(this.encode=this.defaultEncoder,this.decode=this.defaultDecoder);let n=null;Z&&Z.addEventListener&&(Z.addEventListener("pagehide",(e=>{this.conn&&(this.disconnect(),n=this.connectClock)})),Z.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.longpollerTimeout=t.longpollerTimeout||2e4,this.params=Q(t.params||{}),this.endPoint=`${e}/${ue}`,this.vsn=t.vsn||"2.0.0",this.heartbeatTimeoutTimer=null,this.heartbeatTimer=null,this.pendingHeartbeatRef=null,this.reconnectTimer=new de((()=>{this.teardown((()=>this.connect()))}),this.reconnectAfterMs)}getLongPollTransport(){return he}replaceTransport(e){this.connectClock++,this.closeWasClean=!0,this.reconnectTimer.reset(),this.sendBuffer=[],this.conn&&(this.conn.close(),this.conn=null),this.transport=e}protocol(){return location.protocol.match(/^https/)?"wss":"ws"}endPointURL(){let e=fe.appendParams(fe.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,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=Q(e)),this.conn||(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))}log(e,t,n){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((o=>{o.ref===t&&(this.off([r]),e(Date.now()-n))}));return!0}clearHeartbeats(){clearTimeout(this.heartbeatTimer),clearTimeout(this.heartbeatTimeoutTimer)}onConnOpen(){this.hasLogger()&&this.log("transport",`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(se)}))}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 class{constructor(e,t,n){this.state=te,this.topic=e,this.params=Q(t||{}),this.socket=n,this.bindings=[],this.bindingRef=0,this.timeout=this.socket.timeout,this.joinedOnce=!1,this.joinPush=new pe(this,"phx_join",this.params,this.timeout),this.pushBuffer=[],this.stateChangeRefs=[],this.rejoinTimer=new de((()=>{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=re,this.rejoinTimer.reset(),this.pushBuffer.forEach((e=>e.send())),this.pushBuffer=[]})),this.joinPush.receive("error",(()=>{this.state=ne,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=te,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=ne,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 pe(this,le,Q({}),this.timeout).send(),this.state=ne,this.joinPush.reset(),this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()})),this.on(ce,((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(ae,e)}onError(e){return this.on(se,(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 pe(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=ie;let t=()=>{this.socket.hasLogger()&&this.socket.log("channel",`leave ${this.topic}`),this.trigger(ae,"leave")},n=new pe(this,le,Q({}),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=oe,this.joinPush.resend(e))}trigger(e,t,n,r){let o=this.onMessage(e,t,n,r);if(t&&!o)throw new Error("channel onMessage callbacks must return the payload, modified or unmodified");let i=this.bindings.filter((t=>t.event===e));for(let e=0;e<i.length;e++)i[e].callback(o,n,r||this.joinRef())}replyEventName(e){return`chan_reply_${e}`}isClosed(){return this.state===te}isErrored(){return this.state===ne}isJoined(){return this.state===re}isJoining(){return this.state===oe}isLeaving(){return this.state===ie}}(e,t,this);return this.channels.push(n),n}push(e){if(this.hasLogger()){let{topic:t,event:n,payload:r,ref:o,join_ref:i}=e;this.log("push",`${t} ${n} (${i}, ${o})`,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:o,join_ref:i}=e;o&&o===this.pendingHeartbeatRef&&(this.clearHeartbeats(),this.pendingHeartbeatRef=null,this.heartbeatTimer=setTimeout((()=>this.sendHeartbeat()),this.heartbeatIntervalMs)),this.hasLogger()&&this.log("receive",`${r.status||""} ${t} ${n} ${o&&"("+o+")"||""}`,r);for(let e=0;e<this.channels.length;e++){const a=this.channels[e];a.isMember(t,n,r,i)&&a.trigger(n,r,o,i)}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())}}(o,{params:Object.assign(Object.assign({},i),{v:C})}),this.socket.connect(),this.channel=this.socket.channel(this.channelTopic,{authorization:`Bearer ${this.accessToken}`,channelName:this.channelName}),this.start(),this.socket.onError((e=>{_e("[SOCKET][ERROR]",e)})),this.socket.onOpen((()=>{_e("[SOCKET]OPEN")})),this.channel.on("system",(e=>{"attach_channel_succeeded"===e.type&&xe(this,ge,"m",Oe).call(this,{connected:!0,ready:!0,currentState:"attach_channel_succeeded"})})),this.socket.onClose((()=>{_e("[SOCKET]CLOSE"),xe(this,ge,"m",Oe).call(this,{connected:!1,ready:!1,currentState:"socket_closed"})})),this.channel.onClose((()=>{_e("[CHANNEL]CLOSE"),xe(this,ge,"m",Oe).call(this,{connected:!1,ready:!1,currentState:"channel_closed"})})),this.channel.onError((e=>{_e("[CHANNEL][ERROR]",e),xe(this,ge,"m",Oe).call(this,{connected:!1,ready:!1,currentState:"channel_erred"})})),xe(this,ge,"m",je).call(this,"ack","ui","error","participant","message","service_data","system","info","sync")}))}start(){this.channel.join().receive("ok",(()=>{_e("[CHANNEL][JOIN] OK"),xe(this,ge,"m",Oe).call(this,{connected:!0,ready:!1,currentState:"join_channel_succeeded"})})).receive("error",(e=>{_e("[CHANNEL][JOIN] ERROR",e),xe(this,ge,"m",Oe).call(this,{connected:!1,ready:!1,currentState:"join_channel_erred"}),this.channel.socket.disconnect()})).receive("timeout",(()=>{_e("[CHANEL][JOIN] Networking issue. Still waiting...")}))}disconnect(){var e,t,n;null===(e=this.channel)||void 0===e||e.leave(),null===(t=this.socket)||void 0===t||t.remove(this.channel),null===(n=this.socket)||void 0===n||n.disconnect(),Se(this,we,[],"f")}onConnection(e){xe(this,we,"f").push(e)}pushToChannel(e,t,n=1e4){this.channel.push(e,t,n)}}we=new WeakMap,ge=new WeakSet,je=function(...e){e.forEach((e=>{this.channel.on(e,(t=>{_e("[RECEIVE]",e,t)}))}))},Oe=function(e){Se(this,we,xe(this,we,"f").filter((t=>!t(e))),"f")};var Ce,Pe,Te,ke,Ae,Ne,Ie,Re,De,Me,Le,Ue,Fe,Be,$e,ze=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},He=function(e,t,n,r,o){if("m"===r)throw new TypeError("Private method is not writable");if("a"===r&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?o.call(e,n):o?o.value=n:t.set(e,n),n},Ve=function(e,t,n,r){if("a"===n&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?r:"a"===n?r.call(e):r?r.value:t.get(e)};const qe=K()("seamly");function We(){if(!Intl||"undefined"==typeof Intl||void 0===Intl.DateTimeFormat)return null;const e=Intl.DateTimeFormat();if(void 0===e||void 0===e.resolvedOptions)return null;const t=e.resolvedOptions().timeZone;return t&&(t.indexOf("/")>-1||"UTC"===t)?t:null}class Ge{constructor({layoutMode:e,namespace:t,config:n,context:r}){var o;Ce.add(this),Pe.set(this,void 0),Te.set(this,void 0),ke.set(this,void 0),Ae.set(this,void 0),this.conversation=new Ee,Le.set(this,(e=>e||this.locale)),this.store=function(e,t){const n=t(e),r=n.get()||{};return{get:e=>void 0===e?r:r[e],set:(e,t)=>(r[e]=t,n.set(r),t),delete(e){const t=this.get(e);return delete r[e],n.set(r),t}}}(`${t}.connection${r.locale?`.${r.locale}`:""}`,n.storageProvider||X),this.connectionInfo={apiKey:n.key,domain:n.domain||"api.seamly-app.com",secure:!1!==n.secure&&(n.secure||!0)},He(this,Ae,Object.assign(Object.assign({},n),{sendEnvironment:null===(o=n.sendEnvironment)||void 0===o||o,context:Object.assign(Object.assign({},r),{channelName:r.channelName||"web"})}),"f"),He(this,Pe,!1,"f"),this.connected=!1,this.configReady=!1,He(this,Te,n.externalId,"f"),He(this,ke,e,"f"),this.userResponded=!1,this.URLS={},window.addEventListener("pageshow",(e=>{e.persisted&&this.connected&&this.connect()}))}getConversationUrl(){return this.store.get("conversationUrl")}hasConversation(){return!!this.getConversationUrl()}clearStore(){this.store.delete("accessToken"),this.store.delete("conversationUrl"),this.store.delete("channelName"),this.store.delete("channelTopic")}reset(){return ze(this,void 0,void 0,(function*(){return yield this.disconnect(),this.clearStore(),this.getConfig()}))}disconnect(){var e;return ze(this,void 0,void 0,(function*(){(null===(e=this.conversation)||void 0===e?void 0:e.disconnect)&&this.conversation.disconnect(),this.connected=!1,this.configReady=!1}))}getConfig(){return N().post(`${Ve(this,Ce,"m",Ue).call(this,"http")}/client/${this.connectionInfo.apiKey}/configs`).set("Content-Type","application/json").query({v:C}).send({context:Object.assign(Object.assign({},Ve(this,Ae,"f").context),{environment:!0===Ve(this,Ae,"f").sendEnvironment?Ve(this,Ce,"m",$e).call(this):Ve(this,Ae,"f").sendEnvironment})}).then((({body:e})=>(Ve(this,Ce,"m",Fe).call(this,e),this.configReady=!0,e.config))).catch((e=>{if(404===e.status)throw new R(e);if(e.status>=500)throw new D(e);throw e}))}getConversation(){return ze(this,void 0,void 0,(function*(){if(!this.hasConversation())return null;try{const{body:e}=yield N().get(`${Ve(this,Ce,"m",Ue).call(this,"http")}${this.URLS.history}`).set("Authorization",`Bearer ${Ve(this,Ce,"m",Ne).call(this)}`).query({v:C});Ve(this,Ce,"m",Fe).call(this,e);const{messages:t,participants:n,activeServiceSessionId:r,activeServiceSettings:o,serviceData:i,ui:a,translation:s}=e.history;return{events:t.map((([e,t])=>({type:e,payload:Object.assign(Object.assign({},t),{type:"participant"===e?e:t.type})}))),participants:n,activeServiceSessionId:r,activeServiceSettings:o,serviceData:i,resumeConversationPrompt:!!a&&Boolean(a.resumeConversationPrompt),translationProposal:a.translationProposal,translation:s}}catch(e){if(401===e.status)throw new L(e);if(404===e.status)throw new M(e);if(e.status>=500)throw new D(e);throw e}}))}connect(){return ze(this,void 0,void 0,(function*(){this.connected=!1;let e={};return this.hasConversation()||(e=yield Ve(this,Ce,"m",Be).call(this)),this.conversation.connect(`${Ve(this,Ce,"m",Ue).call(this,"ws")}${this.URLS.socket}`,Ve(this,Ae,"f").context.channelName,Ve(this,Ce,"m",De).call(this),Ve(this,Ce,"m",Ne).call(this)),this.conversation.onConnection((({connected:e,ready:t})=>{this.connected=e,He(this,Pe,t,"f")})),Ve(this,Ae,"f").sendEnvironment&&this.send("context",{environment:!0===Ve(this,Ae,"f").sendEnvironment?Ve(this,Ce,"m",$e).call(this):Ve(this,Ae,"f").sendEnvironment},!1),e}))}uploadFile(e,t,n,r){const o=new FormData;o.append("upload",e);const i=N().post(`${Ve(this,Ce,"m",Ue).call(this,"http")}${this.URLS.uploads}`).set("Authorization",`Bearer ${Ve(this,Ce,"m",Ne).call(this)}`).send(o);return i.on("progress",(function(e){const{direction:n,percent:r}=e;"upload"===n&&"function"==typeof t&&t(r)})),i.then((e=>{n&&n(e)})).catch((e=>{if(!r)throw e;r(e.response)})),i}getConversationIntitialState(){return N().get(`${Ve(this,Ce,"m",Ue).call(this,"http")}${this.getConversationUrl()}`).set("Authorization",`Bearer ${Ve(this,Ce,"m",Ne).call(this)}`).query({v:C}).then((({body:e})=>{return Ve(this,Ce,"m",Fe).call(this,e),this.userResponded=e.conversation.userResponded,t=e.conversation,n=["accessToken","channelTopic"],Object.keys(t).reduce(((e,r)=>(n.includes(r)||(e[r]=t[r]),e)),{});var t,n})).catch((e=>{if(401===e.status)throw new L(e);if(404===e.status)throw new M(e);if(e.status>=500)throw new D(e);throw e}))}getTranslations(e){return ze(this,void 0,void 0,(function*(){try{if(!this.URLS.translations)throw new R;const t=`${Ve(this,Ce,"m",Ue).call(this,"http")}${this.URLS.translations}`.replace("{version}",String(2)).replace("{locale}",Ve(this,Le,"f").call(this,e)),n=N().get(t),{body:r}=yield n;return r.translations}catch(e){if(e.status>=500)throw new D(e);throw e}}))}send(e,t,n=!0){var r;!this.connected||n&&!Ve(this,Pe,"f")?null===(r=this.conversation)||void 0===r||r.onConnection((({connected:r,ready:o})=>(this.connected=r,He(this,Pe,o,"f"),!!(n?o:r)&&(this.send(e,t,n),!0)))):(qe("[SEND]",e,t),this.conversation.pushToChannel(e,function(e,t){if("message"!==e)return t;const{type:n,body:r}=t;let{transactionId:o}=t;return o||(o=J()),{type:n,body:r,transactionId:o}}(e,t),1e4))}sendContext(e){const{locale:t,variables:n}=e,r={};if(t){if("string"!=typeof t)throw new Error("Locale must be a string");r.locale=t}if(n){if("object"!=typeof n)throw new Error("Variables must be an object");r.variables=n}0===Object.keys(r).length&&r.constructor===Object||this.send("context",r,!1)}}Pe=new WeakMap,Te=new WeakMap,ke=new WeakMap,Ae=new WeakMap,Le=new WeakMap,Ce=new WeakSet,Ne=function(){return this.store.get("accessToken")},Ie=function(e){this.store.set("accessToken",e)},Re=function(e){this.store.set("conversationUrl",e)},De=function(){return this.store.get("channelTopic")||this.store.get("channelName")},Me=function(e){this.store.set("channelTopic",e)},Ue=function(e){return`${this.connectionInfo.secure?`${e}s`:e}://${this.connectionInfo.domain}`},Fe=function({_links:e}){this.URLS=Object.entries(e).filter((([e])=>"self"!==e)).reduce(((e,[t,{href:n}])=>Object.assign(Object.assign({},e),{[t]:n})),this.URLS)},Be=function(){var e;return ze(this,void 0,void 0,(function*(){try{const t=N().post(`${Ve(this,Ce,"m",Ue).call(this,"http")}${this.URLS.conversations}`).set("Content-Type","application/json").query({v:C}).withCredentials().send({externalId:Ve(this,Te,"f")||void 0}),{body:n}=yield t,{conversation:r}=n,o=Object.assign({},r);return delete o.accessToken,delete o.channelTopic,Ve(this,Ce,"m",Ie).call(this,r.accessToken),Ve(this,Ce,"m",Me).call(this,r.channelTopic),Ve(this,Ce,"m",Fe).call(this,n),Ve(this,Ce,"m",Re).call(this,this.URLS.conversation),this.locale=null===(e=r.translation)||void 0===e?void 0:e.locale,this.userResponded=r.userResponded,o}catch(e){if(e.status>=500)throw new D(e);throw e}}))},$e=function(){return{clientName:"@seamly/web-ui",clientVariant:Ve(this,ke,"f"),clientVersion:"21.0.7",currentUrl:window.location.toString(),screenResolution:`${window.screen.width}x${window.screen.height}`,timezone:We(),userAgent:navigator.userAgent,preferredLocale:navigator.language}};var Ke=n(554),Je=n.n(Ke),Xe=n(210),Qe=n(207),Ye=n(688),Ze=n(798),et=n(661);let tt=function(e){e()};const nt=()=>tt,rt=(0,et.createContext)(null);function ot(){return(0,et.useContext)(rt)}let it=()=>{throw new Error("uSES not initialized!")};const at=(e,t)=>e===t;function st(e=rt){const t=e===rt?ot:()=>(0,et.useContext)(e);return function(e,n=at){const{store:r,subscription:o,getServerState:i}=t(),a=it(o.addNestedSub,r.getState,i||r.getState,e,n);return(0,et.useDebugValue)(a),a}}const ct=st();n(679),n(973);const lt={notify(){},get:()=>[]};const ut="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?et.useLayoutEffect:et.useEffect;let pt=null;const dt=function({store:e,context:t,children:n,serverState:r}){const o=(0,et.useMemo)((()=>{const t=function(e,t){let n,r=lt;function o(){a.onStateChange&&a.onStateChange()}function i(){n||(n=t?t.addNestedSub(o):e.subscribe(o),r=function(){const e=nt();let t=null,n=null;return{clear(){t=null,n=null},notify(){e((()=>{let e=t;for(;e;)e.callback(),e=e.next}))},get(){let e=[],n=t;for(;n;)e.push(n),n=n.next;return e},subscribe(e){let r=!0,o=n={callback:e,next:null,prev:n};return o.prev?o.prev.next=o:t=o,function(){r&&null!==t&&(r=!1,o.next?o.next.prev=o.prev:n=o.prev,o.prev?o.prev.next=o.next:t=o.next)}}}}())}const a={addNestedSub:function(e){return i(),r.subscribe(e)},notifyNestedSubs:function(){r.notify()},handleChangeWrapper:o,isSubscribed:function(){return Boolean(n)},trySubscribe:i,tryUnsubscribe:function(){n&&(n(),n=void 0,r.clear(),r=lt)},getListeners:()=>r};return a}(e);return{store:e,subscription:t,getServerState:r?()=>r:void 0}}),[e,r]),i=(0,et.useMemo)((()=>e.getState()),[e]);ut((()=>{const{subscription:t}=o;return t.onStateChange=t.notifyNestedSubs,t.trySubscribe(),i!==e.getState()&&t.notifyNestedSubs(),()=>{t.tryUnsubscribe(),t.onStateChange=void 0}}),[o,i]);const a=t||rt;return et.default.createElement(a.Provider,{value:o},n)};function ft(e=rt){const t=e===rt?ot:()=>(0,et.useContext)(e);return function(){const{store:e}=t();return e}}const ht=ft();function yt(e=rt){const t=e===rt?ht:ft(e);return function(){return t().dispatch}}const mt=yt();var bt;(e=>{it=e})(Ze.useSyncExternalStoreWithSelector),(e=>{pt=e})(Ye.useSyncExternalStore),bt=et.unstable_batchedUpdates,tt=bt;const vt=(0,Xe.createContext)(null),gt=(0,Xe.createContext)(null);function wt(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];throw Error("[Immer] minified error nr: "+e+(n.length?" "+n.map((function(e){return"'"+e+"'"})).join(","):"")+". Find the full error at: https://bit.ly/3cXEKWf")}function jt(e){return!!e&&!!e[cn]}function Ot(e){var t;return!!e&&(function(e){if(!e||"object"!=typeof e)return!1;var t=Object.getPrototypeOf(e);if(null===t)return!0;var n=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return n===Object||"function"==typeof n&&Function.toString.call(n)===ln}(e)||Array.isArray(e)||!!e[sn]||!!(null===(t=e.constructor)||void 0===t?void 0:t[sn])||Pt(e)||Tt(e))}function xt(e,t,n){void 0===n&&(n=!1),0===St(e)?(n?Object.keys:un)(e).forEach((function(r){n&&"symbol"==typeof r||t(r,e[r],e)})):e.forEach((function(n,r){return t(r,n,e)}))}function St(e){var t=e[cn];return t?t.i>3?t.i-4:t.i:Array.isArray(e)?1:Pt(e)?2:Tt(e)?3:0}function _t(e,t){return 2===St(e)?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function Et(e,t,n){var r=St(e);2===r?e.set(t,n):3===r?(e.delete(t),e.add(n)):e[t]=n}function Ct(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}function Pt(e){return nn&&e instanceof Map}function Tt(e){return rn&&e instanceof Set}function kt(e){return e.o||e.t}function At(e){if(Array.isArray(e))return Array.prototype.slice.call(e);var t=pn(e);delete t[cn];for(var n=un(t),r=0;r<n.length;r++){var o=n[r],i=t[o];!1===i.writable&&(i.writable=!0,i.configurable=!0),(i.get||i.set)&&(t[o]={configurable:!0,writable:!0,enumerable:i.enumerable,value:e[o]})}return Object.create(Object.getPrototypeOf(e),t)}function Nt(e,t){return void 0===t&&(t=!1),Rt(e)||jt(e)||!Ot(e)||(St(e)>1&&(e.set=e.add=e.clear=e.delete=It),Object.freeze(e),t&&xt(e,(function(e,t){return Nt(t,!0)}),!0)),e}function It(){wt(2)}function Rt(e){return null==e||"object"!=typeof e||Object.isFrozen(e)}function Dt(e){var t=dn[e];return t||wt(18,e),t}function Mt(){return en}function Lt(e,t){t&&(Dt("Patches"),e.u=[],e.s=[],e.v=t)}function Ut(e){Ft(e),e.p.forEach($t),e.p=null}function Ft(e){e===en&&(en=e.l)}function Bt(e){return en={p:[],l:en,h:e,m:!0,_:0}}function $t(e){var t=e[cn];0===t.i||1===t.i?t.j():t.O=!0}function zt(e,t){t._=t.p.length;var n=t.p[0],r=void 0!==e&&e!==n;return t.h.g||Dt("ES5").S(t,e,r),r?(n[cn].P&&(Ut(t),wt(4)),Ot(e)&&(e=Ht(t,e),t.l||qt(t,e)),t.u&&Dt("Patches").M(n[cn].t,e,t.u,t.s)):e=Ht(t,n,[]),Ut(t),t.u&&t.v(t.u,t.s),e!==an?e:void 0}function Ht(e,t,n){if(Rt(t))return t;var r=t[cn];if(!r)return xt(t,(function(o,i){return Vt(e,r,t,o,i,n)}),!0),t;if(r.A!==e)return t;if(!r.P)return qt(e,r.t,!0),r.t;if(!r.I){r.I=!0,r.A._--;var o=4===r.i||5===r.i?r.o=At(r.k):r.o;xt(3===r.i?new Set(o):o,(function(t,i){return Vt(e,r,o,t,i,n)})),qt(e,o,!1),n&&e.u&&Dt("Patches").R(r,n,e.u,e.s)}return r.o}function Vt(e,t,n,r,o,i){if(jt(o)){var a=Ht(e,o,i&&t&&3!==t.i&&!_t(t.D,r)?i.concat(r):void 0);if(Et(n,r,a),!jt(a))return;e.m=!1}if(Ot(o)&&!Rt(o)){if(!e.h.F&&e._<1)return;Ht(e,o),t&&t.A.l||qt(e,o)}}function qt(e,t,n){void 0===n&&(n=!1),e.h.F&&e.m&&Nt(t,n)}function Wt(e,t){var n=e[cn];return(n?kt(n):e)[t]}function Gt(e,t){if(t in e)for(var n=Object.getPrototypeOf(e);n;){var r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=Object.getPrototypeOf(n)}}function Kt(e){e.P||(e.P=!0,e.l&&Kt(e.l))}function Jt(e){e.o||(e.o=At(e.t))}function Xt(e,t,n){var r=Pt(t)?Dt("MapSet").N(t,n):Tt(t)?Dt("MapSet").T(t,n):e.g?function(e,t){var n=Array.isArray(e),r={i:n?1:0,A:t?t.A:Mt(),P:!1,I:!1,D:{},l:t,t:e,k:null,o:null,j:null,C:!1},o=r,i=fn;n&&(o=[r],i=hn);var a=Proxy.revocable(o,i),s=a.revoke,c=a.proxy;return r.k=c,r.j=s,c}(t,n):Dt("ES5").J(t,n);return(n?n.A:Mt()).p.push(r),r}function Qt(e){return jt(e)||wt(22,e),function e(t){if(!Ot(t))return t;var n,r=t[cn],o=St(t);if(r){if(!r.P&&(r.i<4||!Dt("ES5").K(r)))return r.t;r.I=!0,n=Yt(t,o),r.I=!1}else n=Yt(t,o);return xt(n,(function(t,o){r&&function(e,t){return 2===St(e)?e.get(t):e[t]}(r.t,t)===o||Et(n,t,e(o))})),3===o?new Set(n):n}(e)}function Yt(e,t){switch(t){case 2:return new Map(e);case 3:return Array.from(e)}return At(e)}var Zt,en,tn="undefined"!=typeof Symbol&&"symbol"==typeof Symbol("x"),nn="undefined"!=typeof Map,rn="undefined"!=typeof Set,on="undefined"!=typeof Proxy&&void 0!==Proxy.revocable&&"undefined"!=typeof Reflect,an=tn?Symbol.for("immer-nothing"):((Zt={})["immer-nothing"]=!0,Zt),sn=tn?Symbol.for("immer-draftable"):"__$immer_draftable",cn=tn?Symbol.for("immer-state"):"__$immer_state",ln=("undefined"!=typeof Symbol&&Symbol.iterator,""+Object.prototype.constructor),un="undefined"!=typeof Reflect&&Reflect.ownKeys?Reflect.ownKeys:void 0!==Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Object.getOwnPropertyNames,pn=Object.getOwnPropertyDescriptors||function(e){var t={};return un(e).forEach((function(n){t[n]=Object.getOwnPropertyDescriptor(e,n)})),t},dn={},fn={get:function(e,t){if(t===cn)return e;var n=kt(e);if(!_t(n,t))return function(e,t,n){var r,o=Gt(t,n);return o?"value"in o?o.value:null===(r=o.get)||void 0===r?void 0:r.call(e.k):void 0}(e,n,t);var r=n[t];return e.I||!Ot(r)?r:r===Wt(e.t,t)?(Jt(e),e.o[t]=Xt(e.A.h,r,e)):r},has:function(e,t){return t in kt(e)},ownKeys:function(e){return Reflect.ownKeys(kt(e))},set:function(e,t,n){var r=Gt(kt(e),t);if(null==r?void 0:r.set)return r.set.call(e.k,n),!0;if(!e.P){var o=Wt(kt(e),t),i=null==o?void 0:o[cn];if(i&&i.t===n)return e.o[t]=n,e.D[t]=!1,!0;if(Ct(n,o)&&(void 0!==n||_t(e.t,t)))return!0;Jt(e),Kt(e)}return e.o[t]===n&&"number"!=typeof n&&(void 0!==n||t in e.o)||(e.o[t]=n,e.D[t]=!0,!0)},deleteProperty:function(e,t){return void 0!==Wt(e.t,t)||t in e.t?(e.D[t]=!1,Jt(e),Kt(e)):delete e.D[t],e.o&&delete e.o[t],!0},getOwnPropertyDescriptor:function(e,t){var n=kt(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r?{writable:!0,configurable:1!==e.i||"length"!==t,enumerable:r.enumerable,value:n[t]}:r},defineProperty:function(){wt(11)},getPrototypeOf:function(e){return Object.getPrototypeOf(e.t)},setPrototypeOf:function(){wt(12)}},hn={};xt(fn,(function(e,t){hn[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}})),hn.deleteProperty=function(e,t){return hn.set.call(this,e,t,void 0)},hn.set=function(e,t,n){return fn.set.call(this,e[0],t,n,e[0])};var yn=function(){function e(e){var t=this;this.g=on,this.F=!0,this.produce=function(e,n,r){if("function"==typeof e&&"function"!=typeof n){var o=n;n=e;var i=t;return function(e){var t=this;void 0===e&&(e=o);for(var r=arguments.length,a=Array(r>1?r-1:0),s=1;s<r;s++)a[s-1]=arguments[s];return i.produce(e,(function(e){var r;return(r=n).call.apply(r,[t,e].concat(a))}))}}var a;if("function"!=typeof n&&wt(6),void 0!==r&&"function"!=typeof r&&wt(7),Ot(e)){var s=Bt(t),c=Xt(t,e,void 0),l=!0;try{a=n(c),l=!1}finally{l?Ut(s):Ft(s)}return"undefined"!=typeof Promise&&a instanceof Promise?a.then((function(e){return Lt(s,r),zt(e,s)}),(function(e){throw Ut(s),e})):(Lt(s,r),zt(a,s))}if(!e||"object"!=typeof e){if(void 0===(a=n(e))&&(a=e),a===an&&(a=void 0),t.F&&Nt(a,!0),r){var u=[],p=[];Dt("Patches").M(e,a,u,p),r(u,p)}return a}wt(21,e)},this.produceWithPatches=function(e,n){if("function"==typeof e)return function(n){for(var r=arguments.length,o=Array(r>1?r-1:0),i=1;i<r;i++)o[i-1]=arguments[i];return t.produceWithPatches(n,(function(t){return e.apply(void 0,[t].concat(o))}))};var r,o,i=t.produce(e,n,(function(e,t){r=e,o=t}));return"undefined"!=typeof Promise&&i instanceof Promise?i.then((function(e){return[e,r,o]})):[i,r,o]},"boolean"==typeof(null==e?void 0:e.useProxies)&&this.setUseProxies(e.useProxies),"boolean"==typeof(null==e?void 0:e.autoFreeze)&&this.setAutoFreeze(e.autoFreeze)}var t=e.prototype;return t.createDraft=function(e){Ot(e)||wt(8),jt(e)&&(e=Qt(e));var t=Bt(this),n=Xt(this,e,void 0);return n[cn].C=!0,Ft(t),n},t.finishDraft=function(e,t){var n=(e&&e[cn]).A;return Lt(n,t),zt(void 0,n)},t.setAutoFreeze=function(e){this.F=e},t.setUseProxies=function(e){e&&!on&&wt(20),this.g=e},t.applyPatches=function(e,t){var n;for(n=t.length-1;n>=0;n--){var r=t[n];if(0===r.path.length&&"replace"===r.op){e=r.value;break}}n>-1&&(t=t.slice(n+1));var o=Dt("Patches").$;return jt(e)?o(e,t):this.produce(e,(function(e){return o(e,t)}))},e}(),mn=new yn,bn=mn.produce;mn.produceWithPatches.bind(mn),mn.setAutoFreeze.bind(mn),mn.setUseProxies.bind(mn),mn.applyPatches.bind(mn),mn.createDraft.bind(mn),mn.finishDraft.bind(mn);const vn=bn;function gn(e){return gn="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},gn(e)}function wn(e){var t=function(e,t){if("object"!==gn(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==gn(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===gn(t)?t:String(t)}function jn(e,t,n){return(t=wn(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function On(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 xn(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?On(Object(n),!0).forEach((function(t){jn(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):On(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Sn(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. "}var _n="function"==typeof Symbol&&Symbol.observable||"@@observable",En=function(){return Math.random().toString(36).substring(7).split("").join(".")},Cn={INIT:"@@redux/INIT"+En(),REPLACE:"@@redux/REPLACE"+En(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+En()}};function Pn(e){if("object"!=typeof e||null===e)return!1;for(var t=e;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function Tn(e,t,n){var r;if("function"==typeof t&&"function"==typeof n||"function"==typeof n&&"function"==typeof arguments[3])throw new Error(Sn(0));if("function"==typeof t&&void 0===n&&(n=t,t=void 0),void 0!==n){if("function"!=typeof n)throw new Error(Sn(1));return n(Tn)(e,t)}if("function"!=typeof e)throw new Error(Sn(2));var o=e,i=t,a=[],s=a,c=!1;function l(){s===a&&(s=a.slice())}function u(){if(c)throw new Error(Sn(3));return i}function p(e){if("function"!=typeof e)throw new Error(Sn(4));if(c)throw new Error(Sn(5));var t=!0;return l(),s.push(e),function(){if(t){if(c)throw new Error(Sn(6));t=!1,l();var n=s.indexOf(e);s.splice(n,1),a=null}}}function d(e){if(!Pn(e))throw new Error(Sn(7));if(void 0===e.type)throw new Error(Sn(8));if(c)throw new Error(Sn(9));try{c=!0,i=o(i,e)}finally{c=!1}for(var t=a=s,n=0;n<t.length;n++)(0,t[n])();return e}function f(e){if("function"!=typeof e)throw new Error(Sn(10));o=e,d({type:Cn.REPLACE})}function h(){var e,t=p;return(e={subscribe:function(e){if("object"!=typeof e||null===e)throw new Error(Sn(11));function n(){e.next&&e.next(u())}return n(),{unsubscribe:t(n)}}})[_n]=function(){return this},e}return d({type:Cn.INIT}),(r={dispatch:d,subscribe:p,getState:u,replaceReducer:f})[_n]=h,r}function kn(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return 0===t.length?function(e){return e}:1===t.length?t[0]:t.reduce((function(e,t){return function(){return e(t.apply(void 0,arguments))}}))}function An(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e){return function(){var n=e.apply(void 0,arguments),r=function(){throw new Error(Sn(15))},o={getState:n.getState,dispatch:function(){return r.apply(void 0,arguments)}},i=t.map((function(e){return e(o)}));return r=kn.apply(void 0,i)(n.dispatch),xn(xn({},n),{},{dispatch:r})}}}function Nn(e){return function(t){var n=t.dispatch,r=t.getState;return function(t){return function(o){return"function"==typeof o?o(n,r,e):t(o)}}}}var In=Nn();In.withExtraArgument=Nn;const Rn=In;var Dn,Mn=(Dn=function(e,t){return Dn=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},Dn(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}Dn(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),Ln=function(e,t){for(var n=0,r=t.length,o=e.length;n<r;n++,o++)e[o]=t[n];return e},Un=Object.defineProperty,Fn=Object.defineProperties,Bn=Object.getOwnPropertyDescriptors,$n=Object.getOwnPropertySymbols,zn=Object.prototype.hasOwnProperty,Hn=Object.prototype.propertyIsEnumerable,Vn=function(e,t,n){return t in e?Un(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n},qn=function(e,t){for(var n in t||(t={}))zn.call(t,n)&&Vn(e,n,t[n]);if($n)for(var r=0,o=$n(t);r<o.length;r++)n=o[r],Hn.call(t,n)&&Vn(e,n,t[n]);return e},Wn=function(e,t){return Fn(e,Bn(t))},Gn="undefined"!=typeof window&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(0!==arguments.length)return"object"==typeof arguments[0]?kn:kn.apply(null,arguments)};"undefined"!=typeof window&&window.__REDUX_DEVTOOLS_EXTENSION__&&window.__REDUX_DEVTOOLS_EXTENSION__;var Kn=function(e){function t(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var o=e.apply(this,n)||this;return Object.setPrototypeOf(o,t.prototype),o}return Mn(t,e),Object.defineProperty(t,Symbol.species,{get:function(){return t},enumerable:!1,configurable:!0}),t.prototype.concat=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return e.prototype.concat.apply(this,t)},t.prototype.prepend=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return 1===e.length&&Array.isArray(e[0])?new(t.bind.apply(t,Ln([void 0],e[0].concat(this)))):new(t.bind.apply(t,Ln([void 0],e.concat(this))))},t}(Array);function Jn(e){return Ot(e)?vn(e,(function(){})):e}function Xn(e){var t,n=function(e){return function(e){void 0===e&&(e={});var t=e.thunk,n=void 0===t||t,r=(e.immutableCheck,e.serializableCheck,new Kn);return n&&(function(e){return"boolean"==typeof e}(n)?r.push(Rn):r.push(Rn.withExtraArgument(n.extraArgument))),r}(e)},r=e||{},o=r.reducer,i=void 0===o?void 0:o,a=r.middleware,s=void 0===a?n():a,c=r.devTools,l=void 0===c||c,u=r.preloadedState,p=void 0===u?void 0:u,d=r.enhancers,f=void 0===d?void 0:d;if("function"==typeof i)t=i;else{if(!function(e){if("object"!=typeof e||null===e)return!1;var t=Object.getPrototypeOf(e);if(null===t)return!0;for(var n=t;null!==Object.getPrototypeOf(n);)n=Object.getPrototypeOf(n);return t===n}(i))throw new Error('"reducer" is a required argument, and must be a function or an object of functions that can be passed to combineReducers');t=function(e){for(var t=Object.keys(e),n={},r=0;r<t.length;r++){var o=t[r];"function"==typeof e[o]&&(n[o]=e[o])}var i,a=Object.keys(n);try{!function(e){Object.keys(e).forEach((function(t){var n=e[t];if(void 0===n(void 0,{type:Cn.INIT}))throw new Error(Sn(12));if(void 0===n(void 0,{type:Cn.PROBE_UNKNOWN_ACTION()}))throw new Error(Sn(13))}))}(n)}catch(e){i=e}return function(e,t){if(void 0===e&&(e={}),i)throw i;for(var r=!1,o={},s=0;s<a.length;s++){var c=a[s],l=n[c],u=e[c],p=l(u,t);if(void 0===p)throw t&&t.type,new Error(Sn(14));o[c]=p,r=r||p!==u}return(r=r||a.length!==Object.keys(e).length)?o:e}}(i)}var h=s;"function"==typeof h&&(h=h(n));var y=An.apply(void 0,h),m=kn;l&&(m=Gn(qn({trace:!1},"object"==typeof l&&l)));var b=[y];return Array.isArray(f)?b=Ln([y],f):"function"==typeof f&&(b=f(b)),Tn(t,p,m.apply(void 0,b))}function Qn(e,t){function n(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];if(t){var o=t.apply(void 0,n);if(!o)throw new Error("prepareAction did not return an object");return qn(qn({type:e,payload:o.payload},"meta"in o&&{meta:o.meta}),"error"in o&&{error:o.error})}return{type:e,payload:n[0]}}return n.toString=function(){return""+e},n.type=e,n.match=function(t){return t.type===e},n}function Yn(e){var t,n={},r=[],o={addCase:function(e,t){var r="string"==typeof e?e:e.type;if(r in n)throw new Error("addCase cannot be called with two reducers for the same action type");return n[r]=t,o},addMatcher:function(e,t){return r.push({matcher:e,reducer:t}),o},addDefaultCase:function(e){return t=e,o}};return e(o),[n,r,t]}function Zn(e){var t=e.name;if(!t)throw new Error("`name` is a required option for createSlice");var n,r="function"==typeof e.initialState?e.initialState:Jn(e.initialState),o=e.reducers||{},i=Object.keys(o),a={},s={},c={};function l(){var t="function"==typeof e.extraReducers?Yn(e.extraReducers):[e.extraReducers],n=t[0],o=void 0===n?{}:n,i=t[1],a=void 0===i?[]:i,c=t[2],l=void 0===c?void 0:c,u=qn(qn({},o),s);return function(e,t,n,r){void 0===n&&(n=[]);var o,i=Yn(t),a=i[0],s=i[1],c=i[2];if(function(e){return"function"==typeof e}(e))o=function(){return Jn(e())};else{var l=Jn(e);o=function(){return l}}function u(e,t){void 0===e&&(e=o());var n=Ln([a[t.type]],s.filter((function(e){return(0,e.matcher)(t)})).map((function(e){return e.reducer})));return 0===n.filter((function(e){return!!e})).length&&(n=[c]),n.reduce((function(e,n){if(n){var r;if(jt(e))return void 0===(r=n(e,t))?e:r;if(Ot(e))return vn(e,(function(e){return n(e,t)}));if(void 0===(r=n(e,t))){if(null===e)return e;throw Error("A case reducer on a non-draftable value must not return undefined")}return r}return e}),e)}return u.getInitialState=o,u}(r,(function(e){for(var t in u)e.addCase(t,u[t]);for(var n=0,r=a;n<r.length;n++){var o=r[n];e.addMatcher(o.matcher,o.reducer)}l&&e.addDefaultCase(l)}))}return i.forEach((function(e){var n,r,i=o[e],l=function(e,t){return e+"/"+t}(t,e);"reducer"in i?(n=i.reducer,r=i.prepare):n=i,a[e]=n,s[l]=n,c[e]=r?Qn(l,r):Qn(l)})),{name:t,reducer:function(e,t){return n||(n=l()),n(e,t)},actions:c,caseReducers:a,getInitialState:function(){return n||(n=l()),n.getInitialState()}}}var er=function(e){void 0===e&&(e=21);for(var t="",n=e;n--;)t+="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW"[64*Math.random()|0];return t},tr=["name","message","stack","code"],nr=function(e,t){this.payload=e,this.meta=t},rr=function(e,t){this.payload=e,this.meta=t},or=function(e){if("object"==typeof e&&null!==e){for(var t={},n=0,r=tr;n<r.length;n++){var o=r[n];"string"==typeof e[o]&&(t[o]=e[o])}return t}return{message:String(e)}},ir=function(){function e(e,t,n){var r=Qn(e+"/fulfilled",(function(e,t,n,r){return{payload:e,meta:Wn(qn({},r||{}),{arg:n,requestId:t,requestStatus:"fulfilled"})}})),o=Qn(e+"/pending",(function(e,t,n){return{payload:void 0,meta:Wn(qn({},n||{}),{arg:t,requestId:e,requestStatus:"pending"})}})),i=Qn(e+"/rejected",(function(e,t,r,o,i){return{payload:o,error:(n&&n.serializeError||or)(e||"Rejected"),meta:Wn(qn({},i||{}),{arg:r,requestId:t,rejectedWithValue:!!o,requestStatus:"rejected",aborted:"AbortError"===(null==e?void 0:e.name),condition:"ConditionError"===(null==e?void 0:e.name)})}})),a="undefined"!=typeof AbortController?AbortController:function(){function e(){this.signal={aborted:!1,addEventListener:function(){},dispatchEvent:function(){return!1},onabort:function(){},removeEventListener:function(){},reason:void 0,throwIfAborted:function(){}}}return e.prototype.abort=function(){},e}();return Object.assign((function(e){return function(s,c,l){var u,p=(null==n?void 0:n.idGenerator)?n.idGenerator(e):er(),d=new a;function f(e){u=e,d.abort()}var h=function(){return a=this,h=null,y=function(){var a,h,y,m,b,v;return function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}}(this,(function(g){switch(g.label){case 0:return g.trys.push([0,4,,5]),null===(w=m=null==(a=null==n?void 0:n.condition)?void 0:a.call(n,e,{getState:c,extra:l}))||"object"!=typeof w||"function"!=typeof w.then?[3,2]:[4,m];case 1:m=g.sent(),g.label=2;case 2:if(!1===m||d.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};return b=new Promise((function(e,t){return d.signal.addEventListener("abort",(function(){return t({name:"AbortError",message:u||"Aborted"})}))})),s(o(p,e,null==(h=null==n?void 0:n.getPendingMeta)?void 0:h.call(n,{requestId:p,arg:e},{getState:c,extra:l}))),[4,Promise.race([b,Promise.resolve(t(e,{dispatch:s,getState:c,extra:l,requestId:p,signal:d.signal,abort:f,rejectWithValue:function(e,t){return new nr(e,t)},fulfillWithValue:function(e,t){return new rr(e,t)}})).then((function(t){if(t instanceof nr)throw t;return t instanceof rr?r(t.payload,p,e,t.meta):r(t,p,e)}))])];case 3:return y=g.sent(),[3,5];case 4:return v=g.sent(),y=v instanceof nr?i(null,p,e,v.payload,v.meta):i(v,p,e),[3,5];case 5:return n&&!n.dispatchConditionRejection&&i.match(y)&&y.meta.condition||s(y),[2,y]}var w}))},new Promise((function(e,t){var n=function(e){try{o(y.next(e))}catch(e){t(e)}},r=function(e){try{o(y.throw(e))}catch(e){t(e)}},o=function(t){return t.done?e(t.value):Promise.resolve(t.value).then(n,r)};o((y=y.apply(a,h)).next())}));var a,h,y}();return Object.assign(h,{abort:f,requestId:p,arg:e,unwrap:function(){return h.then(ar)}})}}),{pending:o,rejected:i,fulfilled:r,typePrefix:e})}return e.withTypes=function(){return e},e}();function ar(e){if(e.meta&&e.meta.rejectedWithValue)throw e.payload;if(e.error)throw e.error;return e.payload}var sr=function(e,t){return function(e){return e&&"function"==typeof e.match}(e)?e.match(t):e(t)};function cr(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return function(t){return e.some((function(e){return sr(e,t)}))}}Object.assign;var lr="listenerMiddleware";Qn(lr+"/add"),Qn(lr+"/removeAll"),Qn(lr+"/remove"),"function"==typeof queueMicrotask&&queueMicrotask.bind("undefined"!=typeof window?window:void 0!==n.g?n.g:globalThis);"undefined"!=typeof window&&window.requestAnimationFrame&&window.requestAnimationFrame,function(){function e(e,t){var n=o[e];return n?n.enumerable=t:o[e]=n={configurable:!0,enumerable:t,get:function(){var t=this[cn];return fn.get(t,e)},set:function(t){var n=this[cn];fn.set(n,e,t)}},n}function t(e){for(var t=e.length-1;t>=0;t--){var o=e[t][cn];if(!o.P)switch(o.i){case 5:r(o)&&Kt(o);break;case 4:n(o)&&Kt(o)}}}function n(e){for(var t=e.t,n=e.k,r=un(n),o=r.length-1;o>=0;o--){var i=r[o];if(i!==cn){var a=t[i];if(void 0===a&&!_t(t,i))return!0;var s=n[i],c=s&&s[cn];if(c?c.t!==a:!Ct(s,a))return!0}}var l=!!t[cn];return r.length!==un(t).length+(l?0:1)}function r(e){var t=e.k;if(t.length!==e.t.length)return!0;var n=Object.getOwnPropertyDescriptor(t,t.length-1);if(n&&!n.get)return!0;for(var r=0;r<t.length;r++)if(!t.hasOwnProperty(r))return!0;return!1}var o={};!function(e,t){dn[e]||(dn[e]=t)}("ES5",{J:function(t,n){var r=Array.isArray(t),o=function(t,n){if(t){for(var r=Array(n.length),o=0;o<n.length;o++)Object.defineProperty(r,""+o,e(o,!0));return r}var i=pn(n);delete i[cn];for(var a=un(i),s=0;s<a.length;s++){var c=a[s];i[c]=e(c,t||!!i[c].enumerable)}return Object.create(Object.getPrototypeOf(n),i)}(r,t),i={i:r?5:4,A:n?n.A:Mt(),P:!1,I:!1,D:{},l:n,t,k:o,o:null,O:!1,C:!1};return Object.defineProperty(o,cn,{value:i,writable:!0}),o},S:function(e,n,o){o?jt(n)&&n[cn].A===e&&t(e.p):(e.u&&function e(t){if(t&&"object"==typeof t){var n=t[cn];if(n){var o=n.t,i=n.k,a=n.D,s=n.i;if(4===s)xt(i,(function(t){t!==cn&&(void 0!==o[t]||_t(o,t)?a[t]||e(i[t]):(a[t]=!0,Kt(n)))})),xt(o,(function(e){void 0!==i[e]||_t(i,e)||(a[e]=!1,Kt(n))}));else if(5===s){if(r(n)&&(Kt(n),a.length=!0),i.length<o.length)for(var c=i.length;c<o.length;c++)a[c]=!1;else for(var l=o.length;l<i.length;l++)a[l]=!0;for(var u=Math.min(i.length,o.length),p=0;p<u;p++)i.hasOwnProperty(p)||(a[p]=!0),void 0===a[p]&&e(i[p])}}}}(e.p[0]),t(e.p))},K:function(e){return 4===e.i?n(e):r(e)}})}();class ur extends I{constructor(e,...t){super(e,...t),this.name="SeamlyUnavailableError",this.langKey="errors.seamlyUnavailable"}}var pr=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))};const dr=ir("initializeConfig",((e,{extra:{api:t,config:n},rejectWithValue:r})=>pr(void 0,void 0,void 0,(function*(){var e;try{const{features:r,defaultLocale:o,preChat:i,agentParticipant:a,userParticipant:s,startChatIcon:c}=yield t.getConfig(),l=(null===(e=null==n?void 0:n.context)||void 0===e?void 0:e.locale)||o,{connectWhenInView:u}=n;return{features:r,defaultLocale:o,preChat:i,agentParticipant:a,userParticipant:s,startChatIcon:c,locale:l,connectWhenInView:u}}catch(e){return r(e)}})))),fr=ir("resetConfig",((e,{extra:{config:t}})=>pr(void 0,void 0,void 0,(function*(){return t}))));const hr=ir("setLocale",((e,{extra:{api:t},rejectWithValue:n})=>function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))}(void 0,void 0,void 0,(function*(){try{return{translations:yield t.getTranslations(e),locale:e}}catch(e){return n(e)}}))),{condition:(e,{getState:t})=>{const{i18n:{isLoading:n,locale:r}}=t();return e!==r&&!n}});var yr="NOT_FOUND",mr=function(e,t){return e===t};function br(e,t){var n,r,o="object"==typeof t?t:{equalityCheck:t},i=o.equalityCheck,a=void 0===i?mr:i,s=o.maxSize,c=void 0===s?1:s,l=o.resultEqualityCheck,u=function(e){return function(t,n){if(null===t||null===n||t.length!==n.length)return!1;for(var r=t.length,o=0;o<r;o++)if(!e(t[o],n[o]))return!1;return!0}}(a),p=1===c?(n=u,{get:function(e){return r&&n(r.key,e)?r.value:yr},put:function(e,t){r={key:e,value:t}},getEntries:function(){return r?[r]:[]},clear:function(){r=void 0}}):function(e,t){var n=[];function r(e){var r=n.findIndex((function(n){return t(e,n.key)}));if(r>-1){var o=n[r];return r>0&&(n.splice(r,1),n.unshift(o)),o.value}return yr}return{get:r,put:function(t,o){r(t)===yr&&(n.unshift({key:t,value:o}),n.length>e&&n.pop())},getEntries:function(){return n},clear:function(){n=[]}}}(c,u);function d(){var t=p.get(arguments);if(t===yr){if(t=e.apply(null,arguments),l){var n=p.getEntries(),r=n.find((function(e){return l(e.value,t)}));r&&(t=r.value)}p.put(arguments,t)}return t}return d.clearCache=function(){return p.clear()},d}function vr(e){var t=Array.isArray(e[0])?e[0]:e;if(!t.every((function(e){return"function"==typeof e}))){var n=t.map((function(e){return"function"==typeof e?"function "+(e.name||"unnamed")+"()":typeof e})).join(", ");throw new Error("createSelector expects all input-selectors to be functions, but received the following types: ["+n+"]")}return t}function gr(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];var o=function(){for(var t=arguments.length,r=new Array(t),o=0;o<t;o++)r[o]=arguments[o];var i,a=0,s={memoizeOptions:void 0},c=r.pop();if("object"==typeof c&&(s=c,c=r.pop()),"function"!=typeof c)throw new Error("createSelector expects an output function after the inputs, but received: ["+typeof c+"]");var l=s,u=l.memoizeOptions,p=void 0===u?n:u,d=Array.isArray(p)?p:[p],f=vr(r),h=e.apply(void 0,[function(){return a++,c.apply(null,arguments)}].concat(d)),y=e((function(){for(var e=[],t=f.length,n=0;n<t;n++)e.push(f[n].apply(null,arguments));return i=h.apply(null,e)}));return Object.assign(y,{resultFunc:c,memoizedResultFunc:h,dependencies:f,lastResult:function(){return i},recomputations:function(){return a},resetRecomputations:function(){return a=0}}),y};return o}var wr=gr(br);const jr=wr((({app:e})=>e),(({userHasResponded:e})=>e)),Or=wr((({config:e})=>e),(e=>{let t=Object.assign({visible:"inline"===(null==e?void 0:e.layoutMode)?S.open:S.minimized,appContainerClassNames:e.appContainerClassNames||[]},e);return"function"==typeof t.appContainerClassNames&&(t=Object.assign(Object.assign({},t),{appContainerClassNames:t.appContainerClassNames(t)})),t})),xr=()=>ct(Or),Sr=({state:e})=>e,_r=()=>ct(Sr),Er=wr(Sr,Or,jr,(({events:e,serviceData:t},n,r)=>{var o;if(r||"inline"===n.layoutMode||!(null==t?void 0:t.suggestion)||!(null===(o=null==t?void 0:t.suggestion)||void 0===o?void 0:o.body.length))return e;const i={type:"service_data",payload:t.suggestion};return[...e,i]})),Cr=wr(Er,Or,((e,t)=>{var n,r;const{enabled:o,threshold:i}=null!==(r=null===(n=null==t?void 0:t.messages)||void 0===n?void 0:n.timeIndicator)&&void 0!==r?r:{};if(!o)return e;const a=[];let s=null;return e.forEach(((e,t)=>{if(0===t)a.push(Object.assign(Object.assign({},e),{timeIndicator:e.payload.occurredAt}));else{const t=s&&F(e.payload.occurredAt-s.payload.occurredAt)>=i?e.payload.occurredAt:void 0;a.push(Object.assign(Object.assign({},e),{timeIndicator:t}))}s=e})),a})),Pr=()=>ct(Cr),Tr=(wr(Cr,(e=>e.map((e=>e.payload.id)))),()=>_r().isLoading),kr=()=>_r().unreadEvents,Ar=()=>_r().skiplinkTargetId,Nr=wr(Cr,(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})),Ir=()=>{const{participants:e,currentAgent:t}=_r().participantInfo;return t?e[t]:null},Rr=()=>{const{layoutMode:e}=xr();return{isInline:"inline"===e,isWindow:"window"===e,isApp:"app"===e,isResolving:!e}},Dr=wr((({visibility:e})=>e),(e=>e.visibility)),Mr=wr((({visibility:e})=>e),(e=>e.showInlineView));const Lr=[S.open,S.minimized,S.hidden],Ur=ir("setVisibility",((e,{getState:t,extra:{api:n,eventBus:r}})=>{const o=t(),i=Dr(o),a=jr(o),s=n.hasConversation(),c=Or(o),{visibilityCallback:l=_,layoutMode:u}=c,{unreadEvents:p}=Sr(o),d=l({hasResponded:a,previousVisibility:i,requestedVisibility:e,config:c});if(Lr.includes(d)){if(i!==d)return n.store.set(x,Object.assign(Object.assign({},n.store.get(x)||{}),{[u]:e})),e&&r.emit("ui.visible",e,{visibility:e,hasConversation:s,hasResponded:a,unreadMessageCount:p}),d}else console.error('The visibilityCallback function should return "open", "minimized" or "hidden".')})),Fr=ir("initialize",((e,{dispatch:t,getState:n,extra:{api:r}})=>function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))}(void 0,void 0,void 0,(function*(){var e;const{layoutMode:o}=Or(n()),i=(null===(e=r.store.get(x))||void 0===e?void 0:e[o])||S.initialize;return t(Ur(i)),i}))));var Br=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))};const $r=ir("initializeApp",((e,{extra:{api:t,config:n},rejectWithValue:r})=>Br(void 0,void 0,void 0,(function*(){var e,o,i,a;let s=null===(e=null==n?void 0:n.context)||void 0===e?void 0:e.locale;try{if(t.hasConversation()){const e=yield t.getConversationIntitialState();return s=(null===(o=e.translation)||void 0===o?void 0:o.locale)||s,{initialState:e,locale:s,config:n}}return(null===(i=null==n?void 0:n.context)||void 0===i?void 0:i.topic)&&t.send("action",{type:f,body:{name:n.context.topic,fallbackMessage:n.context.topic}}),(null===(a=null==n?void 0:n.context)||void 0===a?void 0:a.translationLocale)&&(s=n.context.translationLocale,t.send("action",{type:h,body:{enabled:!0,locale:s}},!1)),{initialState:void 0,locale:s,config:n}}catch(e){if(e instanceof M){const e=new M;return r({name:e.name,message:e.message,originalEvent:e.originalEvent,originalError:e.originalError,action:e.action})}const t=new ur;return r({name:t.name,message:t.message,langKey:t.langKey})}})))),zr=ir("resetApp",((e,{dispatch:t,extra:{api:n}})=>Br(void 0,void 0,void 0,(function*(){yield n.disconnect(),yield n.clearStore(),t(fr()),yield t(dr());try{const{locale:e}=yield t($r()).unwrap();yield t(hr(e))}catch(e){}t(Fr())})))),Hr=()=>ct(jr),Vr={userHasResponded:!1},qr=Zn({name:"app",initialState:Vr,reducers:{setHasResponded:(e,{payload:t})=>{e.userHasResponded=t}},extraReducers:e=>{e.addCase(zr.pending,(()=>Vr)).addCase($r.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:Wr}=qr.actions,Gr=qr.reducer,Kr={error:void 0},Jr=Zn({name:"interrupt",initialState:Kr,reducers:{setInterrupt:(e,t)=>{e.error=t.payload},clearInterrupt:()=>Kr},extraReducers:e=>{e.addCase(zr.fulfilled,(()=>Kr)).addMatcher(cr($r.rejected,dr.rejected,hr.rejected,Ur.rejected,Fr.rejected),((e,{payload:t})=>{e.error=t}))}}),{setInterrupt:Xr,clearInterrupt:Qr}=Jr.actions,Yr=Jr.reducer,Zr=({type:n,payload:r})=>n===e.message&&!r.fromClient||n===e.info&&r.type===t,eo=e=>e.sort((({payload:{occurredAt:e}},{payload:{occurredAt:t}})=>e-t)),to=(e,t)=>{if(!e)return{participants:{},currentAgent:""};const{participants:n}=e||{participants:{}},{id:r,avatar:o,name:i,introduction:a}=t.participant,s=n[r],c=Object.assign(Object.assign({},n),{[r]:s?Object.assign(Object.assign(Object.assign(Object.assign({},s),o?{avatar:o}:{}),i?{name:i}:{}),a?{introduction:a}:{}):t.participant});return Object.assign(Object.assign({},e),{participants:c,currentAgent:e.currentAgent===r||t.fromClient?e.currentAgent:r})},no=(e,t)=>{const n="message"===(null==t?void 0:t.type)?null==t?void 0:t.payload.entry:{},{blockAutoEntrySwitch:r}=e;if(!n)return Object.assign(Object.assign({},e),{optionsOverride:{}});const{type:o,options:i}=n;let a=e.active;return r||o===e.userSelected||(a=o),Object.assign(Object.assign({},e),{active:a,optionsOverride:Object.assign(Object.assign({},e.optionsOverride),{[o]:i||{}})})},ro={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:""},participantInfo:{participants:{},currentAgent:""},headerTitles:{title:null,subTitle:""},historyLoaded:!1,skiplinkTargetId:J(),optionsButtonId:J(),headerCollapseButtonId:J(),serviceData:{},options:{features:{},panelActive:!1,optionActive:"",userSelectedOptions:{}},showFileUpload:!1,currentUploads:[],entryMeta:{default:o,active:o,userSelected:null,blockAutoEntrySwitch:!1,options:{},optionsOverride:{}},seamlyContainerElement:null},oo=Zn({name:"store",initialState:ro,reducers:{addEvent:(t,n)=>{var r,o;const{type:c,payload:l}=n.payload,u=t.options.features.hasOwnProperty(j);let p=Object.assign({},t.options);if(u&&(c===e.message||c===e.participant)&&!l.fromClient){const e="message"===c?null===(r=l.entry)||void 0===r?void 0:r.type:{};p=Object.assign(Object.assign({},p),{features:Object.assign(Object.assign({},p.features),{uploads:Object.assign(Object.assign({},null===(o=p.features)||void 0===o?void 0:o.uploads),{enabledFromEntry:e===i})})})}const d=Zr(n.payload);if(t.events.find((e=>e.payload.id===l.id)))return;const f=no(t.entryMeta,n.payload);t.entryMeta=u||f.active!==i?f:Object.assign({},t.entryMeta),t.options=p,d&&(t.unreadEvents+=1,"service_data"!==c&&(n.payload.payload.messageStatus=l.fromClient?s:a)),n.payload.payload.key=J(),t.events.push(n.payload),t.isLastEventFromClient=l.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:o}=t;n&&(n.payload.id=r,n.payload.occurredAt=o,e.events=eo(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===a&&{messageStatus:s})),e)))},setLoadedImageEventIds:(e,{payload:t})=>{e.loadedImageEventIds.push(t)},setHistory:(e,{payload:{events:n,participants:r,activeServiceSessionId:o,activeServiceSettings:s={},serviceData:c,resumeConversationPrompt:l}})=>{var u,p;const d=((e,t)=>{const n=e.filter((e=>!t.some((t=>t.payload.id===e.payload.id)))),r=t.filter((e=>!("participant"===e.type&&!e.payload.participant.introduction))).reverse();return eo([...r,...n])})(e.events,n),f=Object.assign(Object.assign({},e.participantInfo.participants),r),h=d.slice().reverse().find((e=>("message"===e.type||"participant"===e.type)&&!e.payload.fromClient));let y=null;h&&("message"===h.type&&(y=h.payload.participant),"participant"===h.type&&(y=h.payload.participant.id));const{entry:m}=s,b=null===(u=null==m?void 0:m.options)||void 0===u?void 0:u.upload,v=no(Object.assign(Object.assign(Object.assign({},e.entryMeta),m),{active:(null==m?void 0:m.default)||t,options:Object.assign({},(null==m?void 0:m.options)?m.options:{})}),d[d.length-1]);let g=Object.assign({},e.options.features);const w=g.hasOwnProperty(j);if(w&&"message"===(null==h?void 0:h.type)){const{payload:e}=h,t=(null===(p=null==e?void 0:e.entry)||void 0===p?void 0:p.type)||{};g=Object.assign(Object.assign({},g),{uploads:{enabled:!(!b||!(null==b?void 0:b.enabled)),enabledFromEntry:t===i}})}e.unreadEvents=d.filter((e=>"message"===e.type&&e.payload.messageStatus===a)).length,e.events=d.filter((e=>"participant"!==e.type||!!e.payload.participant.introduction)),e.participantInfo=Object.assign(Object.assign(Object.assign({},e.participantInfo),y?to(e.participantInfo,{participant:f[y]}):{}),{participants:f}),e.historyLoaded=!0,e.serviceInfo=Object.assign(Object.assign({},e.serviceInfo),{activeServiceSessionId:o}),e.serviceData=Object.assign(Object.assign({},e.serviceData),c),e.options=Object.assign(Object.assign({},e.options),{features:g||{}}),e.entryMeta=w||v.active!==i?v:Object.assign({},e.entryMeta),e.resumeConversationPrompt=l||!1,y&&(e.headerTitles.subTitle=f[y].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=B(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=to(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.initialState,e.unreadEvents=ro.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={}},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={}},setActiveEntryType:(e,{payload:t})=>{e.entryMeta.active=t},setUserEntryType:(e,{payload:t})=>{e.entryMeta.userSelected=t},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))},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}},extraReducers:e=>{e.addCase(zr.pending,(()=>ro)).addCase(dr.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($r.fulfilled,((e,{payload:t})=>{t.initialState&&(e.initialState=t.initialState)})).addMatcher(cr(yo,mo),(e=>{e.isLastEventFromClient=!1}))}}),{ackEvent:io,addEvent:ao,clearAllUploads:so,clearEvents:co,clearFeatures:lo,clearIdleDetachCountdown:uo,clearResumeConversationPrompt:po,decrementIdleDetachCountdownCounter:fo,hideOption:ho,initIdleDetachCountdown:yo,initResumeConversationPrompt:mo,registerUpload:bo,resetHistoryLoadedFlag:vo,setActiveEntryType:go,setActiveService:wo,setBlockAutoEntrySwitch:jo,setEventsRead:Oo,setFeatureEnabledState:xo,setFeatures:So,setHeaderSubTitle:_o,setHeaderTitle:Eo,setHistory:Co,setInitialState:Po,setIsLoading:To,setLoadedImageEventIds:ko,setParticipant:Ao,setSeamlyContainerElement:No,setServiceDataItem:Io,setServiceEntryMetadata:Ro,setUploadComplete:Do,setUploadError:Mo,setUploadProgress:Lo,setUserEntryType:Uo,setUserSelectedOption:Fo,setUserSelectedOptions:Bo,showOption:$o,stopIdleDetachCountdownCounter:zo}=oo.actions,Ho=oo.reducer;const Vo=Object.assign(Object.assign({},{namespace:"default",layoutMode:"window",messages:{agent:{showAvatar:!1,showName:!1},user:{showAvatar:!1,showName:!1},timeIndicator:{enabled:!1,threshold:36e5}}}),{api:{domain:"",key:"",secure:!0},hideOnNoUserResponse:!1,connectWhenInView:!0,showDisclaimer:!1,showFaq:!1,showSuggestions:!0,customComponents:{},defaults:{visible:null},preChatEvents:[]}),qo=["hideOnNoUserResponse","connectWhenInView","showDisclaimer","showFaq","showSuggestions","namespace","customComponents","defaults","layoutMode","api","zIndex","context","appContainerClassNames","messages","visible","visibilityCallback","errorCallback","agentParticipant","userParticipant","startChatIcon"],Wo=(e,t)=>{const n=(i=t,qo.reduce(((e,t)=>(t in i&&(e[t]=i[t]),e)),{})),{messages:r}=n,o=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 o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}(n,["messages"]);var i;let a=e;return Object.keys(o).length>0&&(a=Object.assign(Object.assign({},a),o)),r&&(a=Object.assign(Object.assign({},a),{messages:Object.assign(Object.assign({},a.messages),r)})),a},Go=Zn({name:"config",initialState:Vo,reducers:{setConfig:(e,{payload:t})=>Wo(e,t),updateConfig:(e,{payload:t})=>Wo(e,t),setPreChatEvents:(e,{payload:t})=>{e.preChatEvents=t}},extraReducers:e=>{e.addCase(fr.fulfilled,(e=>e)).addCase(dr.fulfilled,((e,{payload:{preChat:t,agentParticipant:n,userParticipant:r,startChatIcon:o}})=>{e.preChatEvents=t.map((e=>({type:"message",payload:e}))),e.agentParticipant=n,e.userParticipant=r,e.startChatIcon=o}))}}),{setConfig:Ko,updateConfig:Jo,setPreChatEvents:Xo}=Go.actions,Qo=Go.reducer;class Yo extends I{constructor(e,...t){super(e,...t),this.name="SeamlyOfflineError",this.langKey="errors.seamlyOffline"}}const Zo={SeamlyGeneralError:D,SeamlyConfigurationError:R,SeamlySessionExpiredError:M,SeamlyOfflineError:Yo,SeamlyUnauthorizedError:L,SeamlyUnavailableError:ur},ei=Qn("catch-error",(e=>({payload:e})));function ti({api:e}){return({getState:t})=>{const n=n=>{const{errorCallback:r,namespace:o,api:i,layoutMode:a}=Or(t()),{error:s,type:c}=n,l=Zo[null==s?void 0:s.name]?new Zo[s.name](s):new I(s);null==r||r(l,{namespace:o,api:i,layoutMode:a,conversationUrl:e.getConversationUrl(),action:c?n:void 0})};return e=>t=>{var r,o,i,a,s,c;try{return(null===(o=null===(r=t.payload)||void 0===r?void 0:r.originalEvent)||void 0===o?void 0:o.payload)?n({error:t.payload,type:null===(s=null===(a=null===(i=t.payload)||void 0===i?void 0:i.originalEvent)||void 0===a?void 0:a.payload)||void 0===s?void 0:s.type}):(null===(c=t.payload)||void 0===c?void 0:c.originalError)&&n({error:t.payload,type:void 0}),e(t)}catch(e){throw n({error:e}),e}}}}const ni={controls:{}},ri={value:"",touched:!1},oi={controls:ri},ii=Zn({name:"forms",initialState:oi,reducers:{registerForm:(e,{payload:{persistData:t,formId:n}})=>{var r;const o=t&&null!==(r=e[n])&&void 0!==r?r:Object.assign(Object.assign({},ni),{persistData:t});e[n]=o},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]:ri}},deregisterControl:(e,{payload:{name:t,formId:n}})=>{const r=e[n];if(!r)return e;if(r.persistData)return e;const o=Object.assign({},r.controls);return delete o[t],Object.assign(Object.assign({},e),{[n]:Object.assign(Object.assign({},r),{controls:o})})},updateControlValue:(e,{payload:{formId:t,name:n,value:r}})=>{var o;(null===(o=e[t])||void 0===o?void 0:o.controls)&&(e[t].controls[n].value=r)},updateControlTouched:(e,{payload:{formId:t,name:n,touched:r}})=>{var o;(null===(o=e[t])||void 0===o?void 0:o.controls[n])&&(e[t].controls[n].touched=r)}},extraReducers:e=>{e.addCase(zr.pending,(()=>oi))}}),{registerForm:ai,deregisterForm:si,registerControl:ci,deregisterControl:li,updateControlValue:ui,updateControlTouched:pi}=ii.actions,di=ii.reducer,fi=Zn({name:"app",initialState:{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,locale:void 0},reducers:{setInitialLocale:(e,t)=>{e.initialLocale=t.payload},setTranslations:(e,{payload:t})=>{e.translations=t}},extraReducers:e=>{e.addCase(dr.fulfilled,((e,{payload:t})=>{e.initialLocale=t.locale})).addCase(hr.pending,(e=>{e.isLoading=!0})).addCase(hr.rejected,(e=>{e.isLoading=!1})).addCase(hr.fulfilled,((e,{payload:t})=>{e.isLoading=!1,(null==t?void 0:t.translations)&&(e.locale=t.locale,e.translations=Object.keys(t.translations).sort().reduce(((e,n)=>Object.assign(Object.assign({},e),{[n]:t.translations[n]})),{}))}))}}),{setInitialLocale:hi,setTranslations:yi}=fi.actions,mi=fi.reducer,bi=[D,R,M,Yo,L,ur];function vi({api:e}){return()=>t=>n=>{const{payload:r,type:o}=n;if(o===Xr.type){if(!bi.some((e=>r.name===e.name)))throw new D(r);"reset"===r.action&&e.disconnect().then((()=>{e.clearStore()}))}return t(n)}}function gi(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 wi(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?gi(Object(n),!0).forEach((function(t){ji(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):gi(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function ji(e,t,n){return t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Oi({api:e}){return()=>t=>n=>{const r=t(n);switch(n.type){case Bo.toString():e.store.set("options",n.payload);break;case Fo.toString():e.store.set("options",wi(wi({},e.store.get("options")||{}),{},{[n.payload.option]:n.payload.value}))}return r}}const xi=wr((({i18n:e})=>e),(({translations:e})=>e)),Si=wr((({i18n:e})=>e),(({initialLocale:e})=>e)),_i=wr((({i18n:e})=>e),(({locale:e})=>e)),Ei=wr((({i18n:e})=>e),(({isLoading:e})=>e)),Ci={isActive:!1,currentLocale:void 0,isAvailable:!1,languages:[],containerId:er(),translatedEventGroups:{},translationProposal:null},Pi=(e,t)=>{const n=[...e].reduce(((e,{payload:n},r,o)=>{var i;if(e[t]){if("divider"===(null==n?void 0:n.type)&&(null===(i=null==n?void 0:n.body)||void 0===i?void 0:i.translationEnabled))return o.splice(0),e;e[t].push(n.id)}return n.id===t&&(e[t]=[]),e}),{}),[[r,o]]=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:o}},Ti=Zn({name:"translation",initialState:Ci,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}=Pi(t,n);e.lastGroupId=r},disableEventsTranslation:(e,{payload:{events:t,id:n}})=>{const{lastGroupId:r,groupId:o,eventIds:i}=Pi(t,n);e.lastGroupId=r,e.translatedEventGroups[o]=i},disableTranslationProposalPrompt:e=>{e.translationProposal=null},setTranslationProposalPrompt:(e,{payload:t})=>{e.translationProposal=t}},extraReducers:e=>{e.addCase(dr.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)})).addCase(Co,((e,{payload:t})=>{e.translationProposal=t.translationProposal})).addCase(ao,((e,{payload:t})=>{e.translatedEventGroups[e.lastGroupId]&&e.translatedEventGroups[e.lastGroupId].push(t.payload.id)}))}}),{enableTranslation:ki,disableTranslation:Ai,enableEventsTranslation:Ni,disableEventsTranslation:Ii,setTranslationProposalPrompt:Ri,disableTranslationProposalPrompt:Di}=Ti.actions,Mi=Ti.reducer;function Li({dispatch:e,getState:t}){return n=>r=>{const o=n(r),{payload:i}=r;switch(r.type){case Co.type:i?.translation?.enabled&&(e(ki(i.translation.locale)),e(hr(i.translation.locale)));break;case dr.fulfilled.type:i.locale&&e(hr(i.locale));break;case Po.type:i?.translation?.enabled&&(e(ki(i.translation.locale)),e(hr(i.locale)));break;case ao.type:"info"===i.type&&"new_translation"===i?.payload?.body?.subtype&&i.payload.body.translationEnabled&&e(hr(i.payload.body.translationLocale));break;case Ai.type:const n=Si(t());e(hr(n))}return o}}const Ui=Zn({name:"visibility",initialState:{visibility:S.initialize,showInlineView:!1},reducers:{setShowInlineView:e=>{e.showInlineView=!0}},extraReducers:e=>{e.addCase(Ur.fulfilled,((e,{payload:t})=>{t&&(e.visibility=t)})).addCase(dr.fulfilled,((e,{payload:t})=>{t.connectWhenInView||(e.showInlineView=!t.connectWhenInView)}))}}),{setShowInlineView:Fi}=Ui.actions,Bi=Ui.reducer,$i=mt,zi=()=>{const e=$i(),t=ct(Dr),n=!!t&&t!==S.hidden,r=t===S.open,o=t===S.minimized,i=(0,Qe.useCallback)((t=>e(Ur(t))),[e]);return{isVisible:n,isOpen:r,isMinimized:o,visible:t,setVisibility:i,openChat:()=>{i(S.open)},closeChat:()=>{i(S.minimized)}}},Hi=({freezeOnceVisible:e=!1,enabled:t=!0,containerRef:n=(0,Xe.createRef)()})=>{const[r,o]=(0,Qe.useState)(null),i=!!(null==r?void 0:r.isIntersecting)||!t,a=i&&e,s=([e])=>o(e);return(0,Qe.useEffect)((()=>{const e=null==n?void 0:n.current;if(!window.IntersectionObserver||a||!e||!t)return()=>{};const r=new IntersectionObserver(s,{threshold:0,root:null,rootMargin:"0%"});return r.observe(e),()=>r.disconnect()}),[n,t,a]),{isVisible:i,containerRef:n}},Vi=()=>(0,Qe.useContext)(vt),qi=()=>Vi().store||{},Wi=()=>{const e=Vi();return(0,Qe.useCallback)((()=>e.hasConversation()),[e])};function Gi(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 Ki(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Gi(Object(n),!0).forEach((function(t){Ji(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Gi(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Ji(e,t,n){return t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Xi=()=>{const e=Vi(),t=xr(),n=mt(),r=(0,Qe.useContext)(gt),o=Hr(),i=Wi(),{visible:a,setVisibility:s}=zi(),c=kr(),p=(0,Qe.useCallback)(((...e)=>{r.emit(...e)}),[r]),d=(0,Qe.useCallback)((()=>{e.sendContext(t.context||{}),p("ui.beforeStart",{visibility:a,hasConversation:i(),hasResponded:o,unreadMessageCount:c}),e.send("start"),p("ui.start",{visibility:a,hasConversation:i(),hasResponded:o,unreadMessageCount:c})}),[e,t.context,p,i,o,c,a]),f=(0,Qe.useCallback)((async()=>{n(zr())}),[n]),h=(0,Qe.useCallback)((e=>({type:e,id:J(),transactionId:J(),participant:P,fromClient:!0,occurredAt:1e3*Date.now(),meta:{}})),[]),y=(0,Qe.useCallback)((e=>Ki(Ki({},h("text")),{},{body:{text:e}})),[h]),m=(0,Qe.useCallback)((({body:t,config:r={}})=>{if(""===t.trim())return;const o=Ki(Ki({},y(t)),r);e.send("message",o),p("message",o),n(ao({type:"message",payload:Ki(Ki({},o),{},{optimisticallyInjected:!0})}))}),[e,n,p,y]),b=(0,Qe.useCallback)(((e,t=J())=>{n(ao({type:"message",payload:Ki(Ki({},y(e)),{},{transactionId:t})}))}),[n,y]),v=(0,Qe.useCallback)(((e,t,r,o,i,a,s)=>{n(ao({type:"message",payload:{type:"upload",id:e,transactionId:t,participant:P,fromClient:!0,occurredAt:r,meta:{},body:{contentType:o,filename:i,filesize:a,url:s}}}))}),[n]),g=(0,Qe.useCallback)(((e,t=J())=>{const r={body:{subtype:e,type:"divider"},fromClient:!1,fromHistory:!0,id:J(),transactionId:t,type:"divider"};n(ao({type:"info",payload:r}))}),[n]),w=(0,Qe.useCallback)((t=>{if(!t)return;e.send("action",t);const{type:n}=t;n!==l&&n!==u&&p(`action.${n}`,t)}),[e,p]),j=(0,Qe.useCallback)((t=>{e.sendContext(t)}),[e]),O=(0,Qe.useCallback)((()=>e.connected?Promise.reject(new Error("The API is already connected")):e.connect().then((e=>{e&&(n(Po(e)),e.userResponded&&(n(Wr(e.userResponded)),s(S.open)))})).catch((e=>{n(Xr({name:e?.name,message:e?.message,langKey:e?.langKey,action:e?.action,originalEvent:e?.originalEvent,originalError:e?.originalError}))}))),[e,n,s]);return{connect:O,start:d,sendMessage:m,sendAction:w,sendContext:j,reset:f,emitEvent:p,addMessageBubble:b,addUploadBubble:v,addDivider:g,apiConnected:e.connected,apiConfigReady:e.configReady}};function Qi(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 Yi(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,s=[],c=!0,l=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=i.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,o=e}finally{try{if(!c&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(l)throw o}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Qi(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)?Qi(e,t):void 0}}(e,t)||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.")}()}function Zi(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ea(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,wn(r.key),r)}}function ta(e){return e.reduce((function(e,t){return e.concat(Array.isArray(t)?ta(t):t)}),[])}function na(e){var t={};return function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];var i=r.length?r.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(t,i))return t[i];var a=e.apply(void 0,r);return t[i]=a,a}}function ra(e){for(var t=function(e){return/\s/.test(e)},n=[],r={},o=0,i=null,a=!1,s=0;s<e.length;){if(a&&(t(e[s])||"{"===e[s]))a=!1,i=e.slice(o,s),"{"===e[s]&&s--;else if(!a&&!t(e[s])){var c="{"===e[s];if(i&&c){var l=oa(e,s);if(-1===l)throw new Error('Unbalanced curly braces in string: "'.concat(e,'"'));r[i]=e.slice(s+1,l),s=l,i=null}else i&&(n.push(i),i=null),a=!0,o=s}s++}return a&&(i=e.slice(o)),i&&n.push(i),{args:n,cases:r}}function oa(e,t){for(var n=0,r=t+1;r<e.length;r++){var o=e.charAt(r);if("}"===o){if(0===n)return r;n--}else"{"===o&&n++}return-1}function ia(e){return aa(e.slice(1,-1),",",3)}function aa(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 o=e.indexOf(t);if(-1===o)return r.push(e),r;var i=e.substring(0,o).trim(),a=e.substring(o+t.length+1).trim();return r.push(i),aa(a,t,n-1,r)}var sa;function ca(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 la(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ca(Object(n),!0).forEach((function(t){jn(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ca(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var ua=0,pa="other";function da(e,t){for(var n=0,r="",o=0,i={};n<e.length;){if("#"!==e[n]||o)r+=e[n];else{var a="__hashToken".concat(ua++);r+="{".concat(a,", number}"),i[a]=t}"{"===e[n]?o++:"}"===e[n]&&o--,n++}return{caseBody:r,numberValues:i}}var fa="other";const ha=new(function(){function e(t){var n=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Zi(this,e),jn(this,"format",na((function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return ta(n.process(e,t)).join("")}))),this.locale=t,this.typeHandlers=r}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=e.indexOf("{");if(-1!==n){var r=oa(e,n);if(-1===r)throw new Error('Unbalanced curly braces in string: "'.concat(e,'"'));var o=e.substring(n,r+1);if(o){var i=[],a=e.substring(0,n);a&&i.push(a);var s=ia(o),c=Yi(s,3),l=c[0],u=c[1],p=c[2],d=t[l];null==d&&(d="");var f=u&&this.typeHandlers[u];i.push(f?f(d,p,this.locale,t,this.process.bind(this)):d);var h=e.substring(r+1);return h&&i.push(this.process(h,t)),i}}return[e]}}],n&&ea(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),e}())("en-GB",{plural:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0,o=arguments.length>4?arguments[4]:void 0,i=ra(t),a=i.args,s=i.cases,c=parseInt(e);a.forEach((function(e){e.startsWith("offset:")&&(c-=parseInt(e.slice("offset:".length)))}));var l=[];if("PluralRules"in Intl){void 0!==sa&&sa.resolvedOptions().locale===n||(sa=new Intl.PluralRules(n));var u=sa.select(c);u!==pa&&l.push(u)}1===c&&l.push("one"),l.push("=".concat(c),pa);for(var p=0;p<l.length;p++){var d=l[p];if(d in s){var f=da(s[d],c),h=f.caseBody,y=f.numberValues;return o(h,la(la({},r),y))}}return e},select:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>3?arguments[3]:void 0,r=arguments.length>4?arguments[4]:void 0,o=ra(t),i=o.cases;return e in i?r(i[e],n):fa in i?r(i[fa],n):e}});function ya(){const e=ct(xi),t=ct(_i),n=ct(Si),r=ct(Ei),o=(0,Qe.useCallback)(((n,o={})=>{const i=e[n];return i?ha.format(i,o):(r||console.warn(`Translation key: ${n} is missing in locale: ${t}`),null)}),[e,t,r]);return{t:o,locale:t,initialLocale:n}}const ma=(0,Xe.createContext)(null),ba=()=>{const e=(0,Qe.useContext)(ma);return{sendPolite:(0,Qe.useCallback)((t=>{t&&e({ariaLive:g,messageText:t})}),[e]),sendAssertive:(0,Qe.useCallback)((t=>{t&&e({ariaLive:v,messageText:t})}),[e])}},va=({children:e})=>((()=>{const e=Pr(),{t}=ya(),{isInline:n,isWindow:r,isApp:o}=Rr(),{isOpen:i,isVisible:a}=zi(),s=ct(Mr),c=mt(),l=(0,Qe.useRef)(null),{start:u,connect:p,apiConfigReady:d,apiConnected:f}=Xi(),h=Wi(),y=(0,Qe.useRef)(!1),{sendAssertive:m}=ba();(0,Qe.useEffect)((()=>{a&&setTimeout((()=>{m(t("window.srTexts.onLoad"))}),500)}),[a,m,t]),(0,Qe.useEffect)((()=>{a&&m(t(i?"window.srTexts.onOpen":"window.srTexts.onClose"))}),[i,a,m,t]),(0,Qe.useEffect)((()=>(l.current=setTimeout((()=>{c(To(!0))}),500),()=>{clearTimeout(l.current)})),[c]),(0,Qe.useEffect)((()=>(e.length&&(l.current=setTimeout((()=>{c(To(!1))}),5e3)),()=>{clearTimeout(l.current)})),[e,c]),(0,Qe.useEffect)((()=>{d&&f||(y.current=!1)}),[d,f]);const b=(0,Qe.useCallback)((async()=>{f||(y.current=!0,await p()),(o||i||a&&n)&&u()}),[f,p,o,n,i,a,u]);(0,Qe.useEffect)((()=>{d&&!y.current&&(!r||i||h())&&(!n||a&&s)&&(h()&&i&&(clearTimeout(l.current),c(To(!1))),b())}),[d,b,c,h,n,i,r,a,s])})(),(0,k.jsx)(k.Fragment,{children:e})),ga=(0,Xe.createContext)({}),wa=()=>xr().appContainerClassNames,ja=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},Oa=(e=0)=>new Promise((t=>{setTimeout(t,e)})),xa=()=>{const{seamlyContainerElement:e}=_r(),t=mt();return[e,(0,Qe.useCallback)((e=>{t(No(e))}),[t])]},Sa=e=>(0,Qe.useCallback)((()=>{var t;t=e,requestAnimationFrame((async()=>{await Oa(180);const e="string"==typeof t?document.getElementById(t):t;q(e)}))}),[e]),_a=()=>{const e=Ar();return Sa(e)},Ea=(0,Xe.createContext)({});function Ca(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 Pa(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ca(Object(n),!0).forEach((function(t){Ta(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ca(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Ta(e,t,n){return t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const ka=()=>{const{showFileUpload:e,entryMeta:{options:t,optionsOverride:n},options:{features:{uploads:r}}}=_r(),{allowedMimeTypes:o,maxSize:i}=n.upload||{},{enabled:a,enabledFromEntry:s}=r||{},{allowedMimeTypes:c,maxSize:l}=Pa(Pa(Pa({},t.upload||{allowedMimeTypes:[],maxSize:0}),o?{allowedMimeTypes:o}:{}),i?{maxSize:i}:{});return{showFileUpload:e,accountAllowsUploads:!!r,serviceAllowsUploads:s||a,allowedMimeTypes:c,maxSize:l}},Aa=()=>{const{currentUploads:e}=_r(),t=mt(),n=(0,Qe.useContext)(Ea);return{uploadFile:(0,Qe.useCallback)((e=>{n(e)}),[n]),clearUploads:(0,Qe.useCallback)((()=>{t(so())}),[t]),currentUploads:e,isUploading:e.some((e=>e.uploading)),isComplete:e.every((e=>e.complete))}};function Na(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 Ia(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Na(Object(n),!0).forEach((function(t){Ra(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Na(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Ra(e,t,n){return t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Da=()=>{const{t:e}=ya(),{options:t}=_r(),{panelActive:n,optionActive:r,userSelectedOptions:o,features:i}=t,{extraMenuItem:a,sendTranscript:s}=i,c={extraMenuItem:a,sendTranscript:s},l=t=>"extraMenuItem"===t?"Extra menu item":e(`options.${t}.menuTitle`),u=Object.keys(c).filter((e=>c[e])).map((e=>({name:e,title:l(e),available:c[e].enabled}))),p=a||s,d=mt(),{get:f,set:h}=qi();return{allowOptionSelection:p,userSelectedOptions:o,features:i,menuOptions:u,initUserSelectedOptions:(0,Qe.useCallback)((()=>{const e=f("options")||{};d(Bo(e))}),[f,d]),setUserSelectedOptions:(0,Qe.useCallback)((e=>{d(Bo(e)),h("options",e)}),[h,d]),setUserSelectedOption:(0,Qe.useCallback)(((e,t)=>{const n=f("options")||{};h("options",Ia(Ia({},n),{},{[e]:t})),d(Fo({option:e,value:t}))}),[d,f,h]),showOption:e=>{d($o(e))},hideOption:()=>{d(ho())},panelActive:n,optionActive:r}},Ma=()=>{const{optionsButtonId:e}=_r();return{id:e,focusButton:Sa(e)}},La=(0,Xe.createContext)(null),Ua=()=>(0,Qe.useContext)(La);function Fa(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 Ba(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Fa(Object(n),!0).forEach((function(t){$a(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Fa(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function $a(e,t,n){return t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const za=()=>{const e=mt(),{idleDetachCountdown:t}=_r(),{isOpen:n}=zi(),r=(0,Qe.useRef)({});r.current={hasCountdown:t.hasCountdown,isActive:t.isActive,remaining:t.remaining,wasStopped:t.wasStopped,isOpen:n};const{emitEvent:o,sendAction:i}=Xi(),{t:a}=ya(),{sendAssertive:s,sendPolite:c}=ba(),l=(0,Qe.useCallback)((e=>{const{isOpen:t}=r.current;t&&s(e)}),[s]),u=(0,Qe.useCallback)((e=>{const{isOpen:t}=r.current;t&&c(e)}),[c]),d=(0,Qe.useCallback)((t=>{const n=(e=>Math.ceil(e/1e3))(t),r=B(n);e(yo({delaySeconds:n,delayTime:r})),o("idleTimer.start"),l(`${a("idleDetachWarning.countdownTitle")} ${a("idleDetachWarning.countdownText")} ${a("idleDetachWarning.countdownTimer",r)}`)}),[e,o,l,a]),f=(0,Qe.useCallback)(((t,n)=>{const{hasCountdown:s,wasStopped:c}=r.current;s&&(t||(n||i({type:p}),l(a("idleDetachWarning.notifyTransferText"))),c||o("idleTimer.stop"),e(uo()))}),[e,i,o,l,a]),h=(0,Qe.useCallback)((()=>{const{remaining:t}=r.current;if(t<=0)return;const n=t-1;n%10==0&&l(`${a("idleDetachWarning.countdownText")} ${a("idleDetachWarning.countdownTimer",B(n))}`),e(fo())}),[e,l,a]),y=(0,Qe.useCallback)((()=>{const{isActive:t,remaining:n}=r.current;t&&(e(zo()),n&&(o("idleTimer.stop"),u(a("idleDetachWarning.srCountDownStoppedText"))))}),[e,o,u,a]);return Ba(Ba({},t),{},{initCountdown:d,endCountdown:f,decrementCountdown:h,stopCountdown:y})},Ha=()=>{const e=mt(),t=_r().resumeConversationPrompt,{sendAction:n}=Xi(),{t:r}=ya(),{sendAssertive:o}=ba();return{continueChat:()=>{n({type:d,body:{type:"resume_conversation_prompt"}}),e(po())},hasPrompt:t,restartChat:()=>{o(r("resumeConversationPrompt.srNotifyRestartText")),n({type:p}),e(po())}}},Va=()=>{const[e]=(0,Qe.useState)((()=>J()));return e},qa=e=>{const t=(0,Qe.useRef)(null);t.current=e;const n="function"==typeof e;return(0,Qe.useMemo)((()=>n?(...e)=>t.current(...e):void 0),[n])};function Wa(){const{sendAction:e}=Xi(),t=mt(),n=(0,Qe.useCallback)(((n,r="translation_choice")=>{e({type:h,body:{enabled:!0,locale:n,source:r}}),t(ki(n)),t(Di())}),[e,t]),r=(0,Qe.useCallback)((()=>{e({type:h,body:{enabled:!1}}),t(Ai())}),[e,t]),{languages:o,isActive:i,isAvailable:a,currentLocale:s}=ct((({translations:e})=>e));return{languages:o,isActive:i,isAvailable:a,currentLocale:s,enableTranslations:n,disableTranslations:r}}function Ga(e){const{translatedBody:t,body:n}=e.payload?"participant"===e.type?{body:null===(r=e.payload)||void 0===r?void 0:r.participant.introduction,translatedBody:null===(i=null===(o=e.payload)||void 0===o?void 0:o.participant)||void 0===i?void 0:i.translatedIntroduction}:{body:e.payload.body,translatedBody:e.payload.translatedBody}:{body:void 0,translatedBody:void 0};var r,o,i;const a=!!t,s=ct((e=>wr((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)})))))(e));return{body:a&&s?null==t?void 0:t.data:n,hasTranslation:a,isTranslated:s&&a,locale:null==t?void 0:t.locale}}function Ka(){const e=ct((({translations:e})=>e.containerId));return{id:e,focusContainer:Sa(e)}}function Ja(e){const{languages:t}=Wa();return(0,Qe.useMemo)((()=>{var n;return null===(n=null==t?void 0:t.find((t=>t.locale===e)))||void 0===n?void 0:n.nativeName}),[e,t])}const Xa=({eventPayload:e})=>{const{t}=ya(),{fromClient:n,participant:r}=e,o=(e=>_r().participantInfo.participants[e])(r)||{},{messages:i}=xr(),a=n?t("participants.user.name"):o&&o.name,{showAvatar:s,showName:c}=i[n?"user":"agent"]||{};if(!s&&!c)return null;const l=[];return s&&a&&o.avatar&&l.push((0,k.jsx)("span",{className:T("message__avatar"),children:(0,k.jsx)("img",{src:o.avatar,className:T("avatar"),alt:""})})),c&&l.push((0,k.jsx)("span",{className:T("message__author-name"),children:a})),l.length>0&&(0,k.jsx)("div",{className:T("message__author"),children:l})},Qa=["showParticipant","event","type","modifiers","children","bodyProps","info"];function Ya(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 Za(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ya(Object(n),!0).forEach((function(t){es(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ya(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function es(e,t,n){return t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const ts=function(e){let{showParticipant:t=!0,event:n,type:r,modifiers:o,children:i,bodyProps:a={},info:s}=e,c=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,Qa);const l=ja(n),{hasTranslation:u,isTranslated:p,locale:d}=Ga(n);return r&&l.push(`message--type-${r}`),o&&("string"==typeof o&&(o=o.split(" ").filter((e=>e.length))),o.forEach((e=>{l.push(`message--${e}`)}))),p&&l.push("message--is-translated"),u&&l.push("message--has-translation"),p&&(a=Za(Za({},a),{},{lang:d})),(0,k.jsx)(k.Fragment,{children:(0,k.jsxs)("div",Za(Za({className:T(l)},c),{},{children:[t&&(0,k.jsx)(Xa,{eventPayload:n.payload}),(0,k.jsx)("div",Za(Za({className:T("message__body")},a),{},{children:i})),s&&(0,k.jsx)("div",{"aria-hidden":"true",className:T("message__info"),children:s})]}))})};function ns(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 rs(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ns(Object(n),!0).forEach((function(t){os(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ns(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function os(e,t,n){return t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const is=({id:e,action:t,buttonText:n,description:r,hasFocus:o,image:i,title:a,isCarouselItem:s})=>{const c=(0,Qe.useRef)(null),{sendMessage:l,sendAction:u,emitEvent:p}=Xi(),d=Va(),h=(0,Qe.useRef)(),m=t.type===O?"a":"button",b=(0,Qe.useCallback)((()=>p("action.click_card",{type:y,originMessage:e,action:t})),[p,e,t]),v=(0,Qe.useCallback)((()=>{if(b(),"ask"===t.type)l({body:t.ask});else if("topic"===t.type){const{topic:e,fallbackMessage:n}=t;u({type:f,body:{name:e,fallbackMessage:n}})}}),[l,t,u,b]),g=(0,Qe.useMemo)((()=>t.type===O?{href:t.link,rel:"noopener noreferrer",target:t.newTab?"_blank":"_self",onClick:b}:{onClick:v}),[t,v,b]);return(0,Qe.useEffect)((()=>{s&&(o&&h.current?window.requestAnimationFrame((()=>c.current.focus())):c.current.blur()),h.current=!0}),[o,s]),(0,k.jsxs)("div",{className:T("card__wrapper"),id:e,tabIndex:"-1",ref:c,children:[(0,k.jsx)("img",{className:T("card__image"),src:i,alt:""}),(0,k.jsxs)("div",{className:T("card__content"),id:e,children:[a&&(0,k.jsx)("h2",{className:T("card__title"),children:a}),r&&(0,k.jsx)("div",{className:T("card__description"),dangerouslySetInnerHTML:{__html:r}}),(0,k.jsx)(m,rs(rs({tabIndex:s&&!o?"-1":void 0,className:T("button","button--primary"),"aria-describedby":d},g),{},{children:n}))]})]})};function as(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 ss(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?as(Object(n),!0).forEach((function(t){cs(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):as(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function cs(e,t,n){return t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ls(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 us(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ls(Object(n),!0).forEach((function(t){ps(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ls(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function ps(e,t,n){return t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ds({item:e,items:t,index:n,isActive:r}){const{t:o}=ya();return(0,k.jsx)("div",{className:T("carousel-item",`carousel-item--${e.type}`),role:"group","aria-roledescription":"slide","aria-label":o("carousel.slide.label",{index:n+1,total:t.length}),children:(0,k.jsx)(is,us(us({},e),{},{isCarouselItem:!0,hasFocus:r}))})}const fs={send32:'<svg xmlns="http://www.w3.org/2000/svg" width="32px" height="32px" x="0px" y="0px" viewBox="0 0 32 32"><defs/><path fill="#4A48C1" d="M6.714,14.985l17.837-7.906c0.681-0.302,1.414,0.301,1.25,1.027L22.273,23.59\tc-0.13,0.566-0.751,0.865-1.275,0.613l-3.623-1.752l-2.334,2.287c-0.572,0.562-1.538,0.156-1.538-0.645V21.01\tc0-0.217,0.078-0.43,0.222-0.594l7.676-8.841l-10.414,7.472l-4.351-2.445C5.987,16.236,6.033,15.287,6.714,14.985L6.714,14.985z"/></svg>',balloon32:'<svg xmlns="http://www.w3.org/2000/svg" width="32px" height="32px" x="0px" y="0px" viewBox="0 0 32 32"><defs/><path fill="#4A48C1" d="M24,10.824v10.375c0,1.104-0.896,2-2,2h-4.694l-4.931,3.625v-3.625H10c-1.104,0-2-0.896-2-2V10.824\tc0-1.104,0.896-2,2-2h12C23.104,8.824,24,9.719,24,10.824z"/></svg>',newTopic32:'<svg xmlns="http://www.w3.org/2000/svg" width="32px" height="32px" x="0px" y="0px" viewBox="0 0 32 32"><path fill="#4A48C1" d="M16,8.593l2.407,4.573l5.093,0.876l-3.604,3.702l0.74,5.115L16,20.574l-4.634,2.285l0.739-5.115L8.5,14.042\tl5.094-0.876L16,8.593z"/></svg>',newTranslation16:'<svg xmlns="http://www.w3.org/2000/svg" x="0px" y="0px" viewBox="0 0 16 16"><path fill="#4A48C1" d="M8,0C3.6,0,0,3.6,0,8s3.6,8,8,8s8-3.6,8-8S12.4,0,8,0z M14.1,7.1h-1.4c-0.1-1.5-0.4-2.9-1-4\tC13,4,13.9,5.4,14.1,7.1z M7.1,2.1v5H5C5.2,4.7,6.1,2.9,7.1,2.1z M7.1,8.9v5c-1-0.7-1.9-2.5-2.1-5H7.1z M8.9,13.9v-5H11\tC10.8,11.3,9.9,13.2,8.9,13.9z M8.9,7.1v-5c1,0.7,1.9,2.5,2.1,5H8.9z M4.2,3.1c-0.5,1.1-0.9,2.5-1,4H1.9C2.1,5.4,3,4,4.2,3.1z M1.9,8.9h1.4c0.1,1.5,0.4,2.9,1,4C3,12,2.1,10.5,1.9,8.9z M11.8,12.9c0.5-1.1,0.9-2.5,1-4h1.4C13.9,10.5,13,12,11.8,12.9z"/></svg>',newTranslation32:'<svg xmlns="http://www.w3.org/2000/svg" x="0px" y="0px" viewBox="0 0 32 32"><path fill="#4A48C1" d="M16,7c-4.9,0-9,4.1-9,9s4.1,9,9,9s9-4.1,9-9S20.9,7,16,7z M22.9,15h-1.6c-0.1-1.7-0.5-3.3-1.1-4.5\tC21.6,11.5,22.6,13.1,22.9,15z M15,9.4V15h-2.3C12.9,12.3,13.9,10.2,15,9.4z M15,17v5.6c-1.1-0.8-2.1-2.9-2.3-5.6H15z M17,22.6V17\th2.3C19.1,19.8,18.1,21.8,17,22.6z M17,15V9.4c1.1,0.8,2.1,2.9,2.3,5.6H17z M11.8,10.4c-0.6,1.3-1,2.8-1.1,4.5H9.1\tC9.4,13.1,10.4,11.5,11.8,10.4z M9.1,17h1.6c0.1,1.7,0.5,3.3,1.1,4.5C10.4,20.5,9.4,18.9,9.1,17z M20.2,21.5c0.6-1.3,1-2.8,1.1-4.5\th1.6C22.6,18.8,21.6,20.5,20.2,21.5z"/></svg>',avatar32:'<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"\n\t viewBox="0 0 32 32" enable-background="new 0 0 32 32" xml:space="preserve">\n<path fill="#4A48C1" d="M10,14.8c-1.1,0-2-0.9-2-2s0.9-2,2-2s2,0.9,2,2S11.1,14.8,10,14.8z M15.9,14.8c1.1,0,2-0.9,2-2s-0.9-2-2-2\n\ts-2,0.9-2,2S14.8,14.8,15.9,14.8z M21.8,10.8c-1.1,0-2,0.9-2,2s0.9,2,2,2s2-0.9,2-2S22.9,10.8,21.8,10.8z M21.3,18.1H10.7\n\tC11.7,23.9,20.2,23.9,21.3,18.1z"/>\n</svg>\n',chevronDown8:'<svg xmlns="http://www.w3.org/2000/svg" width="8px" height="8px" x="0px" y="0px" viewBox="0 0 8 8"><defs/><path fill="#4A48C1" d="M-0.001,2.876c0-0.247,0.091-0.494,0.273-0.688c0.38-0.401,1.013-0.418,1.414-0.039l1.938,1.834\tc0.199,0.188,0.547,0.188,0.746,0L6.31,2.15c0.401-0.379,1.034-0.362,1.414,0.04c0.379,0.401,0.361,1.034-0.04,1.414L5.745,5.437\tC4.782,6.35,3.213,6.35,2.249,5.436L0.311,3.603C0.103,3.406-0.001,3.142-0.001,2.876z"/></svg>',chevronDown32:'<svg xmlns="http://www.w3.org/2000/svg" width="32px" height="32px" x="0px" y="0px" viewBox="0 0 32 32"><defs/><path fill="#4A48C1" d="M16,20.425c-0.782,0-1.563-0.291-2.159-0.874l-6.541-6.408c-0.395-0.387-0.401-1.02-0.015-1.414\tc0.387-0.394,1.021-0.4,1.414-0.015l6.541,6.408c0.42,0.409,1.102,0.409,1.52-0.001l6.541-6.407c0.396-0.386,1.028-0.38,1.414,0.015\tc0.387,0.395,0.381,1.027-0.014,1.414l-6.541,6.407C17.563,20.133,16.782,20.425,16,20.425z"/></svg>',chevronRight8:'<svg xmlns="http://www.w3.org/2000/svg" width="8px" height="8px" x="0px" y="0px" viewBox="0 0 8 8"><defs/><path fill="#4A48C1" d="M2.875,7.998c-0.247,0-0.494-0.091-0.688-0.273c-0.401-0.38-0.418-1.013-0.039-1.414l1.834-1.938\tc0.188-0.199,0.188-0.547,0-0.746l-1.835-1.94c-0.379-0.401-0.362-1.034,0.04-1.414s1.034-0.361,1.414,0.04l1.834,1.939\tc0.913,0.963,0.913,2.532-0.001,3.496L3.601,7.686C3.405,7.894,3.14,7.998,2.875,7.998z"/></svg>',chevronRight16:'<svg xmlns="http://www.w3.org/2000/svg" width="16px" height="16px" x="0px" y="0px" viewBox="0 0 16 16"><defs/><path fill="#4A48C1" d="M6.5,13c-0.247,0-0.494-0.091-0.687-0.273c-0.401-0.38-0.419-1.013-0.04-1.414L8.22,8.727\tc0.373-0.394,0.373-1.06,0-1.454L5.773,4.687c-0.379-0.401-0.362-1.034,0.04-1.414c0.4-0.378,1.034-0.362,1.414,0.04l2.446,2.586\tc1.096,1.159,1.096,3.043,0,4.203l-2.446,2.586C7.03,12.896,6.765,13,6.5,13z"/></svg>',close8:'<svg xmlns="http://www.w3.org/2000/svg" width="8px" height="8px" x="0px" y="0px" viewBox="0 0 8 8"><defs/><path fill="#4A48C1" d="M7.705,7.729C7.511,7.923,7.255,8.02,7,8.02c-0.257,0-0.514-0.099-0.709-0.295L4,5.423L1.709,7.725\tC1.513,7.921,1.257,8.02,1,8.02c-0.255,0-0.51-0.097-0.706-0.291c-0.391-0.39-0.393-1.022-0.003-1.414l2.298-2.309l-2.27-2.28\tC-0.07,1.334-0.068,0.701,0.323,0.311c0.392-0.389,1.024-0.387,1.415,0.003L4,2.587l2.263-2.274C6.653-0.077,7.287-0.079,7.677,0.31\tC8.068,0.7,8.07,1.333,7.681,1.725l-2.27,2.281l2.298,2.309C8.099,6.705,8.097,7.339,7.705,7.729z"/></svg>',close16:'<svg xmlns="http://www.w3.org/2000/svg" width="16px" height="16px" x="0px" y="0px" viewBox="0 0 16 16"><defs/><path fill="#4A48C1" d="M12.709,11.295L9.411,7.982l3.262-3.276c0.39-0.392,0.388-1.024-0.004-1.414\tc-0.39-0.39-1.023-0.388-1.414,0.003L8,6.564L4.746,3.295C4.357,2.904,3.724,2.903,3.332,3.292C2.94,3.682,2.939,4.315,3.329,4.707\tl3.261,3.275l-3.298,3.313c-0.39,0.391-0.388,1.024,0.003,1.414C3.49,12.903,3.745,13,4,13c0.257,0,0.513-0.099,0.708-0.295L8,9.399\tl3.291,3.306C11.486,12.901,11.743,13,12,13c0.255,0,0.511-0.097,0.705-0.291C13.097,12.319,13.099,11.686,12.709,11.295z"/></svg>',enlarge32:'<svg xmlns="http://www.w3.org/2000/svg" width="32px" height="32px" x="0px" y="0px" viewBox="0 0 32 32"><defs/><path fill="#4A48C1" d="M24,9v6.5c0,0.552-0.447,1-1,1s-1-0.448-1-1v-4.086L11.414,22H15.5c0.552,0,1,0.447,1,1s-0.448,1-1,1H9\tc-0.13,0-0.26-0.026-0.382-0.077c-0.245-0.102-0.439-0.296-0.541-0.541C8.026,23.26,8,23.13,8,23v-6.5c0-0.552,0.448-1,1-1\ts1,0.448,1,1v4.085L20.586,10H16.5c-0.552,0-1-0.448-1-1s0.448-1,1-1H23c0.13,0,0.26,0.026,0.382,0.077\tc0.245,0.102,0.439,0.296,0.541,0.541C23.974,8.74,24,8.87,24,9z"/></svg>',options32:'<svg xmlns="http://www.w3.org/2000/svg" width="32px" height="32px" x="0px" y="0px" viewBox="0 0 32 32"><defs/><path fill="#4A48C1" d="M26.1,21.383c0.334-0.625,0.602-1.279,0.812-1.949L32,18.609V13.51l-5.058-0.846\tc-0.208-0.67-0.468-1.325-0.795-1.956l3.009-4.145l-3.604-3.634L21.38,5.903c-0.626-0.333-1.276-0.602-1.948-0.81L18.609,0\tl-5.098,0.001l-0.847,5.061c-0.669,0.203-1.326,0.465-1.957,0.794L6.562,2.847L2.929,6.449l2.973,4.171\tC5.569,11.247,5.3,11.9,5.091,12.569L0,13.373v5.099l5.06,0.866c0.204,0.669,0.467,1.324,0.796,1.955l-3.009,4.146l3.601,3.635\tl4.171-2.975c0.627,0.335,1.282,0.603,1.951,0.811L13.372,32h5.118l0.849-5.057c0.668-0.207,1.323-0.469,1.953-0.795l4.144,3.01\tl3.639-3.604L26.1,21.383z M19.01,19.035c-1.675,1.663-4.381,1.652-6.041-0.025c-1.662-1.675-1.649-4.381,0.024-6.042\tc1.676-1.661,4.382-1.648,6.043,0.025C20.699,14.67,20.686,17.377,19.01,19.035z"/></svg>',file32:'<svg xmlns="http://www.w3.org/2000/svg" xml:space="preserve" x="0px" y="0px" version="1.1" viewBox="0 0 32 32"><path fill="#4A48C1" d="M16,28.5c-3.6,0-6.5-3-6.5-6.6V9.6c0-0.6,0.4-1,1-1s1,0.4,1,1v12.3c0,2.5,2,4.6,4.5,4.6\tc2.5,0,4.5-2.1,4.5-4.6V8.3c0-1.5-1.2-2.8-2.7-2.8c-1.5,0-2.7,1.3-2.7,2.8v13.5c0,0.6,0.5,1.1,1,1.1c0.6,0,1-0.5,1-1.1v-10\tc0-0.6,0.4-1,1-1s1,0.4,1,1v10c0,1.7-1.4,3.1-3,3.1s-3-1.4-3-3.1V8.3c0-2.6,2.1-4.8,4.7-4.8c2.6,0,4.7,2.2,4.7,4.8v13.6\tC22.5,25.5,19.6,28.5,16,28.5z"/></svg>',upload32:'<svg xmlns="http://www.w3.org/2000/svg" width="32px" height="32px" x="0px" y="0px" viewBox="0 0 32 32"><defs/><path fill="#4A48C1" d="M9.488,13.481c-0.391-0.391-0.391-1.023,0-1.414l5.805-5.805c0.026-0.026,0.06-0.036,0.088-0.058\tc0.073-0.06,0.146-0.119,0.235-0.156c0.246-0.103,0.522-0.103,0.769,0c0.093,0.039,0.171,0.101,0.249,0.165\tc0.023,0.02,0.053,0.027,0.074,0.049l5.805,5.805c0.391,0.391,0.391,1.023,0,1.414c-0.195,0.195-0.451,0.293-0.707,0.293\ts-0.512-0.098-0.707-0.293L17,9.383V20.33c0,0.553-0.447,1-1,1c-0.552,0-1-0.447-1-1V9.383l-4.098,4.098\tC10.512,13.872,9.879,13.872,9.488,13.481z M22.819,24.031H9.181c-0.552,0-1,0.447-1,1s0.448,1,1,1h13.639c0.553,0,1-0.447,1-1\tS23.372,24.031,22.819,24.031z"/></svg>',download16:'<svg xmlns="http://www.w3.org/2000/svg" width="16px" height="16px" x="0px" y="0px" viewBox="0 0 16 16"><defs/><path fill="#FFF" d="M3.175,7.726c-0.413-0.367-0.45-0.999-0.083-1.412c0.367-0.413,0.999-0.45,1.412-0.083L7,8.45V1.5\tc0-0.552,0.448-1,1-1c0.553,0,1,0.448,1,1v6.95l2.496-2.219c0.412-0.367,1.044-0.331,1.411,0.083\tc0.367,0.413,0.33,1.045-0.083,1.412l-4.16,3.698c-0.047,0.041-0.103,0.062-0.154,0.094c-0.047,0.028-0.089,0.064-0.141,0.085\tC8.25,11.649,8.125,11.677,8,11.677c-0.126,0-0.25-0.027-0.369-0.074c-0.05-0.021-0.09-0.055-0.136-0.083\tc-0.053-0.031-0.111-0.053-0.159-0.096L3.175,7.726z M12.018,13.5H3.983c-0.552,0-1,0.447-1,1s0.448,1,1,1h8.035\tc0.553,0,1-0.447,1-1S12.57,13.5,12.018,13.5z"/></svg>',error16:'<svg xmlns="http://www.w3.org/2000/svg" width="16px" height="16px" x="0px" y="0px" viewBox="0 0 16 16"><defs/><path fill="#ad001f" d="M15.744,13.104L9.097,1.47c-0.604-1.055-1.59-1.055-2.193,0L0.256,13.104\tc-0.604,1.056-0.102,1.919,1.113,1.919H14.63C15.847,15.022,16.348,14.159,15.744,13.104z M7,5.045c0-0.552,0.448-1,1-1s1,0.448,1,1\tv3.656c0,0.552-0.448,1-1,1s-1-0.448-1-1V5.045z M8,13.212c-0.748,0-1.354-0.607-1.354-1.354c0-0.748,0.606-1.354,1.354-1.354\ts1.354,0.606,1.354,1.354C9.354,12.604,8.748,13.212,8,13.212z"/></svg>',arrowLeft16:'<?xml version="1.0" encoding="utf-8"?>\n\x3c!-- Generator: Adobe Illustrator 25.2.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) --\x3e\n<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"\n\t viewBox="0 0 16 16" enable-background="new 0 0 16 16" xml:space="preserve">\n<path fill="#5053A4" d="M13.6,8c0,0.6-0.4,1-1,1h-7l2.2,2.5c0.4,0.4,0.3,1-0.1,1.4c-0.2,0.2-0.4,0.2-0.7,0.2c-0.3,0-0.6-0.1-0.8-0.3\n\tL2.6,8.6c0,0-0.1-0.1-0.1-0.2c0,0-0.1-0.1-0.1-0.1c0-0.1-0.1-0.2-0.1-0.3c0,0,0,0,0,0c0,0,0,0,0,0c0-0.1,0-0.3,0.1-0.4\n\tc0,0,0.1-0.1,0.1-0.1c0-0.1,0.1-0.1,0.1-0.2l3.7-4.1c0.4-0.4,1-0.4,1.4-0.1c0.4,0.4,0.4,1,0.1,1.4L5.6,7h7C13.2,7,13.6,7.4,13.6,8z"\n\t/>\n</svg>\n',arrowRight16:'<?xml version="1.0" encoding="utf-8"?>\n\x3c!-- Generator: Adobe Illustrator 25.2.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) --\x3e\n<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"\n\t viewBox="0 0 16 16" enable-background="new 0 0 16 16" xml:space="preserve">\n<path fill="#5053A4" d="M2.4,8.1c0-0.6,0.4-1,1-1h7L8.1,4.5c-0.4-0.4-0.3-1,0.1-1.4c0.2-0.2,0.4-0.2,0.7-0.2c0.3,0,0.6,0.1,0.8,0.3\n\tl3.7,4.2c0,0,0.1,0.1,0.1,0.2c0,0,0.1,0.1,0.1,0.1c0,0.1,0.1,0.2,0.1,0.3c0,0,0,0,0,0c0,0,0,0,0,0c0,0.1,0,0.3-0.1,0.4\n\tc0,0-0.1,0.1-0.1,0.1c0,0.1-0.1,0.1-0.1,0.2l-3.7,4.1c-0.4,0.4-1,0.4-1.4,0.1c-0.4-0.4-0.4-1-0.1-1.4l2.2-2.4h-7\n\tC2.8,9.1,2.4,8.6,2.4,8.1z"/>\n</svg>\n',check32:'<svg\n xmlns="http://www.w3.org/2000/svg"\n width="32px"\n height="32px"\n x="0px"\n y="0px"\n viewBox="0 0 32 32"\n>\n <path\n fill="currentColor"\n d="M22.9,9.3l-9.3,9.3l-3.2-3.2c-0.9-0.9-2.3-0.9-3.2,0l0,0c-0.9,0.9-0.9,2.3,0,3.2l3.2,3.2l0,0l1.6,1.6\n\tc0.9,0.9,2.3,0.9,3.2,0l1.6-1.6l9.3-9.3c0.9-0.9,0.9-2.3,0-3.2l0,0C25.2,8.4,23.7,8.4,22.9,9.3z"\n />\n</svg>\n',check16:'<svg\n xmlns="http://www.w3.org/2000/svg"\n width="16px"\n height="16px"\n x="0px"\n y="0px"\n viewBox="0 0 16 16"\n>\n <path\n fill="currentColor"\n d="M11.6,4.3l-5,5L4.9,7.5C4.4,7,3.7,7,3.2,7.5l0,0C2.8,8,2.8,8.7,3.2,9.2l1.7,1.7l0,0l0.8,0.8\n\tc0.5,0.5,1.2,0.5,1.7,0l0.8-0.8l5-5c0.5-0.5,0.5-1.2,0-1.7l0,0C12.8,3.8,12.1,3.8,11.6,4.3z"\n />\n</svg>\n'},hs=({name:e,size:t="32",className:n,alt:r})=>{const o=`${e}${t}`;return(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)("div",{"aria-hidden":"true",className:n||T("icon"),dangerouslySetInnerHTML:{__html:fs[o]}}),r&&(0,k.jsx)("span",{className:T("visually-hidden"),children:r})]})};function ys({items:e,currentIndex:t,onChange:n,children:r}){const{t:o}=ya(),i=e.length;return(0,k.jsxs)("div",{className:T("carousel-controls"),children:[(0,k.jsx)("button",{className:T("button","button--previous"),"aria-label":o("carousel.controls.previous"),onClick:()=>{n((t-1+i)%i)},children:(0,k.jsx)(hs,{name:"arrowLeft",size:"16"})}),r,(0,k.jsx)("button",{className:T("button","button--next"),"aria-label":o("carousel.controls.next"),onClick:()=>{n((t+1)%i)},children:(0,k.jsx)(hs,{name:"arrowRight",size:"16"})})]})}function ms({items:e,currentIndex:t,onChange:n,getItemKey:r,getItemLabel:o}){const i=e.length,a=(0,Qe.useCallback)((e=>{const r=Number(e.target.dataset.item||"0"),o=Math.min(i-1,Math.max(0,r));o!==t&&n(o)}),[i,t,n]);return(0,k.jsx)("div",{className:T("carousel-pagination__wrapper"),role:"group",children:(0,k.jsx)("ul",{className:T("carousel-pagination"),children:e.map(((e,n)=>{const i=t===n;return(0,k.jsx)("li",{className:T("carousel-pagination__item",i?"is-active":void 0),children:(0,k.jsx)("button",{className:T("carousel-pagination__button"),type:"button",onClick:a,"data-item":n,"aria-disabled":i?"true":void 0,"aria-label":o(e,n)})},r(e,n,"pagination-item-"))}))})})}const bs=(e,t,n)=>`${n}${t}`,vs=e=>e.label,gs=({target:e})=>{e.scrollLeft=0};function ws({currentIndex:e,onChange:t,getItemKey:n=bs,getItemLabel:r=vs,items:o}){const i=Va(),a=o.length,[s,c]=(0,Qe.useState)(Number(e||"0"));(0,Qe.useEffect)((()=>{c(Number(e||"0"))}),[c,e]);const l=(0,Qe.useRef)([]);l.current=(0,Qe.useMemo)((()=>Array(a).fill(1).map((()=>(0,Xe.createRef)()))),[a]);const u=(0,Qe.useRef)(!0),p=(0,Qe.useRef)();return p.current=t,(0,Qe.useEffect)((()=>{u.current?u.current=!1:p.current&&p.current(s)}),[s]),(0,k.jsxs)("div",{className:T("carousel"),role:"group","aria-roledescription":"carousel",children:[(0,k.jsx)("div",{className:T("carousel__slides-wrapper"),onScroll:gs,children:(0,k.jsx)("div",{id:i,className:T("carousel__slides"),style:{width:100*a+"%",left:-100*s+"%"},"aria-live":"polite","aria-atomic":"false",children:o.map(((e,t)=>{const r=s===t;return(0,k.jsx)("div",{ref:l.current[t],className:T("carousel__slide",r?"is-active":void 0),"aria-hidden":r?void 0:"true",children:(0,k.jsx)(ds,{item:e,items:o,currentIndex:s,index:t,isActive:r})},n(e,t,"item-"))}))})}),(0,k.jsx)("div",{className:T("carousel__controls"),children:(0,k.jsx)(ys,{currentIndex:s,items:o,onChange:c,controlId:i,children:(0,k.jsx)("div",{className:T("carousel__pagination"),children:(0,k.jsx)(ms,{currentIndex:s,items:o,onChange:c,getItemKey:n,getItemLabel:r})})})})]})}const js=(e,t,n="")=>`${n}${e.title}:${t}`,Os=e=>e.title,xs=["event","children"];function Ss(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 _s(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ss(Object(n),!0).forEach((function(t){Es(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ss(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Es(e,t,n){return t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Cs=e=>`suggestions__item--${String(e).toLowerCase().replace(/[^a-z0-9_\\-]/,"")}`,Ps=({id:e,categories:t=[],question:n,onClick:r,hasIcon:o})=>{const i=(0,Qe.useMemo)((()=>["suggestions__item",...t.map(Cs)]),[t]),a=(0,Qe.useCallback)((()=>{r&&r({id:e,question:n})}),[e,n,r]);return(0,k.jsx)("li",{className:T(i),children:(0,k.jsxs)("button",{type:"button",onClick:a,className:T("button","button--primary"),children:[o&&(0,k.jsx)(hs,{name:"chevronRight",size:"8"}),n]})})};function Ts(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 ks(e,t,n){return t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const As=({className:e,suggestions:t=[],onClickSuggestion:n,hasIcon:r=!0})=>(0,k.jsx)("ul",{className:T("suggestions__list",e),children:t.map((e=>(0,k.jsx)(Ps,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ts(Object(n),!0).forEach((function(t){ks(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ts(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({hasIcon:r,onClick:n},e),e.id)))}),Ns=["event"];function Is(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 Rs(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Is(Object(n),!0).forEach((function(t){Ds(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Is(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Ds(e,t,n){return t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Ms=e=>{const{sendAction:t}=Xi();return n=>{n.target&&n.target.dataset.linkId&&t({type:"navigate",originMessage:e,link:{id:n.target.dataset.linkId,url:n.target.getAttribute("href")}})}};function Ls(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 Us(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ls(Object(n),!0).forEach((function(t){Fs(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ls(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Fs(e,t,n){return t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Bs({children:e,childrenHTML:t,className:n,graphicSrc:r,graphicType:o="icon",iconName:i,iconSize:a,iconClassName:s,dividerType:c}){const l=Boolean(i||r),u=t?{dangerouslySetInnerHTML:{__html:t}}:{children:e};return(0,k.jsxs)("div",{className:T("divider",c&&`divider--type-${c}`,n),children:[l&&(0,k.jsx)("span",{className:T("divider__graphic"),children:i?(0,k.jsx)(hs,{name:i,size:a,className:s}):(0,k.jsx)("img",{src:r,className:T({icon:"icon"===o,avatar:"avatar"===o},s)})}),(0,k.jsx)("div",Us({className:T("divider__body")},u))]})}const $s={[w.new_topic]:"newtopic"},zs=["event"];function Hs(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 Vs(e,t,n){return t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const qs={default:({event:e})=>{const{t}=ya(),{subtype:n}=e.payload.body,r=$s[w[n]];return(0,k.jsx)(Bs,{dividerType:r,iconName:w[n],children:(0,k.jsx)("p",{children:t(`dividerKeys.${w[n]}`)})})},[w.new_translation]:({event:e})=>{const{t}=ya(),n=Pr(),{body:{restartButtonText:r,translationEnabled:o,translationLocale:i,text:a,title:s},id:c}=e.payload,{enableTranslations:l}=Wa(),u=ct((e=>e.translations.translatedEventGroups)),p=mt(),d=(0,Qe.useCallback)((()=>{u[c]?p(Ni({events:n,id:c})):p(Ii({events:n,id:c}))}),[p,n,c,u]);return(0,k.jsxs)(Bs,{iconName:"newTranslation",dividerType:"newtranslation",children:[(0,k.jsx)("p",{className:T("divider__title"),children:s}),a&&(0,k.jsx)("p",{children:a}),o?(0,k.jsx)(k.Fragment,{children:(0,k.jsx)("button",{className:T("button","button--secondary"),onClick:d,children:t(u[c]?"translations.toggle.showTranslationsButtonText":"translations.toggle.hideTranslationsButtonText")})}):(0,k.jsx)("button",{className:T("button","button--secondary"),"data-testid":"restartTranslationButton",onClick:()=>{l(i)},children:r})]})}},Ws={month:"long",day:"numeric",year:"numeric"},Gs={hour:"numeric",minute:"numeric"},Ks=({event:e})=>{const t=(()=>{const[e,t]=(0,Qe.useReducer)((e=>e+1),0);return(0,Qe.useCallback)((()=>{setTimeout((()=>{t()}))}),[])})(),{date:n,time:r,timeUntilMidnight:o,srText:i}=(e=>{const{t}=ya(),n=xr()?.context?.locale??[],r=new Date(e),o=new Date,i=new Date(o);i.setHours(24,0,0,0);const a=i-o,s=r.toString(),c=new Intl.DateTimeFormat(n,Gs).format(r);let l=((e,t)=>{const n=new Date(t).setHours(0,0,0,0),r=e.getTime(),o=864e5;return r>=n+o?e:r>n?"today":r>n-o?"yesterday":e})(r,o);switch(l){case"today":l=t("dateTime.today");break;case"yesterday":l=t("dateTime.yesterday");break;default:l=new Intl.DateTimeFormat(n,Ws).format(r)}return{date:l,srText:t("dateTime.srText",{date:l,time:c}),time:c,fullDateTime:s,timeUntilMidnight:a}})(F(e.timeIndicator));return(0,Qe.useEffect)((()=>{const e=setTimeout((()=>{t()}),o);return()=>{clearTimeout(e)}}),[t,o]),(0,k.jsxs)(Bs,{dividerType:"time-indicator",children:[(0,k.jsxs)("p",{className:T("divider__time"),"aria-hidden":"true",children:[(0,k.jsx)("span",{children:n}),(0,k.jsx)("span",{children:r})]}),(0,k.jsx)("p",{className:T("visually-hidden"),children:i})]})};var Js=["input","select","textarea","a[href]","button","[tabindex]:not(slot)","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable="false"])',"details>summary:first-of-type","details"],Xs=Js.join(","),Qs="undefined"==typeof Element,Ys=Qs?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Zs=!Qs&&Element.prototype.getRootNode?function(e){return e.getRootNode()}:function(e){return e.ownerDocument},ec=function(e,t,n){var r=Array.prototype.slice.apply(e.querySelectorAll(Xs));return t&&Ys.call(e,Xs)&&r.unshift(e),r.filter(n)},tc=function e(t,n,r){for(var o=[],i=Array.from(t);i.length;){var a=i.shift();if("SLOT"===a.tagName){var s=a.assignedElements(),c=e(s.length?s:a.children,!0,r);r.flatten?o.push.apply(o,c):o.push({scopeParent:a,candidates:c})}else{Ys.call(a,Xs)&&r.filter(a)&&(n||!t.includes(a))&&o.push(a);var l=a.shadowRoot||"function"==typeof r.getShadowRoot&&r.getShadowRoot(a),u=!r.shadowRootFilter||r.shadowRootFilter(a);if(l&&u){var p=e(!0===l?a.children:l.children,!0,r);r.flatten?o.push.apply(o,p):o.push({scopeParent:a,candidates:p})}else i.unshift.apply(i,a.children)}}return o},nc=function(e,t){return e.tabIndex<0&&(t||/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||e.isContentEditable)&&isNaN(parseInt(e.getAttribute("tabindex"),10))?0:e.tabIndex},rc=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},oc=function(e){return"INPUT"===e.tagName},ic=function(e){var t=e.getBoundingClientRect(),n=t.width,r=t.height;return 0===n&&0===r},ac=function(e,t){return!(t.disabled||function(e){return oc(e)&&"hidden"===e.type}(t)||function(e,t){var n=t.displayCheck,r=t.getShadowRoot;if("hidden"===getComputedStyle(e).visibility)return!0;var o=Ys.call(e,"details>summary:first-of-type")?e.parentElement:e;if(Ys.call(o,"details:not([open]) *"))return!0;if(n&&"full"!==n&&"legacy-full"!==n){if("non-zero-area"===n)return ic(e)}else{if("function"==typeof r){for(var i=e;e;){var a=e.parentElement,s=Zs(e);if(a&&!a.shadowRoot&&!0===r(a))return ic(e);e=e.assignedSlot?e.assignedSlot:a||s===e.ownerDocument?a:s.host}e=i}if(function(e){for(var t,n=Zs(e).host,r=!!(null!==(t=n)&&void 0!==t&&t.ownerDocument.contains(n)||e.ownerDocument.contains(e));!r&&n;){var o;r=!(null===(o=n=Zs(n).host)||void 0===o||!o.ownerDocument.contains(n))}return r}(e))return!e.getClientRects().length;if("legacy-full"!==n)return!0}return!1}(t,e)||function(e){return"DETAILS"===e.tagName&&Array.prototype.slice.apply(e.children).some((function(e){return"SUMMARY"===e.tagName}))}(t)||function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var t=e.parentElement;t;){if("FIELDSET"===t.tagName&&t.disabled){for(var n=0;n<t.children.length;n++){var r=t.children.item(n);if("LEGEND"===r.tagName)return!!Ys.call(t,"fieldset[disabled] *")||!r.contains(e)}return!0}t=t.parentElement}return!1}(t))},sc=function(e,t){return!(function(e){return function(e){return oc(e)&&"radio"===e.type}(e)&&!function(e){if(!e.name)return!0;var t,n=e.form||Zs(e),r=function(e){return n.querySelectorAll('input[type="radio"][name="'+e+'"]')};if("undefined"!=typeof window&&void 0!==window.CSS&&"function"==typeof window.CSS.escape)t=r(window.CSS.escape(e.name));else try{t=r(e.name)}catch(e){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",e.message),!1}var o=function(e,t){for(var n=0;n<e.length;n++)if(e[n].checked&&e[n].form===t)return e[n]}(t,e.form);return!o||o===e}(e)}(t)||nc(t)<0||!ac(e,t))},cc=function(e){var t=parseInt(e.getAttribute("tabindex"),10);return!!(isNaN(t)||t>=0)},lc=function e(t){var n=[],r=[];return t.forEach((function(t,o){var i=!!t.scopeParent,a=i?t.scopeParent:t,s=nc(a,i),c=i?e(t.candidates):a;0===s?i?n.push.apply(n,c):n.push(a):r.push({documentOrder:o,tabIndex:s,item:t,isScope:i,content:c})})),r.sort(rc).reduce((function(e,t){return t.isScope?e.push.apply(e,t.content):e.push(t.content),e}),[]).concat(n)},uc=function(e,t){var n;return n=(t=t||{}).getShadowRoot?tc([e],t.includeContainer,{filter:sc.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:cc}):ec(e,t.includeContainer,sc.bind(null,t)),lc(n)},pc=function(e,t){if(t=t||{},!e)throw new Error("No node provided");return!1!==Ys.call(e,Xs)&&sc(t,e)},dc=Js.concat("iframe").join(","),fc=function(e,t){if(t=t||{},!e)throw new Error("No node provided");return!1!==Ys.call(e,dc)&&ac(t,e)};function hc(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 yc(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?hc(Object(n),!0).forEach((function(t){mc(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):hc(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function mc(e,t,n){return t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var bc=function(e){return"Tab"===e.key||9===e.keyCode},vc=function(e){return bc(e)&&!e.shiftKey},gc=function(e){return bc(e)&&e.shiftKey},wc=function(e){return setTimeout(e,0)},jc=function(e,t){var n=-1;return e.every((function(e,r){return!t(e)||(n=r,!1)})),n},Oc=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return"function"==typeof e?e.apply(void 0,n):e},xc=function(e){return e.target.shadowRoot&&"function"==typeof e.composedPath?e.composedPath()[0]:e.target},Sc=[];function _c(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 Ec(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?_c(Object(n),!0).forEach((function(t){Cc(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_c(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Cc(e,t,n){return t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Pc=({children:e,onClose:t,"aria-label":n,"aria-labelledby":r,fallBackFocusRef:o})=>{const i=Va(),a=(0,Qe.useRef)(null),s=(0,Qe.useRef)(null),[c,l]=(0,Qe.useState)(!1);return(0,Qe.useEffect)((()=>{return c&&(s.current=(e=a.current,t={initialFocus:o&&o.current?o.current:null},r=(null==t?void 0:t.document)||document,i=(null==t?void 0:t.trapStack)||Sc,l=yc({returnFocusOnDeactivate:!0,escapeDeactivates:!0,delayInitialFocus:!0,isKeyForward:vc,isKeyBackward:gc},t),u={containers:[],containerGroups:[],tabbableGroups:[],nodeFocusedBeforeActivation:null,mostRecentlyFocusedNode:null,active:!1,paused:!1,delayInitialFocusTimer:void 0},p=function(e,t,n){return e&&void 0!==e[t]?e[t]:l[n||t]},d=function(e){return u.containerGroups.findIndex((function(t){var n=t.container,r=t.tabbableNodes;return n.contains(e)||r.find((function(t){return t===e}))}))},f=function(e){var t=l[e];if("function"==typeof t){for(var n=arguments.length,o=new Array(n>1?n-1:0),i=1;i<n;i++)o[i-1]=arguments[i];t=t.apply(void 0,o)}if(!0===t&&(t=void 0),!t){if(void 0===t||!1===t)return t;throw new Error("`".concat(e,"` was specified but was not a node, or did not return a node"))}var a=t;if("string"==typeof t&&!(a=r.querySelector(t)))throw new Error("`".concat(e,"` as selector refers to no known node"));return a},h=function(){var e=f("initialFocus");if(!1===e)return!1;if(void 0===e)if(d(r.activeElement)>=0)e=r.activeElement;else{var t=u.tabbableGroups[0];e=t&&t.firstTabbableNode||f("fallbackFocus")}if(!e)throw new Error("Your focus-trap needs to have at least one focusable element");return e},y=function(){if(u.containerGroups=u.containers.map((function(e){var t=uc(e,l.tabbableOptions),n=function(e,t){return(t=t||{}).getShadowRoot?tc([e],t.includeContainer,{filter:ac.bind(null,t),flatten:!0,getShadowRoot:t.getShadowRoot}):ec(e,t.includeContainer,ac.bind(null,t))}(e,l.tabbableOptions);return{container:e,tabbableNodes:t,focusableNodes:n,firstTabbableNode:t.length>0?t[0]:null,lastTabbableNode:t.length>0?t[t.length-1]:null,nextTabbableNode:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=n.findIndex((function(t){return t===e}));if(!(r<0))return t?n.slice(r+1).find((function(e){return pc(e,l.tabbableOptions)})):n.slice(0,r).reverse().find((function(e){return pc(e,l.tabbableOptions)}))}}})),u.tabbableGroups=u.containerGroups.filter((function(e){return e.tabbableNodes.length>0})),u.tabbableGroups.length<=0&&!f("fallbackFocus"))throw new Error("Your focus-trap must have at least one container with at least one tabbable node in it at all times")},m=function e(t){!1!==t&&t!==r.activeElement&&(t&&t.focus?(t.focus({preventScroll:!!l.preventScroll}),u.mostRecentlyFocusedNode=t,function(e){return e.tagName&&"input"===e.tagName.toLowerCase()&&"function"==typeof e.select}(t)&&t.select()):e(h()))},b=function(e){var t=f("setReturnFocus",e);return t||!1!==t&&e},v=function(e){var t=xc(e);d(t)>=0||(Oc(l.clickOutsideDeactivates,e)?n.deactivate({returnFocus:l.returnFocusOnDeactivate&&!fc(t,l.tabbableOptions)}):Oc(l.allowOutsideClick,e)||e.preventDefault())},g=function(e){var t=xc(e),n=d(t)>=0;n||t instanceof Document?n&&(u.mostRecentlyFocusedNode=t):(e.stopImmediatePropagation(),m(u.mostRecentlyFocusedNode||h()))},w=function(e){if(("Escape"===(t=e).key||"Esc"===t.key||27===t.keyCode)&&!1!==Oc(l.escapeDeactivates,e))return e.preventDefault(),void n.deactivate();var t;(l.isKeyForward(e)||l.isKeyBackward(e))&&function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=xc(e);y();var r=null;if(u.tabbableGroups.length>0){var o=d(n),i=o>=0?u.containerGroups[o]:void 0;if(o<0)r=t?u.tabbableGroups[u.tabbableGroups.length-1].lastTabbableNode:u.tabbableGroups[0].firstTabbableNode;else if(t){var a=jc(u.tabbableGroups,(function(e){var t=e.firstTabbableNode;return n===t}));if(a<0&&(i.container===n||fc(n,l.tabbableOptions)&&!pc(n,l.tabbableOptions)&&!i.nextTabbableNode(n,!1))&&(a=o),a>=0){var s=0===a?u.tabbableGroups.length-1:a-1;r=u.tabbableGroups[s].lastTabbableNode}else bc(e)||(r=i.nextTabbableNode(n,!1))}else{var c=jc(u.tabbableGroups,(function(e){var t=e.lastTabbableNode;return n===t}));if(c<0&&(i.container===n||fc(n,l.tabbableOptions)&&!pc(n,l.tabbableOptions)&&!i.nextTabbableNode(n))&&(c=o),c>=0){var p=c===u.tabbableGroups.length-1?0:c+1;r=u.tabbableGroups[p].firstTabbableNode}else bc(e)||(r=i.nextTabbableNode(n))}}else r=f("fallbackFocus");r&&(bc(e)&&e.preventDefault(),m(r))}(e,l.isKeyBackward(e))},j=function(e){var t=xc(e);d(t)>=0||Oc(l.clickOutsideDeactivates,e)||Oc(l.allowOutsideClick,e)||(e.preventDefault(),e.stopImmediatePropagation())},O=function(){if(u.active)return function(e,t){if(e.length>0){var n=e[e.length-1];n!==t&&n.pause()}var r=e.indexOf(t);-1===r||e.splice(r,1),e.push(t)}(i,n),u.delayInitialFocusTimer=l.delayInitialFocus?wc((function(){m(h())})):m(h()),r.addEventListener("focusin",g,!0),r.addEventListener("mousedown",v,{capture:!0,passive:!1}),r.addEventListener("touchstart",v,{capture:!0,passive:!1}),r.addEventListener("click",j,{capture:!0,passive:!1}),r.addEventListener("keydown",w,{capture:!0,passive:!1}),n},x=function(){if(u.active)return r.removeEventListener("focusin",g,!0),r.removeEventListener("mousedown",v,!0),r.removeEventListener("touchstart",v,!0),r.removeEventListener("click",j,!0),r.removeEventListener("keydown",w,!0),n},n={get active(){return u.active},get paused(){return u.paused},activate:function(e){if(u.active)return this;var t=p(e,"onActivate"),n=p(e,"onPostActivate"),o=p(e,"checkCanFocusTrap");o||y(),u.active=!0,u.paused=!1,u.nodeFocusedBeforeActivation=r.activeElement,t&&t();var i=function(){o&&y(),O(),n&&n()};return o?(o(u.containers.concat()).then(i,i),this):(i(),this)},deactivate:function(e){if(!u.active)return this;var t=yc({onDeactivate:l.onDeactivate,onPostDeactivate:l.onPostDeactivate,checkCanReturnFocus:l.checkCanReturnFocus},e);clearTimeout(u.delayInitialFocusTimer),u.delayInitialFocusTimer=void 0,x(),u.active=!1,u.paused=!1,function(e,t){var n=e.indexOf(t);-1!==n&&e.splice(n,1),e.length>0&&e[e.length-1].unpause()}(i,n);var r=p(t,"onDeactivate"),o=p(t,"onPostDeactivate"),a=p(t,"checkCanReturnFocus"),s=p(t,"returnFocus","returnFocusOnDeactivate");r&&r();var c=function(){wc((function(){s&&m(b(u.nodeFocusedBeforeActivation)),o&&o()}))};return s&&a?(a(b(u.nodeFocusedBeforeActivation)).then(c,c),this):(c(),this)},pause:function(){return u.paused||!u.active||(u.paused=!0,x()),this},unpause:function(){return u.paused&&u.active?(u.paused=!1,y(),O(),this):this},updateContainerElements:function(e){var t=[].concat(e).filter(Boolean);return u.containers=t.map((function(e){return"string"==typeof e?r.querySelector(e):e})),u.active&&y(),this}},n.updateContainerElements(e),n),s.current.activate()),()=>{s.current&&s.current.deactivate()};var e,t,n,r,i,l,u,p,d,f,h,y,m,b,v,g,w,j,O,x}),[c,o]),(0,Qe.useEffect)((()=>{const e=(()=>{const e=[],t=[];return document.querySelectorAll('body > *:not([role="dialog"])').forEach((n=>{const r=n.getAttribute("aria-hidden");null!==r&&"false"!==r||(e.push(r),t.push(n),n.setAttribute("aria-hidden","true"))})),()=>{t.forEach(((t,n)=>{const r=e[n];null===r?t.removeAttribute("aria-hidden"):t.setAttribute("aria-hidden",r)}))}})();return()=>{e()}}),[c]),(0,Qe.useEffect)((()=>{c&&a.current.addEventListener("keydown",(e=>{(e.code&&"Escape"===e.code||27===e.keyCode)&&t()}))}),[c,t]),(0,Qe.useLayoutEffect)((()=>{const e=document.getElementsByTagName("body")[0],t=document.createElement("div");return t.setAttribute("id",i),t.setAttribute("role","dialog"),t.setAttribute("data-nosnippet","true"),t.setAttribute("aria-modal","true"),n&&t.setAttribute("aria-label",n),r&&t.setAttribute("aria-labelledby",r),e.appendChild(t),a.current=t,l(!0),()=>{a.current&&(e.removeChild(a.current),a.current=null)}}),[n,r,i]),"function"==typeof e?e({onClose:t,modalRenderFn:e=>a.current&&(0,Xe.render)(e,a.current)}):a.current&&(0,Xe.render)((0,Xe.toChildArray)(e).map((e=>(e.props=Ec(Ec({},e.props),{},{onClose:t}),e))),a.current)},Tc=({url:e,description:t,onClose:n})=>{const{zIndex:r,layoutMode:o,namespace:i}=xr(),a=Ua(),s=wa(),c=(0,Qe.useRef)(null),{t:l}=ya(),u=["modal",`app--layout-${o}`,`namespace--${i}`,...s],p=e=>{e.stopPropagation()},d=()=>{n()},f=r?{zIndex:r+1}:void 0;return(0,k.jsx)(Pc,{onClose:n,"aria-label":l("lightbox.heading"),fallBackFocusRef:c,children:({onClose:n,modalRenderFn:r})=>r((n=>(0,k.jsx)("div",{className:T(u),onClick:d,style:f,children:(0,k.jsxs)("div",{className:T("modal__float"),tabIndex:"-1",onMouseDown:a,onKeyDown:a,onTouchStart:a,onMouseMove:a,onWheel:a,onPointerDown:a,onPointerMove:a,ref:c,children:[(0,k.jsx)("div",{className:T("modal__inner"),onClick:p,children:(0,k.jsx)("img",{className:T("modal__image"),src:e,alt:t})}),(0,k.jsxs)("button",{type:"button",className:T("modal__close"),onClick:n,children:[(0,k.jsx)(hs,{name:"close",size:"16"}),l("lightbox.closeLabel")]})]})}))(n))})},kc=({description:e,url:t})=>{const{t:n}=ya(),[r,o]=(0,Qe.useState)(!1);return(0,k.jsxs)(k.Fragment,{children:[(0,k.jsxs)("button",{type:"button",className:T("modal__enlarge"),onClick:()=>{o(!0)},children:[n("message.image.srTextEnlargeButtonLabel",{description:e}),(0,k.jsx)(hs,{name:"enlarge",size:"32"})]}),r&&(0,k.jsx)(Tc,{url:t,description:e,onClose:()=>{o(!1)}})]})},Ac=["event","descriptorId"];function Nc(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 Ic(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Nc(Object(n),!0).forEach((function(t){Rc(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Nc(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Rc(e,t,n){return t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Dc=["event"];function Mc(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 Lc(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Mc(Object(n),!0).forEach((function(t){Uc(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Mc(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Uc(e,t,n){return t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Fc=["event"];function Bc(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 $c(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Bc(Object(n),!0).forEach((function(t){zc(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Bc(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function zc(e,t,n){return t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Hc=e=>{let{event:t}=e,n=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,Fc);const{body:r}=Ga(t),o=Ms(t.payload.id),i=(0,Qe.useMemo)((()=>t.payload.optimisticallyInjected?{children:(0,k.jsx)("p",{children:r.text})}:{bodyProps:{dangerouslySetInnerHTML:{__html:r.text}}}),[r,t]);return(0,k.jsx)(ts,$c($c({type:"text",event:t,onClick:o},n),i))},Vc=["event"];function qc(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 Wc(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?qc(Object(n),!0).forEach((function(t){Gc(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):qc(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Gc(e,t,n){return t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Kc=["event"];function Jc(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 Xc(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Jc(Object(n),!0).forEach((function(t){Qc(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Jc(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Qc(e,t,n){return t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Yc=({children:e,url:t,target:n})=>t?(0,k.jsx)("a",{href:t,download:!0,target:n||void 0,className:T(["download","download-link"]),children:e}):(0,k.jsx)("span",{className:T("download"),children:e}),Zc=["event","descriptorId"];function el(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 tl(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?el(Object(n),!0).forEach((function(t){nl(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):el(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function nl(e,t,n){return t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function rl(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 ol(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?rl(Object(n),!0).forEach((function(t){il(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):rl(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function il(e,t,n){return t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const al={message:{choice_prompt:e=>{let{event:t,children:n}=e,r=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,xs);const{t:o}=ya(),i=Va(),{body:a,subEvent:s,showOptions:c,chooseAgain:l,onChoiceClickHandler:u,onChooseAgainClickHandler:p}=(e=>{const{payload:t}=e,[n,r]=(0,Qe.useState)(!1),{sendAction:o,addMessageBubble:i,addDivider:a}=Xi(),{activeServiceSessionId:s}=_r().serviceInfo,c=ct(Nr),{body:l}=Ga(e),{service:u}=t,p=(0,Qe.useMemo)((()=>_s(_s({},e),{},{payload:_s(_s({},e.payload),{},{body:e.payload.body?.prompt,translatedBody:e.payload.translatedBody&&_s(_s({},e.payload.translatedBody),{},{data:e.payload.translatedBody.data.prompt})})})),[e]),d=l.chooseAgain&&s===u.serviceSessionId&&t.id!==c;return(0,Qe.useEffect)((()=>{r(t.id===c)}),[t,c]),{body:l,subEvent:p,showOptions:n,chooseAgain:d,onChoiceClickHandler:e=>{const n=J();d&&a("new_topic",n),i(e.text,n),o({type:"pick_choice",originMessage:t.id,choice:{id:e.id,text:e.text,chooseAgain:d},transactionId:n}),r(!1)},onChooseAgainClickHandler:()=>{r((e=>!e))}}})(t);return(0,k.jsxs)(k.Fragment,{children:[(0,Xe.toChildArray)(n).map((e=>(e.props=_s(_s({},e.props),{},{event:s,descriptorId:i,showTranslationToggle:!1}),e))),l&&(0,k.jsxs)("button",{type:"button",className:T("button","button--secondary","button--choose-again"),"aria-expanded":c?"true":"false",onClick:p,"aria-describedby":i,children:[o(c?"message.choicePrompts.cancelChooseAgain":"message.choicePrompts.chooseAgain"),(0,k.jsx)(hs,{name:"chevronDown",size:"8"})]}),c&&(0,k.jsx)(ts,_s(_s({type:"choice-prompt",showParticipant:!1,event:t},r),{},{children:(0,k.jsx)("ul",{className:T("choice-prompt","choice-prompt--many"),children:a.choices.map((e=>(0,k.jsx)("li",{className:T("choice-prompt__item",{[`choice-prompt__item--${e.category}`]:e.category}),children:(0,k.jsx)("button",{type:"button",className:T("button","button--primary"),onClick:()=>{u(e)},children:e.text})},e.id)))})}))]})},text:Hc,image:e=>{let{event:t,descriptorId:n}=e,r=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,Ac);const{body:o}=Ga(t),{description:i,url:a,isZoomable:s}=o,[c,l]=(0,Qe.useState)(!1),u=mt();return(0,k.jsxs)(ts,Ic(Ic({event:t,type:"image"},r),{},{children:[(0,k.jsx)("img",{src:a,id:n,alt:i,onLoad:()=>{u(ko(t.payload.id)),l(!0)}}),s&&c&&(0,k.jsx)(kc,{description:i,url:a})]}))},splash:e=>{let{event:t}=e,n=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,Dc);const{payload:r}=t,{body:o}=Ga(t),i=Ms(r.id);return(0,k.jsx)(ts,Lc(Lc({type:"splash",event:t,onClick:i},n),{},{bodyProps:{dangerouslySetInnerHTML:{__html:o.text}}}))},video:e=>{let{event:t,descriptorId:n}=e,r=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,Zc);const{body:o}=Ga(t),{description:i,url:a}=o;return ja(t).push("message--type-video"),(0,k.jsxs)(ts,tl(tl({event:t,type:"video"},r),{},{children:[(0,k.jsx)("div",{id:n,className:T("visually-hidden"),children:i}),(0,k.jsx)("iframe",{title:i,src:a,allow:"autoplay; encrypted-media",allowFullScreen:!0})]}))},upload:e=>{let{event:t}=e,n=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,Kc);const{t:r}=ya(),{body:o}=Ga(t),{fromClient:i}=t.payload,{filename:a,url:s}=o,c=(0,Qe.useMemo)((()=>r(s?"fileUpload.srFileDownloadText":"fileUpload.srFileUploadedText",{fileName:a})),[s,a,r]);return(0,k.jsx)(ts,Xc(Xc({event:t,type:"upload"},n),{},{children:(0,k.jsxs)(Yc,{url:s,target:i?void 0:"_blank",children:[(0,k.jsx)(hs,{name:"download",size:"16"}),(0,k.jsx)("span",{"aria-hidden":"true",className:T("file-download"),children:a}),(0,k.jsx)("span",{className:T("visually-hidden"),children:c})]})}))},cta:({event:e})=>{const{body:t}=Ga(e),n=Ms(e.payload.id),{emitEvent:r}=Xi(),o=Va(),i=(0,Qe.useCallback)((()=>r(`action.${y}`,{type:y,originMessage:e.payload.id,link:{url:t.buttonLink}})),[r,t,e]);return(0,k.jsxs)(ts,{type:"cta",event:e,children:[(0,k.jsx)("div",{className:T("cta__content"),id:o,dangerouslySetInnerHTML:{__html:t.description},onClick:n}),(0,k.jsx)("a",{className:T("button","button--primary"),"aria-describedby":o,href:t.buttonLink,rel:"noreferrer",target:t.buttonNewTab?"_blank":"_self",onClick:i,children:t.buttonText})]})},carousel:({event:e})=>{const{body:t}=Ga(e),n=t.cards;return(0,k.jsx)(ts,{event:e,modifiers:"type-carousel",children:(0,k.jsx)(ws,{items:n,ItemComponent:ds,getItemKey:js,getItemLabel:Os})})},card:({event:e})=>{const{body:t}=Ga(e),n=Va();return(0,k.jsx)(ts,{type:"card",event:e,children:(0,k.jsx)(is,ss({id:n},t))})}},info:{text:Hc,divider:e=>{let{event:t}=e,n=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,zs);const r=qs[w[t.payload.body.subtype]]||qs.default;return(0,k.jsx)(r,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Hs(Object(n),!0).forEach((function(t){Vs(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Hs(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({event:t},n))},translation:e=>{let{event:t}=e,n=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,Vc);const{t:r}=ya(),{body:o}=Ga(t);return(0,k.jsx)(ts,Wc(Wc({type:"text",event:t},n),{},{children:r(o.key.join("."),o.variables)}))},timeIndicator:Ks},participant:{participant:({event:e})=>{const{participant:t}=e.payload,{body:n}=Ga(e);return n?(0,k.jsx)(Bs,{graphicSrc:t.avatar,graphicType:t.avatar?"avatar":void 0,iconName:t.avatar?void 0:"balloon",childrenHTML:n,dividerType:"participant"}):null}},service_data:{suggestion:e=>{let{event:t}=e,n=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,Ns);const[r,o]=(0,Qe.useState)(!0),i=mt(),a=Hr(),{sendAction:s,addMessageBubble:l}=Xi(),{suggestions:u,payload:p}=(e=>{const{payload:t}=e,{body:n}=Ga(e);return{suggestions:n,payload:t}})(t),{showSuggestions:d}=xr(),f=Pr(),{t:h}=ya(),y=h("suggestions.headingText"),m=h("suggestions.footerText"),b=(0,Qe.useMemo)((()=>f.some((({payload:e})=>e?.transactionLast))),[f]),v=(0,Qe.useCallback)((({id:e,question:t})=>{o(!1),i(Wr(!0)),s({type:c,originMessage:p.id,body:{type:"faqclick",body:{faqId:e,faqQuestion:t}}}),l(t)}),[i,s,p.id,l]);return r&&!a&&b&&d?(0,k.jsxs)("div",{className:T("suggestions","suggestions--conversation"),children:[y&&(0,k.jsx)("p",{className:T("suggestions__heading"),children:y}),(0,k.jsxs)(ts,Rs(Rs({type:"suggestions",showParticipant:!1,event:t},n),{},{children:[(0,k.jsx)(As,{className:"suggestions__list--conversation",onClickSuggestion:v,suggestions:u}),m&&(0,k.jsx)("p",{className:T("suggestions__footer"),children:m})]}))]}):null}}},sl=({children:e})=>{const{customComponents:t}=xr(),n=(0,Qe.useMemo)((()=>Object.keys(al).reduce(((e,n)=>ol(ol({},e),{},{[n]:ol(ol({},al[n]),t?t[n]:{})})),{fallback:Hc})),[t]);return(0,k.jsx)(ga.Provider,{value:n,children:e})},cl=({children:e})=>{const{isMinimized:t}=zi(),n=(0,Qe.useRef)(0),{sendAction:r}=Xi(),{hasCountdown:o,isActive:i,stopCountdown:a}=za(),s=(0,Qe.useCallback)((()=>{if(t)return;const e=(new Date).getTime(),s=()=>{r({type:"interactivity_update"}),n.current=e};o&&i&&(s(),a()),e-n.current>15e3&&s()}),[r,o,i,a,t]);return(0,k.jsx)("div",Object.assign({className:T("activity-monitor"),tabIndex:-1,onMouseDown:s,onKeyUp:s,onTouchStart:s,onMouseMove:s,onWheel:s,onPointerDown:s,onPointerMove:s},{children:(0,k.jsx)(La.Provider,Object.assign({value:s},{children:e}))}))};const ll=["text","choice_prompt","image","video"],ul=()=>{const e=Vi(),t=(0,Qe.useRef)(),n=(0,Qe.useRef)(),r=mt(),o=Pr(),i=(0,Qe.useContext)(gt),a=(0,Qe.useRef)(null),{initCountdown:s,endCountdown:c}=za(),{emitEvent:l}=Xi();return(0,Qe.useEffect)((()=>{if(e.connectionInfo&&e.conversation.socket){const{socket:t}=e.conversation;t.onError((e=>{const t=new Yo(e);r(Xr({name:t.name,message:t.message,langKey:t.langKey,originalEvent:t.originalEvent,originalError:t.originalError})),r(co())})),t.onOpen((()=>{r(Qr())}))}}),[e,e.connectionInfo,e.conversation.socket,r]),(0,Qe.useEffect)((()=>{if(e.connectionInfo&&e.conversation.channel){const{channel:t}=e.conversation;return()=>{null==t||t.leave()}}return()=>{}}),[e,e.connectionInfo,e.conversation]),(0,Qe.useEffect)((()=>{e.conversation.onConnection((({currentState:e})=>{if("join_channel_erred"===e){const e=new D;r(Xr({name:e.name,message:e.message,langKey:e.langKey,originalEvent:e.originalEvent,originalError:e.originalError,action:e.action}))}}))}),[e.conversation,r]),(0,Qe.useEffect)((()=>{e.connectionInfo&&e.conversation.onConnection((({connected:t})=>{if(!t)return!1;const{channel:n}=e.conversation,o=e=>{const{payload:t}=e;if(!t||!t.participant)return;const{fromClient:n,participant:o}=t;!n&&"string"!=typeof o&&(null==o?void 0:o.name)&&r(_o(o.name)),r(Ao({participant:o,fromClient:n})),"string"!=typeof o&&o.introduction&&r(ao(Object.assign(Object.assign({},e),{payload:Object.assign(Object.assign({},t),{type:"participant"})})))};return n.onMessage=(e,t)=>{const n={type:e,payload:t};switch(e){case"ui":switch(t.state&&t.state.hasOwnProperty("loading")&&r(To(t.state.loading)),t.type){case"idle_detach_countdown":s(t.body.duration);break;case"idle_detach_countdown_elapsed":c(void 0,!0);break;case"resume_conversation_prompt":r(mo());break;case"translation_proposal":r(Ri(t.body));break;case"user_first_response":r(Wr(!0)),i.emit("system.userFirstResponse",t.body)}break;case"message":switch(o(t),t.type){case"text":case"choice_prompt":case"splash":case"image":case"upload":case"video":case"cta":case"custom":case"carousel":case"card":t.service&&t.service.serviceSessionId&&r(wo(t.service.serviceSessionId)),r(ao(n))}break;case"participant":o(n);break;case"service_data":t.persist&&r(Io(t));break;case"ack":r(io(n));break;case"system":if("service_changed"===t.type){const{serviceSettings:e}=t,n=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 o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}(t,["serviceSettings"]),{entry:o}=e,{upload:i}=o.options;r(xo({key:j,enabled:!(!i||!i.enabled)})),r(Ro(o)),t.serviceSessionId&&r(wo(t.serviceSessionId)),l("system.serviceChanged",n)}break;case"info":"divider"!==t.type&&"text"!==t.type&&"translation"!==t.type||r(ao(n));break;case"error":switch(t.type){case"find_conversation_erred":const e=new M(n);r(Xr({name:e.name,action:e.action,message:e.message,originalEvent:e.originalEvent,originalError:e.originalError}));break;case"conversation_erred":const t=new D(n);r(Xr({name:t.name,message:t.message,langKey:t.langKey,originalEvent:t.originalEvent,originalError:t.originalError,action:t.action}))}}return t},!0}))}),[e,e.connectionInfo,e.conversation.channel,r,l,c,i,s]),(0,Qe.useEffect)((()=>e.connectionInfo?(e.conversation.onConnection((({connected:t})=>{if(!t)return!1;const{channel:r}=e.conversation;return n.current=r.on("message",(e=>ll.includes(e.type)?(e.id!==a.current&&i.emit("message",e),a.current=e.id,e):e)),!0})),()=>{var t;null===(t=e.conversation.channel)||void 0===t||t.off("message",n.current)}):()=>{}),[e,e.connectionInfo,e.conversation.channel,i]),(0,Qe.useEffect)((()=>e.connectionInfo?(e.conversation.onConnection((({connected:n})=>!!n&&(t.current=e.conversation.channel.on("sync",(t=>{var n;const i=o[o.length-1],a=null===(n=null==t?void 0:t.lastEvent)||void 0===n?void 0:n.id;return i&&a===i.payload.id?t:e.getConversation().then((e=>{e&&r(Co(e))})).catch((e=>{r(Xr({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}))}))})),!0))),()=>{var n;null===(n=e.conversation.channel)||void 0===n||n.off("sync",t.current)}):()=>{}),[e,e.connectionInfo,e.conversation.channel,o,r]),null},pl=({children:e})=>{const{t}=ya(),n=mt(),r=Vi(),{addUploadBubble:o}=Xi();return(0,k.jsx)(Ea.Provider,{value:e=>{const i=J(),a=r.uploadFile(e,(e=>{n(Lo({fileId:i,progress:Math.ceil(e)}))}),(e=>{const{id:t,transactionId:r,occurredAt:a,body:{contentType:s,filename:c,filesize:l,url:u}}=e.body;n(Do(i)),o(t,r,a,s,c,l,u)}),(e=>{let r;switch(e&&e.body?e.body.error:""){case"file_uploads_are_disabled":r=t("fileUpload.errors.unavailable");break;case"request_entity_too_large":r=t("fileUpload.errors.tooLarge");break;case"file_has_invalid_mime_type":r=t("fileUpload.errors.wrongType");break;case"virus_found":r=t("fileUpload.errors.virusFound");break;default:r=t("fileUpload.errors.general")}n(Mo({fileId:i,errorText:r}))}));n(bo({fileId:i,fileName:e.name,uploadHandle:a}))},children:e})},dl=()=>{const{hasCountdown:e,isActive:t,remaining:n,decrementCountdown:r}=za();return((e,t)=>{const n=(0,Qe.useRef)(e);(0,Qe.useEffect)((()=>{n.current=e}),[e]),(0,Qe.useEffect)((()=>{if(null!==t){const e=setInterval((function(){n.current()}),t);return()=>clearInterval(e)}}),[t])})((()=>{r()}),e&&t&&n>0?1e3:null),null},fl=()=>{const{initUserSelectedOptions:e}=Da(),t=(0,Qe.useRef)(!1),n=xr();return(0,Qe.useEffect)((()=>{n.api&&!t.current&&(t.current=!0,e())}),[e,n]),null},hl=wr((({interrupt:e})=>e),(({error:e})=>e));function yl(){const{t:e}=ya(),t=ct(hl);return{hasInterrupt:Boolean(t),meta:(0,Qe.useMemo)((()=>{if(!t)return{};const{langKey:n,action:r}=t,o=e(`${n}.title`),i=e(`${n}.message`),a=e(`${n}.srText`),s=e(`${n}.buttonText`);return Object.assign(Object.assign(Object.assign(Object.assign({},n?{title:o,message:i,srText:a}:{}),r?{action:r}:{}),r&&n?{buttonText:s}:{}),{originalError:t})}),[e,t]),error:t}}function ml(e,t,n=[]){const r=(0,Qe.useContext)(gt),o=(0,Qe.useRef)();o.current=t,(0,Qe.useEffect)((()=>{if(!n.every(Boolean))return;const t=(...e)=>o.current?.(...e);return r.emit("function.register",e,t),()=>r.emit("function.unregister",e,t)}),[r,e,...n])}const bl=()=>{const e=xr(),{sendMessage:t,sendContext:n,sendAction:r}=Xi(),o=mt(),{setVisibility:i,visible:a}=zi(),s=(0,Qe.useRef)(a),c=(0,Qe.useContext)(gt),l=Vi(),u=kr(),p=(0,Qe.useRef)(null),d=(0,Qe.useRef)(null),{isInline:h,isResolving:y}=Rr(),{hasInterrupt:m}=yl(),b=(()=>{const{get:e}=qi();return e?e("conversationUrl"):null})(),v=(0,Qe.useRef)(null),g=Ua(),{enableTranslations:w,disableTranslations:j}=Wa();return(0,Qe.useEffect)((()=>{s.current=a}),[a]),ml("askText",(e=>{t({body:e})}),[l?.send]),ml("setVariables",(e=>{n({variables:e})}),[l?.send]),ml("getVisibility",(e=>{e?e(s.current):console.warn("A callback function is required for the getVisibility action.")})),ml("setVisibility",(e=>{Object.values(S).includes(e)?(g(),i(e)):console.error('Requested visibility states should be "open", "minimized" ,"hidden" or null.')}),[e?.api]),ml("sendCustomAction",((e,t)=>{r({type:"custom",body:{type:e,body:t}})}),[l.send]),ml("setTopic",(({name:e,fallbackMessage:t,userTriggered:n})=>{n&&o(Jo({showSuggestions:!1})),e&&t?r({type:f,body:{name:e,fallbackMessage:t,participant:n?P:void 0}}):console.warn("A name and a fallbackMessage are required for the setTopic action.")}),[l.send]),ml("setTranslation",(({enabled:e,locale:t})=>{e?w(t,"window_api"):j()}),[l.send]),(0,Qe.useEffect)((()=>{y||m||(v.current&&v.current!==b&&c.emit("unreadMessageCount",u),a===S.open&&a!==d.current&&0!==p.current&&c.emit("unreadMessageCount",0),a!==S.open&&u!==p.current&&c.emit("unreadMessageCount",u),d.current=a,p.current=u,v.current=b)}),[u,a,c,h,y,m,b]),null},vl=({children:e})=>{const t=(0,Qe.useContext)(gt),[n,r]=(0,Qe.useState)({}),o=(0,Qe.useRef)(!0),i=(0,Qe.useCallback)((e=>{o.current&&(r(e),t.emit("aria-live",e))}),[r,t]);(0,Qe.useEffect)((()=>{let e=null;return n&&n.messageText&&(e=setTimeout((()=>{i({}),clearTimeout(e)}),500)),()=>{clearTimeout(e)}}),[n,i]),(0,Qe.useEffect)((()=>()=>{o.current=!1}),[]);const{ariaLive:a,messageText:s}=n;return(0,k.jsxs)(ma.Provider,{value:i,children:[e,(0,k.jsxs)("div",{className:T("app__live-container"),children:[(0,k.jsx)("div",{"aria-live":"assertive","aria-atomic":"true",className:T("visually-hidden"),children:a===v?s:null}),(0,k.jsx)("div",{"aria-live":"polite","aria-atomic":"true",className:T("visually-hidden"),children:a===g?s:null})]})]})},gl=()=>{const{t:e}=ya(),t=Pr(),n=(0,Qe.useRef)(0),r=(0,Qe.useRef)(0),o=_r().historyLoaded,{sendPolite:i}=ba(),{isOpen:a}=zi(),s=(0,Qe.useRef)(null),c=(0,Qe.useRef)(null),l=(0,Qe.useMemo)((()=>U((t=>{const n=t.filter((({payload:e})=>!e.fromClient&&!e.fromHistory)).length;n>r.current&&(i(e("message.srNewEventCount",{newCount:n-r.current})),r.current=n)}),1e3)),[i,e]);return(0,Qe.useEffect)((()=>{t.length>n.current&&(a&&(c.current=l(t)),n.current=t.length)}),[t,l,a]),(0,Qe.useEffect)((()=>{s.current&&!a&&c.current&&(c.current(!0),c.current=null)}),[a]),(0,Qe.useEffect)((()=>{o&&setTimeout((()=>{i(e("window.srTexts.onHistoryLoad"))}),500)}),[o,e,i]),null},wl=()=>{const{t:e}=ya(),{isOpen:t,isVisible:n}=zi(),r=kr(),{sendPolite:o}=ba(),i=(0,Qe.useMemo)((()=>U(o,2e3)),[o]),a=(0,Qe.useRef)(null),s=(0,Qe.useRef)(null);return(0,Qe.useEffect)((()=>{a.current!==n&&!n&&s.current&&s.current(),0!==r&&!t&&n&&(s.current=i(e("message.srTextUnreadCount",{unreadCount:r}))),a.current=n}),[r,t,n,i,e]),null},jl=({store:e,children:t,eventBus:n,api:r})=>((0,Qe.useErrorBoundary)((t=>{e.dispatch(ei(t))})),(0,k.jsx)(dt,Object.assign({store:e},{children:(0,k.jsx)(gt.Provider,Object.assign({value:n},{children:(0,k.jsx)(vt.Provider,Object.assign({value:r},{children:(0,k.jsx)(vl,{children:(0,k.jsx)(va,{children:(0,k.jsxs)(sl,{children:[(0,k.jsx)(fl,{}),(0,k.jsx)(ul,{}),(0,k.jsx)(wl,{}),(0,k.jsx)(gl,{}),(0,k.jsx)(dl,{}),(0,k.jsxs)(cl,{children:[(0,k.jsx)(bl,{}),(0,k.jsx)(pl,{children:t})]})]})})})}))}))}))),Ol=()=>{const{t:e}=ya(),{showDisclaimer:t}=xr();return t&&(0,k.jsxs)("div",{className:T("disclaimer"),tabIndex:"0",children:[(0,k.jsx)("h2",{className:T("disclaimer__title"),children:e("disclaimer.title")}),(0,k.jsx)("div",{className:T("disclaimer__message"),dangerouslySetInnerHTML:{__html:e("disclaimer.content")}})]})},xl=require("preact/compat"),Sl=(0,Xe.createContext)(null),_l=e=>{const t=(0,Qe.useContext)(ga),n=t[e.type];let r=n[e.payload.type],o=null;return"choice_prompt"===e.payload.type&&(o=n[e.payload.body.prompt.type]),"participant"===e.type&&(r=n[e.type]),r&&"function"!=typeof r&&(r=r[e.payload.body.type]),[r||t.fallback,o]},El=({event:e,newParticipant:t})=>{const{eventRefs:n,unreadIds:r}=(0,xl.useContext)(Sl),{sendAction:o}=Xi(),i=n[e.payload.id],{containerRef:a,isVisible:s}=Hi({containerRef:i,freezeOnceVisible:!0}),c=mt(),[l,p]=_l(e);if((0,xl.useEffect)((()=>{if(s&&(null==r?void 0:r.includes(e.payload.id))){const t=r.reduce(((t,n)=>t.includes(e.payload.id)?t:t.concat(n)),[]);c(Oo(t)),o({type:u,events:t})}}),[c,e.payload.id,s,o,r]),!l)return null;const d=["conversation__item"];return"info"===e.type?d.push("conversation__item--source-info"):e.payload.fromClient?d.push("conversation__item--source-user"):d.push("conversation__item--source-agent"),t&&d.push("conversation__item--new-participant"),(0,k.jsxs)("li",Object.assign({className:T(d),ref:a},{children:[e.timeIndicator&&(0,k.jsx)(Ks,{event:e}),(0,k.jsx)(l,Object.assign({event:e},{children:(0,k.jsx)(p,{event:e})}))]}))},Cl=()=>{const{id:e}=Ir()||{};return(0,k.jsx)("li",{className:T("conversation__item","conversation__item--source-agent"),children:(0,k.jsxs)("div",{className:T("message","message--source-agent","message--type-loading"),children:[(0,k.jsx)(Xa,{eventPayload:{fromClient:!1,participant:e}}),(0,k.jsx)("div",{className:T("message__body"),children:(0,k.jsxs)("span",{className:T("loader"),children:[(0,k.jsx)("span",{className:T("loader__part","one")}),(0,k.jsx)("span",{className:T("loader__part","two")}),(0,k.jsx)("span",{className:T("loader__part","three")}),(0,k.jsx)("span",{className:T("loader__part","four")})]})})]})})},Pl=()=>{const e=Pr();let t=null;return(0,k.jsx)(k.Fragment,{children:e.map((e=>{const{type:n,payload:r}=e;let o=!1;if("participant"!==n&&"service_data"!==n){const{participant:n,fromClient:i}=r,a=i?"seamly-client-participant":n;"info"!==e.type&&t!==a&&(o=!0),t=a}return(0,k.jsx)(El,{event:e,newParticipant:o},e.payload.key||e.payload.id)}))})},Tl=()=>{const{t:e}=ya(),t=Tr(),{isOpen:n}=zi(),r=Ar(),o=_a();return(0,k.jsxs)(k.Fragment,{children:[n&&(0,k.jsx)("a",Object.assign({className:T("skip-link"),href:`#${r}`,onClick:e=>{e.preventDefault(),o()}},{children:e("skiplinkText")})),(0,k.jsx)("div",Object.assign({className:T("chat__body")},{children:(0,k.jsxs)("div",Object.assign({className:T("conversation__container")},{children:[(0,k.jsx)(Ol,{}),(0,k.jsxs)("ol",Object.assign({className:T("conversation")},{children:[(0,k.jsx)(sl,{children:(0,k.jsx)(Pl,{})}),t&&(0,k.jsx)(Cl,{})]}))]}))}))]})},kl={visible:T("transition--visible"),in:T("transition--in"),visuallyHidden:T("visually-hidden")},Al=Object.values(kl),Nl="notRendered",Il="rendered",Rl="visuallyHidden",Dl=({children:e,isActive:t,timeout:n=300,transitionStartState:r=Nl,onInTransitionComplete:o=(()=>{}),onOutTransitionComplete:i=(()=>{})})=>{const a=(0,Qe.useRef)(!1),s=parseInt(n,10),c=qa(o),l=qa(i),u=r===Rl,[p,d]=(0,Qe.useState)((()=>u?[kl.visuallyHidden]:[])),f="notRendered"!==r||p.length>0;return(0,Qe.useEffect)((()=>{let e=null,n=null;return a.current&&!t&&(d([kl.visible]),e=setTimeout((()=>{d([...u?[kl.visuallyHidden]:[]]),l&&(n=requestAnimationFrame((()=>{l()})))}),s)),!a.current&&t&&(d([kl.visible]),n=requestAnimationFrame((()=>{n=requestAnimationFrame((()=>{d([kl.visible,kl.in]),c&&(e=setTimeout((()=>{c()}),s))}))}))),a.current=t,()=>{clearTimeout(e),cancelAnimationFrame(n)}}),[t,u,s,c,l]),(0,k.jsx)(k.Fragment,{children:f&&(0,Xe.toChildArray)(e).map((e=>{const{className:t=""}=e.props,n=t.split(" ").filter((e=>!Al.includes(e)));return(0,Xe.cloneElement)(e,{className:[...n,...p].join(" ")})}))})},Ml=({isAside:e=!1})=>{const{isInline:t}=Rr(),{t:n}=ya(),{sendAction:r,addMessageBubble:o}=Xi(),{isOpen:i,setVisibility:a}=zi(),{showSuggestions:s}=xr(),l=Va(),u=_a(),p=(0,Qe.useRef)(null),{sendPolite:d}=ba(),{hasInterrupt:f}=yl(),{hasCountdown:h,endCountdown:y}=za(),{hasPrompt:m,continueChat:b}=Ha(),v=Hr(),g=("suggestion",_r().serviceData.suggestion);const{body:w}=Ga({payload:g}),j=(0,Qe.useMemo)((()=>g&&!f?w:[]),[g,f,w]),O=(0,Qe.useRef)(null),x=(0,Qe.useRef)(!1),_=(0,Qe.useRef)([]),E=!!j.length,C=t?(v||i)&&!e:v,P=(0,Qe.useRef)(C),A=E&&!C&&s,N=E?j:_.current;_.current=N;const I=(0,Qe.useMemo)((()=>{const t=["suggestions"];return e&&t.push("suggestions--aside"),T(t)}),[e]),R=(0,Qe.useCallback)((({id:e,question:t})=>{h&&y(!0),m&&b(),r({type:c,originMessage:g.id,body:{type:"faqclick",body:{faqId:e,faqQuestion:t}}}),o(t),i||a(S.open),u()}),[o,b,y,u,h,m,g,r,a,i]);(0,Qe.useEffect)((()=>{if(O.current!==j&&!C){if(E){const e=x.current?n("suggestions.srUpdatedText"):n("suggestions.srAvailableText");setTimeout((()=>{d(e)}),30)}else x.current&&d(n("suggestions.srUnavailableText"));O.current=j}!P.current&&C?(W(p.current,u),d(n("suggestions.srUnavailableText"))):!E&&x.current&&W(p.current,u),x.current=E,P.current=C}),[j,E,C,u,d,n]);const D=n("suggestions.headingText"),M=n("suggestions.footerText"),L=D?"section":"div";return(0,k.jsx)(Dl,{isActive:A,transitionStartState:Nl,children:(0,k.jsxs)(L,{className:I,"aria-labelledby":D?l:null,ref:p,children:[D&&(0,k.jsx)("p",{id:l,className:T("suggestions__heading"),children:D}),!!N.length&&(0,k.jsx)(As,{suggestions:N,onClickSuggestion:R}),M&&!i&&(0,k.jsx)("p",{className:T("suggestions__footer"),children:M})]})})},Ll=(0,xl.forwardRef)((({children:e,className:t=""},n)=>{const{isOpen:r,isVisible:o,setVisibility:i}=zi(),{namespace:a,layoutMode:s}=xr(),{isInline:c}=Rr(),l=wa(),u=Hr(),{t:p}=ya(),d=["chat",`chat--layout-${s}`,`namespace--${a}`,...l,t];return r||"app"===s||d.push("chat--collapsed"),u&&d.push("chat--user-responded"),o&&(0,k.jsxs)("section",{className:T(d),onKeyDown:e=>{(e.code&&"Escape"===e.code||27===e.keyCode)&&!c&&r&&i(S.minimized)},tabIndex:"-1",ref:n,"aria-label":p("chat.srLabel"),children:[(0,k.jsx)("div",{className:T("chat-wrapper"),children:e}),"inline"===s&&r&&(0,k.jsx)(Ml,{isAside:!0})]})})),Ul=Ll,Fl=({className:e,children:t,onCancel:n,headingText:r,description:o,descriptionId:i,cancelButtonText:a,cancelButtonRef:s,disableButtonFocusing:c,position:l={horizontal:"left",vertical:"top"}})=>{const u=Va(),{hideOption:p}=Da(),{focusButton:d}=Ma(),f=(0,Qe.useCallback)((()=>{p(),c||d()}),[c,d,p]),h=(0,Qe.useCallback)((()=>{n&&n(),f()}),[f,n]),y=(e=>{const t=(0,Qe.useRef)(null);return(0,Qe.useEffect)((()=>{const n=({target:n})=>{t.current&&n instanceof HTMLElement&&!t.current.contains(n)&&e()};return document.addEventListener("click",n,!0),document.addEventListener("touchstart",n,!0),()=>{document.removeEventListener("click",n,!0),document.removeEventListener("touchstart",n,!0)}}),[e,t]),t})(h);return(0,Qe.useEffect)((()=>{q(y.current)}),[y]),(0,k.jsx)("section",Object.assign({className:T("options",{"options--right":"right"===l.horizontal,"options--left":"left"===l.horizontal,"options--top":"top"===l.vertical,"options--bottom":"bottom"===l.vertical},e),"aria-labelledby":u,tabIndex:-1,ref:y},{children:(0,k.jsxs)("div",Object.assign({className:T("options__body")},{children:[(0,k.jsx)("h2",Object.assign({id:u,className:T("options__title")},{children:r})),(0,k.jsxs)("button",Object.assign({type:"button",onClick:h,"aria-describedby":u,className:T("button","options__close"),ref:e=>{s&&(s.current=e)}},{children:[(0,k.jsx)(hs,{name:"close",size:"16",alt:""}),(0,k.jsx)("span",{children:a})]})),o?(0,k.jsx)("p",Object.assign({className:T("options__description"),id:i},{children:o})):null,(0,k.jsx)("div",Object.assign({className:T("options__wrapper")},{children:t}))]}))}))},Bl=(e,t,n=null)=>({fn:e,errorText:t,compareValue:n}),$l=(e,t)=>{let n=!0;for(let r=0;r<e.length;r++)e[r].size>t&&(n=!1);return n},zl=e=>!!e?.length>0,Hl=e=>{const t=e&&e.trim();return!(!t||!t.match(/^(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])$/i))},Vl=e=>!!e,ql=(0,Xe.createContext)({handleSubmit:()=>{},isSubmitted:!1,isValid:!1,updateControlValue:()=>{},updateControlTouched:()=>{},errors:void 0}),Wl=ql,{Provider:Gl,Consumer:Kl}=ql,Jl=wr((({forms:e})=>e),((e,{formId:t})=>t),((e,t)=>e[t])),Xl=wr(Jl,(e=>(null==e?void 0:e.controls)||{})),Ql=wr(Xl,(e=>{const t={};return Object.entries(e).forEach((([e,{value:n}])=>{t[e]=n})),t})),Yl=wr(Xl,((e,{name:t})=>t),((e,t)=>{var n;return null===(n=e[t])||void 0===n?void 0:n.value})),Zl=wr(Xl,((e,{name:t})=>t),((e,t)=>{var n;return null===(n=e[t])||void 0===n?void 0:n.touched}));function eu(){return(0,Qe.useContext)(Wl)}function tu(e){const t=mt(),{formId:n,updateControlValue:r,updateControlTouched:o,errors:i}=eu(),a=!!ct((e=>Jl(e,{formId:n}))),s=ct((t=>Yl(t,{formId:n,name:e}))),c=ct((t=>Zl(t,{formId:n,name:e}))),l=null==i?void 0:i[e],u=!l;(0,Qe.useEffect)((()=>{a&&t(ci({formId:n,name:e}))}),[a,n,e,t]),(0,Qe.useLayoutEffect)((()=>()=>{t(li({formId:n,name:e}))}),[a,n,e,t]);const p=(0,Qe.useCallback)((t=>r(e,t.target.value)),[e,r]),d=(0,Qe.useCallback)((()=>{o(e,!0)}),[o,e]);return[(0,Qe.useMemo)((()=>({name:e,onInput:p,onBlur:d,value:s})),[e,p,d,s]),(0,Qe.useMemo)((()=>({isValid:u,error:l,touched:c})),[u,l,c])]}function nu(e){var{children:t,formId:n,persistData:r,onError:o,onSubmit:i,validationSchema:a}=e,s=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}(e,["children","formId","persistData","onError","onSubmit","validationSchema"]);const c=mt(),l=ct((e=>Ql(e,{formId:n}))),[u,p]=(0,Qe.useState)(!1),[d,f]=(0,Qe.useState)({}),{isValid:h,errors:y}=function(e,t){const n=(0,Qe.useMemo)((()=>function(e,t={}){return Object.entries(t).reduce(((t,[n,r])=>{var o;const i=Array.isArray(r)?r:[r];for(let r=0;null!==(o=r<(null==i?void 0:i.length))&&void 0!==o&&o;r++)if(!i[r].fn(e[n],i[r].compareValue)){t[n]=i[r].errorText;break}return t}),{})}(e,t)),[e,t]);return{isValid:0===Object.keys(n).length,errors:n}}(l,a),m=(0,Qe.useMemo)((()=>Object.assign(Object.assign({},y),d)),[y,d]);(0,Qe.useLayoutEffect)((()=>{c(ai({formId:n,persistData:r}))}),[n,r,c]),(0,Qe.useEffect)((()=>()=>{c(si({formId:n}))}),[n,r,c]);const b=(0,Qe.useCallback)(((e,t)=>{c(ui({formId:n,name:e,value:t}))}),[n,c]),v=(0,Qe.useCallback)(((e,t)=>{c(pi({formId:n,name:e,touched:t}))}),[c,n]),g=(0,Qe.useCallback)(((e,t)=>{f((n=>Object.assign(Object.assign({},n),{[e]:t})))}),[f]),w=(0,Qe.useCallback)((e=>{var t;e.preventDefault();const n="true"===(null===(t=e.submitter)||void 0===t?void 0:t.ariaDisabled);p(!n),!n&&h&&(c(Wr(!0)),i(l,{updateControlValue:b,setError:g}))}),[h,c,i,l,b,g]);(0,Qe.useEffect)((()=>{o&&o({errors:m,isSubmitted:u,isValid:0===Object.keys(m).length})}),[u,m,o]);const j=(0,Qe.useMemo)((()=>({formId:n,values:l,errors:m,isValid:0===Object.keys(m).length,isSubmitted:u,handleSubmit:w,validationSchema:a,updateControlValue:b,updateControlTouched:v})),[n,l,m,u,w,a,b,v]);return n?i?(0,k.jsx)(Gl,Object.assign({},s,{value:j},{children:t})):(console.error('"onSubmit" is required.'),null):(console.error('"formId" is required.'),null)}const ru=["className","disableValidationClasses"];function ou(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 iu(e,t,n){return t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const au=function(e){let{className:t,disableValidationClasses:n}=e,r=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,ru);const{handleSubmit:o,isValid:i,isSubmitted:a}=function(){const{handleSubmit:e,isSubmitted:t,isValid:n}=eu();return{handleSubmit:e,isSubmitted:t,isValid:n}}(),s=["form"];return!n&&a&&(s.push("form--submitted"),i?s.push("form--valid"):s.push("form--invalid")),(0,k.jsx)("form",function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ou(Object(n),!0).forEach((function(t){iu(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ou(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({onSubmit:o,className:T([...s,t])},r))};function su({id:e,error:t}){const[n,r]=(0,Qe.useState)(!1);return(0,Qe.useEffect)((()=>{const e=setTimeout((()=>r(!0)),300);return()=>clearTimeout(e)}),[]),(0,k.jsx)("div",{className:T("error"),"aria-live":"assertive","aria-atomic":"true",children:n&&t&&(0,k.jsxs)("span",{id:e,className:T("error__message"),children:[(0,k.jsx)(hs,{name:"error",size:"16"}),t]})})}const cu=({contentHint:e,id:t,labelText:n,labelClass:r=T("label"),validity:o,errorText:i,children:a})=>(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)("label",{htmlFor:t,className:r,children:n}),e&&(0,k.jsx)("span",{id:`${t}-content-hint`,className:T("input__content-hint"),children:e}),(0,k.jsx)(su,{id:`${t}-error`,error:!o&&i}),a]}),lu=["id","name","type","labelText","labelClass","contentHint","aria-describedby"];function uu(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 pu(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?uu(Object(n),!0).forEach((function(t){du(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):uu(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function du(e,t,n){return t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const fu=function(e){let{id:t,name:n,type:r,labelText:o,labelClass:i,contentHint:a,"aria-describedby":s}=e,c=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,lu);const{isSubmitted:l}=eu(),[u,{error:p}]=tu(n),d=l&&p,f=[];return s&&f.push(s),a&&f.push(`${t}-content-hint`),d&&f.push(`${t}-error`),(0,k.jsx)(cu,{id:t,contentHint:a,validity:!d,errorText:p,labelText:o,labelClass:i,children:(0,k.jsx)("input",pu(pu({id:t,name:n,type:r,"aria-invalid":d?"true":"false","aria-describedby":f.join(" ")||null},u),c))})};function hu({controlName:e,describedById:t}){const{t:n}=ya();return(0,k.jsxs)(au,{noValidate:"true",className:T("options__form"),children:[(0,k.jsx)(fu,{name:e,type:"email",className:T("transcript__input"),"aria-describedby":t,labelClass:T("label"),labelText:n("options.sendTranscript.label")}),(0,k.jsx)("div",{className:T("options__actions"),children:(0,k.jsx)("button",{type:"submit",className:T("button","button--primary","options__submit"),children:n("options.sendTranscript.sendButtonText")})})]})}const yu="email",mu={sendTranscript:()=>{const[e,t]=(0,Qe.useState)(void 0),{hideOption:n}=Da(),{focusButton:r}=Ma(),{t:o}=ya(),i=Va(),{sendAction:a}=Xi(),s=(0,Qe.useMemo)((()=>({[yu]:[Bl(Vl,o("options.sendTranscript.noEmailText")),Bl(Hl,o("options.sendTranscript.invalidEmailText"))]})),[o]),c=(0,Qe.useCallback)((e=>{const t=e[yu].trim();a({type:"send_transcript",body:{emailAddress:t}}),n(),r()}),[a,n,r]),l=(0,Qe.useCallback)((({isValid:e,isSubmitted:n})=>{t(n&&!e?"options--error":void 0)}),[t]);return(0,k.jsx)(Fl,{className:e,headingText:o("options.sendTranscript.title"),cancelButtonText:o("options.cancelButtonText"),description:o("options.sendTranscript.description"),descriptionId:i,position:{vertical:"top",horizontal:"right"},children:(0,k.jsx)(nu,{formId:"sendTranscript",onSubmit:c,validationSchema:s,onError:l,children:(0,k.jsx)(hu,{controlName:yu,describedById:i})})})}},bu=()=>{const{optionActive:e}=Da(),t=(0,Qe.useRef)(null),n=mu[e||t.current];return e&&(t.current=e),n?(0,k.jsx)(n,{}):null},vu=()=>{const{t:e}=ya(),{menuOptions:t,showOption:n,panelActive:r,hideOption:o}=Da(),{id:i}=Ma(),a=(0,Qe.useRef)(null),[s,c]=(0,Qe.useState)(!1),l=(0,Qe.useRef)(null),u=t.length,p=(0,Qe.useRef)(Array.from({length:u},(()=>(0,Xe.createRef)()))),d=(0,Qe.useRef)(!1),f=u>1,h=t[0],y=(0,Qe.useMemo)((()=>h?.name?.trim().replace(/\s+/g,"")),[h]);return(0,Qe.useEffect)((()=>()=>{clearTimeout(a.current)}),[]),(0,Qe.useEffect)((()=>{s&&!d.current&&requestAnimationFrame((async()=>{await Oa(60);const e=t.findIndex((e=>e.available)),n=-1===e?0:e;q(p.current[n])})),d.current=s}),[s,t]),u?(0,k.jsxs)("div",{className:T("options__container"),onKeyDown:e=>{s&&(V(e)===H.Escape&&(c(!1),q(l.current)),V(e)===H.Home&&(q(p.current[0]),e.preventDefault()),V(e)===H.End&&(q(p.current[u-1]),e.preventDefault()))},onfocusout:()=>{f&&(a.current=setTimeout((()=>{c(!1)}),200))},onfocusin:()=>{clearTimeout(a.current)},children:[(0,k.jsx)(Dl,{transitionStartState:Nl,isActive:r,children:(0,k.jsx)("div",{className:T("options__dialog"),children:(0,k.jsx)(bu,{})})}),f&&(0,k.jsx)(Dl,{isActive:s,transitionStartState:Nl,children:(0,k.jsx)("ul",{className:T(["options__menu"]),role:"menu",tabIndex:"-1","aria-labelledby":i,children:t.map((({name:r,title:o,available:i},a)=>(0,k.jsx)("li",{className:T("options__menu__item"),role:"menuitem","data-testid":r,children:(0,k.jsxs)("button",{type:"button",ref:e=>{p.current[a]=e},className:T(["button","button--secondary"]),onKeyDown:e=>((e,t)=>{if(V(e)===H.ArrowDown){const n=Math.min(u-1,t+1);q(p.current[t===n?0:n]),e.preventDefault()}if(V(e)===H.ArrowUp){const n=Math.max(0,t-1);q(p.current[t===n?u-1:n]),e.preventDefault()}})(e,a),onKeyPress:e=>((e,n)=>{const r=String.fromCharCode(e.charCode);if(1!==r.length||!r.match(/\S/))return;let o=-1;t.forEach(((e,t)=>{t>n&&e.title.charAt(0).toLowerCase()===r.toLowerCase()&&-1===o&&(o=t)})),-1!==o&&q(p.current[o])})(e,a),onClick:()=>((e,t)=>{t&&(c(!1),n(e))})(r,i),"aria-disabled":i?null:"true",children:[(0,k.jsxs)("span",{className:T("button__text"),children:[o,!i&&" "]}),!i&&(0,k.jsx)("span",{className:T("button__state"),children:e("options.unavailableText")})]})},r)))})}),(0,k.jsxs)("button",{type:"button",className:T(["button","button--secondary","chat__options__button",...!f&&y?[`chat__options__button--${y}`]:[]]),id:i,onClick:()=>{r&&o(),f?c((e=>!e)):h.available&&!r&&n(h.name)},onKeyDown:f?e=>{V(e)===H.ArrowDown&&(c(!0),e.preventDefault())}:null,ref:l,"aria-haspopup":f?"menu":null,"aria-expanded":f?s.toString():null,"aria-disabled":f||h.available?null:"true",children:[f&&(0,k.jsx)(hs,{name:"options",size:"32"}),(0,k.jsx)("span",{className:T("button__text"),children:f?e("options.openButtonText"):`${h.title}${h.available?"":" "}`}),!f&&!h.available&&(0,k.jsx)("span",{className:T("button__state"),children:e("options.unavailableText")})]})]}):null},gu=({label:e,checked:t,description:n,onChange:r,id:o})=>(0,k.jsxs)("li",Object.assign({className:T("translation-options__item"),"aria-selected":t,role:"option",tabIndex:0,onClick:r,onKeyDown:e=>{"Space"!==e.code&&"Enter"!==e.code||(e.preventDefault(),r())},id:o},{children:[(0,k.jsx)(hs,{alt:"",name:"check",size:"16"}),e," ",n&&(0,k.jsxs)("span",{children:["(",n,")"]})]})),wu=({onChange:e,describedById:t})=>{const{context:{locale:n}}=xr(),{t:r}=ya(),{focusContainer:o}=Ka(),{languages:i,currentLocale:a,enableTranslations:s,disableTranslations:c}=Wa(),l=({locale:t})=>()=>{t===a||n===t?c():s(t),e(),o()},u=(0,Qe.useMemo)((()=>[...i].sort(((e,t)=>e.locale===n?-1:t.locale===n?1:e.nativeName.localeCompare(t.nativeName,void 0,{sensitivity:"base"})))),[i,n]);return(0,k.jsx)("ul",Object.assign({"aria-describedby":t,role:"listbox",tabIndex:-1,className:T("translation-options")},{children:u.map(((e,t)=>{const n=0===t,o=a===e.locale||!a&&n;return(0,k.jsx)(gu,{id:e.locale,label:e.nativeName,checked:o,description:n&&r("translations.settings.original"),onChange:l(e)},e.locale)}))}))},ju=function({onClose:e,position:t}){const{t:n}=ya(),r=Va();return(0,k.jsx)(Fl,Object.assign({onCancel:e,headingText:n("translations.menu.title"),cancelButtonText:n("translations.settings.cancelButtonText"),description:n("translations.menu.description"),descriptionId:r,position:t,disableButtonFocusing:!0},{children:(0,k.jsx)(wu,{describedById:r,onChange:e})}))};function Ou({children:e,position:t={horizontal:"left",vertical:"top"},classNames:n}){const[r,o]=(0,Qe.useState)(!1),i=(0,Qe.useRef)(null),a=Va();return(0,k.jsxs)("div",Object.assign({className:T("translations__container"),onKeyDown:e=>{r&&V(e)===H.Escape&&(o(!1),q(i.current))}},{children:[(0,k.jsx)(Dl,Object.assign({onOutTransitionComplete:()=>{},onInTransitionComplete:()=>{},timeout:0,transitionStartState:Nl,isActive:r},{children:(0,k.jsx)("div",Object.assign({className:T("options__dialog"),role:"dialog"},{children:(0,k.jsx)(ju,{onClose:()=>{o(!1)},position:t})}))})),(0,k.jsx)("button",Object.assign({type:"button",className:T(["button","chat__options__button",...n]),id:a,onClick:()=>{o(!r)},onKeyDown:e=>{V(e)===H.ArrowDown&&(o(!0),e.preventDefault())},ref:i,"aria-haspopup":"dialog","aria-expanded":r.toString()},{children:e}))]}))}function xu(){const{menuOptions:e,allowOptionSelection:t}=Da(),{isAvailable:n}=Wa(),{hasInterrupt:r}=yl(),{t:o,locale:i}=ya(),a=Ja(i);if(!n&&(!t||!e.length)||r)return null;const s=o("translations.settings.openButtonText",{hasLanguage:!!a,language:a});return(0,k.jsxs)("div",{className:T("chat__options"),children:[n&&(0,k.jsx)("div",{className:T("chat__options-item","chat__options-item--left"),children:(0,k.jsxs)(Ou,{classNames:["button--secondary"],children:[(0,k.jsx)(hs,{alt:s,name:"newTranslation",size:"16"}),(0,k.jsx)("span",{className:T("button__text"),children:s})]})}),t&&(0,k.jsx)("div",{className:T("chat__options-item","chat__options-item--right"),children:(0,k.jsx)(vu,{})})]})}const Su=()=>{const{scrollToRef:e,unreadIds:t}=(0,Qe.useContext)(Sl),{isMinimized:n}=zi(),{t:r}=ya();return(0,k.jsx)(Dl,Object.assign({isActive:!!t.length&&!n},{children:(0,k.jsx)("div",Object.assign({className:T("unread-messages")},{children:(0,k.jsxs)("button",Object.assign({type:"button",className:T("button","button--primary"),onClick:e},{children:[r("message.unreadMessagesCount",{unreadCount:t.length}),(0,k.jsx)(hs,{name:"chevronDown",size:"32",alt:""})]}))}))}))},_u=wr(Cr,(e=>e.filter((e=>{var t;return Zr(e)&&"service_data"!==e.type&&(null===(t=e.payload)||void 0===t?void 0:t.messageStatus)===a})).map((e=>e.payload.id))));const Eu=e=>{const t=(0,Qe.useRef)(),[n,r]=(0,Qe.useState)(!0),o=ct(_u),i=Pr(),a=Tr(),{isOpen:s}=zi(),c=_r().loadedImageEventIds,l=ct((e=>e.state.isLastEventFromClient));(0,Qe.useEffect)((()=>{const e=t.current,n=()=>{const{scrollHeight:t,scrollTop:n,clientHeight:o}=e,i=Math.abs(t-n-o)>10;r(!i)};return e.addEventListener("scroll",n),()=>e.removeEventListener("scroll",n)}),[]);const u=(0,Qe.useCallback)((()=>{requestAnimationFrame((()=>function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))}(void 0,void 0,void 0,(function*(){var e,n;yield Oa(30),null===(e=t.current)||void 0===e||e.scrollTo({top:null===(n=t.current)||void 0===n?void 0:n.scrollHeight,left:0,behavior:"auto"})}))))}),[]);return(0,Qe.useEffect)((()=>{l&&u()}),[l,u]),(0,Qe.useEffect)((()=>{n&&u()}),[n,o,i,a,s,c,u]),{containerRef:t,unreadIds:o,scrollToRef:()=>{var n,r;const i=null===(n=e[null==o?void 0:o.at(0)])||void 0===n?void 0:n.current;null===(r=t.current)||void 0===r||r.scrollTo({top:null==i?void 0:i.offsetTop,behavior:"auto",left:0})},scrollToBottom:u}},Cu=({children:e})=>{const t=Pr(),n=(0,Qe.useMemo)((()=>t.reduce(((e,t)=>(e[t.payload.id]=(0,Xe.createRef)(),e)),{})),[t]),{scrollToRef:r,scrollToBottom:o,containerRef:i,unreadIds:a}=Eu(n);return(0,k.jsx)(Sl.Provider,Object.assign({value:{eventRefs:n,unreadIds:a,scrollToRef:r,scrollToBottom:o,containerRef:i}},{children:(0,k.jsxs)("div",Object.assign({className:T("chat__container")},{children:[(0,k.jsx)("div",Object.assign({className:T("chat__container__scroll-area"),ref:i},{children:e})),(0,k.jsx)(Su,{})]}))}))},Pu=({baseClassName:e,children:t,title:n})=>{const r=Ar(),o=Va();return(0,k.jsxs)("section",{id:r,className:T(e),"aria-describedby":o,tabIndex:"-1",children:[(0,k.jsx)("h2",{className:T(`${e}__title`),id:o,children:n}),t]})},Tu=()=>{const{t:e}=ya(),t=_a(),n=Ua(),{emitEvent:r}=Xi(),{isActive:o,remaining:i,timer:a,endCountdown:s}=za(),c=i>0,l=e(c?"idleDetachWarning.countdownTitle":"idleDetachWarning.notifyTransferText");return(0,k.jsx)(Pu,{baseClassName:"idle",title:l,children:c&&(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)("div",{className:T("idle__count-container"),children:o&&(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)("span",{className:T("idle__count-text"),children:e("idleDetachWarning.countdownText")}),(0,k.jsx)("span",{className:T("idle__count-timer"),children:e("idleDetachWarning.countdownTimer",a)})]})}),(0,k.jsxs)("div",{className:T("idle__options"),children:[(0,k.jsx)("button",{type:"button",className:T("button","button--primary"),onClick:()=>{n(),s(!0),t(),r("idleTimer.selectContinue")},children:e("idleDetachWarning.continueButton")}),(0,k.jsx)("button",{type:"button",className:T("button","button--primary"),onClick:()=>{s(),t(),r("idleTimer.selectEnd")},children:e("idleDetachWarning.detachButton")})]})]})})},ku=()=>{const{t:e}=ya(),t=Ua(),{name:n}=Ir()||{},{continueChat:r,restartChat:o}=Ha();return(0,k.jsx)(Pu,{baseClassName:"prompt",title:e("resumeConversationPrompt.title",{name:n}),children:(0,k.jsxs)("div",{className:T("prompt__options"),children:[(0,k.jsx)("button",{type:"button",className:T("button","button--primary"),onClick:()=>{t(),r()},children:e("resumeConversationPrompt.continueButton")}),(0,k.jsx)("button",{type:"button",className:T("button","button--primary"),onClick:o,children:e("resumeConversationPrompt.detachButton")})]})})};function Au(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 Nu(e,t,n){return t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Iu=()=>{const{default:e,active:t,userSelected:n,options:r,optionsOverride:o}=_r().entryMeta,i=mt(),a=n||t||e,s=o[a]||r[a]||{},c=(0,Qe.useCallback)((e=>{i(jo(e))}),[i]),l=(0,Qe.useCallback)((e=>{i(go(e))}),[i]),u=(0,Qe.useCallback)((e=>{i(Uo(e))}),[i]),p=(0,Qe.useCallback)((()=>{n?u(null):l(e)}),[n,e,u,l]);return{activeEntry:a,activeEntryOptions:s,setActiveEntryType:l,setUserEntryType:u,cancelEntrySelection:p,setBlockAutoEntrySwitch:c}};function Ru({controlName:e,skipLinkId:t}){const{t:n}=ya(),{sendAssertive:r}=ba(),{emitEvent:o}=Xi(),i=(()=>{const{sendAction:e}=Xi(),{features:t}=Da(),{typingPeekahead:n}=t||{},r=(0,Qe.useRef)(null),o=(0,Qe.useRef)(null),i=(0,Qe.useRef)(!1),a=(0,Qe.useRef)(null);(0,Qe.useEffect)((()=>()=>{clearInterval(a.current),clearTimeout(r.current),clearTimeout(o.current)}),[]);const s=(t,r)=>{e(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Au(Object(n),!0).forEach((function(t){Nu(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Au(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({type:l,state:t},n&&n.enabled?{body:{currentMessage:r}}:{}))};return e=>{e.code&&"Enter"===e.code||13===e.keyCode||(i.current=!0,a.current||(s(!0,e.target.value),a.current=setInterval((()=>{i.current?n&&n.enabled&&s(!0,e.target.value):(clearInterval(a.current),a.current=null)}),2e3)),clearTimeout(r.current),clearTimeout(o.current),r.current=setTimeout((()=>{i.current=!1}),300),o.current=setTimeout((()=>{s(!1,e.target.value)}),2e3))}})(),{setBlockAutoEntrySwitch:a}=Iu(),{hasCharacterLimit:s,characterLimit:c,reachedCharacterWarning:u,reachedCharacterLimit:p,remainingChars:d}=function(e){const{t}=ya(),{sendAssertive:n}=ba(),{hasLimit:r,limit:o}=(()=>{const{entryMeta:{options:{text:e},optionsOverride:{text:t}}}=_r(),{limit:n}=t||e||{limit:null};return{hasLimit:null!==n,limit:null!==n?n:null}})(),i=(0,Qe.useMemo)((()=>U(n,300)),[n]),a=(0,Qe.useMemo)((()=>U(((e,n)=>{e&&i(t("input.srCharacterLimitText",{limit:n}))}),300)),[i,t]),[{value:s}]=tu(e),c=r&&s?o-s.length:o,l=!!r&&c<=50,u=!!r&&c<0;return(0,Qe.useEffect)((()=>{a(l,c)}),[l,c,a]),{hasCharacterLimit:r,characterLimit:o,reachedCharacterWarning:l,reachedCharacterLimit:u,remainingChars:c}}(e),[{value:f}]=tu(e),h=!!f,y=(0,Qe.useCallback)((()=>{u&&r(n("input.srCharacterLimitText",{limit:d})),o("ui.inputFocus")}),[n,r,u,d,o]),m=(0,Qe.useMemo)((()=>n("input.inputPlaceholder",{hasLimit:s,limit:s?c:null})),[n,s,c]),b=(0,Qe.useMemo)((()=>n("input.inputLabel",{hasLimit:s,limit:s?c:null})),[n,s,c]);return(0,Qe.useLayoutEffect)((()=>(a(h),()=>{a(!1)})),[a,h]),(0,k.jsxs)(au,{className:T("entry-form"),disableValidationClasses:!0,noValidate:"true",children:[(0,k.jsxs)("div",{className:T(["input--text__container",...u&&!p?["character-warning"]:[],...p?["character-exceeded"]:[]]),children:[(0,k.jsx)(fu,{id:t,type:"text",name:e,className:T("input__text"),autocomplete:"off",placeholder:m,labelText:b,labelClass:T("visually-hidden"),"aria-invalid":s?p:null,onKeyUp:i,onFocus:y}),(0,k.jsx)("div",{className:T("character-count"),children:u&&(0,k.jsx)("span",{children:d})})]}),(0,k.jsx)("button",{className:T("button","input__submit"),type:"submit",onPointerDown:e=>{e.preventDefault()},"aria-disabled":!h||p?"true":null,children:(0,k.jsx)(hs,{name:"send",size:"32",alt:n("input.sendMessage")})})]})}function Du(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 Mu(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Du(Object(n),!0).forEach((function(t){Lu(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Du(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Lu(e,t,n){return t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Uu(){return Uu=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Uu.apply(this,arguments)}const Fu="textMessageEntry";function Bu(e){let t=Uu({},(function(e){if(null==e)throw new TypeError("Cannot destructure "+e)}(e),e));const{isOpen:n,setVisibility:r}=zi(),o=Ar(),i=_a(),{sendMessage:a}=Xi(),s=(0,Qe.useCallback)(((e,{updateControlValue:t})=>{a({body:e[Fu]}),t(Fu,""),i(),n||r(S.open)}),[a,i,n,r]);return(0,k.jsx)(nu,Mu(Mu({},t),{},{formId:"textEntry",persistData:!0,onSubmit:s,children:(0,k.jsx)(Ru,{controlName:Fu,skipLinkId:o})}))}const $u=()=>{const{t:e}=ya(),{currentUploads:t}=Aa();return(0,k.jsx)("div",{className:T("progress"),children:t.map((({id:t,name:n,progress:r,uploading:o,error:i})=>(0,k.jsxs)("div",{className:T("progress_container"),children:[(0,k.jsxs)("div",{className:T("progress__text"),children:[(0,k.jsx)("span",{className:T("progress__text--file-name"),children:n}),(0,k.jsx)("span",{className:T("progress__text--percentage"),children:`${r}%`})]}),(0,k.jsx)(su,{error:i}),(0,k.jsx)("progress",{className:T("progress__bar"),role:"progressbar","aria-valuemin":"0","aria-valuemax":"100","aria-label":e("fileUpload.srProgressLabel",{fileName:n}),max:"100","aria-valuenow":r,value:r,"aria-busy":o,children:`${r}%`})]},t)))})};function zu({id:e,name:t,labelText:n,contentHint:r,outputText:o,accept:i}){const{isSubmitted:a}=eu(),[s,c]=(0,Qe.useState)(!1),[{onInput:l,onBlur:u},{error:p}]=tu(t),d=Va(),f=Va(),h=Va(),y=a&&p,m=[h];r&&m.push(f),y&&m.push(d);const b=(0,Qe.useCallback)((()=>{c(!0)}),[c]),v=(0,Qe.useCallback)((()=>{c(!1),u()}),[c,u]),g=(0,Qe.useCallback)((e=>{const t={target:{value:e.target.files}};l(t)}),[l]);return(0,k.jsxs)("div",{className:T("upload__container"),children:[r&&(0,k.jsx)("span",{className:T("upload__content-hint"),id:f,children:r}),(0,k.jsx)(su,{id:d,error:y&&p}),(0,k.jsx)("div",{className:T(["file-upload",...s?["focus-within"]:[]]),children:(0,k.jsxs)("label",{htmlFor:e,className:T("upload__label"),children:[(0,k.jsx)(hs,{name:"upload",size:"32"}),(0,k.jsxs)("div",{children:[(0,k.jsx)("span",{className:T(["upload__label--text"]),children:n}),(0,k.jsx)("input",{id:e,className:T("upload__input"),type:"file",name:t,onChange:g,"aria-invalid":y?"true":"false","aria-describedby":m.join(" "),accept:i||null,onFocus:b,onBlur:v}),(0,k.jsx)("span",{className:T("upload__output"),"aria-hidden":"true",id:h,children:o})]})]})})]})}function Hu({skiplinkId:e,controlName:t,accept:n,contentHint:r,isUploading:o,isComplete:i,onClickCancel:a}){const{t:s}=ya(),[{value:c}]=tu(t),l=c&&c.length>0,u=l?c[0].name:"";return(0,k.jsxs)(au,{className:T("upload-form"),children:[(0,k.jsx)(zu,{name:t,id:e,accept:n,labelText:s("fileUpload.labelText"),outputText:s("fileUpload.selectedText",{hasFile:l,filename:u}),contentHint:r}),(0,k.jsxs)("div",{className:T("upload__button-container"),children:[(0,k.jsx)("button",{id:o||!i?e:void 0,type:"button",onClick:a,className:T("button","button--secondary","upload__cancel"),children:s("fileUpload.cancelButtonText")}),(0,k.jsx)("button",{className:T("button","button--primary"),type:"submit",children:s("fileUpload.uploadButtonText")})]})]})}const Vu="fileListForm",qu="fileList",Wu=()=>{const{t:e}=ya(),{sendPolite:t,sendAssertive:n}=ba(),r=Ar(),o=_a(),{serviceAllowsUploads:i,allowedMimeTypes:a,maxSize:s}=ka(),c=(0,Qe.useRef)(null),l=(0,Qe.useRef)(i),{cancelEntrySelection:u}=Iu(),{uploadFile:p,clearUploads:d,isUploading:f,isComplete:h}=Aa(),{hasFile:y,selectedFileName:m,uploadHandle:b,hasServerError:v,progress:g}=((e,t)=>{const n=ct((n=>Yl(n,{formId:e,name:t}))),{currentUploads:r}=Aa(),o=n&&n.length>0;let i=null,a=!1,s=0;if(r&&r.length>0){const e=r[0];i=e.uploadHandle,a=!!e.error,s=e.progress}return{hasFile:o,selectedFileName:o?n[0].name:"",uploadHandle:i,hasServerError:a,progress:s}})(Vu,qu),w=Va(),j=(0,Qe.useRef)(!0),O=e("fileUpload.contentHint",{size:$(s)}),x=(0,Qe.useRef)(""),S=(0,Qe.useRef)(null);(0,Qe.useEffect)((()=>{x.current&&S.current?.contains(document.activeElement)&&"INPUT"===document.activeElement.tagName&&n(O),x.current=O}),[O,n]),(0,Qe.useEffect)((()=>{g>0&&t(1===g?e("fileUpload.srStartedText"):`${g}%`)}),[g,t,e]),(0,Qe.useEffect)((()=>{j.current||f||!h||(d(),u(),o(),setTimeout((()=>{t(e("fileUpload.srCompleteText"))}),300)),j.current=h}),[f,h,d,u,o,t,e]);const _=(0,Qe.useCallback)((({fileList:e})=>{p(e[0]),o()}),[p,!1,o]),E=(0,Qe.useCallback)((()=>{b&&b.abort(),d(),u(),o()}),[b,d,u,o]),C=(0,Qe.useMemo)((()=>({[qu]:[Bl((()=>i),e("fileUpload.errors.unavailable")),Bl(zl,e("fileUpload.errors.noFile")),Bl($l,e("fileUpload.errors.tooLarge"),s)]})),[s,i,e]);return(0,k.jsx)("div",{className:T(["upload",...v?["upload--error"]:[]]),ref:S,children:(0,k.jsxs)(nu,{formId:Vu,persistData:!0,onSubmit:_,validationSchema:C,children:[(f||!h)&&(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)($u,{}),(0,k.jsx)("div",{className:T("upload__button-container"),children:(0,k.jsx)("button",{id:f||!h?r:void 0,type:"button",onClick:E,ref:c,className:T("button","button--secondary","upload__cancel"),children:e("fileUpload.cancelButtonText")})})]}),!f&&h&&(0,k.jsx)(Hu,{controlName:qu,skiplinkId:r,accept:a.join(", "),contentHint:O,isComplete:h,isUploading:f,outputText:e("fileUpload.selectedText",{hasFile:y,filename:m}),onClickCancel:E}),!l.current&&(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)("span",{className:T("notification"),id:w,children:e("fileUpload.unavailableText")}),(0,k.jsx)("div",{className:T("upload__button-container"),children:(0,k.jsx)("button",{id:f||!h?r:void 0,type:"button",onClick:E,className:T("button","button--secondary","upload__cancel"),children:e("fileUpload.cancelButtonText")})})]})]})})},Gu=()=>{const{t:e}=ya(),{showFileUpload:t,serviceAllowsUploads:n}=ka(),[r,o]=(0,Qe.useState)(n),a=_a(),s=(0,Qe.useRef)(null),{setUserEntryType:c,activeEntry:l}=Iu(),u=(0,Qe.useRef)(null),{sendPolite:p}=ba(),d=!!Ir();return(0,Qe.useEffect)((()=>{W(u.current,(()=>{n||a()})),o(n)}),[n,a]),(0,Qe.useEffect)((()=>{s.current&&!n&&p(e("fileUpload.srUnavailableText")),!1===s.current&&n&&p(e("fileUpload.srAvailableText")),d&&(s.current=n)}),[n,d,p,e]),!t&&l!==i&&(0,k.jsx)(Dl,{isActive:r,transitionStartState:Il,children:(0,k.jsx)("div",{className:T("upload-toggle-wrapper"),children:(0,k.jsx)(Dl,{isActive:r,transitionStartState:Rl,children:(0,k.jsx)("button",{className:T(["button","button--secondary","upload-toggle"]),ref:u,"aria-disabled":r?null:"true",type:"button",onClick:r?()=>{c(i),a()}:null,children:(0,k.jsx)(hs,{name:"file",size:"32",alt:e("fileUpload.toggleButtonText")})})})})})};function Ku(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 Ju(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ku(Object(n),!0).forEach((function(t){Xu(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ku(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Xu(e,t,n){return t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Qu=()=>{const{isOpen:e}=zi(),t=(0,Qe.useRef)(null),{hasCountdown:n}=za(),[r,o]=(0,Qe.useState)(n),{hasPrompt:a}=Ha(),[s,c]=(0,Qe.useState)(a),l=_a(),u=(0,Qe.useRef)(!1),{activeEntry:p}=Iu(),[d,f]=(0,Qe.useState)({text:Bu,upload:Wu}),[h,y]=(0,Qe.useState)((()=>p)),m=xr(),{accountAllowsUploads:b}=ka(),v=(0,Qe.useCallback)((()=>{W(t.current,l)}),[l]);(0,Qe.useEffect)((()=>{const{customComponents:e}=m,{entry:t}=e||{};t&&f((e=>Ju(Ju({},e),t)))}),[m]),(0,Qe.useEffect)((()=>{v(),o(n),c(a)}),[n,a,v]),(0,Qe.useEffect)((()=>{y(p),v()}),[p,v,t]),u.current=!(!t.current||!t.current.contains(document.activeElement));const g=d[h];return(0,k.jsxs)("div",{className:T("chat__entry"),ref:t,children:[r&&(0,k.jsx)(Tu,{}),s&&(0,k.jsx)(ku,{}),(0,k.jsxs)("div",{className:T(["entry__body",...n||a?["entry__body--hidden"]:[]]),children:[h!==i&&b&&e&&(0,k.jsx)(Gu,{}),(0,k.jsx)(g,{})]})]})},Yu=()=>{const{t:e}=ya(),{isOpen:t,closeChat:n}=zi(),{isWindow:r}=Rr();return t&&r?(0,k.jsx)("button",{type:"button",className:T("button","collapse-button"),onClick:n,children:(0,k.jsx)(hs,{name:"chevronDown",size:"32",alt:e("window.srCollapseButton")})}):null},Zu=({children:e,handleClose:t,title:n,closeButtonText:r,srCloseButtonText:o,id:i})=>{const a=Va();return(0,k.jsxs)("section",Object.assign({tabIndex:-1,id:i,"aria-labelledby":n?a:void 0,className:T("chat-status",!n&&"chat-status--condensed")},{children:[(0,k.jsxs)("div",Object.assign({className:T("chat-status__body")},{children:[n?(0,k.jsx)("h2",Object.assign({className:T("chat-status__title"),id:a},{children:n})):null,e]})),"function"==typeof t&&(0,k.jsxs)("button",Object.assign({type:"button",onClick:t,className:T("button","button--tertiary","chat-status__close")},{children:[r||(0,k.jsx)(hs,{name:"close",size:"16",alt:""}),o&&(0,k.jsx)("span",Object.assign({className:T("visually-hidden")},{children:o}))]}))]}))};function ep(){const{t:e}=ya(),{id:t}=Ka(),{hasInterrupt:n}=yl(),{disableTranslations:r,currentLocale:o}=Wa(),i=Ja(o),a=_a(),s=e("translations.status.label",{language:i}),c=(0,Qe.useCallback)((()=>{r(),a()}),[r,a]);return n?null:(0,k.jsx)(Zu,{handleClose:c,title:s,id:t,closeButtonText:e("translations.status.stopText"),srCloseButtonText:e("translations.status.srStopText")})}const tp=({handleClick:e,icon:t,title:n,srButtonText:r})=>(0,k.jsxs)("button",Object.assign({type:"button",onClick:e,className:T("button","button--primary","chat-status__button")},{children:[(0,k.jsx)(hs,{name:t,size:"16",alt:""}),n,r&&(0,k.jsx)("span",Object.assign({className:T("visually-hidden")},{children:r}))]}));function np(){const{showProposal:e,translationProposal:t,dismissTranslationProposal:n,activateTranslationProposal:r}=(()=>{const{isActive:e,languages:t}=Wa(),n=mt(),{sendAction:r}=Xi(),{translationProposal:o}=ct((e=>e.translations)),{enableTranslations:i}=Wa(),{isOpen:a}=zi(),{locale:s}=ya(),c=null==o?void 0:o.proposedLocale,l=Ja(c),u=(0,Qe.useMemo)((()=>null!==o&&!e&&a&&s!==c&&t.some((e=>e.locale===c))),[o,e,a,s,c,t]);return{activateTranslationProposal:()=>{i(null==o?void 0:o.proposedLocale,b)},dismissTranslationProposal:()=>{r({type:d,body:{type:m}}),n(Di())},proposedLocale:c,proposedLocaleNativeName:l,showProposal:u,translationProposal:o}})(),{id:o}=Ka();return e?(0,k.jsx)(Zu,Object.assign({handleClose:n,srCloseButtonText:t.srDismissButtonText,id:o,title:t.titleLabel},{children:(0,k.jsx)(tp,{handleClick:r,icon:"newTranslation",title:t.buttonLabel})})):null}function rp(){const{hasInterrupt:e}=yl(),{isActive:t}=Wa();return e?null:t?(0,k.jsx)(ep,{}):(0,k.jsx)(np,{})}function op(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 ip(e,t,n){return t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const ap=function({children:e,interruptComponent:t}){const{hasInterrupt:n,meta:r}=yl(),{isOpen:o}=zi();return n?o?(0,k.jsx)(t,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?op(Object(n),!0).forEach((function(t){ip(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):op(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},r)):null:(0,k.jsxs)(k.Fragment,{children:[(0,k.jsxs)(Cu,{children:[(0,k.jsxs)("div",{className:T("chat__container__header"),children:[(0,k.jsx)(rp,{}),(0,k.jsx)(Yu,{})]}),e]}),(0,k.jsx)(Qu,{}),o&&(0,k.jsx)(xu,{})]})},sp=({originalError:e,title:t,message:n,buttonText:r,action:o,srText:i})=>{const a=Xi(),s=Va(),{sendPolite:c}=ba(),l=_a(),u="SeamlySessionExpiredError"===e.name;return(0,Qe.useEffect)((()=>{u&&a[o]&&a[o]()}),[o,a,u]),(0,Qe.useEffect)((()=>{!u&&i&&setTimeout((()=>{c(i)}),200)}),[c,i,u]),u?(0,k.jsx)(k.Fragment,{}):(0,k.jsxs)("section",{className:T("interrupt"),"aria-labelledby":s,children:[(0,k.jsx)(Yu,{}),(0,k.jsxs)("div",{className:T("interrupt__body"),children:[(0,k.jsx)("h2",{id:s,className:T("interrupt__title"),children:t}),(0,k.jsx)("p",{className:T("interrupt__message"),children:n}),r&&o&&(0,k.jsx)("div",{className:T("interrupt__actions"),children:(0,k.jsx)("button",{type:"button",className:T("button","button--primary"),onClick:()=>{a[o]&&a[o](),l()},children:r})})]})]})};function cp({event:e}){const[t]=_l(e);return(0,k.jsx)(t,{event:e})}function lp(){const{preChatEvents:e,layoutMode:t}=xr(),{hasInterrupt:n}=yl(),{isOpen:r}=zi(),o=!(n||!e?.length||r);return o&&(0,k.jsx)("ul",{className:T("pre-chat-messages",`pre-chat-messages--${t}`),"aria-hidden":!o,children:e.map((e=>(0,k.jsx)("li",{className:T("pre-chat-messages__message"),children:(0,k.jsx)(cp,{event:e})},e.payload.id)))})}function up(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 pp(e,t,n){return t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const dp=()=>{const e=function(){const{startChatIcon:e}=xr();return e}(),t=Ir(),{hasInterrupt:n}=yl(),r=t&&!n,o=r?t.avatar:e;return o?(0,k.jsx)("img",{className:T(r?"avatar":"icon"),src:o,alt:""}):(0,k.jsx)(hs,{name:"avatar",size:"32"})},fp=({onClick:e})=>{const t=Wi(),{t:n}=ya(),r=t()?n("window.openButton.srContinue"):n("window.openButton.srStart"),o=_a(),{isOpen:i}=zi(),a=kr(),s=(0,Qe.useCallback)((()=>{e(),o()}),[o,e]);return(0,k.jsx)(Dl,{isActive:!i,transitionStartState:Il,children:(0,k.jsxs)("button",{className:T("window-open-button"),"aria-label":r,"aria-hidden":i,onClick:s,children:[(0,k.jsx)("span",{className:T("message-count"),"aria-hidden":"true",children:!!a&&a}),(0,k.jsx)(dp,{})]})})};function hp(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 yp(e,t,n){return t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const mp={app:()=>(0,k.jsx)(Ul,{children:(0,k.jsx)(ap,{interruptComponent:sp,children:(0,k.jsx)(Tl,{})})}),inline:()=>{const{showInlineView:e,containerRef:t}=(()=>{const e=mt(),{connectWhenInView:t}=xr(),n=ct(Mr),{containerRef:r,isVisible:o}=Hi({enabled:t,freezeOnceVisible:!0});return(0,Qe.useEffect)((()=>{o&&e(Fi())}),[e,o]),{containerRef:r,showInlineView:n}})(),{isOpen:n}=zi(),{hasInterrupt:r,meta:o}=yl();return r&&!n?(0,k.jsx)(sp,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?up(Object(n),!0).forEach((function(t){pp(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):up(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},o)):(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(Dl,{isActive:!n,transitionStartState:Il,children:(0,k.jsxs)("div",{ref:t,className:T("unstarted-wrapper","unstarted-wrapper--inline"),children:[(0,k.jsx)(lp,{}),(0,k.jsx)(Ml,{})]})}),(0,k.jsx)(Dl,{isActive:n,transitionStartState:Il,children:(0,k.jsx)(Ul,{ref:t,children:e&&(0,k.jsx)(ap,{interruptComponent:sp,children:n&&(0,k.jsx)(Tl,{})})})})]})},window:()=>{const{isOpen:e,openChat:t}=zi(),n=Hr(),{hasInterrupt:r,meta:o}=yl(),{t:i}=ya(),a=i("window.chat.continue"),s=(0,Qe.useMemo)((()=>({payload:{body:{text:a}}})),[a]);return r&&!e?(0,k.jsx)(sp,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?hp(Object(n),!0).forEach((function(t){yp(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):hp(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},o)):(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(fp,{onClick:t}),(0,k.jsx)(Dl,{isActive:!e&&!n,transitionStartState:Il,children:(0,k.jsx)("div",{className:T("unstarted-wrapper","unstarted-wrapper--window"),children:(0,k.jsx)(lp,{})})}),(0,k.jsx)(Dl,{isActive:!e&&n,transitionStartState:Nl,children:(0,k.jsx)("div",{className:T("unstarted-wrapper","unstarted-wrapper--window","unstarted-wrapper--continue"),children:(0,k.jsx)(Hc,{event:s})})}),(0,k.jsx)(Dl,{isActive:e,transitionStartState:Nl,children:(0,k.jsx)(Ul,{children:(0,k.jsx)(ap,{interruptComponent:sp,children:(0,k.jsx)(Tl,{})})})})]})}},bp=({children:e})=>{const[,t]=xa(),{namespace:n,layoutMode:r,zIndex:o}=xr(),{isOpen:i,isVisible:a}=zi(),s=wa(),c=Hr(),{locale:l}=ya(),u=mp[r],p=(0,Qe.useCallback)((e=>{t(e)}),[t]),d=(0,Qe.useMemo)((()=>{if(l&&document.querySelector("html").getAttribute("lang")!==l)return l}),[l]);if(!u)return console.warn('"layoutMode" should be one of "app", "inline" or "window"'),null;const f=["app",`app--layout-${r}`,`namespace--${n}`,...s];return i||"app"===r||f.push("app--collapsed"),c&&f.push("app--user-responded"),a&&(0,k.jsx)("div",{className:T(f),lang:d,tabIndex:"-1","data-nosnippet":!0,style:{zIndex:o},ref:p,children:e||(0,k.jsx)(u,{})})};function vp(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 gp(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?vp(Object(n),!0).forEach((function(t){wp(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):vp(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function wp(e,t,n){return t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const jp=e=>(0,k.jsx)(jl,gp(gp({},e),{},{children:(0,k.jsx)(bp,{})}));var Op=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 o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n};class xp{constructor(e,t){const{namespace:n="",parentElement:r,showFaq:o}=e,i=Op(e,["namespace","parentElement","showFaq"]);this.config=Object.assign(Object.assign({},i),{namespace:n,showFaq:!1!==o}),this.namespace=n,this.parentElement=r,this.externalApi=t,this.api=new Ge({layoutMode:e.layoutMode,namespace:e.namespace,config:e.api,context:e.context}),this.eventBus=new(Je()),this.functions={},this.registerFunctions({on:this.eventBus.on,off:this.eventBus.off}),this.eventBus.on("function.register",((e,t)=>this.registerFunction(e,t))),this.eventBus.on("function.unregister",((e,t)=>this.unregisterFunction(e,t)))}render(){return function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))}(this,void 0,void 0,(function*(){const e=this.config.customComponents||{},{view:t}=e,n=Op(e,["view"]),r=Object.assign(Object.assign({},this.config),{customComponents:Object.keys(n).length?n:void 0}),o=function({initialState:e,api:t,eventBus:n,config:r}){return Xn({reducer:{state:Ho,app:Gr,config:Qo,i18n:mi,translations:Mi,visibility:Bi,forms:di,interrupt:Yr},preloadedState:e,middleware:e=>e({thunk:{extraArgument:{api:t,eventBus:n,config:r}},serializableCheck:!1}).concat([ti({api:t}),vi({api:t}),Oi({api:t}),Li])})}({api:this.api,eventBus:this.eventBus,config:r,initialState:void 0});o.dispatch(Ko(r)),yield o.dispatch(dr());try{const{locale:e}=yield o.dispatch($r()).unwrap();yield o.dispatch(hr(e))}catch(e){}o.dispatch(Fr()),t?(0,Xe.render)((0,k.jsx)(jl,Object.assign({eventBus:this.eventBus,store:o,api:this.api},{children:(0,k.jsx)(t,{})})),this.parentElement):(0,Xe.render)((0,k.jsx)(jp,{config:r,eventBus:this.eventBus,store:o,api:this.api}),this.parentElement)}))}destroy(){(0,Xe.render)(null,this.parentElement),this.eventBus.off(),this.api.disconnect(),delete this.functions}registerFunctions(e){Object.entries(e).forEach((([e,t])=>{this.registerFunction(e,t)}))}registerFunction(e,t){this.functions[e]=this.functions[e]||[],this.functions[e].push(t),this.externalApi.handleActions()}unregisterFunction(e,t){const n=this.functions[e];n&&n.length&&(this.functions[e]=n.filter((e=>e!==t)))}execFunction(e,...t){const n=this.functions[e];return!(!n||!n.length||(n.forEach((n=>{try{n(...t)}catch(t){console.error(`Action(${e}) failed: `,t)}})),0))}}function Sp(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 _p(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Sp(Object(n),!0).forEach((function(t){Ep(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Sp(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Ep(e,t,n){return t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Cp=e=>"object"==typeof e&&"action"in e,Pp=e=>_p(_p({},e),{},{args:Array.isArray(e.args)?e.args:[e.args]}),Tp=class{constructor(e){this._waitingActions=[],this._instances={},this.appConfig=e,this.context={}}push(...e){(e=e.filter(Cp).map(Pp)).length&&(this._waitingActions.push(...e),this.handleActions())}handleActions(){const e=this._waitingActions;this._waitingActions=[],e.forEach((e=>{switch(e.action){case"init":this.handleInit(e);break;case"destroy":this.handleDestroy(e);break;default:this.handleAction(e)||this.setContext(e.action,...e.args)||this._waitingActions.push(e)}}))}instanceInitializing(e){const t=Object.keys(this._instances);return!e&&t.length>0||t.includes(e)}setContext(e,t){const{instance:n}=t;if(this.instanceInitializing(n))return!1;switch(e){case"setTopic":const{name:e}=t;return e&&(this.context.topic=e),!0;case"setTranslation":const{enabled:n,locale:r}=t;return n&&r&&(this.context.translationLocale=r),!0;case"setVariables":return Object.keys(t).length>0&&(this.context.variables=_p({},t)),!0;default:return!1}}handleInit(e){const t=this.getUserConfig(...e.args),n=this.getCombinedConfig(t),{parentElement:r,namespace:o}=n||t;if(o?Object.values(this._instances).forEach((e=>{e.parentElement!==r&&e.namespace!==o||this.destroy(e)})):this.destroy(),n){const e=this.createInstance(n);this._instances[n.namespace]=e,this.context={},e.render()}}handleDestroy(e){this.destroy(e.instance)}handleAction(e){const{action:t,instance:n,args:r}=e,o=Object.values(this._instances);return!n&&o.length>1&&console.warn(`Multiple instances detected. Due to potential race conditions, it is recommended to target a specific instance with the action: ${t}`),o.map((e=>(!n||e.namespace===n)&&e.execFunction(t,...r))).some(Boolean)}createInstance(e){return new xp(e,this)}destroy(e){e?("string"==typeof e&&(e=this._instances[e]),e&&(e.destroy(),delete this._instances[e.namespace])):Object.entries(this._instances).forEach((([e,t])=>{t.destroy(),delete this._instances[e]}))}getUserConfig(e={}){return e}getCombinedConfig(e){const t=_p(_p({},e.context||this.appConfig.context),this.context),n=this.getMergedVariables(e);Object.keys(n).length>0&&(t.variables=n);const r=_p(_p({},this.appConfig.defaults),e.defaults),o=_p(_p(_p({},this.appConfig),e),{},{api:_p(_p({},this.appConfig.api),e.api),context:Object.keys(t).length?t:void 0,defaults:Object.keys(r).length?r:void 0});return"function"==typeof this.appConfig?this.appConfig(o):o}getMergedVariables(e){return _p(_p(_p({},this.appConfig.context?.variables||{}),e.context?.variables||{}),this.context.variables||{})}},kp=(...e)=>{const t=new URL(window.location.href);return e.reduce(((e,n)=>{const r=t.searchParams.get(n)||sessionStorage.getItem(n);return r&&(e[n]=r),e}),{})},Ap=(...e)=>{const t=new URL(window.location.href),n=e.reduce(((e,n)=>{const r=t.searchParams.get(n),o=r||sessionStorage.getItem(n);return r&&sessionStorage.setItem(n,r),o?(e.set(n,o),e):e}),new URLSearchParams),r=new URLSearchParams(Object.assign(Object.assign({},Object.fromEntries(t.searchParams)),Object.fromEntries(n)));return r.toString()&&window.history.replaceState(null,null,`?${r}`),kp(...n.keys())},Np=(...e)=>{const t=document.querySelector("[data-reset-search-params]");t&&t.addEventListener("click",(t=>{t.preventDefault();const n=new URL(window.location.href);e.forEach((e=>{sessionStorage.removeItem(e),n.searchParams.delete(e)})),window.location.href=n.toString()}))}})(),module.exports=r})();
2
+ (()=>{var e={574:e=>{"use strict";function t(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 n(){this._defaults=[]}for(var r=0,o=["use","on","once","set","query","type","accept","auth","withCredentials","sortQuery","retry","ok","redirects","timeout","buffer","serialize","parse","ca","key","pfx","cert","disableTLSCerts"];r<o.length;r++){const e=o[r];n.prototype[e]=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return this._defaults.push({fn:e,args:n}),this}}n.prototype._setDefaults=function(e){var n,r=function(e,n){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,n){if(e){if("string"==typeof e)return t(e,n);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?t(e,n):void 0}}(e))||n&&e&&"number"==typeof e.length){r&&(e=r);var o=0,i=function(){};return{s:i,n:function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,s=!0,c=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return s=e.done,e},e:function(e){c=!0,a=e},f:function(){try{s||null==r.return||r.return()}finally{if(c)throw a}}}}(this._defaults);try{for(r.s();!(n=r.n()).done;){const t=n.value;e[t.fn](...t.args)}}catch(e){r.e(e)}finally{r.f()}},e.exports=n},766:(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}let o;"undefined"!=typeof window?o=window:"undefined"==typeof self?(console.warn("Using browser-only version of superagent in non-browser environment"),o=void 0):o=self;const i=n(767),a=n(445),s=n(129),c=n(842),l=n(244),u=l.isObject,p=l.mixin,d=l.hasOwn,f=n(253),h=n(574);function y(){}e.exports=function(e,n){return"function"==typeof n?new t.Request("GET",e).end(n):1===arguments.length?new t.Request("GET",e):new t.Request(e,n)};const m=t=e.exports;t.Request=x,m.getXHR=()=>{if(o.XMLHttpRequest)return new o.XMLHttpRequest;throw new Error("Browser-only version of superagent could not find XHR")};const b="".trim?e=>e.trim():e=>e.replace(/(^\s*|\s*$)/g,"");function v(e){if(!u(e))return e;const t=[];for(const n in e)d(e,n)&&g(t,n,e[n]);return t.join("&")}function g(e,t,n){if(void 0!==n)if(null!==n)if(Array.isArray(n)){var o,i=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=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}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var o=0,i=function(){};return{s:i,n:function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,s=!0,c=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){c=!0,a=e},f:function(){try{s||null==n.return||n.return()}finally{if(c)throw a}}}}(n);try{for(i.s();!(o=i.n()).done;)g(e,t,o.value)}catch(e){i.e(e)}finally{i.f()}}else if(u(n))for(const r in n)d(n,r)&&g(e,`${t}[${r}]`,n[r]);else e.push(encodeURI(t)+"="+encodeURIComponent(n));else e.push(encodeURI(t))}function w(e){const t={},n=e.split("&");let r,o;for(let e=0,i=n.length;e<i;++e)r=n[e],o=r.indexOf("="),-1===o?t[decodeURIComponent(r)]="":t[decodeURIComponent(r.slice(0,o))]=decodeURIComponent(r.slice(o+1));return t}function j(e){return/[/+]json($|[^-\w])/i.test(e)}function O(e){this.req=e,this.xhr=this.req.xhr,this.text="HEAD"!==this.req.method&&(""===this.xhr.responseType||"text"===this.xhr.responseType)||void 0===this.xhr.responseType?this.xhr.responseText:null,this.statusText=this.req.xhr.statusText;let t=this.xhr.status;1223===t&&(t=204),this._setStatusProperties(t),this.headers=function(e){const t=e.split(/\r?\n/),n={};let r,o,i,a;for(let e=0,s=t.length;e<s;++e)o=t[e],r=o.indexOf(":"),-1!==r&&(i=o.slice(0,r).toLowerCase(),a=b(o.slice(r+1)),n[i]=a);return n}(this.xhr.getAllResponseHeaders()),this.header=this.headers,this.header["content-type"]=this.xhr.getResponseHeader("content-type"),this._setHeaderProperties(this.header),null===this.text&&e._responseType?this.body=this.xhr.response:this.body="HEAD"===this.req.method?null:this._parseBody(this.text?this.text:this.xhr.response)}function x(e,t){const n=this;this._query=this._query||[],this.method=e,this.url=t,this.header={},this._header={},this.on("end",(()=>{let e,t=null,r=null;try{r=new O(n)}catch(e){return t=new Error("Parser is unable to parse the response"),t.parse=!0,t.original=e,n.xhr?(t.rawResponse=void 0===n.xhr.responseType?n.xhr.responseText:n.xhr.response,t.status=n.xhr.status?n.xhr.status:null,t.statusCode=t.status):(t.rawResponse=null,t.status=null),n.callback(t)}n.emit("response",r);try{n._isResponseOK(r)||(e=new Error(r.statusText||r.text||"Unsuccessful HTTP response"))}catch(t){e=t}e?(e.original=t,e.response=r,e.status=e.status||r.status,n.callback(e,r)):n.callback(null,r)}))}m.serializeObject=v,m.parseString=w,m.types={html:"text/html",json:"application/json",xml:"text/xml",urlencoded:"application/x-www-form-urlencoded",form:"application/x-www-form-urlencoded","form-data":"application/x-www-form-urlencoded"},m.serialize={"application/x-www-form-urlencoded":s.stringify,"application/json":a},m.parse={"application/x-www-form-urlencoded":w,"application/json":JSON.parse},p(O.prototype,f.prototype),O.prototype._parseBody=function(e){let t=m.parse[this.type];return this.req._parser?this.req._parser(this,e):(!t&&j(this.type)&&(t=m.parse["application/json"]),t&&e&&(e.length>0||e instanceof Object)?t(e):null)},O.prototype.toError=function(){const e=this.req,t=e.method,n=e.url,r=`cannot ${t} ${n} (${this.status})`,o=new Error(r);return o.status=this.status,o.method=t,o.url=n,o},m.Response=O,i(x.prototype),p(x.prototype,c.prototype),x.prototype.type=function(e){return this.set("Content-Type",m.types[e]||e),this},x.prototype.accept=function(e){return this.set("Accept",m.types[e]||e),this},x.prototype.auth=function(e,t,n){1===arguments.length&&(t=""),"object"==typeof t&&null!==t&&(n=t,t=""),n||(n={type:"function"==typeof btoa?"basic":"auto"});const r=n.encoder?n.encoder:e=>{if("function"==typeof btoa)return btoa(e);throw new Error("Cannot use basic auth, btoa is not a function")};return this._auth(e,t,n,r)},x.prototype.query=function(e){return"string"!=typeof e&&(e=v(e)),e&&this._query.push(e),this},x.prototype.attach=function(e,t,n){if(t){if(this._data)throw new Error("superagent can't mix .send() and .attach()");this._getFormData().append(e,t,n||t.name)}return this},x.prototype._getFormData=function(){return this._formData||(this._formData=new o.FormData),this._formData},x.prototype.callback=function(e,t){if(this._shouldRetry(e,t))return this._retry();const n=this._callback;this.clearTimeout(),e&&(this._maxRetries&&(e.retries=this._retries-1),this.emit("error",e)),n(e,t)},x.prototype.crossDomainError=function(){const e=new Error("Request has been terminated\nPossible causes: the network is offline, Origin is not allowed by Access-Control-Allow-Origin, the page is being unloaded, etc.");e.crossDomain=!0,e.status=this.status,e.method=this.method,e.url=this.url,this.callback(e)},x.prototype.agent=function(){return console.warn("This is not supported in browser version of superagent"),this},x.prototype.ca=x.prototype.agent,x.prototype.buffer=x.prototype.ca,x.prototype.write=()=>{throw new Error("Streaming is not supported in browser version of superagent")},x.prototype.pipe=x.prototype.write,x.prototype._isHost=function(e){return e&&"object"==typeof e&&!Array.isArray(e)&&"[object Object]"!==Object.prototype.toString.call(e)},x.prototype.end=function(e){this._endCalled&&console.warn("Warning: .end() was called twice. This is not supported in superagent"),this._endCalled=!0,this._callback=e||y,this._finalizeQueryString(),this._end()},x.prototype._setUploadTimeout=function(){const e=this;this._uploadTimeout&&!this._uploadTimeoutTimer&&(this._uploadTimeoutTimer=setTimeout((()=>{e._timeoutError("Upload timeout of ",e._uploadTimeout,"ETIMEDOUT")}),this._uploadTimeout))},x.prototype._end=function(){if(this._aborted)return this.callback(new Error("The request has been aborted even before .end() was called"));const e=this;this.xhr=m.getXHR();const t=this.xhr;let n=this._formData||this._data;this._setTimeouts(),t.addEventListener("readystatechange",(()=>{const n=t.readyState;if(n>=2&&e._responseTimeoutTimer&&clearTimeout(e._responseTimeoutTimer),4!==n)return;let r;try{r=t.status}catch(e){r=0}if(!r){if(e.timedout||e._aborted)return;return e.crossDomainError()}e.emit("end")}));const r=(t,n)=>{n.total>0&&(n.percent=n.loaded/n.total*100,100===n.percent&&clearTimeout(e._uploadTimeoutTimer)),n.direction=t,e.emit("progress",n)};if(this.hasListeners("progress"))try{t.addEventListener("progress",r.bind(null,"download")),t.upload&&t.upload.addEventListener("progress",r.bind(null,"upload"))}catch(e){}t.upload&&this._setUploadTimeout();try{this.username&&this.password?t.open(this.method,this.url,!0,this.username,this.password):t.open(this.method,this.url,!0)}catch(e){return this.callback(e)}if(this._withCredentials&&(t.withCredentials=!0),!this._formData&&"GET"!==this.method&&"HEAD"!==this.method&&"string"!=typeof n&&!this._isHost(n)){const e=this._header["content-type"];let t=this._serializer||m.serialize[e?e.split(";")[0]:""];!t&&j(e)&&(t=m.serialize["application/json"]),t&&(n=t(n))}for(const e in this.header)null!==this.header[e]&&d(this.header,e)&&t.setRequestHeader(e,this.header[e]);this._responseType&&(t.responseType=this._responseType),this.emit("request",this),t.send(void 0===n?null:n)},m.agent=()=>new h;for(var S=0,_=["GET","POST","OPTIONS","PATCH","PUT","DELETE"];S<_.length;S++){const e=_[S];h.prototype[e.toLowerCase()]=function(t,n){const r=new m.Request(e,t);return this._setDefaults(r),n&&r.end(n),r}}function E(e,t,n){const r=m("DELETE",e);return"function"==typeof t&&(n=t,t=null),t&&r.send(t),n&&r.end(n),r}h.prototype.del=h.prototype.delete,m.get=(e,t,n)=>{const r=m("GET",e);return"function"==typeof t&&(n=t,t=null),t&&r.query(t),n&&r.end(n),r},m.head=(e,t,n)=>{const r=m("HEAD",e);return"function"==typeof t&&(n=t,t=null),t&&r.query(t),n&&r.end(n),r},m.options=(e,t,n)=>{const r=m("OPTIONS",e);return"function"==typeof t&&(n=t,t=null),t&&r.send(t),n&&r.end(n),r},m.del=E,m.delete=E,m.patch=(e,t,n)=>{const r=m("PATCH",e);return"function"==typeof t&&(n=t,t=null),t&&r.send(t),n&&r.end(n),r},m.post=(e,t,n)=>{const r=m("POST",e);return"function"==typeof t&&(n=t,t=null),t&&r.send(t),n&&r.end(n),r},m.put=(e,t,n)=>{const r=m("PUT",e);return"function"==typeof t&&(n=t,t=null),t&&r.send(t),n&&r.end(n),r}},842:(e,t,n)=>{"use strict";const r=n(695),o=n(244),i=o.isObject,a=o.hasOwn;function s(){}e.exports=s,s.prototype.clearTimeout=function(){return clearTimeout(this._timer),clearTimeout(this._responseTimeoutTimer),clearTimeout(this._uploadTimeoutTimer),delete this._timer,delete this._responseTimeoutTimer,delete this._uploadTimeoutTimer,this},s.prototype.parse=function(e){return this._parser=e,this},s.prototype.responseType=function(e){return this._responseType=e,this},s.prototype.serialize=function(e){return this._serializer=e,this},s.prototype.timeout=function(e){if(!e||"object"!=typeof e)return this._timeout=e,this._responseTimeout=0,this._uploadTimeout=0,this;for(const t in e)if(a(e,t))switch(t){case"deadline":this._timeout=e.deadline;break;case"response":this._responseTimeout=e.response;break;case"upload":this._uploadTimeout=e.upload;break;default:console.warn("Unknown timeout option",t)}return this},s.prototype.retry=function(e,t){return 0!==arguments.length&&!0!==e||(e=1),e<=0&&(e=0),this._maxRetries=e,this._retries=0,this._retryCallback=t,this};const c=new Set(["ETIMEDOUT","ECONNRESET","EADDRINUSE","ECONNREFUSED","EPIPE","ENOTFOUND","ENETUNREACH","EAI_AGAIN"]),l=new Set([408,413,429,500,502,503,504,521,522,524]);s.prototype._shouldRetry=function(e,t){if(!this._maxRetries||this._retries++>=this._maxRetries)return!1;if(this._retryCallback)try{const n=this._retryCallback(e,t);if(!0===n)return!0;if(!1===n)return!1}catch(e){console.error(e)}if(t&&t.status&&l.has(t.status))return!0;if(e){if(e.code&&c.has(e.code))return!0;if(e.timeout&&"ECONNABORTED"===e.code)return!0;if(e.crossDomain)return!0}return!1},s.prototype._retry=function(){return this.clearTimeout(),this.req&&(this.req=null,this.req=this.request()),this._aborted=!1,this.timedout=!1,this.timedoutError=null,this._end()},s.prototype.then=function(e,t){if(!this._fullfilledPromise){const e=this;this._endCalled&&console.warn("Warning: superagent request was sent twice, because both .end() and .then() were called. Never call .end() if you use promises"),this._fullfilledPromise=new Promise(((t,n)=>{e.on("abort",(()=>{if(this._maxRetries&&this._maxRetries>this._retries)return;if(this.timedout&&this.timedoutError)return void n(this.timedoutError);const e=new Error("Aborted");e.code="ABORTED",e.status=this.status,e.method=this.method,e.url=this.url,n(e)})),e.end(((e,r)=>{e?n(e):t(r)}))}))}return this._fullfilledPromise.then(e,t)},s.prototype.catch=function(e){return this.then(void 0,e)},s.prototype.use=function(e){return e(this),this},s.prototype.ok=function(e){if("function"!=typeof e)throw new Error("Callback required");return this._okCallback=e,this},s.prototype._isResponseOK=function(e){return!!e&&(this._okCallback?this._okCallback(e):e.status>=200&&e.status<300)},s.prototype.get=function(e){return this._header[e.toLowerCase()]},s.prototype.getHeader=s.prototype.get,s.prototype.set=function(e,t){if(i(e)){for(const t in e)a(e,t)&&this.set(t,e[t]);return this}return this._header[e.toLowerCase()]=t,this.header[e]=t,this},s.prototype.unset=function(e){return delete this._header[e.toLowerCase()],delete this.header[e],this},s.prototype.field=function(e,t,n){if(null==e)throw new Error(".field(name, val) name can not be empty");if(this._data)throw new Error(".field() can't be used if .send() is used. Please use only .send() or only .field() & .attach()");if(i(e)){for(const t in e)a(e,t)&&this.field(t,e[t]);return this}if(Array.isArray(t)){for(const n in t)a(t,n)&&this.field(e,t[n]);return this}if(null==t)throw new Error(".field(name, val) val can not be empty");return"boolean"==typeof t&&(t=String(t)),n?this._getFormData().append(e,t,n):this._getFormData().append(e,t),this},s.prototype.abort=function(){if(this._aborted)return this;if(this._aborted=!0,this.xhr&&this.xhr.abort(),this.req){if(r.gte(process.version,"v13.0.0")&&r.lt(process.version,"v14.0.0"))throw new Error("Superagent does not work in v13 properly with abort() due to Node.js core changes");r.gte(process.version,"v14.0.0")&&(this.req.destroyed=!0),this.req.abort()}return this.clearTimeout(),this.emit("abort"),this},s.prototype._auth=function(e,t,n,r){switch(n.type){case"basic":this.set("Authorization",`Basic ${r(`${e}:${t}`)}`);break;case"auto":this.username=e,this.password=t;break;case"bearer":this.set("Authorization",`Bearer ${e}`)}return this},s.prototype.withCredentials=function(e){return void 0===e&&(e=!0),this._withCredentials=e,this},s.prototype.redirects=function(e){return this._maxRedirects=e,this},s.prototype.maxResponseSize=function(e){if("number"!=typeof e)throw new TypeError("Invalid argument");return this._maxResponseSize=e,this},s.prototype.toJSON=function(){return{method:this.method,url:this.url,data:this._data,headers:this._header}},s.prototype.send=function(e){const t=i(e);let n=this._header["content-type"];if(this._formData)throw new Error(".send() can't be used if .attach() or .field() is used. Please use only .send() or only .field() & .attach()");if(t&&!this._data)Array.isArray(e)?this._data=[]:this._isHost(e)||(this._data={});else if(e&&this._data&&this._isHost(this._data))throw new Error("Can't merge these send calls");if(t&&i(this._data))for(const t in e)a(e,t)&&(this._data[t]=e[t]);else"string"==typeof e?(n||this.type("form"),n=this._header["content-type"],n&&(n=n.toLowerCase().trim()),this._data="application/x-www-form-urlencoded"===n?this._data?`${this._data}&${e}`:e:(this._data||"")+e):this._data=e;return!t||this._isHost(e)||n||this.type("json"),this},s.prototype.sortQuery=function(e){return this._sort=void 0===e||e,this},s.prototype._finalizeQueryString=function(){const e=this._query.join("&");if(e&&(this.url+=(this.url.includes("?")?"&":"?")+e),this._query.length=0,this._sort){const e=this.url.indexOf("?");if(e>=0){const t=this.url.slice(e+1).split("&");"function"==typeof this._sort?t.sort(this._sort):t.sort(),this.url=this.url.slice(0,e)+"?"+t.join("&")}}},s.prototype._appendQueryString=()=>{console.warn("Unsupported")},s.prototype._timeoutError=function(e,t,n){if(this._aborted)return;const r=new Error(`${e+t}ms exceeded`);r.timeout=t,r.code="ECONNABORTED",r.errno=n,this.timedout=!0,this.timedoutError=r,this.abort(),this.callback(r)},s.prototype._setTimeouts=function(){const e=this;this._timeout&&!this._timer&&(this._timer=setTimeout((()=>{e._timeoutError("Timeout of ",e._timeout,"ETIME")}),this._timeout)),this._responseTimeout&&!this._responseTimeoutTimer&&(this._responseTimeoutTimer=setTimeout((()=>{e._timeoutError("Response timeout of ",e._responseTimeout,"ETIMEDOUT")}),this._responseTimeout))}},253:(e,t,n)=>{"use strict";const r=n(244);function o(){}e.exports=o,o.prototype.get=function(e){return this.header[e.toLowerCase()]},o.prototype._setHeaderProperties=function(e){const t=e["content-type"]||"";this.type=r.type(t);const n=r.params(t);for(const e in n)Object.prototype.hasOwnProperty.call(n,e)&&(this[e]=n[e]);this.links={};try{e.link&&(this.links=r.parseLinks(e.link))}catch(e){}},o.prototype._setStatusProperties=function(e){const t=Math.trunc(e/100);this.statusCode=e,this.status=this.statusCode,this.statusType=t,this.info=1===t,this.ok=2===t,this.redirect=3===t,this.clientError=4===t,this.serverError=5===t,this.error=(4===t||5===t)&&this.toError(),this.created=201===e,this.accepted=202===e,this.noContent=204===e,this.badRequest=400===e,this.unauthorized=401===e,this.notAcceptable=406===e,this.forbidden=403===e,this.notFound=404===e,this.unprocessableEntity=422===e}},244:(e,t)=>{"use strict";function n(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=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}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var o=0,i=function(){};return{s:i,n:function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,s=!0,c=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){c=!0,a=e},f:function(){try{s||null==n.return||n.return()}finally{if(c)throw a}}}}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}t.type=e=>e.split(/ *; */).shift(),t.params=e=>{const t={};var r,o=n(e.split(/ *; */));try{for(o.s();!(r=o.n()).done;){const e=r.value.split(/ *= */),n=e.shift(),o=e.shift();n&&o&&(t[n]=o)}}catch(e){o.e(e)}finally{o.f()}return t},t.parseLinks=e=>{const t={};var r,o=n(e.split(/ *, */));try{for(o.s();!(r=o.n()).done;){const e=r.value.split(/ *; */),n=e[0].slice(1,-1);t[e[1].split(/ *= */)[1].slice(1,-1)]=n}}catch(e){o.e(e)}finally{o.f()}return t},t.cleanHeader=(e,t)=>(delete e["content-type"],delete e["content-length"],delete e["transfer-encoding"],delete e.host,t&&(delete e.authorization,delete e.cookie),e),t.isObject=e=>null!==e&&"object"==typeof e,t.hasOwn=Object.hasOwn||function(e,t){if(null==e)throw new TypeError("Cannot convert undefined or null to object");return Object.prototype.hasOwnProperty.call(new Object(e),t)},t.mixin=(e,n)=>{for(const r in n)t.hasOwn(n,r)&&(e[r]=n[r])}},905:e=>{e.exports=()=>()=>null},924:(e,t,n)=>{"use strict";var r=n(141),o=n(559),i=o(r("String.prototype.indexOf"));e.exports=function(e,t){var n=r(e,!!t);return"function"==typeof n&&i(e,".prototype.")>-1?o(n):n}},559:(e,t,n)=>{"use strict";var r=n(612),o=n(141),i=o("%Function.prototype.apply%"),a=o("%Function.prototype.call%"),s=o("%Reflect.apply%",!0)||r.call(a,i),c=o("%Object.getOwnPropertyDescriptor%",!0),l=o("%Object.defineProperty%",!0),u=o("%Math.max%");if(l)try{l({},"a",{value:1})}catch(e){l=null}e.exports=function(e){var t=s(r,a,arguments);if(c&&l){var n=c(t,"length");n.configurable&&l(t,"length",{value:1+u(0,e.length-(arguments.length-1))})}return t};var p=function(){return s(r,i,arguments)};l?l(e.exports,"apply",{value:p}):e.exports.apply=p},767:e=>{function t(e){if(e)return function(e){for(var n in t.prototype)e[n]=t.prototype[n];return e}(e)}e.exports=t,t.prototype.on=t.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this},t.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this},t.prototype.off=t.prototype.removeListener=t.prototype.removeAllListeners=t.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var n,r=this._callbacks["$"+e];if(!r)return this;if(1==arguments.length)return delete this._callbacks["$"+e],this;for(var o=0;o<r.length;o++)if((n=r[o])===t||n.fn===t){r.splice(o,1);break}return 0===r.length&&delete this._callbacks["$"+e],this},t.prototype.emit=function(e){this._callbacks=this._callbacks||{};for(var t=new Array(arguments.length-1),n=this._callbacks["$"+e],r=1;r<arguments.length;r++)t[r-1]=arguments[r];if(n){r=0;for(var o=(n=n.slice(0)).length;r<o;++r)n[r].apply(this,t)}return this},t.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]},t.prototype.hasListeners=function(e){return!!this.listeners(e).length}},445:e=>{e.exports=a,a.default=a,a.stable=u,a.stableStringify=u;var t="[...]",n="[Circular]",r=[],o=[];function i(){return{depthLimit:Number.MAX_SAFE_INTEGER,edgesLimit:Number.MAX_SAFE_INTEGER}}function a(e,t,n,a){var s;void 0===a&&(a=i()),c(e,"",0,[],void 0,0,a);try{s=0===o.length?JSON.stringify(e,t,n):JSON.stringify(e,d(t),n)}catch(e){return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;0!==r.length;){var l=r.pop();4===l.length?Object.defineProperty(l[0],l[1],l[3]):l[0][l[1]]=l[2]}}return s}function s(e,t,n,i){var a=Object.getOwnPropertyDescriptor(i,n);void 0!==a.get?a.configurable?(Object.defineProperty(i,n,{value:e}),r.push([i,n,t,a])):o.push([t,n,e]):(i[n]=e,r.push([i,n,t]))}function c(e,r,o,i,a,l,u){var p;if(l+=1,"object"==typeof e&&null!==e){for(p=0;p<i.length;p++)if(i[p]===e)return void s(n,e,r,a);if(void 0!==u.depthLimit&&l>u.depthLimit)return void s(t,e,r,a);if(void 0!==u.edgesLimit&&o+1>u.edgesLimit)return void s(t,e,r,a);if(i.push(e),Array.isArray(e))for(p=0;p<e.length;p++)c(e[p],p,p,i,e,l,u);else{var d=Object.keys(e);for(p=0;p<d.length;p++){var f=d[p];c(e[f],f,p,i,e,l,u)}}i.pop()}}function l(e,t){return e<t?-1:e>t?1:0}function u(e,t,n,a){void 0===a&&(a=i());var s,c=p(e,"",0,[],void 0,0,a)||e;try{s=0===o.length?JSON.stringify(c,t,n):JSON.stringify(c,d(t),n)}catch(e){return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;0!==r.length;){var l=r.pop();4===l.length?Object.defineProperty(l[0],l[1],l[3]):l[0][l[1]]=l[2]}}return s}function p(e,o,i,a,c,u,d){var f;if(u+=1,"object"==typeof e&&null!==e){for(f=0;f<a.length;f++)if(a[f]===e)return void s(n,e,o,c);try{if("function"==typeof e.toJSON)return}catch(e){return}if(void 0!==d.depthLimit&&u>d.depthLimit)return void s(t,e,o,c);if(void 0!==d.edgesLimit&&i+1>d.edgesLimit)return void s(t,e,o,c);if(a.push(e),Array.isArray(e))for(f=0;f<e.length;f++)p(e[f],f,f,a,e,u,d);else{var h={},y=Object.keys(e).sort(l);for(f=0;f<y.length;f++){var m=y[f];p(e[m],m,f,a,e,u,d),h[m]=e[m]}if(void 0===c)return h;r.push([c,o,e]),c[o]=h}a.pop()}}function d(e){return e=void 0!==e?e:function(e,t){return t},function(t,n){if(o.length>0)for(var r=0;r<o.length;r++){var i=o[r];if(i[1]===t&&i[0]===n){n=i[2],o.splice(r,1);break}}return e.call(this,t,n)}}},648:e=>{"use strict";var t="Function.prototype.bind called on incompatible ",n=Array.prototype.slice,r=Object.prototype.toString,o="[object Function]";e.exports=function(e){var i=this;if("function"!=typeof i||r.call(i)!==o)throw new TypeError(t+i);for(var a,s=n.call(arguments,1),c=function(){if(this instanceof a){var t=i.apply(this,s.concat(n.call(arguments)));return Object(t)===t?t:this}return i.apply(e,s.concat(n.call(arguments)))},l=Math.max(0,i.length-s.length),u=[],p=0;p<l;p++)u.push("$"+p);if(a=Function("binder","return function ("+u.join(",")+"){ return binder.apply(this,arguments); }")(c),i.prototype){var d=function(){};d.prototype=i.prototype,a.prototype=new d,d.prototype=null}return a}},612:(e,t,n)=>{"use strict";var r=n(648);e.exports=Function.prototype.bind||r},141:(e,t,n)=>{"use strict";var r,o=SyntaxError,i=Function,a=TypeError,s=function(e){try{return i('"use strict"; return ('+e+").constructor;")()}catch(e){}},c=Object.getOwnPropertyDescriptor;if(c)try{c({},"")}catch(e){c=null}var l=function(){throw new a},u=c?function(){try{return l}catch(e){try{return c(arguments,"callee").get}catch(e){return l}}}():l,p=n(405)(),d=Object.getPrototypeOf||function(e){return e.__proto__},f={},h="undefined"==typeof Uint8Array?r:d(Uint8Array),y={"%AggregateError%":"undefined"==typeof AggregateError?r:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?r:ArrayBuffer,"%ArrayIteratorPrototype%":p?d([][Symbol.iterator]()):r,"%AsyncFromSyncIteratorPrototype%":r,"%AsyncFunction%":f,"%AsyncGenerator%":f,"%AsyncGeneratorFunction%":f,"%AsyncIteratorPrototype%":f,"%Atomics%":"undefined"==typeof Atomics?r:Atomics,"%BigInt%":"undefined"==typeof BigInt?r:BigInt,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?r:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":"undefined"==typeof Float32Array?r:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?r:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?r:FinalizationRegistry,"%Function%":i,"%GeneratorFunction%":f,"%Int8Array%":"undefined"==typeof Int8Array?r:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?r:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?r:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":p?d(d([][Symbol.iterator]())):r,"%JSON%":"object"==typeof JSON?JSON:r,"%Map%":"undefined"==typeof Map?r:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&p?d((new Map)[Symbol.iterator]()):r,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?r:Promise,"%Proxy%":"undefined"==typeof Proxy?r:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":"undefined"==typeof Reflect?r:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?r:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&p?d((new Set)[Symbol.iterator]()):r,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?r:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":p?d(""[Symbol.iterator]()):r,"%Symbol%":p?Symbol:r,"%SyntaxError%":o,"%ThrowTypeError%":u,"%TypedArray%":h,"%TypeError%":a,"%Uint8Array%":"undefined"==typeof Uint8Array?r:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?r:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?r:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?r:Uint32Array,"%URIError%":URIError,"%WeakMap%":"undefined"==typeof WeakMap?r:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?r:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?r:WeakSet},m=function e(t){var n;if("%AsyncFunction%"===t)n=s("async function () {}");else if("%GeneratorFunction%"===t)n=s("function* () {}");else if("%AsyncGeneratorFunction%"===t)n=s("async function* () {}");else if("%AsyncGenerator%"===t){var r=e("%AsyncGeneratorFunction%");r&&(n=r.prototype)}else if("%AsyncIteratorPrototype%"===t){var o=e("%AsyncGenerator%");o&&(n=d(o.prototype))}return y[t]=n,n},b={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},v=n(612),g=n(642),w=v.call(Function.call,Array.prototype.concat),j=v.call(Function.apply,Array.prototype.splice),O=v.call(Function.call,String.prototype.replace),x=v.call(Function.call,String.prototype.slice),S=v.call(Function.call,RegExp.prototype.exec),_=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,E=/\\(\\)?/g,C=function(e){var t=x(e,0,1),n=x(e,-1);if("%"===t&&"%"!==n)throw new o("invalid intrinsic syntax, expected closing `%`");if("%"===n&&"%"!==t)throw new o("invalid intrinsic syntax, expected opening `%`");var r=[];return O(e,_,(function(e,t,n,o){r[r.length]=n?O(o,E,"$1"):t||e})),r},P=function(e,t){var n,r=e;if(g(b,r)&&(r="%"+(n=b[r])[0]+"%"),g(y,r)){var i=y[r];if(i===f&&(i=m(r)),void 0===i&&!t)throw new a("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:n,name:r,value:i}}throw new o("intrinsic "+e+" does not exist!")};e.exports=function(e,t){if("string"!=typeof e||0===e.length)throw new a("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof t)throw new a('"allowMissing" argument must be a boolean');if(null===S(/^%?[^%]*%?$/,e))throw new o("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=C(e),r=n.length>0?n[0]:"",i=P("%"+r+"%",t),s=i.name,l=i.value,u=!1,p=i.alias;p&&(r=p[0],j(n,w([0,1],p)));for(var d=1,f=!0;d<n.length;d+=1){var h=n[d],m=x(h,0,1),b=x(h,-1);if(('"'===m||"'"===m||"`"===m||'"'===b||"'"===b||"`"===b)&&m!==b)throw new o("property names with quotes must have matching quotes");if("constructor"!==h&&f||(u=!0),g(y,s="%"+(r+="."+h)+"%"))l=y[s];else if(null!=l){if(!(h in l)){if(!t)throw new a("base intrinsic for "+e+" exists, but the property is not available.");return}if(c&&d+1>=n.length){var v=c(l,h);l=(f=!!v)&&"get"in v&&!("originalValue"in v.get)?v.get:l[h]}else f=g(l,h),l=l[h];f&&!u&&(y[s]=l)}}return l}},405:(e,t,n)=>{"use strict";var r="undefined"!=typeof Symbol&&Symbol,o=n(419);e.exports=function(){return"function"==typeof r&&"function"==typeof Symbol&&"symbol"==typeof r("foo")&&"symbol"==typeof Symbol("bar")&&o()}},419:e=>{"use strict";e.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var e={},t=Symbol("test"),n=Object(t);if("string"==typeof t)return!1;if("[object Symbol]"!==Object.prototype.toString.call(t))return!1;if("[object Symbol]"!==Object.prototype.toString.call(n))return!1;for(t in e[t]=42,e)return!1;if("function"==typeof Object.keys&&0!==Object.keys(e).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(e).length)return!1;var r=Object.getOwnPropertySymbols(e);if(1!==r.length||r[0]!==t)return!1;if(!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var o=Object.getOwnPropertyDescriptor(e,t);if(42!==o.value||!0!==o.enumerable)return!1}return!0}},642:(e,t,n)=>{"use strict";var r=n(612);e.exports=r.call(Function.call,Object.prototype.hasOwnProperty)},679:(e,t,n)=>{"use strict";var r=n(864),o={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},i={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},a={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},s={};function c(e){return r.isMemo(e)?a:s[e.$$typeof]||o}s[r.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},s[r.Memo]=a;var l=Object.defineProperty,u=Object.getOwnPropertyNames,p=Object.getOwnPropertySymbols,d=Object.getOwnPropertyDescriptor,f=Object.getPrototypeOf,h=Object.prototype;e.exports=function e(t,n,r){if("string"!=typeof n){if(h){var o=f(n);o&&o!==h&&e(t,o,r)}var a=u(n);p&&(a=a.concat(p(n)));for(var s=c(t),y=c(n),m=0;m<a.length;++m){var b=a[m];if(!(i[b]||r&&r[b]||y&&y[b]||s&&s[b])){var v=d(n,b);try{l(t,b,v)}catch(e){}}}}return t}},554:e=>{e.exports=function(e){var t={},n=[];(e=e||this).on=function(n,r,o){return(t[n]=t[n]||[]).push([r,o]),e},e.off=function(r,o){r||(t={});for(var i=t[r]||n,a=i.length=o?i.length:0;a--;)o==i[a][0]&&i.splice(a,1);return e},e.emit=function(r){for(var o,i=t[r]||n,a=i.length>0?i.slice(0,i.length):i,s=0;o=a[s++];)o[0].apply(o[1],n.slice.call(arguments,1));return e}}},631:(e,t,n)=>{var r="function"==typeof Map&&Map.prototype,o=Object.getOwnPropertyDescriptor&&r?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,i=r&&o&&"function"==typeof o.get?o.get:null,a=r&&Map.prototype.forEach,s="function"==typeof Set&&Set.prototype,c=Object.getOwnPropertyDescriptor&&s?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,l=s&&c&&"function"==typeof c.get?c.get:null,u=s&&Set.prototype.forEach,p="function"==typeof WeakMap&&WeakMap.prototype?WeakMap.prototype.has:null,d="function"==typeof WeakSet&&WeakSet.prototype?WeakSet.prototype.has:null,f="function"==typeof WeakRef&&WeakRef.prototype?WeakRef.prototype.deref:null,h=Boolean.prototype.valueOf,y=Object.prototype.toString,m=Function.prototype.toString,b=String.prototype.match,v=String.prototype.slice,g=String.prototype.replace,w=String.prototype.toUpperCase,j=String.prototype.toLowerCase,O=RegExp.prototype.test,x=Array.prototype.concat,S=Array.prototype.join,_=Array.prototype.slice,E=Math.floor,C="function"==typeof BigInt?BigInt.prototype.valueOf:null,P=Object.getOwnPropertySymbols,T="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?Symbol.prototype.toString:null,k="function"==typeof Symbol&&"object"==typeof Symbol.iterator,A="function"==typeof Symbol&&Symbol.toStringTag&&(Symbol.toStringTag,1)?Symbol.toStringTag:null,N=Object.prototype.propertyIsEnumerable,I=("function"==typeof Reflect?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(e){return e.__proto__}:null);function R(e,t){if(e===1/0||e===-1/0||e!=e||e&&e>-1e3&&e<1e3||O.call(/e/,t))return t;var n=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if("number"==typeof e){var r=e<0?-E(-e):E(e);if(r!==e){var o=String(r),i=v.call(t,o.length+1);return g.call(o,n,"$&_")+"."+g.call(g.call(i,/([0-9]{3})/g,"$&_"),/_$/,"")}}return g.call(t,n,"$&_")}var D=n(654),M=D.custom,L=z(M)?M:null;function U(e,t,n){var r="double"===(n.quoteStyle||t)?'"':"'";return r+e+r}function F(e){return g.call(String(e),/"/g,"&quot;")}function B(e){return!("[object Array]"!==q(e)||A&&"object"==typeof e&&A in e)}function $(e){return!("[object RegExp]"!==q(e)||A&&"object"==typeof e&&A in e)}function z(e){if(k)return e&&"object"==typeof e&&e instanceof Symbol;if("symbol"==typeof e)return!0;if(!e||"object"!=typeof e||!T)return!1;try{return T.call(e),!0}catch(e){}return!1}e.exports=function e(t,n,r,o){var s=n||{};if(V(s,"quoteStyle")&&"single"!==s.quoteStyle&&"double"!==s.quoteStyle)throw new TypeError('option "quoteStyle" must be "single" or "double"');if(V(s,"maxStringLength")&&("number"==typeof s.maxStringLength?s.maxStringLength<0&&s.maxStringLength!==1/0:null!==s.maxStringLength))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var c=!V(s,"customInspect")||s.customInspect;if("boolean"!=typeof c&&"symbol"!==c)throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(V(s,"indent")&&null!==s.indent&&"\t"!==s.indent&&!(parseInt(s.indent,10)===s.indent&&s.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(V(s,"numericSeparator")&&"boolean"!=typeof s.numericSeparator)throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var y=s.numericSeparator;if(void 0===t)return"undefined";if(null===t)return"null";if("boolean"==typeof t)return t?"true":"false";if("string"==typeof t)return G(t,s);if("number"==typeof t){if(0===t)return 1/0/t>0?"0":"-0";var w=String(t);return y?R(t,w):w}if("bigint"==typeof t){var O=String(t)+"n";return y?R(t,O):O}var E=void 0===s.depth?5:s.depth;if(void 0===r&&(r=0),r>=E&&E>0&&"object"==typeof t)return B(t)?"[Array]":"[Object]";var P,M=function(e,t){var n;if("\t"===e.indent)n="\t";else{if(!("number"==typeof e.indent&&e.indent>0))return null;n=S.call(Array(e.indent+1)," ")}return{base:n,prev:S.call(Array(t+1),n)}}(s,r);if(void 0===o)o=[];else if(W(o,t)>=0)return"[Circular]";function H(t,n,i){if(n&&(o=_.call(o)).push(n),i){var a={depth:s.depth};return V(s,"quoteStyle")&&(a.quoteStyle=s.quoteStyle),e(t,a,r+1,o)}return e(t,s,r+1,o)}if("function"==typeof t&&!$(t)){var K=function(e){if(e.name)return e.name;var t=b.call(m.call(e),/^function\s*([\w$]+)/);return t?t[1]:null}(t),ee=Z(t,H);return"[Function"+(K?": "+K:" (anonymous)")+"]"+(ee.length>0?" { "+S.call(ee,", ")+" }":"")}if(z(t)){var te=k?g.call(String(t),/^(Symbol\(.*\))_[^)]*$/,"$1"):T.call(t);return"object"!=typeof t||k?te:J(te)}if((P=t)&&"object"==typeof P&&("undefined"!=typeof HTMLElement&&P instanceof HTMLElement||"string"==typeof P.nodeName&&"function"==typeof P.getAttribute)){for(var ne="<"+j.call(String(t.nodeName)),re=t.attributes||[],oe=0;oe<re.length;oe++)ne+=" "+re[oe].name+"="+U(F(re[oe].value),"double",s);return ne+=">",t.childNodes&&t.childNodes.length&&(ne+="..."),ne+"</"+j.call(String(t.nodeName))+">"}if(B(t)){if(0===t.length)return"[]";var ie=Z(t,H);return M&&!function(e){for(var t=0;t<e.length;t++)if(W(e[t],"\n")>=0)return!1;return!0}(ie)?"["+Y(ie,M)+"]":"[ "+S.call(ie,", ")+" ]"}if(function(e){return!("[object Error]"!==q(e)||A&&"object"==typeof e&&A in e)}(t)){var ae=Z(t,H);return"cause"in Error.prototype||!("cause"in t)||N.call(t,"cause")?0===ae.length?"["+String(t)+"]":"{ ["+String(t)+"] "+S.call(ae,", ")+" }":"{ ["+String(t)+"] "+S.call(x.call("[cause]: "+H(t.cause),ae),", ")+" }"}if("object"==typeof t&&c){if(L&&"function"==typeof t[L]&&D)return D(t,{depth:E-r});if("symbol"!==c&&"function"==typeof t.inspect)return t.inspect()}if(function(e){if(!i||!e||"object"!=typeof e)return!1;try{i.call(e);try{l.call(e)}catch(e){return!0}return e instanceof Map}catch(e){}return!1}(t)){var se=[];return a.call(t,(function(e,n){se.push(H(n,t,!0)+" => "+H(e,t))})),Q("Map",i.call(t),se,M)}if(function(e){if(!l||!e||"object"!=typeof e)return!1;try{l.call(e);try{i.call(e)}catch(e){return!0}return e instanceof Set}catch(e){}return!1}(t)){var ce=[];return u.call(t,(function(e){ce.push(H(e,t))})),Q("Set",l.call(t),ce,M)}if(function(e){if(!p||!e||"object"!=typeof e)return!1;try{p.call(e,p);try{d.call(e,d)}catch(e){return!0}return e instanceof WeakMap}catch(e){}return!1}(t))return X("WeakMap");if(function(e){if(!d||!e||"object"!=typeof e)return!1;try{d.call(e,d);try{p.call(e,p)}catch(e){return!0}return e instanceof WeakSet}catch(e){}return!1}(t))return X("WeakSet");if(function(e){if(!f||!e||"object"!=typeof e)return!1;try{return f.call(e),!0}catch(e){}return!1}(t))return X("WeakRef");if(function(e){return!("[object Number]"!==q(e)||A&&"object"==typeof e&&A in e)}(t))return J(H(Number(t)));if(function(e){if(!e||"object"!=typeof e||!C)return!1;try{return C.call(e),!0}catch(e){}return!1}(t))return J(H(C.call(t)));if(function(e){return!("[object Boolean]"!==q(e)||A&&"object"==typeof e&&A in e)}(t))return J(h.call(t));if(function(e){return!("[object String]"!==q(e)||A&&"object"==typeof e&&A in e)}(t))return J(H(String(t)));if(!function(e){return!("[object Date]"!==q(e)||A&&"object"==typeof e&&A in e)}(t)&&!$(t)){var le=Z(t,H),ue=I?I(t)===Object.prototype:t instanceof Object||t.constructor===Object,pe=t instanceof Object?"":"null prototype",de=!ue&&A&&Object(t)===t&&A in t?v.call(q(t),8,-1):pe?"Object":"",fe=(ue||"function"!=typeof t.constructor?"":t.constructor.name?t.constructor.name+" ":"")+(de||pe?"["+S.call(x.call([],de||[],pe||[]),": ")+"] ":"");return 0===le.length?fe+"{}":M?fe+"{"+Y(le,M)+"}":fe+"{ "+S.call(le,", ")+" }"}return String(t)};var H=Object.prototype.hasOwnProperty||function(e){return e in this};function V(e,t){return H.call(e,t)}function q(e){return y.call(e)}function W(e,t){if(e.indexOf)return e.indexOf(t);for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1}function G(e,t){if(e.length>t.maxStringLength){var n=e.length-t.maxStringLength,r="... "+n+" more character"+(n>1?"s":"");return G(v.call(e,0,t.maxStringLength),t)+r}return U(g.call(g.call(e,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,K),"single",t)}function K(e){var t=e.charCodeAt(0),n={8:"b",9:"t",10:"n",12:"f",13:"r"}[t];return n?"\\"+n:"\\x"+(t<16?"0":"")+w.call(t.toString(16))}function J(e){return"Object("+e+")"}function X(e){return e+" { ? }"}function Q(e,t,n,r){return e+" ("+t+") {"+(r?Y(n,r):S.call(n,", "))+"}"}function Y(e,t){if(0===e.length)return"";var n="\n"+t.prev+t.base;return n+S.call(e,","+n)+"\n"+t.prev}function Z(e,t){var n=B(e),r=[];if(n){r.length=e.length;for(var o=0;o<e.length;o++)r[o]=V(e,o)?t(e[o],e):""}var i,a="function"==typeof P?P(e):[];if(k){i={};for(var s=0;s<a.length;s++)i["$"+a[s]]=a[s]}for(var c in e)V(e,c)&&(n&&String(Number(c))===c&&c<e.length||k&&i["$"+c]instanceof Symbol||(O.call(/[^\w$]/,c)?r.push(t(c,e)+": "+t(e[c],e)):r.push(c+": "+t(e[c],e))));if("function"==typeof P)for(var l=0;l<a.length;l++)N.call(e,a[l])&&r.push("["+t(a[l])+"]: "+t(e[a[l]],e));return r}},661:(e,t,n)=>{"use strict";n.r(t),n.d(t,{Children:()=>y,Component:()=>r.Component,Fragment:()=>r.Fragment,PureComponent:()=>l,StrictMode:()=>Q,Suspense:()=>w,SuspenseList:()=>x,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:()=>z,cloneElement:()=>W,createContext:()=>r.createContext,createElement:()=>r.createElement,createFactory:()=>V,createPortal:()=>C,createRef:()=>r.createRef,default:()=>re,findDOMNode:()=>K,flushSync:()=>X,forwardRef:()=>f,hydrate:()=>I,isValidElement:()=>q,lazy:()=>O,memo:()=>u,render:()=>N,startTransition:()=>Y,unmountComponentAtNode:()=>G,unstable_batchedUpdates:()=>J,useDeferredValue:()=>Z,useInsertionEffect:()=>te,useSyncExternalStore:()=>ne,useTransition:()=>ee,version:()=>H});var r=n(210),o=n(207),i={};for(const e in o)["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","isValidElement","lazy","memo","render","startTransition","unmountComponentAtNode","unstable_batchedUpdates","useDeferredValue","useInsertionEffect","useSyncExternalStore","useTransition","version"].indexOf(e)<0&&(i[e]=()=>o[e]);function a(e,t){for(var n in t)e[n]=t[n];return e}function s(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,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t}function l(e){this.props=e}function u(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:s(this.props,e)}function o(t){return this.shouldComponentUpdate=n,(0,r.createElement)(e,t)}return o.displayName="Memo("+(e.displayName||e.name)+")",o.prototype.isReactComponent=!0,o.__f=!0,o}n.d(t,i),(l.prototype=new r.Component).isPureReactComponent=!0,l.prototype.shouldComponentUpdate=function(e,t){return s(this.props,e)||s(this.state,t)};var p=r.options.__b;r.options.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),p&&p(e)};var d="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.forward_ref")||3911;function f(e){function t(t){var n=a({},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))},y={map:h,forEach:h,count:function(e){return e?(0,r.toChildArray)(e).length:0},only:function(e){var t=(0,r.toChildArray)(e);if(1!==t.length)throw"Children.only";return t[0]},toArray:r.toChildArray},m=r.options.__e;r.options.__e=function(e,t,n,r){if(e.then)for(var o,i=t;i=i.__;)if((o=i.__c)&&o.__c)return null==t.__e&&(t.__e=n.__e,t.__k=n.__k),o.__c(e,t);m(e,t,n,r)};var b=r.options.unmount;function v(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=a({},e)).__c&&(e.__c.__P===n&&(e.__c.__P=t),e.__c=null),e.__k=e.__k&&e.__k.map((function(e){return v(e,t,n)}))),e}function g(e,t,n){return e&&(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.insertBefore(e.__e,e.__d),e.__c.__e=!0,e.__c.__P=n)),e}function w(){this.__u=0,this.t=null,this.__b=null}function j(e){var t=e.__.__c;return t&&t.__a&&t.__a(e)}function O(e){var t,n,o;function i(i){if(t||(t=e()).then((function(e){n=e.default||e}),(function(e){o=e})),o)throw o;if(!n)throw t;return(0,r.createElement)(n,i)}return i.displayName="Lazy",i.__f=!0,i}function x(){this.u=null,this.o=null}r.options.unmount=function(e){var t=e.__c;t&&t.__R&&t.__R(),t&&!0===e.__h&&(e.type=null),b&&b(e)},(w.prototype=new r.Component).__c=function(e,t){var n=t.__c,r=this;null==r.t&&(r.t=[]),r.t.push(n);var o=j(r.__v),i=!1,a=function(){i||(i=!0,n.__R=null,o?o(s):s())};n.__R=a;var s=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()}},c=!0===t.__h;r.__u++||c||r.setState({__a:r.__b=r.__v.__k[0]}),e.then(a,a)},w.prototype.componentWillUnmount=function(){this.t=[]},w.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var n=document.createElement("div"),o=this.__v.__k[0].__c;this.__v.__k[0]=v(this.__b,n,o.__O=o.__P)}this.__b=null}var i=t.__a&&(0,r.createElement)(r.Fragment,null,e.fallback);return i&&(i.__h=null),[(0,r.createElement)(r.Fragment,null,t.__a?null:e.children),i]};var S=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 _(e){return this.getChildContext=function(){return e.context},e.children}function E(e){var t=this,n=e.i;t.componentWillUnmount=function(){(0,r.render)(null,t.l),t.l=null,t.i=null},t.i&&t.i!==n&&t.componentWillUnmount(),e.__v?(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)(_,{context:t.context},e.__v),t.l)):t.l&&t.componentWillUnmount()}function C(e,t){var n=(0,r.createElement)(E,{__v:e,i:t});return n.containerInfo=t,n}(x.prototype=new r.Component).__a=function(e){var t=this,n=j(t.__v),r=t.o.get(e);return r[0]++,function(o){var i=function(){t.props.revealOrder?(r.push(o),S(t,e,r)):o()};n?n(i):i()}},x.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},x.prototype.componentDidUpdate=x.prototype.componentDidMount=function(){var e=this;this.o.forEach((function(t,n){S(e,n,t)}))};var P="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,T=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image|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]/,k="undefined"!=typeof document,A=function(e){return("undefined"!=typeof Symbol&&"symbol"==typeof Symbol()?/fil|che|rad/i:/fil|che|ra/i).test(e)};function N(e,t,n){return null==t.__k&&(t.textContent=""),(0,r.render)(e,t),"function"==typeof n&&n(),e?e.__c:null}function I(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 R=r.options.event;function D(){}function M(){return this.cancelBubble}function L(){return this.defaultPrevented}r.options.event=function(e){return R&&(e=R(e)),e.persist=D,e.isPropagationStopped=M,e.isDefaultPrevented=L,e.nativeEvent=e};var U,F={configurable:!0,get:function(){return this.class}},B=r.options.vnode;r.options.vnode=function(e){var t=e.type,n=e.props,o=n;if("string"==typeof t){var i=-1===t.indexOf("-");for(var a in o={},n){var s=n[a];k&&"children"===a&&"noscript"===t||"value"===a&&"defaultValue"in n&&null==s||("defaultValue"===a&&"value"in n&&null==n.value?a="value":"download"===a&&!0===s?s="":/ondoubleclick/i.test(a)?a="ondblclick":/^onchange(textarea|input)/i.test(a+t)&&!A(n.type)?a="oninput":/^onfocus$/i.test(a)?a="onfocusin":/^onblur$/i.test(a)?a="onfocusout":/^on(Ani|Tra|Tou|BeforeInp|Compo)/.test(a)?a=a.toLowerCase():i&&T.test(a)?a=a.replace(/[A-Z0-9]/g,"-$&").toLowerCase():null===s&&(s=void 0),/^oninput$/i.test(a)&&(a=a.toLowerCase(),o[a]&&(a="oninputCapture")),o[a]=s)}"select"==t&&o.multiple&&Array.isArray(o.value)&&(o.value=(0,r.toChildArray)(n.children).forEach((function(e){e.props.selected=-1!=o.value.indexOf(e.props.value)}))),"select"==t&&null!=o.defaultValue&&(o.value=(0,r.toChildArray)(n.children).forEach((function(e){e.props.selected=o.multiple?-1!=o.defaultValue.indexOf(e.props.value):o.defaultValue==e.props.value}))),e.props=o,n.class!=n.className&&(F.enumerable="className"in n,null!=n.className&&(o.class=n.className),Object.defineProperty(o,"className",F))}e.$$typeof=P,B&&B(e)};var $=r.options.__r;r.options.__r=function(e){$&&$(e),U=e.__c};var z={ReactCurrentDispatcher:{current:{readContext:function(e){return U.__n[e.__c].props.value}}}},H="17.0.2";function V(e){return r.createElement.bind(null,e)}function q(e){return!!e&&e.$$typeof===P}function W(e){return q(e)?r.cloneElement.apply(null,arguments):e}function G(e){return!!e.__k&&((0,r.render)(null,e),!0)}function K(e){return e&&(e.base||1===e.nodeType&&e)||null}var J=function(e,t){return e(t)},X=function(e,t){return e(t)},Q=r.Fragment;function Y(e){e()}function Z(e){return e}function ee(){return[!1,Y]}var te=o.useLayoutEffect;function ne(e,t){var n=t(),r=(0,o.useState)({h:{__:n,v:t}}),i=r[0].h,a=r[1];return(0,o.useLayoutEffect)((function(){i.__=n,i.v=t,c(i.__,t())||a({h:i})}),[e,n,t]),(0,o.useEffect)((function(){return c(i.__,i.v())||a({h:i}),e((function(){c(i.__,i.v())||a({h:i})}))}),[e]),n}var re={useState:o.useState,useId:o.useId,useReducer:o.useReducer,useEffect:o.useEffect,useLayoutEffect:o.useLayoutEffect,useInsertionEffect:te,useTransition:ee,useDeferredValue:Z,useSyncExternalStore:ne,startTransition:Y,useRef:o.useRef,useImperativeHandle:o.useImperativeHandle,useMemo:o.useMemo,useCallback:o.useCallback,useContext:o.useContext,useDebugValue:o.useDebugValue,version:"17.0.2",Children:y,render:N,hydrate:I,unmountComponentAtNode:G,createPortal:C,createElement:r.createElement,createContext:r.createContext,createFactory:V,cloneElement:W,createRef:r.createRef,Fragment:r.Fragment,isValidElement:q,findDOMNode:K,Component:r.Component,PureComponent:l,memo:u,forwardRef:f,flushSync:X,unstable_batchedUpdates:J,StrictMode:Q,Suspense:w,SuspenseList:x,lazy:O,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:z}},569:e=>{"use strict";var t=String.prototype.replace,n=/%20/g,r="RFC3986";e.exports={default:r,formatters:{RFC1738:function(e){return t.call(e,n,"+")},RFC3986:function(e){return String(e)}},RFC1738:"RFC1738",RFC3986:r}},129:(e,t,n)=>{"use strict";var r=n(261),o=n(235),i=n(569);e.exports={formats:i,parse:o,stringify:r}},235:(e,t,n)=>{"use strict";var r=n(769),o=Object.prototype.hasOwnProperty,i=Array.isArray,a={allowDots:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:r.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},s=function(e){return e.replace(/&#(\d+);/g,(function(e,t){return String.fromCharCode(parseInt(t,10))}))},c=function(e,t){return e&&"string"==typeof e&&t.comma&&e.indexOf(",")>-1?e.split(","):e},l=function(e,t,n,r){if(e){var i=n.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e,a=/(\[[^[\]]*])/g,s=n.depth>0&&/(\[[^[\]]*])/.exec(i),l=s?i.slice(0,s.index):i,u=[];if(l){if(!n.plainObjects&&o.call(Object.prototype,l)&&!n.allowPrototypes)return;u.push(l)}for(var p=0;n.depth>0&&null!==(s=a.exec(i))&&p<n.depth;){if(p+=1,!n.plainObjects&&o.call(Object.prototype,s[1].slice(1,-1))&&!n.allowPrototypes)return;u.push(s[1])}return s&&u.push("["+i.slice(s.index)+"]"),function(e,t,n,r){for(var o=r?t:c(t,n),i=e.length-1;i>=0;--i){var a,s=e[i];if("[]"===s&&n.parseArrays)a=[].concat(o);else{a=n.plainObjects?Object.create(null):{};var l="["===s.charAt(0)&&"]"===s.charAt(s.length-1)?s.slice(1,-1):s,u=parseInt(l,10);n.parseArrays||""!==l?!isNaN(u)&&s!==l&&String(u)===l&&u>=0&&n.parseArrays&&u<=n.arrayLimit?(a=[])[u]=o:"__proto__"!==l&&(a[l]=o):a={0:o}}o=a}return o}(u,t,n,r)}};e.exports=function(e,t){var n=function(e){if(!e)return a;if(null!==e.decoder&&void 0!==e.decoder&&"function"!=typeof e.decoder)throw new TypeError("Decoder has to be a function.");if(void 0!==e.charset&&"utf-8"!==e.charset&&"iso-8859-1"!==e.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var t=void 0===e.charset?a.charset:e.charset;return{allowDots:void 0===e.allowDots?a.allowDots:!!e.allowDots,allowPrototypes:"boolean"==typeof e.allowPrototypes?e.allowPrototypes:a.allowPrototypes,allowSparse:"boolean"==typeof e.allowSparse?e.allowSparse:a.allowSparse,arrayLimit:"number"==typeof e.arrayLimit?e.arrayLimit:a.arrayLimit,charset:t,charsetSentinel:"boolean"==typeof e.charsetSentinel?e.charsetSentinel:a.charsetSentinel,comma:"boolean"==typeof e.comma?e.comma:a.comma,decoder:"function"==typeof e.decoder?e.decoder:a.decoder,delimiter:"string"==typeof e.delimiter||r.isRegExp(e.delimiter)?e.delimiter:a.delimiter,depth:"number"==typeof e.depth||!1===e.depth?+e.depth:a.depth,ignoreQueryPrefix:!0===e.ignoreQueryPrefix,interpretNumericEntities:"boolean"==typeof e.interpretNumericEntities?e.interpretNumericEntities:a.interpretNumericEntities,parameterLimit:"number"==typeof e.parameterLimit?e.parameterLimit:a.parameterLimit,parseArrays:!1!==e.parseArrays,plainObjects:"boolean"==typeof e.plainObjects?e.plainObjects:a.plainObjects,strictNullHandling:"boolean"==typeof e.strictNullHandling?e.strictNullHandling:a.strictNullHandling}}(t);if(""===e||null==e)return n.plainObjects?Object.create(null):{};for(var u="string"==typeof e?function(e,t){var n,l={},u=t.ignoreQueryPrefix?e.replace(/^\?/,""):e,p=t.parameterLimit===1/0?void 0:t.parameterLimit,d=u.split(t.delimiter,p),f=-1,h=t.charset;if(t.charsetSentinel)for(n=0;n<d.length;++n)0===d[n].indexOf("utf8=")&&("utf8=%E2%9C%93"===d[n]?h="utf-8":"utf8=%26%2310003%3B"===d[n]&&(h="iso-8859-1"),f=n,n=d.length);for(n=0;n<d.length;++n)if(n!==f){var y,m,b=d[n],v=b.indexOf("]="),g=-1===v?b.indexOf("="):v+1;-1===g?(y=t.decoder(b,a.decoder,h,"key"),m=t.strictNullHandling?null:""):(y=t.decoder(b.slice(0,g),a.decoder,h,"key"),m=r.maybeMap(c(b.slice(g+1),t),(function(e){return t.decoder(e,a.decoder,h,"value")}))),m&&t.interpretNumericEntities&&"iso-8859-1"===h&&(m=s(m)),b.indexOf("[]=")>-1&&(m=i(m)?[m]:m),o.call(l,y)?l[y]=r.combine(l[y],m):l[y]=m}return l}(e,n):e,p=n.plainObjects?Object.create(null):{},d=Object.keys(u),f=0;f<d.length;++f){var h=d[f],y=l(h,u[h],n,"string"==typeof e);p=r.merge(p,y,n)}return!0===n.allowSparse?p:r.compact(p)}},261:(e,t,n)=>{"use strict";var r=n(478),o=n(769),i=n(569),a=Object.prototype.hasOwnProperty,s={brackets:function(e){return e+"[]"},comma:"comma",indices:function(e,t){return e+"["+t+"]"},repeat:function(e){return e}},c=Array.isArray,l=String.prototype.split,u=Array.prototype.push,p=function(e,t){u.apply(e,c(t)?t:[t])},d=Date.prototype.toISOString,f=i.default,h={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:o.encode,encodeValuesOnly:!1,format:f,formatter:i.formatters[f],indices:!1,serializeDate:function(e){return d.call(e)},skipNulls:!1,strictNullHandling:!1},y={},m=function e(t,n,i,a,s,u,d,f,m,b,v,g,w,j,O,x){for(var S,_=t,E=x,C=0,P=!1;void 0!==(E=E.get(y))&&!P;){var T=E.get(t);if(C+=1,void 0!==T){if(T===C)throw new RangeError("Cyclic object value");P=!0}void 0===E.get(y)&&(C=0)}if("function"==typeof f?_=f(n,_):_ instanceof Date?_=v(_):"comma"===i&&c(_)&&(_=o.maybeMap(_,(function(e){return e instanceof Date?v(e):e}))),null===_){if(s)return d&&!j?d(n,h.encoder,O,"key",g):n;_=""}if("string"==typeof(S=_)||"number"==typeof S||"boolean"==typeof S||"symbol"==typeof S||"bigint"==typeof S||o.isBuffer(_)){if(d){var k=j?n:d(n,h.encoder,O,"key",g);if("comma"===i&&j){for(var A=l.call(String(_),","),N="",I=0;I<A.length;++I)N+=(0===I?"":",")+w(d(A[I],h.encoder,O,"value",g));return[w(k)+(a&&c(_)&&1===A.length?"[]":"")+"="+N]}return[w(k)+"="+w(d(_,h.encoder,O,"value",g))]}return[w(n)+"="+w(String(_))]}var R,D=[];if(void 0===_)return D;if("comma"===i&&c(_))R=[{value:_.length>0?_.join(",")||null:void 0}];else if(c(f))R=f;else{var M=Object.keys(_);R=m?M.sort(m):M}for(var L=a&&c(_)&&1===_.length?n+"[]":n,U=0;U<R.length;++U){var F=R[U],B="object"==typeof F&&void 0!==F.value?F.value:_[F];if(!u||null!==B){var $=c(_)?"function"==typeof i?i(L,F):L:L+(b?"."+F:"["+F+"]");x.set(t,C);var z=r();z.set(y,x),p(D,e(B,$,i,a,s,u,d,f,m,b,v,g,w,j,O,z))}}return D};e.exports=function(e,t){var n,o=e,l=function(e){if(!e)return h;if(null!==e.encoder&&void 0!==e.encoder&&"function"!=typeof e.encoder)throw new TypeError("Encoder has to be a function.");var t=e.charset||h.charset;if(void 0!==e.charset&&"utf-8"!==e.charset&&"iso-8859-1"!==e.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var n=i.default;if(void 0!==e.format){if(!a.call(i.formatters,e.format))throw new TypeError("Unknown format option provided.");n=e.format}var r=i.formatters[n],o=h.filter;return("function"==typeof e.filter||c(e.filter))&&(o=e.filter),{addQueryPrefix:"boolean"==typeof e.addQueryPrefix?e.addQueryPrefix:h.addQueryPrefix,allowDots:void 0===e.allowDots?h.allowDots:!!e.allowDots,charset:t,charsetSentinel:"boolean"==typeof e.charsetSentinel?e.charsetSentinel:h.charsetSentinel,delimiter:void 0===e.delimiter?h.delimiter:e.delimiter,encode:"boolean"==typeof e.encode?e.encode:h.encode,encoder:"function"==typeof e.encoder?e.encoder:h.encoder,encodeValuesOnly:"boolean"==typeof e.encodeValuesOnly?e.encodeValuesOnly:h.encodeValuesOnly,filter:o,format:n,formatter:r,serializeDate:"function"==typeof e.serializeDate?e.serializeDate:h.serializeDate,skipNulls:"boolean"==typeof e.skipNulls?e.skipNulls:h.skipNulls,sort:"function"==typeof e.sort?e.sort:null,strictNullHandling:"boolean"==typeof e.strictNullHandling?e.strictNullHandling:h.strictNullHandling}}(t);"function"==typeof l.filter?o=(0,l.filter)("",o):c(l.filter)&&(n=l.filter);var u,d=[];if("object"!=typeof o||null===o)return"";u=t&&t.arrayFormat in s?t.arrayFormat:t&&"indices"in t?t.indices?"indices":"repeat":"indices";var f=s[u];if(t&&"commaRoundTrip"in t&&"boolean"!=typeof t.commaRoundTrip)throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var y="comma"===f&&t&&t.commaRoundTrip;n||(n=Object.keys(o)),l.sort&&n.sort(l.sort);for(var b=r(),v=0;v<n.length;++v){var g=n[v];l.skipNulls&&null===o[g]||p(d,m(o[g],g,f,y,l.strictNullHandling,l.skipNulls,l.encode?l.encoder:null,l.filter,l.sort,l.allowDots,l.serializeDate,l.format,l.formatter,l.encodeValuesOnly,l.charset,b))}var w=d.join(l.delimiter),j=!0===l.addQueryPrefix?"?":"";return l.charsetSentinel&&("iso-8859-1"===l.charset?j+="utf8=%26%2310003%3B&":j+="utf8=%E2%9C%93&"),w.length>0?j+w:""}},769:(e,t,n)=>{"use strict";var r=n(569),o=Object.prototype.hasOwnProperty,i=Array.isArray,a=function(){for(var e=[],t=0;t<256;++t)e.push("%"+((t<16?"0":"")+t.toString(16)).toUpperCase());return e}(),s=function(e,t){for(var n=t&&t.plainObjects?Object.create(null):{},r=0;r<e.length;++r)void 0!==e[r]&&(n[r]=e[r]);return n};e.exports={arrayToObject:s,assign:function(e,t){return Object.keys(t).reduce((function(e,n){return e[n]=t[n],e}),e)},combine:function(e,t){return[].concat(e,t)},compact:function(e){for(var t=[{obj:{o:e},prop:"o"}],n=[],r=0;r<t.length;++r)for(var o=t[r],a=o.obj[o.prop],s=Object.keys(a),c=0;c<s.length;++c){var l=s[c],u=a[l];"object"==typeof u&&null!==u&&-1===n.indexOf(u)&&(t.push({obj:a,prop:l}),n.push(u))}return function(e){for(;e.length>1;){var t=e.pop(),n=t.obj[t.prop];if(i(n)){for(var r=[],o=0;o<n.length;++o)void 0!==n[o]&&r.push(n[o]);t.obj[t.prop]=r}}}(t),e},decode:function(e,t,n){var r=e.replace(/\+/g," ");if("iso-8859-1"===n)return r.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(r)}catch(e){return r}},encode:function(e,t,n,o,i){if(0===e.length)return e;var s=e;if("symbol"==typeof e?s=Symbol.prototype.toString.call(e):"string"!=typeof e&&(s=String(e)),"iso-8859-1"===n)return escape(s).replace(/%u[0-9a-f]{4}/gi,(function(e){return"%26%23"+parseInt(e.slice(2),16)+"%3B"}));for(var c="",l=0;l<s.length;++l){var u=s.charCodeAt(l);45===u||46===u||95===u||126===u||u>=48&&u<=57||u>=65&&u<=90||u>=97&&u<=122||i===r.RFC1738&&(40===u||41===u)?c+=s.charAt(l):u<128?c+=a[u]:u<2048?c+=a[192|u>>6]+a[128|63&u]:u<55296||u>=57344?c+=a[224|u>>12]+a[128|u>>6&63]+a[128|63&u]:(l+=1,u=65536+((1023&u)<<10|1023&s.charCodeAt(l)),c+=a[240|u>>18]+a[128|u>>12&63]+a[128|u>>6&63]+a[128|63&u])}return c},isBuffer:function(e){return!(!e||"object"!=typeof e||!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e)))},isRegExp:function(e){return"[object RegExp]"===Object.prototype.toString.call(e)},maybeMap:function(e,t){if(i(e)){for(var n=[],r=0;r<e.length;r+=1)n.push(t(e[r]));return n}return t(e)},merge:function e(t,n,r){if(!n)return t;if("object"!=typeof n){if(i(t))t.push(n);else{if(!t||"object"!=typeof t)return[t,n];(r&&(r.plainObjects||r.allowPrototypes)||!o.call(Object.prototype,n))&&(t[n]=!0)}return t}if(!t||"object"!=typeof t)return[t].concat(n);var a=t;return i(t)&&!i(n)&&(a=s(t,r)),i(t)&&i(n)?(n.forEach((function(n,i){if(o.call(t,i)){var a=t[i];a&&"object"==typeof a&&n&&"object"==typeof n?t[i]=e(a,n,r):t.push(n)}else t[i]=n})),t):Object.keys(n).reduce((function(t,i){var a=n[i];return o.call(t,i)?t[i]=e(t[i],a,r):t[i]=a,t}),a)}}},921:(e,t)=>{"use strict";var n="function"==typeof Symbol&&Symbol.for,r=n?Symbol.for("react.element"):60103,o=n?Symbol.for("react.portal"):60106,i=n?Symbol.for("react.fragment"):60107,a=n?Symbol.for("react.strict_mode"):60108,s=n?Symbol.for("react.profiler"):60114,c=n?Symbol.for("react.provider"):60109,l=n?Symbol.for("react.context"):60110,u=n?Symbol.for("react.async_mode"):60111,p=n?Symbol.for("react.concurrent_mode"):60111,d=n?Symbol.for("react.forward_ref"):60112,f=n?Symbol.for("react.suspense"):60113,h=n?Symbol.for("react.suspense_list"):60120,y=n?Symbol.for("react.memo"):60115,m=n?Symbol.for("react.lazy"):60116,b=n?Symbol.for("react.block"):60121,v=n?Symbol.for("react.fundamental"):60117,g=n?Symbol.for("react.responder"):60118,w=n?Symbol.for("react.scope"):60119;function j(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case r:switch(e=e.type){case u:case p:case i:case s:case a:case f:return e;default:switch(e=e&&e.$$typeof){case l:case d:case m:case y:case c:return e;default:return t}}case o:return t}}}function O(e){return j(e)===p}t.AsyncMode=u,t.ConcurrentMode=p,t.ContextConsumer=l,t.ContextProvider=c,t.Element=r,t.ForwardRef=d,t.Fragment=i,t.Lazy=m,t.Memo=y,t.Portal=o,t.Profiler=s,t.StrictMode=a,t.Suspense=f,t.isAsyncMode=function(e){return O(e)||j(e)===u},t.isConcurrentMode=O,t.isContextConsumer=function(e){return j(e)===l},t.isContextProvider=function(e){return j(e)===c},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===r},t.isForwardRef=function(e){return j(e)===d},t.isFragment=function(e){return j(e)===i},t.isLazy=function(e){return j(e)===m},t.isMemo=function(e){return j(e)===y},t.isPortal=function(e){return j(e)===o},t.isProfiler=function(e){return j(e)===s},t.isStrictMode=function(e){return j(e)===a},t.isSuspense=function(e){return j(e)===f},t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===i||e===p||e===s||e===a||e===f||e===h||"object"==typeof e&&null!==e&&(e.$$typeof===m||e.$$typeof===y||e.$$typeof===c||e.$$typeof===l||e.$$typeof===d||e.$$typeof===v||e.$$typeof===g||e.$$typeof===w||e.$$typeof===b)},t.typeOf=j},864:(e,t,n)=>{"use strict";e.exports=n(921)},359:(e,t)=>{"use strict";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.module.reference")},973:(e,t,n)=>{"use strict";n(359)},478:(e,t,n)=>{"use strict";var r=n(141),o=n(924),i=n(631),a=r("%TypeError%"),s=r("%WeakMap%",!0),c=r("%Map%",!0),l=o("WeakMap.prototype.get",!0),u=o("WeakMap.prototype.set",!0),p=o("WeakMap.prototype.has",!0),d=o("Map.prototype.get",!0),f=o("Map.prototype.set",!0),h=o("Map.prototype.has",!0),y=function(e,t){for(var n,r=e;null!==(n=r.next);r=n)if(n.key===t)return r.next=n.next,n.next=e.next,e.next=n,n};e.exports=function(){var e,t,n,r={assert:function(e){if(!r.has(e))throw new a("Side channel does not contain "+i(e))},get:function(r){if(s&&r&&("object"==typeof r||"function"==typeof r)){if(e)return l(e,r)}else if(c){if(t)return d(t,r)}else if(n)return function(e,t){var n=y(e,t);return n&&n.value}(n,r)},has:function(r){if(s&&r&&("object"==typeof r||"function"==typeof r)){if(e)return p(e,r)}else if(c){if(t)return h(t,r)}else if(n)return function(e,t){return!!y(e,t)}(n,r);return!1},set:function(r,o){s&&r&&("object"==typeof r||"function"==typeof r)?(e||(e=new s),u(e,r,o)):c?(t||(t=new c),f(t,r,o)):(n||(n={key:{},next:null}),function(e,t,n){var r=y(e,t);r?r.value=n:e.next={key:t,next:e.next,value:n}}(n,r,o))}};return r}},250:(e,t,n)=>{"use strict";var r=n(661),o="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},i=r.useState,a=r.useEffect,s=r.useLayoutEffect,c=r.useDebugValue;function l(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!o(e,n)}catch(e){return!0}}var u="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(e,t){var n=t(),r=i({inst:{value:n,getSnapshot:t}}),o=r[0].inst,u=r[1];return s((function(){o.value=n,o.getSnapshot=t,l(o)&&u({inst:o})}),[e,n,t]),a((function(){return l(o)&&u({inst:o}),e((function(){l(o)&&u({inst:o})}))}),[e]),c(n),n};t.useSyncExternalStore=void 0!==r.useSyncExternalStore?r.useSyncExternalStore:u},139:(e,t,n)=>{"use strict";var r=n(661),o=n(688),i="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},a=o.useSyncExternalStore,s=r.useRef,c=r.useEffect,l=r.useMemo,u=r.useDebugValue;t.useSyncExternalStoreWithSelector=function(e,t,n,r,o){var p=s(null);if(null===p.current){var d={hasValue:!1,value:null};p.current=d}else d=p.current;p=l((function(){function e(e){if(!c){if(c=!0,a=e,e=r(e),void 0!==o&&d.hasValue){var t=d.value;if(o(t,e))return s=t}return s=e}if(t=s,i(a,e))return t;var n=r(e);return void 0!==o&&o(t,n)?t:(a=e,s=n)}var a,s,c=!1,l=void 0===n?null:n;return[function(){return e(t())},null===l?void 0:function(){return e(l())}]}),[t,n,r,o]);var f=a(e,p[0],p[1]);return c((function(){d.hasValue=!0,d.value=f}),[f]),u(f),f}},688:(e,t,n)=>{"use strict";e.exports=n(250)},798:(e,t,n)=>{"use strict";e.exports=n(139)},210:e=>{"use strict";e.exports=require("preact")},207:e=>{"use strict";e.exports=require("preact/hooks")},654:()=>{},695:()=>{}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var i=t[r]={exports:{}};return e[r](i,i.exports,n),i.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};(()=>{"use strict";n.r(r),n.d(r,{Engine:()=>wp,ExternalApi:()=>Ep,calculateVisibility:()=>_,className:()=>T,eventTypes:()=>e,getSearchParamsByKeys:()=>Cp,initResetSearchParams:()=>Tp,randomId:()=>J,replaceSearchParams:()=>Pp});const e={info:"info",message:"message",participant:"participant",system:"system"},t="text",o="text",i="upload",a="received",s="read",c="custom",l="typing",u="read",p="detach_service",d="dismiss",f="set_topic",h="set_translation",y="click_cta",m="translation_proposal",b=m,v="assertive",g="polite",w={new_topic:"newTopic",new_translation:"newTranslation"},j="uploads",O="navigate",x="visibility",S={hidden:"hidden",minimized:"minimized",open:"open",initialize:null},_=({hasResponded:e,previousVisibility:t,requestedVisibility:n,config:r})=>{const{defaults:o,layoutMode:i,hideOnNoUserResponse:a}=r,{visible:s}=o||{};return"app"!==i||t?"window"===i&&a&&n!==S.open?e?n||t||S.open:S.hidden:"inline"===i&&e&&!n?t||S.open:n||t||s||S.minimized:S.open},E="cvco",C="2",P="seamly-client-participant",T=(...e)=>e.flat().map((e=>"object"==typeof e?Object.entries(e).map((([e,t])=>t?e:"")).join(" "):e)).filter((e=>"string"==typeof e)).map((e=>e.split(" "))).flat().filter((e=>e.length)).map((e=>e.indexOf(E)>-1?e:[E,e].join("-"))).join(" "),k=require("preact/jsx-runtime");var A=n(766),N=n.n(A);class I 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)}}class R extends I{constructor(e,...t){super(e,...t),this.name="SeamlyConfigurationError",this.langKey="errors.configError"}}class D extends I{constructor(e,...t){super(e,...t),this.name="SeamlyGeneralError",this.langKey="errors.general",this.action="reset"}}class M extends I{constructor(e,...t){super(e,...t),this.name="SeamlySessionExpiredError",this.action="reset"}}class L extends I{constructor(e,...t){super(e,...t),this.name="SeamlyUnauthorizedError",this.langKey="errors.general",this.action="reset"}}const U=(e,t)=>{let n;return function(...r){let o=!1;return clearTimeout(n),n=setTimeout((()=>{n=null,o||e.apply(this,r),o=!1}),t),t=>{o=!0,t&&e.apply(this,r)}}},F=e=>Math.ceil(e/1e3),B=e=>{const t=Math.floor(e/60);return{minutes:t,seconds:e-60*t}},$=(e,t=2)=>{if(0===e)return"0 Bytes";const n=t<0?0:t,r=Math.floor(Math.log(e)/Math.log(1024));return`${parseFloat((e/1024**r).toFixed(n))} ${["Bytes","KB","MB","GB","TB","PB","EB","ZB","YB"][r]}`},z={27:"Escape",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown"},H={Escape:"Escape",End:"End",Home:"Home",ArrowLeft:"ArrowLeft",ArrowUp:"ArrowUp",ArrowRight:"ArrowRight",ArrowDown:"ArrowDown"},V=e=>e.code?H[e.code]:z[e.keyCode],q=e=>{e&&e.focus()},W=(e,t)=>{e&&(e.contains(document.activeElement)||e===document.activeElement)&&t()};var G=n(905),K=n.n(G);function J(){return`_${(Number(String(Math.random()).slice(2))+Date.now()+Math.round(performance.now())).toString(36)}`}function X(e){const t=`cvco.${e}`;return{get(){const e=[t,t.split(".").slice(0,-1).join(".")];let n;do{n=sessionStorage.getItem(e[0])}while(e.shift()&&!n);return JSON.parse(n)},set(e){e&&sessionStorage.setItem(t,JSON.stringify(e))}}}var Q=e=>"function"==typeof e?e:function(){return e},Y="undefined"!=typeof self?self:null,Z="undefined"!=typeof window?window:null,ee=Y||Z||ee,te="closed",ne="errored",re="joined",oe="joining",ie="leaving",ae="phx_close",se="phx_error",ce="phx_reply",le="phx_leave",ue="websocket",pe=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})}},de=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))}},fe=class{static request(e,t,n,r,o,i,a){if(ee.XDomainRequest){let n=new ee.XDomainRequest;return this.xdomainRequest(n,e,t,r,o,i,a)}{let s=new ee.XMLHttpRequest;return this.xhrRequest(s,e,t,n,r,o,i,a)}}static xdomainRequest(e,t,n,r,o,i,a){return e.timeout=o,e.open(t,n),e.onload=()=>{let t=this.parseJSON(e.responseText);a&&a(t)},i&&(e.ontimeout=i),e.onprogress=()=>{},e.send(r),e}static xhrRequest(e,t,n,r,o,i,a,s){return e.open(t,n,!0),e.timeout=i,e.setRequestHeader("Content-Type",r),e.onerror=()=>s&&s(null),e.onreadystatechange=()=>{if(4===e.readyState&&s){let t=this.parseJSON(e.responseText);s(t)}},a&&(e.ontimeout=a),e.send(o),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 o=t?`${t}[${r}]`:r,i=e[r];"object"==typeof i?n.push(this.serialize(i,o)):n.push(encodeURIComponent(o)+"="+encodeURIComponent(i))}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)}`}},he=class{constructor(e){this.endPoint=null,this.token=null,this.skipHeartbeat=!0,this.reqs=new Set,this.onopen=function(){},this.onerror=function(){},this.onmessage=function(){},this.onclose=function(){},this.pollEndpoint=this.normalizeEndpoint(e),this.readyState=0,this.poll()}normalizeEndpoint(e){return e.replace("ws://","http://").replace("wss://","https://").replace(new RegExp("(.*)/"+ue),"$1/longpoll")}endpointURL(){return fe.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",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){this.ajax("POST",e,(()=>this.onerror("timeout")),(e=>{e&&200===e.status||(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});"undefined"!=typeof CloseEvent?this.onclose(new CloseEvent("close",r)):this.onclose(r)}ajax(e,t,n,r){let o;o=fe.request(e,this.endpointURL(),"application/json",t,this.timeout,(()=>{this.reqs.delete(o),n()}),(e=>{this.reqs.delete(o),this.isActive()&&r(e)})),this.reqs.add(o)}},ye={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,o,i,a]=JSON.parse(e);return t({join_ref:n,ref:r,topic:o,event:i,payload:a})}},binaryEncode(e){let{join_ref:t,ref:n,event:r,topic:o,payload:i}=e,a=this.META_LENGTH+t.length+n.length+o.length+r.length,s=new ArrayBuffer(this.HEADER_LENGTH+a),c=new DataView(s),l=0;c.setUint8(l++,this.KINDS.push),c.setUint8(l++,t.length),c.setUint8(l++,n.length),c.setUint8(l++,o.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(o,(e=>c.setUint8(l++,e.charCodeAt(0)))),Array.from(r,(e=>c.setUint8(l++,e.charCodeAt(0))));var u=new Uint8Array(s.byteLength+i.byteLength);return u.set(new Uint8Array(s),0),u.set(new Uint8Array(i),s.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),o=t.getUint8(2),i=t.getUint8(3),a=this.HEADER_LENGTH+this.META_LENGTH-1,s=n.decode(e.slice(a,a+r));a+=r;let c=n.decode(e.slice(a,a+o));a+=o;let l=n.decode(e.slice(a,a+i));return a+=i,{join_ref:s,ref:null,topic:c,event:l,payload:e.slice(a,e.byteLength)}},decodeReply(e,t,n){let r=t.getUint8(1),o=t.getUint8(2),i=t.getUint8(3),a=t.getUint8(4),s=this.HEADER_LENGTH+this.META_LENGTH,c=n.decode(e.slice(s,s+r));s+=r;let l=n.decode(e.slice(s,s+o));s+=o;let u=n.decode(e.slice(s,s+i));s+=i;let p=n.decode(e.slice(s,s+a));s+=a;let d=e.slice(s,e.byteLength);return{join_ref:c,ref:l,topic:u,event:ce,payload:{status:p,response:d}}},decodeBroadcast(e,t,n){let r=t.getUint8(1),o=t.getUint8(2),i=this.HEADER_LENGTH+2,a=n.decode(e.slice(i,i+r));i+=r;let s=n.decode(e.slice(i,i+o));return i+=o,{join_ref:null,ref:null,topic:a,event:s,payload:e.slice(i,e.byteLength)}}};function me(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 be(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?me(Object(n),!0).forEach((function(t){ve(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):me(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function ve(e,t,n){return t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var ge,we,je,Oe,xe=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)},Se=function(e,t,n,r,o){if("m"===r)throw new TypeError("Private method is not writable");if("a"===r&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?o.call(e,n):o?o.value=n:t.set(e,n),n};const _e=K()("seamly");class Ee{constructor(){ge.add(this),we.set(this,[])}connect(e,t,n,r){return function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))}(this,void 0,void 0,(function*(){this.url=e,this.accessToken=r,this.channelName=t,this.channelTopic=n;const{url:o,params:i}=(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 be(be({},e),{},{[n]:decodeURIComponent(r)})}),{})}})(this.url);this.socket=new 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||ee.WebSocket||he,this.establishedConnections=0,this.defaultEncoder=ye.encode.bind(ye),this.defaultDecoder=ye.decode.bind(ye),this.closeWasClean=!1,this.binaryType=t.binaryType||"arraybuffer",this.connectClock=1,this.transport!==he?(this.encode=t.encode||this.defaultEncoder,this.decode=t.decode||this.defaultDecoder):(this.encode=this.defaultEncoder,this.decode=this.defaultDecoder);let n=null;Z&&Z.addEventListener&&(Z.addEventListener("pagehide",(e=>{this.conn&&(this.disconnect(),n=this.connectClock)})),Z.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.longpollerTimeout=t.longpollerTimeout||2e4,this.params=Q(t.params||{}),this.endPoint=`${e}/${ue}`,this.vsn=t.vsn||"2.0.0",this.heartbeatTimeoutTimer=null,this.heartbeatTimer=null,this.pendingHeartbeatRef=null,this.reconnectTimer=new de((()=>{this.teardown((()=>this.connect()))}),this.reconnectAfterMs)}getLongPollTransport(){return he}replaceTransport(e){this.connectClock++,this.closeWasClean=!0,this.reconnectTimer.reset(),this.sendBuffer=[],this.conn&&(this.conn.close(),this.conn=null),this.transport=e}protocol(){return location.protocol.match(/^https/)?"wss":"ws"}endPointURL(){let e=fe.appendParams(fe.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,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=Q(e)),this.conn||(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))}log(e,t,n){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((o=>{o.ref===t&&(this.off([r]),e(Date.now()-n))}));return!0}clearHeartbeats(){clearTimeout(this.heartbeatTimer),clearTimeout(this.heartbeatTimeoutTimer)}onConnOpen(){this.hasLogger()&&this.log("transport",`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(se)}))}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 class{constructor(e,t,n){this.state=te,this.topic=e,this.params=Q(t||{}),this.socket=n,this.bindings=[],this.bindingRef=0,this.timeout=this.socket.timeout,this.joinedOnce=!1,this.joinPush=new pe(this,"phx_join",this.params,this.timeout),this.pushBuffer=[],this.stateChangeRefs=[],this.rejoinTimer=new de((()=>{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=re,this.rejoinTimer.reset(),this.pushBuffer.forEach((e=>e.send())),this.pushBuffer=[]})),this.joinPush.receive("error",(()=>{this.state=ne,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=te,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=ne,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 pe(this,le,Q({}),this.timeout).send(),this.state=ne,this.joinPush.reset(),this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()})),this.on(ce,((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(ae,e)}onError(e){return this.on(se,(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 pe(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=ie;let t=()=>{this.socket.hasLogger()&&this.socket.log("channel",`leave ${this.topic}`),this.trigger(ae,"leave")},n=new pe(this,le,Q({}),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=oe,this.joinPush.resend(e))}trigger(e,t,n,r){let o=this.onMessage(e,t,n,r);if(t&&!o)throw new Error("channel onMessage callbacks must return the payload, modified or unmodified");let i=this.bindings.filter((t=>t.event===e));for(let e=0;e<i.length;e++)i[e].callback(o,n,r||this.joinRef())}replyEventName(e){return`chan_reply_${e}`}isClosed(){return this.state===te}isErrored(){return this.state===ne}isJoined(){return this.state===re}isJoining(){return this.state===oe}isLeaving(){return this.state===ie}}(e,t,this);return this.channels.push(n),n}push(e){if(this.hasLogger()){let{topic:t,event:n,payload:r,ref:o,join_ref:i}=e;this.log("push",`${t} ${n} (${i}, ${o})`,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:o,join_ref:i}=e;o&&o===this.pendingHeartbeatRef&&(this.clearHeartbeats(),this.pendingHeartbeatRef=null,this.heartbeatTimer=setTimeout((()=>this.sendHeartbeat()),this.heartbeatIntervalMs)),this.hasLogger()&&this.log("receive",`${r.status||""} ${t} ${n} ${o&&"("+o+")"||""}`,r);for(let e=0;e<this.channels.length;e++){const a=this.channels[e];a.isMember(t,n,r,i)&&a.trigger(n,r,o,i)}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())}}(o,{params:Object.assign(Object.assign({},i),{v:C})}),this.socket.connect(),this.channel=this.socket.channel(this.channelTopic,{authorization:`Bearer ${this.accessToken}`,channelName:this.channelName}),this.start(),this.socket.onError((e=>{_e("[SOCKET][ERROR]",e)})),this.socket.onOpen((()=>{_e("[SOCKET]OPEN")})),this.channel.on("system",(e=>{"attach_channel_succeeded"===e.type&&xe(this,ge,"m",Oe).call(this,{connected:!0,ready:!0,currentState:"attach_channel_succeeded"})})),this.socket.onClose((()=>{_e("[SOCKET]CLOSE"),xe(this,ge,"m",Oe).call(this,{connected:!1,ready:!1,currentState:"socket_closed"})})),this.channel.onClose((()=>{_e("[CHANNEL]CLOSE"),xe(this,ge,"m",Oe).call(this,{connected:!1,ready:!1,currentState:"channel_closed"})})),this.channel.onError((e=>{_e("[CHANNEL][ERROR]",e),xe(this,ge,"m",Oe).call(this,{connected:!1,ready:!1,currentState:"channel_erred"})})),xe(this,ge,"m",je).call(this,"ack","ui","error","participant","message","service_data","system","info","sync")}))}start(){this.channel.join().receive("ok",(()=>{_e("[CHANNEL][JOIN] OK"),xe(this,ge,"m",Oe).call(this,{connected:!0,ready:!1,currentState:"join_channel_succeeded"})})).receive("error",(e=>{_e("[CHANNEL][JOIN] ERROR",e),xe(this,ge,"m",Oe).call(this,{connected:!1,ready:!1,currentState:"join_channel_erred"}),this.channel.socket.disconnect()})).receive("timeout",(()=>{_e("[CHANEL][JOIN] Networking issue. Still waiting...")}))}disconnect(){var e,t,n;null===(e=this.channel)||void 0===e||e.leave(),null===(t=this.socket)||void 0===t||t.remove(this.channel),null===(n=this.socket)||void 0===n||n.disconnect(),Se(this,we,[],"f")}onConnection(e){xe(this,we,"f").push(e)}pushToChannel(e,t,n=1e4){this.channel.push(e,t,n)}}we=new WeakMap,ge=new WeakSet,je=function(...e){e.forEach((e=>{this.channel.on(e,(t=>{_e("[RECEIVE]",e,t)}))}))},Oe=function(e){Se(this,we,xe(this,we,"f").filter((t=>!t(e))),"f")};var Ce,Pe,Te,ke,Ae,Ne,Ie,Re,De,Me,Le,Ue,Fe,Be,$e,ze=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},He=function(e,t,n,r,o){if("m"===r)throw new TypeError("Private method is not writable");if("a"===r&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?o.call(e,n):o?o.value=n:t.set(e,n),n},Ve=function(e,t,n,r){if("a"===n&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?r:"a"===n?r.call(e):r?r.value:t.get(e)};const qe=K()("seamly");function We(){if(!Intl||"undefined"==typeof Intl||void 0===Intl.DateTimeFormat)return null;const e=Intl.DateTimeFormat();if(void 0===e||void 0===e.resolvedOptions)return null;const t=e.resolvedOptions().timeZone;return t&&(t.indexOf("/")>-1||"UTC"===t)?t:null}class Ge{constructor({layoutMode:e,namespace:t,config:n,context:r}){var o;Ce.add(this),Pe.set(this,void 0),Te.set(this,void 0),ke.set(this,void 0),Ae.set(this,void 0),this.conversation=new Ee,Le.set(this,(e=>e||this.locale)),this.store=function(e,t){const n=t(e),r=n.get()||{};return{get:e=>void 0===e?r:r[e],set:(e,t)=>(r[e]=t,n.set(r),t),delete(e){const t=this.get(e);return delete r[e],n.set(r),t}}}(`${t}.connection${r.locale?`.${r.locale}`:""}`,n.storageProvider||X),this.connectionInfo={apiKey:n.key,domain:n.domain||"api.seamly-app.com",secure:!1!==n.secure&&(n.secure||!0)},He(this,Ae,Object.assign(Object.assign({},n),{sendEnvironment:null===(o=n.sendEnvironment)||void 0===o||o,context:Object.assign(Object.assign({},r),{channelName:r.channelName||"web"})}),"f"),He(this,Pe,!1,"f"),this.connected=!1,this.configReady=!1,He(this,Te,n.externalId,"f"),He(this,ke,e,"f"),this.userResponded=!1,this.URLS={},window.addEventListener("pageshow",(e=>{e.persisted&&this.connected&&this.connect()}))}getConversationUrl(){return this.store.get("conversationUrl")}hasConversation(){return!!this.getConversationUrl()}clearStore(){this.store.delete("accessToken"),this.store.delete("conversationUrl"),this.store.delete("channelName"),this.store.delete("channelTopic")}reset(){return ze(this,void 0,void 0,(function*(){return yield this.disconnect(),this.clearStore(),this.getConfig()}))}disconnect(){var e;return ze(this,void 0,void 0,(function*(){(null===(e=this.conversation)||void 0===e?void 0:e.disconnect)&&this.conversation.disconnect(),this.connected=!1,this.configReady=!1}))}getConfig(){return N().post(`${Ve(this,Ce,"m",Ue).call(this,"http")}/client/${this.connectionInfo.apiKey}/configs`).set("Content-Type","application/json").query({v:C}).send({context:Object.assign(Object.assign({},Ve(this,Ae,"f").context),{environment:!0===Ve(this,Ae,"f").sendEnvironment?Ve(this,Ce,"m",$e).call(this):Ve(this,Ae,"f").sendEnvironment})}).then((({body:e})=>(Ve(this,Ce,"m",Fe).call(this,e),this.configReady=!0,e.config))).catch((e=>{if(404===e.status)throw new R(e);if(e.status>=500)throw new D(e);throw e}))}getConversation(){return ze(this,void 0,void 0,(function*(){if(!this.hasConversation())return null;try{const{body:e}=yield N().get(`${Ve(this,Ce,"m",Ue).call(this,"http")}${this.URLS.history}`).set("Authorization",`Bearer ${Ve(this,Ce,"m",Ne).call(this)}`).query({v:C});Ve(this,Ce,"m",Fe).call(this,e);const{messages:t,participants:n,activeServiceSessionId:r,activeServiceSettings:o,serviceData:i,ui:a,translation:s}=e.history;return{events:t.map((([e,t])=>({type:e,payload:Object.assign(Object.assign({},t),{type:"participant"===e?e:t.type})}))),participants:n,activeServiceSessionId:r,activeServiceSettings:o,serviceData:i,resumeConversationPrompt:!!a&&Boolean(a.resumeConversationPrompt),translationProposal:a.translationProposal,translation:s}}catch(e){if(401===e.status)throw new L(e);if(404===e.status)throw new M(e);if(e.status>=500)throw new D(e);throw e}}))}connect(){return ze(this,void 0,void 0,(function*(){this.connected=!1;let e={};return this.hasConversation()||(e=yield Ve(this,Ce,"m",Be).call(this)),this.conversation.connect(`${Ve(this,Ce,"m",Ue).call(this,"ws")}${this.URLS.socket}`,Ve(this,Ae,"f").context.channelName,Ve(this,Ce,"m",De).call(this),Ve(this,Ce,"m",Ne).call(this)),this.conversation.onConnection((({connected:e,ready:t})=>{this.connected=e,He(this,Pe,t,"f")})),Ve(this,Ae,"f").sendEnvironment&&this.send("context",{environment:!0===Ve(this,Ae,"f").sendEnvironment?Ve(this,Ce,"m",$e).call(this):Ve(this,Ae,"f").sendEnvironment},!1),e}))}uploadFile(e,t,n,r){const o=new FormData;o.append("upload",e);const i=N().post(`${Ve(this,Ce,"m",Ue).call(this,"http")}${this.URLS.uploads}`).set("Authorization",`Bearer ${Ve(this,Ce,"m",Ne).call(this)}`).send(o);return i.on("progress",(function(e){const{direction:n,percent:r}=e;"upload"===n&&"function"==typeof t&&t(r)})),i.then((e=>{n&&n(e)})).catch((e=>{if(!r)throw e;r(e.response)})),i}getConversationIntitialState(){return N().get(`${Ve(this,Ce,"m",Ue).call(this,"http")}${this.getConversationUrl()}`).set("Authorization",`Bearer ${Ve(this,Ce,"m",Ne).call(this)}`).query({v:C}).then((({body:e})=>{return Ve(this,Ce,"m",Fe).call(this,e),this.userResponded=e.conversation.userResponded,t=e.conversation,n=["accessToken","channelTopic"],Object.keys(t).reduce(((e,r)=>(n.includes(r)||(e[r]=t[r]),e)),{});var t,n})).catch((e=>{if(401===e.status)throw new L(e);if(404===e.status)throw new M(e);if(e.status>=500)throw new D(e);throw e}))}getTranslations(e){return ze(this,void 0,void 0,(function*(){try{if(!this.URLS.translations)throw new R;const t=`${Ve(this,Ce,"m",Ue).call(this,"http")}${this.URLS.translations}`.replace("{version}",String(2)).replace("{locale}",Ve(this,Le,"f").call(this,e)),n=N().get(t),{body:r}=yield n;return r.translations}catch(e){if(e.status>=500)throw new D(e);throw e}}))}send(e,t,n=!0){var r;!this.connected||n&&!Ve(this,Pe,"f")?null===(r=this.conversation)||void 0===r||r.onConnection((({connected:r,ready:o})=>(this.connected=r,He(this,Pe,o,"f"),!!(n?o:r)&&(this.send(e,t,n),!0)))):(qe("[SEND]",e,t),this.conversation.pushToChannel(e,function(e,t){if("message"!==e)return t;const{type:n,body:r}=t;let{transactionId:o}=t;return o||(o=J()),{type:n,body:r,transactionId:o}}(e,t),1e4))}sendContext(e){const{locale:t,variables:n}=e,r={};if(t){if("string"!=typeof t)throw new Error("Locale must be a string");r.locale=t}if(n){if("object"!=typeof n)throw new Error("Variables must be an object");r.variables=n}0===Object.keys(r).length&&r.constructor===Object||this.send("context",r,!1)}}Pe=new WeakMap,Te=new WeakMap,ke=new WeakMap,Ae=new WeakMap,Le=new WeakMap,Ce=new WeakSet,Ne=function(){return this.store.get("accessToken")},Ie=function(e){this.store.set("accessToken",e)},Re=function(e){this.store.set("conversationUrl",e)},De=function(){return this.store.get("channelTopic")||this.store.get("channelName")},Me=function(e){this.store.set("channelTopic",e)},Ue=function(e){return`${this.connectionInfo.secure?`${e}s`:e}://${this.connectionInfo.domain}`},Fe=function({_links:e}){this.URLS=Object.entries(e).filter((([e])=>"self"!==e)).reduce(((e,[t,{href:n}])=>Object.assign(Object.assign({},e),{[t]:n})),this.URLS)},Be=function(){var e;return ze(this,void 0,void 0,(function*(){try{const t=N().post(`${Ve(this,Ce,"m",Ue).call(this,"http")}${this.URLS.conversations}`).set("Content-Type","application/json").query({v:C}).withCredentials().send({externalId:Ve(this,Te,"f")||void 0}),{body:n}=yield t,{conversation:r}=n,o=Object.assign({},r);return delete o.accessToken,delete o.channelTopic,Ve(this,Ce,"m",Ie).call(this,r.accessToken),Ve(this,Ce,"m",Me).call(this,r.channelTopic),Ve(this,Ce,"m",Fe).call(this,n),Ve(this,Ce,"m",Re).call(this,this.URLS.conversation),this.locale=null===(e=r.translation)||void 0===e?void 0:e.locale,this.userResponded=r.userResponded,o}catch(e){if(e.status>=500)throw new D(e);throw e}}))},$e=function(){return{clientName:"@seamly/web-ui",clientVariant:Ve(this,ke,"f"),clientVersion:"21.0.9",currentUrl:window.location.toString(),screenResolution:`${window.screen.width}x${window.screen.height}`,timezone:We(),userAgent:navigator.userAgent,preferredLocale:navigator.language}};var Ke=n(554),Je=n.n(Ke),Xe=n(210),Qe=n(207),Ye=n(688),Ze=n(798),et=n(661);let tt=function(e){e()};const nt=()=>tt,rt=(0,et.createContext)(null);function ot(){return(0,et.useContext)(rt)}let it=()=>{throw new Error("uSES not initialized!")};const at=(e,t)=>e===t;function st(e=rt){const t=e===rt?ot:()=>(0,et.useContext)(e);return function(e,n=at){const{store:r,subscription:o,getServerState:i}=t(),a=it(o.addNestedSub,r.getState,i||r.getState,e,n);return(0,et.useDebugValue)(a),a}}const ct=st();n(679),n(973);const lt={notify(){},get:()=>[]};const ut="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?et.useLayoutEffect:et.useEffect;let pt=null;const dt=function({store:e,context:t,children:n,serverState:r}){const o=(0,et.useMemo)((()=>{const t=function(e,t){let n,r=lt;function o(){a.onStateChange&&a.onStateChange()}function i(){n||(n=t?t.addNestedSub(o):e.subscribe(o),r=function(){const e=nt();let t=null,n=null;return{clear(){t=null,n=null},notify(){e((()=>{let e=t;for(;e;)e.callback(),e=e.next}))},get(){let e=[],n=t;for(;n;)e.push(n),n=n.next;return e},subscribe(e){let r=!0,o=n={callback:e,next:null,prev:n};return o.prev?o.prev.next=o:t=o,function(){r&&null!==t&&(r=!1,o.next?o.next.prev=o.prev:n=o.prev,o.prev?o.prev.next=o.next:t=o.next)}}}}())}const a={addNestedSub:function(e){return i(),r.subscribe(e)},notifyNestedSubs:function(){r.notify()},handleChangeWrapper:o,isSubscribed:function(){return Boolean(n)},trySubscribe:i,tryUnsubscribe:function(){n&&(n(),n=void 0,r.clear(),r=lt)},getListeners:()=>r};return a}(e);return{store:e,subscription:t,getServerState:r?()=>r:void 0}}),[e,r]),i=(0,et.useMemo)((()=>e.getState()),[e]);ut((()=>{const{subscription:t}=o;return t.onStateChange=t.notifyNestedSubs,t.trySubscribe(),i!==e.getState()&&t.notifyNestedSubs(),()=>{t.tryUnsubscribe(),t.onStateChange=void 0}}),[o,i]);const a=t||rt;return et.default.createElement(a.Provider,{value:o},n)};function ft(e=rt){const t=e===rt?ot:()=>(0,et.useContext)(e);return function(){const{store:e}=t();return e}}const ht=ft();function yt(e=rt){const t=e===rt?ht:ft(e);return function(){return t().dispatch}}const mt=yt();var bt;(e=>{it=e})(Ze.useSyncExternalStoreWithSelector),(e=>{pt=e})(Ye.useSyncExternalStore),bt=et.unstable_batchedUpdates,tt=bt;const vt=(0,Xe.createContext)(null),gt=(0,Xe.createContext)(null);function wt(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];throw Error("[Immer] minified error nr: "+e+(n.length?" "+n.map((function(e){return"'"+e+"'"})).join(","):"")+". Find the full error at: https://bit.ly/3cXEKWf")}function jt(e){return!!e&&!!e[cn]}function Ot(e){var t;return!!e&&(function(e){if(!e||"object"!=typeof e)return!1;var t=Object.getPrototypeOf(e);if(null===t)return!0;var n=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return n===Object||"function"==typeof n&&Function.toString.call(n)===ln}(e)||Array.isArray(e)||!!e[sn]||!!(null===(t=e.constructor)||void 0===t?void 0:t[sn])||Pt(e)||Tt(e))}function xt(e,t,n){void 0===n&&(n=!1),0===St(e)?(n?Object.keys:un)(e).forEach((function(r){n&&"symbol"==typeof r||t(r,e[r],e)})):e.forEach((function(n,r){return t(r,n,e)}))}function St(e){var t=e[cn];return t?t.i>3?t.i-4:t.i:Array.isArray(e)?1:Pt(e)?2:Tt(e)?3:0}function _t(e,t){return 2===St(e)?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function Et(e,t,n){var r=St(e);2===r?e.set(t,n):3===r?(e.delete(t),e.add(n)):e[t]=n}function Ct(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}function Pt(e){return nn&&e instanceof Map}function Tt(e){return rn&&e instanceof Set}function kt(e){return e.o||e.t}function At(e){if(Array.isArray(e))return Array.prototype.slice.call(e);var t=pn(e);delete t[cn];for(var n=un(t),r=0;r<n.length;r++){var o=n[r],i=t[o];!1===i.writable&&(i.writable=!0,i.configurable=!0),(i.get||i.set)&&(t[o]={configurable:!0,writable:!0,enumerable:i.enumerable,value:e[o]})}return Object.create(Object.getPrototypeOf(e),t)}function Nt(e,t){return void 0===t&&(t=!1),Rt(e)||jt(e)||!Ot(e)||(St(e)>1&&(e.set=e.add=e.clear=e.delete=It),Object.freeze(e),t&&xt(e,(function(e,t){return Nt(t,!0)}),!0)),e}function It(){wt(2)}function Rt(e){return null==e||"object"!=typeof e||Object.isFrozen(e)}function Dt(e){var t=dn[e];return t||wt(18,e),t}function Mt(){return en}function Lt(e,t){t&&(Dt("Patches"),e.u=[],e.s=[],e.v=t)}function Ut(e){Ft(e),e.p.forEach($t),e.p=null}function Ft(e){e===en&&(en=e.l)}function Bt(e){return en={p:[],l:en,h:e,m:!0,_:0}}function $t(e){var t=e[cn];0===t.i||1===t.i?t.j():t.O=!0}function zt(e,t){t._=t.p.length;var n=t.p[0],r=void 0!==e&&e!==n;return t.h.g||Dt("ES5").S(t,e,r),r?(n[cn].P&&(Ut(t),wt(4)),Ot(e)&&(e=Ht(t,e),t.l||qt(t,e)),t.u&&Dt("Patches").M(n[cn].t,e,t.u,t.s)):e=Ht(t,n,[]),Ut(t),t.u&&t.v(t.u,t.s),e!==an?e:void 0}function Ht(e,t,n){if(Rt(t))return t;var r=t[cn];if(!r)return xt(t,(function(o,i){return Vt(e,r,t,o,i,n)}),!0),t;if(r.A!==e)return t;if(!r.P)return qt(e,r.t,!0),r.t;if(!r.I){r.I=!0,r.A._--;var o=4===r.i||5===r.i?r.o=At(r.k):r.o;xt(3===r.i?new Set(o):o,(function(t,i){return Vt(e,r,o,t,i,n)})),qt(e,o,!1),n&&e.u&&Dt("Patches").R(r,n,e.u,e.s)}return r.o}function Vt(e,t,n,r,o,i){if(jt(o)){var a=Ht(e,o,i&&t&&3!==t.i&&!_t(t.D,r)?i.concat(r):void 0);if(Et(n,r,a),!jt(a))return;e.m=!1}if(Ot(o)&&!Rt(o)){if(!e.h.F&&e._<1)return;Ht(e,o),t&&t.A.l||qt(e,o)}}function qt(e,t,n){void 0===n&&(n=!1),e.h.F&&e.m&&Nt(t,n)}function Wt(e,t){var n=e[cn];return(n?kt(n):e)[t]}function Gt(e,t){if(t in e)for(var n=Object.getPrototypeOf(e);n;){var r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=Object.getPrototypeOf(n)}}function Kt(e){e.P||(e.P=!0,e.l&&Kt(e.l))}function Jt(e){e.o||(e.o=At(e.t))}function Xt(e,t,n){var r=Pt(t)?Dt("MapSet").N(t,n):Tt(t)?Dt("MapSet").T(t,n):e.g?function(e,t){var n=Array.isArray(e),r={i:n?1:0,A:t?t.A:Mt(),P:!1,I:!1,D:{},l:t,t:e,k:null,o:null,j:null,C:!1},o=r,i=fn;n&&(o=[r],i=hn);var a=Proxy.revocable(o,i),s=a.revoke,c=a.proxy;return r.k=c,r.j=s,c}(t,n):Dt("ES5").J(t,n);return(n?n.A:Mt()).p.push(r),r}function Qt(e){return jt(e)||wt(22,e),function e(t){if(!Ot(t))return t;var n,r=t[cn],o=St(t);if(r){if(!r.P&&(r.i<4||!Dt("ES5").K(r)))return r.t;r.I=!0,n=Yt(t,o),r.I=!1}else n=Yt(t,o);return xt(n,(function(t,o){r&&function(e,t){return 2===St(e)?e.get(t):e[t]}(r.t,t)===o||Et(n,t,e(o))})),3===o?new Set(n):n}(e)}function Yt(e,t){switch(t){case 2:return new Map(e);case 3:return Array.from(e)}return At(e)}var Zt,en,tn="undefined"!=typeof Symbol&&"symbol"==typeof Symbol("x"),nn="undefined"!=typeof Map,rn="undefined"!=typeof Set,on="undefined"!=typeof Proxy&&void 0!==Proxy.revocable&&"undefined"!=typeof Reflect,an=tn?Symbol.for("immer-nothing"):((Zt={})["immer-nothing"]=!0,Zt),sn=tn?Symbol.for("immer-draftable"):"__$immer_draftable",cn=tn?Symbol.for("immer-state"):"__$immer_state",ln=("undefined"!=typeof Symbol&&Symbol.iterator,""+Object.prototype.constructor),un="undefined"!=typeof Reflect&&Reflect.ownKeys?Reflect.ownKeys:void 0!==Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Object.getOwnPropertyNames,pn=Object.getOwnPropertyDescriptors||function(e){var t={};return un(e).forEach((function(n){t[n]=Object.getOwnPropertyDescriptor(e,n)})),t},dn={},fn={get:function(e,t){if(t===cn)return e;var n=kt(e);if(!_t(n,t))return function(e,t,n){var r,o=Gt(t,n);return o?"value"in o?o.value:null===(r=o.get)||void 0===r?void 0:r.call(e.k):void 0}(e,n,t);var r=n[t];return e.I||!Ot(r)?r:r===Wt(e.t,t)?(Jt(e),e.o[t]=Xt(e.A.h,r,e)):r},has:function(e,t){return t in kt(e)},ownKeys:function(e){return Reflect.ownKeys(kt(e))},set:function(e,t,n){var r=Gt(kt(e),t);if(null==r?void 0:r.set)return r.set.call(e.k,n),!0;if(!e.P){var o=Wt(kt(e),t),i=null==o?void 0:o[cn];if(i&&i.t===n)return e.o[t]=n,e.D[t]=!1,!0;if(Ct(n,o)&&(void 0!==n||_t(e.t,t)))return!0;Jt(e),Kt(e)}return e.o[t]===n&&"number"!=typeof n&&(void 0!==n||t in e.o)||(e.o[t]=n,e.D[t]=!0,!0)},deleteProperty:function(e,t){return void 0!==Wt(e.t,t)||t in e.t?(e.D[t]=!1,Jt(e),Kt(e)):delete e.D[t],e.o&&delete e.o[t],!0},getOwnPropertyDescriptor:function(e,t){var n=kt(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r?{writable:!0,configurable:1!==e.i||"length"!==t,enumerable:r.enumerable,value:n[t]}:r},defineProperty:function(){wt(11)},getPrototypeOf:function(e){return Object.getPrototypeOf(e.t)},setPrototypeOf:function(){wt(12)}},hn={};xt(fn,(function(e,t){hn[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}})),hn.deleteProperty=function(e,t){return hn.set.call(this,e,t,void 0)},hn.set=function(e,t,n){return fn.set.call(this,e[0],t,n,e[0])};var yn=function(){function e(e){var t=this;this.g=on,this.F=!0,this.produce=function(e,n,r){if("function"==typeof e&&"function"!=typeof n){var o=n;n=e;var i=t;return function(e){var t=this;void 0===e&&(e=o);for(var r=arguments.length,a=Array(r>1?r-1:0),s=1;s<r;s++)a[s-1]=arguments[s];return i.produce(e,(function(e){var r;return(r=n).call.apply(r,[t,e].concat(a))}))}}var a;if("function"!=typeof n&&wt(6),void 0!==r&&"function"!=typeof r&&wt(7),Ot(e)){var s=Bt(t),c=Xt(t,e,void 0),l=!0;try{a=n(c),l=!1}finally{l?Ut(s):Ft(s)}return"undefined"!=typeof Promise&&a instanceof Promise?a.then((function(e){return Lt(s,r),zt(e,s)}),(function(e){throw Ut(s),e})):(Lt(s,r),zt(a,s))}if(!e||"object"!=typeof e){if(void 0===(a=n(e))&&(a=e),a===an&&(a=void 0),t.F&&Nt(a,!0),r){var u=[],p=[];Dt("Patches").M(e,a,u,p),r(u,p)}return a}wt(21,e)},this.produceWithPatches=function(e,n){if("function"==typeof e)return function(n){for(var r=arguments.length,o=Array(r>1?r-1:0),i=1;i<r;i++)o[i-1]=arguments[i];return t.produceWithPatches(n,(function(t){return e.apply(void 0,[t].concat(o))}))};var r,o,i=t.produce(e,n,(function(e,t){r=e,o=t}));return"undefined"!=typeof Promise&&i instanceof Promise?i.then((function(e){return[e,r,o]})):[i,r,o]},"boolean"==typeof(null==e?void 0:e.useProxies)&&this.setUseProxies(e.useProxies),"boolean"==typeof(null==e?void 0:e.autoFreeze)&&this.setAutoFreeze(e.autoFreeze)}var t=e.prototype;return t.createDraft=function(e){Ot(e)||wt(8),jt(e)&&(e=Qt(e));var t=Bt(this),n=Xt(this,e,void 0);return n[cn].C=!0,Ft(t),n},t.finishDraft=function(e,t){var n=(e&&e[cn]).A;return Lt(n,t),zt(void 0,n)},t.setAutoFreeze=function(e){this.F=e},t.setUseProxies=function(e){e&&!on&&wt(20),this.g=e},t.applyPatches=function(e,t){var n;for(n=t.length-1;n>=0;n--){var r=t[n];if(0===r.path.length&&"replace"===r.op){e=r.value;break}}n>-1&&(t=t.slice(n+1));var o=Dt("Patches").$;return jt(e)?o(e,t):this.produce(e,(function(e){return o(e,t)}))},e}(),mn=new yn,bn=mn.produce;mn.produceWithPatches.bind(mn),mn.setAutoFreeze.bind(mn),mn.setUseProxies.bind(mn),mn.applyPatches.bind(mn),mn.createDraft.bind(mn),mn.finishDraft.bind(mn);const vn=bn;function gn(e){return gn="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},gn(e)}function wn(e){var t=function(e,t){if("object"!==gn(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==gn(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===gn(t)?t:String(t)}function jn(e,t,n){return(t=wn(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function On(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 xn(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?On(Object(n),!0).forEach((function(t){jn(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):On(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Sn(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. "}var _n="function"==typeof Symbol&&Symbol.observable||"@@observable",En=function(){return Math.random().toString(36).substring(7).split("").join(".")},Cn={INIT:"@@redux/INIT"+En(),REPLACE:"@@redux/REPLACE"+En(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+En()}};function Pn(e){if("object"!=typeof e||null===e)return!1;for(var t=e;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function Tn(e,t,n){var r;if("function"==typeof t&&"function"==typeof n||"function"==typeof n&&"function"==typeof arguments[3])throw new Error(Sn(0));if("function"==typeof t&&void 0===n&&(n=t,t=void 0),void 0!==n){if("function"!=typeof n)throw new Error(Sn(1));return n(Tn)(e,t)}if("function"!=typeof e)throw new Error(Sn(2));var o=e,i=t,a=[],s=a,c=!1;function l(){s===a&&(s=a.slice())}function u(){if(c)throw new Error(Sn(3));return i}function p(e){if("function"!=typeof e)throw new Error(Sn(4));if(c)throw new Error(Sn(5));var t=!0;return l(),s.push(e),function(){if(t){if(c)throw new Error(Sn(6));t=!1,l();var n=s.indexOf(e);s.splice(n,1),a=null}}}function d(e){if(!Pn(e))throw new Error(Sn(7));if(void 0===e.type)throw new Error(Sn(8));if(c)throw new Error(Sn(9));try{c=!0,i=o(i,e)}finally{c=!1}for(var t=a=s,n=0;n<t.length;n++)(0,t[n])();return e}function f(e){if("function"!=typeof e)throw new Error(Sn(10));o=e,d({type:Cn.REPLACE})}function h(){var e,t=p;return(e={subscribe:function(e){if("object"!=typeof e||null===e)throw new Error(Sn(11));function n(){e.next&&e.next(u())}return n(),{unsubscribe:t(n)}}})[_n]=function(){return this},e}return d({type:Cn.INIT}),(r={dispatch:d,subscribe:p,getState:u,replaceReducer:f})[_n]=h,r}function kn(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return 0===t.length?function(e){return e}:1===t.length?t[0]:t.reduce((function(e,t){return function(){return e(t.apply(void 0,arguments))}}))}function An(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e){return function(){var n=e.apply(void 0,arguments),r=function(){throw new Error(Sn(15))},o={getState:n.getState,dispatch:function(){return r.apply(void 0,arguments)}},i=t.map((function(e){return e(o)}));return r=kn.apply(void 0,i)(n.dispatch),xn(xn({},n),{},{dispatch:r})}}}function Nn(e){return function(t){var n=t.dispatch,r=t.getState;return function(t){return function(o){return"function"==typeof o?o(n,r,e):t(o)}}}}var In=Nn();In.withExtraArgument=Nn;const Rn=In;var Dn,Mn=(Dn=function(e,t){return Dn=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},Dn(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}Dn(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),Ln=function(e,t){for(var n=0,r=t.length,o=e.length;n<r;n++,o++)e[o]=t[n];return e},Un=Object.defineProperty,Fn=Object.defineProperties,Bn=Object.getOwnPropertyDescriptors,$n=Object.getOwnPropertySymbols,zn=Object.prototype.hasOwnProperty,Hn=Object.prototype.propertyIsEnumerable,Vn=function(e,t,n){return t in e?Un(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n},qn=function(e,t){for(var n in t||(t={}))zn.call(t,n)&&Vn(e,n,t[n]);if($n)for(var r=0,o=$n(t);r<o.length;r++)n=o[r],Hn.call(t,n)&&Vn(e,n,t[n]);return e},Wn=function(e,t){return Fn(e,Bn(t))},Gn="undefined"!=typeof window&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(0!==arguments.length)return"object"==typeof arguments[0]?kn:kn.apply(null,arguments)};"undefined"!=typeof window&&window.__REDUX_DEVTOOLS_EXTENSION__&&window.__REDUX_DEVTOOLS_EXTENSION__;var Kn=function(e){function t(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var o=e.apply(this,n)||this;return Object.setPrototypeOf(o,t.prototype),o}return Mn(t,e),Object.defineProperty(t,Symbol.species,{get:function(){return t},enumerable:!1,configurable:!0}),t.prototype.concat=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return e.prototype.concat.apply(this,t)},t.prototype.prepend=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return 1===e.length&&Array.isArray(e[0])?new(t.bind.apply(t,Ln([void 0],e[0].concat(this)))):new(t.bind.apply(t,Ln([void 0],e.concat(this))))},t}(Array);function Jn(e){return Ot(e)?vn(e,(function(){})):e}function Xn(e){var t,n=function(e){return function(e){void 0===e&&(e={});var t=e.thunk,n=void 0===t||t,r=(e.immutableCheck,e.serializableCheck,new Kn);return n&&(function(e){return"boolean"==typeof e}(n)?r.push(Rn):r.push(Rn.withExtraArgument(n.extraArgument))),r}(e)},r=e||{},o=r.reducer,i=void 0===o?void 0:o,a=r.middleware,s=void 0===a?n():a,c=r.devTools,l=void 0===c||c,u=r.preloadedState,p=void 0===u?void 0:u,d=r.enhancers,f=void 0===d?void 0:d;if("function"==typeof i)t=i;else{if(!function(e){if("object"!=typeof e||null===e)return!1;var t=Object.getPrototypeOf(e);if(null===t)return!0;for(var n=t;null!==Object.getPrototypeOf(n);)n=Object.getPrototypeOf(n);return t===n}(i))throw new Error('"reducer" is a required argument, and must be a function or an object of functions that can be passed to combineReducers');t=function(e){for(var t=Object.keys(e),n={},r=0;r<t.length;r++){var o=t[r];"function"==typeof e[o]&&(n[o]=e[o])}var i,a=Object.keys(n);try{!function(e){Object.keys(e).forEach((function(t){var n=e[t];if(void 0===n(void 0,{type:Cn.INIT}))throw new Error(Sn(12));if(void 0===n(void 0,{type:Cn.PROBE_UNKNOWN_ACTION()}))throw new Error(Sn(13))}))}(n)}catch(e){i=e}return function(e,t){if(void 0===e&&(e={}),i)throw i;for(var r=!1,o={},s=0;s<a.length;s++){var c=a[s],l=n[c],u=e[c],p=l(u,t);if(void 0===p)throw t&&t.type,new Error(Sn(14));o[c]=p,r=r||p!==u}return(r=r||a.length!==Object.keys(e).length)?o:e}}(i)}var h=s;"function"==typeof h&&(h=h(n));var y=An.apply(void 0,h),m=kn;l&&(m=Gn(qn({trace:!1},"object"==typeof l&&l)));var b=[y];return Array.isArray(f)?b=Ln([y],f):"function"==typeof f&&(b=f(b)),Tn(t,p,m.apply(void 0,b))}function Qn(e,t){function n(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];if(t){var o=t.apply(void 0,n);if(!o)throw new Error("prepareAction did not return an object");return qn(qn({type:e,payload:o.payload},"meta"in o&&{meta:o.meta}),"error"in o&&{error:o.error})}return{type:e,payload:n[0]}}return n.toString=function(){return""+e},n.type=e,n.match=function(t){return t.type===e},n}function Yn(e){var t,n={},r=[],o={addCase:function(e,t){var r="string"==typeof e?e:e.type;if(r in n)throw new Error("addCase cannot be called with two reducers for the same action type");return n[r]=t,o},addMatcher:function(e,t){return r.push({matcher:e,reducer:t}),o},addDefaultCase:function(e){return t=e,o}};return e(o),[n,r,t]}function Zn(e){var t=e.name;if(!t)throw new Error("`name` is a required option for createSlice");var n,r="function"==typeof e.initialState?e.initialState:Jn(e.initialState),o=e.reducers||{},i=Object.keys(o),a={},s={},c={};function l(){var t="function"==typeof e.extraReducers?Yn(e.extraReducers):[e.extraReducers],n=t[0],o=void 0===n?{}:n,i=t[1],a=void 0===i?[]:i,c=t[2],l=void 0===c?void 0:c,u=qn(qn({},o),s);return function(e,t,n,r){void 0===n&&(n=[]);var o,i=Yn(t),a=i[0],s=i[1],c=i[2];if(function(e){return"function"==typeof e}(e))o=function(){return Jn(e())};else{var l=Jn(e);o=function(){return l}}function u(e,t){void 0===e&&(e=o());var n=Ln([a[t.type]],s.filter((function(e){return(0,e.matcher)(t)})).map((function(e){return e.reducer})));return 0===n.filter((function(e){return!!e})).length&&(n=[c]),n.reduce((function(e,n){if(n){var r;if(jt(e))return void 0===(r=n(e,t))?e:r;if(Ot(e))return vn(e,(function(e){return n(e,t)}));if(void 0===(r=n(e,t))){if(null===e)return e;throw Error("A case reducer on a non-draftable value must not return undefined")}return r}return e}),e)}return u.getInitialState=o,u}(r,(function(e){for(var t in u)e.addCase(t,u[t]);for(var n=0,r=a;n<r.length;n++){var o=r[n];e.addMatcher(o.matcher,o.reducer)}l&&e.addDefaultCase(l)}))}return i.forEach((function(e){var n,r,i=o[e],l=function(e,t){return e+"/"+t}(t,e);"reducer"in i?(n=i.reducer,r=i.prepare):n=i,a[e]=n,s[l]=n,c[e]=r?Qn(l,r):Qn(l)})),{name:t,reducer:function(e,t){return n||(n=l()),n(e,t)},actions:c,caseReducers:a,getInitialState:function(){return n||(n=l()),n.getInitialState()}}}var er=function(e){void 0===e&&(e=21);for(var t="",n=e;n--;)t+="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW"[64*Math.random()|0];return t},tr=["name","message","stack","code"],nr=function(e,t){this.payload=e,this.meta=t},rr=function(e,t){this.payload=e,this.meta=t},or=function(e){if("object"==typeof e&&null!==e){for(var t={},n=0,r=tr;n<r.length;n++){var o=r[n];"string"==typeof e[o]&&(t[o]=e[o])}return t}return{message:String(e)}},ir=function(){function e(e,t,n){var r=Qn(e+"/fulfilled",(function(e,t,n,r){return{payload:e,meta:Wn(qn({},r||{}),{arg:n,requestId:t,requestStatus:"fulfilled"})}})),o=Qn(e+"/pending",(function(e,t,n){return{payload:void 0,meta:Wn(qn({},n||{}),{arg:t,requestId:e,requestStatus:"pending"})}})),i=Qn(e+"/rejected",(function(e,t,r,o,i){return{payload:o,error:(n&&n.serializeError||or)(e||"Rejected"),meta:Wn(qn({},i||{}),{arg:r,requestId:t,rejectedWithValue:!!o,requestStatus:"rejected",aborted:"AbortError"===(null==e?void 0:e.name),condition:"ConditionError"===(null==e?void 0:e.name)})}})),a="undefined"!=typeof AbortController?AbortController:function(){function e(){this.signal={aborted:!1,addEventListener:function(){},dispatchEvent:function(){return!1},onabort:function(){},removeEventListener:function(){},reason:void 0,throwIfAborted:function(){}}}return e.prototype.abort=function(){},e}();return Object.assign((function(e){return function(s,c,l){var u,p=(null==n?void 0:n.idGenerator)?n.idGenerator(e):er(),d=new a;function f(e){u=e,d.abort()}var h=function(){return a=this,h=null,y=function(){var a,h,y,m,b,v;return function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}}(this,(function(g){switch(g.label){case 0:return g.trys.push([0,4,,5]),null===(w=m=null==(a=null==n?void 0:n.condition)?void 0:a.call(n,e,{getState:c,extra:l}))||"object"!=typeof w||"function"!=typeof w.then?[3,2]:[4,m];case 1:m=g.sent(),g.label=2;case 2:if(!1===m||d.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};return b=new Promise((function(e,t){return d.signal.addEventListener("abort",(function(){return t({name:"AbortError",message:u||"Aborted"})}))})),s(o(p,e,null==(h=null==n?void 0:n.getPendingMeta)?void 0:h.call(n,{requestId:p,arg:e},{getState:c,extra:l}))),[4,Promise.race([b,Promise.resolve(t(e,{dispatch:s,getState:c,extra:l,requestId:p,signal:d.signal,abort:f,rejectWithValue:function(e,t){return new nr(e,t)},fulfillWithValue:function(e,t){return new rr(e,t)}})).then((function(t){if(t instanceof nr)throw t;return t instanceof rr?r(t.payload,p,e,t.meta):r(t,p,e)}))])];case 3:return y=g.sent(),[3,5];case 4:return v=g.sent(),y=v instanceof nr?i(null,p,e,v.payload,v.meta):i(v,p,e),[3,5];case 5:return n&&!n.dispatchConditionRejection&&i.match(y)&&y.meta.condition||s(y),[2,y]}var w}))},new Promise((function(e,t){var n=function(e){try{o(y.next(e))}catch(e){t(e)}},r=function(e){try{o(y.throw(e))}catch(e){t(e)}},o=function(t){return t.done?e(t.value):Promise.resolve(t.value).then(n,r)};o((y=y.apply(a,h)).next())}));var a,h,y}();return Object.assign(h,{abort:f,requestId:p,arg:e,unwrap:function(){return h.then(ar)}})}}),{pending:o,rejected:i,fulfilled:r,typePrefix:e})}return e.withTypes=function(){return e},e}();function ar(e){if(e.meta&&e.meta.rejectedWithValue)throw e.payload;if(e.error)throw e.error;return e.payload}var sr=function(e,t){return function(e){return e&&"function"==typeof e.match}(e)?e.match(t):e(t)};function cr(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return function(t){return e.some((function(e){return sr(e,t)}))}}Object.assign;var lr="listenerMiddleware";Qn(lr+"/add"),Qn(lr+"/removeAll"),Qn(lr+"/remove"),"function"==typeof queueMicrotask&&queueMicrotask.bind("undefined"!=typeof window?window:void 0!==n.g?n.g:globalThis);"undefined"!=typeof window&&window.requestAnimationFrame&&window.requestAnimationFrame,function(){function e(e,t){var n=o[e];return n?n.enumerable=t:o[e]=n={configurable:!0,enumerable:t,get:function(){var t=this[cn];return fn.get(t,e)},set:function(t){var n=this[cn];fn.set(n,e,t)}},n}function t(e){for(var t=e.length-1;t>=0;t--){var o=e[t][cn];if(!o.P)switch(o.i){case 5:r(o)&&Kt(o);break;case 4:n(o)&&Kt(o)}}}function n(e){for(var t=e.t,n=e.k,r=un(n),o=r.length-1;o>=0;o--){var i=r[o];if(i!==cn){var a=t[i];if(void 0===a&&!_t(t,i))return!0;var s=n[i],c=s&&s[cn];if(c?c.t!==a:!Ct(s,a))return!0}}var l=!!t[cn];return r.length!==un(t).length+(l?0:1)}function r(e){var t=e.k;if(t.length!==e.t.length)return!0;var n=Object.getOwnPropertyDescriptor(t,t.length-1);if(n&&!n.get)return!0;for(var r=0;r<t.length;r++)if(!t.hasOwnProperty(r))return!0;return!1}var o={};!function(e,t){dn[e]||(dn[e]=t)}("ES5",{J:function(t,n){var r=Array.isArray(t),o=function(t,n){if(t){for(var r=Array(n.length),o=0;o<n.length;o++)Object.defineProperty(r,""+o,e(o,!0));return r}var i=pn(n);delete i[cn];for(var a=un(i),s=0;s<a.length;s++){var c=a[s];i[c]=e(c,t||!!i[c].enumerable)}return Object.create(Object.getPrototypeOf(n),i)}(r,t),i={i:r?5:4,A:n?n.A:Mt(),P:!1,I:!1,D:{},l:n,t,k:o,o:null,O:!1,C:!1};return Object.defineProperty(o,cn,{value:i,writable:!0}),o},S:function(e,n,o){o?jt(n)&&n[cn].A===e&&t(e.p):(e.u&&function e(t){if(t&&"object"==typeof t){var n=t[cn];if(n){var o=n.t,i=n.k,a=n.D,s=n.i;if(4===s)xt(i,(function(t){t!==cn&&(void 0!==o[t]||_t(o,t)?a[t]||e(i[t]):(a[t]=!0,Kt(n)))})),xt(o,(function(e){void 0!==i[e]||_t(i,e)||(a[e]=!1,Kt(n))}));else if(5===s){if(r(n)&&(Kt(n),a.length=!0),i.length<o.length)for(var c=i.length;c<o.length;c++)a[c]=!1;else for(var l=o.length;l<i.length;l++)a[l]=!0;for(var u=Math.min(i.length,o.length),p=0;p<u;p++)i.hasOwnProperty(p)||(a[p]=!0),void 0===a[p]&&e(i[p])}}}}(e.p[0]),t(e.p))},K:function(e){return 4===e.i?n(e):r(e)}})}();class ur extends I{constructor(e,...t){super(e,...t),this.name="SeamlyUnavailableError",this.langKey="errors.seamlyUnavailable"}}var pr=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))};const dr=ir("initializeConfig",((e,{extra:{api:t,config:n},rejectWithValue:r})=>pr(void 0,void 0,void 0,(function*(){var e;try{const{features:r,defaultLocale:o,preChat:i,agentParticipant:a,userParticipant:s,startChatIcon:c}=yield t.getConfig(),l=(null===(e=null==n?void 0:n.context)||void 0===e?void 0:e.locale)||o,{connectWhenInView:u}=n;return{features:r,defaultLocale:o,preChat:i,agentParticipant:a,userParticipant:s,startChatIcon:c,locale:l,connectWhenInView:u}}catch(e){return r(e)}})))),fr=ir("resetConfig",((e,{extra:{config:t}})=>pr(void 0,void 0,void 0,(function*(){return t}))));const hr=ir("setLocale",((e,{extra:{api:t},rejectWithValue:n})=>function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))}(void 0,void 0,void 0,(function*(){try{return{translations:yield t.getTranslations(e),locale:e}}catch(e){return n(e)}}))),{condition:(e,{getState:t})=>{const{i18n:{isLoading:n,locale:r}}=t();return e!==r&&!n}});var yr="NOT_FOUND",mr=function(e,t){return e===t};function br(e,t){var n,r,o="object"==typeof t?t:{equalityCheck:t},i=o.equalityCheck,a=void 0===i?mr:i,s=o.maxSize,c=void 0===s?1:s,l=o.resultEqualityCheck,u=function(e){return function(t,n){if(null===t||null===n||t.length!==n.length)return!1;for(var r=t.length,o=0;o<r;o++)if(!e(t[o],n[o]))return!1;return!0}}(a),p=1===c?(n=u,{get:function(e){return r&&n(r.key,e)?r.value:yr},put:function(e,t){r={key:e,value:t}},getEntries:function(){return r?[r]:[]},clear:function(){r=void 0}}):function(e,t){var n=[];function r(e){var r=n.findIndex((function(n){return t(e,n.key)}));if(r>-1){var o=n[r];return r>0&&(n.splice(r,1),n.unshift(o)),o.value}return yr}return{get:r,put:function(t,o){r(t)===yr&&(n.unshift({key:t,value:o}),n.length>e&&n.pop())},getEntries:function(){return n},clear:function(){n=[]}}}(c,u);function d(){var t=p.get(arguments);if(t===yr){if(t=e.apply(null,arguments),l){var n=p.getEntries(),r=n.find((function(e){return l(e.value,t)}));r&&(t=r.value)}p.put(arguments,t)}return t}return d.clearCache=function(){return p.clear()},d}function vr(e){var t=Array.isArray(e[0])?e[0]:e;if(!t.every((function(e){return"function"==typeof e}))){var n=t.map((function(e){return"function"==typeof e?"function "+(e.name||"unnamed")+"()":typeof e})).join(", ");throw new Error("createSelector expects all input-selectors to be functions, but received the following types: ["+n+"]")}return t}function gr(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];var o=function(){for(var t=arguments.length,r=new Array(t),o=0;o<t;o++)r[o]=arguments[o];var i,a=0,s={memoizeOptions:void 0},c=r.pop();if("object"==typeof c&&(s=c,c=r.pop()),"function"!=typeof c)throw new Error("createSelector expects an output function after the inputs, but received: ["+typeof c+"]");var l=s,u=l.memoizeOptions,p=void 0===u?n:u,d=Array.isArray(p)?p:[p],f=vr(r),h=e.apply(void 0,[function(){return a++,c.apply(null,arguments)}].concat(d)),y=e((function(){for(var e=[],t=f.length,n=0;n<t;n++)e.push(f[n].apply(null,arguments));return i=h.apply(null,e)}));return Object.assign(y,{resultFunc:c,memoizedResultFunc:h,dependencies:f,lastResult:function(){return i},recomputations:function(){return a},resetRecomputations:function(){return a=0}}),y};return o}var wr=gr(br);const jr=wr((({app:e})=>e),(({userHasResponded:e})=>e)),Or=wr((({config:e})=>e),(e=>{let t=Object.assign({visible:"inline"===(null==e?void 0:e.layoutMode)?S.open:S.minimized,appContainerClassNames:e.appContainerClassNames||[]},e);return"function"==typeof t.appContainerClassNames&&(t=Object.assign(Object.assign({},t),{appContainerClassNames:t.appContainerClassNames(t)})),t})),xr=()=>ct(Or),Sr=({state:e})=>e,_r=()=>ct(Sr),Er=wr(Sr,Or,jr,(({events:e,serviceData:t},n,r)=>{var o;if(r||"inline"===n.layoutMode||!(null==t?void 0:t.suggestion)||!(null===(o=null==t?void 0:t.suggestion)||void 0===o?void 0:o.body.length))return e;const i={type:"service_data",payload:t.suggestion};return[...e,i]})),Cr=wr(Er,Or,((e,t)=>{var n,r;const{enabled:o,threshold:i}=null!==(r=null===(n=null==t?void 0:t.messages)||void 0===n?void 0:n.timeIndicator)&&void 0!==r?r:{};if(!o)return e;const a=[];let s=null;return e.forEach(((e,t)=>{if(0===t)a.push(Object.assign(Object.assign({},e),{timeIndicator:e.payload.occurredAt}));else{const t=s&&F(e.payload.occurredAt-s.payload.occurredAt)>=i?e.payload.occurredAt:void 0;a.push(Object.assign(Object.assign({},e),{timeIndicator:t}))}s=e})),a})),Pr=()=>ct(Cr),Tr=(wr(Cr,(e=>e.map((e=>e.payload.id)))),()=>_r().isLoading),kr=()=>_r().unreadEvents,Ar=()=>_r().skiplinkTargetId,Nr=wr(Cr,(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})),Ir=()=>{const{participants:e,currentAgent:t}=_r().participantInfo;return t?e[t]:null},Rr=()=>{const{layoutMode:e}=xr();return{isInline:"inline"===e,isWindow:"window"===e,isApp:"app"===e,isResolving:!e}},Dr=wr((({visibility:e})=>e),(e=>e.visibility)),Mr=wr((({visibility:e})=>e),(e=>e.showInlineView));const Lr=[S.open,S.minimized,S.hidden],Ur=ir("setVisibility",((e,{getState:t,extra:{api:n,eventBus:r}})=>{const o=t(),i=Dr(o),a=jr(o),s=n.hasConversation(),c=Or(o),{visibilityCallback:l=_,layoutMode:u}=c,{unreadEvents:p}=Sr(o),d=l({hasResponded:a,previousVisibility:i,requestedVisibility:e,config:c});if(Lr.includes(d)){if(i!==d)return n.store.set(x,Object.assign(Object.assign({},n.store.get(x)||{}),{[u]:e})),e&&r.emit("ui.visible",e,{visibility:e,hasConversation:s,hasResponded:a,unreadMessageCount:p}),d}else console.error('The visibilityCallback function should return "open", "minimized" or "hidden".')})),Fr=ir("initialize",((e,{dispatch:t,getState:n,extra:{api:r}})=>function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))}(void 0,void 0,void 0,(function*(){var e;const{layoutMode:o}=Or(n()),i=(null===(e=r.store.get(x))||void 0===e?void 0:e[o])||S.initialize;return t(Ur(i)),i}))));var Br=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))};const $r=ir("initializeApp",((e,{extra:{api:t,config:n},rejectWithValue:r})=>Br(void 0,void 0,void 0,(function*(){var e,o,i,a;let s=null===(e=null==n?void 0:n.context)||void 0===e?void 0:e.locale;try{if(t.hasConversation()){const e=yield t.getConversationIntitialState();return s=(null===(o=e.translation)||void 0===o?void 0:o.locale)||s,{initialState:e,locale:s,config:n}}return(null===(i=null==n?void 0:n.context)||void 0===i?void 0:i.topic)&&t.send("action",{type:f,body:{name:n.context.topic,fallbackMessage:n.context.topic}}),(null===(a=null==n?void 0:n.context)||void 0===a?void 0:a.translationLocale)&&(s=n.context.translationLocale,t.send("action",{type:h,body:{enabled:!0,locale:s}},!1)),{initialState:void 0,locale:s,config:n}}catch(e){if(e instanceof M){const e=new M;return r({name:e.name,message:e.message,originalEvent:e.originalEvent,originalError:e.originalError,action:e.action})}const t=new ur;return r({name:t.name,message:t.message,langKey:t.langKey})}})))),zr=ir("resetApp",((e,{dispatch:t,extra:{api:n}})=>Br(void 0,void 0,void 0,(function*(){yield n.disconnect(),yield n.clearStore(),t(fr()),yield t(dr());try{const{locale:e}=yield t($r()).unwrap();yield t(hr(e))}catch(e){}t(Fr())})))),Hr=()=>ct(jr),Vr={userHasResponded:!1},qr=Zn({name:"app",initialState:Vr,reducers:{setHasResponded:(e,{payload:t})=>{e.userHasResponded=t}},extraReducers:e=>{e.addCase(zr.pending,(()=>Vr)).addCase($r.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:Wr}=qr.actions,Gr=qr.reducer,Kr={error:void 0},Jr=Zn({name:"interrupt",initialState:Kr,reducers:{setInterrupt:(e,t)=>{e.error=t.payload},clearInterrupt:()=>Kr},extraReducers:e=>{e.addCase(dr.pending,(()=>Kr)).addMatcher(cr($r.rejected,dr.rejected,hr.rejected,Ur.rejected,Fr.rejected),((e,{payload:t})=>{e.error=t}))}}),{setInterrupt:Xr,clearInterrupt:Qr}=Jr.actions,Yr=Jr.reducer,Zr=({type:n,payload:r})=>n===e.message&&!r.fromClient||n===e.info&&r.type===t,eo=e=>e.sort((({payload:{occurredAt:e}},{payload:{occurredAt:t}})=>e-t)),to=(e,t)=>{if(!e)return{participants:{},currentAgent:""};const{participants:n}=e||{participants:{}},{id:r,avatar:o,name:i,introduction:a}=t.participant,s=n[r],c=Object.assign(Object.assign({},n),{[r]:s?Object.assign(Object.assign(Object.assign(Object.assign({},s),o?{avatar:o}:{}),i?{name:i}:{}),a?{introduction:a}:{}):t.participant});return Object.assign(Object.assign({},e),{participants:c,currentAgent:e.currentAgent===r||t.fromClient?e.currentAgent:r})},no=(e,t)=>{const n="message"===(null==t?void 0:t.type)?null==t?void 0:t.payload.entry:{},{blockAutoEntrySwitch:r}=e;if(!n)return Object.assign(Object.assign({},e),{optionsOverride:{}});const{type:o,options:i}=n;let a=e.active;return r||o===e.userSelected||(a=o),Object.assign(Object.assign({},e),{active:a,optionsOverride:Object.assign(Object.assign({},e.optionsOverride),{[o]:i||{}})})},ro={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:""},participantInfo:{participants:{},currentAgent:""},headerTitles:{title:null,subTitle:""},historyLoaded:!1,skiplinkTargetId:J(),optionsButtonId:J(),headerCollapseButtonId:J(),serviceData:{},options:{features:{},panelActive:!1,optionActive:"",userSelectedOptions:{}},showFileUpload:!1,currentUploads:[],entryMeta:{default:o,active:o,userSelected:null,blockAutoEntrySwitch:!1,options:{},optionsOverride:{}},seamlyContainerElement:null},oo=Zn({name:"store",initialState:ro,reducers:{addEvent:(t,n)=>{var r,o;const{type:c,payload:l}=n.payload,u=t.options.features.hasOwnProperty(j);let p=Object.assign({},t.options);if(u&&(c===e.message||c===e.participant)&&!l.fromClient){const e="message"===c?null===(r=l.entry)||void 0===r?void 0:r.type:{};p=Object.assign(Object.assign({},p),{features:Object.assign(Object.assign({},p.features),{uploads:Object.assign(Object.assign({},null===(o=p.features)||void 0===o?void 0:o.uploads),{enabledFromEntry:e===i})})})}const d=Zr(n.payload);if(t.events.find((e=>e.payload.id===l.id)))return;const f=no(t.entryMeta,n.payload);t.entryMeta=u||f.active!==i?f:Object.assign({},t.entryMeta),t.options=p,d&&(t.unreadEvents+=1,"service_data"!==c&&(n.payload.payload.messageStatus=l.fromClient?s:a)),n.payload.payload.key=J(),t.events.push(n.payload),t.isLastEventFromClient=l.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:o}=t;n&&(n.payload.id=r,n.payload.occurredAt=o,e.events=eo(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===a&&{messageStatus:s})),e)))},setLoadedImageEventIds:(e,{payload:t})=>{e.loadedImageEventIds.push(t)},setHistory:(e,{payload:{events:n,participants:r,activeServiceSessionId:o,activeServiceSettings:s={},serviceData:c,resumeConversationPrompt:l}})=>{var u,p;const d=((e,t)=>{const n=e.filter((e=>!t.some((t=>t.payload.id===e.payload.id)))),r=t.filter((e=>!("participant"===e.type&&!e.payload.participant.introduction))).reverse();return eo([...r,...n])})(e.events,n),f=Object.assign(Object.assign({},e.participantInfo.participants),r),h=d.slice().reverse().find((e=>("message"===e.type||"participant"===e.type)&&!e.payload.fromClient));let y=null;h&&("message"===h.type&&(y=h.payload.participant),"participant"===h.type&&(y=h.payload.participant.id));const{entry:m}=s,b=null===(u=null==m?void 0:m.options)||void 0===u?void 0:u.upload,v=no(Object.assign(Object.assign(Object.assign({},e.entryMeta),m),{active:(null==m?void 0:m.default)||t,options:Object.assign({},(null==m?void 0:m.options)?m.options:{})}),d[d.length-1]);let g=Object.assign({},e.options.features);const w=g.hasOwnProperty(j);if(w&&"message"===(null==h?void 0:h.type)){const{payload:e}=h,t=(null===(p=null==e?void 0:e.entry)||void 0===p?void 0:p.type)||{};g=Object.assign(Object.assign({},g),{uploads:{enabled:!(!b||!(null==b?void 0:b.enabled)),enabledFromEntry:t===i}})}e.unreadEvents=d.filter((e=>"message"===e.type&&e.payload.messageStatus===a)).length,e.events=d.filter((e=>"participant"!==e.type||!!e.payload.participant.introduction)),e.participantInfo=Object.assign(Object.assign(Object.assign({},e.participantInfo),y?to(e.participantInfo,{participant:f[y]}):{}),{participants:f}),e.historyLoaded=!0,e.serviceInfo=Object.assign(Object.assign({},e.serviceInfo),{activeServiceSessionId:o}),e.serviceData=Object.assign(Object.assign({},e.serviceData),c),e.options=Object.assign(Object.assign({},e.options),{features:g||{}}),e.entryMeta=w||v.active!==i?v:Object.assign({},e.entryMeta),e.resumeConversationPrompt=l||!1,y&&(e.headerTitles.subTitle=f[y].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=B(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=to(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.initialState,e.unreadEvents=ro.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={}},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={}},setActiveEntryType:(e,{payload:t})=>{e.entryMeta.active=t},setUserEntryType:(e,{payload:t})=>{e.entryMeta.userSelected=t},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))},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}},extraReducers:e=>{e.addCase(zr.pending,(()=>ro)).addCase(dr.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($r.fulfilled,((e,{payload:t})=>{t.initialState&&(e.initialState=t.initialState)})).addMatcher(cr(yo,mo),(e=>{e.isLastEventFromClient=!1}))}}),{ackEvent:io,addEvent:ao,clearAllUploads:so,clearEvents:co,clearFeatures:lo,clearIdleDetachCountdown:uo,clearResumeConversationPrompt:po,decrementIdleDetachCountdownCounter:fo,hideOption:ho,initIdleDetachCountdown:yo,initResumeConversationPrompt:mo,registerUpload:bo,resetHistoryLoadedFlag:vo,setActiveEntryType:go,setActiveService:wo,setBlockAutoEntrySwitch:jo,setEventsRead:Oo,setFeatureEnabledState:xo,setFeatures:So,setHeaderSubTitle:_o,setHeaderTitle:Eo,setHistory:Co,setInitialState:Po,setIsLoading:To,setLoadedImageEventIds:ko,setParticipant:Ao,setSeamlyContainerElement:No,setServiceDataItem:Io,setServiceEntryMetadata:Ro,setUploadComplete:Do,setUploadError:Mo,setUploadProgress:Lo,setUserEntryType:Uo,setUserSelectedOption:Fo,setUserSelectedOptions:Bo,showOption:$o,stopIdleDetachCountdownCounter:zo}=oo.actions,Ho=oo.reducer;const Vo=Object.assign(Object.assign({},{namespace:"default",layoutMode:"window",messages:{agent:{showAvatar:!1,showName:!1},user:{showAvatar:!1,showName:!1},timeIndicator:{enabled:!1,threshold:36e5}}}),{api:{domain:"",key:"",secure:!0},hideOnNoUserResponse:!1,connectWhenInView:!0,showDisclaimer:!1,showFaq:!1,showSuggestions:!0,customComponents:{},defaults:{visible:null},preChatEvents:[]}),qo=["hideOnNoUserResponse","connectWhenInView","showDisclaimer","showFaq","showSuggestions","namespace","customComponents","defaults","layoutMode","api","zIndex","context","appContainerClassNames","messages","visible","visibilityCallback","errorCallback","agentParticipant","userParticipant","startChatIcon"],Wo=(e,t)=>{const n=(i=t,qo.reduce(((e,t)=>(t in i&&(e[t]=i[t]),e)),{})),{messages:r}=n,o=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 o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}(n,["messages"]);var i;let a=e;return Object.keys(o).length>0&&(a=Object.assign(Object.assign({},a),o)),r&&(a=Object.assign(Object.assign({},a),{messages:Object.assign(Object.assign({},a.messages),r)})),a},Go=Zn({name:"config",initialState:Vo,reducers:{setConfig:(e,{payload:t})=>Wo(e,t),updateConfig:(e,{payload:t})=>Wo(e,t),setPreChatEvents:(e,{payload:t})=>{e.preChatEvents=t}},extraReducers:e=>{e.addCase(fr.fulfilled,(e=>e)).addCase(dr.fulfilled,((e,{payload:{preChat:t,agentParticipant:n,userParticipant:r,startChatIcon:o}})=>{e.preChatEvents=t.map((e=>({type:"message",payload:e}))),e.agentParticipant=n,e.userParticipant=r,e.startChatIcon=o}))}}),{setConfig:Ko,updateConfig:Jo,setPreChatEvents:Xo}=Go.actions,Qo=Go.reducer;class Yo extends I{constructor(e,...t){super(e,...t),this.name="SeamlyOfflineError",this.langKey="errors.seamlyOffline"}}const Zo={SeamlyGeneralError:D,SeamlyConfigurationError:R,SeamlySessionExpiredError:M,SeamlyOfflineError:Yo,SeamlyUnauthorizedError:L,SeamlyUnavailableError:ur},ei=Qn("catch-error",(e=>({payload:e})));function ti({api:e}){return({getState:t})=>{const n=n=>{const{errorCallback:r,namespace:o,api:i,layoutMode:a}=Or(t()),{error:s,type:c}=n,l=Zo[null==s?void 0:s.name]?new Zo[s.name](s):new I(s);null==r||r(l,{namespace:o,api:i,layoutMode:a,conversationUrl:e.getConversationUrl(),action:c?n:void 0})};return e=>t=>{var r,o,i,a,s,c;try{return(null===(o=null===(r=t.payload)||void 0===r?void 0:r.originalEvent)||void 0===o?void 0:o.payload)?n({error:t.payload,type:null===(s=null===(a=null===(i=t.payload)||void 0===i?void 0:i.originalEvent)||void 0===a?void 0:a.payload)||void 0===s?void 0:s.type}):(null===(c=t.payload)||void 0===c?void 0:c.originalError)&&n({error:t.payload,type:void 0}),e(t)}catch(e){throw n({error:e}),e}}}}const ni={controls:{}},ri={value:"",touched:!1},oi={controls:ri},ii=Zn({name:"forms",initialState:oi,reducers:{registerForm:(e,{payload:{persistData:t,formId:n}})=>{var r;const o=t&&null!==(r=e[n])&&void 0!==r?r:Object.assign(Object.assign({},ni),{persistData:t});e[n]=o},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]:ri}},deregisterControl:(e,{payload:{name:t,formId:n}})=>{const r=e[n];if(!r)return e;if(r.persistData)return e;const o=Object.assign({},r.controls);return delete o[t],Object.assign(Object.assign({},e),{[n]:Object.assign(Object.assign({},r),{controls:o})})},updateControlValue:(e,{payload:{formId:t,name:n,value:r}})=>{var o;(null===(o=e[t])||void 0===o?void 0:o.controls)&&(e[t].controls[n].value=r)},updateControlTouched:(e,{payload:{formId:t,name:n,touched:r}})=>{var o;(null===(o=e[t])||void 0===o?void 0:o.controls[n])&&(e[t].controls[n].touched=r)}},extraReducers:e=>{e.addCase(zr.pending,(()=>oi))}}),{registerForm:ai,deregisterForm:si,registerControl:ci,deregisterControl:li,updateControlValue:ui,updateControlTouched:pi}=ii.actions,di=ii.reducer,fi={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,locale:void 0},hi=Zn({name:"app",initialState:fi,reducers:{setInitialLocale:(e,t)=>{e.initialLocale=t.payload},setTranslations:(e,{payload:t})=>{e.translations=t}},extraReducers:e=>{e.addCase(zr.pending,(()=>fi)).addCase(dr.fulfilled,((e,{payload:t})=>{e.initialLocale=t.locale})).addCase(hr.pending,(e=>{e.isLoading=!0})).addCase(hr.rejected,(e=>{e.isLoading=!1})).addCase(hr.fulfilled,((e,{payload:t})=>{e.isLoading=!1,(null==t?void 0:t.translations)&&(e.locale=t.locale,e.translations=Object.keys(t.translations).sort().reduce(((e,n)=>Object.assign(Object.assign({},e),{[n]:t.translations[n]})),{}))}))}}),{setInitialLocale:yi,setTranslations:mi}=hi.actions,bi=hi.reducer,vi=["SeamlyGeneralError","SeamlyConfigurationError","SeamlySessionExpiredError","SeamlyOfflineError","SeamlyUnauthorizedError","SeamlyUnavailableError"];function gi({api:e}){return()=>t=>n=>{const{payload:r,type:o}=n;if(o===Xr.type){if(!vi.includes(r.name))throw new D(r);"reset"===r.action&&e.disconnect().then((()=>{e.clearStore()}))}return t(n)}}function wi(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 ji(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?wi(Object(n),!0).forEach((function(t){Oi(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):wi(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Oi(e,t,n){return t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function xi({api:e}){return()=>t=>n=>{const r=t(n);switch(n.type){case Bo.toString():e.store.set("options",n.payload);break;case Fo.toString():e.store.set("options",ji(ji({},e.store.get("options")||{}),{},{[n.payload.option]:n.payload.value}))}return r}}const Si=wr((({i18n:e})=>e),(({translations:e})=>e)),_i=wr((({i18n:e})=>e),(({initialLocale:e})=>e)),Ei=wr((({i18n:e})=>e),(({locale:e})=>e)),Ci=wr((({i18n:e})=>e),(({isLoading:e})=>e)),Pi={isActive:!1,currentLocale:void 0,isAvailable:!1,languages:[],containerId:er(),translatedEventGroups:{},translationProposal:null},Ti=(e,t)=>{const n=[...e].reduce(((e,{payload:n},r,o)=>{var i;if(e[t]){if("divider"===(null==n?void 0:n.type)&&(null===(i=null==n?void 0:n.body)||void 0===i?void 0:i.translationEnabled))return o.splice(0),e;e[t].push(n.id)}return n.id===t&&(e[t]=[]),e}),{}),[[r,o]]=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:o}},ki=Zn({name:"translation",initialState:Pi,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}=Ti(t,n);e.lastGroupId=r},disableEventsTranslation:(e,{payload:{events:t,id:n}})=>{const{lastGroupId:r,groupId:o,eventIds:i}=Ti(t,n);e.lastGroupId=r,e.translatedEventGroups[o]=i},disableTranslationProposalPrompt:e=>{e.translationProposal=null},setTranslationProposalPrompt:(e,{payload:t})=>{e.translationProposal=t}},extraReducers:e=>{e.addCase(zr.pending,(()=>Pi)).addCase(dr.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)})).addCase(Co,((e,{payload:t})=>{e.translationProposal=t.translationProposal})).addCase(ao,((e,{payload:t})=>{e.translatedEventGroups[e.lastGroupId]&&e.translatedEventGroups[e.lastGroupId].push(t.payload.id)}))}}),{enableTranslation:Ai,disableTranslation:Ni,enableEventsTranslation:Ii,disableEventsTranslation:Ri,setTranslationProposalPrompt:Di,disableTranslationProposalPrompt:Mi}=ki.actions,Li=ki.reducer;function Ui({dispatch:e,getState:t}){return n=>r=>{const o=n(r),{payload:i}=r;switch(r.type){case Co.type:i?.translation?.enabled&&(e(Ai(i.translation.locale)),e(hr(i.translation.locale)));break;case dr.fulfilled.type:i.locale&&e(hr(i.locale));break;case Po.type:i?.translation?.enabled&&(e(Ai(i.translation.locale)),e(hr(i.locale)));break;case ao.type:"info"===i.type&&"new_translation"===i?.payload?.body?.subtype&&i.payload.body.translationEnabled&&e(hr(i.payload.body.translationLocale));break;case Ni.type:const n=_i(t());e(hr(n))}return o}}const Fi=Zn({name:"visibility",initialState:{visibility:S.initialize,showInlineView:!1},reducers:{setShowInlineView:e=>{e.showInlineView=!0}},extraReducers:e=>{e.addCase(Ur.fulfilled,((e,{payload:t})=>{t&&(e.visibility=t)})).addCase(dr.fulfilled,((e,{payload:t})=>{t.connectWhenInView||(e.showInlineView=!t.connectWhenInView)}))}}),{setShowInlineView:Bi}=Fi.actions,$i=Fi.reducer,zi=mt,Hi=()=>{const e=zi(),t=ct(Dr),n=!!t&&t!==S.hidden,r=t===S.open,o=t===S.minimized,i=(0,Qe.useCallback)((t=>e(Ur(t))),[e]);return{isVisible:n,isOpen:r,isMinimized:o,visible:t,setVisibility:i,openChat:()=>{i(S.open)},closeChat:()=>{i(S.minimized)}}},Vi=({freezeOnceVisible:e=!1,enabled:t=!0,containerRef:n=(0,Xe.createRef)()})=>{const[r,o]=(0,Qe.useState)(null),i=!!(null==r?void 0:r.isIntersecting)||!t,a=i&&e,s=([e])=>o(e);return(0,Qe.useEffect)((()=>{const e=null==n?void 0:n.current;if(!window.IntersectionObserver||a||!e||!t)return()=>{};const r=new IntersectionObserver(s,{threshold:0,root:null,rootMargin:"0%"});return r.observe(e),()=>r.disconnect()}),[n,t,a]),{isVisible:i,containerRef:n}},qi=()=>(0,Qe.useContext)(vt),Wi=()=>qi().store||{},Gi=()=>{const e=qi();return(0,Qe.useCallback)((()=>e.hasConversation()),[e])};function Ki(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 Ji(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ki(Object(n),!0).forEach((function(t){Xi(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ki(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Xi(e,t,n){return t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Qi=()=>{const e=qi(),t=xr(),n=mt(),r=(0,Qe.useContext)(gt),o=Hr(),i=Gi(),{visible:a,setVisibility:s}=Hi(),c=kr(),p=(0,Qe.useCallback)(((...e)=>{r.emit(...e)}),[r]),d=(0,Qe.useCallback)((()=>{e.sendContext(t.context||{}),p("ui.beforeStart",{visibility:a,hasConversation:i(),hasResponded:o,unreadMessageCount:c}),e.send("start"),p("ui.start",{visibility:a,hasConversation:i(),hasResponded:o,unreadMessageCount:c})}),[e,t.context,p,i,o,c,a]),f=(0,Qe.useCallback)((async()=>{n(zr())}),[n]),h=(0,Qe.useCallback)((e=>({type:e,id:J(),transactionId:J(),participant:P,fromClient:!0,occurredAt:1e3*Date.now(),meta:{}})),[]),y=(0,Qe.useCallback)((e=>Ji(Ji({},h("text")),{},{body:{text:e}})),[h]),m=(0,Qe.useCallback)((({body:t,config:r={}})=>{if(""===t.trim())return;const o=Ji(Ji({},y(t)),r);e.send("message",o),p("message",o),n(ao({type:"message",payload:Ji(Ji({},o),{},{optimisticallyInjected:!0})}))}),[e,n,p,y]),b=(0,Qe.useCallback)(((e,t=J())=>{n(ao({type:"message",payload:Ji(Ji({},y(e)),{},{transactionId:t})}))}),[n,y]),v=(0,Qe.useCallback)(((e,t,r,o,i,a,s)=>{n(ao({type:"message",payload:{type:"upload",id:e,transactionId:t,participant:P,fromClient:!0,occurredAt:r,meta:{},body:{contentType:o,filename:i,filesize:a,url:s}}}))}),[n]),g=(0,Qe.useCallback)(((e,t=J())=>{const r={body:{subtype:e,type:"divider"},fromClient:!1,fromHistory:!0,id:J(),transactionId:t,type:"divider"};n(ao({type:"info",payload:r}))}),[n]),w=(0,Qe.useCallback)((t=>{if(!t)return;e.send("action",t);const{type:n}=t;n!==l&&n!==u&&p(`action.${n}`,t)}),[e,p]),j=(0,Qe.useCallback)((t=>{e.sendContext(t)}),[e]),O=(0,Qe.useCallback)((()=>e.connected?Promise.reject(new Error("The API is already connected")):e.connect().then((e=>{e&&(n(Po(e)),e.userResponded&&(n(Wr(e.userResponded)),s(S.open)))})).catch((e=>{n(Xr({name:e?.name,message:e?.message,langKey:e?.langKey,action:e?.action,originalEvent:e?.originalEvent,originalError:e?.originalError}))}))),[e,n,s]);return{connect:O,start:d,sendMessage:m,sendAction:w,sendContext:j,reset:f,emitEvent:p,addMessageBubble:b,addUploadBubble:v,addDivider:g,apiConnected:e.connected,apiConfigReady:e.configReady}};function Yi(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 Zi(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,s=[],c=!0,l=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=i.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,o=e}finally{try{if(!c&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(l)throw o}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Yi(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)?Yi(e,t):void 0}}(e,t)||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.")}()}function ea(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ta(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,wn(r.key),r)}}function na(e){return e.reduce((function(e,t){return e.concat(Array.isArray(t)?na(t):t)}),[])}function ra(e){var t={};return function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];var i=r.length?r.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(t,i))return t[i];var a=e.apply(void 0,r);return t[i]=a,a}}function oa(e){for(var t=function(e){return/\s/.test(e)},n=[],r={},o=0,i=null,a=!1,s=0;s<e.length;){if(a&&(t(e[s])||"{"===e[s]))a=!1,i=e.slice(o,s),"{"===e[s]&&s--;else if(!a&&!t(e[s])){var c="{"===e[s];if(i&&c){var l=ia(e,s);if(-1===l)throw new Error('Unbalanced curly braces in string: "'.concat(e,'"'));r[i]=e.slice(s+1,l),s=l,i=null}else i&&(n.push(i),i=null),a=!0,o=s}s++}return a&&(i=e.slice(o)),i&&n.push(i),{args:n,cases:r}}function ia(e,t){for(var n=0,r=t+1;r<e.length;r++){var o=e.charAt(r);if("}"===o){if(0===n)return r;n--}else"{"===o&&n++}return-1}function aa(e){return sa(e.slice(1,-1),",",3)}function sa(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 o=e.indexOf(t);if(-1===o)return r.push(e),r;var i=e.substring(0,o).trim(),a=e.substring(o+t.length+1).trim();return r.push(i),sa(a,t,n-1,r)}var ca;function la(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 ua(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?la(Object(n),!0).forEach((function(t){jn(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):la(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var pa=0,da="other";function fa(e,t){for(var n=0,r="",o=0,i={};n<e.length;){if("#"!==e[n]||o)r+=e[n];else{var a="__hashToken".concat(pa++);r+="{".concat(a,", number}"),i[a]=t}"{"===e[n]?o++:"}"===e[n]&&o--,n++}return{caseBody:r,numberValues:i}}var ha="other";const ya=new(function(){function e(t){var n=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};ea(this,e),jn(this,"format",ra((function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return na(n.process(e,t)).join("")}))),this.locale=t,this.typeHandlers=r}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=e.indexOf("{");if(-1!==n){var r=ia(e,n);if(-1===r)throw new Error('Unbalanced curly braces in string: "'.concat(e,'"'));var o=e.substring(n,r+1);if(o){var i=[],a=e.substring(0,n);a&&i.push(a);var s=aa(o),c=Zi(s,3),l=c[0],u=c[1],p=c[2],d=t[l];null==d&&(d="");var f=u&&this.typeHandlers[u];i.push(f?f(d,p,this.locale,t,this.process.bind(this)):d);var h=e.substring(r+1);return h&&i.push(this.process(h,t)),i}}return[e]}}],n&&ta(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),e}())("en-GB",{plural:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0,o=arguments.length>4?arguments[4]:void 0,i=oa(t),a=i.args,s=i.cases,c=parseInt(e);a.forEach((function(e){e.startsWith("offset:")&&(c-=parseInt(e.slice("offset:".length)))}));var l=[];if("PluralRules"in Intl){void 0!==ca&&ca.resolvedOptions().locale===n||(ca=new Intl.PluralRules(n));var u=ca.select(c);u!==da&&l.push(u)}1===c&&l.push("one"),l.push("=".concat(c),da);for(var p=0;p<l.length;p++){var d=l[p];if(d in s){var f=fa(s[d],c),h=f.caseBody,y=f.numberValues;return o(h,ua(ua({},r),y))}}return e},select:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>3?arguments[3]:void 0,r=arguments.length>4?arguments[4]:void 0,o=oa(t),i=o.cases;return e in i?r(i[e],n):ha in i?r(i[ha],n):e}});function ma(){const e=ct(Si),t=ct(Ei),n=ct(_i),r=ct(Ci),o=(0,Qe.useCallback)(((n,o={})=>{const i=e[n];return i?ya.format(i,o):(r||console.warn(`Translation key: ${n} is missing in locale: ${t}`),null)}),[e,t,r]);return{t:o,locale:t,initialLocale:n}}const ba=(0,Xe.createContext)(null),va=()=>{const e=(0,Qe.useContext)(ba);return{sendPolite:(0,Qe.useCallback)((t=>{t&&e({ariaLive:g,messageText:t})}),[e]),sendAssertive:(0,Qe.useCallback)((t=>{t&&e({ariaLive:v,messageText:t})}),[e])}},ga=wr((({interrupt:e})=>e),(({error:e})=>e)),wa=wr(ga,(e=>Boolean(e)));function ja(){const{t:e}=ma(),t=ct(ga),n=ct(wa),r=(0,Qe.useMemo)((()=>{if(!n)return{title:void 0,message:void 0,srText:void 0,buttonText:void 0,originalError:void 0};const{langKey:r,action:o}=t,i=e(`${r}.title`),a=e(`${r}.message`),s=e(`${r}.srText`),c=e(`${r}.buttonText`);return Object.assign(Object.assign(Object.assign(Object.assign({},r?{title:i,message:a,srText:s}:{}),o?{action:o}:{}),o&&r?{buttonText:c}:{}),{originalError:t})}),[n,t,e]);return{hasError:n,meta:r,error:t}}const Oa=()=>{const e=Pr(),{t}=ma(),{isInline:n,isWindow:r,isApp:o}=Rr(),{isOpen:i,isVisible:a}=Hi(),s=ct(Mr),c=mt(),l=(0,Qe.useRef)(null),{start:u,connect:p,apiConfigReady:d,apiConnected:f}=Qi(),h=Gi(),y=(0,Qe.useRef)(!1),{sendAssertive:m}=va();!function(){const{meta:{originalError:e,action:t}}=ja(),n=Qi(),r="SeamlySessionExpiredError"===(null==e?void 0:e.name);(0,Qe.useEffect)((()=>{r&&n[t]&&n[t]()}),[t,n,r])}(),(0,Qe.useEffect)((()=>{a&&setTimeout((()=>{m(t("window.srTexts.onLoad"))}),500)}),[a,m,t]),(0,Qe.useEffect)((()=>{a&&m(t(i?"window.srTexts.onOpen":"window.srTexts.onClose"))}),[i,a,m,t]),(0,Qe.useEffect)((()=>(l.current=setTimeout((()=>{c(To(!0))}),500),()=>{clearTimeout(l.current)})),[c]),(0,Qe.useEffect)((()=>(e.length&&(l.current=setTimeout((()=>{c(To(!1))}),5e3)),()=>{clearTimeout(l.current)})),[e,c]),(0,Qe.useEffect)((()=>{d&&f||(y.current=!1)}),[d,f]);const b=(0,Qe.useCallback)((()=>function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))}(void 0,void 0,void 0,(function*(){f||(y.current=!0,yield p()),(o||i||a&&n)&&u()}))),[f,p,o,n,i,a,u]);(0,Qe.useEffect)((()=>{!d||y.current||r&&!i||!(!n||a&&s)||(h()&&i&&(clearTimeout(l.current),c(To(!1))),b())}),[d,b,c,h,n,i,r,a,s])},xa=({children:e})=>(Oa(),(0,k.jsx)(k.Fragment,{children:e})),Sa=(0,Xe.createContext)({}),_a=()=>xr().appContainerClassNames,Ea=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},Ca=(e=0)=>new Promise((t=>{setTimeout(t,e)})),Pa=()=>{const{seamlyContainerElement:e}=_r(),t=mt();return[e,(0,Qe.useCallback)((e=>{t(No(e))}),[t])]},Ta=e=>(0,Qe.useCallback)((()=>{var t;t=e,requestAnimationFrame((async()=>{await Ca(180);const e="string"==typeof t?document.getElementById(t):t;q(e)}))}),[e]),ka=()=>{const e=Ar();return Ta(e)},Aa=(0,Xe.createContext)({});function Na(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 Ia(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Na(Object(n),!0).forEach((function(t){Ra(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Na(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Ra(e,t,n){return t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Da=()=>{const{showFileUpload:e,entryMeta:{options:t,optionsOverride:n},options:{features:{uploads:r}}}=_r(),{allowedMimeTypes:o,maxSize:i}=n.upload||{},{enabled:a,enabledFromEntry:s}=r||{},{allowedMimeTypes:c,maxSize:l}=Ia(Ia(Ia({},t.upload||{allowedMimeTypes:[],maxSize:0}),o?{allowedMimeTypes:o}:{}),i?{maxSize:i}:{});return{showFileUpload:e,accountAllowsUploads:!!r,serviceAllowsUploads:s||a,allowedMimeTypes:c,maxSize:l}},Ma=()=>{const{currentUploads:e}=_r(),t=mt(),n=(0,Qe.useContext)(Aa);return{uploadFile:(0,Qe.useCallback)((e=>{n(e)}),[n]),clearUploads:(0,Qe.useCallback)((()=>{t(so())}),[t]),currentUploads:e,isUploading:e.some((e=>e.uploading)),isComplete:e.every((e=>e.complete))}};function La(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 Ua(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?La(Object(n),!0).forEach((function(t){Fa(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):La(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Fa(e,t,n){return t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Ba=()=>{const{t:e}=ma(),{options:t}=_r(),{panelActive:n,optionActive:r,userSelectedOptions:o,features:i}=t,{extraMenuItem:a,sendTranscript:s}=i,c={extraMenuItem:a,sendTranscript:s},l=t=>"extraMenuItem"===t?"Extra menu item":e(`options.${t}.menuTitle`),u=Object.keys(c).filter((e=>c[e])).map((e=>({name:e,title:l(e),available:c[e].enabled}))),p=a||s,d=mt(),{get:f,set:h}=Wi();return{allowOptionSelection:p,userSelectedOptions:o,features:i,menuOptions:u,initUserSelectedOptions:(0,Qe.useCallback)((()=>{const e=f("options")||{};d(Bo(e))}),[f,d]),setUserSelectedOptions:(0,Qe.useCallback)((e=>{d(Bo(e)),h("options",e)}),[h,d]),setUserSelectedOption:(0,Qe.useCallback)(((e,t)=>{const n=f("options")||{};h("options",Ua(Ua({},n),{},{[e]:t})),d(Fo({option:e,value:t}))}),[d,f,h]),showOption:e=>{d($o(e))},hideOption:()=>{d(ho())},panelActive:n,optionActive:r}},$a=()=>{const{optionsButtonId:e}=_r();return{id:e,focusButton:Ta(e)}},za=(0,Xe.createContext)(null),Ha=()=>(0,Qe.useContext)(za);function Va(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 qa(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Va(Object(n),!0).forEach((function(t){Wa(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Va(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Wa(e,t,n){return t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Ga=()=>{const e=mt(),{idleDetachCountdown:t}=_r(),{isOpen:n}=Hi(),r=(0,Qe.useRef)({});r.current={hasCountdown:t.hasCountdown,isActive:t.isActive,remaining:t.remaining,wasStopped:t.wasStopped,isOpen:n};const{emitEvent:o,sendAction:i}=Qi(),{t:a}=ma(),{sendAssertive:s,sendPolite:c}=va(),l=(0,Qe.useCallback)((e=>{const{isOpen:t}=r.current;t&&s(e)}),[s]),u=(0,Qe.useCallback)((e=>{const{isOpen:t}=r.current;t&&c(e)}),[c]),d=(0,Qe.useCallback)((t=>{const n=(e=>Math.ceil(e/1e3))(t),r=B(n);e(yo({delaySeconds:n,delayTime:r})),o("idleTimer.start"),l(`${a("idleDetachWarning.countdownTitle")} ${a("idleDetachWarning.countdownText")} ${a("idleDetachWarning.countdownTimer",r)}`)}),[e,o,l,a]),f=(0,Qe.useCallback)(((t,n)=>{const{hasCountdown:s,wasStopped:c}=r.current;s&&(t||(n||i({type:p}),l(a("idleDetachWarning.notifyTransferText"))),c||o("idleTimer.stop"),e(uo()))}),[e,i,o,l,a]),h=(0,Qe.useCallback)((()=>{const{remaining:t}=r.current;if(t<=0)return;const n=t-1;n%10==0&&l(`${a("idleDetachWarning.countdownText")} ${a("idleDetachWarning.countdownTimer",B(n))}`),e(fo())}),[e,l,a]),y=(0,Qe.useCallback)((()=>{const{isActive:t,remaining:n}=r.current;t&&(e(zo()),n&&(o("idleTimer.stop"),u(a("idleDetachWarning.srCountDownStoppedText"))))}),[e,o,u,a]);return qa(qa({},t),{},{initCountdown:d,endCountdown:f,decrementCountdown:h,stopCountdown:y})},Ka=()=>{const e=mt(),t=_r().resumeConversationPrompt,{sendAction:n}=Qi(),{t:r}=ma(),{sendAssertive:o}=va();return{continueChat:()=>{n({type:d,body:{type:"resume_conversation_prompt"}}),e(po())},hasPrompt:t,restartChat:()=>{o(r("resumeConversationPrompt.srNotifyRestartText")),n({type:p}),e(po())}}},Ja=()=>{const[e]=(0,Qe.useState)((()=>J()));return e},Xa=e=>{const t=(0,Qe.useRef)(null);t.current=e;const n="function"==typeof e;return(0,Qe.useMemo)((()=>n?(...e)=>t.current(...e):void 0),[n])};function Qa(){const{sendAction:e}=Qi(),t=mt(),n=(0,Qe.useCallback)(((n,r="translation_choice")=>{e({type:h,body:{enabled:!0,locale:n,source:r}}),t(Ai(n)),t(Mi())}),[e,t]),r=(0,Qe.useCallback)((()=>{e({type:h,body:{enabled:!1}}),t(Ni())}),[e,t]),{languages:o,isActive:i,isAvailable:a,currentLocale:s}=ct((({translations:e})=>e));return{languages:o,isActive:i,isAvailable:a,currentLocale:s,enableTranslations:n,disableTranslations:r}}function Ya(e){const{translatedBody:t,body:n}=e.payload?"participant"===e.type?{body:null===(r=e.payload)||void 0===r?void 0:r.participant.introduction,translatedBody:null===(i=null===(o=e.payload)||void 0===o?void 0:o.participant)||void 0===i?void 0:i.translatedIntroduction}:{body:e.payload.body,translatedBody:e.payload.translatedBody}:{body:void 0,translatedBody:void 0};var r,o,i;const a=!!t,s=ct((e=>wr((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)})))))(e));return{body:a&&s?null==t?void 0:t.data:n,hasTranslation:a,isTranslated:s&&a,locale:null==t?void 0:t.locale}}function Za(){const e=ct((({translations:e})=>e.containerId));return{id:e,focusContainer:Ta(e)}}function es(e){const{languages:t}=Qa();return(0,Qe.useMemo)((()=>{var n;return null===(n=null==t?void 0:t.find((t=>t.locale===e)))||void 0===n?void 0:n.nativeName}),[e,t])}const ts=({eventPayload:e})=>{const{t}=ma(),{fromClient:n,participant:r}=e,o=(e=>_r().participantInfo.participants[e])(r)||{},{messages:i}=xr(),a=n?t("participants.user.name"):o&&o.name,{showAvatar:s,showName:c}=i[n?"user":"agent"]||{};if(!s&&!c)return null;const l=[];return s&&a&&o.avatar&&l.push((0,k.jsx)("span",{className:T("message__avatar"),children:(0,k.jsx)("img",{src:o.avatar,className:T("avatar"),alt:""})})),c&&l.push((0,k.jsx)("span",{className:T("message__author-name"),children:a})),l.length>0&&(0,k.jsx)("div",{className:T("message__author"),children:l})},ns=["showParticipant","event","type","modifiers","children","bodyProps","info"];function rs(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 os(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?rs(Object(n),!0).forEach((function(t){is(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):rs(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function is(e,t,n){return t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const as=function(e){let{showParticipant:t=!0,event:n,type:r,modifiers:o,children:i,bodyProps:a={},info:s}=e,c=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,ns);const l=Ea(n),{hasTranslation:u,isTranslated:p,locale:d}=Ya(n);return r&&l.push(`message--type-${r}`),o&&("string"==typeof o&&(o=o.split(" ").filter((e=>e.length))),o.forEach((e=>{l.push(`message--${e}`)}))),p&&l.push("message--is-translated"),u&&l.push("message--has-translation"),p&&(a=os(os({},a),{},{lang:d})),(0,k.jsx)(k.Fragment,{children:(0,k.jsxs)("div",os(os({className:T(l)},c),{},{children:[t&&(0,k.jsx)(ts,{eventPayload:n.payload}),(0,k.jsx)("div",os(os({className:T("message__body")},a),{},{children:i})),s&&(0,k.jsx)("div",{"aria-hidden":"true",className:T("message__info"),children:s})]}))})};function ss(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 cs(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ss(Object(n),!0).forEach((function(t){ls(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ss(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function ls(e,t,n){return t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const us=({id:e,action:t,buttonText:n,description:r,hasFocus:o,image:i,title:a,isCarouselItem:s})=>{const c=(0,Qe.useRef)(null),{sendMessage:l,sendAction:u,emitEvent:p}=Qi(),d=Ja(),h=(0,Qe.useRef)(),m=t.type===O?"a":"button",b=(0,Qe.useCallback)((()=>p("action.click_card",{type:y,originMessage:e,action:t})),[p,e,t]),v=(0,Qe.useCallback)((()=>{if(b(),"ask"===t.type)l({body:t.ask});else if("topic"===t.type){const{topic:e,fallbackMessage:n}=t;u({type:f,body:{name:e,fallbackMessage:n}})}}),[l,t,u,b]),g=(0,Qe.useMemo)((()=>t.type===O?{href:t.link,rel:"noopener noreferrer",target:t.newTab?"_blank":"_self",onClick:b}:{onClick:v}),[t,v,b]);return(0,Qe.useEffect)((()=>{s&&(o&&h.current?window.requestAnimationFrame((()=>c.current.focus())):c.current.blur()),h.current=!0}),[o,s]),(0,k.jsxs)("div",{className:T("card__wrapper"),id:e,tabIndex:"-1",ref:c,children:[(0,k.jsx)("img",{className:T("card__image"),src:i,alt:""}),(0,k.jsxs)("div",{className:T("card__content"),id:e,children:[a&&(0,k.jsx)("h2",{className:T("card__title"),children:a}),r&&(0,k.jsx)("div",{className:T("card__description"),dangerouslySetInnerHTML:{__html:r}}),(0,k.jsx)(m,cs(cs({tabIndex:s&&!o?"-1":void 0,className:T("button","button--primary"),"aria-describedby":d},g),{},{children:n}))]})]})};function ps(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 ds(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ps(Object(n),!0).forEach((function(t){fs(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ps(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function fs(e,t,n){return t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function hs(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 ys(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?hs(Object(n),!0).forEach((function(t){ms(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):hs(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function ms(e,t,n){return t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function bs({item:e,items:t,index:n,isActive:r}){const{t:o}=ma();return(0,k.jsx)("div",{className:T("carousel-item",`carousel-item--${e.type}`),role:"group","aria-roledescription":"slide","aria-label":o("carousel.slide.label",{index:n+1,total:t.length}),children:(0,k.jsx)(us,ys(ys({},e),{},{isCarouselItem:!0,hasFocus:r}))})}const vs={send32:'<svg xmlns="http://www.w3.org/2000/svg" width="32px" height="32px" x="0px" y="0px" viewBox="0 0 32 32"><defs/><path fill="#4A48C1" d="M6.714,14.985l17.837-7.906c0.681-0.302,1.414,0.301,1.25,1.027L22.273,23.59\tc-0.13,0.566-0.751,0.865-1.275,0.613l-3.623-1.752l-2.334,2.287c-0.572,0.562-1.538,0.156-1.538-0.645V21.01\tc0-0.217,0.078-0.43,0.222-0.594l7.676-8.841l-10.414,7.472l-4.351-2.445C5.987,16.236,6.033,15.287,6.714,14.985L6.714,14.985z"/></svg>',balloon32:'<svg xmlns="http://www.w3.org/2000/svg" width="32px" height="32px" x="0px" y="0px" viewBox="0 0 32 32"><defs/><path fill="#4A48C1" d="M24,10.824v10.375c0,1.104-0.896,2-2,2h-4.694l-4.931,3.625v-3.625H10c-1.104,0-2-0.896-2-2V10.824\tc0-1.104,0.896-2,2-2h12C23.104,8.824,24,9.719,24,10.824z"/></svg>',newTopic32:'<svg xmlns="http://www.w3.org/2000/svg" width="32px" height="32px" x="0px" y="0px" viewBox="0 0 32 32"><path fill="#4A48C1" d="M16,8.593l2.407,4.573l5.093,0.876l-3.604,3.702l0.74,5.115L16,20.574l-4.634,2.285l0.739-5.115L8.5,14.042\tl5.094-0.876L16,8.593z"/></svg>',newTranslation16:'<svg xmlns="http://www.w3.org/2000/svg" x="0px" y="0px" viewBox="0 0 16 16"><path fill="#4A48C1" d="M8,0C3.6,0,0,3.6,0,8s3.6,8,8,8s8-3.6,8-8S12.4,0,8,0z M14.1,7.1h-1.4c-0.1-1.5-0.4-2.9-1-4\tC13,4,13.9,5.4,14.1,7.1z M7.1,2.1v5H5C5.2,4.7,6.1,2.9,7.1,2.1z M7.1,8.9v5c-1-0.7-1.9-2.5-2.1-5H7.1z M8.9,13.9v-5H11\tC10.8,11.3,9.9,13.2,8.9,13.9z M8.9,7.1v-5c1,0.7,1.9,2.5,2.1,5H8.9z M4.2,3.1c-0.5,1.1-0.9,2.5-1,4H1.9C2.1,5.4,3,4,4.2,3.1z M1.9,8.9h1.4c0.1,1.5,0.4,2.9,1,4C3,12,2.1,10.5,1.9,8.9z M11.8,12.9c0.5-1.1,0.9-2.5,1-4h1.4C13.9,10.5,13,12,11.8,12.9z"/></svg>',newTranslation32:'<svg xmlns="http://www.w3.org/2000/svg" x="0px" y="0px" viewBox="0 0 32 32"><path fill="#4A48C1" d="M16,7c-4.9,0-9,4.1-9,9s4.1,9,9,9s9-4.1,9-9S20.9,7,16,7z M22.9,15h-1.6c-0.1-1.7-0.5-3.3-1.1-4.5\tC21.6,11.5,22.6,13.1,22.9,15z M15,9.4V15h-2.3C12.9,12.3,13.9,10.2,15,9.4z M15,17v5.6c-1.1-0.8-2.1-2.9-2.3-5.6H15z M17,22.6V17\th2.3C19.1,19.8,18.1,21.8,17,22.6z M17,15V9.4c1.1,0.8,2.1,2.9,2.3,5.6H17z M11.8,10.4c-0.6,1.3-1,2.8-1.1,4.5H9.1\tC9.4,13.1,10.4,11.5,11.8,10.4z M9.1,17h1.6c0.1,1.7,0.5,3.3,1.1,4.5C10.4,20.5,9.4,18.9,9.1,17z M20.2,21.5c0.6-1.3,1-2.8,1.1-4.5\th1.6C22.6,18.8,21.6,20.5,20.2,21.5z"/></svg>',avatar32:'<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"\n\t viewBox="0 0 32 32" enable-background="new 0 0 32 32" xml:space="preserve">\n<path fill="#4A48C1" d="M10,14.8c-1.1,0-2-0.9-2-2s0.9-2,2-2s2,0.9,2,2S11.1,14.8,10,14.8z M15.9,14.8c1.1,0,2-0.9,2-2s-0.9-2-2-2\n\ts-2,0.9-2,2S14.8,14.8,15.9,14.8z M21.8,10.8c-1.1,0-2,0.9-2,2s0.9,2,2,2s2-0.9,2-2S22.9,10.8,21.8,10.8z M21.3,18.1H10.7\n\tC11.7,23.9,20.2,23.9,21.3,18.1z"/>\n</svg>\n',chevronDown8:'<svg xmlns="http://www.w3.org/2000/svg" width="8px" height="8px" x="0px" y="0px" viewBox="0 0 8 8"><defs/><path fill="#4A48C1" d="M-0.001,2.876c0-0.247,0.091-0.494,0.273-0.688c0.38-0.401,1.013-0.418,1.414-0.039l1.938,1.834\tc0.199,0.188,0.547,0.188,0.746,0L6.31,2.15c0.401-0.379,1.034-0.362,1.414,0.04c0.379,0.401,0.361,1.034-0.04,1.414L5.745,5.437\tC4.782,6.35,3.213,6.35,2.249,5.436L0.311,3.603C0.103,3.406-0.001,3.142-0.001,2.876z"/></svg>',chevronDown32:'<svg xmlns="http://www.w3.org/2000/svg" width="32px" height="32px" x="0px" y="0px" viewBox="0 0 32 32"><defs/><path fill="#4A48C1" d="M16,20.425c-0.782,0-1.563-0.291-2.159-0.874l-6.541-6.408c-0.395-0.387-0.401-1.02-0.015-1.414\tc0.387-0.394,1.021-0.4,1.414-0.015l6.541,6.408c0.42,0.409,1.102,0.409,1.52-0.001l6.541-6.407c0.396-0.386,1.028-0.38,1.414,0.015\tc0.387,0.395,0.381,1.027-0.014,1.414l-6.541,6.407C17.563,20.133,16.782,20.425,16,20.425z"/></svg>',chevronRight8:'<svg xmlns="http://www.w3.org/2000/svg" width="8px" height="8px" x="0px" y="0px" viewBox="0 0 8 8"><defs/><path fill="#4A48C1" d="M2.875,7.998c-0.247,0-0.494-0.091-0.688-0.273c-0.401-0.38-0.418-1.013-0.039-1.414l1.834-1.938\tc0.188-0.199,0.188-0.547,0-0.746l-1.835-1.94c-0.379-0.401-0.362-1.034,0.04-1.414s1.034-0.361,1.414,0.04l1.834,1.939\tc0.913,0.963,0.913,2.532-0.001,3.496L3.601,7.686C3.405,7.894,3.14,7.998,2.875,7.998z"/></svg>',chevronRight16:'<svg xmlns="http://www.w3.org/2000/svg" width="16px" height="16px" x="0px" y="0px" viewBox="0 0 16 16"><defs/><path fill="#4A48C1" d="M6.5,13c-0.247,0-0.494-0.091-0.687-0.273c-0.401-0.38-0.419-1.013-0.04-1.414L8.22,8.727\tc0.373-0.394,0.373-1.06,0-1.454L5.773,4.687c-0.379-0.401-0.362-1.034,0.04-1.414c0.4-0.378,1.034-0.362,1.414,0.04l2.446,2.586\tc1.096,1.159,1.096,3.043,0,4.203l-2.446,2.586C7.03,12.896,6.765,13,6.5,13z"/></svg>',close8:'<svg xmlns="http://www.w3.org/2000/svg" width="8px" height="8px" x="0px" y="0px" viewBox="0 0 8 8"><defs/><path fill="#4A48C1" d="M7.705,7.729C7.511,7.923,7.255,8.02,7,8.02c-0.257,0-0.514-0.099-0.709-0.295L4,5.423L1.709,7.725\tC1.513,7.921,1.257,8.02,1,8.02c-0.255,0-0.51-0.097-0.706-0.291c-0.391-0.39-0.393-1.022-0.003-1.414l2.298-2.309l-2.27-2.28\tC-0.07,1.334-0.068,0.701,0.323,0.311c0.392-0.389,1.024-0.387,1.415,0.003L4,2.587l2.263-2.274C6.653-0.077,7.287-0.079,7.677,0.31\tC8.068,0.7,8.07,1.333,7.681,1.725l-2.27,2.281l2.298,2.309C8.099,6.705,8.097,7.339,7.705,7.729z"/></svg>',close16:'<svg xmlns="http://www.w3.org/2000/svg" width="16px" height="16px" x="0px" y="0px" viewBox="0 0 16 16"><defs/><path fill="#4A48C1" d="M12.709,11.295L9.411,7.982l3.262-3.276c0.39-0.392,0.388-1.024-0.004-1.414\tc-0.39-0.39-1.023-0.388-1.414,0.003L8,6.564L4.746,3.295C4.357,2.904,3.724,2.903,3.332,3.292C2.94,3.682,2.939,4.315,3.329,4.707\tl3.261,3.275l-3.298,3.313c-0.39,0.391-0.388,1.024,0.003,1.414C3.49,12.903,3.745,13,4,13c0.257,0,0.513-0.099,0.708-0.295L8,9.399\tl3.291,3.306C11.486,12.901,11.743,13,12,13c0.255,0,0.511-0.097,0.705-0.291C13.097,12.319,13.099,11.686,12.709,11.295z"/></svg>',enlarge32:'<svg xmlns="http://www.w3.org/2000/svg" width="32px" height="32px" x="0px" y="0px" viewBox="0 0 32 32"><defs/><path fill="#4A48C1" d="M24,9v6.5c0,0.552-0.447,1-1,1s-1-0.448-1-1v-4.086L11.414,22H15.5c0.552,0,1,0.447,1,1s-0.448,1-1,1H9\tc-0.13,0-0.26-0.026-0.382-0.077c-0.245-0.102-0.439-0.296-0.541-0.541C8.026,23.26,8,23.13,8,23v-6.5c0-0.552,0.448-1,1-1\ts1,0.448,1,1v4.085L20.586,10H16.5c-0.552,0-1-0.448-1-1s0.448-1,1-1H23c0.13,0,0.26,0.026,0.382,0.077\tc0.245,0.102,0.439,0.296,0.541,0.541C23.974,8.74,24,8.87,24,9z"/></svg>',options32:'<svg xmlns="http://www.w3.org/2000/svg" width="32px" height="32px" x="0px" y="0px" viewBox="0 0 32 32"><defs/><path fill="#4A48C1" d="M26.1,21.383c0.334-0.625,0.602-1.279,0.812-1.949L32,18.609V13.51l-5.058-0.846\tc-0.208-0.67-0.468-1.325-0.795-1.956l3.009-4.145l-3.604-3.634L21.38,5.903c-0.626-0.333-1.276-0.602-1.948-0.81L18.609,0\tl-5.098,0.001l-0.847,5.061c-0.669,0.203-1.326,0.465-1.957,0.794L6.562,2.847L2.929,6.449l2.973,4.171\tC5.569,11.247,5.3,11.9,5.091,12.569L0,13.373v5.099l5.06,0.866c0.204,0.669,0.467,1.324,0.796,1.955l-3.009,4.146l3.601,3.635\tl4.171-2.975c0.627,0.335,1.282,0.603,1.951,0.811L13.372,32h5.118l0.849-5.057c0.668-0.207,1.323-0.469,1.953-0.795l4.144,3.01\tl3.639-3.604L26.1,21.383z M19.01,19.035c-1.675,1.663-4.381,1.652-6.041-0.025c-1.662-1.675-1.649-4.381,0.024-6.042\tc1.676-1.661,4.382-1.648,6.043,0.025C20.699,14.67,20.686,17.377,19.01,19.035z"/></svg>',file32:'<svg xmlns="http://www.w3.org/2000/svg" xml:space="preserve" x="0px" y="0px" version="1.1" viewBox="0 0 32 32"><path fill="#4A48C1" d="M16,28.5c-3.6,0-6.5-3-6.5-6.6V9.6c0-0.6,0.4-1,1-1s1,0.4,1,1v12.3c0,2.5,2,4.6,4.5,4.6\tc2.5,0,4.5-2.1,4.5-4.6V8.3c0-1.5-1.2-2.8-2.7-2.8c-1.5,0-2.7,1.3-2.7,2.8v13.5c0,0.6,0.5,1.1,1,1.1c0.6,0,1-0.5,1-1.1v-10\tc0-0.6,0.4-1,1-1s1,0.4,1,1v10c0,1.7-1.4,3.1-3,3.1s-3-1.4-3-3.1V8.3c0-2.6,2.1-4.8,4.7-4.8c2.6,0,4.7,2.2,4.7,4.8v13.6\tC22.5,25.5,19.6,28.5,16,28.5z"/></svg>',upload32:'<svg xmlns="http://www.w3.org/2000/svg" width="32px" height="32px" x="0px" y="0px" viewBox="0 0 32 32"><defs/><path fill="#4A48C1" d="M9.488,13.481c-0.391-0.391-0.391-1.023,0-1.414l5.805-5.805c0.026-0.026,0.06-0.036,0.088-0.058\tc0.073-0.06,0.146-0.119,0.235-0.156c0.246-0.103,0.522-0.103,0.769,0c0.093,0.039,0.171,0.101,0.249,0.165\tc0.023,0.02,0.053,0.027,0.074,0.049l5.805,5.805c0.391,0.391,0.391,1.023,0,1.414c-0.195,0.195-0.451,0.293-0.707,0.293\ts-0.512-0.098-0.707-0.293L17,9.383V20.33c0,0.553-0.447,1-1,1c-0.552,0-1-0.447-1-1V9.383l-4.098,4.098\tC10.512,13.872,9.879,13.872,9.488,13.481z M22.819,24.031H9.181c-0.552,0-1,0.447-1,1s0.448,1,1,1h13.639c0.553,0,1-0.447,1-1\tS23.372,24.031,22.819,24.031z"/></svg>',download16:'<svg xmlns="http://www.w3.org/2000/svg" width="16px" height="16px" x="0px" y="0px" viewBox="0 0 16 16"><defs/><path fill="#FFF" d="M3.175,7.726c-0.413-0.367-0.45-0.999-0.083-1.412c0.367-0.413,0.999-0.45,1.412-0.083L7,8.45V1.5\tc0-0.552,0.448-1,1-1c0.553,0,1,0.448,1,1v6.95l2.496-2.219c0.412-0.367,1.044-0.331,1.411,0.083\tc0.367,0.413,0.33,1.045-0.083,1.412l-4.16,3.698c-0.047,0.041-0.103,0.062-0.154,0.094c-0.047,0.028-0.089,0.064-0.141,0.085\tC8.25,11.649,8.125,11.677,8,11.677c-0.126,0-0.25-0.027-0.369-0.074c-0.05-0.021-0.09-0.055-0.136-0.083\tc-0.053-0.031-0.111-0.053-0.159-0.096L3.175,7.726z M12.018,13.5H3.983c-0.552,0-1,0.447-1,1s0.448,1,1,1h8.035\tc0.553,0,1-0.447,1-1S12.57,13.5,12.018,13.5z"/></svg>',error16:'<svg xmlns="http://www.w3.org/2000/svg" width="16px" height="16px" x="0px" y="0px" viewBox="0 0 16 16"><defs/><path fill="#ad001f" d="M15.744,13.104L9.097,1.47c-0.604-1.055-1.59-1.055-2.193,0L0.256,13.104\tc-0.604,1.056-0.102,1.919,1.113,1.919H14.63C15.847,15.022,16.348,14.159,15.744,13.104z M7,5.045c0-0.552,0.448-1,1-1s1,0.448,1,1\tv3.656c0,0.552-0.448,1-1,1s-1-0.448-1-1V5.045z M8,13.212c-0.748,0-1.354-0.607-1.354-1.354c0-0.748,0.606-1.354,1.354-1.354\ts1.354,0.606,1.354,1.354C9.354,12.604,8.748,13.212,8,13.212z"/></svg>',arrowLeft16:'<?xml version="1.0" encoding="utf-8"?>\n\x3c!-- Generator: Adobe Illustrator 25.2.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) --\x3e\n<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"\n\t viewBox="0 0 16 16" enable-background="new 0 0 16 16" xml:space="preserve">\n<path fill="#5053A4" d="M13.6,8c0,0.6-0.4,1-1,1h-7l2.2,2.5c0.4,0.4,0.3,1-0.1,1.4c-0.2,0.2-0.4,0.2-0.7,0.2c-0.3,0-0.6-0.1-0.8-0.3\n\tL2.6,8.6c0,0-0.1-0.1-0.1-0.2c0,0-0.1-0.1-0.1-0.1c0-0.1-0.1-0.2-0.1-0.3c0,0,0,0,0,0c0,0,0,0,0,0c0-0.1,0-0.3,0.1-0.4\n\tc0,0,0.1-0.1,0.1-0.1c0-0.1,0.1-0.1,0.1-0.2l3.7-4.1c0.4-0.4,1-0.4,1.4-0.1c0.4,0.4,0.4,1,0.1,1.4L5.6,7h7C13.2,7,13.6,7.4,13.6,8z"\n\t/>\n</svg>\n',arrowRight16:'<?xml version="1.0" encoding="utf-8"?>\n\x3c!-- Generator: Adobe Illustrator 25.2.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) --\x3e\n<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"\n\t viewBox="0 0 16 16" enable-background="new 0 0 16 16" xml:space="preserve">\n<path fill="#5053A4" d="M2.4,8.1c0-0.6,0.4-1,1-1h7L8.1,4.5c-0.4-0.4-0.3-1,0.1-1.4c0.2-0.2,0.4-0.2,0.7-0.2c0.3,0,0.6,0.1,0.8,0.3\n\tl3.7,4.2c0,0,0.1,0.1,0.1,0.2c0,0,0.1,0.1,0.1,0.1c0,0.1,0.1,0.2,0.1,0.3c0,0,0,0,0,0c0,0,0,0,0,0c0,0.1,0,0.3-0.1,0.4\n\tc0,0-0.1,0.1-0.1,0.1c0,0.1-0.1,0.1-0.1,0.2l-3.7,4.1c-0.4,0.4-1,0.4-1.4,0.1c-0.4-0.4-0.4-1-0.1-1.4l2.2-2.4h-7\n\tC2.8,9.1,2.4,8.6,2.4,8.1z"/>\n</svg>\n',check32:'<svg\n xmlns="http://www.w3.org/2000/svg"\n width="32px"\n height="32px"\n x="0px"\n y="0px"\n viewBox="0 0 32 32"\n>\n <path\n fill="currentColor"\n d="M22.9,9.3l-9.3,9.3l-3.2-3.2c-0.9-0.9-2.3-0.9-3.2,0l0,0c-0.9,0.9-0.9,2.3,0,3.2l3.2,3.2l0,0l1.6,1.6\n\tc0.9,0.9,2.3,0.9,3.2,0l1.6-1.6l9.3-9.3c0.9-0.9,0.9-2.3,0-3.2l0,0C25.2,8.4,23.7,8.4,22.9,9.3z"\n />\n</svg>\n',check16:'<svg\n xmlns="http://www.w3.org/2000/svg"\n width="16px"\n height="16px"\n x="0px"\n y="0px"\n viewBox="0 0 16 16"\n>\n <path\n fill="currentColor"\n d="M11.6,4.3l-5,5L4.9,7.5C4.4,7,3.7,7,3.2,7.5l0,0C2.8,8,2.8,8.7,3.2,9.2l1.7,1.7l0,0l0.8,0.8\n\tc0.5,0.5,1.2,0.5,1.7,0l0.8-0.8l5-5c0.5-0.5,0.5-1.2,0-1.7l0,0C12.8,3.8,12.1,3.8,11.6,4.3z"\n />\n</svg>\n'},gs=({name:e,size:t="32",className:n,alt:r})=>{const o=`${e}${t}`;return(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)("div",{"aria-hidden":"true",className:n||T("icon"),dangerouslySetInnerHTML:{__html:vs[o]}}),r&&(0,k.jsx)("span",{className:T("visually-hidden"),children:r})]})};function ws({items:e,currentIndex:t,onChange:n,children:r}){const{t:o}=ma(),i=e.length;return(0,k.jsxs)("div",{className:T("carousel-controls"),children:[(0,k.jsx)("button",{className:T("button","button--previous"),"aria-label":o("carousel.controls.previous"),onClick:()=>{n((t-1+i)%i)},children:(0,k.jsx)(gs,{name:"arrowLeft",size:"16"})}),r,(0,k.jsx)("button",{className:T("button","button--next"),"aria-label":o("carousel.controls.next"),onClick:()=>{n((t+1)%i)},children:(0,k.jsx)(gs,{name:"arrowRight",size:"16"})})]})}function js({items:e,currentIndex:t,onChange:n,getItemKey:r,getItemLabel:o}){const i=e.length,a=(0,Qe.useCallback)((e=>{const r=Number(e.target.dataset.item||"0"),o=Math.min(i-1,Math.max(0,r));o!==t&&n(o)}),[i,t,n]);return(0,k.jsx)("div",{className:T("carousel-pagination__wrapper"),role:"group",children:(0,k.jsx)("ul",{className:T("carousel-pagination"),children:e.map(((e,n)=>{const i=t===n;return(0,k.jsx)("li",{className:T("carousel-pagination__item",i?"is-active":void 0),children:(0,k.jsx)("button",{className:T("carousel-pagination__button"),type:"button",onClick:a,"data-item":n,"aria-disabled":i?"true":void 0,"aria-label":o(e,n)})},r(e,n,"pagination-item-"))}))})})}const Os=(e,t,n)=>`${n}${t}`,xs=e=>e.label,Ss=({target:e})=>{e.scrollLeft=0};function _s({currentIndex:e,onChange:t,getItemKey:n=Os,getItemLabel:r=xs,items:o}){const i=Ja(),a=o.length,[s,c]=(0,Qe.useState)(Number(e||"0"));(0,Qe.useEffect)((()=>{c(Number(e||"0"))}),[c,e]);const l=(0,Qe.useRef)([]);l.current=(0,Qe.useMemo)((()=>Array(a).fill(1).map((()=>(0,Xe.createRef)()))),[a]);const u=(0,Qe.useRef)(!0),p=(0,Qe.useRef)();return p.current=t,(0,Qe.useEffect)((()=>{u.current?u.current=!1:p.current&&p.current(s)}),[s]),(0,k.jsxs)("div",{className:T("carousel"),role:"group","aria-roledescription":"carousel",children:[(0,k.jsx)("div",{className:T("carousel__slides-wrapper"),onScroll:Ss,children:(0,k.jsx)("div",{id:i,className:T("carousel__slides"),style:{width:100*a+"%",left:-100*s+"%"},"aria-live":"polite","aria-atomic":"false",children:o.map(((e,t)=>{const r=s===t;return(0,k.jsx)("div",{ref:l.current[t],className:T("carousel__slide",r?"is-active":void 0),"aria-hidden":r?void 0:"true",children:(0,k.jsx)(bs,{item:e,items:o,currentIndex:s,index:t,isActive:r})},n(e,t,"item-"))}))})}),(0,k.jsx)("div",{className:T("carousel__controls"),children:(0,k.jsx)(ws,{currentIndex:s,items:o,onChange:c,controlId:i,children:(0,k.jsx)("div",{className:T("carousel__pagination"),children:(0,k.jsx)(js,{currentIndex:s,items:o,onChange:c,getItemKey:n,getItemLabel:r})})})})]})}const Es=(e,t,n="")=>`${n}${e.title}:${t}`,Cs=e=>e.title,Ps=["event","children"];function Ts(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 ks(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ts(Object(n),!0).forEach((function(t){As(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ts(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function As(e,t,n){return t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Ns=e=>`suggestions__item--${String(e).toLowerCase().replace(/[^a-z0-9_\\-]/,"")}`,Is=({id:e,categories:t=[],question:n,onClick:r,hasIcon:o})=>{const i=(0,Qe.useMemo)((()=>["suggestions__item",...t.map(Ns)]),[t]),a=(0,Qe.useCallback)((()=>{r&&r({id:e,question:n})}),[e,n,r]);return(0,k.jsx)("li",{className:T(i),children:(0,k.jsxs)("button",{type:"button",onClick:a,className:T("button","button--primary"),children:[o&&(0,k.jsx)(gs,{name:"chevronRight",size:"8"}),n]})})};function Rs(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 Ds(e,t,n){return t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Ms=({className:e,suggestions:t=[],onClickSuggestion:n,hasIcon:r=!0})=>(0,k.jsx)("ul",{className:T("suggestions__list",e),children:t.map((e=>(0,k.jsx)(Is,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Rs(Object(n),!0).forEach((function(t){Ds(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Rs(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({hasIcon:r,onClick:n},e),e.id)))}),Ls=["event"];function Us(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 Fs(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Us(Object(n),!0).forEach((function(t){Bs(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Us(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Bs(e,t,n){return t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const $s=e=>{const{sendAction:t}=Qi();return n=>{n.target&&n.target.dataset.linkId&&t({type:"navigate",originMessage:e,link:{id:n.target.dataset.linkId,url:n.target.getAttribute("href")}})}};function zs(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 Hs(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?zs(Object(n),!0).forEach((function(t){Vs(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):zs(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Vs(e,t,n){return t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function qs({children:e,childrenHTML:t,className:n,graphicSrc:r,graphicType:o="icon",iconName:i,iconSize:a,iconClassName:s,dividerType:c}){const l=Boolean(i||r),u=t?{dangerouslySetInnerHTML:{__html:t}}:{children:e};return(0,k.jsxs)("div",{className:T("divider",c&&`divider--type-${c}`,n),children:[l&&(0,k.jsx)("span",{className:T("divider__graphic"),children:i?(0,k.jsx)(gs,{name:i,size:a,className:s}):(0,k.jsx)("img",{src:r,className:T({icon:"icon"===o,avatar:"avatar"===o},s)})}),(0,k.jsx)("div",Hs({className:T("divider__body")},u))]})}const Ws={[w.new_topic]:"newtopic"},Gs=["event"];function Ks(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 Js(e,t,n){return t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Xs={default:({event:e})=>{const{t}=ma(),{subtype:n}=e.payload.body,r=Ws[w[n]];return(0,k.jsx)(qs,{dividerType:r,iconName:w[n],children:(0,k.jsx)("p",{children:t(`dividerKeys.${w[n]}`)})})},[w.new_translation]:({event:e})=>{const{t}=ma(),n=Pr(),{body:{restartButtonText:r,translationEnabled:o,translationLocale:i,text:a,title:s},id:c}=e.payload,{enableTranslations:l}=Qa(),u=ct((e=>e.translations.translatedEventGroups)),p=mt(),d=(0,Qe.useCallback)((()=>{u[c]?p(Ii({events:n,id:c})):p(Ri({events:n,id:c}))}),[p,n,c,u]);return(0,k.jsxs)(qs,{iconName:"newTranslation",dividerType:"newtranslation",children:[(0,k.jsx)("p",{className:T("divider__title"),children:s}),a&&(0,k.jsx)("p",{children:a}),o?(0,k.jsx)(k.Fragment,{children:(0,k.jsx)("button",{className:T("button","button--secondary"),onClick:d,children:t(u[c]?"translations.toggle.showTranslationsButtonText":"translations.toggle.hideTranslationsButtonText")})}):(0,k.jsx)("button",{className:T("button","button--secondary"),"data-testid":"restartTranslationButton",onClick:()=>{l(i)},children:r})]})}},Qs={month:"long",day:"numeric",year:"numeric"},Ys={hour:"numeric",minute:"numeric"},Zs=({event:e})=>{const t=(()=>{const[e,t]=(0,Qe.useReducer)((e=>e+1),0);return(0,Qe.useCallback)((()=>{setTimeout((()=>{t()}))}),[])})(),{date:n,time:r,timeUntilMidnight:o,srText:i}=(e=>{const{t}=ma(),n=xr()?.context?.locale??[],r=new Date(e),o=new Date,i=new Date(o);i.setHours(24,0,0,0);const a=i-o,s=r.toString(),c=new Intl.DateTimeFormat(n,Ys).format(r);let l=((e,t)=>{const n=new Date(t).setHours(0,0,0,0),r=e.getTime(),o=864e5;return r>=n+o?e:r>n?"today":r>n-o?"yesterday":e})(r,o);switch(l){case"today":l=t("dateTime.today");break;case"yesterday":l=t("dateTime.yesterday");break;default:l=new Intl.DateTimeFormat(n,Qs).format(r)}return{date:l,srText:t("dateTime.srText",{date:l,time:c}),time:c,fullDateTime:s,timeUntilMidnight:a}})(F(e.timeIndicator));return(0,Qe.useEffect)((()=>{const e=setTimeout((()=>{t()}),o);return()=>{clearTimeout(e)}}),[t,o]),(0,k.jsxs)(qs,{dividerType:"time-indicator",children:[(0,k.jsxs)("p",{className:T("divider__time"),"aria-hidden":"true",children:[(0,k.jsx)("span",{children:n}),(0,k.jsx)("span",{children:r})]}),(0,k.jsx)("p",{className:T("visually-hidden"),children:i})]})};var ec=["input","select","textarea","a[href]","button","[tabindex]:not(slot)","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable="false"])',"details>summary:first-of-type","details"],tc=ec.join(","),nc="undefined"==typeof Element,rc=nc?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,oc=!nc&&Element.prototype.getRootNode?function(e){return e.getRootNode()}:function(e){return e.ownerDocument},ic=function(e,t,n){var r=Array.prototype.slice.apply(e.querySelectorAll(tc));return t&&rc.call(e,tc)&&r.unshift(e),r.filter(n)},ac=function e(t,n,r){for(var o=[],i=Array.from(t);i.length;){var a=i.shift();if("SLOT"===a.tagName){var s=a.assignedElements(),c=e(s.length?s:a.children,!0,r);r.flatten?o.push.apply(o,c):o.push({scopeParent:a,candidates:c})}else{rc.call(a,tc)&&r.filter(a)&&(n||!t.includes(a))&&o.push(a);var l=a.shadowRoot||"function"==typeof r.getShadowRoot&&r.getShadowRoot(a),u=!r.shadowRootFilter||r.shadowRootFilter(a);if(l&&u){var p=e(!0===l?a.children:l.children,!0,r);r.flatten?o.push.apply(o,p):o.push({scopeParent:a,candidates:p})}else i.unshift.apply(i,a.children)}}return o},sc=function(e,t){return e.tabIndex<0&&(t||/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||e.isContentEditable)&&isNaN(parseInt(e.getAttribute("tabindex"),10))?0:e.tabIndex},cc=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},lc=function(e){return"INPUT"===e.tagName},uc=function(e){var t=e.getBoundingClientRect(),n=t.width,r=t.height;return 0===n&&0===r},pc=function(e,t){return!(t.disabled||function(e){return lc(e)&&"hidden"===e.type}(t)||function(e,t){var n=t.displayCheck,r=t.getShadowRoot;if("hidden"===getComputedStyle(e).visibility)return!0;var o=rc.call(e,"details>summary:first-of-type")?e.parentElement:e;if(rc.call(o,"details:not([open]) *"))return!0;if(n&&"full"!==n&&"legacy-full"!==n){if("non-zero-area"===n)return uc(e)}else{if("function"==typeof r){for(var i=e;e;){var a=e.parentElement,s=oc(e);if(a&&!a.shadowRoot&&!0===r(a))return uc(e);e=e.assignedSlot?e.assignedSlot:a||s===e.ownerDocument?a:s.host}e=i}if(function(e){for(var t,n=oc(e).host,r=!!(null!==(t=n)&&void 0!==t&&t.ownerDocument.contains(n)||e.ownerDocument.contains(e));!r&&n;){var o;r=!(null===(o=n=oc(n).host)||void 0===o||!o.ownerDocument.contains(n))}return r}(e))return!e.getClientRects().length;if("legacy-full"!==n)return!0}return!1}(t,e)||function(e){return"DETAILS"===e.tagName&&Array.prototype.slice.apply(e.children).some((function(e){return"SUMMARY"===e.tagName}))}(t)||function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var t=e.parentElement;t;){if("FIELDSET"===t.tagName&&t.disabled){for(var n=0;n<t.children.length;n++){var r=t.children.item(n);if("LEGEND"===r.tagName)return!!rc.call(t,"fieldset[disabled] *")||!r.contains(e)}return!0}t=t.parentElement}return!1}(t))},dc=function(e,t){return!(function(e){return function(e){return lc(e)&&"radio"===e.type}(e)&&!function(e){if(!e.name)return!0;var t,n=e.form||oc(e),r=function(e){return n.querySelectorAll('input[type="radio"][name="'+e+'"]')};if("undefined"!=typeof window&&void 0!==window.CSS&&"function"==typeof window.CSS.escape)t=r(window.CSS.escape(e.name));else try{t=r(e.name)}catch(e){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",e.message),!1}var o=function(e,t){for(var n=0;n<e.length;n++)if(e[n].checked&&e[n].form===t)return e[n]}(t,e.form);return!o||o===e}(e)}(t)||sc(t)<0||!pc(e,t))},fc=function(e){var t=parseInt(e.getAttribute("tabindex"),10);return!!(isNaN(t)||t>=0)},hc=function e(t){var n=[],r=[];return t.forEach((function(t,o){var i=!!t.scopeParent,a=i?t.scopeParent:t,s=sc(a,i),c=i?e(t.candidates):a;0===s?i?n.push.apply(n,c):n.push(a):r.push({documentOrder:o,tabIndex:s,item:t,isScope:i,content:c})})),r.sort(cc).reduce((function(e,t){return t.isScope?e.push.apply(e,t.content):e.push(t.content),e}),[]).concat(n)},yc=function(e,t){var n;return n=(t=t||{}).getShadowRoot?ac([e],t.includeContainer,{filter:dc.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:fc}):ic(e,t.includeContainer,dc.bind(null,t)),hc(n)},mc=function(e,t){if(t=t||{},!e)throw new Error("No node provided");return!1!==rc.call(e,tc)&&dc(t,e)},bc=ec.concat("iframe").join(","),vc=function(e,t){if(t=t||{},!e)throw new Error("No node provided");return!1!==rc.call(e,bc)&&pc(t,e)};function gc(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 wc(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?gc(Object(n),!0).forEach((function(t){jc(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):gc(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function jc(e,t,n){return t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Oc=function(e){return"Tab"===e.key||9===e.keyCode},xc=function(e){return Oc(e)&&!e.shiftKey},Sc=function(e){return Oc(e)&&e.shiftKey},_c=function(e){return setTimeout(e,0)},Ec=function(e,t){var n=-1;return e.every((function(e,r){return!t(e)||(n=r,!1)})),n},Cc=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return"function"==typeof e?e.apply(void 0,n):e},Pc=function(e){return e.target.shadowRoot&&"function"==typeof e.composedPath?e.composedPath()[0]:e.target},Tc=[];function kc(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 Ac(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?kc(Object(n),!0).forEach((function(t){Nc(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):kc(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Nc(e,t,n){return t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Ic=({children:e,onClose:t,"aria-label":n,"aria-labelledby":r,fallBackFocusRef:o})=>{const i=Ja(),a=(0,Qe.useRef)(null),s=(0,Qe.useRef)(null),[c,l]=(0,Qe.useState)(!1);return(0,Qe.useEffect)((()=>{return c&&(s.current=(e=a.current,t={initialFocus:o&&o.current?o.current:null},r=(null==t?void 0:t.document)||document,i=(null==t?void 0:t.trapStack)||Tc,l=wc({returnFocusOnDeactivate:!0,escapeDeactivates:!0,delayInitialFocus:!0,isKeyForward:xc,isKeyBackward:Sc},t),u={containers:[],containerGroups:[],tabbableGroups:[],nodeFocusedBeforeActivation:null,mostRecentlyFocusedNode:null,active:!1,paused:!1,delayInitialFocusTimer:void 0},p=function(e,t,n){return e&&void 0!==e[t]?e[t]:l[n||t]},d=function(e){return u.containerGroups.findIndex((function(t){var n=t.container,r=t.tabbableNodes;return n.contains(e)||r.find((function(t){return t===e}))}))},f=function(e){var t=l[e];if("function"==typeof t){for(var n=arguments.length,o=new Array(n>1?n-1:0),i=1;i<n;i++)o[i-1]=arguments[i];t=t.apply(void 0,o)}if(!0===t&&(t=void 0),!t){if(void 0===t||!1===t)return t;throw new Error("`".concat(e,"` was specified but was not a node, or did not return a node"))}var a=t;if("string"==typeof t&&!(a=r.querySelector(t)))throw new Error("`".concat(e,"` as selector refers to no known node"));return a},h=function(){var e=f("initialFocus");if(!1===e)return!1;if(void 0===e)if(d(r.activeElement)>=0)e=r.activeElement;else{var t=u.tabbableGroups[0];e=t&&t.firstTabbableNode||f("fallbackFocus")}if(!e)throw new Error("Your focus-trap needs to have at least one focusable element");return e},y=function(){if(u.containerGroups=u.containers.map((function(e){var t=yc(e,l.tabbableOptions),n=function(e,t){return(t=t||{}).getShadowRoot?ac([e],t.includeContainer,{filter:pc.bind(null,t),flatten:!0,getShadowRoot:t.getShadowRoot}):ic(e,t.includeContainer,pc.bind(null,t))}(e,l.tabbableOptions);return{container:e,tabbableNodes:t,focusableNodes:n,firstTabbableNode:t.length>0?t[0]:null,lastTabbableNode:t.length>0?t[t.length-1]:null,nextTabbableNode:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=n.findIndex((function(t){return t===e}));if(!(r<0))return t?n.slice(r+1).find((function(e){return mc(e,l.tabbableOptions)})):n.slice(0,r).reverse().find((function(e){return mc(e,l.tabbableOptions)}))}}})),u.tabbableGroups=u.containerGroups.filter((function(e){return e.tabbableNodes.length>0})),u.tabbableGroups.length<=0&&!f("fallbackFocus"))throw new Error("Your focus-trap must have at least one container with at least one tabbable node in it at all times")},m=function e(t){!1!==t&&t!==r.activeElement&&(t&&t.focus?(t.focus({preventScroll:!!l.preventScroll}),u.mostRecentlyFocusedNode=t,function(e){return e.tagName&&"input"===e.tagName.toLowerCase()&&"function"==typeof e.select}(t)&&t.select()):e(h()))},b=function(e){var t=f("setReturnFocus",e);return t||!1!==t&&e},v=function(e){var t=Pc(e);d(t)>=0||(Cc(l.clickOutsideDeactivates,e)?n.deactivate({returnFocus:l.returnFocusOnDeactivate&&!vc(t,l.tabbableOptions)}):Cc(l.allowOutsideClick,e)||e.preventDefault())},g=function(e){var t=Pc(e),n=d(t)>=0;n||t instanceof Document?n&&(u.mostRecentlyFocusedNode=t):(e.stopImmediatePropagation(),m(u.mostRecentlyFocusedNode||h()))},w=function(e){if(("Escape"===(t=e).key||"Esc"===t.key||27===t.keyCode)&&!1!==Cc(l.escapeDeactivates,e))return e.preventDefault(),void n.deactivate();var t;(l.isKeyForward(e)||l.isKeyBackward(e))&&function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=Pc(e);y();var r=null;if(u.tabbableGroups.length>0){var o=d(n),i=o>=0?u.containerGroups[o]:void 0;if(o<0)r=t?u.tabbableGroups[u.tabbableGroups.length-1].lastTabbableNode:u.tabbableGroups[0].firstTabbableNode;else if(t){var a=Ec(u.tabbableGroups,(function(e){var t=e.firstTabbableNode;return n===t}));if(a<0&&(i.container===n||vc(n,l.tabbableOptions)&&!mc(n,l.tabbableOptions)&&!i.nextTabbableNode(n,!1))&&(a=o),a>=0){var s=0===a?u.tabbableGroups.length-1:a-1;r=u.tabbableGroups[s].lastTabbableNode}else Oc(e)||(r=i.nextTabbableNode(n,!1))}else{var c=Ec(u.tabbableGroups,(function(e){var t=e.lastTabbableNode;return n===t}));if(c<0&&(i.container===n||vc(n,l.tabbableOptions)&&!mc(n,l.tabbableOptions)&&!i.nextTabbableNode(n))&&(c=o),c>=0){var p=c===u.tabbableGroups.length-1?0:c+1;r=u.tabbableGroups[p].firstTabbableNode}else Oc(e)||(r=i.nextTabbableNode(n))}}else r=f("fallbackFocus");r&&(Oc(e)&&e.preventDefault(),m(r))}(e,l.isKeyBackward(e))},j=function(e){var t=Pc(e);d(t)>=0||Cc(l.clickOutsideDeactivates,e)||Cc(l.allowOutsideClick,e)||(e.preventDefault(),e.stopImmediatePropagation())},O=function(){if(u.active)return function(e,t){if(e.length>0){var n=e[e.length-1];n!==t&&n.pause()}var r=e.indexOf(t);-1===r||e.splice(r,1),e.push(t)}(i,n),u.delayInitialFocusTimer=l.delayInitialFocus?_c((function(){m(h())})):m(h()),r.addEventListener("focusin",g,!0),r.addEventListener("mousedown",v,{capture:!0,passive:!1}),r.addEventListener("touchstart",v,{capture:!0,passive:!1}),r.addEventListener("click",j,{capture:!0,passive:!1}),r.addEventListener("keydown",w,{capture:!0,passive:!1}),n},x=function(){if(u.active)return r.removeEventListener("focusin",g,!0),r.removeEventListener("mousedown",v,!0),r.removeEventListener("touchstart",v,!0),r.removeEventListener("click",j,!0),r.removeEventListener("keydown",w,!0),n},n={get active(){return u.active},get paused(){return u.paused},activate:function(e){if(u.active)return this;var t=p(e,"onActivate"),n=p(e,"onPostActivate"),o=p(e,"checkCanFocusTrap");o||y(),u.active=!0,u.paused=!1,u.nodeFocusedBeforeActivation=r.activeElement,t&&t();var i=function(){o&&y(),O(),n&&n()};return o?(o(u.containers.concat()).then(i,i),this):(i(),this)},deactivate:function(e){if(!u.active)return this;var t=wc({onDeactivate:l.onDeactivate,onPostDeactivate:l.onPostDeactivate,checkCanReturnFocus:l.checkCanReturnFocus},e);clearTimeout(u.delayInitialFocusTimer),u.delayInitialFocusTimer=void 0,x(),u.active=!1,u.paused=!1,function(e,t){var n=e.indexOf(t);-1!==n&&e.splice(n,1),e.length>0&&e[e.length-1].unpause()}(i,n);var r=p(t,"onDeactivate"),o=p(t,"onPostDeactivate"),a=p(t,"checkCanReturnFocus"),s=p(t,"returnFocus","returnFocusOnDeactivate");r&&r();var c=function(){_c((function(){s&&m(b(u.nodeFocusedBeforeActivation)),o&&o()}))};return s&&a?(a(b(u.nodeFocusedBeforeActivation)).then(c,c),this):(c(),this)},pause:function(){return u.paused||!u.active||(u.paused=!0,x()),this},unpause:function(){return u.paused&&u.active?(u.paused=!1,y(),O(),this):this},updateContainerElements:function(e){var t=[].concat(e).filter(Boolean);return u.containers=t.map((function(e){return"string"==typeof e?r.querySelector(e):e})),u.active&&y(),this}},n.updateContainerElements(e),n),s.current.activate()),()=>{s.current&&s.current.deactivate()};var e,t,n,r,i,l,u,p,d,f,h,y,m,b,v,g,w,j,O,x}),[c,o]),(0,Qe.useEffect)((()=>{const e=(()=>{const e=[],t=[];return document.querySelectorAll('body > *:not([role="dialog"])').forEach((n=>{const r=n.getAttribute("aria-hidden");null!==r&&"false"!==r||(e.push(r),t.push(n),n.setAttribute("aria-hidden","true"))})),()=>{t.forEach(((t,n)=>{const r=e[n];null===r?t.removeAttribute("aria-hidden"):t.setAttribute("aria-hidden",r)}))}})();return()=>{e()}}),[c]),(0,Qe.useEffect)((()=>{c&&a.current.addEventListener("keydown",(e=>{(e.code&&"Escape"===e.code||27===e.keyCode)&&t()}))}),[c,t]),(0,Qe.useLayoutEffect)((()=>{const e=document.getElementsByTagName("body")[0],t=document.createElement("div");return t.setAttribute("id",i),t.setAttribute("role","dialog"),t.setAttribute("data-nosnippet","true"),t.setAttribute("aria-modal","true"),n&&t.setAttribute("aria-label",n),r&&t.setAttribute("aria-labelledby",r),e.appendChild(t),a.current=t,l(!0),()=>{a.current&&(e.removeChild(a.current),a.current=null)}}),[n,r,i]),"function"==typeof e?e({onClose:t,modalRenderFn:e=>a.current&&(0,Xe.render)(e,a.current)}):a.current&&(0,Xe.render)((0,Xe.toChildArray)(e).map((e=>(e.props=Ac(Ac({},e.props),{},{onClose:t}),e))),a.current)},Rc=({url:e,description:t,onClose:n})=>{const{zIndex:r,layoutMode:o,namespace:i}=xr(),a=Ha(),s=_a(),c=(0,Qe.useRef)(null),{t:l}=ma(),u=["modal",`app--layout-${o}`,`namespace--${i}`,...s],p=e=>{e.stopPropagation()},d=()=>{n()},f=r?{zIndex:r+1}:void 0;return(0,k.jsx)(Ic,{onClose:n,"aria-label":l("lightbox.heading"),fallBackFocusRef:c,children:({onClose:n,modalRenderFn:r})=>r((n=>(0,k.jsx)("div",{className:T(u),onClick:d,style:f,children:(0,k.jsxs)("div",{className:T("modal__float"),tabIndex:"-1",onMouseDown:a,onKeyDown:a,onTouchStart:a,onMouseMove:a,onWheel:a,onPointerDown:a,onPointerMove:a,ref:c,children:[(0,k.jsx)("div",{className:T("modal__inner"),onClick:p,children:(0,k.jsx)("img",{className:T("modal__image"),src:e,alt:t})}),(0,k.jsxs)("button",{type:"button",className:T("modal__close"),onClick:n,children:[(0,k.jsx)(gs,{name:"close",size:"16"}),l("lightbox.closeLabel")]})]})}))(n))})},Dc=({description:e,url:t})=>{const{t:n}=ma(),[r,o]=(0,Qe.useState)(!1);return(0,k.jsxs)(k.Fragment,{children:[(0,k.jsxs)("button",{type:"button",className:T("modal__enlarge"),onClick:()=>{o(!0)},children:[n("message.image.srTextEnlargeButtonLabel",{description:e}),(0,k.jsx)(gs,{name:"enlarge",size:"32"})]}),r&&(0,k.jsx)(Rc,{url:t,description:e,onClose:()=>{o(!1)}})]})},Mc=["event","descriptorId"];function Lc(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 Uc(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Lc(Object(n),!0).forEach((function(t){Fc(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Lc(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Fc(e,t,n){return t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Bc=["event"];function $c(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 zc(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?$c(Object(n),!0).forEach((function(t){Hc(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):$c(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Hc(e,t,n){return t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Vc=["event"];function qc(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 Wc(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?qc(Object(n),!0).forEach((function(t){Gc(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):qc(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Gc(e,t,n){return t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Kc=e=>{let{event:t}=e,n=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,Vc);const{body:r}=Ya(t),o=$s(t.payload.id),i=(0,Qe.useMemo)((()=>t.payload.optimisticallyInjected?{children:(0,k.jsx)("p",{children:r.text})}:{bodyProps:{dangerouslySetInnerHTML:{__html:r.text}}}),[r,t]);return(0,k.jsx)(as,Wc(Wc({type:"text",event:t,onClick:o},n),i))},Jc=["event"];function Xc(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 Qc(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Xc(Object(n),!0).forEach((function(t){Yc(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Xc(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Yc(e,t,n){return t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Zc=["event"];function el(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 tl(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?el(Object(n),!0).forEach((function(t){nl(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):el(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function nl(e,t,n){return t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const rl=({children:e,url:t,target:n})=>t?(0,k.jsx)("a",{href:t,download:!0,target:n||void 0,className:T(["download","download-link"]),children:e}):(0,k.jsx)("span",{className:T("download"),children:e}),ol=["event","descriptorId"];function il(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 al(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?il(Object(n),!0).forEach((function(t){sl(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):il(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function sl(e,t,n){return t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function cl(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 ll(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?cl(Object(n),!0).forEach((function(t){ul(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):cl(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function ul(e,t,n){return t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const pl={message:{choice_prompt:e=>{let{event:t,children:n}=e,r=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,Ps);const{t:o}=ma(),i=Ja(),{body:a,subEvent:s,showOptions:c,chooseAgain:l,onChoiceClickHandler:u,onChooseAgainClickHandler:p}=(e=>{const{payload:t}=e,[n,r]=(0,Qe.useState)(!1),{sendAction:o,addMessageBubble:i,addDivider:a}=Qi(),{activeServiceSessionId:s}=_r().serviceInfo,c=ct(Nr),{body:l}=Ya(e),{service:u}=t,p=(0,Qe.useMemo)((()=>ks(ks({},e),{},{payload:ks(ks({},e.payload),{},{body:e.payload.body?.prompt,translatedBody:e.payload.translatedBody&&ks(ks({},e.payload.translatedBody),{},{data:e.payload.translatedBody.data.prompt})})})),[e]),d=l.chooseAgain&&s===u.serviceSessionId&&t.id!==c;return(0,Qe.useEffect)((()=>{r(t.id===c)}),[t,c]),{body:l,subEvent:p,showOptions:n,chooseAgain:d,onChoiceClickHandler:e=>{const n=J();d&&a("new_topic",n),i(e.text,n),o({type:"pick_choice",originMessage:t.id,choice:{id:e.id,text:e.text,chooseAgain:d},transactionId:n}),r(!1)},onChooseAgainClickHandler:()=>{r((e=>!e))}}})(t);return(0,k.jsxs)(k.Fragment,{children:[(0,Xe.toChildArray)(n).map((e=>(e.props=ks(ks({},e.props),{},{event:s,descriptorId:i,showTranslationToggle:!1}),e))),l&&(0,k.jsxs)("button",{type:"button",className:T("button","button--secondary","button--choose-again"),"aria-expanded":c?"true":"false",onClick:p,"aria-describedby":i,children:[o(c?"message.choicePrompts.cancelChooseAgain":"message.choicePrompts.chooseAgain"),(0,k.jsx)(gs,{name:"chevronDown",size:"8"})]}),c&&(0,k.jsx)(as,ks(ks({type:"choice-prompt",showParticipant:!1,event:t},r),{},{children:(0,k.jsx)("ul",{className:T("choice-prompt","choice-prompt--many"),children:a.choices.map((e=>(0,k.jsx)("li",{className:T("choice-prompt__item",{[`choice-prompt__item--${e.category}`]:e.category}),children:(0,k.jsx)("button",{type:"button",className:T("button","button--primary"),onClick:()=>{u(e)},children:e.text})},e.id)))})}))]})},text:Kc,image:e=>{let{event:t,descriptorId:n}=e,r=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,Mc);const{body:o}=Ya(t),{description:i,url:a,isZoomable:s}=o,[c,l]=(0,Qe.useState)(!1),u=mt();return(0,k.jsxs)(as,Uc(Uc({event:t,type:"image"},r),{},{children:[(0,k.jsx)("img",{src:a,id:n,alt:i,onLoad:()=>{u(ko(t.payload.id)),l(!0)}}),s&&c&&(0,k.jsx)(Dc,{description:i,url:a})]}))},splash:e=>{let{event:t}=e,n=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,Bc);const{payload:r}=t,{body:o}=Ya(t),i=$s(r.id);return(0,k.jsx)(as,zc(zc({type:"splash",event:t,onClick:i},n),{},{bodyProps:{dangerouslySetInnerHTML:{__html:o.text}}}))},video:e=>{let{event:t,descriptorId:n}=e,r=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,ol);const{body:o}=Ya(t),{description:i,url:a}=o;return Ea(t).push("message--type-video"),(0,k.jsxs)(as,al(al({event:t,type:"video"},r),{},{children:[(0,k.jsx)("div",{id:n,className:T("visually-hidden"),children:i}),(0,k.jsx)("iframe",{title:i,src:a,allow:"autoplay; encrypted-media",allowFullScreen:!0})]}))},upload:e=>{let{event:t}=e,n=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,Zc);const{t:r}=ma(),{body:o}=Ya(t),{fromClient:i}=t.payload,{filename:a,url:s}=o,c=(0,Qe.useMemo)((()=>r(s?"fileUpload.srFileDownloadText":"fileUpload.srFileUploadedText",{fileName:a})),[s,a,r]);return(0,k.jsx)(as,tl(tl({event:t,type:"upload"},n),{},{children:(0,k.jsxs)(rl,{url:s,target:i?void 0:"_blank",children:[(0,k.jsx)(gs,{name:"download",size:"16"}),(0,k.jsx)("span",{"aria-hidden":"true",className:T("file-download"),children:a}),(0,k.jsx)("span",{className:T("visually-hidden"),children:c})]})}))},cta:({event:e})=>{const{body:t}=Ya(e),n=$s(e.payload.id),{emitEvent:r}=Qi(),o=Ja(),i=(0,Qe.useCallback)((()=>r(`action.${y}`,{type:y,originMessage:e.payload.id,link:{url:t.buttonLink}})),[r,t,e]);return(0,k.jsxs)(as,{type:"cta",event:e,children:[(0,k.jsx)("div",{className:T("cta__content"),id:o,dangerouslySetInnerHTML:{__html:t.description},onClick:n}),(0,k.jsx)("a",{className:T("button","button--primary"),"aria-describedby":o,href:t.buttonLink,rel:"noreferrer",target:t.buttonNewTab?"_blank":"_self",onClick:i,children:t.buttonText})]})},carousel:({event:e})=>{const{body:t}=Ya(e),n=t.cards;return(0,k.jsx)(as,{event:e,modifiers:"type-carousel",children:(0,k.jsx)(_s,{items:n,ItemComponent:bs,getItemKey:Es,getItemLabel:Cs})})},card:({event:e})=>{const{body:t}=Ya(e),n=Ja();return(0,k.jsx)(as,{type:"card",event:e,children:(0,k.jsx)(us,ds({id:n},t))})}},info:{text:Kc,divider:e=>{let{event:t}=e,n=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,Gs);const r=Xs[w[t.payload.body.subtype]]||Xs.default;return(0,k.jsx)(r,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ks(Object(n),!0).forEach((function(t){Js(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ks(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({event:t},n))},translation:e=>{let{event:t}=e,n=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,Jc);const{t:r}=ma(),{body:o}=Ya(t);return(0,k.jsx)(as,Qc(Qc({type:"text",event:t},n),{},{children:r(o.key.join("."),o.variables)}))},timeIndicator:Zs},participant:{participant:({event:e})=>{const{participant:t}=e.payload,{body:n}=Ya(e);return n?(0,k.jsx)(qs,{graphicSrc:t.avatar,graphicType:t.avatar?"avatar":void 0,iconName:t.avatar?void 0:"balloon",childrenHTML:n,dividerType:"participant"}):null}},service_data:{suggestion:e=>{let{event:t}=e,n=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,Ls);const[r,o]=(0,Qe.useState)(!0),i=mt(),a=Hr(),{sendAction:s,addMessageBubble:l}=Qi(),{suggestions:u,payload:p}=(e=>{const{payload:t}=e,{body:n}=Ya(e);return{suggestions:n,payload:t}})(t),{showSuggestions:d}=xr(),f=Pr(),{t:h}=ma(),y=h("suggestions.headingText"),m=h("suggestions.footerText"),b=(0,Qe.useMemo)((()=>f.some((({payload:e})=>e?.transactionLast))),[f]),v=(0,Qe.useCallback)((({id:e,question:t})=>{o(!1),i(Wr(!0)),s({type:c,originMessage:p.id,body:{type:"faqclick",body:{faqId:e,faqQuestion:t}}}),l(t)}),[i,s,p.id,l]);return r&&!a&&b&&d?(0,k.jsxs)("div",{className:T("suggestions","suggestions--conversation"),children:[y&&(0,k.jsx)("p",{className:T("suggestions__heading"),children:y}),(0,k.jsxs)(as,Fs(Fs({type:"suggestions",showParticipant:!1,event:t},n),{},{children:[(0,k.jsx)(Ms,{className:"suggestions__list--conversation",onClickSuggestion:v,suggestions:u}),m&&(0,k.jsx)("p",{className:T("suggestions__footer"),children:m})]}))]}):null}}},dl=({children:e})=>{const{customComponents:t}=xr(),n=(0,Qe.useMemo)((()=>Object.keys(pl).reduce(((e,n)=>ll(ll({},e),{},{[n]:ll(ll({},pl[n]),t?t[n]:{})})),{fallback:Kc})),[t]);return(0,k.jsx)(Sa.Provider,{value:n,children:e})},fl=({children:e})=>{const{isMinimized:t}=Hi(),n=(0,Qe.useRef)(0),{sendAction:r}=Qi(),{hasCountdown:o,isActive:i,stopCountdown:a}=Ga(),s=(0,Qe.useCallback)((()=>{if(t)return;const e=(new Date).getTime(),s=()=>{r({type:"interactivity_update"}),n.current=e};o&&i&&(s(),a()),e-n.current>15e3&&s()}),[r,o,i,a,t]);return(0,k.jsx)("div",Object.assign({className:T("activity-monitor"),tabIndex:-1,onMouseDown:s,onKeyUp:s,onTouchStart:s,onMouseMove:s,onWheel:s,onPointerDown:s,onPointerMove:s},{children:(0,k.jsx)(za.Provider,Object.assign({value:s},{children:e}))}))};const hl=["text","choice_prompt","image","video"],yl=()=>{const e=qi(),t=(0,Qe.useRef)(),n=(0,Qe.useRef)(),r=mt(),o=Pr(),i=(0,Qe.useContext)(gt),a=(0,Qe.useRef)(null),{initCountdown:s,endCountdown:c}=Ga(),{emitEvent:l}=Qi();return(0,Qe.useEffect)((()=>{if(e.connectionInfo&&e.conversation.socket){const{socket:t}=e.conversation;t.onError((e=>{const t=new Yo(e);r(Xr({name:t.name,message:t.message,langKey:t.langKey,originalEvent:t.originalEvent,originalError:t.originalError})),r(co())})),t.onOpen((()=>{r(Qr())}))}}),[e,e.connectionInfo,e.conversation.socket,r]),(0,Qe.useEffect)((()=>{if(e.connectionInfo&&e.conversation.channel){const{channel:t}=e.conversation;return()=>{null==t||t.leave()}}return()=>{}}),[e,e.connectionInfo,e.conversation]),(0,Qe.useEffect)((()=>{e.conversation.onConnection((({currentState:e})=>{if("join_channel_erred"===e){const e=new D;r(Xr({name:e.name,message:e.message,langKey:e.langKey,originalEvent:e.originalEvent,originalError:e.originalError,action:e.action}))}}))}),[e.conversation,r]),(0,Qe.useEffect)((()=>{e.connectionInfo&&e.conversation.onConnection((({connected:t})=>{if(!t)return!1;const{channel:n}=e.conversation,o=e=>{const{payload:t}=e;if(!t||!t.participant)return;const{fromClient:n,participant:o}=t;!n&&"string"!=typeof o&&(null==o?void 0:o.name)&&r(_o(o.name)),r(Ao({participant:o,fromClient:n})),"string"!=typeof o&&o.introduction&&r(ao(Object.assign(Object.assign({},e),{payload:Object.assign(Object.assign({},t),{type:"participant"})})))};return n.onMessage=(e,t)=>{const n={type:e,payload:t};switch(e){case"ui":switch(t.state&&t.state.hasOwnProperty("loading")&&r(To(t.state.loading)),t.type){case"idle_detach_countdown":s(t.body.duration);break;case"idle_detach_countdown_elapsed":c(void 0,!0);break;case"resume_conversation_prompt":r(mo());break;case"translation_proposal":r(Di(t.body));break;case"user_first_response":r(Wr(!0)),i.emit("system.userFirstResponse",t.body)}break;case"message":switch(o(t),t.type){case"text":case"choice_prompt":case"splash":case"image":case"upload":case"video":case"cta":case"custom":case"carousel":case"card":t.service&&t.service.serviceSessionId&&r(wo(t.service.serviceSessionId)),r(ao(n))}break;case"participant":o(n);break;case"service_data":t.persist&&r(Io(t));break;case"ack":r(io(n));break;case"system":if("service_changed"===t.type){const{serviceSettings:e}=t,n=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 o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}(t,["serviceSettings"]),{entry:o}=e,{upload:i}=o.options;r(xo({key:j,enabled:!(!i||!i.enabled)})),r(Ro(o)),t.serviceSessionId&&r(wo(t.serviceSessionId)),l("system.serviceChanged",n)}break;case"info":"divider"!==t.type&&"text"!==t.type&&"translation"!==t.type||r(ao(n));break;case"error":switch(t.type){case"find_conversation_erred":const e=new M(n);r(Xr({name:e.name,action:e.action,message:e.message,originalEvent:e.originalEvent,originalError:e.originalError}));break;case"conversation_erred":const t=new D(n);r(Xr({name:t.name,message:t.message,langKey:t.langKey,originalEvent:t.originalEvent,originalError:t.originalError,action:t.action}))}}return t},!0}))}),[e,e.connectionInfo,e.conversation.channel,r,l,c,i,s]),(0,Qe.useEffect)((()=>{e.connectionInfo&&e.conversation.onConnection((({connected:t})=>{if(!t)return!1;const{channel:r}=e.conversation;return n.current&&(null==r||r.off("message",n.current)),n.current=r.on("message",(e=>hl.includes(e.type)?(e.id!==a.current&&i.emit("message",e),a.current=e.id,e):e)),!0}))}),[e,e.connectionInfo,e.conversation.channel,i]),(0,Qe.useEffect)((()=>{e.connectionInfo&&e.conversation.onConnection((({connected:n})=>{var i;return!!n&&(t.current&&(null===(i=e.conversation.channel)||void 0===i||i.off("sync",t.current)),t.current=e.conversation.channel.on("sync",(t=>{var n;const i=o[o.length-1],a=null===(n=null==t?void 0:t.lastEvent)||void 0===n?void 0:n.id;return i&&a===i.payload.id?t:e.getConversation().then((e=>{e&&r(Co(e))})).catch((e=>{r(Xr({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}))}))})),!0)}))}),[e,e.connectionInfo,e.conversation.channel,o,r]),null},ml=({children:e})=>{const{t}=ma(),n=mt(),r=qi(),{addUploadBubble:o}=Qi();return(0,k.jsx)(Aa.Provider,{value:e=>{const i=J(),a=r.uploadFile(e,(e=>{n(Lo({fileId:i,progress:Math.ceil(e)}))}),(e=>{const{id:t,transactionId:r,occurredAt:a,body:{contentType:s,filename:c,filesize:l,url:u}}=e.body;n(Do(i)),o(t,r,a,s,c,l,u)}),(e=>{let r;switch(e&&e.body?e.body.error:""){case"file_uploads_are_disabled":r=t("fileUpload.errors.unavailable");break;case"request_entity_too_large":r=t("fileUpload.errors.tooLarge");break;case"file_has_invalid_mime_type":r=t("fileUpload.errors.wrongType");break;case"virus_found":r=t("fileUpload.errors.virusFound");break;default:r=t("fileUpload.errors.general")}n(Mo({fileId:i,errorText:r}))}));n(bo({fileId:i,fileName:e.name,uploadHandle:a}))},children:e})},bl=()=>{const{hasCountdown:e,isActive:t,remaining:n,decrementCountdown:r}=Ga();return((e,t)=>{const n=(0,Qe.useRef)(e);(0,Qe.useEffect)((()=>{n.current=e}),[e]),(0,Qe.useEffect)((()=>{if(null!==t){const e=setInterval((function(){n.current()}),t);return()=>clearInterval(e)}}),[t])})((()=>{r()}),e&&t&&n>0?1e3:null),null},vl=()=>{const{initUserSelectedOptions:e}=Ba(),t=(0,Qe.useRef)(!1),n=xr();return(0,Qe.useEffect)((()=>{n.api&&!t.current&&(t.current=!0,e())}),[e,n]),null};function gl(e,t,n=[]){const r=(0,Qe.useContext)(gt),o=(0,Qe.useRef)();o.current=t,(0,Qe.useEffect)((()=>{if(!n.every(Boolean))return;const t=(...e)=>o.current?.(...e);return r.emit("function.register",e,t),()=>r.emit("function.unregister",e,t)}),[r,e,...n])}const wl=()=>{const e=xr(),{sendMessage:t,sendContext:n,sendAction:r}=Qi(),o=mt(),{setVisibility:i,visible:a}=Hi(),s=(0,Qe.useRef)(a),c=(0,Qe.useContext)(gt),l=qi(),u=kr(),p=(0,Qe.useRef)(null),d=(0,Qe.useRef)(null),{isInline:h,isResolving:y}=Rr(),m=ct(wa),b=(()=>{const{get:e}=Wi();return e?e("conversationUrl"):null})(),v=(0,Qe.useRef)(null),g=Ha(),{enableTranslations:w,disableTranslations:j}=Qa();return(0,Qe.useEffect)((()=>{s.current=a}),[a]),gl("askText",(e=>{t({body:e})}),[l?.send]),gl("setVariables",(e=>{n({variables:e})}),[l?.send]),gl("getVisibility",(e=>{e?e(s.current):console.warn("A callback function is required for the getVisibility action.")})),gl("setVisibility",(e=>{Object.values(S).includes(e)?(g(),i(e)):console.error('Requested visibility states should be "open", "minimized" ,"hidden" or null.')}),[e?.api]),gl("sendCustomAction",((e,t)=>{r({type:"custom",body:{type:e,body:t}})}),[l.send]),gl("setTopic",(({name:e,fallbackMessage:t,userTriggered:n})=>{n&&o(Jo({showSuggestions:!1})),e&&t?r({type:f,body:{name:e,fallbackMessage:t,participant:n?P:void 0}}):console.warn("A name and a fallbackMessage are required for the setTopic action.")}),[l.send]),gl("setTranslation",(({enabled:e,locale:t})=>{e?w(t,"window_api"):j()}),[l.send]),(0,Qe.useEffect)((()=>{y||m||(v.current&&v.current!==b&&c.emit("unreadMessageCount",u),a===S.open&&a!==d.current&&0!==p.current&&c.emit("unreadMessageCount",0),a!==S.open&&u!==p.current&&c.emit("unreadMessageCount",u),d.current=a,p.current=u,v.current=b)}),[u,a,c,h,y,m,b]),null},jl=({children:e})=>{const t=(0,Qe.useContext)(gt),[n,r]=(0,Qe.useState)({}),o=(0,Qe.useRef)(!0),i=(0,Qe.useCallback)((e=>{o.current&&(r(e),t.emit("aria-live",e))}),[r,t]);(0,Qe.useEffect)((()=>{let e=null;return n&&n.messageText&&(e=setTimeout((()=>{i({}),clearTimeout(e)}),500)),()=>{clearTimeout(e)}}),[n,i]),(0,Qe.useEffect)((()=>()=>{o.current=!1}),[]);const{ariaLive:a,messageText:s}=n;return(0,k.jsxs)(ba.Provider,{value:i,children:[e,(0,k.jsxs)("div",{className:T("app__live-container"),children:[(0,k.jsx)("div",{"aria-live":"assertive","aria-atomic":"true",className:T("visually-hidden"),children:a===v?s:null}),(0,k.jsx)("div",{"aria-live":"polite","aria-atomic":"true",className:T("visually-hidden"),children:a===g?s:null})]})]})},Ol=()=>{const{t:e}=ma(),t=Pr(),n=(0,Qe.useRef)(0),r=(0,Qe.useRef)(0),o=_r().historyLoaded,{sendPolite:i}=va(),{isOpen:a}=Hi(),s=(0,Qe.useRef)(null),c=(0,Qe.useRef)(null),l=(0,Qe.useMemo)((()=>U((t=>{const n=t.filter((({payload:e})=>!e.fromClient&&!e.fromHistory)).length;n>r.current&&(i(e("message.srNewEventCount",{newCount:n-r.current})),r.current=n)}),1e3)),[i,e]);return(0,Qe.useEffect)((()=>{t.length>n.current&&(a&&(c.current=l(t)),n.current=t.length)}),[t,l,a]),(0,Qe.useEffect)((()=>{s.current&&!a&&c.current&&(c.current(!0),c.current=null)}),[a]),(0,Qe.useEffect)((()=>{o&&setTimeout((()=>{i(e("window.srTexts.onHistoryLoad"))}),500)}),[o,e,i]),null},xl=()=>{const{t:e}=ma(),{isOpen:t,isVisible:n}=Hi(),r=kr(),{sendPolite:o}=va(),i=(0,Qe.useMemo)((()=>U(o,2e3)),[o]),a=(0,Qe.useRef)(null),s=(0,Qe.useRef)(null);return(0,Qe.useEffect)((()=>{a.current!==n&&!n&&s.current&&s.current(),0!==r&&!t&&n&&(s.current=i(e("message.srTextUnreadCount",{unreadCount:r}))),a.current=n}),[r,t,n,i,e]),null},Sl=({store:e,children:t,eventBus:n,api:r})=>((0,Qe.useErrorBoundary)((t=>{e.dispatch(ei(t))})),(0,k.jsx)(dt,Object.assign({store:e},{children:(0,k.jsx)(gt.Provider,Object.assign({value:n},{children:(0,k.jsx)(vt.Provider,Object.assign({value:r},{children:(0,k.jsx)(jl,{children:(0,k.jsx)(xa,{children:(0,k.jsxs)(dl,{children:[(0,k.jsx)(vl,{}),(0,k.jsx)(yl,{}),(0,k.jsx)(xl,{}),(0,k.jsx)(Ol,{}),(0,k.jsx)(bl,{}),(0,k.jsxs)(fl,{children:[(0,k.jsx)(wl,{}),(0,k.jsx)(ml,{children:t})]})]})})})}))}))}))),_l=()=>{const{t:e}=ma(),{showDisclaimer:t}=xr();return t&&(0,k.jsxs)("div",{className:T("disclaimer"),tabIndex:"0",children:[(0,k.jsx)("h2",{className:T("disclaimer__title"),children:e("disclaimer.title")}),(0,k.jsx)("div",{className:T("disclaimer__message"),dangerouslySetInnerHTML:{__html:e("disclaimer.content")}})]})},El=require("preact/compat"),Cl=(0,Xe.createContext)(null),Pl=e=>{const t=(0,Qe.useContext)(Sa),n=t[e.type];let r=n[e.payload.type],o=null;return"choice_prompt"===e.payload.type&&(o=n[e.payload.body.prompt.type]),"participant"===e.type&&(r=n[e.type]),r&&"function"!=typeof r&&(r=r[e.payload.body.type]),[r||t.fallback,o]},Tl=({event:e,newParticipant:t})=>{const{eventRefs:n,unreadIds:r}=(0,El.useContext)(Cl),{sendAction:o}=Qi(),i=n[e.payload.id],{containerRef:a,isVisible:s}=Vi({containerRef:i,freezeOnceVisible:!0}),c=mt(),[l,p]=Pl(e);if((0,El.useEffect)((()=>{if(s&&(null==r?void 0:r.includes(e.payload.id))){const t=r.reduce(((t,n)=>t.includes(e.payload.id)?t:t.concat(n)),[]);c(Oo(t)),o({type:u,events:t})}}),[c,e.payload.id,s,o,r]),!l)return null;const d=["conversation__item"];return"info"===e.type?d.push("conversation__item--source-info"):e.payload.fromClient?d.push("conversation__item--source-user"):d.push("conversation__item--source-agent"),t&&d.push("conversation__item--new-participant"),(0,k.jsxs)("li",Object.assign({className:T(d),ref:a},{children:[e.timeIndicator&&(0,k.jsx)(Zs,{event:e}),(0,k.jsx)(l,Object.assign({event:e},{children:(0,k.jsx)(p,{event:e})}))]}))},kl=()=>{const{id:e}=Ir()||{};return(0,k.jsx)("li",{className:T("conversation__item","conversation__item--source-agent"),children:(0,k.jsxs)("div",{className:T("message","message--source-agent","message--type-loading"),children:[(0,k.jsx)(ts,{eventPayload:{fromClient:!1,participant:e}}),(0,k.jsx)("div",{className:T("message__body"),children:(0,k.jsxs)("span",{className:T("loader"),children:[(0,k.jsx)("span",{className:T("loader__part","one")}),(0,k.jsx)("span",{className:T("loader__part","two")}),(0,k.jsx)("span",{className:T("loader__part","three")}),(0,k.jsx)("span",{className:T("loader__part","four")})]})})]})})},Al=()=>{const e=Pr();let t=null;return(0,k.jsx)(k.Fragment,{children:e.map((e=>{const{type:n,payload:r}=e;let o=!1;if("participant"!==n&&"service_data"!==n){const{participant:n,fromClient:i}=r,a=i?"seamly-client-participant":n;"info"!==e.type&&t!==a&&(o=!0),t=a}return(0,k.jsx)(Tl,{event:e,newParticipant:o},e.payload.key||e.payload.id)}))})},Nl=()=>{const{t:e}=ma(),t=Tr(),{isOpen:n}=Hi(),r=Ar(),o=ka();return(0,k.jsxs)(k.Fragment,{children:[n&&(0,k.jsx)("a",Object.assign({className:T("skip-link"),href:`#${r}`,onClick:e=>{e.preventDefault(),o()}},{children:e("skiplinkText")})),(0,k.jsx)("div",Object.assign({className:T("chat__body")},{children:(0,k.jsxs)("div",Object.assign({className:T("conversation__container")},{children:[(0,k.jsx)(_l,{}),(0,k.jsxs)("ol",Object.assign({className:T("conversation")},{children:[(0,k.jsx)(dl,{children:(0,k.jsx)(Al,{})}),t&&(0,k.jsx)(kl,{})]}))]}))}))]})},Il={visible:T("transition--visible"),in:T("transition--in"),visuallyHidden:T("visually-hidden")},Rl=Object.values(Il),Dl="notRendered",Ml="rendered",Ll="visuallyHidden",Ul=({children:e,isActive:t,timeout:n=300,transitionStartState:r=Dl,onInTransitionComplete:o=(()=>{}),onOutTransitionComplete:i=(()=>{})})=>{const a=(0,Qe.useRef)(!1),s=parseInt(n,10),c=Xa(o),l=Xa(i),u=r===Ll,[p,d]=(0,Qe.useState)((()=>u?[Il.visuallyHidden]:[])),f="notRendered"!==r||p.length>0;return(0,Qe.useEffect)((()=>{let e=null,n=null;return a.current&&!t&&(d([Il.visible]),e=setTimeout((()=>{d([...u?[Il.visuallyHidden]:[]]),l&&(n=requestAnimationFrame((()=>{l()})))}),s)),!a.current&&t&&(d([Il.visible]),n=requestAnimationFrame((()=>{n=requestAnimationFrame((()=>{d([Il.visible,Il.in]),c&&(e=setTimeout((()=>{c()}),s))}))}))),a.current=t,()=>{clearTimeout(e),cancelAnimationFrame(n)}}),[t,u,s,c,l]),(0,k.jsx)(k.Fragment,{children:f&&(0,Xe.toChildArray)(e).map((e=>{const{className:t=""}=e.props,n=t.split(" ").filter((e=>!Rl.includes(e)));return(0,Xe.cloneElement)(e,{className:[...n,...p].join(" ")})}))})},Fl=({isAside:e=!1})=>{const{isInline:t}=Rr(),{t:n}=ma(),{sendAction:r,addMessageBubble:o}=Qi(),{isOpen:i,setVisibility:a}=Hi(),{showSuggestions:s}=xr(),l=Ja(),u=ka(),p=(0,Qe.useRef)(null),{sendPolite:d}=va(),f=ct(wa),{hasCountdown:h,endCountdown:y}=Ga(),{hasPrompt:m,continueChat:b}=Ka(),v=Hr(),g=("suggestion",_r().serviceData.suggestion);const{body:w}=Ya({payload:g}),j=(0,Qe.useMemo)((()=>g&&!f?w:[]),[g,f,w]),O=(0,Qe.useRef)(null),x=(0,Qe.useRef)(!1),_=(0,Qe.useRef)([]),E=!!j.length,C=t?(v||i)&&!e:v,P=(0,Qe.useRef)(C),A=E&&!C&&s,N=E?j:_.current;_.current=N;const I=(0,Qe.useMemo)((()=>{const t=["suggestions"];return e&&t.push("suggestions--aside"),T(t)}),[e]),R=(0,Qe.useCallback)((({id:e,question:t})=>{h&&y(!0),m&&b(),r({type:c,originMessage:g.id,body:{type:"faqclick",body:{faqId:e,faqQuestion:t}}}),o(t),i||a(S.open),u()}),[o,b,y,u,h,m,g,r,a,i]);(0,Qe.useEffect)((()=>{if(O.current!==j&&!C){if(E){const e=x.current?n("suggestions.srUpdatedText"):n("suggestions.srAvailableText");setTimeout((()=>{d(e)}),30)}else x.current&&d(n("suggestions.srUnavailableText"));O.current=j}!P.current&&C?(W(p.current,u),d(n("suggestions.srUnavailableText"))):!E&&x.current&&W(p.current,u),x.current=E,P.current=C}),[j,E,C,u,d,n]);const D=n("suggestions.headingText"),M=n("suggestions.footerText"),L=D?"section":"div";return(0,k.jsx)(Ul,{isActive:A,transitionStartState:Dl,children:(0,k.jsxs)(L,{className:I,"aria-labelledby":D?l:null,ref:p,children:[D&&(0,k.jsx)("p",{id:l,className:T("suggestions__heading"),children:D}),!!N.length&&(0,k.jsx)(Ms,{suggestions:N,onClickSuggestion:R}),M&&!i&&(0,k.jsx)("p",{className:T("suggestions__footer"),children:M})]})})},Bl=(0,El.forwardRef)((({children:e,className:t=""},n)=>{const{isOpen:r,isVisible:o,setVisibility:i}=Hi(),{namespace:a,layoutMode:s}=xr(),{isInline:c}=Rr(),l=_a(),u=Hr(),{t:p}=ma(),d=["chat",`chat--layout-${s}`,`namespace--${a}`,...l,t];return r||"app"===s||d.push("chat--collapsed"),u&&d.push("chat--user-responded"),o&&(0,k.jsxs)("section",{className:T(d),onKeyDown:e=>{(e.code&&"Escape"===e.code||27===e.keyCode)&&!c&&r&&i(S.minimized)},tabIndex:"-1",ref:n,"aria-label":p("chat.srLabel"),children:[(0,k.jsx)("div",{className:T("chat-wrapper"),children:e}),"inline"===s&&r&&(0,k.jsx)(Fl,{isAside:!0})]})})),$l=Bl,zl=({className:e,children:t,onCancel:n,headingText:r,description:o,descriptionId:i,cancelButtonText:a,cancelButtonRef:s,disableButtonFocusing:c,position:l={horizontal:"left",vertical:"top"}})=>{const u=Ja(),{hideOption:p}=Ba(),{focusButton:d}=$a(),f=(0,Qe.useCallback)((()=>{p(),c||d()}),[c,d,p]),h=(0,Qe.useCallback)((()=>{n&&n(),f()}),[f,n]),y=(e=>{const t=(0,Qe.useRef)(null);return(0,Qe.useEffect)((()=>{const n=({target:n})=>{t.current&&n instanceof HTMLElement&&!t.current.contains(n)&&e()};return document.addEventListener("click",n,!0),document.addEventListener("touchstart",n,!0),()=>{document.removeEventListener("click",n,!0),document.removeEventListener("touchstart",n,!0)}}),[e,t]),t})(h);return(0,Qe.useEffect)((()=>{q(y.current)}),[y]),(0,k.jsx)("section",Object.assign({className:T("options",{"options--right":"right"===l.horizontal,"options--left":"left"===l.horizontal,"options--top":"top"===l.vertical,"options--bottom":"bottom"===l.vertical},e),"aria-labelledby":u,tabIndex:-1,ref:y},{children:(0,k.jsxs)("div",Object.assign({className:T("options__body")},{children:[(0,k.jsx)("h2",Object.assign({id:u,className:T("options__title")},{children:r})),(0,k.jsxs)("button",Object.assign({type:"button",onClick:h,"aria-describedby":u,className:T("button","options__close"),ref:e=>{s&&(s.current=e)}},{children:[(0,k.jsx)(gs,{name:"close",size:"16",alt:""}),(0,k.jsx)("span",{children:a})]})),o?(0,k.jsx)("p",Object.assign({className:T("options__description"),id:i},{children:o})):null,(0,k.jsx)("div",Object.assign({className:T("options__wrapper")},{children:t}))]}))}))},Hl=(e,t,n=null)=>({fn:e,errorText:t,compareValue:n}),Vl=(e,t)=>{let n=!0;for(let r=0;r<e.length;r++)e[r].size>t&&(n=!1);return n},ql=e=>!!e?.length>0,Wl=e=>{const t=e&&e.trim();return!(!t||!t.match(/^(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])$/i))},Gl=e=>!!e,Kl=(0,Xe.createContext)({handleSubmit:()=>{},isSubmitted:!1,isValid:!1,updateControlValue:()=>{},updateControlTouched:()=>{},errors:void 0}),Jl=Kl,{Provider:Xl,Consumer:Ql}=Kl,Yl=wr((({forms:e})=>e),((e,{formId:t})=>t),((e,t)=>e[t])),Zl=wr(Yl,(e=>(null==e?void 0:e.controls)||{})),eu=wr(Zl,(e=>{const t={};return Object.entries(e).forEach((([e,{value:n}])=>{t[e]=n})),t})),tu=wr(Zl,((e,{name:t})=>t),((e,t)=>{var n;return null===(n=e[t])||void 0===n?void 0:n.value})),nu=wr(Zl,((e,{name:t})=>t),((e,t)=>{var n;return null===(n=e[t])||void 0===n?void 0:n.touched}));function ru(){return(0,Qe.useContext)(Jl)}function ou(e){const t=mt(),{formId:n,updateControlValue:r,updateControlTouched:o,errors:i}=ru(),a=!!ct((e=>Yl(e,{formId:n}))),s=ct((t=>tu(t,{formId:n,name:e}))),c=ct((t=>nu(t,{formId:n,name:e}))),l=null==i?void 0:i[e],u=!l;(0,Qe.useEffect)((()=>{a&&t(ci({formId:n,name:e}))}),[a,n,e,t]),(0,Qe.useLayoutEffect)((()=>()=>{t(li({formId:n,name:e}))}),[a,n,e,t]);const p=(0,Qe.useCallback)((t=>r(e,t.target.value)),[e,r]),d=(0,Qe.useCallback)((()=>{o(e,!0)}),[o,e]);return[(0,Qe.useMemo)((()=>({name:e,onInput:p,onBlur:d,value:s})),[e,p,d,s]),(0,Qe.useMemo)((()=>({isValid:u,error:l,touched:c})),[u,l,c])]}function iu(e){var{children:t,formId:n,persistData:r,onError:o,onSubmit:i,validationSchema:a}=e,s=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}(e,["children","formId","persistData","onError","onSubmit","validationSchema"]);const c=mt(),l=ct((e=>eu(e,{formId:n}))),[u,p]=(0,Qe.useState)(!1),[d,f]=(0,Qe.useState)({}),{isValid:h,errors:y}=function(e,t){const n=(0,Qe.useMemo)((()=>function(e,t={}){return Object.entries(t).reduce(((t,[n,r])=>{var o;const i=Array.isArray(r)?r:[r];for(let r=0;null!==(o=r<(null==i?void 0:i.length))&&void 0!==o&&o;r++)if(!i[r].fn(e[n],i[r].compareValue)){t[n]=i[r].errorText;break}return t}),{})}(e,t)),[e,t]);return{isValid:0===Object.keys(n).length,errors:n}}(l,a),m=(0,Qe.useMemo)((()=>Object.assign(Object.assign({},y),d)),[y,d]);(0,Qe.useLayoutEffect)((()=>{c(ai({formId:n,persistData:r}))}),[n,r,c]),(0,Qe.useEffect)((()=>()=>{c(si({formId:n}))}),[n,r,c]);const b=(0,Qe.useCallback)(((e,t)=>{c(ui({formId:n,name:e,value:t}))}),[n,c]),v=(0,Qe.useCallback)(((e,t)=>{c(pi({formId:n,name:e,touched:t}))}),[c,n]),g=(0,Qe.useCallback)(((e,t)=>{f((n=>Object.assign(Object.assign({},n),{[e]:t})))}),[f]),w=(0,Qe.useCallback)((e=>{e.preventDefault();const t="true"===e.submitter.getAttribute("aria-disabled");p(!t),!t&&h&&(c(Wr(!0)),i(l,{updateControlValue:b,setError:g}))}),[h,c,i,l,b,g]);(0,Qe.useEffect)((()=>{o&&o({errors:m,isSubmitted:u,isValid:0===Object.keys(m).length})}),[u,m,o]);const j=(0,Qe.useMemo)((()=>({formId:n,values:l,errors:m,isValid:0===Object.keys(m).length,isSubmitted:u,handleSubmit:w,validationSchema:a,updateControlValue:b,updateControlTouched:v})),[n,l,m,u,w,a,b,v]);return n?i?(0,k.jsx)(Xl,Object.assign({},s,{value:j},{children:t})):(console.error('"onSubmit" is required.'),null):(console.error('"formId" is required.'),null)}const au=["className","disableValidationClasses"];function su(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 cu(e,t,n){return t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const lu=function(e){let{className:t,disableValidationClasses:n}=e,r=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,au);const{handleSubmit:o,isValid:i,isSubmitted:a}=function(){const{handleSubmit:e,isSubmitted:t,isValid:n}=ru();return{handleSubmit:e,isSubmitted:t,isValid:n}}(),s=["form"];return!n&&a&&(s.push("form--submitted"),i?s.push("form--valid"):s.push("form--invalid")),(0,k.jsx)("form",function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?su(Object(n),!0).forEach((function(t){cu(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):su(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({onSubmit:o,className:T([...s,t])},r))};function uu({id:e,error:t}){const[n,r]=(0,Qe.useState)(!1);return(0,Qe.useEffect)((()=>{const e=setTimeout((()=>r(!0)),300);return()=>clearTimeout(e)}),[]),(0,k.jsx)("div",{className:T("error"),"aria-live":"assertive","aria-atomic":"true",children:n&&t&&(0,k.jsxs)("span",{id:e,className:T("error__message"),children:[(0,k.jsx)(gs,{name:"error",size:"16"}),t]})})}const pu=({contentHint:e,id:t,labelText:n,labelClass:r=T("label"),validity:o,errorText:i,children:a})=>(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)("label",{htmlFor:t,className:r,children:n}),e&&(0,k.jsx)("span",{id:`${t}-content-hint`,className:T("input__content-hint"),children:e}),(0,k.jsx)(uu,{id:`${t}-error`,error:!o&&i}),a]}),du=["id","name","type","labelText","labelClass","contentHint","aria-describedby"];function fu(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 hu(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?fu(Object(n),!0).forEach((function(t){yu(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):fu(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function yu(e,t,n){return t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const mu=function(e){let{id:t,name:n,type:r,labelText:o,labelClass:i,contentHint:a,"aria-describedby":s}=e,c=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,du);const{isSubmitted:l}=ru(),[u,{error:p}]=ou(n),d=l&&p,f=[];return s&&f.push(s),a&&f.push(`${t}-content-hint`),d&&f.push(`${t}-error`),(0,k.jsx)(pu,{id:t,contentHint:a,validity:!d,errorText:p,labelText:o,labelClass:i,children:(0,k.jsx)("input",hu(hu({id:t,name:n,type:r,"aria-invalid":d?"true":"false","aria-describedby":f.join(" ")||null},u),c))})};function bu({controlName:e,describedById:t}){const{t:n}=ma();return(0,k.jsxs)(lu,{noValidate:"true",className:T("options__form"),children:[(0,k.jsx)(mu,{name:e,type:"email",className:T("transcript__input"),"aria-describedby":t,labelClass:T("label"),labelText:n("options.sendTranscript.label")}),(0,k.jsx)("div",{className:T("options__actions"),children:(0,k.jsx)("button",{type:"submit",className:T("button","button--primary","options__submit"),children:n("options.sendTranscript.sendButtonText")})})]})}const vu="email",gu={sendTranscript:()=>{const[e,t]=(0,Qe.useState)(void 0),{hideOption:n}=Ba(),{focusButton:r}=$a(),{t:o}=ma(),i=Ja(),{sendAction:a}=Qi(),s=(0,Qe.useMemo)((()=>({[vu]:[Hl(Gl,o("options.sendTranscript.noEmailText")),Hl(Wl,o("options.sendTranscript.invalidEmailText"))]})),[o]),c=(0,Qe.useCallback)((e=>{const t=e[vu].trim();a({type:"send_transcript",body:{emailAddress:t}}),n(),r()}),[a,n,r]),l=(0,Qe.useCallback)((({isValid:e,isSubmitted:n})=>{t(n&&!e?"options--error":void 0)}),[t]);return(0,k.jsx)(zl,{className:e,headingText:o("options.sendTranscript.title"),cancelButtonText:o("options.cancelButtonText"),description:o("options.sendTranscript.description"),descriptionId:i,position:{vertical:"top",horizontal:"right"},children:(0,k.jsx)(iu,{formId:"sendTranscript",onSubmit:c,validationSchema:s,onError:l,children:(0,k.jsx)(bu,{controlName:vu,describedById:i})})})}},wu=()=>{const{optionActive:e}=Ba(),t=(0,Qe.useRef)(null),n=gu[e||t.current];return e&&(t.current=e),n?(0,k.jsx)(n,{}):null},ju=()=>{const{t:e}=ma(),{menuOptions:t,showOption:n,panelActive:r,hideOption:o}=Ba(),{id:i}=$a(),a=(0,Qe.useRef)(null),[s,c]=(0,Qe.useState)(!1),l=(0,Qe.useRef)(null),u=t.length,p=(0,Qe.useRef)(Array.from({length:u},(()=>(0,Xe.createRef)()))),d=(0,Qe.useRef)(!1),f=u>1,h=t[0],y=(0,Qe.useMemo)((()=>h?.name?.trim().replace(/\s+/g,"")),[h]);return(0,Qe.useEffect)((()=>()=>{clearTimeout(a.current)}),[]),(0,Qe.useEffect)((()=>{s&&!d.current&&requestAnimationFrame((async()=>{await Ca(60);const e=t.findIndex((e=>e.available)),n=-1===e?0:e;q(p.current[n])})),d.current=s}),[s,t]),u?(0,k.jsxs)("div",{className:T("options__container"),onKeyDown:e=>{s&&(V(e)===H.Escape&&(c(!1),q(l.current)),V(e)===H.Home&&(q(p.current[0]),e.preventDefault()),V(e)===H.End&&(q(p.current[u-1]),e.preventDefault()))},onfocusout:()=>{f&&(a.current=setTimeout((()=>{c(!1)}),200))},onfocusin:()=>{clearTimeout(a.current)},children:[(0,k.jsx)(Ul,{transitionStartState:Dl,isActive:r,children:(0,k.jsx)("div",{className:T("options__dialog"),children:(0,k.jsx)(wu,{})})}),f&&(0,k.jsx)(Ul,{isActive:s,transitionStartState:Dl,children:(0,k.jsx)("ul",{className:T(["options__menu"]),role:"menu",tabIndex:"-1","aria-labelledby":i,children:t.map((({name:r,title:o,available:i},a)=>(0,k.jsx)("li",{className:T("options__menu__item"),role:"menuitem","data-testid":r,children:(0,k.jsxs)("button",{type:"button",ref:e=>{p.current[a]=e},className:T(["button","button--secondary"]),onKeyDown:e=>((e,t)=>{if(V(e)===H.ArrowDown){const n=Math.min(u-1,t+1);q(p.current[t===n?0:n]),e.preventDefault()}if(V(e)===H.ArrowUp){const n=Math.max(0,t-1);q(p.current[t===n?u-1:n]),e.preventDefault()}})(e,a),onKeyPress:e=>((e,n)=>{const r=String.fromCharCode(e.charCode);if(1!==r.length||!r.match(/\S/))return;let o=-1;t.forEach(((e,t)=>{t>n&&e.title.charAt(0).toLowerCase()===r.toLowerCase()&&-1===o&&(o=t)})),-1!==o&&q(p.current[o])})(e,a),onClick:()=>((e,t)=>{t&&(c(!1),n(e))})(r,i),"aria-disabled":i?null:"true",children:[(0,k.jsxs)("span",{className:T("button__text"),children:[o,!i&&" "]}),!i&&(0,k.jsx)("span",{className:T("button__state"),children:e("options.unavailableText")})]})},r)))})}),(0,k.jsxs)("button",{type:"button",className:T(["button","button--secondary","chat__options__button",...!f&&y?[`chat__options__button--${y}`]:[]]),id:i,onClick:()=>{r&&o(),f?c((e=>!e)):h.available&&!r&&n(h.name)},onKeyDown:f?e=>{V(e)===H.ArrowDown&&(c(!0),e.preventDefault())}:null,ref:l,"aria-haspopup":f?"menu":null,"aria-expanded":f?s.toString():null,"aria-disabled":f||h.available?null:"true",children:[f&&(0,k.jsx)(gs,{name:"options",size:"32"}),(0,k.jsx)("span",{className:T("button__text"),children:f?e("options.openButtonText"):`${h.title}${h.available?"":" "}`}),!f&&!h.available&&(0,k.jsx)("span",{className:T("button__state"),children:e("options.unavailableText")})]})]}):null},Ou=({label:e,checked:t,description:n,onChange:r,id:o})=>(0,k.jsxs)("li",Object.assign({className:T("translation-options__item"),"aria-selected":t,role:"option",tabIndex:0,onClick:r,onKeyDown:e=>{"Space"!==e.code&&"Enter"!==e.code||(e.preventDefault(),r())},id:o},{children:[(0,k.jsx)(gs,{alt:"",name:"check",size:"16"}),e," ",n&&(0,k.jsxs)("span",{children:["(",n,")"]})]})),xu=({onChange:e,describedById:t})=>{const{context:{locale:n}}=xr(),{t:r}=ma(),{focusContainer:o}=Za(),{languages:i,currentLocale:a,enableTranslations:s,disableTranslations:c}=Qa(),l=({locale:t})=>()=>{t===a||n===t?c():s(t),e(),o()},u=(0,Qe.useMemo)((()=>[...i].sort(((e,t)=>e.locale===n?-1:t.locale===n?1:e.nativeName.localeCompare(t.nativeName,void 0,{sensitivity:"base"})))),[i,n]);return(0,k.jsx)("ul",Object.assign({"aria-describedby":t,role:"listbox",tabIndex:-1,className:T("translation-options")},{children:u.map(((e,t)=>{const n=0===t,o=a===e.locale||!a&&n;return(0,k.jsx)(Ou,{id:e.locale,label:e.nativeName,checked:o,description:n&&r("translations.settings.original"),onChange:l(e)},e.locale)}))}))},Su=function({onClose:e,position:t}){const{t:n}=ma(),r=Ja();return(0,k.jsx)(zl,Object.assign({onCancel:e,headingText:n("translations.menu.title"),cancelButtonText:n("translations.settings.cancelButtonText"),description:n("translations.menu.description"),descriptionId:r,position:t,disableButtonFocusing:!0},{children:(0,k.jsx)(xu,{describedById:r,onChange:e})}))};function _u({children:e,position:t={horizontal:"left",vertical:"top"},classNames:n}){const[r,o]=(0,Qe.useState)(!1),i=(0,Qe.useRef)(null),a=Ja();return(0,k.jsxs)("div",Object.assign({className:T("translations__container"),onKeyDown:e=>{r&&V(e)===H.Escape&&(o(!1),q(i.current))}},{children:[(0,k.jsx)(Ul,Object.assign({onOutTransitionComplete:()=>{},onInTransitionComplete:()=>{},timeout:0,transitionStartState:Dl,isActive:r},{children:(0,k.jsx)("div",Object.assign({className:T("options__dialog"),role:"dialog"},{children:(0,k.jsx)(Su,{onClose:()=>{o(!1)},position:t})}))})),(0,k.jsx)("button",Object.assign({type:"button",className:T(["button","chat__options__button",...n]),id:a,onClick:()=>{o(!r)},onKeyDown:e=>{V(e)===H.ArrowDown&&(o(!0),e.preventDefault())},ref:i,"aria-haspopup":"dialog","aria-expanded":r.toString()},{children:e}))]}))}function Eu(){const{menuOptions:e,allowOptionSelection:t}=Ba(),{isAvailable:n}=Qa(),r=ct(wa),{t:o,locale:i}=ma(),a=es(i);if(!n&&(!t||!e.length)||r)return null;const s=o("translations.settings.openButtonText",{hasLanguage:!!a,language:a});return(0,k.jsxs)("div",{className:T("chat__options"),children:[n&&(0,k.jsx)("div",{className:T("chat__options-item","chat__options-item--left"),children:(0,k.jsxs)(_u,{classNames:["button--secondary"],children:[(0,k.jsx)(gs,{alt:s,name:"newTranslation",size:"16"}),(0,k.jsx)("span",{className:T("button__text"),children:s})]})}),t&&(0,k.jsx)("div",{className:T("chat__options-item","chat__options-item--right"),children:(0,k.jsx)(ju,{})})]})}const Cu=()=>{const{scrollToRef:e,unreadIds:t}=(0,Qe.useContext)(Cl),{isMinimized:n}=Hi(),{t:r}=ma();return(0,k.jsx)(Ul,Object.assign({isActive:!!t.length&&!n},{children:(0,k.jsx)("div",Object.assign({className:T("unread-messages")},{children:(0,k.jsxs)("button",Object.assign({type:"button",className:T("button","button--primary"),onClick:e},{children:[r("message.unreadMessagesCount",{unreadCount:t.length}),(0,k.jsx)(gs,{name:"chevronDown",size:"32",alt:""})]}))}))}))},Pu=wr(Cr,(e=>e.filter((e=>{var t;return Zr(e)&&"service_data"!==e.type&&(null===(t=e.payload)||void 0===t?void 0:t.messageStatus)===a})).map((e=>e.payload.id))));const Tu=e=>{const t=(0,Qe.useRef)(),[n,r]=(0,Qe.useState)(!0),o=ct(Pu),i=Pr(),a=Tr(),{isOpen:s}=Hi(),c=_r().loadedImageEventIds,l=ct((e=>e.state.isLastEventFromClient));(0,Qe.useEffect)((()=>{const e=t.current,n=()=>{const{scrollHeight:t,scrollTop:n,clientHeight:o}=e,i=Math.abs(t-n-o)>10;r(!i)};return e.addEventListener("scroll",n),()=>e.removeEventListener("scroll",n)}),[]);const u=(0,Qe.useCallback)((()=>{requestAnimationFrame((()=>function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))}(void 0,void 0,void 0,(function*(){var e,n;yield Ca(30),null===(e=t.current)||void 0===e||e.scrollTo({top:null===(n=t.current)||void 0===n?void 0:n.scrollHeight,left:0,behavior:"auto"})}))))}),[]);return(0,Qe.useEffect)((()=>{l&&u()}),[l,u]),(0,Qe.useEffect)((()=>{n&&u()}),[n,o,i,a,s,c,u]),{containerRef:t,unreadIds:o,scrollToRef:()=>{var n,r;const i=null===(n=e[null==o?void 0:o.at(0)])||void 0===n?void 0:n.current;null===(r=t.current)||void 0===r||r.scrollTo({top:null==i?void 0:i.offsetTop,behavior:"auto",left:0})},scrollToBottom:u}},ku=({children:e})=>{const t=Pr(),n=(0,Qe.useMemo)((()=>t.reduce(((e,t)=>(e[t.payload.id]=(0,Xe.createRef)(),e)),{})),[t]),{scrollToRef:r,scrollToBottom:o,containerRef:i,unreadIds:a}=Tu(n);return(0,k.jsx)(Cl.Provider,Object.assign({value:{eventRefs:n,unreadIds:a,scrollToRef:r,scrollToBottom:o,containerRef:i}},{children:(0,k.jsxs)("div",Object.assign({className:T("chat__container")},{children:[(0,k.jsx)("div",Object.assign({className:T("chat__container__scroll-area"),ref:i},{children:e})),(0,k.jsx)(Cu,{})]}))}))},Au=({baseClassName:e,children:t,title:n})=>{const r=Ar(),o=Ja();return(0,k.jsxs)("section",{id:r,className:T(e),"aria-describedby":o,tabIndex:"-1",children:[(0,k.jsx)("h2",{className:T(`${e}__title`),id:o,children:n}),t]})},Nu=()=>{const{t:e}=ma(),t=ka(),n=Ha(),{emitEvent:r}=Qi(),{isActive:o,remaining:i,timer:a,endCountdown:s}=Ga(),c=i>0,l=e(c?"idleDetachWarning.countdownTitle":"idleDetachWarning.notifyTransferText");return(0,k.jsx)(Au,{baseClassName:"idle",title:l,children:c&&(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)("div",{className:T("idle__count-container"),children:o&&(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)("span",{className:T("idle__count-text"),children:e("idleDetachWarning.countdownText")}),(0,k.jsx)("span",{className:T("idle__count-timer"),children:e("idleDetachWarning.countdownTimer",a)})]})}),(0,k.jsxs)("div",{className:T("idle__options"),children:[(0,k.jsx)("button",{type:"button",className:T("button","button--primary"),onClick:()=>{n(),s(!0),t(),r("idleTimer.selectContinue")},children:e("idleDetachWarning.continueButton")}),(0,k.jsx)("button",{type:"button",className:T("button","button--primary"),onClick:()=>{s(),t(),r("idleTimer.selectEnd")},children:e("idleDetachWarning.detachButton")})]})]})})},Iu=()=>{const{t:e}=ma(),t=Ha(),{name:n}=Ir()||{},{continueChat:r,restartChat:o}=Ka();return(0,k.jsx)(Au,{baseClassName:"prompt",title:e("resumeConversationPrompt.title",{name:n}),children:(0,k.jsxs)("div",{className:T("prompt__options"),children:[(0,k.jsx)("button",{type:"button",className:T("button","button--primary"),onClick:()=>{t(),r()},children:e("resumeConversationPrompt.continueButton")}),(0,k.jsx)("button",{type:"button",className:T("button","button--primary"),onClick:o,children:e("resumeConversationPrompt.detachButton")})]})})};function Ru(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 Du(e,t,n){return t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Mu=()=>{const{default:e,active:t,userSelected:n,options:r,optionsOverride:o}=_r().entryMeta,i=mt(),a=n||t||e,s=o[a]||r[a]||{},c=(0,Qe.useCallback)((e=>{i(jo(e))}),[i]),l=(0,Qe.useCallback)((e=>{i(go(e))}),[i]),u=(0,Qe.useCallback)((e=>{i(Uo(e))}),[i]),p=(0,Qe.useCallback)((()=>{n?u(null):l(e)}),[n,e,u,l]);return{activeEntry:a,activeEntryOptions:s,setActiveEntryType:l,setUserEntryType:u,cancelEntrySelection:p,setBlockAutoEntrySwitch:c}};function Lu({controlName:e,skipLinkId:t}){const{t:n}=ma(),{sendAssertive:r}=va(),{emitEvent:o}=Qi(),i=(()=>{const{sendAction:e}=Qi(),{features:t}=Ba(),{typingPeekahead:n}=t||{},r=(0,Qe.useRef)(null),o=(0,Qe.useRef)(null),i=(0,Qe.useRef)(!1),a=(0,Qe.useRef)(null);(0,Qe.useEffect)((()=>()=>{clearInterval(a.current),clearTimeout(r.current),clearTimeout(o.current)}),[]);const s=(t,r)=>{e(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ru(Object(n),!0).forEach((function(t){Du(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ru(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({type:l,state:t},n&&n.enabled?{body:{currentMessage:r}}:{}))};return e=>{e.code&&"Enter"===e.code||13===e.keyCode||(i.current=!0,a.current||(s(!0,e.target.value),a.current=setInterval((()=>{i.current?n&&n.enabled&&s(!0,e.target.value):(clearInterval(a.current),a.current=null)}),2e3)),clearTimeout(r.current),clearTimeout(o.current),r.current=setTimeout((()=>{i.current=!1}),300),o.current=setTimeout((()=>{s(!1,e.target.value)}),2e3))}})(),{setBlockAutoEntrySwitch:a}=Mu(),{hasCharacterLimit:s,characterLimit:c,reachedCharacterWarning:u,reachedCharacterLimit:p,remainingChars:d}=function(e){const{t}=ma(),{sendAssertive:n}=va(),{hasLimit:r,limit:o}=(()=>{const{entryMeta:{options:{text:e},optionsOverride:{text:t}}}=_r(),{limit:n}=t||e||{limit:null};return{hasLimit:null!==n,limit:null!==n?n:null}})(),i=(0,Qe.useMemo)((()=>U(n,300)),[n]),a=(0,Qe.useMemo)((()=>U(((e,n)=>{e&&i(t("input.srCharacterLimitText",{limit:n}))}),300)),[i,t]),[{value:s}]=ou(e),c=r&&s?o-s.length:o,l=!!r&&c<=50,u=!!r&&c<0;return(0,Qe.useEffect)((()=>{a(l,c)}),[l,c,a]),{hasCharacterLimit:r,characterLimit:o,reachedCharacterWarning:l,reachedCharacterLimit:u,remainingChars:c}}(e),[{value:f}]=ou(e),h=!!f,y=(0,Qe.useCallback)((()=>{u&&r(n("input.srCharacterLimitText",{limit:d})),o("ui.inputFocus")}),[n,r,u,d,o]),m=(0,Qe.useMemo)((()=>n("input.inputPlaceholder",{hasLimit:s,limit:s?c:null})),[n,s,c]),b=(0,Qe.useMemo)((()=>n("input.inputLabel",{hasLimit:s,limit:s?c:null})),[n,s,c]);return(0,Qe.useLayoutEffect)((()=>(a(h),()=>{a(!1)})),[a,h]),(0,k.jsxs)(lu,{className:T("entry-form"),disableValidationClasses:!0,noValidate:"true",children:[(0,k.jsxs)("div",{className:T(["input--text__container",...u&&!p?["character-warning"]:[],...p?["character-exceeded"]:[]]),children:[(0,k.jsx)(mu,{id:t,type:"text",name:e,className:T("input__text"),autocomplete:"off",placeholder:m,labelText:b,labelClass:T("visually-hidden"),"aria-invalid":s?p:null,onKeyUp:i,onFocus:y}),(0,k.jsx)("div",{className:T("character-count"),children:u&&(0,k.jsx)("span",{children:d})})]}),(0,k.jsx)("button",{className:T("button","input__submit"),type:"submit",onPointerDown:e=>{e.preventDefault()},"aria-disabled":!h||p?"true":null,children:(0,k.jsx)(gs,{name:"send",size:"32",alt:n("input.sendMessage")})})]})}function Uu(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 Fu(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Uu(Object(n),!0).forEach((function(t){Bu(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Uu(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Bu(e,t,n){return t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function $u(){return $u=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},$u.apply(this,arguments)}const zu="textMessageEntry";function Hu(e){let t=$u({},(function(e){if(null==e)throw new TypeError("Cannot destructure "+e)}(e),e));const{isOpen:n,setVisibility:r}=Hi(),o=Ar(),i=ka(),{sendMessage:a}=Qi(),s=(0,Qe.useCallback)(((e,{updateControlValue:t})=>{a({body:e[zu]}),t(zu,""),i(),n||r(S.open)}),[a,i,n,r]);return(0,k.jsx)(iu,Fu(Fu({},t),{},{formId:"textEntry",persistData:!0,onSubmit:s,children:(0,k.jsx)(Lu,{controlName:zu,skipLinkId:o})}))}const Vu=()=>{const{t:e}=ma(),{currentUploads:t}=Ma();return(0,k.jsx)("div",{className:T("progress"),children:t.map((({id:t,name:n,progress:r,uploading:o,error:i})=>(0,k.jsxs)("div",{className:T("progress_container"),children:[(0,k.jsxs)("div",{className:T("progress__text"),children:[(0,k.jsx)("span",{className:T("progress__text--file-name"),children:n}),(0,k.jsx)("span",{className:T("progress__text--percentage"),children:`${r}%`})]}),(0,k.jsx)(uu,{error:i}),(0,k.jsx)("progress",{className:T("progress__bar"),role:"progressbar","aria-valuemin":"0","aria-valuemax":"100","aria-label":e("fileUpload.srProgressLabel",{fileName:n}),max:"100","aria-valuenow":r,value:r,"aria-busy":o,children:`${r}%`})]},t)))})};function qu({id:e,name:t,labelText:n,contentHint:r,outputText:o,accept:i}){const{isSubmitted:a}=ru(),[s,c]=(0,Qe.useState)(!1),[{onInput:l,onBlur:u},{error:p}]=ou(t),d=Ja(),f=Ja(),h=Ja(),y=a&&p,m=[h];r&&m.push(f),y&&m.push(d);const b=(0,Qe.useCallback)((()=>{c(!0)}),[c]),v=(0,Qe.useCallback)((()=>{c(!1),u()}),[c,u]),g=(0,Qe.useCallback)((e=>{const t={target:{value:e.target.files}};l(t)}),[l]);return(0,k.jsxs)("div",{className:T("upload__container"),children:[r&&(0,k.jsx)("span",{className:T("upload__content-hint"),id:f,children:r}),(0,k.jsx)(uu,{id:d,error:y&&p}),(0,k.jsx)("div",{className:T(["file-upload",...s?["focus-within"]:[]]),children:(0,k.jsxs)("label",{htmlFor:e,className:T("upload__label"),children:[(0,k.jsx)(gs,{name:"upload",size:"32"}),(0,k.jsxs)("div",{children:[(0,k.jsx)("span",{className:T(["upload__label--text"]),children:n}),(0,k.jsx)("input",{id:e,className:T("upload__input"),type:"file",name:t,onChange:g,"aria-invalid":y?"true":"false","aria-describedby":m.join(" "),accept:i||null,onFocus:b,onBlur:v}),(0,k.jsx)("span",{className:T("upload__output"),"aria-hidden":"true",id:h,children:o})]})]})})]})}function Wu({skiplinkId:e,controlName:t,accept:n,contentHint:r,isUploading:o,isComplete:i,onClickCancel:a}){const{t:s}=ma(),[{value:c}]=ou(t),l=c&&c.length>0,u=l?c[0].name:"";return(0,k.jsxs)(lu,{className:T("upload-form"),children:[(0,k.jsx)(qu,{name:t,id:e,accept:n,labelText:s("fileUpload.labelText"),outputText:s("fileUpload.selectedText",{hasFile:l,filename:u}),contentHint:r}),(0,k.jsxs)("div",{className:T("upload__button-container"),children:[(0,k.jsx)("button",{id:o||!i?e:void 0,type:"button",onClick:a,className:T("button","button--secondary","upload__cancel"),children:s("fileUpload.cancelButtonText")}),(0,k.jsx)("button",{className:T("button","button--primary"),type:"submit",children:s("fileUpload.uploadButtonText")})]})]})}const Gu="fileListForm",Ku="fileList",Ju=()=>{const{t:e}=ma(),{sendPolite:t,sendAssertive:n}=va(),r=Ar(),o=ka(),{serviceAllowsUploads:i,allowedMimeTypes:a,maxSize:s}=Da(),c=(0,Qe.useRef)(null),l=(0,Qe.useRef)(i),{cancelEntrySelection:u}=Mu(),{uploadFile:p,clearUploads:d,isUploading:f,isComplete:h}=Ma(),{hasFile:y,selectedFileName:m,uploadHandle:b,hasServerError:v,progress:g}=((e,t)=>{const n=ct((n=>tu(n,{formId:e,name:t}))),{currentUploads:r}=Ma(),o=n&&n.length>0;let i=null,a=!1,s=0;if(r&&r.length>0){const e=r[0];i=e.uploadHandle,a=!!e.error,s=e.progress}return{hasFile:o,selectedFileName:o?n[0].name:"",uploadHandle:i,hasServerError:a,progress:s}})(Gu,Ku),w=Ja(),j=(0,Qe.useRef)(!0),O=e("fileUpload.contentHint",{size:$(s)}),x=(0,Qe.useRef)(""),S=(0,Qe.useRef)(null);(0,Qe.useEffect)((()=>{x.current&&S.current?.contains(document.activeElement)&&"INPUT"===document.activeElement.tagName&&n(O),x.current=O}),[O,n]),(0,Qe.useEffect)((()=>{g>0&&t(1===g?e("fileUpload.srStartedText"):`${g}%`)}),[g,t,e]),(0,Qe.useEffect)((()=>{j.current||f||!h||(d(),u(),o(),setTimeout((()=>{t(e("fileUpload.srCompleteText"))}),300)),j.current=h}),[f,h,d,u,o,t,e]);const _=(0,Qe.useCallback)((({fileList:e})=>{p(e[0]),o()}),[p,!1,o]),E=(0,Qe.useCallback)((()=>{b&&b.abort(),d(),u(),o()}),[b,d,u,o]),C=(0,Qe.useMemo)((()=>({[Ku]:[Hl((()=>i),e("fileUpload.errors.unavailable")),Hl(ql,e("fileUpload.errors.noFile")),Hl(Vl,e("fileUpload.errors.tooLarge"),s)]})),[s,i,e]);return(0,k.jsx)("div",{className:T(["upload",...v?["upload--error"]:[]]),ref:S,children:(0,k.jsxs)(iu,{formId:Gu,persistData:!0,onSubmit:_,validationSchema:C,children:[(f||!h)&&(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(Vu,{}),(0,k.jsx)("div",{className:T("upload__button-container"),children:(0,k.jsx)("button",{id:f||!h?r:void 0,type:"button",onClick:E,ref:c,className:T("button","button--secondary","upload__cancel"),children:e("fileUpload.cancelButtonText")})})]}),!f&&h&&(0,k.jsx)(Wu,{controlName:Ku,skiplinkId:r,accept:a.join(", "),contentHint:O,isComplete:h,isUploading:f,outputText:e("fileUpload.selectedText",{hasFile:y,filename:m}),onClickCancel:E}),!l.current&&(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)("span",{className:T("notification"),id:w,children:e("fileUpload.unavailableText")}),(0,k.jsx)("div",{className:T("upload__button-container"),children:(0,k.jsx)("button",{id:f||!h?r:void 0,type:"button",onClick:E,className:T("button","button--secondary","upload__cancel"),children:e("fileUpload.cancelButtonText")})})]})]})})},Xu=()=>{const{t:e}=ma(),{showFileUpload:t,serviceAllowsUploads:n}=Da(),[r,o]=(0,Qe.useState)(n),a=ka(),s=(0,Qe.useRef)(null),{setUserEntryType:c,activeEntry:l}=Mu(),u=(0,Qe.useRef)(null),{sendPolite:p}=va(),d=!!Ir();return(0,Qe.useEffect)((()=>{W(u.current,(()=>{n||a()})),o(n)}),[n,a]),(0,Qe.useEffect)((()=>{s.current&&!n&&p(e("fileUpload.srUnavailableText")),!1===s.current&&n&&p(e("fileUpload.srAvailableText")),d&&(s.current=n)}),[n,d,p,e]),!t&&l!==i&&(0,k.jsx)(Ul,{isActive:r,transitionStartState:Ml,children:(0,k.jsx)("div",{className:T("upload-toggle-wrapper"),children:(0,k.jsx)(Ul,{isActive:r,transitionStartState:Ll,children:(0,k.jsx)("button",{className:T(["button","button--secondary","upload-toggle"]),ref:u,"aria-disabled":r?null:"true",type:"button",onClick:r?()=>{c(i),a()}:null,children:(0,k.jsx)(gs,{name:"file",size:"32",alt:e("fileUpload.toggleButtonText")})})})})})};function Qu(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 Yu(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Qu(Object(n),!0).forEach((function(t){Zu(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Qu(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Zu(e,t,n){return t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const ep=()=>{const{isOpen:e}=Hi(),t=(0,Qe.useRef)(null),{hasCountdown:n}=Ga(),[r,o]=(0,Qe.useState)(n),{hasPrompt:a}=Ka(),[s,c]=(0,Qe.useState)(a),l=ka(),u=(0,Qe.useRef)(!1),{activeEntry:p}=Mu(),[d,f]=(0,Qe.useState)({text:Hu,upload:Ju}),[h,y]=(0,Qe.useState)((()=>p)),m=xr(),{accountAllowsUploads:b}=Da(),v=(0,Qe.useCallback)((()=>{W(t.current,l)}),[l]);(0,Qe.useEffect)((()=>{const{customComponents:e}=m,{entry:t}=e||{};t&&f((e=>Yu(Yu({},e),t)))}),[m]),(0,Qe.useEffect)((()=>{v(),o(n),c(a)}),[n,a,v]),(0,Qe.useEffect)((()=>{y(p),v()}),[p,v,t]),u.current=!(!t.current||!t.current.contains(document.activeElement));const g=d[h];return(0,k.jsxs)("div",{className:T("chat__entry"),ref:t,children:[r&&(0,k.jsx)(Nu,{}),s&&(0,k.jsx)(Iu,{}),(0,k.jsxs)("div",{className:T(["entry__body",...n||a?["entry__body--hidden"]:[]]),children:[h!==i&&b&&e&&(0,k.jsx)(Xu,{}),(0,k.jsx)(g,{})]})]})},tp=()=>{const{t:e}=ma(),{isOpen:t,closeChat:n}=Hi(),{isWindow:r}=Rr();return t&&r?(0,k.jsx)("button",{type:"button",className:T("button","collapse-button"),onClick:n,children:(0,k.jsx)(gs,{name:"chevronDown",size:"32",alt:e("window.srCollapseButton")})}):null},np=({children:e,handleClose:t,title:n,closeButtonText:r,srCloseButtonText:o,id:i})=>{const a=Ja();return(0,k.jsxs)("section",Object.assign({tabIndex:-1,id:i,"aria-labelledby":n?a:void 0,className:T("chat-status",!n&&"chat-status--condensed")},{children:[(0,k.jsxs)("div",Object.assign({className:T("chat-status__body")},{children:[n?(0,k.jsx)("h2",Object.assign({className:T("chat-status__title"),id:a},{children:n})):null,e]})),"function"==typeof t&&(0,k.jsxs)("button",Object.assign({type:"button",onClick:t,className:T("button","button--tertiary","chat-status__close")},{children:[r||(0,k.jsx)(gs,{name:"close",size:"16",alt:""}),o&&(0,k.jsx)("span",Object.assign({className:T("visually-hidden")},{children:o}))]}))]}))};function rp(){const{t:e}=ma(),{id:t}=Za(),n=ct(wa),{disableTranslations:r,currentLocale:o}=Qa(),i=es(o),a=ka(),s=e("translations.status.label",{language:i}),c=(0,Qe.useCallback)((()=>{r(),a()}),[r,a]);return n?null:(0,k.jsx)(np,{handleClose:c,title:s,id:t,closeButtonText:e("translations.status.stopText"),srCloseButtonText:e("translations.status.srStopText")})}const op=({handleClick:e,icon:t,title:n,srButtonText:r})=>(0,k.jsxs)("button",Object.assign({type:"button",onClick:e,className:T("button","button--primary","chat-status__button")},{children:[(0,k.jsx)(gs,{name:t,size:"16",alt:""}),n,r&&(0,k.jsx)("span",Object.assign({className:T("visually-hidden")},{children:r}))]}));function ip(){const{showProposal:e,translationProposal:t,dismissTranslationProposal:n,activateTranslationProposal:r}=(()=>{const{isActive:e,languages:t}=Qa(),n=mt(),{sendAction:r}=Qi(),{translationProposal:o}=ct((e=>e.translations)),{enableTranslations:i}=Qa(),{isOpen:a}=Hi(),{locale:s}=ma(),c=null==o?void 0:o.proposedLocale,l=es(c),u=(0,Qe.useMemo)((()=>null!==o&&!e&&a&&s!==c&&t.some((e=>e.locale===c))),[o,e,a,s,c,t]);return{activateTranslationProposal:()=>{i(null==o?void 0:o.proposedLocale,b)},dismissTranslationProposal:()=>{r({type:d,body:{type:m}}),n(Mi())},proposedLocale:c,proposedLocaleNativeName:l,showProposal:u,translationProposal:o}})(),{id:o}=Za();return e?(0,k.jsx)(np,Object.assign({handleClose:n,srCloseButtonText:t.srDismissButtonText,id:o,title:t.titleLabel},{children:(0,k.jsx)(op,{handleClick:r,icon:"newTranslation",title:t.buttonLabel})})):null}function ap(){const e=ct(wa),{isActive:t}=Qa();return e?null:t?(0,k.jsx)(rp,{}):(0,k.jsx)(ip,{})}const sp=()=>{const{meta:{originalError:e,title:t,message:n,buttonText:r,action:o,srText:i}}=ja(),a=Qi(),s=Ja(),{sendPolite:c}=va(),l=ka(),u="SeamlySessionExpiredError"===e?.name;return(0,Qe.useEffect)((()=>{!u&&i&&setTimeout((()=>{c(i)}),200)}),[c,i,u]),u?(0,k.jsx)(k.Fragment,{}):(0,k.jsxs)("section",{className:T("interrupt"),"aria-labelledby":s,children:[(0,k.jsx)(tp,{}),(0,k.jsxs)("div",{className:T("interrupt__body"),children:[(0,k.jsx)("h2",{id:s,className:T("interrupt__title"),children:t}),(0,k.jsx)("p",{className:T("interrupt__message"),children:n}),r&&o&&(0,k.jsx)("div",{className:T("interrupt__actions"),children:(0,k.jsx)("button",{type:"button",className:T("button","button--primary"),onClick:()=>{a[o]&&a[o](),l()},children:r})})]})]})},cp=function({children:e}){const t=ct(wa),{isOpen:n}=Hi();return t?(0,k.jsx)(sp,{}):(0,k.jsxs)(k.Fragment,{children:[(0,k.jsxs)(ku,{children:[(0,k.jsxs)("div",{className:T("chat__container__header"),children:[(0,k.jsx)(ap,{}),(0,k.jsx)(tp,{})]}),e]}),(0,k.jsx)(ep,{}),n&&(0,k.jsx)(Eu,{})]})};function lp({event:e}){const[t]=Pl(e);return(0,k.jsx)(t,{event:e})}function up(){const{preChatEvents:e,layoutMode:t}=xr(),n=ct(wa),{isOpen:r}=Hi(),o=!(n||!e?.length||r);return o&&(0,k.jsx)("ul",{className:T("pre-chat-messages",`pre-chat-messages--${t}`),"aria-hidden":!o,children:e.map((e=>(0,k.jsx)("li",{className:T("pre-chat-messages__message"),children:(0,k.jsx)(lp,{event:e})},e.payload.id)))})}const pp=()=>{const e=function(){const{startChatIcon:e}=xr();return e}(),t=Ir(),n=ct(wa),r=t&&!n,o=r?t.avatar:e;return o?(0,k.jsx)("img",{className:T(r?"avatar":"icon"),src:o,alt:""}):(0,k.jsx)(gs,{name:"avatar",size:"32"})},dp=({onClick:e})=>{const t=Gi(),{t:n}=ma(),r=t()?n("window.openButton.srContinue"):n("window.openButton.srStart"),o=ka(),{isOpen:i}=Hi(),a=kr(),s=(0,Qe.useCallback)((()=>{e(),o()}),[o,e]);return(0,k.jsx)(Ul,{isActive:!i,transitionStartState:Ml,children:(0,k.jsxs)("button",{className:T("window-open-button"),"aria-label":r,"aria-hidden":i,onClick:s,children:[(0,k.jsx)("span",{className:T("message-count"),"aria-hidden":"true",children:!!a&&a}),(0,k.jsx)(pp,{})]})})},fp={app:()=>(0,k.jsx)($l,{children:(0,k.jsx)(cp,{children:(0,k.jsx)(Nl,{})})}),inline:()=>{const{showInlineView:e,containerRef:t}=(()=>{const e=mt(),{connectWhenInView:t}=xr(),n=ct(Mr),{containerRef:r,isVisible:o}=Vi({enabled:t,freezeOnceVisible:!0});return(0,Qe.useEffect)((()=>{o&&e(Bi())}),[e,o]),{containerRef:r,showInlineView:n}})(),{isOpen:n}=Hi();return(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(Ul,{isActive:!n,transitionStartState:Ml,children:(0,k.jsxs)("div",{ref:t,className:T("unstarted-wrapper","unstarted-wrapper--inline"),children:[(0,k.jsx)(up,{}),(0,k.jsx)(Fl,{})]})}),(0,k.jsx)(Ul,{isActive:n,transitionStartState:Ml,children:(0,k.jsx)($l,{ref:t,children:e&&(0,k.jsx)(cp,{children:n&&(0,k.jsx)(Nl,{})})})})]})},window:()=>{const{isOpen:e,openChat:t}=Hi(),n=Hr(),{t:r}=ma(),o=r("window.chat.continue"),i=(0,Qe.useMemo)((()=>({payload:{body:{text:o}}})),[o]);return(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(dp,{onClick:t}),(0,k.jsx)(Ul,{isActive:!e&&!n,transitionStartState:Ml,children:(0,k.jsx)("div",{className:T("unstarted-wrapper","unstarted-wrapper--window"),children:(0,k.jsx)(up,{})})}),(0,k.jsx)(Ul,{isActive:!e&&n,transitionStartState:Dl,children:(0,k.jsx)("div",{className:T("unstarted-wrapper","unstarted-wrapper--window","unstarted-wrapper--continue"),children:(0,k.jsx)(Kc,{event:i})})}),(0,k.jsx)(Ul,{isActive:e,transitionStartState:Dl,children:(0,k.jsx)($l,{children:(0,k.jsx)(cp,{children:(0,k.jsx)(Nl,{})})})})]})}},hp=({children:e})=>{const[,t]=Pa(),{namespace:n,layoutMode:r,zIndex:o}=xr(),{isOpen:i,isVisible:a}=Hi(),s=_a(),c=Hr(),{locale:l}=ma(),u=fp[r],p=(0,Qe.useCallback)((e=>{t(e)}),[t]),d=(0,Qe.useMemo)((()=>{if(l&&document.querySelector("html").getAttribute("lang")!==l)return l}),[l]);if(!u)return console.warn('"layoutMode" should be one of "app", "inline" or "window"'),null;const f=["app",`app--layout-${r}`,`namespace--${n}`,...s];return i||"app"===r||f.push("app--collapsed"),c&&f.push("app--user-responded"),a&&(0,k.jsx)("div",{className:T(f),lang:d,tabIndex:"-1","data-nosnippet":!0,style:{zIndex:o},ref:p,children:e||(0,k.jsx)(u,{})})};function yp(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 mp(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?yp(Object(n),!0).forEach((function(t){bp(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):yp(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function bp(e,t,n){return t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const vp=e=>(0,k.jsx)(Sl,mp(mp({},e),{},{children:(0,k.jsx)(hp,{})}));var gp=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 o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n};class wp{constructor(e,t){const{namespace:n="",parentElement:r,showFaq:o}=e,i=gp(e,["namespace","parentElement","showFaq"]);this.config=Object.assign(Object.assign({},i),{namespace:n,showFaq:!1!==o}),this.namespace=n,this.parentElement=r,this.externalApi=t,this.api=new Ge({layoutMode:e.layoutMode,namespace:e.namespace,config:e.api,context:e.context}),this.eventBus=new(Je()),this.functions={},this.registerFunctions({on:this.eventBus.on,off:this.eventBus.off}),this.eventBus.on("function.register",((e,t)=>this.registerFunction(e,t))),this.eventBus.on("function.unregister",((e,t)=>this.unregisterFunction(e,t)))}render(){return function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))}(this,void 0,void 0,(function*(){const e=this.config.customComponents||{},{view:t}=e,n=gp(e,["view"]),r=Object.assign(Object.assign({},this.config),{customComponents:Object.keys(n).length?n:void 0}),o=function({initialState:e,api:t,eventBus:n,config:r}){return Xn({reducer:{state:Ho,app:Gr,config:Qo,i18n:bi,translations:Li,visibility:$i,forms:di,interrupt:Yr},preloadedState:e,middleware:e=>e({thunk:{extraArgument:{api:t,eventBus:n,config:r}},serializableCheck:!1}).concat([ti({api:t}),gi({api:t}),xi({api:t}),Ui])})}({api:this.api,eventBus:this.eventBus,config:r,initialState:void 0});o.dispatch(Ko(r)),yield o.dispatch(dr());try{const{locale:e}=yield o.dispatch($r()).unwrap();yield o.dispatch(hr(e))}catch(e){}o.dispatch(Fr()),t?(0,Xe.render)((0,k.jsx)(Sl,Object.assign({eventBus:this.eventBus,store:o,api:this.api},{children:(0,k.jsx)(t,{})})),this.parentElement):(0,Xe.render)((0,k.jsx)(vp,{config:r,eventBus:this.eventBus,store:o,api:this.api}),this.parentElement)}))}destroy(){(0,Xe.render)(null,this.parentElement),this.eventBus.off(),this.api.disconnect(),delete this.functions}registerFunctions(e){Object.entries(e).forEach((([e,t])=>{this.registerFunction(e,t)}))}registerFunction(e,t){this.functions[e]=this.functions[e]||[],this.functions[e].push(t),this.externalApi.handleActions()}unregisterFunction(e,t){const n=this.functions[e];n&&n.length&&(this.functions[e]=n.filter((e=>e!==t)))}execFunction(e,...t){const n=this.functions[e];return!(!n||!n.length||(n.forEach((n=>{try{n(...t)}catch(t){console.error(`Action(${e}) failed: `,t)}})),0))}}function jp(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 Op(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?jp(Object(n),!0).forEach((function(t){xp(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):jp(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function xp(e,t,n){return t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Sp=e=>"object"==typeof e&&"action"in e,_p=e=>Op(Op({},e),{},{args:Array.isArray(e.args)?e.args:[e.args]}),Ep=class{constructor(e){this._waitingActions=[],this._instances={},this.appConfig=e,this.context={}}push(...e){(e=e.filter(Sp).map(_p)).length&&(this._waitingActions.push(...e),this.handleActions())}handleActions(){const e=this._waitingActions;this._waitingActions=[],e.forEach((e=>{switch(e.action){case"init":this.handleInit(e);break;case"destroy":this.handleDestroy(e);break;default:this.handleAction(e)||this.setContext(e.action,...e.args)||this._waitingActions.push(e)}}))}instanceInitializing(e){const t=Object.keys(this._instances);return!e&&t.length>0||t.includes(e)}setContext(e,t){const{instance:n}=t;if(this.instanceInitializing(n))return!1;switch(e){case"setTopic":const{name:e}=t;return e&&(this.context.topic=e),!0;case"setTranslation":const{enabled:n,locale:r}=t;return n&&r&&(this.context.translationLocale=r),!0;case"setVariables":return Object.keys(t).length>0&&(this.context.variables=Op({},t)),!0;default:return!1}}handleInit(e){const t=this.getUserConfig(...e.args),n=this.getCombinedConfig(t),{parentElement:r,namespace:o}=n||t;if(o?Object.values(this._instances).forEach((e=>{e.parentElement!==r&&e.namespace!==o||this.destroy(e)})):this.destroy(),n){const e=this.createInstance(n);this._instances[n.namespace]=e,this.context={},e.render()}}handleDestroy(e){this.destroy(e.instance)}handleAction(e){const{action:t,instance:n,args:r}=e,o=Object.values(this._instances);return!n&&o.length>1&&console.warn(`Multiple instances detected. Due to potential race conditions, it is recommended to target a specific instance with the action: ${t}`),o.map((e=>(!n||e.namespace===n)&&e.execFunction(t,...r))).some(Boolean)}createInstance(e){return new wp(e,this)}destroy(e){e?("string"==typeof e&&(e=this._instances[e]),e&&(e.destroy(),delete this._instances[e.namespace])):Object.entries(this._instances).forEach((([e,t])=>{t.destroy(),delete this._instances[e]}))}getUserConfig(e={}){return e}getCombinedConfig(e){const t=Op(Op({},e.context||this.appConfig.context),this.context),n=this.getMergedVariables(e);Object.keys(n).length>0&&(t.variables=n);const r=Op(Op({},this.appConfig.defaults),e.defaults),o=Op(Op(Op({},this.appConfig),e),{},{api:Op(Op({},this.appConfig.api),e.api),context:Object.keys(t).length?t:void 0,defaults:Object.keys(r).length?r:void 0});return"function"==typeof this.appConfig?this.appConfig(o):o}getMergedVariables(e){return Op(Op(Op({},this.appConfig.context?.variables||{}),e.context?.variables||{}),this.context.variables||{})}},Cp=(...e)=>{const t=new URL(window.location.href);return e.reduce(((e,n)=>{const r=t.searchParams.get(n)||sessionStorage.getItem(n);return r&&(e[n]=r),e}),{})},Pp=(...e)=>{const t=new URL(window.location.href),n=e.reduce(((e,n)=>{const r=t.searchParams.get(n),o=r||sessionStorage.getItem(n);return r&&sessionStorage.setItem(n,r),o?(e.set(n,o),e):e}),new URLSearchParams),r=new URLSearchParams(Object.assign(Object.assign({},Object.fromEntries(t.searchParams)),Object.fromEntries(n)));return r.toString()&&window.history.replaceState(null,null,`?${r}`),Cp(...n.keys())},Tp=(...e)=>{const t=document.querySelector("[data-reset-search-params]");t&&t.addEventListener("click",(t=>{t.preventDefault();const n=new URL(window.location.href);e.forEach((e=>{sessionStorage.removeItem(e),n.searchParams.delete(e)})),window.location.href=n.toString()}))}})(),module.exports=r})();