import{C as e,G as t,I as n,J as r,R as i,S as a,T as o,f as s,ht as c,n as l,pt as u,v as d,w as f,x as p}from"./folders.j8Vf02Wn.js";import{c as m}from"./style.BtGWTIRi.js";import{i as h}from"../options.C1oHSPEM.js";import{t as g}from"./LinkCard.BUwb4UH-.js";var _={class:`starred-view p-4`},v={class:`mb-4 flex items-center justify-between`},y={key:0,class:`py-12 text-center`},b={__name:`StarredView`,setup(b){let x=l(),S=m(),C=t([]),w=t(S.viewMode||s.LIST),T=p(()=>x.starredLinks);function E(e){C.value.includes(e)?C.value=C.value.filter(t=>t!==e):C.value=[...C.value,e]}function D(){C.value=[]}function O(){C.value=T.value.map(e=>e.id)}let k=p(()=>C.value.length),A=p(()=>C.value.length>0);function j(e){window.open(e.url,`_blank`)}function M(e){x.starLink(e.id,!e.starred)}function N(){w.value=w.value===s.LIST?s.GRID:s.LIST,S.update(`viewMode`,w.value)}return(t,l)=>(n(),o(`div`,_,[a(`div`,v,[l[0]||=a(`h2`,{class:`text-lg font-medium text-foreground`},`Starred Links`,-1),a(`button`,{onClick:N,class:`btn btn-ghost btn-sm`},c(w.value===r(s).LIST?`☰`:`⬜`),1)]),T.value.length===0?(n(),o(`div`,y,[...l[1]||=[a(`div`,{class:`text-4xl mb-2`},`⭐`,-1),a(`h3`,{class:`text-lg font-medium text-foreground mb-1`},`No starred links`,-1),a(`p`,{class:`text-sm text-muted-foreground`},`Star important links to quickly access them here`,-1)]])):(n(),o(`div`,{key:1,class:u([`gap-2`,w.value===r(s).GRID?`grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4`:`grid grid-cols-1`])},[(n(!0),o(d,null,i(T.value,t=>(n(),e(g,{key:t.id,link:t,selected:C.value.includes(t.id),"view-mode":w.value,onToggleSelect:e=>E(t.id),onToggleStar:e=>M(t),onOpen:e=>j(t)},null,8,[`link`,`selected`,`view-mode`,`onToggleSelect`,`onToggleStar`,`onOpen`]))),128))],2)),A.value?(n(),e(h,{key:2,count:k.value,"selected-ids":C.value,onClear:D,onSelectAll:O},null,8,[`count`,`selected-ids`])):f(``,!0)]))}};export{b as default};