@seamly/web-ui 24.0.0-beta.7 → 24.0.0-beta.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.
- package/build/dist/lib/index.debug.js +14 -2
- package/build/dist/lib/index.debug.js.map +1 -1
- package/build/dist/lib/index.debug.min.js +1 -1
- package/build/dist/lib/index.debug.min.js.map +1 -1
- package/build/dist/lib/index.js +14 -2
- package/build/dist/lib/index.js.map +1 -1
- package/build/dist/lib/index.min.js +1 -1
- package/build/dist/lib/index.min.js.map +1 -1
- package/build/dist/lib/standalone.js +14 -2
- package/build/dist/lib/standalone.js.map +1 -1
- package/build/dist/lib/standalone.min.js +1 -1
- package/build/dist/lib/standalone.min.js.map +1 -1
- package/build/dist/lib/style-guide.js +15 -5
- package/build/dist/lib/style-guide.js.map +1 -1
- package/build/dist/lib/style-guide.min.js +1 -1
- package/build/dist/lib/style-guide.min.js.map +1 -1
- package/build/dist/lib/utils.js +14 -2
- package/build/dist/lib/utils.js.map +1 -1
- package/build/dist/lib/utils.min.js +1 -1
- package/build/dist/lib/utils.min.js.map +1 -1
- package/package.json +1 -1
- package/src/javascripts/style-guide/components/static-core.tsx +3 -3
- package/src/javascripts/ui/components/core/seamly-instance-functions-loader.ts +17 -1
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/*! For license information please see standalone.min.js.LICENSE.txt */
|
|
2
|
-
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var n=t();for(var r in n)("object"==typeof exports?exports:e)[r]=n[r]}}(self,(function(){return function(){var e={2086:function(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}}},7402:function(e,t,n){"use strict";n.r(t),n.d(t,{Children:function(){return f},Component:function(){return r.uA},Fragment:function(){return r.FK},PureComponent:function(){return s},StrictMode:function(){return ee},Suspense:function(){return _},SuspenseList:function(){return w},__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:function(){return K},cloneElement:function(){return G},createContext:function(){return r.q6},createElement:function(){return r.n},createFactory:function(){return $},createPortal:function(){return E},createRef:function(){return r._3},default:function(){return ce},findDOMNode:function(){return Y},flushSync:function(){return Z},forwardRef:function(){return d},hydrate:function(){return P},isElement:function(){return ie},isFragment:function(){return W},isMemo:function(){return q},isValidElement:function(){return J},lazy:function(){return b},memo:function(){return c},render:function(){return A},startTransition:function(){return te},unmountComponentAtNode:function(){return X},unstable_batchedUpdates:function(){return Q},useCallback:function(){return o.hb},useContext:function(){return o.NT},useDebugValue:function(){return o.MN},useDeferredValue:function(){return ne},useEffect:function(){return o.vJ},useErrorBoundary:function(){return o.Md},useId:function(){return o.Bi},useImperativeHandle:function(){return o.Yn},useInsertionEffect:function(){return oe},useLayoutEffect:function(){return o.Nf},useMemo:function(){return o.Kr},useReducer:function(){return o.WO},useRef:function(){return o.li},useState:function(){return o.J0},useSyncExternalStore:function(){return ae},useTransition:function(){return re},version:function(){return H}});var r=n(172),o=n(5994);function i(e,t){for(var n in t)e[n]=t[n];return e}function a(e,t){for(var n in e)if("__source"!==n&&!(n in t))return!0;for(var r in t)if("__source"!==r&&e[r]!==t[r])return!0;return!1}function s(e,t){this.props=e,this.context=t}function c(e,t){function n(e){var n=this.props.ref,r=n==e.ref;return!r&&n&&(n.call?n(null):n.current=null),t?!t(this.props,e)||!r:a(this.props,e)}function o(t){return this.shouldComponentUpdate=n,(0,r.n)(e,t)}return o.displayName="Memo("+(e.displayName||e.name)+")",o.prototype.isReactComponent=!0,o.__f=!0,o}(s.prototype=new r.uA).isPureReactComponent=!0,s.prototype.shouldComponentUpdate=function(e,t){return a(this.props,e)||a(this.state,t)};var l=r.fF.__b;r.fF.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),l&&l(e)};var u="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.forward_ref")||3911;function d(e){function t(t){var n=i({},t);return delete n.ref,e(n,t.ref||null)}return t.$$typeof=u,t.render=t,t.prototype.isReactComponent=t.__f=!0,t.displayName="ForwardRef("+(e.displayName||e.name)+")",t}var p=function(e,t){return null==e?null:(0,r.v2)((0,r.v2)(e).map(t))},f={map:p,forEach:p,count:function(e){return e?(0,r.v2)(e).length:0},only:function(e){var t=(0,r.v2)(e);if(1!==t.length)throw"Children.only";return t[0]},toArray:r.v2},h=r.fF.__e;r.fF.__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);h(e,t,n,r)};var v=r.fF.unmount;function m(e,t,n){return e&&(e.__c&&e.__c.__H&&(e.__c.__H.__.forEach((function(e){"function"==typeof e.__c&&e.__c()})),e.__c.__H=null),null!=(e=i({},e)).__c&&(e.__c.__P===n&&(e.__c.__P=t),e.__c=null),e.__k=e.__k&&e.__k.map((function(e){return m(e,t,n)}))),e}function y(e,t,n){return e&&n&&(e.__v=null,e.__k=e.__k&&e.__k.map((function(e){return y(e,t,n)})),e.__c&&e.__c.__P===t&&(e.__e&&n.appendChild(e.__e),e.__c.__e=!0,e.__c.__P=n)),e}function _(){this.__u=0,this.t=null,this.__b=null}function g(e){var t=e.__.__c;return t&&t.__a&&t.__a(e)}function b(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.n)(n,i)}return i.displayName="Lazy",i.__f=!0,i}function w(){this.u=null,this.o=null}r.fF.unmount=function(e){var t=e.__c;t&&t.__R&&t.__R(),t&&32&e.__u&&(e.type=null),v&&v(e)},(_.prototype=new r.uA).__c=function(e,t){var n=t.__c,r=this;null==r.t&&(r.t=[]),r.t.push(n);var o=g(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]=y(e,e.__c.__P,e.__c.__O)}var t;for(r.setState({__a:r.__b=null});t=r.t.pop();)t.forceUpdate()}};r.__u++||32&t.__u||r.setState({__a:r.__b=r.__v.__k[0]}),e.then(a,a)},_.prototype.componentWillUnmount=function(){this.t=[]},_.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]=m(this.__b,n,o.__O=o.__P)}this.__b=null}var i=t.__a&&(0,r.n)(r.FK,null,e.fallback);return i&&(i.__u&=-33),[(0,r.n)(r.FK,null,t.__a?null:e.children),i]};var x=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 C(e){return this.getChildContext=function(){return e.context},e.children}function S(e){var t=this,n=e.i;t.componentWillUnmount=function(){(0,r.XX)(null,t.l),t.l=null,t.i=null},t.i&&t.i!==n&&t.componentWillUnmount(),t.l||(t.i=n,t.l={nodeType:1,parentNode:n,childNodes:[],contains:function(){return!0},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.XX)((0,r.n)(C,{context:t.context},e.__v),t.l)}function E(e,t){var n=(0,r.n)(S,{__v:e,i:t});return n.containerInfo=t,n}(w.prototype=new r.uA).__a=function(e){var t=this,n=g(t.__v),r=t.o.get(e);return r[0]++,function(o){var i=function(){t.props.revealOrder?(r.push(o),x(t,e,r)):o()};n?n(i):i()}},w.prototype.render=function(e){this.u=null,this.o=new Map;var t=(0,r.v2)(e.children);e.revealOrder&&"b"===e.revealOrder[0]&&t.reverse();for(var n=t.length;n--;)this.o.set(t[n],this.u=[1,0,this.u]);return e.children},w.prototype.componentDidUpdate=w.prototype.componentDidMount=function(){var e=this;this.o.forEach((function(t,n){x(e,n,t)}))};var T="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,N=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,I=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,O=/[A-Z0-9]/g,k="undefined"!=typeof document,L=function(e){return("undefined"!=typeof Symbol&&"symbol"==typeof Symbol()?/fil|che|rad/:/fil|che|ra/).test(e)};function A(e,t,n){return null==t.__k&&(t.textContent=""),(0,r.XX)(e,t),"function"==typeof n&&n(),e?e.__c:null}function P(e,t,n){return(0,r.Qv)(e,t),"function"==typeof n&&n(),e?e.__c:null}r.uA.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach((function(e){Object.defineProperty(r.uA.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})}));var M=r.fF.event;function R(){}function F(){return this.cancelBubble}function D(){return this.defaultPrevented}r.fF.event=function(e){return M&&(e=M(e)),e.persist=R,e.isPropagationStopped=F,e.isDefaultPrevented=D,e.nativeEvent=e};var U,j={enumerable:!1,configurable:!0,get:function(){return this.class}},z=r.fF.vnode;r.fF.vnode=function(e){"string"==typeof e.type&&function(e){var t=e.props,n=e.type,o={},i=-1===n.indexOf("-");for(var a in t){var s=t[a];if(!("value"===a&&"defaultValue"in t&&null==s||k&&"children"===a&&"noscript"===n||"class"===a||"className"===a)){var c=a.toLowerCase();"defaultValue"===a&&"value"in t&&null==t.value?a="value":"download"===a&&!0===s?s="":"translate"===c&&"no"===s?s=!1:"o"===c[0]&&"n"===c[1]?"ondoubleclick"===c?a="ondblclick":"onchange"!==c||"input"!==n&&"textarea"!==n||L(t.type)?"onfocus"===c?a="onfocusin":"onblur"===c?a="onfocusout":I.test(a)&&(a=c):c=a="oninput":i&&N.test(a)?a=a.replace(O,"-$&").toLowerCase():null===s&&(s=void 0),"oninput"===c&&o[a=c]&&(a="oninputCapture"),o[a]=s}}"select"==n&&o.multiple&&Array.isArray(o.value)&&(o.value=(0,r.v2)(t.children).forEach((function(e){e.props.selected=-1!=o.value.indexOf(e.props.value)}))),"select"==n&&null!=o.defaultValue&&(o.value=(0,r.v2)(t.children).forEach((function(e){e.props.selected=o.multiple?-1!=o.defaultValue.indexOf(e.props.value):o.defaultValue==e.props.value}))),t.class&&!t.className?(o.class=t.class,Object.defineProperty(o,"className",j)):(t.className&&!t.class||t.class&&t.className)&&(o.class=o.className=t.className),e.props=o}(e),e.$$typeof=T,z&&z(e)};var B=r.fF.__r;r.fF.__r=function(e){B&&B(e),U=e.__c};var V=r.fF.diffed;r.fF.diffed=function(e){V&&V(e);var t=e.props,n=e.__e;null!=n&&"textarea"===e.type&&"value"in t&&t.value!==n.value&&(n.value=null==t.value?"":t.value),U=null};var K={ReactCurrentDispatcher:{current:{readContext:function(e){return U.__n[e.__c].props.value},useCallback:o.hb,useContext:o.NT,useDebugValue:o.MN,useDeferredValue:ne,useEffect:o.vJ,useId:o.Bi,useImperativeHandle:o.Yn,useInsertionEffect:oe,useLayoutEffect:o.Nf,useMemo:o.Kr,useReducer:o.WO,useRef:o.li,useState:o.J0,useSyncExternalStore:ae,useTransition:re}}},H="17.0.2";function $(e){return r.n.bind(null,e)}function J(e){return!!e&&e.$$typeof===T}function W(e){return J(e)&&e.type===r.FK}function q(e){return!!e&&!!e.displayName&&("string"==typeof e.displayName||e.displayName instanceof String)&&e.displayName.startsWith("Memo(")}function G(e){return J(e)?r.Ob.apply(null,arguments):e}function X(e){return!!e.__k&&((0,r.XX)(null,e),!0)}function Y(e){return e&&(e.base||1===e.nodeType&&e)||null}var Q=function(e,t){return e(t)},Z=function(e,t){return e(t)},ee=r.FK;function te(e){e()}function ne(e){return e}function re(){return[!1,te]}var oe=o.Nf,ie=J;function ae(e,t){var n=t(),r=(0,o.J0)({h:{__:n,v:t}}),i=r[0].h,a=r[1];return(0,o.Nf)((function(){i.__=n,i.v=t,se(i)&&a({h:i})}),[e,n,t]),(0,o.vJ)((function(){return se(i)&&a({h:i}),e((function(){se(i)&&a({h:i})}))}),[e]),n}function se(e){var t,n,r=e.v,o=e.__;try{var i=r();return!((t=o)===(n=i)&&(0!==t||1/t==1/n)||t!=t&&n!=n)}catch(e){return!0}}var ce={useState:o.J0,useId:o.Bi,useReducer:o.WO,useEffect:o.vJ,useLayoutEffect:o.Nf,useInsertionEffect:oe,useTransition:re,useDeferredValue:ne,useSyncExternalStore:ae,startTransition:te,useRef:o.li,useImperativeHandle:o.Yn,useMemo:o.Kr,useCallback:o.hb,useContext:o.NT,useDebugValue:o.MN,version:"17.0.2",Children:f,render:A,hydrate:P,unmountComponentAtNode:X,createPortal:E,createElement:r.n,createContext:r.q6,createFactory:$,cloneElement:G,createRef:r._3,Fragment:r.FK,isValidElement:J,isElement:ie,isFragment:W,isMemo:q,findDOMNode:Y,Component:r.uA,PureComponent:s,memo:c,forwardRef:d,flushSync:Z,unstable_batchedUpdates:Q,StrictMode:ee,Suspense:_,SuspenseList:w,lazy:b,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:K}},172:function(e,t,n){"use strict";n.d(t,{FK:function(){return C},Ob:function(){return $},Qv:function(){return H},XX:function(){return K},_3:function(){return x},fF:function(){return o},n:function(){return b},q6:function(){return J},uA:function(){return S},v2:function(){return A}});var r,o,i,a,s,c,l,u,d,p,f,h={},v=[],m=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,y=Array.isArray;function _(e,t){for(var n in t)e[n]=t[n];return e}function g(e){var t=e.parentNode;t&&t.removeChild(e)}function b(e,t,n){var o,i,a,s={};for(a in t)"key"==a?o=t[a]:"ref"==a?i=t[a]:s[a]=t[a];if(arguments.length>2&&(s.children=arguments.length>3?r.call(arguments,2):n),"function"==typeof e&&null!=e.defaultProps)for(a in e.defaultProps)void 0===s[a]&&(s[a]=e.defaultProps[a]);return w(e,s,o,i,null)}function w(e,t,n,r,a){var s={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:null==a?++i:a,__i:-1,__u:0};return null==a&&null!=o.vnode&&o.vnode(s),s}function x(){return{current:null}}function C(e){return e.children}function S(e,t){this.props=e,this.context=t}function E(e,t){if(null==t)return e.__?E(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e)return n.__e;return"function"==typeof e.type?E(e):null}function T(e){var t,n;if(null!=(e=e.__)&&null!=e.__c){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e){e.__e=e.__c.base=n.__e;break}return T(e)}}function N(e){(!e.__d&&(e.__d=!0)&&a.push(e)&&!I.__r++||s!==o.debounceRendering)&&((s=o.debounceRendering)||c)(I)}function I(){var e,t,n,r,i,s,c,u;for(a.sort(l);e=a.shift();)e.__d&&(t=a.length,r=void 0,s=(i=(n=e).__v).__e,c=[],u=[],n.__P&&((r=_({},i)).__v=i.__v+1,o.vnode&&o.vnode(r),D(n.__P,r,i,n.__n,n.__P.namespaceURI,32&i.__u?[s]:null,c,null==s?E(i):s,!!(32&i.__u),u),r.__v=i.__v,r.__.__k[r.__i]=r,U(c,r,u),r.__e!=s&&T(r)),a.length>t&&a.sort(l));I.__r=0}function O(e,t,n,r,o,i,a,s,c,l,u){var d,p,f,m,y,_=r&&r.__k||v,g=t.length;for(n.__d=c,k(n,t,_),c=n.__d,d=0;d<g;d++)null!=(f=n.__k[d])&&"boolean"!=typeof f&&"function"!=typeof f&&(p=-1===f.__i?h:_[f.__i]||h,f.__i=d,D(e,f,p,o,i,a,s,c,l,u),m=f.__e,f.ref&&p.ref!=f.ref&&(p.ref&&z(p.ref,null,f),u.push(f.ref,f.__c||m,f)),null==y&&null!=m&&(y=m),65536&f.__u||p.__k===f.__k?c=L(f,c,e):"function"==typeof f.type&&void 0!==f.__d?c=f.__d:m&&(c=m.nextSibling),f.__d=void 0,f.__u&=-196609);n.__d=c,n.__e=y}function k(e,t,n){var r,o,i,a,s,c=t.length,l=n.length,u=l,d=0;for(e.__k=[],r=0;r<c;r++)a=r+d,null!=(o=e.__k[r]=null==(o=t[r])||"boolean"==typeof o||"function"==typeof o?null:"string"==typeof o||"number"==typeof o||"bigint"==typeof o||o.constructor==String?w(null,o,null,null,null):y(o)?w(C,{children:o},null,null,null):void 0===o.constructor&&o.__b>0?w(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):o)?(o.__=e,o.__b=e.__b+1,s=P(o,n,a,u),o.__i=s,i=null,-1!==s&&(u--,(i=n[s])&&(i.__u|=131072)),null==i||null===i.__v?(-1==s&&d--,"function"!=typeof o.type&&(o.__u|=65536)):s!==a&&(s==a-1?d--:s==a+1?d++:s>a?u>c-a?d+=s-a:d--:s<a&&(s==a-d?d-=s-a:d++),s!==r+d&&(o.__u|=65536))):(i=n[a])&&null==i.key&&i.__e&&!(131072&i.__u)&&(i.__e==e.__d&&(e.__d=E(i)),B(i,i,!1),n[a]=null,u--);if(u)for(r=0;r<l;r++)null!=(i=n[r])&&!(131072&i.__u)&&(i.__e==e.__d&&(e.__d=E(i)),B(i,i))}function L(e,t,n){var r,o;if("function"==typeof e.type){for(r=e.__k,o=0;r&&o<r.length;o++)r[o]&&(r[o].__=e,t=L(r[o],t,n));return t}e.__e!=t&&(t&&e.type&&!n.contains(t)&&(t=E(e)),n.insertBefore(e.__e,t||null),t=e.__e);do{t=t&&t.nextSibling}while(null!=t&&8===t.nodeType);return t}function A(e,t){return t=t||[],null==e||"boolean"==typeof e||(y(e)?e.some((function(e){A(e,t)})):t.push(e)),t}function P(e,t,n,r){var o=e.key,i=e.type,a=n-1,s=n+1,c=t[n];if(null===c||c&&o==c.key&&i===c.type&&!(131072&c.__u))return n;if(r>(null==c||131072&c.__u?0:1))for(;a>=0||s<t.length;){if(a>=0){if((c=t[a])&&!(131072&c.__u)&&o==c.key&&i===c.type)return a;a--}if(s<t.length){if((c=t[s])&&!(131072&c.__u)&&o==c.key&&i===c.type)return s;s++}}return-1}function M(e,t,n){"-"===t[0]?e.setProperty(t,null==n?"":n):e[t]=null==n?"":"number"!=typeof n||m.test(t)?n:n+"px"}function R(e,t,n,r,o){var i;e:if("style"===t)if("string"==typeof n)e.style.cssText=n;else{if("string"==typeof r&&(e.style.cssText=r=""),r)for(t in r)n&&t in n||M(e.style,t,"");if(n)for(t in n)r&&n[t]===r[t]||M(e.style,t,n[t])}else if("o"===t[0]&&"n"===t[1])i=t!==(t=t.replace(/(PointerCapture)$|Capture$/i,"$1")),t=t.toLowerCase()in e||"onFocusOut"===t||"onFocusIn"===t?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+i]=n,n?r?n.u=r.u:(n.u=u,e.addEventListener(t,i?p:d,i)):e.removeEventListener(t,i?p:d,i);else{if("http://www.w3.org/2000/svg"==o)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!=t&&"height"!=t&&"href"!=t&&"list"!=t&&"form"!=t&&"tabIndex"!=t&&"download"!=t&&"rowSpan"!=t&&"colSpan"!=t&&"role"!=t&&"popover"!=t&&t in e)try{e[t]=null==n?"":n;break e}catch(e){}"function"==typeof n||(null==n||!1===n&&"-"!==t[4]?e.removeAttribute(t):e.setAttribute(t,"popover"==t&&1==n?"":n))}}function F(e){return function(t){if(this.l){var n=this.l[t.type+e];if(null==t.t)t.t=u++;else if(t.t<n.u)return;return n(o.event?o.event(t):t)}}}function D(e,t,n,r,i,a,s,c,l,u){var d,p,f,h,v,m,g,b,w,x,E,T,N,I,k,L,A=t.type;if(void 0!==t.constructor)return null;128&n.__u&&(l=!!(32&n.__u),a=[c=t.__e=n.__e]),(d=o.__b)&&d(t);e:if("function"==typeof A)try{if(b=t.props,w="prototype"in A&&A.prototype.render,x=(d=A.contextType)&&r[d.__c],E=d?x?x.props.value:d.__:r,n.__c?g=(p=t.__c=n.__c).__=p.__E:(w?t.__c=p=new A(b,E):(t.__c=p=new S(b,E),p.constructor=A,p.render=V),x&&x.sub(p),p.props=b,p.state||(p.state={}),p.context=E,p.__n=r,f=p.__d=!0,p.__h=[],p._sb=[]),w&&null==p.__s&&(p.__s=p.state),w&&null!=A.getDerivedStateFromProps&&(p.__s==p.state&&(p.__s=_({},p.__s)),_(p.__s,A.getDerivedStateFromProps(b,p.__s))),h=p.props,v=p.state,p.__v=t,f)w&&null==A.getDerivedStateFromProps&&null!=p.componentWillMount&&p.componentWillMount(),w&&null!=p.componentDidMount&&p.__h.push(p.componentDidMount);else{if(w&&null==A.getDerivedStateFromProps&&b!==h&&null!=p.componentWillReceiveProps&&p.componentWillReceiveProps(b,E),!p.__e&&(null!=p.shouldComponentUpdate&&!1===p.shouldComponentUpdate(b,p.__s,E)||t.__v===n.__v)){for(t.__v!==n.__v&&(p.props=b,p.state=p.__s,p.__d=!1),t.__e=n.__e,t.__k=n.__k,t.__k.forEach((function(e){e&&(e.__=t)})),T=0;T<p._sb.length;T++)p.__h.push(p._sb[T]);p._sb=[],p.__h.length&&s.push(p);break e}null!=p.componentWillUpdate&&p.componentWillUpdate(b,p.__s,E),w&&null!=p.componentDidUpdate&&p.__h.push((function(){p.componentDidUpdate(h,v,m)}))}if(p.context=E,p.props=b,p.__P=e,p.__e=!1,N=o.__r,I=0,w){for(p.state=p.__s,p.__d=!1,N&&N(t),d=p.render(p.props,p.state,p.context),k=0;k<p._sb.length;k++)p.__h.push(p._sb[k]);p._sb=[]}else do{p.__d=!1,N&&N(t),d=p.render(p.props,p.state,p.context),p.state=p.__s}while(p.__d&&++I<25);p.state=p.__s,null!=p.getChildContext&&(r=_(_({},r),p.getChildContext())),w&&!f&&null!=p.getSnapshotBeforeUpdate&&(m=p.getSnapshotBeforeUpdate(h,v)),O(e,y(L=null!=d&&d.type===C&&null==d.key?d.props.children:d)?L:[L],t,n,r,i,a,s,c,l,u),p.base=t.__e,t.__u&=-161,p.__h.length&&s.push(p),g&&(p.__E=p.__=null)}catch(e){if(t.__v=null,l||null!=a){for(t.__u|=l?160:32;c&&8===c.nodeType&&c.nextSibling;)c=c.nextSibling;a[a.indexOf(c)]=null,t.__e=c}else t.__e=n.__e,t.__k=n.__k;o.__e(e,t,n)}else null==a&&t.__v===n.__v?(t.__k=n.__k,t.__e=n.__e):t.__e=j(n.__e,t,n,r,i,a,s,l,u);(d=o.diffed)&&d(t)}function U(e,t,n){t.__d=void 0;for(var r=0;r<n.length;r++)z(n[r],n[++r],n[++r]);o.__c&&o.__c(t,e),e.some((function(t){try{e=t.__h,t.__h=[],e.some((function(e){e.call(t)}))}catch(e){o.__e(e,t.__v)}}))}function j(e,t,n,o,i,a,s,c,l){var u,d,p,f,v,m,_,b=n.props,w=t.props,x=t.type;if("svg"===x?i="http://www.w3.org/2000/svg":"math"===x?i="http://www.w3.org/1998/Math/MathML":i||(i="http://www.w3.org/1999/xhtml"),null!=a)for(u=0;u<a.length;u++)if((v=a[u])&&"setAttribute"in v==!!x&&(x?v.localName===x:3===v.nodeType)){e=v,a[u]=null;break}if(null==e){if(null===x)return document.createTextNode(w);e=document.createElementNS(i,x,w.is&&w),a=null,c=!1}if(null===x)b===w||c&&e.data===w||(e.data=w);else{if(a=a&&r.call(e.childNodes),b=n.props||h,!c&&null!=a)for(b={},u=0;u<e.attributes.length;u++)b[(v=e.attributes[u]).name]=v.value;for(u in b)if(v=b[u],"children"==u);else if("dangerouslySetInnerHTML"==u)p=v;else if("key"!==u&&!(u in w)){if("value"==u&&"defaultValue"in w||"checked"==u&&"defaultChecked"in w)continue;R(e,u,null,v,i)}for(u in w)v=w[u],"children"==u?f=v:"dangerouslySetInnerHTML"==u?d=v:"value"==u?m=v:"checked"==u?_=v:"key"===u||c&&"function"!=typeof v||b[u]===v||R(e,u,v,b[u],i);if(d)c||p&&(d.__html===p.__html||d.__html===e.innerHTML)||(e.innerHTML=d.__html),t.__k=[];else if(p&&(e.innerHTML=""),O(e,y(f)?f:[f],t,n,o,"foreignObject"===x?"http://www.w3.org/1999/xhtml":i,a,s,a?a[0]:n.__k&&E(n,0),c,l),null!=a)for(u=a.length;u--;)null!=a[u]&&g(a[u]);c||(u="value",void 0!==m&&(m!==e[u]||"progress"===x&&!m||"option"===x&&m!==b[u])&&R(e,u,m,b[u],i),u="checked",void 0!==_&&_!==e[u]&&R(e,u,_,b[u],i))}return e}function z(e,t,n){try{if("function"==typeof e){var r="function"==typeof e.__u;r&&e.__u(),r&&null==t||(e.__u=e(t))}else e.current=t}catch(e){o.__e(e,n)}}function B(e,t,n){var r,i;if(o.unmount&&o.unmount(e),(r=e.ref)&&(r.current&&r.current!==e.__e||z(r,null,t)),null!=(r=e.__c)){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(e){o.__e(e,t)}r.base=r.__P=null}if(r=e.__k)for(i=0;i<r.length;i++)r[i]&&B(r[i],t,n||"function"!=typeof e.type);n||null==e.__e||g(e.__e),e.__c=e.__=e.__e=e.__d=void 0}function V(e,t,n){return this.constructor(e,n)}function K(e,t,n){var i,a,s,c;o.__&&o.__(e,t),a=(i="function"==typeof n)?null:n&&n.__k||t.__k,s=[],c=[],D(t,e=(!i&&n||t).__k=b(C,null,[e]),a||h,h,t.namespaceURI,!i&&n?[n]:a?null:t.firstChild?r.call(t.childNodes):null,s,!i&&n?n:a?a.__e:t.firstChild,i,c),U(s,e,c)}function H(e,t){K(e,t,H)}function $(e,t,n){var o,i,a,s,c=_({},e.props);for(a in e.type&&e.type.defaultProps&&(s=e.type.defaultProps),t)"key"==a?o=t[a]:"ref"==a?i=t[a]:c[a]=void 0===t[a]&&void 0!==s?s[a]:t[a];return arguments.length>2&&(c.children=arguments.length>3?r.call(arguments,2):n),w(e.type,c,o||e.key,i||e.ref,null)}function J(e,t){var n={__c:t="__cC"+f++,__:e,Consumer:function(e,t){return e.children(t)},Provider:function(e){var n,r;return this.getChildContext||(n=[],(r={})[t]=this,this.getChildContext=function(){return r},this.componentWillUnmount=function(){n=null},this.shouldComponentUpdate=function(e){this.props.value!==e.value&&n.some((function(e){e.__e=!0,N(e)}))},this.sub=function(e){n.push(e);var t=e.componentWillUnmount;e.componentWillUnmount=function(){n&&n.splice(n.indexOf(e),1),t&&t.call(e)}}),e.children}};return n.Provider.__=n.Consumer.contextType=n}r=v.slice,o={__e:function(e,t,n,r){for(var o,i,a;t=t.__;)if((o=t.__c)&&!o.__)try{if((i=o.constructor)&&null!=i.getDerivedStateFromError&&(o.setState(i.getDerivedStateFromError(e)),a=o.__d),null!=o.componentDidCatch&&(o.componentDidCatch(e,r||{}),a=o.__d),a)return o.__E=o}catch(t){e=t}throw e}},i=0,S.prototype.setState=function(e,t){var n;n=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=_({},this.state),"function"==typeof e&&(e=e(_({},n),this.props)),e&&_(n,e),null!=e&&this.__v&&(t&&this._sb.push(t),N(this))},S.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),N(this))},S.prototype.render=C,a=[],c="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,l=function(e,t){return e.__v.__b-t.__v.__b},I.__r=0,u=0,d=F(!1),p=F(!0),f=0},5994:function(e,t,n){"use strict";n.d(t,{Bi:function(){return O},J0:function(){return _},Kr:function(){return S},MN:function(){return N},Md:function(){return I},NT:function(){return T},Nf:function(){return w},WO:function(){return g},Yn:function(){return C},hb:function(){return E},li:function(){return x},vJ:function(){return b}});var r,o,i,a,s=n(172),c=0,l=[],u=s.fF,d=u.__b,p=u.__r,f=u.diffed,h=u.__c,v=u.unmount,m=u.__;function y(e,t){u.__h&&u.__h(o,e,c||t),c=0;var n=o.__H||(o.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function _(e){return c=1,g(F,e)}function g(e,t,n){var i=y(r++,2);if(i.t=e,!i.__c&&(i.__=[n?n(t):F(void 0,t),function(e){var t=i.__N?i.__N[0]:i.__[0],n=i.t(t,e);t!==n&&(i.__N=[n,i.__[1]],i.__c.setState({}))}],i.__c=o,!o.u)){var a=function(e,t,n){if(!i.__c.__H)return!0;var r=i.__c.__H.__.filter((function(e){return!!e.__c}));if(r.every((function(e){return!e.__N})))return!s||s.call(this,e,t,n);var o=!1;return r.forEach((function(e){if(e.__N){var t=e.__[0];e.__=e.__N,e.__N=void 0,t!==e.__[0]&&(o=!0)}})),!(!o&&i.__c.props===e)&&(!s||s.call(this,e,t,n))};o.u=!0;var s=o.shouldComponentUpdate,c=o.componentWillUpdate;o.componentWillUpdate=function(e,t,n){if(this.__e){var r=s;s=void 0,a(e,t,n),s=r}c&&c.call(this,e,t,n)},o.shouldComponentUpdate=a}return i.__N||i.__}function b(e,t){var n=y(r++,3);!u.__s&&R(n.__H,t)&&(n.__=e,n.i=t,o.__H.__h.push(n))}function w(e,t){var n=y(r++,4);!u.__s&&R(n.__H,t)&&(n.__=e,n.i=t,o.__h.push(n))}function x(e){return c=5,S((function(){return{current:e}}),[])}function C(e,t,n){c=6,w((function(){return"function"==typeof e?(e(t()),function(){return e(null)}):e?(e.current=t(),function(){return e.current=null}):void 0}),null==n?n:n.concat(e))}function S(e,t){var n=y(r++,7);return R(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function E(e,t){return c=8,S((function(){return e}),t)}function T(e){var t=o.context[e.__c],n=y(r++,9);return n.c=e,t?(null==n.__&&(n.__=!0,t.sub(o)),t.props.value):e.__}function N(e,t){u.useDebugValue&&u.useDebugValue(t?t(e):e)}function I(e){var t=y(r++,10),n=_();return t.__=e,o.componentDidCatch||(o.componentDidCatch=function(e,r){t.__&&t.__(e,r),n[1](e)}),[n[0],function(){n[1](void 0)}]}function O(){var e=y(r++,11);if(!e.__){for(var t=o.__v;null!==t&&!t.__m&&null!==t.__;)t=t.__;var n=t.__m||(t.__m=[0,0]);e.__="P"+n[0]+"-"+n[1]++}return e.__}function k(){for(var e;e=l.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(P),e.__H.__h.forEach(M),e.__H.__h=[]}catch(t){e.__H.__h=[],u.__e(t,e.__v)}}u.__b=function(e){o=null,d&&d(e)},u.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),m&&m(e,t)},u.__r=function(e){p&&p(e),r=0;var t=(o=e.__c).__H;t&&(i===o?(t.__h=[],o.__h=[],t.__.forEach((function(e){e.__N&&(e.__=e.__N),e.i=e.__N=void 0}))):(t.__h.forEach(P),t.__h.forEach(M),t.__h=[],r=0)),i=o},u.diffed=function(e){f&&f(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(1!==l.push(t)&&a===u.requestAnimationFrame||((a=u.requestAnimationFrame)||A)(k)),t.__H.__.forEach((function(e){e.i&&(e.__H=e.i),e.i=void 0}))),i=o=null},u.__c=function(e,t){t.some((function(e){try{e.__h.forEach(P),e.__h=e.__h.filter((function(e){return!e.__||M(e)}))}catch(n){t.some((function(e){e.__h&&(e.__h=[])})),t=[],u.__e(n,e.__v)}})),h&&h(e,t)},u.unmount=function(e){v&&v(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach((function(e){try{P(e)}catch(e){t=e}})),n.__H=void 0,t&&u.__e(t,n.__v))};var L="function"==typeof requestAnimationFrame;function A(e){var t,n=function(){clearTimeout(r),L&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,100);L&&(t=requestAnimationFrame(n))}function P(e){var t=o,n=e.__c;"function"==typeof n&&(e.__c=void 0,n()),o=t}function M(e){var t=o;e.__c=e.__(),o=t}function R(e,t){return!e||e.length!==t.length||t.some((function(t,n){return t!==e[n]}))}function F(e,t){return"function"==typeof t?t(e):t}},7154:function(e,t,n){"use strict";var r=n(7402),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.useSyncExternalStore,a=r.useRef,s=r.useEffect,c=r.useMemo,l=r.useDebugValue;t.useSyncExternalStoreWithSelector=function(e,t,n,r,u){var d=a(null);if(null===d.current){var p={hasValue:!1,value:null};d.current=p}else p=d.current;d=c((function(){function e(e){if(!s){if(s=!0,i=e,e=r(e),void 0!==u&&p.hasValue){var t=p.value;if(u(t,e))return a=t}return a=e}if(t=a,o(i,e))return t;var n=r(e);return void 0!==u&&u(t,n)?t:(i=e,a=n)}var i,a,s=!1,c=void 0===n?null:n;return[function(){return e(t())},null===c?void 0:function(){return e(c())}]}),[t,n,r,u]);var f=i(e,d[0],d[1]);return s((function(){p.hasValue=!0,p.value=f}),[f]),l(f),f}},8418:function(e,t,n){"use strict";e.exports=n(7154)},9497:function(e,t,n){"use strict";n(8107);var r=n(7015);e.exports=r("Array","at")},9306:function(e,t,n){"use strict";var r=n(4901),o=n(6823),i=TypeError;e.exports=function(e){if(r(e))return e;throw new i(o(e)+" is not a function")}},7080:function(e,t,n){"use strict";var r=n(4402).has;e.exports=function(e){return r(e),e}},6469:function(e,t,n){"use strict";var r=n(8227),o=n(2360),i=n(4913).f,a=r("unscopables"),s=Array.prototype;void 0===s[a]&&i(s,a,{configurable:!0,value:o(null)}),e.exports=function(e){s[a][e]=!0}},8551:function(e,t,n){"use strict";var r=n(34),o=String,i=TypeError;e.exports=function(e){if(r(e))return e;throw new i(o(e)+" is not an object")}},9617:function(e,t,n){"use strict";var r=n(5397),o=n(5610),i=n(6198),a=function(e){return function(t,n,a){var s=r(t),c=i(s);if(0===c)return!e&&-1;var l,u=o(a,c);if(e&&n!=n){for(;c>u;)if((l=s[u++])!=l)return!0}else for(;c>u;u++)if((e||u in s)&&s[u]===n)return e||u||0;return!e&&-1}};e.exports={includes:a(!0),indexOf:a(!1)}},4527:function(e,t,n){"use strict";var r=n(3724),o=n(4376),i=TypeError,a=Object.getOwnPropertyDescriptor,s=r&&!function(){if(void 0!==this)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(e){return e instanceof TypeError}}();e.exports=s?function(e,t){if(o(e)&&!a(e,"length").writable)throw new i("Cannot set read only .length");return e.length=t}:function(e,t){return e.length=t}},2195:function(e,t,n){"use strict";var r=n(9504),o=r({}.toString),i=r("".slice);e.exports=function(e){return i(o(e),8,-1)}},7740:function(e,t,n){"use strict";var r=n(9297),o=n(5031),i=n(7347),a=n(4913);e.exports=function(e,t,n){for(var s=o(t),c=a.f,l=i.f,u=0;u<s.length;u++){var d=s[u];r(e,d)||n&&r(n,d)||c(e,d,l(t,d))}}},6699:function(e,t,n){"use strict";var r=n(3724),o=n(4913),i=n(6980);e.exports=r?function(e,t,n){return o.f(e,t,i(1,n))}:function(e,t,n){return e[t]=n,e}},6980:function(e){"use strict";e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},6840:function(e,t,n){"use strict";var r=n(4901),o=n(4913),i=n(283),a=n(9433);e.exports=function(e,t,n,s){s||(s={});var c=s.enumerable,l=void 0!==s.name?s.name:t;if(r(n)&&i(n,l,s),s.global)c?e[t]=n:a(t,n);else{try{s.unsafe?e[t]&&(c=!0):delete e[t]}catch(e){}c?e[t]=n:o.f(e,t,{value:n,enumerable:!1,configurable:!s.nonConfigurable,writable:!s.nonWritable})}return e}},9433:function(e,t,n){"use strict";var r=n(4576),o=Object.defineProperty;e.exports=function(e,t){try{o(r,e,{value:t,configurable:!0,writable:!0})}catch(n){r[e]=t}return t}},3724:function(e,t,n){"use strict";var r=n(9039);e.exports=!r((function(){return 7!==Object.defineProperty({},1,{get:function(){return 7}})[1]}))},4055:function(e,t,n){"use strict";var r=n(4576),o=n(34),i=r.document,a=o(i)&&o(i.createElement);e.exports=function(e){return a?i.createElement(e):{}}},6837:function(e){"use strict";var t=TypeError;e.exports=function(e){if(e>9007199254740991)throw t("Maximum allowed index exceeded");return e}},7015:function(e,t,n){"use strict";var r=n(4576),o=n(9504);e.exports=function(e,t){return o(r[e].prototype[t])}},8727:function(e){"use strict";e.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},2839:function(e,t,n){"use strict";var r=n(4576).navigator,o=r&&r.userAgent;e.exports=o?String(o):""},9519:function(e,t,n){"use strict";var r,o,i=n(4576),a=n(2839),s=i.process,c=i.Deno,l=s&&s.versions||c&&c.version,u=l&&l.v8;u&&(o=(r=u.split("."))[0]>0&&r[0]<4?1:+(r[0]+r[1])),!o&&a&&(!(r=a.match(/Edge\/(\d+)/))||r[1]>=74)&&(r=a.match(/Chrome\/(\d+)/))&&(o=+r[1]),e.exports=o},6518:function(e,t,n){"use strict";var r=n(4576),o=n(7347).f,i=n(6699),a=n(6840),s=n(9433),c=n(7740),l=n(2796);e.exports=function(e,t){var n,u,d,p,f,h=e.target,v=e.global,m=e.stat;if(n=v?r:m?r[h]||s(h,{}):r[h]&&r[h].prototype)for(u in t){if(p=t[u],d=e.dontCallGetSet?(f=o(n,u))&&f.value:n[u],!l(v?u:h+(m?".":"#")+u,e.forced)&&void 0!==d){if(typeof p==typeof d)continue;c(p,d)}(e.sham||d&&d.sham)&&i(p,"sham",!0),a(n,u,p,e)}}},9039:function(e){"use strict";e.exports=function(e){try{return!!e()}catch(e){return!0}}},616:function(e,t,n){"use strict";var r=n(9039);e.exports=!r((function(){var e=function(){}.bind();return"function"!=typeof e||e.hasOwnProperty("prototype")}))},9565:function(e,t,n){"use strict";var r=n(616),o=Function.prototype.call;e.exports=r?o.bind(o):function(){return o.apply(o,arguments)}},350:function(e,t,n){"use strict";var r=n(3724),o=n(9297),i=Function.prototype,a=r&&Object.getOwnPropertyDescriptor,s=o(i,"name"),c=s&&"something"===function(){}.name,l=s&&(!r||r&&a(i,"name").configurable);e.exports={EXISTS:s,PROPER:c,CONFIGURABLE:l}},6706:function(e,t,n){"use strict";var r=n(9504),o=n(9306);e.exports=function(e,t,n){try{return r(o(Object.getOwnPropertyDescriptor(e,t)[n]))}catch(e){}}},9504:function(e,t,n){"use strict";var r=n(616),o=Function.prototype,i=o.call,a=r&&o.bind.bind(i,i);e.exports=r?a:function(e){return function(){return i.apply(e,arguments)}}},7751:function(e,t,n){"use strict";var r=n(4576),o=n(4901);e.exports=function(e,t){return arguments.length<2?(n=r[e],o(n)?n:void 0):r[e]&&r[e][t];var n}},1767:function(e){"use strict";e.exports=function(e){return{iterator:e,next:e.next,done:!1}}},5966:function(e,t,n){"use strict";var r=n(9306),o=n(4117);e.exports=function(e,t){var n=e[t];return o(n)?void 0:r(n)}},3789:function(e,t,n){"use strict";var r=n(9306),o=n(8551),i=n(9565),a=n(1291),s=n(1767),c="Invalid size",l=RangeError,u=TypeError,d=Math.max,p=function(e,t){this.set=e,this.size=d(t,0),this.has=r(e.has),this.keys=r(e.keys)};p.prototype={getIterator:function(){return s(o(i(this.keys,this.set)))},includes:function(e){return i(this.has,this.set,e)}},e.exports=function(e){o(e);var t=+e.size;if(t!=t)throw new u(c);var n=a(t);if(n<0)throw new l(c);return new p(e,n)}},4576:function(e,t,n){"use strict";var r=function(e){return e&&e.Math===Math&&e};e.exports=r("object"==typeof globalThis&&globalThis)||r("object"==typeof window&&window)||r("object"==typeof self&&self)||r("object"==typeof n.g&&n.g)||r("object"==typeof this&&this)||function(){return this}()||Function("return this")()},9297:function(e,t,n){"use strict";var r=n(9504),o=n(8981),i=r({}.hasOwnProperty);e.exports=Object.hasOwn||function(e,t){return i(o(e),t)}},421:function(e){"use strict";e.exports={}},397:function(e,t,n){"use strict";var r=n(7751);e.exports=r("document","documentElement")},5917:function(e,t,n){"use strict";var r=n(3724),o=n(9039),i=n(4055);e.exports=!r&&!o((function(){return 7!==Object.defineProperty(i("div"),"a",{get:function(){return 7}}).a}))},7055:function(e,t,n){"use strict";var r=n(9504),o=n(9039),i=n(2195),a=Object,s=r("".split);e.exports=o((function(){return!a("z").propertyIsEnumerable(0)}))?function(e){return"String"===i(e)?s(e,""):a(e)}:a},3706:function(e,t,n){"use strict";var r=n(9504),o=n(4901),i=n(7629),a=r(Function.toString);o(i.inspectSource)||(i.inspectSource=function(e){return a(e)}),e.exports=i.inspectSource},1181:function(e,t,n){"use strict";var r,o,i,a=n(8622),s=n(4576),c=n(34),l=n(6699),u=n(9297),d=n(7629),p=n(6119),f=n(421),h="Object already initialized",v=s.TypeError,m=s.WeakMap;if(a||d.state){var y=d.state||(d.state=new m);y.get=y.get,y.has=y.has,y.set=y.set,r=function(e,t){if(y.has(e))throw new v(h);return t.facade=e,y.set(e,t),t},o=function(e){return y.get(e)||{}},i=function(e){return y.has(e)}}else{var _=p("state");f[_]=!0,r=function(e,t){if(u(e,_))throw new v(h);return t.facade=e,l(e,_,t),t},o=function(e){return u(e,_)?e[_]:{}},i=function(e){return u(e,_)}}e.exports={set:r,get:o,has:i,enforce:function(e){return i(e)?o(e):r(e,{})},getterFor:function(e){return function(t){var n;if(!c(t)||(n=o(t)).type!==e)throw new v("Incompatible receiver, "+e+" required");return n}}}},4376:function(e,t,n){"use strict";var r=n(2195);e.exports=Array.isArray||function(e){return"Array"===r(e)}},4901:function(e){"use strict";var t="object"==typeof document&&document.all;e.exports=void 0===t&&void 0!==t?function(e){return"function"==typeof e||e===t}:function(e){return"function"==typeof e}},2796:function(e,t,n){"use strict";var r=n(9039),o=n(4901),i=/#|\.prototype\./,a=function(e,t){var n=c[s(e)];return n===u||n!==l&&(o(t)?r(t):!!t)},s=a.normalize=function(e){return String(e).replace(i,".").toLowerCase()},c=a.data={},l=a.NATIVE="N",u=a.POLYFILL="P";e.exports=a},4117:function(e){"use strict";e.exports=function(e){return null==e}},34:function(e,t,n){"use strict";var r=n(4901);e.exports=function(e){return"object"==typeof e?null!==e:r(e)}},6395:function(e){"use strict";e.exports=!1},757:function(e,t,n){"use strict";var r=n(7751),o=n(4901),i=n(1625),a=n(7040),s=Object;e.exports=a?function(e){return"symbol"==typeof e}:function(e){var t=r("Symbol");return o(t)&&i(t.prototype,s(e))}},507:function(e,t,n){"use strict";var r=n(9565);e.exports=function(e,t,n){for(var o,i,a=n?e:e.iterator,s=e.next;!(o=r(s,a)).done;)if(void 0!==(i=t(o.value)))return i}},9539:function(e,t,n){"use strict";var r=n(9565),o=n(8551),i=n(5966);e.exports=function(e,t,n){var a,s;o(e);try{if(!(a=i(e,"return"))){if("throw"===t)throw n;return n}a=r(a,e)}catch(e){s=!0,a=e}if("throw"===t)throw n;if(s)throw a;return o(a),n}},6198:function(e,t,n){"use strict";var r=n(8014);e.exports=function(e){return r(e.length)}},283:function(e,t,n){"use strict";var r=n(9504),o=n(9039),i=n(4901),a=n(9297),s=n(3724),c=n(350).CONFIGURABLE,l=n(3706),u=n(1181),d=u.enforce,p=u.get,f=String,h=Object.defineProperty,v=r("".slice),m=r("".replace),y=r([].join),_=s&&!o((function(){return 8!==h((function(){}),"length",{value:8}).length})),g=String(String).split("String"),b=e.exports=function(e,t,n){"Symbol("===v(f(t),0,7)&&(t="["+m(f(t),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),n&&n.getter&&(t="get "+t),n&&n.setter&&(t="set "+t),(!a(e,"name")||c&&e.name!==t)&&(s?h(e,"name",{value:t,configurable:!0}):e.name=t),_&&n&&a(n,"arity")&&e.length!==n.arity&&h(e,"length",{value:n.arity});try{n&&a(n,"constructor")&&n.constructor?s&&h(e,"prototype",{writable:!1}):e.prototype&&(e.prototype=void 0)}catch(e){}var r=d(e);return a(r,"source")||(r.source=y(g,"string"==typeof t?t:"")),e};Function.prototype.toString=b((function(){return i(this)&&p(this).source||l(this)}),"toString")},741:function(e){"use strict";var t=Math.ceil,n=Math.floor;e.exports=Math.trunc||function(e){var r=+e;return(r>0?n:t)(r)}},2360:function(e,t,n){"use strict";var r,o=n(8551),i=n(6801),a=n(8727),s=n(421),c=n(397),l=n(4055),u=n(6119),d="prototype",p="script",f=u("IE_PROTO"),h=function(){},v=function(e){return"<"+p+">"+e+"</"+p+">"},m=function(e){e.write(v("")),e.close();var t=e.parentWindow.Object;return e=null,t},y=function(){try{r=new ActiveXObject("htmlfile")}catch(e){}var e,t,n;y="undefined"!=typeof document?document.domain&&r?m(r):(t=l("iframe"),n="java"+p+":",t.style.display="none",c.appendChild(t),t.src=String(n),(e=t.contentWindow.document).open(),e.write(v("document.F=Object")),e.close(),e.F):m(r);for(var o=a.length;o--;)delete y[d][a[o]];return y()};s[f]=!0,e.exports=Object.create||function(e,t){var n;return null!==e?(h[d]=o(e),n=new h,h[d]=null,n[f]=e):n=y(),void 0===t?n:i.f(n,t)}},6801:function(e,t,n){"use strict";var r=n(3724),o=n(8686),i=n(4913),a=n(8551),s=n(5397),c=n(1072);t.f=r&&!o?Object.defineProperties:function(e,t){a(e);for(var n,r=s(t),o=c(t),l=o.length,u=0;l>u;)i.f(e,n=o[u++],r[n]);return e}},4913:function(e,t,n){"use strict";var r=n(3724),o=n(5917),i=n(8686),a=n(8551),s=n(6969),c=TypeError,l=Object.defineProperty,u=Object.getOwnPropertyDescriptor,d="enumerable",p="configurable",f="writable";t.f=r?i?function(e,t,n){if(a(e),t=s(t),a(n),"function"==typeof e&&"prototype"===t&&"value"in n&&f in n&&!n[f]){var r=u(e,t);r&&r[f]&&(e[t]=n.value,n={configurable:p in n?n[p]:r[p],enumerable:d in n?n[d]:r[d],writable:!1})}return l(e,t,n)}:l:function(e,t,n){if(a(e),t=s(t),a(n),o)try{return l(e,t,n)}catch(e){}if("get"in n||"set"in n)throw new c("Accessors not supported");return"value"in n&&(e[t]=n.value),e}},7347:function(e,t,n){"use strict";var r=n(3724),o=n(9565),i=n(8773),a=n(6980),s=n(5397),c=n(6969),l=n(9297),u=n(5917),d=Object.getOwnPropertyDescriptor;t.f=r?d:function(e,t){if(e=s(e),t=c(t),u)try{return d(e,t)}catch(e){}if(l(e,t))return a(!o(i.f,e,t),e[t])}},8480:function(e,t,n){"use strict";var r=n(1828),o=n(8727).concat("length","prototype");t.f=Object.getOwnPropertyNames||function(e){return r(e,o)}},3717:function(e,t){"use strict";t.f=Object.getOwnPropertySymbols},1625:function(e,t,n){"use strict";var r=n(9504);e.exports=r({}.isPrototypeOf)},1828:function(e,t,n){"use strict";var r=n(9504),o=n(9297),i=n(5397),a=n(9617).indexOf,s=n(421),c=r([].push);e.exports=function(e,t){var n,r=i(e),l=0,u=[];for(n in r)!o(s,n)&&o(r,n)&&c(u,n);for(;t.length>l;)o(r,n=t[l++])&&(~a(u,n)||c(u,n));return u}},1072:function(e,t,n){"use strict";var r=n(1828),o=n(8727);e.exports=Object.keys||function(e){return r(e,o)}},8773:function(e,t){"use strict";var n={}.propertyIsEnumerable,r=Object.getOwnPropertyDescriptor,o=r&&!n.call({1:2},1);t.f=o?function(e){var t=r(this,e);return!!t&&t.enumerable}:n},4270:function(e,t,n){"use strict";var r=n(9565),o=n(4901),i=n(34),a=TypeError;e.exports=function(e,t){var n,s;if("string"===t&&o(n=e.toString)&&!i(s=r(n,e)))return s;if(o(n=e.valueOf)&&!i(s=r(n,e)))return s;if("string"!==t&&o(n=e.toString)&&!i(s=r(n,e)))return s;throw new a("Can't convert object to primitive value")}},5031:function(e,t,n){"use strict";var r=n(7751),o=n(9504),i=n(8480),a=n(3717),s=n(8551),c=o([].concat);e.exports=r("Reflect","ownKeys")||function(e){var t=i.f(s(e)),n=a.f;return n?c(t,n(e)):t}},7750:function(e,t,n){"use strict";var r=n(4117),o=TypeError;e.exports=function(e){if(r(e))throw new o("Can't call method on "+e);return e}},9286:function(e,t,n){"use strict";var r=n(4402),o=n(8469),i=r.Set,a=r.add;e.exports=function(e){var t=new i;return o(e,(function(e){a(t,e)})),t}},3440:function(e,t,n){"use strict";var r=n(7080),o=n(4402),i=n(9286),a=n(5170),s=n(3789),c=n(8469),l=n(507),u=o.has,d=o.remove;e.exports=function(e){var t=r(this),n=s(e),o=i(t);return a(t)<=n.size?c(t,(function(e){n.includes(e)&&d(o,e)})):l(n.getIterator(),(function(e){u(t,e)&&d(o,e)})),o}},4402:function(e,t,n){"use strict";var r=n(9504),o=Set.prototype;e.exports={Set:Set,add:r(o.add),has:r(o.has),remove:r(o.delete),proto:o}},8750:function(e,t,n){"use strict";var r=n(7080),o=n(4402),i=n(5170),a=n(3789),s=n(8469),c=n(507),l=o.Set,u=o.add,d=o.has;e.exports=function(e){var t=r(this),n=a(e),o=new l;return i(t)>n.size?c(n.getIterator(),(function(e){d(t,e)&&u(o,e)})):s(t,(function(e){n.includes(e)&&u(o,e)})),o}},4449:function(e,t,n){"use strict";var r=n(7080),o=n(4402).has,i=n(5170),a=n(3789),s=n(8469),c=n(507),l=n(9539);e.exports=function(e){var t=r(this),n=a(e);if(i(t)<=n.size)return!1!==s(t,(function(e){if(n.includes(e))return!1}),!0);var u=n.getIterator();return!1!==c(u,(function(e){if(o(t,e))return l(u,"normal",!1)}))}},3838:function(e,t,n){"use strict";var r=n(7080),o=n(5170),i=n(8469),a=n(3789);e.exports=function(e){var t=r(this),n=a(e);return!(o(t)>n.size)&&!1!==i(t,(function(e){if(!n.includes(e))return!1}),!0)}},8527:function(e,t,n){"use strict";var r=n(7080),o=n(4402).has,i=n(5170),a=n(3789),s=n(507),c=n(9539);e.exports=function(e){var t=r(this),n=a(e);if(i(t)<n.size)return!1;var l=n.getIterator();return!1!==s(l,(function(e){if(!o(t,e))return c(l,"normal",!1)}))}},8469:function(e,t,n){"use strict";var r=n(9504),o=n(507),i=n(4402),a=i.Set,s=i.proto,c=r(s.forEach),l=r(s.keys),u=l(new a).next;e.exports=function(e,t,n){return n?o({iterator:l(e),next:u},t):c(e,t)}},4916:function(e,t,n){"use strict";var r=n(7751),o=function(e){return{size:e,has:function(){return!1},keys:function(){return{next:function(){return{done:!0}}}}}};e.exports=function(e){var t=r("Set");try{(new t)[e](o(0));try{return(new t)[e](o(-1)),!1}catch(e){return!0}}catch(e){return!1}}},5170:function(e,t,n){"use strict";var r=n(6706),o=n(4402);e.exports=r(o.proto,"size","get")||function(e){return e.size}},3650:function(e,t,n){"use strict";var r=n(7080),o=n(4402),i=n(9286),a=n(3789),s=n(507),c=o.add,l=o.has,u=o.remove;e.exports=function(e){var t=r(this),n=a(e).getIterator(),o=i(t);return s(n,(function(e){l(t,e)?u(o,e):c(o,e)})),o}},4204:function(e,t,n){"use strict";var r=n(7080),o=n(4402).add,i=n(9286),a=n(3789),s=n(507);e.exports=function(e){var t=r(this),n=a(e).getIterator(),c=i(t);return s(n,(function(e){o(c,e)})),c}},6119:function(e,t,n){"use strict";var r=n(5745),o=n(3392),i=r("keys");e.exports=function(e){return i[e]||(i[e]=o(e))}},7629:function(e,t,n){"use strict";var r=n(6395),o=n(4576),i=n(9433),a="__core-js_shared__",s=e.exports=o[a]||i(a,{});(s.versions||(s.versions=[])).push({version:"3.38.1",mode:r?"pure":"global",copyright:"© 2014-2024 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.38.1/LICENSE",source:"https://github.com/zloirock/core-js"})},5745:function(e,t,n){"use strict";var r=n(7629);e.exports=function(e,t){return r[e]||(r[e]=t||{})}},4495:function(e,t,n){"use strict";var r=n(9519),o=n(9039),i=n(4576).String;e.exports=!!Object.getOwnPropertySymbols&&!o((function(){var e=Symbol("symbol detection");return!i(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&r&&r<41}))},5610:function(e,t,n){"use strict";var r=n(1291),o=Math.max,i=Math.min;e.exports=function(e,t){var n=r(e);return n<0?o(n+t,0):i(n,t)}},5397:function(e,t,n){"use strict";var r=n(7055),o=n(7750);e.exports=function(e){return r(o(e))}},1291:function(e,t,n){"use strict";var r=n(741);e.exports=function(e){var t=+e;return t!=t||0===t?0:r(t)}},8014:function(e,t,n){"use strict";var r=n(1291),o=Math.min;e.exports=function(e){var t=r(e);return t>0?o(t,9007199254740991):0}},8981:function(e,t,n){"use strict";var r=n(7750),o=Object;e.exports=function(e){return o(r(e))}},2777:function(e,t,n){"use strict";var r=n(9565),o=n(34),i=n(757),a=n(5966),s=n(4270),c=n(8227),l=TypeError,u=c("toPrimitive");e.exports=function(e,t){if(!o(e)||i(e))return e;var n,c=a(e,u);if(c){if(void 0===t&&(t="default"),n=r(c,e,t),!o(n)||i(n))return n;throw new l("Can't convert object to primitive value")}return void 0===t&&(t="number"),s(e,t)}},6969:function(e,t,n){"use strict";var r=n(2777),o=n(757);e.exports=function(e){var t=r(e,"string");return o(t)?t:t+""}},6823:function(e){"use strict";var t=String;e.exports=function(e){try{return t(e)}catch(e){return"Object"}}},3392:function(e,t,n){"use strict";var r=n(9504),o=0,i=Math.random(),a=r(1..toString);e.exports=function(e){return"Symbol("+(void 0===e?"":e)+")_"+a(++o+i,36)}},7040:function(e,t,n){"use strict";var r=n(4495);e.exports=r&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},8686:function(e,t,n){"use strict";var r=n(3724),o=n(9039);e.exports=r&&o((function(){return 42!==Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype}))},8622:function(e,t,n){"use strict";var r=n(4576),o=n(4901),i=r.WeakMap;e.exports=o(i)&&/native code/.test(String(i))},8227:function(e,t,n){"use strict";var r=n(4576),o=n(5745),i=n(9297),a=n(3392),s=n(4495),c=n(7040),l=r.Symbol,u=o("wks"),d=c?l.for||l:l&&l.withoutSetter||a;e.exports=function(e){return i(u,e)||(u[e]=s&&i(l,e)?l[e]:d("Symbol."+e)),u[e]}},8107:function(e,t,n){"use strict";var r=n(6518),o=n(8981),i=n(6198),a=n(1291),s=n(6469);r({target:"Array",proto:!0},{at:function(e){var t=o(this),n=i(t),r=a(e),s=r>=0?r:n+r;return s<0||s>=n?void 0:t[s]}}),s("at")},4114:function(e,t,n){"use strict";var r=n(6518),o=n(8981),i=n(6198),a=n(4527),s=n(6837);r({target:"Array",proto:!0,arity:1,forced:n(9039)((function(){return 4294967297!==[].push.call({length:4294967296},1)}))||!function(){try{Object.defineProperty([],"length",{writable:!1}).push()}catch(e){return e instanceof TypeError}}()},{push:function(e){var t=o(this),n=i(t),r=arguments.length;s(n+r);for(var c=0;c<r;c++)t[n]=arguments[c],n++;return a(t,n),n}})},7642:function(e,t,n){"use strict";var r=n(6518),o=n(3440);r({target:"Set",proto:!0,real:!0,forced:!n(4916)("difference")},{difference:o})},8004:function(e,t,n){"use strict";var r=n(6518),o=n(9039),i=n(8750);r({target:"Set",proto:!0,real:!0,forced:!n(4916)("intersection")||o((function(){return"3,2"!==String(Array.from(new Set([1,2,3]).intersection(new Set([3,2]))))}))},{intersection:i})},3853:function(e,t,n){"use strict";var r=n(6518),o=n(4449);r({target:"Set",proto:!0,real:!0,forced:!n(4916)("isDisjointFrom")},{isDisjointFrom:o})},5876:function(e,t,n){"use strict";var r=n(6518),o=n(3838);r({target:"Set",proto:!0,real:!0,forced:!n(4916)("isSubsetOf")},{isSubsetOf:o})},2475:function(e,t,n){"use strict";var r=n(6518),o=n(8527);r({target:"Set",proto:!0,real:!0,forced:!n(4916)("isSupersetOf")},{isSupersetOf:o})},5024:function(e,t,n){"use strict";var r=n(6518),o=n(3650);r({target:"Set",proto:!0,real:!0,forced:!n(4916)("symmetricDifference")},{symmetricDifference:o})},1698:function(e,t,n){"use strict";var r=n(6518),o=n(4204);r({target:"Set",proto:!0,real:!0,forced:!n(4916)("union")},{union:o})},3375:function(e,t,n){"use strict";n(7642)},9225:function(e,t,n){"use strict";n(8004)},3972:function(e,t,n){"use strict";n(3853)},9209:function(e,t,n){"use strict";n(5876)},5714:function(e,t,n){"use strict";n(2475)},7561:function(e,t,n){"use strict";n(5024)},6197:function(e,t,n){"use strict";n(1698)}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var i=t[r]={exports:{}};return e[r].call(i.exports,i,i.exports,n),i.exports}n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,{a:t}),t},n.d=function(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=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},function(){var e;n.g.importScripts&&(e=n.g.location+"");var t=n.g.document;if(!e&&t&&(t.currentScript&&"SCRIPT"===t.currentScript.tagName.toUpperCase()&&(e=t.currentScript.src),!e)){var r=t.getElementsByTagName("script");if(r.length)for(var o=r.length-1;o>-1&&(!e||!/^http(s?):/.test(e));)e=r[o--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),n.p=e}();var r={};return function(){"use strict";n.r(r),n.d(r,{API:function(){return G},AgentInfo:function(){return ll},Chat:function(){return Qs},ChatFrame:function(){return Hc},ComponentFilter:function(){return os},Conversation:function(){return Ks},Engine:function(){return ol},EntryContainer:function(){return Bc},EventParticipant:function(){return qi},ExternalApi:function(){return sl},Header:function(){return ul},Icon:function(){return Zi},Interrupt:function(){return Kc},MessageContainer:function(){return Gi},SeamlyActivityMonitor:function(){return is},SeamlyApiContext:function(){return ai},SeamlyEventBusContext:function(){return si},SeamlyFileUpload:function(){return cs},SeamlyGeneralError:function(){return b},SeamlyLiveRegionContext:function(){return ci},SeamlyOfflineError:function(){return rr},SeamlyStoreProvider:function(){return rn},Text:function(){return Za},TextEntry:function(){return Pc},Upload:function(){return jc},View:function(){return nl},calculateVisibility:function(){return jt},className:function(){return Pi},default:function(){return dl},eventTypes:function(){return S},randomId:function(){return $},useChoicePrompt:function(){return ca},useEvents:function(){return Tn},useGeneratedId:function(){return Ji},useI18n:function(){return ni},useSeamlyActions:function(){return cl},useSeamlyChat:function(){return _i},useSeamlyCommands:function(){return fi},useSeamlyConfig:function(){return un},useSeamlyEventStream:function(){return Wi},useSeamlyIdleDetachCountdown:function(){return Hi},useSeamlyMessageContainerClassNames:function(){return Ri},useSeamlyOptions:function(){return zi},useSeamlyVisibility:function(){return ri},useTranslatedEventData:function(){return Oi},useTranslations:function(){return Ii},useTranslationsContainer:function(){return ki},visibilityStates:function(){return Dt}}),n(9497),n(4114);var e=n(2086),t=n.n(e),o=n(172),i=(n(3375),n(9225),n(3972),n(9209),n(5714),n(7561),n(6197),function(e,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},i(e,t)});function a(e,t){function n(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}function s(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a}var c=function(e,t){this.target=t,this.type=e},l=function(e){function t(t,n){var r=e.call(this,"error",n)||this;return r.message=t.message,r.error=t,r}return a(t,e),t}(c),u=function(e){function t(t,n,r){void 0===t&&(t=1e3),void 0===n&&(n="");var o=e.call(this,"close",r)||this;return o.wasClean=!0,o.code=t,o.reason=n,o}return a(t,e),t}(c),d=function(){if("undefined"!=typeof WebSocket)return WebSocket},p={maxReconnectionDelay:1e4,minReconnectionDelay:1e3+4e3*Math.random(),minUptime:5e3,reconnectionDelayGrowFactor:1.3,connectionTimeout:4e3,maxRetries:1/0,maxEnqueuedMessages:1/0,startClosed:!1,debug:!1},f=function(){function e(e,t,n){var r=this;void 0===n&&(n={}),this._listeners={error:[],message:[],open:[],close:[]},this._retryCount=-1,this._shouldReconnect=!0,this._connectLock=!1,this._binaryType="blob",this._closeCalled=!1,this._messageQueue=[],this.onclose=null,this.onerror=null,this.onmessage=null,this.onopen=null,this._handleOpen=function(e){r._debug("open event");var t=r._options.minUptime,n=void 0===t?p.minUptime:t;clearTimeout(r._connectTimeout),r._uptimeTimeout=setTimeout((function(){return r._acceptOpen()}),n),r._ws.binaryType=r._binaryType,r._messageQueue.forEach((function(e){return r._ws.send(e)})),r._messageQueue=[],r.onopen&&r.onopen(e),r._listeners.open.forEach((function(t){return r._callEventListener(e,t)}))},this._handleMessage=function(e){r._debug("message event"),r.onmessage&&r.onmessage(e),r._listeners.message.forEach((function(t){return r._callEventListener(e,t)}))},this._handleError=function(e){r._debug("error event",e.message),r._disconnect(void 0,"TIMEOUT"===e.message?"timeout":void 0),r.onerror&&r.onerror(e),r._debug("exec error listeners"),r._listeners.error.forEach((function(t){return r._callEventListener(e,t)})),r._connect()},this._handleClose=function(e){r._debug("close event"),r._clearTimeouts(),r._shouldReconnect&&r._connect(),r.onclose&&r.onclose(e),r._listeners.close.forEach((function(t){return r._callEventListener(e,t)}))},this._url=e,this._protocols=t,this._options=n,this._options.startClosed&&(this._shouldReconnect=!1),this._connect()}return Object.defineProperty(e,"CONNECTING",{get:function(){return 0},enumerable:!0,configurable:!0}),Object.defineProperty(e,"OPEN",{get:function(){return 1},enumerable:!0,configurable:!0}),Object.defineProperty(e,"CLOSING",{get:function(){return 2},enumerable:!0,configurable:!0}),Object.defineProperty(e,"CLOSED",{get:function(){return 3},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"CONNECTING",{get:function(){return e.CONNECTING},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"OPEN",{get:function(){return e.OPEN},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"CLOSING",{get:function(){return e.CLOSING},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"CLOSED",{get:function(){return e.CLOSED},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"binaryType",{get:function(){return this._ws?this._ws.binaryType:this._binaryType},set:function(e){this._binaryType=e,this._ws&&(this._ws.binaryType=e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"retryCount",{get:function(){return Math.max(this._retryCount,0)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"bufferedAmount",{get:function(){return this._messageQueue.reduce((function(e,t){return"string"==typeof t?e+=t.length:t instanceof Blob?e+=t.size:e+=t.byteLength,e}),0)+(this._ws?this._ws.bufferedAmount:0)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"extensions",{get:function(){return this._ws?this._ws.extensions:""},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"protocol",{get:function(){return this._ws?this._ws.protocol:""},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"readyState",{get:function(){return this._ws?this._ws.readyState:this._options.startClosed?e.CLOSED:e.CONNECTING},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"url",{get:function(){return this._ws?this._ws.url:""},enumerable:!0,configurable:!0}),e.prototype.close=function(e,t){void 0===e&&(e=1e3),this._closeCalled=!0,this._shouldReconnect=!1,this._clearTimeouts(),this._ws?this._ws.readyState!==this.CLOSED?this._ws.close(e,t):this._debug("close: already closed"):this._debug("close enqueued: no ws instance")},e.prototype.reconnect=function(e,t){this._shouldReconnect=!0,this._closeCalled=!1,this._retryCount=-1,this._ws&&this._ws.readyState!==this.CLOSED?(this._disconnect(e,t),this._connect()):this._connect()},e.prototype.send=function(e){if(this._ws&&this._ws.readyState===this.OPEN)this._debug("send",e),this._ws.send(e);else{var t=this._options.maxEnqueuedMessages,n=void 0===t?p.maxEnqueuedMessages:t;this._messageQueue.length<n&&(this._debug("enqueue",e),this._messageQueue.push(e))}},e.prototype.addEventListener=function(e,t){this._listeners[e]&&this._listeners[e].push(t)},e.prototype.dispatchEvent=function(e){var t,n,r=this._listeners[e.type];if(r)try{for(var o=function(e){var t="function"==typeof Symbol&&e[Symbol.iterator],n=0;return t?t.call(e):{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}}}(r),i=o.next();!i.done;i=o.next()){var a=i.value;this._callEventListener(e,a)}}catch(e){t={error:e}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(t)throw t.error}}return!0},e.prototype.removeEventListener=function(e,t){this._listeners[e]&&(this._listeners[e]=this._listeners[e].filter((function(e){return e!==t})))},e.prototype._debug=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this._options.debug&&console.log.apply(console,function(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(s(arguments[t]));return e}(["RWS>"],e))},e.prototype._getNextDelay=function(){var e=this._options,t=e.reconnectionDelayGrowFactor,n=void 0===t?p.reconnectionDelayGrowFactor:t,r=e.minReconnectionDelay,o=void 0===r?p.minReconnectionDelay:r,i=e.maxReconnectionDelay,a=void 0===i?p.maxReconnectionDelay:i,s=0;return this._retryCount>0&&(s=o*Math.pow(n,this._retryCount-1))>a&&(s=a),this._debug("next delay",s),s},e.prototype._wait=function(){var e=this;return new Promise((function(t){setTimeout(t,e._getNextDelay())}))},e.prototype._getNextUrl=function(e){if("string"==typeof e)return Promise.resolve(e);if("function"==typeof e){var t=e();if("string"==typeof t)return Promise.resolve(t);if(t.then)return t}throw Error("Invalid URL")},e.prototype._connect=function(){var e=this;if(!this._connectLock&&this._shouldReconnect){this._connectLock=!0;var t=this._options,n=t.maxRetries,r=void 0===n?p.maxRetries:n,o=t.connectionTimeout,i=void 0===o?p.connectionTimeout:o,a=t.WebSocket,s=void 0===a?d():a;if(this._retryCount>=r)this._debug("max retries reached",this._retryCount,">=",r);else{if(this._retryCount++,this._debug("connect",this._retryCount),this._removeListeners(),void 0===(c=s)||!c||2!==c.CLOSING)throw Error("No valid WebSocket class provided");var c;this._wait().then((function(){return e._getNextUrl(e._url)})).then((function(t){e._closeCalled||(e._debug("connect",{url:t,protocols:e._protocols}),e._ws=e._protocols?new s(t,e._protocols):new s(t),e._ws.binaryType=e._binaryType,e._connectLock=!1,e._addListeners(),e._connectTimeout=setTimeout((function(){return e._handleTimeout()}),i))}))}}},e.prototype._handleTimeout=function(){this._debug("timeout event"),this._handleError(new l(Error("TIMEOUT"),this))},e.prototype._disconnect=function(e,t){if(void 0===e&&(e=1e3),this._clearTimeouts(),this._ws){this._removeListeners();try{this._ws.close(e,t),this._handleClose(new u(e,t,this))}catch(e){}}},e.prototype._acceptOpen=function(){this._debug("accept open"),this._retryCount=0},e.prototype._callEventListener=function(e,t){"handleEvent"in t?t.handleEvent(e):t(e)},e.prototype._removeListeners=function(){this._ws&&(this._debug("removeListeners"),this._ws.removeEventListener("open",this._handleOpen),this._ws.removeEventListener("close",this._handleClose),this._ws.removeEventListener("message",this._handleMessage),this._ws.removeEventListener("error",this._handleError))},e.prototype._addListeners=function(){this._ws&&(this._debug("addListeners"),this._ws.addEventListener("open",this._handleOpen),this._ws.addEventListener("close",this._handleClose),this._ws.addEventListener("message",this._handleMessage),this._ws.addEventListener("error",this._handleError))},e.prototype._clearTimeouts=function(){clearTimeout(this._connectTimeout),clearTimeout(this._uptimeTimeout)},e}(),h=f;const v=new Set;class m{#e=[];#t=null;#n=null;#r=e=>{const t=JSON.parse(e.data);this.#t&&clearInterval(this.#t),this.#t=setInterval((()=>{this.socket?.readyState===h.OPEN&&this.socket?.send(JSON.stringify({type:"ping"}))}),3e4);try{if("attach_channel_response"===t.type){if(!t.payload.success)return void this.#o({connected:!0,ready:!1,currentState:"attach_channel_erred"});this.#o({connected:!0,ready:!0,currentState:"attach_channel_response"})}}catch(e){console.warn(e)}};#i=()=>{this.#o({connected:!1,ready:!1,currentState:"socket_closed"})};#a=()=>{this.#o({connected:!1,ready:!1,currentState:"socket_join_error"})};accessToken="";channelName="";channelTopic="";url="";async connect(e,t,n,r){this.url=e,this.accessToken=r,this.channelName=t,this.channelTopic=n;const{url:o}=(e=>{const t=e.indexOf("?");return t<0?{url:e,params:{}}:{url:e.slice(0,t),params:e.slice(t+1).split("&").reduce((function(e,t){const[n,r]=t.split("=");return{...e,[n]:decodeURIComponent(r)}}),{})}})(this.url);this.socket=new h(o,[],{maxReconnectionDelay:1e4,minReconnectionDelay:500,reconnectionDelayGrowFactor:2});const i={type:"attach_channel",payload:{accessToken:this.accessToken,channelName:this.channelName}};this.#n=()=>{this.socket?.send(JSON.stringify(i)),this.#o({connected:!0,ready:!1,currentState:"socket_connected"})},this.socket?.addEventListener("open",this.#n),this.socket?.addEventListener("message",this.#r),this.socket?.addEventListener("close",this.#i),this.socket?.addEventListener("error",this.#a)}disconnect(){this.socket?.close(),this.#n&&this.socket?.removeEventListener("open",this.#n),this.socket?.removeEventListener("message",this.#r),this.socket?.removeEventListener("close",this.#i),this.socket?.removeEventListener("error",this.#a),this.#e=[]}onOpen=e=>{this?.socket?.addEventListener("open",e)};onError=e=>{this?.socket?.addEventListener("error",e)};addListener=(e,t)=>{this?.socket?.addEventListener(e,(e=>t(JSON.parse(e.data))))};onMessage=e=>{this?.socket&&(this.socket.onmessage=t=>e(JSON.parse(t.data)))};removeListener=(e,t)=>{this.socket?.removeEventListener(e,t)};onConnection(e){this.#e.push(e)}#o(e){this.#e=this.#e.filter((t=>!t(e))),v.forEach((e=>e()))}pushToChannel(e,t){this.socket?.send(JSON.stringify({type:e,payload:t}))}static subscribe(e){return v.add(e),()=>v.delete(e)}}class y extends Error{constructor(e,t){super(e,{cause:t?.cause}),this.status=t?.status}}class _ 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 g extends _{constructor(e,...t){super(e,...t),this.name="SeamlyConfigurationError",this.langKey="errors.configError"}}class b extends _{constructor(e,...t){super(e,...t),this.name="SeamlyGeneralError",this.langKey="errors.general",this.action="reset"}}class w extends _{constructor(e,...t){super(e,...t),this.name="SeamlySessionExpiredError",this.action="reset"}}class x extends _{constructor(e,...t){super(e,...t),this.name="SeamlyUnauthorizedError",this.langKey="errors.general",this.action="reset"}}function C(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 n?JSON.parse(n):{}},set(e){e&&sessionStorage.setItem(t,JSON.stringify(e))}}}const S={info:"info",message:"message",participant:"participant",system:"system"},E="text",T="text",N="upload",I="received",O="read",k="custom",L="typing",A="read",P="detach_service",M="dismiss",R="set_topic",F="click_cta",D="translation_proposal",U=D,j="window_api",z="assertive",B="polite",V={new_topic:"newTopic",new_translation:"newTranslation"},K="uploads",H="navigate";function $(){return`_${(Number(String(Math.random()).slice(2))+Date.now()+Math.round(performance.now())).toString(36)}`}const J=async(e,t)=>{const n=new URL(e),r=await fetch(n.href,{mode:"cors",...t});if(!r.ok)throw new y(r.statusText||`Request failed with status: ${r.status}`,{status:r.status});return r};function W(){if(!Intl||"undefined"==typeof Intl||void 0===Intl.DateTimeFormat)return;const e=Intl.DateTimeFormat();if(void 0===e||void 0===e.resolvedOptions)return;const t=e.resolvedOptions().timeZone;return t&&(t.indexOf("/")>-1||"UTC"===t)?t:void 0}const q=(...e)=>console.debug("seamly",...e);class G{#s;#c;#l;#u="window";#d;#p="new";URLS={};locale="";conversation=new m;constructor({layoutMode:e,namespace:t,config:n,context:r}){this.store=function(e,t){const n=t(e),r=n.get()||{};return{get(e){return void 0===e?r:r[e]},set(e,t){return r[e]=t,n.set(r),t},delete(e){const t=this.get(e);return delete r[e],n.set(r),t}}}(`${t}.connection${r.userLocale?`.${r.userLocale}`:""}`,n.storageProvider||C),this.connectionInfo={apiKey:n.key,domain:n.domain||"api.seamly-app.com",secure:!1!==n.secure&&(n.secure||!0)},this.#d={...n,sendEnvironment:n.sendEnvironment??!0,context:{...r,channelName:r.channelName||"web"}},this.#s=!1,this.connected=!1,this.configReady=!1,n.externalId&&(this.#c=n.externalId),this.#u=e,this.userResponded=!1,this.URLS={translations:{href:`/channels/api/v2/client/${this.connectionInfo.apiKey}/translations/{version}/{locale}.json`,templated:!0},config:{href:`/channels/api/v2/client/${this.connectionInfo.apiKey}/configs`,templated:!0}},window.addEventListener("pageshow",(e=>{e.persisted&&this.connected&&this.connect()}))}getAccessToken(){return this.store.get("accessToken")}setAccessToken(e){this.store.set("accessToken",e)}getConversationUrl(){return this.store.get("conversationUrl")}setConversationUrl(e){this.store.set("conversationUrl",e?.href)}hasConversation(){return!!this.getConversationUrl()}getChannelTopic(){return this.store.get("channelTopic")||this.store.get("channelName")}getLocale=e=>e||this.locale;#f({_links:{self:e,...t}}){this.URLS={...this.URLS,...t}}clearStore(){this.store.delete("accessToken"),this.store.delete("conversationUrl"),this.store.delete("channelName"),this.store.delete("channelTopic")}#h(e){return`${this.connectionInfo.secure?`${e}s`:e}://${this.connectionInfo.domain}`}async getTranslations(e){try{if(!this.URLS.translations?.href)throw new g;const t=`${this.#h("http")}${this.URLS.translations.href}`.replace("{version}",String(4)).replace("{locale}",this.getLocale(e)),n=await J(t,{method:"GET"});return(await n.json()).translations}catch(e){if(e.status>=500)throw new b(e);throw new y(e)}}getContext(e){const{source:t,userLocale:n,variables:r}=e;if(t&&"string"!=typeof t)throw new Error("Source must be a string");if(n){if("string"!=typeof n)throw new Error("Locale must be a string");this.#v(e,n)}if(r&&"object"!=typeof r)throw new Error("Variables must be an object");if(0===Object.keys(e).length&&e.constructor===Object)return;const o=this.#d.context?.contentLocale,i=this.#d.context?.userLocale;return{...o?{contentLocale:o}:{},...i?{userLocale:i}:{},...e}}uploadFile(e,t,n,r){const o=new FormData;o.append("upload",e);const i=new XMLHttpRequest;return i.open("POST",`${this.#h("http")}${this.URLS.uploads.href}`),i.setRequestHeader("Authorization",`Bearer ${this.getAccessToken()}`),i.upload.onprogress=e=>{if("function"==typeof t){const n=Math.ceil(e.loaded/e.total*100);t(n)}},i.onloadend=()=>{if(0!==i.status)if(200!==i.status&&201!==i.status||!n){if(!r)throw new Error(i.response);try{r(JSON.parse(i.response))}catch(e){r(i.response)}}else try{n(JSON.parse(i.response))}catch(e){n(i.response)}},i.send(o),i}async createConversation(){try{"function"==typeof this.#d?.getConversationAuthToken&&(this.#l=await this.#d.getConversationAuthToken());const e=await J(`${this.#h("http")}${this.URLS.conversations?.href}`,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({externalId:this.#l?void 0:this.#c,token:this.#l})}),t=await e.json(),{conversation:n}=t,r={...n};return this.setAccessToken(n.accessToken),this.#f(t),this.URLS.conversation&&this.setConversationUrl(this.URLS.conversation),this.locale=n.context.userLocale,this.userResponded=n.userResponded,this.#p=n.status,r}catch(e){if(e.status>=500)throw new b(e);if(400===e.status)throw new x(e);if(404===e.status)throw new g(e);throw e}}async getConfig(){try{const e={channelName:this.#d.context.channelName,contentLocale:this.#d.context.contentLocale,environment:!0===this.#d.sendEnvironment?this.getEnvironment():this.#d.sendEnvironment,userLocale:this.#d.context.userLocale,variables:this.#d.context.variables},t=await J(`${this.#h("http")}${this.URLS.config?.href}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({context:e})}),n=await t.json();return this.#f(n),this.configReady=!0,n.config}catch(e){if(404===e.status)throw new g(e);if(e.status>=500)throw new b(e);throw e}}async fetchConversation(){if(!this.hasConversation())return null;try{const e=await J(`${this.#h("http")}${this.getConversationUrl()}`,{method:"GET",headers:{Authorization:`Bearer ${this.getAccessToken()}`}}),t=await e.json();return this.#p=t.conversation.status,this.#f(t),t.conversation}catch(e){if(401===e.status)throw new x(e);if(404===e.status)throw new w(e);if(e.status>=500)throw new b(e);throw e}}async getConversation(){return this.hasConversation()?this.fetchConversation():null}async getConversationIntitialState(){return this.fetchConversation()}async disconnect(){this.conversation?.disconnect&&this.conversation.disconnect(),this.connected=!1,this.configReady=!1}async connect(){this.connected=!1;const e=this.hasConversation()?void 0:await this.createConversation();return this.URLS.socket&&(this.conversation.connect(`${this.#h("ws")}${this.URLS.socket.href}`,this.#d.context.channelName||"",this.getChannelTopic(),this.getAccessToken()),this.conversation.onConnection((({connected:e,ready:t})=>{this.connected=e,this.#s=t})),this.send("context",this.#m())),e}send(e,t=void 0){this.connected&&this.#s?(q("[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=$()),{type:n,body:r,transactionId:o}}(e,t))):this.conversation?.onConnection((({connected:n,ready:r})=>(this.connected=n,this.#s=r,!!r&&(this.send(e,t),!0))))}sendContext(e){const t=this.getContext(e);t&&this.send("context",t)}#m(){const e=!0===this.#d.sendEnvironment?this.getEnvironment():void 0,t="string"==typeof this.#d.context?.source?this.#d.context?.source:void 0,n=this.#d.context?.variables;return{contentLocale:"started"!==this.#p?this.#d.context?.contentLocale:void 0,environment:e,source:t,userLocale:"started"!==this.#p?this.#d.context?.userLocale:void 0,variables:n}}#v(e,t){e.source||t==this.#d.context?.userLocale||(e.source=j)}getEnvironment(){return{clientName:"@seamly/web-ui",clientVariant:this.#u,clientVersion:"24.0.0-beta.7",currentUrl:window.location.toString(),screenResolution:`${window.screen.width}x${window.screen.height}`,timezone:W(),userAgent:navigator.userAgent,preferredLocale:navigator.language}}}function X(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 Y=(()=>"function"==typeof Symbol&&Symbol.observable||"@@observable")(),Q=()=>Math.random().toString(36).substring(7).split("").join("."),Z={INIT:`@@redux/INIT${Q()}`,REPLACE:`@@redux/REPLACE${Q()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${Q()}`};function ee(e){if("object"!=typeof e||null===e)return!1;let t=e;for(;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||null===Object.getPrototypeOf(e)}function te(e,t,n){if("function"!=typeof e)throw new Error(X(2));if("function"==typeof t&&"function"==typeof n||"function"==typeof n&&"function"==typeof arguments[3])throw new Error(X(0));if("function"==typeof t&&void 0===n&&(n=t,t=void 0),void 0!==n){if("function"!=typeof n)throw new Error(X(1));return n(te)(e,t)}let r=e,o=t,i=new Map,a=i,s=0,c=!1;function l(){a===i&&(a=new Map,i.forEach(((e,t)=>{a.set(t,e)})))}function u(){if(c)throw new Error(X(3));return o}function d(e){if("function"!=typeof e)throw new Error(X(4));if(c)throw new Error(X(5));let t=!0;l();const n=s++;return a.set(n,e),function(){if(t){if(c)throw new Error(X(6));t=!1,l(),a.delete(n),i=null}}}function p(e){if(!ee(e))throw new Error(X(7));if(void 0===e.type)throw new Error(X(8));if("string"!=typeof e.type)throw new Error(X(17));if(c)throw new Error(X(9));try{c=!0,o=r(o,e)}finally{c=!1}return(i=a).forEach((e=>{e()})),e}return p({type:Z.INIT}),{dispatch:p,subscribe:d,getState:u,replaceReducer:function(e){if("function"!=typeof e)throw new Error(X(10));r=e,p({type:Z.REPLACE})},[Y]:function(){const e=d;return{subscribe(t){if("object"!=typeof t||null===t)throw new Error(X(11));function n(){const e=t;e.next&&e.next(u())}return n(),{unsubscribe:e(n)}},[Y](){return this}}}}}function ne(e){const t=Object.keys(e),n={};for(let r=0;r<t.length;r++){const o=t[r];"function"==typeof e[o]&&(n[o]=e[o])}const r=Object.keys(n);let o;try{!function(e){Object.keys(e).forEach((t=>{const n=e[t];if(void 0===n(void 0,{type:Z.INIT}))throw new Error(X(12));if(void 0===n(void 0,{type:Z.PROBE_UNKNOWN_ACTION()}))throw new Error(X(13))}))}(n)}catch(e){o=e}return function(e={},t){if(o)throw o;let i=!1;const a={};for(let o=0;o<r.length;o++){const s=r[o],c=n[s],l=e[s],u=c(l,t);if(void 0===u)throw t&&t.type,new Error(X(14));a[s]=u,i=i||u!==l}return i=i||r.length!==Object.keys(e).length,i?a:e}}function re(...e){return 0===e.length?e=>e:1===e.length?e[0]:e.reduce(((e,t)=>(...n)=>e(t(...n))))}function oe(e){return({dispatch:t,getState:n})=>r=>o=>"function"==typeof o?o(t,n,e):r(o)}var ie=oe(),ae=oe,se=Symbol.for("immer-nothing"),ce=Symbol.for("immer-draftable"),le=Symbol.for("immer-state");function ue(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var de=Object.getPrototypeOf;function pe(e){return!!e&&!!e[le]}function fe(e){return!!e&&(ve(e)||Array.isArray(e)||!!e[ce]||!!e.constructor?.[ce]||be(e)||we(e))}var he=Object.prototype.constructor.toString();function ve(e){if(!e||"object"!=typeof e)return!1;const t=de(e);if(null===t)return!0;const n=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return n===Object||"function"==typeof n&&Function.toString.call(n)===he}function me(e,t){0===ye(e)?Reflect.ownKeys(e).forEach((n=>{t(n,e[n],e)})):e.forEach(((n,r)=>t(r,n,e)))}function ye(e){const t=e[le];return t?t.type_:Array.isArray(e)?1:be(e)?2:we(e)?3:0}function _e(e,t){return 2===ye(e)?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function ge(e,t,n){const r=ye(e);2===r?e.set(t,n):3===r?e.add(n):e[t]=n}function be(e){return e instanceof Map}function we(e){return e instanceof Set}function xe(e){return e.copy_||e.base_}function Ce(e,t){if(be(e))return new Map(e);if(we(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);const n=ve(e);if(!0===t||"class_only"===t&&!n){const t=Object.getOwnPropertyDescriptors(e);delete t[le];let n=Reflect.ownKeys(t);for(let r=0;r<n.length;r++){const 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(de(e),t)}{const t=de(e);if(null!==t&&n)return{...e};const r=Object.create(t);return Object.assign(r,e)}}function Se(e,t=!1){return Te(e)||pe(e)||!fe(e)||(ye(e)>1&&(e.set=e.add=e.clear=e.delete=Ee),Object.freeze(e),t&&Object.entries(e).forEach((([e,t])=>Se(t,!0)))),e}function Ee(){ue(2)}function Te(e){return Object.isFrozen(e)}var Ne,Ie={};function Oe(e){const t=Ie[e];return t||ue(0),t}function ke(){return Ne}function Le(e,t){t&&(Oe("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function Ae(e){Pe(e),e.drafts_.forEach(Re),e.drafts_=null}function Pe(e){e===Ne&&(Ne=e.parent_)}function Me(e){return Ne={drafts_:[],parent_:Ne,immer_:e,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function Re(e){const t=e[le];0===t.type_||1===t.type_?t.revoke_():t.revoked_=!0}function Fe(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];return void 0!==e&&e!==n?(n[le].modified_&&(Ae(t),ue(4)),fe(e)&&(e=De(t,e),t.parent_||je(t,e)),t.patches_&&Oe("Patches").generateReplacementPatches_(n[le].base_,e,t.patches_,t.inversePatches_)):e=De(t,n,[]),Ae(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==se?e:void 0}function De(e,t,n){if(Te(t))return t;const r=t[le];if(!r)return me(t,((o,i)=>Ue(e,r,t,o,i,n))),t;if(r.scope_!==e)return t;if(!r.modified_)return je(e,r.base_,!0),r.base_;if(!r.finalized_){r.finalized_=!0,r.scope_.unfinalizedDrafts_--;const t=r.copy_;let o=t,i=!1;3===r.type_&&(o=new Set(t),t.clear(),i=!0),me(o,((o,a)=>Ue(e,r,t,o,a,n,i))),je(e,t,!1),n&&e.patches_&&Oe("Patches").generatePatches_(r,n,e.patches_,e.inversePatches_)}return r.copy_}function Ue(e,t,n,r,o,i,a){if(pe(o)){const a=De(e,o,i&&t&&3!==t.type_&&!_e(t.assigned_,r)?i.concat(r):void 0);if(ge(n,r,a),!pe(a))return;e.canAutoFreeze_=!1}else a&&n.add(o);if(fe(o)&&!Te(o)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;De(e,o),t&&t.scope_.parent_||"symbol"==typeof r||!Object.prototype.propertyIsEnumerable.call(n,r)||je(e,o)}}function je(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&Se(t,n)}var ze={get(e,t){if(t===le)return e;const n=xe(e);if(!_e(n,t))return function(e,t,n){const r=Ke(t,n);return r?"value"in r?r.value:r.get?.call(e.draft_):void 0}(e,n,t);const r=n[t];return e.finalized_||!fe(r)?r:r===Ve(e.base_,t)?($e(e),e.copy_[t]=Je(r,e)):r},has(e,t){return t in xe(e)},ownKeys(e){return Reflect.ownKeys(xe(e))},set(e,t,n){const r=Ke(xe(e),t);if(r?.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const r=Ve(xe(e),t),a=r?.[le];if(a&&a.base_===n)return e.copy_[t]=n,e.assigned_[t]=!1,!0;if(((o=n)===(i=r)?0!==o||1/o==1/i:o!=o&&i!=i)&&(void 0!==n||_e(e.base_,t)))return!0;$e(e),He(e)}var o,i;return e.copy_[t]===n&&(void 0!==n||t in e.copy_)||Number.isNaN(n)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=n,e.assigned_[t]=!0),!0},deleteProperty(e,t){return void 0!==Ve(e.base_,t)||t in e.base_?(e.assigned_[t]=!1,$e(e),He(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const n=xe(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r?{writable:!0,configurable:1!==e.type_||"length"!==t,enumerable:r.enumerable,value:n[t]}:r},defineProperty(){ue(11)},getPrototypeOf(e){return de(e.base_)},setPrototypeOf(){ue(12)}},Be={};function Ve(e,t){const n=e[le];return(n?xe(n):e)[t]}function Ke(e,t){if(!(t in e))return;let n=de(e);for(;n;){const e=Object.getOwnPropertyDescriptor(n,t);if(e)return e;n=de(n)}}function He(e){e.modified_||(e.modified_=!0,e.parent_&&He(e.parent_))}function $e(e){e.copy_||(e.copy_=Ce(e.base_,e.scope_.immer_.useStrictShallowCopy_))}function Je(e,t){const n=be(e)?Oe("MapSet").proxyMap_(e,t):we(e)?Oe("MapSet").proxySet_(e,t):function(e,t){const n=Array.isArray(e),r={type_:n?1:0,scope_:t?t.scope_:ke(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let o=r,i=ze;n&&(o=[r],i=Be);const{revoke:a,proxy:s}=Proxy.revocable(o,i);return r.draft_=s,r.revoke_=a,s}(e,t);return(t?t.scope_:ke()).drafts_.push(n),n}function We(e){if(!fe(e)||Te(e))return e;const t=e[le];let n;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=Ce(e,t.scope_.immer_.useStrictShallowCopy_)}else n=Ce(e,!0);return me(n,((e,t)=>{ge(n,e,We(t))})),t&&(t.finalized_=!1),n}me(ze,((e,t)=>{Be[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}})),Be.deleteProperty=function(e,t){return Be.set.call(this,e,t,void 0)},Be.set=function(e,t,n){return ze.set.call(this,e[0],t,n,e[0])};var qe=new class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(e,t,n)=>{if("function"==typeof e&&"function"!=typeof t){const n=t;t=e;const r=this;return function(e=n,...o){return r.produce(e,(e=>t.call(this,e,...o)))}}let r;if("function"!=typeof t&&ue(6),void 0!==n&&"function"!=typeof n&&ue(7),fe(e)){const o=Me(this),i=Je(e,void 0);let a=!0;try{r=t(i),a=!1}finally{a?Ae(o):Pe(o)}return Le(o,n),Fe(r,o)}if(!e||"object"!=typeof e){if(r=t(e),void 0===r&&(r=e),r===se&&(r=void 0),this.autoFreeze_&&Se(r,!0),n){const t=[],o=[];Oe("Patches").generateReplacementPatches_(e,r,t,o),n(t,o)}return r}ue(1)},this.produceWithPatches=(e,t)=>{if("function"==typeof e)return(t,...n)=>this.produceWithPatches(t,(t=>e(t,...n)));let n,r;return[this.produce(e,t,((e,t)=>{n=e,r=t})),n,r]},"boolean"==typeof e?.autoFreeze&&this.setAutoFreeze(e.autoFreeze),"boolean"==typeof e?.useStrictShallowCopy&&this.setUseStrictShallowCopy(e.useStrictShallowCopy)}createDraft(e){var t;fe(e)||ue(8),pe(e)&&(pe(t=e)||ue(10),e=We(t));const n=Me(this),r=Je(e,void 0);return r[le].isManual_=!0,Pe(n),r}finishDraft(e,t){const n=e&&e[le];n&&n.isManual_||ue(9);const{scope_:r}=n;return Le(r,t),Fe(void 0,r)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}applyPatches(e,t){let n;for(n=t.length-1;n>=0;n--){const r=t[n];if(0===r.path.length&&"replace"===r.op){e=r.value;break}}n>-1&&(t=t.slice(n+1));const r=Oe("Patches").applyPatches_;return pe(e)?r(e,t):this.produce(e,(e=>r(e,t)))}},Ge=qe.produce;qe.produceWithPatches.bind(qe),qe.setAutoFreeze.bind(qe),qe.setUseStrictShallowCopy.bind(qe),qe.applyPatches.bind(qe),qe.createDraft.bind(qe),qe.finishDraft.bind(qe);var Xe="undefined"!=typeof window&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(0!==arguments.length)return"object"==typeof arguments[0]?re:re.apply(null,arguments)},Ye=("undefined"!=typeof window&&window.__REDUX_DEVTOOLS_EXTENSION__&&window.__REDUX_DEVTOOLS_EXTENSION__,e=>e&&"function"==typeof e.match);function Qe(e,t){function n(...n){if(t){let r=t(...n);if(!r)throw new Error(xt(0));return{type:e,payload:r.payload,..."meta"in r&&{meta:r.meta},..."error"in r&&{error:r.error}}}return{type:e,payload:n[0]}}return n.toString=()=>`${e}`,n.type=e,n.match=t=>function(e){return ee(e)&&"type"in e&&"string"==typeof e.type}(t)&&t.type===e,n}var Ze=class e extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,e.prototype)}static get[Symbol.species](){return e}concat(...e){return super.concat.apply(this,e)}prepend(...t){return 1===t.length&&Array.isArray(t[0])?new e(...t[0].concat(this)):new e(...t.concat(this))}};function et(e){return fe(e)?Ge(e,(()=>{})):e}function tt(e,t,n){if(e.has(t)){let r=e.get(t);return n.update&&(r=n.update(r,t,e),e.set(t,r)),r}if(!n.insert)throw new Error(xt(10));const r=n.insert(t,e);return e.set(t,r),r}var nt=()=>function(e){const{thunk:t=!0,immutableCheck:n=!0,serializableCheck:r=!0,actionCreatorCheck:o=!0}=e??{};let i=new Ze;return t&&("boolean"==typeof t?i.push(ie):i.push(ae(t.extraArgument))),i},rt=e=>t=>{setTimeout(t,e)},ot="undefined"!=typeof window&&window.requestAnimationFrame?window.requestAnimationFrame:rt(10),it=e=>function(t){const{autoBatch:n=!0}=t??{};let r=new Ze(e);return n&&r.push(((e={type:"raf"})=>t=>(...n)=>{const r=t(...n);let o=!0,i=!1,a=!1;const s=new Set,c="tick"===e.type?queueMicrotask:"raf"===e.type?ot:"callback"===e.type?e.queueNotification:rt(e.timeout),l=()=>{a=!1,i&&(i=!1,s.forEach((e=>e())))};return Object.assign({},r,{subscribe(e){const t=r.subscribe((()=>o&&e()));return s.add(e),()=>{t(),s.delete(e)}},dispatch(e){try{return o=!e?.meta?.RTK_autoBatch,i=!o,i&&(a||(a=!0,c(l))),r.dispatch(e)}finally{o=!0}}})})("object"==typeof n?n:void 0)),r};function at(e){const t={},n=[];let r;const o={addCase(e,n){const r="string"==typeof e?e:e.type;if(!r)throw new Error(xt(28));if(r in t)throw new Error(xt(29));return t[r]=n,o},addMatcher(e,t){return n.push({matcher:e,reducer:t}),o},addDefaultCase(e){return r=e,o}};return e(o),[t,n,r]}function st(...e){return t=>e.some((e=>((e,t)=>Ye(e)?e.match(t):e(t))(e,t)))}var ct=(e=21)=>{let t="",n=e;for(;n--;)t+="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW"[64*Math.random()|0];return t},lt=["name","message","stack","code"],ut=class{constructor(e,t){this.payload=e,this.meta=t}_type},dt=class{constructor(e,t){this.payload=e,this.meta=t}_type},pt=e=>{if("object"==typeof e&&null!==e){const t={};for(const n of lt)"string"==typeof e[n]&&(t[n]=e[n]);return t}return{message:String(e)}},ft=(()=>{function e(e,t,n){const r=Qe(e+"/fulfilled",((e,t,n,r)=>({payload:e,meta:{...r||{},arg:n,requestId:t,requestStatus:"fulfilled"}}))),o=Qe(e+"/pending",((e,t,n)=>({payload:void 0,meta:{...n||{},arg:t,requestId:e,requestStatus:"pending"}}))),i=Qe(e+"/rejected",((e,t,r,o,i)=>({payload:o,error:(n&&n.serializeError||pt)(e||"Rejected"),meta:{...i||{},arg:r,requestId:t,rejectedWithValue:!!o,requestStatus:"rejected",aborted:"AbortError"===e?.name,condition:"ConditionError"===e?.name}})));return Object.assign((function(e){return(a,s,c)=>{const l=n?.idGenerator?n.idGenerator(e):ct(),u=new AbortController;let d,p;function f(e){p=e,u.abort()}const h=async function(){let h;try{let i=n?.condition?.(e,{getState:s,extra:c});if(null!==(v=i)&&"object"==typeof v&&"function"==typeof v.then&&(i=await i),!1===i||u.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};const m=new Promise(((e,t)=>{d=()=>{t({name:"AbortError",message:p||"Aborted"})},u.signal.addEventListener("abort",d)}));a(o(l,e,n?.getPendingMeta?.({requestId:l,arg:e},{getState:s,extra:c}))),h=await Promise.race([m,Promise.resolve(t(e,{dispatch:a,getState:s,extra:c,requestId:l,signal:u.signal,abort:f,rejectWithValue:(e,t)=>new ut(e,t),fulfillWithValue:(e,t)=>new dt(e,t)})).then((t=>{if(t instanceof ut)throw t;return t instanceof dt?r(t.payload,l,e,t.meta):r(t,l,e)}))])}catch(t){h=t instanceof ut?i(null,l,e,t.payload,t.meta):i(t,l,e)}finally{d&&u.signal.removeEventListener("abort",d)}var v;return n&&!n.dispatchConditionRejection&&i.match(h)&&h.meta.condition||a(h),h}();return Object.assign(h,{abort:f,requestId:l,arg:e,unwrap(){return h.then(ht)}})}}),{pending:o,rejected:i,fulfilled:r,settled:st(i,r),typePrefix:e})}return e.withTypes=()=>e,e})();function ht(e){if(e.meta&&e.meta.rejectedWithValue)throw e.payload;if(e.error)throw e.error;return e.payload}var vt=Symbol.for("rtk-slice-createasyncthunk");function mt(e,t){return`${e}/${t}`}function yt({creators:e}={}){const t=e?.asyncThunk?.[vt];return function(e){const{name:n,reducerPath:r=n}=e;if(!n)throw new Error(xt(11));const o=("function"==typeof e.reducers?e.reducers(function(){function e(e,t){return{_reducerDefinitionType:"asyncThunk",payloadCreator:e,...t}}return e.withTypes=()=>e,{reducer(e){return Object.assign({[e.name](...t){return e(...t)}}[e.name],{_reducerDefinitionType:"reducer"})},preparedReducer(e,t){return{_reducerDefinitionType:"reducerWithPrepare",prepare:e,reducer:t}},asyncThunk:e}}()):e.reducers)||{},i=Object.keys(o),a={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},s={addCase(e,t){const n="string"==typeof e?e:e.type;if(!n)throw new Error(xt(12));if(n in a.sliceCaseReducersByType)throw new Error(xt(13));return a.sliceCaseReducersByType[n]=t,s},addMatcher(e,t){return a.sliceMatchers.push({matcher:e,reducer:t}),s},exposeAction(e,t){return a.actionCreators[e]=t,s},exposeCaseReducer(e,t){return a.sliceCaseReducersByName[e]=t,s}};function c(){const[t={},n=[],r]="function"==typeof e.extraReducers?at(e.extraReducers):[e.extraReducers],o={...t,...a.sliceCaseReducersByType};return function(e){let t,[i,s,c]=at((e=>{for(let t in o)e.addCase(t,o[t]);for(let t of a.sliceMatchers)e.addMatcher(t.matcher,t.reducer);for(let t of n)e.addMatcher(t.matcher,t.reducer);r&&e.addDefaultCase(r)}));if("function"==typeof e)t=()=>et(e());else{const n=et(e);t=()=>n}function l(e=t(),n){let r=[i[n.type],...s.filter((({matcher:e})=>e(n))).map((({reducer:e})=>e))];return 0===r.filter((e=>!!e)).length&&(r=[c]),r.reduce(((e,t)=>{if(t){if(pe(e)){const r=t(e,n);return void 0===r?e:r}if(fe(e))return Ge(e,(e=>t(e,n)));{const r=t(e,n);if(void 0===r){if(null===e)return e;throw new Error(xt(9))}return r}}return e}),e)}return l.getInitialState=t,l}(e.initialState)}i.forEach((r=>{const i=o[r],a={reducerName:r,type:mt(n,r),createNotation:"function"==typeof e.reducers};!function(e){return"asyncThunk"===e._reducerDefinitionType}(i)?function({type:e,reducerName:t,createNotation:n},r,o){let i,a;if("reducer"in r){if(n&&!function(e){return"reducerWithPrepare"===e._reducerDefinitionType}(r))throw new Error(xt(17));i=r.reducer,a=r.prepare}else i=r;o.addCase(e,i).exposeCaseReducer(t,i).exposeAction(t,a?Qe(e,a):Qe(e))}(a,i,s):function({type:e,reducerName:t},n,r,o){if(!o)throw new Error(xt(18));const{payloadCreator:i,fulfilled:a,pending:s,rejected:c,settled:l,options:u}=n,d=o(e,i,u);r.exposeAction(t,d),a&&r.addCase(d.fulfilled,a),s&&r.addCase(d.pending,s),c&&r.addCase(d.rejected,c),l&&r.addMatcher(d.settled,l),r.exposeCaseReducer(t,{fulfilled:a||bt,pending:s||bt,rejected:c||bt,settled:l||bt})}(a,i,s,t)}));const l=e=>e,u=new Map;let d;function p(e,t){return d||(d=c()),d(e,t)}function f(){return d||(d=c()),d.getInitialState()}function h(t,n=!1){function r(e){let r=e[t];return void 0===r&&n&&(r=f()),r}function o(t=l){const r=tt(u,n,{insert:()=>new WeakMap});return tt(r,t,{insert:()=>{const r={};for(const[o,i]of Object.entries(e.selectors??{}))r[o]=_t(i,t,f,n);return r}})}return{reducerPath:t,getSelectors:o,get selectors(){return o(r)},selectSlice:r}}const v={name:n,reducer:p,actions:a.actionCreators,caseReducers:a.sliceCaseReducersByName,getInitialState:f,...h(r),injectInto(e,{reducerPath:t,...n}={}){const o=t??r;return e.inject({reducerPath:o,reducer:p},n),{...v,...h(o,!0)}}};return v}}function _t(e,t,n,r){function o(o,...i){let a=t(o);return void 0===a&&r&&(a=n()),e(a,...i)}return o.unwrapped=e,o}var gt=yt();function bt(){}var{assign:wt}=Object;function xt(e){return`Minified Redux Toolkit error #${e}; visit https://redux-toolkit.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}Symbol.for("rtk-state-proxy-original");class Ct extends _{constructor(e,...t){super(e,...t),this.name="SeamlyUnavailableError",this.langKey="errors.seamlyUnavailable"}}const St=ft("initializeConfig",(async(e,{extra:{api:t,config:n},rejectWithValue:r})=>{try{const{features:e,preChat:r,agentParticipant:o,defaultContentLocale:i,defaultUserLocale:a,userParticipant:s,startChatIcon:c}=await t.getConfig(),{connectWhenInView:l}=n;return{features:e,preChat:r,agentParticipant:o,userParticipant:s,startChatIcon:c,defaultUserLocale:n?.context?.userLocale||a,defaultContentLocale:n?.context?.contentLocale||i,connectWhenInView:l}}catch(e){return r(e)}})),Et=ft("resetConfig",(async(e,{extra:{config:t}})=>t));var Tt=e=>Array.isArray(e)?e:[e];Symbol(),Object.getPrototypeOf({});var Nt="undefined"!=typeof WeakRef?WeakRef:class{constructor(e){this.value=e}deref(){return this.value}},It=0,Ot=1;function kt(){return{s:It,v:void 0,o:null,p:null}}function Lt(e,t={}){let n=kt();const{resultEqualityCheck:r}=t;let o,i=0;function a(){let t=n;const{length:a}=arguments;for(let e=0,n=a;e<n;e++){const n=arguments[e];if("function"==typeof n||"object"==typeof n&&null!==n){let e=t.o;null===e&&(t.o=e=new WeakMap);const r=e.get(n);void 0===r?(t=kt(),e.set(n,t)):t=r}else{let e=t.p;null===e&&(t.p=e=new Map);const r=e.get(n);void 0===r?(t=kt(),e.set(n,t)):t=r}}const s=t;let c;if(t.s===Ot)c=t.v;else if(c=e.apply(null,arguments),i++,r){const e=o?.deref?.()??o;null!=e&&r(e,c)&&(c=e,0!==i&&i--),o="object"==typeof c&&null!==c||"function"==typeof c?new Nt(c):c}return s.s=Ot,s.v=c,c}return a.clearCache=()=>{n=kt(),a.resetResultsCount()},a.resultsCount=()=>i,a.resetResultsCount=()=>{i=0},a}function At(e,...t){const n="function"==typeof e?{memoize:e,memoizeOptions:t}:e,r=(...e)=>{let t,r=0,o=0,i={},a=e.pop();"object"==typeof a&&(i=a,a=e.pop()),function(e,t="expected a function, instead received "+typeof e){if("function"!=typeof e)throw new TypeError(t)}(a,`createSelector expects an output function after the inputs, but received: [${typeof a}]`);const s={...n,...i},{memoize:c,memoizeOptions:l=[],argsMemoize:u=Lt,argsMemoizeOptions:d=[],devModeChecks:p={}}=s,f=Tt(l),h=Tt(d),v=function(e){const t=Array.isArray(e[0])?e[0]:e;return function(e,t="expected all items to be functions, instead received the following types: "){if(!e.every((e=>"function"==typeof e))){const n=e.map((e=>"function"==typeof e?`function ${e.name||"unnamed"}()`:typeof e)).join(", ");throw new TypeError(`${t}[${n}]`)}}(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}(e),m=c((function(){return r++,a.apply(null,arguments)}),...f),y=u((function(){o++;const e=function(e,t){const n=[],{length:r}=e;for(let o=0;o<r;o++)n.push(e[o].apply(null,t));return n}(v,arguments);return t=m.apply(null,e),t}),...h);return Object.assign(y,{resultFunc:a,memoizedResultFunc:m,dependencies:v,dependencyRecomputations:()=>o,resetDependencyRecomputations:()=>{o=0},lastResult:()=>t,recomputations:()=>r,resetRecomputations:()=>{r=0},memoize:c,argsMemoize:u})};return Object.assign(r,{withTypes:()=>r}),r}var Pt=At(Lt),Mt=Object.assign(((e,t=Pt)=>{!function(e,t="expected an object, instead received "+typeof e){if("object"!=typeof e)throw new TypeError(t)}(e,"createStructuredSelector expects first argument to be an object where each property is a selector, instead received a "+typeof e);const n=Object.keys(e);return t(n.map((t=>e[t])),((...e)=>e.reduce(((e,t,r)=>(e[n[r]]=t,e)),{})))}),{withTypes:()=>Mt});const Rt=Pt((({app:e})=>e),(({userHasResponded:e})=>e)),Ft="visibility",Dt={hidden:"hidden",minimized:"minimized",open:"open",initialize:null},Ut=Pt((({config:e})=>e),(e=>{let t={visible:"inline"===e?.layoutMode?Dt.open:Dt.minimized,appContainerClassNames:e?.appContainerClassNames||[],...e};return"function"==typeof t.appContainerClassNames&&(t={...t,appContainerClassNames:t.appContainerClassNames(t)}),t})),jt=({hasResponded:e,previousVisibility:t,requestedVisibility:n,config:r})=>{const{defaults:o,layoutMode:i,hideOnNoUserResponse:a}=r,{visible:s}=o||{};if("app"===i&&!t)return Dt.open;if("window"===i&&a&&n!==Dt.open)return e?n||t||Dt.open:Dt.hidden;if("inline"===i&&e&&!n)return t||Dt.open;const c=Dt.minimized;return n||t||s||c};var zt=n(7402),Bt=n(8418),Vt=zt.default,Kt=Symbol.for("react-redux-context"),Ht="undefined"!=typeof globalThis?globalThis:{};function $t(){if(!Vt.createContext)return{};const e=Ht[Kt]??(Ht[Kt]=new Map);let t=e.get(Vt.createContext);return t||(t=Vt.createContext(null),e.set(Vt.createContext,t)),t}var Jt=$t();function Wt(e=Jt){return function(){return Vt.useContext(e)}}var qt=Wt(),Gt=()=>{throw new Error("uSES not initialized!")},Xt=(e,t)=>e===t;function Yt(e=Jt){const t=e===Jt?qt:Wt(e),n=(e,n={})=>{const{equalityFn:r=Xt,devModeChecks:o={}}="function"==typeof n?{equalityFn:n}:n,{store:i,subscription:a,getServerState:s,stabilityCheck:c,identityFunctionCheck:l}=t(),u=(Vt.useRef(!0),Vt.useCallback({[e.name](t){return e(t)}}[e.name],[e,c,o.stabilityCheck])),d=Gt(a.addNestedSub,i.getState,s||i.getState,u,r);return Vt.useDebugValue(d),d};return Object.assign(n,{withTypes:()=>n}),n}var Qt=Yt();Symbol.for("react.element"),Symbol.for("react.portal"),Symbol.for("react.fragment"),Symbol.for("react.strict_mode"),Symbol.for("react.profiler"),Symbol.for("react.provider"),Symbol.for("react.context"),Symbol.for("react.server_context"),Symbol.for("react.forward_ref"),Symbol.for("react.suspense"),Symbol.for("react.suspense_list"),Symbol.for("react.memo"),Symbol.for("react.lazy"),Symbol.for("react.offscreen"),Symbol.for("react.client.reference");var Zt={notify(){},get:()=>[]};var en=!("undefined"==typeof window||void 0===window.document||void 0===window.document.createElement),tn="undefined"!=typeof navigator&&"ReactNative"===navigator.product,nn=en||tn?Vt.useLayoutEffect:Vt.useEffect;Object.defineProperty,Object.getOwnPropertyNames,Object.getOwnPropertySymbols,Object.getOwnPropertyDescriptor,Object.getPrototypeOf,Object.prototype;var rn=function({store:e,context:t,children:n,serverState:r,stabilityCheck:o="once",identityFunctionCheck:i="once"}){const a=Vt.useMemo((()=>{const t=function(e,t){let n,r=Zt,o=0,i=!1;function a(){l.onStateChange&&l.onStateChange()}function s(){o++,n||(n=t?t.addNestedSub(a):e.subscribe(a),r=function(){let e=null,t=null;return{clear(){e=null,t=null},notify(){(()=>{let t=e;for(;t;)t.callback(),t=t.next})()},get(){const t=[];let n=e;for(;n;)t.push(n),n=n.next;return t},subscribe(n){let r=!0;const o=t={callback:n,next:null,prev:t};return o.prev?o.prev.next=o:e=o,function(){r&&null!==e&&(r=!1,o.next?o.next.prev=o.prev:t=o.prev,o.prev?o.prev.next=o.next:e=o.next)}}}}())}function c(){o--,n&&0===o&&(n(),n=void 0,r.clear(),r=Zt)}const l={addNestedSub:function(e){s();const t=r.subscribe(e);let n=!1;return()=>{n||(n=!0,t(),c())}},notifyNestedSubs:function(){r.notify()},handleChangeWrapper:a,isSubscribed:function(){return i},trySubscribe:function(){i||(i=!0,s())},tryUnsubscribe:function(){i&&(i=!1,c())},getListeners:()=>r};return l}(e);return{store:e,subscription:t,getServerState:r?()=>r:void 0,stabilityCheck:o,identityFunctionCheck:i}}),[e,r,o,i]),s=Vt.useMemo((()=>e.getState()),[e]);nn((()=>{const{subscription:t}=a;return t.onStateChange=t.notifyNestedSubs,t.trySubscribe(),s!==e.getState()&&t.notifyNestedSubs(),()=>{t.tryUnsubscribe(),t.onStateChange=void 0}}),[a,s]);const c=t||Jt;return Vt.createElement(c.Provider,{value:a},n)};function on(e=Jt){const t=e===Jt?qt:Wt(e),n=()=>{const{store:e}=t();return e};return Object.assign(n,{withTypes:()=>n}),n}var an=on();function sn(e=Jt){const t=e===Jt?an:on(e),n=()=>t().dispatch;return Object.assign(n,{withTypes:()=>n}),n}var cn,ln=sn();cn=Bt.useSyncExternalStoreWithSelector,Gt=cn,zt.useSyncExternalStore;const un=()=>Qt(Ut);function dn(){const{startChatIcon:e}=un();return e}const pn=(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)}}},fn=e=>Math.ceil(e/1e3),hn=e=>{const t=Math.floor(e/60);return{minutes:t,seconds:e-60*t}},vn=(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]}`},mn={27:"Escape",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown"},yn={Escape:"Escape",End:"End",Home:"Home",ArrowLeft:"ArrowLeft",ArrowUp:"ArrowUp",ArrowRight:"ArrowRight",ArrowDown:"ArrowDown"},_n=e=>e.code?yn[e.code]:mn[e.keyCode],gn=e=>{e&&e.focus()},bn=(e,t)=>{e&&(e.contains(document.activeElement)||e===document.activeElement)&&t()};function wn(e){return"object"==typeof e}const xn=({state:e})=>e,Cn=()=>Qt(xn),Sn=Pt(xn,Ut,Rt,(({events:e,serviceData:t},n,r)=>{if(r||"inline"===n.layoutMode||!t?.suggestion||!t?.suggestion?.body?.length)return e;const o={type:"service_data",payload:t.suggestion};return[...e,o]})),En=Pt(Sn,Ut,((e,t)=>{const{enabled:n,threshold:r}=t?.messages?.timeIndicator??{};return n?e.map((({type:e,payload:t},n,o)=>{if(0===n)return{type:e,payload:{...t,timeIndicator:t?.occurredAt}};const i=o[n-1];if(!t?.occurredAt||!i.payload?.occurredAt||!r)return{type:e,payload:{...t,timeIndicator:void 0}};const a=fn(t.occurredAt-i.payload.occurredAt)>=r?t.occurredAt:void 0;return{type:e,payload:{...t,timeIndicator:a}}})):e})),Tn=()=>Qt(En),Nn=(Pt(En,(e=>e.map((e=>e.payload.id)))),()=>Cn().isLoading),In=()=>Cn().unreadEvents,On=()=>Cn().skiplinkTargetId,kn=()=>Cn().serviceInfo,Ln=Pt(En,(e=>{const t=e.filter((e=>"message"===e.type));return t[t.length-1]?.payload.id})),An=()=>{const{participants:e,currentAgent:t}=Cn().participantInfo;return t?e[t]:null},Pn=()=>{const{entryMeta:{options:e,optionsOverride:t}}=Cn(),{limit:n}=t?.text||e?.text||{limit:null};return{hasLimit:null!==n,limit:null!==n?n:null}},Mn=()=>{const{layoutMode:e}=un();return{isInline:"inline"===e,isWindow:"window"===e,isApp:"app"===e,isResolving:!e}},Rn=Pt((({visibility:e})=>e),(e=>e.visibility)),Fn=Pt((({visibility:e})=>e),(e=>e.showInlineView)),Dn=Pt((({visibility:e})=>e),(e=>e.setInputFocus)),Un=[Dt.open,Dt.minimized,Dt.hidden],jn=ft("setVisibility",((e,{getState:t,extra:{api:n,eventBus:r}})=>{const o=t(),i=e.visibility,a=Rn(o),s=Rt(o),c=n.hasConversation(),l=Ut(o),{visibilityCallback:u=jt,layoutMode:d}=l,{unreadEvents:p}=xn(o),f=u({hasResponded:s,previousVisibility:a,requestedVisibility:i,config:l});if(f&&!Un.includes(f))return console.error('The visibilityCallback function should return "open", "minimized" or "hidden".'),{visibility:null,setInputFocus:e.setInputFocus};if(a===f)return{visibility:null,setInputFocus:e.setInputFocus};const h=n.store.get(Ft);return n.store.set(Ft,{...h||{},[d]:i}),i&&r.emit("ui.visible",i,{visibility:i,hasConversation:c,hasResponded:s,unreadMessageCount:p}),{visibility:f,setInputFocus:e.setInputFocus}})),zn=ft("initialize",(async(e,{dispatch:t,getState:n,extra:{api:r}})=>{const{layoutMode:o}=Ut(n()),i=r.store.get(Ft)?.[o]||Dt.initialize;return t(jn({visibility:i})),i})),Bn=ft("initializeApp",(async(e,{extra:{api:t,config:n},rejectWithValue:r})=>{const o=n?.context?.contentLocale,i=n?.context?.userLocale;try{return t.hasConversation()?{initialState:await t.getConversationIntitialState(),contentLocale:o,userLocale:i,config:n}:(n?.context?.topic&&t.send("action",{type:R,body:{name:n.context.topic,fallbackMessage:n.context.topic}}),{initialState:void 0,contentLocale:o,userLocale:i,config:n})}catch(e){if(e instanceof w){const e=new w;return r({name:e.name,message:e.message,originalEvent:e.originalEvent,originalError:e.originalError,action:e.action})}const t=new Ct;return r({name:t.name,message:t.message,langKey:t.langKey})}})),Vn=((e,t,n)=>{const{wait:r=300,maxWait:o=0,leading:i=!1}=n??{};let a,s=null,c=null;const l=()=>{c&&clearTimeout(c),c=void 0,a&&(a(!0),a=void 0)};return ft(e,t,{condition:()=>{const e=i&&!s;return s&&clearTimeout(s),s=setTimeout((()=>{l(),s=null}),r),!!e||(a&&(a(!1),a=void 0),o&&!c&&(c=setTimeout(l,o)),new Promise((e=>{a=e})))}})})("resetApp",(async(e,{dispatch:t,extra:{api:n}})=>{await n.disconnect(),n.clearStore(),t(Et()),await t(St()),await t(Bn()),t(zn())}),{wait:2e3,leading:!0}),Kn="cvco",Hn=50,$n=300,Jn=["hideOnNoUserResponse","connectWhenInView","showDisclaimer","showSuggestions","continueChat","preChat","namespace","customComponents","defaults","layoutMode","api","zIndex","context","appContainerClassNames","messages","visible","visibilityCallback","errorCallback","agentParticipant","userParticipant","startChatIcon","notificationAudioURL"],Wn=(e,t)=>{const{messages:n,...r}=(o=t,Jn.reduce(((e,t)=>(t in o&&(e[t]=o[t]),e)),{}));var o;let i=e;return Object.keys(r).length>0&&(i={...i,...r}),n&&(i={...i,messages:{...i.messages,...n}}),i},qn=gt({name:"config",initialState:{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,sendEnvironment:!0},context:{},notificationAudioURL:void 0,hideOnNoUserResponse:!1,connectWhenInView:!0,showDisclaimer:!1,showSuggestions:!0,preChat:{enterDelay:1e3,exitAfter:4e3},continueChat:{enterDelay:0,exitAfter:2e3},customComponents:{},defaults:{visible:null},preChatEvents:[],parentElement:void 0,layoutMode:"window"},reducers:{setConfig:(e,{payload:t})=>Wn(e,t),updateConfig:(e,{payload:t})=>Wn(e,t),setPreChatEvents:(e,{payload:t})=>{e.preChatEvents=t}},extraReducers:e=>{e.addCase(Et.fulfilled,(e=>e)).addCase(St.fulfilled,((e,{payload:{preChat:t,agentParticipant:n,userParticipant:r,startChatIcon:o,defaultContentLocale:i,defaultUserLocale:a}})=>{e.preChatEvents=t.map((e=>({type:"message",payload:e}))),e.context.contentLocale=i,e.context.userLocale=a,e.agentParticipant=n,e.userParticipant=r,e.startChatIcon=o||""}))}}),{setConfig:Gn,updateConfig:Xn,setPreChatEvents:Yn}=qn.actions;var Qn=qn.reducer;const Zn={userHasResponded:!1},er=gt({name:"app",initialState:Zn,reducers:{setHasResponded:(e,{payload:t})=>{e.userHasResponded=t}},extraReducers:e=>{e.addCase(Vn.pending,(()=>Zn)).addCase(Bn.fulfilled,((e,{payload:t})=>{t.initialState&&"userResponded"in t.initialState&&(e.userHasResponded=t.initialState.userResponded||!1)}))}}),{setHasResponded:tr}=er.actions;var nr=er.reducer;class rr extends _{constructor(e,...t){super(e,...t),this.name="SeamlyOfflineError",this.langKey="errors.seamlyOffline"}}const or={SeamlyGeneralError:b,SeamlyConfigurationError:g,SeamlySessionExpiredError:w,SeamlyOfflineError:rr,SeamlyUnauthorizedError:x,SeamlyUnavailableError:Ct},ir=Qe("catch-error",(e=>({payload:e}))),ar={controls:{}},sr={touched:!1},cr={controls:sr},lr=gt({name:"forms",initialState:cr,reducers:{registerForm:(e,{payload:{persistData:t,formId:n}})=>{const r=t?e[n]??{...ar,persistData:t}:{...ar,persistData:t};e[n]=r},deregisterForm:(e,{payload:{formId:t}})=>(e[t]?.persistData||delete e[t],e),registerControl:(e,{payload:{name:t,formId:n}})=>{e[n].controls={[t]:sr}},deregisterControl:(e,{payload:{name:t,formId:n}})=>{const r=e[n];if(!r)return e;if(r.persistData)return e;const o={...r.controls};return delete o[t],{...e,[n]:{...r,controls:o}}},updateControlValue:(e,{payload:{formId:t,name:n,value:r}})=>{e[t]?.controls&&(e[t].controls[n].value=r)},updateControlTouched:(e,{payload:{formId:t,name:n,touched:r}})=>{e[t]?.controls[n]&&(e[t].controls[n].touched=r)}},extraReducers:e=>{e.addCase(Vn.pending,(()=>cr))}}),{registerForm:ur,deregisterForm:dr,registerControl:pr,deregisterControl:fr,updateControlValue:hr,updateControlTouched:vr}=lr.actions;var mr=lr.reducer;const yr=ft("setLocale",(async(e,{extra:{api:t},rejectWithValue:n})=>{try{return{translations:await t.getTranslations(e),userLocale:e}}catch(e){return n(e)}}),{condition:(e,{getState:t})=>{const{i18n:{isLoading:n,userLocale:r}}=t();return e!==r&&!n}}),_r={translations:{"errors.configError.message":"We are sorry this happened, please retry at a later time.","errors.configError.srText":"A chat configuration error occurred. Our apologies, please retry at a later time.","errors.configError.title":"Chat configuration error.","errors.general.buttonText":"Restart chat","errors.general.message":"Do you want to start a new chat session?","errors.general.srText":"Something went wrong with the chat session. You can restart the chat.","errors.general.title":"Something went wrong","errors.seamlyOffline.message":"There might be a problem with your or our network connection. The chat session should resume as soon the connection is available again.","errors.seamlyOffline.srText":"The chat has connection issues. There might be a problem with your or our network connection. The chat session should resume as soon as the connection is available again.","errors.seamlyOffline.title":"Connection issues","errors.seamlyUnavailable.buttonText":"Try again","errors.seamlyUnavailable.message":"The server could not be reached. Try again in a little while.","errors.seamlyUnavailable.srText":"The chat server could not be reached. Try again in a little while.","errors.seamlyUnavailable.title":"Server unavailable"},isLoading:!1,initialLocale:void 0,userLocale:void 0},gr=gt({name:"app",initialState:_r,reducers:{setInitialLocale:(e,t)=>{e.initialLocale=t.payload},setTranslations:(e,{payload:t})=>{e.translations=t}},extraReducers:e=>{e.addCase(Vn.pending,(()=>_r)).addCase(St.fulfilled,((e,{payload:t})=>{e.initialLocale=t.defaultUserLocale})).addCase(yr.pending,(e=>{e.isLoading=!0})).addCase(yr.rejected,(e=>{e.isLoading=!1})).addCase(yr.fulfilled,((e,{payload:t})=>{e.isLoading=!1,t?.translations&&(e.userLocale=t.userLocale,e.translations=Object.keys(t.translations).sort().reduce(((e,n)=>{if(!t.translations)return e;const r=t.translations[n];return e[n]=r,e}),{}))}))}}),{setInitialLocale:br,setTranslations:wr}=gr.actions;var xr=gr.reducer;const Cr=ft("getConversation",(async(e,{extra:{api:t},rejectWithValue:n})=>{try{const e=await t.getConversation();if(!e)throw new Error("No conversation found");return e}catch(e){return n({name:e?.name,message:e?.message,langKey:e?.langKey,action:e?.action,originalEvent:e?.originalEvent,originalError:e?.originalError})}}),{condition(e,{getState:t}){const{state:{events:n}}=t(),r=n.at(-1);return r&&("lastEvent"in e?e?.lastEvent?.id:e?.body?.lastEvent?.id)!==r.payload.id}}),Sr={error:void 0},Er=gt({name:"interrupt",initialState:Sr,reducers:{setInterrupt:(e,t)=>{e.error=t.payload},clearInterrupt:()=>Sr},extraReducers:e=>{e.addCase(St.pending,(()=>Sr)).addMatcher(st(Bn.rejected,St.rejected,yr.rejected,jn.rejected,zn.rejected,Cr.rejected),((e,{payload:t})=>{e.error=t}))}}),{setInterrupt:Tr,clearInterrupt:Nr}=Er.actions;var Ir=Er.reducer;const Or=["SeamlyGeneralError","SeamlyConfigurationError","SeamlySessionExpiredError","SeamlyOfflineError","SeamlyUnauthorizedError","SeamlyUnavailableError"],kr=({type:e,payload:t})=>"hidden"===document.visibilityState||e===S.message&&!t.fromClient||e===S.info&&t.type===E,Lr=e=>e.sort((({payload:{occurredAt:e=0}},{payload:{occurredAt:t=0}})=>e-t)),Ar=(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={...n,[r]:s?{...s,...o?{avatar:o}:{},...i?{name:i}:{},...a?{introduction:a}:{}}:t.participant};return{...e,participants:c,currentAgent:e.currentAgent===r||t.fromClient?e.currentAgent:r}},Pr=(e,t)=>{const n="message"===t?.type?t?.payload.translatedEntry||t?.payload.entry:{options:void 0,type:void 0},{blockAutoEntrySwitch:r}=e,o=t?.payload?.actions||{},i=t?.payload?.translatedActions||{};if(!n)return{...e,actions:o,optionsOverride:{},translatedActions:i};const{type:a,options:s}=n||{};let c=e.active;return r||a===e.userSelected||(c=a),{...e,active:c,optionsOverride:{...e.optionsOverride||{},...a?{[a]:s}:{}},actions:o,translatedActions:i}},Mr={events:[],isLastEventFromClient:!1,initialState:{userResponded:!1,context:{contentLocale:"",translationActive:!1,userLocale:""}},unreadEvents:0,userHasResponded:!1,loadedImageEventIds:[],isLoading:!1,idleDetachCountdown:{hasCountdown:!1,isActive:!1,remaining:void 0,wasStopped:void 0,count:void 0,timer:void 0},resumeConversationPrompt:!1,serviceInfo:{activeServiceSessionId:"",proactiveMessages:!1},participantInfo:{participants:{},currentAgent:""},headerTitles:{title:null,subTitle:""},historyLoaded:!1,skiplinkTargetId:$(),optionsButtonId:$(),headerCollapseButtonId:$(),serviceData:{},options:{features:{webNotifications:{enabled:!1}},panelActive:!1,optionActive:"",userSelectedOptions:{}},showFileUpload:!1,currentUploads:[],processingFileUploads:[],entryMeta:{default:T,optionsOverride:{},defaultEntry:T,active:T,userSelected:null,blockAutoEntrySwitch:!1,options:{},actions:{},translatedActions:{}},seamlyContainerElement:null},Rr=gt({name:"store",initialState:Mr,reducers:{addEvent:(e,t)=>{const{type:n,payload:r}=t.payload,o=e.options.features.hasOwnProperty(K);let i={...e.options};if(o&&(n===S.message||n===S.participant)&&!r.fromClient){const e="message"===n?r.entry?.type:void 0;i={...i,features:{...i.features,uploads:{enabled:i.features.uploads?.enabled||!1,...i.features?.uploads||{},enabledFromEntry:e===N}}}}const a=kr(t.payload);if(!e.events.find((e=>e.payload.id===r.id))){if(!e.events.find((e=>"transactionId"in e.payload&&"transactionId"in r&&e.payload.transactionId===r.transactionId&&(!t.payload.type||e.type===t.payload.type)&&r.fromClient))){const s=Pr(e.entryMeta,t.payload);e.entryMeta=o||s.active!==N?s:{...e.entryMeta},e.options=i,a&&(e.unreadEvents+=1,"service_data"!==n&&(t.payload.payload.messageStatus=r.fromClient?O:I)),t.payload.payload.key=$(),e.events.push(t.payload),e.events=Lr(e.events)}r.fromClient&&(e.isLastEventFromClient=r.fromClient)}},updateEvent:(e,{payload:t})=>{const n=e.events.find((e=>"service_data"!==e.type&&"service_data"!==t.type&&e.payload.transactionId===t.payload.transactionId));if(!n)return e.events.push(t),void(e.events=Lr(e.events));n.payload.id=t.payload.id,n.payload.occurredAt=t.payload.occurredAt},clearEvents:e=>{e.unreadEvents=0,e.loadedImageEventIds=[],e.events=[]},setEventsRead:(e,{payload:t})=>{e.unreadEvents=0,e.events.forEach((e=>(e.payload.id&&-1!==t.indexOf(e.payload.id)&&(e.payload={...e.payload,..."service_data"!==e.type&&e.payload.messageStatus===I&&{messageStatus:O}}),e)))},setLoadedImageEventIds:(e,{payload:t})=>{e.loadedImageEventIds.push(t)},setEvents:(e,{payload:{messages:t,unreadMessageCount:n,userResponded:r,participants:o,service:i,serviceData:a,ui:s}})=>{const c=((e,t)=>{const n=e.filter((e=>"message"===e.type&&!e.payload.optimisticallyInjected&&!t.some((t=>t.payload?.id===e.payload.id)))),r=t.filter((({type:e,payload:t})=>!("participant"===e&&!t?.participant?.introduction))).reverse();return Lr([...r,...n])})(e.events,t),l=Object.fromEntries(Object.entries(o).map((([e,t])=>[t.id,t]))),u=c.find((e=>"participant"===e.type)),d=u?.payload.participant?.id,{entry:p}=i?.settings||{},f=Pr({...e.entryMeta,...p,active:p?.default||E,options:{...p?.options?p.options:{}}},c[c.length-1]),h={...e.options.features},v=h.hasOwnProperty(K);e.unreadEvents=n,e.userHasResponded=r,e.events=c.filter((e=>"participant"!==e.type||!!e.payload.participant?.introduction)),e.participantInfo={...e.participantInfo,...d?Ar(e.participantInfo,{participant:l[d]}):{},participants:l},e.historyLoaded=!0,e.serviceInfo={...e.serviceInfo,proactiveMessages:i?.settings?.proactiveMessages?.enabled||!1,activeServiceSessionId:i?.sessionId},e.serviceData={...e.serviceData,...a},e.options={...e.options,features:h},e.entryMeta=v||f.active!==N?f:{...e.entryMeta},e.resumeConversationPrompt=s.resumeConversationPrompt||!1,d&&(e.headerTitles.subTitle=l[d]?.name)},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=0}=t,r=n-1;e.idleDetachCountdown.remaining=r,e.idleDetachCountdown.timer=hn(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=Ar(e.participantInfo,{participant:t.participant,fromClient:t.fromClient})},setActiveService:(e,{payload:t})=>{e.serviceInfo.activeServiceSessionId!==t&&(e.serviceInfo.activeServiceSessionId=t)},setHeaderTitle:(e,{payload:t})=>{e.headerTitles.title=t},setHeaderSubTitle:(e,{payload:t})=>{e.headerTitles.subTitle=t},setInitialState:(e,{payload:t})=>{e.initialState=t,e.unreadEvents=Mr.unreadEvents},setServiceDataItem:(e,{payload:t})=>{e.serviceData[t.type]=t},setFeatures:(e,{payload:t})=>{t.features&&(e.options.features=t.features)},updateFeatures:(e,{payload:t})=>{Object.entries(t).forEach((([t,n])=>{e.options.features[t]=n}))},setFeatureEnabledState:(e,{payload:t})=>{e.options.features.hasOwnProperty(t.key)&&(e.options.features[t.key].enabled=t.enabled)},clearFeatures:e=>{e.options.features={webNotifications:e.options.features.webNotifications}},showOption:(e,{payload:t})=>{e.options.panelActive=!0,e.options.optionActive=t},hideOption:e=>{e.options.panelActive=!1,e.options.optionActive=""},setUserSelectedOptions:(e,{payload:t})=>{e.options.userSelectedOptions=t},setUserSelectedOption:(e,{payload:t})=>{const{option:n,value:r}=t;e.options.userSelectedOptions[n]=r},setBlockAutoEntrySwitch:(e,{payload:t})=>{e.entryMeta.blockAutoEntrySwitch=t},setServiceEntryMetadata:(e,{payload:t})=>{e.entryMeta.active=t.default,e.entryMeta.options=t.options||{},e.entryMeta.optionsOverride={},e.entryMeta.actions={},e.entryMeta.translatedActions={}},setActiveEntryType:(e,{payload:t})=>{e.entryMeta.active=t},setUserEntryType:(e,{payload:t})=>{e.entryMeta.userSelected=t},clearAbortTransaction:e=>{e.entryMeta.actions={}},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?{...e,progress:t.progress,uploading:100!==t.progress,uploadHandle:100===t.progress?null:e.uploadHandle}:e))},startProcessingImage:(e,{payload:t})=>{e.processingFileUploads.push(t)},doneProcessingImage:(e,{payload:t})=>{e.processingFileUploads=e.processingFileUploads.filter((e=>e!==t))},setUploadError:(e,{payload:t})=>{e.currentUploads=e.currentUploads.map((e=>e.id===t.fileId?{...e,error:t.errorText,progress:0,uploading:!1,uploadHandle:null}:e))},setUploadComplete:(e,{payload:t})=>{e.currentUploads=e.currentUploads.map((e=>e.id===t?{...e,complete:!0}:e))},clearAllUploads:e=>{e.currentUploads=[]},setSeamlyContainerElement:(e,{payload:t})=>{e.seamlyContainerElement=t},setProactiveMessages:(e,{payload:t})=>{e.serviceInfo.proactiveMessages=t}},extraReducers:e=>{e.addCase(Vn.pending,(()=>Mr)).addCase(Bn.pending,(e=>{e.isLoading=!0})).addCase(St.fulfilled,((e,{payload:t})=>{e.headerTitles.subTitle=t.agentParticipant?.name||"",t.features&&(e.options.features=t.features)})).addCase(Bn.fulfilled,((e,{payload:t,type:n})=>{e.isLoading=!1,t.initialState&&(e.initialState=t.initialState,"messages"in t.initialState&&Rr.caseReducers.setEvents(e,{payload:t.initialState,type:n}))})).addMatcher(st($r,Jr),(e=>{e.isLastEventFromClient=!1}))}}),{addEvent:Fr,updateEvent:Dr,clearAllUploads:Ur,clearEvents:jr,clearFeatures:zr,clearIdleDetachCountdown:Br,clearResumeConversationPrompt:Vr,decrementIdleDetachCountdownCounter:Kr,hideOption:Hr,initIdleDetachCountdown:$r,initResumeConversationPrompt:Jr,registerUpload:Wr,setActiveEntryType:qr,setActiveService:Gr,setBlockAutoEntrySwitch:Xr,setEventsRead:Yr,setFeatureEnabledState:Qr,updateFeatures:Zr,setFeatures:eo,setHeaderSubTitle:to,setHeaderTitle:no,setEvents:ro,setInitialState:oo,setIsLoading:io,setLoadedImageEventIds:ao,setParticipant:so,setSeamlyContainerElement:co,setServiceDataItem:lo,setServiceEntryMetadata:uo,clearAbortTransaction:po,setUploadComplete:fo,setUploadError:ho,setUploadProgress:vo,startProcessingImage:mo,doneProcessingImage:yo,setUserEntryType:_o,setUserSelectedOption:go,setUserSelectedOptions:bo,showOption:wo,stopIdleDetachCountdownCounter:xo,setProactiveMessages:Co}=Rr.actions;var So=Rr.reducer,Eo=({dispatch:e})=>t=>n=>{const r=t(n);if(St.fulfilled.match(n)&&n.payload.defaultUserLocale)return e(yr(n.payload.defaultUserLocale)),r;if(Bn.fulfilled.match(n))return n.payload.userLocale&&e(yr(n.payload.userLocale)),r;if(Fr.match(n)&&"info"===n.payload.type&&n.payload.payload.body&&"subtype"in n.payload.payload.body&&"new_translation"===n.payload.payload.body.subtype){const{body:t}=n.payload.payload;if(t.translationLocale&&t.translationEnabled)return e(yr(t.translationLocale)),r}return r};const To={isActive:!1,currentLocale:void 0,isAvailable:!1,languages:[],containerId:ct(),translatedEventGroups:{},translationProposal:null},No=(e,t)=>{const n=[...e].reduce(((e,{payload:n,type:r},o,i)=>{if(e[t]&&n.id){if("info"===r&&"divider"===n?.type&&n?.body?.translationEnabled)return i.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=>"divider"===e.payload?.type)).map((e=>e.payload.id)).at(-1),groupId:r,eventIds:o}},Io=gt({name:"translation",initialState:To,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}=No(t,n);e.lastGroupId=r},disableEventsTranslation:(e,{payload:{events:t,id:n}})=>{const{lastGroupId:r,groupId:o,eventIds:i}=No(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(Vn.pending,(()=>To)).addCase(St.fulfilled,((e,{payload:t})=>{const n=t?.features?.translation;n?.languages&&(e.isAvailable=!0===n.enabled,e.languages=[...n.languages].sort(((e,n)=>e.locale===t.defaultUserLocale?-1:n.locale===t.defaultUserLocale?1:e.nativeName?.localeCompare(n.nativeName||"",void 0,{sensitivity:"base"})||0)))})).addCase(yr.fulfilled,((e,{payload:t})=>{e.currentLocale=t.userLocale})).addCase(Fr,((e,{payload:t})=>{t.payload.id&&e.lastGroupId&&e.translatedEventGroups[e.lastGroupId]&&e.translatedEventGroups[e.lastGroupId].push(t.payload.id)})).addCase(ro,((e,{payload:t})=>{e.translationProposal=t?.ui?.translationProposal})).addCase(Bn.fulfilled,((e,{payload:t})=>{e.translationProposal=t.initialState?.ui?.translationProposal}))}}),{enableTranslation:Oo,disableTranslation:ko,enableEventsTranslation:Lo,disableEventsTranslation:Ao,setTranslationProposalPrompt:Po,disableTranslationProposalPrompt:Mo}=Io.actions;var Ro=Io.reducer;const Fo=gt({name:"visibility",initialState:{visibility:Dt.initialize,showInlineView:!1,setInputFocus:!1},reducers:{setShowInlineView:e=>{e.showInlineView=!0}},extraReducers:e=>{e.addCase(jn.fulfilled,((e,{payload:{visibility:t,setInputFocus:n}})=>{t&&(e.visibility=t,e.setInputFocus=Boolean(n))})).addCase(St.fulfilled,((e,{payload:t})=>{t.connectWhenInView||(e.showInlineView=!t.connectWhenInView)}))}}),{setShowInlineView:Do}=Fo.actions,Uo=ne({state:So,app:nr,config:Qn,i18n:xr,translations:Ro,visibility:Fo.reducer,forms:mr,interrupt:Ir});function jo({initialState:e,api:t,eventBus:n,config:r}){const o=function(e){const t=nt(),{reducer:n,middleware:r,devTools:o=!0,preloadedState:i,enhancers:a}=e||{};let s,c;if("function"==typeof n)s=n;else{if(!ee(n))throw new Error(xt(1));s=ne(n)}c="function"==typeof r?r(t):t();let l=re;o&&(l=Xe({trace:!1,..."object"==typeof o&&o}));const u=function(...e){return t=>(n,r)=>{const o=t(n,r);let i=()=>{throw new Error(X(15))};const a={getState:o.getState,dispatch:(e,...t)=>i(e,...t)},s=e.map((e=>e(a)));return i=re(...s)(o.dispatch),{...o,dispatch:i}}}(...c),d=it(u);return te(s,i,l(..."function"==typeof a?a(d):d()))}({reducer:Uo,preloadedState:e,middleware:e=>e({thunk:{extraArgument:{api:t,eventBus:n,config:r}},serializableCheck:!1}).concat(function({api:e}){return({getState:t})=>{const n=n=>{const{errorCallback:r,namespace:o,api:i,layoutMode:a}=Ut(t()),{error:s,type:c}=n,l=or[s?.name]?new or[s.name](s):new _(s);r?.(l,{namespace:o,api:i,layoutMode:a,conversationUrl:e.getConversationUrl(),action:c?n:void 0})};return e=>t=>{try{return t.payload?.originalEvent?.payload?n({error:t.payload,type:t.payload?.originalEvent?.payload?.type}):t.payload?.originalError&&n({error:t.payload,type:void 0}),e(t)}catch(e){throw n({error:e}),e}}}}({api:t}),function({api:e}){return()=>t=>n=>{const{payload:r,type:o}=n;if(o===Tr.type){if(!Or.includes(r.name))throw new b(r);"reset"===r.action&&e.disconnect().then((()=>{e.clearStore()}))}return t(n)}}({api:t}),function({api:e}){return()=>t=>n=>{const r=t(n);switch(n.type){case bo.toString():e.store.set("options",n.payload);break;case go.toString():e.store.set("options",{...e.store.get("options")||{},[n.payload.option]:n.payload.value})}return r}}({api:t}),Eo)});return o}const zo=ln;var Bo=n(5994);function Vo(e=""){const t=e=>/\s/.test(e),n=[],r={};let o=0,i=null,a=!1,s=0;for(;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])){const t="{"===e[s];if(i&&t){const t=Ko(e,s);if(-1===t)throw new Error(`Unbalanced curly braces in string: "${e}"`);r[i]=e.slice(s+1,t),s=t,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 Ko(e,t){let n=0;for(let r=t+1;r<e.length;r++){let t=e.charAt(r);if("}"===t){if(0===n)return r;n--}else"{"===t&&n++}return-1}function Ho(e){return $o(e.slice(1,-1),",",3)}function $o(e,t,n,r=[]){if(!e)return r;if(1===n)return r.push(e),r;let o=e.indexOf(t);if(-1===o)return r.push(e),r;let i=e.substring(0,o).trim(),a=e.substring(o+t.length+1).trim();return r.push(i),$o(a,t,n-1,r)}let Jo,Wo=0;const qo="other";function Go(e,t){let n=0,r="",o=0;const i={};for(;n<e.length;){if("#"!==e[n]||o)r+=e[n];else{let e="__hashToken"+Wo++;r+=`{${e}, number}`,i[e]=t}"{"===e[n]?o++:"}"===e[n]&&o--,n++}return{caseBody:r,numberValues:i}}const Xo="other",Yo=Pt((({i18n:e})=>e),(({translations:e})=>e)),Qo=Pt((({i18n:e})=>e),(({initialLocale:e})=>e)),Zo=Pt((({i18n:e})=>e),(({userLocale:e})=>e)),ei=Pt((({i18n:e})=>e),(({isLoading:e})=>e)),ti=new class{constructor(e,t={}){this.locale=e,this.typeHandlers=t}format=function(e){const t={};return function(...n){let r=n.length?n.map((e=>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,r))return t[r];let o=e(...n);return t[r]=o,o}}(((e,t={})=>this.process(e,t).flat(1/0).join("")));process(e,t={}){if(!e)return[];let n=e.indexOf("{");if(-1!==n){let r=Ko(e,n);if(-1===r)throw new Error(`Unbalanced curly braces in string: "${e}"`);{let o=e.substring(n,r+1);if(o){let i=[],a=e.substring(0,n);a&&i.push(a);let[s,c,l]=Ho(o),u=t[s];null==u&&(u="");let d=c&&this.typeHandlers[c];i.push(d?d(u,l,this.locale,t,this.process.bind(this)):u);let p=e.substring(r+1);return p&&i.push(this.process(p,t)),i}}}return[e]}}("en-GB",{plural:function(e,t,n,r,o){const{args:i,cases:a}=Vo(t);let s=parseInt(e);i.forEach((e=>{e.startsWith("offset:")&&(s-=parseInt(e.slice(7)))}));const c=[];if("PluralRules"in Intl){void 0!==Jo&&Jo.resolvedOptions().locale===n||(Jo=new Intl.PluralRules(n));const e=Jo.select(s);e!==qo&&c.push(e)}1===s&&c.push("one"),c.push(`=${s}`,qo);for(let e=0;e<c.length;e++){const t=c[e];if(t in a){const{caseBody:e,numberValues:n}=Go(a[t],s);return o(e,{...r,...n})}}return e},select:function(e,t,n,r,o){const{cases:i}=Vo(t);return e in i?o(i[e],r):Xo in i?o(i[Xo],r):e}});function ni(){const e=Qt(Yo),t=Qt(Zo),n=Qt(Qo),r=Qt(ei),o=(0,Bo.hb)(((n,o={})=>{if(!e)return"";const i=e[n];return i?ti.format(i,o):(r||console.warn(`Translation key: ${n} is missing in locale: ${t}`),"")}),[e,t,r]);return{t:o,userLocale:t,initialLocale:n}}const ri=()=>{const e=zo(),t=Qt(Rn),n=Qt(Dn),r=!!t&&t!==Dt.hidden,o=t===Dt.open,i=t===Dt.minimized,a=(0,Bo.hb)((t=>{e(jn("string"==typeof t||null===t?{visibility:t,setInputFocus:!1}:t))}),[e]);return{isVisible:r,isOpen:o,isMinimized:i,visible:t,setVisibility:a,openChat:()=>{a({visibility:Dt.open})},closeChat:()=>{a({visibility:Dt.minimized})},setInputFocus:n}},oi=({freezeOnceVisible:e=!1,enabled:t=!0,containerRef:n=(0,o._3)()})=>{const[r,i]=(0,Bo.J0)(null),a=!!r?.isIntersecting||!t,s=a&&e,c=([e])=>i(e);return(0,Bo.vJ)((()=>{const e=n?.current;if(!window.IntersectionObserver||s||!e||!t)return()=>{};const r=new IntersectionObserver(c,{threshold:0,root:null,rootMargin:"0%"});return r.observe(e),()=>r.disconnect()}),[n,t,s]),{isVisible:a,containerRef:n}},ii=()=>Qt(Rt),ai=(0,o.q6)(null),si=(0,o.q6)(null),ci=(0,o.q6)(null);var li=()=>{const e=(0,Bo.NT)(si);if(!e)throw new Error("useSeamlyEventBusContext has to be used within <SeamlyEventBusContext.Provider>");return e};const ui=()=>{const e=(0,Bo.NT)(ai);if(!e)throw new Error("useSeamlyApiContext has to be used within <SeamlyApiContext.Provider>");return e},di=()=>ui().store,pi=()=>{const e=ui();return(0,Bo.hb)((()=>e.hasConversation()),[e])};var fi=()=>{const e=ui(),t=zo(),n=li(),r=ii(),o=pi(),{visible:i,setVisibility:a}=ri(),s=In(),c=(0,Bo.hb)(((...e)=>{n.emit(...e)}),[n]),l=(0,Bo.hb)((()=>{c("ui.beforeStart",{visibility:i,hasConversation:o(),hasResponded:r,unreadMessageCount:s}),e.send("start_conversation"),c("ui.start",{visibility:i,hasConversation:o(),hasResponded:r,unreadMessageCount:s})}),[e,c,o,r,s,i]),u=(0,Bo.hb)((async()=>{await t(Vn())}),[t]),d=(0,Bo.hb)((e=>({type:e,id:$(),transactionId:$(),fromClient:!0,participant:"seamly-client-participant",occurredAt:1e3*Date.now()})),[]),p=(0,Bo.hb)((e=>({...d("text"),body:{text:e}})),[d]),f=(0,Bo.hb)((({body:n,config:r={}})=>{if(""===n.trim())return;const o={...p(n),...r};e.send("message",o),c("message",o),t(Fr({type:"message",payload:{...o,body:o.body,type:o.type,optimisticallyInjected:!0}}))}),[e,t,c,p]),h=(0,Bo.hb)(((e,n=$())=>{t(Fr({type:"message",payload:{...p(e),transactionId:n}}))}),[t,p]),v=(0,Bo.hb)(((e,n,r,o,i,a)=>{t(Fr({type:"message",payload:{type:"upload",id:e,transactionId:n,fromClient:!0,participant:"seamly-client-participant",occurredAt:r,body:{contentType:o,filename:i,filesize:a,id:e||""}}}))}),[t]),m=(0,Bo.hb)(((e,n=$())=>{t(Fr({type:"info",payload:{type:"divider",body:{subtype:e},fromClient:!1,participant:null,id:$(),transactionId:n}}))}),[t]),y=(0,Bo.hb)((t=>{if(!t)return;e.send("action",t);const{type:n}=t;n!==L&&n!==A&&c(`action.${n}`,t)}),[e,c]),_=(0,Bo.hb)((t=>{e.sendContext(t)}),[e]),g=(0,Bo.hb)((()=>e.connected?Promise.reject(new Error("The API is already connected")):e.connect().then((e=>{e&&(t(oo(e)),e.messages&&e.messages.length&&t(ro(e)),e.userResponded&&(t(tr(e.userResponded)),a({visibility:Dt.open})))})).catch((e=>{t(Tr({name:e?.name,message:e?.message,langKey:e?.langKey,action:e?.action,originalEvent:e?.originalEvent,originalError:e?.originalError}))}))),[e,t,a]);return{connect:g,start:l,sendMessage:f,sendAction:y,sendContext:_,reset:u,emitEvent:c,addMessageBubble:h,addUploadBubble:v,addDivider:m,apiConnected:e.connected,apiConfigReady:e.configReady}};const hi=()=>{const e=(()=>{const e=(0,Bo.NT)(ci);if(!e)throw new Error("useSeamlyLiveRegionContext has to be used within <SeamlyLiveRegionContext.Provider>");return e})();return{sendPolite:(0,Bo.hb)((t=>{t&&e({ariaLive:B,messageText:t})}),[e]),sendAssertive:(0,Bo.hb)((t=>{t&&e({ariaLive:z,messageText:t})}),[e])}},vi=Pt((({interrupt:e})=>e),(({error:e})=>e)),mi=Pt(vi,(e=>Boolean(e)));function yi(){const{t:e}=ni(),t=Qt(vi);return{hasError:Qt(mi),meta:(0,Bo.Kr)((()=>{if(!t)return{title:void 0,message:void 0,srText:void 0,buttonText:void 0,originalError:void 0,action:void 0};const{langKey:n,action:r}=t,o=e(`${n}.title`),i=e(`${n}.message`),a=e(`${n}.srText`),s=r?e(`${n}.buttonText`):null;return{...n?{title:o,message:i,srText:a}:{},...r?{action:r}:{},...r&&n?{buttonText:s}:{},originalError:t}}),[t,e]),error:t}}var _i=()=>{const{t:e}=ni(),{isInline:t,isWindow:n,isApp:r}=Mn(),{isOpen:o,isVisible:i}=ri(),a=Qt(Fn),{start:s,connect:c,apiConfigReady:l,apiConnected:u}=fi(),d=(0,Bo.li)(!1),{sendAssertive:p}=hi();!function(){const{meta:{originalError:e,action:t}}=yi(),n=zo(),{reset:r}=fi(),o="SeamlySessionExpiredError"===e?.name,i=(0,Bo.li)(0),a=(0,Bo.li)(null);(0,Bo.vJ)((()=>{if(o&&"reset"===t){if(i.current>=10){a.current=setTimeout((()=>{i.current=0}),1e4);const e=new b;return n(Tr({name:e.name,message:e.message,langKey:e.langKey,originalEvent:e.originalEvent,originalError:e.originalError,action:e.action})),()=>{}}i.current+=1,r()}return()=>{a.current&&clearTimeout(a.current)}}),[t,r,o,n])}(),(0,Bo.vJ)((()=>{i&&setTimeout((()=>{p(e("window.srTexts.onLoad"))}),500)}),[i,p,e]),(0,Bo.vJ)((()=>{i&&p(e(o?"window.srTexts.onOpen":"window.srTexts.onClose"))}),[o,i,p,e]),(0,Bo.vJ)((()=>{l||u||(d.current=!1)}),[l,u]);const f=(0,Bo.hb)((async()=>{u||(d.current=!0,await c()),(r||o||i&&t)&&s()}),[u,c,r,t,o,i,s]);(0,Bo.vJ)((()=>{!l||d.current||n&&!o||!(!t||i&&a)||f()}),[l,f,t,o,i,n,a])},gi=0;function bi(e,t,n,r,i,a){t||(t={});var s,c,l=t;if("ref"in l)for(c in l={},t)"ref"==c?s=t[c]:l[c]=t[c];var u={type:e,props:l,key:n,ref:s,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:--gi,__i:-1,__u:0,__source:i,__self:a};if("function"==typeof e&&(s=e.defaultProps))for(c in s)void 0===l[c]&&(l[c]=s[c]);return o.fF.vnode&&o.fF.vnode(u),u}Array.isArray;var wi=({children:e})=>(_i(),bi(o.FK,{children:e})),xi=(0,o.q6)(null);const Ci=(e=0)=>new Promise((t=>{setTimeout(t,e)})),Si=()=>{const{seamlyContainerElement:e}=Cn(),t=zo();return[e,(0,Bo.hb)((e=>{t(co(e))}),[t])]},Ei=e=>(0,Bo.hb)((()=>{var t;t=e,requestAnimationFrame((async()=>{await Ci(180);const e="string"==typeof t?document.getElementById(t):t;gn(e)}))}),[e]),Ti=()=>{const e=On();return Ei(e)},Ni=e=>Pt((e=>e.translations.translatedEventGroups),(t=>Object.values(t).every((t=>e?.payload?.id&&!t.includes(e.payload.id)))));function Ii(){const{sendContext:e}=fi(),t=zo(),n=un(),r=(0,Bo.hb)(((t,n)=>{e({userLocale:t,source:n})}),[e]),o=(0,Bo.hb)((()=>{e({userLocale:n.context?.contentLocale}),t(ko())}),[n.context?.contentLocale,t,e]),{languages:i,isActive:a,isAvailable:s,currentLocale:c}=Qt((({translations:e})=>e));return{languages:i,isActive:a,isAvailable:s,currentLocale:c,enableTranslations:r,disableTranslations:o}}const Oi=e=>{const t=Qt(Ni(e));if(!e?.payload)return{body:void 0,hasTranslation:!1,isTranslated:!1,locale:""};const n=e.payload?.translatedBody&&"data"in e.payload.translatedBody?e.payload?.translatedBody.data:e.payload.translatedBody,{translation:r,body:o}={body:e.payload?.body,translation:e.payload?.translation},i=!!n;return{body:t&&i?n:o,hasTranslation:i,isTranslated:t&&i,locale:r?.locale}};function ki(){const e=Qt((({translations:e})=>e.containerId));return{id:e,focusContainer:Ei(e)}}function Li(e){const{languages:t}=Ii();return(0,Bo.Kr)((()=>t?.find((t=>t.locale===e))?.nativeName),[e,t])}const Ai=()=>{const{isActive:e,languages:t}=Ii(),n=zo(),{sendAction:r}=fi(),{translationProposal:o}=Qt((e=>e.translations)),{enableTranslations:i}=Ii(),{isOpen:a}=ri(),{userLocale:s}=ni(),c=o?.proposedLocale,l=Li(c),u=(0,Bo.Kr)((()=>null!==o&&!e&&a&&s!==c&&t.some((e=>e.locale===c))),[o,e,a,s,c,t]);return{activateTranslationProposal:()=>{o?.proposedLocale&&i(o.proposedLocale,U)},dismissTranslationProposal:()=>{r({type:M,body:{type:D}}),n(Mo())},proposedLocale:c,proposedLocaleNativeName:l,showProposal:u,translationProposal:o}},Pi=(...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&&e.length)).map((e=>e&&e.indexOf(Kn)>-1?e:[Kn,e].join("-"))).join(" "),Mi=()=>un().appContainerClassNames,Ri=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};var Fi=()=>{const e=ui();return(0,zt.useSyncExternalStore)(m.subscribe,(()=>e.conversation))},Di=(0,o.q6)(null);const Ui=()=>{const{showFileUpload:e,entryMeta:{options:t,optionsOverride:n},options:{features:{uploads:r}}}=Cn(),{allowedMimeTypes:o,maxSize:i}=n?.upload||{},{enabled:a,enabledFromEntry:s}=r||{},{allowedMimeTypes:c,maxSize:l}={...t.upload||{allowedMimeTypes:[],maxSize:0},...o?{allowedMimeTypes:o}:{},...i?{maxSize:i}:{}};return{showFileUpload:e,accountAllowsUploads:!!r,serviceAllowsUploads:s||a,allowedMimeTypes:c,maxSize:l}},ji=()=>{const{currentUploads:e}=Cn(),t=zo(),n=(()=>{const e=(0,Bo.NT)(Di);if(!e)throw new Error("useSeamlyFileUploadContext has to be used within <SeamlyFileUploadContext.Provider>");return e})();return{uploadFile:(0,Bo.hb)((e=>{n(e)}),[n]),clearUploads:(0,Bo.hb)((()=>{t(Ur())}),[t]),currentUploads:e,isUploading:e.some((e=>e.uploading)),isComplete:e.every((e=>e.complete))}},zi=()=>{const{t:e}=ni(),{options:t}=Cn(),{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}))),d=a||s,p=zo(),{get:f,set:h}=di();return{allowOptionSelection:d,userSelectedOptions:o,features:i,menuOptions:u,initUserSelectedOptions:(0,Bo.hb)((()=>{const e=f("options")||{};p(bo(e))}),[f,p]),setUserSelectedOptions:(0,Bo.hb)((e=>{p(bo(e)),h("options",e)}),[h,p]),setUserSelectedOption:(0,Bo.hb)(((e,t)=>{const n=f("options")||{};"object"==typeof n&&h("options",{...n,[e]:t}),p(go({option:e,value:t}))}),[p,f,h]),showOption:e=>{p(wo(e))},hideOption:()=>{p(Hr())},panelActive:n,optionActive:r}},Bi=()=>{const{optionsButtonId:e}=Cn();return{id:e,focusButton:Ei(e)}};var Vi=(0,o.q6)(null),Ki=()=>{const e=(0,Bo.NT)(Vi);if(!e)throw new Error("useSeamlyActivityEventHandler has to be used within <SeamlyActivityEventContext.Provider>");return e},Hi=()=>{const e=zo(),{idleDetachCountdown:{hasCountdown:t,isActive:n,count:r,remaining:o,timer:i,wasStopped:a}}=Cn(),{isOpen:s}=ri(),{emitEvent:c,sendAction:l}=fi(),{t:u}=ni(),{sendAssertive:d,sendPolite:p}=hi(),f=(0,Bo.hb)((e=>{s&&d(e)}),[s,d]),h=(0,Bo.hb)((e=>{s&&p(e)}),[s,p]),v=(0,Bo.hb)((t=>{const n=(e=>Math.ceil(e/1e3))(t),r=hn(n);e($r({delaySeconds:n,delayTime:r})),c("idleTimer.start"),f(`${u("idleDetachWarning.countdownTitle")} ${u("idleDetachWarning.countdownText")} ${u("idleDetachWarning.countdownTimer",r)}`)}),[e,c,f,u]),m=(0,Bo.hb)(((n=void 0,r=!1)=>{t&&(n||(r||l({type:P}),f(u("idleDetachWarning.notifyTransferText"))),a||c("idleTimer.stop"),e(Br()))}),[e,c,t,l,f,u,a]),y=(0,Bo.hb)((()=>{if(!o||o<=0)return;const t=o-1;t%10==0&&f(`${u("idleDetachWarning.countdownText")} ${u("idleDetachWarning.countdownTimer",hn(t))}`),e(Kr())}),[e,o,f,u]),_=(0,Bo.hb)((()=>{n&&(e(xo()),o&&(c("idleTimer.stop"),h(u("idleDetachWarning.srCountDownStoppedText"))))}),[e,c,n,o,h,u]);return{hasCountdown:t,isActive:n,count:r,remaining:o,timer:i,wasStopped:a,initCountdown:v,endCountdown:m,decrementCountdown:y,stopCountdown:_}},$i=()=>{const e=zo(),t=Cn().resumeConversationPrompt,{sendAction:n}=fi(),{t:r}=ni(),{sendAssertive:o}=hi();return{continueChat:()=>{n({type:M,body:{type:"resume_conversation_prompt"}}),e(Vr())},hasPrompt:t,restartChat:()=>{o(r("resumeConversationPrompt.srNotifyRestartText")),n({type:P}),e(Vr())}}};const Ji=()=>{const[e]=(0,Bo.J0)((()=>$()));return e},Wi=(e,t)=>{const n=Fi();(0,Bo.vJ)((()=>{n.onMessage(((n,r)=>(t&&!t({type:n,payload:r})||e({type:n,payload:r}),r)))}),[e,t,n])};var qi=({eventPayload:e})=>{const{t:t}=ni(),{fromClient:n,participant:r}=e,o=(e=>Cn().participantInfo.participants[e])(r)||{},{messages:i}=un(),a=n?t("participants.user.name"):o&&o.name,{showAvatar:s,showName:c}=i&&i[n?"user":"agent"]||{};if(!s&&!c)return null;const l=[];return s&&a&&o.avatar&&l.push(bi("span",{className:Pi("message__avatar"),children:bi("img",{src:o.avatar,className:Pi("avatar"),alt:""})})),c&&a&&l.push(bi("span",{className:Pi("message__author-name"),children:a})),l.length>0?bi("div",{className:Pi("message__author"),children:l}):null},Gi=({showParticipant:e=!0,event:t,type:n,modifiers:r,children:i,bodyProps:a={},info:s,...c})=>{const l=Ri(t),{hasTranslation:u,isTranslated:d,locale:p}=Oi(t);return n&&l.push(`message--type-${n}`),r&&("string"==typeof r&&(r=r.split(" ").filter((e=>e.length))),r.forEach((e=>{l.push(`message--${e}`)}))),d&&l.push("message--is-translated"),u&&l.push("message--has-translation"),d&&(a={...a,lang:p}),bi(o.FK,{children:bi("div",{className:Pi(l),...c,children:[e&&bi(qi,{eventPayload:t.payload}),bi("div",{className:Pi("message__body"),...a,children:i}),s&&bi("div",{"aria-hidden":"true",className:Pi("message__info"),children:s})]})})},Xi=({id:e,action:t,buttonText:n,description:r,hasFocus:o,image:i,title:a,isCarouselItem:s})=>{const c=(0,Bo.li)(null),{sendMessage:l,sendAction:u,emitEvent:d}=fi(),p=Ji(),f=(0,Bo.li)(!1),h=t?.type===H?"a":"button",v=(0,Bo.hb)((()=>d("action.click_card",{type:F,originMessage:e,action:t})),[d,e,t]),m=(0,Bo.hb)((()=>{if(v(),"ask"===t?.type)l({body:t?.ask});else if("topic"===t?.type){const{topic:e,fallbackMessage:n}=t;u({type:R,body:{name:e,fallbackMessage:n}})}}),[l,t,u,v]),y=(0,Bo.Kr)((()=>t?.type===H?{href:t?.link,rel:"noopener noreferrer",target:t?.newTab?"_blank":"_self",onClick:v}:{onClick:m}),[t,m,v]);return(0,Bo.vJ)((()=>{s&&(o&&f.current?window.requestAnimationFrame((()=>c.current?.focus())):c.current?.blur()),f.current=!0}),[o,s]),bi("div",{className:Pi("card__wrapper"),id:e,tabIndex:-1,ref:c,children:[i?bi("img",{className:Pi("card__image"),src:i,alt:""}):null,bi("div",{className:Pi("card__content"),id:e,children:[a&&bi("h2",{className:Pi("card__title"),children:a}),r&&bi("div",{className:Pi("card__description"),dangerouslySetInnerHTML:{__html:r}}),bi(h,{tabIndex:s&&!o?-1:void 0,className:Pi("button","button--primary"),"aria-describedby":p,...y,children:n})]})]})};function Yi({item:e,items:t,index:n,isActive:r}){const{t:o}=ni();return bi("div",{className:Pi("carousel-item",`carousel-item--${e.type}`),role:"group","aria-roledescription":"slide","aria-label":o("carousel.slide.label",{index:n+1,total:t.length}),children:bi(Xi,{...e,isCarouselItem:!0,hasFocus:r})})}const Qi={send:{32:'<svg xmlns="http://www.w3.org/2000/svg" width="32px" height="32px" x="0px" y="0px" viewBox="0 0 32 32"><defs/><path fill="#4A48C1" d="M6.714,14.985l17.837-7.906c0.681-0.302,1.414,0.301,1.25,1.027L22.273,23.59\tc-0.13,0.566-0.751,0.865-1.275,0.613l-3.623-1.752l-2.334,2.287c-0.572,0.562-1.538,0.156-1.538-0.645V21.01\tc0-0.217,0.078-0.43,0.222-0.594l7.676-8.841l-10.414,7.472l-4.351-2.445C5.987,16.236,6.033,15.287,6.714,14.985L6.714,14.985z"/></svg>'},balloon:{32:'<svg xmlns="http://www.w3.org/2000/svg" width="32px" height="32px" x="0px" y="0px" viewBox="0 0 32 32"><defs/><path fill="#4A48C1" d="M24,10.824v10.375c0,1.104-0.896,2-2,2h-4.694l-4.931,3.625v-3.625H10c-1.104,0-2-0.896-2-2V10.824\tc0-1.104,0.896-2,2-2h12C23.104,8.824,24,9.719,24,10.824z"/></svg>'},newTopic:{32:'<svg xmlns="http://www.w3.org/2000/svg" width="32px" height="32px" x="0px" y="0px" viewBox="0 0 32 32"><path fill="#4A48C1" d="M16,8.593l2.407,4.573l5.093,0.876l-3.604,3.702l0.74,5.115L16,20.574l-4.634,2.285l0.739-5.115L8.5,14.042\tl5.094-0.876L16,8.593z"/></svg>'},newTranslation:{16:'<svg xmlns="http://www.w3.org/2000/svg" x="0px" y="0px" viewBox="0 0 16 16"><path fill="#4A48C1" d="M8,0C3.6,0,0,3.6,0,8s3.6,8,8,8s8-3.6,8-8S12.4,0,8,0z M14.1,7.1h-1.4c-0.1-1.5-0.4-2.9-1-4\tC13,4,13.9,5.4,14.1,7.1z M7.1,2.1v5H5C5.2,4.7,6.1,2.9,7.1,2.1z M7.1,8.9v5c-1-0.7-1.9-2.5-2.1-5H7.1z M8.9,13.9v-5H11\tC10.8,11.3,9.9,13.2,8.9,13.9z M8.9,7.1v-5c1,0.7,1.9,2.5,2.1,5H8.9z M4.2,3.1c-0.5,1.1-0.9,2.5-1,4H1.9C2.1,5.4,3,4,4.2,3.1z M1.9,8.9h1.4c0.1,1.5,0.4,2.9,1,4C3,12,2.1,10.5,1.9,8.9z M11.8,12.9c0.5-1.1,0.9-2.5,1-4h1.4C13.9,10.5,13,12,11.8,12.9z"/></svg>',32:'<svg xmlns="http://www.w3.org/2000/svg" x="0px" y="0px" viewBox="0 0 32 32"><path fill="#4A48C1" d="M16,7c-4.9,0-9,4.1-9,9s4.1,9,9,9s9-4.1,9-9S20.9,7,16,7z M22.9,15h-1.6c-0.1-1.7-0.5-3.3-1.1-4.5\tC21.6,11.5,22.6,13.1,22.9,15z M15,9.4V15h-2.3C12.9,12.3,13.9,10.2,15,9.4z M15,17v5.6c-1.1-0.8-2.1-2.9-2.3-5.6H15z M17,22.6V17\th2.3C19.1,19.8,18.1,21.8,17,22.6z M17,15V9.4c1.1,0.8,2.1,2.9,2.3,5.6H17z M11.8,10.4c-0.6,1.3-1,2.8-1.1,4.5H9.1\tC9.4,13.1,10.4,11.5,11.8,10.4z M9.1,17h1.6c0.1,1.7,0.5,3.3,1.1,4.5C10.4,20.5,9.4,18.9,9.1,17z M20.2,21.5c0.6-1.3,1-2.8,1.1-4.5\th1.6C22.6,18.8,21.6,20.5,20.2,21.5z"/></svg>'},avatar:{32:'<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"\n\t viewBox="0 0 32 32" enable-background="new 0 0 32 32" xml:space="preserve">\n<path fill="#4A48C1" d="M10,14.8c-1.1,0-2-0.9-2-2s0.9-2,2-2s2,0.9,2,2S11.1,14.8,10,14.8z M15.9,14.8c1.1,0,2-0.9,2-2s-0.9-2-2-2\n\ts-2,0.9-2,2S14.8,14.8,15.9,14.8z M21.8,10.8c-1.1,0-2,0.9-2,2s0.9,2,2,2s2-0.9,2-2S22.9,10.8,21.8,10.8z M21.3,18.1H10.7\n\tC11.7,23.9,20.2,23.9,21.3,18.1z"/>\n</svg>\n'},chevronDown:{8:'<svg xmlns="http://www.w3.org/2000/svg" width="8px" height="8px" x="0px" y="0px" viewBox="0 0 8 8"><defs/><path fill="#4A48C1" d="M-0.001,2.876c0-0.247,0.091-0.494,0.273-0.688c0.38-0.401,1.013-0.418,1.414-0.039l1.938,1.834\tc0.199,0.188,0.547,0.188,0.746,0L6.31,2.15c0.401-0.379,1.034-0.362,1.414,0.04c0.379,0.401,0.361,1.034-0.04,1.414L5.745,5.437\tC4.782,6.35,3.213,6.35,2.249,5.436L0.311,3.603C0.103,3.406-0.001,3.142-0.001,2.876z"/></svg>',32:'<svg xmlns="http://www.w3.org/2000/svg" width="32px" height="32px" x="0px" y="0px" viewBox="0 0 32 32"><defs/><path fill="#4A48C1" d="M16,20.425c-0.782,0-1.563-0.291-2.159-0.874l-6.541-6.408c-0.395-0.387-0.401-1.02-0.015-1.414\tc0.387-0.394,1.021-0.4,1.414-0.015l6.541,6.408c0.42,0.409,1.102,0.409,1.52-0.001l6.541-6.407c0.396-0.386,1.028-0.38,1.414,0.015\tc0.387,0.395,0.381,1.027-0.014,1.414l-6.541,6.407C17.563,20.133,16.782,20.425,16,20.425z"/></svg>'},chevronRight:{8:'<svg xmlns="http://www.w3.org/2000/svg" width="8px" height="8px" x="0px" y="0px" viewBox="0 0 8 8"><defs/><path fill="#4A48C1" d="M2.875,7.998c-0.247,0-0.494-0.091-0.688-0.273c-0.401-0.38-0.418-1.013-0.039-1.414l1.834-1.938\tc0.188-0.199,0.188-0.547,0-0.746l-1.835-1.94c-0.379-0.401-0.362-1.034,0.04-1.414s1.034-0.361,1.414,0.04l1.834,1.939\tc0.913,0.963,0.913,2.532-0.001,3.496L3.601,7.686C3.405,7.894,3.14,7.998,2.875,7.998z"/></svg>',16:'<svg xmlns="http://www.w3.org/2000/svg" width="16px" height="16px" x="0px" y="0px" viewBox="0 0 16 16"><defs/><path fill="#4A48C1" d="M6.5,13c-0.247,0-0.494-0.091-0.687-0.273c-0.401-0.38-0.419-1.013-0.04-1.414L8.22,8.727\tc0.373-0.394,0.373-1.06,0-1.454L5.773,4.687c-0.379-0.401-0.362-1.034,0.04-1.414c0.4-0.378,1.034-0.362,1.414,0.04l2.446,2.586\tc1.096,1.159,1.096,3.043,0,4.203l-2.446,2.586C7.03,12.896,6.765,13,6.5,13z"/></svg>'},close:{8:'<svg xmlns="http://www.w3.org/2000/svg" width="8px" height="8px" x="0px" y="0px" viewBox="0 0 8 8"><defs/><path fill="#4A48C1" d="M7.705,7.729C7.511,7.923,7.255,8.02,7,8.02c-0.257,0-0.514-0.099-0.709-0.295L4,5.423L1.709,7.725\tC1.513,7.921,1.257,8.02,1,8.02c-0.255,0-0.51-0.097-0.706-0.291c-0.391-0.39-0.393-1.022-0.003-1.414l2.298-2.309l-2.27-2.28\tC-0.07,1.334-0.068,0.701,0.323,0.311c0.392-0.389,1.024-0.387,1.415,0.003L4,2.587l2.263-2.274C6.653-0.077,7.287-0.079,7.677,0.31\tC8.068,0.7,8.07,1.333,7.681,1.725l-2.27,2.281l2.298,2.309C8.099,6.705,8.097,7.339,7.705,7.729z"/></svg>',16:'<svg xmlns="http://www.w3.org/2000/svg" width="16px" height="16px" x="0px" y="0px" viewBox="0 0 16 16"><defs/><path fill="#4A48C1" d="M12.709,11.295L9.411,7.982l3.262-3.276c0.39-0.392,0.388-1.024-0.004-1.414\tc-0.39-0.39-1.023-0.388-1.414,0.003L8,6.564L4.746,3.295C4.357,2.904,3.724,2.903,3.332,3.292C2.94,3.682,2.939,4.315,3.329,4.707\tl3.261,3.275l-3.298,3.313c-0.39,0.391-0.388,1.024,0.003,1.414C3.49,12.903,3.745,13,4,13c0.257,0,0.513-0.099,0.708-0.295L8,9.399\tl3.291,3.306C11.486,12.901,11.743,13,12,13c0.255,0,0.511-0.097,0.705-0.291C13.097,12.319,13.099,11.686,12.709,11.295z"/></svg>'},enlarge:{32:'<svg xmlns="http://www.w3.org/2000/svg" width="32px" height="32px" x="0px" y="0px" viewBox="0 0 32 32"><defs/><path fill="#4A48C1" d="M24,9v6.5c0,0.552-0.447,1-1,1s-1-0.448-1-1v-4.086L11.414,22H15.5c0.552,0,1,0.447,1,1s-0.448,1-1,1H9\tc-0.13,0-0.26-0.026-0.382-0.077c-0.245-0.102-0.439-0.296-0.541-0.541C8.026,23.26,8,23.13,8,23v-6.5c0-0.552,0.448-1,1-1\ts1,0.448,1,1v4.085L20.586,10H16.5c-0.552,0-1-0.448-1-1s0.448-1,1-1H23c0.13,0,0.26,0.026,0.382,0.077\tc0.245,0.102,0.439,0.296,0.541,0.541C23.974,8.74,24,8.87,24,9z"/></svg>'},options:{32:'<svg xmlns="http://www.w3.org/2000/svg" width="32px" height="32px" x="0px" y="0px" viewBox="0 0 32 32"><defs/><path fill="#4A48C1" d="M26.1,21.383c0.334-0.625,0.602-1.279,0.812-1.949L32,18.609V13.51l-5.058-0.846\tc-0.208-0.67-0.468-1.325-0.795-1.956l3.009-4.145l-3.604-3.634L21.38,5.903c-0.626-0.333-1.276-0.602-1.948-0.81L18.609,0\tl-5.098,0.001l-0.847,5.061c-0.669,0.203-1.326,0.465-1.957,0.794L6.562,2.847L2.929,6.449l2.973,4.171\tC5.569,11.247,5.3,11.9,5.091,12.569L0,13.373v5.099l5.06,0.866c0.204,0.669,0.467,1.324,0.796,1.955l-3.009,4.146l3.601,3.635\tl4.171-2.975c0.627,0.335,1.282,0.603,1.951,0.811L13.372,32h5.118l0.849-5.057c0.668-0.207,1.323-0.469,1.953-0.795l4.144,3.01\tl3.639-3.604L26.1,21.383z M19.01,19.035c-1.675,1.663-4.381,1.652-6.041-0.025c-1.662-1.675-1.649-4.381,0.024-6.042\tc1.676-1.661,4.382-1.648,6.043,0.025C20.699,14.67,20.686,17.377,19.01,19.035z"/></svg>'},file:{32:'<svg xmlns="http://www.w3.org/2000/svg" xml:space="preserve" x="0px" y="0px" version="1.1" viewBox="0 0 32 32"><path fill="#4A48C1" d="M16,28.5c-3.6,0-6.5-3-6.5-6.6V9.6c0-0.6,0.4-1,1-1s1,0.4,1,1v12.3c0,2.5,2,4.6,4.5,4.6\tc2.5,0,4.5-2.1,4.5-4.6V8.3c0-1.5-1.2-2.8-2.7-2.8c-1.5,0-2.7,1.3-2.7,2.8v13.5c0,0.6,0.5,1.1,1,1.1c0.6,0,1-0.5,1-1.1v-10\tc0-0.6,0.4-1,1-1s1,0.4,1,1v10c0,1.7-1.4,3.1-3,3.1s-3-1.4-3-3.1V8.3c0-2.6,2.1-4.8,4.7-4.8c2.6,0,4.7,2.2,4.7,4.8v13.6\tC22.5,25.5,19.6,28.5,16,28.5z"/></svg>'},upload:{32:'<svg xmlns="http://www.w3.org/2000/svg" width="32px" height="32px" x="0px" y="0px" viewBox="0 0 32 32"><defs/><path fill="#4A48C1" d="M9.488,13.481c-0.391-0.391-0.391-1.023,0-1.414l5.805-5.805c0.026-0.026,0.06-0.036,0.088-0.058\tc0.073-0.06,0.146-0.119,0.235-0.156c0.246-0.103,0.522-0.103,0.769,0c0.093,0.039,0.171,0.101,0.249,0.165\tc0.023,0.02,0.053,0.027,0.074,0.049l5.805,5.805c0.391,0.391,0.391,1.023,0,1.414c-0.195,0.195-0.451,0.293-0.707,0.293\ts-0.512-0.098-0.707-0.293L17,9.383V20.33c0,0.553-0.447,1-1,1c-0.552,0-1-0.447-1-1V9.383l-4.098,4.098\tC10.512,13.872,9.879,13.872,9.488,13.481z M22.819,24.031H9.181c-0.552,0-1,0.447-1,1s0.448,1,1,1h13.639c0.553,0,1-0.447,1-1\tS23.372,24.031,22.819,24.031z"/></svg>'},download:{16:'<svg xmlns="http://www.w3.org/2000/svg" width="16px" height="16px" x="0px" y="0px" viewBox="0 0 16 16"><defs/><path fill="#FFF" d="M3.175,7.726c-0.413-0.367-0.45-0.999-0.083-1.412c0.367-0.413,0.999-0.45,1.412-0.083L7,8.45V1.5\tc0-0.552,0.448-1,1-1c0.553,0,1,0.448,1,1v6.95l2.496-2.219c0.412-0.367,1.044-0.331,1.411,0.083\tc0.367,0.413,0.33,1.045-0.083,1.412l-4.16,3.698c-0.047,0.041-0.103,0.062-0.154,0.094c-0.047,0.028-0.089,0.064-0.141,0.085\tC8.25,11.649,8.125,11.677,8,11.677c-0.126,0-0.25-0.027-0.369-0.074c-0.05-0.021-0.09-0.055-0.136-0.083\tc-0.053-0.031-0.111-0.053-0.159-0.096L3.175,7.726z M12.018,13.5H3.983c-0.552,0-1,0.447-1,1s0.448,1,1,1h8.035\tc0.553,0,1-0.447,1-1S12.57,13.5,12.018,13.5z"/></svg>'},error:{16:'<svg xmlns="http://www.w3.org/2000/svg" width="16px" height="16px" x="0px" y="0px" viewBox="0 0 16 16"><defs/><path fill="#ad001f" d="M15.744,13.104L9.097,1.47c-0.604-1.055-1.59-1.055-2.193,0L0.256,13.104\tc-0.604,1.056-0.102,1.919,1.113,1.919H14.63C15.847,15.022,16.348,14.159,15.744,13.104z M7,5.045c0-0.552,0.448-1,1-1s1,0.448,1,1\tv3.656c0,0.552-0.448,1-1,1s-1-0.448-1-1V5.045z M8,13.212c-0.748,0-1.354-0.607-1.354-1.354c0-0.748,0.606-1.354,1.354-1.354\ts1.354,0.606,1.354,1.354C9.354,12.604,8.748,13.212,8,13.212z"/></svg>'},arrowLeft:{16:'<?xml version="1.0" encoding="utf-8"?>\n\x3c!-- Generator: Adobe Illustrator 25.2.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) --\x3e\n<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"\n\t viewBox="0 0 16 16" enable-background="new 0 0 16 16" xml:space="preserve">\n<path fill="#5053A4" d="M13.6,8c0,0.6-0.4,1-1,1h-7l2.2,2.5c0.4,0.4,0.3,1-0.1,1.4c-0.2,0.2-0.4,0.2-0.7,0.2c-0.3,0-0.6-0.1-0.8-0.3\n\tL2.6,8.6c0,0-0.1-0.1-0.1-0.2c0,0-0.1-0.1-0.1-0.1c0-0.1-0.1-0.2-0.1-0.3c0,0,0,0,0,0c0,0,0,0,0,0c0-0.1,0-0.3,0.1-0.4\n\tc0,0,0.1-0.1,0.1-0.1c0-0.1,0.1-0.1,0.1-0.2l3.7-4.1c0.4-0.4,1-0.4,1.4-0.1c0.4,0.4,0.4,1,0.1,1.4L5.6,7h7C13.2,7,13.6,7.4,13.6,8z"\n\t/>\n</svg>\n'},arrowRight:{16:'<?xml version="1.0" encoding="utf-8"?>\n\x3c!-- Generator: Adobe Illustrator 25.2.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) --\x3e\n<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"\n\t viewBox="0 0 16 16" enable-background="new 0 0 16 16" xml:space="preserve">\n<path fill="#5053A4" d="M2.4,8.1c0-0.6,0.4-1,1-1h7L8.1,4.5c-0.4-0.4-0.3-1,0.1-1.4c0.2-0.2,0.4-0.2,0.7-0.2c0.3,0,0.6,0.1,0.8,0.3\n\tl3.7,4.2c0,0,0.1,0.1,0.1,0.2c0,0,0.1,0.1,0.1,0.1c0,0.1,0.1,0.2,0.1,0.3c0,0,0,0,0,0c0,0,0,0,0,0c0,0.1,0,0.3-0.1,0.4\n\tc0,0-0.1,0.1-0.1,0.1c0,0.1-0.1,0.1-0.1,0.2l-3.7,4.1c-0.4,0.4-1,0.4-1.4,0.1c-0.4-0.4-0.4-1-0.1-1.4l2.2-2.4h-7\n\tC2.8,9.1,2.4,8.6,2.4,8.1z"/>\n</svg>\n'},check:{16:'<svg\n xmlns="http://www.w3.org/2000/svg"\n width="16px"\n height="16px"\n x="0px"\n y="0px"\n viewBox="0 0 16 16"\n>\n <path\n fill="currentColor"\n d="M11.6,4.3l-5,5L4.9,7.5C4.4,7,3.7,7,3.2,7.5l0,0C2.8,8,2.8,8.7,3.2,9.2l1.7,1.7l0,0l0.8,0.8\n\tc0.5,0.5,1.2,0.5,1.7,0l0.8-0.8l5-5c0.5-0.5,0.5-1.2,0-1.7l0,0C12.8,3.8,12.1,3.8,11.6,4.3z"\n />\n</svg>\n',32:'<svg\n xmlns="http://www.w3.org/2000/svg"\n width="32px"\n height="32px"\n x="0px"\n y="0px"\n viewBox="0 0 32 32"\n>\n <path\n fill="currentColor"\n d="M22.9,9.3l-9.3,9.3l-3.2-3.2c-0.9-0.9-2.3-0.9-3.2,0l0,0c-0.9,0.9-0.9,2.3,0,3.2l3.2,3.2l0,0l1.6,1.6\n\tc0.9,0.9,2.3,0.9,3.2,0l1.6-1.6l9.3-9.3c0.9-0.9,0.9-2.3,0-3.2l0,0C25.2,8.4,23.7,8.4,22.9,9.3z"\n />\n</svg>\n'}};var Zi=({name:e,size:t="32",className:n,alt:r})=>bi(o.FK,{children:[bi("div",{"aria-hidden":"true",className:n||Pi("icon"),dangerouslySetInnerHTML:{__html:Qi[e][t]}}),r&&bi("span",{className:Pi("visually-hidden"),children:r})]});function ea({items:e,currentIndex:t,onChange:n,children:r}){const{t:o}=ni(),i=e.length;return bi("div",{className:Pi("carousel-controls"),children:[bi("button",{className:Pi("button","button--previous"),"aria-label":o("carousel.controls.previous"),onClick:()=>{n((t-1+i)%i)},children:bi(Zi,{name:"arrowLeft",size:"16",alt:""})}),r,bi("button",{className:Pi("button","button--next"),"aria-label":o("carousel.controls.next"),onClick:()=>{n((t+1)%i)},children:bi(Zi,{name:"arrowRight",size:"16",alt:""})})]})}function ta({items:e,currentIndex:t,onChange:n,getItemKey:r,getItemLabel:o}){const i=e.length,a=(0,Bo.hb)((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 bi("div",{className:Pi("carousel-pagination__wrapper"),role:"group",children:bi("ul",{className:Pi("carousel-pagination"),children:e.map(((e,n)=>{const i=t===n;return bi("li",{className:Pi("carousel-pagination__item",i?"is-active":void 0),children:bi("button",{className:Pi("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 na=(e,t,n)=>`${n}${t}`,ra=e=>e.label,oa=({target:e})=>{e.scrollLeft=0};function ia({currentIndex:e=0,onChange:t=()=>{},getItemKey:n=na,getItemLabel:r=ra,items:i}){const a=Ji(),s=i.length,[c,l]=(0,Bo.J0)(Number(e||0));(0,Bo.vJ)((()=>{l(Number(e||0))}),[l,e]);const u=(0,Bo.li)([]);u.current=(0,Bo.Kr)((()=>Array(s).fill(1).map((()=>(0,o._3)()))),[s]);const d=(0,Bo.li)(!0),p=(0,Bo.li)(null);return p.current=t,(0,Bo.vJ)((()=>{d.current?d.current=!1:p.current&&p.current(c)}),[c]),bi("div",{className:Pi("carousel"),role:"group","aria-roledescription":"carousel",children:[bi("div",{className:Pi("carousel__slides-wrapper"),onScroll:oa,children:bi("div",{id:a,className:Pi("carousel__slides"),style:{width:100*s+"%",left:-100*c+"%"},"aria-live":"polite","aria-atomic":"false",children:i.map(((e,t)=>{const r=c===t;return bi("div",{ref:u.current[t],className:Pi("carousel__slide",r?"is-active":void 0),"aria-hidden":r?void 0:"true",children:bi(Yi,{item:e,items:i,index:t,isActive:r})},n(e,t,"item-"))}))})}),bi("div",{className:Pi("carousel__controls"),children:bi(ea,{currentIndex:c,items:i,onChange:l,children:bi("div",{className:Pi("carousel__pagination"),children:bi(ta,{currentIndex:c,items:i,onChange:l,getItemKey:n,getItemLabel:r})})})})]})}const aa=(e,t,n="")=>`${n}${e.title}:${t}`,sa=e=>e.title;const ca=e=>{const{payload:t}=e,[n,r]=(0,Bo.J0)(!1),{sendAction:o,addMessageBubble:i,addDivider:a}=fi(),{activeServiceSessionId:s}=kn(),c=Qt(Ln),{body:l}=Oi(e),{service:u}=t,d=(0,Bo.Kr)((()=>{if("choice_prompt"===e.payload.type)return{...e,payload:{...e.payload,body:e.payload.body?.prompt,translatedBody:e.payload.translatedBody&&{...e.payload.translatedBody,data:e.payload.translatedBody?.prompt}}}}),[e]),p=l?.chooseAgain&&s===u?.serviceSessionId&&t.id!==c;return(0,Bo.vJ)((()=>{r(t.id===c)}),[t,c]),{body:l,subEvent:d,showOptions:n,chooseAgain:p,onChoiceClickHandler:e=>{const n=$();p&&a("new_topic",n),i(e.text,n),o({type:"pick_choice",originMessage:t.id,choice:{id:e.id,chooseAgain:p},transactionId:n}),r(!1)},onChooseAgainClickHandler:()=>{r((e=>!e))}}};const la=e=>`suggestions__item--${String(e).toLowerCase().replace(/[^a-z0-9_\\-]/,"")}`;var ua=({id:e,categories:t=[],question:n,onClick:r,hasIcon:o})=>{const i=(0,Bo.Kr)((()=>["suggestions__item",...t.map(la)]),[t]),a=(0,Bo.hb)((()=>{r&&r({id:e,question:n})}),[e,n,r]);return bi("li",{className:Pi(i),children:bi("button",{type:"button",onClick:a,className:Pi("button","button--primary"),children:[o&&bi(Zi,{name:"chevronRight",size:"8",alt:""}),n]})})},da=({className:e,suggestions:t=[],onClickSuggestion:n,hasIcon:r=!0})=>bi("ul",{className:Pi("suggestions__list",e||""),children:t.map((e=>bi(ua,{hasIcon:r,onClick:n,categories:e.categories,id:e.id,question:e.question},e.id)))}),pa=({originMessage:e,transactionId:t})=>{const{sendAction:n}=fi();return r=>{r.target&&r.target.dataset.linkId&&n({type:"navigate",originMessage:e,transactionId:t,link:{id:r.target.dataset.linkId,url:r.target.getAttribute("href")}})}},fa=({children:e,className:t,graphicSrc:n,graphicType:r="icon",iconName:o,iconSize:i,iconClassName:a,dividerType:s,title:c,description:l})=>{const u=Boolean(o||n);return bi("div",{className:Pi("divider",s&&`divider--type-${s}`,t),children:[u&&bi("span",{className:Pi("divider__graphic"),children:o?bi(Zi,{name:o,size:i,className:a,alt:""}):bi("img",{src:n||void 0,className:Pi({icon:"icon"===r,avatar:"avatar"===r},a)})}),bi("div",{className:Pi("divider__body"),children:[c?bi("h2",{className:Pi("divider__title"),dangerouslySetInnerHTML:{__html:c}}):null,l?bi("p",{className:Pi("divider__description"),dangerouslySetInnerHTML:{__html:l}}):null,e]})]})};const ha={[V.new_topic]:"new-topic"};const va={default:({event:e})=>{const{t:t}=ni(),{subtype:n}=e.payload.body;return V[n]?bi(fa,{dividerType:ha[V[n]],iconName:V[n],title:t(`dividerKeys.${V[n]}`)}):null},[V.new_translation]:({event:e})=>{const{t:t}=ni(),n=Tn(),{body:{translationEnabled:r,text:i,title:a},id:s}=e.payload,c=Qt((e=>e.translations.translatedEventGroups)),l=zo(),u=(0,Bo.hb)((()=>{c[s]?l(Lo({events:n,id:s})):l(Ao({events:n,id:s}))}),[l,n,s,c]);return bi(fa,{iconName:"newTranslation",dividerType:"new-translation",title:a,description:i,children:r?bi(o.FK,{children:bi("button",{className:Pi("button","button--secondary"),onClick:u,children:t(c[s]?"translations.toggle.showTranslationsButtonText":"translations.toggle.hideTranslationsButtonText")})}):null})}};const ma={month:"long",day:"numeric",year:"numeric"},ya={hour:"numeric",minute:"numeric"};var _a=({event:e})=>{const t=(()=>{const[e,t]=(0,Bo.WO)((e=>e+1),0);return(0,Bo.hb)((()=>{setTimeout((()=>{t()}))}),[])})(),{date:n,time:r,timeUntilMidnight:o,srText:i}=(e=>{const{t:t}=ni(),n=un(),r=n?.context?.userLocale??[],o=new Date(e),i=new Date,a=new Date(i);a.setHours(24,0,0,0);const s=a.valueOf()-i.valueOf(),c=o.toString(),l=new Intl.DateTimeFormat(r,ya).format(o);let u=((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})(o,i);switch(u){case"today":u=t("dateTime.today");break;case"yesterday":u=t("dateTime.yesterday");break;default:u=new Intl.DateTimeFormat(r,ma).format(o)}return{date:u,srText:t("dateTime.srText",{date:u,time:l}),time:l,fullDateTime:c,timeUntilMidnight:s}})(fn(e.payload.timeIndicator));return(0,Bo.vJ)((()=>{const e=setTimeout((()=>{t()}),o);return()=>{clearTimeout(e)}}),[t,o]),bi(fa,{dividerType:"time-indicator",children:[bi("h2",{className:Pi("divider__time"),"aria-hidden":"true",children:[bi("span",{className:Pi("divider__time--date"),children:n}),bi("span",{className:Pi("divider__time--time"),children:r})]}),bi("p",{className:Pi("visually-hidden"),children:i})]})},ga=["input:not([inert])","select:not([inert])","textarea:not([inert])","a[href]:not([inert])","button:not([inert])","[tabindex]:not(slot):not([inert])","audio[controls]:not([inert])","video[controls]:not([inert])",'[contenteditable]:not([contenteditable="false"]):not([inert])',"details>summary:first-of-type:not([inert])","details:not([inert])"],ba=ga.join(","),wa="undefined"==typeof Element,xa=wa?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Ca=!wa&&Element.prototype.getRootNode?function(e){var t;return null==e||null===(t=e.getRootNode)||void 0===t?void 0:t.call(e)}:function(e){return null==e?void 0:e.ownerDocument},Sa=function e(t,n){var r;void 0===n&&(n=!0);var o=null==t||null===(r=t.getAttribute)||void 0===r?void 0:r.call(t,"inert");return""===o||"true"===o||n&&t&&e(t.parentNode)},Ea=function(e,t,n){if(Sa(e))return[];var r=Array.prototype.slice.apply(e.querySelectorAll(ba));return t&&xa.call(e,ba)&&r.unshift(e),r.filter(n)},Ta=function e(t,n,r){for(var o=[],i=Array.from(t);i.length;){var a=i.shift();if(!Sa(a,!1))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{xa.call(a,ba)&&r.filter(a)&&(n||!t.includes(a))&&o.push(a);var l=a.shadowRoot||"function"==typeof r.getShadowRoot&&r.getShadowRoot(a),u=!Sa(l,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(a));if(l&&u){var d=e(!0===l?a.children:l.children,!0,r);r.flatten?o.push.apply(o,d):o.push({scopeParent:a,candidates:d})}else i.unshift.apply(i,a.children)}}return o},Na=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},Ia=function(e){if(!e)throw new Error("No node provided");return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||function(e){var t,n=null==e||null===(t=e.getAttribute)||void 0===t?void 0:t.call(e,"contenteditable");return""===n||"true"===n}(e))&&!Na(e)?0:e.tabIndex},Oa=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},ka=function(e){return"INPUT"===e.tagName},La=function(e){var t=e.getBoundingClientRect(),n=t.width,r=t.height;return 0===n&&0===r},Aa=function(e,t){return!(t.disabled||Sa(t)||function(e){return ka(e)&&"hidden"===e.type}(t)||function(e,t){var n=t.displayCheck,r=t.getShadowRoot;if("hidden"===getComputedStyle(e).visibility)return!0;var o=xa.call(e,"details>summary:first-of-type")?e.parentElement:e;if(xa.call(o,"details:not([open]) *"))return!0;if(n&&"full"!==n&&"legacy-full"!==n){if("non-zero-area"===n)return La(e)}else{if("function"==typeof r){for(var i=e;e;){var a=e.parentElement,s=Ca(e);if(a&&!a.shadowRoot&&!0===r(a))return La(e);e=e.assignedSlot?e.assignedSlot:a||s===e.ownerDocument?a:s.host}e=i}if(function(e){var t,n,r,o,i=e&&Ca(e),a=null===(t=i)||void 0===t?void 0:t.host,s=!1;if(i&&i!==e)for(s=!!(null!==(n=a)&&void 0!==n&&null!==(r=n.ownerDocument)&&void 0!==r&&r.contains(a)||null!=e&&null!==(o=e.ownerDocument)&&void 0!==o&&o.contains(e));!s&&a;){var c,l,u;s=!(null===(l=a=null===(c=i=Ca(a))||void 0===c?void 0:c.host)||void 0===l||null===(u=l.ownerDocument)||void 0===u||!u.contains(a))}return s}(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!!xa.call(t,"fieldset[disabled] *")||!r.contains(e)}return!0}t=t.parentElement}return!1}(t))},Pa=function(e,t){return!(function(e){return function(e){return ka(e)&&"radio"===e.type}(e)&&!function(e){if(!e.name)return!0;var t,n=e.form||Ca(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)||Ia(t)<0||!Aa(e,t))},Ma=function(e){var t=parseInt(e.getAttribute("tabindex"),10);return!!(isNaN(t)||t>=0)},Ra=function e(t){var n=[],r=[];return t.forEach((function(t,o){var i=!!t.scopeParent,a=i?t.scopeParent:t,s=function(e,t){var n=Ia(e);return n<0&&t&&!Na(e)?0:n}(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(Oa).reduce((function(e,t){return t.isScope?e.push.apply(e,t.content):e.push(t.content),e}),[]).concat(n)},Fa=function(e,t){if(t=t||{},!e)throw new Error("No node provided");return!1!==xa.call(e,ba)&&Pa(t,e)},Da=ga.concat("iframe").join(","),Ua=function(e,t){if(t=t||{},!e)throw new Error("No node provided");return!1!==xa.call(e,Da)&&Aa(t,e)};function ja(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?ja(Object(n),!0).forEach((function(t){var r,o,i;r=e,o=t,i=n[t],o=function(e){var t=function(e){if("object"!=typeof e||null===e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(o),o in r?Object.defineProperty(r,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):r[o]=i})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ja(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Ba=function(e){return"Tab"===(null==e?void 0:e.key)||9===(null==e?void 0:e.keyCode)},Va=function(e){return Ba(e)&&!e.shiftKey},Ka=function(e){return Ba(e)&&e.shiftKey},Ha=function(e){return setTimeout(e,0)},$a=function(e,t){var n=-1;return e.every((function(e,r){return!t(e)||(n=r,!1)})),n},Ja=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},Wa=function(e){return e.target.shadowRoot&&"function"==typeof e.composedPath?e.composedPath()[0]:e.target},qa=[],Ga=function(e,t){var n,r=(null==t?void 0:t.document)||document,o=(null==t?void 0:t.trapStack)||qa,i=za({returnFocusOnDeactivate:!0,escapeDeactivates:!0,delayInitialFocus:!0,isKeyForward:Va,isKeyBackward:Ka},t),a={containers:[],containerGroups:[],tabbableGroups:[],nodeFocusedBeforeActivation:null,mostRecentlyFocusedNode:null,active:!1,paused:!1,delayInitialFocusTimer:void 0,recentNavEvent:void 0},s=function(e,t,n){return e&&void 0!==e[t]?e[t]:i[n||t]},c=function(e,t){var n="function"==typeof(null==t?void 0:t.composedPath)?t.composedPath():void 0;return a.containerGroups.findIndex((function(t){var r=t.container,o=t.tabbableNodes;return r.contains(e)||(null==n?void 0:n.includes(r))||o.find((function(t){return t===e}))}))},l=function(e){var t=i[e];if("function"==typeof t){for(var n=arguments.length,o=new Array(n>1?n-1:0),a=1;a<n;a++)o[a-1]=arguments[a];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 s=t;if("string"==typeof t&&!(s=r.querySelector(t)))throw new Error("`".concat(e,"` as selector refers to no known node"));return s},u=function(){var e=l("initialFocus");if(!1===e)return!1;if(void 0===e||!Ua(e,i.tabbableOptions))if(c(r.activeElement)>=0)e=r.activeElement;else{var t=a.tabbableGroups[0];e=t&&t.firstTabbableNode||l("fallbackFocus")}if(!e)throw new Error("Your focus-trap needs to have at least one focusable element");return e},d=function(){if(a.containerGroups=a.containers.map((function(e){var t=function(e,t){var n;return n=(t=t||{}).getShadowRoot?Ta([e],t.includeContainer,{filter:Pa.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:Ma}):Ea(e,t.includeContainer,Pa.bind(null,t)),Ra(n)}(e,i.tabbableOptions),n=function(e,t){return(t=t||{}).getShadowRoot?Ta([e],t.includeContainer,{filter:Aa.bind(null,t),flatten:!0,getShadowRoot:t.getShadowRoot}):Ea(e,t.includeContainer,Aa.bind(null,t))}(e,i.tabbableOptions),r=t.length>0?t[0]:void 0,o=t.length>0?t[t.length-1]:void 0,a=n.find((function(e){return Fa(e)})),s=n.slice().reverse().find((function(e){return Fa(e)})),c=!!t.find((function(e){return Ia(e)>0}));return{container:e,tabbableNodes:t,focusableNodes:n,posTabIndexesFound:c,firstTabbableNode:r,lastTabbableNode:o,firstDomTabbableNode:a,lastDomTabbableNode:s,nextTabbableNode:function(e){var r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],o=t.indexOf(e);return o<0?r?n.slice(n.indexOf(e)+1).find((function(e){return Fa(e)})):n.slice(0,n.indexOf(e)).reverse().find((function(e){return Fa(e)})):t[o+(r?1:-1)]}}})),a.tabbableGroups=a.containerGroups.filter((function(e){return e.tabbableNodes.length>0})),a.tabbableGroups.length<=0&&!l("fallbackFocus"))throw new Error("Your focus-trap must have at least one container with at least one tabbable node in it at all times");if(a.containerGroups.find((function(e){return e.posTabIndexesFound}))&&a.containerGroups.length>1)throw new Error("At least one node with a positive tabindex was found in one of your focus-trap's multiple containers. Positive tabindexes are only supported in single-container focus-traps.")},p=function e(t){var n=t.activeElement;if(n)return n.shadowRoot&&null!==n.shadowRoot.activeElement?e(n.shadowRoot):n},f=function e(t){!1!==t&&t!==p(document)&&(t&&t.focus?(t.focus({preventScroll:!!i.preventScroll}),a.mostRecentlyFocusedNode=t,function(e){return e.tagName&&"input"===e.tagName.toLowerCase()&&"function"==typeof e.select}(t)&&t.select()):e(u()))},h=function(e){var t=l("setReturnFocus",e);return t||!1!==t&&e},v=function(e){var t=e.target,n=e.event,r=e.isBackward,o=void 0!==r&&r;t=t||Wa(n),d();var s=null;if(a.tabbableGroups.length>0){var u=c(t,n),p=u>=0?a.containerGroups[u]:void 0;if(u<0)s=o?a.tabbableGroups[a.tabbableGroups.length-1].lastTabbableNode:a.tabbableGroups[0].firstTabbableNode;else if(o){var f=$a(a.tabbableGroups,(function(e){var n=e.firstTabbableNode;return t===n}));if(f<0&&(p.container===t||Ua(t,i.tabbableOptions)&&!Fa(t,i.tabbableOptions)&&!p.nextTabbableNode(t,!1))&&(f=u),f>=0){var h=0===f?a.tabbableGroups.length-1:f-1,v=a.tabbableGroups[h];s=Ia(t)>=0?v.lastTabbableNode:v.lastDomTabbableNode}else Ba(n)||(s=p.nextTabbableNode(t,!1))}else{var m=$a(a.tabbableGroups,(function(e){var n=e.lastTabbableNode;return t===n}));if(m<0&&(p.container===t||Ua(t,i.tabbableOptions)&&!Fa(t,i.tabbableOptions)&&!p.nextTabbableNode(t))&&(m=u),m>=0){var y=m===a.tabbableGroups.length-1?0:m+1,_=a.tabbableGroups[y];s=Ia(t)>=0?_.firstTabbableNode:_.firstDomTabbableNode}else Ba(n)||(s=p.nextTabbableNode(t))}}else s=l("fallbackFocus");return s},m=function(e){var t=Wa(e);c(t,e)>=0||(Ja(i.clickOutsideDeactivates,e)?n.deactivate({returnFocus:i.returnFocusOnDeactivate}):Ja(i.allowOutsideClick,e)||e.preventDefault())},y=function(e){var t=Wa(e),n=c(t,e)>=0;if(n||t instanceof Document)n&&(a.mostRecentlyFocusedNode=t);else{var r;e.stopImmediatePropagation();var o=!0;if(a.mostRecentlyFocusedNode)if(Ia(a.mostRecentlyFocusedNode)>0){var s=c(a.mostRecentlyFocusedNode),l=a.containerGroups[s].tabbableNodes;if(l.length>0){var d=l.findIndex((function(e){return e===a.mostRecentlyFocusedNode}));d>=0&&(i.isKeyForward(a.recentNavEvent)?d+1<l.length&&(r=l[d+1],o=!1):d-1>=0&&(r=l[d-1],o=!1))}}else a.containerGroups.some((function(e){return e.tabbableNodes.some((function(e){return Ia(e)>0}))}))||(o=!1);else o=!1;o&&(r=v({target:a.mostRecentlyFocusedNode,isBackward:i.isKeyBackward(a.recentNavEvent)})),f(r||a.mostRecentlyFocusedNode||u())}a.recentNavEvent=void 0},_=function(e){if(!(t=e,"Escape"!==(null==t?void 0:t.key)&&"Esc"!==(null==t?void 0:t.key)&&27!==(null==t?void 0:t.keyCode)||!1===Ja(i.escapeDeactivates,e)))return e.preventDefault(),void n.deactivate();var t;(i.isKeyForward(e)||i.isKeyBackward(e))&&function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];a.recentNavEvent=e;var n=v({event:e,isBackward:t});n&&(Ba(e)&&e.preventDefault(),f(n))}(e,i.isKeyBackward(e))},g=function(e){var t=Wa(e);c(t,e)>=0||Ja(i.clickOutsideDeactivates,e)||Ja(i.allowOutsideClick,e)||(e.preventDefault(),e.stopImmediatePropagation())},b=function(){if(a.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)}(o,n),a.delayInitialFocusTimer=i.delayInitialFocus?Ha((function(){f(u())})):f(u()),r.addEventListener("focusin",y,!0),r.addEventListener("mousedown",m,{capture:!0,passive:!1}),r.addEventListener("touchstart",m,{capture:!0,passive:!1}),r.addEventListener("click",g,{capture:!0,passive:!1}),r.addEventListener("keydown",_,{capture:!0,passive:!1}),n},w=function(){if(a.active)return r.removeEventListener("focusin",y,!0),r.removeEventListener("mousedown",m,!0),r.removeEventListener("touchstart",m,!0),r.removeEventListener("click",g,!0),r.removeEventListener("keydown",_,!0),n},x="undefined"!=typeof window&&"MutationObserver"in window?new MutationObserver((function(e){e.some((function(e){return Array.from(e.removedNodes).some((function(e){return e===a.mostRecentlyFocusedNode}))}))&&f(u())})):void 0,C=function(){x&&(x.disconnect(),a.active&&!a.paused&&a.containers.map((function(e){x.observe(e,{subtree:!0,childList:!0})})))};return n={get active(){return a.active},get paused(){return a.paused},activate:function(e){if(a.active)return this;var t=s(e,"onActivate"),n=s(e,"onPostActivate"),o=s(e,"checkCanFocusTrap");o||d(),a.active=!0,a.paused=!1,a.nodeFocusedBeforeActivation=r.activeElement,null==t||t();var i=function(){o&&d(),b(),C(),null==n||n()};return o?(o(a.containers.concat()).then(i,i),this):(i(),this)},deactivate:function(e){if(!a.active)return this;var t=za({onDeactivate:i.onDeactivate,onPostDeactivate:i.onPostDeactivate,checkCanReturnFocus:i.checkCanReturnFocus},e);clearTimeout(a.delayInitialFocusTimer),a.delayInitialFocusTimer=void 0,w(),a.active=!1,a.paused=!1,C(),function(e,t){var n=e.indexOf(t);-1!==n&&e.splice(n,1),e.length>0&&e[e.length-1].unpause()}(o,n);var r=s(t,"onDeactivate"),c=s(t,"onPostDeactivate"),l=s(t,"checkCanReturnFocus"),u=s(t,"returnFocus","returnFocusOnDeactivate");null==r||r();var d=function(){Ha((function(){u&&f(h(a.nodeFocusedBeforeActivation)),null==c||c()}))};return u&&l?(l(h(a.nodeFocusedBeforeActivation)).then(d,d),this):(d(),this)},pause:function(e){if(a.paused||!a.active)return this;var t=s(e,"onPause"),n=s(e,"onPostPause");return a.paused=!0,null==t||t(),w(),C(),null==n||n(),this},unpause:function(e){if(!a.paused||!a.active)return this;var t=s(e,"onUnpause"),n=s(e,"onPostUnpause");return a.paused=!1,null==t||t(),d(),b(),C(),null==n||n(),this},updateContainerElements:function(e){var t=[].concat(e).filter(Boolean);return a.containers=t.map((function(e){return"string"==typeof e?r.querySelector(e):e})),a.active&&d(),C(),this}},n.updateContainerElements(e),n},Xa=({children:e,onClose:t,fallBackFocusRef:n,"aria-label":r,"aria-labelledby":i})=>{const a=Ji(),s=(0,Bo.li)(null),c=(0,Bo.li)(null),[l,u]=(0,Bo.J0)(!1);return(0,Bo.vJ)((()=>(l&&s.current&&(c.current=Ga(s.current,{initialFocus:n.current||void 0}),c.current.activate()),()=>{c.current&&c.current.deactivate()})),[l,n]),(0,Bo.vJ)((()=>{const e=(()=>{const e=[],t=[];return document.querySelectorAll('body > *:not([role="dialog"])').forEach((n=>{const r=n.getAttribute("aria-hidden");null!==r&&"false"!==r||(null!==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()}}),[l]),(0,Bo.vJ)((()=>{l&&s.current&&s.current.addEventListener("keydown",(e=>{(e.code&&"Escape"===e.code||27===e.keyCode)&&t()}))}),[l,t]),(0,Bo.Nf)((()=>{const e=document.getElementsByTagName("body")[0],t=document.createElement("div");return t.setAttribute("id",a),t.setAttribute("role","dialog"),t.setAttribute("data-nosnippet","true"),t.setAttribute("aria-modal","true"),r&&t.setAttribute("aria-label",r),i&&t.setAttribute("aria-labelledby",i),e.appendChild(t),s.current=t,u(!0),()=>{s.current&&(e.removeChild(s.current),s.current=null)}}),[r,i,a]),"function"==typeof e?e({onClose:t,modalRenderFn:e=>s.current&&(0,o.XX)(e,s.current)}):s.current&&(0,o.XX)((0,o.v2)(e).filter(wn).map((e=>(e.props={...e.props,onClose:t},e))),s.current)},Ya=({url:e,description:t,onClose:n})=>{const r=un(),o=Ki(),i=Mi(),a=(0,Bo.li)(null),{t:s}=ni(),c=["modal",`app--layout-${r.layoutMode}`,`namespace--${r.namespace}`];"function"!=typeof i?c.push(...i):c.push(...i(r));const l=e=>{e.stopPropagation()},u=()=>{n()},d=r?.zIndex?{zIndex:r.zIndex+1}:void 0;return bi(Xa,{onClose:n,"aria-label":s("lightbox.heading"),fallBackFocusRef:a,children:({onClose:n,modalRenderFn:r})=>r((n=>bi("div",{className:Pi(c),onClick:u,style:d,children:bi("div",{className:Pi("modal__float"),tabIndex:-1,onMouseDown:o,onKeyDown:o,onTouchStart:o,onMouseMove:o,onWheel:o,onPointerDown:o,onPointerMove:o,ref:a,children:[bi("div",{className:Pi("modal__inner"),onClick:l,children:bi("img",{className:Pi("modal__image"),src:e,alt:t})}),bi("button",{type:"button",className:Pi("modal__close"),onClick:n,children:[bi(Zi,{name:"close",size:"16",alt:""}),s("lightbox.closeLabel")]})]})}))(n))})},Qa=({description:e,url:t})=>{const{t:n}=ni(),[r,i]=(0,Bo.J0)(!1);return bi(o.FK,{children:[bi("button",{type:"button",className:Pi("modal__enlarge"),onClick:()=>{i(!0)},children:[n("message.image.srTextEnlargeButtonLabel",{description:e}),bi(Zi,{name:"enlarge",size:"32",alt:""})]}),r&&bi(Ya,{url:t,description:e,onClose:()=>{i(!1)}})]})},Za=({event:e,...t})=>{const{body:n}=Oi(e),r=pa({originMessage:e.payload.id,transactionId:e.payload.transactionId}),o=(0,Bo.Kr)((()=>e.payload.optimisticallyInjected?{children:bi("p",{children:n?.text})}:{bodyProps:{dangerouslySetInnerHTML:{__html:n?.text||""}}}),[n,e]);return bi(Gi,{type:"text",event:e,onClick:r,...t,...o})};const es="PROCESSING_IMAGE",ts=({img:e,filename:t})=>{const{t:n}=ni(),r=n("fileUpload.srFileUploadedText",{fileName:t});return bi(o.FK,{children:bi("span",{className:Pi(["download","download--preview"]),children:[bi("img",{src:e,alt:r}),bi("span",{"aria-hidden":"true",className:Pi("file-download"),children:t})]})})},ns=({children:e,url:t,target:n})=>t?bi("a",{href:t,download:!0,target:n,className:Pi(["download","download-link"]),children:e}):bi("span",{className:Pi("download"),children:e});const rs={message:{choice_prompt:({event:e,children:t,...n})=>{const{t:r}=ni(),i=Ji(),{body:a,subEvent:s,showOptions:c,chooseAgain:l,onChoiceClickHandler:u,onChooseAgainClickHandler:d}=ca(e);return bi(o.FK,{children:[(0,o.v2)(t).filter(wn).map((e=>(e.props={...e.props,event:s,descriptorId:i,showTranslationToggle:!1},e))),l&&bi("button",{type:"button",className:Pi("button","button--secondary","button--choose-again"),"aria-expanded":c?"true":"false",onClick:d,"aria-describedby":i,children:[r(c?"message.choicePrompts.cancelChooseAgain":"message.choicePrompts.chooseAgain"),bi(Zi,{name:"chevronDown",size:"8",alt:""})]}),c&&bi(Gi,{type:"choice-prompt",showParticipant:!1,event:e,...n,children:bi("ul",{className:Pi("choice-prompt","choice-prompt--many"),children:a?.choices?.map((e=>bi("li",{className:Pi("choice-prompt__item",{[`choice-prompt__item--${e?.category}`]:!!e.category}),children:bi("button",{type:"button",className:Pi("button","button--primary"),onClick:()=>{u(e)},children:e.text})},e.id)))})})]})},text:Za,image:({event:e,descriptorId:t,...n})=>{const{body:r}=Oi(e),[o,i]=(0,Bo.J0)(!1),a=zo();return bi(Gi,{event:e,type:"image",...n,children:[bi("img",{src:r?.url,id:t,alt:r?.description||void 0,onLoad:()=>{a(ao(e.payload.id)),i(!0)}}),r?.isZoomable&&o&&bi(Qa,{description:r?.description,url:r?.url})]})},splash:({event:e,...t})=>{const{payload:n}=e,{body:r}=Oi(e),o=pa({originMessage:n.id,transactionId:n.transactionId});return bi(Gi,{type:"splash",event:e,onClick:o,...t,bodyProps:{dangerouslySetInnerHTML:{__html:r?.text||""}}})},video:({event:e,descriptorId:t,...n})=>{const{body:r}=Oi(e);return Ri(e).push("message--type-video"),bi(Gi,{event:e,type:"video",...n,children:[bi("div",{id:t,className:Pi("visually-hidden"),children:r?.description}),bi("iframe",{title:r?.description||"",src:r?.url,allow:"autoplay; encrypted-media",allowFullScreen:!0})]})},upload:({event:e,...t})=>{const{t:n}=ni(),{body:r}=Oi(e),{fromClient:o,id:i}=e.payload,{filename:a,url:s}=r,c=(e=>{const{processingFileUploads:t}=Qt((({state:e})=>e));return(0,Bo.Kr)((()=>{if(t.some((t=>t===e)))return es;try{return sessionStorage.getItem(`image-${e}`)}catch(e){return}}),[e,t])})(i),l=(0,Bo.Kr)((()=>n(s?"fileUpload.srFileDownloadText":"fileUpload.srFileUploadedText",{fileName:a})),[s,a,n]);return bi(Gi,{event:e,type:"upload",...t,children:c&&c!==es?bi(ts,{img:c,filename:a}):bi(ns,{url:s,target:o?void 0:"_blank",children:[bi(Zi,{name:"download",size:"16",alt:l}),bi("span",{"aria-hidden":"true",className:Pi("file-download"),children:a})]})})},cta:({event:e})=>{const{body:t}=Oi(e),n=pa({originMessage:e.payload.id,transactionId:e.payload.transactionId}),{emitEvent:r}=fi(),o=Ji(),i=(0,Bo.hb)((()=>r(`action.${F}`,{type:F,originMessage:e.payload.id,link:{url:t?.buttonLink}})),[r,t,e]);return bi(Gi,{type:"cta",event:e,children:[bi("div",{className:Pi("cta__content"),id:o,dangerouslySetInnerHTML:t?.description?{__html:t.description}:void 0,onClick:n}),bi("a",{className:Pi("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}=Oi(e),n=t.cards;return bi(Gi,{event:e,modifiers:"type-carousel",children:bi(ia,{items:n,getItemKey:aa,getItemLabel:sa})})},card:({event:e})=>{const{body:t}=Oi(e),n=Ji();return bi(Gi,{type:"card",event:e,children:bi(Xi,{id:n,...t})})}},info:{text:Za,divider:({event:e,...t})=>bi(va[V[e.payload.body.subtype]]||va.default,{event:e,...t}),translation:({event:e,...t})=>{const{t:n}=ni(),{body:r}=Oi(e);return bi(Gi,{type:"text",event:e,...t,children:n(r.key.join("."),r.variables)})},timeIndicator:_a},participant:{participant:({event:e})=>{const{participant:t}=e.payload,{body:n}=(e=>{const{translatedBody:t,translation:n,body:r}={body:e.payload?.participant?.introduction,translatedBody:e.payload?.participant?.translatedIntroduction,translation:e.payload?.participant?.translation},o=!!t,i=Qt(Ni(e));return{body:i&&o?t:r,hasTranslation:o,isTranslated:i&&o,userLocale:n?.locale}})(e);return n?bi(fa,{graphicSrc:t?.avatar,graphicType:t?.avatar?"avatar":void 0,iconName:t?.avatar?void 0:"balloon",dividerType:"participant",title:n}):null}},service_data:{suggestion:({event:e,...t})=>{const[n,r]=(0,Bo.J0)(!0),o=zo(),i=ii(),{sendAction:a,addMessageBubble:s}=fi(),{suggestions:c,payload:l}=(e=>{const{payload:t}=e,{body:n}=Oi(e);return{suggestions:n,payload:t}})(e),{showSuggestions:u}=un(),d=Tn(),{t:p}=ni(),f=p("suggestions.headingText"),h=p("suggestions.footerText"),v=(0,Bo.Kr)((()=>d.some((({payload:e,type:t})=>"message"===t&&e?.transactionLast))),[d]),m=(0,Bo.hb)((({id:e,question:t})=>{r(!1),o(tr(!0));const n=$();a({type:k,originMessage:l.id,body:{type:"faqclick",body:{faqId:e,faqQuestion:t}},transactionId:n}),s(t,n)}),[o,a,l.id,s]);return n&&!i&&v&&u?bi("div",{className:Pi("suggestions","suggestions--conversation"),children:[f&&bi("p",{className:Pi("suggestions__heading"),children:f}),bi(Gi,{type:"suggestions",showParticipant:!1,event:e,...t,children:[bi(da,{className:"suggestions__list--conversation",onClickSuggestion:m,suggestions:c}),h&&bi("p",{className:Pi("suggestions__footer"),children:h})]})]}):null}}};var os=({children:e})=>{const{customComponents:t}=un(),n=(0,Bo.Kr)((()=>Object.keys(rs).reduce(((e,n)=>(e[n]={...rs[n],...t?t[n]:{}},e)),{fallback:Za})),[t]);return bi(xi.Provider,{value:n,children:e})},is=({children:e})=>{const{isMinimized:t}=ri(),n=(0,Bo.li)(0),{sendAction:r}=fi(),{hasCountdown:o,isActive:i,stopCountdown:a}=Hi(),s=(0,Bo.hb)((()=>{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 bi("div",{className:Pi("activity-monitor"),tabIndex:-1,onMouseDown:s,onKeyUp:s,onTouchStart:s,onMouseMove:s,onWheel:s,onPointerDown:s,onPointerMove:s,children:bi(Vi.Provider,{value:s,children:e})})};const as=["text","choice_prompt","image","video"];var ss=()=>{const e=Fi(),t=(0,Bo.li)(),n=(0,Bo.li)(),r=zo(),o=li(),i=(0,Bo.li)(null),{initCountdown:a,endCountdown:s}=Hi(),{emitEvent:c}=fi();return(0,Bo.vJ)((()=>{e.socket&&(e.onConnection((({currentState:e})=>{if("attach_channel_erred"===e){const e=new b;return r(Tr({name:e.name,message:e.message,langKey:e.langKey,originalEvent:e.originalEvent,originalError:e.originalError,action:e.action})),!0}return!1})),e.onError((e=>{const t=new rr(e);r(Tr({name:t.name,message:t.message,langKey:t.langKey,originalEvent:t.originalEvent,originalError:t.originalError})),r(jr())})),e.onOpen((()=>{r(Nr())})))}),[e,e.socket,r]),(0,Bo.vJ)((()=>{e.onConnection((({connected:t})=>!!t&&(n.current&&e?.removeListener("message",n.current),n.current=e=>{switch(e.type){case"ui":switch(e.payload.type){case"idle_detach_countdown":"idle_detach_countdown"===e.payload.body.type&&a(e.payload.body.duration);break;case"loading":r(io(e.payload.body.loading));break;case"idle_detach_countdown_elapsed":s(void 0,!0);break;case"resume_conversation_prompt":r(Jr());break;case"user_first_response":r(tr(!0)),c("system.userFirstResponse",e.payload.body);break;case"translation_proposal":r(Po(e.payload.body))}break;case"service_attach":const{service:{name:t,settings:{proactiveMessages:{enabled:n},entry:o},sessionId:i}}=e.payload;r(Co(n||!1)),t&&c("system.serviceChanged",t),i&&r(Gr(i)),r(uo(o)),r(Zr({uploads:o.options.upload,text:o.options.text}));break;case"context":e.payload.contentLocale&&e.payload.userLocale&&r(yr(e.payload.userLocale));break;case"message":switch(e.payload.type){case"text":case"choice_prompt":case"splash":case"image":case"upload":case"video":case"cta":case"custom":case"carousel":case"card":if(e.payload.service&&e.payload.service.serviceSessionId&&r(Gr(e.payload.service.serviceSessionId)),e.payload.fromClient){r(Dr(e));break}r(Fr(e))}break;case"participant":(e=>{const{payload:t}=e;if(!t||!t.participant)return;const{fromClient:n,participant:o}=t;!n&&"string"!=typeof o&&o?.name&&r(to(o.name)),r(so(t)),"string"!=typeof o&&o.introduction&&r(Fr({...e,payload:{...t,type:"participant"}}))})(e);break;case"service_data":e.payload.persist&&r(lo(e.payload));break;case"info":"divider"!==e.payload.type&&"text"!==e.payload.type&&"translation"!==e.payload.type||r(Fr({type:"info",payload:{...e.payload,participant:null}}));break;case"error":switch(e.payload.type){case"find_conversation":const t=new w(e);r(Tr({name:t.name,action:t.action,message:t.message,originalEvent:t.originalEvent,originalError:t.originalError}));break;case"conversation":const n=new b(e);r(Tr({name:n.name,message:n.message,langKey:n.langKey,originalEvent:n.originalEvent,originalError:n.originalError,action:n.action}))}}return e},e.onMessage(n.current),!0)))}),[e,r,c,s,o,a]),(0,Bo.vJ)((()=>{e.onConnection((({connected:n})=>!!n&&(t.current&&e.removeListener("message",t.current),t.current=async({payload:e})=>{if("history_changed"===e?.type)try{const t=await r(Cr(e)).unwrap();t&&"service"in t&&r(ro(t))}catch(e){}return as.includes(e?.type)?(e.id!==i.current&&o.emit("message",e),i.current=e.id,e):e},e.addListener("message",t.current),!0)))}),[e,r,o]),null},cs=({children:e})=>{const{t:t}=ni(),n=zo(),r=ui(),{addUploadBubble:o}=fi(),i=(0,Bo.hb)((async(e,t)=>{n(mo(t));const r=await(e=>new Promise(((t,n)=>{const r=new FileReader;r.readAsDataURL(e),r.onload=()=>{"string"==typeof r.result&&t(r.result)},r.onerror=e=>n(e)})))(e),o=new Image;o.src=r,await o.decode();const i=(e=>{const t=document.createElement("canvas"),n=t.getContext("2d"),[r,o]=(e=>{const{height:t,width:n}=e;return n>t&&n>600?[600,600*t/n]:t>600?[600*n/t,600]:[n,t]})(e);return t.width=r,t.height=o,n?.drawImage(e,0,0,r,o),t.toDataURL()})(o);try{sessionStorage.setItem(`image-${t}`,i)}catch(e){}finally{n(yo(t))}}),[n]),a=(0,Bo.hb)((e=>{const a=$(),s=r.uploadFile(e,(e=>{n(vo({fileId:a,progress:Math.ceil(e)}))}),(async t=>{const{id:r,transactionId:s,occurredAt:c,body:{contentType:l,filename:u,filesize:d}}=t;n(fo(a)),o(r,s,c,l,u,d),await i(e,r)}),(e=>{let r;switch(e?.error||""){case"file_uploads_are_disabled":r=t("fileUpload.errors.unavailable");break;case"request_entity_too_large":r=t("fileUpload.errors.tooLarge");break;case"file_has_invalid_mime_type":r=t("fileUpload.errors.wrongType");break;case"virus_found":r=t("fileUpload.errors.virusFound");break;default:r=t("fileUpload.errors.general")}n(ho({fileId:a,errorText:r}))}));n(Wr({fileId:a,fileName:e.name,uploadHandle:s}))}),[i,o,r,n,t]);return bi(Di.Provider,{value:a,children:e})},ls=()=>{const{hasCountdown:e,isActive:t,remaining:n,decrementCountdown:r}=Hi();return((e,t)=>{const n=(0,Bo.li)(e);(0,Bo.vJ)((()=>{n.current=e}),[e]),(0,Bo.vJ)((()=>{if(null!==t){const e=setInterval((function(){n.current()}),t);return()=>clearInterval(e)}}),[t])})((()=>{r()}),e&&t&&n&&n>0?1e3:null),null},us=()=>{const{initUserSelectedOptions:e}=zi(),t=(0,Bo.li)(!1),n=un();return(0,Bo.vJ)((()=>{n.api&&!t.current&&(t.current=!0,e())}),[e,n]),null};function ds(e,t,n=[]){const r=li(),o=(0,Bo.li)(t);(0,Bo.vJ)((()=>{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])}var ps=()=>{const e=un(),{sendMessage:t,sendContext:n,sendAction:r}=fi(),o=zo(),{setVisibility:i,visible:a}=ri(),s=(0,Bo.li)(a),c=li(),l=ui(),u=In(),d=(0,Bo.li)(null),p=(0,Bo.li)(null),{isInline:f,isResolving:h}=Mn(),v=Qt(mi),m=(()=>{const{get:e}=di();return e?e("conversationUrl"):null})(),y=(0,Bo.li)(null),_=Ki(),{enableTranslations:g,disableTranslations:b}=Ii();return(0,Bo.vJ)((()=>{s.current=a}),[a]),ds("askText",(e=>{t({body:e})}),[l.send]),ds("setVariables",(e=>{n({variables:e})}),[l.send]),ds("getVisibility",(e=>{e?e(s.current):console.warn("A callback function is required for the getVisibility action.")})),ds("setVisibility",(e=>{const t="string"==typeof e||null===e?e:e.visibility;Object.values(Dt).includes(t)?(_(),i(e)):console.error('Requested visibility states should be "open", "minimized" ,"hidden" or null.')}),[e.api]),ds("sendCustomAction",((e,t)=>{r({type:"custom",body:{type:e,body:t}})}),[l.send]),ds("setTopic",(({name:e,fallbackMessage:t,message:n,userTriggered:i})=>{i&&o(Xn({showSuggestions:!1})),e&&t?r({type:R,body:{name:e,fallbackMessage:t,message:n}}):console.warn("A name and a fallbackMessage are required for the setTopic action.")}),[l.send]),ds("setContext",(e=>{n(e)}),[l.send]),ds("setTranslation",(({enabled:e,locale:t})=>{e?g(t,j):b()}),[l.send]),(0,Bo.vJ)((()=>{h||v||(y.current&&y.current!==m&&c.emit("unreadMessageCount",u),a===Dt.open&&a!==p.current&&0!==d.current&&c.emit("unreadMessageCount",0),a!==Dt.open&&u!==d.current&&c.emit("unreadMessageCount",u),p.current=a,d.current=u,"string"==typeof m&&(y.current=m))}),[u,a,c,f,h,v,m]),null},fs=({children:e})=>{const t=li(),n=(0,Bo.li)(null),[r,o]=(0,Bo.J0)(),i=(0,Bo.li)(!0),a=(0,Bo.hb)((e=>{i.current&&(o(e),t.emit("aria-live",e))}),[o,t]);return(0,Bo.vJ)((()=>(n.current=null,r?.messageText&&(n.current=setTimeout((()=>{a({}),n.current&&clearTimeout(n.current)}),600)),()=>{n.current&&clearTimeout(n.current)})),[r,a]),(0,Bo.vJ)((()=>()=>{i.current=!1}),[]),bi(ci.Provider,{value:a,children:[e,bi("div",{className:Pi("app__live-container"),children:[bi("div",{"aria-live":"assertive","aria-atomic":"true",className:Pi("visually-hidden"),children:r?.ariaLive===z?r?.messageText:null}),bi("div",{"aria-live":"polite","aria-atomic":"true",className:Pi("visually-hidden"),children:r?.ariaLive===B?r?.messageText:null})]})]})},hs=()=>{const{t:e}=ni(),t=Tn(),n=(0,Bo.li)(0),r=(0,Bo.li)(0),o=Cn().historyLoaded,{sendPolite:i}=hi(),{isOpen:a}=ri(),s=(0,Bo.li)(null),c=(0,Bo.li)(null),l=(0,Bo.Kr)((()=>pn((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,Bo.vJ)((()=>{t.length>n.current&&(a&&(c.current=l(t)),n.current=t.length)}),[t,l,a]),(0,Bo.vJ)((()=>{s.current&&!a&&c.current&&(c.current(!0),c.current=null)}),[a]),(0,Bo.vJ)((()=>{o&&setTimeout((()=>{i(e("window.srTexts.onHistoryLoad"))}),500)}),[o,e,i]),null},vs=()=>{const{t:e}=ni(),{isOpen:t,isVisible:n}=ri(),r=In(),{sendPolite:o}=hi(),i=(0,Bo.Kr)((()=>pn(o,2e3)),[o]),a=(0,Bo.li)(null),s=(0,Bo.li)(null);return(0,Bo.vJ)((()=>{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},ms=({store:e,children:t,eventBus:n,api:r})=>((0,Bo.Md)((t=>{console.error(t),e.dispatch(ir(t))})),bi(rn,{store:e,children:bi(si.Provider,{value:n,children:bi(ai.Provider,{value:r,children:bi(fs,{children:bi(wi,{children:bi(os,{children:[bi(us,{}),bi(ss,{}),bi(vs,{}),bi(hs,{}),bi(ls,{}),bi(is,{children:[bi(ps,{}),bi(cs,{children:t})]})]})})})})})}));const ys=Pt(En,(e=>e.filter((e=>kr(e)&&"service_data"!==e.type&&e.payload?.messageStatus===I)))),_s=Pt([ys],(e=>e.filter((e=>"participant"!==e.type)).at(-1))),gs=Pt(ys,(e=>e.filter((({payload:e})=>e?.id)).map((({payload:e})=>e.id)))),bs=Pt((({state:e})=>e.options.features?.webNotifications),(e=>e?.enabled));var ws=()=>{const{t:e}=ni(),{showDisclaimer:t}=un();return t?bi("div",{className:Pi("disclaimer"),tabIndex:0,children:[bi("h2",{className:Pi("disclaimer__title"),children:e("disclaimer.title")}),bi("div",{className:Pi("disclaimer__message"),dangerouslySetInnerHTML:{__html:e("disclaimer.content")}})]}):null};const xs=Pt([({forms:e})=>e,(e,{formId:t})=>t],((e,t)=>e[t])),Cs=Pt(xs,(e=>e?.controls||{})),Ss=Pt(Cs,(e=>{const t={};return Object.entries(e).forEach((([e,{value:n}])=>{t[e]=n})),t})),Es=Pt([Cs,(e,{name:t})=>t],((e,t)=>e[t]?.value)),Ts=Pt([Cs,(e,{name:t})=>t],((e,t)=>e[t]?.touched)),Ns=(0,o.q6)({handleSubmit:()=>{},isSubmitted:!1,isValid:!1,updateControlValue:()=>{},updateControlTouched:()=>{},errors:void 0}),{Provider:Is,Consumer:Os}=Ns;var ks=Ns;function Ls(){return(0,Bo.NT)(ks)}function As(e){const t=zo(),{formId:n,updateControlValue:r,updateControlTouched:o,errors:i}=Ls(),a=!!Qt((e=>xs(e,{formId:n}))),s=Qt((t=>Es(t,{formId:n,name:e}))),c=Qt((t=>Ts(t,{formId:n,name:e}))),l=i?.[e],u=!l;(0,Bo.vJ)((()=>{a&&t(pr({formId:n,name:e}))}),[a,n,e,t]),(0,Bo.Nf)((()=>()=>{t(fr({formId:n,name:e}))}),[a,n,e,t]);const d=(0,Bo.hb)((t=>r(e,t.target.value)),[e,r]),p=(0,Bo.hb)((()=>{o(e,!0)}),[o,e]);return[(0,Bo.Kr)((()=>({name:e,onInput:d,onBlur:p,value:s})),[e,d,p,s]),(0,Bo.Kr)((()=>({isValid:u,error:l,touched:c})),[u,l,c])]}function Ps(e){const{t:t}=ni(),{sendAssertive:n}=hi(),{hasLimit:r,limit:o}=Pn(),i=(0,Bo.Kr)((()=>pn(n,$n)),[n]),a=(0,Bo.Kr)((()=>pn(((e,n)=>{e&&i(t("input.srCharacterLimitText",{limit:n}))}),$n)),[i,t]),[{value:s}]=As(e),c=o&&r&&s?o-s.length:o,l=!(!r||!c)&&c<=Hn,u=!(!r||!c)&&c<0;return(0,Bo.vJ)((()=>{a(l,c)}),[l,c,a]),{hasCharacterLimit:r,characterLimit:o,reachedCharacterWarning:l,reachedCharacterLimit:u,remainingChars:c}}const Ms=e=>{const{hasCharacterLimit:t,characterLimit:n}=Ps(e),{entryMeta:{optionsOverride:r}}=Cn(),{t:o}=ni();return{placeholder:(0,Bo.Kr)((()=>o("input.inputPlaceholder",{hasLimit:t,text:r?.text?.placeholder||o("input.inputPlaceholderText"),limit:t?n:null})),[o,t,n,r?.text?.placeholder]),label:(0,Bo.Kr)((()=>o("input.inputLabel",{hasLimit:!r?.text?.label&&t,text:r?.text?.label||o("input.inputLabelText"),limit:!r?.text?.label&&t?n:null})),[o,t,n,r?.text?.label]),labelClass:(0,Bo.Kr)((()=>r?.text?.label?"label":"visually-hidden"),[r?.text?.label])}};function Rs(){const{abortTransaction:e,clearEntryAbortTransaction:t}=(()=>{const e=zo(),{entryMeta:{actions:t,translatedActions:n}}=Cn();return{abortTransaction:n?.abortTransaction||t?.abortTransaction,clearEntryAbortTransaction:()=>{e(po())}}})(),n=ui();return e?bi("li",{className:Pi(["cvco-conversation__item","cvco-conversation__item--abort-transaction"]),children:bi("button",{className:Pi(["button","button--secondary","abort-transaction__button"]),type:"button",onClick:()=>{n.send("action",{type:R,body:{name:e.topicName,fallbackMessage:e.topicFallbackMessage}}),t()},children:e.label})}):null}const Fs=(0,o.q6)(null),Ds=()=>{const e=(0,Bo.NT)(Fs);if(!e)throw new Error("useChatScrollContext has to be used within <ChatScrollContext.Provider>");return e};var Us=Fs,js=e=>{const t=(()=>{const e=(0,Bo.NT)(xi);if(!e)throw new Error("useComponentContext has to be used within <ComponentContext.Provider>");return e})(),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]},zs=({event:e,newParticipant:t})=>{const{eventRefs:n,unreadIds:r}=Ds(),{sendAction:o}=fi(),i=e.payload.id?n[e.payload.id]:void 0,{containerRef:a,isVisible:s}=oi({containerRef:i,freezeOnceVisible:!0}),c=zo(),[l,u]=js(e);if((0,zt.useEffect)((()=>{if(s&&r?.includes(e.payload.id)){const t=r.reduce(((t,n)=>e?.payload?.id&&n&&!t.includes(e.payload.id)?t.concat(n):t),[]);c(Yr(t)),o({type:A,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"),bi("li",{className:Pi(d),ref:a,children:[e.payload.timeIndicator&&bi(_a,{event:e}),bi(l,{event:e,children:bi(u,{event:e})})]})},Bs=()=>{const{id:e}=An()||{};return bi("li",{className:Pi("conversation__item","conversation__item--source-agent"),children:bi("div",{className:Pi("message","message--source-agent","message--type-loading"),children:[bi(qi,{eventPayload:{fromClient:!1,participant:e}}),bi("div",{className:Pi("message__body"),children:bi("span",{className:Pi("loader"),children:[bi("span",{className:Pi("loader__part","one")}),bi("span",{className:Pi("loader__part","two")}),bi("span",{className:Pi("loader__part","three")}),bi("span",{className:Pi("loader__part","four")})]})})]})})};const Vs=()=>{const e=Tn();let t;return bi(o.FK,{children:e.map((e=>{const{type:n,payload:r}=e;let o=!1;if("info"===n||"message"===n){const{participant:n,fromClient:i}=r,a=i?"seamly-client-participant":n;"info"!==e.type&&t!==a&&(o=!0),t=a}return bi(zs,{event:e,newParticipant:o},e.payload.key||e.payload.id)}))})};var Ks=()=>{const{t:e}=ni(),t=Nn(),n=((e,t=20)=>{const[n,r]=(0,Bo.J0)(e),o=(0,Bo.li)(null);return(0,Bo.vJ)((()=>(o.current=setTimeout((()=>r(e)),t),()=>{o.current&&clearTimeout(o.current)})),[e,t]),n})(t,t?0:20),{isOpen:r}=ri(),i=On(),a=Ti();return bi(o.FK,{children:[r&&bi("a",{className:Pi("skip-link"),href:`#${i}`,onClick:e=>{e.preventDefault(),a()},children:e("skiplinkText")}),bi("div",{className:Pi("chat__body"),children:bi("div",{className:Pi("conversation__container"),children:[bi(ws,{}),bi("ol",{className:Pi("conversation"),children:[bi(os,{children:bi(Vs,{})}),n?bi(Bs,{}):null,bi(Rs,{})]})]})})]})};function Hs(e,t){const n=(0,Bo.li)(null),r=(0,Bo.li)(e);return(0,Bo.vJ)((()=>{r.current=e}),[e]),(0,Bo.vJ)((()=>"number"!=typeof t?()=>{}:(n.current=setTimeout((()=>r.current()),t),()=>{n.current&&clearTimeout(n.current)})),[t]),n}const $s={visible:Pi("transition--visible"),in:Pi("transition--in"),visuallyHidden:Pi("visually-hidden")},Js=Object.values($s),Ws=e=>{const t=(0,Bo.li)(null);t.current=e;const n="function"==typeof e;return(0,Bo.Kr)((()=>n?(...e)=>t.current(...e):void 0),[n])},qs={notRendered:"notRendered",rendered:"rendered",visuallyHidden:"visuallyHidden"};var Gs=({children:e,isActive:t,timeout:n=300,transitionStartState:r=qs.notRendered,onInTransitionComplete:i=()=>{},onOutTransitionComplete:a=()=>{},exitAfter:s,enterDelay:c=0})=>{const l=(0,Bo.li)(!1),u=(0,Bo.li)(null),d=(0,Bo.li)(null),p=r===qs.visuallyHidden,[f,h]=(0,Bo.J0)((()=>p?[$s.visuallyHidden]:[])),[v,m]=(0,Bo.J0)((()=>0===c)),y=(0,Bo.Kr)((()=>s?s+c:s),[c,s]);Hs((()=>m(!1)),t?y:void 0),Hs((()=>m(!0)),t?c:void 0);const _=(0,Bo.Kr)((()=>v&&t),[t,v]),g=Ws(i),b=Ws(a),w="notRendered"!==r||f.length>0;return(0,Bo.vJ)((()=>(l.current&&!_&&(h([$s.visible]),u.current=setTimeout((()=>{h([...p?[$s.visuallyHidden]:[]]),b&&(d.current=requestAnimationFrame((()=>{b()})))}),n)),!l.current&&_&&(h([$s.visible]),d.current=requestAnimationFrame((()=>{d.current=requestAnimationFrame((()=>{h([$s.visible,$s.in]),g&&(u.current=setTimeout((()=>{g()}),n))}))}))),l.current=_,()=>{u.current&&clearTimeout(u.current),d.current&&cancelAnimationFrame(d.current)})),[p,g,b,n,_]),bi(o.FK,{children:w&&(0,o.v2)(e).filter(wn).map((e=>{const{className:t=""}=e.props,n=t.split(" ").filter((e=>!Js.includes(e)));return(0,o.Ob)(e,{className:[...n,...f].join(" ")})}))})},Xs=({isAside:e=!1})=>{const{isInline:t}=Mn(),{t:n}=ni(),{sendAction:r,addMessageBubble:o}=fi(),{isOpen:i,setVisibility:a}=ri(),{showSuggestions:s}=un(),c=Ji(),l=Ti(),u=(0,Bo.li)(null),{sendPolite:d}=hi(),p=Qt(mi),{hasCountdown:f,endCountdown:h}=Hi(),{hasPrompt:v,continueChat:m}=$i(),y=ii(),_=Cn().serviceData.suggestion;const{body:g}=Oi({payload:_,type:"service_data"}),b=(0,Bo.Kr)((()=>p?[]:Array.isArray(g)?g:[]),[g,p]),w=(0,Bo.li)(),x=(0,Bo.li)(!1),C=(0,Bo.li)(),S=!!b?.length,E=t?(y||i)&&!e:y,T=(0,Bo.li)(E),N=S&&!E&&s,I=S?b:C.current;C.current=I;const O=(0,Bo.Kr)((()=>{const t=["suggestions"];return e&&t.push("suggestions--aside"),Pi(t)}),[e]),L=(0,Bo.hb)((({id:e,question:t})=>{f&&h(!0),v&&m();const n=$();r({type:k,originMessage:_.id,body:{type:"faqclick",body:{faqId:e,faqQuestion:t}},transactionId:n}),o(t,n),i||a({visibility:Dt.open}),l()}),[o,m,h,l,f,v,_,r,a,i]);(0,Bo.vJ)((()=>{if(w.current!==b&&!E){if(S){const e=x.current?n("suggestions.srUpdatedText"):n("suggestions.srAvailableText");setTimeout((()=>{d(e)}),30)}else x.current&&d(n("suggestions.srUnavailableText"));w.current=b}!T.current&&E?(bn(u.current,l),d(n("suggestions.srUnavailableText"))):!S&&x.current&&bn(u.current,l),x.current=S,T.current=E}),[b,S,E,l,d,n]);const A=n("suggestions.headingText"),P=n("suggestions.footerText"),M=A?"section":"div";return bi(Gs,{isActive:!!N,transitionStartState:qs.notRendered,children:bi(M,{className:O,"aria-labelledby":A?c:void 0,ref:u,children:[A&&bi("p",{id:c,className:Pi("suggestions__heading"),children:A}),!!I&&bi(da,{suggestions:I,onClickSuggestion:L}),P&&!i&&bi("p",{className:Pi("suggestions__footer"),children:P})]})})};const Ys=(0,zt.forwardRef)((({children:e,className:t=""},n)=>{const{isOpen:r,isVisible:o,setVisibility:i}=ri(),{namespace:a,layoutMode:s}=un(),{isInline:c}=Mn(),l=Mi(),u=ii(),{t:d}=ni(),p=["chat",`chat--layout-${s}`,`namespace--${a}`,t];return"function"!=typeof l&&p.push(...l),r||"app"===s||p.push("chat--collapsed"),u&&p.push("chat--user-responded"),o&&bi("section",{className:Pi(p),onKeyDown:e=>{(e.code&&"Escape"===e.code||27===e.keyCode)&&!c&&r&&i({visibility:Dt.minimized})},tabIndex:-1,ref:n,"aria-label":d("chat.srLabel"),children:[bi("div",{className:Pi("chat-wrapper"),children:e}),"inline"===s&&r&&bi(Xs,{isAside:!0})]})}));var Qs=Ys,Zs=({children:e,handleClose:t,title:n,closeButtonText:r,srCloseButtonText:o,id:i})=>{const a=Ji();return bi("section",{tabIndex:-1,id:i,"aria-labelledby":n?a:void 0,className:Pi("chat-status",n?void 0:"chat-status--condensed"),children:[bi("div",{className:Pi("chat-status__body"),children:[n?bi("h2",{className:Pi("chat-status__title"),id:a,children:n}):null,e]}),"function"==typeof t&&bi("button",{type:"button",onClick:t,className:Pi("button","button--tertiary","chat-status__close"),children:[r||bi(Zi,{name:"close",size:"16",alt:""}),o&&bi("span",{className:Pi("visually-hidden"),children:o})]})]})},ec=({handleClick:e,icon:t,title:n,srButtonText:r})=>bi("button",{type:"button",onClick:e,className:Pi("button","button--primary","chat-status__button"),children:[bi(Zi,{name:t,size:"16",alt:""}),n,r&&bi("span",{className:Pi("visually-hidden"),children:r})]});function tc(){const{showProposal:e,translationProposal:t,dismissTranslationProposal:n,activateTranslationProposal:r}=Ai(),{id:o}=ki();return e&&t?bi(Zs,{handleClose:n,srCloseButtonText:t.srDismissButtonText,id:o,title:t.titleLabel,children:bi(ec,{handleClick:r,icon:"newTranslation",title:t.buttonLabel})}):null}function nc(){const e=Qt(mi),{isActive:t}=Ii();return e||t?null:bi(tc,{})}var rc=({label:e,checked:t,description:n,onChange:r,id:o,itemClassName:i})=>bi("li",{className:Pi([i||"","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:[bi(Zi,{name:"check",size:"16",alt:""}),e," ",n&&bi("span",{children:["(",n,")"]})]}),oc=({onChange:e,describedById:t})=>{const{context:{contentLocale:n}}=un(),{t:r}=ni(),{languages:o,currentLocale:i,enableTranslations:a,disableTranslations:s}=Ii(),c=Ti(),l=t=>()=>{t&&(t===i||n===t?s():a(t,"translation_choice"),e(),c())},{primaryLanguages:u,remainingLanguages:d}=(0,zt.useMemo)((()=>o.reduce(((e,t)=>{const r=t.locale===n,o=((e,t,n)=>t===e.locale||!t&&n)(t,i,r);t.locale!==n&&e.remainingLanguages.push({...t,checked:o,isOriginal:r});const a=e.remainingLanguages.findIndex((e=>e.locale===i));return(r||o&&a>4)&&e.primaryLanguages.push({...t,checked:o,isOriginal:r}),e}),{primaryLanguages:[],remainingLanguages:[]})),[i,n,o]);return bi("ul",{"aria-describedby":t,role:"listbox",tabIndex:-1,className:Pi("translation-options"),children:[u.map((({locale:e,nativeName:t,checked:n,isOriginal:o},i)=>bi(rc,{id:e,label:t,checked:n,description:o?r("translations.settings.original"):void 0,onChange:l(e),itemClassName:Pi({"translation-options__item--original":o,"translation-options__item--selected":n&&0!==i})},e))),d.map((({locale:e,nativeName:t,checked:n,isOriginal:o})=>bi(rc,{id:e,label:t,checked:n,description:o?r("translations.settings.original"):void 0,onChange:l(e)},e)))]})},ic=({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=Ji(),{hideOption:d}=zi(),{focusButton:p}=Bi(),f=(0,Bo.hb)((()=>{d(),c||p()}),[c,p,d]),h=(0,Bo.hb)((()=>{n&&n(),f()}),[f,n]),v=(e=>{const t=(0,Bo.li)(null);return(0,Bo.vJ)((()=>{const n=n=>{t.current&&n.target instanceof HTMLElement&&!t.current.contains(n.target)&&(n.preventDefault(),n.stopPropagation(),e())};return document.addEventListener("click",n,!0),document.addEventListener("touchstart",n,!0),()=>{document.removeEventListener("click",n,!0),document.removeEventListener("touchstart",n,!0)}}),[e,t]),t})(h);return(0,Bo.vJ)((()=>{gn(v.current)}),[v]),bi("section",{className:Pi("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:v,children:bi("div",{className:Pi("options__body"),children:[bi("h2",{id:u,className:Pi("options__title"),children:r}),bi("button",{type:"button",onClick:h,"aria-describedby":u,className:Pi("button","options__close"),ref:e=>{s&&(s.current=e)},children:[bi(Zi,{name:"close",size:"16",alt:""}),bi("span",{children:a})]}),o?bi("p",{className:Pi("options__description"),id:i,children:o}):null,bi("div",{className:Pi("options__wrapper"),children:t})]})})},ac=function({onClose:e,position:t}){const{t:n}=ni(),r=Ji();return bi(ic,{onCancel:e,headingText:n("translations.menu.title"),cancelButtonText:n("translations.settings.cancelButtonText"),description:n("translations.menu.description"),descriptionId:r,position:t,disableButtonFocusing:!0,children:bi(oc,{describedById:r,onChange:e})})};function sc({children:e,position:t={horizontal:"left",vertical:"top"},classNames:n=[]}){const[r,o]=(0,Bo.J0)(!1),i=(0,Bo.li)(null),a=Ji();return bi("div",{className:Pi("translations__container"),onKeyDown:e=>{r&&_n(e)===yn.Escape&&(o(!1),gn(i.current))},children:[bi(Gs,{transitionStartState:qs.notRendered,isActive:r,children:bi("div",{className:Pi("options__dialog"),role:"dialog",children:bi(ac,{onClose:()=>{o(!1)},position:t})})}),bi("button",{type:"button",className:Pi(["button","chat__options__button",...n]),id:a,onClick:()=>{o(!r)},onKeyDown:e=>{_n(e)===yn.ArrowDown&&(o(!0),e.preventDefault())},ref:i,"aria-haspopup":"dialog","aria-expanded":r,children:e})]})}var cc=({children:e,formId:t,persistData:n=!1,onError:r,onSubmit:o,validationSchema:i={},...a})=>{const s=zo(),c=Qt((e=>Ss(e,{formId:t}))),[l,u]=(0,Bo.J0)(!1),[d,p]=(0,Bo.J0)({}),{isValid:f,errors:h}=function(e,t){const n=(0,Bo.Kr)((()=>function(e,t={}){return Object.entries(t).reduce(((t,[n,r])=>{const o=Array.isArray(r)?r:[r];for(let r=0;r<o?.length;r++)if(!o[r].fn(e[n],o[r].compareValue)){t[n]=o[r].errorText;break}return t}),{})}(e,t)),[e,t]);return{isValid:0===Object.keys(n).length,errors:n}}(c,i),v=(0,Bo.Kr)((()=>({...h,...d})),[h,d]);(0,Bo.Nf)((()=>{s(ur({formId:t,persistData:n}))}),[t,n,s]),(0,Bo.vJ)((()=>()=>{s(dr({formId:t}))}),[t,n,s]);const m=(0,Bo.hb)(((e,n)=>{s(hr({formId:t,name:e,value:n}))}),[t,s]),y=(0,Bo.hb)(((e,n)=>{s(vr({formId:t,name:e,touched:n}))}),[s,t]),_=(0,Bo.hb)(((e,t)=>{p((n=>({...n,[e]:t})))}),[p]),g=(0,Bo.hb)((e=>{e.preventDefault();const t="true"===e.submitter.getAttribute("aria-disabled");u(!t),!t&&f&&(s(tr(!0)),o(c,{updateControlValue:m,setError:_}))}),[f,s,o,c,m,_]);(0,Bo.vJ)((()=>{r&&r({errors:v,isSubmitted:l,isValid:0===Object.keys(v).length})}),[l,v,r]);const b=(0,Bo.Kr)((()=>({formId:t,values:c,errors:v,isValid:0===Object.keys(v).length,isSubmitted:l,handleSubmit:g,validationSchema:i,updateControlValue:m,updateControlTouched:y})),[t,c,v,l,g,i,m,y]);return t?o?bi(Is,{...a,value:b,children:e}):(console.error('"onSubmit" is required.'),null):(console.error('"formId" is required.'),null)};const lc=(e,t,n=null)=>({fn:e,errorText:t,compareValue:n}),uc=(e,t)=>{let n=!0;for(let r=0;r<e.length;r++)e[r].size>t&&(n=!1);return n},dc=e=>!!e?.length,pc=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))},fc=e=>!!e;var hc=function({className:e,disableValidationClasses:t=!1,...n}){const{handleSubmit:r,isValid:o,isSubmitted:i}=function(){const{handleSubmit:e,isSubmitted:t,isValid:n}=Ls();return{handleSubmit:e,isSubmitted:t,isValid:n}}(),a=["form"];return!t&&i&&(a.push("form--submitted"),o?a.push("form--valid"):a.push("form--invalid")),bi("form",{onSubmit:r,className:Pi([...a,e]),...n})};function vc({id:e,error:t}){const[n,r]=(0,Bo.J0)(!1);return(0,Bo.vJ)((()=>{const e=setTimeout((()=>r(!0)),300);return()=>clearTimeout(e)}),[]),bi("div",{className:Pi("error"),"aria-live":"assertive","aria-atomic":"true",children:n&&t&&bi("span",{id:e,className:Pi("error__message"),children:[bi(Zi,{name:"error",size:"16",alt:""}),t]})})}var mc=({contentHint:e,id:t,labelText:n,labelClass:r,validity:i,errorText:a,children:s})=>bi(o.FK,{children:[e&&bi("span",{id:`${t}-content-hint`,className:Pi("input__content-hint"),children:e}),bi(vc,{id:`${t}-error`,error:!i&&a}),bi("div",{className:Pi("form-control__wrapper"),children:[bi("label",{htmlFor:t,className:Pi(r),children:n}),s]})]}),yc=function({id:e,name:t,type:n,labelText:r,labelClass:o,contentHint:i=null,focus:a,"aria-invalid":s,"aria-describedby":c,...l}){const u=(0,Bo.li)(null),{isSubmitted:d}=Ls(),[p,{error:f}]=As(t),h=d&&f,v=[];return c&&v.push(c),i&&v.push(`${e}-content-hint`),h&&v.push(`${e}-error`),(0,Bo.Nf)((()=>{u.current&&a&&u.current.focus()}),[a]),bi(mc,{id:e,contentHint:i,validity:!h,errorText:f,labelText:r,labelClass:o,children:bi("input",{...p,...l,ref:u,id:e,type:n,"aria-invalid":s||h?"true":"false","aria-describedby":v.join(" ")||void 0,name:t})})};function _c({controlName:e,describedById:t}){const{t:n}=ni();return bi(hc,{noValidate:"true",className:Pi("options__form"),children:[bi(yc,{id:"email-id",name:e,type:"email",className:Pi("transcript__input"),"aria-describedby":t,labelClass:Pi("label"),labelText:n("options.sendTranscript.label")}),bi("div",{className:Pi("options__actions"),children:bi("button",{type:"submit",className:Pi("button","button--primary","options__submit"),children:n("options.sendTranscript.sendButtonText")})})]})}const gc="email";const bc={sendTranscript:()=>{const[e,t]=(0,Bo.J0)(void 0),{hideOption:n}=zi(),{focusButton:r}=Bi(),{t:o}=ni(),i=Ji(),{sendAction:a}=fi(),s=(0,Bo.Kr)((()=>({[gc]:[lc(fc,o("options.sendTranscript.noEmailText")),lc(pc,o("options.sendTranscript.invalidEmailText"))]})),[o]),c=(0,Bo.hb)((e=>{const t=e[gc].trim();a({type:"send_transcript",body:{emailAddress:t}}),n(),r()}),[a,n,r]),l=(0,Bo.hb)((({isValid:e,isSubmitted:n})=>{t(n&&!e?"options--error":void 0)}),[t]);return bi(ic,{className:e,headingText:o("options.sendTranscript.title"),cancelButtonText:o("options.cancelButtonText"),description:o("options.sendTranscript.description"),descriptionId:i,position:{vertical:"top",horizontal:"right"},children:bi(cc,{formId:"sendTranscript",onSubmit:c,validationSchema:s,onError:l,children:bi(_c,{controlName:gc,describedById:i})})})}};var wc=()=>{const{optionActive:e}=zi(),t=(0,Bo.li)(),n=bc[t.current??e];return e&&(t.current=e),n?bi(n,{}):null},xc=()=>{const{t:e}=ni(),{menuOptions:t,showOption:n,panelActive:r,hideOption:o}=zi(),{id:i}=Bi(),a=(0,Bo.li)(null),[s,c]=(0,Bo.J0)(!1),l=(0,Bo.li)(null),u=t.length,d=(0,Bo.li)([]),p=(0,Bo.li)(!1),f=u>1,h=t[0],v=(0,Bo.Kr)((()=>h?.name?.trim().replace(/\s+/g,"")),[h]);return(0,Bo.vJ)((()=>()=>{a.current&&clearTimeout(a.current)}),[]),(0,Bo.vJ)((()=>{s&&!p.current&&requestAnimationFrame((async()=>{await Ci(60);const e=t.findIndex((e=>e.available)),n=-1===e?0:e;d.current&&gn(d.current[n])})),p.current=s}),[s,t]),u?bi("div",{className:Pi("options__container"),onKeyDown:e=>{s&&(_n(e)===yn.Escape&&(c(!1),gn(l.current)),_n(e)===yn.Home&&(d.current&&gn(d.current[0]),e.preventDefault()),_n(e)===yn.End&&(d.current&&gn(d.current[u-1]),e.preventDefault()))},onFocusOut:()=>{f&&(a.current=setTimeout((()=>{c(!1)}),200))},onFocusIn:()=>{a.current&&clearTimeout(a.current)},children:[bi(Gs,{transitionStartState:qs.notRendered,isActive:r,children:bi("div",{className:Pi("options__dialog"),children:bi(wc,{})})}),f&&bi(Gs,{isActive:s,transitionStartState:qs.notRendered,children:bi("ul",{className:Pi(["options__menu"]),role:"menu",tabIndex:-1,"aria-labelledby":i,children:t.map((({name:r,title:o,available:i},a)=>bi("li",{className:Pi("options__menu__item"),role:"menuitem","data-testid":r,children:bi("button",{type:"button",ref:e=>{e&&(d.current[a]=e)},className:Pi(["button","button--secondary"]),onKeyDown:e=>((e,t)=>{if(_n(e)===yn.ArrowDown){const n=Math.min(u-1,t+1);d.current&&gn(d.current[t===n?0:n]),e.preventDefault()}if(_n(e)===yn.ArrowUp){const n=Math.max(0,t-1);d.current&&gn(d.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&&d.current&&gn(d.current[o])})(e,a),onClick:()=>((e,t)=>{t&&(c(!1),n(e))})(r,i),"aria-disabled":!i,children:[bi("span",{className:Pi("button__text"),children:[o,!i&&" "]}),i?null:bi("span",{className:Pi("button__state"),children:e("options.unavailableText")})]})},r)))})}),bi("button",{type:"button",className:Pi(["button","button--secondary","chat__options__button",...!f&&v?[`chat__options__button--${v}`]:[]]),id:i,onClick:()=>{r&&o(),f?c((e=>!e)):h.available&&!r&&n(h.name)},onKeyDown:f?e=>{_n(e)===yn.ArrowDown&&(c(!0),e.preventDefault())}:void 0,ref:l,"aria-haspopup":!!f&&"menu","aria-expanded":!!f&&s,"aria-disabled":!f&&!h.available,children:[f?bi(Zi,{name:"options",size:"32",alt:""}):null,bi("span",{className:Pi("button__text"),children:f?e("options.openButtonText"):`${h.title}${h.available?"":" "}`}),f||h.available?null:bi("span",{className:Pi("button__state"),children:e("options.unavailableText")})]})]}):null};function Cc(){const{menuOptions:e,allowOptionSelection:t}=zi(),{isAvailable:n}=Ii(),r=Qt(mi),{t:o,userLocale:i}=ni(),a=Li(i);if(!n&&(!t||!e.length)||r)return null;const s=o("translations.settings.openButtonText",{hasLanguage:!!a,language:a});return bi("div",{className:Pi("chat__options"),children:[n&&bi("div",{className:Pi("chat__options-item","chat__options-item--left"),children:bi(sc,{classNames:["button--secondary"],children:[bi(Zi,{alt:s,name:"newTranslation",size:"16"}),bi("span",{className:Pi("button__text"),children:s})]})}),t&&bi("div",{className:Pi("chat__options-item","chat__options-item--right"),children:bi(xc,{})})]})}var Sc=()=>{const{scrollToRef:e,unreadIds:t}=Ds(),{isMinimized:n}=ri(),{t:r}=ni();return bi(Gs,{isActive:!!t.length&&!n,children:bi("div",{className:Pi("unread-messages"),children:bi("button",{type:"button",className:Pi("button","button--primary"),onClick:e,children:[r("message.unreadMessagesCount",{unreadCount:t.length}),bi(Zi,{name:"chevronDown",size:"32",alt:""})]})})})},Ec=({children:e})=>{const t=Tn(),n=(0,Bo.Kr)((()=>t.reduce(((e,t)=>t.payload.id?(e[t.payload.id]=(0,o._3)(),e):e),{})),[t]),{scrollToRef:r,scrollToBottom:i,containerRef:a,unreadIds:s}=(e=>{const t=(0,Bo.li)(null),[n,r]=(0,Bo.J0)(!0),o=Qt(gs),i=Tn(),a=Nn(),{isOpen:s}=ri(),c=Cn().loadedImageEventIds,{processingFileUploads:l,isLastEventFromClient:u}=Qt((({state:e})=>e));(0,Bo.vJ)((()=>{const e=t.current;if(!e)return()=>{};const 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 d=(0,Bo.hb)((()=>{requestAnimationFrame((async()=>{await Ci(30),t.current?.scrollTo({top:t.current?.scrollHeight,left:0,behavior:"auto"})}))}),[]);return(0,Bo.vJ)((()=>{u&&d()}),[u,d]),(0,Bo.vJ)((()=>{n&&d()}),[n,o,i,a,s,c,l,d]),{containerRef:t,unreadIds:o,scrollToRef:()=>{const n=o.at(0);if(void 0!==n){const r=e[n]?.current;t.current?.scrollTo({top:r?.offsetTop,behavior:"auto",left:0})}},scrollToBottom:d}})(n);return bi(Us.Provider,{value:{eventRefs:n,unreadIds:s,scrollToRef:r,scrollToBottom:i,containerRef:a},children:bi("div",{className:Pi("chat__container"),children:[bi("div",{className:Pi("chat__container__scroll-area"),ref:a,children:e}),bi(Sc,{})]})})},Tc=({baseClassName:e,children:t,title:n})=>{const r=On(),o=Ji();return bi("section",{id:r,className:Pi(e),"aria-describedby":o,tabIndex:-1,children:[bi("h2",{className:Pi(`${e}__title`),id:o,children:n}),t]})},Nc=()=>{const{t:e}=ni(),t=Ti(),n=Ki(),{emitEvent:r}=fi(),{isActive:i,remaining:a,timer:s,endCountdown:c}=Hi(),l=!!a&&a>0,u=e(l?"idleDetachWarning.countdownTitle":"idleDetachWarning.notifyTransferText");return bi(Tc,{baseClassName:"idle",title:u,children:l&&bi(o.FK,{children:[bi("div",{className:Pi("idle__count-container"),children:i&&bi(o.FK,{children:[bi("span",{className:Pi("idle__count-text"),children:e("idleDetachWarning.countdownText")}),bi("span",{className:Pi("idle__count-timer"),children:e("idleDetachWarning.countdownTimer",s)})]})}),bi("div",{className:Pi("idle__options"),children:[bi("button",{type:"button",className:Pi("button","button--primary"),onClick:()=>{n(),c(!0),t(),r("idleTimer.selectContinue")},children:e("idleDetachWarning.continueButton")}),bi("button",{type:"button",className:Pi("button","button--primary"),onClick:()=>{c(),t(),r("idleTimer.selectEnd")},children:e("idleDetachWarning.detachButton")})]})]})})},Ic=()=>{const{t:e}=ni(),t=Ki(),{name:n}=An()||{},{continueChat:r,restartChat:o}=$i();return bi(Tc,{baseClassName:"prompt",title:e("resumeConversationPrompt.title",{name:n}),children:bi("div",{className:Pi("prompt__options"),children:[bi("button",{type:"button",className:Pi("button","button--primary"),onClick:()=>{t(),r()},children:e("resumeConversationPrompt.continueButton")}),bi("button",{type:"button",className:Pi("button","button--primary"),onClick:o,children:e("resumeConversationPrompt.detachButton")})]})})};const Oc=()=>{const{sendAction:e}=fi(),{features:t}=zi(),{typingPeekahead:n}=t||{},r=(0,Bo.li)(null),o=(0,Bo.li)(null),i=(0,Bo.li)(!1),a=(0,Bo.li)(null);(0,Bo.vJ)((()=>()=>{a.current&&clearInterval(a.current),r.current&&clearTimeout(r.current),o.current&&clearTimeout(o.current)}),[]);const s=(t,r)=>{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&&a.current?(clearInterval(a.current),a.current=null):n&&n.enabled&&s(!0,e.target.value)}),2e3)),r.current&&clearTimeout(r.current),o.current&&clearTimeout(o.current),r.current=setTimeout((()=>{i.current=!1}),300),o.current=setTimeout((()=>{s(!1,e.target.value)}),2e3))}},kc=()=>{const{default:e,active:t,userSelected:n,options:r,optionsOverride:o}=Cn().entryMeta,i=zo(),a=n||t||e,s=o&&o[a]||r&&r[a]||{},c=(0,Bo.hb)((e=>{i(Xr(e))}),[i]),l=(0,Bo.hb)((e=>{i(qr(e))}),[i]),u=(0,Bo.hb)((e=>{i(_o(e))}),[i]),d=(0,Bo.hb)((()=>{n?u(null):l(e)}),[l,u,e,n]);return{activeEntry:a,activeEntryOptions:s,setActiveEntryType:l,setUserEntryType:u,cancelEntrySelection:d,setBlockAutoEntrySwitch:c}};function Lc({controlName:e,skipLinkId:t}){const{t:n}=ni(),{setInputFocus:r}=ri(),{sendAssertive:o}=hi(),{emitEvent:i}=fi(),a=Oc(),{setBlockAutoEntrySwitch:s}=kc(),{placeholder:c,label:l,labelClass:u}=Ms(e),{hasCharacterLimit:d,reachedCharacterWarning:p,reachedCharacterLimit:f,remainingChars:h}=Ps(e),[{value:v}]=As(e),m=!!v,y=(0,Bo.hb)((()=>{p&&o(n("input.srCharacterLimitText",{limit:h})),i("ui.inputFocus")}),[n,o,p,h,i]);return(0,Bo.Nf)((()=>(s(m),()=>{s(!1)})),[s,m]),bi(hc,{className:Pi("entry-form"),disableValidationClasses:!0,noValidate:"true",children:[bi("div",{className:Pi(["input--text__container",...p&&!f?["character-warning"]:[],...f?["character-exceeded"]:[]]),children:[bi(yc,{id:t,type:"text",name:e,className:Pi("input__text"),autocomplete:"off",placeholder:c,labelText:l,labelClass:Pi(u),"aria-invalid":!!d&&f,onKeyUp:a,onFocus:y,focus:r}),bi("div",{className:Pi("character-count"),children:p&&bi("span",{children:h})})]}),bi("button",{className:Pi("button","input__submit"),onPointerDown:e=>{e.preventDefault()},"aria-disabled":!m||f,children:bi(Zi,{name:"send",size:"32",alt:n("input.sendMessage")})})]})}const Ac="textMessageEntry";function Pc({...e}){const{isOpen:t,setVisibility:n}=ri(),r=On(),o=Ti(),{sendMessage:i}=fi(),a=(0,Bo.hb)(((e,{updateControlValue:r})=>{i({body:e[Ac]}),r(Ac,""),o(),t||n({visibility:Dt.open})}),[i,o,t,n]);return bi(cc,{...e,formId:"textEntry",persistData:!0,onSubmit:a,children:bi(Lc,{controlName:Ac,skipLinkId:r})})}var Mc=()=>{const{t:e}=ni(),{currentUploads:t}=ji();return bi("div",{className:Pi("progress"),children:t.map((({id:t,name:n,progress:r,uploading:o,error:i})=>bi("div",{className:Pi("progress_container"),children:[bi("div",{className:Pi("progress__text"),children:[bi("span",{className:Pi("progress__text--file-name"),children:n}),bi("span",{className:Pi("progress__text--percentage"),children:`${r}%`})]}),bi(vc,{error:i,id:"progress-error"}),bi("progress",{className:Pi("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 Rc({id:e,name:t,labelText:n,contentHint:r,outputText:o,accept:i}){const{isSubmitted:a}=Ls(),[s,c]=(0,Bo.J0)(!1),[{onInput:l,onBlur:u},{error:d}]=As(t),p=Ji(),f=Ji(),h=Ji(),v=a&&d,m=[h];r&&m.push(f),v&&m.push(p);const y=(0,Bo.hb)((()=>{c(!0)}),[c]),_=(0,Bo.hb)((()=>{c(!1),u()}),[c,u]),g=(0,Bo.hb)((e=>{const t={target:{value:e.target.files}};l(t)}),[l]);return bi("div",{className:Pi("upload__container"),children:[r&&bi("span",{className:Pi("upload__content-hint"),id:f,children:r}),bi(vc,{id:p,error:v&&d}),bi("div",{className:Pi(["file-upload",...s?["focus-within"]:[]]),children:bi("label",{htmlFor:e,className:Pi("upload__label"),children:[bi(Zi,{name:"upload",size:"32",alt:""}),bi("div",{children:[bi("span",{className:Pi(["upload__label--text"]),children:n}),bi("input",{id:e,className:Pi("upload__input"),type:"file",name:t,onChange:g,"aria-invalid":v?"true":"false","aria-describedby":m.join(" "),accept:i||null,onFocus:y,onBlur:_}),bi("span",{className:Pi("upload__output"),"aria-hidden":"true",id:h,children:o})]})]})})]})}var Fc=({skiplinkId:e,controlName:t,accept:n,contentHint:r,isUploading:o,isComplete:i,onClickCancel:a})=>{const{t:s}=ni(),[{value:c}]=As(t),l=c&&c.length>0,u=l&&"string"!=typeof c?c[0].name:"";return bi(hc,{className:Pi("upload-form"),children:[bi(Rc,{name:t,id:e,accept:n,labelText:s("fileUpload.labelText"),outputText:s("fileUpload.selectedText",{hasFile:l,filename:u}),contentHint:r}),bi("div",{className:Pi("upload__button-container"),children:[bi("button",{id:o||!i?e:void 0,type:"button",onClick:a,className:Pi("button","button--secondary","upload__cancel"),children:s("fileUpload.cancelButtonText")}),bi("button",{className:Pi("button","button--primary"),type:"submit",children:s("fileUpload.uploadButtonText")})]})]})};const Dc="fileListForm",Uc="fileList";var jc=()=>{const{t:e}=ni(),{sendPolite:t,sendAssertive:n}=hi(),r=On(),i=Ti(),{serviceAllowsUploads:a,allowedMimeTypes:s,maxSize:c}=Ui(),l=(0,Bo.li)(null),u=(0,Bo.li)(a),{cancelEntrySelection:d}=kc(),{uploadFile:p,clearUploads:f,isUploading:h,isComplete:v}=ji(),{uploadHandle:m,hasServerError:y,progress:_}=((e,t)=>{const n=Qt((n=>Es(n,{formId:e,name:t}))),{currentUploads:r}=ji(),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}})(Dc,Uc),g=Ji(),b=(0,Bo.li)(!0),w=e("fileUpload.contentHint",{size:vn(c)}),x=(0,Bo.li)(""),C=(0,Bo.li)(null);(0,Bo.vJ)((()=>{x.current&&C.current?.contains(document.activeElement)&&"INPUT"===document.activeElement?.tagName&&n(w),x.current=w}),[w,n]),(0,Bo.vJ)((()=>{_>0&&t(1===_?e("fileUpload.srStartedText"):`${_}%`)}),[_,t,e]),(0,Bo.vJ)((()=>{b.current||h||!v||(f(),d(),i(),setTimeout((()=>{t(e("fileUpload.srCompleteText"))}),300)),b.current=v}),[h,v,f,d,i,t,e]);const S=(0,Bo.hb)((({fileList:e})=>{p(e[0]),i()}),[p,!1,i]),E=(0,Bo.hb)((()=>{m&&m.abort(),f(),d(),i()}),[m,f,d,i]),T=(0,Bo.Kr)((()=>({[Uc]:[lc((()=>a),e("fileUpload.errors.unavailable")),lc(dc,e("fileUpload.errors.noFile")),lc(uc,e("fileUpload.errors.tooLarge"),c)]})),[c,a,e]);return bi("div",{className:Pi(["upload",...y?["upload--error"]:[]]),ref:C,children:bi(cc,{formId:Dc,persistData:!0,onSubmit:S,validationSchema:T,children:[(h||!v)&&bi(o.FK,{children:[bi(Mc,{}),bi("div",{className:Pi("upload__button-container"),children:bi("button",{id:h||!v?r:void 0,type:"button",onClick:E,ref:l,className:Pi("button","button--secondary","upload__cancel"),children:e("fileUpload.cancelButtonText")})})]}),!h&&v&&bi(Fc,{controlName:Uc,skiplinkId:r,accept:s?.join(", ")||"",contentHint:w,isComplete:v,isUploading:h,onClickCancel:E}),!u.current&&bi(o.FK,{children:[bi("span",{className:Pi("notification"),id:g,children:e("fileUpload.unavailableText")}),bi("div",{className:Pi("upload__button-container"),children:bi("button",{id:h||!v?r:void 0,type:"button",onClick:E,className:Pi("button","button--secondary","upload__cancel"),children:e("fileUpload.cancelButtonText")})})]})]})})},zc=()=>{const{t:e}=ni(),{showFileUpload:t,serviceAllowsUploads:n}=Ui(),[r,o]=(0,Bo.J0)(n||!1),i=Ti(),a=(0,Bo.li)(null),{setUserEntryType:s,activeEntry:c}=kc(),l=(0,Bo.li)(null),{sendPolite:u}=hi(),d=!!An();return(0,Bo.vJ)((()=>{bn(l.current,(()=>{n||i()})),o(n||!1)}),[n,i]),(0,Bo.vJ)((()=>{a.current&&!n&&u(e("fileUpload.srUnavailableText")),!1===a.current&&n&&u(e("fileUpload.srAvailableText")),d&&(a.current=n)}),[n,d,u,e]),t||c===N?null:bi(Gs,{isActive:r,transitionStartState:qs.rendered,children:bi("div",{className:Pi("upload-toggle-wrapper"),children:bi(Gs,{isActive:r,transitionStartState:qs.visuallyHidden,children:bi("button",{className:Pi(["button","button--secondary","upload-toggle"]),ref:l,"aria-disabled":!r,type:"button",onClick:r?()=>{s(N),i()}:void 0,children:bi(Zi,{name:"file",size:"32",alt:e("fileUpload.toggleButtonText")})})})})})},Bc=()=>{const{isOpen:e}=ri(),t=(0,Bo.li)(null),{hasCountdown:n}=Hi(),[r,o]=(0,Bo.J0)(n),{hasPrompt:i}=$i(),[a,s]=(0,Bo.J0)(i),c=Ti(),l=(0,Bo.li)(!1),{activeEntry:u}=kc(),[d,p]=(0,Bo.J0)({text:Pc,upload:jc}),[f,h]=(0,Bo.J0)((()=>u)),v=un(),{accountAllowsUploads:m}=Ui(),y=(0,Bo.hb)((()=>{bn(t.current,c)}),[c]);(0,Bo.vJ)((()=>{const{customComponents:e}=v,{entry:t}=e||{};t&&p((e=>({...e,...t})))}),[v]),(0,Bo.vJ)((()=>{y(),o(n),s(i)}),[n,i,y]),(0,Bo.vJ)((()=>{h(u),y()}),[u,y,t]),l.current=!(!t.current||!t.current.contains(document.activeElement));const _=d[f];return bi("div",{className:Pi("chat__entry"),ref:t,children:[r&&bi(Nc,{}),a&&bi(Ic,{}),bi("div",{className:Pi(["entry__body",...n||i?["entry__body--hidden"]:[]]),children:[f!==N&&m&&e?bi(zc,{}):null,bi(_,{})]})]})},Vc=()=>{const{t:e}=ni(),{isOpen:t,closeChat:n}=ri(),{isWindow:r}=Mn();return t&&r?bi("button",{type:"button",className:Pi("button","collapse-button"),onClick:n,children:bi(Zi,{name:"chevronDown",size:"32",alt:e("window.srCollapseButton")})}):null},Kc=()=>{const{meta:{originalError:e,title:t,message:n,buttonText:r,action:i,srText:a}}=yi(),s=fi(),c=Ji(),{sendPolite:l}=hi(),u=Ti(),d="SeamlySessionExpiredError"===e?.name;return(0,Bo.vJ)((()=>{!d&&a&&setTimeout((()=>{l(a)}),200)}),[l,a,d]),d?bi(o.FK,{}):bi("section",{className:Pi("interrupt"),"aria-labelledby":c,children:[bi(Vc,{}),bi("div",{className:Pi("interrupt__body"),children:[bi("h2",{id:c,className:Pi("interrupt__title"),children:t}),bi("p",{className:Pi("interrupt__message"),children:n}),r&&i&&bi("div",{className:Pi("interrupt__actions"),children:bi("button",{type:"button",className:Pi("button","button--primary"),onClick:()=>{i&&s[i]&&s[i](),u()},children:r})})]})]})},Hc=function({children:e}){const t=Qt(mi),{isOpen:n}=ri();return t?bi(Kc,{}):bi(o.FK,{children:[bi(Ec,{children:[bi("div",{className:Pi("chat__container__header"),children:[bi(nc,{}),bi(Vc,{})]}),e]}),bi(Bc,{}),n&&bi(Cc,{})]})};function $c({event:e}){const[t]=js(e);return bi("li",{children:bi(t,{event:e})})}function Jc({events:e}){return bi("ul",{className:Pi("collapsed-chat-messages"),children:e.map((e=>bi($c,{event:e},e.payload.id)))})}function Wc(){const{preChatEvents:e}=un(),t=Qt(mi),{isOpen:n}=ri();return t||!e?.length||n?null:bi(Jc,{events:e})}function qc(){const{t:e}=ni(),t=e("window.chat.continue");return bi(Jc,{events:[(0,Bo.Kr)((()=>({type:"message",payload:{type:"custom",body:{text:t,type:"",data:{}},participant:"seamly-client-participant"}})),[t])]})}const Gc=()=>{const e=dn(),t=An(),n=Qt(mi),r=t&&!n,o=r?t.avatar:e;return o?bi("img",{className:Pi(r?"avatar":"icon"),src:o,alt:""}):bi(Zi,{name:"avatar",size:"32",alt:""})};var Xc=({onClick:e})=>{const t=pi(),{t:n}=ni(),r=t()?n("window.openButton.srContinue"):n("window.openButton.srStart"),o=Ti(),{isOpen:i}=ri(),a=In(),s=(0,Bo.hb)((()=>{e(),o()}),[o,e]);return bi(Gs,{isActive:!i,transitionStartState:qs.rendered,children:bi("button",{className:Pi("window-open-button"),"aria-label":r,"aria-hidden":i,onClick:s,children:[bi(Gs,{isActive:!!a,transitionStartState:qs.notRendered,children:bi("span",{className:Pi("message-count"),"aria-hidden":"true",children:a})}),bi(Gc,{})]})})};const Yc=(e,t,n)=>"object"==typeof e?e[t]:n;var Qc=n.p+"sounds/beep.mp3";const Zc=!!window.Notification;const el={app:()=>bi(Qs,{children:bi(Hc,{children:bi(Ks,{})})}),inline:()=>{const{showInlineView:e,containerRef:t}=(()=>{const e=zo(),{connectWhenInView:t}=un(),n=Qt(Fn),{containerRef:r,isVisible:o}=oi({enabled:t,freezeOnceVisible:!0});return(0,Bo.vJ)((()=>{o&&e(Do())}),[e,o]),{containerRef:r,showInlineView:n}})(),{isOpen:n}=ri();return bi(o.FK,{children:[bi(Gs,{isActive:!n,transitionStartState:qs.rendered,children:bi("div",{ref:t,className:Pi("unstarted-wrapper","unstarted-wrapper--inline"),children:[bi(Wc,{}),bi(Xs,{})]})}),bi(Gs,{isActive:n,transitionStartState:qs.rendered,children:bi(Qs,{ref:t,children:e&&bi(Hc,{children:n&&bi(Ks,{})})})})]})},window:()=>{const{isOpen:e,openChat:t}=ri(),n=ii(),{continueChat:r,preChat:i}=un();return bi(o.FK,{children:[bi(Xc,{onClick:t}),bi(Gs,{isActive:!!i&&!e&&!n,exitAfter:Yc(i,"exitAfter"),enterDelay:Yc(i,"enterDelay"),transitionStartState:qs.notRendered,children:bi("div",{className:Pi("unstarted-wrapper","unstarted-wrapper--window"),children:bi(Wc,{})})}),bi(Gs,{isActive:r&&!e&&n,exitAfter:Yc(r,"exitAfter"),enterDelay:Yc(r,"enterDelay"),transitionStartState:qs.notRendered,children:bi("div",{className:Pi("unstarted-wrapper","unstarted-wrapper--window","unstarted-wrapper--continue"),children:bi(qc,{})})}),bi(Gs,{isActive:e,transitionStartState:qs.notRendered,children:bi(Qs,{children:bi(Hc,{children:bi(Ks,{})})})})]})}};function tl(e){const t=document.createElement("div");return t.innerHTML=e||"",t.textContent||t.innerText||""}var nl=({children:e})=>{const{sendNotification:t}=(()=>{const{proactiveMessages:e}=kn(),{notificationAudioURL:t}=un(),[n,r]=(0,Bo.J0)(Zc?Notification.permission:"default"),[o,i]=(0,Bo.J0)(document.visibilityState),a=Qt(bs),s=(0,Bo.hb)((async()=>{if(Zc&&"granted"!==n){const e=await Notification.requestPermission();r(e)}}),[n]),c=(0,Bo.Kr)((()=>"granted"===n),[n]),l=(0,Bo.Kr)((()=>"hidden"===o),[o]);(0,Bo.vJ)((()=>{"default"===n&&e&&s()}),[n,e,s]);const u=(0,Bo.hb)((async(e,r)=>{if(a&&Zc){if("default"===n&&s(),!1!==t&&!c&&(l||!document.hasFocus()))try{const e=new Audio(t||Qc);await e.play()}catch(e){console.warn(e)}if(c&&(l||!document.hasFocus())){const t=new Notification(e,r);t.onclick=function(){window.parent.focus(),window.focus(),t.close();const e=document.querySelector(`input[name=${Ac}]`);e&&e.focus()}}}}),[t,n,c,s,a,l]);return(0,Bo.vJ)((()=>{if(!a)return()=>{};function e(){i(document.visibilityState)}return document.addEventListener("visibilitychange",e,!1),()=>{document.removeEventListener("visibilitychange",e)}}),[a]),{permission:n,requestPermission:s,sendNotification:u}})(),[,n]=Si(),r=un(),o=An(),{proactiveMessages:i}=kn(),{isOpen:a,isVisible:s}=ri(),c=Mi(),l=ii(),u=Qt(_s),{body:d}=Oi(u),{userLocale:p}=ni(),f=(0,Bo.li)(void 0),h=(0,Bo.Kr)((()=>d?"string"==typeof d?tl(d):"text"in d?tl(d.text):"prompt"in d&&d.prompt&&"text"in d.prompt?tl(d.prompt?.text):"":""),[d]);(0,Bo.vJ)((()=>{o?.name&&h&&i&&u&&f.current!==u.payload?.id&&(t(o.name,{body:h,icon:o?.avatar||void 0}),f.current=u.payload.id)}),[o?.avatar,o?.name,u,h,i,t]);const v=el[r.layoutMode],m=(0,Bo.hb)((e=>{"function"==typeof n&&n(e)}),[n]),y=(0,Bo.Kr)((()=>{if(p){const e=document.querySelector("html")?.getAttribute("lang");if(e!==p)return p}}),[p]);if(!v)return console.warn('"layoutMode" should be one of "app", "inline" or "window"'),null;const _=["app",`app--layout-${r.layoutMode}`,`namespace--${r.namespace}`];return"function"!=typeof c?_.push(...c):_.push(...c(r)),a||"app"===r.layoutMode||_.push("app--collapsed"),l&&_.push("app--user-responded"),s?bi("div",{className:Pi(_),lang:y,tabIndex:-1,"data-nosnippet":!0,style:{zIndex:r?.zIndex},ref:m,children:e||bi(v,{})}):null},rl=e=>bi(ms,{...e,children:bi(nl,{})});class ol{constructor(e,n){const{namespace:r="",parentElement:o,...i}=e;this.config={...i,namespace:r},this.namespace=r,this.parentElement=o,this.externalApi=n,this.api=new G({layoutMode:e.layoutMode,namespace:e.namespace,config:e.api,context:e.context}),this.eventBus=new(t()),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)))}async render(){const{view:e,...t}=this.config.customComponents||{},n={...this.config,parentElement:this.parentElement,customComponents:Object.keys(t).length?t:void 0},r=jo({api:this.api,eventBus:this.eventBus,config:n,initialState:void 0});r.dispatch(Gn(n)),await r.dispatch(St()),await r.dispatch(Bn()),r.dispatch(zn()),e?(0,o.XX)(bi(ms,{eventBus:this.eventBus,store:r,api:this.api,children:bi(e,{})}),this.parentElement):(0,o.XX)(bi(rl,{config:n,eventBus:this.eventBus,store:r,api:this.api}),this.parentElement)}destroy(){(0,o.XX)(null,this.parentElement),this.eventBus.off(),this.api.disconnect(),this.functions={}}registerFunctions(e){Object.entries(e).forEach((([e,t])=>{this.registerFunction(e,t)}))}registerFunction(e,t){this.functions[e]=this.functions[e]||[],this.functions[e].push(t),this.externalApi.handleActions()}unregisterFunction(e,t){const n=this.functions[e];n&&n.length&&(this.functions[e]=n.filter((e=>e!==t)))}execFunction(e,...t){const n=this.functions[e];return!(!n||!n.length||(n.forEach((n=>{try{n(...t)}catch(t){console.error(`Action(${e}) failed: `,t)}})),0))}}const il=e=>"object"==typeof e&&"action"in e,al=e=>({...e,args:Array.isArray(e.args)?e.args:[e.args]});var sl=class{constructor(e){this._waitingActions=[],this._instances={},this.timeouts={},this.appConfig=e,this.context={}}push(...e){(e=e.filter(il).map(al)).length&&(this._waitingActions.push(...e),this.handleActions())}handleActions(){const e=this._waitingActions;this._waitingActions=[],e.forEach((e=>{switch(e.action){case"init":this.handleInit(e);break;case"destroy":this.handleDestroy(e);break;default:this.handleAction(e)||this.setContext(e.action,...e.args)||this._waitingActions.push(e)}}))}instanceInitializing(e){const t=Object.keys(this._instances);return!e&&t.length>0||t.includes(e)}setContext(e,t){const{instance:n}=t;if(this.instanceInitializing(n))return!1;switch(e){case"setTopic":const{name:e}=t;return e&&(this.context.topic=e),!0;case"setTranslation":const{enabled:n,locale:r}=t;return n&&r&&(this.context.userLocale=r,this.context.source=j),!0;case"setContext":const{userLocale:o,contentLocale:i}=t;return this.context.userLocale=o,this.context.contentLocale=i,o&&o!=this.appConfig?.userLocale&&(this.context.source=j),!0;case"setVariables":return Object.keys(t).length>0&&(this.context.variables={...t}),!0;default:return!1}}handleInit(e){const t=this.getUserConfig(...e.args),n=this.getCombinedConfig(t),{parentElement:r,namespace: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={},this.debouncedRender(e,n.namespace)}}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 ol(e,this)}debouncedRender(e,t){window.clearTimeout(this.timeouts[t]),this.timeouts[t]=window.setTimeout((()=>{e.render()}),100)}destroy(e){e?("string"==typeof e&&(e=this._instances[e]),e&&(e.destroy(),delete this._instances[e.namespace])):Object.entries(this._instances).forEach((([e,t])=>{t.destroy(),delete this._instances[e]}))}getUserConfig(e={}){return e}getCombinedConfig(e){const t={...e.context||this.appConfig.context,...this.context},n=this.getMergedVariables(e);Object.keys(n).length>0&&(t.variables=n);const r={...this.appConfig.defaults,...e.defaults},o={...this.appConfig,...e,api:{...this.appConfig.api,...e.api},context:Object.keys(t).length?t:void 0,defaults:Object.keys(r).length?r:void 0};return"function"==typeof this.appConfig?this.appConfig(o):o}getMergedVariables(e){return{...this.appConfig.context?.variables||{},...e.context?.variables||{},...this.context.variables||{}}}};const cl=()=>{const e=zo();return{addEvent:t=>e(Fr(t)),clearEvents:()=>e(jr()),setEventsRead:t=>e(Yr(t)),setLoadedImageEventIds:t=>e(ao(t)),setIsLoading:t=>e(io(t)),setParticipant:t=>e(so(t)),setHeaderTitle:t=>e(no(t)),setHeaderSubTitle:t=>e(to(t)),setActiveService:t=>e(Gr(t)),initIdleDetachCountdown:t=>e($r(t)),decrementIdleDetachCountdownCounter:()=>e(Kr()),stopIdleDetachCountdownCounter:()=>e(xo()),clearIdleDetachCountdown:()=>e(Br()),initResumeConversationPrompt:()=>e(Jr()),clearResumeConversationPrompt:()=>e(Vr()),setServiceDataItem:t=>e(lo(t)),setFeatures:t=>e(eo(t)),setFeatureEnabledState:t=>e(Qr(t)),clearFeatures:()=>e(zr()),setInitialState:t=>e(oo(t)),setUserSelectedOptions:t=>e(bo(t)),setUserSelectedOption:t=>e(go(t)),showOption:t=>e(wo(t)),hideOption:()=>e(Hr()),setServiceEntryMetadata:t=>e(uo(t)),setBlockAutoEntrySwitch:t=>e(Xr(t)),setActiveEntryType:t=>e(qr(t)),setUserEntryType:t=>e(_o(t)),registerUpload:t=>e(Wr(t)),setUploadProgress:t=>e(vo(t)),setUploadComplete:t=>e(fo(t)),setUploadError:t=>e(ho(t)),clearAllUploads:()=>e(Ur()),setSeamlyContainerElement:t=>e(co(t))}};var ll=()=>{const{t:e}=ni(),{title:t,subTitle:n}=Cn().headerTitles,r=In(),{isOpen:o}=ri(),i=An(),a=Qt(mi),s=dn(),c=i?.avatar??s,l=a?"":n,u=["message-count"];return o&&u.push("message-count__hide"),0===r&&u.push("message-count__empty"),l||!o?bi("div",{className:Pi("agent-info"),children:[bi("div",{className:Pi("agent-info__graphic"),children:[c?bi("img",{className:Pi(i?.avatar?"avatar":"icon"),src:c,alt:""}):bi(Zi,{name:"avatar",size:"32",alt:""}),bi("span",{className:Pi(u),"aria-hidden":"true",children:r})]}),bi("div",{className:Pi("agent-info__body"),children:[bi("p",{className:Pi("agent-info__heading"),children:t??e("header.title")}),bi("p",{className:Pi("agent-info__text"),children:l})]})]}):null},ul=({children:e,onCloseChat:t})=>{const{headerCollapseButtonId:n}=Cn(),r=(0,Bo.li)(null),{t:o}=ni();return bi("header",{className:Pi("chat__header"),children:[e,bi("div",{className:Pi("header-controls"),children:bi("button",{type:"button",className:Pi("button","header-controls__collapse"),onClick:t,ref:r,id:n,children:bi(Zi,{name:"chevronDown",size:"32",alt:o("header.collapseApp")})})})]})},dl=function(e){if(window.seamly&&!Array.isArray(window.seamly))throw new Error("Seamly UI has already been initialised. Use the window.seamly object to start new instances instead.");const t=Array.isArray(window.seamly)?window.seamly:[],n=new sl(e);window.seamly={push:n.push.bind(n)},n.push(...t)}}(),r}()}));
|
|
2
|
+
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var n=t();for(var r in n)("object"==typeof exports?exports:e)[r]=n[r]}}(self,(function(){return function(){var e={2086:function(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}}},7402:function(e,t,n){"use strict";n.r(t),n.d(t,{Children:function(){return f},Component:function(){return r.uA},Fragment:function(){return r.FK},PureComponent:function(){return s},StrictMode:function(){return ee},Suspense:function(){return _},SuspenseList:function(){return w},__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:function(){return K},cloneElement:function(){return G},createContext:function(){return r.q6},createElement:function(){return r.n},createFactory:function(){return $},createPortal:function(){return E},createRef:function(){return r._3},default:function(){return ce},findDOMNode:function(){return Y},flushSync:function(){return Z},forwardRef:function(){return d},hydrate:function(){return P},isElement:function(){return ie},isFragment:function(){return W},isMemo:function(){return q},isValidElement:function(){return J},lazy:function(){return b},memo:function(){return c},render:function(){return A},startTransition:function(){return te},unmountComponentAtNode:function(){return X},unstable_batchedUpdates:function(){return Q},useCallback:function(){return o.hb},useContext:function(){return o.NT},useDebugValue:function(){return o.MN},useDeferredValue:function(){return ne},useEffect:function(){return o.vJ},useErrorBoundary:function(){return o.Md},useId:function(){return o.Bi},useImperativeHandle:function(){return o.Yn},useInsertionEffect:function(){return oe},useLayoutEffect:function(){return o.Nf},useMemo:function(){return o.Kr},useReducer:function(){return o.WO},useRef:function(){return o.li},useState:function(){return o.J0},useSyncExternalStore:function(){return ae},useTransition:function(){return re},version:function(){return H}});var r=n(172),o=n(5994);function i(e,t){for(var n in t)e[n]=t[n];return e}function a(e,t){for(var n in e)if("__source"!==n&&!(n in t))return!0;for(var r in t)if("__source"!==r&&e[r]!==t[r])return!0;return!1}function s(e,t){this.props=e,this.context=t}function c(e,t){function n(e){var n=this.props.ref,r=n==e.ref;return!r&&n&&(n.call?n(null):n.current=null),t?!t(this.props,e)||!r:a(this.props,e)}function o(t){return this.shouldComponentUpdate=n,(0,r.n)(e,t)}return o.displayName="Memo("+(e.displayName||e.name)+")",o.prototype.isReactComponent=!0,o.__f=!0,o}(s.prototype=new r.uA).isPureReactComponent=!0,s.prototype.shouldComponentUpdate=function(e,t){return a(this.props,e)||a(this.state,t)};var l=r.fF.__b;r.fF.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),l&&l(e)};var u="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.forward_ref")||3911;function d(e){function t(t){var n=i({},t);return delete n.ref,e(n,t.ref||null)}return t.$$typeof=u,t.render=t,t.prototype.isReactComponent=t.__f=!0,t.displayName="ForwardRef("+(e.displayName||e.name)+")",t}var p=function(e,t){return null==e?null:(0,r.v2)((0,r.v2)(e).map(t))},f={map:p,forEach:p,count:function(e){return e?(0,r.v2)(e).length:0},only:function(e){var t=(0,r.v2)(e);if(1!==t.length)throw"Children.only";return t[0]},toArray:r.v2},h=r.fF.__e;r.fF.__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);h(e,t,n,r)};var v=r.fF.unmount;function m(e,t,n){return e&&(e.__c&&e.__c.__H&&(e.__c.__H.__.forEach((function(e){"function"==typeof e.__c&&e.__c()})),e.__c.__H=null),null!=(e=i({},e)).__c&&(e.__c.__P===n&&(e.__c.__P=t),e.__c=null),e.__k=e.__k&&e.__k.map((function(e){return m(e,t,n)}))),e}function y(e,t,n){return e&&n&&(e.__v=null,e.__k=e.__k&&e.__k.map((function(e){return y(e,t,n)})),e.__c&&e.__c.__P===t&&(e.__e&&n.appendChild(e.__e),e.__c.__e=!0,e.__c.__P=n)),e}function _(){this.__u=0,this.t=null,this.__b=null}function g(e){var t=e.__.__c;return t&&t.__a&&t.__a(e)}function b(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.n)(n,i)}return i.displayName="Lazy",i.__f=!0,i}function w(){this.u=null,this.o=null}r.fF.unmount=function(e){var t=e.__c;t&&t.__R&&t.__R(),t&&32&e.__u&&(e.type=null),v&&v(e)},(_.prototype=new r.uA).__c=function(e,t){var n=t.__c,r=this;null==r.t&&(r.t=[]),r.t.push(n);var o=g(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]=y(e,e.__c.__P,e.__c.__O)}var t;for(r.setState({__a:r.__b=null});t=r.t.pop();)t.forceUpdate()}};r.__u++||32&t.__u||r.setState({__a:r.__b=r.__v.__k[0]}),e.then(a,a)},_.prototype.componentWillUnmount=function(){this.t=[]},_.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]=m(this.__b,n,o.__O=o.__P)}this.__b=null}var i=t.__a&&(0,r.n)(r.FK,null,e.fallback);return i&&(i.__u&=-33),[(0,r.n)(r.FK,null,t.__a?null:e.children),i]};var x=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 C(e){return this.getChildContext=function(){return e.context},e.children}function S(e){var t=this,n=e.i;t.componentWillUnmount=function(){(0,r.XX)(null,t.l),t.l=null,t.i=null},t.i&&t.i!==n&&t.componentWillUnmount(),t.l||(t.i=n,t.l={nodeType:1,parentNode:n,childNodes:[],contains:function(){return!0},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.XX)((0,r.n)(C,{context:t.context},e.__v),t.l)}function E(e,t){var n=(0,r.n)(S,{__v:e,i:t});return n.containerInfo=t,n}(w.prototype=new r.uA).__a=function(e){var t=this,n=g(t.__v),r=t.o.get(e);return r[0]++,function(o){var i=function(){t.props.revealOrder?(r.push(o),x(t,e,r)):o()};n?n(i):i()}},w.prototype.render=function(e){this.u=null,this.o=new Map;var t=(0,r.v2)(e.children);e.revealOrder&&"b"===e.revealOrder[0]&&t.reverse();for(var n=t.length;n--;)this.o.set(t[n],this.u=[1,0,this.u]);return e.children},w.prototype.componentDidUpdate=w.prototype.componentDidMount=function(){var e=this;this.o.forEach((function(t,n){x(e,n,t)}))};var T="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,N=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,I=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,O=/[A-Z0-9]/g,k="undefined"!=typeof document,L=function(e){return("undefined"!=typeof Symbol&&"symbol"==typeof Symbol()?/fil|che|rad/:/fil|che|ra/).test(e)};function A(e,t,n){return null==t.__k&&(t.textContent=""),(0,r.XX)(e,t),"function"==typeof n&&n(),e?e.__c:null}function P(e,t,n){return(0,r.Qv)(e,t),"function"==typeof n&&n(),e?e.__c:null}r.uA.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach((function(e){Object.defineProperty(r.uA.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})}));var M=r.fF.event;function R(){}function F(){return this.cancelBubble}function D(){return this.defaultPrevented}r.fF.event=function(e){return M&&(e=M(e)),e.persist=R,e.isPropagationStopped=F,e.isDefaultPrevented=D,e.nativeEvent=e};var U,j={enumerable:!1,configurable:!0,get:function(){return this.class}},z=r.fF.vnode;r.fF.vnode=function(e){"string"==typeof e.type&&function(e){var t=e.props,n=e.type,o={},i=-1===n.indexOf("-");for(var a in t){var s=t[a];if(!("value"===a&&"defaultValue"in t&&null==s||k&&"children"===a&&"noscript"===n||"class"===a||"className"===a)){var c=a.toLowerCase();"defaultValue"===a&&"value"in t&&null==t.value?a="value":"download"===a&&!0===s?s="":"translate"===c&&"no"===s?s=!1:"o"===c[0]&&"n"===c[1]?"ondoubleclick"===c?a="ondblclick":"onchange"!==c||"input"!==n&&"textarea"!==n||L(t.type)?"onfocus"===c?a="onfocusin":"onblur"===c?a="onfocusout":I.test(a)&&(a=c):c=a="oninput":i&&N.test(a)?a=a.replace(O,"-$&").toLowerCase():null===s&&(s=void 0),"oninput"===c&&o[a=c]&&(a="oninputCapture"),o[a]=s}}"select"==n&&o.multiple&&Array.isArray(o.value)&&(o.value=(0,r.v2)(t.children).forEach((function(e){e.props.selected=-1!=o.value.indexOf(e.props.value)}))),"select"==n&&null!=o.defaultValue&&(o.value=(0,r.v2)(t.children).forEach((function(e){e.props.selected=o.multiple?-1!=o.defaultValue.indexOf(e.props.value):o.defaultValue==e.props.value}))),t.class&&!t.className?(o.class=t.class,Object.defineProperty(o,"className",j)):(t.className&&!t.class||t.class&&t.className)&&(o.class=o.className=t.className),e.props=o}(e),e.$$typeof=T,z&&z(e)};var B=r.fF.__r;r.fF.__r=function(e){B&&B(e),U=e.__c};var V=r.fF.diffed;r.fF.diffed=function(e){V&&V(e);var t=e.props,n=e.__e;null!=n&&"textarea"===e.type&&"value"in t&&t.value!==n.value&&(n.value=null==t.value?"":t.value),U=null};var K={ReactCurrentDispatcher:{current:{readContext:function(e){return U.__n[e.__c].props.value},useCallback:o.hb,useContext:o.NT,useDebugValue:o.MN,useDeferredValue:ne,useEffect:o.vJ,useId:o.Bi,useImperativeHandle:o.Yn,useInsertionEffect:oe,useLayoutEffect:o.Nf,useMemo:o.Kr,useReducer:o.WO,useRef:o.li,useState:o.J0,useSyncExternalStore:ae,useTransition:re}}},H="17.0.2";function $(e){return r.n.bind(null,e)}function J(e){return!!e&&e.$$typeof===T}function W(e){return J(e)&&e.type===r.FK}function q(e){return!!e&&!!e.displayName&&("string"==typeof e.displayName||e.displayName instanceof String)&&e.displayName.startsWith("Memo(")}function G(e){return J(e)?r.Ob.apply(null,arguments):e}function X(e){return!!e.__k&&((0,r.XX)(null,e),!0)}function Y(e){return e&&(e.base||1===e.nodeType&&e)||null}var Q=function(e,t){return e(t)},Z=function(e,t){return e(t)},ee=r.FK;function te(e){e()}function ne(e){return e}function re(){return[!1,te]}var oe=o.Nf,ie=J;function ae(e,t){var n=t(),r=(0,o.J0)({h:{__:n,v:t}}),i=r[0].h,a=r[1];return(0,o.Nf)((function(){i.__=n,i.v=t,se(i)&&a({h:i})}),[e,n,t]),(0,o.vJ)((function(){return se(i)&&a({h:i}),e((function(){se(i)&&a({h:i})}))}),[e]),n}function se(e){var t,n,r=e.v,o=e.__;try{var i=r();return!((t=o)===(n=i)&&(0!==t||1/t==1/n)||t!=t&&n!=n)}catch(e){return!0}}var ce={useState:o.J0,useId:o.Bi,useReducer:o.WO,useEffect:o.vJ,useLayoutEffect:o.Nf,useInsertionEffect:oe,useTransition:re,useDeferredValue:ne,useSyncExternalStore:ae,startTransition:te,useRef:o.li,useImperativeHandle:o.Yn,useMemo:o.Kr,useCallback:o.hb,useContext:o.NT,useDebugValue:o.MN,version:"17.0.2",Children:f,render:A,hydrate:P,unmountComponentAtNode:X,createPortal:E,createElement:r.n,createContext:r.q6,createFactory:$,cloneElement:G,createRef:r._3,Fragment:r.FK,isValidElement:J,isElement:ie,isFragment:W,isMemo:q,findDOMNode:Y,Component:r.uA,PureComponent:s,memo:c,forwardRef:d,flushSync:Z,unstable_batchedUpdates:Q,StrictMode:ee,Suspense:_,SuspenseList:w,lazy:b,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:K}},172:function(e,t,n){"use strict";n.d(t,{FK:function(){return C},Ob:function(){return $},Qv:function(){return H},XX:function(){return K},_3:function(){return x},fF:function(){return o},n:function(){return b},q6:function(){return J},uA:function(){return S},v2:function(){return A}});var r,o,i,a,s,c,l,u,d,p,f,h={},v=[],m=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,y=Array.isArray;function _(e,t){for(var n in t)e[n]=t[n];return e}function g(e){var t=e.parentNode;t&&t.removeChild(e)}function b(e,t,n){var o,i,a,s={};for(a in t)"key"==a?o=t[a]:"ref"==a?i=t[a]:s[a]=t[a];if(arguments.length>2&&(s.children=arguments.length>3?r.call(arguments,2):n),"function"==typeof e&&null!=e.defaultProps)for(a in e.defaultProps)void 0===s[a]&&(s[a]=e.defaultProps[a]);return w(e,s,o,i,null)}function w(e,t,n,r,a){var s={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:null==a?++i:a,__i:-1,__u:0};return null==a&&null!=o.vnode&&o.vnode(s),s}function x(){return{current:null}}function C(e){return e.children}function S(e,t){this.props=e,this.context=t}function E(e,t){if(null==t)return e.__?E(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e)return n.__e;return"function"==typeof e.type?E(e):null}function T(e){var t,n;if(null!=(e=e.__)&&null!=e.__c){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e){e.__e=e.__c.base=n.__e;break}return T(e)}}function N(e){(!e.__d&&(e.__d=!0)&&a.push(e)&&!I.__r++||s!==o.debounceRendering)&&((s=o.debounceRendering)||c)(I)}function I(){var e,t,n,r,i,s,c,u;for(a.sort(l);e=a.shift();)e.__d&&(t=a.length,r=void 0,s=(i=(n=e).__v).__e,c=[],u=[],n.__P&&((r=_({},i)).__v=i.__v+1,o.vnode&&o.vnode(r),D(n.__P,r,i,n.__n,n.__P.namespaceURI,32&i.__u?[s]:null,c,null==s?E(i):s,!!(32&i.__u),u),r.__v=i.__v,r.__.__k[r.__i]=r,U(c,r,u),r.__e!=s&&T(r)),a.length>t&&a.sort(l));I.__r=0}function O(e,t,n,r,o,i,a,s,c,l,u){var d,p,f,m,y,_=r&&r.__k||v,g=t.length;for(n.__d=c,k(n,t,_),c=n.__d,d=0;d<g;d++)null!=(f=n.__k[d])&&"boolean"!=typeof f&&"function"!=typeof f&&(p=-1===f.__i?h:_[f.__i]||h,f.__i=d,D(e,f,p,o,i,a,s,c,l,u),m=f.__e,f.ref&&p.ref!=f.ref&&(p.ref&&z(p.ref,null,f),u.push(f.ref,f.__c||m,f)),null==y&&null!=m&&(y=m),65536&f.__u||p.__k===f.__k?c=L(f,c,e):"function"==typeof f.type&&void 0!==f.__d?c=f.__d:m&&(c=m.nextSibling),f.__d=void 0,f.__u&=-196609);n.__d=c,n.__e=y}function k(e,t,n){var r,o,i,a,s,c=t.length,l=n.length,u=l,d=0;for(e.__k=[],r=0;r<c;r++)a=r+d,null!=(o=e.__k[r]=null==(o=t[r])||"boolean"==typeof o||"function"==typeof o?null:"string"==typeof o||"number"==typeof o||"bigint"==typeof o||o.constructor==String?w(null,o,null,null,null):y(o)?w(C,{children:o},null,null,null):void 0===o.constructor&&o.__b>0?w(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):o)?(o.__=e,o.__b=e.__b+1,s=P(o,n,a,u),o.__i=s,i=null,-1!==s&&(u--,(i=n[s])&&(i.__u|=131072)),null==i||null===i.__v?(-1==s&&d--,"function"!=typeof o.type&&(o.__u|=65536)):s!==a&&(s==a-1?d--:s==a+1?d++:s>a?u>c-a?d+=s-a:d--:s<a&&(s==a-d?d-=s-a:d++),s!==r+d&&(o.__u|=65536))):(i=n[a])&&null==i.key&&i.__e&&!(131072&i.__u)&&(i.__e==e.__d&&(e.__d=E(i)),B(i,i,!1),n[a]=null,u--);if(u)for(r=0;r<l;r++)null!=(i=n[r])&&!(131072&i.__u)&&(i.__e==e.__d&&(e.__d=E(i)),B(i,i))}function L(e,t,n){var r,o;if("function"==typeof e.type){for(r=e.__k,o=0;r&&o<r.length;o++)r[o]&&(r[o].__=e,t=L(r[o],t,n));return t}e.__e!=t&&(t&&e.type&&!n.contains(t)&&(t=E(e)),n.insertBefore(e.__e,t||null),t=e.__e);do{t=t&&t.nextSibling}while(null!=t&&8===t.nodeType);return t}function A(e,t){return t=t||[],null==e||"boolean"==typeof e||(y(e)?e.some((function(e){A(e,t)})):t.push(e)),t}function P(e,t,n,r){var o=e.key,i=e.type,a=n-1,s=n+1,c=t[n];if(null===c||c&&o==c.key&&i===c.type&&!(131072&c.__u))return n;if(r>(null==c||131072&c.__u?0:1))for(;a>=0||s<t.length;){if(a>=0){if((c=t[a])&&!(131072&c.__u)&&o==c.key&&i===c.type)return a;a--}if(s<t.length){if((c=t[s])&&!(131072&c.__u)&&o==c.key&&i===c.type)return s;s++}}return-1}function M(e,t,n){"-"===t[0]?e.setProperty(t,null==n?"":n):e[t]=null==n?"":"number"!=typeof n||m.test(t)?n:n+"px"}function R(e,t,n,r,o){var i;e:if("style"===t)if("string"==typeof n)e.style.cssText=n;else{if("string"==typeof r&&(e.style.cssText=r=""),r)for(t in r)n&&t in n||M(e.style,t,"");if(n)for(t in n)r&&n[t]===r[t]||M(e.style,t,n[t])}else if("o"===t[0]&&"n"===t[1])i=t!==(t=t.replace(/(PointerCapture)$|Capture$/i,"$1")),t=t.toLowerCase()in e||"onFocusOut"===t||"onFocusIn"===t?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+i]=n,n?r?n.u=r.u:(n.u=u,e.addEventListener(t,i?p:d,i)):e.removeEventListener(t,i?p:d,i);else{if("http://www.w3.org/2000/svg"==o)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!=t&&"height"!=t&&"href"!=t&&"list"!=t&&"form"!=t&&"tabIndex"!=t&&"download"!=t&&"rowSpan"!=t&&"colSpan"!=t&&"role"!=t&&"popover"!=t&&t in e)try{e[t]=null==n?"":n;break e}catch(e){}"function"==typeof n||(null==n||!1===n&&"-"!==t[4]?e.removeAttribute(t):e.setAttribute(t,"popover"==t&&1==n?"":n))}}function F(e){return function(t){if(this.l){var n=this.l[t.type+e];if(null==t.t)t.t=u++;else if(t.t<n.u)return;return n(o.event?o.event(t):t)}}}function D(e,t,n,r,i,a,s,c,l,u){var d,p,f,h,v,m,g,b,w,x,E,T,N,I,k,L,A=t.type;if(void 0!==t.constructor)return null;128&n.__u&&(l=!!(32&n.__u),a=[c=t.__e=n.__e]),(d=o.__b)&&d(t);e:if("function"==typeof A)try{if(b=t.props,w="prototype"in A&&A.prototype.render,x=(d=A.contextType)&&r[d.__c],E=d?x?x.props.value:d.__:r,n.__c?g=(p=t.__c=n.__c).__=p.__E:(w?t.__c=p=new A(b,E):(t.__c=p=new S(b,E),p.constructor=A,p.render=V),x&&x.sub(p),p.props=b,p.state||(p.state={}),p.context=E,p.__n=r,f=p.__d=!0,p.__h=[],p._sb=[]),w&&null==p.__s&&(p.__s=p.state),w&&null!=A.getDerivedStateFromProps&&(p.__s==p.state&&(p.__s=_({},p.__s)),_(p.__s,A.getDerivedStateFromProps(b,p.__s))),h=p.props,v=p.state,p.__v=t,f)w&&null==A.getDerivedStateFromProps&&null!=p.componentWillMount&&p.componentWillMount(),w&&null!=p.componentDidMount&&p.__h.push(p.componentDidMount);else{if(w&&null==A.getDerivedStateFromProps&&b!==h&&null!=p.componentWillReceiveProps&&p.componentWillReceiveProps(b,E),!p.__e&&(null!=p.shouldComponentUpdate&&!1===p.shouldComponentUpdate(b,p.__s,E)||t.__v===n.__v)){for(t.__v!==n.__v&&(p.props=b,p.state=p.__s,p.__d=!1),t.__e=n.__e,t.__k=n.__k,t.__k.forEach((function(e){e&&(e.__=t)})),T=0;T<p._sb.length;T++)p.__h.push(p._sb[T]);p._sb=[],p.__h.length&&s.push(p);break e}null!=p.componentWillUpdate&&p.componentWillUpdate(b,p.__s,E),w&&null!=p.componentDidUpdate&&p.__h.push((function(){p.componentDidUpdate(h,v,m)}))}if(p.context=E,p.props=b,p.__P=e,p.__e=!1,N=o.__r,I=0,w){for(p.state=p.__s,p.__d=!1,N&&N(t),d=p.render(p.props,p.state,p.context),k=0;k<p._sb.length;k++)p.__h.push(p._sb[k]);p._sb=[]}else do{p.__d=!1,N&&N(t),d=p.render(p.props,p.state,p.context),p.state=p.__s}while(p.__d&&++I<25);p.state=p.__s,null!=p.getChildContext&&(r=_(_({},r),p.getChildContext())),w&&!f&&null!=p.getSnapshotBeforeUpdate&&(m=p.getSnapshotBeforeUpdate(h,v)),O(e,y(L=null!=d&&d.type===C&&null==d.key?d.props.children:d)?L:[L],t,n,r,i,a,s,c,l,u),p.base=t.__e,t.__u&=-161,p.__h.length&&s.push(p),g&&(p.__E=p.__=null)}catch(e){if(t.__v=null,l||null!=a){for(t.__u|=l?160:32;c&&8===c.nodeType&&c.nextSibling;)c=c.nextSibling;a[a.indexOf(c)]=null,t.__e=c}else t.__e=n.__e,t.__k=n.__k;o.__e(e,t,n)}else null==a&&t.__v===n.__v?(t.__k=n.__k,t.__e=n.__e):t.__e=j(n.__e,t,n,r,i,a,s,l,u);(d=o.diffed)&&d(t)}function U(e,t,n){t.__d=void 0;for(var r=0;r<n.length;r++)z(n[r],n[++r],n[++r]);o.__c&&o.__c(t,e),e.some((function(t){try{e=t.__h,t.__h=[],e.some((function(e){e.call(t)}))}catch(e){o.__e(e,t.__v)}}))}function j(e,t,n,o,i,a,s,c,l){var u,d,p,f,v,m,_,b=n.props,w=t.props,x=t.type;if("svg"===x?i="http://www.w3.org/2000/svg":"math"===x?i="http://www.w3.org/1998/Math/MathML":i||(i="http://www.w3.org/1999/xhtml"),null!=a)for(u=0;u<a.length;u++)if((v=a[u])&&"setAttribute"in v==!!x&&(x?v.localName===x:3===v.nodeType)){e=v,a[u]=null;break}if(null==e){if(null===x)return document.createTextNode(w);e=document.createElementNS(i,x,w.is&&w),a=null,c=!1}if(null===x)b===w||c&&e.data===w||(e.data=w);else{if(a=a&&r.call(e.childNodes),b=n.props||h,!c&&null!=a)for(b={},u=0;u<e.attributes.length;u++)b[(v=e.attributes[u]).name]=v.value;for(u in b)if(v=b[u],"children"==u);else if("dangerouslySetInnerHTML"==u)p=v;else if("key"!==u&&!(u in w)){if("value"==u&&"defaultValue"in w||"checked"==u&&"defaultChecked"in w)continue;R(e,u,null,v,i)}for(u in w)v=w[u],"children"==u?f=v:"dangerouslySetInnerHTML"==u?d=v:"value"==u?m=v:"checked"==u?_=v:"key"===u||c&&"function"!=typeof v||b[u]===v||R(e,u,v,b[u],i);if(d)c||p&&(d.__html===p.__html||d.__html===e.innerHTML)||(e.innerHTML=d.__html),t.__k=[];else if(p&&(e.innerHTML=""),O(e,y(f)?f:[f],t,n,o,"foreignObject"===x?"http://www.w3.org/1999/xhtml":i,a,s,a?a[0]:n.__k&&E(n,0),c,l),null!=a)for(u=a.length;u--;)null!=a[u]&&g(a[u]);c||(u="value",void 0!==m&&(m!==e[u]||"progress"===x&&!m||"option"===x&&m!==b[u])&&R(e,u,m,b[u],i),u="checked",void 0!==_&&_!==e[u]&&R(e,u,_,b[u],i))}return e}function z(e,t,n){try{if("function"==typeof e){var r="function"==typeof e.__u;r&&e.__u(),r&&null==t||(e.__u=e(t))}else e.current=t}catch(e){o.__e(e,n)}}function B(e,t,n){var r,i;if(o.unmount&&o.unmount(e),(r=e.ref)&&(r.current&&r.current!==e.__e||z(r,null,t)),null!=(r=e.__c)){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(e){o.__e(e,t)}r.base=r.__P=null}if(r=e.__k)for(i=0;i<r.length;i++)r[i]&&B(r[i],t,n||"function"!=typeof e.type);n||null==e.__e||g(e.__e),e.__c=e.__=e.__e=e.__d=void 0}function V(e,t,n){return this.constructor(e,n)}function K(e,t,n){var i,a,s,c;o.__&&o.__(e,t),a=(i="function"==typeof n)?null:n&&n.__k||t.__k,s=[],c=[],D(t,e=(!i&&n||t).__k=b(C,null,[e]),a||h,h,t.namespaceURI,!i&&n?[n]:a?null:t.firstChild?r.call(t.childNodes):null,s,!i&&n?n:a?a.__e:t.firstChild,i,c),U(s,e,c)}function H(e,t){K(e,t,H)}function $(e,t,n){var o,i,a,s,c=_({},e.props);for(a in e.type&&e.type.defaultProps&&(s=e.type.defaultProps),t)"key"==a?o=t[a]:"ref"==a?i=t[a]:c[a]=void 0===t[a]&&void 0!==s?s[a]:t[a];return arguments.length>2&&(c.children=arguments.length>3?r.call(arguments,2):n),w(e.type,c,o||e.key,i||e.ref,null)}function J(e,t){var n={__c:t="__cC"+f++,__:e,Consumer:function(e,t){return e.children(t)},Provider:function(e){var n,r;return this.getChildContext||(n=[],(r={})[t]=this,this.getChildContext=function(){return r},this.componentWillUnmount=function(){n=null},this.shouldComponentUpdate=function(e){this.props.value!==e.value&&n.some((function(e){e.__e=!0,N(e)}))},this.sub=function(e){n.push(e);var t=e.componentWillUnmount;e.componentWillUnmount=function(){n&&n.splice(n.indexOf(e),1),t&&t.call(e)}}),e.children}};return n.Provider.__=n.Consumer.contextType=n}r=v.slice,o={__e:function(e,t,n,r){for(var o,i,a;t=t.__;)if((o=t.__c)&&!o.__)try{if((i=o.constructor)&&null!=i.getDerivedStateFromError&&(o.setState(i.getDerivedStateFromError(e)),a=o.__d),null!=o.componentDidCatch&&(o.componentDidCatch(e,r||{}),a=o.__d),a)return o.__E=o}catch(t){e=t}throw e}},i=0,S.prototype.setState=function(e,t){var n;n=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=_({},this.state),"function"==typeof e&&(e=e(_({},n),this.props)),e&&_(n,e),null!=e&&this.__v&&(t&&this._sb.push(t),N(this))},S.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),N(this))},S.prototype.render=C,a=[],c="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,l=function(e,t){return e.__v.__b-t.__v.__b},I.__r=0,u=0,d=F(!1),p=F(!0),f=0},5994:function(e,t,n){"use strict";n.d(t,{Bi:function(){return O},J0:function(){return _},Kr:function(){return S},MN:function(){return N},Md:function(){return I},NT:function(){return T},Nf:function(){return w},WO:function(){return g},Yn:function(){return C},hb:function(){return E},li:function(){return x},vJ:function(){return b}});var r,o,i,a,s=n(172),c=0,l=[],u=s.fF,d=u.__b,p=u.__r,f=u.diffed,h=u.__c,v=u.unmount,m=u.__;function y(e,t){u.__h&&u.__h(o,e,c||t),c=0;var n=o.__H||(o.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function _(e){return c=1,g(F,e)}function g(e,t,n){var i=y(r++,2);if(i.t=e,!i.__c&&(i.__=[n?n(t):F(void 0,t),function(e){var t=i.__N?i.__N[0]:i.__[0],n=i.t(t,e);t!==n&&(i.__N=[n,i.__[1]],i.__c.setState({}))}],i.__c=o,!o.u)){var a=function(e,t,n){if(!i.__c.__H)return!0;var r=i.__c.__H.__.filter((function(e){return!!e.__c}));if(r.every((function(e){return!e.__N})))return!s||s.call(this,e,t,n);var o=!1;return r.forEach((function(e){if(e.__N){var t=e.__[0];e.__=e.__N,e.__N=void 0,t!==e.__[0]&&(o=!0)}})),!(!o&&i.__c.props===e)&&(!s||s.call(this,e,t,n))};o.u=!0;var s=o.shouldComponentUpdate,c=o.componentWillUpdate;o.componentWillUpdate=function(e,t,n){if(this.__e){var r=s;s=void 0,a(e,t,n),s=r}c&&c.call(this,e,t,n)},o.shouldComponentUpdate=a}return i.__N||i.__}function b(e,t){var n=y(r++,3);!u.__s&&R(n.__H,t)&&(n.__=e,n.i=t,o.__H.__h.push(n))}function w(e,t){var n=y(r++,4);!u.__s&&R(n.__H,t)&&(n.__=e,n.i=t,o.__h.push(n))}function x(e){return c=5,S((function(){return{current:e}}),[])}function C(e,t,n){c=6,w((function(){return"function"==typeof e?(e(t()),function(){return e(null)}):e?(e.current=t(),function(){return e.current=null}):void 0}),null==n?n:n.concat(e))}function S(e,t){var n=y(r++,7);return R(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function E(e,t){return c=8,S((function(){return e}),t)}function T(e){var t=o.context[e.__c],n=y(r++,9);return n.c=e,t?(null==n.__&&(n.__=!0,t.sub(o)),t.props.value):e.__}function N(e,t){u.useDebugValue&&u.useDebugValue(t?t(e):e)}function I(e){var t=y(r++,10),n=_();return t.__=e,o.componentDidCatch||(o.componentDidCatch=function(e,r){t.__&&t.__(e,r),n[1](e)}),[n[0],function(){n[1](void 0)}]}function O(){var e=y(r++,11);if(!e.__){for(var t=o.__v;null!==t&&!t.__m&&null!==t.__;)t=t.__;var n=t.__m||(t.__m=[0,0]);e.__="P"+n[0]+"-"+n[1]++}return e.__}function k(){for(var e;e=l.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(P),e.__H.__h.forEach(M),e.__H.__h=[]}catch(t){e.__H.__h=[],u.__e(t,e.__v)}}u.__b=function(e){o=null,d&&d(e)},u.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),m&&m(e,t)},u.__r=function(e){p&&p(e),r=0;var t=(o=e.__c).__H;t&&(i===o?(t.__h=[],o.__h=[],t.__.forEach((function(e){e.__N&&(e.__=e.__N),e.i=e.__N=void 0}))):(t.__h.forEach(P),t.__h.forEach(M),t.__h=[],r=0)),i=o},u.diffed=function(e){f&&f(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(1!==l.push(t)&&a===u.requestAnimationFrame||((a=u.requestAnimationFrame)||A)(k)),t.__H.__.forEach((function(e){e.i&&(e.__H=e.i),e.i=void 0}))),i=o=null},u.__c=function(e,t){t.some((function(e){try{e.__h.forEach(P),e.__h=e.__h.filter((function(e){return!e.__||M(e)}))}catch(n){t.some((function(e){e.__h&&(e.__h=[])})),t=[],u.__e(n,e.__v)}})),h&&h(e,t)},u.unmount=function(e){v&&v(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach((function(e){try{P(e)}catch(e){t=e}})),n.__H=void 0,t&&u.__e(t,n.__v))};var L="function"==typeof requestAnimationFrame;function A(e){var t,n=function(){clearTimeout(r),L&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,100);L&&(t=requestAnimationFrame(n))}function P(e){var t=o,n=e.__c;"function"==typeof n&&(e.__c=void 0,n()),o=t}function M(e){var t=o;e.__c=e.__(),o=t}function R(e,t){return!e||e.length!==t.length||t.some((function(t,n){return t!==e[n]}))}function F(e,t){return"function"==typeof t?t(e):t}},7154:function(e,t,n){"use strict";var r=n(7402),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.useSyncExternalStore,a=r.useRef,s=r.useEffect,c=r.useMemo,l=r.useDebugValue;t.useSyncExternalStoreWithSelector=function(e,t,n,r,u){var d=a(null);if(null===d.current){var p={hasValue:!1,value:null};d.current=p}else p=d.current;d=c((function(){function e(e){if(!s){if(s=!0,i=e,e=r(e),void 0!==u&&p.hasValue){var t=p.value;if(u(t,e))return a=t}return a=e}if(t=a,o(i,e))return t;var n=r(e);return void 0!==u&&u(t,n)?t:(i=e,a=n)}var i,a,s=!1,c=void 0===n?null:n;return[function(){return e(t())},null===c?void 0:function(){return e(c())}]}),[t,n,r,u]);var f=i(e,d[0],d[1]);return s((function(){p.hasValue=!0,p.value=f}),[f]),l(f),f}},8418:function(e,t,n){"use strict";e.exports=n(7154)},9497:function(e,t,n){"use strict";n(8107);var r=n(7015);e.exports=r("Array","at")},9306:function(e,t,n){"use strict";var r=n(4901),o=n(6823),i=TypeError;e.exports=function(e){if(r(e))return e;throw new i(o(e)+" is not a function")}},7080:function(e,t,n){"use strict";var r=n(4402).has;e.exports=function(e){return r(e),e}},6469:function(e,t,n){"use strict";var r=n(8227),o=n(2360),i=n(4913).f,a=r("unscopables"),s=Array.prototype;void 0===s[a]&&i(s,a,{configurable:!0,value:o(null)}),e.exports=function(e){s[a][e]=!0}},8551:function(e,t,n){"use strict";var r=n(34),o=String,i=TypeError;e.exports=function(e){if(r(e))return e;throw new i(o(e)+" is not an object")}},9617:function(e,t,n){"use strict";var r=n(5397),o=n(5610),i=n(6198),a=function(e){return function(t,n,a){var s=r(t),c=i(s);if(0===c)return!e&&-1;var l,u=o(a,c);if(e&&n!=n){for(;c>u;)if((l=s[u++])!=l)return!0}else for(;c>u;u++)if((e||u in s)&&s[u]===n)return e||u||0;return!e&&-1}};e.exports={includes:a(!0),indexOf:a(!1)}},4527:function(e,t,n){"use strict";var r=n(3724),o=n(4376),i=TypeError,a=Object.getOwnPropertyDescriptor,s=r&&!function(){if(void 0!==this)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(e){return e instanceof TypeError}}();e.exports=s?function(e,t){if(o(e)&&!a(e,"length").writable)throw new i("Cannot set read only .length");return e.length=t}:function(e,t){return e.length=t}},2195:function(e,t,n){"use strict";var r=n(9504),o=r({}.toString),i=r("".slice);e.exports=function(e){return i(o(e),8,-1)}},7740:function(e,t,n){"use strict";var r=n(9297),o=n(5031),i=n(7347),a=n(4913);e.exports=function(e,t,n){for(var s=o(t),c=a.f,l=i.f,u=0;u<s.length;u++){var d=s[u];r(e,d)||n&&r(n,d)||c(e,d,l(t,d))}}},6699:function(e,t,n){"use strict";var r=n(3724),o=n(4913),i=n(6980);e.exports=r?function(e,t,n){return o.f(e,t,i(1,n))}:function(e,t,n){return e[t]=n,e}},6980:function(e){"use strict";e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},6840:function(e,t,n){"use strict";var r=n(4901),o=n(4913),i=n(283),a=n(9433);e.exports=function(e,t,n,s){s||(s={});var c=s.enumerable,l=void 0!==s.name?s.name:t;if(r(n)&&i(n,l,s),s.global)c?e[t]=n:a(t,n);else{try{s.unsafe?e[t]&&(c=!0):delete e[t]}catch(e){}c?e[t]=n:o.f(e,t,{value:n,enumerable:!1,configurable:!s.nonConfigurable,writable:!s.nonWritable})}return e}},9433:function(e,t,n){"use strict";var r=n(4576),o=Object.defineProperty;e.exports=function(e,t){try{o(r,e,{value:t,configurable:!0,writable:!0})}catch(n){r[e]=t}return t}},3724:function(e,t,n){"use strict";var r=n(9039);e.exports=!r((function(){return 7!==Object.defineProperty({},1,{get:function(){return 7}})[1]}))},4055:function(e,t,n){"use strict";var r=n(4576),o=n(34),i=r.document,a=o(i)&&o(i.createElement);e.exports=function(e){return a?i.createElement(e):{}}},6837:function(e){"use strict";var t=TypeError;e.exports=function(e){if(e>9007199254740991)throw t("Maximum allowed index exceeded");return e}},7015:function(e,t,n){"use strict";var r=n(4576),o=n(9504);e.exports=function(e,t){return o(r[e].prototype[t])}},8727:function(e){"use strict";e.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},2839:function(e,t,n){"use strict";var r=n(4576).navigator,o=r&&r.userAgent;e.exports=o?String(o):""},9519:function(e,t,n){"use strict";var r,o,i=n(4576),a=n(2839),s=i.process,c=i.Deno,l=s&&s.versions||c&&c.version,u=l&&l.v8;u&&(o=(r=u.split("."))[0]>0&&r[0]<4?1:+(r[0]+r[1])),!o&&a&&(!(r=a.match(/Edge\/(\d+)/))||r[1]>=74)&&(r=a.match(/Chrome\/(\d+)/))&&(o=+r[1]),e.exports=o},6518:function(e,t,n){"use strict";var r=n(4576),o=n(7347).f,i=n(6699),a=n(6840),s=n(9433),c=n(7740),l=n(2796);e.exports=function(e,t){var n,u,d,p,f,h=e.target,v=e.global,m=e.stat;if(n=v?r:m?r[h]||s(h,{}):r[h]&&r[h].prototype)for(u in t){if(p=t[u],d=e.dontCallGetSet?(f=o(n,u))&&f.value:n[u],!l(v?u:h+(m?".":"#")+u,e.forced)&&void 0!==d){if(typeof p==typeof d)continue;c(p,d)}(e.sham||d&&d.sham)&&i(p,"sham",!0),a(n,u,p,e)}}},9039:function(e){"use strict";e.exports=function(e){try{return!!e()}catch(e){return!0}}},616:function(e,t,n){"use strict";var r=n(9039);e.exports=!r((function(){var e=function(){}.bind();return"function"!=typeof e||e.hasOwnProperty("prototype")}))},9565:function(e,t,n){"use strict";var r=n(616),o=Function.prototype.call;e.exports=r?o.bind(o):function(){return o.apply(o,arguments)}},350:function(e,t,n){"use strict";var r=n(3724),o=n(9297),i=Function.prototype,a=r&&Object.getOwnPropertyDescriptor,s=o(i,"name"),c=s&&"something"===function(){}.name,l=s&&(!r||r&&a(i,"name").configurable);e.exports={EXISTS:s,PROPER:c,CONFIGURABLE:l}},6706:function(e,t,n){"use strict";var r=n(9504),o=n(9306);e.exports=function(e,t,n){try{return r(o(Object.getOwnPropertyDescriptor(e,t)[n]))}catch(e){}}},9504:function(e,t,n){"use strict";var r=n(616),o=Function.prototype,i=o.call,a=r&&o.bind.bind(i,i);e.exports=r?a:function(e){return function(){return i.apply(e,arguments)}}},7751:function(e,t,n){"use strict";var r=n(4576),o=n(4901);e.exports=function(e,t){return arguments.length<2?(n=r[e],o(n)?n:void 0):r[e]&&r[e][t];var n}},1767:function(e){"use strict";e.exports=function(e){return{iterator:e,next:e.next,done:!1}}},5966:function(e,t,n){"use strict";var r=n(9306),o=n(4117);e.exports=function(e,t){var n=e[t];return o(n)?void 0:r(n)}},3789:function(e,t,n){"use strict";var r=n(9306),o=n(8551),i=n(9565),a=n(1291),s=n(1767),c="Invalid size",l=RangeError,u=TypeError,d=Math.max,p=function(e,t){this.set=e,this.size=d(t,0),this.has=r(e.has),this.keys=r(e.keys)};p.prototype={getIterator:function(){return s(o(i(this.keys,this.set)))},includes:function(e){return i(this.has,this.set,e)}},e.exports=function(e){o(e);var t=+e.size;if(t!=t)throw new u(c);var n=a(t);if(n<0)throw new l(c);return new p(e,n)}},4576:function(e,t,n){"use strict";var r=function(e){return e&&e.Math===Math&&e};e.exports=r("object"==typeof globalThis&&globalThis)||r("object"==typeof window&&window)||r("object"==typeof self&&self)||r("object"==typeof n.g&&n.g)||r("object"==typeof this&&this)||function(){return this}()||Function("return this")()},9297:function(e,t,n){"use strict";var r=n(9504),o=n(8981),i=r({}.hasOwnProperty);e.exports=Object.hasOwn||function(e,t){return i(o(e),t)}},421:function(e){"use strict";e.exports={}},397:function(e,t,n){"use strict";var r=n(7751);e.exports=r("document","documentElement")},5917:function(e,t,n){"use strict";var r=n(3724),o=n(9039),i=n(4055);e.exports=!r&&!o((function(){return 7!==Object.defineProperty(i("div"),"a",{get:function(){return 7}}).a}))},7055:function(e,t,n){"use strict";var r=n(9504),o=n(9039),i=n(2195),a=Object,s=r("".split);e.exports=o((function(){return!a("z").propertyIsEnumerable(0)}))?function(e){return"String"===i(e)?s(e,""):a(e)}:a},3706:function(e,t,n){"use strict";var r=n(9504),o=n(4901),i=n(7629),a=r(Function.toString);o(i.inspectSource)||(i.inspectSource=function(e){return a(e)}),e.exports=i.inspectSource},1181:function(e,t,n){"use strict";var r,o,i,a=n(8622),s=n(4576),c=n(34),l=n(6699),u=n(9297),d=n(7629),p=n(6119),f=n(421),h="Object already initialized",v=s.TypeError,m=s.WeakMap;if(a||d.state){var y=d.state||(d.state=new m);y.get=y.get,y.has=y.has,y.set=y.set,r=function(e,t){if(y.has(e))throw new v(h);return t.facade=e,y.set(e,t),t},o=function(e){return y.get(e)||{}},i=function(e){return y.has(e)}}else{var _=p("state");f[_]=!0,r=function(e,t){if(u(e,_))throw new v(h);return t.facade=e,l(e,_,t),t},o=function(e){return u(e,_)?e[_]:{}},i=function(e){return u(e,_)}}e.exports={set:r,get:o,has:i,enforce:function(e){return i(e)?o(e):r(e,{})},getterFor:function(e){return function(t){var n;if(!c(t)||(n=o(t)).type!==e)throw new v("Incompatible receiver, "+e+" required");return n}}}},4376:function(e,t,n){"use strict";var r=n(2195);e.exports=Array.isArray||function(e){return"Array"===r(e)}},4901:function(e){"use strict";var t="object"==typeof document&&document.all;e.exports=void 0===t&&void 0!==t?function(e){return"function"==typeof e||e===t}:function(e){return"function"==typeof e}},2796:function(e,t,n){"use strict";var r=n(9039),o=n(4901),i=/#|\.prototype\./,a=function(e,t){var n=c[s(e)];return n===u||n!==l&&(o(t)?r(t):!!t)},s=a.normalize=function(e){return String(e).replace(i,".").toLowerCase()},c=a.data={},l=a.NATIVE="N",u=a.POLYFILL="P";e.exports=a},4117:function(e){"use strict";e.exports=function(e){return null==e}},34:function(e,t,n){"use strict";var r=n(4901);e.exports=function(e){return"object"==typeof e?null!==e:r(e)}},6395:function(e){"use strict";e.exports=!1},757:function(e,t,n){"use strict";var r=n(7751),o=n(4901),i=n(1625),a=n(7040),s=Object;e.exports=a?function(e){return"symbol"==typeof e}:function(e){var t=r("Symbol");return o(t)&&i(t.prototype,s(e))}},507:function(e,t,n){"use strict";var r=n(9565);e.exports=function(e,t,n){for(var o,i,a=n?e:e.iterator,s=e.next;!(o=r(s,a)).done;)if(void 0!==(i=t(o.value)))return i}},9539:function(e,t,n){"use strict";var r=n(9565),o=n(8551),i=n(5966);e.exports=function(e,t,n){var a,s;o(e);try{if(!(a=i(e,"return"))){if("throw"===t)throw n;return n}a=r(a,e)}catch(e){s=!0,a=e}if("throw"===t)throw n;if(s)throw a;return o(a),n}},6198:function(e,t,n){"use strict";var r=n(8014);e.exports=function(e){return r(e.length)}},283:function(e,t,n){"use strict";var r=n(9504),o=n(9039),i=n(4901),a=n(9297),s=n(3724),c=n(350).CONFIGURABLE,l=n(3706),u=n(1181),d=u.enforce,p=u.get,f=String,h=Object.defineProperty,v=r("".slice),m=r("".replace),y=r([].join),_=s&&!o((function(){return 8!==h((function(){}),"length",{value:8}).length})),g=String(String).split("String"),b=e.exports=function(e,t,n){"Symbol("===v(f(t),0,7)&&(t="["+m(f(t),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),n&&n.getter&&(t="get "+t),n&&n.setter&&(t="set "+t),(!a(e,"name")||c&&e.name!==t)&&(s?h(e,"name",{value:t,configurable:!0}):e.name=t),_&&n&&a(n,"arity")&&e.length!==n.arity&&h(e,"length",{value:n.arity});try{n&&a(n,"constructor")&&n.constructor?s&&h(e,"prototype",{writable:!1}):e.prototype&&(e.prototype=void 0)}catch(e){}var r=d(e);return a(r,"source")||(r.source=y(g,"string"==typeof t?t:"")),e};Function.prototype.toString=b((function(){return i(this)&&p(this).source||l(this)}),"toString")},741:function(e){"use strict";var t=Math.ceil,n=Math.floor;e.exports=Math.trunc||function(e){var r=+e;return(r>0?n:t)(r)}},2360:function(e,t,n){"use strict";var r,o=n(8551),i=n(6801),a=n(8727),s=n(421),c=n(397),l=n(4055),u=n(6119),d="prototype",p="script",f=u("IE_PROTO"),h=function(){},v=function(e){return"<"+p+">"+e+"</"+p+">"},m=function(e){e.write(v("")),e.close();var t=e.parentWindow.Object;return e=null,t},y=function(){try{r=new ActiveXObject("htmlfile")}catch(e){}var e,t,n;y="undefined"!=typeof document?document.domain&&r?m(r):(t=l("iframe"),n="java"+p+":",t.style.display="none",c.appendChild(t),t.src=String(n),(e=t.contentWindow.document).open(),e.write(v("document.F=Object")),e.close(),e.F):m(r);for(var o=a.length;o--;)delete y[d][a[o]];return y()};s[f]=!0,e.exports=Object.create||function(e,t){var n;return null!==e?(h[d]=o(e),n=new h,h[d]=null,n[f]=e):n=y(),void 0===t?n:i.f(n,t)}},6801:function(e,t,n){"use strict";var r=n(3724),o=n(8686),i=n(4913),a=n(8551),s=n(5397),c=n(1072);t.f=r&&!o?Object.defineProperties:function(e,t){a(e);for(var n,r=s(t),o=c(t),l=o.length,u=0;l>u;)i.f(e,n=o[u++],r[n]);return e}},4913:function(e,t,n){"use strict";var r=n(3724),o=n(5917),i=n(8686),a=n(8551),s=n(6969),c=TypeError,l=Object.defineProperty,u=Object.getOwnPropertyDescriptor,d="enumerable",p="configurable",f="writable";t.f=r?i?function(e,t,n){if(a(e),t=s(t),a(n),"function"==typeof e&&"prototype"===t&&"value"in n&&f in n&&!n[f]){var r=u(e,t);r&&r[f]&&(e[t]=n.value,n={configurable:p in n?n[p]:r[p],enumerable:d in n?n[d]:r[d],writable:!1})}return l(e,t,n)}:l:function(e,t,n){if(a(e),t=s(t),a(n),o)try{return l(e,t,n)}catch(e){}if("get"in n||"set"in n)throw new c("Accessors not supported");return"value"in n&&(e[t]=n.value),e}},7347:function(e,t,n){"use strict";var r=n(3724),o=n(9565),i=n(8773),a=n(6980),s=n(5397),c=n(6969),l=n(9297),u=n(5917),d=Object.getOwnPropertyDescriptor;t.f=r?d:function(e,t){if(e=s(e),t=c(t),u)try{return d(e,t)}catch(e){}if(l(e,t))return a(!o(i.f,e,t),e[t])}},8480:function(e,t,n){"use strict";var r=n(1828),o=n(8727).concat("length","prototype");t.f=Object.getOwnPropertyNames||function(e){return r(e,o)}},3717:function(e,t){"use strict";t.f=Object.getOwnPropertySymbols},1625:function(e,t,n){"use strict";var r=n(9504);e.exports=r({}.isPrototypeOf)},1828:function(e,t,n){"use strict";var r=n(9504),o=n(9297),i=n(5397),a=n(9617).indexOf,s=n(421),c=r([].push);e.exports=function(e,t){var n,r=i(e),l=0,u=[];for(n in r)!o(s,n)&&o(r,n)&&c(u,n);for(;t.length>l;)o(r,n=t[l++])&&(~a(u,n)||c(u,n));return u}},1072:function(e,t,n){"use strict";var r=n(1828),o=n(8727);e.exports=Object.keys||function(e){return r(e,o)}},8773:function(e,t){"use strict";var n={}.propertyIsEnumerable,r=Object.getOwnPropertyDescriptor,o=r&&!n.call({1:2},1);t.f=o?function(e){var t=r(this,e);return!!t&&t.enumerable}:n},4270:function(e,t,n){"use strict";var r=n(9565),o=n(4901),i=n(34),a=TypeError;e.exports=function(e,t){var n,s;if("string"===t&&o(n=e.toString)&&!i(s=r(n,e)))return s;if(o(n=e.valueOf)&&!i(s=r(n,e)))return s;if("string"!==t&&o(n=e.toString)&&!i(s=r(n,e)))return s;throw new a("Can't convert object to primitive value")}},5031:function(e,t,n){"use strict";var r=n(7751),o=n(9504),i=n(8480),a=n(3717),s=n(8551),c=o([].concat);e.exports=r("Reflect","ownKeys")||function(e){var t=i.f(s(e)),n=a.f;return n?c(t,n(e)):t}},7750:function(e,t,n){"use strict";var r=n(4117),o=TypeError;e.exports=function(e){if(r(e))throw new o("Can't call method on "+e);return e}},9286:function(e,t,n){"use strict";var r=n(4402),o=n(8469),i=r.Set,a=r.add;e.exports=function(e){var t=new i;return o(e,(function(e){a(t,e)})),t}},3440:function(e,t,n){"use strict";var r=n(7080),o=n(4402),i=n(9286),a=n(5170),s=n(3789),c=n(8469),l=n(507),u=o.has,d=o.remove;e.exports=function(e){var t=r(this),n=s(e),o=i(t);return a(t)<=n.size?c(t,(function(e){n.includes(e)&&d(o,e)})):l(n.getIterator(),(function(e){u(t,e)&&d(o,e)})),o}},4402:function(e,t,n){"use strict";var r=n(9504),o=Set.prototype;e.exports={Set:Set,add:r(o.add),has:r(o.has),remove:r(o.delete),proto:o}},8750:function(e,t,n){"use strict";var r=n(7080),o=n(4402),i=n(5170),a=n(3789),s=n(8469),c=n(507),l=o.Set,u=o.add,d=o.has;e.exports=function(e){var t=r(this),n=a(e),o=new l;return i(t)>n.size?c(n.getIterator(),(function(e){d(t,e)&&u(o,e)})):s(t,(function(e){n.includes(e)&&u(o,e)})),o}},4449:function(e,t,n){"use strict";var r=n(7080),o=n(4402).has,i=n(5170),a=n(3789),s=n(8469),c=n(507),l=n(9539);e.exports=function(e){var t=r(this),n=a(e);if(i(t)<=n.size)return!1!==s(t,(function(e){if(n.includes(e))return!1}),!0);var u=n.getIterator();return!1!==c(u,(function(e){if(o(t,e))return l(u,"normal",!1)}))}},3838:function(e,t,n){"use strict";var r=n(7080),o=n(5170),i=n(8469),a=n(3789);e.exports=function(e){var t=r(this),n=a(e);return!(o(t)>n.size)&&!1!==i(t,(function(e){if(!n.includes(e))return!1}),!0)}},8527:function(e,t,n){"use strict";var r=n(7080),o=n(4402).has,i=n(5170),a=n(3789),s=n(507),c=n(9539);e.exports=function(e){var t=r(this),n=a(e);if(i(t)<n.size)return!1;var l=n.getIterator();return!1!==s(l,(function(e){if(!o(t,e))return c(l,"normal",!1)}))}},8469:function(e,t,n){"use strict";var r=n(9504),o=n(507),i=n(4402),a=i.Set,s=i.proto,c=r(s.forEach),l=r(s.keys),u=l(new a).next;e.exports=function(e,t,n){return n?o({iterator:l(e),next:u},t):c(e,t)}},4916:function(e,t,n){"use strict";var r=n(7751),o=function(e){return{size:e,has:function(){return!1},keys:function(){return{next:function(){return{done:!0}}}}}};e.exports=function(e){var t=r("Set");try{(new t)[e](o(0));try{return(new t)[e](o(-1)),!1}catch(e){return!0}}catch(e){return!1}}},5170:function(e,t,n){"use strict";var r=n(6706),o=n(4402);e.exports=r(o.proto,"size","get")||function(e){return e.size}},3650:function(e,t,n){"use strict";var r=n(7080),o=n(4402),i=n(9286),a=n(3789),s=n(507),c=o.add,l=o.has,u=o.remove;e.exports=function(e){var t=r(this),n=a(e).getIterator(),o=i(t);return s(n,(function(e){l(t,e)?u(o,e):c(o,e)})),o}},4204:function(e,t,n){"use strict";var r=n(7080),o=n(4402).add,i=n(9286),a=n(3789),s=n(507);e.exports=function(e){var t=r(this),n=a(e).getIterator(),c=i(t);return s(n,(function(e){o(c,e)})),c}},6119:function(e,t,n){"use strict";var r=n(5745),o=n(3392),i=r("keys");e.exports=function(e){return i[e]||(i[e]=o(e))}},7629:function(e,t,n){"use strict";var r=n(6395),o=n(4576),i=n(9433),a="__core-js_shared__",s=e.exports=o[a]||i(a,{});(s.versions||(s.versions=[])).push({version:"3.38.1",mode:r?"pure":"global",copyright:"© 2014-2024 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.38.1/LICENSE",source:"https://github.com/zloirock/core-js"})},5745:function(e,t,n){"use strict";var r=n(7629);e.exports=function(e,t){return r[e]||(r[e]=t||{})}},4495:function(e,t,n){"use strict";var r=n(9519),o=n(9039),i=n(4576).String;e.exports=!!Object.getOwnPropertySymbols&&!o((function(){var e=Symbol("symbol detection");return!i(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&r&&r<41}))},5610:function(e,t,n){"use strict";var r=n(1291),o=Math.max,i=Math.min;e.exports=function(e,t){var n=r(e);return n<0?o(n+t,0):i(n,t)}},5397:function(e,t,n){"use strict";var r=n(7055),o=n(7750);e.exports=function(e){return r(o(e))}},1291:function(e,t,n){"use strict";var r=n(741);e.exports=function(e){var t=+e;return t!=t||0===t?0:r(t)}},8014:function(e,t,n){"use strict";var r=n(1291),o=Math.min;e.exports=function(e){var t=r(e);return t>0?o(t,9007199254740991):0}},8981:function(e,t,n){"use strict";var r=n(7750),o=Object;e.exports=function(e){return o(r(e))}},2777:function(e,t,n){"use strict";var r=n(9565),o=n(34),i=n(757),a=n(5966),s=n(4270),c=n(8227),l=TypeError,u=c("toPrimitive");e.exports=function(e,t){if(!o(e)||i(e))return e;var n,c=a(e,u);if(c){if(void 0===t&&(t="default"),n=r(c,e,t),!o(n)||i(n))return n;throw new l("Can't convert object to primitive value")}return void 0===t&&(t="number"),s(e,t)}},6969:function(e,t,n){"use strict";var r=n(2777),o=n(757);e.exports=function(e){var t=r(e,"string");return o(t)?t:t+""}},6823:function(e){"use strict";var t=String;e.exports=function(e){try{return t(e)}catch(e){return"Object"}}},3392:function(e,t,n){"use strict";var r=n(9504),o=0,i=Math.random(),a=r(1..toString);e.exports=function(e){return"Symbol("+(void 0===e?"":e)+")_"+a(++o+i,36)}},7040:function(e,t,n){"use strict";var r=n(4495);e.exports=r&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},8686:function(e,t,n){"use strict";var r=n(3724),o=n(9039);e.exports=r&&o((function(){return 42!==Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype}))},8622:function(e,t,n){"use strict";var r=n(4576),o=n(4901),i=r.WeakMap;e.exports=o(i)&&/native code/.test(String(i))},8227:function(e,t,n){"use strict";var r=n(4576),o=n(5745),i=n(9297),a=n(3392),s=n(4495),c=n(7040),l=r.Symbol,u=o("wks"),d=c?l.for||l:l&&l.withoutSetter||a;e.exports=function(e){return i(u,e)||(u[e]=s&&i(l,e)?l[e]:d("Symbol."+e)),u[e]}},8107:function(e,t,n){"use strict";var r=n(6518),o=n(8981),i=n(6198),a=n(1291),s=n(6469);r({target:"Array",proto:!0},{at:function(e){var t=o(this),n=i(t),r=a(e),s=r>=0?r:n+r;return s<0||s>=n?void 0:t[s]}}),s("at")},4114:function(e,t,n){"use strict";var r=n(6518),o=n(8981),i=n(6198),a=n(4527),s=n(6837);r({target:"Array",proto:!0,arity:1,forced:n(9039)((function(){return 4294967297!==[].push.call({length:4294967296},1)}))||!function(){try{Object.defineProperty([],"length",{writable:!1}).push()}catch(e){return e instanceof TypeError}}()},{push:function(e){var t=o(this),n=i(t),r=arguments.length;s(n+r);for(var c=0;c<r;c++)t[n]=arguments[c],n++;return a(t,n),n}})},7642:function(e,t,n){"use strict";var r=n(6518),o=n(3440);r({target:"Set",proto:!0,real:!0,forced:!n(4916)("difference")},{difference:o})},8004:function(e,t,n){"use strict";var r=n(6518),o=n(9039),i=n(8750);r({target:"Set",proto:!0,real:!0,forced:!n(4916)("intersection")||o((function(){return"3,2"!==String(Array.from(new Set([1,2,3]).intersection(new Set([3,2]))))}))},{intersection:i})},3853:function(e,t,n){"use strict";var r=n(6518),o=n(4449);r({target:"Set",proto:!0,real:!0,forced:!n(4916)("isDisjointFrom")},{isDisjointFrom:o})},5876:function(e,t,n){"use strict";var r=n(6518),o=n(3838);r({target:"Set",proto:!0,real:!0,forced:!n(4916)("isSubsetOf")},{isSubsetOf:o})},2475:function(e,t,n){"use strict";var r=n(6518),o=n(8527);r({target:"Set",proto:!0,real:!0,forced:!n(4916)("isSupersetOf")},{isSupersetOf:o})},5024:function(e,t,n){"use strict";var r=n(6518),o=n(3650);r({target:"Set",proto:!0,real:!0,forced:!n(4916)("symmetricDifference")},{symmetricDifference:o})},1698:function(e,t,n){"use strict";var r=n(6518),o=n(4204);r({target:"Set",proto:!0,real:!0,forced:!n(4916)("union")},{union:o})},3375:function(e,t,n){"use strict";n(7642)},9225:function(e,t,n){"use strict";n(8004)},3972:function(e,t,n){"use strict";n(3853)},9209:function(e,t,n){"use strict";n(5876)},5714:function(e,t,n){"use strict";n(2475)},7561:function(e,t,n){"use strict";n(5024)},6197:function(e,t,n){"use strict";n(1698)}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var i=t[r]={exports:{}};return e[r].call(i.exports,i,i.exports,n),i.exports}n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,{a:t}),t},n.d=function(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=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},function(){var e;n.g.importScripts&&(e=n.g.location+"");var t=n.g.document;if(!e&&t&&(t.currentScript&&"SCRIPT"===t.currentScript.tagName.toUpperCase()&&(e=t.currentScript.src),!e)){var r=t.getElementsByTagName("script");if(r.length)for(var o=r.length-1;o>-1&&(!e||!/^http(s?):/.test(e));)e=r[o--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),n.p=e}();var r={};return function(){"use strict";n.r(r),n.d(r,{API:function(){return G},AgentInfo:function(){return ll},Chat:function(){return Qs},ChatFrame:function(){return Hc},ComponentFilter:function(){return os},Conversation:function(){return Ks},Engine:function(){return ol},EntryContainer:function(){return Bc},EventParticipant:function(){return qi},ExternalApi:function(){return sl},Header:function(){return ul},Icon:function(){return Zi},Interrupt:function(){return Kc},MessageContainer:function(){return Gi},SeamlyActivityMonitor:function(){return is},SeamlyApiContext:function(){return ai},SeamlyEventBusContext:function(){return si},SeamlyFileUpload:function(){return cs},SeamlyGeneralError:function(){return b},SeamlyLiveRegionContext:function(){return ci},SeamlyOfflineError:function(){return rr},SeamlyStoreProvider:function(){return rn},Text:function(){return Za},TextEntry:function(){return Pc},Upload:function(){return jc},View:function(){return nl},calculateVisibility:function(){return jt},className:function(){return Pi},default:function(){return dl},eventTypes:function(){return S},randomId:function(){return $},useChoicePrompt:function(){return ca},useEvents:function(){return Tn},useGeneratedId:function(){return Ji},useI18n:function(){return ni},useSeamlyActions:function(){return cl},useSeamlyChat:function(){return _i},useSeamlyCommands:function(){return fi},useSeamlyConfig:function(){return un},useSeamlyEventStream:function(){return Wi},useSeamlyIdleDetachCountdown:function(){return Hi},useSeamlyMessageContainerClassNames:function(){return Ri},useSeamlyOptions:function(){return zi},useSeamlyVisibility:function(){return ri},useTranslatedEventData:function(){return Oi},useTranslations:function(){return Ii},useTranslationsContainer:function(){return ki},visibilityStates:function(){return Dt}}),n(9497),n(4114);var e=n(2086),t=n.n(e),o=n(172),i=(n(3375),n(9225),n(3972),n(9209),n(5714),n(7561),n(6197),function(e,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},i(e,t)});function a(e,t){function n(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}function s(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a}var c=function(e,t){this.target=t,this.type=e},l=function(e){function t(t,n){var r=e.call(this,"error",n)||this;return r.message=t.message,r.error=t,r}return a(t,e),t}(c),u=function(e){function t(t,n,r){void 0===t&&(t=1e3),void 0===n&&(n="");var o=e.call(this,"close",r)||this;return o.wasClean=!0,o.code=t,o.reason=n,o}return a(t,e),t}(c),d=function(){if("undefined"!=typeof WebSocket)return WebSocket},p={maxReconnectionDelay:1e4,minReconnectionDelay:1e3+4e3*Math.random(),minUptime:5e3,reconnectionDelayGrowFactor:1.3,connectionTimeout:4e3,maxRetries:1/0,maxEnqueuedMessages:1/0,startClosed:!1,debug:!1},f=function(){function e(e,t,n){var r=this;void 0===n&&(n={}),this._listeners={error:[],message:[],open:[],close:[]},this._retryCount=-1,this._shouldReconnect=!0,this._connectLock=!1,this._binaryType="blob",this._closeCalled=!1,this._messageQueue=[],this.onclose=null,this.onerror=null,this.onmessage=null,this.onopen=null,this._handleOpen=function(e){r._debug("open event");var t=r._options.minUptime,n=void 0===t?p.minUptime:t;clearTimeout(r._connectTimeout),r._uptimeTimeout=setTimeout((function(){return r._acceptOpen()}),n),r._ws.binaryType=r._binaryType,r._messageQueue.forEach((function(e){return r._ws.send(e)})),r._messageQueue=[],r.onopen&&r.onopen(e),r._listeners.open.forEach((function(t){return r._callEventListener(e,t)}))},this._handleMessage=function(e){r._debug("message event"),r.onmessage&&r.onmessage(e),r._listeners.message.forEach((function(t){return r._callEventListener(e,t)}))},this._handleError=function(e){r._debug("error event",e.message),r._disconnect(void 0,"TIMEOUT"===e.message?"timeout":void 0),r.onerror&&r.onerror(e),r._debug("exec error listeners"),r._listeners.error.forEach((function(t){return r._callEventListener(e,t)})),r._connect()},this._handleClose=function(e){r._debug("close event"),r._clearTimeouts(),r._shouldReconnect&&r._connect(),r.onclose&&r.onclose(e),r._listeners.close.forEach((function(t){return r._callEventListener(e,t)}))},this._url=e,this._protocols=t,this._options=n,this._options.startClosed&&(this._shouldReconnect=!1),this._connect()}return Object.defineProperty(e,"CONNECTING",{get:function(){return 0},enumerable:!0,configurable:!0}),Object.defineProperty(e,"OPEN",{get:function(){return 1},enumerable:!0,configurable:!0}),Object.defineProperty(e,"CLOSING",{get:function(){return 2},enumerable:!0,configurable:!0}),Object.defineProperty(e,"CLOSED",{get:function(){return 3},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"CONNECTING",{get:function(){return e.CONNECTING},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"OPEN",{get:function(){return e.OPEN},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"CLOSING",{get:function(){return e.CLOSING},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"CLOSED",{get:function(){return e.CLOSED},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"binaryType",{get:function(){return this._ws?this._ws.binaryType:this._binaryType},set:function(e){this._binaryType=e,this._ws&&(this._ws.binaryType=e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"retryCount",{get:function(){return Math.max(this._retryCount,0)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"bufferedAmount",{get:function(){return this._messageQueue.reduce((function(e,t){return"string"==typeof t?e+=t.length:t instanceof Blob?e+=t.size:e+=t.byteLength,e}),0)+(this._ws?this._ws.bufferedAmount:0)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"extensions",{get:function(){return this._ws?this._ws.extensions:""},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"protocol",{get:function(){return this._ws?this._ws.protocol:""},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"readyState",{get:function(){return this._ws?this._ws.readyState:this._options.startClosed?e.CLOSED:e.CONNECTING},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"url",{get:function(){return this._ws?this._ws.url:""},enumerable:!0,configurable:!0}),e.prototype.close=function(e,t){void 0===e&&(e=1e3),this._closeCalled=!0,this._shouldReconnect=!1,this._clearTimeouts(),this._ws?this._ws.readyState!==this.CLOSED?this._ws.close(e,t):this._debug("close: already closed"):this._debug("close enqueued: no ws instance")},e.prototype.reconnect=function(e,t){this._shouldReconnect=!0,this._closeCalled=!1,this._retryCount=-1,this._ws&&this._ws.readyState!==this.CLOSED?(this._disconnect(e,t),this._connect()):this._connect()},e.prototype.send=function(e){if(this._ws&&this._ws.readyState===this.OPEN)this._debug("send",e),this._ws.send(e);else{var t=this._options.maxEnqueuedMessages,n=void 0===t?p.maxEnqueuedMessages:t;this._messageQueue.length<n&&(this._debug("enqueue",e),this._messageQueue.push(e))}},e.prototype.addEventListener=function(e,t){this._listeners[e]&&this._listeners[e].push(t)},e.prototype.dispatchEvent=function(e){var t,n,r=this._listeners[e.type];if(r)try{for(var o=function(e){var t="function"==typeof Symbol&&e[Symbol.iterator],n=0;return t?t.call(e):{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}}}(r),i=o.next();!i.done;i=o.next()){var a=i.value;this._callEventListener(e,a)}}catch(e){t={error:e}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(t)throw t.error}}return!0},e.prototype.removeEventListener=function(e,t){this._listeners[e]&&(this._listeners[e]=this._listeners[e].filter((function(e){return e!==t})))},e.prototype._debug=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this._options.debug&&console.log.apply(console,function(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(s(arguments[t]));return e}(["RWS>"],e))},e.prototype._getNextDelay=function(){var e=this._options,t=e.reconnectionDelayGrowFactor,n=void 0===t?p.reconnectionDelayGrowFactor:t,r=e.minReconnectionDelay,o=void 0===r?p.minReconnectionDelay:r,i=e.maxReconnectionDelay,a=void 0===i?p.maxReconnectionDelay:i,s=0;return this._retryCount>0&&(s=o*Math.pow(n,this._retryCount-1))>a&&(s=a),this._debug("next delay",s),s},e.prototype._wait=function(){var e=this;return new Promise((function(t){setTimeout(t,e._getNextDelay())}))},e.prototype._getNextUrl=function(e){if("string"==typeof e)return Promise.resolve(e);if("function"==typeof e){var t=e();if("string"==typeof t)return Promise.resolve(t);if(t.then)return t}throw Error("Invalid URL")},e.prototype._connect=function(){var e=this;if(!this._connectLock&&this._shouldReconnect){this._connectLock=!0;var t=this._options,n=t.maxRetries,r=void 0===n?p.maxRetries:n,o=t.connectionTimeout,i=void 0===o?p.connectionTimeout:o,a=t.WebSocket,s=void 0===a?d():a;if(this._retryCount>=r)this._debug("max retries reached",this._retryCount,">=",r);else{if(this._retryCount++,this._debug("connect",this._retryCount),this._removeListeners(),void 0===(c=s)||!c||2!==c.CLOSING)throw Error("No valid WebSocket class provided");var c;this._wait().then((function(){return e._getNextUrl(e._url)})).then((function(t){e._closeCalled||(e._debug("connect",{url:t,protocols:e._protocols}),e._ws=e._protocols?new s(t,e._protocols):new s(t),e._ws.binaryType=e._binaryType,e._connectLock=!1,e._addListeners(),e._connectTimeout=setTimeout((function(){return e._handleTimeout()}),i))}))}}},e.prototype._handleTimeout=function(){this._debug("timeout event"),this._handleError(new l(Error("TIMEOUT"),this))},e.prototype._disconnect=function(e,t){if(void 0===e&&(e=1e3),this._clearTimeouts(),this._ws){this._removeListeners();try{this._ws.close(e,t),this._handleClose(new u(e,t,this))}catch(e){}}},e.prototype._acceptOpen=function(){this._debug("accept open"),this._retryCount=0},e.prototype._callEventListener=function(e,t){"handleEvent"in t?t.handleEvent(e):t(e)},e.prototype._removeListeners=function(){this._ws&&(this._debug("removeListeners"),this._ws.removeEventListener("open",this._handleOpen),this._ws.removeEventListener("close",this._handleClose),this._ws.removeEventListener("message",this._handleMessage),this._ws.removeEventListener("error",this._handleError))},e.prototype._addListeners=function(){this._ws&&(this._debug("addListeners"),this._ws.addEventListener("open",this._handleOpen),this._ws.addEventListener("close",this._handleClose),this._ws.addEventListener("message",this._handleMessage),this._ws.addEventListener("error",this._handleError))},e.prototype._clearTimeouts=function(){clearTimeout(this._connectTimeout),clearTimeout(this._uptimeTimeout)},e}(),h=f;const v=new Set;class m{#e=[];#t=null;#n=null;#r=e=>{const t=JSON.parse(e.data);this.#t&&clearInterval(this.#t),this.#t=setInterval((()=>{this.socket?.readyState===h.OPEN&&this.socket?.send(JSON.stringify({type:"ping"}))}),3e4);try{if("attach_channel_response"===t.type){if(!t.payload.success)return void this.#o({connected:!0,ready:!1,currentState:"attach_channel_erred"});this.#o({connected:!0,ready:!0,currentState:"attach_channel_response"})}}catch(e){console.warn(e)}};#i=()=>{this.#o({connected:!1,ready:!1,currentState:"socket_closed"})};#a=()=>{this.#o({connected:!1,ready:!1,currentState:"socket_join_error"})};accessToken="";channelName="";channelTopic="";url="";async connect(e,t,n,r){this.url=e,this.accessToken=r,this.channelName=t,this.channelTopic=n;const{url:o}=(e=>{const t=e.indexOf("?");return t<0?{url:e,params:{}}:{url:e.slice(0,t),params:e.slice(t+1).split("&").reduce((function(e,t){const[n,r]=t.split("=");return{...e,[n]:decodeURIComponent(r)}}),{})}})(this.url);this.socket=new h(o,[],{maxReconnectionDelay:1e4,minReconnectionDelay:500,reconnectionDelayGrowFactor:2});const i={type:"attach_channel",payload:{accessToken:this.accessToken,channelName:this.channelName}};this.#n=()=>{this.socket?.send(JSON.stringify(i)),this.#o({connected:!0,ready:!1,currentState:"socket_connected"})},this.socket?.addEventListener("open",this.#n),this.socket?.addEventListener("message",this.#r),this.socket?.addEventListener("close",this.#i),this.socket?.addEventListener("error",this.#a)}disconnect(){this.socket?.close(),this.#n&&this.socket?.removeEventListener("open",this.#n),this.socket?.removeEventListener("message",this.#r),this.socket?.removeEventListener("close",this.#i),this.socket?.removeEventListener("error",this.#a),this.#e=[]}onOpen=e=>{this?.socket?.addEventListener("open",e)};onError=e=>{this?.socket?.addEventListener("error",e)};addListener=(e,t)=>{this?.socket?.addEventListener(e,(e=>t(JSON.parse(e.data))))};onMessage=e=>{this?.socket&&(this.socket.onmessage=t=>e(JSON.parse(t.data)))};removeListener=(e,t)=>{this.socket?.removeEventListener(e,t)};onConnection(e){this.#e.push(e)}#o(e){this.#e=this.#e.filter((t=>!t(e))),v.forEach((e=>e()))}pushToChannel(e,t){this.socket?.send(JSON.stringify({type:e,payload:t}))}static subscribe(e){return v.add(e),()=>v.delete(e)}}class y extends Error{constructor(e,t){super(e,{cause:t?.cause}),this.status=t?.status}}class _ 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 g extends _{constructor(e,...t){super(e,...t),this.name="SeamlyConfigurationError",this.langKey="errors.configError"}}class b extends _{constructor(e,...t){super(e,...t),this.name="SeamlyGeneralError",this.langKey="errors.general",this.action="reset"}}class w extends _{constructor(e,...t){super(e,...t),this.name="SeamlySessionExpiredError",this.action="reset"}}class x extends _{constructor(e,...t){super(e,...t),this.name="SeamlyUnauthorizedError",this.langKey="errors.general",this.action="reset"}}function C(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 n?JSON.parse(n):{}},set(e){e&&sessionStorage.setItem(t,JSON.stringify(e))}}}const S={info:"info",message:"message",participant:"participant",system:"system"},E="text",T="text",N="upload",I="received",O="read",k="custom",L="typing",A="read",P="detach_service",M="dismiss",R="set_topic",F="click_cta",D="translation_proposal",U=D,j="window_api",z="assertive",B="polite",V={new_topic:"newTopic",new_translation:"newTranslation"},K="uploads",H="navigate";function $(){return`_${(Number(String(Math.random()).slice(2))+Date.now()+Math.round(performance.now())).toString(36)}`}const J=async(e,t)=>{const n=new URL(e),r=await fetch(n.href,{mode:"cors",...t});if(!r.ok)throw new y(r.statusText||`Request failed with status: ${r.status}`,{status:r.status});return r};function W(){if(!Intl||"undefined"==typeof Intl||void 0===Intl.DateTimeFormat)return;const e=Intl.DateTimeFormat();if(void 0===e||void 0===e.resolvedOptions)return;const t=e.resolvedOptions().timeZone;return t&&(t.indexOf("/")>-1||"UTC"===t)?t:void 0}const q=(...e)=>console.debug("seamly",...e);class G{#s;#c;#l;#u="window";#d;#p="new";URLS={};locale="";conversation=new m;constructor({layoutMode:e,namespace:t,config:n,context:r}){this.store=function(e,t){const n=t(e),r=n.get()||{};return{get(e){return void 0===e?r:r[e]},set(e,t){return r[e]=t,n.set(r),t},delete(e){const t=this.get(e);return delete r[e],n.set(r),t}}}(`${t}.connection${r.userLocale?`.${r.userLocale}`:""}`,n.storageProvider||C),this.connectionInfo={apiKey:n.key,domain:n.domain||"api.seamly-app.com",secure:!1!==n.secure&&(n.secure||!0)},this.#d={...n,sendEnvironment:n.sendEnvironment??!0,context:{...r,channelName:r.channelName||"web"}},this.#s=!1,this.connected=!1,this.configReady=!1,n.externalId&&(this.#c=n.externalId),this.#u=e,this.userResponded=!1,this.URLS={translations:{href:`/channels/api/v2/client/${this.connectionInfo.apiKey}/translations/{version}/{locale}.json`,templated:!0},config:{href:`/channels/api/v2/client/${this.connectionInfo.apiKey}/configs`,templated:!0}},window.addEventListener("pageshow",(e=>{e.persisted&&this.connected&&this.connect()}))}getAccessToken(){return this.store.get("accessToken")}setAccessToken(e){this.store.set("accessToken",e)}getConversationUrl(){return this.store.get("conversationUrl")}setConversationUrl(e){this.store.set("conversationUrl",e?.href)}hasConversation(){return!!this.getConversationUrl()}getChannelTopic(){return this.store.get("channelTopic")||this.store.get("channelName")}getLocale=e=>e||this.locale;#f({_links:{self:e,...t}}){this.URLS={...this.URLS,...t}}clearStore(){this.store.delete("accessToken"),this.store.delete("conversationUrl"),this.store.delete("channelName"),this.store.delete("channelTopic")}#h(e){return`${this.connectionInfo.secure?`${e}s`:e}://${this.connectionInfo.domain}`}async getTranslations(e){try{if(!this.URLS.translations?.href)throw new g;const t=`${this.#h("http")}${this.URLS.translations.href}`.replace("{version}",String(4)).replace("{locale}",this.getLocale(e)),n=await J(t,{method:"GET"});return(await n.json()).translations}catch(e){if(e.status>=500)throw new b(e);throw new y(e)}}getContext(e){const{source:t,userLocale:n,variables:r}=e;if(t&&"string"!=typeof t)throw new Error("Source must be a string");if(n){if("string"!=typeof n)throw new Error("Locale must be a string");this.#v(e,n)}if(r&&"object"!=typeof r)throw new Error("Variables must be an object");if(0===Object.keys(e).length&&e.constructor===Object)return;const o=this.#d.context?.contentLocale,i=this.#d.context?.userLocale;return{...o?{contentLocale:o}:{},...i?{userLocale:i}:{},...e}}uploadFile(e,t,n,r){const o=new FormData;o.append("upload",e);const i=new XMLHttpRequest;return i.open("POST",`${this.#h("http")}${this.URLS.uploads.href}`),i.setRequestHeader("Authorization",`Bearer ${this.getAccessToken()}`),i.upload.onprogress=e=>{if("function"==typeof t){const n=Math.ceil(e.loaded/e.total*100);t(n)}},i.onloadend=()=>{if(0!==i.status)if(200!==i.status&&201!==i.status||!n){if(!r)throw new Error(i.response);try{r(JSON.parse(i.response))}catch(e){r(i.response)}}else try{n(JSON.parse(i.response))}catch(e){n(i.response)}},i.send(o),i}async createConversation(){try{"function"==typeof this.#d?.getConversationAuthToken&&(this.#l=await this.#d.getConversationAuthToken());const e=await J(`${this.#h("http")}${this.URLS.conversations?.href}`,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({externalId:this.#l?void 0:this.#c,token:this.#l})}),t=await e.json(),{conversation:n}=t,r={...n};return this.setAccessToken(n.accessToken),this.#f(t),this.URLS.conversation&&this.setConversationUrl(this.URLS.conversation),this.locale=n.context.userLocale,this.userResponded=n.userResponded,this.#p=n.status,r}catch(e){if(e.status>=500)throw new b(e);if(400===e.status)throw new x(e);if(404===e.status)throw new g(e);throw e}}async getConfig(){try{const e={channelName:this.#d.context.channelName,contentLocale:this.#d.context.contentLocale,environment:!0===this.#d.sendEnvironment?this.getEnvironment():this.#d.sendEnvironment,userLocale:this.#d.context.userLocale,variables:this.#d.context.variables},t=await J(`${this.#h("http")}${this.URLS.config?.href}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({context:e})}),n=await t.json();return this.#f(n),this.configReady=!0,n.config}catch(e){if(404===e.status)throw new g(e);if(e.status>=500)throw new b(e);throw e}}async fetchConversation(){if(!this.hasConversation())return null;try{const e=await J(`${this.#h("http")}${this.getConversationUrl()}`,{method:"GET",headers:{Authorization:`Bearer ${this.getAccessToken()}`}}),t=await e.json();return this.#p=t.conversation.status,this.#f(t),t.conversation}catch(e){if(401===e.status)throw new x(e);if(404===e.status)throw new w(e);if(e.status>=500)throw new b(e);throw e}}async getConversation(){return this.hasConversation()?this.fetchConversation():null}async getConversationIntitialState(){return this.fetchConversation()}async disconnect(){this.conversation?.disconnect&&this.conversation.disconnect(),this.connected=!1,this.configReady=!1}async connect(){this.connected=!1;const e=this.hasConversation()?void 0:await this.createConversation();return this.URLS.socket&&(this.conversation.connect(`${this.#h("ws")}${this.URLS.socket.href}`,this.#d.context.channelName||"",this.getChannelTopic(),this.getAccessToken()),this.conversation.onConnection((({connected:e,ready:t})=>{this.connected=e,this.#s=t})),this.send("context",this.#m())),e}send(e,t=void 0){this.connected&&this.#s?(q("[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=$()),{type:n,body:r,transactionId:o}}(e,t))):this.conversation?.onConnection((({connected:n,ready:r})=>(this.connected=n,this.#s=r,!!r&&(this.send(e,t),!0))))}sendContext(e){const t=this.getContext(e);t&&this.send("context",t)}#m(){const e=!0===this.#d.sendEnvironment?this.getEnvironment():void 0,t="string"==typeof this.#d.context?.source?this.#d.context?.source:void 0,n=this.#d.context?.variables;return{contentLocale:"started"!==this.#p?this.#d.context?.contentLocale:void 0,environment:e,source:t,userLocale:"started"!==this.#p?this.#d.context?.userLocale:void 0,variables:n}}#v(e,t){e.source||t==this.#d.context?.userLocale||(e.source=j)}getEnvironment(){return{clientName:"@seamly/web-ui",clientVariant:this.#u,clientVersion:"24.0.0-beta.9",currentUrl:window.location.toString(),screenResolution:`${window.screen.width}x${window.screen.height}`,timezone:W(),userAgent:navigator.userAgent,preferredLocale:navigator.language}}}function X(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 Y=(()=>"function"==typeof Symbol&&Symbol.observable||"@@observable")(),Q=()=>Math.random().toString(36).substring(7).split("").join("."),Z={INIT:`@@redux/INIT${Q()}`,REPLACE:`@@redux/REPLACE${Q()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${Q()}`};function ee(e){if("object"!=typeof e||null===e)return!1;let t=e;for(;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||null===Object.getPrototypeOf(e)}function te(e,t,n){if("function"!=typeof e)throw new Error(X(2));if("function"==typeof t&&"function"==typeof n||"function"==typeof n&&"function"==typeof arguments[3])throw new Error(X(0));if("function"==typeof t&&void 0===n&&(n=t,t=void 0),void 0!==n){if("function"!=typeof n)throw new Error(X(1));return n(te)(e,t)}let r=e,o=t,i=new Map,a=i,s=0,c=!1;function l(){a===i&&(a=new Map,i.forEach(((e,t)=>{a.set(t,e)})))}function u(){if(c)throw new Error(X(3));return o}function d(e){if("function"!=typeof e)throw new Error(X(4));if(c)throw new Error(X(5));let t=!0;l();const n=s++;return a.set(n,e),function(){if(t){if(c)throw new Error(X(6));t=!1,l(),a.delete(n),i=null}}}function p(e){if(!ee(e))throw new Error(X(7));if(void 0===e.type)throw new Error(X(8));if("string"!=typeof e.type)throw new Error(X(17));if(c)throw new Error(X(9));try{c=!0,o=r(o,e)}finally{c=!1}return(i=a).forEach((e=>{e()})),e}return p({type:Z.INIT}),{dispatch:p,subscribe:d,getState:u,replaceReducer:function(e){if("function"!=typeof e)throw new Error(X(10));r=e,p({type:Z.REPLACE})},[Y]:function(){const e=d;return{subscribe(t){if("object"!=typeof t||null===t)throw new Error(X(11));function n(){const e=t;e.next&&e.next(u())}return n(),{unsubscribe:e(n)}},[Y](){return this}}}}}function ne(e){const t=Object.keys(e),n={};for(let r=0;r<t.length;r++){const o=t[r];"function"==typeof e[o]&&(n[o]=e[o])}const r=Object.keys(n);let o;try{!function(e){Object.keys(e).forEach((t=>{const n=e[t];if(void 0===n(void 0,{type:Z.INIT}))throw new Error(X(12));if(void 0===n(void 0,{type:Z.PROBE_UNKNOWN_ACTION()}))throw new Error(X(13))}))}(n)}catch(e){o=e}return function(e={},t){if(o)throw o;let i=!1;const a={};for(let o=0;o<r.length;o++){const s=r[o],c=n[s],l=e[s],u=c(l,t);if(void 0===u)throw t&&t.type,new Error(X(14));a[s]=u,i=i||u!==l}return i=i||r.length!==Object.keys(e).length,i?a:e}}function re(...e){return 0===e.length?e=>e:1===e.length?e[0]:e.reduce(((e,t)=>(...n)=>e(t(...n))))}function oe(e){return({dispatch:t,getState:n})=>r=>o=>"function"==typeof o?o(t,n,e):r(o)}var ie=oe(),ae=oe,se=Symbol.for("immer-nothing"),ce=Symbol.for("immer-draftable"),le=Symbol.for("immer-state");function ue(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var de=Object.getPrototypeOf;function pe(e){return!!e&&!!e[le]}function fe(e){return!!e&&(ve(e)||Array.isArray(e)||!!e[ce]||!!e.constructor?.[ce]||be(e)||we(e))}var he=Object.prototype.constructor.toString();function ve(e){if(!e||"object"!=typeof e)return!1;const t=de(e);if(null===t)return!0;const n=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return n===Object||"function"==typeof n&&Function.toString.call(n)===he}function me(e,t){0===ye(e)?Reflect.ownKeys(e).forEach((n=>{t(n,e[n],e)})):e.forEach(((n,r)=>t(r,n,e)))}function ye(e){const t=e[le];return t?t.type_:Array.isArray(e)?1:be(e)?2:we(e)?3:0}function _e(e,t){return 2===ye(e)?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function ge(e,t,n){const r=ye(e);2===r?e.set(t,n):3===r?e.add(n):e[t]=n}function be(e){return e instanceof Map}function we(e){return e instanceof Set}function xe(e){return e.copy_||e.base_}function Ce(e,t){if(be(e))return new Map(e);if(we(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);const n=ve(e);if(!0===t||"class_only"===t&&!n){const t=Object.getOwnPropertyDescriptors(e);delete t[le];let n=Reflect.ownKeys(t);for(let r=0;r<n.length;r++){const 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(de(e),t)}{const t=de(e);if(null!==t&&n)return{...e};const r=Object.create(t);return Object.assign(r,e)}}function Se(e,t=!1){return Te(e)||pe(e)||!fe(e)||(ye(e)>1&&(e.set=e.add=e.clear=e.delete=Ee),Object.freeze(e),t&&Object.entries(e).forEach((([e,t])=>Se(t,!0)))),e}function Ee(){ue(2)}function Te(e){return Object.isFrozen(e)}var Ne,Ie={};function Oe(e){const t=Ie[e];return t||ue(0),t}function ke(){return Ne}function Le(e,t){t&&(Oe("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function Ae(e){Pe(e),e.drafts_.forEach(Re),e.drafts_=null}function Pe(e){e===Ne&&(Ne=e.parent_)}function Me(e){return Ne={drafts_:[],parent_:Ne,immer_:e,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function Re(e){const t=e[le];0===t.type_||1===t.type_?t.revoke_():t.revoked_=!0}function Fe(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];return void 0!==e&&e!==n?(n[le].modified_&&(Ae(t),ue(4)),fe(e)&&(e=De(t,e),t.parent_||je(t,e)),t.patches_&&Oe("Patches").generateReplacementPatches_(n[le].base_,e,t.patches_,t.inversePatches_)):e=De(t,n,[]),Ae(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==se?e:void 0}function De(e,t,n){if(Te(t))return t;const r=t[le];if(!r)return me(t,((o,i)=>Ue(e,r,t,o,i,n))),t;if(r.scope_!==e)return t;if(!r.modified_)return je(e,r.base_,!0),r.base_;if(!r.finalized_){r.finalized_=!0,r.scope_.unfinalizedDrafts_--;const t=r.copy_;let o=t,i=!1;3===r.type_&&(o=new Set(t),t.clear(),i=!0),me(o,((o,a)=>Ue(e,r,t,o,a,n,i))),je(e,t,!1),n&&e.patches_&&Oe("Patches").generatePatches_(r,n,e.patches_,e.inversePatches_)}return r.copy_}function Ue(e,t,n,r,o,i,a){if(pe(o)){const a=De(e,o,i&&t&&3!==t.type_&&!_e(t.assigned_,r)?i.concat(r):void 0);if(ge(n,r,a),!pe(a))return;e.canAutoFreeze_=!1}else a&&n.add(o);if(fe(o)&&!Te(o)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;De(e,o),t&&t.scope_.parent_||"symbol"==typeof r||!Object.prototype.propertyIsEnumerable.call(n,r)||je(e,o)}}function je(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&Se(t,n)}var ze={get(e,t){if(t===le)return e;const n=xe(e);if(!_e(n,t))return function(e,t,n){const r=Ke(t,n);return r?"value"in r?r.value:r.get?.call(e.draft_):void 0}(e,n,t);const r=n[t];return e.finalized_||!fe(r)?r:r===Ve(e.base_,t)?($e(e),e.copy_[t]=Je(r,e)):r},has(e,t){return t in xe(e)},ownKeys(e){return Reflect.ownKeys(xe(e))},set(e,t,n){const r=Ke(xe(e),t);if(r?.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const r=Ve(xe(e),t),a=r?.[le];if(a&&a.base_===n)return e.copy_[t]=n,e.assigned_[t]=!1,!0;if(((o=n)===(i=r)?0!==o||1/o==1/i:o!=o&&i!=i)&&(void 0!==n||_e(e.base_,t)))return!0;$e(e),He(e)}var o,i;return e.copy_[t]===n&&(void 0!==n||t in e.copy_)||Number.isNaN(n)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=n,e.assigned_[t]=!0),!0},deleteProperty(e,t){return void 0!==Ve(e.base_,t)||t in e.base_?(e.assigned_[t]=!1,$e(e),He(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const n=xe(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r?{writable:!0,configurable:1!==e.type_||"length"!==t,enumerable:r.enumerable,value:n[t]}:r},defineProperty(){ue(11)},getPrototypeOf(e){return de(e.base_)},setPrototypeOf(){ue(12)}},Be={};function Ve(e,t){const n=e[le];return(n?xe(n):e)[t]}function Ke(e,t){if(!(t in e))return;let n=de(e);for(;n;){const e=Object.getOwnPropertyDescriptor(n,t);if(e)return e;n=de(n)}}function He(e){e.modified_||(e.modified_=!0,e.parent_&&He(e.parent_))}function $e(e){e.copy_||(e.copy_=Ce(e.base_,e.scope_.immer_.useStrictShallowCopy_))}function Je(e,t){const n=be(e)?Oe("MapSet").proxyMap_(e,t):we(e)?Oe("MapSet").proxySet_(e,t):function(e,t){const n=Array.isArray(e),r={type_:n?1:0,scope_:t?t.scope_:ke(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let o=r,i=ze;n&&(o=[r],i=Be);const{revoke:a,proxy:s}=Proxy.revocable(o,i);return r.draft_=s,r.revoke_=a,s}(e,t);return(t?t.scope_:ke()).drafts_.push(n),n}function We(e){if(!fe(e)||Te(e))return e;const t=e[le];let n;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=Ce(e,t.scope_.immer_.useStrictShallowCopy_)}else n=Ce(e,!0);return me(n,((e,t)=>{ge(n,e,We(t))})),t&&(t.finalized_=!1),n}me(ze,((e,t)=>{Be[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}})),Be.deleteProperty=function(e,t){return Be.set.call(this,e,t,void 0)},Be.set=function(e,t,n){return ze.set.call(this,e[0],t,n,e[0])};var qe=new class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(e,t,n)=>{if("function"==typeof e&&"function"!=typeof t){const n=t;t=e;const r=this;return function(e=n,...o){return r.produce(e,(e=>t.call(this,e,...o)))}}let r;if("function"!=typeof t&&ue(6),void 0!==n&&"function"!=typeof n&&ue(7),fe(e)){const o=Me(this),i=Je(e,void 0);let a=!0;try{r=t(i),a=!1}finally{a?Ae(o):Pe(o)}return Le(o,n),Fe(r,o)}if(!e||"object"!=typeof e){if(r=t(e),void 0===r&&(r=e),r===se&&(r=void 0),this.autoFreeze_&&Se(r,!0),n){const t=[],o=[];Oe("Patches").generateReplacementPatches_(e,r,t,o),n(t,o)}return r}ue(1)},this.produceWithPatches=(e,t)=>{if("function"==typeof e)return(t,...n)=>this.produceWithPatches(t,(t=>e(t,...n)));let n,r;return[this.produce(e,t,((e,t)=>{n=e,r=t})),n,r]},"boolean"==typeof e?.autoFreeze&&this.setAutoFreeze(e.autoFreeze),"boolean"==typeof e?.useStrictShallowCopy&&this.setUseStrictShallowCopy(e.useStrictShallowCopy)}createDraft(e){var t;fe(e)||ue(8),pe(e)&&(pe(t=e)||ue(10),e=We(t));const n=Me(this),r=Je(e,void 0);return r[le].isManual_=!0,Pe(n),r}finishDraft(e,t){const n=e&&e[le];n&&n.isManual_||ue(9);const{scope_:r}=n;return Le(r,t),Fe(void 0,r)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}applyPatches(e,t){let n;for(n=t.length-1;n>=0;n--){const r=t[n];if(0===r.path.length&&"replace"===r.op){e=r.value;break}}n>-1&&(t=t.slice(n+1));const r=Oe("Patches").applyPatches_;return pe(e)?r(e,t):this.produce(e,(e=>r(e,t)))}},Ge=qe.produce;qe.produceWithPatches.bind(qe),qe.setAutoFreeze.bind(qe),qe.setUseStrictShallowCopy.bind(qe),qe.applyPatches.bind(qe),qe.createDraft.bind(qe),qe.finishDraft.bind(qe);var Xe="undefined"!=typeof window&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(0!==arguments.length)return"object"==typeof arguments[0]?re:re.apply(null,arguments)},Ye=("undefined"!=typeof window&&window.__REDUX_DEVTOOLS_EXTENSION__&&window.__REDUX_DEVTOOLS_EXTENSION__,e=>e&&"function"==typeof e.match);function Qe(e,t){function n(...n){if(t){let r=t(...n);if(!r)throw new Error(xt(0));return{type:e,payload:r.payload,..."meta"in r&&{meta:r.meta},..."error"in r&&{error:r.error}}}return{type:e,payload:n[0]}}return n.toString=()=>`${e}`,n.type=e,n.match=t=>function(e){return ee(e)&&"type"in e&&"string"==typeof e.type}(t)&&t.type===e,n}var Ze=class e extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,e.prototype)}static get[Symbol.species](){return e}concat(...e){return super.concat.apply(this,e)}prepend(...t){return 1===t.length&&Array.isArray(t[0])?new e(...t[0].concat(this)):new e(...t.concat(this))}};function et(e){return fe(e)?Ge(e,(()=>{})):e}function tt(e,t,n){if(e.has(t)){let r=e.get(t);return n.update&&(r=n.update(r,t,e),e.set(t,r)),r}if(!n.insert)throw new Error(xt(10));const r=n.insert(t,e);return e.set(t,r),r}var nt=()=>function(e){const{thunk:t=!0,immutableCheck:n=!0,serializableCheck:r=!0,actionCreatorCheck:o=!0}=e??{};let i=new Ze;return t&&("boolean"==typeof t?i.push(ie):i.push(ae(t.extraArgument))),i},rt=e=>t=>{setTimeout(t,e)},ot="undefined"!=typeof window&&window.requestAnimationFrame?window.requestAnimationFrame:rt(10),it=e=>function(t){const{autoBatch:n=!0}=t??{};let r=new Ze(e);return n&&r.push(((e={type:"raf"})=>t=>(...n)=>{const r=t(...n);let o=!0,i=!1,a=!1;const s=new Set,c="tick"===e.type?queueMicrotask:"raf"===e.type?ot:"callback"===e.type?e.queueNotification:rt(e.timeout),l=()=>{a=!1,i&&(i=!1,s.forEach((e=>e())))};return Object.assign({},r,{subscribe(e){const t=r.subscribe((()=>o&&e()));return s.add(e),()=>{t(),s.delete(e)}},dispatch(e){try{return o=!e?.meta?.RTK_autoBatch,i=!o,i&&(a||(a=!0,c(l))),r.dispatch(e)}finally{o=!0}}})})("object"==typeof n?n:void 0)),r};function at(e){const t={},n=[];let r;const o={addCase(e,n){const r="string"==typeof e?e:e.type;if(!r)throw new Error(xt(28));if(r in t)throw new Error(xt(29));return t[r]=n,o},addMatcher(e,t){return n.push({matcher:e,reducer:t}),o},addDefaultCase(e){return r=e,o}};return e(o),[t,n,r]}function st(...e){return t=>e.some((e=>((e,t)=>Ye(e)?e.match(t):e(t))(e,t)))}var ct=(e=21)=>{let t="",n=e;for(;n--;)t+="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW"[64*Math.random()|0];return t},lt=["name","message","stack","code"],ut=class{constructor(e,t){this.payload=e,this.meta=t}_type},dt=class{constructor(e,t){this.payload=e,this.meta=t}_type},pt=e=>{if("object"==typeof e&&null!==e){const t={};for(const n of lt)"string"==typeof e[n]&&(t[n]=e[n]);return t}return{message:String(e)}},ft=(()=>{function e(e,t,n){const r=Qe(e+"/fulfilled",((e,t,n,r)=>({payload:e,meta:{...r||{},arg:n,requestId:t,requestStatus:"fulfilled"}}))),o=Qe(e+"/pending",((e,t,n)=>({payload:void 0,meta:{...n||{},arg:t,requestId:e,requestStatus:"pending"}}))),i=Qe(e+"/rejected",((e,t,r,o,i)=>({payload:o,error:(n&&n.serializeError||pt)(e||"Rejected"),meta:{...i||{},arg:r,requestId:t,rejectedWithValue:!!o,requestStatus:"rejected",aborted:"AbortError"===e?.name,condition:"ConditionError"===e?.name}})));return Object.assign((function(e){return(a,s,c)=>{const l=n?.idGenerator?n.idGenerator(e):ct(),u=new AbortController;let d,p;function f(e){p=e,u.abort()}const h=async function(){let h;try{let i=n?.condition?.(e,{getState:s,extra:c});if(null!==(v=i)&&"object"==typeof v&&"function"==typeof v.then&&(i=await i),!1===i||u.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};const m=new Promise(((e,t)=>{d=()=>{t({name:"AbortError",message:p||"Aborted"})},u.signal.addEventListener("abort",d)}));a(o(l,e,n?.getPendingMeta?.({requestId:l,arg:e},{getState:s,extra:c}))),h=await Promise.race([m,Promise.resolve(t(e,{dispatch:a,getState:s,extra:c,requestId:l,signal:u.signal,abort:f,rejectWithValue:(e,t)=>new ut(e,t),fulfillWithValue:(e,t)=>new dt(e,t)})).then((t=>{if(t instanceof ut)throw t;return t instanceof dt?r(t.payload,l,e,t.meta):r(t,l,e)}))])}catch(t){h=t instanceof ut?i(null,l,e,t.payload,t.meta):i(t,l,e)}finally{d&&u.signal.removeEventListener("abort",d)}var v;return n&&!n.dispatchConditionRejection&&i.match(h)&&h.meta.condition||a(h),h}();return Object.assign(h,{abort:f,requestId:l,arg:e,unwrap(){return h.then(ht)}})}}),{pending:o,rejected:i,fulfilled:r,settled:st(i,r),typePrefix:e})}return e.withTypes=()=>e,e})();function ht(e){if(e.meta&&e.meta.rejectedWithValue)throw e.payload;if(e.error)throw e.error;return e.payload}var vt=Symbol.for("rtk-slice-createasyncthunk");function mt(e,t){return`${e}/${t}`}function yt({creators:e}={}){const t=e?.asyncThunk?.[vt];return function(e){const{name:n,reducerPath:r=n}=e;if(!n)throw new Error(xt(11));const o=("function"==typeof e.reducers?e.reducers(function(){function e(e,t){return{_reducerDefinitionType:"asyncThunk",payloadCreator:e,...t}}return e.withTypes=()=>e,{reducer(e){return Object.assign({[e.name](...t){return e(...t)}}[e.name],{_reducerDefinitionType:"reducer"})},preparedReducer(e,t){return{_reducerDefinitionType:"reducerWithPrepare",prepare:e,reducer:t}},asyncThunk:e}}()):e.reducers)||{},i=Object.keys(o),a={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},s={addCase(e,t){const n="string"==typeof e?e:e.type;if(!n)throw new Error(xt(12));if(n in a.sliceCaseReducersByType)throw new Error(xt(13));return a.sliceCaseReducersByType[n]=t,s},addMatcher(e,t){return a.sliceMatchers.push({matcher:e,reducer:t}),s},exposeAction(e,t){return a.actionCreators[e]=t,s},exposeCaseReducer(e,t){return a.sliceCaseReducersByName[e]=t,s}};function c(){const[t={},n=[],r]="function"==typeof e.extraReducers?at(e.extraReducers):[e.extraReducers],o={...t,...a.sliceCaseReducersByType};return function(e){let t,[i,s,c]=at((e=>{for(let t in o)e.addCase(t,o[t]);for(let t of a.sliceMatchers)e.addMatcher(t.matcher,t.reducer);for(let t of n)e.addMatcher(t.matcher,t.reducer);r&&e.addDefaultCase(r)}));if("function"==typeof e)t=()=>et(e());else{const n=et(e);t=()=>n}function l(e=t(),n){let r=[i[n.type],...s.filter((({matcher:e})=>e(n))).map((({reducer:e})=>e))];return 0===r.filter((e=>!!e)).length&&(r=[c]),r.reduce(((e,t)=>{if(t){if(pe(e)){const r=t(e,n);return void 0===r?e:r}if(fe(e))return Ge(e,(e=>t(e,n)));{const r=t(e,n);if(void 0===r){if(null===e)return e;throw new Error(xt(9))}return r}}return e}),e)}return l.getInitialState=t,l}(e.initialState)}i.forEach((r=>{const i=o[r],a={reducerName:r,type:mt(n,r),createNotation:"function"==typeof e.reducers};!function(e){return"asyncThunk"===e._reducerDefinitionType}(i)?function({type:e,reducerName:t,createNotation:n},r,o){let i,a;if("reducer"in r){if(n&&!function(e){return"reducerWithPrepare"===e._reducerDefinitionType}(r))throw new Error(xt(17));i=r.reducer,a=r.prepare}else i=r;o.addCase(e,i).exposeCaseReducer(t,i).exposeAction(t,a?Qe(e,a):Qe(e))}(a,i,s):function({type:e,reducerName:t},n,r,o){if(!o)throw new Error(xt(18));const{payloadCreator:i,fulfilled:a,pending:s,rejected:c,settled:l,options:u}=n,d=o(e,i,u);r.exposeAction(t,d),a&&r.addCase(d.fulfilled,a),s&&r.addCase(d.pending,s),c&&r.addCase(d.rejected,c),l&&r.addMatcher(d.settled,l),r.exposeCaseReducer(t,{fulfilled:a||bt,pending:s||bt,rejected:c||bt,settled:l||bt})}(a,i,s,t)}));const l=e=>e,u=new Map;let d;function p(e,t){return d||(d=c()),d(e,t)}function f(){return d||(d=c()),d.getInitialState()}function h(t,n=!1){function r(e){let r=e[t];return void 0===r&&n&&(r=f()),r}function o(t=l){const r=tt(u,n,{insert:()=>new WeakMap});return tt(r,t,{insert:()=>{const r={};for(const[o,i]of Object.entries(e.selectors??{}))r[o]=_t(i,t,f,n);return r}})}return{reducerPath:t,getSelectors:o,get selectors(){return o(r)},selectSlice:r}}const v={name:n,reducer:p,actions:a.actionCreators,caseReducers:a.sliceCaseReducersByName,getInitialState:f,...h(r),injectInto(e,{reducerPath:t,...n}={}){const o=t??r;return e.inject({reducerPath:o,reducer:p},n),{...v,...h(o,!0)}}};return v}}function _t(e,t,n,r){function o(o,...i){let a=t(o);return void 0===a&&r&&(a=n()),e(a,...i)}return o.unwrapped=e,o}var gt=yt();function bt(){}var{assign:wt}=Object;function xt(e){return`Minified Redux Toolkit error #${e}; visit https://redux-toolkit.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}Symbol.for("rtk-state-proxy-original");class Ct extends _{constructor(e,...t){super(e,...t),this.name="SeamlyUnavailableError",this.langKey="errors.seamlyUnavailable"}}const St=ft("initializeConfig",(async(e,{extra:{api:t,config:n},rejectWithValue:r})=>{try{const{features:e,preChat:r,agentParticipant:o,defaultContentLocale:i,defaultUserLocale:a,userParticipant:s,startChatIcon:c}=await t.getConfig(),{connectWhenInView:l}=n;return{features:e,preChat:r,agentParticipant:o,userParticipant:s,startChatIcon:c,defaultUserLocale:n?.context?.userLocale||a,defaultContentLocale:n?.context?.contentLocale||i,connectWhenInView:l}}catch(e){return r(e)}})),Et=ft("resetConfig",(async(e,{extra:{config:t}})=>t));var Tt=e=>Array.isArray(e)?e:[e];Symbol(),Object.getPrototypeOf({});var Nt="undefined"!=typeof WeakRef?WeakRef:class{constructor(e){this.value=e}deref(){return this.value}},It=0,Ot=1;function kt(){return{s:It,v:void 0,o:null,p:null}}function Lt(e,t={}){let n=kt();const{resultEqualityCheck:r}=t;let o,i=0;function a(){let t=n;const{length:a}=arguments;for(let e=0,n=a;e<n;e++){const n=arguments[e];if("function"==typeof n||"object"==typeof n&&null!==n){let e=t.o;null===e&&(t.o=e=new WeakMap);const r=e.get(n);void 0===r?(t=kt(),e.set(n,t)):t=r}else{let e=t.p;null===e&&(t.p=e=new Map);const r=e.get(n);void 0===r?(t=kt(),e.set(n,t)):t=r}}const s=t;let c;if(t.s===Ot)c=t.v;else if(c=e.apply(null,arguments),i++,r){const e=o?.deref?.()??o;null!=e&&r(e,c)&&(c=e,0!==i&&i--),o="object"==typeof c&&null!==c||"function"==typeof c?new Nt(c):c}return s.s=Ot,s.v=c,c}return a.clearCache=()=>{n=kt(),a.resetResultsCount()},a.resultsCount=()=>i,a.resetResultsCount=()=>{i=0},a}function At(e,...t){const n="function"==typeof e?{memoize:e,memoizeOptions:t}:e,r=(...e)=>{let t,r=0,o=0,i={},a=e.pop();"object"==typeof a&&(i=a,a=e.pop()),function(e,t="expected a function, instead received "+typeof e){if("function"!=typeof e)throw new TypeError(t)}(a,`createSelector expects an output function after the inputs, but received: [${typeof a}]`);const s={...n,...i},{memoize:c,memoizeOptions:l=[],argsMemoize:u=Lt,argsMemoizeOptions:d=[],devModeChecks:p={}}=s,f=Tt(l),h=Tt(d),v=function(e){const t=Array.isArray(e[0])?e[0]:e;return function(e,t="expected all items to be functions, instead received the following types: "){if(!e.every((e=>"function"==typeof e))){const n=e.map((e=>"function"==typeof e?`function ${e.name||"unnamed"}()`:typeof e)).join(", ");throw new TypeError(`${t}[${n}]`)}}(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}(e),m=c((function(){return r++,a.apply(null,arguments)}),...f),y=u((function(){o++;const e=function(e,t){const n=[],{length:r}=e;for(let o=0;o<r;o++)n.push(e[o].apply(null,t));return n}(v,arguments);return t=m.apply(null,e),t}),...h);return Object.assign(y,{resultFunc:a,memoizedResultFunc:m,dependencies:v,dependencyRecomputations:()=>o,resetDependencyRecomputations:()=>{o=0},lastResult:()=>t,recomputations:()=>r,resetRecomputations:()=>{r=0},memoize:c,argsMemoize:u})};return Object.assign(r,{withTypes:()=>r}),r}var Pt=At(Lt),Mt=Object.assign(((e,t=Pt)=>{!function(e,t="expected an object, instead received "+typeof e){if("object"!=typeof e)throw new TypeError(t)}(e,"createStructuredSelector expects first argument to be an object where each property is a selector, instead received a "+typeof e);const n=Object.keys(e);return t(n.map((t=>e[t])),((...e)=>e.reduce(((e,t,r)=>(e[n[r]]=t,e)),{})))}),{withTypes:()=>Mt});const Rt=Pt((({app:e})=>e),(({userHasResponded:e})=>e)),Ft="visibility",Dt={hidden:"hidden",minimized:"minimized",open:"open",initialize:null},Ut=Pt((({config:e})=>e),(e=>{let t={visible:"inline"===e?.layoutMode?Dt.open:Dt.minimized,appContainerClassNames:e?.appContainerClassNames||[],...e};return"function"==typeof t.appContainerClassNames&&(t={...t,appContainerClassNames:t.appContainerClassNames(t)}),t})),jt=({hasResponded:e,previousVisibility:t,requestedVisibility:n,config:r})=>{const{defaults:o,layoutMode:i,hideOnNoUserResponse:a}=r,{visible:s}=o||{};if("app"===i&&!t)return Dt.open;if("window"===i&&a&&n!==Dt.open)return e?n||t||Dt.open:Dt.hidden;if("inline"===i&&e&&!n)return t||Dt.open;const c=Dt.minimized;return n||t||s||c};var zt=n(7402),Bt=n(8418),Vt=zt.default,Kt=Symbol.for("react-redux-context"),Ht="undefined"!=typeof globalThis?globalThis:{};function $t(){if(!Vt.createContext)return{};const e=Ht[Kt]??(Ht[Kt]=new Map);let t=e.get(Vt.createContext);return t||(t=Vt.createContext(null),e.set(Vt.createContext,t)),t}var Jt=$t();function Wt(e=Jt){return function(){return Vt.useContext(e)}}var qt=Wt(),Gt=()=>{throw new Error("uSES not initialized!")},Xt=(e,t)=>e===t;function Yt(e=Jt){const t=e===Jt?qt:Wt(e),n=(e,n={})=>{const{equalityFn:r=Xt,devModeChecks:o={}}="function"==typeof n?{equalityFn:n}:n,{store:i,subscription:a,getServerState:s,stabilityCheck:c,identityFunctionCheck:l}=t(),u=(Vt.useRef(!0),Vt.useCallback({[e.name](t){return e(t)}}[e.name],[e,c,o.stabilityCheck])),d=Gt(a.addNestedSub,i.getState,s||i.getState,u,r);return Vt.useDebugValue(d),d};return Object.assign(n,{withTypes:()=>n}),n}var Qt=Yt();Symbol.for("react.element"),Symbol.for("react.portal"),Symbol.for("react.fragment"),Symbol.for("react.strict_mode"),Symbol.for("react.profiler"),Symbol.for("react.provider"),Symbol.for("react.context"),Symbol.for("react.server_context"),Symbol.for("react.forward_ref"),Symbol.for("react.suspense"),Symbol.for("react.suspense_list"),Symbol.for("react.memo"),Symbol.for("react.lazy"),Symbol.for("react.offscreen"),Symbol.for("react.client.reference");var Zt={notify(){},get:()=>[]};var en=!("undefined"==typeof window||void 0===window.document||void 0===window.document.createElement),tn="undefined"!=typeof navigator&&"ReactNative"===navigator.product,nn=en||tn?Vt.useLayoutEffect:Vt.useEffect;Object.defineProperty,Object.getOwnPropertyNames,Object.getOwnPropertySymbols,Object.getOwnPropertyDescriptor,Object.getPrototypeOf,Object.prototype;var rn=function({store:e,context:t,children:n,serverState:r,stabilityCheck:o="once",identityFunctionCheck:i="once"}){const a=Vt.useMemo((()=>{const t=function(e,t){let n,r=Zt,o=0,i=!1;function a(){l.onStateChange&&l.onStateChange()}function s(){o++,n||(n=t?t.addNestedSub(a):e.subscribe(a),r=function(){let e=null,t=null;return{clear(){e=null,t=null},notify(){(()=>{let t=e;for(;t;)t.callback(),t=t.next})()},get(){const t=[];let n=e;for(;n;)t.push(n),n=n.next;return t},subscribe(n){let r=!0;const o=t={callback:n,next:null,prev:t};return o.prev?o.prev.next=o:e=o,function(){r&&null!==e&&(r=!1,o.next?o.next.prev=o.prev:t=o.prev,o.prev?o.prev.next=o.next:e=o.next)}}}}())}function c(){o--,n&&0===o&&(n(),n=void 0,r.clear(),r=Zt)}const l={addNestedSub:function(e){s();const t=r.subscribe(e);let n=!1;return()=>{n||(n=!0,t(),c())}},notifyNestedSubs:function(){r.notify()},handleChangeWrapper:a,isSubscribed:function(){return i},trySubscribe:function(){i||(i=!0,s())},tryUnsubscribe:function(){i&&(i=!1,c())},getListeners:()=>r};return l}(e);return{store:e,subscription:t,getServerState:r?()=>r:void 0,stabilityCheck:o,identityFunctionCheck:i}}),[e,r,o,i]),s=Vt.useMemo((()=>e.getState()),[e]);nn((()=>{const{subscription:t}=a;return t.onStateChange=t.notifyNestedSubs,t.trySubscribe(),s!==e.getState()&&t.notifyNestedSubs(),()=>{t.tryUnsubscribe(),t.onStateChange=void 0}}),[a,s]);const c=t||Jt;return Vt.createElement(c.Provider,{value:a},n)};function on(e=Jt){const t=e===Jt?qt:Wt(e),n=()=>{const{store:e}=t();return e};return Object.assign(n,{withTypes:()=>n}),n}var an=on();function sn(e=Jt){const t=e===Jt?an:on(e),n=()=>t().dispatch;return Object.assign(n,{withTypes:()=>n}),n}var cn,ln=sn();cn=Bt.useSyncExternalStoreWithSelector,Gt=cn,zt.useSyncExternalStore;const un=()=>Qt(Ut);function dn(){const{startChatIcon:e}=un();return e}const pn=(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)}}},fn=e=>Math.ceil(e/1e3),hn=e=>{const t=Math.floor(e/60);return{minutes:t,seconds:e-60*t}},vn=(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]}`},mn={27:"Escape",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown"},yn={Escape:"Escape",End:"End",Home:"Home",ArrowLeft:"ArrowLeft",ArrowUp:"ArrowUp",ArrowRight:"ArrowRight",ArrowDown:"ArrowDown"},_n=e=>e.code?yn[e.code]:mn[e.keyCode],gn=e=>{e&&e.focus()},bn=(e,t)=>{e&&(e.contains(document.activeElement)||e===document.activeElement)&&t()};function wn(e){return"object"==typeof e}const xn=({state:e})=>e,Cn=()=>Qt(xn),Sn=Pt(xn,Ut,Rt,(({events:e,serviceData:t},n,r)=>{if(r||"inline"===n.layoutMode||!t?.suggestion||!t?.suggestion?.body?.length)return e;const o={type:"service_data",payload:t.suggestion};return[...e,o]})),En=Pt(Sn,Ut,((e,t)=>{const{enabled:n,threshold:r}=t?.messages?.timeIndicator??{};return n?e.map((({type:e,payload:t},n,o)=>{if(0===n)return{type:e,payload:{...t,timeIndicator:t?.occurredAt}};const i=o[n-1];if(!t?.occurredAt||!i.payload?.occurredAt||!r)return{type:e,payload:{...t,timeIndicator:void 0}};const a=fn(t.occurredAt-i.payload.occurredAt)>=r?t.occurredAt:void 0;return{type:e,payload:{...t,timeIndicator:a}}})):e})),Tn=()=>Qt(En),Nn=(Pt(En,(e=>e.map((e=>e.payload.id)))),()=>Cn().isLoading),In=()=>Cn().unreadEvents,On=()=>Cn().skiplinkTargetId,kn=()=>Cn().serviceInfo,Ln=Pt(En,(e=>{const t=e.filter((e=>"message"===e.type));return t[t.length-1]?.payload.id})),An=()=>{const{participants:e,currentAgent:t}=Cn().participantInfo;return t?e[t]:null},Pn=()=>{const{entryMeta:{options:e,optionsOverride:t}}=Cn(),{limit:n}=t?.text||e?.text||{limit:null};return{hasLimit:null!==n,limit:null!==n?n:null}},Mn=()=>{const{layoutMode:e}=un();return{isInline:"inline"===e,isWindow:"window"===e,isApp:"app"===e,isResolving:!e}},Rn=Pt((({visibility:e})=>e),(e=>e.visibility)),Fn=Pt((({visibility:e})=>e),(e=>e.showInlineView)),Dn=Pt((({visibility:e})=>e),(e=>e.setInputFocus)),Un=[Dt.open,Dt.minimized,Dt.hidden],jn=ft("setVisibility",((e,{getState:t,extra:{api:n,eventBus:r}})=>{const o=t(),i=e.visibility,a=Rn(o),s=Rt(o),c=n.hasConversation(),l=Ut(o),{visibilityCallback:u=jt,layoutMode:d}=l,{unreadEvents:p}=xn(o),f=u({hasResponded:s,previousVisibility:a,requestedVisibility:i,config:l});if(f&&!Un.includes(f))return console.error('The visibilityCallback function should return "open", "minimized" or "hidden".'),{visibility:null,setInputFocus:e.setInputFocus};if(a===f)return{visibility:null,setInputFocus:e.setInputFocus};const h=n.store.get(Ft);return n.store.set(Ft,{...h||{},[d]:i}),i&&r.emit("ui.visible",i,{visibility:i,hasConversation:c,hasResponded:s,unreadMessageCount:p}),{visibility:f,setInputFocus:e.setInputFocus}})),zn=ft("initialize",(async(e,{dispatch:t,getState:n,extra:{api:r}})=>{const{layoutMode:o}=Ut(n()),i=r.store.get(Ft)?.[o]||Dt.initialize;return t(jn({visibility:i})),i})),Bn=ft("initializeApp",(async(e,{extra:{api:t,config:n},rejectWithValue:r})=>{const o=n?.context?.contentLocale,i=n?.context?.userLocale;try{return t.hasConversation()?{initialState:await t.getConversationIntitialState(),contentLocale:o,userLocale:i,config:n}:(n?.context?.topic&&t.send("action",{type:R,body:{name:n.context.topic,fallbackMessage:n.context.topic}}),{initialState:void 0,contentLocale:o,userLocale:i,config:n})}catch(e){if(e instanceof w){const e=new w;return r({name:e.name,message:e.message,originalEvent:e.originalEvent,originalError:e.originalError,action:e.action})}const t=new Ct;return r({name:t.name,message:t.message,langKey:t.langKey})}})),Vn=((e,t,n)=>{const{wait:r=300,maxWait:o=0,leading:i=!1}=n??{};let a,s=null,c=null;const l=()=>{c&&clearTimeout(c),c=void 0,a&&(a(!0),a=void 0)};return ft(e,t,{condition:()=>{const e=i&&!s;return s&&clearTimeout(s),s=setTimeout((()=>{l(),s=null}),r),!!e||(a&&(a(!1),a=void 0),o&&!c&&(c=setTimeout(l,o)),new Promise((e=>{a=e})))}})})("resetApp",(async(e,{dispatch:t,extra:{api:n}})=>{await n.disconnect(),n.clearStore(),t(Et()),await t(St()),await t(Bn()),t(zn())}),{wait:2e3,leading:!0}),Kn="cvco",Hn=50,$n=300,Jn=["hideOnNoUserResponse","connectWhenInView","showDisclaimer","showSuggestions","continueChat","preChat","namespace","customComponents","defaults","layoutMode","api","zIndex","context","appContainerClassNames","messages","visible","visibilityCallback","errorCallback","agentParticipant","userParticipant","startChatIcon","notificationAudioURL"],Wn=(e,t)=>{const{messages:n,...r}=(o=t,Jn.reduce(((e,t)=>(t in o&&(e[t]=o[t]),e)),{}));var o;let i=e;return Object.keys(r).length>0&&(i={...i,...r}),n&&(i={...i,messages:{...i.messages,...n}}),i},qn=gt({name:"config",initialState:{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,sendEnvironment:!0},context:{},notificationAudioURL:void 0,hideOnNoUserResponse:!1,connectWhenInView:!0,showDisclaimer:!1,showSuggestions:!0,preChat:{enterDelay:1e3,exitAfter:4e3},continueChat:{enterDelay:0,exitAfter:2e3},customComponents:{},defaults:{visible:null},preChatEvents:[],parentElement:void 0,layoutMode:"window"},reducers:{setConfig:(e,{payload:t})=>Wn(e,t),updateConfig:(e,{payload:t})=>Wn(e,t),setPreChatEvents:(e,{payload:t})=>{e.preChatEvents=t}},extraReducers:e=>{e.addCase(Et.fulfilled,(e=>e)).addCase(St.fulfilled,((e,{payload:{preChat:t,agentParticipant:n,userParticipant:r,startChatIcon:o,defaultContentLocale:i,defaultUserLocale:a}})=>{e.preChatEvents=t.map((e=>({type:"message",payload:e}))),e.context.contentLocale=i,e.context.userLocale=a,e.agentParticipant=n,e.userParticipant=r,e.startChatIcon=o||""}))}}),{setConfig:Gn,updateConfig:Xn,setPreChatEvents:Yn}=qn.actions;var Qn=qn.reducer;const Zn={userHasResponded:!1},er=gt({name:"app",initialState:Zn,reducers:{setHasResponded:(e,{payload:t})=>{e.userHasResponded=t}},extraReducers:e=>{e.addCase(Vn.pending,(()=>Zn)).addCase(Bn.fulfilled,((e,{payload:t})=>{t.initialState&&"userResponded"in t.initialState&&(e.userHasResponded=t.initialState.userResponded||!1)}))}}),{setHasResponded:tr}=er.actions;var nr=er.reducer;class rr extends _{constructor(e,...t){super(e,...t),this.name="SeamlyOfflineError",this.langKey="errors.seamlyOffline"}}const or={SeamlyGeneralError:b,SeamlyConfigurationError:g,SeamlySessionExpiredError:w,SeamlyOfflineError:rr,SeamlyUnauthorizedError:x,SeamlyUnavailableError:Ct},ir=Qe("catch-error",(e=>({payload:e}))),ar={controls:{}},sr={touched:!1},cr={controls:sr},lr=gt({name:"forms",initialState:cr,reducers:{registerForm:(e,{payload:{persistData:t,formId:n}})=>{const r=t?e[n]??{...ar,persistData:t}:{...ar,persistData:t};e[n]=r},deregisterForm:(e,{payload:{formId:t}})=>(e[t]?.persistData||delete e[t],e),registerControl:(e,{payload:{name:t,formId:n}})=>{e[n].controls={[t]:sr}},deregisterControl:(e,{payload:{name:t,formId:n}})=>{const r=e[n];if(!r)return e;if(r.persistData)return e;const o={...r.controls};return delete o[t],{...e,[n]:{...r,controls:o}}},updateControlValue:(e,{payload:{formId:t,name:n,value:r}})=>{e[t]?.controls&&(e[t].controls[n].value=r)},updateControlTouched:(e,{payload:{formId:t,name:n,touched:r}})=>{e[t]?.controls[n]&&(e[t].controls[n].touched=r)}},extraReducers:e=>{e.addCase(Vn.pending,(()=>cr))}}),{registerForm:ur,deregisterForm:dr,registerControl:pr,deregisterControl:fr,updateControlValue:hr,updateControlTouched:vr}=lr.actions;var mr=lr.reducer;const yr=ft("setLocale",(async(e,{extra:{api:t},rejectWithValue:n})=>{try{return{translations:await t.getTranslations(e),userLocale:e}}catch(e){return n(e)}}),{condition:(e,{getState:t})=>{const{i18n:{isLoading:n,userLocale:r}}=t();return e!==r&&!n}}),_r={translations:{"errors.configError.message":"We are sorry this happened, please retry at a later time.","errors.configError.srText":"A chat configuration error occurred. Our apologies, please retry at a later time.","errors.configError.title":"Chat configuration error.","errors.general.buttonText":"Restart chat","errors.general.message":"Do you want to start a new chat session?","errors.general.srText":"Something went wrong with the chat session. You can restart the chat.","errors.general.title":"Something went wrong","errors.seamlyOffline.message":"There might be a problem with your or our network connection. The chat session should resume as soon the connection is available again.","errors.seamlyOffline.srText":"The chat has connection issues. There might be a problem with your or our network connection. The chat session should resume as soon as the connection is available again.","errors.seamlyOffline.title":"Connection issues","errors.seamlyUnavailable.buttonText":"Try again","errors.seamlyUnavailable.message":"The server could not be reached. Try again in a little while.","errors.seamlyUnavailable.srText":"The chat server could not be reached. Try again in a little while.","errors.seamlyUnavailable.title":"Server unavailable"},isLoading:!1,initialLocale:void 0,userLocale:void 0},gr=gt({name:"app",initialState:_r,reducers:{setInitialLocale:(e,t)=>{e.initialLocale=t.payload},setTranslations:(e,{payload:t})=>{e.translations=t}},extraReducers:e=>{e.addCase(Vn.pending,(()=>_r)).addCase(St.fulfilled,((e,{payload:t})=>{e.initialLocale=t.defaultUserLocale})).addCase(yr.pending,(e=>{e.isLoading=!0})).addCase(yr.rejected,(e=>{e.isLoading=!1})).addCase(yr.fulfilled,((e,{payload:t})=>{e.isLoading=!1,t?.translations&&(e.userLocale=t.userLocale,e.translations=Object.keys(t.translations).sort().reduce(((e,n)=>{if(!t.translations)return e;const r=t.translations[n];return e[n]=r,e}),{}))}))}}),{setInitialLocale:br,setTranslations:wr}=gr.actions;var xr=gr.reducer;const Cr=ft("getConversation",(async(e,{extra:{api:t},rejectWithValue:n})=>{try{const e=await t.getConversation();if(!e)throw new Error("No conversation found");return e}catch(e){return n({name:e?.name,message:e?.message,langKey:e?.langKey,action:e?.action,originalEvent:e?.originalEvent,originalError:e?.originalError})}}),{condition(e,{getState:t}){const{state:{events:n}}=t(),r=n.at(-1);return r&&("lastEvent"in e?e?.lastEvent?.id:e?.body?.lastEvent?.id)!==r.payload.id}}),Sr={error:void 0},Er=gt({name:"interrupt",initialState:Sr,reducers:{setInterrupt:(e,t)=>{e.error=t.payload},clearInterrupt:()=>Sr},extraReducers:e=>{e.addCase(St.pending,(()=>Sr)).addMatcher(st(Bn.rejected,St.rejected,yr.rejected,jn.rejected,zn.rejected,Cr.rejected),((e,{payload:t})=>{e.error=t}))}}),{setInterrupt:Tr,clearInterrupt:Nr}=Er.actions;var Ir=Er.reducer;const Or=["SeamlyGeneralError","SeamlyConfigurationError","SeamlySessionExpiredError","SeamlyOfflineError","SeamlyUnauthorizedError","SeamlyUnavailableError"],kr=({type:e,payload:t})=>"hidden"===document.visibilityState||e===S.message&&!t.fromClient||e===S.info&&t.type===E,Lr=e=>e.sort((({payload:{occurredAt:e=0}},{payload:{occurredAt:t=0}})=>e-t)),Ar=(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={...n,[r]:s?{...s,...o?{avatar:o}:{},...i?{name:i}:{},...a?{introduction:a}:{}}:t.participant};return{...e,participants:c,currentAgent:e.currentAgent===r||t.fromClient?e.currentAgent:r}},Pr=(e,t)=>{const n="message"===t?.type?t?.payload.translatedEntry||t?.payload.entry:{options:void 0,type:void 0},{blockAutoEntrySwitch:r}=e,o=t?.payload?.actions||{},i=t?.payload?.translatedActions||{};if(!n)return{...e,actions:o,optionsOverride:{},translatedActions:i};const{type:a,options:s}=n||{};let c=e.active;return r||a===e.userSelected||(c=a),{...e,active:c,optionsOverride:{...e.optionsOverride||{},...a?{[a]:s}:{}},actions:o,translatedActions:i}},Mr={events:[],isLastEventFromClient:!1,initialState:{userResponded:!1,context:{contentLocale:"",translationActive:!1,userLocale:""}},unreadEvents:0,userHasResponded:!1,loadedImageEventIds:[],isLoading:!1,idleDetachCountdown:{hasCountdown:!1,isActive:!1,remaining:void 0,wasStopped:void 0,count:void 0,timer:void 0},resumeConversationPrompt:!1,serviceInfo:{activeServiceSessionId:"",proactiveMessages:!1},participantInfo:{participants:{},currentAgent:""},headerTitles:{title:null,subTitle:""},historyLoaded:!1,skiplinkTargetId:$(),optionsButtonId:$(),headerCollapseButtonId:$(),serviceData:{},options:{features:{webNotifications:{enabled:!1}},panelActive:!1,optionActive:"",userSelectedOptions:{}},showFileUpload:!1,currentUploads:[],processingFileUploads:[],entryMeta:{default:T,optionsOverride:{},defaultEntry:T,active:T,userSelected:null,blockAutoEntrySwitch:!1,options:{},actions:{},translatedActions:{}},seamlyContainerElement:null},Rr=gt({name:"store",initialState:Mr,reducers:{addEvent:(e,t)=>{const{type:n,payload:r}=t.payload,o=e.options.features.hasOwnProperty(K);let i={...e.options};if(o&&(n===S.message||n===S.participant)&&!r.fromClient){const e="message"===n?r.entry?.type:void 0;i={...i,features:{...i.features,uploads:{enabled:i.features.uploads?.enabled||!1,...i.features?.uploads||{},enabledFromEntry:e===N}}}}const a=kr(t.payload);if(!e.events.find((e=>e.payload.id===r.id))){if(!e.events.find((e=>"transactionId"in e.payload&&"transactionId"in r&&e.payload.transactionId===r.transactionId&&(!t.payload.type||e.type===t.payload.type)&&r.fromClient))){const s=Pr(e.entryMeta,t.payload);e.entryMeta=o||s.active!==N?s:{...e.entryMeta},e.options=i,a&&(e.unreadEvents+=1,"service_data"!==n&&(t.payload.payload.messageStatus=r.fromClient?O:I)),t.payload.payload.key=$(),e.events.push(t.payload),e.events=Lr(e.events)}r.fromClient&&(e.isLastEventFromClient=r.fromClient)}},updateEvent:(e,{payload:t})=>{const n=e.events.find((e=>"service_data"!==e.type&&"service_data"!==t.type&&e.payload.transactionId===t.payload.transactionId));if(!n)return e.events.push(t),void(e.events=Lr(e.events));n.payload.id=t.payload.id,n.payload.occurredAt=t.payload.occurredAt},clearEvents:e=>{e.unreadEvents=0,e.loadedImageEventIds=[],e.events=[]},setEventsRead:(e,{payload:t})=>{e.unreadEvents=0,e.events.forEach((e=>(e.payload.id&&-1!==t.indexOf(e.payload.id)&&(e.payload={...e.payload,..."service_data"!==e.type&&e.payload.messageStatus===I&&{messageStatus:O}}),e)))},setLoadedImageEventIds:(e,{payload:t})=>{e.loadedImageEventIds.push(t)},setEvents:(e,{payload:{messages:t,unreadMessageCount:n,userResponded:r,participants:o,service:i,serviceData:a,ui:s}})=>{const c=((e,t)=>{const n=e.filter((e=>"message"===e.type&&!e.payload.optimisticallyInjected&&!t.some((t=>t.payload?.id===e.payload.id)))),r=t.filter((({type:e,payload:t})=>!("participant"===e&&!t?.participant?.introduction))).reverse();return Lr([...r,...n])})(e.events,t),l=Object.fromEntries(Object.entries(o).map((([e,t])=>[t.id,t]))),u=c.find((e=>"participant"===e.type)),d=u?.payload.participant?.id,{entry:p}=i?.settings||{},f=Pr({...e.entryMeta,...p,active:p?.default||E,options:{...p?.options?p.options:{}}},c[c.length-1]),h={...e.options.features},v=h.hasOwnProperty(K);e.unreadEvents=n,e.userHasResponded=r,e.events=c.filter((e=>"participant"!==e.type||!!e.payload.participant?.introduction)),e.participantInfo={...e.participantInfo,...d?Ar(e.participantInfo,{participant:l[d]}):{},participants:l},e.historyLoaded=!0,e.serviceInfo={...e.serviceInfo,proactiveMessages:i?.settings?.proactiveMessages?.enabled||!1,activeServiceSessionId:i?.sessionId},e.serviceData={...e.serviceData,...a},e.options={...e.options,features:h},e.entryMeta=v||f.active!==N?f:{...e.entryMeta},e.resumeConversationPrompt=s.resumeConversationPrompt||!1,d&&(e.headerTitles.subTitle=l[d]?.name)},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=0}=t,r=n-1;e.idleDetachCountdown.remaining=r,e.idleDetachCountdown.timer=hn(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=Ar(e.participantInfo,{participant:t.participant,fromClient:t.fromClient})},setActiveService:(e,{payload:t})=>{e.serviceInfo.activeServiceSessionId!==t&&(e.serviceInfo.activeServiceSessionId=t)},setHeaderTitle:(e,{payload:t})=>{e.headerTitles.title=t},setHeaderSubTitle:(e,{payload:t})=>{e.headerTitles.subTitle=t},setInitialState:(e,{payload:t})=>{e.initialState=t,e.unreadEvents=Mr.unreadEvents},setServiceDataItem:(e,{payload:t})=>{e.serviceData[t.type]=t},setFeatures:(e,{payload:t})=>{t.features&&(e.options.features=t.features)},updateFeatures:(e,{payload:t})=>{Object.entries(t).forEach((([t,n])=>{e.options.features[t]=n}))},setFeatureEnabledState:(e,{payload:t})=>{e.options.features.hasOwnProperty(t.key)&&(e.options.features[t.key].enabled=t.enabled)},clearFeatures:e=>{e.options.features={webNotifications:e.options.features.webNotifications}},showOption:(e,{payload:t})=>{e.options.panelActive=!0,e.options.optionActive=t},hideOption:e=>{e.options.panelActive=!1,e.options.optionActive=""},setUserSelectedOptions:(e,{payload:t})=>{e.options.userSelectedOptions=t},setUserSelectedOption:(e,{payload:t})=>{const{option:n,value:r}=t;e.options.userSelectedOptions[n]=r},setBlockAutoEntrySwitch:(e,{payload:t})=>{e.entryMeta.blockAutoEntrySwitch=t},setServiceEntryMetadata:(e,{payload:t})=>{e.entryMeta.active=t.default,e.entryMeta.options=t.options||{},e.entryMeta.optionsOverride={},e.entryMeta.actions={},e.entryMeta.translatedActions={}},setActiveEntryType:(e,{payload:t})=>{e.entryMeta.active=t},setUserEntryType:(e,{payload:t})=>{e.entryMeta.userSelected=t},clearAbortTransaction:e=>{e.entryMeta.actions={}},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?{...e,progress:t.progress,uploading:100!==t.progress,uploadHandle:100===t.progress?null:e.uploadHandle}:e))},startProcessingImage:(e,{payload:t})=>{e.processingFileUploads.push(t)},doneProcessingImage:(e,{payload:t})=>{e.processingFileUploads=e.processingFileUploads.filter((e=>e!==t))},setUploadError:(e,{payload:t})=>{e.currentUploads=e.currentUploads.map((e=>e.id===t.fileId?{...e,error:t.errorText,progress:0,uploading:!1,uploadHandle:null}:e))},setUploadComplete:(e,{payload:t})=>{e.currentUploads=e.currentUploads.map((e=>e.id===t?{...e,complete:!0}:e))},clearAllUploads:e=>{e.currentUploads=[]},setSeamlyContainerElement:(e,{payload:t})=>{e.seamlyContainerElement=t},setProactiveMessages:(e,{payload:t})=>{e.serviceInfo.proactiveMessages=t}},extraReducers:e=>{e.addCase(Vn.pending,(()=>Mr)).addCase(Bn.pending,(e=>{e.isLoading=!0})).addCase(St.fulfilled,((e,{payload:t})=>{e.headerTitles.subTitle=t.agentParticipant?.name||"",t.features&&(e.options.features=t.features)})).addCase(Bn.fulfilled,((e,{payload:t,type:n})=>{e.isLoading=!1,t.initialState&&(e.initialState=t.initialState,"messages"in t.initialState&&Rr.caseReducers.setEvents(e,{payload:t.initialState,type:n}))})).addMatcher(st($r,Jr),(e=>{e.isLastEventFromClient=!1}))}}),{addEvent:Fr,updateEvent:Dr,clearAllUploads:Ur,clearEvents:jr,clearFeatures:zr,clearIdleDetachCountdown:Br,clearResumeConversationPrompt:Vr,decrementIdleDetachCountdownCounter:Kr,hideOption:Hr,initIdleDetachCountdown:$r,initResumeConversationPrompt:Jr,registerUpload:Wr,setActiveEntryType:qr,setActiveService:Gr,setBlockAutoEntrySwitch:Xr,setEventsRead:Yr,setFeatureEnabledState:Qr,updateFeatures:Zr,setFeatures:eo,setHeaderSubTitle:to,setHeaderTitle:no,setEvents:ro,setInitialState:oo,setIsLoading:io,setLoadedImageEventIds:ao,setParticipant:so,setSeamlyContainerElement:co,setServiceDataItem:lo,setServiceEntryMetadata:uo,clearAbortTransaction:po,setUploadComplete:fo,setUploadError:ho,setUploadProgress:vo,startProcessingImage:mo,doneProcessingImage:yo,setUserEntryType:_o,setUserSelectedOption:go,setUserSelectedOptions:bo,showOption:wo,stopIdleDetachCountdownCounter:xo,setProactiveMessages:Co}=Rr.actions;var So=Rr.reducer,Eo=({dispatch:e})=>t=>n=>{const r=t(n);if(St.fulfilled.match(n)&&n.payload.defaultUserLocale)return e(yr(n.payload.defaultUserLocale)),r;if(Bn.fulfilled.match(n))return n.payload.userLocale&&e(yr(n.payload.userLocale)),r;if(Fr.match(n)&&"info"===n.payload.type&&n.payload.payload.body&&"subtype"in n.payload.payload.body&&"new_translation"===n.payload.payload.body.subtype){const{body:t}=n.payload.payload;if(t.translationLocale&&t.translationEnabled)return e(yr(t.translationLocale)),r}return r};const To={isActive:!1,currentLocale:void 0,isAvailable:!1,languages:[],containerId:ct(),translatedEventGroups:{},translationProposal:null},No=(e,t)=>{const n=[...e].reduce(((e,{payload:n,type:r},o,i)=>{if(e[t]&&n.id){if("info"===r&&"divider"===n?.type&&n?.body?.translationEnabled)return i.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=>"divider"===e.payload?.type)).map((e=>e.payload.id)).at(-1),groupId:r,eventIds:o}},Io=gt({name:"translation",initialState:To,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}=No(t,n);e.lastGroupId=r},disableEventsTranslation:(e,{payload:{events:t,id:n}})=>{const{lastGroupId:r,groupId:o,eventIds:i}=No(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(Vn.pending,(()=>To)).addCase(St.fulfilled,((e,{payload:t})=>{const n=t?.features?.translation;n?.languages&&(e.isAvailable=!0===n.enabled,e.languages=[...n.languages].sort(((e,n)=>e.locale===t.defaultUserLocale?-1:n.locale===t.defaultUserLocale?1:e.nativeName?.localeCompare(n.nativeName||"",void 0,{sensitivity:"base"})||0)))})).addCase(yr.fulfilled,((e,{payload:t})=>{e.currentLocale=t.userLocale})).addCase(Fr,((e,{payload:t})=>{t.payload.id&&e.lastGroupId&&e.translatedEventGroups[e.lastGroupId]&&e.translatedEventGroups[e.lastGroupId].push(t.payload.id)})).addCase(ro,((e,{payload:t})=>{e.translationProposal=t?.ui?.translationProposal})).addCase(Bn.fulfilled,((e,{payload:t})=>{e.translationProposal=t.initialState?.ui?.translationProposal}))}}),{enableTranslation:Oo,disableTranslation:ko,enableEventsTranslation:Lo,disableEventsTranslation:Ao,setTranslationProposalPrompt:Po,disableTranslationProposalPrompt:Mo}=Io.actions;var Ro=Io.reducer;const Fo=gt({name:"visibility",initialState:{visibility:Dt.initialize,showInlineView:!1,setInputFocus:!1},reducers:{setShowInlineView:e=>{e.showInlineView=!0}},extraReducers:e=>{e.addCase(jn.fulfilled,((e,{payload:{visibility:t,setInputFocus:n}})=>{t&&(e.visibility=t,e.setInputFocus=Boolean(n))})).addCase(St.fulfilled,((e,{payload:t})=>{t.connectWhenInView||(e.showInlineView=!t.connectWhenInView)}))}}),{setShowInlineView:Do}=Fo.actions,Uo=ne({state:So,app:nr,config:Qn,i18n:xr,translations:Ro,visibility:Fo.reducer,forms:mr,interrupt:Ir});function jo({initialState:e,api:t,eventBus:n,config:r}){const o=function(e){const t=nt(),{reducer:n,middleware:r,devTools:o=!0,preloadedState:i,enhancers:a}=e||{};let s,c;if("function"==typeof n)s=n;else{if(!ee(n))throw new Error(xt(1));s=ne(n)}c="function"==typeof r?r(t):t();let l=re;o&&(l=Xe({trace:!1,..."object"==typeof o&&o}));const u=function(...e){return t=>(n,r)=>{const o=t(n,r);let i=()=>{throw new Error(X(15))};const a={getState:o.getState,dispatch:(e,...t)=>i(e,...t)},s=e.map((e=>e(a)));return i=re(...s)(o.dispatch),{...o,dispatch:i}}}(...c),d=it(u);return te(s,i,l(..."function"==typeof a?a(d):d()))}({reducer:Uo,preloadedState:e,middleware:e=>e({thunk:{extraArgument:{api:t,eventBus:n,config:r}},serializableCheck:!1}).concat(function({api:e}){return({getState:t})=>{const n=n=>{const{errorCallback:r,namespace:o,api:i,layoutMode:a}=Ut(t()),{error:s,type:c}=n,l=or[s?.name]?new or[s.name](s):new _(s);r?.(l,{namespace:o,api:i,layoutMode:a,conversationUrl:e.getConversationUrl(),action:c?n:void 0})};return e=>t=>{try{return t.payload?.originalEvent?.payload?n({error:t.payload,type:t.payload?.originalEvent?.payload?.type}):t.payload?.originalError&&n({error:t.payload,type:void 0}),e(t)}catch(e){throw n({error:e}),e}}}}({api:t}),function({api:e}){return()=>t=>n=>{const{payload:r,type:o}=n;if(o===Tr.type){if(!Or.includes(r.name))throw new b(r);"reset"===r.action&&e.disconnect().then((()=>{e.clearStore()}))}return t(n)}}({api:t}),function({api:e}){return()=>t=>n=>{const r=t(n);switch(n.type){case bo.toString():e.store.set("options",n.payload);break;case go.toString():e.store.set("options",{...e.store.get("options")||{},[n.payload.option]:n.payload.value})}return r}}({api:t}),Eo)});return o}const zo=ln;var Bo=n(5994);function Vo(e=""){const t=e=>/\s/.test(e),n=[],r={};let o=0,i=null,a=!1,s=0;for(;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])){const t="{"===e[s];if(i&&t){const t=Ko(e,s);if(-1===t)throw new Error(`Unbalanced curly braces in string: "${e}"`);r[i]=e.slice(s+1,t),s=t,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 Ko(e,t){let n=0;for(let r=t+1;r<e.length;r++){let t=e.charAt(r);if("}"===t){if(0===n)return r;n--}else"{"===t&&n++}return-1}function Ho(e){return $o(e.slice(1,-1),",",3)}function $o(e,t,n,r=[]){if(!e)return r;if(1===n)return r.push(e),r;let o=e.indexOf(t);if(-1===o)return r.push(e),r;let i=e.substring(0,o).trim(),a=e.substring(o+t.length+1).trim();return r.push(i),$o(a,t,n-1,r)}let Jo,Wo=0;const qo="other";function Go(e,t){let n=0,r="",o=0;const i={};for(;n<e.length;){if("#"!==e[n]||o)r+=e[n];else{let e="__hashToken"+Wo++;r+=`{${e}, number}`,i[e]=t}"{"===e[n]?o++:"}"===e[n]&&o--,n++}return{caseBody:r,numberValues:i}}const Xo="other",Yo=Pt((({i18n:e})=>e),(({translations:e})=>e)),Qo=Pt((({i18n:e})=>e),(({initialLocale:e})=>e)),Zo=Pt((({i18n:e})=>e),(({userLocale:e})=>e)),ei=Pt((({i18n:e})=>e),(({isLoading:e})=>e)),ti=new class{constructor(e,t={}){this.locale=e,this.typeHandlers=t}format=function(e){const t={};return function(...n){let r=n.length?n.map((e=>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,r))return t[r];let o=e(...n);return t[r]=o,o}}(((e,t={})=>this.process(e,t).flat(1/0).join("")));process(e,t={}){if(!e)return[];let n=e.indexOf("{");if(-1!==n){let r=Ko(e,n);if(-1===r)throw new Error(`Unbalanced curly braces in string: "${e}"`);{let o=e.substring(n,r+1);if(o){let i=[],a=e.substring(0,n);a&&i.push(a);let[s,c,l]=Ho(o),u=t[s];null==u&&(u="");let d=c&&this.typeHandlers[c];i.push(d?d(u,l,this.locale,t,this.process.bind(this)):u);let p=e.substring(r+1);return p&&i.push(this.process(p,t)),i}}}return[e]}}("en-GB",{plural:function(e,t,n,r,o){const{args:i,cases:a}=Vo(t);let s=parseInt(e);i.forEach((e=>{e.startsWith("offset:")&&(s-=parseInt(e.slice(7)))}));const c=[];if("PluralRules"in Intl){void 0!==Jo&&Jo.resolvedOptions().locale===n||(Jo=new Intl.PluralRules(n));const e=Jo.select(s);e!==qo&&c.push(e)}1===s&&c.push("one"),c.push(`=${s}`,qo);for(let e=0;e<c.length;e++){const t=c[e];if(t in a){const{caseBody:e,numberValues:n}=Go(a[t],s);return o(e,{...r,...n})}}return e},select:function(e,t,n,r,o){const{cases:i}=Vo(t);return e in i?o(i[e],r):Xo in i?o(i[Xo],r):e}});function ni(){const e=Qt(Yo),t=Qt(Zo),n=Qt(Qo),r=Qt(ei),o=(0,Bo.hb)(((n,o={})=>{if(!e)return"";const i=e[n];return i?ti.format(i,o):(r||console.warn(`Translation key: ${n} is missing in locale: ${t}`),"")}),[e,t,r]);return{t:o,userLocale:t,initialLocale:n}}const ri=()=>{const e=zo(),t=Qt(Rn),n=Qt(Dn),r=!!t&&t!==Dt.hidden,o=t===Dt.open,i=t===Dt.minimized,a=(0,Bo.hb)((t=>{e(jn("string"==typeof t||null===t?{visibility:t,setInputFocus:!1}:t))}),[e]);return{isVisible:r,isOpen:o,isMinimized:i,visible:t,setVisibility:a,openChat:()=>{a({visibility:Dt.open})},closeChat:()=>{a({visibility:Dt.minimized})},setInputFocus:n}},oi=({freezeOnceVisible:e=!1,enabled:t=!0,containerRef:n=(0,o._3)()})=>{const[r,i]=(0,Bo.J0)(null),a=!!r?.isIntersecting||!t,s=a&&e,c=([e])=>i(e);return(0,Bo.vJ)((()=>{const e=n?.current;if(!window.IntersectionObserver||s||!e||!t)return()=>{};const r=new IntersectionObserver(c,{threshold:0,root:null,rootMargin:"0%"});return r.observe(e),()=>r.disconnect()}),[n,t,s]),{isVisible:a,containerRef:n}},ii=()=>Qt(Rt),ai=(0,o.q6)(null),si=(0,o.q6)(null),ci=(0,o.q6)(null);var li=()=>{const e=(0,Bo.NT)(si);if(!e)throw new Error("useSeamlyEventBusContext has to be used within <SeamlyEventBusContext.Provider>");return e};const ui=()=>{const e=(0,Bo.NT)(ai);if(!e)throw new Error("useSeamlyApiContext has to be used within <SeamlyApiContext.Provider>");return e},di=()=>ui().store,pi=()=>{const e=ui();return(0,Bo.hb)((()=>e.hasConversation()),[e])};var fi=()=>{const e=ui(),t=zo(),n=li(),r=ii(),o=pi(),{visible:i,setVisibility:a}=ri(),s=In(),c=(0,Bo.hb)(((...e)=>{n.emit(...e)}),[n]),l=(0,Bo.hb)((()=>{c("ui.beforeStart",{visibility:i,hasConversation:o(),hasResponded:r,unreadMessageCount:s}),e.send("start_conversation"),c("ui.start",{visibility:i,hasConversation:o(),hasResponded:r,unreadMessageCount:s})}),[e,c,o,r,s,i]),u=(0,Bo.hb)((async()=>{await t(Vn())}),[t]),d=(0,Bo.hb)((e=>({type:e,id:$(),transactionId:$(),fromClient:!0,participant:"seamly-client-participant",occurredAt:1e3*Date.now()})),[]),p=(0,Bo.hb)((e=>({...d("text"),body:{text:e}})),[d]),f=(0,Bo.hb)((({body:n,config:r={}})=>{if(""===n.trim())return;const o={...p(n),...r};e.send("message",o),c("message",o),t(Fr({type:"message",payload:{...o,body:o.body,type:o.type,optimisticallyInjected:!0}}))}),[e,t,c,p]),h=(0,Bo.hb)(((e,n=$())=>{t(Fr({type:"message",payload:{...p(e),transactionId:n}}))}),[t,p]),v=(0,Bo.hb)(((e,n,r,o,i,a)=>{t(Fr({type:"message",payload:{type:"upload",id:e,transactionId:n,fromClient:!0,participant:"seamly-client-participant",occurredAt:r,body:{contentType:o,filename:i,filesize:a,id:e||""}}}))}),[t]),m=(0,Bo.hb)(((e,n=$())=>{t(Fr({type:"info",payload:{type:"divider",body:{subtype:e},fromClient:!1,participant:null,id:$(),transactionId:n}}))}),[t]),y=(0,Bo.hb)((t=>{if(!t)return;e.send("action",t);const{type:n}=t;n!==L&&n!==A&&c(`action.${n}`,t)}),[e,c]),_=(0,Bo.hb)((t=>{e.sendContext(t)}),[e]),g=(0,Bo.hb)((()=>e.connected?Promise.reject(new Error("The API is already connected")):e.connect().then((e=>{e&&(t(oo(e)),e.messages&&e.messages.length&&t(ro(e)),e.userResponded&&(t(tr(e.userResponded)),a({visibility:Dt.open})))})).catch((e=>{t(Tr({name:e?.name,message:e?.message,langKey:e?.langKey,action:e?.action,originalEvent:e?.originalEvent,originalError:e?.originalError}))}))),[e,t,a]);return{connect:g,start:l,sendMessage:f,sendAction:y,sendContext:_,reset:u,emitEvent:c,addMessageBubble:h,addUploadBubble:v,addDivider:m,apiConnected:e.connected,apiConfigReady:e.configReady}};const hi=()=>{const e=(()=>{const e=(0,Bo.NT)(ci);if(!e)throw new Error("useSeamlyLiveRegionContext has to be used within <SeamlyLiveRegionContext.Provider>");return e})();return{sendPolite:(0,Bo.hb)((t=>{t&&e({ariaLive:B,messageText:t})}),[e]),sendAssertive:(0,Bo.hb)((t=>{t&&e({ariaLive:z,messageText:t})}),[e])}},vi=Pt((({interrupt:e})=>e),(({error:e})=>e)),mi=Pt(vi,(e=>Boolean(e)));function yi(){const{t:e}=ni(),t=Qt(vi);return{hasError:Qt(mi),meta:(0,Bo.Kr)((()=>{if(!t)return{title:void 0,message:void 0,srText:void 0,buttonText:void 0,originalError:void 0,action:void 0};const{langKey:n,action:r}=t,o=e(`${n}.title`),i=e(`${n}.message`),a=e(`${n}.srText`),s=r?e(`${n}.buttonText`):null;return{...n?{title:o,message:i,srText:a}:{},...r?{action:r}:{},...r&&n?{buttonText:s}:{},originalError:t}}),[t,e]),error:t}}var _i=()=>{const{t:e}=ni(),{isInline:t,isWindow:n,isApp:r}=Mn(),{isOpen:o,isVisible:i}=ri(),a=Qt(Fn),{start:s,connect:c,apiConfigReady:l,apiConnected:u}=fi(),d=(0,Bo.li)(!1),{sendAssertive:p}=hi();!function(){const{meta:{originalError:e,action:t}}=yi(),n=zo(),{reset:r}=fi(),o="SeamlySessionExpiredError"===e?.name,i=(0,Bo.li)(0),a=(0,Bo.li)(null);(0,Bo.vJ)((()=>{if(o&&"reset"===t){if(i.current>=10){a.current=setTimeout((()=>{i.current=0}),1e4);const e=new b;return n(Tr({name:e.name,message:e.message,langKey:e.langKey,originalEvent:e.originalEvent,originalError:e.originalError,action:e.action})),()=>{}}i.current+=1,r()}return()=>{a.current&&clearTimeout(a.current)}}),[t,r,o,n])}(),(0,Bo.vJ)((()=>{i&&setTimeout((()=>{p(e("window.srTexts.onLoad"))}),500)}),[i,p,e]),(0,Bo.vJ)((()=>{i&&p(e(o?"window.srTexts.onOpen":"window.srTexts.onClose"))}),[o,i,p,e]),(0,Bo.vJ)((()=>{l||u||(d.current=!1)}),[l,u]);const f=(0,Bo.hb)((async()=>{u||(d.current=!0,await c()),(r||o||i&&t)&&s()}),[u,c,r,t,o,i,s]);(0,Bo.vJ)((()=>{!l||d.current||n&&!o||!(!t||i&&a)||f()}),[l,f,t,o,i,n,a])},gi=0;function bi(e,t,n,r,i,a){t||(t={});var s,c,l=t;if("ref"in l)for(c in l={},t)"ref"==c?s=t[c]:l[c]=t[c];var u={type:e,props:l,key:n,ref:s,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:--gi,__i:-1,__u:0,__source:i,__self:a};if("function"==typeof e&&(s=e.defaultProps))for(c in s)void 0===l[c]&&(l[c]=s[c]);return o.fF.vnode&&o.fF.vnode(u),u}Array.isArray;var wi=({children:e})=>(_i(),bi(o.FK,{children:e})),xi=(0,o.q6)(null);const Ci=(e=0)=>new Promise((t=>{setTimeout(t,e)})),Si=()=>{const{seamlyContainerElement:e}=Cn(),t=zo();return[e,(0,Bo.hb)((e=>{t(co(e))}),[t])]},Ei=e=>(0,Bo.hb)((()=>{var t;t=e,requestAnimationFrame((async()=>{await Ci(180);const e="string"==typeof t?document.getElementById(t):t;gn(e)}))}),[e]),Ti=()=>{const e=On();return Ei(e)},Ni=e=>Pt((e=>e.translations.translatedEventGroups),(t=>Object.values(t).every((t=>e?.payload?.id&&!t.includes(e.payload.id)))));function Ii(){const{sendContext:e}=fi(),t=zo(),n=un(),r=(0,Bo.hb)(((t,n)=>{e({userLocale:t,source:n})}),[e]),o=(0,Bo.hb)((()=>{e({userLocale:n.context?.contentLocale}),t(ko())}),[n.context?.contentLocale,t,e]),{languages:i,isActive:a,isAvailable:s,currentLocale:c}=Qt((({translations:e})=>e));return{languages:i,isActive:a,isAvailable:s,currentLocale:c,enableTranslations:r,disableTranslations:o}}const Oi=e=>{const t=Qt(Ni(e));if(!e?.payload)return{body:void 0,hasTranslation:!1,isTranslated:!1,locale:""};const n=e.payload?.translatedBody&&"data"in e.payload.translatedBody?e.payload?.translatedBody.data:e.payload.translatedBody,{translation:r,body:o}={body:e.payload?.body,translation:e.payload?.translation},i=!!n;return{body:t&&i?n:o,hasTranslation:i,isTranslated:t&&i,locale:r?.locale}};function ki(){const e=Qt((({translations:e})=>e.containerId));return{id:e,focusContainer:Ei(e)}}function Li(e){const{languages:t}=Ii();return(0,Bo.Kr)((()=>t?.find((t=>t.locale===e))?.nativeName),[e,t])}const Ai=()=>{const{isActive:e,languages:t}=Ii(),n=zo(),{sendAction:r}=fi(),{translationProposal:o}=Qt((e=>e.translations)),{enableTranslations:i}=Ii(),{isOpen:a}=ri(),{userLocale:s}=ni(),c=o?.proposedLocale,l=Li(c),u=(0,Bo.Kr)((()=>null!==o&&!e&&a&&s!==c&&t.some((e=>e.locale===c))),[o,e,a,s,c,t]);return{activateTranslationProposal:()=>{o?.proposedLocale&&i(o.proposedLocale,U)},dismissTranslationProposal:()=>{r({type:M,body:{type:D}}),n(Mo())},proposedLocale:c,proposedLocaleNativeName:l,showProposal:u,translationProposal:o}},Pi=(...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&&e.length)).map((e=>e&&e.indexOf(Kn)>-1?e:[Kn,e].join("-"))).join(" "),Mi=()=>un().appContainerClassNames,Ri=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};var Fi=()=>{const e=ui();return(0,zt.useSyncExternalStore)(m.subscribe,(()=>e.conversation))},Di=(0,o.q6)(null);const Ui=()=>{const{showFileUpload:e,entryMeta:{options:t,optionsOverride:n},options:{features:{uploads:r}}}=Cn(),{allowedMimeTypes:o,maxSize:i}=n?.upload||{},{enabled:a,enabledFromEntry:s}=r||{},{allowedMimeTypes:c,maxSize:l}={...t.upload||{allowedMimeTypes:[],maxSize:0},...o?{allowedMimeTypes:o}:{},...i?{maxSize:i}:{}};return{showFileUpload:e,accountAllowsUploads:!!r,serviceAllowsUploads:s||a,allowedMimeTypes:c,maxSize:l}},ji=()=>{const{currentUploads:e}=Cn(),t=zo(),n=(()=>{const e=(0,Bo.NT)(Di);if(!e)throw new Error("useSeamlyFileUploadContext has to be used within <SeamlyFileUploadContext.Provider>");return e})();return{uploadFile:(0,Bo.hb)((e=>{n(e)}),[n]),clearUploads:(0,Bo.hb)((()=>{t(Ur())}),[t]),currentUploads:e,isUploading:e.some((e=>e.uploading)),isComplete:e.every((e=>e.complete))}},zi=()=>{const{t:e}=ni(),{options:t}=Cn(),{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}))),d=a||s,p=zo(),{get:f,set:h}=di();return{allowOptionSelection:d,userSelectedOptions:o,features:i,menuOptions:u,initUserSelectedOptions:(0,Bo.hb)((()=>{const e=f("options")||{};p(bo(e))}),[f,p]),setUserSelectedOptions:(0,Bo.hb)((e=>{p(bo(e)),h("options",e)}),[h,p]),setUserSelectedOption:(0,Bo.hb)(((e,t)=>{const n=f("options")||{};"object"==typeof n&&h("options",{...n,[e]:t}),p(go({option:e,value:t}))}),[p,f,h]),showOption:e=>{p(wo(e))},hideOption:()=>{p(Hr())},panelActive:n,optionActive:r}},Bi=()=>{const{optionsButtonId:e}=Cn();return{id:e,focusButton:Ei(e)}};var Vi=(0,o.q6)(null),Ki=()=>{const e=(0,Bo.NT)(Vi);if(!e)throw new Error("useSeamlyActivityEventHandler has to be used within <SeamlyActivityEventContext.Provider>");return e},Hi=()=>{const e=zo(),{idleDetachCountdown:{hasCountdown:t,isActive:n,count:r,remaining:o,timer:i,wasStopped:a}}=Cn(),{isOpen:s}=ri(),{emitEvent:c,sendAction:l}=fi(),{t:u}=ni(),{sendAssertive:d,sendPolite:p}=hi(),f=(0,Bo.hb)((e=>{s&&d(e)}),[s,d]),h=(0,Bo.hb)((e=>{s&&p(e)}),[s,p]),v=(0,Bo.hb)((t=>{const n=(e=>Math.ceil(e/1e3))(t),r=hn(n);e($r({delaySeconds:n,delayTime:r})),c("idleTimer.start"),f(`${u("idleDetachWarning.countdownTitle")} ${u("idleDetachWarning.countdownText")} ${u("idleDetachWarning.countdownTimer",r)}`)}),[e,c,f,u]),m=(0,Bo.hb)(((n=void 0,r=!1)=>{t&&(n||(r||l({type:P}),f(u("idleDetachWarning.notifyTransferText"))),a||c("idleTimer.stop"),e(Br()))}),[e,c,t,l,f,u,a]),y=(0,Bo.hb)((()=>{if(!o||o<=0)return;const t=o-1;t%10==0&&f(`${u("idleDetachWarning.countdownText")} ${u("idleDetachWarning.countdownTimer",hn(t))}`),e(Kr())}),[e,o,f,u]),_=(0,Bo.hb)((()=>{n&&(e(xo()),o&&(c("idleTimer.stop"),h(u("idleDetachWarning.srCountDownStoppedText"))))}),[e,c,n,o,h,u]);return{hasCountdown:t,isActive:n,count:r,remaining:o,timer:i,wasStopped:a,initCountdown:v,endCountdown:m,decrementCountdown:y,stopCountdown:_}},$i=()=>{const e=zo(),t=Cn().resumeConversationPrompt,{sendAction:n}=fi(),{t:r}=ni(),{sendAssertive:o}=hi();return{continueChat:()=>{n({type:M,body:{type:"resume_conversation_prompt"}}),e(Vr())},hasPrompt:t,restartChat:()=>{o(r("resumeConversationPrompt.srNotifyRestartText")),n({type:P}),e(Vr())}}};const Ji=()=>{const[e]=(0,Bo.J0)((()=>$()));return e},Wi=(e,t)=>{const n=Fi();(0,Bo.vJ)((()=>{n.onMessage(((n,r)=>(t&&!t({type:n,payload:r})||e({type:n,payload:r}),r)))}),[e,t,n])};var qi=({eventPayload:e})=>{const{t:t}=ni(),{fromClient:n,participant:r}=e,o=(e=>Cn().participantInfo.participants[e])(r)||{},{messages:i}=un(),a=n?t("participants.user.name"):o&&o.name,{showAvatar:s,showName:c}=i&&i[n?"user":"agent"]||{};if(!s&&!c)return null;const l=[];return s&&a&&o.avatar&&l.push(bi("span",{className:Pi("message__avatar"),children:bi("img",{src:o.avatar,className:Pi("avatar"),alt:""})})),c&&a&&l.push(bi("span",{className:Pi("message__author-name"),children:a})),l.length>0?bi("div",{className:Pi("message__author"),children:l}):null},Gi=({showParticipant:e=!0,event:t,type:n,modifiers:r,children:i,bodyProps:a={},info:s,...c})=>{const l=Ri(t),{hasTranslation:u,isTranslated:d,locale:p}=Oi(t);return n&&l.push(`message--type-${n}`),r&&("string"==typeof r&&(r=r.split(" ").filter((e=>e.length))),r.forEach((e=>{l.push(`message--${e}`)}))),d&&l.push("message--is-translated"),u&&l.push("message--has-translation"),d&&(a={...a,lang:p}),bi(o.FK,{children:bi("div",{className:Pi(l),...c,children:[e&&bi(qi,{eventPayload:t.payload}),bi("div",{className:Pi("message__body"),...a,children:i}),s&&bi("div",{"aria-hidden":"true",className:Pi("message__info"),children:s})]})})},Xi=({id:e,action:t,buttonText:n,description:r,hasFocus:o,image:i,title:a,isCarouselItem:s})=>{const c=(0,Bo.li)(null),{sendMessage:l,sendAction:u,emitEvent:d}=fi(),p=Ji(),f=(0,Bo.li)(!1),h=t?.type===H?"a":"button",v=(0,Bo.hb)((()=>d("action.click_card",{type:F,originMessage:e,action:t})),[d,e,t]),m=(0,Bo.hb)((()=>{if(v(),"ask"===t?.type)l({body:t?.ask});else if("topic"===t?.type){const{topic:e,fallbackMessage:n}=t;u({type:R,body:{name:e,fallbackMessage:n}})}}),[l,t,u,v]),y=(0,Bo.Kr)((()=>t?.type===H?{href:t?.link,rel:"noopener noreferrer",target:t?.newTab?"_blank":"_self",onClick:v}:{onClick:m}),[t,m,v]);return(0,Bo.vJ)((()=>{s&&(o&&f.current?window.requestAnimationFrame((()=>c.current?.focus())):c.current?.blur()),f.current=!0}),[o,s]),bi("div",{className:Pi("card__wrapper"),id:e,tabIndex:-1,ref:c,children:[i?bi("img",{className:Pi("card__image"),src:i,alt:""}):null,bi("div",{className:Pi("card__content"),id:e,children:[a&&bi("h2",{className:Pi("card__title"),children:a}),r&&bi("div",{className:Pi("card__description"),dangerouslySetInnerHTML:{__html:r}}),bi(h,{tabIndex:s&&!o?-1:void 0,className:Pi("button","button--primary"),"aria-describedby":p,...y,children:n})]})]})};function Yi({item:e,items:t,index:n,isActive:r}){const{t:o}=ni();return bi("div",{className:Pi("carousel-item",`carousel-item--${e.type}`),role:"group","aria-roledescription":"slide","aria-label":o("carousel.slide.label",{index:n+1,total:t.length}),children:bi(Xi,{...e,isCarouselItem:!0,hasFocus:r})})}const Qi={send:{32:'<svg xmlns="http://www.w3.org/2000/svg" width="32px" height="32px" x="0px" y="0px" viewBox="0 0 32 32"><defs/><path fill="#4A48C1" d="M6.714,14.985l17.837-7.906c0.681-0.302,1.414,0.301,1.25,1.027L22.273,23.59\tc-0.13,0.566-0.751,0.865-1.275,0.613l-3.623-1.752l-2.334,2.287c-0.572,0.562-1.538,0.156-1.538-0.645V21.01\tc0-0.217,0.078-0.43,0.222-0.594l7.676-8.841l-10.414,7.472l-4.351-2.445C5.987,16.236,6.033,15.287,6.714,14.985L6.714,14.985z"/></svg>'},balloon:{32:'<svg xmlns="http://www.w3.org/2000/svg" width="32px" height="32px" x="0px" y="0px" viewBox="0 0 32 32"><defs/><path fill="#4A48C1" d="M24,10.824v10.375c0,1.104-0.896,2-2,2h-4.694l-4.931,3.625v-3.625H10c-1.104,0-2-0.896-2-2V10.824\tc0-1.104,0.896-2,2-2h12C23.104,8.824,24,9.719,24,10.824z"/></svg>'},newTopic:{32:'<svg xmlns="http://www.w3.org/2000/svg" width="32px" height="32px" x="0px" y="0px" viewBox="0 0 32 32"><path fill="#4A48C1" d="M16,8.593l2.407,4.573l5.093,0.876l-3.604,3.702l0.74,5.115L16,20.574l-4.634,2.285l0.739-5.115L8.5,14.042\tl5.094-0.876L16,8.593z"/></svg>'},newTranslation:{16:'<svg xmlns="http://www.w3.org/2000/svg" x="0px" y="0px" viewBox="0 0 16 16"><path fill="#4A48C1" d="M8,0C3.6,0,0,3.6,0,8s3.6,8,8,8s8-3.6,8-8S12.4,0,8,0z M14.1,7.1h-1.4c-0.1-1.5-0.4-2.9-1-4\tC13,4,13.9,5.4,14.1,7.1z M7.1,2.1v5H5C5.2,4.7,6.1,2.9,7.1,2.1z M7.1,8.9v5c-1-0.7-1.9-2.5-2.1-5H7.1z M8.9,13.9v-5H11\tC10.8,11.3,9.9,13.2,8.9,13.9z M8.9,7.1v-5c1,0.7,1.9,2.5,2.1,5H8.9z M4.2,3.1c-0.5,1.1-0.9,2.5-1,4H1.9C2.1,5.4,3,4,4.2,3.1z M1.9,8.9h1.4c0.1,1.5,0.4,2.9,1,4C3,12,2.1,10.5,1.9,8.9z M11.8,12.9c0.5-1.1,0.9-2.5,1-4h1.4C13.9,10.5,13,12,11.8,12.9z"/></svg>',32:'<svg xmlns="http://www.w3.org/2000/svg" x="0px" y="0px" viewBox="0 0 32 32"><path fill="#4A48C1" d="M16,7c-4.9,0-9,4.1-9,9s4.1,9,9,9s9-4.1,9-9S20.9,7,16,7z M22.9,15h-1.6c-0.1-1.7-0.5-3.3-1.1-4.5\tC21.6,11.5,22.6,13.1,22.9,15z M15,9.4V15h-2.3C12.9,12.3,13.9,10.2,15,9.4z M15,17v5.6c-1.1-0.8-2.1-2.9-2.3-5.6H15z M17,22.6V17\th2.3C19.1,19.8,18.1,21.8,17,22.6z M17,15V9.4c1.1,0.8,2.1,2.9,2.3,5.6H17z M11.8,10.4c-0.6,1.3-1,2.8-1.1,4.5H9.1\tC9.4,13.1,10.4,11.5,11.8,10.4z M9.1,17h1.6c0.1,1.7,0.5,3.3,1.1,4.5C10.4,20.5,9.4,18.9,9.1,17z M20.2,21.5c0.6-1.3,1-2.8,1.1-4.5\th1.6C22.6,18.8,21.6,20.5,20.2,21.5z"/></svg>'},avatar:{32:'<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"\n\t viewBox="0 0 32 32" enable-background="new 0 0 32 32" xml:space="preserve">\n<path fill="#4A48C1" d="M10,14.8c-1.1,0-2-0.9-2-2s0.9-2,2-2s2,0.9,2,2S11.1,14.8,10,14.8z M15.9,14.8c1.1,0,2-0.9,2-2s-0.9-2-2-2\n\ts-2,0.9-2,2S14.8,14.8,15.9,14.8z M21.8,10.8c-1.1,0-2,0.9-2,2s0.9,2,2,2s2-0.9,2-2S22.9,10.8,21.8,10.8z M21.3,18.1H10.7\n\tC11.7,23.9,20.2,23.9,21.3,18.1z"/>\n</svg>\n'},chevronDown:{8:'<svg xmlns="http://www.w3.org/2000/svg" width="8px" height="8px" x="0px" y="0px" viewBox="0 0 8 8"><defs/><path fill="#4A48C1" d="M-0.001,2.876c0-0.247,0.091-0.494,0.273-0.688c0.38-0.401,1.013-0.418,1.414-0.039l1.938,1.834\tc0.199,0.188,0.547,0.188,0.746,0L6.31,2.15c0.401-0.379,1.034-0.362,1.414,0.04c0.379,0.401,0.361,1.034-0.04,1.414L5.745,5.437\tC4.782,6.35,3.213,6.35,2.249,5.436L0.311,3.603C0.103,3.406-0.001,3.142-0.001,2.876z"/></svg>',32:'<svg xmlns="http://www.w3.org/2000/svg" width="32px" height="32px" x="0px" y="0px" viewBox="0 0 32 32"><defs/><path fill="#4A48C1" d="M16,20.425c-0.782,0-1.563-0.291-2.159-0.874l-6.541-6.408c-0.395-0.387-0.401-1.02-0.015-1.414\tc0.387-0.394,1.021-0.4,1.414-0.015l6.541,6.408c0.42,0.409,1.102,0.409,1.52-0.001l6.541-6.407c0.396-0.386,1.028-0.38,1.414,0.015\tc0.387,0.395,0.381,1.027-0.014,1.414l-6.541,6.407C17.563,20.133,16.782,20.425,16,20.425z"/></svg>'},chevronRight:{8:'<svg xmlns="http://www.w3.org/2000/svg" width="8px" height="8px" x="0px" y="0px" viewBox="0 0 8 8"><defs/><path fill="#4A48C1" d="M2.875,7.998c-0.247,0-0.494-0.091-0.688-0.273c-0.401-0.38-0.418-1.013-0.039-1.414l1.834-1.938\tc0.188-0.199,0.188-0.547,0-0.746l-1.835-1.94c-0.379-0.401-0.362-1.034,0.04-1.414s1.034-0.361,1.414,0.04l1.834,1.939\tc0.913,0.963,0.913,2.532-0.001,3.496L3.601,7.686C3.405,7.894,3.14,7.998,2.875,7.998z"/></svg>',16:'<svg xmlns="http://www.w3.org/2000/svg" width="16px" height="16px" x="0px" y="0px" viewBox="0 0 16 16"><defs/><path fill="#4A48C1" d="M6.5,13c-0.247,0-0.494-0.091-0.687-0.273c-0.401-0.38-0.419-1.013-0.04-1.414L8.22,8.727\tc0.373-0.394,0.373-1.06,0-1.454L5.773,4.687c-0.379-0.401-0.362-1.034,0.04-1.414c0.4-0.378,1.034-0.362,1.414,0.04l2.446,2.586\tc1.096,1.159,1.096,3.043,0,4.203l-2.446,2.586C7.03,12.896,6.765,13,6.5,13z"/></svg>'},close:{8:'<svg xmlns="http://www.w3.org/2000/svg" width="8px" height="8px" x="0px" y="0px" viewBox="0 0 8 8"><defs/><path fill="#4A48C1" d="M7.705,7.729C7.511,7.923,7.255,8.02,7,8.02c-0.257,0-0.514-0.099-0.709-0.295L4,5.423L1.709,7.725\tC1.513,7.921,1.257,8.02,1,8.02c-0.255,0-0.51-0.097-0.706-0.291c-0.391-0.39-0.393-1.022-0.003-1.414l2.298-2.309l-2.27-2.28\tC-0.07,1.334-0.068,0.701,0.323,0.311c0.392-0.389,1.024-0.387,1.415,0.003L4,2.587l2.263-2.274C6.653-0.077,7.287-0.079,7.677,0.31\tC8.068,0.7,8.07,1.333,7.681,1.725l-2.27,2.281l2.298,2.309C8.099,6.705,8.097,7.339,7.705,7.729z"/></svg>',16:'<svg xmlns="http://www.w3.org/2000/svg" width="16px" height="16px" x="0px" y="0px" viewBox="0 0 16 16"><defs/><path fill="#4A48C1" d="M12.709,11.295L9.411,7.982l3.262-3.276c0.39-0.392,0.388-1.024-0.004-1.414\tc-0.39-0.39-1.023-0.388-1.414,0.003L8,6.564L4.746,3.295C4.357,2.904,3.724,2.903,3.332,3.292C2.94,3.682,2.939,4.315,3.329,4.707\tl3.261,3.275l-3.298,3.313c-0.39,0.391-0.388,1.024,0.003,1.414C3.49,12.903,3.745,13,4,13c0.257,0,0.513-0.099,0.708-0.295L8,9.399\tl3.291,3.306C11.486,12.901,11.743,13,12,13c0.255,0,0.511-0.097,0.705-0.291C13.097,12.319,13.099,11.686,12.709,11.295z"/></svg>'},enlarge:{32:'<svg xmlns="http://www.w3.org/2000/svg" width="32px" height="32px" x="0px" y="0px" viewBox="0 0 32 32"><defs/><path fill="#4A48C1" d="M24,9v6.5c0,0.552-0.447,1-1,1s-1-0.448-1-1v-4.086L11.414,22H15.5c0.552,0,1,0.447,1,1s-0.448,1-1,1H9\tc-0.13,0-0.26-0.026-0.382-0.077c-0.245-0.102-0.439-0.296-0.541-0.541C8.026,23.26,8,23.13,8,23v-6.5c0-0.552,0.448-1,1-1\ts1,0.448,1,1v4.085L20.586,10H16.5c-0.552,0-1-0.448-1-1s0.448-1,1-1H23c0.13,0,0.26,0.026,0.382,0.077\tc0.245,0.102,0.439,0.296,0.541,0.541C23.974,8.74,24,8.87,24,9z"/></svg>'},options:{32:'<svg xmlns="http://www.w3.org/2000/svg" width="32px" height="32px" x="0px" y="0px" viewBox="0 0 32 32"><defs/><path fill="#4A48C1" d="M26.1,21.383c0.334-0.625,0.602-1.279,0.812-1.949L32,18.609V13.51l-5.058-0.846\tc-0.208-0.67-0.468-1.325-0.795-1.956l3.009-4.145l-3.604-3.634L21.38,5.903c-0.626-0.333-1.276-0.602-1.948-0.81L18.609,0\tl-5.098,0.001l-0.847,5.061c-0.669,0.203-1.326,0.465-1.957,0.794L6.562,2.847L2.929,6.449l2.973,4.171\tC5.569,11.247,5.3,11.9,5.091,12.569L0,13.373v5.099l5.06,0.866c0.204,0.669,0.467,1.324,0.796,1.955l-3.009,4.146l3.601,3.635\tl4.171-2.975c0.627,0.335,1.282,0.603,1.951,0.811L13.372,32h5.118l0.849-5.057c0.668-0.207,1.323-0.469,1.953-0.795l4.144,3.01\tl3.639-3.604L26.1,21.383z M19.01,19.035c-1.675,1.663-4.381,1.652-6.041-0.025c-1.662-1.675-1.649-4.381,0.024-6.042\tc1.676-1.661,4.382-1.648,6.043,0.025C20.699,14.67,20.686,17.377,19.01,19.035z"/></svg>'},file:{32:'<svg xmlns="http://www.w3.org/2000/svg" xml:space="preserve" x="0px" y="0px" version="1.1" viewBox="0 0 32 32"><path fill="#4A48C1" d="M16,28.5c-3.6,0-6.5-3-6.5-6.6V9.6c0-0.6,0.4-1,1-1s1,0.4,1,1v12.3c0,2.5,2,4.6,4.5,4.6\tc2.5,0,4.5-2.1,4.5-4.6V8.3c0-1.5-1.2-2.8-2.7-2.8c-1.5,0-2.7,1.3-2.7,2.8v13.5c0,0.6,0.5,1.1,1,1.1c0.6,0,1-0.5,1-1.1v-10\tc0-0.6,0.4-1,1-1s1,0.4,1,1v10c0,1.7-1.4,3.1-3,3.1s-3-1.4-3-3.1V8.3c0-2.6,2.1-4.8,4.7-4.8c2.6,0,4.7,2.2,4.7,4.8v13.6\tC22.5,25.5,19.6,28.5,16,28.5z"/></svg>'},upload:{32:'<svg xmlns="http://www.w3.org/2000/svg" width="32px" height="32px" x="0px" y="0px" viewBox="0 0 32 32"><defs/><path fill="#4A48C1" d="M9.488,13.481c-0.391-0.391-0.391-1.023,0-1.414l5.805-5.805c0.026-0.026,0.06-0.036,0.088-0.058\tc0.073-0.06,0.146-0.119,0.235-0.156c0.246-0.103,0.522-0.103,0.769,0c0.093,0.039,0.171,0.101,0.249,0.165\tc0.023,0.02,0.053,0.027,0.074,0.049l5.805,5.805c0.391,0.391,0.391,1.023,0,1.414c-0.195,0.195-0.451,0.293-0.707,0.293\ts-0.512-0.098-0.707-0.293L17,9.383V20.33c0,0.553-0.447,1-1,1c-0.552,0-1-0.447-1-1V9.383l-4.098,4.098\tC10.512,13.872,9.879,13.872,9.488,13.481z M22.819,24.031H9.181c-0.552,0-1,0.447-1,1s0.448,1,1,1h13.639c0.553,0,1-0.447,1-1\tS23.372,24.031,22.819,24.031z"/></svg>'},download:{16:'<svg xmlns="http://www.w3.org/2000/svg" width="16px" height="16px" x="0px" y="0px" viewBox="0 0 16 16"><defs/><path fill="#FFF" d="M3.175,7.726c-0.413-0.367-0.45-0.999-0.083-1.412c0.367-0.413,0.999-0.45,1.412-0.083L7,8.45V1.5\tc0-0.552,0.448-1,1-1c0.553,0,1,0.448,1,1v6.95l2.496-2.219c0.412-0.367,1.044-0.331,1.411,0.083\tc0.367,0.413,0.33,1.045-0.083,1.412l-4.16,3.698c-0.047,0.041-0.103,0.062-0.154,0.094c-0.047,0.028-0.089,0.064-0.141,0.085\tC8.25,11.649,8.125,11.677,8,11.677c-0.126,0-0.25-0.027-0.369-0.074c-0.05-0.021-0.09-0.055-0.136-0.083\tc-0.053-0.031-0.111-0.053-0.159-0.096L3.175,7.726z M12.018,13.5H3.983c-0.552,0-1,0.447-1,1s0.448,1,1,1h8.035\tc0.553,0,1-0.447,1-1S12.57,13.5,12.018,13.5z"/></svg>'},error:{16:'<svg xmlns="http://www.w3.org/2000/svg" width="16px" height="16px" x="0px" y="0px" viewBox="0 0 16 16"><defs/><path fill="#ad001f" d="M15.744,13.104L9.097,1.47c-0.604-1.055-1.59-1.055-2.193,0L0.256,13.104\tc-0.604,1.056-0.102,1.919,1.113,1.919H14.63C15.847,15.022,16.348,14.159,15.744,13.104z M7,5.045c0-0.552,0.448-1,1-1s1,0.448,1,1\tv3.656c0,0.552-0.448,1-1,1s-1-0.448-1-1V5.045z M8,13.212c-0.748,0-1.354-0.607-1.354-1.354c0-0.748,0.606-1.354,1.354-1.354\ts1.354,0.606,1.354,1.354C9.354,12.604,8.748,13.212,8,13.212z"/></svg>'},arrowLeft:{16:'<?xml version="1.0" encoding="utf-8"?>\n\x3c!-- Generator: Adobe Illustrator 25.2.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) --\x3e\n<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"\n\t viewBox="0 0 16 16" enable-background="new 0 0 16 16" xml:space="preserve">\n<path fill="#5053A4" d="M13.6,8c0,0.6-0.4,1-1,1h-7l2.2,2.5c0.4,0.4,0.3,1-0.1,1.4c-0.2,0.2-0.4,0.2-0.7,0.2c-0.3,0-0.6-0.1-0.8-0.3\n\tL2.6,8.6c0,0-0.1-0.1-0.1-0.2c0,0-0.1-0.1-0.1-0.1c0-0.1-0.1-0.2-0.1-0.3c0,0,0,0,0,0c0,0,0,0,0,0c0-0.1,0-0.3,0.1-0.4\n\tc0,0,0.1-0.1,0.1-0.1c0-0.1,0.1-0.1,0.1-0.2l3.7-4.1c0.4-0.4,1-0.4,1.4-0.1c0.4,0.4,0.4,1,0.1,1.4L5.6,7h7C13.2,7,13.6,7.4,13.6,8z"\n\t/>\n</svg>\n'},arrowRight:{16:'<?xml version="1.0" encoding="utf-8"?>\n\x3c!-- Generator: Adobe Illustrator 25.2.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) --\x3e\n<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"\n\t viewBox="0 0 16 16" enable-background="new 0 0 16 16" xml:space="preserve">\n<path fill="#5053A4" d="M2.4,8.1c0-0.6,0.4-1,1-1h7L8.1,4.5c-0.4-0.4-0.3-1,0.1-1.4c0.2-0.2,0.4-0.2,0.7-0.2c0.3,0,0.6,0.1,0.8,0.3\n\tl3.7,4.2c0,0,0.1,0.1,0.1,0.2c0,0,0.1,0.1,0.1,0.1c0,0.1,0.1,0.2,0.1,0.3c0,0,0,0,0,0c0,0,0,0,0,0c0,0.1,0,0.3-0.1,0.4\n\tc0,0-0.1,0.1-0.1,0.1c0,0.1-0.1,0.1-0.1,0.2l-3.7,4.1c-0.4,0.4-1,0.4-1.4,0.1c-0.4-0.4-0.4-1-0.1-1.4l2.2-2.4h-7\n\tC2.8,9.1,2.4,8.6,2.4,8.1z"/>\n</svg>\n'},check:{16:'<svg\n xmlns="http://www.w3.org/2000/svg"\n width="16px"\n height="16px"\n x="0px"\n y="0px"\n viewBox="0 0 16 16"\n>\n <path\n fill="currentColor"\n d="M11.6,4.3l-5,5L4.9,7.5C4.4,7,3.7,7,3.2,7.5l0,0C2.8,8,2.8,8.7,3.2,9.2l1.7,1.7l0,0l0.8,0.8\n\tc0.5,0.5,1.2,0.5,1.7,0l0.8-0.8l5-5c0.5-0.5,0.5-1.2,0-1.7l0,0C12.8,3.8,12.1,3.8,11.6,4.3z"\n />\n</svg>\n',32:'<svg\n xmlns="http://www.w3.org/2000/svg"\n width="32px"\n height="32px"\n x="0px"\n y="0px"\n viewBox="0 0 32 32"\n>\n <path\n fill="currentColor"\n d="M22.9,9.3l-9.3,9.3l-3.2-3.2c-0.9-0.9-2.3-0.9-3.2,0l0,0c-0.9,0.9-0.9,2.3,0,3.2l3.2,3.2l0,0l1.6,1.6\n\tc0.9,0.9,2.3,0.9,3.2,0l1.6-1.6l9.3-9.3c0.9-0.9,0.9-2.3,0-3.2l0,0C25.2,8.4,23.7,8.4,22.9,9.3z"\n />\n</svg>\n'}};var Zi=({name:e,size:t="32",className:n,alt:r})=>bi(o.FK,{children:[bi("div",{"aria-hidden":"true",className:n||Pi("icon"),dangerouslySetInnerHTML:{__html:Qi[e][t]}}),r&&bi("span",{className:Pi("visually-hidden"),children:r})]});function ea({items:e,currentIndex:t,onChange:n,children:r}){const{t:o}=ni(),i=e.length;return bi("div",{className:Pi("carousel-controls"),children:[bi("button",{className:Pi("button","button--previous"),"aria-label":o("carousel.controls.previous"),onClick:()=>{n((t-1+i)%i)},children:bi(Zi,{name:"arrowLeft",size:"16",alt:""})}),r,bi("button",{className:Pi("button","button--next"),"aria-label":o("carousel.controls.next"),onClick:()=>{n((t+1)%i)},children:bi(Zi,{name:"arrowRight",size:"16",alt:""})})]})}function ta({items:e,currentIndex:t,onChange:n,getItemKey:r,getItemLabel:o}){const i=e.length,a=(0,Bo.hb)((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 bi("div",{className:Pi("carousel-pagination__wrapper"),role:"group",children:bi("ul",{className:Pi("carousel-pagination"),children:e.map(((e,n)=>{const i=t===n;return bi("li",{className:Pi("carousel-pagination__item",i?"is-active":void 0),children:bi("button",{className:Pi("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 na=(e,t,n)=>`${n}${t}`,ra=e=>e.label,oa=({target:e})=>{e.scrollLeft=0};function ia({currentIndex:e=0,onChange:t=()=>{},getItemKey:n=na,getItemLabel:r=ra,items:i}){const a=Ji(),s=i.length,[c,l]=(0,Bo.J0)(Number(e||0));(0,Bo.vJ)((()=>{l(Number(e||0))}),[l,e]);const u=(0,Bo.li)([]);u.current=(0,Bo.Kr)((()=>Array(s).fill(1).map((()=>(0,o._3)()))),[s]);const d=(0,Bo.li)(!0),p=(0,Bo.li)(null);return p.current=t,(0,Bo.vJ)((()=>{d.current?d.current=!1:p.current&&p.current(c)}),[c]),bi("div",{className:Pi("carousel"),role:"group","aria-roledescription":"carousel",children:[bi("div",{className:Pi("carousel__slides-wrapper"),onScroll:oa,children:bi("div",{id:a,className:Pi("carousel__slides"),style:{width:100*s+"%",left:-100*c+"%"},"aria-live":"polite","aria-atomic":"false",children:i.map(((e,t)=>{const r=c===t;return bi("div",{ref:u.current[t],className:Pi("carousel__slide",r?"is-active":void 0),"aria-hidden":r?void 0:"true",children:bi(Yi,{item:e,items:i,index:t,isActive:r})},n(e,t,"item-"))}))})}),bi("div",{className:Pi("carousel__controls"),children:bi(ea,{currentIndex:c,items:i,onChange:l,children:bi("div",{className:Pi("carousel__pagination"),children:bi(ta,{currentIndex:c,items:i,onChange:l,getItemKey:n,getItemLabel:r})})})})]})}const aa=(e,t,n="")=>`${n}${e.title}:${t}`,sa=e=>e.title;const ca=e=>{const{payload:t}=e,[n,r]=(0,Bo.J0)(!1),{sendAction:o,addMessageBubble:i,addDivider:a}=fi(),{activeServiceSessionId:s}=kn(),c=Qt(Ln),{body:l}=Oi(e),{service:u}=t,d=(0,Bo.Kr)((()=>{if("choice_prompt"===e.payload.type)return{...e,payload:{...e.payload,body:e.payload.body?.prompt,translatedBody:e.payload.translatedBody&&{...e.payload.translatedBody,data:e.payload.translatedBody?.prompt}}}}),[e]),p=l?.chooseAgain&&s===u?.serviceSessionId&&t.id!==c;return(0,Bo.vJ)((()=>{r(t.id===c)}),[t,c]),{body:l,subEvent:d,showOptions:n,chooseAgain:p,onChoiceClickHandler:e=>{const n=$();p&&a("new_topic",n),i(e.text,n),o({type:"pick_choice",originMessage:t.id,choice:{id:e.id,chooseAgain:p},transactionId:n}),r(!1)},onChooseAgainClickHandler:()=>{r((e=>!e))}}};const la=e=>`suggestions__item--${String(e).toLowerCase().replace(/[^a-z0-9_\\-]/,"")}`;var ua=({id:e,categories:t=[],question:n,onClick:r,hasIcon:o})=>{const i=(0,Bo.Kr)((()=>["suggestions__item",...t.map(la)]),[t]),a=(0,Bo.hb)((()=>{r&&r({id:e,question:n})}),[e,n,r]);return bi("li",{className:Pi(i),children:bi("button",{type:"button",onClick:a,className:Pi("button","button--primary"),children:[o&&bi(Zi,{name:"chevronRight",size:"8",alt:""}),n]})})},da=({className:e,suggestions:t=[],onClickSuggestion:n,hasIcon:r=!0})=>bi("ul",{className:Pi("suggestions__list",e||""),children:t.map((e=>bi(ua,{hasIcon:r,onClick:n,categories:e.categories,id:e.id,question:e.question},e.id)))}),pa=({originMessage:e,transactionId:t})=>{const{sendAction:n}=fi();return r=>{r.target&&r.target.dataset.linkId&&n({type:"navigate",originMessage:e,transactionId:t,link:{id:r.target.dataset.linkId,url:r.target.getAttribute("href")}})}},fa=({children:e,className:t,graphicSrc:n,graphicType:r="icon",iconName:o,iconSize:i,iconClassName:a,dividerType:s,title:c,description:l})=>{const u=Boolean(o||n);return bi("div",{className:Pi("divider",s&&`divider--type-${s}`,t),children:[u&&bi("span",{className:Pi("divider__graphic"),children:o?bi(Zi,{name:o,size:i,className:a,alt:""}):bi("img",{src:n||void 0,className:Pi({icon:"icon"===r,avatar:"avatar"===r},a)})}),bi("div",{className:Pi("divider__body"),children:[c?bi("h2",{className:Pi("divider__title"),dangerouslySetInnerHTML:{__html:c}}):null,l?bi("p",{className:Pi("divider__description"),dangerouslySetInnerHTML:{__html:l}}):null,e]})]})};const ha={[V.new_topic]:"new-topic"};const va={default:({event:e})=>{const{t:t}=ni(),{subtype:n}=e.payload.body;return V[n]?bi(fa,{dividerType:ha[V[n]],iconName:V[n],title:t(`dividerKeys.${V[n]}`)}):null},[V.new_translation]:({event:e})=>{const{t:t}=ni(),n=Tn(),{body:{translationEnabled:r,text:i,title:a},id:s}=e.payload,c=Qt((e=>e.translations.translatedEventGroups)),l=zo(),u=(0,Bo.hb)((()=>{c[s]?l(Lo({events:n,id:s})):l(Ao({events:n,id:s}))}),[l,n,s,c]);return bi(fa,{iconName:"newTranslation",dividerType:"new-translation",title:a,description:i,children:r?bi(o.FK,{children:bi("button",{className:Pi("button","button--secondary"),onClick:u,children:t(c[s]?"translations.toggle.showTranslationsButtonText":"translations.toggle.hideTranslationsButtonText")})}):null})}};const ma={month:"long",day:"numeric",year:"numeric"},ya={hour:"numeric",minute:"numeric"};var _a=({event:e})=>{const t=(()=>{const[e,t]=(0,Bo.WO)((e=>e+1),0);return(0,Bo.hb)((()=>{setTimeout((()=>{t()}))}),[])})(),{date:n,time:r,timeUntilMidnight:o,srText:i}=(e=>{const{t:t}=ni(),n=un(),r=n?.context?.userLocale??[],o=new Date(e),i=new Date,a=new Date(i);a.setHours(24,0,0,0);const s=a.valueOf()-i.valueOf(),c=o.toString(),l=new Intl.DateTimeFormat(r,ya).format(o);let u=((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})(o,i);switch(u){case"today":u=t("dateTime.today");break;case"yesterday":u=t("dateTime.yesterday");break;default:u=new Intl.DateTimeFormat(r,ma).format(o)}return{date:u,srText:t("dateTime.srText",{date:u,time:l}),time:l,fullDateTime:c,timeUntilMidnight:s}})(fn(e.payload.timeIndicator));return(0,Bo.vJ)((()=>{const e=setTimeout((()=>{t()}),o);return()=>{clearTimeout(e)}}),[t,o]),bi(fa,{dividerType:"time-indicator",children:[bi("h2",{className:Pi("divider__time"),"aria-hidden":"true",children:[bi("span",{className:Pi("divider__time--date"),children:n}),bi("span",{className:Pi("divider__time--time"),children:r})]}),bi("p",{className:Pi("visually-hidden"),children:i})]})},ga=["input:not([inert])","select:not([inert])","textarea:not([inert])","a[href]:not([inert])","button:not([inert])","[tabindex]:not(slot):not([inert])","audio[controls]:not([inert])","video[controls]:not([inert])",'[contenteditable]:not([contenteditable="false"]):not([inert])',"details>summary:first-of-type:not([inert])","details:not([inert])"],ba=ga.join(","),wa="undefined"==typeof Element,xa=wa?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Ca=!wa&&Element.prototype.getRootNode?function(e){var t;return null==e||null===(t=e.getRootNode)||void 0===t?void 0:t.call(e)}:function(e){return null==e?void 0:e.ownerDocument},Sa=function e(t,n){var r;void 0===n&&(n=!0);var o=null==t||null===(r=t.getAttribute)||void 0===r?void 0:r.call(t,"inert");return""===o||"true"===o||n&&t&&e(t.parentNode)},Ea=function(e,t,n){if(Sa(e))return[];var r=Array.prototype.slice.apply(e.querySelectorAll(ba));return t&&xa.call(e,ba)&&r.unshift(e),r.filter(n)},Ta=function e(t,n,r){for(var o=[],i=Array.from(t);i.length;){var a=i.shift();if(!Sa(a,!1))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{xa.call(a,ba)&&r.filter(a)&&(n||!t.includes(a))&&o.push(a);var l=a.shadowRoot||"function"==typeof r.getShadowRoot&&r.getShadowRoot(a),u=!Sa(l,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(a));if(l&&u){var d=e(!0===l?a.children:l.children,!0,r);r.flatten?o.push.apply(o,d):o.push({scopeParent:a,candidates:d})}else i.unshift.apply(i,a.children)}}return o},Na=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},Ia=function(e){if(!e)throw new Error("No node provided");return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||function(e){var t,n=null==e||null===(t=e.getAttribute)||void 0===t?void 0:t.call(e,"contenteditable");return""===n||"true"===n}(e))&&!Na(e)?0:e.tabIndex},Oa=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},ka=function(e){return"INPUT"===e.tagName},La=function(e){var t=e.getBoundingClientRect(),n=t.width,r=t.height;return 0===n&&0===r},Aa=function(e,t){return!(t.disabled||Sa(t)||function(e){return ka(e)&&"hidden"===e.type}(t)||function(e,t){var n=t.displayCheck,r=t.getShadowRoot;if("hidden"===getComputedStyle(e).visibility)return!0;var o=xa.call(e,"details>summary:first-of-type")?e.parentElement:e;if(xa.call(o,"details:not([open]) *"))return!0;if(n&&"full"!==n&&"legacy-full"!==n){if("non-zero-area"===n)return La(e)}else{if("function"==typeof r){for(var i=e;e;){var a=e.parentElement,s=Ca(e);if(a&&!a.shadowRoot&&!0===r(a))return La(e);e=e.assignedSlot?e.assignedSlot:a||s===e.ownerDocument?a:s.host}e=i}if(function(e){var t,n,r,o,i=e&&Ca(e),a=null===(t=i)||void 0===t?void 0:t.host,s=!1;if(i&&i!==e)for(s=!!(null!==(n=a)&&void 0!==n&&null!==(r=n.ownerDocument)&&void 0!==r&&r.contains(a)||null!=e&&null!==(o=e.ownerDocument)&&void 0!==o&&o.contains(e));!s&&a;){var c,l,u;s=!(null===(l=a=null===(c=i=Ca(a))||void 0===c?void 0:c.host)||void 0===l||null===(u=l.ownerDocument)||void 0===u||!u.contains(a))}return s}(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!!xa.call(t,"fieldset[disabled] *")||!r.contains(e)}return!0}t=t.parentElement}return!1}(t))},Pa=function(e,t){return!(function(e){return function(e){return ka(e)&&"radio"===e.type}(e)&&!function(e){if(!e.name)return!0;var t,n=e.form||Ca(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)||Ia(t)<0||!Aa(e,t))},Ma=function(e){var t=parseInt(e.getAttribute("tabindex"),10);return!!(isNaN(t)||t>=0)},Ra=function e(t){var n=[],r=[];return t.forEach((function(t,o){var i=!!t.scopeParent,a=i?t.scopeParent:t,s=function(e,t){var n=Ia(e);return n<0&&t&&!Na(e)?0:n}(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(Oa).reduce((function(e,t){return t.isScope?e.push.apply(e,t.content):e.push(t.content),e}),[]).concat(n)},Fa=function(e,t){if(t=t||{},!e)throw new Error("No node provided");return!1!==xa.call(e,ba)&&Pa(t,e)},Da=ga.concat("iframe").join(","),Ua=function(e,t){if(t=t||{},!e)throw new Error("No node provided");return!1!==xa.call(e,Da)&&Aa(t,e)};function ja(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?ja(Object(n),!0).forEach((function(t){var r,o,i;r=e,o=t,i=n[t],o=function(e){var t=function(e){if("object"!=typeof e||null===e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(o),o in r?Object.defineProperty(r,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):r[o]=i})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ja(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Ba=function(e){return"Tab"===(null==e?void 0:e.key)||9===(null==e?void 0:e.keyCode)},Va=function(e){return Ba(e)&&!e.shiftKey},Ka=function(e){return Ba(e)&&e.shiftKey},Ha=function(e){return setTimeout(e,0)},$a=function(e,t){var n=-1;return e.every((function(e,r){return!t(e)||(n=r,!1)})),n},Ja=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},Wa=function(e){return e.target.shadowRoot&&"function"==typeof e.composedPath?e.composedPath()[0]:e.target},qa=[],Ga=function(e,t){var n,r=(null==t?void 0:t.document)||document,o=(null==t?void 0:t.trapStack)||qa,i=za({returnFocusOnDeactivate:!0,escapeDeactivates:!0,delayInitialFocus:!0,isKeyForward:Va,isKeyBackward:Ka},t),a={containers:[],containerGroups:[],tabbableGroups:[],nodeFocusedBeforeActivation:null,mostRecentlyFocusedNode:null,active:!1,paused:!1,delayInitialFocusTimer:void 0,recentNavEvent:void 0},s=function(e,t,n){return e&&void 0!==e[t]?e[t]:i[n||t]},c=function(e,t){var n="function"==typeof(null==t?void 0:t.composedPath)?t.composedPath():void 0;return a.containerGroups.findIndex((function(t){var r=t.container,o=t.tabbableNodes;return r.contains(e)||(null==n?void 0:n.includes(r))||o.find((function(t){return t===e}))}))},l=function(e){var t=i[e];if("function"==typeof t){for(var n=arguments.length,o=new Array(n>1?n-1:0),a=1;a<n;a++)o[a-1]=arguments[a];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 s=t;if("string"==typeof t&&!(s=r.querySelector(t)))throw new Error("`".concat(e,"` as selector refers to no known node"));return s},u=function(){var e=l("initialFocus");if(!1===e)return!1;if(void 0===e||!Ua(e,i.tabbableOptions))if(c(r.activeElement)>=0)e=r.activeElement;else{var t=a.tabbableGroups[0];e=t&&t.firstTabbableNode||l("fallbackFocus")}if(!e)throw new Error("Your focus-trap needs to have at least one focusable element");return e},d=function(){if(a.containerGroups=a.containers.map((function(e){var t=function(e,t){var n;return n=(t=t||{}).getShadowRoot?Ta([e],t.includeContainer,{filter:Pa.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:Ma}):Ea(e,t.includeContainer,Pa.bind(null,t)),Ra(n)}(e,i.tabbableOptions),n=function(e,t){return(t=t||{}).getShadowRoot?Ta([e],t.includeContainer,{filter:Aa.bind(null,t),flatten:!0,getShadowRoot:t.getShadowRoot}):Ea(e,t.includeContainer,Aa.bind(null,t))}(e,i.tabbableOptions),r=t.length>0?t[0]:void 0,o=t.length>0?t[t.length-1]:void 0,a=n.find((function(e){return Fa(e)})),s=n.slice().reverse().find((function(e){return Fa(e)})),c=!!t.find((function(e){return Ia(e)>0}));return{container:e,tabbableNodes:t,focusableNodes:n,posTabIndexesFound:c,firstTabbableNode:r,lastTabbableNode:o,firstDomTabbableNode:a,lastDomTabbableNode:s,nextTabbableNode:function(e){var r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],o=t.indexOf(e);return o<0?r?n.slice(n.indexOf(e)+1).find((function(e){return Fa(e)})):n.slice(0,n.indexOf(e)).reverse().find((function(e){return Fa(e)})):t[o+(r?1:-1)]}}})),a.tabbableGroups=a.containerGroups.filter((function(e){return e.tabbableNodes.length>0})),a.tabbableGroups.length<=0&&!l("fallbackFocus"))throw new Error("Your focus-trap must have at least one container with at least one tabbable node in it at all times");if(a.containerGroups.find((function(e){return e.posTabIndexesFound}))&&a.containerGroups.length>1)throw new Error("At least one node with a positive tabindex was found in one of your focus-trap's multiple containers. Positive tabindexes are only supported in single-container focus-traps.")},p=function e(t){var n=t.activeElement;if(n)return n.shadowRoot&&null!==n.shadowRoot.activeElement?e(n.shadowRoot):n},f=function e(t){!1!==t&&t!==p(document)&&(t&&t.focus?(t.focus({preventScroll:!!i.preventScroll}),a.mostRecentlyFocusedNode=t,function(e){return e.tagName&&"input"===e.tagName.toLowerCase()&&"function"==typeof e.select}(t)&&t.select()):e(u()))},h=function(e){var t=l("setReturnFocus",e);return t||!1!==t&&e},v=function(e){var t=e.target,n=e.event,r=e.isBackward,o=void 0!==r&&r;t=t||Wa(n),d();var s=null;if(a.tabbableGroups.length>0){var u=c(t,n),p=u>=0?a.containerGroups[u]:void 0;if(u<0)s=o?a.tabbableGroups[a.tabbableGroups.length-1].lastTabbableNode:a.tabbableGroups[0].firstTabbableNode;else if(o){var f=$a(a.tabbableGroups,(function(e){var n=e.firstTabbableNode;return t===n}));if(f<0&&(p.container===t||Ua(t,i.tabbableOptions)&&!Fa(t,i.tabbableOptions)&&!p.nextTabbableNode(t,!1))&&(f=u),f>=0){var h=0===f?a.tabbableGroups.length-1:f-1,v=a.tabbableGroups[h];s=Ia(t)>=0?v.lastTabbableNode:v.lastDomTabbableNode}else Ba(n)||(s=p.nextTabbableNode(t,!1))}else{var m=$a(a.tabbableGroups,(function(e){var n=e.lastTabbableNode;return t===n}));if(m<0&&(p.container===t||Ua(t,i.tabbableOptions)&&!Fa(t,i.tabbableOptions)&&!p.nextTabbableNode(t))&&(m=u),m>=0){var y=m===a.tabbableGroups.length-1?0:m+1,_=a.tabbableGroups[y];s=Ia(t)>=0?_.firstTabbableNode:_.firstDomTabbableNode}else Ba(n)||(s=p.nextTabbableNode(t))}}else s=l("fallbackFocus");return s},m=function(e){var t=Wa(e);c(t,e)>=0||(Ja(i.clickOutsideDeactivates,e)?n.deactivate({returnFocus:i.returnFocusOnDeactivate}):Ja(i.allowOutsideClick,e)||e.preventDefault())},y=function(e){var t=Wa(e),n=c(t,e)>=0;if(n||t instanceof Document)n&&(a.mostRecentlyFocusedNode=t);else{var r;e.stopImmediatePropagation();var o=!0;if(a.mostRecentlyFocusedNode)if(Ia(a.mostRecentlyFocusedNode)>0){var s=c(a.mostRecentlyFocusedNode),l=a.containerGroups[s].tabbableNodes;if(l.length>0){var d=l.findIndex((function(e){return e===a.mostRecentlyFocusedNode}));d>=0&&(i.isKeyForward(a.recentNavEvent)?d+1<l.length&&(r=l[d+1],o=!1):d-1>=0&&(r=l[d-1],o=!1))}}else a.containerGroups.some((function(e){return e.tabbableNodes.some((function(e){return Ia(e)>0}))}))||(o=!1);else o=!1;o&&(r=v({target:a.mostRecentlyFocusedNode,isBackward:i.isKeyBackward(a.recentNavEvent)})),f(r||a.mostRecentlyFocusedNode||u())}a.recentNavEvent=void 0},_=function(e){if(!(t=e,"Escape"!==(null==t?void 0:t.key)&&"Esc"!==(null==t?void 0:t.key)&&27!==(null==t?void 0:t.keyCode)||!1===Ja(i.escapeDeactivates,e)))return e.preventDefault(),void n.deactivate();var t;(i.isKeyForward(e)||i.isKeyBackward(e))&&function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];a.recentNavEvent=e;var n=v({event:e,isBackward:t});n&&(Ba(e)&&e.preventDefault(),f(n))}(e,i.isKeyBackward(e))},g=function(e){var t=Wa(e);c(t,e)>=0||Ja(i.clickOutsideDeactivates,e)||Ja(i.allowOutsideClick,e)||(e.preventDefault(),e.stopImmediatePropagation())},b=function(){if(a.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)}(o,n),a.delayInitialFocusTimer=i.delayInitialFocus?Ha((function(){f(u())})):f(u()),r.addEventListener("focusin",y,!0),r.addEventListener("mousedown",m,{capture:!0,passive:!1}),r.addEventListener("touchstart",m,{capture:!0,passive:!1}),r.addEventListener("click",g,{capture:!0,passive:!1}),r.addEventListener("keydown",_,{capture:!0,passive:!1}),n},w=function(){if(a.active)return r.removeEventListener("focusin",y,!0),r.removeEventListener("mousedown",m,!0),r.removeEventListener("touchstart",m,!0),r.removeEventListener("click",g,!0),r.removeEventListener("keydown",_,!0),n},x="undefined"!=typeof window&&"MutationObserver"in window?new MutationObserver((function(e){e.some((function(e){return Array.from(e.removedNodes).some((function(e){return e===a.mostRecentlyFocusedNode}))}))&&f(u())})):void 0,C=function(){x&&(x.disconnect(),a.active&&!a.paused&&a.containers.map((function(e){x.observe(e,{subtree:!0,childList:!0})})))};return n={get active(){return a.active},get paused(){return a.paused},activate:function(e){if(a.active)return this;var t=s(e,"onActivate"),n=s(e,"onPostActivate"),o=s(e,"checkCanFocusTrap");o||d(),a.active=!0,a.paused=!1,a.nodeFocusedBeforeActivation=r.activeElement,null==t||t();var i=function(){o&&d(),b(),C(),null==n||n()};return o?(o(a.containers.concat()).then(i,i),this):(i(),this)},deactivate:function(e){if(!a.active)return this;var t=za({onDeactivate:i.onDeactivate,onPostDeactivate:i.onPostDeactivate,checkCanReturnFocus:i.checkCanReturnFocus},e);clearTimeout(a.delayInitialFocusTimer),a.delayInitialFocusTimer=void 0,w(),a.active=!1,a.paused=!1,C(),function(e,t){var n=e.indexOf(t);-1!==n&&e.splice(n,1),e.length>0&&e[e.length-1].unpause()}(o,n);var r=s(t,"onDeactivate"),c=s(t,"onPostDeactivate"),l=s(t,"checkCanReturnFocus"),u=s(t,"returnFocus","returnFocusOnDeactivate");null==r||r();var d=function(){Ha((function(){u&&f(h(a.nodeFocusedBeforeActivation)),null==c||c()}))};return u&&l?(l(h(a.nodeFocusedBeforeActivation)).then(d,d),this):(d(),this)},pause:function(e){if(a.paused||!a.active)return this;var t=s(e,"onPause"),n=s(e,"onPostPause");return a.paused=!0,null==t||t(),w(),C(),null==n||n(),this},unpause:function(e){if(!a.paused||!a.active)return this;var t=s(e,"onUnpause"),n=s(e,"onPostUnpause");return a.paused=!1,null==t||t(),d(),b(),C(),null==n||n(),this},updateContainerElements:function(e){var t=[].concat(e).filter(Boolean);return a.containers=t.map((function(e){return"string"==typeof e?r.querySelector(e):e})),a.active&&d(),C(),this}},n.updateContainerElements(e),n},Xa=({children:e,onClose:t,fallBackFocusRef:n,"aria-label":r,"aria-labelledby":i})=>{const a=Ji(),s=(0,Bo.li)(null),c=(0,Bo.li)(null),[l,u]=(0,Bo.J0)(!1);return(0,Bo.vJ)((()=>(l&&s.current&&(c.current=Ga(s.current,{initialFocus:n.current||void 0}),c.current.activate()),()=>{c.current&&c.current.deactivate()})),[l,n]),(0,Bo.vJ)((()=>{const e=(()=>{const e=[],t=[];return document.querySelectorAll('body > *:not([role="dialog"])').forEach((n=>{const r=n.getAttribute("aria-hidden");null!==r&&"false"!==r||(null!==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()}}),[l]),(0,Bo.vJ)((()=>{l&&s.current&&s.current.addEventListener("keydown",(e=>{(e.code&&"Escape"===e.code||27===e.keyCode)&&t()}))}),[l,t]),(0,Bo.Nf)((()=>{const e=document.getElementsByTagName("body")[0],t=document.createElement("div");return t.setAttribute("id",a),t.setAttribute("role","dialog"),t.setAttribute("data-nosnippet","true"),t.setAttribute("aria-modal","true"),r&&t.setAttribute("aria-label",r),i&&t.setAttribute("aria-labelledby",i),e.appendChild(t),s.current=t,u(!0),()=>{s.current&&(e.removeChild(s.current),s.current=null)}}),[r,i,a]),"function"==typeof e?e({onClose:t,modalRenderFn:e=>s.current&&(0,o.XX)(e,s.current)}):s.current&&(0,o.XX)((0,o.v2)(e).filter(wn).map((e=>(e.props={...e.props,onClose:t},e))),s.current)},Ya=({url:e,description:t,onClose:n})=>{const r=un(),o=Ki(),i=Mi(),a=(0,Bo.li)(null),{t:s}=ni(),c=["modal",`app--layout-${r.layoutMode}`,`namespace--${r.namespace}`];"function"!=typeof i?c.push(...i):c.push(...i(r));const l=e=>{e.stopPropagation()},u=()=>{n()},d=r?.zIndex?{zIndex:r.zIndex+1}:void 0;return bi(Xa,{onClose:n,"aria-label":s("lightbox.heading"),fallBackFocusRef:a,children:({onClose:n,modalRenderFn:r})=>r((n=>bi("div",{className:Pi(c),onClick:u,style:d,children:bi("div",{className:Pi("modal__float"),tabIndex:-1,onMouseDown:o,onKeyDown:o,onTouchStart:o,onMouseMove:o,onWheel:o,onPointerDown:o,onPointerMove:o,ref:a,children:[bi("div",{className:Pi("modal__inner"),onClick:l,children:bi("img",{className:Pi("modal__image"),src:e,alt:t})}),bi("button",{type:"button",className:Pi("modal__close"),onClick:n,children:[bi(Zi,{name:"close",size:"16",alt:""}),s("lightbox.closeLabel")]})]})}))(n))})},Qa=({description:e,url:t})=>{const{t:n}=ni(),[r,i]=(0,Bo.J0)(!1);return bi(o.FK,{children:[bi("button",{type:"button",className:Pi("modal__enlarge"),onClick:()=>{i(!0)},children:[n("message.image.srTextEnlargeButtonLabel",{description:e}),bi(Zi,{name:"enlarge",size:"32",alt:""})]}),r&&bi(Ya,{url:t,description:e,onClose:()=>{i(!1)}})]})},Za=({event:e,...t})=>{const{body:n}=Oi(e),r=pa({originMessage:e.payload.id,transactionId:e.payload.transactionId}),o=(0,Bo.Kr)((()=>e.payload.optimisticallyInjected?{children:bi("p",{children:n?.text})}:{bodyProps:{dangerouslySetInnerHTML:{__html:n?.text||""}}}),[n,e]);return bi(Gi,{type:"text",event:e,onClick:r,...t,...o})};const es="PROCESSING_IMAGE",ts=({img:e,filename:t})=>{const{t:n}=ni(),r=n("fileUpload.srFileUploadedText",{fileName:t});return bi(o.FK,{children:bi("span",{className:Pi(["download","download--preview"]),children:[bi("img",{src:e,alt:r}),bi("span",{"aria-hidden":"true",className:Pi("file-download"),children:t})]})})},ns=({children:e,url:t,target:n})=>t?bi("a",{href:t,download:!0,target:n,className:Pi(["download","download-link"]),children:e}):bi("span",{className:Pi("download"),children:e});const rs={message:{choice_prompt:({event:e,children:t,...n})=>{const{t:r}=ni(),i=Ji(),{body:a,subEvent:s,showOptions:c,chooseAgain:l,onChoiceClickHandler:u,onChooseAgainClickHandler:d}=ca(e);return bi(o.FK,{children:[(0,o.v2)(t).filter(wn).map((e=>(e.props={...e.props,event:s,descriptorId:i,showTranslationToggle:!1},e))),l&&bi("button",{type:"button",className:Pi("button","button--secondary","button--choose-again"),"aria-expanded":c?"true":"false",onClick:d,"aria-describedby":i,children:[r(c?"message.choicePrompts.cancelChooseAgain":"message.choicePrompts.chooseAgain"),bi(Zi,{name:"chevronDown",size:"8",alt:""})]}),c&&bi(Gi,{type:"choice-prompt",showParticipant:!1,event:e,...n,children:bi("ul",{className:Pi("choice-prompt","choice-prompt--many"),children:a?.choices?.map((e=>bi("li",{className:Pi("choice-prompt__item",{[`choice-prompt__item--${e?.category}`]:!!e.category}),children:bi("button",{type:"button",className:Pi("button","button--primary"),onClick:()=>{u(e)},children:e.text})},e.id)))})})]})},text:Za,image:({event:e,descriptorId:t,...n})=>{const{body:r}=Oi(e),[o,i]=(0,Bo.J0)(!1),a=zo();return bi(Gi,{event:e,type:"image",...n,children:[bi("img",{src:r?.url,id:t,alt:r?.description||void 0,onLoad:()=>{a(ao(e.payload.id)),i(!0)}}),r?.isZoomable&&o&&bi(Qa,{description:r?.description,url:r?.url})]})},splash:({event:e,...t})=>{const{payload:n}=e,{body:r}=Oi(e),o=pa({originMessage:n.id,transactionId:n.transactionId});return bi(Gi,{type:"splash",event:e,onClick:o,...t,bodyProps:{dangerouslySetInnerHTML:{__html:r?.text||""}}})},video:({event:e,descriptorId:t,...n})=>{const{body:r}=Oi(e);return Ri(e).push("message--type-video"),bi(Gi,{event:e,type:"video",...n,children:[bi("div",{id:t,className:Pi("visually-hidden"),children:r?.description}),bi("iframe",{title:r?.description||"",src:r?.url,allow:"autoplay; encrypted-media",allowFullScreen:!0})]})},upload:({event:e,...t})=>{const{t:n}=ni(),{body:r}=Oi(e),{fromClient:o,id:i}=e.payload,{filename:a,url:s}=r,c=(e=>{const{processingFileUploads:t}=Qt((({state:e})=>e));return(0,Bo.Kr)((()=>{if(t.some((t=>t===e)))return es;try{return sessionStorage.getItem(`image-${e}`)}catch(e){return}}),[e,t])})(i),l=(0,Bo.Kr)((()=>n(s?"fileUpload.srFileDownloadText":"fileUpload.srFileUploadedText",{fileName:a})),[s,a,n]);return bi(Gi,{event:e,type:"upload",...t,children:c&&c!==es?bi(ts,{img:c,filename:a}):bi(ns,{url:s,target:o?void 0:"_blank",children:[bi(Zi,{name:"download",size:"16",alt:l}),bi("span",{"aria-hidden":"true",className:Pi("file-download"),children:a})]})})},cta:({event:e})=>{const{body:t}=Oi(e),n=pa({originMessage:e.payload.id,transactionId:e.payload.transactionId}),{emitEvent:r}=fi(),o=Ji(),i=(0,Bo.hb)((()=>r(`action.${F}`,{type:F,originMessage:e.payload.id,link:{url:t?.buttonLink}})),[r,t,e]);return bi(Gi,{type:"cta",event:e,children:[bi("div",{className:Pi("cta__content"),id:o,dangerouslySetInnerHTML:t?.description?{__html:t.description}:void 0,onClick:n}),bi("a",{className:Pi("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}=Oi(e),n=t.cards;return bi(Gi,{event:e,modifiers:"type-carousel",children:bi(ia,{items:n,getItemKey:aa,getItemLabel:sa})})},card:({event:e})=>{const{body:t}=Oi(e),n=Ji();return bi(Gi,{type:"card",event:e,children:bi(Xi,{id:n,...t})})}},info:{text:Za,divider:({event:e,...t})=>bi(va[V[e.payload.body.subtype]]||va.default,{event:e,...t}),translation:({event:e,...t})=>{const{t:n}=ni(),{body:r}=Oi(e);return bi(Gi,{type:"text",event:e,...t,children:n(r.key.join("."),r.variables)})},timeIndicator:_a},participant:{participant:({event:e})=>{const{participant:t}=e.payload,{body:n}=(e=>{const{translatedBody:t,translation:n,body:r}={body:e.payload?.participant?.introduction,translatedBody:e.payload?.participant?.translatedIntroduction,translation:e.payload?.participant?.translation},o=!!t,i=Qt(Ni(e));return{body:i&&o?t:r,hasTranslation:o,isTranslated:i&&o,userLocale:n?.locale}})(e);return n?bi(fa,{graphicSrc:t?.avatar,graphicType:t?.avatar?"avatar":void 0,iconName:t?.avatar?void 0:"balloon",dividerType:"participant",title:n}):null}},service_data:{suggestion:({event:e,...t})=>{const[n,r]=(0,Bo.J0)(!0),o=zo(),i=ii(),{sendAction:a,addMessageBubble:s}=fi(),{suggestions:c,payload:l}=(e=>{const{payload:t}=e,{body:n}=Oi(e);return{suggestions:n,payload:t}})(e),{showSuggestions:u}=un(),d=Tn(),{t:p}=ni(),f=p("suggestions.headingText"),h=p("suggestions.footerText"),v=(0,Bo.Kr)((()=>d.some((({payload:e,type:t})=>"message"===t&&e?.transactionLast))),[d]),m=(0,Bo.hb)((({id:e,question:t})=>{r(!1),o(tr(!0));const n=$();a({type:k,originMessage:l.id,body:{type:"faqclick",body:{faqId:e,faqQuestion:t}},transactionId:n}),s(t,n)}),[o,a,l.id,s]);return n&&!i&&v&&u?bi("div",{className:Pi("suggestions","suggestions--conversation"),children:[f&&bi("p",{className:Pi("suggestions__heading"),children:f}),bi(Gi,{type:"suggestions",showParticipant:!1,event:e,...t,children:[bi(da,{className:"suggestions__list--conversation",onClickSuggestion:m,suggestions:c}),h&&bi("p",{className:Pi("suggestions__footer"),children:h})]})]}):null}}};var os=({children:e})=>{const{customComponents:t}=un(),n=(0,Bo.Kr)((()=>Object.keys(rs).reduce(((e,n)=>(e[n]={...rs[n],...t?t[n]:{}},e)),{fallback:Za})),[t]);return bi(xi.Provider,{value:n,children:e})},is=({children:e})=>{const{isMinimized:t}=ri(),n=(0,Bo.li)(0),{sendAction:r}=fi(),{hasCountdown:o,isActive:i,stopCountdown:a}=Hi(),s=(0,Bo.hb)((()=>{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 bi("div",{className:Pi("activity-monitor"),tabIndex:-1,onMouseDown:s,onKeyUp:s,onTouchStart:s,onMouseMove:s,onWheel:s,onPointerDown:s,onPointerMove:s,children:bi(Vi.Provider,{value:s,children:e})})};const as=["text","choice_prompt","image","video"];var ss=()=>{const e=Fi(),t=(0,Bo.li)(),n=(0,Bo.li)(),r=zo(),o=li(),i=(0,Bo.li)(null),{initCountdown:a,endCountdown:s}=Hi(),{emitEvent:c}=fi();return(0,Bo.vJ)((()=>{e.socket&&(e.onConnection((({currentState:e})=>{if("attach_channel_erred"===e){const e=new b;return r(Tr({name:e.name,message:e.message,langKey:e.langKey,originalEvent:e.originalEvent,originalError:e.originalError,action:e.action})),!0}return!1})),e.onError((e=>{const t=new rr(e);r(Tr({name:t.name,message:t.message,langKey:t.langKey,originalEvent:t.originalEvent,originalError:t.originalError})),r(jr())})),e.onOpen((()=>{r(Nr())})))}),[e,e.socket,r]),(0,Bo.vJ)((()=>{e.onConnection((({connected:t})=>!!t&&(n.current&&e?.removeListener("message",n.current),n.current=e=>{switch(e.type){case"ui":switch(e.payload.type){case"idle_detach_countdown":"idle_detach_countdown"===e.payload.body.type&&a(e.payload.body.duration);break;case"loading":r(io(e.payload.body.loading));break;case"idle_detach_countdown_elapsed":s(void 0,!0);break;case"resume_conversation_prompt":r(Jr());break;case"user_first_response":r(tr(!0)),c("system.userFirstResponse",e.payload.body);break;case"translation_proposal":r(Po(e.payload.body))}break;case"service_attach":const{service:{name:t,settings:{proactiveMessages:{enabled:n},entry:o},sessionId:i}}=e.payload;r(Co(n||!1)),t&&c("system.serviceChanged",t),i&&r(Gr(i)),r(uo(o)),r(Zr({uploads:o.options.upload,text:o.options.text}));break;case"context":e.payload.contentLocale&&e.payload.userLocale&&r(yr(e.payload.userLocale));break;case"message":switch(e.payload.type){case"text":case"choice_prompt":case"splash":case"image":case"upload":case"video":case"cta":case"custom":case"carousel":case"card":if(e.payload.service&&e.payload.service.serviceSessionId&&r(Gr(e.payload.service.serviceSessionId)),e.payload.fromClient){r(Dr(e));break}r(Fr(e))}break;case"participant":(e=>{const{payload:t}=e;if(!t||!t.participant)return;const{fromClient:n,participant:o}=t;!n&&"string"!=typeof o&&o?.name&&r(to(o.name)),r(so(t)),"string"!=typeof o&&o.introduction&&r(Fr({...e,payload:{...t,type:"participant"}}))})(e);break;case"service_data":e.payload.persist&&r(lo(e.payload));break;case"info":"divider"!==e.payload.type&&"text"!==e.payload.type&&"translation"!==e.payload.type||r(Fr({type:"info",payload:{...e.payload,participant:null}}));break;case"error":switch(e.payload.type){case"find_conversation":const t=new w(e);r(Tr({name:t.name,action:t.action,message:t.message,originalEvent:t.originalEvent,originalError:t.originalError}));break;case"conversation":const n=new b(e);r(Tr({name:n.name,message:n.message,langKey:n.langKey,originalEvent:n.originalEvent,originalError:n.originalError,action:n.action}))}}return e},e.onMessage(n.current),!0)))}),[e,r,c,s,o,a]),(0,Bo.vJ)((()=>{e.onConnection((({connected:n})=>!!n&&(t.current&&e.removeListener("message",t.current),t.current=async({payload:e})=>{if("history_changed"===e?.type)try{const t=await r(Cr(e)).unwrap();t&&"service"in t&&r(ro(t))}catch(e){}return as.includes(e?.type)?(e.id!==i.current&&o.emit("message",e),i.current=e.id,e):e},e.addListener("message",t.current),!0)))}),[e,r,o]),null},cs=({children:e})=>{const{t:t}=ni(),n=zo(),r=ui(),{addUploadBubble:o}=fi(),i=(0,Bo.hb)((async(e,t)=>{n(mo(t));const r=await(e=>new Promise(((t,n)=>{const r=new FileReader;r.readAsDataURL(e),r.onload=()=>{"string"==typeof r.result&&t(r.result)},r.onerror=e=>n(e)})))(e),o=new Image;o.src=r,await o.decode();const i=(e=>{const t=document.createElement("canvas"),n=t.getContext("2d"),[r,o]=(e=>{const{height:t,width:n}=e;return n>t&&n>600?[600,600*t/n]:t>600?[600*n/t,600]:[n,t]})(e);return t.width=r,t.height=o,n?.drawImage(e,0,0,r,o),t.toDataURL()})(o);try{sessionStorage.setItem(`image-${t}`,i)}catch(e){}finally{n(yo(t))}}),[n]),a=(0,Bo.hb)((e=>{const a=$(),s=r.uploadFile(e,(e=>{n(vo({fileId:a,progress:Math.ceil(e)}))}),(async t=>{const{id:r,transactionId:s,occurredAt:c,body:{contentType:l,filename:u,filesize:d}}=t;n(fo(a)),o(r,s,c,l,u,d),await i(e,r)}),(e=>{let r;switch(e?.error||""){case"file_uploads_are_disabled":r=t("fileUpload.errors.unavailable");break;case"request_entity_too_large":r=t("fileUpload.errors.tooLarge");break;case"file_has_invalid_mime_type":r=t("fileUpload.errors.wrongType");break;case"virus_found":r=t("fileUpload.errors.virusFound");break;default:r=t("fileUpload.errors.general")}n(ho({fileId:a,errorText:r}))}));n(Wr({fileId:a,fileName:e.name,uploadHandle:s}))}),[i,o,r,n,t]);return bi(Di.Provider,{value:a,children:e})},ls=()=>{const{hasCountdown:e,isActive:t,remaining:n,decrementCountdown:r}=Hi();return((e,t)=>{const n=(0,Bo.li)(e);(0,Bo.vJ)((()=>{n.current=e}),[e]),(0,Bo.vJ)((()=>{if(null!==t){const e=setInterval((function(){n.current()}),t);return()=>clearInterval(e)}}),[t])})((()=>{r()}),e&&t&&n&&n>0?1e3:null),null},us=()=>{const{initUserSelectedOptions:e}=zi(),t=(0,Bo.li)(!1),n=un();return(0,Bo.vJ)((()=>{n.api&&!t.current&&(t.current=!0,e())}),[e,n]),null};function ds(e,t,n=[]){const r=li(),o=(0,Bo.li)(t);(0,Bo.vJ)((()=>{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])}var ps=()=>{const e=un(),{sendMessage:t,sendContext:n,sendAction:r}=fi(),o=zo(),{setVisibility:i,visible:a}=ri(),s=(0,Bo.li)(a),c=li(),l=ui(),{hasPrompt:u,continueChat:d}=$i(),p=(0,Bo.li)(u),f=In(),h=(0,Bo.li)(null),v=(0,Bo.li)(null),{isInline:m,isResolving:y}=Mn(),_=Qt(mi),g=(()=>{const{get:e}=di();return e?e("conversationUrl"):null})(),b=(0,Bo.li)(null),w=Ki(),{enableTranslations:x,disableTranslations:C}=Ii();return(0,Bo.vJ)((()=>{s.current=a,p.current=u}),[u,a]),ds("askText",(e=>{p.current&&d(),t({body:e})}),[l.send]),ds("setVariables",(e=>{n({variables:e})}),[l.send]),ds("getVisibility",(e=>{e?e(s.current):console.warn("A callback function is required for the getVisibility action.")})),ds("setVisibility",(e=>{const t="string"==typeof e||null===e?e:e.visibility;Object.values(Dt).includes(t)?(w(),i(e)):console.error('Requested visibility states should be "open", "minimized" ,"hidden" or null.')}),[e.api]),ds("sendCustomAction",((e,t)=>{r({type:"custom",body:{type:e,body:t}})}),[l.send]),ds("setTopic",(({name:e,fallbackMessage:t,message:n,userTriggered:i})=>{i&&o(Xn({showSuggestions:!1})),p.current&&d(),e&&t?r({type:R,body:{name:e,fallbackMessage:t,message:n}}):console.warn("A name and a fallbackMessage are required for the setTopic action.")}),[l.send]),ds("setContext",(e=>{n(e)}),[l.send]),ds("setTranslation",(({enabled:e,locale:t})=>{e?x(t,j):C()}),[l.send]),(0,Bo.vJ)((()=>{y||_||(b.current&&b.current!==g&&c.emit("unreadMessageCount",f),a===Dt.open&&a!==v.current&&0!==h.current&&c.emit("unreadMessageCount",0),a!==Dt.open&&f!==h.current&&c.emit("unreadMessageCount",f),v.current=a,h.current=f,"string"==typeof g&&(b.current=g))}),[f,a,c,m,y,_,g]),null},fs=({children:e})=>{const t=li(),n=(0,Bo.li)(null),[r,o]=(0,Bo.J0)(),i=(0,Bo.li)(!0),a=(0,Bo.hb)((e=>{i.current&&(o(e),t.emit("aria-live",e))}),[o,t]);return(0,Bo.vJ)((()=>(n.current=null,r?.messageText&&(n.current=setTimeout((()=>{a({}),n.current&&clearTimeout(n.current)}),600)),()=>{n.current&&clearTimeout(n.current)})),[r,a]),(0,Bo.vJ)((()=>()=>{i.current=!1}),[]),bi(ci.Provider,{value:a,children:[e,bi("div",{className:Pi("app__live-container"),children:[bi("div",{"aria-live":"assertive","aria-atomic":"true",className:Pi("visually-hidden"),children:r?.ariaLive===z?r?.messageText:null}),bi("div",{"aria-live":"polite","aria-atomic":"true",className:Pi("visually-hidden"),children:r?.ariaLive===B?r?.messageText:null})]})]})},hs=()=>{const{t:e}=ni(),t=Tn(),n=(0,Bo.li)(0),r=(0,Bo.li)(0),o=Cn().historyLoaded,{sendPolite:i}=hi(),{isOpen:a}=ri(),s=(0,Bo.li)(null),c=(0,Bo.li)(null),l=(0,Bo.Kr)((()=>pn((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,Bo.vJ)((()=>{t.length>n.current&&(a&&(c.current=l(t)),n.current=t.length)}),[t,l,a]),(0,Bo.vJ)((()=>{s.current&&!a&&c.current&&(c.current(!0),c.current=null)}),[a]),(0,Bo.vJ)((()=>{o&&setTimeout((()=>{i(e("window.srTexts.onHistoryLoad"))}),500)}),[o,e,i]),null},vs=()=>{const{t:e}=ni(),{isOpen:t,isVisible:n}=ri(),r=In(),{sendPolite:o}=hi(),i=(0,Bo.Kr)((()=>pn(o,2e3)),[o]),a=(0,Bo.li)(null),s=(0,Bo.li)(null);return(0,Bo.vJ)((()=>{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},ms=({store:e,children:t,eventBus:n,api:r})=>((0,Bo.Md)((t=>{console.error(t),e.dispatch(ir(t))})),bi(rn,{store:e,children:bi(si.Provider,{value:n,children:bi(ai.Provider,{value:r,children:bi(fs,{children:bi(wi,{children:bi(os,{children:[bi(us,{}),bi(ss,{}),bi(vs,{}),bi(hs,{}),bi(ls,{}),bi(is,{children:[bi(ps,{}),bi(cs,{children:t})]})]})})})})})}));const ys=Pt(En,(e=>e.filter((e=>kr(e)&&"service_data"!==e.type&&e.payload?.messageStatus===I)))),_s=Pt([ys],(e=>e.filter((e=>"participant"!==e.type)).at(-1))),gs=Pt(ys,(e=>e.filter((({payload:e})=>e?.id)).map((({payload:e})=>e.id)))),bs=Pt((({state:e})=>e.options.features?.webNotifications),(e=>e?.enabled));var ws=()=>{const{t:e}=ni(),{showDisclaimer:t}=un();return t?bi("div",{className:Pi("disclaimer"),tabIndex:0,children:[bi("h2",{className:Pi("disclaimer__title"),children:e("disclaimer.title")}),bi("div",{className:Pi("disclaimer__message"),dangerouslySetInnerHTML:{__html:e("disclaimer.content")}})]}):null};const xs=Pt([({forms:e})=>e,(e,{formId:t})=>t],((e,t)=>e[t])),Cs=Pt(xs,(e=>e?.controls||{})),Ss=Pt(Cs,(e=>{const t={};return Object.entries(e).forEach((([e,{value:n}])=>{t[e]=n})),t})),Es=Pt([Cs,(e,{name:t})=>t],((e,t)=>e[t]?.value)),Ts=Pt([Cs,(e,{name:t})=>t],((e,t)=>e[t]?.touched)),Ns=(0,o.q6)({handleSubmit:()=>{},isSubmitted:!1,isValid:!1,updateControlValue:()=>{},updateControlTouched:()=>{},errors:void 0}),{Provider:Is,Consumer:Os}=Ns;var ks=Ns;function Ls(){return(0,Bo.NT)(ks)}function As(e){const t=zo(),{formId:n,updateControlValue:r,updateControlTouched:o,errors:i}=Ls(),a=!!Qt((e=>xs(e,{formId:n}))),s=Qt((t=>Es(t,{formId:n,name:e}))),c=Qt((t=>Ts(t,{formId:n,name:e}))),l=i?.[e],u=!l;(0,Bo.vJ)((()=>{a&&t(pr({formId:n,name:e}))}),[a,n,e,t]),(0,Bo.Nf)((()=>()=>{t(fr({formId:n,name:e}))}),[a,n,e,t]);const d=(0,Bo.hb)((t=>r(e,t.target.value)),[e,r]),p=(0,Bo.hb)((()=>{o(e,!0)}),[o,e]);return[(0,Bo.Kr)((()=>({name:e,onInput:d,onBlur:p,value:s})),[e,d,p,s]),(0,Bo.Kr)((()=>({isValid:u,error:l,touched:c})),[u,l,c])]}function Ps(e){const{t:t}=ni(),{sendAssertive:n}=hi(),{hasLimit:r,limit:o}=Pn(),i=(0,Bo.Kr)((()=>pn(n,$n)),[n]),a=(0,Bo.Kr)((()=>pn(((e,n)=>{e&&i(t("input.srCharacterLimitText",{limit:n}))}),$n)),[i,t]),[{value:s}]=As(e),c=o&&r&&s?o-s.length:o,l=!(!r||!c)&&c<=Hn,u=!(!r||!c)&&c<0;return(0,Bo.vJ)((()=>{a(l,c)}),[l,c,a]),{hasCharacterLimit:r,characterLimit:o,reachedCharacterWarning:l,reachedCharacterLimit:u,remainingChars:c}}const Ms=e=>{const{hasCharacterLimit:t,characterLimit:n}=Ps(e),{entryMeta:{optionsOverride:r}}=Cn(),{t:o}=ni();return{placeholder:(0,Bo.Kr)((()=>o("input.inputPlaceholder",{hasLimit:t,text:r?.text?.placeholder||o("input.inputPlaceholderText"),limit:t?n:null})),[o,t,n,r?.text?.placeholder]),label:(0,Bo.Kr)((()=>o("input.inputLabel",{hasLimit:!r?.text?.label&&t,text:r?.text?.label||o("input.inputLabelText"),limit:!r?.text?.label&&t?n:null})),[o,t,n,r?.text?.label]),labelClass:(0,Bo.Kr)((()=>r?.text?.label?"label":"visually-hidden"),[r?.text?.label])}};function Rs(){const{abortTransaction:e,clearEntryAbortTransaction:t}=(()=>{const e=zo(),{entryMeta:{actions:t,translatedActions:n}}=Cn();return{abortTransaction:n?.abortTransaction||t?.abortTransaction,clearEntryAbortTransaction:()=>{e(po())}}})(),n=ui();return e?bi("li",{className:Pi(["cvco-conversation__item","cvco-conversation__item--abort-transaction"]),children:bi("button",{className:Pi(["button","button--secondary","abort-transaction__button"]),type:"button",onClick:()=>{n.send("action",{type:R,body:{name:e.topicName,fallbackMessage:e.topicFallbackMessage}}),t()},children:e.label})}):null}const Fs=(0,o.q6)(null),Ds=()=>{const e=(0,Bo.NT)(Fs);if(!e)throw new Error("useChatScrollContext has to be used within <ChatScrollContext.Provider>");return e};var Us=Fs,js=e=>{const t=(()=>{const e=(0,Bo.NT)(xi);if(!e)throw new Error("useComponentContext has to be used within <ComponentContext.Provider>");return e})(),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]},zs=({event:e,newParticipant:t})=>{const{eventRefs:n,unreadIds:r}=Ds(),{sendAction:o}=fi(),i=e.payload.id?n[e.payload.id]:void 0,{containerRef:a,isVisible:s}=oi({containerRef:i,freezeOnceVisible:!0}),c=zo(),[l,u]=js(e);if((0,zt.useEffect)((()=>{if(s&&r?.includes(e.payload.id)){const t=r.reduce(((t,n)=>e?.payload?.id&&n&&!t.includes(e.payload.id)?t.concat(n):t),[]);c(Yr(t)),o({type:A,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"),bi("li",{className:Pi(d),ref:a,children:[e.payload.timeIndicator&&bi(_a,{event:e}),bi(l,{event:e,children:bi(u,{event:e})})]})},Bs=()=>{const{id:e}=An()||{};return bi("li",{className:Pi("conversation__item","conversation__item--source-agent"),children:bi("div",{className:Pi("message","message--source-agent","message--type-loading"),children:[bi(qi,{eventPayload:{fromClient:!1,participant:e}}),bi("div",{className:Pi("message__body"),children:bi("span",{className:Pi("loader"),children:[bi("span",{className:Pi("loader__part","one")}),bi("span",{className:Pi("loader__part","two")}),bi("span",{className:Pi("loader__part","three")}),bi("span",{className:Pi("loader__part","four")})]})})]})})};const Vs=()=>{const e=Tn();let t;return bi(o.FK,{children:e.map((e=>{const{type:n,payload:r}=e;let o=!1;if("info"===n||"message"===n){const{participant:n,fromClient:i}=r,a=i?"seamly-client-participant":n;"info"!==e.type&&t!==a&&(o=!0),t=a}return bi(zs,{event:e,newParticipant:o},e.payload.key||e.payload.id)}))})};var Ks=()=>{const{t:e}=ni(),t=Nn(),n=((e,t=20)=>{const[n,r]=(0,Bo.J0)(e),o=(0,Bo.li)(null);return(0,Bo.vJ)((()=>(o.current=setTimeout((()=>r(e)),t),()=>{o.current&&clearTimeout(o.current)})),[e,t]),n})(t,t?0:20),{isOpen:r}=ri(),i=On(),a=Ti();return bi(o.FK,{children:[r&&bi("a",{className:Pi("skip-link"),href:`#${i}`,onClick:e=>{e.preventDefault(),a()},children:e("skiplinkText")}),bi("div",{className:Pi("chat__body"),children:bi("div",{className:Pi("conversation__container"),children:[bi(ws,{}),bi("ol",{className:Pi("conversation"),children:[bi(os,{children:bi(Vs,{})}),n?bi(Bs,{}):null,bi(Rs,{})]})]})})]})};function Hs(e,t){const n=(0,Bo.li)(null),r=(0,Bo.li)(e);return(0,Bo.vJ)((()=>{r.current=e}),[e]),(0,Bo.vJ)((()=>"number"!=typeof t?()=>{}:(n.current=setTimeout((()=>r.current()),t),()=>{n.current&&clearTimeout(n.current)})),[t]),n}const $s={visible:Pi("transition--visible"),in:Pi("transition--in"),visuallyHidden:Pi("visually-hidden")},Js=Object.values($s),Ws=e=>{const t=(0,Bo.li)(null);t.current=e;const n="function"==typeof e;return(0,Bo.Kr)((()=>n?(...e)=>t.current(...e):void 0),[n])},qs={notRendered:"notRendered",rendered:"rendered",visuallyHidden:"visuallyHidden"};var Gs=({children:e,isActive:t,timeout:n=300,transitionStartState:r=qs.notRendered,onInTransitionComplete:i=()=>{},onOutTransitionComplete:a=()=>{},exitAfter:s,enterDelay:c=0})=>{const l=(0,Bo.li)(!1),u=(0,Bo.li)(null),d=(0,Bo.li)(null),p=r===qs.visuallyHidden,[f,h]=(0,Bo.J0)((()=>p?[$s.visuallyHidden]:[])),[v,m]=(0,Bo.J0)((()=>0===c)),y=(0,Bo.Kr)((()=>s?s+c:s),[c,s]);Hs((()=>m(!1)),t?y:void 0),Hs((()=>m(!0)),t?c:void 0);const _=(0,Bo.Kr)((()=>v&&t),[t,v]),g=Ws(i),b=Ws(a),w="notRendered"!==r||f.length>0;return(0,Bo.vJ)((()=>(l.current&&!_&&(h([$s.visible]),u.current=setTimeout((()=>{h([...p?[$s.visuallyHidden]:[]]),b&&(d.current=requestAnimationFrame((()=>{b()})))}),n)),!l.current&&_&&(h([$s.visible]),d.current=requestAnimationFrame((()=>{d.current=requestAnimationFrame((()=>{h([$s.visible,$s.in]),g&&(u.current=setTimeout((()=>{g()}),n))}))}))),l.current=_,()=>{u.current&&clearTimeout(u.current),d.current&&cancelAnimationFrame(d.current)})),[p,g,b,n,_]),bi(o.FK,{children:w&&(0,o.v2)(e).filter(wn).map((e=>{const{className:t=""}=e.props,n=t.split(" ").filter((e=>!Js.includes(e)));return(0,o.Ob)(e,{className:[...n,...f].join(" ")})}))})},Xs=({isAside:e=!1})=>{const{isInline:t}=Mn(),{t:n}=ni(),{sendAction:r,addMessageBubble:o}=fi(),{isOpen:i,setVisibility:a}=ri(),{showSuggestions:s}=un(),c=Ji(),l=Ti(),u=(0,Bo.li)(null),{sendPolite:d}=hi(),p=Qt(mi),{hasCountdown:f,endCountdown:h}=Hi(),{hasPrompt:v,continueChat:m}=$i(),y=ii(),_=Cn().serviceData.suggestion;const{body:g}=Oi({payload:_,type:"service_data"}),b=(0,Bo.Kr)((()=>p?[]:Array.isArray(g)?g:[]),[g,p]),w=(0,Bo.li)(),x=(0,Bo.li)(!1),C=(0,Bo.li)(),S=!!b?.length,E=t?(y||i)&&!e:y,T=(0,Bo.li)(E),N=S&&!E&&s,I=S?b:C.current;C.current=I;const O=(0,Bo.Kr)((()=>{const t=["suggestions"];return e&&t.push("suggestions--aside"),Pi(t)}),[e]),L=(0,Bo.hb)((({id:e,question:t})=>{f&&h(!0),v&&m();const n=$();r({type:k,originMessage:_.id,body:{type:"faqclick",body:{faqId:e,faqQuestion:t}},transactionId:n}),o(t,n),i||a({visibility:Dt.open}),l()}),[o,m,h,l,f,v,_,r,a,i]);(0,Bo.vJ)((()=>{if(w.current!==b&&!E){if(S){const e=x.current?n("suggestions.srUpdatedText"):n("suggestions.srAvailableText");setTimeout((()=>{d(e)}),30)}else x.current&&d(n("suggestions.srUnavailableText"));w.current=b}!T.current&&E?(bn(u.current,l),d(n("suggestions.srUnavailableText"))):!S&&x.current&&bn(u.current,l),x.current=S,T.current=E}),[b,S,E,l,d,n]);const A=n("suggestions.headingText"),P=n("suggestions.footerText"),M=A?"section":"div";return bi(Gs,{isActive:!!N,transitionStartState:qs.notRendered,children:bi(M,{className:O,"aria-labelledby":A?c:void 0,ref:u,children:[A&&bi("p",{id:c,className:Pi("suggestions__heading"),children:A}),!!I&&bi(da,{suggestions:I,onClickSuggestion:L}),P&&!i&&bi("p",{className:Pi("suggestions__footer"),children:P})]})})};const Ys=(0,zt.forwardRef)((({children:e,className:t=""},n)=>{const{isOpen:r,isVisible:o,setVisibility:i}=ri(),{namespace:a,layoutMode:s}=un(),{isInline:c}=Mn(),l=Mi(),u=ii(),{t:d}=ni(),p=["chat",`chat--layout-${s}`,`namespace--${a}`,t];return"function"!=typeof l&&p.push(...l),r||"app"===s||p.push("chat--collapsed"),u&&p.push("chat--user-responded"),o&&bi("section",{className:Pi(p),onKeyDown:e=>{(e.code&&"Escape"===e.code||27===e.keyCode)&&!c&&r&&i({visibility:Dt.minimized})},tabIndex:-1,ref:n,"aria-label":d("chat.srLabel"),children:[bi("div",{className:Pi("chat-wrapper"),children:e}),"inline"===s&&r&&bi(Xs,{isAside:!0})]})}));var Qs=Ys,Zs=({children:e,handleClose:t,title:n,closeButtonText:r,srCloseButtonText:o,id:i})=>{const a=Ji();return bi("section",{tabIndex:-1,id:i,"aria-labelledby":n?a:void 0,className:Pi("chat-status",n?void 0:"chat-status--condensed"),children:[bi("div",{className:Pi("chat-status__body"),children:[n?bi("h2",{className:Pi("chat-status__title"),id:a,children:n}):null,e]}),"function"==typeof t&&bi("button",{type:"button",onClick:t,className:Pi("button","button--tertiary","chat-status__close"),children:[r||bi(Zi,{name:"close",size:"16",alt:""}),o&&bi("span",{className:Pi("visually-hidden"),children:o})]})]})},ec=({handleClick:e,icon:t,title:n,srButtonText:r})=>bi("button",{type:"button",onClick:e,className:Pi("button","button--primary","chat-status__button"),children:[bi(Zi,{name:t,size:"16",alt:""}),n,r&&bi("span",{className:Pi("visually-hidden"),children:r})]});function tc(){const{showProposal:e,translationProposal:t,dismissTranslationProposal:n,activateTranslationProposal:r}=Ai(),{id:o}=ki();return e&&t?bi(Zs,{handleClose:n,srCloseButtonText:t.srDismissButtonText,id:o,title:t.titleLabel,children:bi(ec,{handleClick:r,icon:"newTranslation",title:t.buttonLabel})}):null}function nc(){const e=Qt(mi),{isActive:t}=Ii();return e||t?null:bi(tc,{})}var rc=({label:e,checked:t,description:n,onChange:r,id:o,itemClassName:i})=>bi("li",{className:Pi([i||"","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:[bi(Zi,{name:"check",size:"16",alt:""}),e," ",n&&bi("span",{children:["(",n,")"]})]}),oc=({onChange:e,describedById:t})=>{const{context:{contentLocale:n}}=un(),{t:r}=ni(),{languages:o,currentLocale:i,enableTranslations:a,disableTranslations:s}=Ii(),c=Ti(),l=t=>()=>{t&&(t===i||n===t?s():a(t,"translation_choice"),e(),c())},{primaryLanguages:u,remainingLanguages:d}=(0,zt.useMemo)((()=>o.reduce(((e,t)=>{const r=t.locale===n,o=((e,t,n)=>t===e.locale||!t&&n)(t,i,r);t.locale!==n&&e.remainingLanguages.push({...t,checked:o,isOriginal:r});const a=e.remainingLanguages.findIndex((e=>e.locale===i));return(r||o&&a>4)&&e.primaryLanguages.push({...t,checked:o,isOriginal:r}),e}),{primaryLanguages:[],remainingLanguages:[]})),[i,n,o]);return bi("ul",{"aria-describedby":t,role:"listbox",tabIndex:-1,className:Pi("translation-options"),children:[u.map((({locale:e,nativeName:t,checked:n,isOriginal:o},i)=>bi(rc,{id:e,label:t,checked:n,description:o?r("translations.settings.original"):void 0,onChange:l(e),itemClassName:Pi({"translation-options__item--original":o,"translation-options__item--selected":n&&0!==i})},e))),d.map((({locale:e,nativeName:t,checked:n,isOriginal:o})=>bi(rc,{id:e,label:t,checked:n,description:o?r("translations.settings.original"):void 0,onChange:l(e)},e)))]})},ic=({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=Ji(),{hideOption:d}=zi(),{focusButton:p}=Bi(),f=(0,Bo.hb)((()=>{d(),c||p()}),[c,p,d]),h=(0,Bo.hb)((()=>{n&&n(),f()}),[f,n]),v=(e=>{const t=(0,Bo.li)(null);return(0,Bo.vJ)((()=>{const n=n=>{t.current&&n.target instanceof HTMLElement&&!t.current.contains(n.target)&&(n.preventDefault(),n.stopPropagation(),e())};return document.addEventListener("click",n,!0),document.addEventListener("touchstart",n,!0),()=>{document.removeEventListener("click",n,!0),document.removeEventListener("touchstart",n,!0)}}),[e,t]),t})(h);return(0,Bo.vJ)((()=>{gn(v.current)}),[v]),bi("section",{className:Pi("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:v,children:bi("div",{className:Pi("options__body"),children:[bi("h2",{id:u,className:Pi("options__title"),children:r}),bi("button",{type:"button",onClick:h,"aria-describedby":u,className:Pi("button","options__close"),ref:e=>{s&&(s.current=e)},children:[bi(Zi,{name:"close",size:"16",alt:""}),bi("span",{children:a})]}),o?bi("p",{className:Pi("options__description"),id:i,children:o}):null,bi("div",{className:Pi("options__wrapper"),children:t})]})})},ac=function({onClose:e,position:t}){const{t:n}=ni(),r=Ji();return bi(ic,{onCancel:e,headingText:n("translations.menu.title"),cancelButtonText:n("translations.settings.cancelButtonText"),description:n("translations.menu.description"),descriptionId:r,position:t,disableButtonFocusing:!0,children:bi(oc,{describedById:r,onChange:e})})};function sc({children:e,position:t={horizontal:"left",vertical:"top"},classNames:n=[]}){const[r,o]=(0,Bo.J0)(!1),i=(0,Bo.li)(null),a=Ji();return bi("div",{className:Pi("translations__container"),onKeyDown:e=>{r&&_n(e)===yn.Escape&&(o(!1),gn(i.current))},children:[bi(Gs,{transitionStartState:qs.notRendered,isActive:r,children:bi("div",{className:Pi("options__dialog"),role:"dialog",children:bi(ac,{onClose:()=>{o(!1)},position:t})})}),bi("button",{type:"button",className:Pi(["button","chat__options__button",...n]),id:a,onClick:()=>{o(!r)},onKeyDown:e=>{_n(e)===yn.ArrowDown&&(o(!0),e.preventDefault())},ref:i,"aria-haspopup":"dialog","aria-expanded":r,children:e})]})}var cc=({children:e,formId:t,persistData:n=!1,onError:r,onSubmit:o,validationSchema:i={},...a})=>{const s=zo(),c=Qt((e=>Ss(e,{formId:t}))),[l,u]=(0,Bo.J0)(!1),[d,p]=(0,Bo.J0)({}),{isValid:f,errors:h}=function(e,t){const n=(0,Bo.Kr)((()=>function(e,t={}){return Object.entries(t).reduce(((t,[n,r])=>{const o=Array.isArray(r)?r:[r];for(let r=0;r<o?.length;r++)if(!o[r].fn(e[n],o[r].compareValue)){t[n]=o[r].errorText;break}return t}),{})}(e,t)),[e,t]);return{isValid:0===Object.keys(n).length,errors:n}}(c,i),v=(0,Bo.Kr)((()=>({...h,...d})),[h,d]);(0,Bo.Nf)((()=>{s(ur({formId:t,persistData:n}))}),[t,n,s]),(0,Bo.vJ)((()=>()=>{s(dr({formId:t}))}),[t,n,s]);const m=(0,Bo.hb)(((e,n)=>{s(hr({formId:t,name:e,value:n}))}),[t,s]),y=(0,Bo.hb)(((e,n)=>{s(vr({formId:t,name:e,touched:n}))}),[s,t]),_=(0,Bo.hb)(((e,t)=>{p((n=>({...n,[e]:t})))}),[p]),g=(0,Bo.hb)((e=>{e.preventDefault();const t="true"===e.submitter.getAttribute("aria-disabled");u(!t),!t&&f&&(s(tr(!0)),o(c,{updateControlValue:m,setError:_}))}),[f,s,o,c,m,_]);(0,Bo.vJ)((()=>{r&&r({errors:v,isSubmitted:l,isValid:0===Object.keys(v).length})}),[l,v,r]);const b=(0,Bo.Kr)((()=>({formId:t,values:c,errors:v,isValid:0===Object.keys(v).length,isSubmitted:l,handleSubmit:g,validationSchema:i,updateControlValue:m,updateControlTouched:y})),[t,c,v,l,g,i,m,y]);return t?o?bi(Is,{...a,value:b,children:e}):(console.error('"onSubmit" is required.'),null):(console.error('"formId" is required.'),null)};const lc=(e,t,n=null)=>({fn:e,errorText:t,compareValue:n}),uc=(e,t)=>{let n=!0;for(let r=0;r<e.length;r++)e[r].size>t&&(n=!1);return n},dc=e=>!!e?.length,pc=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))},fc=e=>!!e;var hc=function({className:e,disableValidationClasses:t=!1,...n}){const{handleSubmit:r,isValid:o,isSubmitted:i}=function(){const{handleSubmit:e,isSubmitted:t,isValid:n}=Ls();return{handleSubmit:e,isSubmitted:t,isValid:n}}(),a=["form"];return!t&&i&&(a.push("form--submitted"),o?a.push("form--valid"):a.push("form--invalid")),bi("form",{onSubmit:r,className:Pi([...a,e]),...n})};function vc({id:e,error:t}){const[n,r]=(0,Bo.J0)(!1);return(0,Bo.vJ)((()=>{const e=setTimeout((()=>r(!0)),300);return()=>clearTimeout(e)}),[]),bi("div",{className:Pi("error"),"aria-live":"assertive","aria-atomic":"true",children:n&&t&&bi("span",{id:e,className:Pi("error__message"),children:[bi(Zi,{name:"error",size:"16",alt:""}),t]})})}var mc=({contentHint:e,id:t,labelText:n,labelClass:r,validity:i,errorText:a,children:s})=>bi(o.FK,{children:[e&&bi("span",{id:`${t}-content-hint`,className:Pi("input__content-hint"),children:e}),bi(vc,{id:`${t}-error`,error:!i&&a}),bi("div",{className:Pi("form-control__wrapper"),children:[bi("label",{htmlFor:t,className:Pi(r),children:n}),s]})]}),yc=function({id:e,name:t,type:n,labelText:r,labelClass:o,contentHint:i=null,focus:a,"aria-invalid":s,"aria-describedby":c,...l}){const u=(0,Bo.li)(null),{isSubmitted:d}=Ls(),[p,{error:f}]=As(t),h=d&&f,v=[];return c&&v.push(c),i&&v.push(`${e}-content-hint`),h&&v.push(`${e}-error`),(0,Bo.Nf)((()=>{u.current&&a&&u.current.focus()}),[a]),bi(mc,{id:e,contentHint:i,validity:!h,errorText:f,labelText:r,labelClass:o,children:bi("input",{...p,...l,ref:u,id:e,type:n,"aria-invalid":s||h?"true":"false","aria-describedby":v.join(" ")||void 0,name:t})})};function _c({controlName:e,describedById:t}){const{t:n}=ni();return bi(hc,{noValidate:"true",className:Pi("options__form"),children:[bi(yc,{id:"email-id",name:e,type:"email",className:Pi("transcript__input"),"aria-describedby":t,labelClass:Pi("label"),labelText:n("options.sendTranscript.label")}),bi("div",{className:Pi("options__actions"),children:bi("button",{type:"submit",className:Pi("button","button--primary","options__submit"),children:n("options.sendTranscript.sendButtonText")})})]})}const gc="email";const bc={sendTranscript:()=>{const[e,t]=(0,Bo.J0)(void 0),{hideOption:n}=zi(),{focusButton:r}=Bi(),{t:o}=ni(),i=Ji(),{sendAction:a}=fi(),s=(0,Bo.Kr)((()=>({[gc]:[lc(fc,o("options.sendTranscript.noEmailText")),lc(pc,o("options.sendTranscript.invalidEmailText"))]})),[o]),c=(0,Bo.hb)((e=>{const t=e[gc].trim();a({type:"send_transcript",body:{emailAddress:t}}),n(),r()}),[a,n,r]),l=(0,Bo.hb)((({isValid:e,isSubmitted:n})=>{t(n&&!e?"options--error":void 0)}),[t]);return bi(ic,{className:e,headingText:o("options.sendTranscript.title"),cancelButtonText:o("options.cancelButtonText"),description:o("options.sendTranscript.description"),descriptionId:i,position:{vertical:"top",horizontal:"right"},children:bi(cc,{formId:"sendTranscript",onSubmit:c,validationSchema:s,onError:l,children:bi(_c,{controlName:gc,describedById:i})})})}};var wc=()=>{const{optionActive:e}=zi(),t=(0,Bo.li)(),n=bc[t.current??e];return e&&(t.current=e),n?bi(n,{}):null},xc=()=>{const{t:e}=ni(),{menuOptions:t,showOption:n,panelActive:r,hideOption:o}=zi(),{id:i}=Bi(),a=(0,Bo.li)(null),[s,c]=(0,Bo.J0)(!1),l=(0,Bo.li)(null),u=t.length,d=(0,Bo.li)([]),p=(0,Bo.li)(!1),f=u>1,h=t[0],v=(0,Bo.Kr)((()=>h?.name?.trim().replace(/\s+/g,"")),[h]);return(0,Bo.vJ)((()=>()=>{a.current&&clearTimeout(a.current)}),[]),(0,Bo.vJ)((()=>{s&&!p.current&&requestAnimationFrame((async()=>{await Ci(60);const e=t.findIndex((e=>e.available)),n=-1===e?0:e;d.current&&gn(d.current[n])})),p.current=s}),[s,t]),u?bi("div",{className:Pi("options__container"),onKeyDown:e=>{s&&(_n(e)===yn.Escape&&(c(!1),gn(l.current)),_n(e)===yn.Home&&(d.current&&gn(d.current[0]),e.preventDefault()),_n(e)===yn.End&&(d.current&&gn(d.current[u-1]),e.preventDefault()))},onFocusOut:()=>{f&&(a.current=setTimeout((()=>{c(!1)}),200))},onFocusIn:()=>{a.current&&clearTimeout(a.current)},children:[bi(Gs,{transitionStartState:qs.notRendered,isActive:r,children:bi("div",{className:Pi("options__dialog"),children:bi(wc,{})})}),f&&bi(Gs,{isActive:s,transitionStartState:qs.notRendered,children:bi("ul",{className:Pi(["options__menu"]),role:"menu",tabIndex:-1,"aria-labelledby":i,children:t.map((({name:r,title:o,available:i},a)=>bi("li",{className:Pi("options__menu__item"),role:"menuitem","data-testid":r,children:bi("button",{type:"button",ref:e=>{e&&(d.current[a]=e)},className:Pi(["button","button--secondary"]),onKeyDown:e=>((e,t)=>{if(_n(e)===yn.ArrowDown){const n=Math.min(u-1,t+1);d.current&&gn(d.current[t===n?0:n]),e.preventDefault()}if(_n(e)===yn.ArrowUp){const n=Math.max(0,t-1);d.current&&gn(d.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&&d.current&&gn(d.current[o])})(e,a),onClick:()=>((e,t)=>{t&&(c(!1),n(e))})(r,i),"aria-disabled":!i,children:[bi("span",{className:Pi("button__text"),children:[o,!i&&" "]}),i?null:bi("span",{className:Pi("button__state"),children:e("options.unavailableText")})]})},r)))})}),bi("button",{type:"button",className:Pi(["button","button--secondary","chat__options__button",...!f&&v?[`chat__options__button--${v}`]:[]]),id:i,onClick:()=>{r&&o(),f?c((e=>!e)):h.available&&!r&&n(h.name)},onKeyDown:f?e=>{_n(e)===yn.ArrowDown&&(c(!0),e.preventDefault())}:void 0,ref:l,"aria-haspopup":!!f&&"menu","aria-expanded":!!f&&s,"aria-disabled":!f&&!h.available,children:[f?bi(Zi,{name:"options",size:"32",alt:""}):null,bi("span",{className:Pi("button__text"),children:f?e("options.openButtonText"):`${h.title}${h.available?"":" "}`}),f||h.available?null:bi("span",{className:Pi("button__state"),children:e("options.unavailableText")})]})]}):null};function Cc(){const{menuOptions:e,allowOptionSelection:t}=zi(),{isAvailable:n}=Ii(),r=Qt(mi),{t:o,userLocale:i}=ni(),a=Li(i);if(!n&&(!t||!e.length)||r)return null;const s=o("translations.settings.openButtonText",{hasLanguage:!!a,language:a});return bi("div",{className:Pi("chat__options"),children:[n&&bi("div",{className:Pi("chat__options-item","chat__options-item--left"),children:bi(sc,{classNames:["button--secondary"],children:[bi(Zi,{alt:s,name:"newTranslation",size:"16"}),bi("span",{className:Pi("button__text"),children:s})]})}),t&&bi("div",{className:Pi("chat__options-item","chat__options-item--right"),children:bi(xc,{})})]})}var Sc=()=>{const{scrollToRef:e,unreadIds:t}=Ds(),{isMinimized:n}=ri(),{t:r}=ni();return bi(Gs,{isActive:!!t.length&&!n,children:bi("div",{className:Pi("unread-messages"),children:bi("button",{type:"button",className:Pi("button","button--primary"),onClick:e,children:[r("message.unreadMessagesCount",{unreadCount:t.length}),bi(Zi,{name:"chevronDown",size:"32",alt:""})]})})})},Ec=({children:e})=>{const t=Tn(),n=(0,Bo.Kr)((()=>t.reduce(((e,t)=>t.payload.id?(e[t.payload.id]=(0,o._3)(),e):e),{})),[t]),{scrollToRef:r,scrollToBottom:i,containerRef:a,unreadIds:s}=(e=>{const t=(0,Bo.li)(null),[n,r]=(0,Bo.J0)(!0),o=Qt(gs),i=Tn(),a=Nn(),{isOpen:s}=ri(),c=Cn().loadedImageEventIds,{processingFileUploads:l,isLastEventFromClient:u}=Qt((({state:e})=>e));(0,Bo.vJ)((()=>{const e=t.current;if(!e)return()=>{};const 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 d=(0,Bo.hb)((()=>{requestAnimationFrame((async()=>{await Ci(30),t.current?.scrollTo({top:t.current?.scrollHeight,left:0,behavior:"auto"})}))}),[]);return(0,Bo.vJ)((()=>{u&&d()}),[u,d]),(0,Bo.vJ)((()=>{n&&d()}),[n,o,i,a,s,c,l,d]),{containerRef:t,unreadIds:o,scrollToRef:()=>{const n=o.at(0);if(void 0!==n){const r=e[n]?.current;t.current?.scrollTo({top:r?.offsetTop,behavior:"auto",left:0})}},scrollToBottom:d}})(n);return bi(Us.Provider,{value:{eventRefs:n,unreadIds:s,scrollToRef:r,scrollToBottom:i,containerRef:a},children:bi("div",{className:Pi("chat__container"),children:[bi("div",{className:Pi("chat__container__scroll-area"),ref:a,children:e}),bi(Sc,{})]})})},Tc=({baseClassName:e,children:t,title:n})=>{const r=On(),o=Ji();return bi("section",{id:r,className:Pi(e),"aria-describedby":o,tabIndex:-1,children:[bi("h2",{className:Pi(`${e}__title`),id:o,children:n}),t]})},Nc=()=>{const{t:e}=ni(),t=Ti(),n=Ki(),{emitEvent:r}=fi(),{isActive:i,remaining:a,timer:s,endCountdown:c}=Hi(),l=!!a&&a>0,u=e(l?"idleDetachWarning.countdownTitle":"idleDetachWarning.notifyTransferText");return bi(Tc,{baseClassName:"idle",title:u,children:l&&bi(o.FK,{children:[bi("div",{className:Pi("idle__count-container"),children:i&&bi(o.FK,{children:[bi("span",{className:Pi("idle__count-text"),children:e("idleDetachWarning.countdownText")}),bi("span",{className:Pi("idle__count-timer"),children:e("idleDetachWarning.countdownTimer",s)})]})}),bi("div",{className:Pi("idle__options"),children:[bi("button",{type:"button",className:Pi("button","button--primary"),onClick:()=>{n(),c(!0),t(),r("idleTimer.selectContinue")},children:e("idleDetachWarning.continueButton")}),bi("button",{type:"button",className:Pi("button","button--primary"),onClick:()=>{c(),t(),r("idleTimer.selectEnd")},children:e("idleDetachWarning.detachButton")})]})]})})},Ic=()=>{const{t:e}=ni(),t=Ki(),{name:n}=An()||{},{continueChat:r,restartChat:o}=$i();return bi(Tc,{baseClassName:"prompt",title:e("resumeConversationPrompt.title",{name:n}),children:bi("div",{className:Pi("prompt__options"),children:[bi("button",{type:"button",className:Pi("button","button--primary"),onClick:()=>{t(),r()},children:e("resumeConversationPrompt.continueButton")}),bi("button",{type:"button",className:Pi("button","button--primary"),onClick:o,children:e("resumeConversationPrompt.detachButton")})]})})};const Oc=()=>{const{sendAction:e}=fi(),{features:t}=zi(),{typingPeekahead:n}=t||{},r=(0,Bo.li)(null),o=(0,Bo.li)(null),i=(0,Bo.li)(!1),a=(0,Bo.li)(null);(0,Bo.vJ)((()=>()=>{a.current&&clearInterval(a.current),r.current&&clearTimeout(r.current),o.current&&clearTimeout(o.current)}),[]);const s=(t,r)=>{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&&a.current?(clearInterval(a.current),a.current=null):n&&n.enabled&&s(!0,e.target.value)}),2e3)),r.current&&clearTimeout(r.current),o.current&&clearTimeout(o.current),r.current=setTimeout((()=>{i.current=!1}),300),o.current=setTimeout((()=>{s(!1,e.target.value)}),2e3))}},kc=()=>{const{default:e,active:t,userSelected:n,options:r,optionsOverride:o}=Cn().entryMeta,i=zo(),a=n||t||e,s=o&&o[a]||r&&r[a]||{},c=(0,Bo.hb)((e=>{i(Xr(e))}),[i]),l=(0,Bo.hb)((e=>{i(qr(e))}),[i]),u=(0,Bo.hb)((e=>{i(_o(e))}),[i]),d=(0,Bo.hb)((()=>{n?u(null):l(e)}),[l,u,e,n]);return{activeEntry:a,activeEntryOptions:s,setActiveEntryType:l,setUserEntryType:u,cancelEntrySelection:d,setBlockAutoEntrySwitch:c}};function Lc({controlName:e,skipLinkId:t}){const{t:n}=ni(),{setInputFocus:r}=ri(),{sendAssertive:o}=hi(),{emitEvent:i}=fi(),a=Oc(),{setBlockAutoEntrySwitch:s}=kc(),{placeholder:c,label:l,labelClass:u}=Ms(e),{hasCharacterLimit:d,reachedCharacterWarning:p,reachedCharacterLimit:f,remainingChars:h}=Ps(e),[{value:v}]=As(e),m=!!v,y=(0,Bo.hb)((()=>{p&&o(n("input.srCharacterLimitText",{limit:h})),i("ui.inputFocus")}),[n,o,p,h,i]);return(0,Bo.Nf)((()=>(s(m),()=>{s(!1)})),[s,m]),bi(hc,{className:Pi("entry-form"),disableValidationClasses:!0,noValidate:"true",children:[bi("div",{className:Pi(["input--text__container",...p&&!f?["character-warning"]:[],...f?["character-exceeded"]:[]]),children:[bi(yc,{id:t,type:"text",name:e,className:Pi("input__text"),autocomplete:"off",placeholder:c,labelText:l,labelClass:Pi(u),"aria-invalid":!!d&&f,onKeyUp:a,onFocus:y,focus:r}),bi("div",{className:Pi("character-count"),children:p&&bi("span",{children:h})})]}),bi("button",{className:Pi("button","input__submit"),onPointerDown:e=>{e.preventDefault()},"aria-disabled":!m||f,children:bi(Zi,{name:"send",size:"32",alt:n("input.sendMessage")})})]})}const Ac="textMessageEntry";function Pc({...e}){const{isOpen:t,setVisibility:n}=ri(),r=On(),o=Ti(),{sendMessage:i}=fi(),a=(0,Bo.hb)(((e,{updateControlValue:r})=>{i({body:e[Ac]}),r(Ac,""),o(),t||n({visibility:Dt.open})}),[i,o,t,n]);return bi(cc,{...e,formId:"textEntry",persistData:!0,onSubmit:a,children:bi(Lc,{controlName:Ac,skipLinkId:r})})}var Mc=()=>{const{t:e}=ni(),{currentUploads:t}=ji();return bi("div",{className:Pi("progress"),children:t.map((({id:t,name:n,progress:r,uploading:o,error:i})=>bi("div",{className:Pi("progress_container"),children:[bi("div",{className:Pi("progress__text"),children:[bi("span",{className:Pi("progress__text--file-name"),children:n}),bi("span",{className:Pi("progress__text--percentage"),children:`${r}%`})]}),bi(vc,{error:i,id:"progress-error"}),bi("progress",{className:Pi("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 Rc({id:e,name:t,labelText:n,contentHint:r,outputText:o,accept:i}){const{isSubmitted:a}=Ls(),[s,c]=(0,Bo.J0)(!1),[{onInput:l,onBlur:u},{error:d}]=As(t),p=Ji(),f=Ji(),h=Ji(),v=a&&d,m=[h];r&&m.push(f),v&&m.push(p);const y=(0,Bo.hb)((()=>{c(!0)}),[c]),_=(0,Bo.hb)((()=>{c(!1),u()}),[c,u]),g=(0,Bo.hb)((e=>{const t={target:{value:e.target.files}};l(t)}),[l]);return bi("div",{className:Pi("upload__container"),children:[r&&bi("span",{className:Pi("upload__content-hint"),id:f,children:r}),bi(vc,{id:p,error:v&&d}),bi("div",{className:Pi(["file-upload",...s?["focus-within"]:[]]),children:bi("label",{htmlFor:e,className:Pi("upload__label"),children:[bi(Zi,{name:"upload",size:"32",alt:""}),bi("div",{children:[bi("span",{className:Pi(["upload__label--text"]),children:n}),bi("input",{id:e,className:Pi("upload__input"),type:"file",name:t,onChange:g,"aria-invalid":v?"true":"false","aria-describedby":m.join(" "),accept:i||null,onFocus:y,onBlur:_}),bi("span",{className:Pi("upload__output"),"aria-hidden":"true",id:h,children:o})]})]})})]})}var Fc=({skiplinkId:e,controlName:t,accept:n,contentHint:r,isUploading:o,isComplete:i,onClickCancel:a})=>{const{t:s}=ni(),[{value:c}]=As(t),l=c&&c.length>0,u=l&&"string"!=typeof c?c[0].name:"";return bi(hc,{className:Pi("upload-form"),children:[bi(Rc,{name:t,id:e,accept:n,labelText:s("fileUpload.labelText"),outputText:s("fileUpload.selectedText",{hasFile:l,filename:u}),contentHint:r}),bi("div",{className:Pi("upload__button-container"),children:[bi("button",{id:o||!i?e:void 0,type:"button",onClick:a,className:Pi("button","button--secondary","upload__cancel"),children:s("fileUpload.cancelButtonText")}),bi("button",{className:Pi("button","button--primary"),type:"submit",children:s("fileUpload.uploadButtonText")})]})]})};const Dc="fileListForm",Uc="fileList";var jc=()=>{const{t:e}=ni(),{sendPolite:t,sendAssertive:n}=hi(),r=On(),i=Ti(),{serviceAllowsUploads:a,allowedMimeTypes:s,maxSize:c}=Ui(),l=(0,Bo.li)(null),u=(0,Bo.li)(a),{cancelEntrySelection:d}=kc(),{uploadFile:p,clearUploads:f,isUploading:h,isComplete:v}=ji(),{uploadHandle:m,hasServerError:y,progress:_}=((e,t)=>{const n=Qt((n=>Es(n,{formId:e,name:t}))),{currentUploads:r}=ji(),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}})(Dc,Uc),g=Ji(),b=(0,Bo.li)(!0),w=e("fileUpload.contentHint",{size:vn(c)}),x=(0,Bo.li)(""),C=(0,Bo.li)(null);(0,Bo.vJ)((()=>{x.current&&C.current?.contains(document.activeElement)&&"INPUT"===document.activeElement?.tagName&&n(w),x.current=w}),[w,n]),(0,Bo.vJ)((()=>{_>0&&t(1===_?e("fileUpload.srStartedText"):`${_}%`)}),[_,t,e]),(0,Bo.vJ)((()=>{b.current||h||!v||(f(),d(),i(),setTimeout((()=>{t(e("fileUpload.srCompleteText"))}),300)),b.current=v}),[h,v,f,d,i,t,e]);const S=(0,Bo.hb)((({fileList:e})=>{p(e[0]),i()}),[p,!1,i]),E=(0,Bo.hb)((()=>{m&&m.abort(),f(),d(),i()}),[m,f,d,i]),T=(0,Bo.Kr)((()=>({[Uc]:[lc((()=>a),e("fileUpload.errors.unavailable")),lc(dc,e("fileUpload.errors.noFile")),lc(uc,e("fileUpload.errors.tooLarge"),c)]})),[c,a,e]);return bi("div",{className:Pi(["upload",...y?["upload--error"]:[]]),ref:C,children:bi(cc,{formId:Dc,persistData:!0,onSubmit:S,validationSchema:T,children:[(h||!v)&&bi(o.FK,{children:[bi(Mc,{}),bi("div",{className:Pi("upload__button-container"),children:bi("button",{id:h||!v?r:void 0,type:"button",onClick:E,ref:l,className:Pi("button","button--secondary","upload__cancel"),children:e("fileUpload.cancelButtonText")})})]}),!h&&v&&bi(Fc,{controlName:Uc,skiplinkId:r,accept:s?.join(", ")||"",contentHint:w,isComplete:v,isUploading:h,onClickCancel:E}),!u.current&&bi(o.FK,{children:[bi("span",{className:Pi("notification"),id:g,children:e("fileUpload.unavailableText")}),bi("div",{className:Pi("upload__button-container"),children:bi("button",{id:h||!v?r:void 0,type:"button",onClick:E,className:Pi("button","button--secondary","upload__cancel"),children:e("fileUpload.cancelButtonText")})})]})]})})},zc=()=>{const{t:e}=ni(),{showFileUpload:t,serviceAllowsUploads:n}=Ui(),[r,o]=(0,Bo.J0)(n||!1),i=Ti(),a=(0,Bo.li)(null),{setUserEntryType:s,activeEntry:c}=kc(),l=(0,Bo.li)(null),{sendPolite:u}=hi(),d=!!An();return(0,Bo.vJ)((()=>{bn(l.current,(()=>{n||i()})),o(n||!1)}),[n,i]),(0,Bo.vJ)((()=>{a.current&&!n&&u(e("fileUpload.srUnavailableText")),!1===a.current&&n&&u(e("fileUpload.srAvailableText")),d&&(a.current=n)}),[n,d,u,e]),t||c===N?null:bi(Gs,{isActive:r,transitionStartState:qs.rendered,children:bi("div",{className:Pi("upload-toggle-wrapper"),children:bi(Gs,{isActive:r,transitionStartState:qs.visuallyHidden,children:bi("button",{className:Pi(["button","button--secondary","upload-toggle"]),ref:l,"aria-disabled":!r,type:"button",onClick:r?()=>{s(N),i()}:void 0,children:bi(Zi,{name:"file",size:"32",alt:e("fileUpload.toggleButtonText")})})})})})},Bc=()=>{const{isOpen:e}=ri(),t=(0,Bo.li)(null),{hasCountdown:n}=Hi(),[r,o]=(0,Bo.J0)(n),{hasPrompt:i}=$i(),[a,s]=(0,Bo.J0)(i),c=Ti(),l=(0,Bo.li)(!1),{activeEntry:u}=kc(),[d,p]=(0,Bo.J0)({text:Pc,upload:jc}),[f,h]=(0,Bo.J0)((()=>u)),v=un(),{accountAllowsUploads:m}=Ui(),y=(0,Bo.hb)((()=>{bn(t.current,c)}),[c]);(0,Bo.vJ)((()=>{const{customComponents:e}=v,{entry:t}=e||{};t&&p((e=>({...e,...t})))}),[v]),(0,Bo.vJ)((()=>{y(),o(n),s(i)}),[n,i,y]),(0,Bo.vJ)((()=>{h(u),y()}),[u,y,t]),l.current=!(!t.current||!t.current.contains(document.activeElement));const _=d[f];return bi("div",{className:Pi("chat__entry"),ref:t,children:[r&&bi(Nc,{}),a&&bi(Ic,{}),bi("div",{className:Pi(["entry__body",...n||i?["entry__body--hidden"]:[]]),children:[f!==N&&m&&e?bi(zc,{}):null,bi(_,{})]})]})},Vc=()=>{const{t:e}=ni(),{isOpen:t,closeChat:n}=ri(),{isWindow:r}=Mn();return t&&r?bi("button",{type:"button",className:Pi("button","collapse-button"),onClick:n,children:bi(Zi,{name:"chevronDown",size:"32",alt:e("window.srCollapseButton")})}):null},Kc=()=>{const{meta:{originalError:e,title:t,message:n,buttonText:r,action:i,srText:a}}=yi(),s=fi(),c=Ji(),{sendPolite:l}=hi(),u=Ti(),d="SeamlySessionExpiredError"===e?.name;return(0,Bo.vJ)((()=>{!d&&a&&setTimeout((()=>{l(a)}),200)}),[l,a,d]),d?bi(o.FK,{}):bi("section",{className:Pi("interrupt"),"aria-labelledby":c,children:[bi(Vc,{}),bi("div",{className:Pi("interrupt__body"),children:[bi("h2",{id:c,className:Pi("interrupt__title"),children:t}),bi("p",{className:Pi("interrupt__message"),children:n}),r&&i&&bi("div",{className:Pi("interrupt__actions"),children:bi("button",{type:"button",className:Pi("button","button--primary"),onClick:()=>{i&&s[i]&&s[i](),u()},children:r})})]})]})},Hc=function({children:e}){const t=Qt(mi),{isOpen:n}=ri();return t?bi(Kc,{}):bi(o.FK,{children:[bi(Ec,{children:[bi("div",{className:Pi("chat__container__header"),children:[bi(nc,{}),bi(Vc,{})]}),e]}),bi(Bc,{}),n&&bi(Cc,{})]})};function $c({event:e}){const[t]=js(e);return bi("li",{children:bi(t,{event:e})})}function Jc({events:e}){return bi("ul",{className:Pi("collapsed-chat-messages"),children:e.map((e=>bi($c,{event:e},e.payload.id)))})}function Wc(){const{preChatEvents:e}=un(),t=Qt(mi),{isOpen:n}=ri();return t||!e?.length||n?null:bi(Jc,{events:e})}function qc(){const{t:e}=ni(),t=e("window.chat.continue");return bi(Jc,{events:[(0,Bo.Kr)((()=>({type:"message",payload:{type:"custom",body:{text:t,type:"",data:{}},participant:"seamly-client-participant"}})),[t])]})}const Gc=()=>{const e=dn(),t=An(),n=Qt(mi),r=t&&!n,o=r?t.avatar:e;return o?bi("img",{className:Pi(r?"avatar":"icon"),src:o,alt:""}):bi(Zi,{name:"avatar",size:"32",alt:""})};var Xc=({onClick:e})=>{const t=pi(),{t:n}=ni(),r=t()?n("window.openButton.srContinue"):n("window.openButton.srStart"),o=Ti(),{isOpen:i}=ri(),a=In(),s=(0,Bo.hb)((()=>{e(),o()}),[o,e]);return bi(Gs,{isActive:!i,transitionStartState:qs.rendered,children:bi("button",{className:Pi("window-open-button"),"aria-label":r,"aria-hidden":i,onClick:s,children:[bi(Gs,{isActive:!!a,transitionStartState:qs.notRendered,children:bi("span",{className:Pi("message-count"),"aria-hidden":"true",children:a})}),bi(Gc,{})]})})};const Yc=(e,t,n)=>"object"==typeof e?e[t]:n;var Qc=n.p+"sounds/beep.mp3";const Zc=!!window.Notification;const el={app:()=>bi(Qs,{children:bi(Hc,{children:bi(Ks,{})})}),inline:()=>{const{showInlineView:e,containerRef:t}=(()=>{const e=zo(),{connectWhenInView:t}=un(),n=Qt(Fn),{containerRef:r,isVisible:o}=oi({enabled:t,freezeOnceVisible:!0});return(0,Bo.vJ)((()=>{o&&e(Do())}),[e,o]),{containerRef:r,showInlineView:n}})(),{isOpen:n}=ri();return bi(o.FK,{children:[bi(Gs,{isActive:!n,transitionStartState:qs.rendered,children:bi("div",{ref:t,className:Pi("unstarted-wrapper","unstarted-wrapper--inline"),children:[bi(Wc,{}),bi(Xs,{})]})}),bi(Gs,{isActive:n,transitionStartState:qs.rendered,children:bi(Qs,{ref:t,children:e&&bi(Hc,{children:n&&bi(Ks,{})})})})]})},window:()=>{const{isOpen:e,openChat:t}=ri(),n=ii(),{continueChat:r,preChat:i}=un();return bi(o.FK,{children:[bi(Xc,{onClick:t}),bi(Gs,{isActive:!!i&&!e&&!n,exitAfter:Yc(i,"exitAfter"),enterDelay:Yc(i,"enterDelay"),transitionStartState:qs.notRendered,children:bi("div",{className:Pi("unstarted-wrapper","unstarted-wrapper--window"),children:bi(Wc,{})})}),bi(Gs,{isActive:r&&!e&&n,exitAfter:Yc(r,"exitAfter"),enterDelay:Yc(r,"enterDelay"),transitionStartState:qs.notRendered,children:bi("div",{className:Pi("unstarted-wrapper","unstarted-wrapper--window","unstarted-wrapper--continue"),children:bi(qc,{})})}),bi(Gs,{isActive:e,transitionStartState:qs.notRendered,children:bi(Qs,{children:bi(Hc,{children:bi(Ks,{})})})})]})}};function tl(e){const t=document.createElement("div");return t.innerHTML=e||"",t.textContent||t.innerText||""}var nl=({children:e})=>{const{sendNotification:t}=(()=>{const{proactiveMessages:e}=kn(),{notificationAudioURL:t}=un(),[n,r]=(0,Bo.J0)(Zc?Notification.permission:"default"),[o,i]=(0,Bo.J0)(document.visibilityState),a=Qt(bs),s=(0,Bo.hb)((async()=>{if(Zc&&"granted"!==n){const e=await Notification.requestPermission();r(e)}}),[n]),c=(0,Bo.Kr)((()=>"granted"===n),[n]),l=(0,Bo.Kr)((()=>"hidden"===o),[o]);(0,Bo.vJ)((()=>{"default"===n&&e&&s()}),[n,e,s]);const u=(0,Bo.hb)((async(e,r)=>{if(a&&Zc){if("default"===n&&s(),!1!==t&&!c&&(l||!document.hasFocus()))try{const e=new Audio(t||Qc);await e.play()}catch(e){console.warn(e)}if(c&&(l||!document.hasFocus())){const t=new Notification(e,r);t.onclick=function(){window.parent.focus(),window.focus(),t.close();const e=document.querySelector(`input[name=${Ac}]`);e&&e.focus()}}}}),[t,n,c,s,a,l]);return(0,Bo.vJ)((()=>{if(!a)return()=>{};function e(){i(document.visibilityState)}return document.addEventListener("visibilitychange",e,!1),()=>{document.removeEventListener("visibilitychange",e)}}),[a]),{permission:n,requestPermission:s,sendNotification:u}})(),[,n]=Si(),r=un(),o=An(),{proactiveMessages:i}=kn(),{isOpen:a,isVisible:s}=ri(),c=Mi(),l=ii(),u=Qt(_s),{body:d}=Oi(u),{userLocale:p}=ni(),f=(0,Bo.li)(void 0),h=(0,Bo.Kr)((()=>d?"string"==typeof d?tl(d):"text"in d?tl(d.text):"prompt"in d&&d.prompt&&"text"in d.prompt?tl(d.prompt?.text):"":""),[d]);(0,Bo.vJ)((()=>{o?.name&&h&&i&&u&&f.current!==u.payload?.id&&(t(o.name,{body:h,icon:o?.avatar||void 0}),f.current=u.payload.id)}),[o?.avatar,o?.name,u,h,i,t]);const v=el[r.layoutMode],m=(0,Bo.hb)((e=>{"function"==typeof n&&n(e)}),[n]),y=(0,Bo.Kr)((()=>{if(p){const e=document.querySelector("html")?.getAttribute("lang");if(e!==p)return p}}),[p]);if(!v)return console.warn('"layoutMode" should be one of "app", "inline" or "window"'),null;const _=["app",`app--layout-${r.layoutMode}`,`namespace--${r.namespace}`];return"function"!=typeof c?_.push(...c):_.push(...c(r)),a||"app"===r.layoutMode||_.push("app--collapsed"),l&&_.push("app--user-responded"),s?bi("div",{className:Pi(_),lang:y,tabIndex:-1,"data-nosnippet":!0,style:{zIndex:r?.zIndex},ref:m,children:e||bi(v,{})}):null},rl=e=>bi(ms,{...e,children:bi(nl,{})});class ol{constructor(e,n){const{namespace:r="",parentElement:o,...i}=e;this.config={...i,namespace:r},this.namespace=r,this.parentElement=o,this.externalApi=n,this.api=new G({layoutMode:e.layoutMode,namespace:e.namespace,config:e.api,context:e.context}),this.eventBus=new(t()),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)))}async render(){const{view:e,...t}=this.config.customComponents||{},n={...this.config,parentElement:this.parentElement,customComponents:Object.keys(t).length?t:void 0},r=jo({api:this.api,eventBus:this.eventBus,config:n,initialState:void 0});r.dispatch(Gn(n)),await r.dispatch(St()),await r.dispatch(Bn()),r.dispatch(zn()),e?(0,o.XX)(bi(ms,{eventBus:this.eventBus,store:r,api:this.api,children:bi(e,{})}),this.parentElement):(0,o.XX)(bi(rl,{config:n,eventBus:this.eventBus,store:r,api:this.api}),this.parentElement)}destroy(){(0,o.XX)(null,this.parentElement),this.eventBus.off(),this.api.disconnect(),this.functions={}}registerFunctions(e){Object.entries(e).forEach((([e,t])=>{this.registerFunction(e,t)}))}registerFunction(e,t){this.functions[e]=this.functions[e]||[],this.functions[e].push(t),this.externalApi.handleActions()}unregisterFunction(e,t){const n=this.functions[e];n&&n.length&&(this.functions[e]=n.filter((e=>e!==t)))}execFunction(e,...t){const n=this.functions[e];return!(!n||!n.length||(n.forEach((n=>{try{n(...t)}catch(t){console.error(`Action(${e}) failed: `,t)}})),0))}}const il=e=>"object"==typeof e&&"action"in e,al=e=>({...e,args:Array.isArray(e.args)?e.args:[e.args]});var sl=class{constructor(e){this._waitingActions=[],this._instances={},this.timeouts={},this.appConfig=e,this.context={}}push(...e){(e=e.filter(il).map(al)).length&&(this._waitingActions.push(...e),this.handleActions())}handleActions(){const e=this._waitingActions;this._waitingActions=[],e.forEach((e=>{switch(e.action){case"init":this.handleInit(e);break;case"destroy":this.handleDestroy(e);break;default:this.handleAction(e)||this.setContext(e.action,...e.args)||this._waitingActions.push(e)}}))}instanceInitializing(e){const t=Object.keys(this._instances);return!e&&t.length>0||t.includes(e)}setContext(e,t){const{instance:n}=t;if(this.instanceInitializing(n))return!1;switch(e){case"setTopic":const{name:e}=t;return e&&(this.context.topic=e),!0;case"setTranslation":const{enabled:n,locale:r}=t;return n&&r&&(this.context.userLocale=r,this.context.source=j),!0;case"setContext":const{userLocale:o,contentLocale:i}=t;return this.context.userLocale=o,this.context.contentLocale=i,o&&o!=this.appConfig?.userLocale&&(this.context.source=j),!0;case"setVariables":return Object.keys(t).length>0&&(this.context.variables={...t}),!0;default:return!1}}handleInit(e){const t=this.getUserConfig(...e.args),n=this.getCombinedConfig(t),{parentElement:r,namespace: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={},this.debouncedRender(e,n.namespace)}}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 ol(e,this)}debouncedRender(e,t){window.clearTimeout(this.timeouts[t]),this.timeouts[t]=window.setTimeout((()=>{e.render()}),100)}destroy(e){e?("string"==typeof e&&(e=this._instances[e]),e&&(e.destroy(),delete this._instances[e.namespace])):Object.entries(this._instances).forEach((([e,t])=>{t.destroy(),delete this._instances[e]}))}getUserConfig(e={}){return e}getCombinedConfig(e){const t={...e.context||this.appConfig.context,...this.context},n=this.getMergedVariables(e);Object.keys(n).length>0&&(t.variables=n);const r={...this.appConfig.defaults,...e.defaults},o={...this.appConfig,...e,api:{...this.appConfig.api,...e.api},context:Object.keys(t).length?t:void 0,defaults:Object.keys(r).length?r:void 0};return"function"==typeof this.appConfig?this.appConfig(o):o}getMergedVariables(e){return{...this.appConfig.context?.variables||{},...e.context?.variables||{},...this.context.variables||{}}}};const cl=()=>{const e=zo();return{addEvent:t=>e(Fr(t)),clearEvents:()=>e(jr()),setEventsRead:t=>e(Yr(t)),setLoadedImageEventIds:t=>e(ao(t)),setIsLoading:t=>e(io(t)),setParticipant:t=>e(so(t)),setHeaderTitle:t=>e(no(t)),setHeaderSubTitle:t=>e(to(t)),setActiveService:t=>e(Gr(t)),initIdleDetachCountdown:t=>e($r(t)),decrementIdleDetachCountdownCounter:()=>e(Kr()),stopIdleDetachCountdownCounter:()=>e(xo()),clearIdleDetachCountdown:()=>e(Br()),initResumeConversationPrompt:()=>e(Jr()),clearResumeConversationPrompt:()=>e(Vr()),setServiceDataItem:t=>e(lo(t)),setFeatures:t=>e(eo(t)),setFeatureEnabledState:t=>e(Qr(t)),clearFeatures:()=>e(zr()),setInitialState:t=>e(oo(t)),setUserSelectedOptions:t=>e(bo(t)),setUserSelectedOption:t=>e(go(t)),showOption:t=>e(wo(t)),hideOption:()=>e(Hr()),setServiceEntryMetadata:t=>e(uo(t)),setBlockAutoEntrySwitch:t=>e(Xr(t)),setActiveEntryType:t=>e(qr(t)),setUserEntryType:t=>e(_o(t)),registerUpload:t=>e(Wr(t)),setUploadProgress:t=>e(vo(t)),setUploadComplete:t=>e(fo(t)),setUploadError:t=>e(ho(t)),clearAllUploads:()=>e(Ur()),setSeamlyContainerElement:t=>e(co(t))}};var ll=()=>{const{t:e}=ni(),{title:t,subTitle:n}=Cn().headerTitles,r=In(),{isOpen:o}=ri(),i=An(),a=Qt(mi),s=dn(),c=i?.avatar??s,l=a?"":n,u=["message-count"];return o&&u.push("message-count__hide"),0===r&&u.push("message-count__empty"),l||!o?bi("div",{className:Pi("agent-info"),children:[bi("div",{className:Pi("agent-info__graphic"),children:[c?bi("img",{className:Pi(i?.avatar?"avatar":"icon"),src:c,alt:""}):bi(Zi,{name:"avatar",size:"32",alt:""}),bi("span",{className:Pi(u),"aria-hidden":"true",children:r})]}),bi("div",{className:Pi("agent-info__body"),children:[bi("p",{className:Pi("agent-info__heading"),children:t??e("header.title")}),bi("p",{className:Pi("agent-info__text"),children:l})]})]}):null},ul=({children:e,onCloseChat:t})=>{const{headerCollapseButtonId:n}=Cn(),r=(0,Bo.li)(null),{t:o}=ni();return bi("header",{className:Pi("chat__header"),children:[e,bi("div",{className:Pi("header-controls"),children:bi("button",{type:"button",className:Pi("button","header-controls__collapse"),onClick:t,ref:r,id:n,children:bi(Zi,{name:"chevronDown",size:"32",alt:o("header.collapseApp")})})})]})},dl=function(e){if(window.seamly&&!Array.isArray(window.seamly))throw new Error("Seamly UI has already been initialised. Use the window.seamly object to start new instances instead.");const t=Array.isArray(window.seamly)?window.seamly:[],n=new sl(e);window.seamly={push:n.push.bind(n)},n.push(...t)}}(),r}()}));
|
|
3
3
|
//# sourceMappingURL=~/standalone.min.js.map
|