PageSourceSearch

https://xmacna.ai/_nuxt/i8_opN1b.js

js xmacna.ai collected 2026-10-05 13:23:59 UTC 6,788 bytes, 1 lines download raw bytes

1import{_ as P}from"./Bl7E7JBY.js";import{_ as T}from"./Dgs6hFTu.js";import{u as D,d as F,_ as M}from"./D8LUW1OM.js";import{_ as Q}from"./cabmBHyt.js";import{d as C,ax as R,s as h,k as V,b as d,o as s,A as n,B as i,g as _,e as z,t as b,z as t,f as y,N as q,C as S,W as E,Q as G,R as H,F as K,h as O,c as $,n as U}from"./Bcc8-a-q.js";import{u as W}from"./CUHCQ4-k.js";import{_ as N,a as J}from"./BWLrXIm_.js";import{_ as j}from"./0TAyzOoh.js";import{u as X}from"./PzL4jtUw.js";import{_ as Y}from"./ClL-Wh03.js";import{_ as Z}from"./osqaVy29.js";import{_ as ee}from"./CJvuIo6D.js";import{s as te,a as ae}from"./BESgyjMO.js";const oe={class:"flex items-center gap-0.5"},re={key:0,role:"alert",class:"p-4"},ke=C({__name:"GlobalSearch",props:{collections:{type:Array,required:!0,validator:f=>f.every(l=>["posts","pages","categories","projects","help_articles"].includes(l))},placeholder:{type:String,default:""}},setup(f){const{locale:l,t:r}=R(),x=f,{metaSymbol:g}=D();F({meta_k:{usingInput:!0,handler:()=>{e.value=!e.value}}});const e=h(!1),u=h(!1),{fileUrl:k}=W(),w=V(()=>[{key:"search",label:a=>a&&r("resultsFor",{query:a}),search:async a=>{if(c.value=!0,u.value=!1,!a||a.length<3)return c.value=!1,[];try{const{data:o}=await $fetch("/api/search",{params:{search:a,locale:l.value,collections:x.collections}});return o.map(m=>({id:m.id,label:m.title,href:m.url,avatar:{src:k(m.image)},suffix:m.type}))}catch{return u.value=!0,[]}finally{c.value=!1}}}]);function v(a){a.click?a.click():a.to?S(a.to):a.href&&S(a.href)}h(""),h([]),h(null);const c=h(!1),p={wrapper:"flex flex-col flex-1 min-h-0 bg-gray-50 dark:bg-gray-800",input:{wrapper:"relative flex items-center mx-3 py-3",base:"w-full rounded border-2 border-primary-500 placeholder-gray-400 dark:placeholder-gray-500 focus:border-primary-500 focus:outline-none focus:ring-0 bg-white dark:bg-gray-900",padding:"px-4",height:"h-14",size:"text-lg",icon:{base:"pointer-events-none absolute left-3 text-primary-500 dark:text-primary-400",size:"h-6 w-6"}},group:{wrapper:"p-3 relative",label:"-mx-3 px-3 -mt-4 mb-2 py-1 text-sm font-semibold text-primary-500 dark:text-primary-400 font-semibold sticky top-0 bg-gray-50 dark:bg-gray-800 z-10",container:"space-y-1",command:{base:"flex justify-between select-none items-center rounded px-2 py-4 gap-2 relative font-medium text-sm group shadow",active:"bg-primary-500 dark:bg-primary-400 text-white",inactive:"bg-white dark:bg-gray-900",label:"flex min-w-0 justify-between",suffix:"text-xs",icon:{base:"flex-shrink-0 w-6 h-6",active:"text-white",inactive:"text-gray-400 dark:text-gray-500"}}},emptyState:{wrapper:"flex flex-col items-center justify-center flex-1 py-9",label:"text-sm text-center text-gray-500 dark:text-gray-400",queryLabel:"text-lg text-center text-gray-900 dark:text-white",icon:"w-12 h-12 mx-auto text-gray-400 dark:text-gray-500 mb-4"}};return(a,o)=>{const m=P,B=T,I=M,A=Q;return s(),d("div",null,[n(B,{icon:"material-symbols:search-rounded",color:"white",size:"lg",onClick:o[0]||(o[0]=L=>e.value=!0)},{default:i(()=>[_(b(t(r)("search"))+" ",1),z("div",oe,[n(m,null,{default:i(()=>[_(b(t(g)),1)]),_:1}),n(m,null,{default:i(()=>o[2]||(o[2]=[_("K")])),_:1,__:[2]})])]),_:1}),n(A,{modelValue:t(e),"onUpdate:modelValue":o[1]||(o[1]=L=>q(e)?e.value=L:null)},{default:i(()=>[t(u)?(s(),d("p",re,b(t(r)("searchUnavailable")),1)):y("",!0),n(I,{"empty-state":{label:t(r)("searchPrompt"),queryLabel:t(r)("noResults")},"close-button":{icon:"i-heroicons-x-mark-20-solid","aria-label":t(r)("close")},placeholder:f.placeholder||t(r)("search"),loading:t(c),groups:t(w),ui:p,"onUpdate:modelValue":v},null,8,["empty-state","close-button","placeholder","loading","groups"])]),_:1},8,["modelValue"])])}}}),se={class:"mt-4 space-y-2"},we=C({__name:"Categories",async setup(f){let l,r;const x=X(),{locale:g,localPath:e}=R(),{data:u}=([l,r]=E(()=>G(()=>`categories:${g.value}`,()=>x(H("categories",{fields:["*"]})),"$BQQRGhv7sQ")),l=await l,r(),l);return(k,w)=>{const v=N,c=j;return s(),d("div",se,[(s(!0),d(K,null,O(t(u),p=>(s(),d("div",{key:p.id},[n(c,{href:t(e)(`/posts/categories/${p.slug}`),class:"dark:text-gray-200 hover:opacity-80"},{default:i(()=>[n(v,{color:p.color||void 0,size:"lg"},{default:i(()=>[_(b(p.title),1)]),_:2},1032,["color"])]),_:2},1032,["href"])]))),128))])}}}),le={key:2,class:"absolute top-0 right-0 p-1.5 mt-4 mr-4 rounded-button bg-gray-900/50"},ne={class:"flex flex-col justify-between h-full gap-3"},ie=["innerHTML"],$e=C({__name:"PostCard",props:{post:{},direction:{default:"vertical"}},setup(f){const{localPath:l}=R(),r=f,x={blog:"material-symbols:article-outline-rounded",video:"material-symbols:video-library-outline-rounded",project:"material-symbols:trophy-outline-rounded"},g=V(()=>t(r.post.category)??null);return(e,u)=>{const k=Y,w=N,v=Z,c=j,p=ee,a=J;return s(),d("figure",{class:U([{"flex-col":e.direction==="vertical","flex-col md:flex-row":e.direction==="horizontal"},"flex group gap-6"])},[n(c,{class:U([{"w-full h-56":e.direction==="vertical","w-full h-56 md:w-72 md:h-72":e.direction==="horizontal"},"relative block overflow-hidden border dark:border-gray-700 group rounded-card flex-shrink-0"]),href:t(l)(`/posts/${e.post.slug}`)},{default:i(()=>{var o;return[e.post.image?(s(),$(k,{key:0,class:"relative flex-shrink-0 object-cover w-full h-full transition duration-300 saturate-0 group-hover:opacity-75",src:("safeRelationId"in e?e.safeRelationId:t(ae))(e.post.image),alt:((o=("safeRelation"in e?e.safeRelation:t(te))(e.post.image))==null?void 0:o.alt)??e.post.title??"",width:480,height:270,format:"webp",quality:"75",loading:e.direction==="horizontal"?"eager":"lazy"},null,8,["src","alt","loading"])):y("",!0),u[0]||(u[0]=z("div",{class:"absolute inset-0 transition-opacity duration-300 opacity-0 bg-gradient-to-br from-transparent via-trans
1parent to-primary group-hover:opacity-100"},null,-1)),t(g)?(s(),$(w,{key:1,size:"lg",color:t(g).color,class:"absolute bottom-0 left-0 mb-4 ml-4"},{default:i(()=>[_(b(t(g).title),1)]),_:1},8,["color"])):y("",!0),e.post.type?(s(),d("div",le,[e.post.type?(s(),$(v,{key:0,name:x[e.post.type??"blog"]??"material-symbols:article-outline-rounded",class:"w-6 h-6 text-white"},null,8,["name"])):y("",!0)])):y("",!0)]}),_:1,__:[0]},8,["class","href"]),z("div",ne,[n(c,{class:"space-y-4",href:t(l)(`/posts/${e.post.slug}`)},{default:i(()=>[e.post.title?(s(),d("h3",{key:0,class:"text-xl font-display font-semibold leading-snug tracking-tight color-em dark:text-white group-hover:text-primary",innerHTML:e.post.title},null,8,ie)):y("",!0),n(p,{"text-color":"light",class:"line-clamp-2"},{default:i(()=>{var o;return[_(b((o=e.post)==null?void 0:o.summary),1)]}),_:1})]),_:1},8,["href"]),e.post.author?(s(),$(a,{key:0,size:"sm",author:e.post.author},null,8,["author"])):y("",!0)])],2)}}});export{ke as _,we as a,$e as b};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.