import{B as e,E as t,H as n,It as r,Mt as i,Q as a,V as o,W as s,Y as c,Z as l,_t as u,at as d,d as f,ft as p,g as m,ht as h,i as g,jt as _,mt as v,ot as y,s as b,st as x,tt as S,x as C}from"./BA99CCI5.js";import"./xihTtKlq.js";import"./DGo8yE5j.js";var w=s(`<div class="absolute inset-0 animate-pulse rounded-lg bg-neutral-200 dark:bg-neutral-700"></div>`),T=s(`<div> </div>`),E=s(`<img/>`),D=s(`<div><!> <!></div>`);function O(s,O){i(O,!1);let k=h(),A=h(),j=b(O,`name`,8),M=b(O,`repoUrl`,8),N=b(O,`size`,8,`sm`),P={xs:`h-5 w-5`,sm:`h-8 w-8`,md:`h-10 w-10`},F=h(!1),I=h(!1),L=0,R=h(null),z=h(null),B=h(``),V={"https://github.com/Dictionarry-Hub/trash-pcd":`https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons/png/trash-guides.png`};function H(e){if(V[e])return V[e];let t=e.match(/github\.com\/([^\/]+)\//);return t?`/databases/avatar/${t[1]}`:``}function U(){u(F,!0),u(I,!1)}function W(){if(L<1){L+=1,u(R,Date.now());return}u(F,!0),u(I,!0)}function G(){!a(z)||!a(A)||a(z).complete&&(a(z).naturalWidth>0?U():W())}g(()=>{queueMicrotask(G)}),d(()=>l(M()),()=>{u(k,H(M()))}),d(()=>(a(k),a(R)),()=>{u(A,a(k)?a(R)?`${a(k)}?v=${a(R)}`:a(k):``)}),d(()=>(a(A),a(F)),()=>{!a(A)&&!a(F)&&(u(F,!0),u(I,!0))}),d(()=>(a(A),a(B)),()=>{a(A)&&a(A)!==a(B)&&(u(B,a(A)),queueMicrotask(G))}),y(),f();var K=D(),q=p(K),J=e=>{var t=w();n(e,t)};e(q,e=>{a(F)||e(J)});var Y=v(q,2),X=e=>{var i=T(),a=p(i,!0);r(i),x(e=>{t(i,1,`flex ${l(N()),S(()=>P[N()])??``} items-center justify-center rounded-lg bg-neutral-200 text-xs font-semibold text-neutral-600 dark:bg-neutral-700 dark:text-neutral-300`),o(a,e)},[()=>(l(j()),S(()=>j()?.slice(0,1)??`?`))]),n(e,i)},Z=e=>{var r=E();m(r,e=>u(z,e),()=>a(z)),x(()=>{C(r,`src`,a(A)),C(r,`alt`,`${j()??``} avatar`),t(r,1,`${l(N()),S(()=>P[N()])??``} rounded-lg ${a(F)?`opacity-100`:`opacity-0`}`)}),c(`load`,r,U),c(`error`,r,W),n(e,r)};e(Y,e=>{a(I)?e(X):e(Z,-1)}),r(K),x(()=>t(K,1,`relative ${l(N()),S(()=>P[N()])??``}`)),n(s,K),_()}export{O as t};