window.vfct = window.vfct || {a:{},c:{},f:{},e:{},l:{},s:{},o:{},t:{},v:{}};
vfct.f.uptimeLoopFunction = async function(){
    if(!snUptime)return false;
    if(!Array.isArray(snUptime))return false;
    let loop = snUptime.filter(item => !item.sent);
    loop.forEach(item => {
        vfct.f.uptimeLoopSubmit(item);
        item.sent = true;
    });
};
vfct.f.uptimeLoopSubmit = async function(item){
    // Default options are marked with *
    let form = new FormData();
    if(item.host)form.append('host',item.host);
    if(item.client)form.append('client',item.client);
    if(item.tag)form.append('tag',item.tag);

    const response = await fetch(`https://uptime.searchnitro.io`, {
        method: "POST", // *GET, POST, PUT, DELETE, etc.
        body: form, // body data type must match "Content-Type" header
    });
    return response.json(); // parses JSON response into native JavaScript objects  
}
vfct.f.uptimeLoopInterval = setInterval(vfct.f.uptimeLoopFunction,5000);