@kindly/react-chat 2.76.8 → 2.76.11

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/dist/index.js CHANGED
@@ -971,7 +971,7 @@
971
971
  border-radius: 25px;
972
972
  }
973
973
  }
974
- `,v=function(e){let{from:t,to:n,value:i=1,affix:l,affixValue:s,step:c=1,onChange:m,name:g,field:v,ariaLabel:y,validators:w,hasController:x}=e;const E=(0,r.useMemo)(()=>{var e;const n=parseFloat(t);return Number.isNaN(n)?null==w||null===(e=w.find(e=>void 0!==e.min&&null!==e.min))||void 0===e?void 0:e.min:n},[t,w]),k=(0,r.useMemo)(()=>{var e;const t=parseFloat(n);return Number.isNaN(t)?null==w||null===(e=w.find(e=>void 0!==e.max&&null!==e.max))||void 0===e?void 0:e.max:t},[n,w]),[_,A]=(0,r.useState)(((e,t,n)=>t<e?e+n:t)(c,i,E));return o().createElement(u,{$isForm:!!x},o().createElement(p,{$isForm:!!x},l===a.rc.PREFIX&&o().createElement(d,null,s),o().createElement(f,null,_),l===a.rc.SUFFIX&&o().createElement(d,null,s)),o().createElement(h,null,o().createElement(b,{type:"range",name:g,step:c,min:E,max:k,value:_,onChange:e=>{var t;null!=e&&null!==(t=e.target)&&void 0!==t&&t.value&&(m&&m(e.target.value),null!=v&&v.onChange&&v.onChange(e),A(e.target.value))},"aria-label":y})))}},4047:(e,t,n)=>{"use strict";var r=n(9155),o="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},a=r.useSyncExternalStore,i=r.useRef,l=r.useEffect,s=r.useMemo,c=r.useDebugValue;t.useSyncExternalStoreWithSelector=function(e,t,n,r,u){var d=i(null);if(null===d.current){var p={hasValue:!1,value:null};d.current=p}else p=d.current;d=s(function(){function e(e){if(!l){if(l=!0,a=e,e=r(e),void 0!==u&&p.hasValue){var t=p.value;if(u(t,e))return i=t}return i=e}if(t=i,o(a,e))return t;var n=r(e);return void 0!==u&&u(t,n)?(a=e,t):(a=e,i=n)}var a,i,l=!1,s=void 0===n?null:n;return[function(){return e(t())},null===s?void 0:function(){return e(s())}]},[t,n,r,u]);var f=a(e,d[0],d[1]);return l(function(){p.hasValue=!0,p.value=f},[f]),c(f),f}},4142:(e,t,n)=>{"use strict";n.d(t,{S:()=>l});var r=n(7251),o=n(2221),a=n(1872),i=n(4851);const l=(0,r.zD)("feedback/sendToPat",async(e,t)=>{let{getState:n,dispatch:r,rejectWithValue:l}=t;const{connection:{token:s},environment:{PAT_HOST:c}}=n();try{const t=await r((0,a.et)(`${c}/chatbubble/${o.Ak}/feedback`,{method:"POST",body:{feedback:e},...(0,i.A)({token:s})}));if(!t.ok)throw new Error(`Feedback submission failed with status: ${t.status}`);return t.data.data.id}catch(e){return l(e.message)}})},4240:(e,t,n)=>{"use strict";var r=n(8655)("match");e.exports=function(e){var t=/./;try{"/./"[e](t)}catch(n){try{return t[r]=!1,"/./"[e](t)}catch(e){}}return!1}},4311:(e,t,n)=>{"use strict";n.d(t,{A:()=>s});var r=n(9155),o=n(541),a=n(1695),i=n(9337),l=n(1328);function s(){const{text:e}=(0,o.d4)(a.Od),{currentLanguageCode:t}=(0,l.A)();return(0,r.useMemo)(()=>(0,i.A)(e,t),[t,e])}},4317:(e,t,n)=>{"use strict";var r=n(6100);e.exports=r({}.isPrototypeOf)},4399:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return e?n(e)?e.length?"array":"void":typeof e:"void"};var n=Array.isArray||(Array.isArray=function(e){return""+e!==e&&"[object Array]"==={}.toString.call(e)});e.exports=t.default},4490:(e,t,n)=>{"use strict";function r(e,t){return"number"!=typeof(null==e?void 0:e.length)||e.length!==(null==t?void 0:t.length)?(console.error("Trying to zip non-array of arrays of unequal length"),[]):e.map((e,n)=>[e,t[n]])}n.d(t,{A:()=>r})},4499:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});const r=(e,t,n)=>{var r;return null!==(r=t.split(".").reduce((e,t)=>e?e[t]:void 0,e))&&void 0!==r?r:n}},4517:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){var n={};return t.forEach(function(t){var r=e[t];r&&(n[t]=r)}),n},e.exports=t.default},4543:(e,t,n)=>{"use strict";var r=n(5024),o=n(4713),a=n(7161),i=n(480),l=n(3273),s=n(5341),c=n(701),u=n(9665),d=Object.getOwnPropertyDescriptor;t.f=r?d:function(e,t){if(e=l(e),t=s(t),u)try{return d(e,t)}catch(e){}if(c(e,t))return i(!o(a.f,e,t),e[t])}},4572:(e,t,n)=>{"use strict";var r=n(9344),o=n(814),a=n(1780),i=r(r.bind);e.exports=function(e,t){return o(e),void 0===t?e:a?i(e,t):function(){return e.apply(t,arguments)}}},4574:(e,t,n)=>{"use strict";var r=n(9903),o=Math.max,a=Math.min;e.exports=function(e,t){var n=r(e);return n<0?o(n+t,0):a(n,t)}},4603:(e,t,n)=>{"use strict";var r=n(5547),o=n(1203),a=n(8900).String;e.exports=!!Object.getOwnPropertySymbols&&!o(function(){var e=Symbol("symbol detection");return!a(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&r&&r<41})},4674:(e,t,n)=>{"use strict";var r=n(814),o=n(3057);e.exports=function(e,t){var n=e[t];return o(n)?void 0:r(n)}},4703:(e,t,n)=>{"use strict";n.d(t,{Bd:()=>I,Bu:()=>k,Zn:()=>S,aP:()=>x,j3:()=>L,pA:()=>N,qJ:()=>R,tM:()=>E,y2:()=>_,zh:()=>$});var r=n(5279),o=n(9272),a=n(2221),i=n(4851),l=n(7958),s=n(3699),c=n(1318),u=n(5173),d=n(4490),p=n(1112),f=n(5564),h=n(8628),m=n(8483),g=n(7243),b=n(7811),v=n(6079),y=n(7173);const w=e=>{const{PAT_HOST:t}=e().environment,{local:n,chatbubble:{botKey:r},connection:{token:o},messages:{forms:a}}=e();return{token:o,PAT_HOST:t,botKey:r,local:n,forms:a}},x=(e,t,n)=>(r,o)=>{const{botKey:a}=w(o);r((0,g.zX)(a,!0)),localStorage.setItem("kindly-chat-restart-message",JSON.stringify({message:e,exchangeId:t,newContext:n}))},E=(e,t)=>async(n,r)=>{const{PAT_HOST:o,token:l}=w(r),s=await n((0,f.z5)()),{headers:c}=(0,i.A)({token:l},{withCurrentUrl:!0,extra:s}),d={message:e,temporaryId:t},p=await n((0,g.et)(`${o}/chatbubble/${a.Ak}/message/`,{method:"POST",body:d,headers:c},{onError:e=>{var r;n({type:y.pz,temporaryId:t,status:null==e||null===(r=e.response)||void 0===r?void 0:r.status})}}));(0,u.A)(p)||(n({type:y.pz,...p.data}),n((0,v.uK)()))},k=e=>t=>{t({type:y.QA,formData:e})},_=function(e,t,n){let{responsePromise:l,tempId:s}=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},c=arguments.length>4?arguments[4]:void 0,d=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{};return async(p,b)=>{const{PAT_HOST:x}=w(b);let{token:E,local:_,forms:A}=w(b);if(!E){if(!await p((0,m.mg)({shouldGreet:!1})))return;const{shouldOpenChat:e}=d;e&&(p((0,h.mN)()),p((0,h.lQ)({source:"programmatic"}))),({token:E,local:_,forms:A}=w(b))}const T=await p((0,f.z5)()),{headers:S}=(0,i.A)({token:E},{withCurrentUrl:!0,extra:T});A&&Object.values(A).forEach(e=>{if((null==e?void 0:e.formSubmitState)===o.KN.ACTIVE){const t={submission_id:e.formSubmissionId,context:e.formValue,state:o.KN.UNANSWERED};p((0,g.et)(`${x}/chatbubble/${a.Ak}/form/submit`,{method:"POST",body:t,headers:S})),p(k({...e,formSubmitState:o.KN.UNANSWERED}))}});const $=s||`tempId-${(0,r.A)()}`;p({type:y.tq,data:{id:$,created:(new Date).toISOString(),message:e,buttonType:c}}),p((0,g.TP)((new Date).toISOString()));const C={message:e,exchange_id:t,temporaryId:$,new_context:{..._.context,...n||{}}},O=l?await l:await p((0,g.et)(`${x}/chatbubble/${a.Ak}/message/`,{method:"POST",body:C,headers:S},{onError:e=>{var t,n;console.error(`/chatbubble/${a.Ak}/message returned ${null==e||null===(t=e.response)||void 0===t?void 0:t.status}`),p({type:y.pz,temporaryId:$,status:null==e||null===(n=e.response)||void 0===n?void 0:n.status}),p({type:y.wk})}}));(0,u.A)(O)||(p({type:y.pz,...O.data}),p((0,v.uK)()))}},A=e=>({...e,temporaryId:`tempId-${(0,r.A)()}`}),T=e=>{let{temporaryId:t}=e;return t},S=()=>async(e,t)=>{var n;const{bot:{id:o},chatbubble:{chatId:l,attachments:p},connection:{token:h},environment:{PAT_HOST:m}}=t(),b=await e((0,f.z5)()),{headers:v}=(0,i.A)({token:h},{extra:b}),w=`tempId-${(0,r.A)()}`,x=p.files.map(A).map((0,c.A)("file"));e({type:y.Os,data:{attachments:x}}),e({type:y.Q4}),e({type:y.tq,data:{id:w,created:(new Date).toISOString(),attachment_ids:x.map(T),message:""}}),e((0,g.TP)((new Date).toISOString()));const E=(t,n)=>{var r;e({type:y.pz,temporaryId:w,status:null==t||null===(r=t.response)||void 0===r?void 0:r.status}),n?e({type:y.wP,attachment:{...n,status:a.Le.ERROR}}):x.forEach(t=>e({type:y.wP,attachment:{...t,status:a.Le.ERROR}}))},k=x.map((0,c.A)("file","url")),_=`${m}/chatbubble/${a.Ak}/attachment/create`,S={attachments:k,temporaryChatMessageId:w},$=await e((0,g.et)(_,{method:"POST",body:S,headers:v},{onError:e=>E(e)}));if((0,u.A)($)||!Array.isArray(null==$||null===(n=$.data)||void 0===n?void 0:n.attachments))return;const[C,O]=$.data.attachments.reduce((t,n)=>{let[r,o]=t,{id:a,temporary_id:i,upload_url:l}=n;return e({type:y.wP,attachment:{temporaryId:i,id:a}}),[[...r,a],[...o,l]]},[[],[]]),I={"x-goog-upload-bot-id":o,"x-goog-upload-chat-id":l},L=(0,d.A)(p.files,O).map(async t=>{let[{file:n,...r},o]=t;const a=await(0,s.Bu)(n),i={...I,"Content-Type":n.type};return await e((0,g.et)(o,{method:"PUT",body:a,headers:i},{onError:e=>E(e,r)}))}),M=await Promise.all(L);if(M.some(e=>void 0===e))return;if(M.some(u.A))return;const N=`${m}/chatbubble/${a.Ak}/attachment/uploads-complete`,R={attachmentIds:C,temporaryChatMessageId:w,exchangeId:p.exchangeId};e((0,g.TP)((new Date).toISOString())),await e((0,g.et)(N,{method:"POST",body:R,headers:v},{onError:e=>E(e)}))},$=function(e){let{openChat:t,languageCode:n,tempId:o,responsePromise:l}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return async(s,c)=>{const{connection:{token:d},chatbubble:{currentLanguage:p},local:{context:f}}=c(),{PAT_HOST:b}=c().environment;if(!d){const r={triggerDialogueSlug:e,languageCode:n,openChat:t};return s((0,m.XO)(r)),s((0,h.mN)()),void(t&&s((0,h.lQ)({source:"programmatic"})))}if(n&&n!==p){const e="Tried to trigger a dialogue in another language on an existing chat";s((0,g.Rm)({message:e,level:"error",extra:{languageCode:n,currentLanguage:p}}))}const w=o||(0,r.A)();s({type:y.IM,data:{id:w,created:(new Date).toISOString(),exchangeId:e}}),s((0,g.TP)((new Date).toISOString()));const x={exchange_id:e,temporaryId:w,new_context:{...f}},{headers:E}=(0,i.A)({token:d},{withCurrentUrl:!0}),k=l?await l:await s((0,g.et)(`${b}/chatbubble/${a.Ak}/trigger/`,{method:"POST",body:x,headers:E}));k&&!(0,u.A)(k)&&(t&&s((0,h.lQ)({source:"programmatic"})),s((0,v.uK)()))}},C=(e,t)=>n=>{n({type:y.Y6,buttonClick:{chatMessageId:e.id,buttonId:t.id,time:(new Date).toISOString()}})},O=(e,t,n)=>async(r,o)=>{const{connection:{token:l},environment:{PAT_HOST:s,VERSION:c}}=o(),u=await r((0,f.z5)()),{headers:d}=(0,i.A)({token:l},{withCurrentUrl:!0,extra:u}),p={method:"POST",body:{button:t,chatMessage:e,temporaryId:n,version:c},headers:d};return r((0,g.et)(`${s}/chatbubble/${a.Ak}/button/click/`,p))},I=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];return async(i,l)=>{const{environment:{VERSION:s},messages:{chatMessages:c},chatbubble:{currentLanguage:u},local:d}=l(),f=(0,b.A)(e.button_type),m=`tempId-${(0,r.A)()}`,v={};o.length>0&&o.forEach(e=>{var r,o,l;e.button_type===a.lP.SLIDER.toLowerCase()&&null!==(r=e.slider_details)&&void 0!==r&&r.value?(v[null===(o=e.label)||void 0===o?void 0:o.toLowerCase()]=null===(l=e.slider_details)||void 0===l?void 0:l.value,i(C(i,t))):e.button_type===a.lP.CHECKBOX.toLowerCase()&&n.find(t=>t.id===e.id)?(v[e.value]=e.value,i(C(t,e)),i(O(t,e,m))):v[e.value]=""});const w=i(O(t,{...e,new_context:{...d.context,...v||{}}},m));switch(i({type:y.Y6,buttonClick:{chatMessageId:t.id,buttonId:e.id||e._id,time:(new Date).toISOString()}}),f){case a.lP.QUICK_REPLY:{const n={responsePromise:w,tempId:m};i(_(e.value,t.exchange_id,e.new_context,n,e.button_type));break}case a.lP.HANDOVER_REQUEST:if(!((e,t)=>!!t.find(t=>{let{buttons:n=[]}=t;return!!n.find(t=>{let{language_code:n,button_type:r}=t;return n===e&&(0,b.A)(r)===a.lP.HANDOVER_REQUEST})}))(u,c)){const e={version:s};i((0,g.Rm)({message:"Requested handover with no button",level:"error",extra:e}))}i((0,p.Du)(w));break;case a.lP.DIALOGUE_TRIGGER:i($(e.value,{tempId:m,responsePromise:w}));break;case a.lP.PRIVACY_EXPORT:i((0,h.VK)({responsePromise:w}));break;case a.lP.PRIVACY_DELETE:i((0,h._e)({responsePromise:w}));break;case a.lP.CONTACT_DETAILS:i((0,h.V$)(e));break;case a.lP.UPLOAD_ATTACHMENT:i((0,h.jz)(e))}}},L=(e,t)=>async(n,o)=>{const{connection:{token:l},environment:{PAT_HOST:s,VERSION:c}}=o(),d=`tempId-${(0,r.A)()}`,p=e.contact_details.contact_type,h={...e,button_type:a.lP.edit_contact_details};n({type:y.tq,data:{id:d,created:(new Date).toISOString(),message:t,buttons:[h],isContactDetails:!0}});const m=await n((0,f.z5)()),{headers:b}=(0,i.A)({token:l},{withCurrentUrl:!0,extra:m}),v={contactType:p,value:t,version:c,buttons:[h],temporaryId:d},w=await n((0,g.et)(`${s}/chatbubble/${a.Ak}/button/contact-details/`,{method:"POST",body:v,headers:b}));(0,u.A)(w)||n({type:y.pz,...w.data})},M=(0,l.A)(async(e,t,n)=>{let{id:r,index:o}=e;const{connection:{token:l},environment:{PAT_HOST:s,VERSION:c}}=n(),u=await t((0,f.z5)()),{headers:d}=(0,i.A)({token:l},{withCurrentUrl:!0,extra:u}),p={chatMessageId:r,version:c};t({type:y.kU,id:r,index:o}),t((0,g.et)(`${s}/chatbubble/${a.Ak}/message-seen`,{method:"PATCH",body:p,headers:d}))},1500,(e,t)=>{const[{index:n}]=e,[{index:r}]=t;return n>r?e:t}),N=(e,t)=>(n,r)=>M({id:e,index:t},n,r),R=e=>{let{url:t,messageId:n}=e;return async(e,r)=>{const{botKey:o}=r().chatbubble,{PAT_HOST:l}=r().environment,{token:s}=r().connection,c=await e((0,f.z5)());e((0,g.et)(`${l}/chatbubble/${a.Ak}/message/reference-click/${n}`,{method:"POST",body:{url:t},...(0,i.A)({botKey:o,token:s},{withCurrentUrl:!0,extra:c})}))}}},4713:(e,t,n)=>{"use strict";var r=n(1780),o=Function.prototype.call;e.exports=r?o.bind(o):function(){return o.apply(o,arguments)}},4851:(e,t,n)=>{"use strict";function r(e){let{token:t,botKey:n,jwt:r}=e,{withCurrentUrl:o,withVersion:a,extra:i}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return{headers:{...t?{"kindly-chatbubble-token":t}:{},...n?{"kindly-bot-key":n}:{},...r?{Authorization:`Bearer ${r}`}:{},...o?{"Current-Url":window.location.href}:{},...a?{"kindly-chat-version":"2.76.8"}:{},...i}}}n.d(t,{A:()=>r})},4871:e=>{"use strict";e.exports=!0},4904:(e,t,n)=>{"use strict";var r={};r[n(8655)("toStringTag")]="z",e.exports="[object z]"===String(r)},4927:(e,t,n)=>{"use strict";n.d(t,{$n:()=>p,A0:()=>f,Bi:()=>c,D7:()=>b,N_:()=>u,hF:()=>g,k5:()=>d});var r=n(3864),o=n(6538),a=n(2628),i=n(534),l=n(492),s=n(8905);const c=r.Ay.button`
974
+ `,v=function(e){let{from:t,to:n,value:i=1,affix:l,affixValue:s,step:c=1,onChange:m,name:g,field:v,ariaLabel:y,validators:w,hasController:x}=e;const E=(0,r.useMemo)(()=>{var e;const n=parseFloat(t);return Number.isNaN(n)?null==w||null===(e=w.find(e=>void 0!==e.min&&null!==e.min))||void 0===e?void 0:e.min:n},[t,w]),k=(0,r.useMemo)(()=>{var e;const t=parseFloat(n);return Number.isNaN(t)?null==w||null===(e=w.find(e=>void 0!==e.max&&null!==e.max))||void 0===e?void 0:e.max:t},[n,w]),[_,A]=(0,r.useState)(((e,t,n)=>t<e?e+n:t)(c,i,E));return o().createElement(u,{$isForm:!!x},o().createElement(p,{$isForm:!!x},l===a.rc.PREFIX&&o().createElement(d,null,s),o().createElement(f,null,_),l===a.rc.SUFFIX&&o().createElement(d,null,s)),o().createElement(h,null,o().createElement(b,{type:"range",name:g,step:c,min:E,max:k,value:_,onChange:e=>{var t;null!=e&&null!==(t=e.target)&&void 0!==t&&t.value&&(m&&m(e.target.value),null!=v&&v.onChange&&v.onChange(e),A(e.target.value))},"aria-label":y})))}},4047:(e,t,n)=>{"use strict";var r=n(9155),o="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},a=r.useSyncExternalStore,i=r.useRef,l=r.useEffect,s=r.useMemo,c=r.useDebugValue;t.useSyncExternalStoreWithSelector=function(e,t,n,r,u){var d=i(null);if(null===d.current){var p={hasValue:!1,value:null};d.current=p}else p=d.current;d=s(function(){function e(e){if(!l){if(l=!0,a=e,e=r(e),void 0!==u&&p.hasValue){var t=p.value;if(u(t,e))return i=t}return i=e}if(t=i,o(a,e))return t;var n=r(e);return void 0!==u&&u(t,n)?(a=e,t):(a=e,i=n)}var a,i,l=!1,s=void 0===n?null:n;return[function(){return e(t())},null===s?void 0:function(){return e(s())}]},[t,n,r,u]);var f=a(e,d[0],d[1]);return l(function(){p.hasValue=!0,p.value=f},[f]),c(f),f}},4142:(e,t,n)=>{"use strict";n.d(t,{S:()=>l});var r=n(7251),o=n(2221),a=n(1872),i=n(4851);const l=(0,r.zD)("feedback/sendToPat",async(e,t)=>{let{getState:n,dispatch:r,rejectWithValue:l}=t;const{connection:{token:s},environment:{PAT_HOST:c}}=n();try{const t=await r((0,a.et)(`${c}/chatbubble/${o.Ak}/feedback`,{method:"POST",body:{feedback:e},...(0,i.A)({token:s})}));if(!t.ok)throw new Error(`Feedback submission failed with status: ${t.status}`);return t.data.data.id}catch(e){return l(e.message)}})},4240:(e,t,n)=>{"use strict";var r=n(8655)("match");e.exports=function(e){var t=/./;try{"/./"[e](t)}catch(n){try{return t[r]=!1,"/./"[e](t)}catch(e){}}return!1}},4311:(e,t,n)=>{"use strict";n.d(t,{A:()=>s});var r=n(9155),o=n(541),a=n(1695),i=n(9337),l=n(1328);function s(){const{text:e}=(0,o.d4)(a.Od),{currentLanguageCode:t}=(0,l.A)();return(0,r.useMemo)(()=>(0,i.A)(e,t),[t,e])}},4317:(e,t,n)=>{"use strict";var r=n(6100);e.exports=r({}.isPrototypeOf)},4399:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return e?n(e)?e.length?"array":"void":typeof e:"void"};var n=Array.isArray||(Array.isArray=function(e){return""+e!==e&&"[object Array]"==={}.toString.call(e)});e.exports=t.default},4490:(e,t,n)=>{"use strict";function r(e,t){return"number"!=typeof(null==e?void 0:e.length)||e.length!==(null==t?void 0:t.length)?(console.error("Trying to zip non-array of arrays of unequal length"),[]):e.map((e,n)=>[e,t[n]])}n.d(t,{A:()=>r})},4499:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});const r=(e,t,n)=>{var r;return null!==(r=t.split(".").reduce((e,t)=>e?e[t]:void 0,e))&&void 0!==r?r:n}},4517:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){var n={};return t.forEach(function(t){var r=e[t];r&&(n[t]=r)}),n},e.exports=t.default},4543:(e,t,n)=>{"use strict";var r=n(5024),o=n(4713),a=n(7161),i=n(480),l=n(3273),s=n(5341),c=n(701),u=n(9665),d=Object.getOwnPropertyDescriptor;t.f=r?d:function(e,t){if(e=l(e),t=s(t),u)try{return d(e,t)}catch(e){}if(c(e,t))return i(!o(a.f,e,t),e[t])}},4572:(e,t,n)=>{"use strict";var r=n(9344),o=n(814),a=n(1780),i=r(r.bind);e.exports=function(e,t){return o(e),void 0===t?e:a?i(e,t):function(){return e.apply(t,arguments)}}},4574:(e,t,n)=>{"use strict";var r=n(9903),o=Math.max,a=Math.min;e.exports=function(e,t){var n=r(e);return n<0?o(n+t,0):a(n,t)}},4603:(e,t,n)=>{"use strict";var r=n(5547),o=n(1203),a=n(8900).String;e.exports=!!Object.getOwnPropertySymbols&&!o(function(){var e=Symbol("symbol detection");return!a(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&r&&r<41})},4674:(e,t,n)=>{"use strict";var r=n(814),o=n(3057);e.exports=function(e,t){var n=e[t];return o(n)?void 0:r(n)}},4703:(e,t,n)=>{"use strict";n.d(t,{Bd:()=>I,Bu:()=>k,Zn:()=>S,aP:()=>x,j3:()=>L,pA:()=>N,qJ:()=>R,tM:()=>E,y2:()=>_,zh:()=>$});var r=n(5279),o=n(9272),a=n(2221),i=n(4851),l=n(7958),s=n(3699),c=n(1318),u=n(5173),d=n(4490),p=n(1112),f=n(5564),h=n(8628),m=n(8483),g=n(7243),b=n(7811),v=n(6079),y=n(7173);const w=e=>{const{PAT_HOST:t}=e().environment,{local:n,chatbubble:{botKey:r},connection:{token:o},messages:{forms:a}}=e();return{token:o,PAT_HOST:t,botKey:r,local:n,forms:a}},x=(e,t,n)=>(r,o)=>{const{botKey:a}=w(o);r((0,g.zX)(a,!0)),localStorage.setItem("kindly-chat-restart-message",JSON.stringify({message:e,exchangeId:t,newContext:n}))},E=(e,t)=>async(n,r)=>{const{PAT_HOST:o,token:l}=w(r),s=await n((0,f.z5)()),{headers:c}=(0,i.A)({token:l},{withCurrentUrl:!0,extra:s}),d={message:e,temporaryId:t},p=await n((0,g.et)(`${o}/chatbubble/${a.Ak}/message/`,{method:"POST",body:d,headers:c},{onError:e=>{var r;n({type:y.pz,temporaryId:t,status:null==e||null===(r=e.response)||void 0===r?void 0:r.status})}}));(0,u.A)(p)||(n({type:y.pz,...p.data}),n((0,v.uK)()))},k=e=>t=>{t({type:y.QA,formData:e})},_=function(e,t,n){let{responsePromise:l,tempId:s}=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},c=arguments.length>4?arguments[4]:void 0,d=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{};return async(p,b)=>{const{PAT_HOST:x}=w(b);let{token:E,local:_,forms:A}=w(b);if(!E){if(!await p((0,m.mg)({shouldGreet:!1})))return;const{shouldOpenChat:e}=d;e&&(p((0,h.mN)()),p((0,h.lQ)({source:"programmatic"}))),({token:E,local:_,forms:A}=w(b))}const T=await p((0,f.z5)()),{headers:S}=(0,i.A)({token:E},{withCurrentUrl:!0,extra:T});A&&Object.values(A).forEach(e=>{if((null==e?void 0:e.formSubmitState)===o.KN.ACTIVE){const t={submission_id:e.formSubmissionId,context:e.formValue,state:o.KN.UNANSWERED};p((0,g.et)(`${x}/chatbubble/${a.Ak}/form/submit`,{method:"POST",body:t,headers:S})),p(k({...e,formSubmitState:o.KN.UNANSWERED}))}});const $=s||`tempId-${(0,r.A)()}`;p({type:y.tq,data:{id:$,created:(new Date).toISOString(),message:e,buttonType:c}}),p((0,g.TP)((new Date).toISOString()));const C={message:e,exchange_id:t,temporaryId:$,new_context:{..._.context,...n||{}}},O=l?await l:await p((0,g.et)(`${x}/chatbubble/${a.Ak}/message/`,{method:"POST",body:C,headers:S},{onError:e=>{var t,n;console.error(`/chatbubble/${a.Ak}/message returned ${null==e||null===(t=e.response)||void 0===t?void 0:t.status}`),p({type:y.pz,temporaryId:$,status:null==e||null===(n=e.response)||void 0===n?void 0:n.status}),p({type:y.wk})}}));(0,u.A)(O)||(p({type:y.pz,...O.data}),p((0,v.uK)()))}},A=e=>({...e,temporaryId:`tempId-${(0,r.A)()}`}),T=e=>{let{temporaryId:t}=e;return t},S=()=>async(e,t)=>{var n;const{bot:{id:o},chatbubble:{chatId:l,attachments:p},connection:{token:h},environment:{PAT_HOST:m}}=t(),b=await e((0,f.z5)()),{headers:v}=(0,i.A)({token:h},{extra:b}),w=`tempId-${(0,r.A)()}`,x=p.files.map(A).map((0,c.A)("file"));e({type:y.Os,data:{attachments:x}}),e({type:y.Q4}),e({type:y.tq,data:{id:w,created:(new Date).toISOString(),attachment_ids:x.map(T),message:""}}),e((0,g.TP)((new Date).toISOString()));const E=(t,n)=>{var r;e({type:y.pz,temporaryId:w,status:null==t||null===(r=t.response)||void 0===r?void 0:r.status}),n?e({type:y.wP,attachment:{...n,status:a.Le.ERROR}}):x.forEach(t=>e({type:y.wP,attachment:{...t,status:a.Le.ERROR}}))},k=x.map((0,c.A)("file","url")),_=`${m}/chatbubble/${a.Ak}/attachment/create`,S={attachments:k,temporaryChatMessageId:w},$=await e((0,g.et)(_,{method:"POST",body:S,headers:v},{onError:e=>E(e)}));if((0,u.A)($)||!Array.isArray(null==$||null===(n=$.data)||void 0===n?void 0:n.attachments))return;const[C,O]=$.data.attachments.reduce((t,n)=>{let[r,o]=t,{id:a,temporary_id:i,upload_url:l}=n;return e({type:y.wP,attachment:{temporaryId:i,id:a}}),[[...r,a],[...o,l]]},[[],[]]),I={"x-goog-upload-bot-id":o,"x-goog-upload-chat-id":l},L=(0,d.A)(p.files,O).map(async t=>{let[{file:n,...r},o]=t;const a=await(0,s.Bu)(n),i={...I,"Content-Type":n.type};return await e((0,g.et)(o,{method:"PUT",body:a,headers:i},{onError:e=>E(e,r)}))}),M=await Promise.all(L);if(M.some(e=>void 0===e))return;if(M.some(u.A))return;const N=`${m}/chatbubble/${a.Ak}/attachment/uploads-complete`,R={attachmentIds:C,temporaryChatMessageId:w,exchangeId:p.exchangeId};e((0,g.TP)((new Date).toISOString())),await e((0,g.et)(N,{method:"POST",body:R,headers:v},{onError:e=>E(e)}))},$=function(e){let{openChat:t,languageCode:n,tempId:o,responsePromise:l}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return async(s,c)=>{const{connection:{token:d},chatbubble:{currentLanguage:p},local:{context:f}}=c(),{PAT_HOST:b}=c().environment;if(!d){const r={triggerDialogueSlug:e,languageCode:n,openChat:t};return s((0,m.XO)(r)),s((0,h.mN)()),void(t&&s((0,h.lQ)({source:"programmatic"})))}if(n&&n!==p){const e="Tried to trigger a dialogue in another language on an existing chat";s((0,g.Rm)({message:e,level:"error",extra:{languageCode:n,currentLanguage:p}}))}const w=o||(0,r.A)();s({type:y.IM,data:{id:w,created:(new Date).toISOString(),exchangeId:e}}),s((0,g.TP)((new Date).toISOString()));const x={exchange_id:e,temporaryId:w,new_context:{...f}},{headers:E}=(0,i.A)({token:d},{withCurrentUrl:!0}),k=l?await l:await s((0,g.et)(`${b}/chatbubble/${a.Ak}/trigger/`,{method:"POST",body:x,headers:E}));k&&!(0,u.A)(k)&&(t&&s((0,h.lQ)({source:"programmatic"})),s((0,v.uK)()))}},C=(e,t)=>n=>{n({type:y.Y6,buttonClick:{chatMessageId:e.id,buttonId:t.id,time:(new Date).toISOString()}})},O=(e,t,n)=>async(r,o)=>{const{connection:{token:l},environment:{PAT_HOST:s,VERSION:c}}=o(),u=await r((0,f.z5)()),{headers:d}=(0,i.A)({token:l},{withCurrentUrl:!0,extra:u}),p={method:"POST",body:{button:t,chatMessage:e,temporaryId:n,version:c},headers:d};return r((0,g.et)(`${s}/chatbubble/${a.Ak}/button/click/`,p))},I=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];return async(i,l)=>{const{environment:{VERSION:s},messages:{chatMessages:c},chatbubble:{currentLanguage:u},local:d}=l(),f=(0,b.A)(e.button_type),m=`tempId-${(0,r.A)()}`,v={};o.length>0&&o.forEach(e=>{var r,o,l;e.button_type===a.lP.SLIDER.toLowerCase()&&null!==(r=e.slider_details)&&void 0!==r&&r.value?(v[null===(o=e.label)||void 0===o?void 0:o.toLowerCase()]=null===(l=e.slider_details)||void 0===l?void 0:l.value,i(C(i,t))):e.button_type===a.lP.CHECKBOX.toLowerCase()&&n.find(t=>t.id===e.id)?(v[e.value]=e.value,i(C(t,e)),i(O(t,e,m))):v[e.value]=""});const w=i(O(t,{...e,new_context:{...d.context,...v||{}}},m));switch(i({type:y.Y6,buttonClick:{chatMessageId:t.id,buttonId:e.id||e._id,time:(new Date).toISOString()}}),f){case a.lP.QUICK_REPLY:{const n={responsePromise:w,tempId:m};i(_(e.value,t.exchange_id,e.new_context,n,e.button_type));break}case a.lP.HANDOVER_REQUEST:if(!((e,t)=>!!t.find(t=>{let{buttons:n=[]}=t;return!!n.find(t=>{let{language_code:n,button_type:r}=t;return n===e&&(0,b.A)(r)===a.lP.HANDOVER_REQUEST})}))(u,c)){const e={version:s};i((0,g.Rm)({message:"Requested handover with no button",level:"error",extra:e}))}i((0,p.Du)(w));break;case a.lP.DIALOGUE_TRIGGER:i($(e.value,{tempId:m,responsePromise:w}));break;case a.lP.PRIVACY_EXPORT:i((0,h.VK)({responsePromise:w}));break;case a.lP.PRIVACY_DELETE:i((0,h._e)({responsePromise:w}));break;case a.lP.CONTACT_DETAILS:i((0,h.V$)(e));break;case a.lP.UPLOAD_ATTACHMENT:i((0,h.jz)(e))}}},L=(e,t)=>async(n,o)=>{const{connection:{token:l},environment:{PAT_HOST:s,VERSION:c}}=o(),d=`tempId-${(0,r.A)()}`,p=e.contact_details.contact_type,h={...e,button_type:a.lP.edit_contact_details};n({type:y.tq,data:{id:d,created:(new Date).toISOString(),message:t,buttons:[h],isContactDetails:!0}});const m=await n((0,f.z5)()),{headers:b}=(0,i.A)({token:l},{withCurrentUrl:!0,extra:m}),v={contactType:p,value:t,version:c,buttons:[h],temporaryId:d},w=await n((0,g.et)(`${s}/chatbubble/${a.Ak}/button/contact-details/`,{method:"POST",body:v,headers:b}));(0,u.A)(w)||n({type:y.pz,...w.data})},M=(0,l.A)(async(e,t,n)=>{let{id:r,index:o}=e;const{connection:{token:l},environment:{PAT_HOST:s,VERSION:c}}=n(),u=await t((0,f.z5)()),{headers:d}=(0,i.A)({token:l},{withCurrentUrl:!0,extra:u}),p={chatMessageId:r,version:c};t({type:y.kU,id:r,index:o}),t((0,g.et)(`${s}/chatbubble/${a.Ak}/message-seen`,{method:"PATCH",body:p,headers:d}))},1500,(e,t)=>{const[{index:n}]=e,[{index:r}]=t;return n>r?e:t}),N=(e,t)=>(n,r)=>M({id:e,index:t},n,r),R=e=>{let{url:t,messageId:n}=e;return async(e,r)=>{const{botKey:o}=r().chatbubble,{PAT_HOST:l}=r().environment,{token:s}=r().connection,c=await e((0,f.z5)());e((0,g.et)(`${l}/chatbubble/${a.Ak}/message/reference-click/${n}`,{method:"POST",body:{url:t},...(0,i.A)({botKey:o,token:s},{withCurrentUrl:!0,extra:c})}))}}},4713:(e,t,n)=>{"use strict";var r=n(1780),o=Function.prototype.call;e.exports=r?o.bind(o):function(){return o.apply(o,arguments)}},4851:(e,t,n)=>{"use strict";function r(e){let{token:t,botKey:n,jwt:r}=e,{withCurrentUrl:o,withVersion:a,extra:i}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return{headers:{...t?{"kindly-chatbubble-token":t}:{},...n?{"kindly-bot-key":n}:{},...r?{Authorization:`Bearer ${r}`}:{},...o?{"Current-Url":window.location.href}:{},...a?{"kindly-chat-version":"2.76.11"}:{},...i}}}n.d(t,{A:()=>r})},4871:e=>{"use strict";e.exports=!0},4904:(e,t,n)=>{"use strict";var r={};r[n(8655)("toStringTag")]="z",e.exports="[object z]"===String(r)},4927:(e,t,n)=>{"use strict";n.d(t,{$n:()=>p,A0:()=>f,Bi:()=>c,D7:()=>b,N_:()=>u,hF:()=>g,k5:()=>d});var r=n(3864),o=n(6538),a=n(2628),i=n(534),l=n(492),s=n(8905);const c=r.Ay.button`
975
975
  all: unset;
976
976
  cursor: pointer;
977
977
  /* stylelint-disable-next-line plugin/no-unsupported-browser-features */
@@ -1166,7 +1166,7 @@
1166
1166
  &:nth-of-type(3) {
1167
1167
  animation: 1s ${i.Zm} infinite 0.9s;
1168
1168
  }
1169
- `;function c(e){let{loading:t=!1,isCheckbox:n=!1,flat:r,minHeight:a}=e;return o().createElement(l,{$minHeight:a,$flat:r,$isCheckbox:n,$loading:t},o().createElement(s,null),o().createElement(s,null),o().createElement(s,null))}},5546:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e};function o(e){return e&&e.__esModule?e:{default:e}}t.default=function(e,t){var n=r({key:"redux",merge:i.default,slicer:a.default,serialize:JSON.stringify,deserialize:JSON.parse},t),o=n.key,l=n.merge,s=n.slicer,c=n.serialize,u=n.deserialize;return function(t){return function(n,r,a){"function"==typeof r&&void 0===a&&(a=r,r=void 0);var i=void 0,d=void 0;try{i=u(localStorage.getItem(o)),d=l(r,i)}catch(e){console.warn("Failed to retrieve initialize state from localStorage:",e)}var p=t(n,d,a),f=s(e);return p.subscribe(function(){var e=p.getState(),t=f(e);try{localStorage.setItem(o,c(t))}catch(e){console.warn("Unable to persist state to localStorage:",e)}}),p}}};var a=o(n(8639)),i=o(n(7487));e.exports=t.default},5547:(e,t,n)=>{"use strict";var r,o,a=n(8900),i=n(3531),l=a.process,s=a.Deno,c=l&&l.versions||s&&s.version,u=c&&c.v8;u&&(o=(r=u.split("."))[0]>0&&r[0]<4?1:+(r[0]+r[1])),!o&&i&&(!(r=i.match(/Edge\/(\d+)/))||r[1]>=74)&&(r=i.match(/Chrome\/(\d+)/))&&(o=+r[1]),e.exports=o},5564:(e,t,n)=>{"use strict";n.d(t,{$u:()=>d,z5:()=>p,gm:()=>u,JL:()=>c});var r=n(2221),o=n(4851);var a=n(7243),i=n(7173);const l=()=>({type:i.zZ});let s=null;const c=()=>async(e,t)=>{if(!s)return;const{connection:{token:n},environment:{PAT_HOST:l}}=t(),{headers:c}=(0,o.A)({token:n},{withCurrentUrl:!0}),{data:u,status:d}=await e((0,a.et)(`${l}/chatbubble/${r.Ak}/auth/identify`,{method:"POST",headers:c,body:s}));200===d&&e({type:i.qQ,...u})},u=e=>async(t,n)=>{s=e;const{connection:{token:r}}=n();r&&t(c())},d=()=>async(e,t)=>{const{chatbubble:{chatId:n},connection:{token:s},environment:{PAT_HOST:c}}=t(),{getAuthToken:u}=window.__KINDLY_SETTINGS__;if(!n||!u)return void e(l());let d;try{d=await u(n)}catch(e){console.error("Chatbubble auth failed:",e),d=null}if(!d)return void e(l());const{headers:p}=(0,o.A)({jwt:d,token:s},{withCurrentUrl:!0}),f=await e((0,a.et)(`${c}/chatbubble/${r.Ak}/auth/chat`,{method:"POST",headers:p},{onError:()=>e(l())}));null!=f&&f.data&&e({type:i.K_,token:d,avatarUrl:f.data.avatar_url,fullName:f.data.full_name})},p=()=>async(e,t)=>{const{auth:{isAuthenticated:n,isRefreshing:r,token:o}}=t();if(!n)return null;if(r)return await new Promise(e=>{setTimeout(e,200)}),p()(e,t);const{getAuthToken:a}=window.__KINDLY_SETTINGS__;a&&function(e){const t=function(e){if(!e)return null;const t=e.match(/^[A-Za-z0-9-_=]+\.([A-Za-z0-9-_=]+)\.?[A-Za-z0-9-_.+/=]*$/);if(!t)return null;try{return JSON.parse(window.atob(t[1]))}catch(e){return null}}(e);return!t||t.exp-Math.floor((new Date).getTime()/1e3)<30}(o)&&(e({type:i.Rk}),await e(d()),e({type:i.dp}));const{auth:l}=t();return l.isAuthenticated?{Authorization:`Bearer ${l.token}`}:null}},5644:(e,t,n)=>{"use strict";var r=n(1949),o=n.n(r),a=n(2221),i=n(3211);o().shape({button_type:o().oneOf([...Object.values(a.lP),...Object.values(a.lP).map(i.A)]).isRequired,is_active:o().bool,label:o().string.isRequired,value:o().string,new_context:o().object,index:o().number,language_code:o().string,open_in_new_tab:o().bool})},5767:(e,t,n)=>{"use strict";n.d(t,{ot:()=>A,n_:()=>x,Ay:()=>T,WG:()=>y,CJ:()=>b,GY:()=>k,wm:()=>w,zp:()=>_,m9:()=>E});var r=n(9749),o=n.n(r);var a=e=>Array.isArray(e)?e:[e];Symbol(),Object.getPrototypeOf({});var i="undefined"!=typeof WeakRef?WeakRef:class{constructor(e){this.value=e}deref(){return this.value}};function l(){return{s:0,v:void 0,o:null,p:null}}function s(e,t={}){let n={s:0,v:void 0,o:null,p:null};const{resultEqualityCheck:r}=t;let o,a=0;function s(){let t=n;const{length:s}=arguments;for(let e=0,n=s;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=l(),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=l(),e.set(n,t)):t=r}}const c=t;let u;if(1===t.s)u=t.v;else if(u=e.apply(null,arguments),a++,r){const e=o?.deref?.()??o;null!=e&&r(e,u)&&(u=e,0!==a&&a--),o="object"==typeof u&&null!==u||"function"==typeof u?new i(u):u}return c.s=1,c.v=u,u}return s.clearCache=()=>{n={s:0,v:void 0,o:null,p:null},s.resetResultsCount()},s.resultsCount=()=>a,s.resetResultsCount=()=>{a=0},s}function c(e,...t){const n="function"==typeof e?{memoize:e,memoizeOptions:t}:e,r=(...e)=>{let t,r=0,o=0,i={},l=e.pop();"object"==typeof l&&(i=l,l=e.pop()),function(e,t="expected a function, instead received "+typeof e){if("function"!=typeof e)throw new TypeError(t)}(l,`createSelector expects an output function after the inputs, but received: [${typeof l}]`);const c={...n,...i},{memoize:u,memoizeOptions:d=[],argsMemoize:p=s,argsMemoizeOptions:f=[],devModeChecks:h={}}=c,m=a(d),g=a(f),b=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),v=u(function(){return r++,l.apply(null,arguments)},...m),y=p(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}(b,arguments);return t=v.apply(null,e),t},...g);return Object.assign(y,{resultFunc:l,memoizedResultFunc:v,dependencies:b,dependencyRecomputations:()=>o,resetDependencyRecomputations:()=>{o=0},lastResult:()=>t,recomputations:()=>r,resetRecomputations:()=>{r=0},memoize:u,argsMemoize:p})};return Object.assign(r,{withTypes:()=>r}),r}var u=c(s),d=Object.assign((e,t=u)=>{!function(e,t="expected an object, instead received "+typeof e){if("object"!=typeof e)throw new TypeError(t)}(e,"createStructuredSelector expects first argument to be an object where each property is a selector, instead received a "+typeof e);const n=Object.keys(e);return t(n.map(t=>e[t]),(...e)=>e.reduce((e,t,r)=>(e[n[r]]=t,e),{}))},{withTypes:()=>d}),p=n(7251),f=n(3313),h=n(7523),m=n(4142);const g={feedbacksAlreadyDisplayed:[],feedbackToSubmit:null},b=u([e=>e.feedback.feedbacksAlreadyDisplayed,e=>e.feedback.feedbackToSubmit],(e,t)=>({feedbacksAlreadyDisplayed:e,feedbackToSubmit:t})),v=(0,p.Z0)({name:"feedback",initialState:g,reducers:{initializeFeedback:(e,t)=>{var n;e.feedbackToSubmit={id:null,rating_system:t.payload.ratingSystem,trigger_type:t.payload.triggerType,form_title:t.payload.formTitle,currentStep:t.payload.step,index:null,rating:null,sentiment:null,buttons_chosen:[],freeform_text:null},o()(n=e.feedbacksAlreadyDisplayed).call(n,t.payload.triggerType)||e.feedbacksAlreadyDisplayed.push(t.payload.triggerType)},setRating:(e,t)=>{e.feedbackToSubmit&&(e.feedbackToSubmit.index=t.payload.index,e.feedbackToSubmit.rating=t.payload.rating,e.feedbackToSubmit.sentiment=t.payload.sentiment)},clearRating:e=>{e.feedbackToSubmit&&(e.feedbackToSubmit.index=null,e.feedbackToSubmit.rating=null,e.feedbackToSubmit.sentiment=null)},toggleCommentButton:(e,t)=>{if(!e.feedbackToSubmit)return;const{buttons_chosen:n}=e.feedbackToSubmit;o()(n).call(n,t.payload)?e.feedbackToSubmit.buttons_chosen=n.filter(e=>e!==t.payload):n.push(t.payload)},setFreeformText:(e,t)=>{e.feedbackToSubmit&&(e.feedbackToSubmit.freeform_text=t.payload)},setStep:(e,t)=>{e.feedbackToSubmit&&(e.feedbackToSubmit.currentStep=t.payload)},clearFeedbackToSubmit:e=>{e.feedbackToSubmit=null}},extraReducers:e=>{e.addCase(m.S.fulfilled,(e,t)=>{e.feedbackToSubmit&&(e.feedbackToSubmit.id=t.payload)}),e.addCase(m.S.rejected,e=>{e.feedbackToSubmit=null}),e.addMatcher(e=>{var t;return o()(t=[f.CB,h.ny]).call(t,e.type)},()=>g)}}),{initializeFeedback:y,setRating:w,clearRating:x,toggleCommentButton:E,setFreeformText:k,setStep:_,clearFeedbackToSubmit:A}=v.actions,T=v.reducer},5777: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)}},5814:(e,t,n)=>{"use strict";n.d(t,{Bq:()=>u,G8:()=>s,NR:()=>c});var r=n(9749),o=n.n(r),a=n(5013),i=n(9272);const l={maximum:"max",minimum:"min"},s=e=>{const t={},n=e.map(e=>{const t=Object.keys(e);for(let n=0;n<t.length;n+=1){const r=t[n];if(r&&l[r]){const t=Object.getOwnPropertyDescriptor(e,r);if(t){const n=Object.defineProperty(e,l[r],t);return delete n[r],n}}}return e});for(let e=0;e<n.length;e+=1){var r;const l=Object.keys(n[e]),s=null===(r=n[e].texts)||void 0===r?void 0:r.text;l.forEach(r=>{var l;o()(l=Object.values(i.ZF)).call(l,r)&&(t[(0,a.A)(r)]={value:n[e][r],...s&&{message:s}})})}return t},c=e=>{if("object"!=typeof e)return{};const t={};return Object.entries(e).forEach(e=>{let[n,r]=e;r&&"object"==typeof r&&"value"in r&&!("text"in r)&&(t[n]=r.value)}),t},u=e=>{const t=[...e.validators||[]];return e.required&&t.push({required:e.required,text:e.texts.required_text}),t}},5919:(e,t,n)=>{"use strict";e.exports=n(4047)},5947:(e,t,n)=>{"use strict";var r=n(7752),o=TypeError;e.exports=function(e){if(r(e))throw new o("The method doesn't accept regular expressions");return e}},5960:(e,t,n)=>{"use strict";n.d(t,{Ay:()=>ye,jL:()=>we,GV:()=>xe});var r={};n.r(r),n.d(r,{agent:()=>I,alerts:()=>M,announcement:()=>R,auth:()=>D,bot:()=>h.Ay,connection:()=>F,environment:()=>b,inChatNotification:()=>H,inspector:()=>V,local:()=>q,messages:()=>ae,nudge:()=>le,pushMessages:()=>ue});var o=n(7251),a=n(541),i=n(5546),l=n.n(i);const s=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(){return t.reverse().slice(1).reduce((e,t)=>t(e),t[0](...arguments))}};var c=n(6249);function u(e,t,n){return(0,c.A)(e,function(e,t){return e.split(".").reverse().reduce((e,n,r)=>0===r?{[n]:t}:{[n]:e},{})}(t,n))}var d=n(4499),p=n(2628),f=n(2221),h=n(9100),m=n(7173);const g={PAT_HOST:"https://bot.kindly.ai",PUSHER_KEY:"0d15baa2a7308d71e79d",STATUS_PAGE:"https://status.kindly.ai",KINDLY_CHAT_URL:"http://localhost:8081",SAGE_HOST:"https://sage.kindly.ai",SETTINGS_HOST:"https://chat.kindlycdn.com",VERSION:"dev"},b=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:g,t=arguments.length>1?arguments[1]:void 0;return t.type===m.$o?{...e,...t.env}:e};var v=n(4142);const y={active:!1,allGreetingsHideInput:!1,attachments:{exchangeId:null,buttonClicked:null,files:[]},botKey:null,chatHasStarted:!1,chatId:null,contactDetailsButton:null,currentLanguage:"en",currentlyPoppedUp:!1,error:null,globalIconsState:{seenDelayedPages:[],open:!0},hideInputField:!1,inPlatform:!1,isChatFullWindow:!1,currentModal:null,overlayViews:[],previouslyPoppedUp:!1,renderedBy:"REACT",shownNudges:[],startedAt:null,uploadButtonWasClicked:null,userIsIdle:!1},w=(0,o.Z0)({name:"chatBubble",initialState:y,reducers:{},extraReducers:e=>e.addCase(m.tr,(e,t)=>{e.error=t.payload.error}).addCase(m.M2,(e,t)=>{e.currentLanguage=t.payload.code}).addCase(m.CB,(e,t)=>{e.botKey=t.payload.botKey||e.botKey,e.chatId=y.chatId,e.error=y.error,e.currentModal=y.currentModal,e.overlayViews=y.overlayViews,e.hideInputField=y.hideInputField,e.userIsIdle=y.userIsIdle}).addCase(m.ny,(e,t)=>{e.chatId=t.payload.chatId,e.allGreetingsHideInput=t.payload.allGreetingsHideInput,e.currentModal=y.currentModal,e.overlayViews=y.overlayViews}).addCase(m.d$,(e,t)=>{e.chatHasStarted=t.payload.chatHasStarted,e.userIsIdle=!t.payload.chatHasStarted&&e.userIsIdle}).addCase(m.tq,(e,t)=>{const n=e.hideInputField&&"USER"===t.payload.data.sender;e.chatHasStarted=!0,e.hideInputField=!!n||t.payload.data.chatbubble_hide_input_field}).addCase(m.kA,e=>{e.active=!0,e.userIsIdle=!1}).addCase(m.uS,e=>{e.active=!1}).addCase(m.hn,e=>{e.previouslyPoppedUp=!0,e.currentlyPoppedUp=!0}).addCase(m.IM,e=>e).addCase(m.nm,(e,t)=>{e.startedAt=t.payload.startedAt}).addCase(m.HW,(e,t)=>{e.userIsIdle=t.payload.userIsIdle}).addCase(m.Eg,(e,t)=>{e.contactDetailsButton=t.payload.button}).addCase(m.t1,e=>{e.contactDetailsButton=null}).addCase(m.wX,(e,t)=>{e.shownNudges=(e.shownNudges||[]).concat(t.payload.slug)}).addCase(m.FZ,(e,t)=>{e.attachments.buttonClicked=(+new Date).toString(),e.attachments.exchangeId=t.payload.button.value}).addCase(m.TF,(e,t)=>{e.attachments.files=t.payload.files}).addCase(m.Q4,e=>{e.attachments.exchangeId=null,e.attachments.buttonClicked=null,e.attachments.files=[]}).addCase(m.YR,e=>{e.attachments.buttonClicked=null}).addCase(m.Kd,(e,t)=>{e.shownNudges=(e.shownNudges||[]).filter(e=>e!==t.payload.slug)}).addCase(m.uA,(e,t)=>{e.globalIconsState={...e.globalIconsState,...t.payload.state}}).addCase(m.Xu,(e,t)=>{e.currentModal=t.payload.currentModal}).addCase(m.XM,(e,t)=>{e.isChatFullWindow=t.payload.isChatFullWindow}).addCase(m.wM,(e,t)=>{e.overlayViews=[...e.overlayViews,t.payload.view]}).addCase(m.SO,e=>{e.overlayViews=[]}).addCase(m.nX,e=>{e.overlayViews=e.overlayViews.slice(0,-1)}).addCase(v.S.rejected,e=>{e.currentModal=null,e.overlayViews=e.overlayViews.filter(e=>"FEEDBACK"!==e)})}).reducer,x=(e,t)=>{var n;return{...h.ue,id:e.id,name:e.name,avatar:e.avatar,botName:e.name,botAvatar:e.avatar,chatbubbleTextEnabled:e.use_chatbubble_text,includeDisabledLanguages:e.includeDisabledLanguages,startOverText:e.start_over_text,welcomePage:e.welcomePage,welcomePageType:t?f.Lb.NONE:e.welcomePage.type,maintenanceAlert:e.maintenance_alert,maintenanceAlertEnabled:!t&&((null===(n=e.maintenance_alert)||void 0===n?void 0:n.alert_enabled)||!1),pushGreetingsEnabled:!t&&e.use_push_greetings,pushGreetings:e.push_greetings,tabNotification:e.tab_notification,bubbleNotification:e.bubble_notification,typingIndicator:e.typing_indicator,typingDuration:e.typing_duration,disabledTransports:e.disabled_transports,text:e.text,bubbleSize:e.bubble_size,isTextDirectionRtl:e.text_right_to_left,realtimeAnalytics:e.chatbubble.realtime_analytics,inputLimitEnabled:e.chatbubble.input_limit_enabled,inputLimit:e.chatbubble.input_limit||140,hideHeader:e.hideHeader||!1,bubbleAvatar:e.chatbubble.icon_avatar_image||e.bubbleAvatar||null,position:{...f.bF,...e.position},offsetHeight:e.offsetHeight||"205px",fullscreenMode:e.fullscreenMode||!1,zIndex:e.zIndex||f.DP,persistStateLifespan:t?-1:e.chatbubble.persist_state_lifespan_seconds,showTakeoverQueue:e.show_takeover_queue,bubbleOutline:e.use_bubble_outline,seasonalAppearance:e.seasonal_appearance,nudges:e.nudges||[],handoverMode:e.handover_mode,splitTestEnabled:e.split_test_enabled,conversionPageUrl:e.conversion_page_url,whitelabelEnabled:e.whitelabel_enabled}};function E(e){let{botKey:t,settings:n,settings:{context:r,inPlatform:o,admin:a,environment:i},initialChatLanguage:l}=e;return{bot:x(n,o),chatbubble:{...y,botKey:t,inPlatform:o,admin:a,renderedBy:n.renderedBy||"REACT",currentLanguage:l},local:{context:r,labels:[]},environment:{...g,VERSION:"2.76.8",...i}}}const k=(e,t,n)=>{const{currentLanguage:r}=t;return n[r]||n.en};var _=n(6079);const A=Object.freeze({WARNING:"WARNING",CRITICAL:"CRITICAL"}),T=Object.freeze({OFFLINE:{en:"You seem to be offline, please check your internet connection",nb:"Du ser ut til å være frakoblet internett, vennligst sjekk tilgangen din"},WEBSOCKET_DOWN:{en:"There seems to be an issue with the connection, attempting to reconnect...",nb:"Det ser ut til å være et problem med tilkoblingen. Prøver å koble opp igjen..."}});var S=n(8411),$=n(1872);let C;const O={name:void 0,isTyping:!1,userIsTyping:!1,takenOver:!1,takeoverClosed:!0,requestedHandoverAt:void 0,hasHadHandover:!1,supportsAttachment:!1,handoverWaitTimeEstimate:void 0},I=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:O,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case m.tq:return{...e,name:t.data.name||e.name,isTyping:!1};case m.M_:return{...e,isTyping:!0};case m.MU:return{...e,isTyping:!1};case m.c6:return{...e,userIsTyping:!0};case m.we:return{...e,userIsTyping:!1};case m.II:{const n=Boolean(t.data.requested_handover_at&&!t.data.taken_over),r=Boolean(t.data.taken_over&&!e.takenOver),o=Boolean(!t.data.taken_over&&e.requestedHandoverAt),a=Boolean(!t.data.taken_over&&e.takenOver),i=Boolean(t.data.supports_attachment),l=t.data.requested_handover_at,s=t.data.handover_wait_time_estimate,c=t.data.handover_queue_position;return n?{...e,requestedHandoverAt:l,takenOver:!1,takeoverClosed:!1,handoverWaitTimeEstimate:s,handoverQueuePosition:c}:r?{...e,requestedHandoverAt:void 0,takenOver:!0,isTyping:!1,hasHadHandover:!0,supportsAttachment:i,takeoverClosed:!1,handoverWaitTimeEstimate:void 0,handoverQueuePosition:void 0}:a||o?{...e,requestedHandoverAt:void 0,takenOver:!1,isTyping:!1,supportsAttachment:void 0,handoverWaitTimeEstimate:void 0,handoverQueuePosition:void 0}:e}case m.nz:return{...e,requestedHandoverAt:void 0===t.data.requested_handover_at?e.requestedHandoverAt:t.data.requested_handover_at,takeoverClosed:Boolean(t.data.closed)};case m.AQ:return{...e,handoverWaitTimeEstimate:t.data.handover_wait_time_estimate,handoverQueuePosition:t.data.handover_queue_position};case m.MM:return{...e,requestedHandoverAt:void 0,handoverWaitTimeEstimate:void 0,handoverQueuePosition:void 0};case m.nh:return{...e,hasHadHandover:!1,requestedHandoverAt:void 0,handoverWaitTimeEstimate:void 0,handoverQueuePosition:void 0};case m.CB:return{...e,hasHadHandover:!1,requestedHandoverAt:void 0};default:return e}},L={showTabNotification:!1,showBubbleNotification:!1},M=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:L,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case m.tq:return t.data.from_bot&&"SYSTEM"!==t.data.sender?{...e,showTabNotification:!0}:e;case m.Wh:return{...e,showTabNotification:!0};case m.Zb:return{...e,showBubbleNotification:!0};case m.u2:return{...L};default:return e}},N={show:!1,text:null,url:null,type:null},R=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:N,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case m.YU:return{text:t.payload.text,type:t.payload.alertType,url:t.payload.url,show:!0};case m.nW:return N;default:return e}},P={isAuthenticated:!1,token:null,avatarUrl:null,fullName:null,isRefreshing:!1},D=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:P,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case m.K_:return{...e,isAuthenticated:!0,token:t.token,avatarUrl:t.avatarUrl,fullName:t.fullName};case m.qQ:return{...e,avatarUrl:t.avatar_url,fullName:t.full_name,email:t.email,phoneNumber:t.phone_number,userId:t.user_id};case m.zZ:return{...e,...P};case m.Rk:return{...e,isRefreshing:!0};case m.dp:return{...e,isRefreshing:!1};default:return e}},j={token:null,connected:!0,pusherConnected:!1,connectTriggerConfig:void 0},F=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:j,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case m.ny:return{...e,token:t.token};case m.CB:return{...e,token:null};case m._Y:return{...e,connected:!0};case m._N:return{...e,connected:!1};case m.mz:return e;case m.kP:return{...e,pusherConnected:!1};case m.VZ:return"message"===t.event?{...e,pusherConnected:!0}:e;case m.zT:return{...e,connectTriggerConfig:t.triggerConfig};default:return e}},z={notifications:[]},B={content:"",dismissed:!1,once:!1},H=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:z,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case m.vP:return{...e,notifications:[...e.notifications,{...B,id:t.id,buttonText:t.buttonText,buttonHref:t.buttonHref,content:t.content,icon:t.icon,once:t.once}]};case m.MN:{const n=e.notifications.findIndex(e=>e.id===t.id);if(-1===n)return e;const r=[...e.notifications];return r[n]={content:t.content,buttonHref:t.buttonHref,buttonText:t.buttonText,icon:t.icon,once:t.once,id:t.id},{...e,notifications:r}}case m.nG:return{...e,notifications:e.notifications.filter(e=>e.id!==t.id)};case m.oZ:{const n=e.notifications.find(e=>e.id===t.id);return{...e,notifications:[...e.notifications.filter(e=>e.id!==t.id),{...n,dismissed:!0}]}}default:return e}},U={inspectorOpen:!1,currentMessageId:null},V=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:U,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case m.ye:return{...e,currentMessageId:t.chatMessageId};case m.vK:return{...e,inspectorOpen:!e.inspectorOpen};default:return e}};var G=n(332);const W={context:{},labels:[]},q=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:W,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case G.s:return{...e,context:{...e.context,...t.context}};case G.T:return{...e,labels:[...new Set([...e.labels,t.label])]};case m.CB:return{...e,labels:[]};default:return e}};var K=n(9749),Y=n.n(K),X=n(467),Z=n(5013);const J=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Object.entries(e).reduce((e,t)=>{let[n,r]=t;return{...e,[(0,Z.A)(n)]:r}},{})};var Q=n(7720),ee=n(8172);const te={chatMessages:[],buttonClicks:[],attachments:[],messageSentTime:null,lastMessageSeen:null},ne=e=>{let{id:t}=e;return t},re=e=>{let{temporaryId:t,id:n}=e;return e=>{let{temporaryId:r,id:o}=e;return n===o||t===r}},oe=(e,t,n)=>e.map(e=>t(e)?n(e):e),ae=function(){var e,t,n,r;let o=arguments.length>0&&void 0!==arguments[0]?arguments[0]:te,a=arguments.length>1?arguments[1]:void 0;switch(a.type){case m.tq:{const{chatMessages:e}=o,{data:t}=a;if((0,Q.A)(e)(t)){const n={...t};return n.key||=n.id,u(o,"chatMessages",[...e,n])}const n=e.findIndex(e=>{let{id:n}=e;return n===t.id});if(t.key||=t.id,-1===n)return o;const r=[...e.slice(0,n),t,...e.slice(n+1)];return{...o,chatMessages:r}}case m.CB:return te;case m.fg:{const{chatbubble_temporary_id:e,id:t}=a.data,n=n=>{var r;let{id:o}=n;return Y()(r=[e,t]).call(r,o)},r=e=>({...e,message:a.data.message});return{...o,chatMessages:oe(o.chatMessages,n,r)}}case m.se:return{...o,messageSentTime:a.messageSentTime};case m.pz:{var i;const{created:e,id:t,temporaryId:n}=a,{chatMessages:r}=o,l=null!==(i=null==a?void 0:a.status)&&void 0!==i?i:null,s=r.findIndex(e=>{let{id:t}=e;return t===n});if(s<0)return o;const c=r[s],u={...c,created:e||c.created,id:t||c.id,status:l},d=r.map((e,t)=>t!==s?e:u);return{...o,chatMessages:d}}case m.jE:{const{chatMessageId:e,chatMessageTempId:t,patternContextMatch:n}=a.data,r=n=>{let{id:r}=n;return r===e||r===t},i=e=>({...e,pattern_context_match:n});return{...o,chatMessages:oe(o.chatMessages,r,i)}}case m.Y6:var l;return(0,X.A)(o.buttonClicks)(a.buttonClick)?{...o,buttonClicks:[...null!==(l=o.buttonClicks)&&void 0!==l?l:[],a.buttonClick]}:o;case m.kU:return{...o,lastMessageSeen:(0,ee.A)(a,["id","index"])};case m.Os:return{...o,attachments:[...null!==(e=o.attachments)&&void 0!==e?e:[],...(null===(t=a.data)||void 0===t||null===(n=t.attachments)||void 0===n?void 0:n.map(J))||[]]};case m.wP:{const e=J(a.attachment),t=re(e),n=t=>({...t,...e});return{...o,attachments:oe(o.attachments,t,n)}}case m.tS:{var s;const{attachments:e=[],temporaryChatMessageId:t,chatMessageId:n}=a.data,r=e.map(J),i=(null!==(s=o.attachments)&&void 0!==s?s:[]).map(e=>{const t=r.find(re(e));return t?{...e,...t}:e});let l=o.chatMessages;if(t&&n){const e=e=>{let{id:n}=e;return n===t},a=e=>({...e,id:n,attachment_ids:r.map(ne)});l=oe(o.chatMessages,e,a)}return{...o,attachments:i,chatMessages:l}}case m.QA:return null!==(r=a.formData)&&void 0!==r&&r.formKey?{...o,forms:{...o.forms,[a.formData.formKey]:a.formData}}:o;default:return o}},ie={slug:null,show:!1,isCustom:!1,dialogue:null,webhook:null,content:null,onRendered:null,nudgeLayout:{},nudgeType:f.MK.TEMPLATE,hasBeenDismissed:!1},le=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:ie,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case m.X2:return{...e,show:!1,nudgeLayout:{},hasBeenDismissed:!0};case m.wv:return{...e,show:!0,slug:t.slug,dialogue:t.dialogue,webhook:t.webhook,nudgeLayout:t.nudgeLayout,nudgeType:f.MK.TEMPLATE,trackEvent:t.trackEvent,hasBeenDismissed:!1};case m.un:return{...e,show:!0,isCustom:!0,slug:t.slug,content:t.content,nudgeLayout:{},onRendered:t.onRendered,nudgeType:f.MK.CUSTOM,trackEvent:t.trackEvent,hasBeenDismissed:!1};default:return e}};var se=n(9483);const ce={show:!1,text:null,agent:null,dismissed:!1,type:se.oI.MESSAGE,dismissedMessages:[]},ue=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:ce,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case m.II:return t.data.taken_over&&!e.taken_over?{...e,show:!0,agent:{name:t.data.name,avatar:t.data.avatar},text:void 0,type:se.oI.HANDOVER}:e;case m.tq:return(0,p.A)()||!t.data.from_bot||"SYSTEM"===t.data.sender||"greeting"===t.data.exchange_type?e:{...e,show:!0,text:t.data.message,type:se.oI.MESSAGE};case m.l:return{...e,show:!0,text:t.pushMessageText,dismissed:!1,type:t.pushMessageType,dismissedMessages:[...e.dismissedMessages,t.pushMessageTitle]};case m.a_:return{...e,show:!1,dismissed:!0};case m.a1:return ce;default:return e}};var de=n(5767);const pe=e=>{let{url:t,...n}=e;return(t||"").startsWith("data:")?n:{...n,url:t}},fe=e=>e?()=>e=>({bot:{splitTestLabel:e.bot.splitTestLabel,splitLabelTimestamp:e.bot.splitLabelTimestamp,hasInteraction:e.bot.hasInteraction},chatbubble:{active:!1,previouslyPoppedUp:e.chatbubble.previouslyPoppedUp,shownNudges:e.chatbubble.shownNudges},pushMessages:{dismissedMessages:e.pushMessages.dismissedMessages},agent:{name:e.agent.name}}):()=>e=>({alerts:{showBubbleNotification:e.alerts.showBubbleNotification},agent:{name:e.agent.name,takenOver:e.agent.takenOver,supportsAttachment:e.agent.supportsAttachment},bot:{splitTestLabel:e.bot.splitTestLabel,splitLabelTimestamp:e.bot.splitLabelTimestamp,hasInteraction:e.bot.hasInteraction},chatbubble:{...e.chatbubble,admin:void 0,currentlyPoppedUp:y.currentlyPoppedUp,allGreetingsHideInput:y.allGreetingsHideInput,contactDetailsButton:y.contactDetailsButton,attachments:y.attachments,isChatFullWindow:void 0,overlayViews:e.chatbubble.overlayViews.filter(e=>"FEEDBACK"===e),shownNudges:e.chatbubble.shownNudges,renderedBy:void 0},connection:{token:e.connection.token,connected:!0,pusherConnected:!1},feedback:{...e.feedback},local:{labels:e.local.labels},messages:{forms:e.messages.forms,chatMessages:e.messages.chatMessages,buttonClicks:e.messages.buttonClicks,attachments:(e.messages.attachments||[]).map(pe),messageSentTime:e.messages.messageSentTime,lastMessageSeen:e.messages.lastMessageSeen},pushMessages:{dismissedMessages:e.pushMessages.dismissedMessages}}),he=e=>t=>{let{active:n}=t.chatbubble;const r=(0,p.A)();return e.isFromMultitab||(n=t.chatbubble.active&&(Boolean(e.chatbubble.keep_open&&!r)||Boolean(e.chatbubble.keep_open_mobile&&r))),(0,c.A)(t,{chatbubble:{active:n,wasActiveOnLoad:n}})},me=e=>{var t;if((0,d.A)(e,"bot.includeDisabledLanguages",!1))return e;const n=null==e||null===(t=e.chatbubble)||void 0===t?void 0:t.currentLanguage,r=window.__KINDLY_SETTINGS__.supportedLanguages.some(e=>{let{code:t}=e;return t===n}),o=window.__KINDLY_SETTINGS__.supportedLanguages.find(e=>{let{is_primary:t}=e;return t});if(!o)throw new Error("Impossible state: primary language not found");return r?e:(0,c.A)(e,{chatbubble:{currentLanguage:o.code}})},ge=e=>{let{inPlatform:t,botKey:n}=e;return(e=>(t,n)=>{return r=(0,c.A)(t,n),e.reduce((e,t)=>{let[n,r]=t;return u(e,n,r)},r);var r})([["chatbubble.inPlatform",t],["chatbubble.botKey",n]].filter(e=>{let[,t]=e;return void 0!==t}))},be=e=>t=>{var n,r;const o=null==t||null===(n=t.messages)||void 0===n?void 0:n.chatMessages.filter(e=>e.from_bot).pop(),a=null!==(r=null==o?void 0:o.chat_live_translation_language_code)&&void 0!==r?r:null==o?void 0:o.chat_language_code,i=null!=a?a:e;return(0,c.A)(t,{chatbubble:{currentLanguage:i}})},ve=[e=>t=>n=>n.type===m.tq&&n.data.from_bot?(e.dispatch((0,_.MY)()),(0,_.CM)(),t(n)):t(n),e=>t=>n=>{switch(n.type){case m._N:return((e,t,n,r)=>{const{announcement:o,bot:a,chatbubble:i}=t;if(o.show)return n(r);const l={text:k(0,i,e),alertType:A.WARNING};return n({type:m.YU,payload:l}),n(r)})(T.OFFLINE,e.getState(),t,n);case m._Y:{const{announcement:r,connection:o}=e.getState();return r.show&&t({type:m.nW}),o.connected||e.dispatch((0,_.S4)()),t(n)}default:return t(n)}},e=>t=>async n=>{const{agent:{takenOver:r},chatbubble:{currentLanguage:o}}=e.getState();if(n.type===m.II){const{handoverConversationFeedback:t,preloadFeedbackImages:a}=(0,S.A)(o);r&&!1===n.data.taken_over&&t&&(a("handover_conversation"),e.dispatch((0,$.ob)(t)))}if(n.type!==m.tq)return t(n);const{from_bot:a,sender:i,was_anonymized:l,exchange_type:s,triggered_chat_start:c,chat_language_code:u,chat_live_translation_language_code:d}=n.data,h=d||u;if(n.type===m.tq&&(0,p.A)()&&a&&i!==f.bS.SYSTEM&&e.dispatch({type:m.Zb}),"greeting"===s||c)o!==h&&t({type:m.M2,code:h});else if(a&&h&&o!==h){var g;const{text:n}=e.getState().bot,r=null===(g=n.language_switch_notification)||void 0===g?void 0:g[h];r&&e.dispatch((0,$.cC)({content:r,buttonText:void 0,buttonHref:void 0,icon:"language"},f.Jm.LANGUAGE_SWITCH)),t({type:m.M2,code:u})}if(a||!l)return t(n);t({type:m.fg,data:n.data})},e=>t=>async n=>{var r;return n.type===m.A8&&(clearTimeout(C),C=setTimeout(()=>{e.getState().bot.isTyping&&t({type:m.wk})},1e3*((null===(r=n.data)||void 0===r?void 0:r.TTL)||10))),n.type===m.wk&&clearTimeout(C),t(n)},()=>e=>t=>{e("payload"in t?t:{...t,payload:{...t}})}];function ye(e){let{botKey:t,settings:n,persist:a=!0,initialChatLanguage:i,initialStateModifier:u}=e;const{inPlatform:d}=n,p=!n.inPlatform&&0===n.chatbubble.persist_state_lifespan_seconds,f=`kindly-chat-${t}`,h=fe(p),m=s(me,be(i),he(n),ge({inPlatform:d,botKey:t})),g=a?l()(null,{key:f,slicer:h,merge:m}):e=>e;let b=E({botKey:t,settings:n,initialChatLanguage:i});return u&&(b=(0,c.A)(b,u)),(0,o.U1)({reducer:{...r,feedback:de.Ay,chatbubble:w},preloadedState:b,middleware:e=>e().concat(...ve),enhancers:e=>e().concat(g),devTools:!1})}const we=a.wA.withTypes(),xe=a.d4.withTypes()},6057:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});const r=function(){let e=arguments.length>1?arguments[1]:void 0;return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).reduce((t,n)=>{var r;return{...t,[e(n)]:[...null!==(r=t[e(n)])&&void 0!==r?r:[],n]}},{})}},6064:(e,t,n)=>{"use strict";function r(e,t){if(!e)return;const n=[t,"en"].find(t=>t&&e[t]);return n?e[n]:void 0}n.d(t,{A:()=>r})},6079:(e,t,n)=>{"use strict";n.d(t,{CM:()=>E,Tk:()=>g,MY:()=>k,S4:()=>y,yh:()=>A,Zk:()=>S,Mk:()=>T,f2:()=>_,uK:()=>w});var r=n(9749),o=n.n(r),a=n(2221),i=n(467),l=n(4851),s=n(6057),c=n(7720),u=n(7173),d=n(7243);const p=[],f=[],h=[];let m=0;const g=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];t.length||([...p,...f].forEach(e=>{clearInterval(e)}),p.length=0,f.length=0,h.forEach(e=>{clearTimeout(e)}),h.length=0,m=0),o()(t).call(t,"handoverRequestPollIntervalIds")&&(p.forEach(e=>{clearInterval(e)}),p.length=0),o()(t).call(t,"handoverPollIntervalIds")&&(f.forEach(e=>{clearInterval(e)}),f.length=0),o()(t).call(t,"replyTimeoutIds")&&(h.forEach(e=>{clearTimeout(e)}),h.length=0,m=0)},b=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Object.entries(e).reduce((e,t)=>{let[n,r]=t;return{...e,[n.replace(/_\w/g,e=>e[1].toUpperCase())]:r}},{})},v=e=>{let{status:t}=e;return t!==a.Le.PROCESSING},y=()=>async(e,t)=>{const{agent:{takenOver:n,requestedHandoverAt:r,handoverWaitTimeEstimate:o,handoverQueuePosition:p},chatbubble:{startedAt:f,chatHasStarted:h,botKey:m},connection:{token:g},environment:{PAT_HOST:y},messages:{attachments:w,buttonClicks:E,chatMessages:k,messageSentTime:_}}=t();if(!g||!h)return;const[A]=k.filter(e=>{let{from_bot:t}=e;return t}).slice(-1),[T]=w.filter(v).slice(-1),S=((e,t)=>{let{created:n}=e,{created:r}=t;return n&&r?new Date(n)>new Date(r)?n:r:n||r})(null!=A?A:{},null!=T?T:{})||_||f||(new Date).toISOString(),$=await e((0,d.et)(`${y}/chatbubble/${a.Ak}/latest?timestamp=${S}`,{method:"GET",...(0,l.A)({token:g})},{onError:t=>{var n;403===(null===(n=t.response)||void 0===n?void 0:n.status)?(console.warn(`/chatbubble/${a.Ak}/latest returned 403, starting new chat`),e({type:u.tr,error:403}),e((0,d.zX)(m,!0))):console.error(t)}}));if(!$||!$.data)return;const{chatMessages:C,buttonClicks:O=[],takenOver:I,requestedHandoverAt:L,attachments:M,externalHandoverState:N,handoverWaitTimeEstimate:R,handoverQueuePosition:P}=$.data,D=(0,c.A)(k),j=(0,i.A)(E),F=C.filter(D),z=O.map(b).filter(j),B=F.length>0;var H,U;e((e=>async(t,n)=>{if((null==e?void 0:e.length)>0)return;const{attachments:r=[]}=n().messages,{newAttachments:o=[],updated:i=[]}=(0,s.A)(function(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).filter(e=>{let{sender:t,status:n}=e;return t===a.bS.USER||n===a.Le.CLEAN})}(e),e=>r.find((e=>{let{id:t,temporaryId:n}=e;return e=>{let{id:r,temporaryId:o}=e;return t&&t===r||n&&n===o}})(e))?"updated":"newAttachments");o.length>0&&t({type:u.Os,data:{attachments:o}}),i.length>0&&t({type:u.tS,data:{attachments:i}})})(M)),e(x(B)),n!==I&&e({type:u.II,data:{taken_over:I,supports_attachment:null==N?void 0:N.supports_attachment,requested_handover_at:L}}),r!==L&&e({type:u.nz,data:{requested_handover_at:L,handover_wait_time_estimate:R,handover_queue_position:P}}),o===R&&p===P||e({type:u.AQ,data:{handover_wait_time_estimate:R,handover_queue_position:P}}),(H=F,U="created",(H||[]).slice().sort((e,t)=>e[U]<t[U]?-1:1)).forEach(t=>{e({type:u.tq,data:t})}),z.forEach(t=>e({type:u.Y6,buttonClick:t}))},w=()=>e=>{if(g("replyTimeoutIds"),f.length)return;const t=setTimeout(()=>e(y()),a.RT.REPLY_TIMEOUT_MS);h.push(t),m=1},x=e=>t=>{if(g("replyTimeoutIds"),0===m)return;if(e||!(m<a.RT.REPLY_TIMEOUT_MAX_ATTEMPTS))return void(e||console.error(`Reply timeout failed more than ${a.RT.REPLY_TIMEOUT_MAX_ATTEMPTS} times`));const n=a.RT.REPLY_TIMEOUT_MS*a.RT.REPLY_TIMEOUT_MS_MULTIPLIER**m,r=setTimeout(()=>t(y()),n);h.push(r),m+=1},E=()=>g("replyTimeoutIds"),k=()=>e=>{if(f.length){g("handoverPollIntervalIds");const t=setInterval(()=>e(y()),a.RT.HANDOVER_POLL_INTERVAL_MS);p.push(t)}if(p.length){g("handoverRequestPollIntervalIds");const t=setInterval(()=>e(y()),a.RT.HANDOVER_REQUEST_POLL_INTERVAL_MS);p.push(t)}},_=()=>e=>{if(g(),f.length)return;const t=setInterval(()=>e(y()),a.RT.HANDOVER_POLL_INTERVAL_MS);f.push(t)},A=()=>g("handoverPollIntervalIds"),T=()=>e=>{if(p.length)return;const t=setInterval(()=>e(y()),a.RT.HANDOVER_REQUEST_POLL_INTERVAL_MS);p.push(t)},S=()=>g("handoverRequestPollIntervalIds")},6100:(e,t,n)=>{"use strict";var r=n(1780),o=Function.prototype,a=o.call,i=r&&o.bind.bind(a,a);e.exports=r?i:function(e){return function(){return a.apply(e,arguments)}}},6249:(e,t,n)=>{"use strict";n.d(t,{A:()=>a});var r=n(8089),o=n.n(r);const a=(e,t)=>o()({},e,t)},6253:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var r=n(9155);const o=(e,t)=>{const n=(0,r.useRef)();return(0,r.useCallback)(r=>{var o;new Date-n.current<t?null==r||null===(o=r.preventDefault)||void 0===o||o.call(r):(e(r),n.current=new Date)},[t,e])}},6281:(e,t,n)=>{"use strict";var r=n(1003),o=n(2769),a=n(4317),i=n(7460),l=Object;e.exports=i?function(e){return"symbol"==typeof e}:function(e){var t=r("Symbol");return o(t)&&a(t.prototype,l(e))}},6367:(e,t,n)=>{"use strict";n.d(t,{GJ:()=>i,NY:()=>s,fz:()=>c,n6:()=>d,tf:()=>u});const r=["load","message"],o="See https://docs.kindly.ai/api/chat#handlers for how to switch.",a=function(e,t,n,a){var i,l;let s=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];if(-1!==r.indexOf(e)&&Boolean(a)&&function(e,t,n){const r=`on${t.charAt(0).toUpperCase()+t.slice(1)}`;if("function"!=typeof e)return void console.warn(`Provided setting '${r}' is not a function.`);console.warn(`kindlyOptions.${r} is deprecated in favor of standard event handlers. ${o}`);const a=Object.values(n);try{e(...a)}catch(e){console.error(e)}}(a,e,t),"API"!==n)return!0;if(null===(i=window)||void 0===i||null===(l=i.kindlyChat)||void 0===l||!l.APIRoot)return console.warn("No APIRoot when rendered using kindly-chat API"),!0;"message"===e&&window.kindlyChat.APIRoot.dispatchEvent(new CustomEvent("onMessage",{detail:t}));const c=`kindly:${e}`;return window.kindlyChat.APIRoot.dispatchEvent(new CustomEvent(c,{detail:t,bubbles:!0,cancelable:s}))};function i(e,t,n,r){e&&a("message",{newMessage:e,chatLog:t},r,n)}let l=!1;function s(e){!1===l&&(l=!0,a("load",{settings:e},null==e?void 0:e.renderedBy,null==e?void 0:e.onLoad))}const c=e=>{let{button:t,buttonType:n,chatLog:r,event:a,handlers:i,lastMessage:l,renderedBy:s}=e,c=!1;const u=null==i?void 0:i[n];if(u){console.warn(`kindlyOptions.buttonHandlers is deprecated in favor of standard event handlers. ${o}`);try{c=Boolean(u(a,t,l,r,n))}catch(e){console.error(e)}}var d;return"API"===s&&(c=!(null!==(d=window.kindlyChat)&&void 0!==d&&d.APIRoot.dispatchEvent(new CustomEvent("kindly:buttonclick",{detail:{button:t,lastMessage:l,chatLog:r,buttonType:n},bubbles:!0,cancelable:!0})))),c};function u(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{source:n="user",storeState:r}=arguments.length>2?arguments[2]:void 0;const{chatbubble:{chatId:o,renderedBy:i}}=r,l={...t,chatId:o,source:n,type:e};return a("ui",l,i,void 0,!1)}const d=e=>{var t;let{type:n,icon:r,renderedBy:o}=e;return"API"!==o||!(null!==(t=window.kindlyChat)&&void 0!==t&&t.APIRoot.dispatchEvent(new CustomEvent("kindly:globalicon",{detail:{type:n,icon:r},bubbles:!0,cancelable:!0})))}},6421:(e,t,n)=>{"use strict";n.d(t,{A:()=>i}),n(1949);var r=n(9155),o=n.n(r);const a=n(3864).Ay.div`
1169
+ `;function c(e){let{loading:t=!1,isCheckbox:n=!1,flat:r,minHeight:a}=e;return o().createElement(l,{$minHeight:a,$flat:r,$isCheckbox:n,$loading:t},o().createElement(s,null),o().createElement(s,null),o().createElement(s,null))}},5546:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e};function o(e){return e&&e.__esModule?e:{default:e}}t.default=function(e,t){var n=r({key:"redux",merge:i.default,slicer:a.default,serialize:JSON.stringify,deserialize:JSON.parse},t),o=n.key,l=n.merge,s=n.slicer,c=n.serialize,u=n.deserialize;return function(t){return function(n,r,a){"function"==typeof r&&void 0===a&&(a=r,r=void 0);var i=void 0,d=void 0;try{i=u(localStorage.getItem(o)),d=l(r,i)}catch(e){console.warn("Failed to retrieve initialize state from localStorage:",e)}var p=t(n,d,a),f=s(e);return p.subscribe(function(){var e=p.getState(),t=f(e);try{localStorage.setItem(o,c(t))}catch(e){console.warn("Unable to persist state to localStorage:",e)}}),p}}};var a=o(n(8639)),i=o(n(7487));e.exports=t.default},5547:(e,t,n)=>{"use strict";var r,o,a=n(8900),i=n(3531),l=a.process,s=a.Deno,c=l&&l.versions||s&&s.version,u=c&&c.v8;u&&(o=(r=u.split("."))[0]>0&&r[0]<4?1:+(r[0]+r[1])),!o&&i&&(!(r=i.match(/Edge\/(\d+)/))||r[1]>=74)&&(r=i.match(/Chrome\/(\d+)/))&&(o=+r[1]),e.exports=o},5564:(e,t,n)=>{"use strict";n.d(t,{$u:()=>d,z5:()=>p,gm:()=>u,JL:()=>c});var r=n(2221),o=n(4851);var a=n(7243),i=n(7173);const l=()=>({type:i.zZ});let s=null;const c=()=>async(e,t)=>{if(!s)return;const{connection:{token:n},environment:{PAT_HOST:l}}=t(),{headers:c}=(0,o.A)({token:n},{withCurrentUrl:!0}),{data:u,status:d}=await e((0,a.et)(`${l}/chatbubble/${r.Ak}/auth/identify`,{method:"POST",headers:c,body:s}));200===d&&e({type:i.qQ,...u})},u=e=>async(t,n)=>{s=e;const{connection:{token:r}}=n();r&&t(c())},d=()=>async(e,t)=>{const{chatbubble:{chatId:n},connection:{token:s},environment:{PAT_HOST:c}}=t(),{getAuthToken:u}=window.__KINDLY_SETTINGS__;if(!n||!u)return void e(l());let d;try{d=await u(n)}catch(e){console.error("Chatbubble auth failed:",e),d=null}if(!d)return void e(l());const{headers:p}=(0,o.A)({jwt:d,token:s},{withCurrentUrl:!0}),f=await e((0,a.et)(`${c}/chatbubble/${r.Ak}/auth/chat`,{method:"POST",headers:p},{onError:()=>e(l())}));null!=f&&f.data&&e({type:i.K_,token:d,avatarUrl:f.data.avatar_url,fullName:f.data.full_name})},p=()=>async(e,t)=>{const{auth:{isAuthenticated:n,isRefreshing:r,token:o}}=t();if(!n)return null;if(r)return await new Promise(e=>{setTimeout(e,200)}),p()(e,t);const{getAuthToken:a}=window.__KINDLY_SETTINGS__;a&&function(e){const t=function(e){if(!e)return null;const t=e.match(/^[A-Za-z0-9-_=]+\.([A-Za-z0-9-_=]+)\.?[A-Za-z0-9-_.+/=]*$/);if(!t)return null;try{return JSON.parse(window.atob(t[1]))}catch(e){return null}}(e);return!t||t.exp-Math.floor((new Date).getTime()/1e3)<30}(o)&&(e({type:i.Rk}),await e(d()),e({type:i.dp}));const{auth:l}=t();return l.isAuthenticated?{Authorization:`Bearer ${l.token}`}:null}},5644:(e,t,n)=>{"use strict";var r=n(1949),o=n.n(r),a=n(2221),i=n(3211);o().shape({button_type:o().oneOf([...Object.values(a.lP),...Object.values(a.lP).map(i.A)]).isRequired,is_active:o().bool,label:o().string.isRequired,value:o().string,new_context:o().object,index:o().number,language_code:o().string,open_in_new_tab:o().bool})},5767:(e,t,n)=>{"use strict";n.d(t,{ot:()=>A,n_:()=>x,Ay:()=>T,WG:()=>y,CJ:()=>b,GY:()=>k,wm:()=>w,zp:()=>_,m9:()=>E});var r=n(9749),o=n.n(r);var a=e=>Array.isArray(e)?e:[e];Symbol(),Object.getPrototypeOf({});var i="undefined"!=typeof WeakRef?WeakRef:class{constructor(e){this.value=e}deref(){return this.value}};function l(){return{s:0,v:void 0,o:null,p:null}}function s(e,t={}){let n={s:0,v:void 0,o:null,p:null};const{resultEqualityCheck:r}=t;let o,a=0;function s(){let t=n;const{length:s}=arguments;for(let e=0,n=s;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=l(),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=l(),e.set(n,t)):t=r}}const c=t;let u;if(1===t.s)u=t.v;else if(u=e.apply(null,arguments),a++,r){const e=o?.deref?.()??o;null!=e&&r(e,u)&&(u=e,0!==a&&a--),o="object"==typeof u&&null!==u||"function"==typeof u?new i(u):u}return c.s=1,c.v=u,u}return s.clearCache=()=>{n={s:0,v:void 0,o:null,p:null},s.resetResultsCount()},s.resultsCount=()=>a,s.resetResultsCount=()=>{a=0},s}function c(e,...t){const n="function"==typeof e?{memoize:e,memoizeOptions:t}:e,r=(...e)=>{let t,r=0,o=0,i={},l=e.pop();"object"==typeof l&&(i=l,l=e.pop()),function(e,t="expected a function, instead received "+typeof e){if("function"!=typeof e)throw new TypeError(t)}(l,`createSelector expects an output function after the inputs, but received: [${typeof l}]`);const c={...n,...i},{memoize:u,memoizeOptions:d=[],argsMemoize:p=s,argsMemoizeOptions:f=[],devModeChecks:h={}}=c,m=a(d),g=a(f),b=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),v=u(function(){return r++,l.apply(null,arguments)},...m),y=p(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}(b,arguments);return t=v.apply(null,e),t},...g);return Object.assign(y,{resultFunc:l,memoizedResultFunc:v,dependencies:b,dependencyRecomputations:()=>o,resetDependencyRecomputations:()=>{o=0},lastResult:()=>t,recomputations:()=>r,resetRecomputations:()=>{r=0},memoize:u,argsMemoize:p})};return Object.assign(r,{withTypes:()=>r}),r}var u=c(s),d=Object.assign((e,t=u)=>{!function(e,t="expected an object, instead received "+typeof e){if("object"!=typeof e)throw new TypeError(t)}(e,"createStructuredSelector expects first argument to be an object where each property is a selector, instead received a "+typeof e);const n=Object.keys(e);return t(n.map(t=>e[t]),(...e)=>e.reduce((e,t,r)=>(e[n[r]]=t,e),{}))},{withTypes:()=>d}),p=n(7251),f=n(3313),h=n(7523),m=n(4142);const g={feedbacksAlreadyDisplayed:[],feedbackToSubmit:null},b=u([e=>e.feedback.feedbacksAlreadyDisplayed,e=>e.feedback.feedbackToSubmit],(e,t)=>({feedbacksAlreadyDisplayed:e,feedbackToSubmit:t})),v=(0,p.Z0)({name:"feedback",initialState:g,reducers:{initializeFeedback:(e,t)=>{var n;e.feedbackToSubmit={id:null,rating_system:t.payload.ratingSystem,trigger_type:t.payload.triggerType,form_title:t.payload.formTitle,currentStep:t.payload.step,index:null,rating:null,sentiment:null,buttons_chosen:[],freeform_text:null},o()(n=e.feedbacksAlreadyDisplayed).call(n,t.payload.triggerType)||e.feedbacksAlreadyDisplayed.push(t.payload.triggerType)},setRating:(e,t)=>{e.feedbackToSubmit&&(e.feedbackToSubmit.index=t.payload.index,e.feedbackToSubmit.rating=t.payload.rating,e.feedbackToSubmit.sentiment=t.payload.sentiment)},clearRating:e=>{e.feedbackToSubmit&&(e.feedbackToSubmit.index=null,e.feedbackToSubmit.rating=null,e.feedbackToSubmit.sentiment=null)},toggleCommentButton:(e,t)=>{if(!e.feedbackToSubmit)return;const{buttons_chosen:n}=e.feedbackToSubmit;o()(n).call(n,t.payload)?e.feedbackToSubmit.buttons_chosen=n.filter(e=>e!==t.payload):n.push(t.payload)},setFreeformText:(e,t)=>{e.feedbackToSubmit&&(e.feedbackToSubmit.freeform_text=t.payload)},setStep:(e,t)=>{e.feedbackToSubmit&&(e.feedbackToSubmit.currentStep=t.payload)},clearFeedbackToSubmit:e=>{e.feedbackToSubmit=null}},extraReducers:e=>{e.addCase(m.S.fulfilled,(e,t)=>{e.feedbackToSubmit&&(e.feedbackToSubmit.id=t.payload)}),e.addCase(m.S.rejected,e=>{e.feedbackToSubmit=null}),e.addMatcher(e=>{var t;return o()(t=[f.CB,h.ny]).call(t,e.type)},()=>g)}}),{initializeFeedback:y,setRating:w,clearRating:x,toggleCommentButton:E,setFreeformText:k,setStep:_,clearFeedbackToSubmit:A}=v.actions,T=v.reducer},5777: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)}},5814:(e,t,n)=>{"use strict";n.d(t,{Bq:()=>u,G8:()=>s,NR:()=>c});var r=n(9749),o=n.n(r),a=n(5013),i=n(9272);const l={maximum:"max",minimum:"min"},s=e=>{const t={},n=e.map(e=>{const t=Object.keys(e);for(let n=0;n<t.length;n+=1){const r=t[n];if(r&&l[r]){const t=Object.getOwnPropertyDescriptor(e,r);if(t){const n=Object.defineProperty(e,l[r],t);return delete n[r],n}}}return e});for(let e=0;e<n.length;e+=1){var r;const l=Object.keys(n[e]),s=null===(r=n[e].texts)||void 0===r?void 0:r.text;l.forEach(r=>{var l;o()(l=Object.values(i.ZF)).call(l,r)&&(t[(0,a.A)(r)]={value:n[e][r],...s&&{message:s}})})}return t},c=e=>{if("object"!=typeof e)return{};const t={};return Object.entries(e).forEach(e=>{let[n,r]=e;r&&"object"==typeof r&&"value"in r&&!("text"in r)&&(t[n]=r.value)}),t},u=e=>{const t=[...e.validators||[]];return e.required&&t.push({required:e.required,text:e.texts.required_text}),t}},5919:(e,t,n)=>{"use strict";e.exports=n(4047)},5947:(e,t,n)=>{"use strict";var r=n(7752),o=TypeError;e.exports=function(e){if(r(e))throw new o("The method doesn't accept regular expressions");return e}},5960:(e,t,n)=>{"use strict";n.d(t,{Ay:()=>ye,jL:()=>we,GV:()=>xe});var r={};n.r(r),n.d(r,{agent:()=>I,alerts:()=>M,announcement:()=>R,auth:()=>D,bot:()=>h.Ay,connection:()=>F,environment:()=>b,inChatNotification:()=>H,inspector:()=>V,local:()=>q,messages:()=>ae,nudge:()=>le,pushMessages:()=>ue});var o=n(7251),a=n(541),i=n(5546),l=n.n(i);const s=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(){return t.reverse().slice(1).reduce((e,t)=>t(e),t[0](...arguments))}};var c=n(6249);function u(e,t,n){return(0,c.A)(e,function(e,t){return e.split(".").reverse().reduce((e,n,r)=>0===r?{[n]:t}:{[n]:e},{})}(t,n))}var d=n(4499),p=n(2628),f=n(2221),h=n(9100),m=n(7173);const g={PAT_HOST:"https://bot.kindly.ai",PUSHER_KEY:"0d15baa2a7308d71e79d",STATUS_PAGE:"https://status.kindly.ai",KINDLY_CHAT_URL:"http://localhost:8081",SAGE_HOST:"https://sage.kindly.ai",SETTINGS_HOST:"https://chat.kindlycdn.com",VERSION:"dev"},b=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:g,t=arguments.length>1?arguments[1]:void 0;return t.type===m.$o?{...e,...t.env}:e};var v=n(4142);const y={active:!1,allGreetingsHideInput:!1,attachments:{exchangeId:null,buttonClicked:null,files:[]},botKey:null,chatHasStarted:!1,chatId:null,contactDetailsButton:null,currentLanguage:"en",currentlyPoppedUp:!1,error:null,globalIconsState:{seenDelayedPages:[],open:!0},hideInputField:!1,inPlatform:!1,isChatFullWindow:!1,currentModal:null,overlayViews:[],previouslyPoppedUp:!1,renderedBy:"REACT",shownNudges:[],startedAt:null,uploadButtonWasClicked:null,userIsIdle:!1},w=(0,o.Z0)({name:"chatBubble",initialState:y,reducers:{},extraReducers:e=>e.addCase(m.tr,(e,t)=>{e.error=t.payload.error}).addCase(m.M2,(e,t)=>{e.currentLanguage=t.payload.code}).addCase(m.CB,(e,t)=>{e.botKey=t.payload.botKey||e.botKey,e.chatId=y.chatId,e.error=y.error,e.currentModal=y.currentModal,e.overlayViews=y.overlayViews,e.hideInputField=y.hideInputField,e.userIsIdle=y.userIsIdle}).addCase(m.ny,(e,t)=>{e.chatId=t.payload.chatId,e.allGreetingsHideInput=t.payload.allGreetingsHideInput,e.currentModal=y.currentModal,e.overlayViews=y.overlayViews}).addCase(m.d$,(e,t)=>{e.chatHasStarted=t.payload.chatHasStarted,e.userIsIdle=!t.payload.chatHasStarted&&e.userIsIdle}).addCase(m.tq,(e,t)=>{const n=e.hideInputField&&"USER"===t.payload.data.sender;e.chatHasStarted=!0,e.hideInputField=!!n||t.payload.data.chatbubble_hide_input_field}).addCase(m.kA,e=>{e.active=!0,e.userIsIdle=!1}).addCase(m.uS,e=>{e.active=!1}).addCase(m.hn,e=>{e.previouslyPoppedUp=!0,e.currentlyPoppedUp=!0}).addCase(m.IM,e=>e).addCase(m.nm,(e,t)=>{e.startedAt=t.payload.startedAt}).addCase(m.HW,(e,t)=>{e.userIsIdle=t.payload.userIsIdle}).addCase(m.Eg,(e,t)=>{e.contactDetailsButton=t.payload.button}).addCase(m.t1,e=>{e.contactDetailsButton=null}).addCase(m.wX,(e,t)=>{e.shownNudges=(e.shownNudges||[]).concat(t.payload.slug)}).addCase(m.FZ,(e,t)=>{e.attachments.buttonClicked=(+new Date).toString(),e.attachments.exchangeId=t.payload.button.value}).addCase(m.TF,(e,t)=>{e.attachments.files=t.payload.files}).addCase(m.Q4,e=>{e.attachments.exchangeId=null,e.attachments.buttonClicked=null,e.attachments.files=[]}).addCase(m.YR,e=>{e.attachments.buttonClicked=null}).addCase(m.Kd,(e,t)=>{e.shownNudges=(e.shownNudges||[]).filter(e=>e!==t.payload.slug)}).addCase(m.uA,(e,t)=>{e.globalIconsState={...e.globalIconsState,...t.payload.state}}).addCase(m.Xu,(e,t)=>{e.currentModal=t.payload.currentModal}).addCase(m.XM,(e,t)=>{e.isChatFullWindow=t.payload.isChatFullWindow}).addCase(m.wM,(e,t)=>{e.overlayViews=[...e.overlayViews,t.payload.view]}).addCase(m.SO,e=>{e.overlayViews=[]}).addCase(m.nX,e=>{e.overlayViews=e.overlayViews.slice(0,-1)}).addCase(v.S.rejected,e=>{e.currentModal=null,e.overlayViews=e.overlayViews.filter(e=>"FEEDBACK"!==e)})}).reducer,x=(e,t)=>{var n;return{...h.ue,id:e.id,name:e.name,avatar:e.avatar,botName:e.name,botAvatar:e.avatar,chatbubbleTextEnabled:e.use_chatbubble_text,includeDisabledLanguages:e.includeDisabledLanguages,startOverText:e.start_over_text,welcomePage:e.welcomePage,welcomePageType:t?f.Lb.NONE:e.welcomePage.type,maintenanceAlert:e.maintenance_alert,maintenanceAlertEnabled:!t&&((null===(n=e.maintenance_alert)||void 0===n?void 0:n.alert_enabled)||!1),pushGreetingsEnabled:!t&&e.use_push_greetings,pushGreetings:e.push_greetings,tabNotification:e.tab_notification,bubbleNotification:e.bubble_notification,typingIndicator:e.typing_indicator,typingDuration:e.typing_duration,disabledTransports:e.disabled_transports,text:e.text,bubbleSize:e.bubble_size,isTextDirectionRtl:e.text_right_to_left,realtimeAnalytics:e.chatbubble.realtime_analytics,inputLimitEnabled:e.chatbubble.input_limit_enabled,inputLimit:e.chatbubble.input_limit||140,hideHeader:e.hideHeader||!1,bubbleAvatar:e.chatbubble.icon_avatar_image||e.bubbleAvatar||null,position:{...f.bF,...e.position},offsetHeight:e.offsetHeight||"205px",fullscreenMode:e.fullscreenMode||!1,zIndex:e.zIndex||f.DP,persistStateLifespan:t?-1:e.chatbubble.persist_state_lifespan_seconds,showTakeoverQueue:e.show_takeover_queue,bubbleOutline:e.use_bubble_outline,seasonalAppearance:e.seasonal_appearance,nudges:e.nudges||[],handoverMode:e.handover_mode,splitTestEnabled:e.split_test_enabled,conversionPageUrl:e.conversion_page_url,whitelabelEnabled:e.whitelabel_enabled}};function E(e){let{botKey:t,settings:n,settings:{context:r,inPlatform:o,admin:a,environment:i},initialChatLanguage:l}=e;return{bot:x(n,o),chatbubble:{...y,botKey:t,inPlatform:o,admin:a,renderedBy:n.renderedBy||"REACT",currentLanguage:l},local:{context:r,labels:[]},environment:{...g,VERSION:"2.76.11",...i}}}const k=(e,t,n)=>{const{currentLanguage:r}=t;return n[r]||n.en};var _=n(6079);const A=Object.freeze({WARNING:"WARNING",CRITICAL:"CRITICAL"}),T=Object.freeze({OFFLINE:{en:"You seem to be offline, please check your internet connection",nb:"Du ser ut til å være frakoblet internett, vennligst sjekk tilgangen din"},WEBSOCKET_DOWN:{en:"There seems to be an issue with the connection, attempting to reconnect...",nb:"Det ser ut til å være et problem med tilkoblingen. Prøver å koble opp igjen..."}});var S=n(8411),$=n(1872);let C;const O={name:void 0,isTyping:!1,userIsTyping:!1,takenOver:!1,takeoverClosed:!0,requestedHandoverAt:void 0,hasHadHandover:!1,supportsAttachment:!1,handoverWaitTimeEstimate:void 0},I=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:O,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case m.tq:return{...e,name:t.data.name||e.name,isTyping:!1};case m.M_:return{...e,isTyping:!0};case m.MU:return{...e,isTyping:!1};case m.c6:return{...e,userIsTyping:!0};case m.we:return{...e,userIsTyping:!1};case m.II:{const n=Boolean(t.data.requested_handover_at&&!t.data.taken_over),r=Boolean(t.data.taken_over&&!e.takenOver),o=Boolean(!t.data.taken_over&&e.requestedHandoverAt),a=Boolean(!t.data.taken_over&&e.takenOver),i=Boolean(t.data.supports_attachment),l=t.data.requested_handover_at,s=t.data.handover_wait_time_estimate,c=t.data.handover_queue_position;return n?{...e,requestedHandoverAt:l,takenOver:!1,takeoverClosed:!1,handoverWaitTimeEstimate:s,handoverQueuePosition:c}:r?{...e,requestedHandoverAt:void 0,takenOver:!0,isTyping:!1,hasHadHandover:!0,supportsAttachment:i,takeoverClosed:!1,handoverWaitTimeEstimate:void 0,handoverQueuePosition:void 0}:a||o?{...e,requestedHandoverAt:void 0,takenOver:!1,isTyping:!1,supportsAttachment:void 0,handoverWaitTimeEstimate:void 0,handoverQueuePosition:void 0}:e}case m.nz:return{...e,requestedHandoverAt:void 0===t.data.requested_handover_at?e.requestedHandoverAt:t.data.requested_handover_at,takeoverClosed:Boolean(t.data.closed)};case m.AQ:return{...e,handoverWaitTimeEstimate:t.data.handover_wait_time_estimate,handoverQueuePosition:t.data.handover_queue_position};case m.MM:return{...e,requestedHandoverAt:void 0,handoverWaitTimeEstimate:void 0,handoverQueuePosition:void 0};case m.nh:return{...e,hasHadHandover:!1,requestedHandoverAt:void 0,handoverWaitTimeEstimate:void 0,handoverQueuePosition:void 0};case m.CB:return{...e,hasHadHandover:!1,requestedHandoverAt:void 0};default:return e}},L={showTabNotification:!1,showBubbleNotification:!1},M=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:L,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case m.tq:return t.data.from_bot&&"SYSTEM"!==t.data.sender?{...e,showTabNotification:!0}:e;case m.Wh:return{...e,showTabNotification:!0};case m.Zb:return{...e,showBubbleNotification:!0};case m.u2:return{...L};default:return e}},N={show:!1,text:null,url:null,type:null},R=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:N,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case m.YU:return{text:t.payload.text,type:t.payload.alertType,url:t.payload.url,show:!0};case m.nW:return N;default:return e}},P={isAuthenticated:!1,token:null,avatarUrl:null,fullName:null,isRefreshing:!1},D=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:P,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case m.K_:return{...e,isAuthenticated:!0,token:t.token,avatarUrl:t.avatarUrl,fullName:t.fullName};case m.qQ:return{...e,avatarUrl:t.avatar_url,fullName:t.full_name,email:t.email,phoneNumber:t.phone_number,userId:t.user_id};case m.zZ:return{...e,...P};case m.Rk:return{...e,isRefreshing:!0};case m.dp:return{...e,isRefreshing:!1};default:return e}},j={token:null,connected:!0,pusherConnected:!1,connectTriggerConfig:void 0},F=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:j,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case m.ny:return{...e,token:t.token};case m.CB:return{...e,token:null};case m._Y:return{...e,connected:!0};case m._N:return{...e,connected:!1};case m.mz:return e;case m.kP:return{...e,pusherConnected:!1};case m.VZ:return"message"===t.event?{...e,pusherConnected:!0}:e;case m.zT:return{...e,connectTriggerConfig:t.triggerConfig};default:return e}},z={notifications:[]},B={content:"",dismissed:!1,once:!1},H=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:z,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case m.vP:return{...e,notifications:[...e.notifications,{...B,id:t.id,buttonText:t.buttonText,buttonHref:t.buttonHref,content:t.content,icon:t.icon,once:t.once}]};case m.MN:{const n=e.notifications.findIndex(e=>e.id===t.id);if(-1===n)return e;const r=[...e.notifications];return r[n]={content:t.content,buttonHref:t.buttonHref,buttonText:t.buttonText,icon:t.icon,once:t.once,id:t.id},{...e,notifications:r}}case m.nG:return{...e,notifications:e.notifications.filter(e=>e.id!==t.id)};case m.oZ:{const n=e.notifications.find(e=>e.id===t.id);return{...e,notifications:[...e.notifications.filter(e=>e.id!==t.id),{...n,dismissed:!0}]}}default:return e}},U={inspectorOpen:!1,currentMessageId:null},V=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:U,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case m.ye:return{...e,currentMessageId:t.chatMessageId};case m.vK:return{...e,inspectorOpen:!e.inspectorOpen};default:return e}};var G=n(332);const W={context:{},labels:[]},q=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:W,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case G.s:return{...e,context:{...e.context,...t.context}};case G.T:return{...e,labels:[...new Set([...e.labels,t.label])]};case m.CB:return{...e,labels:[]};default:return e}};var K=n(9749),Y=n.n(K),X=n(467),Z=n(5013);const J=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Object.entries(e).reduce((e,t)=>{let[n,r]=t;return{...e,[(0,Z.A)(n)]:r}},{})};var Q=n(7720),ee=n(8172);const te={chatMessages:[],buttonClicks:[],attachments:[],messageSentTime:null,lastMessageSeen:null},ne=e=>{let{id:t}=e;return t},re=e=>{let{temporaryId:t,id:n}=e;return e=>{let{temporaryId:r,id:o}=e;return n===o||t===r}},oe=(e,t,n)=>e.map(e=>t(e)?n(e):e),ae=function(){var e,t,n,r;let o=arguments.length>0&&void 0!==arguments[0]?arguments[0]:te,a=arguments.length>1?arguments[1]:void 0;switch(a.type){case m.tq:{const{chatMessages:e}=o,{data:t}=a;if((0,Q.A)(e)(t)){const n={...t};return n.key||=n.id,u(o,"chatMessages",[...e,n])}const n=e.findIndex(e=>{let{id:n}=e;return n===t.id});if(t.key||=t.id,-1===n)return o;const r=[...e.slice(0,n),t,...e.slice(n+1)];return{...o,chatMessages:r}}case m.CB:return te;case m.fg:{const{chatbubble_temporary_id:e,id:t}=a.data,n=n=>{var r;let{id:o}=n;return Y()(r=[e,t]).call(r,o)},r=e=>({...e,message:a.data.message});return{...o,chatMessages:oe(o.chatMessages,n,r)}}case m.se:return{...o,messageSentTime:a.messageSentTime};case m.pz:{var i;const{created:e,id:t,temporaryId:n}=a,{chatMessages:r}=o,l=null!==(i=null==a?void 0:a.status)&&void 0!==i?i:null,s=r.findIndex(e=>{let{id:t}=e;return t===n});if(s<0)return o;const c=r[s],u={...c,created:e||c.created,id:t||c.id,status:l},d=r.map((e,t)=>t!==s?e:u);return{...o,chatMessages:d}}case m.jE:{const{chatMessageId:e,chatMessageTempId:t,patternContextMatch:n}=a.data,r=n=>{let{id:r}=n;return r===e||r===t},i=e=>({...e,pattern_context_match:n});return{...o,chatMessages:oe(o.chatMessages,r,i)}}case m.Y6:var l;return(0,X.A)(o.buttonClicks)(a.buttonClick)?{...o,buttonClicks:[...null!==(l=o.buttonClicks)&&void 0!==l?l:[],a.buttonClick]}:o;case m.kU:return{...o,lastMessageSeen:(0,ee.A)(a,["id","index"])};case m.Os:return{...o,attachments:[...null!==(e=o.attachments)&&void 0!==e?e:[],...(null===(t=a.data)||void 0===t||null===(n=t.attachments)||void 0===n?void 0:n.map(J))||[]]};case m.wP:{const e=J(a.attachment),t=re(e),n=t=>({...t,...e});return{...o,attachments:oe(o.attachments,t,n)}}case m.tS:{var s;const{attachments:e=[],temporaryChatMessageId:t,chatMessageId:n}=a.data,r=e.map(J),i=(null!==(s=o.attachments)&&void 0!==s?s:[]).map(e=>{const t=r.find(re(e));return t?{...e,...t}:e});let l=o.chatMessages;if(t&&n){const e=e=>{let{id:n}=e;return n===t},a=e=>({...e,id:n,attachment_ids:r.map(ne)});l=oe(o.chatMessages,e,a)}return{...o,attachments:i,chatMessages:l}}case m.QA:return null!==(r=a.formData)&&void 0!==r&&r.formKey?{...o,forms:{...o.forms,[a.formData.formKey]:a.formData}}:o;default:return o}},ie={slug:null,show:!1,isCustom:!1,dialogue:null,webhook:null,content:null,onRendered:null,nudgeLayout:{},nudgeType:f.MK.TEMPLATE,hasBeenDismissed:!1},le=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:ie,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case m.X2:return{...e,show:!1,nudgeLayout:{},hasBeenDismissed:!0};case m.wv:return{...e,show:!0,slug:t.slug,dialogue:t.dialogue,webhook:t.webhook,nudgeLayout:t.nudgeLayout,nudgeType:f.MK.TEMPLATE,trackEvent:t.trackEvent,hasBeenDismissed:!1};case m.un:return{...e,show:!0,isCustom:!0,slug:t.slug,content:t.content,nudgeLayout:{},onRendered:t.onRendered,nudgeType:f.MK.CUSTOM,trackEvent:t.trackEvent,hasBeenDismissed:!1};default:return e}};var se=n(9483);const ce={show:!1,text:null,agent:null,dismissed:!1,type:se.oI.MESSAGE,dismissedMessages:[]},ue=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:ce,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case m.II:return t.data.taken_over&&!e.taken_over?{...e,show:!0,agent:{name:t.data.name,avatar:t.data.avatar},text:void 0,type:se.oI.HANDOVER}:e;case m.tq:return(0,p.A)()||!t.data.from_bot||"SYSTEM"===t.data.sender||"greeting"===t.data.exchange_type?e:{...e,show:!0,text:t.data.message,type:se.oI.MESSAGE};case m.l:return{...e,show:!0,text:t.pushMessageText,dismissed:!1,type:t.pushMessageType,dismissedMessages:[...e.dismissedMessages,t.pushMessageTitle]};case m.a_:return{...e,show:!1,dismissed:!0};case m.a1:return ce;default:return e}};var de=n(5767);const pe=e=>{let{url:t,...n}=e;return(t||"").startsWith("data:")?n:{...n,url:t}},fe=e=>e?()=>e=>({bot:{splitTestLabel:e.bot.splitTestLabel,splitLabelTimestamp:e.bot.splitLabelTimestamp,hasInteraction:e.bot.hasInteraction},chatbubble:{active:!1,previouslyPoppedUp:e.chatbubble.previouslyPoppedUp,shownNudges:e.chatbubble.shownNudges},pushMessages:{dismissedMessages:e.pushMessages.dismissedMessages},agent:{name:e.agent.name}}):()=>e=>({alerts:{showBubbleNotification:e.alerts.showBubbleNotification},agent:{name:e.agent.name,takenOver:e.agent.takenOver,supportsAttachment:e.agent.supportsAttachment},bot:{splitTestLabel:e.bot.splitTestLabel,splitLabelTimestamp:e.bot.splitLabelTimestamp,hasInteraction:e.bot.hasInteraction},chatbubble:{...e.chatbubble,admin:void 0,currentlyPoppedUp:y.currentlyPoppedUp,allGreetingsHideInput:y.allGreetingsHideInput,contactDetailsButton:y.contactDetailsButton,attachments:y.attachments,isChatFullWindow:void 0,overlayViews:e.chatbubble.overlayViews.filter(e=>"FEEDBACK"===e),shownNudges:e.chatbubble.shownNudges,renderedBy:void 0},connection:{token:e.connection.token,connected:!0,pusherConnected:!1},feedback:{...e.feedback},local:{labels:e.local.labels},messages:{forms:e.messages.forms,chatMessages:e.messages.chatMessages,buttonClicks:e.messages.buttonClicks,attachments:(e.messages.attachments||[]).map(pe),messageSentTime:e.messages.messageSentTime,lastMessageSeen:e.messages.lastMessageSeen},pushMessages:{dismissedMessages:e.pushMessages.dismissedMessages}}),he=e=>t=>{let{active:n}=t.chatbubble;const r=(0,p.A)();return e.isFromMultitab||(n=t.chatbubble.active&&(Boolean(e.chatbubble.keep_open&&!r)||Boolean(e.chatbubble.keep_open_mobile&&r))),(0,c.A)(t,{chatbubble:{active:n,wasActiveOnLoad:n}})},me=e=>{var t;if((0,d.A)(e,"bot.includeDisabledLanguages",!1))return e;const n=null==e||null===(t=e.chatbubble)||void 0===t?void 0:t.currentLanguage,r=window.__KINDLY_SETTINGS__.supportedLanguages.some(e=>{let{code:t}=e;return t===n}),o=window.__KINDLY_SETTINGS__.supportedLanguages.find(e=>{let{is_primary:t}=e;return t});if(!o)throw new Error("Impossible state: primary language not found");return r?e:(0,c.A)(e,{chatbubble:{currentLanguage:o.code}})},ge=e=>{let{inPlatform:t,botKey:n}=e;return(e=>(t,n)=>{return r=(0,c.A)(t,n),e.reduce((e,t)=>{let[n,r]=t;return u(e,n,r)},r);var r})([["chatbubble.inPlatform",t],["chatbubble.botKey",n]].filter(e=>{let[,t]=e;return void 0!==t}))},be=e=>t=>{var n,r;const o=null==t||null===(n=t.messages)||void 0===n?void 0:n.chatMessages.filter(e=>e.from_bot).pop(),a=null!==(r=null==o?void 0:o.chat_live_translation_language_code)&&void 0!==r?r:null==o?void 0:o.chat_language_code,i=null!=a?a:e;return(0,c.A)(t,{chatbubble:{currentLanguage:i}})},ve=[e=>t=>n=>n.type===m.tq&&n.data.from_bot?(e.dispatch((0,_.MY)()),(0,_.CM)(),t(n)):t(n),e=>t=>n=>{switch(n.type){case m._N:return((e,t,n,r)=>{const{announcement:o,bot:a,chatbubble:i}=t;if(o.show)return n(r);const l={text:k(0,i,e),alertType:A.WARNING};return n({type:m.YU,payload:l}),n(r)})(T.OFFLINE,e.getState(),t,n);case m._Y:{const{announcement:r,connection:o}=e.getState();return r.show&&t({type:m.nW}),o.connected||e.dispatch((0,_.S4)()),t(n)}default:return t(n)}},e=>t=>async n=>{const{agent:{takenOver:r},chatbubble:{currentLanguage:o}}=e.getState();if(n.type===m.II){const{handoverConversationFeedback:t,preloadFeedbackImages:a}=(0,S.A)(o);r&&!1===n.data.taken_over&&t&&(a("handover_conversation"),e.dispatch((0,$.ob)(t)))}if(n.type!==m.tq)return t(n);const{from_bot:a,sender:i,was_anonymized:l,exchange_type:s,triggered_chat_start:c,chat_language_code:u,chat_live_translation_language_code:d}=n.data,h=d||u;if(n.type===m.tq&&(0,p.A)()&&a&&i!==f.bS.SYSTEM&&e.dispatch({type:m.Zb}),"greeting"===s||c)o!==h&&t({type:m.M2,code:h});else if(a&&h&&o!==h){var g;const{text:n}=e.getState().bot,r=null===(g=n.language_switch_notification)||void 0===g?void 0:g[h];r&&e.dispatch((0,$.cC)({content:r,buttonText:void 0,buttonHref:void 0,icon:"language"},f.Jm.LANGUAGE_SWITCH)),t({type:m.M2,code:u})}if(a||!l)return t(n);t({type:m.fg,data:n.data})},e=>t=>async n=>{var r;return n.type===m.A8&&(clearTimeout(C),C=setTimeout(()=>{e.getState().bot.isTyping&&t({type:m.wk})},1e3*((null===(r=n.data)||void 0===r?void 0:r.TTL)||10))),n.type===m.wk&&clearTimeout(C),t(n)},()=>e=>t=>{e("payload"in t?t:{...t,payload:{...t}})}];function ye(e){let{botKey:t,settings:n,persist:a=!0,initialChatLanguage:i,initialStateModifier:u}=e;const{inPlatform:d}=n,p=!n.inPlatform&&0===n.chatbubble.persist_state_lifespan_seconds,f=`kindly-chat-${t}`,h=fe(p),m=s(me,be(i),he(n),ge({inPlatform:d,botKey:t})),g=a?l()(null,{key:f,slicer:h,merge:m}):e=>e;let b=E({botKey:t,settings:n,initialChatLanguage:i});return u&&(b=(0,c.A)(b,u)),(0,o.U1)({reducer:{...r,feedback:de.Ay,chatbubble:w},preloadedState:b,middleware:e=>e().concat(...ve),enhancers:e=>e().concat(g),devTools:!1})}const we=a.wA.withTypes(),xe=a.d4.withTypes()},6057:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});const r=function(){let e=arguments.length>1?arguments[1]:void 0;return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).reduce((t,n)=>{var r;return{...t,[e(n)]:[...null!==(r=t[e(n)])&&void 0!==r?r:[],n]}},{})}},6064:(e,t,n)=>{"use strict";function r(e,t){if(!e)return;const n=[t,"en"].find(t=>t&&e[t]);return n?e[n]:void 0}n.d(t,{A:()=>r})},6079:(e,t,n)=>{"use strict";n.d(t,{CM:()=>E,Tk:()=>g,MY:()=>k,S4:()=>y,yh:()=>A,Zk:()=>S,Mk:()=>T,f2:()=>_,uK:()=>w});var r=n(9749),o=n.n(r),a=n(2221),i=n(467),l=n(4851),s=n(6057),c=n(7720),u=n(7173),d=n(7243);const p=[],f=[],h=[];let m=0;const g=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];t.length||([...p,...f].forEach(e=>{clearInterval(e)}),p.length=0,f.length=0,h.forEach(e=>{clearTimeout(e)}),h.length=0,m=0),o()(t).call(t,"handoverRequestPollIntervalIds")&&(p.forEach(e=>{clearInterval(e)}),p.length=0),o()(t).call(t,"handoverPollIntervalIds")&&(f.forEach(e=>{clearInterval(e)}),f.length=0),o()(t).call(t,"replyTimeoutIds")&&(h.forEach(e=>{clearTimeout(e)}),h.length=0,m=0)},b=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Object.entries(e).reduce((e,t)=>{let[n,r]=t;return{...e,[n.replace(/_\w/g,e=>e[1].toUpperCase())]:r}},{})},v=e=>{let{status:t}=e;return t!==a.Le.PROCESSING},y=()=>async(e,t)=>{const{agent:{takenOver:n,requestedHandoverAt:r,handoverWaitTimeEstimate:o,handoverQueuePosition:p},chatbubble:{startedAt:f,chatHasStarted:h,botKey:m},connection:{token:g},environment:{PAT_HOST:y},messages:{attachments:w,buttonClicks:E,chatMessages:k,messageSentTime:_}}=t();if(!g||!h)return;const[A]=k.filter(e=>{let{from_bot:t}=e;return t}).slice(-1),[T]=w.filter(v).slice(-1),S=((e,t)=>{let{created:n}=e,{created:r}=t;return n&&r?new Date(n)>new Date(r)?n:r:n||r})(null!=A?A:{},null!=T?T:{})||_||f||(new Date).toISOString(),$=await e((0,d.et)(`${y}/chatbubble/${a.Ak}/latest?timestamp=${S}`,{method:"GET",...(0,l.A)({token:g})},{onError:t=>{var n;403===(null===(n=t.response)||void 0===n?void 0:n.status)?(console.warn(`/chatbubble/${a.Ak}/latest returned 403, starting new chat`),e({type:u.tr,error:403}),e((0,d.zX)(m,!0))):console.error(t)}}));if(!$||!$.data)return;const{chatMessages:C,buttonClicks:O=[],takenOver:I,requestedHandoverAt:L,attachments:M,externalHandoverState:N,handoverWaitTimeEstimate:R,handoverQueuePosition:P}=$.data,D=(0,c.A)(k),j=(0,i.A)(E),F=C.filter(D),z=O.map(b).filter(j),B=F.length>0;var H,U;e((e=>async(t,n)=>{if((null==e?void 0:e.length)>0)return;const{attachments:r=[]}=n().messages,{newAttachments:o=[],updated:i=[]}=(0,s.A)(function(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).filter(e=>{let{sender:t,status:n}=e;return t===a.bS.USER||n===a.Le.CLEAN})}(e),e=>r.find((e=>{let{id:t,temporaryId:n}=e;return e=>{let{id:r,temporaryId:o}=e;return t&&t===r||n&&n===o}})(e))?"updated":"newAttachments");o.length>0&&t({type:u.Os,data:{attachments:o}}),i.length>0&&t({type:u.tS,data:{attachments:i}})})(M)),e(x(B)),n!==I&&e({type:u.II,data:{taken_over:I,supports_attachment:null==N?void 0:N.supports_attachment,requested_handover_at:L}}),r!==L&&e({type:u.nz,data:{requested_handover_at:L,handover_wait_time_estimate:R,handover_queue_position:P}}),o===R&&p===P||e({type:u.AQ,data:{handover_wait_time_estimate:R,handover_queue_position:P}}),(H=F,U="created",(H||[]).slice().sort((e,t)=>e[U]<t[U]?-1:1)).forEach(t=>{e({type:u.tq,data:t})}),z.forEach(t=>e({type:u.Y6,buttonClick:t}))},w=()=>e=>{if(g("replyTimeoutIds"),f.length)return;const t=setTimeout(()=>e(y()),a.RT.REPLY_TIMEOUT_MS);h.push(t),m=1},x=e=>t=>{if(g("replyTimeoutIds"),0===m)return;if(e||!(m<a.RT.REPLY_TIMEOUT_MAX_ATTEMPTS))return void(e||console.error(`Reply timeout failed more than ${a.RT.REPLY_TIMEOUT_MAX_ATTEMPTS} times`));const n=a.RT.REPLY_TIMEOUT_MS*a.RT.REPLY_TIMEOUT_MS_MULTIPLIER**m,r=setTimeout(()=>t(y()),n);h.push(r),m+=1},E=()=>g("replyTimeoutIds"),k=()=>e=>{if(f.length){g("handoverPollIntervalIds");const t=setInterval(()=>e(y()),a.RT.HANDOVER_POLL_INTERVAL_MS);p.push(t)}if(p.length){g("handoverRequestPollIntervalIds");const t=setInterval(()=>e(y()),a.RT.HANDOVER_REQUEST_POLL_INTERVAL_MS);p.push(t)}},_=()=>e=>{if(g(),f.length)return;const t=setInterval(()=>e(y()),a.RT.HANDOVER_POLL_INTERVAL_MS);f.push(t)},A=()=>g("handoverPollIntervalIds"),T=()=>e=>{if(p.length)return;const t=setInterval(()=>e(y()),a.RT.HANDOVER_REQUEST_POLL_INTERVAL_MS);p.push(t)},S=()=>g("handoverRequestPollIntervalIds")},6100:(e,t,n)=>{"use strict";var r=n(1780),o=Function.prototype,a=o.call,i=r&&o.bind.bind(a,a);e.exports=r?i:function(e){return function(){return a.apply(e,arguments)}}},6249:(e,t,n)=>{"use strict";n.d(t,{A:()=>a});var r=n(8089),o=n.n(r);const a=(e,t)=>o()({},e,t)},6253:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var r=n(9155);const o=(e,t)=>{const n=(0,r.useRef)();return(0,r.useCallback)(r=>{var o;new Date-n.current<t?null==r||null===(o=r.preventDefault)||void 0===o||o.call(r):(e(r),n.current=new Date)},[t,e])}},6281:(e,t,n)=>{"use strict";var r=n(1003),o=n(2769),a=n(4317),i=n(7460),l=Object;e.exports=i?function(e){return"symbol"==typeof e}:function(e){var t=r("Symbol");return o(t)&&a(t.prototype,l(e))}},6367:(e,t,n)=>{"use strict";n.d(t,{GJ:()=>i,NY:()=>s,fz:()=>c,n6:()=>d,tf:()=>u});const r=["load","message"],o="See https://docs.kindly.ai/api/chat#handlers for how to switch.",a=function(e,t,n,a){var i,l;let s=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];if(-1!==r.indexOf(e)&&Boolean(a)&&function(e,t,n){const r=`on${t.charAt(0).toUpperCase()+t.slice(1)}`;if("function"!=typeof e)return void console.warn(`Provided setting '${r}' is not a function.`);console.warn(`kindlyOptions.${r} is deprecated in favor of standard event handlers. ${o}`);const a=Object.values(n);try{e(...a)}catch(e){console.error(e)}}(a,e,t),"API"!==n)return!0;if(null===(i=window)||void 0===i||null===(l=i.kindlyChat)||void 0===l||!l.APIRoot)return console.warn("No APIRoot when rendered using kindly-chat API"),!0;"message"===e&&window.kindlyChat.APIRoot.dispatchEvent(new CustomEvent("onMessage",{detail:t}));const c=`kindly:${e}`;return window.kindlyChat.APIRoot.dispatchEvent(new CustomEvent(c,{detail:t,bubbles:!0,cancelable:s}))};function i(e,t,n,r){e&&a("message",{newMessage:e,chatLog:t},r,n)}let l=!1;function s(e){!1===l&&(l=!0,a("load",{settings:e},null==e?void 0:e.renderedBy,null==e?void 0:e.onLoad))}const c=e=>{let{button:t,buttonType:n,chatLog:r,event:a,handlers:i,lastMessage:l,renderedBy:s}=e,c=!1;const u=null==i?void 0:i[n];if(u){console.warn(`kindlyOptions.buttonHandlers is deprecated in favor of standard event handlers. ${o}`);try{c=Boolean(u(a,t,l,r,n))}catch(e){console.error(e)}}var d;return"API"===s&&(c=!(null!==(d=window.kindlyChat)&&void 0!==d&&d.APIRoot.dispatchEvent(new CustomEvent("kindly:buttonclick",{detail:{button:t,lastMessage:l,chatLog:r,buttonType:n},bubbles:!0,cancelable:!0})))),c};function u(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{source:n="user",storeState:r}=arguments.length>2?arguments[2]:void 0;const{chatbubble:{chatId:o,renderedBy:i}}=r,l={...t,chatId:o,source:n,type:e};return a("ui",l,i,void 0,!1)}const d=e=>{var t;let{type:n,icon:r,renderedBy:o}=e;return"API"!==o||!(null!==(t=window.kindlyChat)&&void 0!==t&&t.APIRoot.dispatchEvent(new CustomEvent("kindly:globalicon",{detail:{type:n,icon:r},bubbles:!0,cancelable:!0})))}},6421:(e,t,n)=>{"use strict";n.d(t,{A:()=>i}),n(1949);var r=n(9155),o=n.n(r);const a=n(3864).Ay.div`
1170
1170
  transition: all 0.3s ease-in-out;
1171
1171
  `,i=function(e){let{children:t,carouselPosition:n,onTouchEnd:r,onTouchMove:i,onTouchStart:l}=e;return o().createElement(a,{onTouchStart:l,onTouchEnd:r,onTouchMove:i,style:{transform:`translateX(${n}px)`}},t)}},6538:(e,t,n)=>{"use strict";function r(e,t,n){return o(e)?n:t}function o(e){let t=e;l(e)&&(t=function(e){const t=e.indexOf(",")>-1?",":" ";let n=(+(e=e.substr(4).split(")")[0].split(t))[0]).toString(16),r=(+e[1]).toString(16),o=(+e[2]).toString(16);return 1===n.length&&(n=`0${n}`),1===r.length&&(r=`0${r}`),1===o.length&&(o=`0${o}`),`#${n}${r}${o}`}(e)),s(e)&&(t=a(e));const n="#"===t.charAt(0)?t.substring(1,7):t,r=[parseInt(n.substring(0,2),16)/255,parseInt(n.substring(2,4),16)/255,parseInt(n.substring(4,6),16)/255].map(e=>e<=.03928?e/12.92:((e+.055)/1.055)**2.4);return.2126*r[0]+.7152*r[1]+.0722*r[2]>.179}function a(e){return e.replace(i,(e,t,n,r)=>`#${t}${t}${n}${n}${r}${r}`)}n.d(t,{J7:()=>c,SW:()=>o,w5:()=>r});const i=/^#?([a-f\d])([a-f\d])([a-f\d])$/i,l=e=>e.match(/^rgb/),s=e=>e.match(i);function c(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:120;const r=u(e),o=u(t);return Math.sqrt((r[0]-o[0])**2+(r[1]-o[1])**2+(r[2]-o[2])**2)<=n}function u(e){if(l(e))return e.match(/\d+/g).map(Number);let t="#"===e.charAt(0)?e.substring(1):e;return s(e)&&(t=a(t).substring(1)),[parseInt(t.substring(0,2),16),parseInt(t.substring(2,4),16),parseInt(t.substring(4,6),16)]}},6804:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>k});var r=n(9155),o=n.n(r),a=n(541),i=n(5256),l=n(1328),s=n(1872),c=n(1695),u=n(3864),d=n(3249),p=n(4927),f=n(8905);const h=u.Ay.div`
1172
1172
  display: flex;
@@ -1249,7 +1249,7 @@
1249
1249
  ${e=>e.$active&&`\n background: #${f.Tj.grayColor};\n background-color: #${f.Tj.grayColor};\n `}
1250
1250
 
1251
1251
  ${e=>e.$tail&&"\n &:after {\n content: '';\n position: absolute;\n right: -6px;\n top: 50%;\n transform: translateY(-50%);\n width: 0;\n height: 0;\n border-top: 6px solid transparent;\n border-bottom: 6px solid transparent;\n border-left: 6px solid #ccc;\n }\n "}
1252
- `;var w=n(6253),x=n(4703);const E=1e3;function k(e){let{active:t}=e;const[n,u]=(0,r.useState)(!1),{botKey:d,admin:p}=(0,a.d4)(c.$P),{supportedLanguages:f}=(0,l.A)(),{fullscreenMode:k}=(0,a.d4)(c.Od),{inspectorOpen:_}=(0,a.d4)(c.qV),A=(0,a.wA)(),T=(0,r.useCallback)(()=>{A((0,s.uz)())},[A]);return function(){var e,t;const n=(0,a.wA)(),{admin:o}=(0,a.d4)(c.$P),{chatMessages:i}=(0,a.d4)(c.DZ)||[],l=null===(e=i.filter(e=>!(null!=e&&e.from_bot)).slice(-1))||void 0===e||null===(t=e[0])||void 0===t?void 0:t.message,s=(0,w.A)(e=>{n((0,x.y2)(e))},E),u=(0,r.useCallback)(e=>{e.altKey&&"KeyR"===e.code&&l&&s(l)},[l,s]);(0,r.useEffect)(()=>{if(o)return window.addEventListener("keydown",u,!0),()=>window.removeEventListener("keydown",u,!0)},[u,o])}(),o().createElement(h,{$active:t},n&&t&&o().createElement(g,null,f.map(e=>o().createElement(y,{key:e.code,title:`Restart ${e.name_local}`,onClick:()=>{return t=e.code,A((0,s.L4)(t)),void u(!1);var t}},o().createElement(b,null,e.code.toUpperCase())))),o().createElement(m,{$active:t,$hasInspector:p,$fullscreenMode:k},p&&o().createElement(v,null,o().createElement(y,{onClick:T,title:_?"Close chat inspector":"Open chat inspector"},_?o().createElement(i.V$,null):o().createElement(i.bM,null))),o().createElement(v,null,o().createElement(y,{title:"Restart chat",onClick:()=>{f.length>1?u(!n):A((0,s.zX)(d,!0))},$active:n,$tail:f.length>1},o().createElement(i.fN,{width:15,height:15})))))}},7e3:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});const r=(e,t)=>Boolean((e=>{const t=e.replace(/\./g,"\\.").replace(/\*/g,".*").replace(/\//g,"\\/").replace(/\?/g,"\\?");return new RegExp(t,"i")})(t).test(e))},7013:(e,t,n)=>{"use strict";var r=n(1780),o=Function.prototype,a=o.apply,i=o.call;e.exports="object"==typeof Reflect&&Reflect.apply||(r?i.bind(a):function(){return i.apply(a,arguments)})},7050:(e,t,n)=>{"use strict";var r=n(1949),o=n.n(r),a=n(2221);const i=o().arrayOf(o().shape({selected:o().bool.isRequired,_id:o().string.isRequired,score:o().number.isRequired,sample:o().string.isRequired}));o().shape({message:o().string,from_bot:o().bool,image_carousel:o().arrayOf(o().object),exchange_type:o().string,exchange_id:o().string,avatar:o().string,sender:o().oneOf(Object.values(a.bS)),skill_subscription_id:o().number,bot_id:o().number,score:o().number,title:o().string,reply_candidates:i,is_followup:o().bool,handler:o().oneOf(Object.values(a.Gi)),new_context:o().objectOf(o().string)})},7161:(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},7173:(e,t,n)=>{"use strict";n.d(t,{M_:()=>r,MU:()=>o,nW:()=>g,YU:()=>m,fg:()=>j,FZ:()=>$.FZ,YR:()=>$.YR,K_:()=>y,A8:()=>E,wk:()=>k,Y6:()=>F,Q4:()=>$.Q4,Tc:()=>A,uS:()=>$.uS,SO:()=>$.SO,_Y:()=>C._Y,zT:()=>C.zT,wX:()=>ee,MO:()=>J,nG:()=>N,_N:()=>C._N,Kd:()=>te,oZ:()=>M,u2:()=>h,X2:()=>Y,a_:()=>ne,wM:()=>$.wM,dp:()=>x,II:()=>l,MM:()=>i,nz:()=>a,t1:()=>$.t1,qQ:()=>v,tS:()=>z,E7:()=>S,Os:()=>B,tq:()=>H,ny:()=>C.ny,kA:()=>$.kA,$o:()=>O,jE:()=>R,hn:()=>$.hn,mz:()=>C.mz,kP:()=>C.kP,VZ:()=>C.VZ,MN:()=>L,nh:()=>u,a1:()=>oe,oE:()=>Q,TF:()=>$.TF,XM:()=>$.XM,d$:()=>$.d$,Xu:()=>$.Xu,tr:()=>$.MO,QA:()=>U,uA:()=>$.uA,ye:()=>P,M2:()=>$.M2,kU:()=>V,se:()=>G,mw:()=>_,nm:()=>$.nm,HW:()=>$.HW,Zb:()=>f,Eg:()=>$.Eg,un:()=>Z,vP:()=>I,wv:()=>X,nX:()=>$.nX,l:()=>re,Wh:()=>p,CB:()=>$.CB,Rk:()=>w,vK:()=>D,IM:()=>W,zZ:()=>b,wP:()=>q,pz:()=>K,AQ:()=>d,Q0:()=>T,c6:()=>s,we:()=>c});const r="AGENT_STARTED_TYPING",o="AGENT_STOPPED_TYPING",a="HANDOVER_REQUESTED",i="HANDOVER_CANCELLED",l="HANDOVER",s="USER_STARTED_TYPING",c="USER_STOPPED_TYPING",u="RESET_HAS_HAD_HANDOVER",d="UPDATE_HANDOVER_QUEUE",p="SHOW_TAB_NOTIFICATION",f="SHOW_BUBBLE_NOTIFICATION",h="DISMISS_NOTIFICATIONS",m="ANNOUNCEMENT_SHOW",g="ANNOUNCEMENT_HIDE",b="UNAUTHENTICATED",v="IDENTIFIED",y="AUTHENTICATED",w="START_REFRESHING",x="END_REFRESHING",E="BOT_STARTED_TYPING",k="BOT_STOPPED_TYPING",_="SET_SPLIT_TEST_LABEL",A="CLEAR_SPLIT_TEST_LABEL",T="UPDATE_SPLIT_LABEL_TIMEOUT",S="MIMIR_STARTED_SEARCHING";var $=n(3313),C=n(7523);const O="ENVIRONMENT_OVERRIDE",I="SHOW_IN_CHAT_NOTIFICATION",L="REPLACE_IN_CHAT_NOTIFICATION",M="DISMISS_IN_CHAT_NOTIFICATION",N="DELETE_IN_CHAT_NOTIFICATION",R="PATTERN_CONTEXT_MATCH",P="SET_INSPECTED_CHAT_MESSAGE",D="TOGGLE_INSPECTOR",j="ANONYMIZED_MESSAGE",F="BUTTON_CLICK",z="MESSAGE_ATTACHMENTS_UPDATED",B="NEW_ATTACHMENTS",H="NEW_MESSAGE",U="SET_FORM",V="SET_LAST_MESSAGE_SEEN",G="SET_MESSAGE_SENT_TIME",W="TRIGGER_DIALOGUE",q="UPDATE_ATTACHMENT",K="UPDATE_CHAT_MESSAGE",Y="DISMISS_NUDGE",X="SHOW_NUDGE",Z="SHOW_CUSTOM_NUDGE",J="CTA_CLICK",Q="SESSION_COMPLETION",ee="COUNT_NUDGE",te="DISCOUNT_NUDGE",ne="DISMISS_PUSH_MESSAGE",re="SHOW_PUSH_MESSAGE",oe="RESET_PUSH_MESSAGES"},7235:(e,t,n)=>{"use strict";var r=n(262),o=String,a=TypeError;e.exports=function(e){if(r(e))return e;throw new a(o(e)+" is not an object")}},7243:(e,t,n)=>{"use strict";n.d(t,{Rm:()=>x,TP:()=>E,zX:()=>m,Cy:()=>y,et:()=>v,DT:()=>w,m8:()=>h,R7:()=>f});var r=n(9749),o=n.n(r),a=n(2221),i=n(2366),l=n(4851),s=n(9292),c=n(8172),u=n(9313),d=n(2633),p=n(7173);const f=e=>async(t,n)=>{const{connection:{token:r},environment:{PAT_HOST:o}}=n();return r?fetch(`${o}/chatbubble/${a.Ak}/user_left/`,{method:"PATCH",...(0,l.A)({token:r,botKey:e})}):null},h=()=>async(e,t)=>{const{connection:{token:n},environment:{PAT_HOST:r},auth:{fullName:o}}=t();return n?fetch(`${r}/chatbubble/${a.Ak}/handover_cancel/`,{method:"POST",body:JSON.stringify({source:o}),...(0,l.A)({token:n},{extra:{"Content-Type":"application/json"}})}):null},m=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return async(n,r)=>{const{agent:{takenOver:o,requestedHandoverAt:i}}=r();i?n({type:p.MM}):o&&n({type:p.II,data:{taken_over:!1}}),n({type:p.a1}),n(f(e)),n({type:p.wk});try{(0,u.Zf)(),t||n({type:p.uS})}catch(e){console.warn(e)}finally{n((0,d.F)(a.Jm.LANGUAGE_SWITCH)),n({type:p.CB,botKey:e,keepOpen:t}),t||setTimeout(()=>n({type:p.d$,chatHasStarted:!1}),300)}}},g=Object.freeze({MAX:3,TIMEOUT_MS:2e3,TIMEOUT_MULTIPLIER:2,RESPONSE_STATUSES:[401,403]});let b=0;const v=function(e,t){let{onError:n,restartOnError:r}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return async a=>{if(!e)return console.error("Tried to call transport without supplying url"),null;if(!t.method)return console.error("Tried to call transport without supplying method"),null;t.headers={"kindly-chat-version":"2.76.8",[i.B]:(0,i.U)(),...t.headers||{}};try{const n=await fetch(e,{...t,...t.body&&{body:t.body instanceof ArrayBuffer?t.body:JSON.stringify(t.body)},headers:{"Content-Type":"application/json",...t.headers&&{...t.headers}}});if(!(t.body instanceof ArrayBuffer)){const e=await n.json();return{status:n.status,statusText:n.statusText,ok:n.ok,data:e}}return n}catch(e){return n?n(e,t):r?a(((e,t)=>function(n){var r,a,i,l;if(!e.response||!o()(r=g.RESPONSE_STATUSES).call(r,null===(a=e.response)||void 0===a?void 0:a.status))return console.error(e),null;if(b+=1,b>g.MAX)return console.error(`${t.url} returned ${null===(l=e.response)||void 0===l?void 0:l.status}, max chats restarts exceeded`),null;console.warn(`${t.url} returned ${null===(i=e.response)||void 0===i?void 0:i.status}, starting new chat`);const s=g.TIMEOUT_MS*g.TIMEOUT_MULTIPLIER**(b-1);return setTimeout(()=>n((e,t)=>{const{botKey:n}=t().chatbubble;e(m(n,!0))}),s),null})(e,t)):null}}},y=e=>{const t=`private-chatbubble-${e}`;(0,u.B1)(t,"mimir-started-searching",p.E7),(0,u.B1)(t,"agent_started_typing",p.M_),(0,u.B1)(t,"agent_stopped_typing",p.MU),(0,u.B1)(t,"message-attachments-updated",p.tS),(0,u.B1)(t,"message",p.tq),(0,u.B1)(t,"bot_started_typing",p.A8),(0,u.B1)(t,"bot_stopped_typing",p.wk),(0,u.B1)(t,"new-attachments",p.Os),(0,u.B1)(t,"pattern-context-match",p.jE),(0,u.B1)(t,"takeover",p.II)},w=e=>{const t=`private-chatbubble-${e}`;(0,u.al)(t,"mimir-started-searching",p.E7),(0,u.al)(t,"agent_started_typing",p.M_),(0,u.al)(t,"agent_stopped_typing",p.MU),(0,u.al)(t,"message-attachments-updated",p.tS),(0,u.al)(t,"message",p.tq),(0,u.al)(t,"bot_started_typing",p.A8),(0,u.al)(t,"bot_stopped_typing",p.wk),(0,u.al)(t,"new-attachments",p.Os),(0,u.al)(t,"pattern-context-match",p.jE),(0,u.al)(t,"takeover",p.II)},x=e=>{let{message:t,error:n,level:r="info",extra:o={}}=e;return(e,i)=>{var u;const d=i(),{connection:{token:p},environment:{PAT_HOST:f},chatbubble:{chatId:h}}=d,m={tags:{chat_id:h,bot_id:null===(u=d.bot)||void 0===u?void 0:u.id}},g=(e=>{var t,n;let{level:r="info",error:o,message:a,reduxState:i,extra:l}=e;a||null!=o&&o.message||(console.error("Attempted to log without message"),a="No error message provided");const u=(0,c.A)(i||{},s.W$),d={version:"2.76.8",release:"2.76.8",userAgent:navigator.userAgent,state:i?JSON.stringify(u):void 0,...l},p={message:null!==(t=a)&&void 0!==t?t:null==o?void 0:o.message,name:null==o?void 0:o.name,stack:null==o?void 0:o.stack,code:null==o?void 0:o.code,signal:null==o?void 0:o.signal,filename:null==o?void 0:o.filename};return{message:null!==(n=a)&&void 0!==n?n:null==o?void 0:o.message,level:r,extra:d,error:p}})({level:r,error:n,message:t,reduxState:d,extra:{...(b=o,JSON.parse(JSON.stringify(b,(e,t)=>void 0===t?"undefined 🤷‍♂️":t))),...m}});var b;e(v(`${f}/chatbubble/${a.Ak}/log`,{method:"POST",body:g,...(0,l.A)({token:p},{withCurrentUrl:!0})}))}},E=e=>t=>{t({type:p.se,messageSentTime:e})}},7251:(e,t,n)=>{"use strict";function r(e){return`Minified Redux error #${e}; visit https://redux.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}n.d(t,{U1:()=>de,zD:()=>ye,Z0:()=>Ae});var o=(()=>"function"==typeof Symbol&&Symbol.observable||"@@observable")(),a=()=>Math.random().toString(36).substring(7).split("").join("."),i={INIT:`@@redux/INIT${a()}`,REPLACE:`@@redux/REPLACE${a()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${a()}`};function l(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 s(e,t,n){if("function"!=typeof e)throw new Error(r(2));if("function"==typeof t&&"function"==typeof n||"function"==typeof n&&"function"==typeof arguments[3])throw new Error(r(0));if("function"==typeof t&&void 0===n&&(n=t,t=void 0),void 0!==n){if("function"!=typeof n)throw new Error(r(1));return n(s)(e,t)}let a=e,c=t,u=new Map,d=u,p=0,f=!1;function h(){d===u&&(d=new Map,u.forEach((e,t)=>{d.set(t,e)}))}function m(){if(f)throw new Error(r(3));return c}function g(e){if("function"!=typeof e)throw new Error(r(4));if(f)throw new Error(r(5));let t=!0;h();const n=p++;return d.set(n,e),function(){if(t){if(f)throw new Error(r(6));t=!1,h(),d.delete(n),u=null}}}function b(e){if(!l(e))throw new Error(r(7));if(void 0===e.type)throw new Error(r(8));if("string"!=typeof e.type)throw new Error(r(17));if(f)throw new Error(r(9));try{f=!0,c=a(c,e)}finally{f=!1}return(u=d).forEach(e=>{e()}),e}return b({type:i.INIT}),{dispatch:b,subscribe:g,getState:m,replaceReducer:function(e){if("function"!=typeof e)throw new Error(r(10));a=e,b({type:i.REPLACE})},[o]:function(){const e=g;return{subscribe(t){if("object"!=typeof t||null===t)throw new Error(r(11));function n(){const e=t;e.next&&e.next(m())}return n(),{unsubscribe:e(n)}},[o](){return this}}}}}function c(...e){return 0===e.length?e=>e:1===e.length?e[0]:e.reduce((e,t)=>(...n)=>e(t(...n)))}function u(e){return({dispatch:t,getState:n})=>r=>o=>"function"==typeof o?o(t,n,e):r(o)}var d=u(),p=u,f=Symbol.for("immer-nothing"),h=Symbol.for("immer-draftable"),m=Symbol.for("immer-state");function g(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var b=Object.getPrototypeOf;function v(e){return!!e&&!!e[m]}function y(e){return!!e&&(x(e)||Array.isArray(e)||!!e[h]||!!e.constructor?.[h]||T(e)||S(e))}var w=Object.prototype.constructor.toString();function x(e){if(!e||"object"!=typeof e)return!1;const t=b(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)===w}function E(e,t){0===k(e)?Reflect.ownKeys(e).forEach(n=>{t(n,e[n],e)}):e.forEach((n,r)=>t(r,n,e))}function k(e){const t=e[m];return t?t.type_:Array.isArray(e)?1:T(e)?2:S(e)?3:0}function _(e,t){return 2===k(e)?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function A(e,t,n){const r=k(e);2===r?e.set(t,n):3===r?e.add(n):e[t]=n}function T(e){return e instanceof Map}function S(e){return e instanceof Set}function $(e){return e.copy_||e.base_}function C(e,t){if(T(e))return new Map(e);if(S(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);const n=x(e);if(!0===t||"class_only"===t&&!n){const t=Object.getOwnPropertyDescriptors(e);delete t[m];let n=Reflect.ownKeys(t);for(let r=0;r<n.length;r++){const o=n[r],a=t[o];!1===a.writable&&(a.writable=!0,a.configurable=!0),(a.get||a.set)&&(t[o]={configurable:!0,writable:!0,enumerable:a.enumerable,value:e[o]})}return Object.create(b(e),t)}{const t=b(e);if(null!==t&&n)return{...e};const r=Object.create(t);return Object.assign(r,e)}}function O(e,t=!1){return L(e)||v(e)||!y(e)||(k(e)>1&&(e.set=e.add=e.clear=e.delete=I),Object.freeze(e),t&&Object.entries(e).forEach(([e,t])=>O(t,!0))),e}function I(){g(2)}function L(e){return Object.isFrozen(e)}var M,N={};function R(e){const t=N[e];return t||g(0),t}function P(){return M}function D(e,t){t&&(R("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function j(e){F(e),e.drafts_.forEach(B),e.drafts_=null}function F(e){e===M&&(M=e.parent_)}function z(e){return M={drafts_:[],parent_:M,immer_:e,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function B(e){const t=e[m];0===t.type_||1===t.type_?t.revoke_():t.revoked_=!0}function H(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];return void 0!==e&&e!==n?(n[m].modified_&&(j(t),g(4)),y(e)&&(e=U(t,e),t.parent_||G(t,e)),t.patches_&&R("Patches").generateReplacementPatches_(n[m].base_,e,t.patches_,t.inversePatches_)):e=U(t,n,[]),j(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==f?e:void 0}function U(e,t,n){if(L(t))return t;const r=t[m];if(!r)return E(t,(o,a)=>V(e,r,t,o,a,n)),t;if(r.scope_!==e)return t;if(!r.modified_)return G(e,r.base_,!0),r.base_;if(!r.finalized_){r.finalized_=!0,r.scope_.unfinalizedDrafts_--;const t=r.copy_;let o=t,a=!1;3===r.type_&&(o=new Set(t),t.clear(),a=!0),E(o,(o,i)=>V(e,r,t,o,i,n,a)),G(e,t,!1),n&&e.patches_&&R("Patches").generatePatches_(r,n,e.patches_,e.inversePatches_)}return r.copy_}function V(e,t,n,r,o,a,i){if(v(o)){const i=U(e,o,a&&t&&3!==t.type_&&!_(t.assigned_,r)?a.concat(r):void 0);if(A(n,r,i),!v(i))return;e.canAutoFreeze_=!1}else i&&n.add(o);if(y(o)&&!L(o)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;U(e,o),t&&t.scope_.parent_||"symbol"==typeof r||!Object.prototype.propertyIsEnumerable.call(n,r)||G(e,o)}}function G(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&O(t,n)}var W={get(e,t){if(t===m)return e;const n=$(e);if(!_(n,t))return function(e,t,n){const r=Y(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_||!y(r)?r:r===K(e.base_,t)?(Z(e),e.copy_[t]=J(r,e)):r},has:(e,t)=>t in $(e),ownKeys:e=>Reflect.ownKeys($(e)),set(e,t,n){const r=Y($(e),t);if(r?.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const r=K($(e),t),i=r?.[m];if(i&&i.base_===n)return e.copy_[t]=n,e.assigned_[t]=!1,!0;if(((o=n)===(a=r)?0!==o||1/o==1/a:o!=o&&a!=a)&&(void 0!==n||_(e.base_,t)))return!0;Z(e),X(e)}var o,a;return e.copy_[t]===n&&(void 0!==n||t in e.copy_)||Number.isNaN(n)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=n,e.assigned_[t]=!0),!0},deleteProperty:(e,t)=>(void 0!==K(e.base_,t)||t in e.base_?(e.assigned_[t]=!1,Z(e),X(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0),getOwnPropertyDescriptor(e,t){const n=$(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r?{writable:!0,configurable:1!==e.type_||"length"!==t,enumerable:r.enumerable,value:n[t]}:r},defineProperty(){g(11)},getPrototypeOf:e=>b(e.base_),setPrototypeOf(){g(12)}},q={};function K(e,t){const n=e[m];return(n?$(n):e)[t]}function Y(e,t){if(!(t in e))return;let n=b(e);for(;n;){const e=Object.getOwnPropertyDescriptor(n,t);if(e)return e;n=b(n)}}function X(e){e.modified_||(e.modified_=!0,e.parent_&&X(e.parent_))}function Z(e){e.copy_||(e.copy_=C(e.base_,e.scope_.immer_.useStrictShallowCopy_))}function J(e,t){const n=T(e)?R("MapSet").proxyMap_(e,t):S(e)?R("MapSet").proxySet_(e,t):function(e,t){const n=Array.isArray(e),r={type_:n?1:0,scope_:t?t.scope_:P(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let o=r,a=W;n&&(o=[r],a=q);const{revoke:i,proxy:l}=Proxy.revocable(o,a);return r.draft_=l,r.revoke_=i,l}(e,t);return(t?t.scope_:P()).drafts_.push(n),n}function Q(e){if(!y(e)||L(e))return e;const t=e[m];let n;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=C(e,t.scope_.immer_.useStrictShallowCopy_)}else n=C(e,!0);return E(n,(e,t)=>{A(n,e,Q(t))}),t&&(t.finalized_=!1),n}E(W,(e,t)=>{q[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}}),q.deleteProperty=function(e,t){return q.set.call(this,e,t,void 0)},q.set=function(e,t,n){return W.set.call(this,e[0],t,n,e[0])};var ee=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&&g(6),void 0!==n&&"function"!=typeof n&&g(7),y(e)){const o=z(this),a=J(e,void 0);let i=!0;try{r=t(a),i=!1}finally{i?j(o):F(o)}return D(o,n),H(r,o)}if(!e||"object"!=typeof e){if(r=t(e),void 0===r&&(r=e),r===f&&(r=void 0),this.autoFreeze_&&O(r,!0),n){const t=[],o=[];R("Patches").generateReplacementPatches_(e,r,t,o),n(t,o)}return r}g(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;y(e)||g(8),v(e)&&(v(t=e)||g(10),e=Q(t));const n=z(this),r=J(e,void 0);return r[m].isManual_=!0,F(n),r}finishDraft(e,t){const n=e&&e[m];n&&n.isManual_||g(9);const{scope_:r}=n;return D(r,t),H(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=R("Patches").applyPatches_;return v(e)?r(e,t):this.produce(e,e=>r(e,t))}},te=ee.produce;ee.produceWithPatches.bind(ee),ee.setAutoFreeze.bind(ee),ee.setUseStrictShallowCopy.bind(ee),ee.applyPatches.bind(ee),ee.createDraft.bind(ee),ee.finishDraft.bind(ee),n(9907);var ne="undefined"!=typeof window&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(0!==arguments.length)return"object"==typeof arguments[0]?c:c.apply(null,arguments)},re=("undefined"!=typeof window&&window.__REDUX_DEVTOOLS_EXTENSION__&&window.__REDUX_DEVTOOLS_EXTENSION__,e=>e&&"function"==typeof e.match);function oe(e,t){function n(...n){if(t){let r=t(...n);if(!r)throw new Error($e(0));return{type:e,payload:r.payload,..."meta"in r&&{meta:r.meta},..."error"in r&&{error:r.error}}}return{type:e,payload:n[0]}}return n.toString=()=>`${e}`,n.type=e,n.match=t=>function(e){return l(e)&&"type"in e&&"string"==typeof e.type}(t)&&t.type===e,n}var ae=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 ie(e){return y(e)?te(e,()=>{}):e}function le(e,t,n){return e.has(t)?e.get(t):e.set(t,n(t)).get(t)}var se=()=>function(e){const{thunk:t=!0,immutableCheck:n=!0,serializableCheck:r=!0,actionCreatorCheck:o=!0}=e??{};let a=new ae;return t&&("boolean"==typeof t?a.push(d):a.push(p(t.extraArgument))),a},ce=e=>t=>{setTimeout(t,e)},ue=e=>function(t){const{autoBatch:n=!0}=t??{};let r=new ae(e);return n&&r.push(((e={type:"raf"})=>t=>(...n)=>{const r=t(...n);let o=!0,a=!1,i=!1;const l=new Set,s="tick"===e.type?queueMicrotask:"raf"===e.type?"undefined"!=typeof window&&window.requestAnimationFrame?window.requestAnimationFrame:ce(10):"callback"===e.type?e.queueNotification:ce(e.timeout),c=()=>{i=!1,a&&(a=!1,l.forEach(e=>e()))};return Object.assign({},r,{subscribe(e){const t=r.subscribe(()=>o&&e());return l.add(e),()=>{t(),l.delete(e)}},dispatch(e){try{return o=!e?.meta?.RTK_autoBatch,a=!o,a&&(i||(i=!0,s(c))),r.dispatch(e)}finally{o=!0}}})})("object"==typeof n?n:void 0)),r};function de(e){const t=se(),{reducer:n,middleware:o,devTools:a=!0,duplicateMiddlewareCheck:u=!0,preloadedState:d,enhancers:p}=e||{};let f,h;if("function"==typeof n)f=n;else{if(!l(n))throw new Error($e(1));f=function(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 o=Object.keys(n);let a;try{!function(e){Object.keys(e).forEach(t=>{const n=e[t];if(void 0===n(void 0,{type:i.INIT}))throw new Error(r(12));if(void 0===n(void 0,{type:i.PROBE_UNKNOWN_ACTION()}))throw new Error(r(13))})}(n)}catch(e){a=e}return function(e={},t){if(a)throw a;let i=!1;const l={};for(let a=0;a<o.length;a++){const s=o[a],c=n[s],u=e[s],d=c(u,t);if(void 0===d)throw t&&t.type,new Error(r(14));l[s]=d,i=i||d!==u}return i=i||o.length!==Object.keys(e).length,i?l:e}}(n)}h="function"==typeof o?o(t):t();let m=c;a&&(m=ne({trace:!1,..."object"==typeof a&&a}));const g=function(...e){return t=>(n,o)=>{const a=t(n,o);let i=()=>{throw new Error(r(15))};const l={getState:a.getState,dispatch:(e,...t)=>i(e,...t)},s=e.map(e=>e(l));return i=c(...s)(a.dispatch),{...a,dispatch:i}}}(...h),b=ue(g);return s(f,d,m(..."function"==typeof p?p(b):b()))}function pe(e){const t={},n=[];let r;const o={addCase(e,n){const r="string"==typeof e?e:e.type;if(!r)throw new Error($e(28));if(r in t)throw new Error($e(29));return t[r]=n,o},addMatcher:(e,t)=>(n.push({matcher:e,reducer:t}),o),addDefaultCase:e=>(r=e,o)};return e(o),[t,n,r]}function fe(...e){return t=>e.some(e=>((e,t)=>re(e)?e.match(t):e(t))(e,t))}var he=["name","message","stack","code"],me=class{constructor(e,t){this.payload=e,this.meta=t}_type},ge=class{constructor(e,t){this.payload=e,this.meta=t}_type},be=e=>{if("object"==typeof e&&null!==e){const t={};for(const n of he)"string"==typeof e[n]&&(t[n]=e[n]);return t}return{message:String(e)}},ve="External signal was aborted",ye=(()=>{function e(e,t,n){const r=oe(e+"/fulfilled",(e,t,n,r)=>({payload:e,meta:{...r||{},arg:n,requestId:t,requestStatus:"fulfilled"}})),o=oe(e+"/pending",(e,t,n)=>({payload:void 0,meta:{...n||{},arg:t,requestId:e,requestStatus:"pending"}})),a=oe(e+"/rejected",(e,t,r,o,a)=>({payload:o,error:(n&&n.serializeError||be)(e||"Rejected"),meta:{...a||{},arg:r,requestId:t,rejectedWithValue:!!o,requestStatus:"rejected",aborted:"AbortError"===e?.name,condition:"ConditionError"===e?.name}}));return Object.assign(function(e,{signal:i}={}){return(l,s,c)=>{const u=n?.idGenerator?n.idGenerator(e):((e=21)=>{let t="",n=e;for(;n--;)t+="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW"[64*Math.random()|0];return t})(),d=new AbortController;let p,f;function h(e){f=e,d.abort()}i&&(i.aborted?h(ve):i.addEventListener("abort",()=>h(ve),{once:!0}));const m=async function(){let i;try{let a=n?.condition?.(e,{getState:s,extra:c});if(null!==(m=a)&&"object"==typeof m&&"function"==typeof m.then&&(a=await a),!1===a||d.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};const g=new Promise((e,t)=>{p=()=>{t({name:"AbortError",message:f||"Aborted"})},d.signal.addEventListener("abort",p)});l(o(u,e,n?.getPendingMeta?.({requestId:u,arg:e},{getState:s,extra:c}))),i=await Promise.race([g,Promise.resolve(t(e,{dispatch:l,getState:s,extra:c,requestId:u,signal:d.signal,abort:h,rejectWithValue:(e,t)=>new me(e,t),fulfillWithValue:(e,t)=>new ge(e,t)})).then(t=>{if(t instanceof me)throw t;return t instanceof ge?r(t.payload,u,e,t.meta):r(t,u,e)})])}catch(t){i=t instanceof me?a(null,u,e,t.payload,t.meta):a(t,u,e)}finally{p&&d.signal.removeEventListener("abort",p)}var m;return n&&!n.dispatchConditionRejection&&a.match(i)&&i.meta.condition||l(i),i}();return Object.assign(m,{abort:h,requestId:u,arg:e,unwrap:()=>m.then(we)})}},{pending:o,rejected:a,fulfilled:r,settled:fe(a,r),typePrefix:e})}return e.withTypes=()=>e,e})();function we(e){if(e.meta&&e.meta.rejectedWithValue)throw e.payload;if(e.error)throw e.error;return e.payload}var xe=Symbol.for("rtk-slice-createasyncthunk");function Ee(e,t){return`${e}/${t}`}function ke({creators:e}={}){const t=e?.asyncThunk?.[xe];return function(e){const{name:n,reducerPath:r=n}=e;if(!n)throw new Error($e(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=>Object.assign({[e.name]:(...t)=>e(...t)}[e.name],{_reducerDefinitionType:"reducer"}),preparedReducer:(e,t)=>({_reducerDefinitionType:"reducerWithPrepare",prepare:e,reducer:t}),asyncThunk:e}}()):e.reducers)||{},a=Object.keys(o),i={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},l={addCase(e,t){const n="string"==typeof e?e:e.type;if(!n)throw new Error($e(12));if(n in i.sliceCaseReducersByType)throw new Error($e(13));return i.sliceCaseReducersByType[n]=t,l},addMatcher:(e,t)=>(i.sliceMatchers.push({matcher:e,reducer:t}),l),exposeAction:(e,t)=>(i.actionCreators[e]=t,l),exposeCaseReducer:(e,t)=>(i.sliceCaseReducersByName[e]=t,l)};function s(){const[t={},n=[],r]="function"==typeof e.extraReducers?pe(e.extraReducers):[e.extraReducers],o={...t,...i.sliceCaseReducersByType};return function(e){let t,[a,l,s]=pe(e=>{for(let t in o)e.addCase(t,o[t]);for(let t of i.sliceMatchers)e.addMatcher(t.matcher,t.reducer);for(let t of n)e.addMatcher(t.matcher,t.reducer);r&&e.addDefaultCase(r)});if("function"==typeof e)t=()=>ie(e());else{const n=ie(e);t=()=>n}function c(e=t(),n){let r=[a[n.type],...l.filter(({matcher:e})=>e(n)).map(({reducer:e})=>e)];return 0===r.filter(e=>!!e).length&&(r=[s]),r.reduce((e,t)=>{if(t){if(v(e)){const r=t(e,n);return void 0===r?e:r}if(y(e))return te(e,e=>t(e,n));{const r=t(e,n);if(void 0===r){if(null===e)return e;throw Error("A case reducer on a non-draftable value must not return undefined")}return r}}return e},e)}return c.getInitialState=t,c}(e.initialState)}a.forEach(r=>{const a=o[r],i={reducerName:r,type:Ee(n,r),createNotation:"function"==typeof e.reducers};!function(e){return"asyncThunk"===e._reducerDefinitionType}(a)?function({type:e,reducerName:t,createNotation:n},r,o){let a,i;if("reducer"in r){if(n&&!function(e){return"reducerWithPrepare"===e._reducerDefinitionType}(r))throw new Error($e(17));a=r.reducer,i=r.prepare}else a=r;o.addCase(e,a).exposeCaseReducer(t,a).exposeAction(t,i?oe(e,i):oe(e))}(i,a,l):function({type:e,reducerName:t},n,r,o){if(!o)throw new Error($e(18));const{payloadCreator:a,fulfilled:i,pending:l,rejected:s,settled:c,options:u}=n,d=o(e,a,u);r.exposeAction(t,d),i&&r.addCase(d.fulfilled,i),l&&r.addCase(d.pending,l),s&&r.addCase(d.rejected,s),c&&r.addMatcher(d.settled,c),r.exposeCaseReducer(t,{fulfilled:i||Te,pending:l||Te,rejected:s||Te,settled:c||Te})}(i,a,l,t)});const c=e=>e,u=new Map,d=new WeakMap;let p;function f(e,t){return p||(p=s()),p(e,t)}function h(){return p||(p=s()),p.getInitialState()}function m(t,n=!1){function r(e){let o=e[t];return void 0===o&&n&&(o=le(d,r,h)),o}function o(t=c){const r=le(u,n,()=>new WeakMap);return le(r,t,()=>{const r={};for(const[o,a]of Object.entries(e.selectors??{}))r[o]=_e(a,t,()=>le(d,t,h),n);return r})}return{reducerPath:t,getSelectors:o,get selectors(){return o(r)},selectSlice:r}}const g={name:n,reducer:f,actions:i.actionCreators,caseReducers:i.sliceCaseReducersByName,getInitialState:h,...m(r),injectInto(e,{reducerPath:t,...n}={}){const o=t??r;return e.inject({reducerPath:o,reducer:f},n),{...g,...m(o,!0)}}};return g}}function _e(e,t,n,r){function o(o,...a){let i=t(o);return void 0===i&&r&&(i=n()),e(i,...a)}return o.unwrapped=e,o}var Ae=ke();function Te(){}var{assign:Se}=Object;function $e(e){return`Minified Redux Toolkit error #${e}; visit https://redux-toolkit.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}Symbol.for("rtk-state-proxy-original")},7355:(e,t,n)=>{"use strict";n.d(t,{A:()=>c});var r=n(9155),o=n.n(r),a=n(3864),i=n(6538);const l=a.Ay.div`
1252
+ `;var w=n(6253),x=n(4703);const E=1e3;function k(e){let{active:t}=e;const[n,u]=(0,r.useState)(!1),{botKey:d,admin:p}=(0,a.d4)(c.$P),{supportedLanguages:f}=(0,l.A)(),{fullscreenMode:k}=(0,a.d4)(c.Od),{inspectorOpen:_}=(0,a.d4)(c.qV),A=(0,a.wA)(),T=(0,r.useCallback)(()=>{A((0,s.uz)())},[A]);return function(){var e,t;const n=(0,a.wA)(),{admin:o}=(0,a.d4)(c.$P),{chatMessages:i}=(0,a.d4)(c.DZ)||[],l=null===(e=i.filter(e=>!(null!=e&&e.from_bot)).slice(-1))||void 0===e||null===(t=e[0])||void 0===t?void 0:t.message,s=(0,w.A)(e=>{n((0,x.y2)(e))},E),u=(0,r.useCallback)(e=>{e.altKey&&"KeyR"===e.code&&l&&s(l)},[l,s]);(0,r.useEffect)(()=>{if(o)return window.addEventListener("keydown",u,!0),()=>window.removeEventListener("keydown",u,!0)},[u,o])}(),o().createElement(h,{$active:t},n&&t&&o().createElement(g,null,f.map(e=>o().createElement(y,{key:e.code,title:`Restart ${e.name_local}`,onClick:()=>{return t=e.code,A((0,s.L4)(t)),void u(!1);var t}},o().createElement(b,null,e.code.toUpperCase())))),o().createElement(m,{$active:t,$hasInspector:p,$fullscreenMode:k},p&&o().createElement(v,null,o().createElement(y,{onClick:T,title:_?"Close chat inspector":"Open chat inspector"},_?o().createElement(i.V$,null):o().createElement(i.bM,null))),o().createElement(v,null,o().createElement(y,{title:"Restart chat",onClick:()=>{f.length>1?u(!n):A((0,s.zX)(d,!0))},$active:n,$tail:f.length>1},o().createElement(i.fN,{width:15,height:15})))))}},7e3:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});const r=(e,t)=>Boolean((e=>{const t=e.replace(/\./g,"\\.").replace(/\*/g,".*").replace(/\//g,"\\/").replace(/\?/g,"\\?");return new RegExp(t,"i")})(t).test(e))},7013:(e,t,n)=>{"use strict";var r=n(1780),o=Function.prototype,a=o.apply,i=o.call;e.exports="object"==typeof Reflect&&Reflect.apply||(r?i.bind(a):function(){return i.apply(a,arguments)})},7050:(e,t,n)=>{"use strict";var r=n(1949),o=n.n(r),a=n(2221);const i=o().arrayOf(o().shape({selected:o().bool.isRequired,_id:o().string.isRequired,score:o().number.isRequired,sample:o().string.isRequired}));o().shape({message:o().string,from_bot:o().bool,image_carousel:o().arrayOf(o().object),exchange_type:o().string,exchange_id:o().string,avatar:o().string,sender:o().oneOf(Object.values(a.bS)),skill_subscription_id:o().number,bot_id:o().number,score:o().number,title:o().string,reply_candidates:i,is_followup:o().bool,handler:o().oneOf(Object.values(a.Gi)),new_context:o().objectOf(o().string)})},7161:(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},7173:(e,t,n)=>{"use strict";n.d(t,{M_:()=>r,MU:()=>o,nW:()=>g,YU:()=>m,fg:()=>j,FZ:()=>$.FZ,YR:()=>$.YR,K_:()=>y,A8:()=>E,wk:()=>k,Y6:()=>F,Q4:()=>$.Q4,Tc:()=>A,uS:()=>$.uS,SO:()=>$.SO,_Y:()=>C._Y,zT:()=>C.zT,wX:()=>ee,MO:()=>J,nG:()=>N,_N:()=>C._N,Kd:()=>te,oZ:()=>M,u2:()=>h,X2:()=>Y,a_:()=>ne,wM:()=>$.wM,dp:()=>x,II:()=>l,MM:()=>i,nz:()=>a,t1:()=>$.t1,qQ:()=>v,tS:()=>z,E7:()=>S,Os:()=>B,tq:()=>H,ny:()=>C.ny,kA:()=>$.kA,$o:()=>O,jE:()=>R,hn:()=>$.hn,mz:()=>C.mz,kP:()=>C.kP,VZ:()=>C.VZ,MN:()=>L,nh:()=>u,a1:()=>oe,oE:()=>Q,TF:()=>$.TF,XM:()=>$.XM,d$:()=>$.d$,Xu:()=>$.Xu,tr:()=>$.MO,QA:()=>U,uA:()=>$.uA,ye:()=>P,M2:()=>$.M2,kU:()=>V,se:()=>G,mw:()=>_,nm:()=>$.nm,HW:()=>$.HW,Zb:()=>f,Eg:()=>$.Eg,un:()=>Z,vP:()=>I,wv:()=>X,nX:()=>$.nX,l:()=>re,Wh:()=>p,CB:()=>$.CB,Rk:()=>w,vK:()=>D,IM:()=>W,zZ:()=>b,wP:()=>q,pz:()=>K,AQ:()=>d,Q0:()=>T,c6:()=>s,we:()=>c});const r="AGENT_STARTED_TYPING",o="AGENT_STOPPED_TYPING",a="HANDOVER_REQUESTED",i="HANDOVER_CANCELLED",l="HANDOVER",s="USER_STARTED_TYPING",c="USER_STOPPED_TYPING",u="RESET_HAS_HAD_HANDOVER",d="UPDATE_HANDOVER_QUEUE",p="SHOW_TAB_NOTIFICATION",f="SHOW_BUBBLE_NOTIFICATION",h="DISMISS_NOTIFICATIONS",m="ANNOUNCEMENT_SHOW",g="ANNOUNCEMENT_HIDE",b="UNAUTHENTICATED",v="IDENTIFIED",y="AUTHENTICATED",w="START_REFRESHING",x="END_REFRESHING",E="BOT_STARTED_TYPING",k="BOT_STOPPED_TYPING",_="SET_SPLIT_TEST_LABEL",A="CLEAR_SPLIT_TEST_LABEL",T="UPDATE_SPLIT_LABEL_TIMEOUT",S="MIMIR_STARTED_SEARCHING";var $=n(3313),C=n(7523);const O="ENVIRONMENT_OVERRIDE",I="SHOW_IN_CHAT_NOTIFICATION",L="REPLACE_IN_CHAT_NOTIFICATION",M="DISMISS_IN_CHAT_NOTIFICATION",N="DELETE_IN_CHAT_NOTIFICATION",R="PATTERN_CONTEXT_MATCH",P="SET_INSPECTED_CHAT_MESSAGE",D="TOGGLE_INSPECTOR",j="ANONYMIZED_MESSAGE",F="BUTTON_CLICK",z="MESSAGE_ATTACHMENTS_UPDATED",B="NEW_ATTACHMENTS",H="NEW_MESSAGE",U="SET_FORM",V="SET_LAST_MESSAGE_SEEN",G="SET_MESSAGE_SENT_TIME",W="TRIGGER_DIALOGUE",q="UPDATE_ATTACHMENT",K="UPDATE_CHAT_MESSAGE",Y="DISMISS_NUDGE",X="SHOW_NUDGE",Z="SHOW_CUSTOM_NUDGE",J="CTA_CLICK",Q="SESSION_COMPLETION",ee="COUNT_NUDGE",te="DISCOUNT_NUDGE",ne="DISMISS_PUSH_MESSAGE",re="SHOW_PUSH_MESSAGE",oe="RESET_PUSH_MESSAGES"},7235:(e,t,n)=>{"use strict";var r=n(262),o=String,a=TypeError;e.exports=function(e){if(r(e))return e;throw new a(o(e)+" is not an object")}},7243:(e,t,n)=>{"use strict";n.d(t,{Rm:()=>x,TP:()=>E,zX:()=>m,Cy:()=>y,et:()=>v,DT:()=>w,m8:()=>h,R7:()=>f});var r=n(9749),o=n.n(r),a=n(2221),i=n(2366),l=n(4851),s=n(9292),c=n(8172),u=n(9313),d=n(2633),p=n(7173);const f=e=>async(t,n)=>{const{connection:{token:r},environment:{PAT_HOST:o}}=n();return r?fetch(`${o}/chatbubble/${a.Ak}/user_left/`,{method:"PATCH",...(0,l.A)({token:r,botKey:e})}):null},h=()=>async(e,t)=>{const{connection:{token:n},environment:{PAT_HOST:r},auth:{fullName:o}}=t();return n?fetch(`${r}/chatbubble/${a.Ak}/handover_cancel/`,{method:"POST",body:JSON.stringify({source:o}),...(0,l.A)({token:n},{extra:{"Content-Type":"application/json"}})}):null},m=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return async(n,r)=>{const{agent:{takenOver:o,requestedHandoverAt:i}}=r();i?n({type:p.MM}):o&&n({type:p.II,data:{taken_over:!1}}),n({type:p.a1}),n(f(e)),n({type:p.wk});try{(0,u.Zf)(),t||n({type:p.uS})}catch(e){console.warn(e)}finally{n((0,d.F)(a.Jm.LANGUAGE_SWITCH)),n({type:p.CB,botKey:e,keepOpen:t}),t||setTimeout(()=>n({type:p.d$,chatHasStarted:!1}),300)}}},g=Object.freeze({MAX:3,TIMEOUT_MS:2e3,TIMEOUT_MULTIPLIER:2,RESPONSE_STATUSES:[401,403]});let b=0;const v=function(e,t){let{onError:n,restartOnError:r}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return async a=>{if(!e)return console.error("Tried to call transport without supplying url"),null;if(!t.method)return console.error("Tried to call transport without supplying method"),null;t.headers={"kindly-chat-version":"2.76.11",[i.B]:(0,i.U)(),...t.headers||{}};try{const n=await fetch(e,{...t,...t.body&&{body:t.body instanceof ArrayBuffer?t.body:JSON.stringify(t.body)},headers:{"Content-Type":"application/json",...t.headers&&{...t.headers}}});if(!(t.body instanceof ArrayBuffer)){const e=await n.json();return{status:n.status,statusText:n.statusText,ok:n.ok,data:e}}return n}catch(e){return n?n(e,t):r?a(((e,t)=>function(n){var r,a,i,l;if(!e.response||!o()(r=g.RESPONSE_STATUSES).call(r,null===(a=e.response)||void 0===a?void 0:a.status))return console.error(e),null;if(b+=1,b>g.MAX)return console.error(`${t.url} returned ${null===(l=e.response)||void 0===l?void 0:l.status}, max chats restarts exceeded`),null;console.warn(`${t.url} returned ${null===(i=e.response)||void 0===i?void 0:i.status}, starting new chat`);const s=g.TIMEOUT_MS*g.TIMEOUT_MULTIPLIER**(b-1);return setTimeout(()=>n((e,t)=>{const{botKey:n}=t().chatbubble;e(m(n,!0))}),s),null})(e,t)):null}}},y=e=>{const t=`private-chatbubble-${e}`;(0,u.B1)(t,"mimir-started-searching",p.E7),(0,u.B1)(t,"agent_started_typing",p.M_),(0,u.B1)(t,"agent_stopped_typing",p.MU),(0,u.B1)(t,"message-attachments-updated",p.tS),(0,u.B1)(t,"message",p.tq),(0,u.B1)(t,"bot_started_typing",p.A8),(0,u.B1)(t,"bot_stopped_typing",p.wk),(0,u.B1)(t,"new-attachments",p.Os),(0,u.B1)(t,"pattern-context-match",p.jE),(0,u.B1)(t,"takeover",p.II)},w=e=>{const t=`private-chatbubble-${e}`;(0,u.al)(t,"mimir-started-searching",p.E7),(0,u.al)(t,"agent_started_typing",p.M_),(0,u.al)(t,"agent_stopped_typing",p.MU),(0,u.al)(t,"message-attachments-updated",p.tS),(0,u.al)(t,"message",p.tq),(0,u.al)(t,"bot_started_typing",p.A8),(0,u.al)(t,"bot_stopped_typing",p.wk),(0,u.al)(t,"new-attachments",p.Os),(0,u.al)(t,"pattern-context-match",p.jE),(0,u.al)(t,"takeover",p.II)},x=e=>{let{message:t,error:n,level:r="info",extra:o={}}=e;return(e,i)=>{var u;const d=i(),{connection:{token:p},environment:{PAT_HOST:f},chatbubble:{chatId:h}}=d,m={tags:{chat_id:h,bot_id:null===(u=d.bot)||void 0===u?void 0:u.id}},g=(e=>{var t,n;let{level:r="info",error:o,message:a,reduxState:i,extra:l}=e;a||null!=o&&o.message||(console.error("Attempted to log without message"),a="No error message provided");const u=(0,c.A)(i||{},s.W$),d={version:"2.76.11",release:"2.76.11",userAgent:navigator.userAgent,state:i?JSON.stringify(u):void 0,...l},p={message:null!==(t=a)&&void 0!==t?t:null==o?void 0:o.message,name:null==o?void 0:o.name,stack:null==o?void 0:o.stack,code:null==o?void 0:o.code,signal:null==o?void 0:o.signal,filename:null==o?void 0:o.filename};return{message:null!==(n=a)&&void 0!==n?n:null==o?void 0:o.message,level:r,extra:d,error:p}})({level:r,error:n,message:t,reduxState:d,extra:{...(b=o,JSON.parse(JSON.stringify(b,(e,t)=>void 0===t?"undefined 🤷‍♂️":t))),...m}});var b;e(v(`${f}/chatbubble/${a.Ak}/log`,{method:"POST",body:g,...(0,l.A)({token:p},{withCurrentUrl:!0})}))}},E=e=>t=>{t({type:p.se,messageSentTime:e})}},7251:(e,t,n)=>{"use strict";function r(e){return`Minified Redux error #${e}; visit https://redux.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}n.d(t,{U1:()=>de,zD:()=>ye,Z0:()=>Ae});var o=(()=>"function"==typeof Symbol&&Symbol.observable||"@@observable")(),a=()=>Math.random().toString(36).substring(7).split("").join("."),i={INIT:`@@redux/INIT${a()}`,REPLACE:`@@redux/REPLACE${a()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${a()}`};function l(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 s(e,t,n){if("function"!=typeof e)throw new Error(r(2));if("function"==typeof t&&"function"==typeof n||"function"==typeof n&&"function"==typeof arguments[3])throw new Error(r(0));if("function"==typeof t&&void 0===n&&(n=t,t=void 0),void 0!==n){if("function"!=typeof n)throw new Error(r(1));return n(s)(e,t)}let a=e,c=t,u=new Map,d=u,p=0,f=!1;function h(){d===u&&(d=new Map,u.forEach((e,t)=>{d.set(t,e)}))}function m(){if(f)throw new Error(r(3));return c}function g(e){if("function"!=typeof e)throw new Error(r(4));if(f)throw new Error(r(5));let t=!0;h();const n=p++;return d.set(n,e),function(){if(t){if(f)throw new Error(r(6));t=!1,h(),d.delete(n),u=null}}}function b(e){if(!l(e))throw new Error(r(7));if(void 0===e.type)throw new Error(r(8));if("string"!=typeof e.type)throw new Error(r(17));if(f)throw new Error(r(9));try{f=!0,c=a(c,e)}finally{f=!1}return(u=d).forEach(e=>{e()}),e}return b({type:i.INIT}),{dispatch:b,subscribe:g,getState:m,replaceReducer:function(e){if("function"!=typeof e)throw new Error(r(10));a=e,b({type:i.REPLACE})},[o]:function(){const e=g;return{subscribe(t){if("object"!=typeof t||null===t)throw new Error(r(11));function n(){const e=t;e.next&&e.next(m())}return n(),{unsubscribe:e(n)}},[o](){return this}}}}}function c(...e){return 0===e.length?e=>e:1===e.length?e[0]:e.reduce((e,t)=>(...n)=>e(t(...n)))}function u(e){return({dispatch:t,getState:n})=>r=>o=>"function"==typeof o?o(t,n,e):r(o)}var d=u(),p=u,f=Symbol.for("immer-nothing"),h=Symbol.for("immer-draftable"),m=Symbol.for("immer-state");function g(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var b=Object.getPrototypeOf;function v(e){return!!e&&!!e[m]}function y(e){return!!e&&(x(e)||Array.isArray(e)||!!e[h]||!!e.constructor?.[h]||T(e)||S(e))}var w=Object.prototype.constructor.toString();function x(e){if(!e||"object"!=typeof e)return!1;const t=b(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)===w}function E(e,t){0===k(e)?Reflect.ownKeys(e).forEach(n=>{t(n,e[n],e)}):e.forEach((n,r)=>t(r,n,e))}function k(e){const t=e[m];return t?t.type_:Array.isArray(e)?1:T(e)?2:S(e)?3:0}function _(e,t){return 2===k(e)?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function A(e,t,n){const r=k(e);2===r?e.set(t,n):3===r?e.add(n):e[t]=n}function T(e){return e instanceof Map}function S(e){return e instanceof Set}function $(e){return e.copy_||e.base_}function C(e,t){if(T(e))return new Map(e);if(S(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);const n=x(e);if(!0===t||"class_only"===t&&!n){const t=Object.getOwnPropertyDescriptors(e);delete t[m];let n=Reflect.ownKeys(t);for(let r=0;r<n.length;r++){const o=n[r],a=t[o];!1===a.writable&&(a.writable=!0,a.configurable=!0),(a.get||a.set)&&(t[o]={configurable:!0,writable:!0,enumerable:a.enumerable,value:e[o]})}return Object.create(b(e),t)}{const t=b(e);if(null!==t&&n)return{...e};const r=Object.create(t);return Object.assign(r,e)}}function O(e,t=!1){return L(e)||v(e)||!y(e)||(k(e)>1&&(e.set=e.add=e.clear=e.delete=I),Object.freeze(e),t&&Object.entries(e).forEach(([e,t])=>O(t,!0))),e}function I(){g(2)}function L(e){return Object.isFrozen(e)}var M,N={};function R(e){const t=N[e];return t||g(0),t}function P(){return M}function D(e,t){t&&(R("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function j(e){F(e),e.drafts_.forEach(B),e.drafts_=null}function F(e){e===M&&(M=e.parent_)}function z(e){return M={drafts_:[],parent_:M,immer_:e,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function B(e){const t=e[m];0===t.type_||1===t.type_?t.revoke_():t.revoked_=!0}function H(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];return void 0!==e&&e!==n?(n[m].modified_&&(j(t),g(4)),y(e)&&(e=U(t,e),t.parent_||G(t,e)),t.patches_&&R("Patches").generateReplacementPatches_(n[m].base_,e,t.patches_,t.inversePatches_)):e=U(t,n,[]),j(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==f?e:void 0}function U(e,t,n){if(L(t))return t;const r=t[m];if(!r)return E(t,(o,a)=>V(e,r,t,o,a,n)),t;if(r.scope_!==e)return t;if(!r.modified_)return G(e,r.base_,!0),r.base_;if(!r.finalized_){r.finalized_=!0,r.scope_.unfinalizedDrafts_--;const t=r.copy_;let o=t,a=!1;3===r.type_&&(o=new Set(t),t.clear(),a=!0),E(o,(o,i)=>V(e,r,t,o,i,n,a)),G(e,t,!1),n&&e.patches_&&R("Patches").generatePatches_(r,n,e.patches_,e.inversePatches_)}return r.copy_}function V(e,t,n,r,o,a,i){if(v(o)){const i=U(e,o,a&&t&&3!==t.type_&&!_(t.assigned_,r)?a.concat(r):void 0);if(A(n,r,i),!v(i))return;e.canAutoFreeze_=!1}else i&&n.add(o);if(y(o)&&!L(o)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;U(e,o),t&&t.scope_.parent_||"symbol"==typeof r||!Object.prototype.propertyIsEnumerable.call(n,r)||G(e,o)}}function G(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&O(t,n)}var W={get(e,t){if(t===m)return e;const n=$(e);if(!_(n,t))return function(e,t,n){const r=Y(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_||!y(r)?r:r===K(e.base_,t)?(Z(e),e.copy_[t]=J(r,e)):r},has:(e,t)=>t in $(e),ownKeys:e=>Reflect.ownKeys($(e)),set(e,t,n){const r=Y($(e),t);if(r?.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const r=K($(e),t),i=r?.[m];if(i&&i.base_===n)return e.copy_[t]=n,e.assigned_[t]=!1,!0;if(((o=n)===(a=r)?0!==o||1/o==1/a:o!=o&&a!=a)&&(void 0!==n||_(e.base_,t)))return!0;Z(e),X(e)}var o,a;return e.copy_[t]===n&&(void 0!==n||t in e.copy_)||Number.isNaN(n)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=n,e.assigned_[t]=!0),!0},deleteProperty:(e,t)=>(void 0!==K(e.base_,t)||t in e.base_?(e.assigned_[t]=!1,Z(e),X(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0),getOwnPropertyDescriptor(e,t){const n=$(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r?{writable:!0,configurable:1!==e.type_||"length"!==t,enumerable:r.enumerable,value:n[t]}:r},defineProperty(){g(11)},getPrototypeOf:e=>b(e.base_),setPrototypeOf(){g(12)}},q={};function K(e,t){const n=e[m];return(n?$(n):e)[t]}function Y(e,t){if(!(t in e))return;let n=b(e);for(;n;){const e=Object.getOwnPropertyDescriptor(n,t);if(e)return e;n=b(n)}}function X(e){e.modified_||(e.modified_=!0,e.parent_&&X(e.parent_))}function Z(e){e.copy_||(e.copy_=C(e.base_,e.scope_.immer_.useStrictShallowCopy_))}function J(e,t){const n=T(e)?R("MapSet").proxyMap_(e,t):S(e)?R("MapSet").proxySet_(e,t):function(e,t){const n=Array.isArray(e),r={type_:n?1:0,scope_:t?t.scope_:P(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let o=r,a=W;n&&(o=[r],a=q);const{revoke:i,proxy:l}=Proxy.revocable(o,a);return r.draft_=l,r.revoke_=i,l}(e,t);return(t?t.scope_:P()).drafts_.push(n),n}function Q(e){if(!y(e)||L(e))return e;const t=e[m];let n;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=C(e,t.scope_.immer_.useStrictShallowCopy_)}else n=C(e,!0);return E(n,(e,t)=>{A(n,e,Q(t))}),t&&(t.finalized_=!1),n}E(W,(e,t)=>{q[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}}),q.deleteProperty=function(e,t){return q.set.call(this,e,t,void 0)},q.set=function(e,t,n){return W.set.call(this,e[0],t,n,e[0])};var ee=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&&g(6),void 0!==n&&"function"!=typeof n&&g(7),y(e)){const o=z(this),a=J(e,void 0);let i=!0;try{r=t(a),i=!1}finally{i?j(o):F(o)}return D(o,n),H(r,o)}if(!e||"object"!=typeof e){if(r=t(e),void 0===r&&(r=e),r===f&&(r=void 0),this.autoFreeze_&&O(r,!0),n){const t=[],o=[];R("Patches").generateReplacementPatches_(e,r,t,o),n(t,o)}return r}g(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;y(e)||g(8),v(e)&&(v(t=e)||g(10),e=Q(t));const n=z(this),r=J(e,void 0);return r[m].isManual_=!0,F(n),r}finishDraft(e,t){const n=e&&e[m];n&&n.isManual_||g(9);const{scope_:r}=n;return D(r,t),H(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=R("Patches").applyPatches_;return v(e)?r(e,t):this.produce(e,e=>r(e,t))}},te=ee.produce;ee.produceWithPatches.bind(ee),ee.setAutoFreeze.bind(ee),ee.setUseStrictShallowCopy.bind(ee),ee.applyPatches.bind(ee),ee.createDraft.bind(ee),ee.finishDraft.bind(ee),n(9907);var ne="undefined"!=typeof window&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(0!==arguments.length)return"object"==typeof arguments[0]?c:c.apply(null,arguments)},re=("undefined"!=typeof window&&window.__REDUX_DEVTOOLS_EXTENSION__&&window.__REDUX_DEVTOOLS_EXTENSION__,e=>e&&"function"==typeof e.match);function oe(e,t){function n(...n){if(t){let r=t(...n);if(!r)throw new Error($e(0));return{type:e,payload:r.payload,..."meta"in r&&{meta:r.meta},..."error"in r&&{error:r.error}}}return{type:e,payload:n[0]}}return n.toString=()=>`${e}`,n.type=e,n.match=t=>function(e){return l(e)&&"type"in e&&"string"==typeof e.type}(t)&&t.type===e,n}var ae=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 ie(e){return y(e)?te(e,()=>{}):e}function le(e,t,n){return e.has(t)?e.get(t):e.set(t,n(t)).get(t)}var se=()=>function(e){const{thunk:t=!0,immutableCheck:n=!0,serializableCheck:r=!0,actionCreatorCheck:o=!0}=e??{};let a=new ae;return t&&("boolean"==typeof t?a.push(d):a.push(p(t.extraArgument))),a},ce=e=>t=>{setTimeout(t,e)},ue=e=>function(t){const{autoBatch:n=!0}=t??{};let r=new ae(e);return n&&r.push(((e={type:"raf"})=>t=>(...n)=>{const r=t(...n);let o=!0,a=!1,i=!1;const l=new Set,s="tick"===e.type?queueMicrotask:"raf"===e.type?"undefined"!=typeof window&&window.requestAnimationFrame?window.requestAnimationFrame:ce(10):"callback"===e.type?e.queueNotification:ce(e.timeout),c=()=>{i=!1,a&&(a=!1,l.forEach(e=>e()))};return Object.assign({},r,{subscribe(e){const t=r.subscribe(()=>o&&e());return l.add(e),()=>{t(),l.delete(e)}},dispatch(e){try{return o=!e?.meta?.RTK_autoBatch,a=!o,a&&(i||(i=!0,s(c))),r.dispatch(e)}finally{o=!0}}})})("object"==typeof n?n:void 0)),r};function de(e){const t=se(),{reducer:n,middleware:o,devTools:a=!0,duplicateMiddlewareCheck:u=!0,preloadedState:d,enhancers:p}=e||{};let f,h;if("function"==typeof n)f=n;else{if(!l(n))throw new Error($e(1));f=function(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 o=Object.keys(n);let a;try{!function(e){Object.keys(e).forEach(t=>{const n=e[t];if(void 0===n(void 0,{type:i.INIT}))throw new Error(r(12));if(void 0===n(void 0,{type:i.PROBE_UNKNOWN_ACTION()}))throw new Error(r(13))})}(n)}catch(e){a=e}return function(e={},t){if(a)throw a;let i=!1;const l={};for(let a=0;a<o.length;a++){const s=o[a],c=n[s],u=e[s],d=c(u,t);if(void 0===d)throw t&&t.type,new Error(r(14));l[s]=d,i=i||d!==u}return i=i||o.length!==Object.keys(e).length,i?l:e}}(n)}h="function"==typeof o?o(t):t();let m=c;a&&(m=ne({trace:!1,..."object"==typeof a&&a}));const g=function(...e){return t=>(n,o)=>{const a=t(n,o);let i=()=>{throw new Error(r(15))};const l={getState:a.getState,dispatch:(e,...t)=>i(e,...t)},s=e.map(e=>e(l));return i=c(...s)(a.dispatch),{...a,dispatch:i}}}(...h),b=ue(g);return s(f,d,m(..."function"==typeof p?p(b):b()))}function pe(e){const t={},n=[];let r;const o={addCase(e,n){const r="string"==typeof e?e:e.type;if(!r)throw new Error($e(28));if(r in t)throw new Error($e(29));return t[r]=n,o},addMatcher:(e,t)=>(n.push({matcher:e,reducer:t}),o),addDefaultCase:e=>(r=e,o)};return e(o),[t,n,r]}function fe(...e){return t=>e.some(e=>((e,t)=>re(e)?e.match(t):e(t))(e,t))}var he=["name","message","stack","code"],me=class{constructor(e,t){this.payload=e,this.meta=t}_type},ge=class{constructor(e,t){this.payload=e,this.meta=t}_type},be=e=>{if("object"==typeof e&&null!==e){const t={};for(const n of he)"string"==typeof e[n]&&(t[n]=e[n]);return t}return{message:String(e)}},ve="External signal was aborted",ye=(()=>{function e(e,t,n){const r=oe(e+"/fulfilled",(e,t,n,r)=>({payload:e,meta:{...r||{},arg:n,requestId:t,requestStatus:"fulfilled"}})),o=oe(e+"/pending",(e,t,n)=>({payload:void 0,meta:{...n||{},arg:t,requestId:e,requestStatus:"pending"}})),a=oe(e+"/rejected",(e,t,r,o,a)=>({payload:o,error:(n&&n.serializeError||be)(e||"Rejected"),meta:{...a||{},arg:r,requestId:t,rejectedWithValue:!!o,requestStatus:"rejected",aborted:"AbortError"===e?.name,condition:"ConditionError"===e?.name}}));return Object.assign(function(e,{signal:i}={}){return(l,s,c)=>{const u=n?.idGenerator?n.idGenerator(e):((e=21)=>{let t="",n=e;for(;n--;)t+="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW"[64*Math.random()|0];return t})(),d=new AbortController;let p,f;function h(e){f=e,d.abort()}i&&(i.aborted?h(ve):i.addEventListener("abort",()=>h(ve),{once:!0}));const m=async function(){let i;try{let a=n?.condition?.(e,{getState:s,extra:c});if(null!==(m=a)&&"object"==typeof m&&"function"==typeof m.then&&(a=await a),!1===a||d.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};const g=new Promise((e,t)=>{p=()=>{t({name:"AbortError",message:f||"Aborted"})},d.signal.addEventListener("abort",p)});l(o(u,e,n?.getPendingMeta?.({requestId:u,arg:e},{getState:s,extra:c}))),i=await Promise.race([g,Promise.resolve(t(e,{dispatch:l,getState:s,extra:c,requestId:u,signal:d.signal,abort:h,rejectWithValue:(e,t)=>new me(e,t),fulfillWithValue:(e,t)=>new ge(e,t)})).then(t=>{if(t instanceof me)throw t;return t instanceof ge?r(t.payload,u,e,t.meta):r(t,u,e)})])}catch(t){i=t instanceof me?a(null,u,e,t.payload,t.meta):a(t,u,e)}finally{p&&d.signal.removeEventListener("abort",p)}var m;return n&&!n.dispatchConditionRejection&&a.match(i)&&i.meta.condition||l(i),i}();return Object.assign(m,{abort:h,requestId:u,arg:e,unwrap:()=>m.then(we)})}},{pending:o,rejected:a,fulfilled:r,settled:fe(a,r),typePrefix:e})}return e.withTypes=()=>e,e})();function we(e){if(e.meta&&e.meta.rejectedWithValue)throw e.payload;if(e.error)throw e.error;return e.payload}var xe=Symbol.for("rtk-slice-createasyncthunk");function Ee(e,t){return`${e}/${t}`}function ke({creators:e}={}){const t=e?.asyncThunk?.[xe];return function(e){const{name:n,reducerPath:r=n}=e;if(!n)throw new Error($e(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=>Object.assign({[e.name]:(...t)=>e(...t)}[e.name],{_reducerDefinitionType:"reducer"}),preparedReducer:(e,t)=>({_reducerDefinitionType:"reducerWithPrepare",prepare:e,reducer:t}),asyncThunk:e}}()):e.reducers)||{},a=Object.keys(o),i={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},l={addCase(e,t){const n="string"==typeof e?e:e.type;if(!n)throw new Error($e(12));if(n in i.sliceCaseReducersByType)throw new Error($e(13));return i.sliceCaseReducersByType[n]=t,l},addMatcher:(e,t)=>(i.sliceMatchers.push({matcher:e,reducer:t}),l),exposeAction:(e,t)=>(i.actionCreators[e]=t,l),exposeCaseReducer:(e,t)=>(i.sliceCaseReducersByName[e]=t,l)};function s(){const[t={},n=[],r]="function"==typeof e.extraReducers?pe(e.extraReducers):[e.extraReducers],o={...t,...i.sliceCaseReducersByType};return function(e){let t,[a,l,s]=pe(e=>{for(let t in o)e.addCase(t,o[t]);for(let t of i.sliceMatchers)e.addMatcher(t.matcher,t.reducer);for(let t of n)e.addMatcher(t.matcher,t.reducer);r&&e.addDefaultCase(r)});if("function"==typeof e)t=()=>ie(e());else{const n=ie(e);t=()=>n}function c(e=t(),n){let r=[a[n.type],...l.filter(({matcher:e})=>e(n)).map(({reducer:e})=>e)];return 0===r.filter(e=>!!e).length&&(r=[s]),r.reduce((e,t)=>{if(t){if(v(e)){const r=t(e,n);return void 0===r?e:r}if(y(e))return te(e,e=>t(e,n));{const r=t(e,n);if(void 0===r){if(null===e)return e;throw Error("A case reducer on a non-draftable value must not return undefined")}return r}}return e},e)}return c.getInitialState=t,c}(e.initialState)}a.forEach(r=>{const a=o[r],i={reducerName:r,type:Ee(n,r),createNotation:"function"==typeof e.reducers};!function(e){return"asyncThunk"===e._reducerDefinitionType}(a)?function({type:e,reducerName:t,createNotation:n},r,o){let a,i;if("reducer"in r){if(n&&!function(e){return"reducerWithPrepare"===e._reducerDefinitionType}(r))throw new Error($e(17));a=r.reducer,i=r.prepare}else a=r;o.addCase(e,a).exposeCaseReducer(t,a).exposeAction(t,i?oe(e,i):oe(e))}(i,a,l):function({type:e,reducerName:t},n,r,o){if(!o)throw new Error($e(18));const{payloadCreator:a,fulfilled:i,pending:l,rejected:s,settled:c,options:u}=n,d=o(e,a,u);r.exposeAction(t,d),i&&r.addCase(d.fulfilled,i),l&&r.addCase(d.pending,l),s&&r.addCase(d.rejected,s),c&&r.addMatcher(d.settled,c),r.exposeCaseReducer(t,{fulfilled:i||Te,pending:l||Te,rejected:s||Te,settled:c||Te})}(i,a,l,t)});const c=e=>e,u=new Map,d=new WeakMap;let p;function f(e,t){return p||(p=s()),p(e,t)}function h(){return p||(p=s()),p.getInitialState()}function m(t,n=!1){function r(e){let o=e[t];return void 0===o&&n&&(o=le(d,r,h)),o}function o(t=c){const r=le(u,n,()=>new WeakMap);return le(r,t,()=>{const r={};for(const[o,a]of Object.entries(e.selectors??{}))r[o]=_e(a,t,()=>le(d,t,h),n);return r})}return{reducerPath:t,getSelectors:o,get selectors(){return o(r)},selectSlice:r}}const g={name:n,reducer:f,actions:i.actionCreators,caseReducers:i.sliceCaseReducersByName,getInitialState:h,...m(r),injectInto(e,{reducerPath:t,...n}={}){const o=t??r;return e.inject({reducerPath:o,reducer:f},n),{...g,...m(o,!0)}}};return g}}function _e(e,t,n,r){function o(o,...a){let i=t(o);return void 0===i&&r&&(i=n()),e(i,...a)}return o.unwrapped=e,o}var Ae=ke();function Te(){}var{assign:Se}=Object;function $e(e){return`Minified Redux Toolkit error #${e}; visit https://redux-toolkit.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}Symbol.for("rtk-state-proxy-original")},7355:(e,t,n)=>{"use strict";n.d(t,{A:()=>c});var r=n(9155),o=n.n(r),a=n(3864),i=n(6538);const l=a.Ay.div`
1253
1253
  visibility: hidden;
1254
1254
  padding: 4px 8px;
1255
1255
  font-size: var(--_kindlychat-font-size-sm);
@@ -1387,7 +1387,7 @@
1387
1387
  stroke: ${e=>{let{theme:t}=e;return(0,c.w5)(t.panelBackground,"rgba(255, 255, 255, 0.8)","rgba(0, 0, 0, 0.8)")}};
1388
1388
  }
1389
1389
  }
1390
- `,g=function(e){let{file:t,canRemove:n=!0,onRemove:r}=e;return o().createElement(u,null,o().createElement(h,null,o().createElement(i.A,{title:"attachment"})),o().createElement(d,null,o().createElement(p,null,t.name),o().createElement(f,null,(0,l.B$)(t.size))),n&&o().createElement(m,{onClick:r},o().createElement(a.US,{width:24,height:24})))}},8089:(e,t,n)=>{e=n.nmd(e);var r="__lodash_hash_undefined__",o=9007199254740991,a="[object Arguments]",i="[object Function]",l="[object Object]",s=/^\[object .+?Constructor\]$/,c=/^(?:0|[1-9]\d*)$/,u={};u["[object Float32Array]"]=u["[object Float64Array]"]=u["[object Int8Array]"]=u["[object Int16Array]"]=u["[object Int32Array]"]=u["[object Uint8Array]"]=u["[object Uint8ClampedArray]"]=u["[object Uint16Array]"]=u["[object Uint32Array]"]=!0,u[a]=u["[object Array]"]=u["[object ArrayBuffer]"]=u["[object Boolean]"]=u["[object DataView]"]=u["[object Date]"]=u["[object Error]"]=u[i]=u["[object Map]"]=u["[object Number]"]=u[l]=u["[object RegExp]"]=u["[object Set]"]=u["[object String]"]=u["[object WeakMap]"]=!1;var d,p,f,h="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,m="object"==typeof self&&self&&self.Object===Object&&self,g=h||m||Function("return this")(),b=t&&!t.nodeType&&t,v=b&&e&&!e.nodeType&&e,y=v&&v.exports===b,w=y&&h.process,x=function(){try{return v&&v.require&&v.require("util").types||w&&w.binding&&w.binding("util")}catch(e){}}(),E=x&&x.isTypedArray,k=Array.prototype,_=Function.prototype,A=Object.prototype,T=g["__core-js_shared__"],S=_.toString,$=A.hasOwnProperty,C=(d=/[^.]+$/.exec(T&&T.keys&&T.keys.IE_PROTO||""))?"Symbol(src)_1."+d:"",O=A.toString,I=S.call(Object),L=RegExp("^"+S.call($).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),M=y?g.Buffer:void 0,N=g.Symbol,R=g.Uint8Array,P=(M&&M.allocUnsafe,p=Object.getPrototypeOf,f=Object,function(e){return p(f(e))}),D=Object.create,j=A.propertyIsEnumerable,F=k.splice,z=N?N.toStringTag:void 0,B=function(){try{var e=le(Object,"defineProperty");return e({},"",{}),e}catch(e){}}(),H=M?M.isBuffer:void 0,U=Math.max,V=Date.now,G=le(g,"Map"),W=le(Object,"create"),q=function(){function e(){}return function(t){if(!ye(t))return{};if(D)return D(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();function K(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Y(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function X(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Z(e){var t=this.__data__=new Y(e);this.size=t.size}function J(e,t,n){(void 0!==n&&!pe(e[t],n)||void 0===n&&!(t in e))&&te(e,t,n)}function Q(e,t,n){var r=e[t];$.call(e,t)&&pe(r,n)&&(void 0!==n||t in e)||te(e,t,n)}function ee(e,t){for(var n=e.length;n--;)if(pe(e[n][0],t))return n;return-1}function te(e,t,n){"__proto__"==t&&B?B(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}K.prototype.clear=function(){this.__data__=W?W(null):{},this.size=0},K.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},K.prototype.get=function(e){var t=this.__data__;if(W){var n=t[e];return n===r?void 0:n}return $.call(t,e)?t[e]:void 0},K.prototype.has=function(e){var t=this.__data__;return W?void 0!==t[e]:$.call(t,e)},K.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=W&&void 0===t?r:t,this},Y.prototype.clear=function(){this.__data__=[],this.size=0},Y.prototype.delete=function(e){var t=this.__data__,n=ee(t,e);return!(n<0||(n==t.length-1?t.pop():F.call(t,n,1),--this.size,0))},Y.prototype.get=function(e){var t=this.__data__,n=ee(t,e);return n<0?void 0:t[n][1]},Y.prototype.has=function(e){return ee(this.__data__,e)>-1},Y.prototype.set=function(e,t){var n=this.__data__,r=ee(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this},X.prototype.clear=function(){this.size=0,this.__data__={hash:new K,map:new(G||Y),string:new K}},X.prototype.delete=function(e){var t=ie(this,e).delete(e);return this.size-=t?1:0,t},X.prototype.get=function(e){return ie(this,e).get(e)},X.prototype.has=function(e){return ie(this,e).has(e)},X.prototype.set=function(e,t){var n=ie(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this},Z.prototype.clear=function(){this.__data__=new Y,this.size=0},Z.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},Z.prototype.get=function(e){return this.__data__.get(e)},Z.prototype.has=function(e){return this.__data__.has(e)},Z.prototype.set=function(e,t){var n=this.__data__;if(n instanceof Y){var r=n.__data__;if(!G||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new X(r)}return n.set(e,t),this.size=n.size,this};function ne(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":z&&z in Object(e)?function(e){var t=$.call(e,z),n=e[z];try{e[z]=void 0;var r=!0}catch(e){}var o=O.call(e);return r&&(t?e[z]=n:delete e[z]),o}(e):function(e){return O.call(e)}(e)}function re(e){return we(e)&&ne(e)==a}function oe(e,t,n,r,o){e!==t&&function(e,t,n){for(var r=-1,o=Object(e),a=n(e),i=a.length;i--;){var l=a[++r];if(!1===t(o[l],l,o))break}}(t,function(a,i){if(o||(o=new Z),ye(a))!function(e,t,n,r,o,a,i){var s=ue(e,n),c=ue(t,n),u=i.get(c);if(u)J(e,n,u);else{var d,p,f,h,m,g=a?a(s,c,n+"",e,t,i):void 0,b=void 0===g;if(b){var v=he(c),y=!v&&ge(c),w=!v&&!y&&xe(c);g=c,v||y||w?he(s)?g=s:we(m=s)&&me(m)?g=function(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}(s):y?(b=!1,g=function(e){return e.slice()}(c)):w?(b=!1,h=new(f=(d=c).buffer).constructor(f.byteLength),new R(h).set(new R(f)),p=h,g=new d.constructor(p,d.byteOffset,d.length)):g=[]:function(e){if(!we(e)||ne(e)!=l)return!1;var t=P(e);if(null===t)return!0;var n=$.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&S.call(n)==I}(c)||fe(c)?(g=s,fe(s)?g=function(e){return function(e,t,n){var r=!n;n||(n={});for(var o=-1,a=t.length;++o<a;){var i=t[o],l=void 0;void 0===l&&(l=e[i]),r?te(n,i,l):Q(n,i,l)}return n}(e,Ee(e))}(s):ye(s)&&!be(s)||(g=function(e){return"function"!=typeof e.constructor||ce(e)?{}:q(P(e))}(c))):b=!1}b&&(i.set(c,g),o(g,c,r,a,i),i.delete(c)),J(e,n,g)}}(e,t,i,n,oe,r,o);else{var s=r?r(ue(e,i),a,i+"",e,t,o):void 0;void 0===s&&(s=a),J(e,i,s)}},Ee)}var ae=B?function(e,t){return B(e,"toString",{configurable:!0,enumerable:!1,value:(n=t,function(){return n}),writable:!0});var n}:Ae;function ie(e,t){var n,r,o=e.__data__;return("string"==(r=typeof(n=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?o["string"==typeof t?"string":"hash"]:o.map}function le(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return function(e){return!(!ye(e)||function(e){return!!C&&C in e}(e))&&(be(e)?L:s).test(function(e){if(null!=e){try{return S.call(e)}catch(e){}try{return e+""}catch(e){}}return""}(e))}(n)?n:void 0}function se(e,t){var n=typeof e;return!!(t=null==t?o:t)&&("number"==n||"symbol"!=n&&c.test(e))&&e>-1&&e%1==0&&e<t}function ce(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||A)}function ue(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}var de=function(e){var t=0,n=0;return function(){var r=V(),o=16-(r-n);if(n=r,o>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}(ae);function pe(e,t){return e===t||e!=e&&t!=t}var fe=re(function(){return arguments}())?re:function(e){return we(e)&&$.call(e,"callee")&&!j.call(e,"callee")},he=Array.isArray;function me(e){return null!=e&&ve(e.length)&&!be(e)}var ge=H||function(){return!1};function be(e){if(!ye(e))return!1;var t=ne(e);return t==i||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}function ve(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=o}function ye(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function we(e){return null!=e&&"object"==typeof e}var xe=E?function(e){return function(t){return e(t)}}(E):function(e){return we(e)&&ve(e.length)&&!!u[ne(e)]};function Ee(e){return me(e)?function(e,t){var n=he(e),r=!n&&fe(e),o=!n&&!r&&ge(e),a=!n&&!r&&!o&&xe(e),i=n||r||o||a,l=i?function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}(e.length,String):[],s=l.length;for(var c in e)!t&&!$.call(e,c)||i&&("length"==c||o&&("offset"==c||"parent"==c)||a&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||se(c,s))||l.push(c);return l}(e,!0):function(e){if(!ye(e))return function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t}(e);var t=ce(e),n=[];for(var r in e)("constructor"!=r||!t&&$.call(e,r))&&n.push(r);return n}(e)}var ke,_e=(ke=function(e,t,n){oe(e,t,n)},function(e,t){return de(function(e,t,n){return t=U(void 0===t?e.length-1:t,0),function(){for(var r=arguments,o=-1,a=U(r.length-t,0),i=Array(a);++o<a;)i[o]=r[t+o];o=-1;for(var l=Array(t+1);++o<t;)l[o]=r[o];return l[t]=n(i),function(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}(e,this,l)}}(e,t,Ae),e+"")}(function(e,t){var n=-1,r=t.length,o=r>1?t[r-1]:void 0,a=r>2?t[2]:void 0;for(o=ke.length>3&&"function"==typeof o?(r--,o):void 0,a&&function(e,t,n){if(!ye(n))return!1;var r=typeof t;return!!("number"==r?me(n)&&se(t,n.length):"string"==r&&t in n)&&pe(n[t],e)}(t[0],t[1],a)&&(o=r<3?void 0:o,r=1),e=Object(e);++n<r;){var i=t[n];i&&ke(e,i,n)}return e}));function Ae(e){return e}e.exports=_e},8099:e=>{"use strict";e.exports={}},8130:(e,t,n)=>{"use strict";var r=n(8146);e.exports=function(e){return r(e.length)}},8137:e=>{"use strict";e.exports=function(){}},8141:(e,t,n)=>{"use strict";var r=n(3753);e.exports=function(e,t){return r[e]||(r[e]=t||{})}},8146:(e,t,n)=>{"use strict";var r=n(9903),o=Math.min;e.exports=function(e){var t=r(e);return t>0?o(t,9007199254740991):0}},8172:(e,t,n)=>{"use strict";n.d(t,{A:()=>a});var r=n(9749),o=n.n(r);function a(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return Object.entries(e).reduce((e,n)=>{let[r,a]=n;return{...e,...o()(t).call(t,r)?{[r]:a}:{}}},{})}},8341:(e,t,n)=>{"use strict";n(7603);var r=n(2856);e.exports=r("Array","includes")},8407:(e,t,n)=>{"use strict";var r=n(4904),o=n(2769),a=n(9932),i=n(8655)("toStringTag"),l=Object,s="Arguments"===a(function(){return arguments}());e.exports=r?a:function(e){var t,n,r;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(n=function(e,t){try{return e[t]}catch(e){}}(t=l(e),i))?n:s?a(t):"Object"===(r=a(t))&&o(t.callee)?"Arguments":r}},8411:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});const r=new Set;function o(e){var t,n;const{feedbackSettings:o}=window.__KINDLY_SETTINGS__,a=null==o||null===(t=o[e])||void 0===t?void 0:t.forms.find(e=>"bot_conversation"===e.trigger_type&&e.is_active),i=null==o||null===(n=o[e])||void 0===n?void 0:n.forms.find(e=>"handover_conversation"===e.trigger_type&&e.is_active);return{botConversationFeedback:a,handoverConversationFeedback:i,preloadFeedbackImages:e=>{const t="bot_conversation"===e?a:i;t&&t.rating_scale.edit_labels.forEach(e=>{if(r.has(e.image))return;const t=new Image;t.src=e.image,r.add(t.src)})}}}},8483:(e,t,n)=>{"use strict";n.d(t,{UJ:()=>u,XO:()=>h,fk:()=>p,mg:()=>f,qf:()=>d});var r=n(2221),o=n(4851),a=n(9313),i=n(5564),l=n(7243),s=n(7173);const c="pusherTransportEncrypted",u=()=>(e,t)=>{const{connected:n}=t().connection;n||e({type:s._Y})},d=()=>(e,t)=>{const{connected:n}=t().connection;n&&e({type:s._N})},p=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return async n=>{const r=JSON.parse(window.localStorage.getItem(c));t.indexOf("ws")<0&&r&&"ws"!==r.transport&&window.localStorage.removeItem(c),await n((0,i.JL)()),await n((0,i.$u)()),(0,a.Xs)({channelAuthorization:{headers:{"kindly-chatbubble-token":e,"Current-Url":window.location.href}},disabledTransports:t}),(0,l.Cy)(e)}},f=function(){let{triggerDialogueSlug:e,languageCode:t,shouldGreet:n=!0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return async(i,c)=>{var u,d,f;const{local:{context:h,labels:m},chatbubble:{botKey:g,currentLanguage:b,disabledTransports:v},environment:{PAT_HOST:y},bot:{includeDisabledLanguages:w}}=c();n&&i({type:s.A8});const x=(new Date).toISOString(),E=await i((0,l.et)(`${y}/chatbubble/${r.Ak}/connect`,{method:"POST",body:{labels:m,context:h,language_code:t||b,trigger_dialogue_slug:e,include_disabled_languages:w,should_greet:n,include_greeting:!0,tz:null===Intl||void 0===Intl||null===(u=Intl.DateTimeFormat)||void 0===u||null===(d=u.call(Intl))||void 0===d||null===(f=d.resolvedOptions())||void 0===f?void 0:f.timeZone},...(0,o.A)({botKey:g},{withCurrentUrl:!0,withVersion:!0})}));if(!E)return i({type:s.wk}),!1;const{pusherConnected:k}=c().connection;if(k)try{(0,a.Zf)()}catch(e){console.warn(e)}const{token:_,chat_id:A,created:T,all_greetings_hide_input:S,greeting:$,live_translation_system_dialogue:C}=E.data;return i({type:s.wk}),i({type:s.ny,token:_,chatId:A,allGreetingsHideInput:S}),i({type:s.nm,startedAt:T}),i((0,l.TP)(x)),C&&i({type:s.tq,data:C}),$&&i({type:s.tq,data:$}),i(p(_,v)),!0}},h=e=>t=>t({type:s.zT,triggerConfig:e})},8628:(e,t,n)=>{"use strict";n.d(t,{jz:()=>_,B:()=>T,UB:()=>w,g4:()=>h,Rh:()=>g,eG:()=>p,mN:()=>I,_e:()=>M,wQ:()=>d,ky:()=>b,VK:()=>L,Mm:()=>E,ZS:()=>x,lQ:()=>y,Ln:()=>A,L4:()=>m,w7:()=>O,zn:()=>$,nI:()=>S,ob:()=>C,i1:()=>f,Z4:()=>v,V$:()=>k});var r=n(6367),o=n(2221),a=n(2366),i=n(4851),l=n(9313),s=n(7243),c=n(7173),u=n(5767);const d=e=>(t,n)=>{const r=n().chatbubble.overlayViews[n().chatbubble.overlayViews.length-1];e&&r!==e&&t({type:c.wM,view:e})},p=()=>e=>{e({type:c.SO})},f=()=>e=>{e({type:c.nX})},h=e=>t=>{t({type:c.CB,botKey:e})},m=function(e){let{skipRestart:t=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return async(n,r)=>{const{botKey:a,chatHasStarted:l}=r().chatbubble,{takenOver:u}=r().agent,{token:d}=r().connection,{PAT_HOST:p}=r().environment;if(n({type:c.M2,code:e}),t||!l||u){if(l&&!await n((0,s.et)(`${p}/chatbubble/${o.Ak}/language_switch/`,{method:"POST",body:{languageCode:e},headers:(0,i.A)({token:d}).headers}))){const{currentLanguage:e}=r().chatbubble;n({type:c.M2,code:e})}}else n((0,s.zX)(a,!0))}},g=function(){let{source:e="user"}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(t,n)=>{(0,r.tf)("close-chatbubble",void 0,{storeState:n(),source:e}),t({type:c.uS})}},b=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return(t,n)=>{const{chatbubble:{botKey:r}}=n();t((0,s.zX)(r,e)),t(p());try{(0,l.Zf)()}catch(e){console.error(e)}}},v=()=>(e,t)=>{const{chatbubble:{chatHasStarted:n}}=t();n||e({type:c.d$,chatHasStarted:!0})},y=function(){let{source:e="user"}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(t,n)=>{const{pushMessages:a,alerts:i,bot:l,nudge:s,chatbubble:{chatHasStarted:u},bot:{welcomePageType:d}}=n(),p=!u&&d!==o.Lb.NONE;(0,r.tf)("open-chatbubble",{value:{nextPage:p?"welcome-page":"chat"}},{storeState:n(),source:e}),a.show&&t({type:c.a_}),s.show&&t({type:c.X2}),(i.showTabNotification||i.showBubbleNotification)&&t({type:c.u2}),t({type:c.kA}),l.welcomePage&&l.welcomePageType!==o.Lb.NONE||t(v())}},w=()=>(e,t)=>{const{active:n,previouslyPoppedUp:r}=t().chatbubble;n||r||(e(y({source:"programmatic"})),e({type:c.hn}))},x=()=>e=>{e({type:c.HW,userIsIdle:!0})},E=e=>(e,t)=>{const{userIsIdle:n}=t().chatbubble;n&&e({type:c.HW,userIsIdle:!1})},k=e=>(t,n)=>{var r,o;const{chatbubble:{contactDetailsButton:a}}=n();(null==a||null===(r=a.contact_details)||void 0===r?void 0:r.contact_type)===(null==e||null===(o=e.contact_details)||void 0===o?void 0:o.contact_type)?t({type:c.t1}):t({type:c.Eg,button:e})},_=e=>t=>{t({type:c.FZ,button:e})},A=e=>t=>{0===e.length?t({type:c.Q4}):t({type:c.TF,files:e})},T=()=>e=>{e({type:c.YR})},S=e=>t=>{t({type:c.uA,state:e})},$=e=>t=>{t({type:c.Xu,currentModal:e})},C=e=>(t,n)=>{setTimeout(()=>{const{chatbubble:{chatHasStarted:r}}=n();r&&(t((0,u.WG)({ratingSystem:e.rating_scale.rating_system,triggerType:e.trigger_type,formTitle:e.form_title,step:"RATING_SCALE"})),t($("FEEDBACK_END_HANDOVER")))},2e3)},O=e=>t=>{t({type:c.XM,isChatFullWindow:e})},I=()=>e=>{e(p()),e(v())},L=function(){let{responsePromise:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"html";return async(n,r)=>{let l=e?await e:null;if(!l){const{connection:{token:e},environment:{PAT_HOST:n}}=r(),s=`${n}/chatbubble/${o.Ak}/privacy/export/${t}`,{headers:c}=(0,i.A)({token:e}),u={method:"GET",headers:{...c,"kindly-chat-version":"2.76.8",[a.B]:(0,a.U)()}};l=await(async(e,t)=>{let n;return fetch(e,{...t,headers:{"Content-Type":"application/json","kindly-chat-version":"2.76.8",[a.B]:(0,a.U)(),...t.headers},body:JSON.stringify(t.body)}).then(e=>{if(!e.ok)throw new Error(e.statusText);const t=e.headers.get("Content-Disposition");return n=t.split(/;(.+)/)[1].split(/=(.+)/)[1],n=n.toLowerCase().startsWith("utf-8''")?decodeURIComponent(n.replace(/utf-8''/i,"")):n.replace(/['"]/g,""),e.blob()}).then(e=>{var t;const r=window.URL.createObjectURL(e),o=((null===(t=window.kindlyChat)||void 0===t?void 0:t.shadowRoot)||window.document).getElementById("chatContainer"),a=document.createElement("a");a.href=r,a.download=n,o.appendChild(a),a.click(),a.remove()})})(s,u)}}},M=function(){let{responsePromise:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return async(t,n)=>{const{connection:{token:r},chatbubble:{botKey:a},environment:{PAT_HOST:l}}=n(),u=`${l}/chatbubble/${o.Ak}/privacy/delete/`,p=e?await e:await t((0,s.et)(u,{method:"DELETE",...(0,i.A)({token:r})}));200===(null==p?void 0:p.status)&&(t({type:c.CB,botKey:a,keepOpen:!0}),t(d("DELETED_CHAT")))}}},8639:(e,t,n)=>{"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){switch((0,a.default)(e)){case"void":return function(e){return e};case"string":return function(t){return(0,o.default)(t,[e])};case"array":return function(t){return(0,o.default)(t,e)};default:return console.error("Invalid paths argument, should be of type String, Array or Void")}};var o=r(n(4517)),a=r(n(4399));e.exports=t.default},8655:(e,t,n)=>{"use strict";var r=n(8900),o=n(8141),a=n(701),i=n(1268),l=n(4603),s=n(7460),c=r.Symbol,u=o("wks"),d=s?c.for||c:c&&c.withoutSetter||i;e.exports=function(e){return a(u,e)||(u[e]=l&&a(c,e)?c[e]:d("Symbol."+e)),u[e]}},8696:(e,t,n)=>{"use strict";var r=n(1203),o=n(2769),a=/#|\.prototype\./,i=function(e,t){var n=s[l(e)];return n===u||n!==c&&(o(t)?r(t):!!t)},l=i.normalize=function(e){return String(e).replace(a,".").toLowerCase()},s=i.data={},c=i.NATIVE="N",u=i.POLYFILL="P";e.exports=i},8780:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});const r=e=>0===Object.keys(e).length},8900: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")()},8905:(e,t,n)=>{"use strict";n.d(t,{AV:()=>i,CM:()=>o,FR:()=>f,HM:()=>h,J:()=>l,Nl:()=>p,Nz:()=>d,Tj:()=>r,jO:()=>c,mb:()=>s,qd:()=>a,vI:()=>u});const r={darkColor:"#2c2c2c",primaryColor:"#0069ff",grayColor:"#edeeef",errorColor:"#fa4d1e",warningColor:"#ffca3a",successColor:"#50e39b",shadowColor:"rgba(0, 0, 0, 0.15)",shadowColorDark:"rgba(0, 0, 0, 0.3)",borderColorLight:"#ebebeb",borderColorDarkGray:"#d2d5d7",white:"#ffffff"},o={0:"#f7fafc",5:"#f4f7fa",10:"#f1f4f8",15:"#edf0f4",20:"#e8ecf1",30:"#dbe0e6",40:"#c8cfd8",50:"#afb8c4",60:"#8f9aaa",70:"#6a778a",80:"#445265",90:"#232f41",100:"#0c141f"},a={textColor:"#333333",textColorLight:"#757575"},i={dark:"#0D0D0D",light:"#F2F2F2"},l={extraSmall:"var(--_kindlychat-font-size-xs)",small:"var(--_kindlychat-font-size-sm)",p:"var(--_kindlychat-font-size-p)",h2:"var(--_kindlychat-font-size-h2)",h3:"var(--_kindlychat-font-size-h3)",h4:"var(--_kindlychat-font-size-h4)",h5:"var(--_kindlychat-font-size-m)",input:"var(--_kindlychat-font-size-input)"},s={tablet:"768px",phone:"500px"},c={minTablet:`(min-width: calc(${s.tablet} + 1px))`,maxTablet:`(max-width: ${s.tablet})`,maxPhone:`(max-width: ${s.phone})`,maxPhoneHeight:"(max-height: 760px)"},u={headerIndex:"15",overlayIndex:"20",contextMenuIndex:"30"},d={minWidth:190},p={icon:"10px",wrapper:"6px"},f={button:"0px 1px 4px 0px rgba(0, 0, 0, 0.08)",level2:"0px 4px 8px 0px rgba(0, 0, 0, 0.04), 0px 0px 1px 0px rgba(0, 0, 0, 0.16), 0px 8px 48px 0px rgba(0, 0, 0, 0.06)"},h={sunglow:"#FFF1CC",sunglowDark:"#4D3800",pomegranate:"#FFD7CC",pomegranateDark:"#4D1000"}},9098:(e,t,n)=>{"use strict";var r=n(8900),o=n(7013),a=n(9344),i=n(2769),l=n(4543).f,s=n(8696),c=n(8099),u=n(4572),d=n(3999),p=n(701);n(3753);var f=function(e){var t=function(n,r,a){if(this instanceof t){switch(arguments.length){case 0:return new e;case 1:return new e(n);case 2:return new e(n,r)}return new e(n,r,a)}return o(e,this,arguments)};return t.prototype=e.prototype,t};e.exports=function(e,t){var n,o,h,m,g,b,v,y,w,x=e.target,E=e.global,k=e.stat,_=e.proto,A=E?r:k?r[x]:r[x]&&r[x].prototype,T=E?c:c[x]||d(c,x,{})[x],S=T.prototype;for(m in t)o=!(n=s(E?m:x+(k?".":"#")+m,e.forced))&&A&&p(A,m),b=T[m],o&&(v=e.dontCallGetSet?(w=l(A,m))&&w.value:A[m]),g=o&&v?v:t[m],(n||_||typeof b!=typeof g)&&(y=e.bind&&o?u(g,r):e.wrap&&o?f(g):_&&i(g)?a(g):g,(e.sham||g&&g.sham||b&&b.sham)&&d(y,"sham",!0),d(T,m,y),_&&(p(c,h=x+"Prototype")||d(c,h,{}),d(c[h],m,g),e.real&&S&&(n||!S[m])&&d(S,m,g)))}},9100:(e,t,n)=>{"use strict";n.d(t,{Ay:()=>l,cT:()=>a,ue:()=>i});var r=n(2221),o=n(7173);const a={KINDLY_GPT:"kindly-gpt"},i={id:null,name:"",avatar:"",botName:"",botAvatar:"",text:null,startOverText:"Start over",placeholder:"",typingIndicator:!1,typingDuration:"",isTyping:!1,typingType:void 0,realtimeAnalytics:!1,inputLimitEnabled:!1,inputLimit:140,welcomePage:null,welcomePageType:r.Lb.COLOR,pushGreetingsEnabled:!1,pushGreetings:[],tabNotification:!0,bubbleNotification:!0},l=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:i,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case o.CB:return{...e,name:e.botName,avatar:e.botAvatar,splitLabelTimestamp:Date.now()};case o.A8:var n;return{...e,isTyping:e.typingIndicator,typingType:null===(n=t.data)||void 0===n?void 0:n.type};case o.wk:return{...e,isTyping:!1,typingType:void 0};case o.tq:return{...e,hasInteraction:!0,splitLabelTimestamp:Date.now()};case o.mw:return{...e,splitLabelTimestamp:Date.now(),splitTestLabel:t.splitTestLabel};case o.Q0:return{...e,splitLabelTimestamp:Date.now()};case o.Tc:return{...e,splitTestLabel:null,hasInteraction:null,splitLabelTimestamp:null};default:return e}}},9155:t=>{"use strict";t.exports=e},9223:(e,t,n)=>{"use strict";n.d(t,{A:()=>u});var r=n(9155),o=n.n(r),a=n(4935),i=n(3169),l=n(5545);function s(e,t){const{href:n,target:r,children:s,icon:c,text:u,loading:d=!1,isCheckbox:p=!1,type:f="button",onClick:h=a.A,cy:m,isSecondaryButton:g=!1,flat:b,disabled:v,selected:y,...w}=e,x=e=>{d?e.preventDefault():h(e)};return n?o().createElement(i.rK,Object.assign({ref:t,href:n,target:r,$isCheckbox:p,onClick:x,$loading:d,$isSecondaryButton:g},w),d?o().createElement(l.A,{flat:w.flat,isCheckbox:p,loading:d}):o().createElement(i.EE,null,o().createElement(i.T3,null,s||u),o().createElement(i.Tu,null,c))):o().createElement(i.Ef,Object.assign({ref:t,onClick:x,$isCheckbox:p,type:f,$loading:d,"data-testid":m,$isSecondaryButton:g,$flat:b,$disabled:v,$selected:y},w),d?o().createElement(l.A,{flat:w.flat,isCheckbox:p,loading:d}):o().createElement(i.EE,null,o().createElement(i.T3,null,s||u),o().createElement(i.Tu,null,c)))}const c=o().forwardRef(s);c.displayName="Button";const u=c},9258:(e,t,n)=>{"use strict";var r=n(4713),o=n(2769),a=n(262),i=TypeError;e.exports=function(e,t){var n,l;if("string"===t&&o(n=e.toString)&&!a(l=r(n,e)))return l;if(o(n=e.valueOf)&&!a(l=r(n,e)))return l;if("string"!==t&&o(n=e.toString)&&!a(l=r(n,e)))return l;throw new i("Can't convert object to primitive value")}},9272:(e,t,n)=>{"use strict";n.d(t,{KN:()=>o,ZF:()=>a,cJ:()=>r,k1:()=>i});const r={TEXT:"TEXT",CHECKBOX:"CHECKBOX",RANGE:"RANGE",EMAIL:"EMAIL",NUMBER:"NUMBER",SELECT:"SELECT",RADIO:"RADIO",FILE:"FILE",TEXTAREA:"TEXTAREA"},o={ACTIVE:"ACTIVE",SUBMITTED:"SUBMITTED",CANCELED:"CANCELED",UNANSWERED:"UNANSWERED",ERRORED:"ERRORED"},a={PATTERN:"pattern",REQUIRED:"required",MAX_LENGTH:"max_length",MIN_LENGTH:"min_length",min:"min",max:"max"},i={CUSTOM:"custom",BROWSER:"browser"}},9292:(e,t,n)=>{"use strict";n.d(t,{Ak:()=>r,W$:()=>o,dT:()=>l,fl:()=>i,gH:()=>a});const r="v2",o=Object.freeze(["agent","alerts","bot","chatbubble","nudge"]),a="chat-group",i="message-block",l="typing-indicator"},9308:(e,t,n)=>{"use strict";n.d(t,{X:()=>Be,A:()=>Ue});var r=n(4953),o=n.n(r),a=n(9155),i=n.n(a),l=n(541),s=n(5256),c=n(3864),u=n(4311),d=n(1872),p=n(1695),f=n(8905),h=n(4499),m=n(6538),g=n(3249);const b=c.AH`
1390
+ `,g=function(e){let{file:t,canRemove:n=!0,onRemove:r}=e;return o().createElement(u,null,o().createElement(h,null,o().createElement(i.A,{title:"attachment"})),o().createElement(d,null,o().createElement(p,null,t.name),o().createElement(f,null,(0,l.B$)(t.size))),n&&o().createElement(m,{onClick:r},o().createElement(a.US,{width:24,height:24})))}},8089:(e,t,n)=>{e=n.nmd(e);var r="__lodash_hash_undefined__",o=9007199254740991,a="[object Arguments]",i="[object Function]",l="[object Object]",s=/^\[object .+?Constructor\]$/,c=/^(?:0|[1-9]\d*)$/,u={};u["[object Float32Array]"]=u["[object Float64Array]"]=u["[object Int8Array]"]=u["[object Int16Array]"]=u["[object Int32Array]"]=u["[object Uint8Array]"]=u["[object Uint8ClampedArray]"]=u["[object Uint16Array]"]=u["[object Uint32Array]"]=!0,u[a]=u["[object Array]"]=u["[object ArrayBuffer]"]=u["[object Boolean]"]=u["[object DataView]"]=u["[object Date]"]=u["[object Error]"]=u[i]=u["[object Map]"]=u["[object Number]"]=u[l]=u["[object RegExp]"]=u["[object Set]"]=u["[object String]"]=u["[object WeakMap]"]=!1;var d,p,f,h="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,m="object"==typeof self&&self&&self.Object===Object&&self,g=h||m||Function("return this")(),b=t&&!t.nodeType&&t,v=b&&e&&!e.nodeType&&e,y=v&&v.exports===b,w=y&&h.process,x=function(){try{return v&&v.require&&v.require("util").types||w&&w.binding&&w.binding("util")}catch(e){}}(),E=x&&x.isTypedArray,k=Array.prototype,_=Function.prototype,A=Object.prototype,T=g["__core-js_shared__"],S=_.toString,$=A.hasOwnProperty,C=(d=/[^.]+$/.exec(T&&T.keys&&T.keys.IE_PROTO||""))?"Symbol(src)_1."+d:"",O=A.toString,I=S.call(Object),L=RegExp("^"+S.call($).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),M=y?g.Buffer:void 0,N=g.Symbol,R=g.Uint8Array,P=(M&&M.allocUnsafe,p=Object.getPrototypeOf,f=Object,function(e){return p(f(e))}),D=Object.create,j=A.propertyIsEnumerable,F=k.splice,z=N?N.toStringTag:void 0,B=function(){try{var e=le(Object,"defineProperty");return e({},"",{}),e}catch(e){}}(),H=M?M.isBuffer:void 0,U=Math.max,V=Date.now,G=le(g,"Map"),W=le(Object,"create"),q=function(){function e(){}return function(t){if(!ye(t))return{};if(D)return D(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();function K(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Y(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function X(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Z(e){var t=this.__data__=new Y(e);this.size=t.size}function J(e,t,n){(void 0!==n&&!pe(e[t],n)||void 0===n&&!(t in e))&&te(e,t,n)}function Q(e,t,n){var r=e[t];$.call(e,t)&&pe(r,n)&&(void 0!==n||t in e)||te(e,t,n)}function ee(e,t){for(var n=e.length;n--;)if(pe(e[n][0],t))return n;return-1}function te(e,t,n){"__proto__"==t&&B?B(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}K.prototype.clear=function(){this.__data__=W?W(null):{},this.size=0},K.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},K.prototype.get=function(e){var t=this.__data__;if(W){var n=t[e];return n===r?void 0:n}return $.call(t,e)?t[e]:void 0},K.prototype.has=function(e){var t=this.__data__;return W?void 0!==t[e]:$.call(t,e)},K.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=W&&void 0===t?r:t,this},Y.prototype.clear=function(){this.__data__=[],this.size=0},Y.prototype.delete=function(e){var t=this.__data__,n=ee(t,e);return!(n<0||(n==t.length-1?t.pop():F.call(t,n,1),--this.size,0))},Y.prototype.get=function(e){var t=this.__data__,n=ee(t,e);return n<0?void 0:t[n][1]},Y.prototype.has=function(e){return ee(this.__data__,e)>-1},Y.prototype.set=function(e,t){var n=this.__data__,r=ee(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this},X.prototype.clear=function(){this.size=0,this.__data__={hash:new K,map:new(G||Y),string:new K}},X.prototype.delete=function(e){var t=ie(this,e).delete(e);return this.size-=t?1:0,t},X.prototype.get=function(e){return ie(this,e).get(e)},X.prototype.has=function(e){return ie(this,e).has(e)},X.prototype.set=function(e,t){var n=ie(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this},Z.prototype.clear=function(){this.__data__=new Y,this.size=0},Z.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},Z.prototype.get=function(e){return this.__data__.get(e)},Z.prototype.has=function(e){return this.__data__.has(e)},Z.prototype.set=function(e,t){var n=this.__data__;if(n instanceof Y){var r=n.__data__;if(!G||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new X(r)}return n.set(e,t),this.size=n.size,this};function ne(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":z&&z in Object(e)?function(e){var t=$.call(e,z),n=e[z];try{e[z]=void 0;var r=!0}catch(e){}var o=O.call(e);return r&&(t?e[z]=n:delete e[z]),o}(e):function(e){return O.call(e)}(e)}function re(e){return we(e)&&ne(e)==a}function oe(e,t,n,r,o){e!==t&&function(e,t,n){for(var r=-1,o=Object(e),a=n(e),i=a.length;i--;){var l=a[++r];if(!1===t(o[l],l,o))break}}(t,function(a,i){if(o||(o=new Z),ye(a))!function(e,t,n,r,o,a,i){var s=ue(e,n),c=ue(t,n),u=i.get(c);if(u)J(e,n,u);else{var d,p,f,h,m,g=a?a(s,c,n+"",e,t,i):void 0,b=void 0===g;if(b){var v=he(c),y=!v&&ge(c),w=!v&&!y&&xe(c);g=c,v||y||w?he(s)?g=s:we(m=s)&&me(m)?g=function(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}(s):y?(b=!1,g=function(e){return e.slice()}(c)):w?(b=!1,h=new(f=(d=c).buffer).constructor(f.byteLength),new R(h).set(new R(f)),p=h,g=new d.constructor(p,d.byteOffset,d.length)):g=[]:function(e){if(!we(e)||ne(e)!=l)return!1;var t=P(e);if(null===t)return!0;var n=$.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&S.call(n)==I}(c)||fe(c)?(g=s,fe(s)?g=function(e){return function(e,t,n){var r=!n;n||(n={});for(var o=-1,a=t.length;++o<a;){var i=t[o],l=void 0;void 0===l&&(l=e[i]),r?te(n,i,l):Q(n,i,l)}return n}(e,Ee(e))}(s):ye(s)&&!be(s)||(g=function(e){return"function"!=typeof e.constructor||ce(e)?{}:q(P(e))}(c))):b=!1}b&&(i.set(c,g),o(g,c,r,a,i),i.delete(c)),J(e,n,g)}}(e,t,i,n,oe,r,o);else{var s=r?r(ue(e,i),a,i+"",e,t,o):void 0;void 0===s&&(s=a),J(e,i,s)}},Ee)}var ae=B?function(e,t){return B(e,"toString",{configurable:!0,enumerable:!1,value:(n=t,function(){return n}),writable:!0});var n}:Ae;function ie(e,t){var n,r,o=e.__data__;return("string"==(r=typeof(n=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?o["string"==typeof t?"string":"hash"]:o.map}function le(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return function(e){return!(!ye(e)||function(e){return!!C&&C in e}(e))&&(be(e)?L:s).test(function(e){if(null!=e){try{return S.call(e)}catch(e){}try{return e+""}catch(e){}}return""}(e))}(n)?n:void 0}function se(e,t){var n=typeof e;return!!(t=null==t?o:t)&&("number"==n||"symbol"!=n&&c.test(e))&&e>-1&&e%1==0&&e<t}function ce(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||A)}function ue(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}var de=function(e){var t=0,n=0;return function(){var r=V(),o=16-(r-n);if(n=r,o>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}(ae);function pe(e,t){return e===t||e!=e&&t!=t}var fe=re(function(){return arguments}())?re:function(e){return we(e)&&$.call(e,"callee")&&!j.call(e,"callee")},he=Array.isArray;function me(e){return null!=e&&ve(e.length)&&!be(e)}var ge=H||function(){return!1};function be(e){if(!ye(e))return!1;var t=ne(e);return t==i||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}function ve(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=o}function ye(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function we(e){return null!=e&&"object"==typeof e}var xe=E?function(e){return function(t){return e(t)}}(E):function(e){return we(e)&&ve(e.length)&&!!u[ne(e)]};function Ee(e){return me(e)?function(e,t){var n=he(e),r=!n&&fe(e),o=!n&&!r&&ge(e),a=!n&&!r&&!o&&xe(e),i=n||r||o||a,l=i?function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}(e.length,String):[],s=l.length;for(var c in e)!t&&!$.call(e,c)||i&&("length"==c||o&&("offset"==c||"parent"==c)||a&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||se(c,s))||l.push(c);return l}(e,!0):function(e){if(!ye(e))return function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t}(e);var t=ce(e),n=[];for(var r in e)("constructor"!=r||!t&&$.call(e,r))&&n.push(r);return n}(e)}var ke,_e=(ke=function(e,t,n){oe(e,t,n)},function(e,t){return de(function(e,t,n){return t=U(void 0===t?e.length-1:t,0),function(){for(var r=arguments,o=-1,a=U(r.length-t,0),i=Array(a);++o<a;)i[o]=r[t+o];o=-1;for(var l=Array(t+1);++o<t;)l[o]=r[o];return l[t]=n(i),function(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}(e,this,l)}}(e,t,Ae),e+"")}(function(e,t){var n=-1,r=t.length,o=r>1?t[r-1]:void 0,a=r>2?t[2]:void 0;for(o=ke.length>3&&"function"==typeof o?(r--,o):void 0,a&&function(e,t,n){if(!ye(n))return!1;var r=typeof t;return!!("number"==r?me(n)&&se(t,n.length):"string"==r&&t in n)&&pe(n[t],e)}(t[0],t[1],a)&&(o=r<3?void 0:o,r=1),e=Object(e);++n<r;){var i=t[n];i&&ke(e,i,n)}return e}));function Ae(e){return e}e.exports=_e},8099:e=>{"use strict";e.exports={}},8130:(e,t,n)=>{"use strict";var r=n(8146);e.exports=function(e){return r(e.length)}},8137:e=>{"use strict";e.exports=function(){}},8141:(e,t,n)=>{"use strict";var r=n(3753);e.exports=function(e,t){return r[e]||(r[e]=t||{})}},8146:(e,t,n)=>{"use strict";var r=n(9903),o=Math.min;e.exports=function(e){var t=r(e);return t>0?o(t,9007199254740991):0}},8172:(e,t,n)=>{"use strict";n.d(t,{A:()=>a});var r=n(9749),o=n.n(r);function a(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return Object.entries(e).reduce((e,n)=>{let[r,a]=n;return{...e,...o()(t).call(t,r)?{[r]:a}:{}}},{})}},8341:(e,t,n)=>{"use strict";n(7603);var r=n(2856);e.exports=r("Array","includes")},8407:(e,t,n)=>{"use strict";var r=n(4904),o=n(2769),a=n(9932),i=n(8655)("toStringTag"),l=Object,s="Arguments"===a(function(){return arguments}());e.exports=r?a:function(e){var t,n,r;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(n=function(e,t){try{return e[t]}catch(e){}}(t=l(e),i))?n:s?a(t):"Object"===(r=a(t))&&o(t.callee)?"Arguments":r}},8411:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});const r=new Set;function o(e){var t,n;const{feedbackSettings:o}=window.__KINDLY_SETTINGS__,a=null==o||null===(t=o[e])||void 0===t?void 0:t.forms.find(e=>"bot_conversation"===e.trigger_type&&e.is_active),i=null==o||null===(n=o[e])||void 0===n?void 0:n.forms.find(e=>"handover_conversation"===e.trigger_type&&e.is_active);return{botConversationFeedback:a,handoverConversationFeedback:i,preloadFeedbackImages:e=>{const t="bot_conversation"===e?a:i;t&&t.rating_scale.edit_labels.forEach(e=>{if(r.has(e.image))return;const t=new Image;t.src=e.image,r.add(t.src)})}}}},8483:(e,t,n)=>{"use strict";n.d(t,{UJ:()=>u,XO:()=>h,fk:()=>p,mg:()=>f,qf:()=>d});var r=n(2221),o=n(4851),a=n(9313),i=n(5564),l=n(7243),s=n(7173);const c="pusherTransportEncrypted",u=()=>(e,t)=>{const{connected:n}=t().connection;n||e({type:s._Y})},d=()=>(e,t)=>{const{connected:n}=t().connection;n&&e({type:s._N})},p=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return async n=>{const r=JSON.parse(window.localStorage.getItem(c));t.indexOf("ws")<0&&r&&"ws"!==r.transport&&window.localStorage.removeItem(c),await n((0,i.JL)()),await n((0,i.$u)()),(0,a.Xs)({channelAuthorization:{headers:{"kindly-chatbubble-token":e,"Current-Url":window.location.href}},disabledTransports:t}),(0,l.Cy)(e)}},f=function(){let{triggerDialogueSlug:e,languageCode:t,shouldGreet:n=!0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return async(i,c)=>{var u,d,f;const{local:{context:h,labels:m},chatbubble:{botKey:g,currentLanguage:b,disabledTransports:v},environment:{PAT_HOST:y},bot:{includeDisabledLanguages:w}}=c();n&&i({type:s.A8});const x=(new Date).toISOString(),E=await i((0,l.et)(`${y}/chatbubble/${r.Ak}/connect`,{method:"POST",body:{labels:m,context:h,language_code:t||b,trigger_dialogue_slug:e,include_disabled_languages:w,should_greet:n,include_greeting:!0,tz:null===Intl||void 0===Intl||null===(u=Intl.DateTimeFormat)||void 0===u||null===(d=u.call(Intl))||void 0===d||null===(f=d.resolvedOptions())||void 0===f?void 0:f.timeZone},...(0,o.A)({botKey:g},{withCurrentUrl:!0,withVersion:!0})}));if(!E)return i({type:s.wk}),!1;const{pusherConnected:k}=c().connection;if(k)try{(0,a.Zf)()}catch(e){console.warn(e)}const{token:_,chat_id:A,created:T,all_greetings_hide_input:S,greeting:$,live_translation_system_dialogue:C}=E.data;return i({type:s.wk}),i({type:s.ny,token:_,chatId:A,allGreetingsHideInput:S}),i({type:s.nm,startedAt:T}),i((0,l.TP)(x)),C&&i({type:s.tq,data:C}),$&&i({type:s.tq,data:$}),i(p(_,v)),!0}},h=e=>t=>t({type:s.zT,triggerConfig:e})},8628:(e,t,n)=>{"use strict";n.d(t,{jz:()=>_,B:()=>T,UB:()=>w,g4:()=>h,Rh:()=>g,eG:()=>p,mN:()=>I,_e:()=>M,wQ:()=>d,ky:()=>b,VK:()=>L,Mm:()=>E,ZS:()=>x,lQ:()=>y,Ln:()=>A,L4:()=>m,w7:()=>O,zn:()=>$,nI:()=>S,ob:()=>C,i1:()=>f,Z4:()=>v,V$:()=>k});var r=n(6367),o=n(2221),a=n(2366),i=n(4851),l=n(9313),s=n(7243),c=n(7173),u=n(5767);const d=e=>(t,n)=>{const r=n().chatbubble.overlayViews[n().chatbubble.overlayViews.length-1];e&&r!==e&&t({type:c.wM,view:e})},p=()=>e=>{e({type:c.SO})},f=()=>e=>{e({type:c.nX})},h=e=>t=>{t({type:c.CB,botKey:e})},m=function(e){let{skipRestart:t=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return async(n,r)=>{const{botKey:a,chatHasStarted:l}=r().chatbubble,{takenOver:u}=r().agent,{token:d}=r().connection,{PAT_HOST:p}=r().environment;if(n({type:c.M2,code:e}),t||!l||u){if(l&&!await n((0,s.et)(`${p}/chatbubble/${o.Ak}/language_switch/`,{method:"POST",body:{languageCode:e},headers:(0,i.A)({token:d}).headers}))){const{currentLanguage:e}=r().chatbubble;n({type:c.M2,code:e})}}else n((0,s.zX)(a,!0))}},g=function(){let{source:e="user"}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(t,n)=>{(0,r.tf)("close-chatbubble",void 0,{storeState:n(),source:e}),t({type:c.uS})}},b=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return(t,n)=>{const{chatbubble:{botKey:r}}=n();t((0,s.zX)(r,e)),t(p());try{(0,l.Zf)()}catch(e){console.error(e)}}},v=()=>(e,t)=>{const{chatbubble:{chatHasStarted:n}}=t();n||e({type:c.d$,chatHasStarted:!0})},y=function(){let{source:e="user"}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(t,n)=>{const{pushMessages:a,alerts:i,bot:l,nudge:s,chatbubble:{chatHasStarted:u},bot:{welcomePageType:d}}=n(),p=!u&&d!==o.Lb.NONE;(0,r.tf)("open-chatbubble",{value:{nextPage:p?"welcome-page":"chat"}},{storeState:n(),source:e}),a.show&&t({type:c.a_}),s.show&&t({type:c.X2}),(i.showTabNotification||i.showBubbleNotification)&&t({type:c.u2}),t({type:c.kA}),l.welcomePage&&l.welcomePageType!==o.Lb.NONE||t(v())}},w=()=>(e,t)=>{const{active:n,previouslyPoppedUp:r}=t().chatbubble;n||r||(e(y({source:"programmatic"})),e({type:c.hn}))},x=()=>e=>{e({type:c.HW,userIsIdle:!0})},E=e=>(e,t)=>{const{userIsIdle:n}=t().chatbubble;n&&e({type:c.HW,userIsIdle:!1})},k=e=>(t,n)=>{var r,o;const{chatbubble:{contactDetailsButton:a}}=n();(null==a||null===(r=a.contact_details)||void 0===r?void 0:r.contact_type)===(null==e||null===(o=e.contact_details)||void 0===o?void 0:o.contact_type)?t({type:c.t1}):t({type:c.Eg,button:e})},_=e=>t=>{t({type:c.FZ,button:e})},A=e=>t=>{0===e.length?t({type:c.Q4}):t({type:c.TF,files:e})},T=()=>e=>{e({type:c.YR})},S=e=>t=>{t({type:c.uA,state:e})},$=e=>t=>{t({type:c.Xu,currentModal:e})},C=e=>(t,n)=>{setTimeout(()=>{const{chatbubble:{chatHasStarted:r}}=n();r&&(t((0,u.WG)({ratingSystem:e.rating_scale.rating_system,triggerType:e.trigger_type,formTitle:e.form_title,step:"RATING_SCALE"})),t($("FEEDBACK_END_HANDOVER")))},2e3)},O=e=>t=>{t({type:c.XM,isChatFullWindow:e})},I=()=>e=>{e(p()),e(v())},L=function(){let{responsePromise:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"html";return async(n,r)=>{let l=e?await e:null;if(!l){const{connection:{token:e},environment:{PAT_HOST:n}}=r(),s=`${n}/chatbubble/${o.Ak}/privacy/export/${t}`,{headers:c}=(0,i.A)({token:e}),u={method:"GET",headers:{...c,"kindly-chat-version":"2.76.11",[a.B]:(0,a.U)()}};l=await(async(e,t)=>{let n;return fetch(e,{...t,headers:{"Content-Type":"application/json","kindly-chat-version":"2.76.11",[a.B]:(0,a.U)(),...t.headers},body:JSON.stringify(t.body)}).then(e=>{if(!e.ok)throw new Error(e.statusText);const t=e.headers.get("Content-Disposition");return n=t.split(/;(.+)/)[1].split(/=(.+)/)[1],n=n.toLowerCase().startsWith("utf-8''")?decodeURIComponent(n.replace(/utf-8''/i,"")):n.replace(/['"]/g,""),e.blob()}).then(e=>{var t;const r=window.URL.createObjectURL(e),o=((null===(t=window.kindlyChat)||void 0===t?void 0:t.shadowRoot)||window.document).getElementById("chatContainer"),a=document.createElement("a");a.href=r,a.download=n,o.appendChild(a),a.click(),a.remove()})})(s,u)}}},M=function(){let{responsePromise:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return async(t,n)=>{const{connection:{token:r},chatbubble:{botKey:a},environment:{PAT_HOST:l}}=n(),u=`${l}/chatbubble/${o.Ak}/privacy/delete/`,p=e?await e:await t((0,s.et)(u,{method:"DELETE",...(0,i.A)({token:r})}));200===(null==p?void 0:p.status)&&(t({type:c.CB,botKey:a,keepOpen:!0}),t(d("DELETED_CHAT")))}}},8639:(e,t,n)=>{"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){switch((0,a.default)(e)){case"void":return function(e){return e};case"string":return function(t){return(0,o.default)(t,[e])};case"array":return function(t){return(0,o.default)(t,e)};default:return console.error("Invalid paths argument, should be of type String, Array or Void")}};var o=r(n(4517)),a=r(n(4399));e.exports=t.default},8655:(e,t,n)=>{"use strict";var r=n(8900),o=n(8141),a=n(701),i=n(1268),l=n(4603),s=n(7460),c=r.Symbol,u=o("wks"),d=s?c.for||c:c&&c.withoutSetter||i;e.exports=function(e){return a(u,e)||(u[e]=l&&a(c,e)?c[e]:d("Symbol."+e)),u[e]}},8696:(e,t,n)=>{"use strict";var r=n(1203),o=n(2769),a=/#|\.prototype\./,i=function(e,t){var n=s[l(e)];return n===u||n!==c&&(o(t)?r(t):!!t)},l=i.normalize=function(e){return String(e).replace(a,".").toLowerCase()},s=i.data={},c=i.NATIVE="N",u=i.POLYFILL="P";e.exports=i},8780:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});const r=e=>0===Object.keys(e).length},8900: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")()},8905:(e,t,n)=>{"use strict";n.d(t,{AV:()=>i,CM:()=>o,FR:()=>f,HM:()=>h,J:()=>l,Nl:()=>p,Nz:()=>d,Tj:()=>r,jO:()=>c,mb:()=>s,qd:()=>a,vI:()=>u});const r={darkColor:"#2c2c2c",primaryColor:"#0069ff",grayColor:"#edeeef",errorColor:"#fa4d1e",warningColor:"#ffca3a",successColor:"#50e39b",shadowColor:"rgba(0, 0, 0, 0.15)",shadowColorDark:"rgba(0, 0, 0, 0.3)",borderColorLight:"#ebebeb",borderColorDarkGray:"#d2d5d7",white:"#ffffff"},o={0:"#f7fafc",5:"#f4f7fa",10:"#f1f4f8",15:"#edf0f4",20:"#e8ecf1",30:"#dbe0e6",40:"#c8cfd8",50:"#afb8c4",60:"#8f9aaa",70:"#6a778a",80:"#445265",90:"#232f41",100:"#0c141f"},a={textColor:"#333333",textColorLight:"#757575"},i={dark:"#0D0D0D",light:"#F2F2F2"},l={extraSmall:"var(--_kindlychat-font-size-xs)",small:"var(--_kindlychat-font-size-sm)",p:"var(--_kindlychat-font-size-p)",h2:"var(--_kindlychat-font-size-h2)",h3:"var(--_kindlychat-font-size-h3)",h4:"var(--_kindlychat-font-size-h4)",h5:"var(--_kindlychat-font-size-m)",input:"var(--_kindlychat-font-size-input)"},s={tablet:"768px",phone:"500px"},c={minTablet:`(min-width: calc(${s.tablet} + 1px))`,maxTablet:`(max-width: ${s.tablet})`,maxPhone:`(max-width: ${s.phone})`,maxPhoneHeight:"(max-height: 760px)"},u={headerIndex:"15",overlayIndex:"20",contextMenuIndex:"30"},d={minWidth:190},p={icon:"10px",wrapper:"6px"},f={button:"0px 1px 4px 0px rgba(0, 0, 0, 0.08)",level2:"0px 4px 8px 0px rgba(0, 0, 0, 0.04), 0px 0px 1px 0px rgba(0, 0, 0, 0.16), 0px 8px 48px 0px rgba(0, 0, 0, 0.06)"},h={sunglow:"#FFF1CC",sunglowDark:"#4D3800",pomegranate:"#FFD7CC",pomegranateDark:"#4D1000"}},9098:(e,t,n)=>{"use strict";var r=n(8900),o=n(7013),a=n(9344),i=n(2769),l=n(4543).f,s=n(8696),c=n(8099),u=n(4572),d=n(3999),p=n(701);n(3753);var f=function(e){var t=function(n,r,a){if(this instanceof t){switch(arguments.length){case 0:return new e;case 1:return new e(n);case 2:return new e(n,r)}return new e(n,r,a)}return o(e,this,arguments)};return t.prototype=e.prototype,t};e.exports=function(e,t){var n,o,h,m,g,b,v,y,w,x=e.target,E=e.global,k=e.stat,_=e.proto,A=E?r:k?r[x]:r[x]&&r[x].prototype,T=E?c:c[x]||d(c,x,{})[x],S=T.prototype;for(m in t)o=!(n=s(E?m:x+(k?".":"#")+m,e.forced))&&A&&p(A,m),b=T[m],o&&(v=e.dontCallGetSet?(w=l(A,m))&&w.value:A[m]),g=o&&v?v:t[m],(n||_||typeof b!=typeof g)&&(y=e.bind&&o?u(g,r):e.wrap&&o?f(g):_&&i(g)?a(g):g,(e.sham||g&&g.sham||b&&b.sham)&&d(y,"sham",!0),d(T,m,y),_&&(p(c,h=x+"Prototype")||d(c,h,{}),d(c[h],m,g),e.real&&S&&(n||!S[m])&&d(S,m,g)))}},9100:(e,t,n)=>{"use strict";n.d(t,{Ay:()=>l,cT:()=>a,ue:()=>i});var r=n(2221),o=n(7173);const a={KINDLY_GPT:"kindly-gpt"},i={id:null,name:"",avatar:"",botName:"",botAvatar:"",text:null,startOverText:"Start over",placeholder:"",typingIndicator:!1,typingDuration:"",isTyping:!1,typingType:void 0,realtimeAnalytics:!1,inputLimitEnabled:!1,inputLimit:140,welcomePage:null,welcomePageType:r.Lb.COLOR,pushGreetingsEnabled:!1,pushGreetings:[],tabNotification:!0,bubbleNotification:!0},l=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:i,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case o.CB:return{...e,name:e.botName,avatar:e.botAvatar,splitLabelTimestamp:Date.now()};case o.A8:var n;return{...e,isTyping:e.typingIndicator,typingType:null===(n=t.data)||void 0===n?void 0:n.type};case o.wk:return{...e,isTyping:!1,typingType:void 0};case o.tq:return{...e,hasInteraction:!0,splitLabelTimestamp:Date.now()};case o.mw:return{...e,splitLabelTimestamp:Date.now(),splitTestLabel:t.splitTestLabel};case o.Q0:return{...e,splitLabelTimestamp:Date.now()};case o.Tc:return{...e,splitTestLabel:null,hasInteraction:null,splitLabelTimestamp:null};default:return e}}},9155:t=>{"use strict";t.exports=e},9223:(e,t,n)=>{"use strict";n.d(t,{A:()=>u});var r=n(9155),o=n.n(r),a=n(4935),i=n(3169),l=n(5545);function s(e,t){const{href:n,target:r,children:s,icon:c,text:u,loading:d=!1,isCheckbox:p=!1,type:f="button",onClick:h=a.A,cy:m,isSecondaryButton:g=!1,flat:b,disabled:v,selected:y,...w}=e,x=e=>{d?e.preventDefault():h(e)};return n?o().createElement(i.rK,Object.assign({ref:t,href:n,target:r,$isCheckbox:p,onClick:x,$loading:d,$isSecondaryButton:g},w),d?o().createElement(l.A,{flat:w.flat,isCheckbox:p,loading:d}):o().createElement(i.EE,null,o().createElement(i.T3,null,s||u),o().createElement(i.Tu,null,c))):o().createElement(i.Ef,Object.assign({ref:t,onClick:x,$isCheckbox:p,type:f,$loading:d,"data-testid":m,$isSecondaryButton:g,$flat:b,$disabled:v,$selected:y},w),d?o().createElement(l.A,{flat:w.flat,isCheckbox:p,loading:d}):o().createElement(i.EE,null,o().createElement(i.T3,null,s||u),o().createElement(i.Tu,null,c)))}const c=o().forwardRef(s);c.displayName="Button";const u=c},9258:(e,t,n)=>{"use strict";var r=n(4713),o=n(2769),a=n(262),i=TypeError;e.exports=function(e,t){var n,l;if("string"===t&&o(n=e.toString)&&!a(l=r(n,e)))return l;if(o(n=e.valueOf)&&!a(l=r(n,e)))return l;if("string"!==t&&o(n=e.toString)&&!a(l=r(n,e)))return l;throw new i("Can't convert object to primitive value")}},9272:(e,t,n)=>{"use strict";n.d(t,{KN:()=>o,ZF:()=>a,cJ:()=>r,k1:()=>i});const r={TEXT:"TEXT",CHECKBOX:"CHECKBOX",RANGE:"RANGE",EMAIL:"EMAIL",NUMBER:"NUMBER",SELECT:"SELECT",RADIO:"RADIO",FILE:"FILE",TEXTAREA:"TEXTAREA"},o={ACTIVE:"ACTIVE",SUBMITTED:"SUBMITTED",CANCELED:"CANCELED",UNANSWERED:"UNANSWERED",ERRORED:"ERRORED"},a={PATTERN:"pattern",REQUIRED:"required",MAX_LENGTH:"max_length",MIN_LENGTH:"min_length",min:"min",max:"max"},i={CUSTOM:"custom",BROWSER:"browser"}},9292:(e,t,n)=>{"use strict";n.d(t,{Ak:()=>r,W$:()=>o,dT:()=>l,fl:()=>i,gH:()=>a});const r="v2",o=Object.freeze(["agent","alerts","bot","chatbubble","nudge"]),a="chat-group",i="message-block",l="typing-indicator"},9308:(e,t,n)=>{"use strict";n.d(t,{X:()=>Be,A:()=>Ue});var r=n(4953),o=n.n(r),a=n(9155),i=n.n(a),l=n(541),s=n(5256),c=n(3864),u=n(4311),d=n(1872),p=n(1695),f=n(8905),h=n(4499),m=n(6538),g=n(3249);const b=c.AH`
1391
1391
  & > div,
1392
1392
  & > svg {
1393
1393
  z-index: 3;
@@ -4329,7 +4329,7 @@
4329
4329
  > button {
4330
4330
  flex: 1;
4331
4331
  }
4332
- `;function Cs(e){let{handleCancel:t,handleEndHumanChat:n,descriptionText:r,titleText:a,cancelButtonText:i,confirmButtonText:l}=e;return o().createElement(As,null,o().createElement(Ts,null,o().createElement(Ss,null,o().createElement(_s,{color:"var(--panel-background-white-black-contrast-1743170834)"}),a),o().createElement("p",null,r)),o().createElement($s,null,o().createElement(ei.A,{isSecondaryButton:!0,onClick:t},i),o().createElement(ei.A,{onClick:n},l)))}const Os=e=>{const t=(0,V.A)(e),n=(e||[]).length;return(0,r.useMemo)(()=>n&&n!==(t||[]).length&&e[n-1],[e,n,t])};function Is(e){var t;let{buttonHandlers:n,onMessage:a=null}=e;const i=(0,c.Pj)(),l=(0,va.jL)(),s=(0,r.useRef)(null),d=(0,r.useRef)(null),p=(0,r.useRef)(null),{hideHeader:f,fullscreenMode:h,offsetHeight:m,id:g}=(0,va.GV)(u.Od),{active:b,chatHasStarted:v,currentlyPoppedUp:y,contactDetailsButton:w,currentLanguage:x,currentModal:E,overlayViews:k,isChatFullWindow:_}=(0,va.GV)(e=>{let{chatbubble:t}=e;return t}),{chatMessages:A}=(0,va.GV)(e=>{let{messages:t}=e;return t}),{takenOver:T}=(0,va.GV)(e=>{let{agent:t}=e;return t}),{feedbackToSubmit:$,feedbacksAlreadyDisplayed:C}=(0,va.GV)(hi.CJ),O=Os(A),{cancel_button:I,user_end_handover_button_text:L,user_end_handover_modal_title_text:M,user_end_handover_modal_description_text:N}=(0,ur.A)(),[R,P]=(0,r.useState)(!0);(0,r.useEffect)(()=>{if(R)return void P(!1);if(!O)return;const e=i.getState(),{chatMessages:t,attachments:n}=e.messages,{chatId:r,renderedBy:o}=e.chatbubble,{token:l}=e.connection,{PAT_HOST:s}=e.environment,c=t.map(e=>(0,vs.A)(e,n,s,l)),u=(0,vs.A)(O,n,s,l);(0,Ce.GJ)(ys(u,{botId:g,currentLanguage:x,chatId:r}),c,a,o)},[R,a,O,g,i,A.length]);const D=A.length>=3,j=k[k.length-1],{botConversationFeedback:F,handoverConversationFeedback:z}=(0,Ua.A)(x),B=null===(t=null==F?void 0:F.allow_bot_feedback_after_handover_feedback)||void 0===t||t,H=F&&!S()(C).call(C,"bot_conversation")&&(!S()(C).call(C,"handover_conversation")||B),U=z&&T?z:H?F:null,V=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"user";U&&"CANCEL_CHAT"===j&&D?(l((0,hi.WG)({ratingSystem:U.rating_scale.rating_system,triggerType:U.trigger_type,formTitle:U.form_title,step:"RATING_SCALE"})),l((0,G.wQ)("FEEDBACK"))):((0,Ce.tf)("end-chat",void 0,{storeState:i.getState(),source:e}),l((0,G.ky)(h)),l((0,G.zn)(null)))};return function(e){const{isChatFullWindow:t,renderedBy:n}=(0,c.d4)(u.$P),o=(0,r.useRef)();(0,r.useEffect)(()=>{if(e.current&&ws&&"API"===n)return o.current!==t&&(o.current=t,t?Es():ks()),ks},[e,t])}(p),o().createElement(oe,{"aria-live":"polite","data-cy":"chat-box","data-testid":"chat-box",ref:p,$active:b,$chatHasStarted:v,$fullscreen:!!h,$isChatFullWindow:_,$offsetHeight:m},o().createElement(Vl.A,{errorPoint:"inside ChatBoxContainer"},!f&&o().createElement(Ga,{handleXButtonClick:()=>{"CANCEL_CHAT"!==j&&"FEEDBACK"!==j?l((0,G.wQ)("CANCEL_CHAT")):V()},settingsButtonRef:d}),!!j&&o().createElement(Nl,{endChat:V,feedbackToSubmit:$}),o().createElement(ue,null),o().createElement(os,null),o().createElement(bs,null),o().createElement(da,{bodyRef:s,buttonHandlers:n,inert:!!j||!!E}),w?o().createElement(Ul,null):o().createElement(Ba,{active:b,chatHasStarted:v,currentlyPoppedUp:y,bodyRef:s,inert:!!j||!!E}),"END_HANDOVER"===E&&o().createElement(Cs,{handleCancel:()=>l((0,G.zn)(null)),handleEndHumanChat:async()=>{await l((0,G.m8)()),l((0,G.zn)(null))},titleText:null!=M?M:"",descriptionText:null!=N?N:"",cancelButtonText:null!=I?I:"",confirmButtonText:null!=L?L:""}),"handover_conversation"===(null==$?void 0:$.trigger_type)&&"FEEDBACK_END_HANDOVER"===E&&o().createElement(Gi,{feedbackToSubmit:$})))}Is.displayName="KindlyChatBox";var Ls=n(9308);const Ms=(e,t)=>Object.entries(e).filter(e=>{let[t,n]=e;return"object"==typeof n}).reduce((e,n)=>{let[r,o]=n;return{...e,[r]:(0,Go.A)(o,t)}},{}),Ns=Object.freeze({en:e=>`New message from ${e}`,nb:e=>`Ny melding fra ${e}`,sv:e=>`Nytt meddelande från ${e}`}),Rs=Object.freeze({en:"An agent joined the conversation",nb:"En agent ble med i samtalen",sv:"En agent gick med i samtalet"});let Ps=!1;function Ds(e){const t=document.title;let n;n||Ps||(Ps=!0,n=setInterval(()=>{document.title=document.title===e?t:e},1e3),window.addEventListener("mousemove",function e(){clearInterval(n),document.title=t,n=null,Ps=!1,window.removeEventListener("mousemove",e)}))}var js=n(6079);const Fs=()=>{const{takenOver:e,requestedHandoverAt:t}=(0,c.d4)(u.MA),n=(0,V.A)(e),o=(0,V.A)(t),a=(0,c.wA)(),i=Boolean(t),l=Boolean(o);(0,r.useEffect)(()=>{e&&!n?a((0,js.f2)()):!e&&n&&(0,js.yh)(),i&&!l?a((0,js.Mk)()):!i&&l&&(0,js.Zk)()},[a,l,n,i,e])};var zs=n(4703),Bs=n(4499),Hs=n(7811);const Us=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Object.entries(e).reduce((e,t)=>{let[n,r]=t;return{...e,[(0,Hs.A)(n)]:r}},{})};function Vs(e){let{settings:t}=e;const n=(0,va.jL)(),{currentLanguageCode:a}=(0,pe.A)(),{inspectorOpen:i}=(0,va.GV)(e=>{let{inspector:t}=e;return t}),{chatMessages:d}=(0,va.GV)(e=>{let{messages:t}=e;return t}),p=(0,r.useRef)(null),f=(0,V.A)(d),h=localStorage.getItem("kindly-chat-restart-message"),m=(0,Bs.A)(t,"zIndex",s.DP);(0,r.useEffect)(()=>{if(0===(null==f?void 0:f.length)&&1===(null==d?void 0:d.length)&&h){const{message:e,exchangeId:t,newContext:r}=JSON.parse(h);localStorage.removeItem("kindly-chat-restart-message"),n((0,zs.y2)(e,t,r))}},[n,d,f,h]),function(){const{tabNotification:e,name:t}=(0,c.d4)(u.Od),{showTabNotification:n}=(0,c.d4)(u.Cv),{currentLanguageCode:o}=(0,pe.A)(),{takenOver:a}=(0,c.d4)(u.MA),{agent:i}=(0,c.d4)(u.zD),l=(0,V.A)(a);(0,r.useEffect)(()=>{var r;e&&n&&Ds((null!==(r=null==Ns?void 0:Ns[o])&&void 0!==r?r:Ns.en)(t||"Kindly"))},[o,e,n,t]),(0,r.useEffect)(()=>{const e=Boolean(null==i?void 0:i.name);var t;l!==a&&a&&e&&Ds(null!==(t=null==Rs?void 0:Rs[o])&&void 0!==t?t:Rs.en)},[a,i,l,o])}(),function(){const e=(0,c.wA)(),{currentLanguage:t,active:n}=(0,c.d4)(u.$P),{maintenanceAlertEnabled:o,maintenanceAlert:a}=(0,c.d4)(u.Od);(0,r.useEffect)(()=>{if(!n||!o)return;const{text_content:r,link_location:i,link_text:l}=Ms(a,t);e((0,G.cC)({content:r,buttonText:l,buttonHref:i,once:!0},s.Jm.MAINTENANCE))},[n,t,e,a,o])}(),Fs(),function(e){const t=(0,c.wA)(),n=(0,r.useRef)(!1);(0,r.useEffect)(()=>{const r=e.current;if(!r)return;const o=document.body||document.documentElement,a=()=>{const e=function(e){if(!e)return!1;const{width:t,height:n}=e.getBoundingClientRect();return t===window.innerWidth&&n===window.innerHeight}(r);e!==n.current&&(n.current=e,(e=>{t((0,Wa.w7)(e)),e?o.classList.add("kindly-overflow-hidden"):o.classList.remove("kindly-overflow-hidden")})(e))};setTimeout(()=>a(),Ls.X+10);const i=new ResizeObserver(a);return i.observe(r),()=>{t((0,Wa.w7)(!1)),o.classList.remove("kindly-overflow-hidden"),i.disconnect()}},[t,e])}(p),function(e){const t=(0,r.useCallback)(t=>{e&&"Tab"===t.key&&e.current.classList.add("using-tab")},[e]),n=(0,r.useCallback)(()=>{e&&e.current.classList.remove("using-tab")},[e]);(0,r.useEffect)(()=>(document.body.addEventListener("keyup",t),document.body.addEventListener("mousedown",n),()=>{document.body.removeEventListener("keyup",t),document.body.removeEventListener("mousedown",n)}),[t,n])}(p),function(){const e=(0,va.jL)(),{chatHasStarted:t}=(0,va.GV)(e=>{let{chatbubble:t}=e;return t}),{welcomePageType:n}=(0,va.GV)(u.Od);(0,r.useEffect)(()=>{!t&&n!==s.Lb.NONE&&e((0,G.wQ)("WELCOME_PAGE"))},[t,n,e])}();const g=(0,r.useMemo)(()=>Us(t.buttonHandlers),[t.buttonHandlers]);return o().createElement(l,{id:"chatContainer",ref:p,className:"chat-container",role:"complementary",$zIndex:m,"data-testid":"chat-box-container",lang:a,$inspectorOpen:i},o().createElement(Is,{buttonHandlers:g,onMessage:t.onMessage}),i&&o().createElement(ae,null))}},9749:(e,t,n)=>{e.exports=n(1726)},9886:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var r=n(9155);function o(e){const t=(0,r.useRef)();return(0,r.useEffect)(()=>{t.current=e},[e]),t.current}},9903:(e,t,n)=>{"use strict";var r=n(5777);e.exports=function(e){var t=+e;return t!=t||0===t?0:r(t)}},9907:e=>{var t,n,r=e.exports={};function o(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function i(e){if(t===setTimeout)return setTimeout(e,0);if((t===o||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(n){try{return t.call(null,e,0)}catch(n){return t.call(this,e,0)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:o}catch(e){t=o}try{n="function"==typeof clearTimeout?clearTimeout:a}catch(e){n=a}}();var l,s=[],c=!1,u=-1;function d(){c&&l&&(c=!1,l.length?s=l.concat(s):u=-1,s.length&&p())}function p(){if(!c){var e=i(d);c=!0;for(var t=s.length;t;){for(l=s,s=[];++u<t;)l&&l[u].run();u=-1,t=s.length}l=null,c=!1,function(e){if(n===clearTimeout)return clearTimeout(e);if((n===a||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(e);try{return n(e)}catch(t){try{return n.call(null,e)}catch(t){return n.call(this,e)}}}(e)}}function f(e,t){this.fun=e,this.array=t}function h(){}r.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];s.push(new f(e,t)),1!==s.length||c||i(p)},f.prototype.run=function(){this.fun.apply(null,this.array)},r.title="browser",r.browser=!0,r.env={},r.argv=[],r.version="",r.versions={},r.on=h,r.addListener=h,r.once=h,r.off=h,r.removeListener=h,r.removeAllListeners=h,r.emit=h,r.prependListener=h,r.prependOnceListener=h,r.listeners=function(e){return[]},r.binding=function(e){throw new Error("process.binding is not supported")},r.cwd=function(){return"/"},r.chdir=function(e){throw new Error("process.chdir is not supported")},r.umask=function(){return 0}},9910:(e,t,n)=>{"use strict";n.d(t,{A:()=>s});var r=n(9155),o=n.n(r),a=n(9662),i=n(3755);function l(e){let{name:t,control:n,options:r,validators:l,register:s,inputType:c}=e;return o().createElement(o().Fragment,null,r.map((e,u)=>o().createElement(i.B2,{key:`${e.value}_${u}`},o().createElement(a.A,{inputType:c,validators:l,register:s,value:e.value,label:e.label,id:e.id,name:t,control:n,isLast:u===r.length-1}))))}const s=o().memo(l)},9932:(e,t,n)=>{"use strict";var r=n(6100),o=r({}.toString),a=r("".slice);e.exports=function(e){return a(o(e),8,-1)}},9989:(e,t,n)=>{"use strict";var r=n(5024),o=n(9665),a=n(1330),i=n(7235),l=n(5341),s=TypeError,c=Object.defineProperty,u=Object.getOwnPropertyDescriptor,d="enumerable",p="configurable",f="writable";t.f=r?a?function(e,t,n){if(i(e),t=l(t),i(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 c(e,t,n)}:c:function(e,t,n){if(i(e),t=l(t),i(n),o)try{return c(e,t,n)}catch(e){}if("get"in n||"set"in n)throw new s("Accessors not supported");return"value"in n&&(e[t]=n.value),e}}},a={};function i(e){var t=a[e];if(void 0!==t)return t.exports;var n=a[e]={id:e,loaded:!1,exports:{}};return o[e].call(n.exports,n,n.exports,i),n.loaded=!0,n.exports}i.amdO={},i.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return i.d(t,{a:t}),t},i.d=(e,t)=>{for(var n in t)i.o(t,n)&&!i.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},i.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),i.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),(()=>{if(void 0!==i){var e=i.u,t=i.e,n={},r={};i.u=function(t){return e(t)+(n.hasOwnProperty(t)?"?"+n[t]:"")},i.e=function(o){return t(o).catch(function(t){var a=r.hasOwnProperty(o)?r[o]:5;if(a<1){var l=e(o);throw t.message="Loading chunk "+o+" failed after 5 retries.\n("+l+")",t.request=l,t}return new Promise(function(e){var t=5-a+1;setTimeout(function(){var l="cache-bust=true&retry-attempt="+t;n[o]=l,r[o]=a-1,e(i.e(o))},e=>300*e)})})}}})(),i.nc=void 0;var l={};return(()=>{"use strict";i.r(l),i.d(l,{default:()=>pe});var e=i(9155),t=i.n(e),n=i(9749),r=i.n(n);var o=i(541),a=i(3864),s=i(6367),c=i(7498),u=i(9308),d=i(1695),p=i(2221);const f=e=>!e||Date.now()-Number(e)>p.M3;var h,m,g=i(6253),b=i(1872),v=i(5960),y=i(1085),w=Object.create,x=Object.defineProperty,E=Object.getOwnPropertyDescriptor,k=Object.getOwnPropertyNames,_=Object.getPrototypeOf,A=Object.prototype.hasOwnProperty,T=(h=(e,t)=>{var n,r;n=e,r=function(e){var t,n=void 0===Number.MAX_SAFE_INTEGER?9007199254740991:Number.MAX_SAFE_INTEGER,r=536870912,o=2*r,a=new WeakMap,i=function(e,t){return function(a){var i=t.get(a),l=void 0===i?a.size:i<o?i+1:0;if(!a.has(l))return e(a,l);if(a.size<r){for(;a.has(l);)l=Math.floor(Math.random()*o);return e(a,l)}if(a.size>n)throw new Error("Congratulations, you created a collection of unique numbers which uses all available integers!");for(;a.has(l);)l=Math.floor(Math.random()*n);return e(a,l)}}((t=a,function(e,n){return t.set(e,n),n}),a),l=function(e){return function(t){var n=e(t);return t.add(n),n}}(i);e.addUniqueNumber=l,e.generateUniqueNumber=i},"object"==typeof e&&typeof t<"u"?r(e):"function"==typeof define&&i.amdO?define(["exports"],r):r((n=typeof globalThis<"u"?globalThis:n||self).fastUniqueNumbers={})},()=>(m||h((m={exports:{}}).exports,m),m.exports));e.Component;((e,t,n)=>{n=null!=e?w(_(e)):{},((e,t,n,r)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let n of k(t))!A.call(e,n)&&undefined!==n&&x(e,n,{get:()=>t[n],enumerable:!(r=E(t,n))||r.enumerable})})(e&&e.__esModule?n:x(n,"default",{value:e,enumerable:!0}),e)})(T());var S="object"==(typeof window>"u"?"undefined":typeof window),$={setTimeout:S?setTimeout.bind(window):setTimeout,clearTimeout:S?clearTimeout.bind(window):clearTimeout,setInterval:S?setInterval.bind(window):setInterval,clearInterval:S?clearInterval.bind(window):clearInterval},C={},O=typeof window>"u"?void 0:"function"==typeof window.BroadcastChannel?window.BroadcastChannel:class{name;closed=!1;mc=new MessageChannel;constructor(e){this.name=e,C[e]=C[e]||[],C[e].push(this),this.mc.port1.start(),this.mc.port2.start(),this.onStorage=this.onStorage.bind(this),window.addEventListener("storage",this.onStorage)}onStorage(e){if(e.storageArea!==window.localStorage||e.key.substring(0,this.name.length)!==this.name||null===e.newValue)return;let t=JSON.parse(e.newValue);this.mc.port2.postMessage(t)}postMessage(e){if(this.closed)throw new Error("InvalidStateError");let t=JSON.stringify(e),n=`${this.name}:${String(Date.now())}${String(Math.random())}`;window.localStorage.setItem(n,t),$.setTimeout(()=>{window.localStorage.removeItem(n)},500),C[this.name].forEach(e=>{e!==this&&e.mc.port2.postMessage(JSON.parse(t))})}close(){if(this.closed)return;this.closed=!0,this.mc.port1.close(),this.mc.port2.close(),window.removeEventListener("storage",this.onStorage);let e=C[this.name].indexOf(this);C[this.name].splice(e,1)}get onmessage(){return this.mc.port1.onmessage}set onmessage(e){this.mc.port1.onmessage=e}get onmessageerror(){return this.mc.port1.onmessageerror}set onmessageerror(e){this.mc.port1.onmessageerror=e}addEventListener(e,t){return this.mc.port1.addEventListener(e,t)}removeEventListener(e,t){return this.mc.port1.removeEventListener(e,t)}dispatchEvent(e){return this.mc.port1.dispatchEvent(e)}};function I(){return Math.random().toString(36).substring(2)}var L=class{options;channel;token=I();isLeader=!1;isDead=!1;isApplying=!1;reApply=!1;intervals=[];listeners=[];deferred;constructor(e,t){this.channel=e,this.options=t,this.apply=this.apply.bind(this),this.awaitLeadership=this.awaitLeadership.bind(this),this.sendAction=this.sendAction.bind(this)}async apply(){if(this.isLeader||this.isDead)return!1;if(this.isApplying)return this.reApply=!0,!1;this.isApplying=!0;let e=!1,t=t=>{let{token:n,action:r}=t.data;n!==this.token&&(0===r&&n>this.token&&(e=!0),1===r&&(e=!0))};this.channel.addEventListener("message",t);try{return this.sendAction(0),await function(e=0){return new Promise(t=>$.setTimeout(t,e))}(this.options.responseTime),this.channel.removeEventListener("message",t),this.isApplying=!1,e?!!this.reApply&&this.apply():(this.assumeLead(),!0)}catch{return!1}}awaitLeadership(){if(this.isLeader)return Promise.resolve();let e=!1,t=null;return new Promise(n=>{let r=()=>{if(e)return;e=!0;try{$.clearInterval(t)}catch{}let r=this.intervals.indexOf(t);r>=0&&this.intervals.splice(r,1),this.channel.removeEventListener("message",o),n()};t=$.setInterval(()=>{this.apply().then(()=>{this.isLeader&&r()})},this.options.fallbackInterval),this.intervals.push(t);let o=e=>{let{action:t}=e.data;2===t&&this.apply().then(()=>{this.isLeader&&r()})};this.channel.addEventListener("message",o)})}sendAction(e){this.channel.postMessage({action:e,token:this.token})}assumeLead(){this.isLeader=!0;let e=e=>{let{action:t}=e.data;0===t&&this.sendAction(1)};return this.channel.addEventListener("message",e),this.listeners.push(e),this.sendAction(1)}waitForLeadership(){return this.deferred||(this.deferred=this.awaitLeadership()),this.deferred}close(){if(!this.isDead){this.isDead=!0,this.isLeader=!1,this.sendAction(2);try{this.listeners.forEach(e=>this.channel.removeEventListener("message",e)),this.intervals.forEach(e=>$.clearInterval(e))}catch{}}}},M=class{channel;options;elector;token=I();registry=new Map;allIdle=!1;isLastActive=!1;constructor(e){let{channelName:t}=e;if(this.options=e,this.channel=new O(t),this.registry.set(this.token,1),e.leaderElection){let e={fallbackInterval:2e3,responseTime:100};this.elector=new L(this.channel,e),this.elector.waitForLeadership()}this.channel.addEventListener("message",e=>{let{action:t,token:n,data:r}=e.data;switch(t){case 3:this.registry.set(n,2);break;case 4:this.registry.delete(n);break;case 5:this.idle(n);break;case 6:this.active(n);break;case 7:this.prompt(n);break;case 8:this.start(n);break;case 9:this.reset(n);break;case 10:this.activate(n);break;case 11:this.pause(n);break;case 12:this.resume(n);break;case 13:this.options.onMessage(r)}}),this.send(3)}get isLeader(){if(!this.elector)throw new Error('❌ Leader election is not enabled. To Enable it set the "leaderElection" property to true.');return this.elector.isLeader}prompt(e=this.token){this.registry.set(e,0);let t=[...this.registry.values()].every(e=>0===e);e===this.token&&this.send(7),t&&this.options.onPrompt()}idle(e=this.token){this.registry.set(e,2);let t=[...this.registry.values()].every(e=>2===e);e===this.token&&this.send(5),!this.allIdle&&t&&(this.allIdle=!0,this.options.onIdle())}active(e=this.token){this.allIdle=!1,this.registry.set(e,1);let t=[...this.registry.values()].some(e=>1===e);e===this.token&&this.send(6),t&&this.options.onActive(),this.isLastActive=e===this.token}start(e=this.token){this.allIdle=!1,this.registry.set(e,1),e===this.token?this.send(8):this.options.start(!0),this.isLastActive=e===this.token}reset(e=this.token){this.allIdle=!1,this.registry.set(e,1),e===this.token?this.send(9):this.options.reset(!0),this.isLastActive=e===this.token}activate(e=this.token){this.allIdle=!1,this.registry.set(e,1),e===this.token?this.send(10):this.options.activate(!0),this.isLastActive=e===this.token}pause(e=this.token){e===this.token?this.send(11):this.options.pause(!0)}resume(e=this.token){e===this.token?this.send(12):this.options.resume(!0)}message(e){try{this.channel.postMessage({action:13,token:this.token,data:e})}catch{}}send(e){try{this.channel.postMessage({action:e,token:this.token})}catch{}}close(){this.options.leaderElection&&this.elector.close(),this.send(4),this.channel.close()}},N=S?document:null,R=["mousemove","keydown","wheel","DOMMouseScroll","mousewheel","mousedown","touchstart","touchmove","MSPointerDown","MSPointerMove","visibilitychange","focus"];function P(e,t){let n=0;return function(...r){let o=(new Date).getTime();if(!(o-n<t))return n=o,e(...r)}}var D=()=>Date.now(),j=2147483647;(0,e.createContext)(null).Consumer;const F=function(t){return(0,e.forwardRef)(function(n,r){let o=function({timeout:t=12e5,promptTimeout:n=0,promptBeforeIdle:r=0,element:o=N,events:a=R,timers:i,immediateEvents:l=[],onPresenceChange:s=()=>{},onPrompt:c=()=>{},onIdle:u=()=>{},onActive:d=()=>{},onAction:p=()=>{},onMessage:f=()=>{},debounce:h=0,throttle:m=0,eventsThrottle:g=200,startOnMount:b=!0,startManually:v=!1,stopOnIdle:y=!1,crossTab:w=!1,name:x="idle-timer",syncTimers:E=0,leaderElection:k=!1,disabled:_=!1}={}){let A=(0,e.useRef)(D()),T=(0,e.useRef)(D()),C=(0,e.useRef)(null),O=(0,e.useRef)(null),I=(0,e.useRef)(0),L=(0,e.useRef)(0),F=(0,e.useRef)(0),z=(0,e.useRef)(0),B=(0,e.useRef)(!1),H=(0,e.useRef)(!1),U=(0,e.useRef)(!1),V=(0,e.useRef)(!0),G=(0,e.useRef)(!1),W=(0,e.useRef)(null),q=(0,e.useRef)(null),K=(0,e.useRef)(t),Y=(0,e.useRef)(0);(0,e.useEffect)(()=>{if(n&&console.warn("⚠️ IdleTimer -- The `promptTimeout` property has been deprecated in favor of `promptBeforeIdle`. It will be removed in the next major release."),r&&n)throw new Error("❌ Both promptTimeout and promptBeforeIdle can not be set. The promptTimeout property will be deprecated in a future version.");if(t>=j)throw new Error(`❌ The value for the timeout property must fit in a 32 bit signed integer, ${j}.`);if(n>=j)throw new Error(`❌ The value for the promptTimeout property must fit in a 32 bit signed integer, ${j}.`);if(r>=j)throw new Error(`❌ The value for the promptBeforeIdle property must fit in a 32 bit signed integer, ${j}.`);if(r>=t)throw new Error(`❌ The value for the promptBeforeIdle property must be less than the timeout property, ${t}.`);if(r?(K.current=t-r,Y.current=r):(K.current=t,Y.current=n),!V.current){if(v||_)return;B.current&&(oe.current(null,Fe),q.current&&q.current.active()),ye()}},[t,n,r,v,_]);let X=(0,e.useRef)(y);(0,e.useEffect)(()=>{X.current=y},[y]);let Z=(0,e.useRef)(l),J=(0,e.useRef)(o),Q=(0,e.useRef)([...new Set([...a,...l]).values()]),ee=(0,e.useRef)(_);(0,e.useEffect)(()=>{ee.current=_,!V.current&&(_?Ee():v||ye())},[_]);let te=(0,e.useRef)(s);(0,e.useEffect)(()=>{te.current=s},[s]);let ne=(0,e.useRef)(c);(0,e.useEffect)(()=>{ne.current=c},[c]);let re=(0,e.useRef)(u);(0,e.useEffect)(()=>{re.current=u},[u]);let oe=(0,e.useRef)(d);(0,e.useEffect)(()=>{oe.current=d},[d]);let ae=(0,e.useRef)(p);(0,e.useEffect)(()=>{ae.current=p},[p]);let ie=(0,e.useRef)(f);(0,e.useEffect)(()=>{ie.current=f},[f]);let le=(0,e.useMemo)(()=>{let e=(e,t)=>ae.current(e,t);return h>0?function(e,t){let n;function r(...r){n&&clearTimeout(n),n=setTimeout(()=>{e(...r),n=null},t)}return r.cancel=function(){clearTimeout(n)},r}(e,h):m>0?P(e,m):e},[m,h]),se=(0,e.useRef)();(0,e.useEffect)(()=>{w&&E&&(se.current=P(()=>{q.current.active()},E))},[w,E]);let ce=()=>{null!==W.current&&($.clearTimeout(W.current),W.current=null)},ue=(e,t=!0)=>{ce(),W.current=$.setTimeout(he,e||K.current),t&&(O.current=D())},de=e=>{!H.current&&!B.current&&(ne.current(e,Fe),te.current({type:"active",prompted:!0},Fe)),z.current=0,F.current=D(),H.current=!0,ue(Y.current,!1)},pe=()=>{ce(),B.current||(re.current(null,Fe),te.current({type:"idle"},Fe)),B.current=!0,C.current=D(),X.current?ve():H.current&&(F.current=0,H.current=!1)},fe=e=>{ce(),(B.current||H.current)&&(oe.current(e,Fe),te.current({type:"active",prompted:!1},Fe)),H.current=!1,F.current=0,B.current=!1,I.current+=D()-C.current,L.current+=D()-C.current,be(),ue()},he=e=>{if(!B.current){le.cancel&&le.cancel();let t=D()-O.current;return K.current+Y.current<t||!(Y.current>0)||H.current?void(q.current?q.current.idle():pe()):void(q.current?q.current.prompt():de(e))}q.current?q.current.active():fe(e)},me=e=>{if(!b&&!O.current&&(O.current=D(),oe.current(null,Fe)),le(e,Fe),H.current)return;if(ce(),!B.current&&Z.current.includes(e.type))return void he(e);let t=D()-O.current;B.current&&!y||!B.current&&t>=K.current?he(e):(U.current=!1,z.current=0,F.current=0,ue(),w&&E&&se.current())},ge=(0,e.useRef)(me);(0,e.useEffect)(()=>{let e=G.current;e&&ve(),ge.current=g>0?P(me,g):me,e&&be()},[g,m,h,ae,w,E]);let be=()=>{S&&J.current&&(G.current||(Q.current.forEach(e=>{J.current.addEventListener(e,ge.current,{capture:!0,passive:!0})}),G.current=!0))},ve=(e=!1)=>{S&&J.current&&(G.current||e)&&(Q.current.forEach(e=>{J.current.removeEventListener(e,ge.current,{capture:!0})}),G.current=!1)},ye=(0,e.useCallback)(e=>!ee.current&&(ce(),be(),B.current=!1,H.current=!1,U.current=!1,z.current=0,F.current=0,q.current&&!e&&q.current.start(),ue(),!0),[W,B,ee,K,q]),we=(0,e.useCallback)(e=>!ee.current&&(ce(),be(),T.current=D(),I.current+=D()-C.current,L.current+=D()-C.current,I.current=0,B.current=!1,H.current=!1,U.current=!1,z.current=0,F.current=0,q.current&&!e&&q.current.reset(),v||ue(),!0),[W,B,K,v,ee,q]),xe=(0,e.useCallback)(e=>!ee.current&&(ce(),be(),(B.current||H.current)&&fe(),B.current=!1,H.current=!1,U.current=!1,z.current=0,F.current=0,T.current=D(),q.current&&!e&&q.current.activate(),ue(),!0),[W,B,H,ee,K,q]),Ee=(0,e.useCallback)((e=!1)=>!ee.current&&!U.current&&(z.current=Oe(),U.current=!0,ve(),ce(),q.current&&!e&&q.current.pause(),!0),[W,ee,q]),ke=(0,e.useCallback)((e=!1)=>!(ee.current||!U.current||(U.current=!1,H.current||be(),B.current||ue(z.current),F.current&&(F.current=D()),q.current&&!e&&q.current.resume(),0)),[W,K,ee,z,q]),_e=(0,e.useCallback)((e,t)=>(q.current?(t&&ie.current(e,Fe),q.current.message(e)):t&&ie.current(e,Fe),!0),[f]),Ae=(0,e.useCallback)(()=>B.current,[B]),Te=(0,e.useCallback)(()=>H.current,[H]),Se=(0,e.useCallback)(()=>q.current?q.current.isLeader:null,[q]),$e=(0,e.useCallback)(()=>q.current?q.current.isLastActive:null,[q]),Ce=(0,e.useCallback)(()=>q.current?q.current.token:null,[q]),Oe=(0,e.useCallback)(()=>{if(U.current)return z.current;let e=z.current?z.current:Y.current+K.current,t=O.current?D()-O.current:0,n=Math.floor(e-t);return n<0?0:Math.abs(n)},[K,Y,H,z,O]),Ie=(0,e.useCallback)(()=>Math.round(D()-T.current),[T]),Le=(0,e.useCallback)(()=>Math.round(D()-A.current),[A]),Me=(0,e.useCallback)(()=>C.current?new Date(C.current):null,[C]),Ne=(0,e.useCallback)(()=>O.current?new Date(O.current):null,[O]),Re=(0,e.useCallback)(()=>B.current?Math.round(D()-C.current+I.current):Math.round(I.current),[C,I]),Pe=(0,e.useCallback)(()=>B.current?Math.round(D()-C.current+L.current):Math.round(L.current),[C,L]),De=(0,e.useCallback)(()=>{let e=Math.round(Ie()-Re());return e>=0?e:0},[C,I]),je=(0,e.useCallback)(()=>{let e=Math.round(Le()-Pe());return e>=0?e:0},[C,I]);(0,e.useEffect)(()=>{if(h>0&&m>0)throw new Error("❌ onAction can either be throttled or debounced, not both.");i&&function(e){$.setTimeout=e.setTimeout,$.clearTimeout=e.clearTimeout,$.setInterval=e.setInterval,$.clearInterval=e.clearInterval}(i);let e=()=>{q.current&&q.current.close(),le.cancel&&le.cancel(),ce(),ve(!0)};return S&&window.addEventListener("beforeunload",e),()=>{S&&window.removeEventListener("beforeunload",e),q.current&&q.current.close(),le.cancel&&le.cancel(),ce(),ve(!0)}},[]),(0,e.useEffect)(()=>{q.current&&q.current.close(),q.current=w?new M({channelName:x,leaderElection:k,onPrompt:()=>{de()},onIdle:()=>{pe()},onActive:()=>{fe()},onMessage:e=>{ie.current(e,Fe)},start:ye,reset:we,activate:xe,pause:Ee,resume:ke}):null},[w,x,k,ne,re,oe,ie,ye,we,Ee,ke]),(0,e.useEffect)(()=>{V.current||(ce(),ve(!0)),!v&&!_&&(b?ye():be())},[v,b,_,V]),(0,e.useEffect)(()=>{if(!V.current){let e=[...new Set([...a,...l]).values()];if(ve(),Q.current=e,J.current=o,Z.current=l,v||_)return;b?ye():be()}},[o,JSON.stringify(a),JSON.stringify(l),V,_,v,b]),(0,e.useEffect)(()=>{V.current&&(V.current=!1)},[V]);let Fe={message:_e,start:ye,reset:we,activate:xe,pause:Ee,resume:ke,isIdle:Ae,isPrompted:Te,isLeader:Se,isLastActiveTab:$e,getTabId:Ce,getRemainingTime:Oe,getElapsedTime:Ie,getTotalElapsedTime:Le,getLastIdleTime:Me,getLastActiveTime:Ne,getIdleTime:Re,getTotalIdleTime:Pe,getActiveTime:De,getTotalActiveTime:je,setOnPresenceChange:e=>{s=e,te.current=e},setOnPrompt:e=>{c=e,ne.current=e},setOnIdle:e=>{u=e,re.current=e},setOnActive:e=>{d=e,oe.current=e},setOnAction:e=>{p=e,ae.current=e},setOnMessage:e=>{f=e,ie.current=e}};return Fe}({...n});return"function"==typeof r?r(o):r&&(r.current=o),(0,y.jsx)(t,{...n,...o})})}(e=>{let{children:t}=e;return t});var z=i(7e3);const B="kindly-last-conversion-timestamp",H=`\n${i(534).n}\n .kindly-overflow-hidden {\n overflow: hidden !important;\n }\n`;var U=i(2927),V=i(7173),G=i(1623);const W=function(){const e=document.createElement("div");e.style.fontSize="initial",document.documentElement.appendChild(e);const t=getComputedStyle(e).fontSize;return document.documentElement.removeChild(e),parseFloat(t)}(),q=a.DU`
4332
+ `;function Cs(e){let{handleCancel:t,handleEndHumanChat:n,descriptionText:r,titleText:a,cancelButtonText:i,confirmButtonText:l}=e;return o().createElement(As,null,o().createElement(Ts,null,o().createElement(Ss,null,o().createElement(_s,{color:"var(--panel-background-white-black-contrast-1743170834)"}),a),o().createElement("p",null,r)),o().createElement($s,null,o().createElement(ei.A,{isSecondaryButton:!0,onClick:t},i),o().createElement(ei.A,{onClick:n},l)))}const Os=e=>{const t=(0,V.A)(e),n=(e||[]).length;return(0,r.useMemo)(()=>n&&n!==(t||[]).length&&e[n-1],[e,n,t])};function Is(e){var t;let{buttonHandlers:n,onMessage:a=null}=e;const i=(0,c.Pj)(),l=(0,va.jL)(),s=(0,r.useRef)(null),d=(0,r.useRef)(null),p=(0,r.useRef)(null),{hideHeader:f,fullscreenMode:h,offsetHeight:m,id:g}=(0,va.GV)(u.Od),{active:b,chatHasStarted:v,currentlyPoppedUp:y,contactDetailsButton:w,currentLanguage:x,currentModal:E,overlayViews:k,isChatFullWindow:_}=(0,va.GV)(e=>{let{chatbubble:t}=e;return t}),{chatMessages:A}=(0,va.GV)(e=>{let{messages:t}=e;return t}),{takenOver:T}=(0,va.GV)(e=>{let{agent:t}=e;return t}),{feedbackToSubmit:$,feedbacksAlreadyDisplayed:C}=(0,va.GV)(hi.CJ),O=Os(A),{cancel_button:I,user_end_handover_button_text:L,user_end_handover_modal_title_text:M,user_end_handover_modal_description_text:N}=(0,ur.A)(),[R,P]=(0,r.useState)(!0);(0,r.useEffect)(()=>{if(R)return void P(!1);if(!O)return;const e=i.getState(),{chatMessages:t,attachments:n}=e.messages,{chatId:r,renderedBy:o}=e.chatbubble,{token:l}=e.connection,{PAT_HOST:s}=e.environment,c=t.map(e=>(0,vs.A)(e,n,s,l)),u=(0,vs.A)(O,n,s,l);(0,Ce.GJ)(ys(u,{botId:g,currentLanguage:x,chatId:r}),c,a,o)},[R,a,O,g,i,A.length]);const D=A.length>=3,j=k[k.length-1],{botConversationFeedback:F,handoverConversationFeedback:z}=(0,Ua.A)(x),B=null===(t=null==F?void 0:F.allow_bot_feedback_after_handover_feedback)||void 0===t||t,H=F&&!S()(C).call(C,"bot_conversation")&&(!S()(C).call(C,"handover_conversation")||B),U=z&&T?z:H?F:null,V=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"user";U&&"CANCEL_CHAT"===j&&D?(l((0,hi.WG)({ratingSystem:U.rating_scale.rating_system,triggerType:U.trigger_type,formTitle:U.form_title,step:"RATING_SCALE"})),l((0,G.wQ)("FEEDBACK"))):((0,Ce.tf)("end-chat",void 0,{storeState:i.getState(),source:e}),l((0,G.ky)(h)),l((0,G.zn)(null)))};return function(e){const{isChatFullWindow:t,renderedBy:n}=(0,c.d4)(u.$P),o=(0,r.useRef)();(0,r.useEffect)(()=>{if(e.current&&ws&&"API"===n)return o.current!==t&&(o.current=t,t?Es():ks()),ks},[e,t])}(p),o().createElement(oe,{"aria-live":"polite","data-cy":"chat-box","data-testid":"chat-box",ref:p,$active:b,$chatHasStarted:v,$fullscreen:!!h,$isChatFullWindow:_,$offsetHeight:m},o().createElement(Vl.A,{errorPoint:"inside ChatBoxContainer"},!f&&o().createElement(Ga,{handleXButtonClick:()=>{"CANCEL_CHAT"!==j&&"FEEDBACK"!==j?l((0,G.wQ)("CANCEL_CHAT")):V()},settingsButtonRef:d}),!!j&&o().createElement(Nl,{endChat:V,feedbackToSubmit:$}),o().createElement(ue,null),o().createElement(os,null),o().createElement(bs,null),o().createElement(da,{bodyRef:s,buttonHandlers:n,inert:!!j||!!E}),w?o().createElement(Ul,null):o().createElement(Ba,{active:b,chatHasStarted:v,currentlyPoppedUp:y,bodyRef:s,inert:!!j||!!E}),"END_HANDOVER"===E&&o().createElement(Cs,{handleCancel:()=>l((0,G.zn)(null)),handleEndHumanChat:async()=>{await l((0,G.m8)()),l((0,G.zn)(null))},titleText:null!=M?M:"",descriptionText:null!=N?N:"",cancelButtonText:null!=I?I:"",confirmButtonText:null!=L?L:""}),"handover_conversation"===(null==$?void 0:$.trigger_type)&&"FEEDBACK_END_HANDOVER"===E&&o().createElement(Gi,{feedbackToSubmit:$})))}Is.displayName="KindlyChatBox";var Ls=n(9308);const Ms=(e,t)=>Object.entries(e).filter(e=>{let[t,n]=e;return"object"==typeof n}).reduce((e,n)=>{let[r,o]=n;return{...e,[r]:(0,Go.A)(o,t)}},{}),Ns=Object.freeze({en:e=>`New message from ${e}`,nb:e=>`Ny melding fra ${e}`,sv:e=>`Nytt meddelande från ${e}`}),Rs=Object.freeze({en:"An agent joined the conversation",nb:"En agent ble med i samtalen",sv:"En agent gick med i samtalet"});let Ps=!1;function Ds(e){const t=document.title;let n;n||Ps||(Ps=!0,n=setInterval(()=>{document.title=document.title===e?t:e},1e3),window.addEventListener("mousemove",function e(){clearInterval(n),document.title=t,n=null,Ps=!1,window.removeEventListener("mousemove",e)}))}var js=n(6079);const Fs=()=>{const{takenOver:e,requestedHandoverAt:t}=(0,c.d4)(u.MA),n=(0,V.A)(e),o=(0,V.A)(t),a=(0,c.wA)(),i=Boolean(t),l=Boolean(o);(0,r.useEffect)(()=>{e&&!n?a((0,js.f2)()):!e&&n&&(0,js.yh)(),i&&!l?a((0,js.Mk)()):!i&&l&&(0,js.Zk)()},[a,l,n,i,e])};var zs=n(4703),Bs=n(4499),Hs=n(7811);const Us=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Object.entries(e).reduce((e,t)=>{let[n,r]=t;return{...e,[(0,Hs.A)(n)]:r}},{})};function Vs(e){let{settings:t}=e;const n=(0,va.jL)(),{currentLanguageCode:a}=(0,pe.A)(),{inspectorOpen:i}=(0,va.GV)(e=>{let{inspector:t}=e;return t}),{chatMessages:d}=(0,va.GV)(e=>{let{messages:t}=e;return t}),p=(0,r.useRef)(null),f=(0,V.A)(d),h=localStorage.getItem("kindly-chat-restart-message"),m=(0,Bs.A)(t,"zIndex",s.DP);(0,r.useEffect)(()=>{if(0===(null==f?void 0:f.length)&&1===(null==d?void 0:d.length)&&h){const{message:e,exchangeId:t,newContext:r}=JSON.parse(h);localStorage.removeItem("kindly-chat-restart-message"),n((0,zs.y2)(e,t,r))}},[n,d,f,h]),function(){const{tabNotification:e,name:t}=(0,c.d4)(u.Od),{showTabNotification:n}=(0,c.d4)(u.Cv),{currentLanguageCode:o}=(0,pe.A)(),{takenOver:a}=(0,c.d4)(u.MA),{agent:i}=(0,c.d4)(u.zD),l=(0,V.A)(a);(0,r.useEffect)(()=>{var r;e&&n&&Ds((null!==(r=null==Ns?void 0:Ns[o])&&void 0!==r?r:Ns.en)(t||"Kindly"))},[o,e,n,t]),(0,r.useEffect)(()=>{const e=Boolean(null==i?void 0:i.name);var t;l!==a&&a&&e&&Ds(null!==(t=null==Rs?void 0:Rs[o])&&void 0!==t?t:Rs.en)},[a,i,l,o])}(),function(){const e=(0,c.wA)(),{currentLanguage:t,active:n}=(0,c.d4)(u.$P),{maintenanceAlertEnabled:o,maintenanceAlert:a}=(0,c.d4)(u.Od);(0,r.useEffect)(()=>{if(!n||!o)return;const{text_content:r,link_location:i,link_text:l}=Ms(a,t);e((0,G.cC)({content:r,buttonText:l,buttonHref:i,once:!0},s.Jm.MAINTENANCE))},[n,t,e,a,o])}(),Fs(),function(e){const t=(0,c.wA)(),n=(0,r.useRef)(!1);(0,r.useEffect)(()=>{const r=e.current;if(!r)return;const o=document.body||document.documentElement,a=()=>{const e=function(e){if(!e)return!1;const{width:t,height:n}=e.getBoundingClientRect();return t>=window.innerWidth&&n>=window.innerHeight}(r);e!==n.current&&(n.current=e,(e=>{t((0,Wa.w7)(e)),e?o.classList.add("kindly-overflow-hidden"):o.classList.remove("kindly-overflow-hidden")})(e))};setTimeout(()=>a(),Ls.X+10);const i=new ResizeObserver(a);return i.observe(r),()=>{t((0,Wa.w7)(!1)),o.classList.remove("kindly-overflow-hidden"),i.disconnect()}},[t,e])}(p),function(e){const t=(0,r.useCallback)(t=>{e&&"Tab"===t.key&&e.current.classList.add("using-tab")},[e]),n=(0,r.useCallback)(()=>{e&&e.current.classList.remove("using-tab")},[e]);(0,r.useEffect)(()=>(document.body.addEventListener("keyup",t),document.body.addEventListener("mousedown",n),()=>{document.body.removeEventListener("keyup",t),document.body.removeEventListener("mousedown",n)}),[t,n])}(p),function(){const e=(0,va.jL)(),{chatHasStarted:t}=(0,va.GV)(e=>{let{chatbubble:t}=e;return t}),{welcomePageType:n}=(0,va.GV)(u.Od);(0,r.useEffect)(()=>{!t&&n!==s.Lb.NONE&&e((0,G.wQ)("WELCOME_PAGE"))},[t,n,e])}();const g=(0,r.useMemo)(()=>Us(t.buttonHandlers),[t.buttonHandlers]);return o().createElement(l,{id:"chatContainer",ref:p,className:"chat-container",role:"complementary",$zIndex:m,"data-testid":"chat-box-container",lang:a,$inspectorOpen:i},o().createElement(Is,{buttonHandlers:g,onMessage:t.onMessage}),i&&o().createElement(ae,null))}},9749:(e,t,n)=>{e.exports=n(1726)},9886:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var r=n(9155);function o(e){const t=(0,r.useRef)();return(0,r.useEffect)(()=>{t.current=e},[e]),t.current}},9903:(e,t,n)=>{"use strict";var r=n(5777);e.exports=function(e){var t=+e;return t!=t||0===t?0:r(t)}},9907:e=>{var t,n,r=e.exports={};function o(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function i(e){if(t===setTimeout)return setTimeout(e,0);if((t===o||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(n){try{return t.call(null,e,0)}catch(n){return t.call(this,e,0)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:o}catch(e){t=o}try{n="function"==typeof clearTimeout?clearTimeout:a}catch(e){n=a}}();var l,s=[],c=!1,u=-1;function d(){c&&l&&(c=!1,l.length?s=l.concat(s):u=-1,s.length&&p())}function p(){if(!c){var e=i(d);c=!0;for(var t=s.length;t;){for(l=s,s=[];++u<t;)l&&l[u].run();u=-1,t=s.length}l=null,c=!1,function(e){if(n===clearTimeout)return clearTimeout(e);if((n===a||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(e);try{return n(e)}catch(t){try{return n.call(null,e)}catch(t){return n.call(this,e)}}}(e)}}function f(e,t){this.fun=e,this.array=t}function h(){}r.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];s.push(new f(e,t)),1!==s.length||c||i(p)},f.prototype.run=function(){this.fun.apply(null,this.array)},r.title="browser",r.browser=!0,r.env={},r.argv=[],r.version="",r.versions={},r.on=h,r.addListener=h,r.once=h,r.off=h,r.removeListener=h,r.removeAllListeners=h,r.emit=h,r.prependListener=h,r.prependOnceListener=h,r.listeners=function(e){return[]},r.binding=function(e){throw new Error("process.binding is not supported")},r.cwd=function(){return"/"},r.chdir=function(e){throw new Error("process.chdir is not supported")},r.umask=function(){return 0}},9910:(e,t,n)=>{"use strict";n.d(t,{A:()=>s});var r=n(9155),o=n.n(r),a=n(9662),i=n(3755);function l(e){let{name:t,control:n,options:r,validators:l,register:s,inputType:c}=e;return o().createElement(o().Fragment,null,r.map((e,u)=>o().createElement(i.B2,{key:`${e.value}_${u}`},o().createElement(a.A,{inputType:c,validators:l,register:s,value:e.value,label:e.label,id:e.id,name:t,control:n,isLast:u===r.length-1}))))}const s=o().memo(l)},9932:(e,t,n)=>{"use strict";var r=n(6100),o=r({}.toString),a=r("".slice);e.exports=function(e){return a(o(e),8,-1)}},9989:(e,t,n)=>{"use strict";var r=n(5024),o=n(9665),a=n(1330),i=n(7235),l=n(5341),s=TypeError,c=Object.defineProperty,u=Object.getOwnPropertyDescriptor,d="enumerable",p="configurable",f="writable";t.f=r?a?function(e,t,n){if(i(e),t=l(t),i(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 c(e,t,n)}:c:function(e,t,n){if(i(e),t=l(t),i(n),o)try{return c(e,t,n)}catch(e){}if("get"in n||"set"in n)throw new s("Accessors not supported");return"value"in n&&(e[t]=n.value),e}}},a={};function i(e){var t=a[e];if(void 0!==t)return t.exports;var n=a[e]={id:e,loaded:!1,exports:{}};return o[e].call(n.exports,n,n.exports,i),n.loaded=!0,n.exports}i.amdO={},i.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return i.d(t,{a:t}),t},i.d=(e,t)=>{for(var n in t)i.o(t,n)&&!i.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},i.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),i.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),(()=>{if(void 0!==i){var e=i.u,t=i.e,n={},r={};i.u=function(t){return e(t)+(n.hasOwnProperty(t)?"?"+n[t]:"")},i.e=function(o){return t(o).catch(function(t){var a=r.hasOwnProperty(o)?r[o]:5;if(a<1){var l=e(o);throw t.message="Loading chunk "+o+" failed after 5 retries.\n("+l+")",t.request=l,t}return new Promise(function(e){var t=5-a+1;setTimeout(function(){var l="cache-bust=true&retry-attempt="+t;n[o]=l,r[o]=a-1,e(i.e(o))},e=>300*e)})})}}})(),i.nc=void 0;var l={};return(()=>{"use strict";i.r(l),i.d(l,{default:()=>pe});var e=i(9155),t=i.n(e),n=i(9749),r=i.n(n);var o=i(541),a=i(3864),s=i(6367),c=i(7498),u=i(9308),d=i(1695),p=i(2221);const f=e=>!e||Date.now()-Number(e)>p.M3;var h,m,g=i(6253),b=i(1872),v=i(5960),y=i(1085),w=Object.create,x=Object.defineProperty,E=Object.getOwnPropertyDescriptor,k=Object.getOwnPropertyNames,_=Object.getPrototypeOf,A=Object.prototype.hasOwnProperty,T=(h=(e,t)=>{var n,r;n=e,r=function(e){var t,n=void 0===Number.MAX_SAFE_INTEGER?9007199254740991:Number.MAX_SAFE_INTEGER,r=536870912,o=2*r,a=new WeakMap,i=function(e,t){return function(a){var i=t.get(a),l=void 0===i?a.size:i<o?i+1:0;if(!a.has(l))return e(a,l);if(a.size<r){for(;a.has(l);)l=Math.floor(Math.random()*o);return e(a,l)}if(a.size>n)throw new Error("Congratulations, you created a collection of unique numbers which uses all available integers!");for(;a.has(l);)l=Math.floor(Math.random()*n);return e(a,l)}}((t=a,function(e,n){return t.set(e,n),n}),a),l=function(e){return function(t){var n=e(t);return t.add(n),n}}(i);e.addUniqueNumber=l,e.generateUniqueNumber=i},"object"==typeof e&&typeof t<"u"?r(e):"function"==typeof define&&i.amdO?define(["exports"],r):r((n=typeof globalThis<"u"?globalThis:n||self).fastUniqueNumbers={})},()=>(m||h((m={exports:{}}).exports,m),m.exports));e.Component;((e,t,n)=>{n=null!=e?w(_(e)):{},((e,t,n,r)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let n of k(t))!A.call(e,n)&&undefined!==n&&x(e,n,{get:()=>t[n],enumerable:!(r=E(t,n))||r.enumerable})})(e&&e.__esModule?n:x(n,"default",{value:e,enumerable:!0}),e)})(T());var S="object"==(typeof window>"u"?"undefined":typeof window),$={setTimeout:S?setTimeout.bind(window):setTimeout,clearTimeout:S?clearTimeout.bind(window):clearTimeout,setInterval:S?setInterval.bind(window):setInterval,clearInterval:S?clearInterval.bind(window):clearInterval},C={},O=typeof window>"u"?void 0:"function"==typeof window.BroadcastChannel?window.BroadcastChannel:class{name;closed=!1;mc=new MessageChannel;constructor(e){this.name=e,C[e]=C[e]||[],C[e].push(this),this.mc.port1.start(),this.mc.port2.start(),this.onStorage=this.onStorage.bind(this),window.addEventListener("storage",this.onStorage)}onStorage(e){if(e.storageArea!==window.localStorage||e.key.substring(0,this.name.length)!==this.name||null===e.newValue)return;let t=JSON.parse(e.newValue);this.mc.port2.postMessage(t)}postMessage(e){if(this.closed)throw new Error("InvalidStateError");let t=JSON.stringify(e),n=`${this.name}:${String(Date.now())}${String(Math.random())}`;window.localStorage.setItem(n,t),$.setTimeout(()=>{window.localStorage.removeItem(n)},500),C[this.name].forEach(e=>{e!==this&&e.mc.port2.postMessage(JSON.parse(t))})}close(){if(this.closed)return;this.closed=!0,this.mc.port1.close(),this.mc.port2.close(),window.removeEventListener("storage",this.onStorage);let e=C[this.name].indexOf(this);C[this.name].splice(e,1)}get onmessage(){return this.mc.port1.onmessage}set onmessage(e){this.mc.port1.onmessage=e}get onmessageerror(){return this.mc.port1.onmessageerror}set onmessageerror(e){this.mc.port1.onmessageerror=e}addEventListener(e,t){return this.mc.port1.addEventListener(e,t)}removeEventListener(e,t){return this.mc.port1.removeEventListener(e,t)}dispatchEvent(e){return this.mc.port1.dispatchEvent(e)}};function I(){return Math.random().toString(36).substring(2)}var L=class{options;channel;token=I();isLeader=!1;isDead=!1;isApplying=!1;reApply=!1;intervals=[];listeners=[];deferred;constructor(e,t){this.channel=e,this.options=t,this.apply=this.apply.bind(this),this.awaitLeadership=this.awaitLeadership.bind(this),this.sendAction=this.sendAction.bind(this)}async apply(){if(this.isLeader||this.isDead)return!1;if(this.isApplying)return this.reApply=!0,!1;this.isApplying=!0;let e=!1,t=t=>{let{token:n,action:r}=t.data;n!==this.token&&(0===r&&n>this.token&&(e=!0),1===r&&(e=!0))};this.channel.addEventListener("message",t);try{return this.sendAction(0),await function(e=0){return new Promise(t=>$.setTimeout(t,e))}(this.options.responseTime),this.channel.removeEventListener("message",t),this.isApplying=!1,e?!!this.reApply&&this.apply():(this.assumeLead(),!0)}catch{return!1}}awaitLeadership(){if(this.isLeader)return Promise.resolve();let e=!1,t=null;return new Promise(n=>{let r=()=>{if(e)return;e=!0;try{$.clearInterval(t)}catch{}let r=this.intervals.indexOf(t);r>=0&&this.intervals.splice(r,1),this.channel.removeEventListener("message",o),n()};t=$.setInterval(()=>{this.apply().then(()=>{this.isLeader&&r()})},this.options.fallbackInterval),this.intervals.push(t);let o=e=>{let{action:t}=e.data;2===t&&this.apply().then(()=>{this.isLeader&&r()})};this.channel.addEventListener("message",o)})}sendAction(e){this.channel.postMessage({action:e,token:this.token})}assumeLead(){this.isLeader=!0;let e=e=>{let{action:t}=e.data;0===t&&this.sendAction(1)};return this.channel.addEventListener("message",e),this.listeners.push(e),this.sendAction(1)}waitForLeadership(){return this.deferred||(this.deferred=this.awaitLeadership()),this.deferred}close(){if(!this.isDead){this.isDead=!0,this.isLeader=!1,this.sendAction(2);try{this.listeners.forEach(e=>this.channel.removeEventListener("message",e)),this.intervals.forEach(e=>$.clearInterval(e))}catch{}}}},M=class{channel;options;elector;token=I();registry=new Map;allIdle=!1;isLastActive=!1;constructor(e){let{channelName:t}=e;if(this.options=e,this.channel=new O(t),this.registry.set(this.token,1),e.leaderElection){let e={fallbackInterval:2e3,responseTime:100};this.elector=new L(this.channel,e),this.elector.waitForLeadership()}this.channel.addEventListener("message",e=>{let{action:t,token:n,data:r}=e.data;switch(t){case 3:this.registry.set(n,2);break;case 4:this.registry.delete(n);break;case 5:this.idle(n);break;case 6:this.active(n);break;case 7:this.prompt(n);break;case 8:this.start(n);break;case 9:this.reset(n);break;case 10:this.activate(n);break;case 11:this.pause(n);break;case 12:this.resume(n);break;case 13:this.options.onMessage(r)}}),this.send(3)}get isLeader(){if(!this.elector)throw new Error('❌ Leader election is not enabled. To Enable it set the "leaderElection" property to true.');return this.elector.isLeader}prompt(e=this.token){this.registry.set(e,0);let t=[...this.registry.values()].every(e=>0===e);e===this.token&&this.send(7),t&&this.options.onPrompt()}idle(e=this.token){this.registry.set(e,2);let t=[...this.registry.values()].every(e=>2===e);e===this.token&&this.send(5),!this.allIdle&&t&&(this.allIdle=!0,this.options.onIdle())}active(e=this.token){this.allIdle=!1,this.registry.set(e,1);let t=[...this.registry.values()].some(e=>1===e);e===this.token&&this.send(6),t&&this.options.onActive(),this.isLastActive=e===this.token}start(e=this.token){this.allIdle=!1,this.registry.set(e,1),e===this.token?this.send(8):this.options.start(!0),this.isLastActive=e===this.token}reset(e=this.token){this.allIdle=!1,this.registry.set(e,1),e===this.token?this.send(9):this.options.reset(!0),this.isLastActive=e===this.token}activate(e=this.token){this.allIdle=!1,this.registry.set(e,1),e===this.token?this.send(10):this.options.activate(!0),this.isLastActive=e===this.token}pause(e=this.token){e===this.token?this.send(11):this.options.pause(!0)}resume(e=this.token){e===this.token?this.send(12):this.options.resume(!0)}message(e){try{this.channel.postMessage({action:13,token:this.token,data:e})}catch{}}send(e){try{this.channel.postMessage({action:e,token:this.token})}catch{}}close(){this.options.leaderElection&&this.elector.close(),this.send(4),this.channel.close()}},N=S?document:null,R=["mousemove","keydown","wheel","DOMMouseScroll","mousewheel","mousedown","touchstart","touchmove","MSPointerDown","MSPointerMove","visibilitychange","focus"];function P(e,t){let n=0;return function(...r){let o=(new Date).getTime();if(!(o-n<t))return n=o,e(...r)}}var D=()=>Date.now(),j=2147483647;(0,e.createContext)(null).Consumer;const F=function(t){return(0,e.forwardRef)(function(n,r){let o=function({timeout:t=12e5,promptTimeout:n=0,promptBeforeIdle:r=0,element:o=N,events:a=R,timers:i,immediateEvents:l=[],onPresenceChange:s=()=>{},onPrompt:c=()=>{},onIdle:u=()=>{},onActive:d=()=>{},onAction:p=()=>{},onMessage:f=()=>{},debounce:h=0,throttle:m=0,eventsThrottle:g=200,startOnMount:b=!0,startManually:v=!1,stopOnIdle:y=!1,crossTab:w=!1,name:x="idle-timer",syncTimers:E=0,leaderElection:k=!1,disabled:_=!1}={}){let A=(0,e.useRef)(D()),T=(0,e.useRef)(D()),C=(0,e.useRef)(null),O=(0,e.useRef)(null),I=(0,e.useRef)(0),L=(0,e.useRef)(0),F=(0,e.useRef)(0),z=(0,e.useRef)(0),B=(0,e.useRef)(!1),H=(0,e.useRef)(!1),U=(0,e.useRef)(!1),V=(0,e.useRef)(!0),G=(0,e.useRef)(!1),W=(0,e.useRef)(null),q=(0,e.useRef)(null),K=(0,e.useRef)(t),Y=(0,e.useRef)(0);(0,e.useEffect)(()=>{if(n&&console.warn("⚠️ IdleTimer -- The `promptTimeout` property has been deprecated in favor of `promptBeforeIdle`. It will be removed in the next major release."),r&&n)throw new Error("❌ Both promptTimeout and promptBeforeIdle can not be set. The promptTimeout property will be deprecated in a future version.");if(t>=j)throw new Error(`❌ The value for the timeout property must fit in a 32 bit signed integer, ${j}.`);if(n>=j)throw new Error(`❌ The value for the promptTimeout property must fit in a 32 bit signed integer, ${j}.`);if(r>=j)throw new Error(`❌ The value for the promptBeforeIdle property must fit in a 32 bit signed integer, ${j}.`);if(r>=t)throw new Error(`❌ The value for the promptBeforeIdle property must be less than the timeout property, ${t}.`);if(r?(K.current=t-r,Y.current=r):(K.current=t,Y.current=n),!V.current){if(v||_)return;B.current&&(oe.current(null,Fe),q.current&&q.current.active()),ye()}},[t,n,r,v,_]);let X=(0,e.useRef)(y);(0,e.useEffect)(()=>{X.current=y},[y]);let Z=(0,e.useRef)(l),J=(0,e.useRef)(o),Q=(0,e.useRef)([...new Set([...a,...l]).values()]),ee=(0,e.useRef)(_);(0,e.useEffect)(()=>{ee.current=_,!V.current&&(_?Ee():v||ye())},[_]);let te=(0,e.useRef)(s);(0,e.useEffect)(()=>{te.current=s},[s]);let ne=(0,e.useRef)(c);(0,e.useEffect)(()=>{ne.current=c},[c]);let re=(0,e.useRef)(u);(0,e.useEffect)(()=>{re.current=u},[u]);let oe=(0,e.useRef)(d);(0,e.useEffect)(()=>{oe.current=d},[d]);let ae=(0,e.useRef)(p);(0,e.useEffect)(()=>{ae.current=p},[p]);let ie=(0,e.useRef)(f);(0,e.useEffect)(()=>{ie.current=f},[f]);let le=(0,e.useMemo)(()=>{let e=(e,t)=>ae.current(e,t);return h>0?function(e,t){let n;function r(...r){n&&clearTimeout(n),n=setTimeout(()=>{e(...r),n=null},t)}return r.cancel=function(){clearTimeout(n)},r}(e,h):m>0?P(e,m):e},[m,h]),se=(0,e.useRef)();(0,e.useEffect)(()=>{w&&E&&(se.current=P(()=>{q.current.active()},E))},[w,E]);let ce=()=>{null!==W.current&&($.clearTimeout(W.current),W.current=null)},ue=(e,t=!0)=>{ce(),W.current=$.setTimeout(he,e||K.current),t&&(O.current=D())},de=e=>{!H.current&&!B.current&&(ne.current(e,Fe),te.current({type:"active",prompted:!0},Fe)),z.current=0,F.current=D(),H.current=!0,ue(Y.current,!1)},pe=()=>{ce(),B.current||(re.current(null,Fe),te.current({type:"idle"},Fe)),B.current=!0,C.current=D(),X.current?ve():H.current&&(F.current=0,H.current=!1)},fe=e=>{ce(),(B.current||H.current)&&(oe.current(e,Fe),te.current({type:"active",prompted:!1},Fe)),H.current=!1,F.current=0,B.current=!1,I.current+=D()-C.current,L.current+=D()-C.current,be(),ue()},he=e=>{if(!B.current){le.cancel&&le.cancel();let t=D()-O.current;return K.current+Y.current<t||!(Y.current>0)||H.current?void(q.current?q.current.idle():pe()):void(q.current?q.current.prompt():de(e))}q.current?q.current.active():fe(e)},me=e=>{if(!b&&!O.current&&(O.current=D(),oe.current(null,Fe)),le(e,Fe),H.current)return;if(ce(),!B.current&&Z.current.includes(e.type))return void he(e);let t=D()-O.current;B.current&&!y||!B.current&&t>=K.current?he(e):(U.current=!1,z.current=0,F.current=0,ue(),w&&E&&se.current())},ge=(0,e.useRef)(me);(0,e.useEffect)(()=>{let e=G.current;e&&ve(),ge.current=g>0?P(me,g):me,e&&be()},[g,m,h,ae,w,E]);let be=()=>{S&&J.current&&(G.current||(Q.current.forEach(e=>{J.current.addEventListener(e,ge.current,{capture:!0,passive:!0})}),G.current=!0))},ve=(e=!1)=>{S&&J.current&&(G.current||e)&&(Q.current.forEach(e=>{J.current.removeEventListener(e,ge.current,{capture:!0})}),G.current=!1)},ye=(0,e.useCallback)(e=>!ee.current&&(ce(),be(),B.current=!1,H.current=!1,U.current=!1,z.current=0,F.current=0,q.current&&!e&&q.current.start(),ue(),!0),[W,B,ee,K,q]),we=(0,e.useCallback)(e=>!ee.current&&(ce(),be(),T.current=D(),I.current+=D()-C.current,L.current+=D()-C.current,I.current=0,B.current=!1,H.current=!1,U.current=!1,z.current=0,F.current=0,q.current&&!e&&q.current.reset(),v||ue(),!0),[W,B,K,v,ee,q]),xe=(0,e.useCallback)(e=>!ee.current&&(ce(),be(),(B.current||H.current)&&fe(),B.current=!1,H.current=!1,U.current=!1,z.current=0,F.current=0,T.current=D(),q.current&&!e&&q.current.activate(),ue(),!0),[W,B,H,ee,K,q]),Ee=(0,e.useCallback)((e=!1)=>!ee.current&&!U.current&&(z.current=Oe(),U.current=!0,ve(),ce(),q.current&&!e&&q.current.pause(),!0),[W,ee,q]),ke=(0,e.useCallback)((e=!1)=>!(ee.current||!U.current||(U.current=!1,H.current||be(),B.current||ue(z.current),F.current&&(F.current=D()),q.current&&!e&&q.current.resume(),0)),[W,K,ee,z,q]),_e=(0,e.useCallback)((e,t)=>(q.current?(t&&ie.current(e,Fe),q.current.message(e)):t&&ie.current(e,Fe),!0),[f]),Ae=(0,e.useCallback)(()=>B.current,[B]),Te=(0,e.useCallback)(()=>H.current,[H]),Se=(0,e.useCallback)(()=>q.current?q.current.isLeader:null,[q]),$e=(0,e.useCallback)(()=>q.current?q.current.isLastActive:null,[q]),Ce=(0,e.useCallback)(()=>q.current?q.current.token:null,[q]),Oe=(0,e.useCallback)(()=>{if(U.current)return z.current;let e=z.current?z.current:Y.current+K.current,t=O.current?D()-O.current:0,n=Math.floor(e-t);return n<0?0:Math.abs(n)},[K,Y,H,z,O]),Ie=(0,e.useCallback)(()=>Math.round(D()-T.current),[T]),Le=(0,e.useCallback)(()=>Math.round(D()-A.current),[A]),Me=(0,e.useCallback)(()=>C.current?new Date(C.current):null,[C]),Ne=(0,e.useCallback)(()=>O.current?new Date(O.current):null,[O]),Re=(0,e.useCallback)(()=>B.current?Math.round(D()-C.current+I.current):Math.round(I.current),[C,I]),Pe=(0,e.useCallback)(()=>B.current?Math.round(D()-C.current+L.current):Math.round(L.current),[C,L]),De=(0,e.useCallback)(()=>{let e=Math.round(Ie()-Re());return e>=0?e:0},[C,I]),je=(0,e.useCallback)(()=>{let e=Math.round(Le()-Pe());return e>=0?e:0},[C,I]);(0,e.useEffect)(()=>{if(h>0&&m>0)throw new Error("❌ onAction can either be throttled or debounced, not both.");i&&function(e){$.setTimeout=e.setTimeout,$.clearTimeout=e.clearTimeout,$.setInterval=e.setInterval,$.clearInterval=e.clearInterval}(i);let e=()=>{q.current&&q.current.close(),le.cancel&&le.cancel(),ce(),ve(!0)};return S&&window.addEventListener("beforeunload",e),()=>{S&&window.removeEventListener("beforeunload",e),q.current&&q.current.close(),le.cancel&&le.cancel(),ce(),ve(!0)}},[]),(0,e.useEffect)(()=>{q.current&&q.current.close(),q.current=w?new M({channelName:x,leaderElection:k,onPrompt:()=>{de()},onIdle:()=>{pe()},onActive:()=>{fe()},onMessage:e=>{ie.current(e,Fe)},start:ye,reset:we,activate:xe,pause:Ee,resume:ke}):null},[w,x,k,ne,re,oe,ie,ye,we,Ee,ke]),(0,e.useEffect)(()=>{V.current||(ce(),ve(!0)),!v&&!_&&(b?ye():be())},[v,b,_,V]),(0,e.useEffect)(()=>{if(!V.current){let e=[...new Set([...a,...l]).values()];if(ve(),Q.current=e,J.current=o,Z.current=l,v||_)return;b?ye():be()}},[o,JSON.stringify(a),JSON.stringify(l),V,_,v,b]),(0,e.useEffect)(()=>{V.current&&(V.current=!1)},[V]);let Fe={message:_e,start:ye,reset:we,activate:xe,pause:Ee,resume:ke,isIdle:Ae,isPrompted:Te,isLeader:Se,isLastActiveTab:$e,getTabId:Ce,getRemainingTime:Oe,getElapsedTime:Ie,getTotalElapsedTime:Le,getLastIdleTime:Me,getLastActiveTime:Ne,getIdleTime:Re,getTotalIdleTime:Pe,getActiveTime:De,getTotalActiveTime:je,setOnPresenceChange:e=>{s=e,te.current=e},setOnPrompt:e=>{c=e,ne.current=e},setOnIdle:e=>{u=e,re.current=e},setOnActive:e=>{d=e,oe.current=e},setOnAction:e=>{p=e,ae.current=e},setOnMessage:e=>{f=e,ie.current=e}};return Fe}({...n});return"function"==typeof r?r(o):r&&(r.current=o),(0,y.jsx)(t,{...n,...o})})}(e=>{let{children:t}=e;return t});var z=i(7e3);const B="kindly-last-conversion-timestamp",H=`\n${i(534).n}\n .kindly-overflow-hidden {\n overflow: hidden !important;\n }\n`;var U=i(2927),V=i(7173),G=i(1623);const W=function(){const e=document.createElement("div");e.style.fontSize="initial",document.documentElement.appendChild(e);const t=getComputedStyle(e).fontSize;return document.documentElement.removeChild(e),parseFloat(t)}(),q=a.DU`
4333
4333
  #kindly-root {
4334
4334
  font-size: initial;
4335
4335
 
@@ -4342,4 +4342,4 @@
4342
4342
  --_kindlychat-font-size-h2: calc(${W}px * 1.6);
4343
4343
  --_kindlychat-font-size-input: ${Math.max(16,W)}px;
4344
4344
  }
4345
- `;var K=i(8905);const Y=e=>{var t,n,r,o,a,i,l,s,c,u,d,p,f,h,m,g,b,v,y,w,x,E,k,_,A,T,S,$,C,O,I,L,M;return{customFont:null!==(t=null==e?void 0:e.customFont)&&void 0!==t?t:null,chatbubbleText:null!==(n=null==e||null===(r=e.style)||void 0===r?void 0:r.color_chatbubble_text)&&void 0!==n?n:K.AV.dark,background:null!==(o=null==e||null===(a=e.style)||void 0===a?void 0:a.color_background)&&void 0!==o?o:"#ffffff",bubbleButtonOutline:null!==(i=null==e||null===(l=e.style)||void 0===l?void 0:l.color_button_outline)&&void 0!==i?i:"#0069ff",buttonBackground:null!==(s=null==e||null===(c=e.style)||void 0===c?void 0:c.color_button_background)&&void 0!==s?s:"#0069ff",secondaryButtonBackground:null!==(u=null==e||null===(d=e.style)||void 0===d?void 0:d.color_secondary_button_background)&&void 0!==u?u:"#ffffff",bubbleButtonBackground:null!==(p=null==e||null===(f=e.style)||void 0===f?void 0:f.color_bubble_button_background)&&void 0!==p?p:"#0069ff",buttonText:null!==(h=null==e||null===(m=e.style)||void 0===m?void 0:m.color_button_text)&&void 0!==h?h:"#ffffff",headerBackground:null!==(g=null==e||null===(b=e.style)||void 0===b?void 0:b.color_header_background)&&void 0!==g?g:"#0069ff",headerText:null!==(v=null==e||null===(y=e.style)||void 0===y?void 0:y.color_header_text)&&void 0!==v?v:"#ffffff",inputBackground:null!==(w=null==e||null===(x=e.style)||void 0===x?void 0:x.color_input_background)&&void 0!==w?w:"#ffffff",inputText:null!==(E=null==e||null===(k=e.style)||void 0===k?void 0:k.color_input_text)&&void 0!==E?E:"#333333",userMessageBackground:null!==(_=null==e||null===(A=e.style)||void 0===A?void 0:A.color_user_message_background)&&void 0!==_?_:"#f5f5f5",userMessageText:null!==(T=null==e||null===(S=e.style)||void 0===S?void 0:S.color_user_message_text_color)&&void 0!==T?T:"#2c2c2c",botMessageBackground:null!==($=null==e||null===(C=e.style)||void 0===C?void 0:C.color_bot_message_background)&&void 0!==$?$:"#f5f5f5",botMessageText:null!==(O=null==e||null===(I=e.style)||void 0===I?void 0:I.color_bot_message_text_color)&&void 0!==O?O:"#2c2c2c",panelBackground:null!==(L=null==e||null===(M=e.style)||void 0===M?void 0:M.color_panel_background)&&void 0!==L?L:"#ffffff"}};var X=i(2628),Z=i(6079);function J(n){let{settings:r}=n;const a=(0,o.wA)(),{inPlatform:i}=(0,o.d4)(d.$P),{canShow:l}=function(){const{splitTestEnabled:t,splitTestLabel:n,splitLabelTimestamp:r}=(0,o.d4)(d.Od),a=(0,o.wA)(),i=(0,e.useCallback)(()=>{a((0,b.YK)())},[a]),l=(0,g.A)(i,2500);return(0,e.useEffect)(()=>{function e(){l()}return t&&window.addEventListener("mousemove",e),()=>t?window.removeEventListener("mousemove",e):void 0},[t]),(0,e.useEffect)(()=>{r&&f(r)&&a((0,b.Ss)())},[r]),(0,e.useEffect)(()=>{let e=n||p.OT.NO_SPLIT_LABEL;t&&!n&&(e=Math.random()>.5?p.OT.SPLIT_A:p.OT.SPLIT_B),n||a((0,b.dm)(e))},[t,n]),{canShow:t&&["A","X"].indexOf(n)>-1||!t,splitTestLabel:n}}();return(()=>{const t=(0,o.wA)(),[n,r]=(0,e.useState)("/"),{conversionPageUrl:a,splitTestLabel:i,hasInteraction:l,splitTestEnabled:s}=(0,o.d4)(d.Od),c=(()=>{const[t,n]=(0,e.useState)(!1),{conversionPageUrl:r}=(0,o.d4)(d.Od),a=((t,n)=>{let{enable:r=!0}=n;const[o,a]=(0,e.useState)(null);if(!r)return null;const i=setInterval(()=>{const e=document.querySelector("#klarna-checkout-iframe");e&&(a(e),clearInterval(i))},500);return o})(0,{enable:null==r?void 0:r.match(/klarna/gi)}),i=(0,e.useRef)(null),l=(0,e.useCallback)(e=>{var t;const r=e.getAttribute("src")||"",o=function(e){try{return JSON.parse(e)}catch(e){return console.error("Failed to parse JSON:",e),null}}((null===(t=decodeURIComponent(r).match(/\{"(.*)/gim))||void 0===t?void 0:t[0])||"");o&&"object"==typeof o&&["created","checkout_complete"].indexOf(o.ORDER_STATUS)>-1&&n(!0)},[]);return(0,e.useEffect)(()=>{a&&!i.current&&(l(a),i.current=setInterval(()=>l(a),500))},[a,i,l]),(0,e.useEffect)(()=>{t&&clearInterval(i.current)},[t]),t})(),u=(0,e.useCallback)(()=>{if(!f(localStorage.getItem(B)))return;const e=s&&i,n=!l;localStorage.setItem(B,Number(new Date)),t((0,b.yM)(e,n)),t((0,b.Ss)())},[t,i,l,s]);(0,e.useEffect)(()=>{c&&u()},[u,c]),(0,e.useEffect)(()=>{r(window.location.href),null!=a&&a.trim()&&(0,z.A)(n,a)&&u()},[u,n,a])})(),function(){const t=(0,o.wA)(),{botKey:n}=(0,o.d4)(d.$P),{messageSentTime:r}=(0,o.d4)(d.DZ),{persistStateLifespan:a}=(0,o.d4)(d.Od),{chatMessages:i}=(0,o.d4)(d.DZ);(0,e.useEffect)(()=>{const e=(0,U.A)({messageSentTime:r,persistStateLifespan:a});0===a||e||0===i.length||t((0,b.g4)(n))},[n,t,a,r])}(),(0,e.useEffect)(()=>{var e;l&&null!==(e=r.chatbubble)&&void 0!==e&&e.autopopup&&!(0,X.A)()&&!i&&setTimeout(()=>a((0,b.UB)()),r.chatbubble.autopopup_time)},[a,i,r,l]),l?t().createElement(u.A,{chatSettings:r,hidden:r.bubbleHidden,onNudgeDismiss:r.onNudgeDismiss,onNudgeFormSubmit:r.onNudgeFormSubmit,onNudgeProductClick:r.onNudgeProductClick}):null}let Q=!1,ee=null;const te=(0,e.forwardRef)((n,r)=>{let{botKey:l,settings:u,initialChatLanguage:d}=n;return ee||(ee=(0,v.Ay)({botKey:l,settings:u,initialChatLanguage:d})),(0,e.useEffect)(()=>()=>{ee=null},[]),function(){const{nonce:t}=window.__KINDLY_SETTINGS__;(0,e.useEffect)(()=>{const e=document.createElement("style");e.setAttribute("data-kindly-styles","true"),e.textContent=H,t&&e.setAttribute("nonce",t);try{return document.querySelector('style[data-kindly-styles="true"]')||document.head.appendChild(e),()=>{try{const e=document.querySelector('style[data-kindly-styles="true"]');e&&document.head.contains(e)&&document.head.removeChild(e)}catch(e){console.error("Error removing Kindly styles:",e)}}}catch(e){return void console.error("Error injecting Kindly styles:",e)}},[])}(),(0,e.useImperativeHandle)(r,()=>({getActivityStatus:()=>ee.getState().chatbubble.active,openChat(){ee.dispatch((0,b.lQ)({source:"programmatic"}))},closeChat(){ee.dispatch((0,b.Rh)({source:"programmatic"}))},restartChat(){let{openChat:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{openChat:!1};(0,Z.Tk)(),ee.dispatch((0,b.zX)(l,e))},triggerDialogue(e,t){ee.dispatch((0,b.zh)(e,t))},sendMessage(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=e.trim(),r="user"===t.sender,o=!1===t.openChat,{newContext:a}=t;r&&n&&ee.dispatch((0,b.y2)(n,void 0,a,void 0,void 0,{shouldOpenChat:!o}))},showNudge(e){let{nudgeLayout:t,slug:n,trackEvent:r=!0}=e;ee.dispatch((0,b.fe)({nudgeLayout:t,slug:n,trackEvent:r}))},showCustomNudge(e){let{content:t,slug:n,onRendered:r,trackEvent:o=!0}=e;ee.dispatch((0,b.kS)({content:t,slug:n,onRendered:r,trackEvent:o}))},getNudges:()=>ee.getState().bot.nudges,closeNudge(e,t){ee.dispatch((0,b.Y_)(e,t))},nudgeCompletion(e){sessionStorage.getItem("kindly-nudge-completion")||(ee.dispatch((0,G.vJ)({slug:e,eventType:V.oE})),ee.dispatch({type:V.Kd,slug:e}),sessionStorage.setItem("kindly-nudge-completion","true"))},triggerCtaEvent(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;ee.dispatch((0,G.NS)(e))},identifyUser(e){ee.dispatch((0,b.gm)(e))},setNewContext(e){ee.dispatch((0,b.Aw)(e))},getContext:()=>ee.dispatch((0,b.SD)()),setNewBannerMessage(e,t){ee.dispatch((0,b.cC)(e,t||(null==e?void 0:e.message)))},setNewLabel(e){ee.dispatch((0,b.tD)(e))},cancelHandover(){ee.dispatch((0,b.cL)())}})),(0,e.useEffect)(()=>{(0,s.NY)(u)},[u]),(0,e.useEffect)(()=>{const{persistStateLifespan:e}=ee.getState().bot;if(-1===e||e>0)return;let t=!1;const n=()=>{t||(t=!0,ee.dispatch((0,b.R7)(l)))};window.onbeforeunload=n,window.onunload=n},[l,u,ee]),(0,e.useEffect)(()=>{!Q&&u.track_utm&&(Q=!0,Promise.resolve().then(i.bind(i,649)).then(e=>{let{default:t}=e;const n=t();n&&ee.dispatch((0,b.Aw)({...n}))}))},[u,ee]),window.Cypress&&(window.store=ee),t().createElement(o.Kq,{store:ee},t().createElement(a.NP,{theme:Y(u)},t().createElement(q,null),t().createElement(c.A,{errorPoint:"inside ChatContainer",displayError:!1},(u.user_idle_timeout_seconds||0)>0?t().createElement(F,{onIdle:()=>ee.dispatch((0,b.ZS)()),onActive:()=>ee.dispatch((0,b.Mm)(u.id)),timeout:1e3*(u.user_idle_timeout_seconds||0)},t().createElement(J,{settings:u})):t().createElement(J,{settings:u}))))});te.displayName="ChatContainer";const ne=te;var re=i(2366),oe=i(6249);function ae(e){let{retries:t=6,interval:n=300,intervalBackoffMultiplier:r=2}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new Promise((o,a)=>{e({retriesLeft:t,interval:n,intervalBackoffMultiplier:r}).then(o).catch(i=>{setTimeout(()=>{t<=1?a(i):ae(e,{retries:t-1,interval:n*r,intervalBackoffMultiplier:r}).then(o,a)},n)})})}async function ie(e,t,n){const r=(0,re.U)(),o=`${e}/settings/${t}.json?version=2.76.8&${[re.B]}=${r}`;return ae(()=>fetch(o,{...n&&{signal:n.signal}}).then(async e=>{const t=await e.json();return{status:e.status,statusText:e.statusText,ok:e.ok,data:t}}),{retries:3,interval:2e3,intervalBackoffMultiplier:1})}let le=!1;const se=e=>e.split("-")[0],ce=(e,t)=>{const n=e.find(e=>e===t);if(n)return n;const r=se(t);return e.find(e=>se(e)===r)};function ue(e){return Object.getOwnPropertyNames(e).forEach(t=>{const n=e[t];n&&"object"==typeof n&&ue(n)}),Object.freeze(e)}function de(n){var o;let{botKey:a,setKindlyChatRef:i,options:l={}}=n;const s=function(t,n){const[r,o]=(0,e.useState)(n||{});return(0,e.useEffect)(()=>{const e=new AbortController;return le?o(e=>(0,oe.A)(e,n)):(async()=>{try{var r;const a=await ie((null===(r=n.environment)||void 0===r?void 0:r.SETTINGS_HOST)||"https://chat.kindlycdn.com",t,e),{welcome_page:i,in_chat_notification:l,notifications:s,settings:{supported_languages:c,...u},...d}=a.data,p={...d,...u,...s,supportedLanguages:c,welcomePage:i,inChatNotification:l};o(e=>(0,oe.A)((0,oe.A)(p,e),{...n}))}catch(e){var a,i;const t=null!==(a=e.response)&&void 0!==a&&null!==(i=a.data)&&void 0!==i&&i.error?e.response.data.error:e;"signal is aborted without reason"!==t.message&&console.error("Kindly chat failed to initialize.",t)}})(),le=!0,()=>{e.abort()}},[t,n]),(0,e.useEffect)(()=>()=>{le=!1},[]),r}(a,l);if(!s.id)return null;const{inPlatform:c,fullscreenMode:u,language:d,focusTrapOnFullView:p,supportedLanguages:f,getAuthToken:h,nonce:m}=s;window.__KINDLY_SETTINGS__=ue({language:d,supportedLanguages:f,feedbackSettings:c?{}:s.feedback_settings,focusTrapOnFullView:p,fullscreenMode:u,getAuthToken:h,nonce:m});const g=window.__KINDLY_SETTINGS__.language,b=function(e,t){var n,r,o;const a=e.map(e=>e.code),i=null==t?void 0:t.toLowerCase();if(1===a.length)return a[0];if(i){const e=ce(a,i);if(e)return e}const l=null===(n=document.documentElement.lang)||void 0===n?void 0:n.toLowerCase(),s=ce(a,l);if(s)return s;const c=null===(r=window.navigator.language)||void 0===r?void 0:r.toLowerCase(),u=ce(a,c);if(u)return u;return(null===(o=window.navigator.languages)||void 0===o?void 0:o.flatMap(e=>{const t=ce(a,e.toLowerCase());return t?[t]:[]})[0])||e.find(e=>e.is_primary).code.toLowerCase()}(window.__KINDLY_SETTINGS__.supportedLanguages.filter(e=>e.is_active),g);if(!b)return console.error("Impossible to determine initial Chat language, make sure you have at least one language active for the Bot"),null;const v=(null===(o=l.environment)||void 0===o?void 0:o.KINDLY_CHAT_URL)||"http://localhost:8081",y=[v?new URL(v).hostname:void 0,"*.kindly.ai","demokind.ly","*.demokind.ly",...s.chatbubble.domains].filter(Boolean);return s.chatbubble.inPlatform||function(e,t){return!!r()(t).call(t,"*")||!!e&&t.some(t=>function(e){const t=e.replace(/\./g,"\\.").replace(/\*/g,".");return new RegExp(t,"i")}(t).test(e))}(window.location.hostname,y)?t().createElement(ne,{ref:i,botKey:a,settings:s,initialChatLanguage:b}):(console.error(`Domain ${window.location.hostname} is not allowed to load Kindly Chat. Please check your bot settings if you think this is a mistake.`),null)}const pe=function(n){let{botKey:r,setKindlyChatRef:o,options:a}=n;return t().createElement(e.Suspense,{fallback:""},t().createElement(de,{botKey:r,setKindlyChatRef:o,options:a}))}})(),l})());
4345
+ `;var K=i(8905);const Y=e=>{var t,n,r,o,a,i,l,s,c,u,d,p,f,h,m,g,b,v,y,w,x,E,k,_,A,T,S,$,C,O,I,L,M;return{customFont:null!==(t=null==e?void 0:e.customFont)&&void 0!==t?t:null,chatbubbleText:null!==(n=null==e||null===(r=e.style)||void 0===r?void 0:r.color_chatbubble_text)&&void 0!==n?n:K.AV.dark,background:null!==(o=null==e||null===(a=e.style)||void 0===a?void 0:a.color_background)&&void 0!==o?o:"#ffffff",bubbleButtonOutline:null!==(i=null==e||null===(l=e.style)||void 0===l?void 0:l.color_button_outline)&&void 0!==i?i:"#0069ff",buttonBackground:null!==(s=null==e||null===(c=e.style)||void 0===c?void 0:c.color_button_background)&&void 0!==s?s:"#0069ff",secondaryButtonBackground:null!==(u=null==e||null===(d=e.style)||void 0===d?void 0:d.color_secondary_button_background)&&void 0!==u?u:"#ffffff",bubbleButtonBackground:null!==(p=null==e||null===(f=e.style)||void 0===f?void 0:f.color_bubble_button_background)&&void 0!==p?p:"#0069ff",buttonText:null!==(h=null==e||null===(m=e.style)||void 0===m?void 0:m.color_button_text)&&void 0!==h?h:"#ffffff",headerBackground:null!==(g=null==e||null===(b=e.style)||void 0===b?void 0:b.color_header_background)&&void 0!==g?g:"#0069ff",headerText:null!==(v=null==e||null===(y=e.style)||void 0===y?void 0:y.color_header_text)&&void 0!==v?v:"#ffffff",inputBackground:null!==(w=null==e||null===(x=e.style)||void 0===x?void 0:x.color_input_background)&&void 0!==w?w:"#ffffff",inputText:null!==(E=null==e||null===(k=e.style)||void 0===k?void 0:k.color_input_text)&&void 0!==E?E:"#333333",userMessageBackground:null!==(_=null==e||null===(A=e.style)||void 0===A?void 0:A.color_user_message_background)&&void 0!==_?_:"#f5f5f5",userMessageText:null!==(T=null==e||null===(S=e.style)||void 0===S?void 0:S.color_user_message_text_color)&&void 0!==T?T:"#2c2c2c",botMessageBackground:null!==($=null==e||null===(C=e.style)||void 0===C?void 0:C.color_bot_message_background)&&void 0!==$?$:"#f5f5f5",botMessageText:null!==(O=null==e||null===(I=e.style)||void 0===I?void 0:I.color_bot_message_text_color)&&void 0!==O?O:"#2c2c2c",panelBackground:null!==(L=null==e||null===(M=e.style)||void 0===M?void 0:M.color_panel_background)&&void 0!==L?L:"#ffffff"}};var X=i(2628),Z=i(6079);function J(n){let{settings:r}=n;const a=(0,o.wA)(),{inPlatform:i}=(0,o.d4)(d.$P),{canShow:l}=function(){const{splitTestEnabled:t,splitTestLabel:n,splitLabelTimestamp:r}=(0,o.d4)(d.Od),a=(0,o.wA)(),i=(0,e.useCallback)(()=>{a((0,b.YK)())},[a]),l=(0,g.A)(i,2500);return(0,e.useEffect)(()=>{function e(){l()}return t&&window.addEventListener("mousemove",e),()=>t?window.removeEventListener("mousemove",e):void 0},[t]),(0,e.useEffect)(()=>{r&&f(r)&&a((0,b.Ss)())},[r]),(0,e.useEffect)(()=>{let e=n||p.OT.NO_SPLIT_LABEL;t&&!n&&(e=Math.random()>.5?p.OT.SPLIT_A:p.OT.SPLIT_B),n||a((0,b.dm)(e))},[t,n]),{canShow:t&&["A","X"].indexOf(n)>-1||!t,splitTestLabel:n}}();return(()=>{const t=(0,o.wA)(),[n,r]=(0,e.useState)("/"),{conversionPageUrl:a,splitTestLabel:i,hasInteraction:l,splitTestEnabled:s}=(0,o.d4)(d.Od),c=(()=>{const[t,n]=(0,e.useState)(!1),{conversionPageUrl:r}=(0,o.d4)(d.Od),a=((t,n)=>{let{enable:r=!0}=n;const[o,a]=(0,e.useState)(null);if(!r)return null;const i=setInterval(()=>{const e=document.querySelector("#klarna-checkout-iframe");e&&(a(e),clearInterval(i))},500);return o})(0,{enable:null==r?void 0:r.match(/klarna/gi)}),i=(0,e.useRef)(null),l=(0,e.useCallback)(e=>{var t;const r=e.getAttribute("src")||"",o=function(e){try{return JSON.parse(e)}catch(e){return console.error("Failed to parse JSON:",e),null}}((null===(t=decodeURIComponent(r).match(/\{"(.*)/gim))||void 0===t?void 0:t[0])||"");o&&"object"==typeof o&&["created","checkout_complete"].indexOf(o.ORDER_STATUS)>-1&&n(!0)},[]);return(0,e.useEffect)(()=>{a&&!i.current&&(l(a),i.current=setInterval(()=>l(a),500))},[a,i,l]),(0,e.useEffect)(()=>{t&&clearInterval(i.current)},[t]),t})(),u=(0,e.useCallback)(()=>{if(!f(localStorage.getItem(B)))return;const e=s&&i,n=!l;localStorage.setItem(B,Number(new Date)),t((0,b.yM)(e,n)),t((0,b.Ss)())},[t,i,l,s]);(0,e.useEffect)(()=>{c&&u()},[u,c]),(0,e.useEffect)(()=>{r(window.location.href),null!=a&&a.trim()&&(0,z.A)(n,a)&&u()},[u,n,a])})(),function(){const t=(0,o.wA)(),{botKey:n}=(0,o.d4)(d.$P),{messageSentTime:r}=(0,o.d4)(d.DZ),{persistStateLifespan:a}=(0,o.d4)(d.Od),{chatMessages:i}=(0,o.d4)(d.DZ);(0,e.useEffect)(()=>{const e=(0,U.A)({messageSentTime:r,persistStateLifespan:a});0===a||e||0===i.length||t((0,b.g4)(n))},[n,t,a,r])}(),(0,e.useEffect)(()=>{var e;l&&null!==(e=r.chatbubble)&&void 0!==e&&e.autopopup&&!(0,X.A)()&&!i&&setTimeout(()=>a((0,b.UB)()),r.chatbubble.autopopup_time)},[a,i,r,l]),l?t().createElement(u.A,{chatSettings:r,hidden:r.bubbleHidden,onNudgeDismiss:r.onNudgeDismiss,onNudgeFormSubmit:r.onNudgeFormSubmit,onNudgeProductClick:r.onNudgeProductClick}):null}let Q=!1,ee=null;const te=(0,e.forwardRef)((n,r)=>{let{botKey:l,settings:u,initialChatLanguage:d}=n;return ee||(ee=(0,v.Ay)({botKey:l,settings:u,initialChatLanguage:d})),(0,e.useEffect)(()=>()=>{ee=null},[]),function(){const{nonce:t}=window.__KINDLY_SETTINGS__;(0,e.useEffect)(()=>{const e=document.createElement("style");e.setAttribute("data-kindly-styles","true"),e.textContent=H,t&&e.setAttribute("nonce",t);try{return document.querySelector('style[data-kindly-styles="true"]')||document.head.appendChild(e),()=>{try{const e=document.querySelector('style[data-kindly-styles="true"]');e&&document.head.contains(e)&&document.head.removeChild(e)}catch(e){console.error("Error removing Kindly styles:",e)}}}catch(e){return void console.error("Error injecting Kindly styles:",e)}},[])}(),(0,e.useImperativeHandle)(r,()=>({getActivityStatus:()=>ee.getState().chatbubble.active,openChat(){ee.dispatch((0,b.lQ)({source:"programmatic"}))},closeChat(){ee.dispatch((0,b.Rh)({source:"programmatic"}))},restartChat(){let{openChat:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{openChat:!1};(0,Z.Tk)(),ee.dispatch((0,b.zX)(l,e))},triggerDialogue(e,t){ee.dispatch((0,b.zh)(e,t))},sendMessage(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=e.trim(),r="user"===t.sender,o=!1===t.openChat,{newContext:a}=t;r&&n&&ee.dispatch((0,b.y2)(n,void 0,a,void 0,void 0,{shouldOpenChat:!o}))},showNudge(e){let{nudgeLayout:t,slug:n,trackEvent:r=!0}=e;ee.dispatch((0,b.fe)({nudgeLayout:t,slug:n,trackEvent:r}))},showCustomNudge(e){let{content:t,slug:n,onRendered:r,trackEvent:o=!0}=e;ee.dispatch((0,b.kS)({content:t,slug:n,onRendered:r,trackEvent:o}))},getNudges:()=>ee.getState().bot.nudges,closeNudge(e,t){ee.dispatch((0,b.Y_)(e,t))},nudgeCompletion(e){sessionStorage.getItem("kindly-nudge-completion")||(ee.dispatch((0,G.vJ)({slug:e,eventType:V.oE})),ee.dispatch({type:V.Kd,slug:e}),sessionStorage.setItem("kindly-nudge-completion","true"))},triggerCtaEvent(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;ee.dispatch((0,G.NS)(e))},identifyUser(e){ee.dispatch((0,b.gm)(e))},setNewContext(e){ee.dispatch((0,b.Aw)(e))},getContext:()=>ee.dispatch((0,b.SD)()),setNewBannerMessage(e,t){ee.dispatch((0,b.cC)(e,t||(null==e?void 0:e.message)))},setNewLabel(e){ee.dispatch((0,b.tD)(e))},cancelHandover(){ee.dispatch((0,b.cL)())}})),(0,e.useEffect)(()=>{(0,s.NY)(u)},[u]),(0,e.useEffect)(()=>{const{persistStateLifespan:e}=ee.getState().bot;if(-1===e||e>0)return;let t=!1;const n=()=>{t||(t=!0,ee.dispatch((0,b.R7)(l)))};window.onbeforeunload=n,window.onunload=n},[l,u,ee]),(0,e.useEffect)(()=>{!Q&&u.track_utm&&(Q=!0,Promise.resolve().then(i.bind(i,649)).then(e=>{let{default:t}=e;const n=t();n&&ee.dispatch((0,b.Aw)({...n}))}))},[u,ee]),window.Cypress&&(window.store=ee),t().createElement(o.Kq,{store:ee},t().createElement(a.NP,{theme:Y(u)},t().createElement(q,null),t().createElement(c.A,{errorPoint:"inside ChatContainer",displayError:!1},(u.user_idle_timeout_seconds||0)>0?t().createElement(F,{onIdle:()=>ee.dispatch((0,b.ZS)()),onActive:()=>ee.dispatch((0,b.Mm)(u.id)),timeout:1e3*(u.user_idle_timeout_seconds||0)},t().createElement(J,{settings:u})):t().createElement(J,{settings:u}))))});te.displayName="ChatContainer";const ne=te;var re=i(2366),oe=i(6249);function ae(e){let{retries:t=6,interval:n=300,intervalBackoffMultiplier:r=2}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new Promise((o,a)=>{e({retriesLeft:t,interval:n,intervalBackoffMultiplier:r}).then(o).catch(i=>{setTimeout(()=>{t<=1?a(i):ae(e,{retries:t-1,interval:n*r,intervalBackoffMultiplier:r}).then(o,a)},n)})})}async function ie(e,t,n){const r=(0,re.U)(),o=`${e}/settings/${t}.json?version=2.76.11&${[re.B]}=${r}`;return ae(()=>fetch(o,{...n&&{signal:n.signal}}).then(async e=>{const t=await e.json();return{status:e.status,statusText:e.statusText,ok:e.ok,data:t}}),{retries:3,interval:2e3,intervalBackoffMultiplier:1})}let le=!1;const se=e=>e.split("-")[0],ce=(e,t)=>{const n=e.find(e=>e===t);if(n)return n;const r=se(t);return e.find(e=>se(e)===r)};function ue(e){return Object.getOwnPropertyNames(e).forEach(t=>{const n=e[t];n&&"object"==typeof n&&ue(n)}),Object.freeze(e)}function de(n){var o;let{botKey:a,setKindlyChatRef:i,options:l={}}=n;const s=function(t,n){const[r,o]=(0,e.useState)(n||{});return(0,e.useEffect)(()=>{const e=new AbortController;return le?o(e=>(0,oe.A)(e,n)):(async()=>{try{var r;const a=await ie((null===(r=n.environment)||void 0===r?void 0:r.SETTINGS_HOST)||"https://chat.kindlycdn.com",t,e),{welcome_page:i,in_chat_notification:l,notifications:s,settings:{supported_languages:c,...u},...d}=a.data,p={...d,...u,...s,supportedLanguages:c,welcomePage:i,inChatNotification:l};o(e=>(0,oe.A)((0,oe.A)(p,e),{...n}))}catch(e){var a,i;const t=null!==(a=e.response)&&void 0!==a&&null!==(i=a.data)&&void 0!==i&&i.error?e.response.data.error:e;"signal is aborted without reason"!==t.message&&console.error("Kindly chat failed to initialize.",t)}})(),le=!0,()=>{e.abort()}},[t,n]),(0,e.useEffect)(()=>()=>{le=!1},[]),r}(a,l);if(!s.id)return null;const{inPlatform:c,fullscreenMode:u,language:d,focusTrapOnFullView:p,supportedLanguages:f,getAuthToken:h,nonce:m}=s;window.__KINDLY_SETTINGS__=ue({language:d,supportedLanguages:f,feedbackSettings:c?{}:s.feedback_settings,focusTrapOnFullView:p,fullscreenMode:u,getAuthToken:h,nonce:m});const g=window.__KINDLY_SETTINGS__.language,b=function(e,t){var n,r,o;const a=e.map(e=>e.code),i=null==t?void 0:t.toLowerCase();if(1===a.length)return a[0];if(i){const e=ce(a,i);if(e)return e}const l=null===(n=document.documentElement.lang)||void 0===n?void 0:n.toLowerCase(),s=ce(a,l);if(s)return s;const c=null===(r=window.navigator.language)||void 0===r?void 0:r.toLowerCase(),u=ce(a,c);if(u)return u;return(null===(o=window.navigator.languages)||void 0===o?void 0:o.flatMap(e=>{const t=ce(a,e.toLowerCase());return t?[t]:[]})[0])||e.find(e=>e.is_primary).code.toLowerCase()}(window.__KINDLY_SETTINGS__.supportedLanguages.filter(e=>e.is_active),g);if(!b)return console.error("Impossible to determine initial Chat language, make sure you have at least one language active for the Bot"),null;const v=(null===(o=l.environment)||void 0===o?void 0:o.KINDLY_CHAT_URL)||"http://localhost:8081",y=[v?new URL(v).hostname:void 0,"*.kindly.ai","demokind.ly","*.demokind.ly",...s.chatbubble.domains].filter(Boolean);return s.chatbubble.inPlatform||function(e,t){return!!r()(t).call(t,"*")||!!e&&t.some(t=>function(e){const t=e.replace(/\./g,"\\.").replace(/\*/g,".");return new RegExp(t,"i")}(t).test(e))}(window.location.hostname,y)?t().createElement(ne,{ref:i,botKey:a,settings:s,initialChatLanguage:b}):(console.error(`Domain ${window.location.hostname} is not allowed to load Kindly Chat. Please check your bot settings if you think this is a mistake.`),null)}const pe=function(n){let{botKey:r,setKindlyChatRef:o,options:a}=n;return t().createElement(e.Suspense,{fallback:""},t().createElement(de,{botKey:r,setKindlyChatRef:o,options:a}))}})(),l})());