PageSourceSearch

https://modrinth.com/_nuxt/sMJrh_8O.js

js modrinth.com collected 2026-09-24 09:07:55 UTC 2,281 bytes, 1 lines download raw bytes

1import{d as _,aU as w,c as f,w as S,a as v,b as r,q as m,v as c,k as e,b3 as V,j as b,p as g,n as h,m as $,bN as C,Q as u,o as p,bp as N,aJ as z,S as B,_ as E,b1 as L,d1 as T}from"./DvgxvNL0.js";import{A}from"./B0nhbelq.js";import"./DG1csYqL.js";import"./C0jx6QEY.js";import"./BYO7PYqm.js";const I={class:"flex flex-col gap-2"},M={key:0,class:"text-sm font-medium text-red"},R=_({__name:"lookup",setup(U){const x=w(),t=u(""),d=u(!1),l=u(!1),n=u(""),s=f(()=>t.value.trim().replace(/\.modrinth\.gg$/i,"").toLowerCase()),i=f(()=>{if(!s.value)return"Enter a server subdomain.";if(s.value.length>63)return"Subdomain must be 63 characters or fewer.";if(!/^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$/.test(s.value))return"Use only letters, numbers, and hyphens, without a leading or trailing hyphen."});S(t,o=>{const a=o.replace(/\.modrinth\.gg$/i,"");a!==o&&(t.value=a),n.value=""});async function k(){if(!l.value&&(d.value=!0,n.value="",!i.value)){t.value=s.value,l.value=!0;try{const o=await x.archon.servers_internal.getBySubdomain(s.value);await L(`/hosting/manage/${o.id}`)}catch(o){o instanceof T&&o.statusCode===404?n.value=`No server was found for ${s.value}.modrinth.gg.`:n.value="The server could not be looked up. Try again."}finally{l.value=!1}}}return(o,a)=>(p(),v("div",null,[a[3]||(a[3]=r("h2",{class:"m-0 mb-4 text-2xl font-semibold"},"Server lookup",-1)),r("form",{class:"card flex flex-col gap-3",onSubmit:C(k,["prevent"])},[r("div",I,[a[1]||(a[1]=r("label",{for:"server-subdomain"},[r("span",{class:"text-lg font-semibold text-contrast"},[m(" Server subdomain "),r("span",{class:"text-brand-red"},"*")])],-1)),c(e(z),{id:"server-subdomain",modelValue:e(t),"onUpdate:modelValue":a[0]||(a[0]=y=>V(t)?t.value=y:null),icon:e(N),error:e(d)&&!!e(i),placeholder:"example or example.modrinth.gg",autocomplete:"off",autocapitalize:"none",spellcheck:!1},null,8,["modelValue","icon","error"]),e(d)&&e(i)?(p(),v("span",M,b(e(i)),1)):g("",!0)]),r("div",null,[c(e(E),{type:"colored",color:"brand","native-type":"submit",loading:e(l)},{default:h(()=>[c(e(B),{"aria-hidden":"true"}),a[2]||(a[2]=m(" Look up server ",-1))]),_:1},8,["loading"])]),e(n)?(p(),$(e(A),{key:0,type:"critical",header:"Lookup failed"},{default:h(()=>[m(b(e(n)),1)]),_:1})):g("",!0)],32)]))}});export{R as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.