Skip to content

Open-source AI browser agent for Chrome and Firefox (monorepo) 🧠

2.2 KB
Raw Blame
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./boot-gChjRm3a.js","./boot-B1RLyG3v.css"])))=>i.map(i=>d[i]);
const g=(function(){const e=typeof document<"u"&&document.createElement("link").relList;return e&&e.supports&&e.supports("modulepreload")?"modulepreload":"preload"})(),w=function(t,e){return new URL(t,e).href},p={},y=function(e,n,d){let f=Promise.resolve();if(n&&n.length>0){let b=function(r){return Promise.all(r.map(a=>Promise.resolve(a).then(c=>({status:"fulfilled",value:c}),c=>({status:"rejected",reason:c}))))};const i=document.getElementsByTagName("link"),o=document.querySelector("meta[property=csp-nonce]"),m=o?.nonce||o?.getAttribute("nonce");f=b(n.map(r=>{if(r=w(r,d),r in p)return;p[r]=!0;const a=r.endsWith(".css"),c=a?'[rel="stylesheet"]':"";if(d)for(let l=i.length-1;l>=0;l--){const u=i[l];if(u.href===r&&(!a||u.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${r}"]${c}`))return;const s=document.createElement("link");if(s.rel=a?"stylesheet":g,a||(s.as="script"),s.crossOrigin="",s.href=r,m&&s.setAttribute("nonce",m),document.head.appendChild(s),a)return new Promise((l,u)=>{s.addEventListener("load",l),s.addEventListener("error",()=>u(new Error(`Unable to preload CSS for ${r}`)))})}))}function h(i){const o=new Event("vite:preloadError",{cancelable:!0});if(o.payload=i,window.dispatchEvent(o),!o.defaultPrevented)throw i}return f.then(i=>{for(const o of i||[])o.status==="rejected"&&h(o.reason);return e().catch(h)})},E="newTabEnabled",_="chrome://new-tab-page/",A="chrome-search://local-ntp/local-ntp.html",T=t=>{const e=t.navigator;return e?e.userAgentData?.brands?.some(n=>/microsoft edge/i.test(n?.brand||""))?!0:/\bEdg(e|A|iOS)?\//.test(e.userAgent||""):!1},L=t=>typeof t.browser<"u"&&typeof t.browser?.sidebarAction?.open=="function"||typeof t.chrome>"u"||!t.chrome?.runtime?.id?null:{api:t.chrome,url:T(t)?A:_};async function v(t=globalThis){const e=L(t);if(!e)return!0;try{if((await e.api.storage.local.get(E))?.[E]===!0)return!0}catch{return!0}try{const n=await e.api.tabs.getCurrent();return!n||n.id==null?!0:(await e.api.tabs.update(n.id,{url:e.url}),!1)}catch{return!0}}v().then(t=>t?y(()=>import("./boot-gChjRm3a.js").then(e=>e.aB),__vite__mapDeps([0,1]),import.meta.url):null);export{y as _};