1import{l as g,d as b,r as o,j as e}from"./react-vendor-Crdm9tML.js";import{H as f,F as N}from"./app-main-D--6P9Pi.js";import{u as y,d as v,H as S}from"./HelpCenterLayout-Bw1wZ07F.js";import{A as L}from"./ArticleCard-CtdlO3pR.js";import{I as w}from"./input-Gz0Z6wOa.js";import{L as C}from"./index-DP4F5GEh.js";import{S as m}from"./search-BELvzXZR.js";import"./main-B9hiWIDM.js";import"./modulepreload-polyfill-B5Qt9EMX.js";import"./mail-ZFU5Ma_r.js";import"./arrow-left-Clq5-Wp6.js";import"./message-circle-BeFJegGE.js";import"./eye-C7afICFk.js";import"./thumbs-up-DqV97rhq.js";import"./formatDistanceToNow-CqOnucfG.js";import"./constructNow-2psKuJKj.js";import"./en-US-DEmH3qd1.js";import"./differenceInCalendarMonths-C3LHJXYc.js";import"./endOfMonth-BIfiImbM.js";import"./differenceInMilliseconds-B4tNXP3n.js";import"./es-DzTFRDdD.js";import"./supabase-j14IZ-fx.js";const U=()=>{const{orgSlug:c}=g(),[d,i]=b(),n=d.get("q")||"",[t,x]=o.useState(n),[r,u]=o.useState(n),{data:l,isLoading:p,error:h}=y(c),{data:a,isLoading:j}=v(l?.id,r);return o.useEffect(()=>{const s=setTimeout(()=>{u(t),t&&i({q:t})},300);return()=>clearTimeout(s)},[t,i]),p?e.jsx("div",{className:"min-h-screen flex items-center justify-center bg-slate-50",children:e.jsx(C,{className:"h-8 w-8 animate-spin text-primary"})}):h||!l?e.jsx("div",{className:"min-h-screen flex items-center justify-center bg-slate-50",children:e.jsxs("div",{className:"text-center",children:[e.jsx("h1",{className:"text-2xl font-bold text-slate-900 mb-2",children:"Centro de Ayuda no encontrado"}),e.jsx("p",{className:"text-slate-600",children:"El centro de ayuda que buscas no existe o no está disponible."})]})}):e.jsxs(e.Fragment,{children:[e.jsx(f,{children:e.jsxs("title",{children:["Buscar: ",r||"ArtÃculos"," | ",l.help_center_config.title]})}),e.jsxs(S,{org:l,showBackButton:!0,backTo:`/help/${c}`,backLabel:"Volver al inicio",children:[e.jsxs("div",{className:"mb-8",children:[e.jsx("h1",{className:"text-2xl font-bold text-slate-900 mb-4",children:"Buscar artÃculos"}),e.jsx("div",{className:"flex gap-2 max-w-xl",children:e.jsxs("div",{className:"relative flex-1",children:[e.jsx(m,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-slate-400"}),e.jsx(w,{type:"search",placeholder:"Buscar...",className:"pl-10",value:t,onChange:s=>x(s.target.value),autoFocus:!0})]})})]}),r.length<2?e.jsxs("div",{className:"text-center py-16 bg-slate-50 rounded-lg",children:[e.jsx(m,{className:"h-12 w-12 text-slate-300 mx-auto mb-4"}),e.jsx("p",{className:"text-slate-500",children:"Escribe al menos 2 caracteres para buscar."})]}):j?e.jsx("div",{className:"space-y-4",children:[1,2,3].map(s=>e.jsx("div",{className:"h-24 bg-slate-100 rounded-lg animate-pulse"},s))}):a&&a.length>0?e.jsxs("div",{children:[e.jsxs("p",{className:"text-sm text-slate-500 mb-4",children:[a.length," resultado",a.length!==1?"s":"",' para "',r,'"']}),e.jsx("div",{className:"space-y-3",children:a.map(s=>e.jsx(L,{article:s,orgSlug:c,showCategory:!0},s.id))})]}):e.jsxs("div",{className:"text-center py-16 bg-slate-50 rounded-lg",children:[e.jsx(N,{className:"h-12 w-12 text-slate-300 mx-auto mb-4"}),e.jsx("p",{className:"text-slate-600 font-medium mb-2",children:"No se encontraron resultados"}),e.jsx("p",{className:"text-slate-500 text-sm",children:"Intenta con otras palabras o navega por las categorÃas."})]})]})]})};export{U as default};
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.