PageSourceSearch

https://acachile.com/assets/ContactPage-2DDGWGYl.js

js acachile.com collected 2026-10-09 01:47:38 UTC 6,885 bytes, 1 lines download raw bytes

1import{r as u,j as t}from"./index-DUOydnzc.js";const g=s=>{if(!s||s.length===0)return[];const n=[];return s.forEach((e,o)=>{n.push({page:"contact",key:typeof(e==null?void 0:e.key)=="string"&&e.key.trim()?e.key.trim():`section_${o}`,title:typeof(e==null?void 0:e.title)=="string"?e.title:"",content:typeof(e==null?void 0:e.content)=="string"?e.content:"",image_url:typeof(e==null?void 0:e.image_url)=="string"?e.image_url:"",sort_order:typeof(e==null?void 0:e.sort_order)=="number"?e.sort_order:o,source_type:(e==null?void 0:e.source_type)??"custom",source_id:(e==null?void 0:e.source_id)!=null?String(e.source_id):void 0,cta_label:(e==null?void 0:e.cta_label)!=null?String(e.cta_label):void 0,cta_url:(e==null?void 0:e.cta_url)!=null?String(e.cta_url):void 0})}),n.sort((e,o)=>e.sort_order-o.sort_order)},f=s=>{const n=s.split(/\r?\n/).map(o=>o.trim()).filter(Boolean),e=[];return n.forEach(o=>{const[c,...x]=o.split(":"),m=c==null?void 0:c.trim(),l=x.join(":").trim();if(!m||!l)return;let r,d="📍";const a=m.toLowerCase(),i=l.toLowerCase();if(a.includes("instagram")||i.includes("instagram")||l.startsWith("@")){const p=l.replace(/^@/,"");r=l.startsWith("http")?l:`https://www.instagram.com/${p}`,d="/icons/instagram-favicon.ico"}else a.includes("facebook")||i.includes("facebook")||i.includes("fb.com")?(r=l.startsWith("http")?l:`https://www.facebook.com/${l.replace(/^\//,"")}`,d="/icons/facebook-favicon.ico"):a.includes("mail")||a.includes("correo")||l.includes("@")&&l.includes(".")?(r=l.startsWith("mailto:")?l:`mailto:${l}`,d="📧"):(a.includes("tel")||a.includes("fono")||/\+?\d/.test(l))&&(r=l.startsWith("tel:")?l:`tel:${l.replace(/\s+/g,"")}`,d="📱");e.push({label:m,value:l,href:r,icon:d})}),e},y=({section:s,loading:n})=>t.jsxs("section",{className:"relative overflow-hidden py-20 bg-soft-gradient-light",children:[s.display_image&&t.jsxs("div",{className:"absolute inset-0 z-0",children:[t.jsx("img",{src:s.display_image,alt:s.display_title,className:"w-full h-full object-cover opacity-20"}),t.jsx("div",{className:"absolute inset-0 bg-gradient-to-b from-white/80 via-white/60 to-white/80"})]}),t.jsxs("div",{className:"relative z-10 px-4 py-16 mx-auto max-w-5xl sm:px-6 lg:px-8 lg:py-24 text-center space-y-6",children:[t.jsx("span",{className:"inline-flex items-center gap-2 px-6 py-3 bg-white/80 backdrop-blur-soft rounded-full shadow-soft-sm border border-white/40 text-primary-600 font-semibold text-sm tracking-wide uppercase",children:n?"Cargando…":"Ponte en contacto"}),t.jsx("h1",{className:"text-4xl sm:text-5xl md:text-6xl font-bold leading-tight text-neutral-900",children:s.display_title}),t.jsx("p",{className:"text-lg sm:text-xl text-neutral-600 font-light leading-relaxed max-w-3xl mx-auto",children:s.display_content}),s.display_cta_label&&s.display_cta_url?t.jsx("a",{href:s.display_cta_url,className:"inline-flex items-center px-8 py-4 rounded-2xl text-white font-semibold text-lg transition-all duration-500",style:{background:"linear-gradient(135deg, #f56934 0%, #e04c1a 50%, #b93c14 100%)"},children:s.display_cta_label}):null]})]}),_=({details:s})=>s.length===0?null:t.jsxs("div",{className:"bg-white/60 backdrop-blur-soft rounded-3xl p-8 shadow-soft-lg border border-white/30",children:[t.jsx("h2",{className:"text-2xl font-bold text-neutral-800 mb-6 text-center",children:"Información de contacto"}),t.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:s.map((n,e)=>{var o,c;return t.jsxs("div",{className:"flex items-start gap-3 p-4 bg-white/40 rounded-xl border border-white/20",children:[(o=n.icon)!=null&&o.startsWith("http")||(c=n.icon)!=null&&c.startsWith("/")?t.jsx("img",{src:n.icon,alt:n.label,className:"w-5 h-5 object-contain"}):t.jsx("span",{className:"text-xl leading-none",children:n.icon??"📍"}),t.jsx("div",{className:"flex-1",children:n.href?t.jsxs("a",{href:n.href,target:"_blank",rel:"noopener noreferrer",className:"block hover:opacity-80 transition-opacity",children:[t.jsx("p",{className:"text-sm font-semibold text-neutral-700 mb-1",children:n.label}),t.jsx("p",{className:"text-sm text-primary-600 hover:underline break-words",children:n.value})]}):t.jsxs(t.Fragment,{children:[t.jsx("p",{className:"text-sm font-semibold text-neutral-700 mb-1",children:n.label}),t.jsx("p",{className:"text-sm text-neutral-600 break-words",children:n.value})]})})]},e)})})]}),b=({section:s})=>!s.display_image&&!s.display_cta_url&&!s.display_content?null:t.jsx("div",{className:"bg-white/60 backdrop-blur-soft rounded-3xl p-8 shadow-soft-lg border border-white/30",children:t.jsxs("div",{className:"flex flex-col lg:flex-row gap-6 items-center",children:[t.jsxs("div",{className:"flex-1 space-y-4",children:[t.jsx("h3",{className:"text-xl font-bold text-neutral-800",children:s.display_title}),t.jsx("p",{className:"text-neutral-600 leading-relaxed",children:s.display_content}),s.display_cta_label&&s.display_cta_url?t.jsx("a",{href:s.display_cta_url,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center px-6 py-3 bg-primary-500 hover:bg-primary-600 text-white font-semibold rounded-xl transition-all duration-300",children:s.display_cta_label}):null]}),s.display_image?t.jsx("div",{className:"flex-1 w-full",children:t.jsx("img",{src:s.display_image,alt:s.display_title,className:"w-full h-full object-cover rounded-2xl"})}):null]})}),N=()=>{const[s,n]=u.useState([]),[e,o]=u.useState(!0);u.useEffect(()=>{let a=!0;return(async()=>{try{console.log("[ContactPage] Fetching contact sections...");const i=await fetch("/api/content?page=contact",{cache:"no-store"});if(console.log("[ContactPage] Response status:",i.status),!i.ok)throw new Error(`HTTP ${i.status}`);const p=await i.json();if(console.log("[ContactPage] Response JSON:",JSON.stringify(p,null,2)),a&&(p!=null&&p.success)){const h=g(p.sections);console.log("[ContactPage] Normalized sections:",JSON.stringify(h,null,2)),n(h)}else console.warn("[ContactPage] Response not successful or missing data")}catch(i){console.warn("[ContactPage] No se pudo obtener contenido dinámico.",i),a&&n([])}finally{a&&o(!1)}})(),()=>{a=!1}},[]);const c=u.useMemo(()=>s.map((a,i)=>({...a,display_title:a.title||`Sección ${i+1}`,display_content:a.content||"",display_image:a.image_url||void 0,display_cta_label:a.cta_label,display_cta_url:a.cta_url})),[s]),x={page:"contact",key:"hero",title:"",content:"",image_url:"",s
1ort_order:0,source_type:"custom",display_title:"",display_content:"",display_image:""},m=c[0]??x,l=c.find(a=>a.key==="contact-info"),r=c.find(a=>a.key==="contact-map"),d=l?f(l.display_content):[];return t.jsxs("div",{className:"min-h-screen bg-soft-gradient-light space-y-10",children:[t.jsx(y,{section:m,loading:e}),t.jsxs("div",{className:"mx-auto max-w-6xl px-4 sm:px-6 lg:px-8 pb-16 space-y-8",children:[d.length>0?t.jsx(_,{details:d}):null,r?t.jsx(b,{section:r}):null]})]})};export{N as ContactPage,N 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.