import{s as p}from"./chunk-DKjNeJAl.js";const a=new URLSearchParams(location.search),e=a.get("name")??"",g=a.get("error")??"Unknown error",c=a.get("path")??"/",E=a.get("search")??"",$=a.get("hash")??"",k=document.getElementById("reason"),h=document.getElementById("urlinput");k.textContent=g;const u=document.getElementById("ensHistory");e&&/^(?:[a-z0-9-]+\.)+eth$/.test(e)&&(u.href=`https://ens.eth.sh/history/${e}`,u.hidden=!1);document.title=e?`${e} · resolution failed`:"dapp3.eth · resolution failed";function y(){if(!/^(?:[a-z0-9-]+\.)+eth$/.test(e))return null;const t=c.startsWith("/")?c:`/${c}`;return`https://${e}.limo${t}${E}${$}`}const b=document.getElementById("fallback"),d=document.getElementById("ethlimo-link"),l=y();l&&(d.href=l,b.hidden=!1,d.addEventListener("click",t=>{t.preventDefault(),chrome.runtime.sendMessage({type:"open-on-eth-limo",url:l}).catch(()=>{location.assign(l)})}));function m(t){const n=t.trim().replace(/^https?:\/\//i,"");if(!n)return null;const r=n.match(/^([^\/\?#]+)(.*)$/);if(!r||!r[1])return null;const i=r[1].toLowerCase(),s=r[2]||"/";if(!/^(?:[a-z0-9-]+\.)+eth$/.test(i))return null;const f=s.startsWith("/")||s.startsWith("?")||s.startsWith("#")?s:`/${s}`;return`http://${i}${f}`}const o=p(h,{placeholder:"name.eth",onSubmit:t=>{const n=m(t);if(!n){o.shake();return}location.assign(n)},onEscape:()=>{o.setValue(e),h.blur()}});o.setValue(e);document.getElementById("retry")?.addEventListener("click",()=>{const t=m(o.getValue());if(!t){o.shake();return}location.assign(t)});document.getElementById("settings")?.addEventListener("click",()=>{chrome.runtime.openOptionsPage()});
//# sourceMappingURL=error-CI9TrnB6.js.map
