\n\tSign in with Smartlist\n\n`;n.innerHTML=i,document.getElementById(e).addEventListener("click",(()=>{if(!0===t.popup)var n=(({url:n,title:t,w:e,h:i})=>{const o=void 0!==window.screenLeft?window.screenLeft:window.screenX,r=void 0!==window.screenTop?window.screenTop:window.screenY,a=window.innerWidth?window.innerWidth:document.documentElement.clientWidth?document.documentElement.clientWidth:screen.width,s=window.innerHeight?window.innerHeight:document.documentElement.clientHeight?document.documentElement.clientHeight:screen.height,d=a/window.screen.availWidth,w=(a-e)/2/d+o,l=(s-i)/2/d+r,p=window.open(n,t,`\nscrollbars=yes,\nwidth=${e/d}, \nheight=${i/d}, \ntop=${l}, \nleft=${w}\n`);return window.focus&&p.focus(),p})({url:`https://smartlist.ga/dashboard/login.php?auth=true&appId=${t.appId}&close`,title:"xtf",w:window.innerWidth/2.5,h:window.innerHeight/2}),e=setInterval((function(){if(n.closed){if(clearInterval(e),!t.callback)throw new Error("Must specify callback if popup is enabled");t.callback(!0)}}),200);else window.location.href=`https://smartlist.ga/dashboard/login.php?auth=true&appId=${t.appId}`}))}}
var button = new SmartlistApiButton(document.getElementById('loginBTN'), {
appId: "c0033b5f5a4815a172984d64037dd49a8663fb8b3a71e47f11ecd332c8c3819c57e1631fdf46d66c6ff0e58763a61529fefcfa2a6675e186ee901e5452fedd94",
callback() {
/**
* We'll redirect to the oAuth URI with the token. Use window.close() to close the login window after authorization is complete
* Make sure to verify the session is valid after the popup is closed!
*/
console.log("Closed popup")
}
})
if (localStorage.theme === 'dark' || (!('theme' in localStorage) && window.matchMedia('(prefers-color-scheme: dark)').matches)) {
document.documentElement.classList.add('dark')
} else {
document.documentElement.classList.remove('dark')
}
function onSignIn(googleUser) {
var id_token = googleUser.getAuthResponse().id_token;
var xhr = new XMLHttpRequest();
xhr.open('POST', `https://visionly.manuthecoder.repl.co/google-auth?idtoken=${id_token}`);
// xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
xhr.onload = function() {
window.location.reload()
console.log('Signed in as: ' + xhr.responseText);
};
xhr.send('idtoken=' + id_token);
}