var _=(g,m,s)=>new Promise((r,o)=>{var d=e=>{try{t(s.next(e))}catch(u){o(u)}},l=e=>{try{t(s.throw(e))}catch(u){o(u)}},t=e=>e.done?r(e.value):Promise.resolve(e.value).then(d,l);t((s=s.apply(g,m)).next())});import{b6 as h,cG as f}from"./bootstrap-Bqxdt4iG.js";import{u as k}from"./custom-links-BriKAUZK.js";import{u as v}from"./data-refresh-BZ1_-6mk.js";import{S as x}from"./index-D0CahMPl.js";import{a1 as L,L as b,aa as S,U as E,ap as a,aj as n,az as c,p as y,ay as p,a9 as i,ak as w,F as V,aq as C,an as F}from"../jse/index-index-BUJ_4tQs.js";const N={class:"rounded-lg border border-gray-200 bg-white dark:border-gray-700 dark:bg-gray-900"},B={class:"flex items-center gap-2 border-b border-gray-200 p-4 dark:border-gray-700"},D={class:"text-base font-semibold"},M={key:0,class:"p-6"},R={key:1,class:"grid grid-cols-2 gap-3 p-4 sm:grid-cols-3 md:grid-cols-4"},G=["href"],I={class:"text-sm font-medium"},P={key:0,class:"mt-1 line-clamp-2 text-xs text-gray-500"},U=L({__name:"custom-links-section",setup(g){const m=k(),s=v(),r=b([]),o=b(!1),d=()=>_(null,null,function*(){o.value=!0;try{r.value=yield m.getVisibleForHome()}catch(l){console.error("Failed to load custom links:",l),r.value=[]}finally{o.value=!1}});return S(d),E(()=>s.customLinksVersion,()=>{d()}),(l,t)=>(n(),a("div",N,[c("div",B,[t[0]||(t[0]=c("span",{class:"text-lg"},"🔗",-1)),c("h3",D,p(i(h)("page.home.customLinks.title")),1)]),y(i(x),{spinning:o.value},{default:w(()=>[r.value.length===0?(n(),a("div",M,[y(i(f),{description:i(h)("page.home.customLinks.empty"),image:i(f).PRESENTED_IMAGE_SIMPLE},null,8,["description","image"])])):(n(),a("div",R,[(n(!0),a(V,null,C(r.value,e=>(n(),a("a",{key:e.id,href:e.url,target:"_blank",rel:"noopener noreferrer",class:"flex min-h-[80px] flex-col rounded-lg border border-gray-200 p-3 transition-all hover:border-blue-500 hover:shadow-md dark:border-gray-700 dark:hover:border-blue-400"},[c("div",I,p(e.title),1),e.description?(n(),a("div",P,p(e.description),1)):F("",!0)],8,G))),128))]))]),_:1},8,["spinning"])]))}});export{U as _};
