/*! mevo-sdk 2022-12-28 */
!function(){var i={blue:"#3b82f6",red:"#ef4444",yellow:"#eab308",green:"#22c55e",indigo:"#6366f1"},n=(window.mevo=window.mevo||{},document.currentScript&&document.currentScript.getAttribute("target")),t='<svg style="width:60%" width="755" height="481" viewBox="0 0 755 481" fill="none" xmlns="http://www.w3.org/2000/svg">',a=(t=(t=t+'<rect y="409.921" width="473.336" height="142.001" rx="71.0004" transform="rotate(-60 0 409.921)" fill="white"/>'+'<rect x="272" y="409.921" width="473.336" height="142.001" rx="71.0004" transform="rotate(-60 272 409.921)" fill="white"/>')+'<rect x="683.976" y="287" width="142.001" height="142.001" rx="71.0004" transform="rotate(60 683.976 287)" fill="white"/>'+"</svg>",'<svg xmlns="http://www.w3.org/2000/svg" style="width:24px; height: 24px;" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2">');function r(){var e=document.querySelector("#mevo_chatbox_opener"),o=document.querySelector("#mevo_chatbox_iframe");mevo.isChatboxOpen?(o.classList.add("mevo_animation_fade_out"),o.classList.remove("mevo_animation_fade_in"),setTimeout(function(){o.style.display="none"},251),e.innerHTML=t):(o.classList.remove("mevo_animation_fade_out"),o.classList.add("mevo_animation_fade_in"),e.classList.remove("mevo_dot"),o.style.display="block",e.innerHTML=a),mevo.isChatboxOpen=!mevo.isChatboxOpen,sessionStorage.setItem("_mevo_chatbox_state",mevo.isChatboxOpen?"open":"closed")}function o(){var e=document.querySelector("#mevo_chatbox_iframe");mevo.isChatboxOpen&&(e.style.display="block",e.classList.add("mevo_animation_fade_in"))}a+='<path stroke-linecap="round" stroke-linejoin="round" d="M6 18L18 6M6 6l12 12" /></svg>',n=n||"https://app.mevo.chat",mevo.init=function(e){mevo.initialized?console.error("Mevo is already initialized!"):(mevo.initialized=!0,mevo.isChatboxOpen=!1,mevo.pid=e,(e=document.createElement("div")).id="mevo_wrapper",e.style.display="none",e.innerHTML+='<div id="mevo_chatbox_opener">'+t+'</div><iframe src="'+n+"/chatbox?pid="+mevo.pid+"&o="+btoa(document.location.href)+'" id="mevo_chatbox_iframe" class="hidden"></iframe>',document.body.appendChild(e),e.querySelector("#mevo_chatbox_iframe").onload=o,window.addEventListener("message",o=>{var e;if(o.origin===n)try{var t=JSON.parse(o.data);"connected"==t.kind?document.querySelector("#mevo_wrapper").style.display="block":"session-message"==t.kind?mevo.isChatboxOpen||document.querySelector("#mevo_chatbox_opener").classList.add("mevo_dot"):"channel"==t.kind?(mevo.style=t.data,(e=document.createElement("style")).innerHTML="#mevo_chatbox_opener { box-shadow: 0 0 2px "+i[mevo.style.bgColor]+", 0 0 2px "+i[mevo.style.bgColor]+", 0 0 50px "+i[mevo.style.bgColor]+"; animation-duration: 500ms; animation-timing-function: ease; animation-delay: 0s; animation-iteration-count: 1; animation-direction: normal; animation-fill-mode: none; animation-play-state: running; animation-name: chatbox-opener-intro; color: white; cursor: pointer; position:fixed; bottom: 30px; "+mevo.style.launcherPosition+": 30px; background-color: "+i[mevo.style.bgColor]+"; width: 45px; height: 45px; display: flex; justify-content: center; align-items:center; border-radius: 50%; z-index:501; }",e.innerHTML+="#mevo_chatbox_opener.mevo_dot::after { width: 14px; height: 14px; border-radius: 50%; background-color: "+i[mevo.style.bgColor]+'; content: ""; position: absolute; right: 0px; bottom: 0px; }',e.innerHTML+="#mevo_chatbox_iframe { border:none !important; box-shadow: 0 1px 6px 0 rgb(0 0 0 / 6%), 0 2px 32px 0 rgb(0 0 0 / 16%); display:none; border-radius: 10px; height:500px;width:400px;position:fixed;"+mevo.style.launcherPosition+":30px;bottom:100px;z-index:502;}",e.innerHTML+="@keyframes fadeInAnimation { 0% { opacity: 0; } 100% { opacity: 1; } }",e.innerHTML+="@keyframes fadeOutAnimation { 0% { opacity: 1; } 100% { opacity: 0; } }",e.innerHTML+="@keyframes chatbox-opener-intro { 0% { opacity: 0; transform: scale(0.5); } 100% { opacity: 1; transform: scale(1);} }",e.innerHTML+="@keyframes fadeOutAnimation { 0% { opacity: 1; } 100% { opacity: 0; } }",e.innerHTML+="#mevo_chatbox_iframe { animation-iteration-count: 1; animation-fill-mode: forwards; }",e.innerHTML+="@media screen and (max-width: 768px) { #mevo_chatbox_opener { right: 16px; bottom: 16px; } #mevo_chatbox_opener.open { right: 16px; top: 10px; background: transparent; box-shadow: none; }}",e.innerHTML+="@media screen and (max-width: 768px) { #mevo_chatbox_iframe { left: 0; right: 0; top: 0; bottom: 0; height: 100vh; height: -webkit-fill-available; width: 100vw; position: fixed; border: 0; border-radius: 0; }}",e.innerHTML+=".mevo_animation_fade_in { animation: fadeInAnimation ease 0.25s; }",e.innerHTML+=".mevo_animation_fade_out { animation: fadeOutAnimation ease 0.25s; }",document.head.appendChild(e)):"error"===t.kind?"NOT_ALLOWED"==t.data.message?console.error("[MEVO] Received an error! Domain is not allowed, check your channel configurations"):console.error("[MEVO] Received an error!",t.data.message):"chatbox-closed"===t.kind&&r()}catch(e){console.error("[MEVO] Unable to parse message",o.data)}},!1),document.querySelector("#mevo_chatbox_opener").addEventListener("click",function(){r()}),"open"===sessionStorage.getItem("_mevo_chatbox_state")&&(r(),document.querySelector("#mevo_chatbox_opener").innerHTML=a))};var e=document.currentScript&&document.currentScript.getAttribute("pid");e&&window.addEventListener("load",function(){mevo.init(e)})}();