const v="https://stealthmodels.com",l=e=>String(e??"").replace(/[&<>"']/g,t=>({"&":"&","<":"<",">":">",'"':""","'":"'"})[t]),p=(e,t)=>String(e).replace(/\{(\w+)\}/g,(a,s)=>t[s]??""),g=(e,t)=>Number.isFinite(e)?e.toFixed(1):t.notScored,I=e=>{const t=new Date(/^\d{4}-\d{2}-\d{2}$/.test(e)?`${e}T00:00:00Z`:e);return Number.isNaN(t.getTime())?"":new Intl.DateTimeFormat("en-GB",{day:"numeric",month:"long",year:"numeric",timeZone:"UTC"}).format(t)},b=e=>{try{const t=new URL(e,v);return t.hostname!=="stealthmodels.com"?e:(t.searchParams.set("utm_source","huggingface"),t.searchParams.set("utm_medium","referral"),t.searchParams.set("utm_campaign","stealthmark-space"),t.toString())}catch{return e}},x='target="_blank" rel="noopener noreferrer"',_=e=>String(e).split("/").pop(),f=e=>` \xB7 ${l(e)}`,T='',$=(e,t,a="",s="")=>`${t}`,O=e=>e?.favicon||e?.logo||"",P=(e,t)=>e?t&&t.length&&!t.includes(e)?v+e:e:"",R=(e,t)=>{const a=O(e);return`${a?``:''}`},h=(e,t,a,s,n=!1)=>$(t||e.detailUrl,`${R(e,s)}${l(e.name)}${T}`,`lockup lockup--${a}`,` data-model="${l(e.id)}"`);function U(e,t){const a=[];return e.router==="confirmed"&&a.push(t.router),e.router==="suspected"&&a.push(t.suspectedRouter),e.estimated&&a.push(t.estimated),e.partial&&a.push(t.partialCoverage),a.map(s=>`${l(s)}`).join("")}function w(e,t){const a=[];return e.officialHfUrl&&a.push($(e.officialHfUrl,l(t.weights)+f(`${e.name}, ${t.destWeights}`),"sec")),e.ggufUrl&&a.push($(e.ggufUrl,l(t.gguf)+f(t.destGguf),"sec")),e.cardUrl&&a.push($(e.cardUrl,l(t.hfCard)+f(`${e.name}, ${t.destCard}`),"sec")),a}function F(e){return[e.name,e.revealedName,...e.aliases||[]].filter(Boolean).join(" ")}function k(e,t,a){const s=e.partial&&e.missing?.length?`
${l(t.partialCoverage)}

${l(p(t.notScoredIn,{tasks:e.missing.join(", ")}))}

`:"";return`
${h(e,e.detailUrl,"s",a)}${U(e,t)}
${s}${g(e.score,t)}${g(e.general,t)}${g(e.visual,t)}`}function A(e,t,a){const s=[...e].sort((n,r)=>(r.score??-1)-(n.score??-1)||n.name.localeCompare(r.name)||n.id.localeCompare(r.id));return{complete:s.filter(n=>!n.partial&&!n.estimated).map(n=>k(n,t,a)).join(""),partial:s.filter(n=>n.partial||n.estimated).map(n=>k(n,t,a)).join("")}}function z(e,t,a,s){return e.map(n=>{const r=n.entries[0]?.score,c=n.entries.map(o=>a.get(o.id)||{id:o.id,name:o.name,detailUrl:o.detailUrl}),i=c.map(o=>`
${h(o,o.detailUrl,n.id==="overall"?"l1":"l2",s)}
`).join(""),d=n.id==="overall"?"":c.flatMap(o=>w(o,t).filter(m=>!m.includes(">"+t.hfCard))).join("");return`
  • ${l(n.label)}

    ${l(t.scoreFull)} ${g(r,t)}

    ${i}
    ${d?``:""}
  • `}).join("")}function B(e,t){const a=t.find(i=>i.id==="overall")?.entries[0]?.id,s=t.find(i=>i.id==="open")?.entries[0]?.id,n=[...e].sort((i,d)=>(d.score??-1)-(i.score??-1)),r=a??n[0]?.id,c=s&&s!==r?s:n.find(i=>i.id!==r)?.id;return[r,c]}const G=(e,t)=>b(`${v}/compare/${e}-vs-${t}`);function Z(e,t,a){return`
    ${h(e,e.detailUrl,"xl",a)}

    ${U(e,t)}

    ${w(e,t).join("")}

    `}const q=(e,t,a,s)=>`
  • ${h(e,e.detailUrl,"s",s)}
  • `,j=(e,t,a)=>{const s=t?.get(e.modelId)||{id:e.modelId,name:e.modelName,detailUrl:e.modelUrl};return`
    ${h(s,s.detailUrl||e.modelUrl,"m",a)}
    `},L={cleared:"Cleared","out-of-turns":"Out of turns","out-of-lives":"Out of lives","ended-early":"Finished early","no-valid-move":"No valid move"},W=(e,t)=>e==="cleared"&&/^foresight/.test(t)?"Survived":L[e]||"",C=(e,t)=>{const[a,s]=t.scoreLine.split("{score}");return`

    ${l(a.trim())} ${g(e.score,t)} ${l((s||"").trim())}

    `};function D(e,t,a,s,n,r,c){const i=a==="high"?s.high:s.low,o=n?.get(t.modelId)?.name||t.modelName,m=t.media?.width?` width="${t.media.width}" height="${t.media.height}"`:"",u=t.resultDate?`${l(p(s.recorded,{date:I(t.resultDate)}))}`:"";return`

    ${l(i)}

    ${j(t,n,r)}
    ${l(p(s.resultAlt,{model:o,task:e.name}))}
    ${C(t,s)}

    ${u}${$(t.detailUrl,l(s.viewResult)+f(`${o}, ${e.name}`),"plain")}

    `}function M(e,t,a,s,n,r){const c=a==="high"?s.highChain:s.lowChain,i=n?.get(t.modelId)?.name||t.modelName,d=(t.levels||[]).map((u,N)=>{const H=u.available===!1?s.notStarted:W(u.outcome,t.chainId),S=Number.isFinite(u.points)?p(s.points,{points:Math.round(u.points*100)/100}):"";return`
  • ${l([p(s.levelN,{level:N+1}),H,S].filter(Boolean).join(" \xB7 "))}
  • `}).join(""),o=t.coverage?.selected?`

    ${l(p(s.coverageLine,t.coverage))}

    `:`

    ${l(s.noOutcome)}

    `,m=t.poster?`
    ${l(p(s.replayAlt,{model:i,game:e.name,level:t.coverage?.selected??
    `:"";return`

    ${l(c)}

    ${j(t,n,r)}${m}
    ${C(t,s)}${o}${d?`
      ${d}
    `:""}

    ${$(t.detailUrl,l(s.watchReplay)+f(`${i}, ${e.name}`),"btn btn-outline")}

    `}function E(e,t,a,s,n=v){const r=(i,d)=>i?e.kind==="game"?M(e,i,d,t,a,s):D(e,i,d,t,a,s,n):"";return`${e.differingBriefs?`

    ${l(t.differingBriefs)}

    `:""}
    ${r(e.high,"high")}${r(e.low,"low")}
    `}export{x as EXT,v as ORIGIN,P as assetSrc,Z as compareIdentityHtml,G as compareUrl,B as defaultPair,l as esc,p as fill,O as identityPath,z as leadersHtml,h as lockupHtml,I as longDate,A as modelsTbodyHtml,R as mountHtml,g as num,E as pairHtml,q as pickerItemHtml,k as rowHtml,F as searchText,w as secondaryLinks,_ as slugOf,U as statusTags,b as withUtm};