const m=document.getElementById("go"),s=document.getElementById("target"),d=document.getElementById("hint");function h(t){const e=t.trim().replace(/^https?:\/\//i,"").replace(/^\/+/,"");if(!e)return null;const r=e.match(/^([^\/\?#]+)(.*)$/);if(!r||!r[1])return null;const n=r[1].toLowerCase().replace(/:\d+$/,""),i=r[2]||"",a=i.startsWith("/")||i.startsWith("?")||i.startsWith("#")||i===""?i:`/${i}`;if(/^0x[a-f0-9]{40}$/.test(n))return{kind:"address",address:n,rest:a};const o=n.match(/^(0x[a-f0-9]{40})\.w3eth\.io$/);if(o&&o[1])return{kind:"address",address:o[1],rest:a};const c=n.match(/^(0x[a-f0-9]{40})\.1\.w3link\.io$/);if(c&&c[1])return{kind:"address",address:c[1],rest:a};const u=n.match(/^((?:[a-z0-9-]+\.)+eth)\.(?:limo|link)$/);if(u&&u[1])return{kind:"ens",host:u[1],rest:a};const l=n.match(/^((?:[a-z0-9-]+\.)+gwei)\.domains$/);return l&&l[1]?{kind:"ens",host:l[1],rest:a}:/^(?:[a-z0-9-]+\.)+(?:eth|gwei)$/.test(n)?{kind:"ens",host:n,rest:a}:null}function f(t){const e=t.rest||"/";return t.kind==="ens"?`http://${t.host}${e}`:`https://${t.address}.w3eth.io${e}`}function g(t){d.textContent=t,d.hidden=!1,s.classList.add("invalid"),setTimeout(()=>{s.classList.remove("invalid")},450)}function $(){d.textContent="",d.hidden=!0}s.addEventListener("input",()=>{d.hidden||$()});m.addEventListener("submit",t=>{t.preventDefault();const e=h(s.value);if(!e){g("Couldn't parse that. Try `name.eth`, `name.gwei`, or a 0x… contract address."),s.focus(),s.select();return}location.assign(f(e))});document.querySelectorAll(".chip[data-target]").forEach(t=>{t.addEventListener("click",()=>{const e=t.dataset.target??"";if(!e)return;s.value=e;const r=h(e);r&&location.assign(f(r))})});s.focus();
//# sourceMappingURL=home-E_gev2pb.js.map
