!function(){var t="https://static.sociocs.com",e="1692339315630",o="chat_prompt_closed",i=document.getElementById("sociocs-c2c");if(!i)return console.error("Sociocs chat plugin cannot be enabled because a tag with id sociocs-c2c not found.");var s,n,a,p,c,r,d,l=i.getAttribute("data-channel");l?(s=i.getAttribute("data-prompt-text")||"Hello there! WhatsApp us here for any questions.","off"===(n=i.getAttribute("data-prompt-profile-pic"))?n="":n&&"on"!==n||(n="https://static.sociocs.com/c2c-prompt-profile-pic.png?1662902675506"),(p=(a=i.getAttribute("data-prompt-delay")||"").endsWith("s"))&&(a=a.replace("s","")),c=parseInt(a)||1e3,p&&(c*=1e3),sessionStorage&&sessionStorage.getItem(o)||((r=document.createElement("iframe")).setAttribute("id","sociocs-c2c-prompt"),r.setAttribute("title","Chat prompt"),r.style.cssText="position:fixed;display:none;max-width:24em;max-height:30em;width:100%;opacity:1;z-index:999999992;left:unset;bottom:88px;top:unset;right:12px;font-size:16px;margin:0px;padding:0px;border:0px;transition: all 0.2s ease; -webkit-transition: all 0.2s ease;overflow:auto;",r.src=t+"/c2c-prompt.html?"+e,r.addEventListener("load",function(){setTimeout(function(){r.style.display="block",r.contentWindow.postMessage({sEventType:"init",promptText:s,promptProfilePic:n},t)},c)}),i.appendChild(r)),(d=document.createElement("iframe")).setAttribute("id","sociocs-c2c-btn"),d.setAttribute("title","Chat button"),d.style.cssText="position:fixed;display:block;z-index:999999992;right:0px;left:unset;bottom:0px;top:unset;width:100%;height:100%;max-width:5em;max-height:5em;margin:0px;padding:0px;border:0px;font-size:16px;",d.src=t+"/c2c-button-wa.html?"+e,d.addEventListener("load",function(){d.contentWindow.postMessage({sEventType:"init",dataChannel:l},t)}),i.appendChild(d),window.addEventListener("message",function(t){if(t.data)switch(t.data.sEventType){case"close-prompt":r.style.display="none",sessionStorage&&sessionStorage.setItem(o,!0);break;case"prompt-size":t.data.promptHeight&&(r.style.height=t.data.promptHeight+"px")}})):console.error("Sociocs chat plugin cannot be enabled because the channel attribute is not available in the HTML tag.")}();