1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[177],{3193:(e,t,r)=>{"use strict";r.d(t,{default:()=>o});var a=r(5155),s=r(2115),l=r(898),n=r(6532);function o(){let e="https://www.google.com/maps?q=".concat(encodeURIComponent("R. dos Sentinelas, 450 - Parque Santa Teresa, Brazil"),"&output=embed"),[t,r]=(0,s.useState)(!1);return(0,a.jsxs)("footer",{className:"w-full bg-[#8C1D18] border-t border-gray-200",children:[(0,a.jsxs)("div",{className:"max-w-6xl mx-auto px-4 sm:px-6 py-8 flex flex-col md:flex-row gap-6 items-start",children:[(0,a.jsxs)("div",{className:"w-full md:flex-[1.2] min-w-0 flex flex-col items-center order-1 md:order-3",children:[(0,a.jsx)("h3",{className:"text-lg font-semibold mb-2 md:mb-3 text-white",children:"Nosso Endere\xe7o"}),(0,a.jsx)("div",{className:"w-full max-w-md h-40 md:h-56 rounded-md shadow overflow-hidden",children:(0,a.jsx)("iframe",{title:"Mapa - R. dos Sentinelas, 450 - Parque Santa Teresa",src:e,className:"w-full h-full border-0",loading:"lazy","aria-label":"Mapa com marcador para R. dos Sentinelas, 450 - Parque Santa Teresa"})}),(0,a.jsxs)("div",{className:"text-sm mt-1 md:mt-2 text-left text-white",children:[(0,a.jsx)("strong",{children:"Endere\xe7o:"})," R. dos Sentinelas, 450 - Parque Santa Teresa"]})]}),(0,a.jsxs)("div",{className:"w-full md:flex-1 min-w-0 flex flex-col items-center order-2 md:order-2",children:[(0,a.jsx)("h3",{className:"text-lg font-semibold mb-2 md:mb-3 text-white",children:"Fale Conosco"}),(0,a.jsx)("div",{className:"bg-[#8C1D18] rounded-md p-3 md:p-4 shadow mx-auto w-full max-w-md md:max-w-60 border-3 border-white font-bold",children:(0,a.jsxs)("div",{className:"text-sm text-white leading-relaxed",children:[(0,a.jsxs)("div",{className:"flex md:flex-col gap-4 mb-3 md:mb-0",children:[(0,a.jsxs)("div",{className:"flex-1 md:mb-4 text-left md:text-center",children:[(0,a.jsx)("div",{className:"font-medium text-base",children:"Telefones"}),(0,a.jsx)("div",{className:"mt-1 md:mt-2 text-xs md:text-sm",children:"(11) 4186-9900"})]}),(0,a.jsxs)("div",{className:"flex-1 md:mb-4 text-left md:text-center",children:[(0,a.jsx)("div",{className:"font-medium text-base",children:"Emails"}),(0,a.jsx)("div",{className:"mt-1 md:mt-2 text-xs md:text-sm",children:(0,a.jsx)("a",{href:"mailto:[email protected]",className:"underline text-white break-all",children:"[email protected]"})})]})]}),(0,a.jsx)("div",{className:"mt-2 flex justify-center",children:(0,a.jsx)("button",{onClick:()=>r(!0),className:"px-6 py-2 rounded-full bg-white text-[#8C1D18] font-bold hover:opacity-95","aria-haspopup":"dialog",children:"Abrir contato"})})]})})]}),(0,a.jsxs)("div",{className:"w-full md:flex-1 min-w-0 flex flex-col items-center order-3 md:order-1",children:[(0,a.jsx)("h3",{className:"text-lg font-semibold mb-2 md:mb-3 text-white",children:"M\xeddias Sociais"}),(0,a.jsxs)("div",{className:"h-auto flex flex-col gap-1.5 md:gap-2 mt-1 md:mt-2",children:[(0,a.jsxs)("a",{href:"https://www.youtube.com/channel/UC5ZBKIxHTzF8EkCSHiva-lg",target:"_blank",rel:"noopener noreferrer","aria-label":"YouTube",className:"w-60 sm:w-80 relative flex items-center justify-center gap-4 pl-4 sm:pl-12 pr-4 h-10 md:h-12 border border-gray-200 rounded-md bg-white hover:shadow text-base",children:[(0,a.jsx)(l.Vk6,{className:"w-5 h-5 text-[#8C1D18] absolute left-2 sm:left-4","aria-hidden":!0}),(0,a.jsx)("span",{className:"text-[#8C1D18] font-medium text-center",children:"YouTube"})]}),(0,a.jsxs)("a",{href:"https://www.instagram.com/valman_oficial?igsh=aThlMGU1cmxmN20=",target:"_blank",rel:"noopener noreferrer","aria-label":"Instagram",className:"w-60 sm:w-80 relative flex items-center justify-center gap-4 pl-4 sm:pl-12 pr-4 h-10 md:h-12 border border-gray-200 rounded-md bg-white hover:shadow text-base",children:[(0,a.jsx)(l.ao$,{className:"w-5 h-5 text-[#8C1D18] absolute left-2 sm:left-4","aria-hidden":!0}),(0,a.jsx)("span",{className:"text-[#8C1D18] font-medium text-center",children:"Instagram"})]}),(0,a.jsxs)("a",{href:"https://web.facebook.com/people/Valman-Ind%C3%BAstria-Metal%C3%BArgica/100075923079879/",target:"_blank",rel:"noopener noreferrer","aria-label":"Facebook",className:"w-60 sm:w-80 relative flex items-center justify-center gap-4 pl-4 sm:pl-12 pr-4 h-10 md:h-12 border border-gray-200 rounded-md bg-white hover:shadow text-base",children:[(0,a.jsx)(l.ok6,{className:"w-5 h-5 text-[#8C1D18] absolute left-2 sm:left-4","aria-hidden":!0}),(0,a.jsx)("span",{className:"text-[#8C1D18] font-medium text-center",children:"Facebook"})]}),(0,a.jsxs)("a",{href:"https://www.linkedin.com/company/valmanoficial/",target:"_blank",rel:"noopener noreferrer","aria-label":"LinkedIn",className:"w-60 sm:w-80 relative flex items-center justify-center gap-4 pl-4 sm:pl-12 pr-4 h-10 md:h-12 border border-gray-200 rounded-md bg-white hover:shadow text-base",children:[(0,a.jsx)(l.H1h,{className:"w-5 h-5 text-[#8C1D18] absolute left-2 sm:left-4","aria-hidden":!0}),(0,a.jsx)("span",{className:"text-[#8C1D18] font-medium text-center",children:"LinkedIn"})]})]})]})]}),(0,a.jsx)(n.A,{open:t,onClose:()=>r(!1)})]})}},3673:()=>{},3837:(e,t,r)=>{"use strict";r.d(t,{T:()=>l});var a=r(2115),s=r(7138);function l(){let[e,t]=(0,a.useState)([]),[r,l]=(0,a.useState)(!0),[n,o]=(0,a.useState)(null);return(0,a.useEffect)(()=>{let e=!1;return(0,s.jE)().then(r=>{e||(t(r),l(!1))}).catch(t=>{e||(console.error("[useFirestoreCategories] Error:",t),o(t instanceof Error?t:Error(String(t))),l(!1))}),()=>{e=!0}},[]),{categories:e,isLoading:r,error:n}}},4346:(e,t,r)=>{Promise.resolve().then(r.t.bind(r,6168,23)),Promise.resolve().then(r.t.bind(r,3944,23)),Promise.resolve().then(r.t.bind(r,3673,23)),Promise.resolve().then(r.t.bind(r,4209,23)),Promise.resolve().then(r.bind(r,3193)),Promise.resolve().then(r.bind(r,5723))},5300:(e,t,r)=>{"use strict";r.d(t,{IG:()=>i,db:()=>d});var a=r(2078),s=r(2553),l=r(9996),n=r(9708);let o=(0,a.Dk)().length?(0,a.Sx)():(0,a.Wp)({apiKey:"AIzaSyAdoEGjNhu8IdfPNn8xULGZdSqmDkCga80",authDomain:"valman-948a2.firebaseapp.com",projectId:"valman-948a2",storageBucket:"valman-948a2.firebasestorage.app",messagingSenderId:"1096113279835",appId:"1:1096113279835:web:9adee3676605f942ab807e"}),i=null,d=null;try{(0,s.xI)(o),(0,s.xI)(o),i=(0,l.c7)(o),d=(0,n._A)(o,{localCache:(0,n.vK)({tabManager:(0,n.K7)()})})}catch(e){console.warn("Firebase initialization warning:",e)}},5723:(e,t,r)=>{"use strict";r.d(t,{default:()=>g});var a=r(5155),s=r(2115),l=r(63),n=r(2619),o=r.n(n),i=r(6497),d=r(1733),c=r(3837),m=r(7301),u=r(7138),h=r(6532);let x=[{label:"Home",href:"/homepage"},{label:"Empresa",href:"/empresa"},{label:"Not\xedcias",href:"/noticias"},{label:"Certificados",href:"/certificados"},{label:"Proj. Sociais",href:"/projetos-sociais"},{label:"Produtos",href:"/produtos"},{label:"Representantes",href:"/representantes"},{label:"Clientes",href:"/clientes"}],f=[{label:"Home",href:"/homepage"},{label:"Cat\xe1logo",href:"/catalogo"},{label:"Produtos",href:"/produtos"},{label:"Certificados",href:"/certificados"},{label:"Not\xedcias",href:"/noticias"},{label:"Clientes",href:"/clientes"},{label:"Representantes",href:"/representantes"},{label:"Proj. Sociais",href:"/projetos-sociais"},{label:"Empresa",href:"/empresa"}];function p(e){let{mobile:t=!1,onNavigate:r}
1=e,[n,o]=(0,s.useState)(""),[c,m]=(0,s.useState)([]),[h,x]=(0,s.useState)(!1),f=(0,s.useRef)(null),p=(0,s.useRef)(null),b=(0,l.useRouter)();(0,s.useEffect)(()=>{(0,u.j0)().then(m).catch(console.error)},[]);let g=(0,s.useMemo)(()=>{if(!n.trim()||n.trim().length<2)return[];let e=(0,u.fQ)(n);return c.filter(t=>{let r=(0,u.fQ)(t.name||""),a=(0,u.fQ)(String(t.description||"")),s=!1;return t.brands&&(Array.isArray(t.brands)?s=t.brands.some(t=>{let r="string"==typeof t?t:(null==t?void 0:t.name)||(null==t?void 0:t.nome)||"";return(0,u.fQ)(String(r)).includes(e)}):"string"==typeof t.brands&&(s=(0,u.fQ)(t.brands).includes(e))),r.includes(e)||a.includes(e)||s}).slice(0,8)},[n,c]),j=h&&n.trim().length>=2;(0,s.useEffect)(()=>{let e=e=>{p.current&&!p.current.contains(e.target)&&x(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]);let v=(0,s.useCallback)(e=>{var t;let a=e.slug||(t=e.name||"",(0,u.fQ)(t).replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")),s="";Array.isArray(e.categoryIds)&&e.categoryIds.length>0?s=e.categoryIds[0]:"string"==typeof e.categoryId?s=e.categoryId:e.categoryId&&"object"==typeof e.categoryId&&e.categoryId.id&&(s=e.categoryId.id),o(""),x(!1),null==r||r(),s?b.push("/produtos/".concat(s,"/").concat(a)):b.push("/produtos?q=".concat(encodeURIComponent(n)))},[b,n,r]),[w,y]=(0,s.useState)(-1);(0,s.useEffect)(()=>{y(-1)},[g]);let N=(0,s.useCallback)(e=>{if("Escape"===e.key)return void x(!1);if("Enter"===e.key){if(e.preventDefault(),j&&g.length>0&&w>=0)return void v(g[w]);let t=n.trim();return void(t&&(o(""),x(!1),null==r||r(),b.push("/busca?q=".concat(encodeURIComponent(t)))))}j&&0!==g.length&&("ArrowDown"===e.key?(e.preventDefault(),y(e=>Math.min(e+1,g.length-1))):"ArrowUp"===e.key&&(e.preventDefault(),y(e=>Math.max(e-1,0))))},[j,g,w,v,n,b,r]);return(0,a.jsxs)("div",{ref:p,className:"relative ".concat(t?"w-full":"w-full max-w-md"),children:[(0,a.jsxs)("div",{className:"relative flex items-center",children:[(0,a.jsx)("svg",{className:"absolute left-3 h-4 w-4 text-gray-400 pointer-events-none",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})}),(0,a.jsx)("input",{ref:f,type:"text",value:n,onChange:e=>o(e.target.value),onFocus:()=>x(!0),onKeyDown:N,placeholder:"Buscar produtos...",className:"\n w-full pl-9 pr-8 py-2 text-sm rounded-full\n border border-gray-300 bg-gray-50\n focus:outline-none focus:ring-2 focus:ring-[#CC3333]/30 focus:border-[#CC3333]/50 focus:bg-white\n placeholder-gray-400 text-gray-700\n transition-all duration-200\n "}),n&&(0,a.jsx)("button",{onClick:()=>{var e;o(""),null==(e=f.current)||e.focus()},className:"absolute right-3 text-gray-400 hover:text-gray-600 transition-colors",tabIndex:-1,children:(0,a.jsx)("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),(0,a.jsx)(i.N,{children:j&&(0,a.jsx)(d.P.div,{initial:{opacity:0,y:-4},animate:{opacity:1,y:0},exit:{opacity:0,y:-4},transition:{duration:.15},className:"\n absolute left-0 right-0 top-full mt-1 z-[60]\n bg-white border border-gray-200 rounded-lg shadow-xl\n max-h-80 overflow-y-auto\n ",children:g.length>0?(0,a.jsx)("ul",{className:"py-1",children:g.map((e,t)=>{let r=e.thumbnailUrl||e.imageUrl;return(0,a.jsx)("li",{children:(0,a.jsxs)("button",{onClick:()=>v(e),onMouseEnter:()=>y(t),className:"\n w-full flex items-center gap-3 px-4 py-2.5 text-left\n transition-colors duration-100\n ".concat(t===w?"bg-red-50":"hover:bg-gray-50","\n "),children:[(0,a.jsx)("div",{className:"w-10 h-10 rounded bg-gray-100 flex-shrink-0 overflow-hidden flex items-center justify-center",children:r?(0,a.jsx)("img",{src:r,alt:"",className:"w-full h-full object-contain",loading:"lazy"}):(0,a.jsx)("svg",{className:"w-5 h-5 text-gray-300",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z"})})}),(0,a.jsx)("div",{className:"flex-1 min-w-0",children:(0,a.jsx)("p",{className:"text-sm font-medium text-gray-800 truncate",children:e.name})}),(0,a.jsx)("svg",{className:"w-4 h-4 text-gray-300 flex-shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})})]})},e.id)})}):(0,a.jsxs)("div",{className:"px-4 py-6 text-center",children:[(0,a.jsx)("svg",{className:"mx-auto h-8 w-8 text-gray-300 mb-2",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})}),(0,a.jsxs)("p",{className:"text-sm text-gray-500",children:['Nenhum produto encontrado para "',n,'"']})]})})})]})}let b=()=>{var e;
1let[t,r]=(0,s.useState)(!1),[n,i]=(0,s.useState)(!1),[u,b]=(0,s.useState)(!1),{categories:g,isLoading:j}=(0,c.T)(),{catalogs:v}=(0,m.tk)(),w=(0,l.useRouter)(),y=(0,l.usePathname)(),N=v&&v.length>0&&(null==(e=v.find(e=>e.pdfUrl))?void 0:e.pdfUrl)||"",k=e=>{r(!1),N||(e.preventDefault(),alert("Aguarde o carregamento do cat\xe1logo."))};return(0,s.useEffect)(()=>{window.innerWidth<768&&r(!1)},[y]),(0,s.useEffect)(()=>{if("undefined"!=typeof document)return t?document.body.style.overflow="hidden":document.body.style.overflow="",()=>{document.body.style.overflow=""}},[t]),(0,a.jsxs)("header",{className:"w-full border-b bg-white sticky top-0 z-50",children:[(0,a.jsx)("div",{children:(0,a.jsxs)("div",{className:"flex h-20 items-center justify-between px-6 gap-4",children:[(0,a.jsx)(o(),{href:"/",className:"flex items-center flex-shrink-0",children:(0,a.jsx)("img",{src:"/images/logo.png",alt:"Valman LTDA",className:"h-10 md:h-14 w-auto"})}),(0,a.jsxs)("a",{href:N||"#",target:"_blank",rel:"noopener noreferrer",onClick:k,className:"md:hidden flex-shrink-0 rounded-md bg-[#CC3333] px-5 py-3 text-xs font-bold uppercase leading-tight tracking-wide text-white text-center hover:bg-red-700 transition-colors",children:["Cat\xe1logo",(0,a.jsx)("br",{}),"Completo"]}),(0,a.jsx)("div",{className:"hidden md:flex flex-1 justify-center px-4",children:(0,a.jsx)(p,{})}),(0,a.jsxs)("div",{className:"hidden md:flex items-center gap-3 flex-shrink-0",children:[(0,a.jsx)("a",{href:N||"#",target:"_blank",rel:"noopener noreferrer",onClick:k,className:"rounded-full bg-[#CC3333] px-6 py-2 text-xs font-bold uppercase tracking-widest text-white transition-colors hover:bg-red-700",children:"Cat\xe1logo Completo"}),(0,a.jsx)("button",{onClick:()=>i(!0),className:"rounded-full border-2 border-[#CC3333] px-6 py-2 text-xs font-bold uppercase tracking-widest text-[#CC3333] transition-colors hover:bg-red-50",children:"Contate-nos"}),(0,a.jsx)("a",{href:"http://databook.valman.com.br",target:"_blank",rel:"noopener noreferrer",className:"rounded-full bg-[#CC3333] px-6 py-2 text-xs font-bold uppercase tracking-widest text-white transition-colors hover:bg-red-700",children:"Databooks"})]}),(0,a.jsx)("div",{className:"mr-2 flex md:hidden print:hidden",children:(0,a.jsx)("button",{onClick:()=>r(e=>!e),"aria-expanded":t,"aria-label":"Toggle menu",className:"inline-flex items-center justify-center p-2 rounded-md text-black hover:bg-gray-100 focus:outline-none",children:(0,a.jsx)("svg",{className:"h-6 w-6",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:t?(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"}):(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 6h16M4 12h16M4 18h16"})})})})]})}),(0,a.jsx)("div",{className:"md:hidden border-t h-12 px-6 flex items-center",children:(0,a.jsx)(p,{mobile:!0,onNavigate:()=>r(!1)})}),(0,a.jsx)("div",{className:"hidden border-t xl:block",children:(0,a.jsx)("div",{className:"mx-auto flex max-w-7xl justify-center",children:(0,a.jsx)("nav",{className:"flex items-center gap-6 py-4 text-xs font-semibold uppercase tracking-widest text-slate-800",children:x.map(e=>"Produtos"===e.label?(0,a.jsxs)("div",{className:"relative",onMouseEnter:()=>b(!0),onMouseLeave:()=>b(!1),children:[(0,a.jsx)(o(),{href:e.href,className:"transition-colors hover:text-[#CC3333]",children:(0,a.jsx)("span",{className:"inline-block px-1",children:e.label})}),u&&(0,a.jsx)("div",{className:"absolute left-0 top-full w-64 sm:w-64 max-h-80 overflow-y-auto bg-white/80 backdrop-blur-sm shadow-lg border border-gray-200/60 rounded-sm",onMouseEnter:()=>b(!0),onMouseLeave:()=>b(!1),children:(0,a.jsxs)("div",{className:"flex",children:[(0,a.jsx)("div",{className:"w-1 bg-[#CC3333]"}),(0,a.jsx)("div",{className:"flex-1 p-3",children:j?(0,a.jsx)("div",{className:"text-sm text-gray-600",children:"Carregando..."}):(0,a.jsx)("ul",{className:"space-y-2",children:g&&g.length>0?[...g].sort((e,t)=>{let r=String(e.name||"").toLowerCase(),a=String(t.name||"").toLowerCase();return r.localeCompare(a)}).map(e=>{let t=String(e.id||e.slug||e.name),r="/produtos/".concat(encodeURIComponent(t));return(0,a.jsx)("li",{children:(0,a.jsx)("button",{className:"text-left w-full block text-sm text-slate-800 hover:text-[#CC3333] px-2",onClick:()=>w.push(r),children:e.name})},e.id)}):(0,a.jsx)("li",{className:"text-sm text-gray-600",children:"Nenhuma categoria"})})})]})})]},e.label):"Cat\xe1logo"===e.label||"/catalogo"===e.href?(0,a.jsx)("a",{href:N||"#",target:"_blank",rel:"noopener noreferrer",onClick:k,className:"transition-colors hover:text-[#CC3333]",children:e.label},e.label):(0,a.jsx)(o(),{href:e.href,className:"transition-colors hover:text-[#CC3333]",children:e.label},e.label))})})}),t&&(0,a.jsx)(d.P.div,{className:"md:hidden fixed inset-0 top-32 bg-black/80 backdrop-blur-sm z-40",initial:{opacity:0}
1,animate:{opacity:1},exit:{opacity:0},transition:{duration:.2},children:(0,a.jsx)("div",{className:"px-6 pt-3 pb-3",children:f.map(e=>"Cat\xe1logo"===e.label||"/catalogo"===e.href?(0,a.jsx)("a",{href:N||"#",target:"_blank",rel:"noopener noreferrer",onClick:k,className:"block px-4 py-2.5 text-base font-medium uppercase tracking-widest text-white hover:text-[#CC3333] transition-colors border-b border-white/20",children:e.label},e.label):(0,a.jsx)(o(),{href:e.href,onClick:()=>r(!1),className:"block px-4 py-2.5 text-base font-medium uppercase tracking-widest text-white hover:text-[#CC3333] transition-colors border-b border-white/20",children:e.label},e.label))})}),(0,a.jsx)(h.A,{open:n,onClose:()=>i(!1)})]})};function g(e){let{children:t}=e;return["/","/login","/unauthorized"].includes((0,l.usePathname)()||""),(0,a.jsxs)("div",{className:"min-h-screen bg-gray-100",children:[(0,a.jsx)(b,{}),(0,a.jsx)("div",{className:"mx-auto flex w-full max-w-7xl px-4 py-4 md:px-6 md:py-6",children:(0,a.jsx)("main",{className:"w-full",children:t})})]})}},6532:(e,t,r)=>{"use strict";r.d(t,{A:()=>l});var a=r(5155),s=r(2115);function l(e){let{open:t,onClose:r}=e,[l,n]=(0,s.useState)(""),[o,i]=(0,s.useState)(""),[d,c]=(0,s.useState)(""),[m,u]=(0,s.useState)(""),[h,x]=(0,s.useState)({}),[f,p]=(0,s.useState)(!1),[b,g]=(0,s.useState)("idle");if(!t)return null;async function j(e){if(e.preventDefault(),function(){let e={};return l.trim()||(e.nome="Nome \xe9 obrigat\xf3rio"),o.trim()?/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(o)||(e.email="Email inv\xe1lido"):e.email="Email \xe9 obrigat\xf3rio",m.trim()||(e.mensagem="Mensagem \xe9 obrigat\xf3ria"),x(e),0===Object.keys(e).length}()){p(!0),g("idle");try{if(!(await fetch("/api/contact",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({nome:l,email:o,telefone:d,mensagem:m})})).ok)throw Error("Erro na requisi\xe7\xe3o");g("success"),setTimeout(()=>{v(),r(),g("idle")},2e3)}catch(e){console.error(e),g("error")}finally{p(!1)}}}function v(){n(""),i(""),c(""),u(""),x({}),g("idle")}return(0,a.jsx)("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50 p-4",role:"dialog","aria-modal":"true",children:(0,a.jsxs)("div",{className:"w-full max-w-sm md:max-w-[600px] bg-white rounded-2xl p-4 sm:p-7 shadow-lg text-[#6b2621] font-sans max-h-[90vh] overflow-y-auto",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-6",children:[(0,a.jsx)("h3",{className:"m-0 text-xl font-semibold text-[#912d28]",children:"Entre em Contato"}),(0,a.jsx)("button",{onClick:r,className:"text-[#912d28] text-2xl leading-none hover:opacity-80","aria-label":"Fechar",children:"\xd7"})]}),(0,a.jsxs)("form",{onSubmit:j,children:[(0,a.jsxs)("div",{className:"mb-4",children:[(0,a.jsx)("label",{className:"block text-xs tracking-wide mb-1 font-semibold",children:"Nome (Obrigat\xf3rio)"}),(0,a.jsx)("input",{value:l,onChange:e=>n(e.target.value),disabled:f,className:"w-full p-2 rounded-lg border bg-white focus:outline-none focus:ring-2 focus:ring-[#f0d4d3] ".concat(h.nome?"border-red-500":"border-[#e0bebe]"),placeholder:"Seu nome"}),h.nome&&(0,a.jsx)("div",{className:"text-sm text-red-600 mt-1",children:h.nome})]}),(0,a.jsxs)("div",{className:"flex flex-col md:flex-row gap-4 mb-4",children:[(0,a.jsxs)("div",{className:"flex-1",children:[(0,a.jsx)("label",{className:"block text-xs tracking-wide mb-1 font-semibold",children:"Email (Obrigat\xf3rio)"}),(0,a.jsx)("input",{value:o,onChange:e=>i(e.target.value),disabled:f,className:"w-full p-2 rounded-lg border bg-white focus:outline-none focus:ring-2 focus:ring-[#f0d4d3] ".concat(h.email?"border-red-500":"border-[#e0bebe]"),placeholder:"[email protected]"}),h.email&&(0,a.jsx)("div",{className:"text-sm text-red-600 mt-1",children:h.email})]}),(0,a.jsxs)("div",{className:"flex-1",children:[(0,a.jsx)("label",{className:"block text-xs tracking-wide mb-1 font-semibold",children:"Telefone"}),(0,a.jsx)("input",{value:d,onChange:e=>c(e.target.value),disabled:f,className:"w-full p-2 rounded-lg border border-[#e0bebe] bg-white focus:outline-none focus:ring-2 focus:ring-[#f0d4d3]",placeholder:"(11) 99999-9999"})]})]}),(0,a.jsxs)("div",{className:"mb-6",children:[(0,a.jsx)("label",{className:"block text-xs tracking-wide mb-1 font-semibold",children:"Mensagem"}),(0,a.jsx)("textarea",{value:m,onChange:e=>u(e.target.value),disabled:f,className:"w-full p-2 rounded-lg border min-h-[120px] resize-y focus:outline-none focus:ring-2 focus:ring-[#f0d4d3] ".concat(h.mensagem?"border-red-500":"border-[#e0bebe]"),placeholder:"Como podemos ajudar?"}),h.mensagem&&(0,a.jsx)("div",{className:"text-sm text-red-600 mt-1",children:h.mensagem})]}),(0,a.jsxs)("div",{className:"flex flex-col-reverse md:flex-row items-center justify-end gap-3 w-full border-t border-gray-100 pt-4",children:[(0,a.jsx)("button",{type:"button",onClick:v,disabled:f,className:"w-full md:w-auto px-5 py-2 rounded-full border border-[#c97e7b] text-[#912d28] hover:bg-[#fff5f4] disabled:opacity-50",children:"Limpar"}),(0,a.jsx)("button",{type:"submit",disabled:f,className:"w-full md:w-auto px-6 py-2 rounded-full bg-gradient-to-b from-[#a73732] to-[#7d1f1c] text-white hover:opacity-95 disabled:opacity-70 flex items-center justify-center gap-2",children:f?(0,a.jsx)(a.Fragment,{children:"Enviando..."}):"Enviar Mensagem"})]}),"success"===b&&(0,a.jsx)("div",{className:"mt-4 p-3 bg-green-50 border border-green-200 text-green-700 rounded-lg text-sm text-center",children:"â
Mensagem enviada com sucesso!"}),"error"===b&&(0,a.jsx)("div",{className:"mt-4 p-3 bg-red-50 border border-red-200 text-red-700 rounded-lg text-sm text-center",children:"â Erro ao enviar. Tente novamente mais tarde."})]})]})})}},7138:(e,t,r)=>{"use strict";r.d(t,{$3:()=>k,Dc:()=>S,Yn:()=>A,al:()=>C,b3:()=>L,fQ:()=>w,j0:()=>N,jE:()=>y,jY:()=>E});var a=r(9708),s=r(5300);let l=null,n=null,o=null,i=null,d=null,c=null,m=null,u=null,h=null,x=null,f=null,p=null,b=null,g=null,j=null,v=null;function w(e){return e.toString().normalize("NFD").replace(RegExp("\\p{Diacritic}","gu"),"").toLowerCase().trim()}async function y(){return l||(n||(n=(0,a.GG)((0,a.rJ)(s.db,"category")).then(e=>{let t=e.docs.map(e=>{let t=e.data();return{...t,id:e.id,name:t.name||t.title||""}});return t.sort((e,t)=>
1{let r=w(e.name||""),a=w(t.name||"");return r.localeCompare(a,"pt-BR")}),l=t,t})),n)}async function N(){return o||(i||(i=(0,a.GG)((0,a.rJ)(s.db,"products")).then(e=>{let t=e.docs.map(e=>{let t=e.data();return{...t,id:e.id,name:t.name||t.title||""}});return t.sort((e,t)=>{let r=w(e.name||""),a=w(t.name||"");return r.localeCompare(a,"pt-BR")}),o=t,t})),i)}async function k(){return d||(c||(c=(0,a.GG)((0,a.rJ)(s.db,"clients")).then(e=>d=e.docs.map(e=>({id:e.id,...e.data()})))),c)}async function C(){return h||(x||(x=(0,a.GG)((0,a.rJ)(s.db,"socialProjects")).then(e=>h=e.docs.map(e=>({id:e.id,...e.data()})))),x)}async function S(){return b||(g||(g=(0,a.GG)((0,a.rJ)(s.db,"certificates")).then(e=>b=e.docs.map(e=>{let t=e.data(),r="string"==typeof t.name?t.name:"string"==typeof t.title?t.title:null,a="string"==typeof t.pdfUrl?t.pdfUrl:"string"==typeof t.pdf?t.pdf:"string"==typeof t.file?t.file:"string"==typeof t.url?t.url:null,s=null;return"string"==typeof t.imageUrl?s=t.imageUrl:"string"==typeof t.image?s=t.image:Array.isArray(t.images)&&t.images.length&&"string"==typeof t.images[0]&&(s=t.images[0]),{id:e.id,name:r,pdfUrl:a,imageUrl:s}}))),g)}async function E(){return f||(p||(p=(0,a.GG)((0,a.rJ)(s.db,"catalogs")).then(e=>{let t=e.docs.map(e=>({id:e.id,...e.data()}));return t.sort((e,t)=>{let r=e=>{var t;return(null==(t=e.createdAt)?void 0:t.seconds)||(e.createdAt instanceof Date?e.createdAt.getTime()/1e3:0)};return r(t)-r(e)}),f=t})),p)}async function L(){return j||(v||(v=(0,a.GG)((0,a.rJ)(s.db,"carousel")).then(e=>{let t=e.docs.map(e=>({id:e.id,...e.data()}));return t.sort((e,t)=>{let r=e=>{var t;return(null==(t=e.createdAt)?void 0:t.seconds)||(e.createdAt instanceof Date?e.createdAt.getTime()/1e3:0)};return r(t)-r(e)}),j=t})),v)}async function A(){return m||(u||(u=(0,a.GG)((0,a.rJ)(s.db,"news")).then(e=>m=e.docs.map(e=>{let t=e.data(),r="string"==typeof t.title?t.title:"string"==typeof t.name?t.name:null,a="string"==typeof t.excerpt&&t.excerpt.trim()?t.excerpt:"string"==typeof t.content?t.content.substring(0,150)+"...":"string"==typeof t.description?t.description.substring(0,150)+"...":null,s="string"==typeof t.date?t.date:null,l=null;"string"==typeof t.imageUrl?l=t.imageUrl:"string"==typeof t.image?l=t.image:Array.isArray(t.images)&&t.images.length&&"string"==typeof t.images[0]&&(l=t.images[0]);let n="string"==typeof t.mediaUrl?t.mediaUrl:null;if(!n&&Array.isArray(t.mediaList)&&t.mediaList.length){let e=t.mediaList[0];"string"==typeof e?n=e:e&&e.url&&(n=e.url)}let o="string"==typeof t.href?t.href:"string"==typeof t.url?t.url:"#",i="string"==typeof t.content?t.content:null,d="string"==typeof t.description?t.description:null;return{id:e.id,title:r,excerpt:a,content:i,description:d,imageUrl:l,mediaUrl:n,createdAt:t.createdAt,date:s,href:o}}))),u)}},7301:(e,t,r)=>{"use strict";r.d(t,{My:()=>c,Qh:()=>n,Tt:()=>o,f_:()=>l,nu:()=>d,tk:()=>i});var a=r(2115),s=r(7138);function l(){let[e,t]=(0,a.useState)([]),[r,l]=(0,a.useState)(!0),[n,o]=(0,a.useState)(null);return(0,a.useEffect)(()=>{let e=!1;return(0,s.$3)().then(r=>{e||(t(r),l(!1))}).catch(t=>{e||(o(t),l(!1))}),()=>{e=!0}},[]),{clients:e,isLoading:r,error:n}}function n(){let[e,t]=(0,a.useState)([]),[r,l]=(0,a.useState)(!0),[n,o]=(0,a.useState)(null);return(0,a.useEffect)(()=>{let e=!1;return(0,s.al)().then(r=>{e||(t(r),l(!1))}).catch(t=>{e||(o(t),l(!1))}),()=>{e=!0}},[]),{socialProjects:e,isLoading:r,error:n}}function o(){let[e,t]=(0,a.useState)([]),[r,l]=(0,a.useState)(!0),[n,o]=(0,a.useState)(null);return(0,a.useEffect)(()=>{let e=!1;return(0,s.Dc)().then(r=>{e||(t(r),l(!1))}).catch(t=>{e||(o(t),l(!1))}),()=>{e=!0}},[]),{certificates:e,isLoading:r,error:n}}function i(){let[e,t]=(0,a.useState)([]),[r,l]=(0,a.useState)(!0),[n,o]=(0,a.useState)(null);return(0,a.useEffect)(()=>{let e=!1;return(0,s.jY)().then(r=>{e||(t(r),l(!1))}).catch(t=>{e||(o(t),l(!1))}),()=>{e=!0}},[]),{catalogs:e,isLoading:r,error:n}}function d(){let[e,t]=(0,a.useState)([]),[r,l]=(0,a.useState)(!0),[n,o]=(0,a.useState)(null);return(0,a.useEffect)(()=>{let e=!1;return(0,s.b3)().then(r=>{e||(t(r),l(!1))}).catch(t=>{e||(o(t),l(!1))}),()=>{e=!0}},[]),{carouselItems:e,isLoading:r,error:n}}function c(){let[e,t]=(0,a.useState)([]),[r,l]=(0,a.useState)(!0),[n,o]=(0,a.useState)(null);return(0,a.useEffect)(()=>{let e=!1;return(0,s.Yn)().then(r=>{e||(t(r),l(!1))}).catch(t=>{e||(o(t),l(!1))}),()=>{e=!0}},[]),{news:e,isLoading:r,error:n}}}},e=>{e.O(0,[652,122,135,204,711,31,619,979,441,255,358],()=>e(e.s=4346)),_N_E=e.O()}]);
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.