"use strict";var _aimtellPushToken,_aimtellRanScript,_aimtellSubscriberID,_aimtellRefreshResult,_aimtellAPI="https://api.aimtell.com/prod",_aimtellSubscriberGEO=null,_aimtellSWInitiated=!1,_aimtellNewSubscriberID=!1,_aimtellVersion=3.986,_aimtellDebugQueue=[],_aimtellDebugQueueActive=0,_aimtellPrompted=!1,_aimtellUserDefinedWorker=null,_aimtellWebsiteConfiguration=null,_aimtellFunnelPixel=null,_aimtellUpdateViaCache=null,_aimtellWorkerScope="/",_aimtellPreSubscriberTrackData=[],_aimtellServiceWorker=null,_aimtellCurrentPage=window.location.href,_aimtellPromptConfiguration=null;_at.showCredit=!!document.currentScript.src.includes("aimtell");var trackData,_aimtellTrackData,_aimtellDebug,aimtellDebugBox,_aimtellPageLoadAttributes=JSON.parse(JSON.stringify(_at.attributes));function _aimtellDeferred(){this._done=[],this._fail=[]}function _aimtellGetUrlVars(){var a={};window.location.href.replace(/[?&]+([^=&]+)=([^&]*)/gi,function(e,t,i){a[t]=i});return a}function _aimtellGetDeviceType(){var e,t=1,i="desktop";return e=navigator.userAgent||navigator.vendor||window.opera,(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od|ad)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|tablet|playbook|silk|kindle|touch|galaxy tab|nexus (7|9)|sm-t|sch-i800|lenovo|huawei|mediapad|xoom|transformer|touchpad/i.test(e)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(e.substr(0,4)))&&(t=2),2==t&&(i="mobile"),i}function _aimtellGetPageDetails(){return{pageTitle:document.title,pageURL:window.location.href}}function _aimtellLoadBeacon(e){var t=document.createElement("iframe");t.setAttribute("src","https://beacon.aimtell.com/?id_site="+_at.idSite+"&subscriber_uid="+_at.subscriber+"&permission="+e),t.style.width="1px",t.style.height="1px",t.style.display="none",document.body.appendChild(t)}function _aimtellCrossDomainSubscriberID(n){return new Promise(function(i,e){var a=new XMLHttpRequest,t="https://beacon.aimtell.com/sub?id_site="+n;a.onreadystatechange=function(){var e,t;4==a.readyState&&(e=JSON.parse(a.responseText),(t={}).subscriber_uid=e.subscriber_uid,t.id_site=n,t.permission=e.permission,i(t))},a.open("GET",t,!0),a.withCredentials=!0,a.setRequestHeader("Content-Type","application/json;charset=UTF-8"),a.send()})}function _aimtellCrossDomainSuppression(n){return new Promise(function(e,t){if(!n||""===n)return e(0);var i=new XMLHttpRequest,a="https://beacon.aimtell.com/suppression?id_sites="+n;i.onreadystatechange=function(){4==i.readyState&&e(i.responseText)},i.open("GET",a,!0),i.withCredentials=!0,i.setRequestHeader("Content-Type","application/json;charset=UTF-8"),i.send()})}function _aimtellGetReferrer(){var e=null,t=null;return 0!==document.referrer.indexOf(location.protocol+"//"+location.host)&&(e=document.referrer||null,t=document.referrer?document.referrer.split("/")[2]:null),{refName:t,refUrl:e}}function _aimtellGetLanguage(){return navigator.language||navigator.userLanguage}function _aimtellAbandonedFunnel(t,e,i,a,n,o,l,r){var s=l||30,l="https://beacon.aimtell.com/af";if(l+="?i="+e,l+="&ec="+i,l+="&ea="+a,l+="&el="+n,l+="&ev="+o,l+="&t="+(s*=1e3),r&&(l+="&vars="+encodeURIComponent(JSON.stringify(r))),l+="&s="+_at.subscriber,e!=_at.idSite)return console.log("[Aimtell] Invalid / Unauthorized Website ID"),!1;(_aimtellFunnelPixel=document.createElement("iframe")).id="_aimtellFunnel",_aimtellFunnelPixel.setAttribute("src",l),_aimtellFunnelPixel.style.width="1px",_aimtellFunnelPixel.style.height="1px",_aimtellFunnelPixel.style.display="none",document.body.appendChild(_aimtellFunnelPixel),_aimtellFunnelPixel.addEventListener("load",function(){var e;"start"==t?_aimtellAbandonPage():"finish"==t&&(e=setInterval(function(){_aimtellFunnelPixel?(_aimtellFunnelPixel.contentWindow.postMessage("finish","https://beacon.aimtell.com"),clearInterval(e)):console.log("[Aimtell] Waiting or beacon to load")},1500))})}function _aimtellAbandonPage(){_aimtellFunnelPixel.contentWindow.postMessage("listen","https://beacon.aimtell.com")}function _aimtellGetResolution(){var e="";return screen.width&&(e+=(screen.width||"")+" x "+(screen.height||"")),e}function _aimtellGetBrowserInfo(){navigator.appVersion;var e,t,i=navigator.userAgent,a=navigator.appName,n=""+parseFloat(navigator.appVersion),o=parseInt(navigator.appVersion,10);return-1!=(t=i.indexOf("Opera"))&&(a="Opera",n=i.substring(t+6),-1!=(t=i.indexOf("Version"))&&(n=i.substring(t+8))),-1!=(t=i.indexOf("OPR"))?(a="Opera",n=i.substring(t+4)):-1!=(t=i.indexOf("MSIE"))?(a="Microsoft Internet Explorer",n=i.substring(t+5)):-1!=(t=i.indexOf("Edge"))?(a="Edge",n=i.substring(t+5)):-1!=(t=i.indexOf("Chrome"))?(a="Chrome",n=i.substring(t+7)):-1!=(t=i.indexOf("Safari"))?(a="Safari",n=i.substring(t+7),-1!=(t=i.indexOf("Version"))&&(n=i.substring(t+8))):-1!=(t=i.indexOf("Firefox"))?(a="Firefox",n=i.substring(t+8)):-1!=i.indexOf("Trident/")?(a="Microsoft Internet Explorer",n=i.substring(i.indexOf("rv:")+3)):(e=i.lastIndexOf(" ")+1)<(t=i.lastIndexOf("/"))&&(a=i.substring(e,t),n=i.substring(t+1),a.toLowerCase()==a.toUpperCase()&&(a=navigator.appName)),-1!=(t=n.indexOf(";"))&&(n=n.substring(0,t)),-1!=(t=n.indexOf(" "))&&(n=n.substring(0,t)),-1!=(t=n.indexOf(")"))&&(n=n.substring(0,t)),o=parseInt(""+n,10),isNaN(o)&&(n=""+parseFloat(navigator.appVersion),o=parseInt(navigator.appVersion,10)),{browser:a,version:n,majorVersion:o}}function _aimtellGetSystemInfo(){var e,t=navigator.userAgent,i=navigator.appVersion,a="-",n=[{s:"Windows 10",r:/(Windows 10.0|Windows NT 10.0)/},{s:"Windows 8.1",r:/(Windows 8.1|Windows NT 6.3)/},{s:"Windows 8",r:/(Windows 8|Windows NT 6.2)/},{s:"Windows 7",r:/(Windows 7|Windows NT 6.1)/},{s:"Windows Vista",r:/Windows NT 6.0/},{s:"Windows Server 2003",r:/Windows NT 5.2/},{s:"Windows XP",r:/(Windows NT 5.1|Windows XP)/},{s:"Windows 2000",r:/(Windows NT 5.0|Windows 2000)/},{s:"Windows ME",r:/(Win 9x 4.90|Windows ME)/},{s:"Windows 98",r:/(Windows 98|Win98)/},{s:"Windows 95",r:/(Windows 95|Win95|Windows_95)/},{s:"Windows NT 4.0",r:/(Windows NT 4.0|WinNT4.0|WinNT|Windows NT)/},{s:"Windows CE",r:/Windows CE/},{s:"Windows 3.11",r:/Win16/},{s:"Android",r:/Android/},{s:"Open BSD",r:/OpenBSD/},{s:"Sun OS",r:/SunOS/},{s:"Linux",r:/(Linux|X11)/},{s:"iOS",r:/(iPhone|iPad|iPod)/},{s:"Mac OS X",r:/Mac OS X/},{s:"Mac OS",r:/(MacPPC|MacIntel|Mac_PowerPC|Macintosh)/},{s:"QNX",r:/QNX/},{s:"UNIX",r:/UNIX/},{s:"BeOS",r:/BeOS/},{s:"OS/2",r:/OS\/2/},{s:"Search Bot",r:/(nuhk|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask Jeeves\/Teoma|ia_archiver)/}];for(e in n){var o=n[e];if(o.r.test(t)){a=o.s;break}}var l="-";switch(/Windows/.test(a)&&(l=/Windows (.*)/.exec(a)[1],a="Windows"),a){case"Mac OS X":l=/Mac OS X ([\.\_\d]+)/.exec(t)[1];break;case"Android":l=/Android ([\.\_\d]+)/.exec(t)[1];break;case"iOS":l=(l=/OS (\d+)_(\d+)_?(\d+)?/.exec(i))[1]+"."+l[2]+"."+(0|l[3])}return{os:a,osVersion:l}}function _aimtellDebugger(e,t){var i={};switch(i.message=e,i.level=t||3,t){case 3:1==_aimtellDebug&&console.log("[aimtell] "+e);break;case 4:console.warn("[aimtell] "+e);break;case 5:console.error("[aimtell] "+e);break;default:1==_aimtellDebug&&console.log("[aimtell] "+e)}1==_aimtellGetUrlVars().aimtelldebug&&(aimtellDebugBox.style.display="block",_aimtellDebugQueue.push(i))}function _aimtellDebugQueueProcess(){0===_aimtellDebugQueueActive&&0<_aimtellDebugQueue.length?(_aimtellDebugQueueActive=1,_aimtellLogDebug(_aimtellDebugQueue[0].message,_aimtellDebugQueue[0].level).then(function(e){var t=new Date,i=t.getHours().toString(),a=t.getMinutes().toString(),t=12<=i?"pm":"am";1==(i="00"==(i=12[error] "),4==_aimtellDebugQueue[0].level&&(t=" [warning] ");a="
"+a+t+_aimtellDebugQueue[0].message+"
",t=document.getElementById("aimtellDebugBoxList");t.innerHTML=a+t.innerHTML,_aimtellDebugQueueActive=0,_aimtellDebugQueue.shift(),_aimtellDebugQueueProcess()})):setTimeout(function(){_aimtellDebugQueueProcess()},1e3)}function _aimtellLogDebug(n,o){return new Promise(function(t,e){var i=new XMLHttpRequest,a="https://log.aimtell.com/debug?type=trackpush";a+="&website_id="+_at.idSite,a+="&body="+n,a+="&log_level="+o,i.onreadystatechange=function(){var e;4==i.readyState&&(e=JSON.parse(i.responseText),t(e))},i.open("POST",a,!0),i.setRequestHeader("Content-Type","application/json;charset=UTF-8"),i.send()})}function _aimtellInitialize(){return _aimtellDebugger("Initializing."),_at.idSite?"denied"==_aimtellCheckPermissions()?(_aimtellDebugger("User has denied push"),_aimtellTrackData.optin.action=2,_aimtellTrack(_aimtellTrackData,["optin"]),!1):"granted"==_aimtellCheckPermissions()?(_aimtellDebugger("User has already granted permissions, updating visitor"),_aimtellSubscribe(!0,!1).catch(function(e){_aimtellDebugger(e)}),!1):_aimtellGetCookie("_aimtellPromptDenied")?(_aimtellDebugger("User has denied prompt"),!1):_aimtellGetCookie("_aimtellPromptApproved")?(_aimtellDebugger("User has approved prompt, but never opted into native. Try clearing cookies.",4),!1):(_aimtellDebugger("Getting config."),void _aimtellGetSiteConfig(_at.idSite).then(function(e){_aimtellPromptConfig(_aimtellPromptConfiguration=e),25865==_at.idSite&&(_aimtellDebugger("Enabling SPA optin support"),window.addEventListener("click",_aimtellSPAOptinHelper),window.addEventListener("keypress",function(e){"Enter"===e.key&&_aimtellSPAOptinHelper()}))}).catch(function(e){_aimtellDebugger(e)})):(_aimtellDebugger("[aimtell] - idSite must be set.",4),!1)}function _aimtellSPAOptinHelper(){window.location.href!=_aimtellCurrentPage&&"true"!=_aimtellGetCookie("_aimtellPromptDenied")&&"default"==_aimtellCheckPermissions()&&(_aimtellDebugger("Detected valid event, prompting configuration"),_aimtellPromptConfig(_aimtellPromptConfiguration),_aimtellCurrentPage=window.location.href)}function _aimtellPromptConfig(e){for(var t=0,i=0,a=null,n=null,o=null,l=null,r=null,s=(s=_aimtellGetPageDetails().pageURL).replace(/(\/#|\/|#)$/,""),c=_aimtellGetDeviceType(),m=_aimtellGetBrowserInfo().browser.toLowerCase(),u=0;u>>0).toString(16)).substr(-8):a>>>0}function _aimtellTrackAttributes(t){Object.keys(t).forEach(function(e){_aimtellTrackData.attribute[e]=t[e]}),_aimtellTrack(_aimtellTrackData,["attribute"])}function _aimtellForcePrompt(){if("granted"==_aimtellCheckPermissions()||"denied"==_aimtellCheckPermissions())return!1;var e=document.getElementById("aimtellPrompt");void 0!==e&&null!=e&&(_aimtellDebugger("Showing Custom Prompt "),document.getElementById("aimtellPrompt").style.display="block")}function _aimtellPrompt(){if("granted"==_aimtellCheckPermissions()||"denied"==_aimtellCheckPermissions())return!1;if(_aimtellGetCookie("_aimtellPromptDenied"))return _aimtellDebugger("User has denied prompt"),!1;var e=document.getElementById("aimtellPrompt");void 0!==e&&null!=e?(_aimtellDebugger("Showing Custom Prompt "),document.getElementById("aimtellPrompt").style.display="block"):(_aimtellDebugger("Loading Native Prompt "),_aimtellRunNative())}function _aimtellAlias(e){var t={};t.id_site=_aimtellTrackData.id_site,t.subscriber_uid=_aimtellTrackData.subscriber_uid,t.alias=e,_aimtellTrack(t,["alias"])}function _aimtellTrackEvent(e,t,i,a,n){if(0==_aimtellSupportsPush())return!1;_aimtellDebugger("Track Event Sent "),_aimtellTrackData.event.category=e,_aimtellTrackData.event.action=t,delete _aimtellTrackData.event.variables,i&&(_aimtellTrackData.event.label=i),a&&(_aimtellTrackData.event.value=a),n&&(_aimtellTrackData.event.variables=n),_aimtellTrack(_aimtellTrackData,["event"])}function _aimtellAbandonedCart(e,t,i){if(0==_aimtellSupportsPush())return!1;if(null==e)return!1;var a={};a.type=e,t&&(a.delay=t),i&&(a.variables=i),a.idSite=_at.idSite,a.owner_uid=_at.owner,a=JSON.stringify(a),(i=new XMLHttpRequest).open("POST",_aimtellAPI+"/subscriber/"+_at.subscriber+"/cart",!0),i.setRequestHeader("Content-Type","text/plain;charset=UTF-8"),i.setRequestHeader("Aimtell-Track-Source","js"),i.send(a),_aimtellDebugger("Abandoned Cart Data Sent ")}function _aimtellTc(n,o,l){return new Promise(function(t,i){var a=new XMLHttpRequest;a.onreadystatechange=function(){var e;4==a.readyState&&(404==a.status?i("[aimtell] - Unable to track."):(e=JSON.parse(a.responseText),t(e)))};var e={};e.subscriber_uid=o,e.logid=n,e.redirect_url=l,e=JSON.stringify(e),a.open("POST",_aimtellAPI+"/push/click/"+n,!0),a.setRequestHeader("Content-Type","text/plain;charset=UTF-8"),a.setRequestHeader("Aimtell-Track-Source","js"),a.send(e)})}void 0===_at.webpushid&&(_at.webpushid="web.aimtell.com"),_at.webpushid=_at.webpushid.replace("apple.com","aimtell.com"),void 0===_at.worker?_at.worker=window.location.origin+"/aimtell-worker.js":_aimtellUserDefinedWorker=_at.worker,13808==_at.idSite&&(_at.worker="/aimtell-worker.js"),"/wp-content/plugins/aimtell-web-push-notifications/assets/json/aimtell-manifest.json"==_at.manifest&&(_at.manifest="https://cdn.aimtell.com/manifest/"+_at.idSite+".json"),!1!==_at.showCredit&&console.log("Push notifications powered by Aimtell. Learn more at https://aimtell.com/developers"),1!=_aimtellGetUrlVars().aimtelldebug&&!0!==_at.debug||(_aimtellDebug=1,(aimtellDebugBox=document.createElement("DIV")).setAttribute("id","aimtellDebugBox"),aimtellDebugBox.innerHTML="
Aimtell Debugger v1.5
",aimtellDebugBox.style.display="none",document.body.appendChild(aimtellDebugBox),_aimtellDebugQueueProcess()),_aimtellDeferred.prototype={execute:function(e,t){var i=e.length;for(t=Array.prototype.slice.call(t);i--;)e[i].apply(null,t)},resolve:function(){this.execute(this._done,arguments)},reject:function(){this.execute(this._fail,arguments)},done:function(e){this._done.push(e)},fail:function(e){this._fail.push(e)}};var logid,subscriber_uid,webURL=_aimtellGetUrlVars().atlink;function _aimtellGetPushToken(){return new Promise(function(t,e){_aimtellPushToken=null,0==_aimtellSupportsPush()&&t(_aimtellPushToken),_aimtellServiceWorker.pushManager.getSubscription().then(function(e){e&&(_aimtellPushToken=_aimtellExtractSubscriptionId(e.endpoint)),t(_aimtellPushToken)}).catch(function(e){_aimtellDebugger(e),t(_aimtellPushToken)})})}function _aimtellSupportsPush(){var e=!1;return"Safari"==_aimtellGetBrowserInfo().browser&&window.top!==window&&(e=!0),"serviceWorker"in navigator&&(e=!0,"showNotification"in ServiceWorkerRegistration.prototype||(e=!1),"PushManager"in window||(e=!1),0==_aimtellCheckHTTPS()&&(e=!1)),"Promise"in window||(e=!1),"Edge"==_aimtellGetBrowserInfo().browser&&void 0!==_aimtellWebsiteConfiguration&&null!=_aimtellWebsiteConfiguration&&"vapid"!=_aimtellWebsiteConfiguration.type&&(e=!1),e}function _aimtellCheckHTTPS(){var e=!1;return"https:"==window.location.protocol&&(e=!0),e}function _aimtellListener(e,t,i){e.addEventListener(t,i)}function _webpushCheckPermissions(){return _aimtellCheckPermissions()}function _webpushSupportsPush(){return _aimtellSupportsPush()}function _webpushPrompt(){_aimtellPrompt()}function _webpushRunNative(){_aimtellRunNative()}function _webpushGetSubscriberIDFromToken(i){return new Promise(function(t,e){aimtellGetSubscriberIDFromToken(i).then(function(e){t(e)})})}function _webpushTrackAttributes(e){_aimtellTrackAttributes(e)}function _webpushGetToken(){return new Promise(function(t,e){_aimtellGetPushToken().then(function(e){t(e)})})}function _webpushTrackEvent(e,t,i,a){_aimtellTrackEvent(e,t,i,a)}function _webpushGetSubscriberID(){return new Promise(function(t,e){_aimtellGetSubscriberID().then(function(e){t(e)})})}function _aimtellCheckPermissions(){return"y"==_aimtellGetCookie("_aimtellUnsubscribed")?"denied":"Notification"in window&&"permission"in window.Notification?Notification.permission:void 0}function _aimtellRunNative(){if(0==_aimtellSupportsPush())return _aimtellDebugger("Browser doesn't support push"),!1;"serviceWorker"in navigator&&_aimtellSubscribe(!0,!0).catch(function(e){_aimtellDebugger(e)})}function _aimtellDelWidgetNotification(e){document.getElementById("webwidget-notification-"+e).remove();document.getElementById("notification-badge");_aimtellCheckNotificationRemaining()}function _aimtellDelAllWidgetNotification(){document.getElementById("webwidget-body").innerHTML="",_aimtellShowNoNotifications()}function _aimtellCheckNotificationRemaining(){var e=document.getElementsByClassName("webwidget-notification");document.getElementById("notification-badge-count").innerHTML=e.length,document.getElementById("notification-badge").style.opacity=1,0==e.length&&(_aimtellShowNoNotifications(),document.getElementById("notification-badge").style.opacity=0)}function _aimtellClickedNotification(e,t,i){_aimtellDelWidgetNotification(e),window.open(t)}function _aimtellShowNotificationCenter(){document.getElementById("notification-icon").className="transition-hide",document.getElementById("notification-icon-close").className="transition-show",document.getElementById("webwidget-content").className="show-widget-contents"}function _aimtellHideNotificationCenter(){document.getElementById("notification-icon").className="transition-show",document.getElementById("notification-icon-close").className="transition-hide",document.getElementById("webwidget-content").className="hide-widget-contents"}function _aimtellAppendNotification(e,t,i,a,n){var o='
';o+='
X
',o+='
',o+='',o+="
",o+='
',o+=''+t+"",o+=''+i+"",o+="
",o+="
",document.getElementById("webwidget-body").innerHTML+=o}function _aimtellShowNoNotifications(){document.getElementById("webwidget-body").innerHTML='
No new notifications, check back later!
',document.getElementById("notification-badge").style.opacity=0}function _aimtellShowNotSubscribed(){document.getElementById("webwidget-body").innerHTML='
You are not currently subscribed.
Click to subscribe
'}function _aimtellLaunchNotificationCenter(){var e=document.createElement("style");e.innerHTML="#webwidget{width:70px;height:70px;position:fixed;bottom:25px;left:25px;border-radius:50%;background-color:#3cba5d;display:block;box-shadow:0 1px 6px rgba(0,0,0,.15),0 2px 32px rgba(0,0,0,.15)!important}#webwidget:hover{box-shadow:0 1px 6px rgba(0,0,0,.20),0 2px 32px rgba(0,0,0,.20)!important;cursor:pointer}#webwidget #notification-badge{display:block;position:absolute;right:0;top:0;background-color:#e95269;color:#FFF;border-radius:50%;width:25px;height:25px;opacity:0}#webwidget #notification-badge span{display:block;margin:0 auto;text-align:center;margin-top:2px}#webwidget #notification-icon,#webwidget #notification-icon-close{position:absolute;left:17px;top:17px}#webwidget #notification-icon{opacity:1;z-index:9}#webwidget #notification-icon-close{opacity:0}#webwidget .transition-show{opacity:1!important;z-index:9;-webkit-transition:opacity .2s ease-in-out;-moz-transition:opacity .2s ease-in-out;-o-transition:opacity .2s ease-in-out;transition:opacity .2s ease-in-out;-webkit-transition:.3s ease-in-out;-moz-transition:.3s ease-in-out;-o-transition:.3s ease-in-out;transition:.3s ease-in-out;-webkit-transform:rotate(45deg);-moz-transform:rotate(45deg);-o-transform:rotate(45deg);transform:rotate(0deg)}#webwidget .transition-hide{opacity:0!important;z-index:8;-webkit-transition:opacity .2s ease-in-out;-moz-transition:opacity .2s ease-in-out;-o-transition:opacity .2s ease-in-out;transition:opacity .2s ease-in-out;-webkit-transition:.3s ease-in-out;-moz-transition:.3s ease-in-out;-o-transition:.3s ease-in-out;transition:.3s ease-in-out;-webkit-transform:rotate(45deg);-moz-transform:rotate(45deg);-o-transform:rotate(45deg);transform:rotate(45deg)}#webwidget #notification-icon-close{left:28px;top:20px;font-size:22px;color:#FFF}#webwidget-content{opacity:0;-webkit-transition:opacity .2s ease-in-out;-moz-transition:opacity .2s ease-in-out;-o-transition:opacity .2s ease-in-out;transition:opacity .2s ease-in-out;height:500px;width:350px;display:block;background-color:#FFF;position:absolute;top:-515px;left:25px;border-radius:10px}#webwidget-content.show-widget-contents{opacity:1!important}#webwidget-content.hide-widget-contents{opacity:0!important}#webwidget-content-header{background-color:#3cba5d;color:#FFF;padding:20px}#webwidget-content-header span{display:block;font-size:16px}#webwidget #webwidget-content #webwidget-pushbell img{display:block;margin:0 auto;margin-top:25px}#webwidget #webwidget-content #webwidget-pushbell{padding:20px}#webwidget #webwidget-content #webwidget-pushbell span{display:block;text-align:center;padding-top:15px}#webwidget #webwidget-content #webwidget-pushbell #webwidget-subscribe span{display:block;text-align:center;padding:10px;background:#428bca;border-radius:2px;margin:0 auto;color:#FFF;width:175px;cursor:pointer;margin-top:15px}#webwidget-footer{position:absolute;bottom:10px;margin:0 auto;display:block;border-top:1px solid #E9E9E9;padding-top:10px;width:100%}#webwidget-footer span,#webwidget-footer a{display:block;text-align:center;font-size:12px;color:#615d5d}.webwidget-notification{border-top:1px solid #f7f5f5;position:relative}.webwidget-notification-del{position:absolute;top:5px;right:5px;cursor:pointer;z-index:10;color:#f7f5f5}.webwidget-notification-del:hover{color:#e95269}.webwidget-notification:hover{background:#f7f5f5;cursor:pointer}.webwidget-notification img{display:block;margin:0 auto;max-width:100%}.webwidget-notification .webwidget-notification-img{display:inline-block;float:left;width:25%;padding:15px}.webwidget-notification .webwidget-notification-text{display:inline-block;width:75%;padding:15px 15px 15px 0}.webwidget-notification .webwidget-notification-text span{display:block}.webwidget-notification .webwidget-notification-text span.webwidget-notification-title{font-weight:500}#webwidget-clearall{display:block;margin:0 auto;text-align:center;color:#E9E9E9}",document.body.appendChild(e);e=document.createElement("div");e.setAttribute("id","aimtellNotificationCenter"),e.innerHTML='
X
3
Notifications
',document.body.appendChild(e),"granted"==_aimtellCheckPermissions()?_aimtellGetWidgetNotifications().then(function(e){_aimtellFillNotifications(e)}):_aimtellShowNotSubscribed()}function _aimtellGetWidgetNotifications(){return new Promise(function(e,t){var i,a,n=new XMLHttpRequest;n.onreadystatechange=function(){4==n.readyState&&(404==n.status||(JSON.parse(n.responseText),e(n.responseText)))},"undefined"!=typeof _at&&void 0!==_at.subscriber&&(i=_at.idSite,a=_at.subscriber,n.open("GET","https://api.aimtell.com/prod/widget/notifications/"+i+"/"+a,!0),n.send(null))})}function _aimtellFillNotifications(e){if((e=JSON.parse(e)).length<1)return _aimtellShowNoNotifications(),!1;var t=e.length;document.getElementById("webwidget-body").innerHTML="";for(var i=0;i - clear all - ",_aimtellCheckNotificationRemaining()}function _aimtellWidgetPermissionGrantedCallback(){_aimtellShowNoNotifications()}function _aimtellPermissionDeniedCallbacks(){_aimtellDebugger("Running Permission Denied Callbacks"),"undefined"!=typeof _aimtellPermissionDenied&&_aimtellPermissionDenied(),_aimtellLoadBeacon(2)}function _aimtellPermissionIgnoredCallbacks(){_aimtellDebugger("Running Permission Ignored Callbacks"),"undefined"!=typeof _aimtellPermissionIgnored&&_aimtellPermissionIgnored()}function _aimtellWebhook(e,t,i){var a=e.includes("?")?"&":"?";e+=a+"id_site="+t,e+="&subscriber_uid="+i,_aimtellDebugger("Webhook sent "+(e=(e+="&webhook_source=aimtell.com").replace(/{country}/g,_aimtellSubscriberGEO))),fetch(e,{method:"POST",mode:"no-cors",redirect:"follow"})}function _aimtellPermissionGrantedCallbacks(){if(_aimtellDebugger("Running Permission Granted Callbacks"),"undefined"!=typeof _aimtellPermissionGranted&&_aimtellPermissionGranted(),void 0!==_aimtellWebsiteConfiguration&&void 0!==_aimtellWebsiteConfiguration.webhooks&&0<_aimtellWebsiteConfiguration.webhooks.length)for(var e=0;e<_aimtellWebsiteConfiguration.webhooks.length;e++)"new_subscriber"==_aimtellWebsiteConfiguration.webhooks[e].type&&_aimtellWebhook(_aimtellWebsiteConfiguration.webhooks[e].url,_at.idSite,_at.subscriber);_aimtellLoadBeacon(1),void 0!==_aimtellWidgetPermissionGrantedCallback&&null!=document.getElementById("webwidget")&&_aimtellWidgetPermissionGrantedCallback(),0<_aimtellPreSubscriberTrackData.length&&_aimtellProcessQueue(_aimtellPreSubscriberTrackData)}function _aimtellSubscribe(a,n){return a=void 0===a||a,n=void 0!==n&&n,"Firefox"==_aimtellGetBrowserInfo().browser&&(a=!1),_aimtellDebugger("Running subscription with vars: subscribe_on_fail="+a+" initial_request="+n),new Promise(function(t,i){var e={userVisibleOnly:!0};"vapid"==_aimtellWebsiteConfiguration.type&&(e.applicationServerKey=_aimtellUrlBase64ToUint8Array(_aimtellWebsiteConfiguration.pub)),_aimtellDebugger("Worker is ready."),_aimtellServiceWorker.pushManager.subscribe(e).then(function(e){_aimtellDebugger("Subscription successful"),(n||_aimtellNewSubscriberID)&&(_aimtellPermissionGrantedCallbacks(),_aimtellSetCookie("_aimtellSubscriptionURL",window.location.href,1)),_aimtellSendSubscriptionToServer(e),t(e)}).catch(function(e){"denied"===Notification.permission?(_aimtellDebugger("Chrome permission denied"),_aimtellTrackData.optin.action=2,_aimtellTrack(_aimtellTrackData,["optin"]),n&&_aimtellPermissionDeniedCallbacks(),i("Denied Permission")):"default"===Notification.permission?n&&_aimtellPermissionIgnoredCallbacks():(_aimtellDebugger("Unable to subscribe to push, considering retry logic. Error: "+e.message),_aimtellLogError("Unable to subscribe to push, considering retry logic. Error: "+e.message,2),a?(_aimtellDebugger("Allow Force Subscribe On Fail Active"),_aimtellServiceWorker.pushManager.getSubscription().then(function(e){return e?void e.unsubscribe().then(function(e){_aimtellDebugger("Unsubscribed"),_aimtellSubscribe(!1).then(function(e){t(e)}).catch(function(e){_aimtellLogError(e,2),_aimtellDebugger(e),i(e)})}):(_aimtellDebugger("Unable to unsubscribe without active subscription"),!1)})):i(e.message))})})}function _aimtellUrlBase64ToUint8Array(e){for(var e=(e+"=".repeat((4-e.length%4)%4)).replace(/-/g,"+").replace(/_/g,"/"),t=window.atob(e),i=new Uint8Array(t.length),a=0;a