import{g as B,o as u,j as L,w as $,a as z,L as A,t as E,a0 as F,i as T,k as w,C as x,K,c as C,F as M,A as I,m as j}from"./entry.Ddy3dMw-.js";import"./home.DFk1FaXE.js";const N=B({__name:"TagListTag",props:{text:{},link:{},hasComma:{type:Boolean}},setup(m){return(e,n)=>(u(),L(F(e.link?"router-link":"div"),{to:e.link},{default:$(()=>[z("span",{class:A(["px-2 pt-1 pb-[0.35rem] text-black capitalize bg-white rounded caption transition-opacity",{link:e.link,"md:hover:opacity-80":e.link}])},E(e.text),3)]),_:1},8,["to"]))}}),Q={class:"flex flex-wrap gap-[0.35em]"},G=B({__name:"TagList",props:{block:{}},async setup(m){let e,n;const f=m,{data:a}=([e,n]=T(()=>w({query:'site.find("work")',select:{...x,fields:"page.fields.toStructure()",categories:"page.categories.toStructure()"}})),e=await e,n(),e),{data:o}=([e,n]=T(()=>w({query:'site.find("stories")',select:{...x,fields:"page.fields.toStructure()",categories:"page.categories.toStructure()"}})),e=await e,n(),e),S=[...f.block.content.tags.split(","),...f.block.content.customtags.split(",")].filter(c=>c),g=K(()=>{var l,r,k,h,_,v,y,b;const c=[...Object.values(((r=(l=a==null?void 0:a.value)==null?void 0:l.result)==null?void 0:r.categories)??{}),...Object.values(((h=(k=o==null?void 0:o.value)==null?void 0:k.result)==null?void 0:h.categories)??{})],p=[...Object.values(((v=(_=a==null?void 0:a.value)==null?void 0:_.result)==null?void 0:v.fields)??{}),...Object.values(((b=(y=o==null?void 0:o.value)==null?void 0:y.result)==null?void 0:b.fields)??{})],i=[];return S.forEach(t=>{const O=c.some(s=>s.id===t),q=p.some(s=>s.id===t);if(O){const s=c.find(d=>d.id===t);i.push({...s,link:`/work?category=${t}`})}else if(q){const s=p.find(d=>d.id===t);i.push({...s,link:`/work?field=${t}`})}else i.push({id:t,title:t,link:void 0})}),i});return(c,p)=>{const i=N;return u(),C("div",Q,[(u(!0),C(M,null,I(j(g),(l,r)=>(u(),L(i,{key:r,text:l.title,link:l.link,"has-comma":r<j(g).length-1},null,8,["text","link","has-comma"]))),128))])}}});export{G as _};