PageSourceSearch

https://www.sumedico.com/_next/static/chunks/0wcgx81-4fogz.js

js sumedico.com collected 2026-10-02 04:35:05 UTC 14,125 bytes, 1 lines download raw bytes

1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,886072,e=>{"use strict";var t=e.i(289704),a=e.i(280515),r=e.i(715445),s=e.i(801647),l=e.i(859219);let n=(0,l.createServerReference)("40f3055a10679210bb4c03880dfc2b1f464018e63e",l.callServer,void 0,l.findSourceMapURL,"buscarAction"),c=/[.!?…:;"'«»“”‘’]$/u,d="dd/mm/aaaa";function i(e){let t=/^(\d{4})-(\d{2})-(\d{2})$/.exec(e);return t?{y:Number(t[1]),m:Number(t[2]),d:Number(t[3])}:null}function o(e,t,a){return`${e}-${String(t).padStart(2,"0")}-${String(a).padStart(2,"0")}`}function m(){let e=new Date;return o(e.getFullYear(),e.getMonth()+1,e.getDate())}function u(e){return e.charAt(0).toUpperCase()+e.slice(1)}function x(e){let r,{label:s,name:l,value:n,onChange:c,locale:x,min:p,max:h}=e,[b,g]=(0,a.useState)(!1),v=(0,a.useRef)(null),f=(0,a.useId)(),j=`${f}-cal`,y=h||m(),N=i(n),[k,w]=(0,a.useState)(()=>{let e=N??i(y)??i(m());return{y:e.y,m:e.m}}),S=()=>{let e=i(n)??i(y)??i(m());w({y:e.y,m:e.m}),g(!0)};(0,a.useEffect)(()=>{if(!b)return;let e=e=>{var t;(null==(t=v.current)?void 0:t.contains(e.target))||g(!1)},t=e=>{"Escape"===e.key&&g(!1)};return document.addEventListener("mousedown",e),document.addEventListener("keydown",t),()=>{document.removeEventListener("mousedown",e),document.removeEventListener("keydown",t)}},[b]);let M=(0,a.useMemo)(()=>{let e=new Intl.DateTimeFormat(x,{month:"long"});return Array.from({length:12},(t,a)=>u(e.format(new Date(2021,a,1))))},[x]),C=(0,a.useMemo)(()=>{let e=new Intl.DateTimeFormat(x,{weekday:"short"});return Array.from({length:7},(t,a)=>u(e.format(new Date(2021,10,1+a))).replace(/\.$/,""))},[x]),$=(0,a.useMemo)(()=>{let e=(new Date(k.y,k.m-1,1).getDay()+6)%7,t=new Date(k.y,k.m-1,1-e);return Array.from({length:42},(e,a)=>{let r=new Date(t.getFullYear(),t.getMonth(),t.getDate()+a),s=o(r.getFullYear(),r.getMonth()+1,r.getDate());return{iso:s,day:r.getDate(),outside:r.getMonth()+1!==k.m||r.getFullYear()!==k.y,disabled:!!(p&&s<p)||s>y}})},[k,p,y]),D=m(),L=!p||o(k.y,k.m,1)>p,A=o(k.y,k.m,28)<y,H=e=>{let t=new Date(k.y,k.m-1+e,1);w({y:t.getFullYear(),m:t.getMonth()+1})},T=(0,a.useMemo)(()=>{let e=i(y).y,t=p?i(p).y:e-30,a=[];for(let r=e;r>=t;r--)a.push(r);return N&&!a.includes(N.y)&&a.push(N.y),a},[y,p,N]);return(0,t.jsxs)("div",{className:"block mt-3",ref:v,children:[(0,t.jsx)("label",{htmlFor:f,className:"block text-[13px] text-[#4b4b4b] cursor-pointer",children:s}),n&&(0,t.jsx)("input",{type:"hidden",name:l,value:n}),(0,t.jsxs)("div",{className:"relative mt-1",children:[(0,t.jsx)("input",{id:f,type:"text",readOnly:!0,value:(r=i(n))?`${String(r.d).padStart(2,"0")}/${String(r.m).padStart(2,"0")}/${r.y}`:"",placeholder:d,role:"combobox","aria-haspopup":"dialog","aria-expanded":b,"aria-controls":j,"aria-label":`${s.replace(/:$/,"")} (${d})`,onClick:()=>b?g(!1):S(),onKeyDown:e=>{("Enter"===e.key||" "===e.key||"ArrowDown"===e.key)&&(e.preventDefault(),S())},className:"block w-full cursor-pointer border border-[#cdcdcd] focus:border-black outline-none pl-3 pr-10 py-2 text-[14px] text-black placeholder:text-[#9a9a9a] bg-white"}),(0,t.jsx)("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",fill:"none",stroke:"#64748b",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round",className:"pointer-events-none absolute right-3 top-1/2 -translate-y-1/2 w-[19px] h-[19px]",children:(0,t.jsx)("path",{d:"M6.75 3v2.25M17.25 3v2.25M3 18.75V7.5a2.25 2.25 0 0 1 2.25-2.25h13.5A2.25 2.25 0 0 1 21 7.5v11.25m-18 0A2.25 2.25 0 0 0 5.25 21h13.5A2.25 2.25 0 0 0 21 18.75m-18 0v-7.5A2.25 2.25 0 0 1 5.25 9h13.5A2.25 2.25 0 0 1 21 11.25v7.5m-9-6h.008v.008H12v-.008ZM12 15h.008v.008H12V15Zm0 2.25h.008v.008H12v-.008ZM9.75 15h.008v.008H9.75V15Zm0 2.25h.008v.008H9.75v-.008ZM7.5 15h.008v.008H7.5V15Zm0 2.25h.008v.008H7.5v-.008Zm6.75-4.5h.008v.008h-.008v-.008Zm0 2.25h.008v.008h-.008V15Zm0 2.25h.008v.008h-.008v-.008Zm2.25-4.5h.008v.008H16.5v-.008Zm0 2.25h.008v.008H16.5V15Z"})}),b&&(0,t.jsxs)("div",{id:j,role:"dialog","aria-label":`Elegir ${s.replace(/:$/,"").toLowerCase()}`,className:"absolute z-30 left-0 top-[calc(100%+6px)] w-[268px] bg-white border border-[#e0e0e0] rounded-lg shadow-[0_8px_24px_rgba(0,0,0,0.12)] p-3",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[(0,t.jsx)("button",{type:"button","aria-label":"Mes anterior",disabled:!L,onClick:()=>H(-1),className:"w-7 h-7 shrink-0 grid place-items-center text-[#4b4b4b] hover:bg-[#f2f2f2] rounded disabled:opacity-30 disabled:hover:bg-transparent",children:(0,t.jsx)("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,className:"w-4 h-4",children:(0,t.jsx)("path",{d:"m15 18-6-6 6-6",strokeLinecap:"round",strokeLinejoin:"round"})})}),(0,t.jsxs)("div",{className:"flex-1 flex items-center justify-center gap-1",children:[(0,t.jsx)("select",{"aria-label":"Mes",value:k.m,onChange:e=>w(t=>({...t,m:Number(e.target.value)})),className:"appearance-none bg-transparent text-[14px] font-medium text-black text-center outline-none cursor-pointer hover:bg-[#f2f2f2] rounded px-1 py-0.5",children:M.map((e,a)=>
1(0,t.jsx)("option",{value:a+1,children:e},e))}),(0,t.jsx)("select",{"aria-label":"Año",value:k.y,onChange:e=>w(t=>({...t,y:Number(e.target.value)})),className:"appearance-none bg-transparent text-[14px] font-medium text-black text-center outline-none cursor-pointer hover:bg-[#f2f2f2] rounded px-1 py-0.5",children:T.map(e=>(0,t.jsx)("option",{value:e,children:e},e))})]}),(0,t.jsx)("button",{type:"button","aria-label":"Mes siguiente",disabled:!A,onClick:()=>H(1),className:"w-7 h-7 shrink-0 grid place-items-center text-[#4b4b4b] hover:bg-[#f2f2f2] rounded disabled:opacity-30 disabled:hover:bg-transparent",children:(0,t.jsx)("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,className:"w-4 h-4",children:(0,t.jsx)("path",{d:"m9 18 6-6-6-6",strokeLinecap:"round",strokeLinejoin:"round"})})})]}),(0,t.jsxs)("div",{className:"mt-2 grid grid-cols-7 gap-y-1",children:[C.map(e=>(0,t.jsx)("div",{className:"h-7 grid place-items-center text-[11px] font-medium text-[#8a8a8a]",children:e},e)),$.map(e=>{let a=n===e.iso,r=D===e.iso;return(0,t.jsx)("button",{type:"button",disabled:e.disabled,"aria-current":r?"date":void 0,onClick:()=>{c(e.iso),g(!1)},className:["h-8 grid place-items-center text-[13px] rounded-full transition-colors",e.disabled?"text-[#d0d0d0] cursor-default":"hover:bg-[#f0f0f0] cursor-pointer",e.outside&&!e.disabled?"text-[#b5b5b5]":"",!e.outside&&!e.disabled?"text-black":"",r&&!a?"ring-1 ring-[#cdcdcd]":"",a?"bg-[var(--buscador-accent,#000)] text-white hover:bg-[var(--buscador-accent,#000)]":""].join(" "),children:e.day},e.iso)})]}),n&&(0,t.jsx)("button",{type:"button",onClick:()=>{c(""),g(!1)},className:"mt-2 w-full text-[12px] uppercase tracking-wider text-[#6b6b6b] hover:text-black py-1.5 border-t border-[#eee]",children:"Borrar fecha"})]})]})]})}function p(e){let{row:a}=e;return(0,t.jsx)("li",{className:"border border-[#e5e5e5] bg-white",children:(0,t.jsxs)("a",{href:a.url,className:"group flex flex-col sm:flex-row gap-4 sm:gap-6 p-4 sm:p-5",children:[a.cover&&(0,t.jsx)("div",{className:"shrink-0 w-full sm:w-[42%] sm:max-w-[440px] aspect-video overflow-hidden bg-[#f3f3f3] self-start",children:(0,t.jsx)("img",{src:a.cover,srcSet:a.cover2x?`${a.cover} 1x, ${a.cover2x} 2x`:void 0,alt:a.titulo,width:480,height:270,loading:"lazy",decoding:"async",className:"w-full h-full object-cover"})}),(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsx)("h2",{className:"text-[19px] sm:text-[22px] md:text-[24px] font-bold leading-[1.25] text-black",children:(0,t.jsx)("span",{className:"group-hover:underline",children:a.titulo})}),a.snippetHtml?(0,t.jsx)("p",{className:"mt-2 text-[14px] sm:text-[15px] text-[#4b4b4b] leading-snug line-clamp-2 [&_mark]:bg-yellow-100 [&_mark]:text-black [&_mark]:px-0.5",dangerouslySetInnerHTML:{__html:a.snippetHtml}}):a.resumen?(0,t.jsx)("p",{className:"mt-2 text-[14px] sm:text-[15px] text-[#4b4b4b] leading-snug line-clamp-2",children:function(e){if(!e)return null;let t=e.trim();return t?c.test(t)?t:`${t}.`:null}(a.resumen)}):null,(0,t.jsxs)("p",{className:"mt-3 text-[13px] text-[#6b6b6b]",children:[a.autor&&(0,t.jsxs)("span",{className:"font-medium",children:["Por ",a.autor]}),a.autor&&(0,t.jsx)("span",{"aria-hidden":!0,children:" · "}),a.fechaStr]})]})]})})}e.s(["BuscarClient",0,function(e){let{q:l,page:c,desde:d,hasta:i,slugs:o,sectionOptions:m,initial:u,locale:h,filtersOpen:b,copy:g}=e,[v,f]=(0,a.useState)({desde:d,hasta:i,slugs:o}),[j,y]=(0,a.useState)(c),[N,k]=(0,a.useState)(b),[w,S]=(0,a.useState)(u),[M,C]=(0,a.useState)(!1),$=(0,a.useRef)(null),D=(0,a.useRef)(0);(0,a.useEffect)(()=>()=>{$.current&&clearTimeout($.current)},[]);let L=(0,a.useCallback)((e,t)=>{let a=new URLSearchParams;for(let t of(l&&a.set("q",l),e.desde&&a.set("desde",e.desde),e.hasta&&a.set("hasta",e.hasta),e.slugs))a.append("s",t);return t>1&&a.set("page",String(t)),a.toString()},[l]),A=(0,a.useCallback)(e=>{f(e),y(1);let t=L(e,1);window.history.replaceState(null,"",t?`/buscar?${t}`:"/buscar"),l.length<2||($.current&&clearTimeout($.current),C(!0),$.current=setTimeout(async()=>{let t=++D.current;try{let a=await n({q:l,page:1,desde:e.desde||void 0,hasta:e.hasta||void 0,s:e.slugs});if(t!==D.current)return;S(a)}catch{if(t!==D.current)return;S(e=>({...e,error:!0}))}finally{t===D.current&&C(!1)}},220))},[L,l]),{rows:H,total:T,totalIsApprox:Z,error:F}=w,B=!!v.desde||!!v.hasta||v.slugs.length>0,E=(0,t.jsxs)("div",{className:"space-y-7",children:[(0,t.jsxs)("fieldset",{children:[(0,t.jsx)("legend",{className:"text-[14px] font-bold text-black",children:"Fecha"}
1),(0,t.jsx)(x,{label:"Desde:",name:"desde",value:v.desde,max:v.hasta||void 0,locale:h,onChange:e=>A({...v,desde:e})}),(0,t.jsx)(x,{label:"Hasta:",name:"hasta",value:v.hasta,min:v.desde||void 0,locale:h,onChange:e=>A({...v,hasta:e})})]}),m.length>0&&(0,t.jsxs)("fieldset",{children:[(0,t.jsx)("legend",{className:"text-[14px] font-bold text-black",children:"Sección"}),(0,t.jsx)("div",{className:"mt-3 space-y-2.5",children:m.map(e=>(0,t.jsxs)("label",{className:"flex items-center gap-2.5 text-[15px] text-black cursor-pointer",children:[(0,t.jsx)("input",{type:"checkbox",name:"s",value:e.slug,checked:v.slugs.includes(e.slug),onChange:t=>{var a,r;let s;return a=e.slug,r=t.target.checked,s=new Set(v.slugs),void(r?s.add(a):s.delete(a),A({...v,slugs:m.map(e=>e.slug).filter(e=>s.has(e))}))},className:"w-[18px] h-[18px] shrink-0 accent-[var(--buscador-accent,#000)]"}),e.nombre]},e.id))})]}),B&&(0,t.jsx)("button",{type:"button",onClick:()=>A({desde:"",hasta:"",slugs:[]}),className:"w-full border border-[#cdcdcd] text-[#4b4b4b] text-[13px] font-medium uppercase tracking-wider py-2 hover:border-black hover:text-black",children:"Limpiar filtros"})]}),R=j<Math.max(1,Math.ceil((Z?Math.min(T,200):T)/20))&&20===H.length,_=j>1,P=e=>{let t=L(v,e);return t?`/buscar?${t}`:"/buscar"};return(0,t.jsx)("form",{method:"get",action:"/buscar",className:"mt-4",children:(0,t.jsxs)("div",{className:"md:grid md:grid-cols-[240px_1fr] md:gap-x-10",children:[(0,t.jsx)("aside",{className:"md:col-start-1 md:row-start-1 md:row-span-2 order-none",children:(0,t.jsxs)("details",{open:N,onToggle:e=>k(e.currentTarget.open),className:"mb-6 md:mb-0 md:sticky md:top-5 border border-[#e5e5e5] md:border-0 px-3 py-2 md:p-0",children:[(0,t.jsx)("summary",{className:"text-[13px] font-medium uppercase tracking-wider text-black cursor-pointer select-none md:hidden",children:"Filtros"}),(0,t.jsx)("div",{className:"mt-4 md:mt-0",children:E})]})}),(0,t.jsx)("div",{className:"md:col-start-2 md:row-start-1",children:(0,t.jsxs)("div",{className:"flex gap-2",children:[(0,t.jsx)("input",{type:"search",name:"q",defaultValue:l,placeholder:"¿Qué estás buscando?",autoFocus:!0,className:"flex-1 min-w-0 border border-[#cdcdcd] focus:border-black outline-none px-3 py-2 text-[16px] text-black bg-white"}),(0,t.jsx)("button",{type:"submit",className:"bg-[var(--buscador-accent,#000)] text-white px-5 py-2 text-[14px] uppercase tracking-wider hover:opacity-90",children:"Buscar"})]})}),(0,t.jsxs)("div",{className:"md:col-start-2 md:row-start-2 min-w-0",children:[0===l.length&&(0,t.jsx)("p",{className:"mt-8 text-[15px] text-[#666]",children:g.prompt}),l.length>0&&l.length<2&&(0,t.jsx)("p",{className:"mt-8 text-[15px] text-[#666]",children:g.tooShort}),F&&(0,t.jsx)("p",{className:"mt-8 text-[15px] text-red-600",children:g.error}),l.length>=2&&!F&&0===H.length&&!M&&(0,t.jsxs)("p",{className:"mt-8 text-[15px] text-[#666]",children:["No encontramos noticias para ",(0,t.jsxs)("strong",{children:["“",l,"”"]}),B?" con los filtros elegidos.":"."]}),l.length>=2&&0===H.length&&M&&(0,t.jsx)("p",{className:"mt-8 text-[15px] text-[#666]",children:"Buscando…"}),H.length>0&&(0,t.jsxs)("div",{"aria-busy":M,className:M?"opacity-50 transition-opacity":"transition-opacity",children:[(0,t.jsxs)("div",{className:"mt-6 mb-2 text-[15px] text-[#4b4b4b]",children:[(0,t.jsxs)("strong",{className:"text-black",children:[Z?"Más de ":"",T]})," ","resultado",1===T?"":"s"," para"," ",(0,t.jsxs)("span",{className:"font-bold text-[var(--buscador-accent,#000)]",children:["“",l,"”"]})]}),(0,t.jsx)("ul",{className:"mt-3 space-y-4",children:H.map(e=>(0,t.jsx)(p,{row:e},e.id))}),(R||_)&&(0,t.jsxs)("nav",{"aria-label":"Paginación",className:"flex items-center justify-between gap-4 mt-10 pt-8 border-t border-[#cdcdcd]",children:[_?(0,t.jsxs)("a",{href:P(j-1),rel:"prev",className:"inline-flex items-center gap-2 text-[13px] font-medium uppercase tracking-[0.15em] text-black hover:underline",children:[(0,t.jsx)(r.ChevronLeft,{className:"w-4 h-4"}),"Página anterior"]}):(0,t.jsx)("span",{}),(0,t.jsxs)("span",{className:"text-[13px] font-medium uppercase tracking-[0.15em] text-[#4b4b4b]",children:["Página ",j]}),R?(0,t.jsxs)("a",{href:P(j+1),rel:"next",className:"inline-flex items-center gap-2 text-[13px] font-medium uppercase tracking-[0.15em] text-black hover:underline",children:["Más resultados",(0,t.jsx)(s.ChevronRight,{className:"w-4 h-4"})]}):(0,t.jsx)("span",{})]})]})]})]})})}],886072)}]);

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.