window.FILAMENT={template:'<button id="flmntChatbot" tabindex="1" class="flmntChatbot chatbotMinimised" onclick="FILAMENT.toggleBot();"><div  id="flmntClickElement" class="flmntClickElement"><h3 id="flmntChatbotTitle" class="flmntChatbotTitle"></h3><img src="" class="flmntChatDecorationIcon" id="flmntChatDecorationIcon" alt="Speech bubbles"><svg class="flmntChatTabIcon" id="flmntChatTabMax" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M464 32H48C21.5 32 0 53.5 0 80v352c0 26.5 21.5 48 48 48h416c26.5 0 48-21.5 48-48V80c0-26.5-21.5-48-48-48zm0 394c0 3.3-2.7 6-6 6H54c-3.3 0-6-2.7-6-6V192h416v234z"></path></svg><svg class="flmntChatTabIcon" id="flmntChatTabMin" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M464 352H48c-26.5 0-48 21.5-48 48v32c0 26.5 21.5 48 48 48h416c26.5 0 48-21.5 48-48v-32c0-26.5-21.5-48-48-48z"></path></svg></div><div class="flmntChatIframeContainer" style="background:#FFF;"><iframe src="" frameborder="0" id="flmntChatIframe" class="flmntChatIframe"></iframe></div></button>',widgetCSS:function(){var t=document.head||document.getElementsByTagName("head")[0],e=document.createElement("style");e.type="text/css",e.appendChild(document.createTextNode(".flmntChatbot.chatbotMaximised:focus { outline: 0; } .flmntChatbot { overflow: visible; padding: 0px; max-height:520px;height:95%;width:350px;min-width:240px;z-index:999999;position:fixed;right:24px;box-shadow:rgba(0,0,0,.1) 0 1px 24px; border: 0px; border-radius:0px 0px 0 0} .flmntClickElement{padding:12px; margin: 2px 2px 0px 2px; background:#DA202A;color:#FFF;border-radius:8px 8px 0 0;cursor:pointer;position:relative}.chatbotMaximised .flmntClickElement, .chatbotMaximised .flmntChatIframeContainer { margin: 0px; } .flmntChatbotTitle{text-align: left; margin:0;padding-left:55px;font-size:16px;color:#FFF;font-weight:400;font-family:chevin,Helvetica,Arial,Nimbus Sans L,sans-serif}.flmntChatIframeContainer{margin: 0px 2px; height:100%}.flmntChatIframe{width:100%;height:92%}.flmntChatTabIcon{width:16px;height:16px;fill:#F4F4F3;position:absolute;top:12px;right:12px}.flmntChatDecorationIcon{width:80px;height:57px;position:absolute;top:-20px;left:-20px}@media screen and (max-width:420px){.flmntChatbot{width:96%;right:6px}.flmntChatbotTitle{padding-left:65px}.flmntChatDecorationIcon{width:65px;height:46px;top:-10px;left:5px}}@media screen and (max-height:500px){.flmntChatIframe{height:91%}}@media screen and (max-height:400px){.flmntChatIframe{height:90%}}@media screen and (max-height:350px){.flmntChatIframe{height:88%}}@media screen and (max-height:300px){.flmntChatIframe{height:86%}}")),t.appendChild(e)},calcPosition:function(){document.body,document.documentElement;var t=document.getElementById("flmntChatbot").clientHeight;return document.getElementById("flmntClickElement").clientHeight-t},toggleBot:function(){if("BUTTON"==document.activeElement.tagName||"BODY"==document.activeElement.tagName){var t=document.getElementById("flmntChatbot"),e=document.getElementById("flmntChatTabMax"),n=document.getElementById("flmntChatTabMin"),a=document.getElementById("flmntChatIframe"),i=window.FILAMENT.calcPosition();t.classList.contains("chatbotMinimised")?(t.style.bottom="0px",t.classList.remove("chatbotMinimised"),t.classList.add("chatbotMaximised"),e.style.display="none",n.style.display="inline-block",-1==a.className.indexOf("flmntChatIframe-maximised")&&setTimeout(function(){a.src=window.FILAMENT.widgetURL(),a.className+=" flmntChatIframe-maximised"},250),window.utag&&utag.link({botChatEvent:"Click|Open",botChatType:"Tracking Assistant"})):(t.style.bottom=i+"px",t.classList.add("chatbotMinimised"),t.classList.remove("chatbotMaximised"),e.style.display="inline-block",n.style.display="none",window.utag&&utag.link({botChatEvent:"Click|Close",botChatType:"Tracking Assistant"}))}},widgetParams:function(){for(var t=document.getElementById("flmntWidgetInit"),e={},n=0;n<t.attributes.length;n++){if(0==t.attributes[n].name.indexOf("flmnt-"))e[t.attributes[n].name.split("flmnt-")[1]]=encodeURIComponent(t.attributes[n].value)}return e},widgetURL:function(){var t=window.FILAMENT.widgetParams(),e=decodeURIComponent(t.widgeturl),n="?";for(var a in t)t.hasOwnProperty(a)&&(0<Object.keys(t).indexOf(a)&&(n+="&"),n+=a+"="+t[a]);return e+n},widgetIcon:function(){var t=window.FILAMENT.widgetParams();return decodeURIComponent(t.widgeticonurl)},refresh:function(){document.getElementById("flmntChatIframe").src=window.FILAMENT.widgetURL()},listenForMessages:function(){window.addEventListener("message",function(t){t.data&&t.data.flTagType&&("view"===t.data.flTagType&&window.utag&&utag.view&&utag.view(t.data.data),"click"===t.data.flTagType&&window.utag&&utag.link&&utag.link(t.data.data))},!1)},init:function(){var t=window.FILAMENT.widgetParams();window.FILAMENT.widgetCSS(),window.FILAMENT.listenForMessages(),document.body.insertAdjacentHTML("beforeend",window.FILAMENT.template),document.getElementById("flmntChatDecorationIcon").src=window.FILAMENT.widgetIcon(),document.getElementById("flmntChatbotTitle").innerHTML=decodeURIComponent(t.widgettab),document.getElementById("flmntChatTabMin").style.display="none",document.getElementById("flmntChatbot").style.bottom=window.FILAMENT.calcPosition()+"px"}},window.FILAMENT.init();