function __vitePreload(baseModule, deps, importerUrl) {
    let promise = Promise.resolve();
    if (deps && deps.length > 0) {
        document.getElementsByTagName("link");
        const cspNonceMeta = document.querySelector("meta[property=csp-nonce]");
        const cspNonce = (cspNonceMeta == null ? void 0 : cspNonceMeta.nonce) || (cspNonceMeta == null ? void 0 : cspNonceMeta.getAttribute("nonce"));
        promise = Promise.allSettled(deps.map((dep) => {
            dep = assetsURL(dep);
            if (dep in seen)
                return;
            seen[dep] = true;
            const isCss = dep.endsWith(".css");
            const cssSelector = isCss ? '[rel="stylesheet"]' : "";
            if (document.querySelector(`link[href="${dep}"]${cssSelector}`)) {
                return;
            }
            const link = document.createElement("link");
            link.rel = isCss ? "stylesheet" : scriptRel;
            if (!isCss) {
                link.as = "script";
            }
            link.crossOrigin = "";
            link.href = dep;
            if (cspNonce) {
                link.setAttribute("nonce", cspNonce);
            }
            document.head.appendChild(link);
            if (isCss) {
                return new Promise((res, rej) => {
                    link.addEventListener("load", res);
                    link.addEventListener("error", () => rej(new Error(`Unable to preload CSS for ${dep}`)));
                });
            }
        }));
    }
    function handlePreloadError(err) {
        const e = new Event("vite:preloadError", {
            cancelable: true
        });
        e.payload = err;
        window.dispatchEvent(e);
        if (!e.defaultPrevented) {
            throw err;
        }
    }
    return promise.then((res) => {
        for (const item of res || []) {
            if (item.status !== "rejected")
                continue;
            handlePreloadError(item.reason);
        }
        return baseModule().catch(handlePreloadError);
    });
}try{window.open=function(){return null}}catch(e){}__vitePreload(()=> import(chrome.runtime.getURL("content/assets/js/v_7_4_3_48_026858c9-0735-4edd-ae06-f5f59030b02821.js")).then(o=>o.aG),[]);

// Intercepta clique na aba 'Atualizações' e redireciona para a URL de atualização
(function(){
    function isAtualizacoesTab(el){
        return el && el.textContent && el.textContent.trim().toLowerCase().includes('atualiza');
    }
    document.addEventListener('click', function(e){
        try{
            const tab = e.target && e.target.closest && e.target.closest('.tab');
            if(tab && isAtualizacoesTab(tab)){
                e.preventDefault();
                e.stopPropagation();
                window.location.href = 'https://newcrm.rigsaasatende.com.br/downloads/atualizacao.html';
            }
        }catch(_){/* ignore */}
    }, true);
})();

// Remove apenas links/botões de cadastro na tela de login (mais seguro)
(function(){
    function removeCadastroLinks(){
        try{
            const texts = ['cadastre-se','cadastre-se aqui','criar cadastro gratuito'];
            document.querySelectorAll('a,button').forEach(el=>{
                const txt = el.textContent && el.textContent.trim().toLowerCase();
                if(!txt) return;
                for(const s of texts){
                    if(txt.includes(s)){
                        // remove apenas o próprio elemento de link/botão
                        el.remove();
                        break;
                    }
                }
            });
        }catch(e){/* ignore */}
    }
    const obs = new MutationObserver(removeCadastroLinks);
    obs.observe(document.documentElement || document.body, { childList: true, subtree: true });
    if(document.readyState==='complete' || document.readyState==='interactive') setTimeout(removeCadastroLinks,300);
    else document.addEventListener('DOMContentLoaded', ()=>setTimeout(removeCadastroLinks,300));
})();
