function a0_0x5755(){let e=["error","classList","position","white","getRandomValues","70vw","0 4px 8px 0 rgba(0, 0, 0, 0.2)","assistant-message","listeners","contentWindow","http://","location","postMessage","-7px","round","100dvh","button_color","maxHeight","setItem",'"/>\n \n',"has","Invalid parameters for update",'" width="24" height="24">\n\n\n','"/>\n\n \n \n \n \n \n \n \n \n \n \n',"user_id","/chatbot-iframe/","localhost"," body {\nposition: fixed !important;\ntop: 0;\nleft: 0;\noverscroll-behavior: none;\nwidth: 0 !important;\nheight: 0 !important;\nmargin: 0 !important;\noverflow: hidden !important;\noverflow-y: hidden !important;\noverflow-x: hidden !important;\ntransform: none !important;\n}\n","#000000","message_bubbles_have_been_shown","identify",'{for(var e=a0_0x128b,t=a0_0x5755();;)try{if(563457==-parseInt(e(323))+parseInt(e(380))/2*(-parseInt(e(256))/3)+-parseInt(e(339))/4+-parseInt(e(253))/5+-parseInt(e(412))/6*(parseInt(e(310))/7)+parseInt(e(261))/8+parseInt(e(440))/9)break;t.push(t.shift())}catch(e){t.push(t.shift())}})(),(()=>{let s=a0_0x128b;let e=[s(289),s(433)],t=[s(409)],n=[s(272)],o=[...t,...n,...e],d=[...o],f=new class{constructor(){this.listeners=new Map}[s(334)](e,t){var n=s;this[n(273)][n(285)](e)||this[n(273)][n(423)](e,new Set),this[n(273)][n(298)](e)[n(445)](t)}[s(342)](e,t){var n=s;this.listeners.has(e)&&this[n(273)][n(298)](e).delete(t)}[s(332)](t){var e=s;return this[e(273)][e(285)](t[e(382)])&&this[e(273)][e(298)](t[e(382)])[e(361)](e=>{e(t)}),o[e(348)](t[e(382)])&&this[e(273)].has(e(318))&&this[e(273)][e(298)](e(318))[e(361)](e=>{e(t)}),!0}},y={},v=null,l=1e3;function i(r){let i=s;window[i(374)]=(e,...n)=>{let a=i;switch(e){case a(263):return a(303);case"identify":n?.[0]&&r.contentWindow.postMessage({type:a(251),params:{user_id:n[0].user_id,user_hash:n[0][a(436)],user_metadata:n[0][a(418)],chatbase_anon_id:(()=>{var e,t=a0_0x128b,n=t(391);for(e of document[t(362)][t(422)](";"))if(0===(e=e.trim())[t(383)](n))try{return decodeURIComponent(e[t(320)](n.length))}catch(e){return console.error(t(363),e),""}return""})()}},"*");break;case"update":n&&typeof n[0]===a(326)?r[a(274)].postMessage({type:a(407),params:n[0]}):console[a(265)](a(286));break;case"shutdown":break;case a(334):d[a(348)](n[0])&&f[a(334)](n[0],n[1]);break;case"removeEventListener":d[a(348)](n[0])&&f[a(342)](n[0],n[1]);break;case a(367):if(typeof n[0]!==a(326)||null===n[0])console[a(265)](a(424));else{for(var[t,o]of Object.entries(n[0])){if(typeof t!==a(358))return void console[a(265)](a(325));if(typeof o!==a(300))return void console[a(265)](a(228))}y=n[0]}break;case a(291):if(n&&Array[a(425)](n[0])&&n[0][a(231)](e=>"string"==typeof e&&0l){console.warn(a(430)+l+a(313));let o=l;e=e[a(240)]((e,t)=>{var n=a;return 0t(n,...e)}})}var a,r,c=document[s(309)];let h=null,x=new URL(c.src);try{h=x[s(305)][s(298)]("chatbotId")}catch(e){console[s(351)](e)}let _=c[s(386)](s(368))||window[s(232)]?.[s(368)]||c.id||window[s(312)]?.[s(368)]||h,u=c[s(386)](s(302))||window[s(232)]?.[s(302)],C=u?u[s(348)]("localhost")?s(275)+u:"https://"+u:x.origin,L=s(414),I=s(268),k=null,E=!1;function w(){var e=s;return document[e(214)](e(373))}function m(){var e=s;return document[e(214)](e(401))[e(340)](e(437))}function T(){var e=s,e='\n{var t=l;c[t(335)][t(259)]=t(327)}),c[l(334)](l(377),e=>{var t=l;c[t(335)][t(259)]=t(435)}),document[l(394)]("div"));w.style[l(212)]=l(337),w.style.alignItems=l(392),w[l(335)][l(304)]=l(392),w[l(335)][l(336)]=l(236),w[l(335)][l(319)]=l(236),w.style[l(218)]=2147483646,c[l(442)](w);c.addEventListener(l(370),()=>{var e=l;(b[e(335)][e(212)]===e(381)?W:j)()}),window[l(334)]("message",o=>{let a=l;if(o[a(217)][a(382)]===a(426)){m.contentWindow[a(277)]({windowInnerWidth:window[a(385)]},"*");var e=window.chatbase?.q||[],r=window[a(226)];if((r?.[a(245)]||r?.email||r?.[a(255)]||r?.user_hash||r?.[a(418)])&&e.unshift(["identify",{user_id:r?.[a(245)],email:r?.[a(344)],name:r?.[a(255)],user_hash:r?.[a(436)],user_metadata:r?.[a(418)]}]),i(m),0{var t=a;m[t(274)][t(277)]({type:t(290),toolName:n,result:e},"*")})):(console[a(265)](a(221)+n+a(324)),m[a(274)][a(277)]({type:a(290),toolName:n,result:{error:a(221)+n+a(324),status:a(265)}},"*"))}}),h.addEventListener("click",()=>{var e=l;E=!0,h[e(335)][e(212)]=e(381),S(),w[e(364)]=M()});let m=document[l(394)]("iframe"),p=(_===l(375)&&(m.allow=l(316)),m.style.height=l(236),m[l(335)][l(336)]=l(236),m[l(335)][l(441)]="none",m[l(335)][l(212)]="none",document[l(394)](l(437))),b=(p[l(335)][l(212)]=l(337),p[l(335)][l(304)]=l(392),p[l(335)].height=l(236),p[l(335)][l(321)]=l(392),document[l(394)]("div"));b.scrolling=l(350),setTimeout(()=>{var e=l;b[e(233)]=e(350)},3e3),b[l(225)]("id",l(373)),b[l(335)][l(441)]="none",b[l(335)][l(267)]=l(408),b[l(335)][l(378)]=l(341),b[l(335)][l(304)]="space-between",b[l(335)][l(419)]=l(369),b[l(335)][l(237)]=window[l(385)]<640?"0":l(366),b[l(335)][l(372)]=window.innerWidth<640?"0":l(432),b[l(335)][l(336)]=window[l(385)]<640?"100%":"458px",b[l(335)][l(319)]=window[l(385)]<640?l(280):l(396),b[l(335)][l(282)]=window.innerWidth<640?"":"824px",b.style.borderRadius=window[l(385)]<640?"0":l(238),b[l(335)][l(212)]="none",b.style.zIndex=2147483646,b[l(335)].overflow=l(387),b.appendChild(p),b[l(442)](m),document[l(411)][l(442)](b),window[l(334)](l(311),()=>{var e=l;"right"===r?(b[e(335)][e(372)]=window[e(385)]<640?0:e(432),b[e(335)][e(417)]=e(343)):(b[e(335)][e(417)]=window.innerWidth<640?0:e(432),b[e(335)].right=e(343)),b.style[e(237)]=window.innerWidth<640?0:e(242),b[e(335)][e(257)]=window.innerWidth<640?0:e(343),b[e(335)][e(336)]=window[e(385)]<640?e(236):e(406),b[e(335)][e(319)]=window[e(385)]<640?e(280):e(396),b[e(335)][e(224)]=window[e(385)]<640?"0":e(238),b[e(335)][e(212)]!==e(381)&&(window[e(385)]<640?document[e(411)][e(266)][e(445)](L):document[e(411)].classList[e(215)](L)),m.contentWindow[e(277)]({windowInnerWidth:window[e(385)]},"*")});function g(e,t){let n=l,o=e;"#"===o[n(317)](0)&&(o=o[n(360)](1));var e=e=>{var t=n;return Math[t(352)](255,Math[t(403)](0,e))},a=Number[n(328)](o.substr(0,2),16),r=Number[n(328)](o[n(360)](2,2),16),i=Number[n(328)](o.substr(4,2),16),t=.5<(.299*a+.587*r+.114*i)/255?-1*Math[n(306)](t):Math.abs(t),a=e(a+Math[n(279)](255*t)),r=e(r+Math[n(279)](255*t)),e=e(i+Math[n(279)](255*t));return"#"+a.toString(16)[n(235)](2,"0")+r.toString(16)[n(235)](2,"0")+e.toString(16)[n(235)](2,"0")}m.onload=()=>{var e=l;m.style[e(212)]="block",p[e(335)][e(212)]="none"};var e=window[l(374)]?.q??[],t=e.find(e=>"setInitialMessages"===e[0]),t=(t&&(v=t[1]),await(async()=>{let i=l,e=await fetch(a+i(338)+_,{method:i(371),headers:{"Content-Type":i(356)}}),{styles:s,initialMessages:t}=await e.json(),d=v||t;m.title=s?.[i(395)]||i(376),b.style[i(389)]="dark"===s[i(223)]?i(402):"white",c[i(335)][i(389)]=s[i(281)]||o,s.align_chat_button===i(417)?(r=i(417),c.style.left=i(432),c[i(335)][i(372)]="unset",h[i(335)][i(417)]="1rem",h[i(335)][i(372)]=i(343),b[i(335)][i(417)]=window[i(385)]<640?0:i(432),b.style[i(372)]="unset"):(c.style[i(372)]=i(432),c[i(335)][i(417)]=i(343),h.style.right=i(432),h[i(335)].left=i(343),b.style[i(372)]=window[i(385)]<640?0:"1rem",b[i(335)][i(417)]=i(343)),b.insertAdjacentElement("beforebegin",c),s.chat_icon&&(k=i(421)+s.chat_icon+i(329)+(s[i(395)]??"chatbot icon")+"\" style='width: 55px; height: 55px; border-radius: 50%;' />");var n=(e=>{let t=l,n=e;"#"===n[t(317)](0)&&(n=n[t(360)](1));var e=Number[t(328)](n.substr(0,2),16),o=Number[t(328)](n.substr(2,2),16),a=Number.parseInt(n[t(360)](4,2),16);return.5<(e=(.299*e+.587*o+.114*a)/255)?"black":t(268)})(s[i(281)]||o),n=(I=n,w[i(364)]=T(),d.forEach((e,t)=>{let n=i,o=document[n(394)](n(437)),a=(o.style[n(212)]=n(337),o.style.justifyContent=s[n(443)]===n(417)?"flex-start":n(415),document.createElement(n(437)));a[n(335)][n(389)]="dark"===s[n(223)]?n(402):n(268),a[n(335)][n(431)]=s[n(223)]===n(243)?n(268):"black",a[n(335)][n(419)]=n(369),a.style[n(224)]="10px",a[n(335)][n(322)]=n(429),a.style.margin=n(227),a[n(335)][n(294)]="14px";var r;a.innerHTML=e;for(r of a[n(296)]("a"))r[n(335)][n(431)]="dark"===s.theme?"white":n(402);a.style[n(234)]=0,a[n(335)][n(259)]=n(292),a[n(335)][n(365)]=n(359),o[n(442)](a),h[n(442)](o),0<=s[n(254)]&&setTimeout(()=>{var e=n;E||window.innerWidth<840||sessionStorage.getItem(e(250))!==e(434)&&(0===t&&(h.style[e(212)]="block"),a.style[e(234)]=1,a.style.transform=e(435),t===d.length-1)&&sessionStorage[e(283)](e(250),e(434))},1e3*s[n(254)]+100*t)}),u[i(335)][i(389)]="dark"===s.theme?g(i(249),.2):g("#FFFFFF",.12),u[i(335)][i(431)]=s.theme===i(243)?i(268):i(402),u[i(335)].boxShadow="rgba(150, 150, 150, 0.15) 0px 6px 24px 0px, rgba(150, 150, 150, 0.15) 0px 0px 0px 1px",h[i(334)]("mouseenter",()=>{var e=i;u[e(335)][e(212)]=e(337)}),h.addEventListener("mouseleave",()=>{var e=i;u[e(335)].display=e(381)}),u[i(334)]("click",e=>{var t=i;e.stopPropagation(),h[t(335)].display="none"}),s[i(223)]===i(243)?i(268):i(402));p[i(364)]=i(252)+n+i(244)})(),window[l(312)]&&(window.chatbaseConfig[l(241)]=!0),e[l(438)](e=>e[0]===l(297)||e[0]===l(229)));t.length&&t[t[l(399)]-1]?.[0]===l(297)&&W();{t=e.filter(e=>e[0]!==l(297)&&e[0]!==l(229));let o=s;window[o(374)]=(e,...t)=>{var n=o;switch(e){case n(297):return void W?.();case n(229):return void j?.();default:window[n(374)].q[n(307)]([e,...t])}},window[o(374)].q=t,window.chatbase=new Proxy(window[o(374)],{get(t,n){return"q"===n?t.q:(...e)=>t(n,...e)}})}}document[s(222)]===s(427)?g():window[s(334)]("load",()=>{g()}),c=a0_0x128b,document[c(362)][c(348)](c(330))||(r=window[c(276)].hostname,a=c(397),r=c(391)+(()=>{let t=a0_0x128b;return([1e7]+-1e3+-4e3+-8e3+-1e11)[t(428)](/[018]/g,e=>(e^crypto[t(269)](new Uint8Array(1))[0]&15>>e/4)[t(353)](16))})()+c(347)+r+c(230)+a,document[c(362)]=r)})();