import{j as e}from"./ui-vendor-D7Fh8Ky-.js";import{u as a}from"./useQuery-CVQmtqFg.js";import{B as s,t as o,s as t,H as i}from"./index--q9pcdAZ.js";import{H as r}from"./Header-CDlt40OO.js";import{F as n}from"./Footer-C1C81Pws.js";import{S as c}from"./SEOHead-YTlsfBRz.js";import{s as l,p as d,t as m,C as u,T as h}from"./cityTldrVariants-_Mx-BcfH.js";import{r as p,e as v}from"./react-vendor-1IeSgoWF.js";import{I as x}from"./input-CXAAeI1i.js";import{L as f}from"./label-BEHDRi30.js";import{T as g}from"./textarea-BngVFzn8.js";import{f as j,v as b,a as y,b as N}from"./validators-B6ObMgjW.js";import{r as w}from"./registrarLead-Dw0HT5Fo.js";import{K as S,L as _,g as C,S as q,k as A}from"./icons-hyxClt4Z.js";import{A as k,a as $,b as E,c as L}from"./accordion-N-LIf9yg.js";import"./supabase-vendor-Dr45T5gF.js";import"./logo-oficial-BW9aD_Pb.js";import"./alert-BK1Zysgl.js";function I({citySlug:a,cityName:i,state:r,pickupLocation:n}){const[c,d]=p.useState(!1),[m,u]=p.useState({nome:"",email:"",telefone:"",vehicleInfo:"",observations:""});return e.jsxs("form",{onSubmit:async e=>{e.preventDefault();const s=b(m.nome);if(!s.valid)return void o({title:"Erro no nome",description:s.message,variant:"destructive"});const c=y(m.email);if(!c.valid)return void o({title:"Erro no e-mail",description:c.message,variant:"destructive"});const h=N(m.telefone);if(!h.valid)return void o({title:"Erro no telefone",description:h.message,variant:"destructive"});if(!n)return void o({title:"Localização não selecionada",description:"Por favor, selecione sua localização no mapa acima.",variant:"destructive"});d(!0);let p=null,v=null,x=null;try{const{error:e}=await t.from("locksmith_requests").insert({city_slug:a,city_name:i,state:r,client_name:m.nome,client_email:m.email,client_phone:m.telefone,pickup_address:n.address,latitude:n.latitude,longitude:n.longitude,vehicle_info:m.vehicleInfo||null,observations:m.observations||null,status:"novo"});try{const e=await l({nome:m.nome,email:m.email,telefone:m.telefone,lat:n.latitude,lng:n.longitude,endereco:n.address,tipoServico:"abertura_veiculo",observacoes:[m.vehicleInfo,m.observations].filter(Boolean).join(" — ")||void 0});p=(null==e?void 0:e.service_request_id)||null,v=(null==e?void 0:e.request_number)||null,(p||v)&&await t.from("locksmith_requests").update({external_quotation_id:p,external_conversation_id:v}).eq("client_email",m.email).eq("client_phone",m.telefone).order("created_at",{ascending:!1}).limit(1)}catch(f){x=f.message||"Erro de comunicação com API"}x&&await t.from("locksmith_requests").update({status:"pendente_externo",observations:`${m.observations||""}\n\n[ERRO API EXTERNA]: ${x}`.trim()}).eq("client_email",m.email).eq("client_phone",m.telefone).order("created_at",{ascending:!1}).limit(1);try{await w({formId:"chaveiro_form",nome:m.nome,email:m.email,telefone:m.telefone,servico:"chaveiro",cidade:i,extra:{estado:r}})}catch(g){}o({title:"Solicitação recebida com sucesso!",description:x?"Recebemos sua solicitação e nossa equipe entrará em contato em instantes.":"Você receberá uma mensagem no WhatsApp com um chaveiro disponível."}),u({nome:"",email:"",telefone:"",vehicleInfo:"",observations:""})}catch(j){o({title:"Erro ao enviar solicitação",description:j.message||"Tente novamente mais tarde.",variant:"destructive"})}finally{d(!1)}},className:"space-y-6 bg-card p-6 rounded-lg border border-border",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(S,{className:"h-6 w-6 text-primary"}),e.jsx("h3",{className:"text-2xl font-bold",children:"Solicite um Chaveiro"})]}),e.jsx("p",{className:"text-muted-foreground",children:"Trancou a chave no carro? Preencha os dados e receba atendimento imediato"})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(f,{htmlFor:"nome",children:"Nome *"}),e.jsx(x,{id:"nome",name:"nome",placeholder:"Seu nome",value:m.nome,onChange:e=>u({...m,nome:e.target.value}),required:!0})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(f,{htmlFor:"email",children:"E-mail *"}),e.jsx(x,{id:"email",name:"email",type:"email",placeholder:"seu@email.com",value:m.email,onChange:e=>u({...m,email:e.target.value}),required:!0})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(f,{htmlFor:"telefone",children:"Telefone *"}),e.jsx(x,{id:"telefone",name:"telefone",type:"tel",placeholder:"(00) 00000-0000",value:m.telefone,onChange:e=>u({...m,telefone:e.target.value}),onBlur:e=>u({...m,telefone:j(e.target.value)}),required:!0})]}),n&&e.jsxs("div",{className:"space-y-2",children:[e.jsx(f,{children:"Localização do veículo"}),e.jsx("div",{className:"p-3 bg-muted rounded-md text-sm",children:n.address})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(f,{htmlFor:"vehicleInfo",children:"Informações do veículo (opcional)"}),e.jsx(x,{id:"vehicleInfo",placeholder:"Ex: Gol Prata 2020, Placa ABC-1234",value:m.vehicleInfo,onChange:e=>u({...m,vehicleInfo:e.target.value})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Modelo, cor e placa ajudam o chaveiro a localizar seu veículo"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(f,{htmlFor:"observations",children:"Observações (opcional)"}),e.jsx(g,{id:"observations",placeholder:"Informações adicionais sobre a situação",value:m.observations,onChange:e=>u({...m,observations:e.target.value}),rows:3})]})]}),e.jsx(s,{type:"submit",className:"w-full",size:"lg",disabled:c,children:c?e.jsxs(e.Fragment,{children:[e.jsx(_,{className:"mr-2 h-4 w-4 animate-spin"}),"Enviando..."]}):"Chamar Chaveiro Agora"}),e.jsx("p",{className:"text-xs text-muted-foreground text-center",children:"Ao enviar, você concorda com nossa política de privacidade"})]})}function O(){const{citySlug:s}=v(),[o,l]=p.useState("client"),[x,f]=p.useState(),g=d(s||""),{data:j}=a({queryKey:["locksmith-city-page",s],queryFn:async()=>{const{data:e,error:a}=await t.from("locksmith_city_pages").select("*").eq("slug",s).eq("is_active",!0).maybeSingle();if(a)throw a;return e}}),{data:b}=a({queryKey:["city-demographics",s],queryFn:async()=>{const{data:e,error:a}=await t.from("city_demographics").select("*").eq("slug",s||"").maybeSingle();return a?null:e??null},staleTime:36e5,enabled:!!s});p.useEffect(()=>{(null==j?void 0:j.id)&&s&&t.rpc("increment_city_page_view",{p_service:"chaveiro",p_slug:s})},[null==j?void 0:j.id,s]);const y=(null==j?void 0:j.city_name)||g.cityName,N=(null==j?void 0:j.state_abbreviation)||g.stateAbbreviation,w=(null==j?void 0:j.state)||g.state,_=(null==j?void 0:j.hero_title)||`Chaveiro Automotivo 24h em ${y}`,O=(null==j?void 0:j.hero_subtitle)||m(s||"","chaveiro",b??null,y,N),P=(null==j?void 0:j.meta_title)||`Chaveiro em ${y} - ${N} | Atendimento 24h`,z=`Precisa de chaveiro automotivo em ${y}? Atendimento 24h para abertura de veículos, cópia de chaves e fechaduras. Ligue: 0800-111-8686.`,T=`/chaveiro/${s||""}`,F={"@context":"https://schema.org","@type":"City",name:y,containedInPlace:{"@type":"State",name:w},address:{"@type":"PostalAddress",addressLocality:y,addressRegion:N,addressCountry:"BR"}};null!=(null==b?void 0:b.population)&&(F.populationCount=b.population);const H={"@context":"https://schema.org","@type":"LocalBusiness",name:`Chaveiro Automotivo 24h em ${y}`,description:z,url:`https://semprecomigo.com.br/chaveiro/${s}`,telephone:"0800-111-8686",address:{"@type":"PostalAddress",addressLocality:y,addressRegion:N,addressCountry:"BR"},areaServed:F,parentOrganization:{"@type":"Organization",name:"Sempre Comigo"},openingHoursSpecification:{"@type":"OpeningHoursSpecification",dayOfWeek:["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],opens:"00:00",closes:"23:59"}},Q={"@context":"https://schema.org","@type":"BreadcrumbList",itemListElement:[{"@type":"ListItem",position:1,name:"Home",item:"https://semprecomigo.com.br"},{"@type":"ListItem",position:2,name:"Chaveiro",item:"https://semprecomigo.com.br/assistencia-24h"},{"@type":"ListItem",position:3,name:y,item:`https://semprecomigo.com.br/chaveiro/${s}`}]};return e.jsxs("div",{className:"min-h-screen bg-background",children:[e.jsx(c,{title:P,description:z,canonical:T,keywords:`chaveiro ${y.toLowerCase()}, chaveiros em ${y.toLowerCase()}, chaveiro automotivo ${y.toLowerCase()}, chaveiro 24h ${y.toLowerCase()}, chaveiro veicular, abertura de veículo ${N}, chaveiro mais próximo`}),e.jsxs(i,{children:[e.jsx("script",{type:"application/ld+json",children:JSON.stringify(H)}),e.jsx("script",{type:"application/ld+json",children:JSON.stringify(Q)}),e.jsx("script",{type:"application/ld+json",children:JSON.stringify(F)})]}),e.jsx(r,{viewMode:o,onViewModeChange:l,showViewModeToggle:!1}),e.jsxs("section",{className:"relative h-[50vh] min-h-[400px] overflow-hidden bg-gradient-to-br from-primary via-primary/90 to-primary/70",children:[e.jsx("div",{className:"absolute inset-0 bg-black/30"}),e.jsx("div",{className:"absolute inset-0 flex items-center justify-center z-10",children:e.jsxs("div",{className:"text-center text-white px-4 max-w-4xl",children:[e.jsx("div",{className:"inline-flex items-center justify-center w-20 h-20 bg-white/20 rounded-full mb-6",children:e.jsx(S,{className:"h-10 w-10 text-white"})}),e.jsx("h1",{className:"text-4xl md:text-5xl lg:text-6xl font-bold mb-4",children:_}),e.jsx("p",{className:"text-xl md:text-2xl mb-8",children:O}),e.jsx("a",{href:"#formulario",className:"inline-block",children:e.jsx("button",{className:"bg-white hover:bg-white/90 text-primary px-8 py-4 rounded-lg text-lg font-semibold transition-colors",children:"Chamar Chaveiro Agora"})})]})})]}),e.jsx(u,{city:b??null,cityName:y,stateAbbr:N}),e.jsx("section",{className:"py-16 bg-muted/30",children:e.jsx("div",{className:"container mx-auto px-4",children:e.jsxs("div",{className:"grid md:grid-cols-3 gap-8",children:[e.jsxs("div",{className:"flex items-start gap-4",children:[e.jsx(C,{className:"h-8 w-8 text-primary flex-shrink-0"}),e.jsxs("div",{children:[e.jsx("h3",{className:"font-bold text-lg mb-2",children:"Atendimento 24h"}),e.jsx("p",{className:"text-muted-foreground",children:"Estamos disponíveis todos os dias, a qualquer hora"})]})]}),e.jsxs("div",{className:"flex items-start gap-4",children:[e.jsx(q,{className:"h-8 w-8 text-primary flex-shrink-0"}),e.jsxs("div",{children:[e.jsx("h3",{className:"font-bold text-lg mb-2",children:"Abertura Sem Danos"}),e.jsx("p",{className:"text-muted-foreground",children:"Técnicas profissionais que preservam seu veículo"})]})]}),e.jsxs("div",{className:"flex items-start gap-4",children:[e.jsx(A,{className:"h-8 w-8 text-primary flex-shrink-0"}),e.jsxs("div",{children:[e.jsx("h3",{className:"font-bold text-lg mb-2",children:"Profissionais Especializados"}),e.jsx("p",{className:"text-muted-foreground",children:"Equipe treinada em abertura de veículos de todas as marcas"})]})]})]})})}),e.jsx("section",{id:"formulario",className:"py-16",children:e.jsx("div",{className:"container mx-auto px-4",children:e.jsxs("div",{className:"grid lg:grid-cols-2 gap-8 items-start",children:[e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-3xl font-bold mb-4",children:"Onde está seu veículo?"}),e.jsx("p",{className:"text-muted-foreground",children:"Detectamos automaticamente sua localização para enviar o chaveiro mais próximo"})]}),e.jsx(h,{onLocationSelect:f})]}),e.jsx("div",{className:"lg:sticky lg:top-4",children:e.jsx(I,{citySlug:s,cityName:y,state:w,pickupLocation:x})})]})})}),e.jsxs("section",{className:"py-12 bg-muted/20",children:[e.jsx(i,{children:e.jsx("script",{type:"application/ld+json",children:JSON.stringify({"@context":"https://schema.org","@type":"FAQPage",mainEntity:[{"@type":"Question",name:`Quanto custa um chaveiro automotivo em ${y}?`,acceptedAnswer:{"@type":"Answer",text:`O preço do chaveiro em ${y} varia conforme o tipo de veículo, complexidade da fechadura e horário do atendimento. Ligue para 0800 111 8686 para cotação imediata.`}},{"@type":"Question",name:`O chaveiro em ${y} funciona 24 horas?`,acceptedAnswer:{"@type":"Answer",text:`Sim. Nosso chaveiro automotivo em ${y} atende 24 horas por dia, 7 dias por semana, incluindo feriados.`}},{"@type":"Question",name:"O chaveiro abre o veículo sem danificar a fechadura?",acceptedAnswer:{"@type":"Answer",text:`Sim. Em ${y} usamos técnicas profissionais de abertura que preservam a fechadura e a porta do veículo. Trabalhamos com todas as marcas.`}},{"@type":"Question",name:`Atendem a região metropolitana de ${y}?`,acceptedAnswer:{"@type":"Answer",text:`Sim. Cobrimos ${y} e toda a região metropolitana. Confirme a área exata pelo 0800 111 8686 antes de acionar o serviço.`}},{"@type":"Question",name:`Quais formas de pagamento aceitam para chaveiro em ${y}?`,acceptedAnswer:{"@type":"Answer",text:`Em ${y} aceitamos PIX, cartão de crédito, débito e dinheiro. Clientes com plano Sempre Comigo já têm o serviço incluído na mensalidade.`}},{"@type":"Question",name:`O chaveiro em ${y} faz cópia de chave codificada?`,acceptedAnswer:{"@type":"Answer",text:`Sim. Em ${y} fazemos cópia de chave simples, chave canivete e chave com transponder (codificada). Para chaves presence (smart key), confirme a marca e modelo do veículo no acionamento.`}}]})})}),e.jsxs("div",{className:"container mx-auto px-4 max-w-3xl",children:[e.jsxs("h2",{className:"text-2xl md:text-3xl font-bold text-center mb-8 text-foreground",children:["Perguntas Frequentes - Chaveiro em ",y]}),e.jsxs(k,{type:"single",collapsible:!0,className:"space-y-3",children:[e.jsxs($,{value:"faq-0",className:"bg-background rounded-lg border px-6",children:[e.jsxs(E,{className:"text-left font-semibold text-foreground hover:no-underline",children:["Quanto custa um chaveiro automotivo em ",y,"?"]}),e.jsxs(L,{className:"text-muted-foreground",style:{lineHeight:1.6},children:["O preço do chaveiro em ",y," varia conforme o tipo de veículo, complexidade da fechadura e horário do atendimento. Para cotação imediata, ligue ",e.jsx("strong",{children:"0800 111 8686"})," ou preencha o formulário acima."]})]}),e.jsxs($,{value:"faq-1",className:"bg-background rounded-lg border px-6",children:[e.jsxs(E,{className:"text-left font-semibold text-foreground hover:no-underline",children:["O chaveiro em ",y," funciona 24 horas?"]}),e.jsxs(L,{className:"text-muted-foreground",style:{lineHeight:1.6},children:["Sim. Nosso chaveiro automotivo em ",y," atende 24 horas por dia, 7 dias por semana, incluindo feriados."]})]}),e.jsxs($,{value:"faq-2",className:"bg-background rounded-lg border px-6",children:[e.jsx(E,{className:"text-left font-semibold text-foreground hover:no-underline",children:"O chaveiro abre o veículo sem danificar a fechadura?"}),e.jsxs(L,{className:"text-muted-foreground",style:{lineHeight:1.6},children:["Sim. Em ",y," usamos técnicas profissionais de abertura que preservam a fechadura e a porta do veículo. Trabalhamos com todas as marcas."]})]}),e.jsxs($,{value:"faq-3",className:"bg-background rounded-lg border px-6",children:[e.jsxs(E,{className:"text-left font-semibold text-foreground hover:no-underline",children:["Atendem a região metropolitana de ",y,"?"]}),e.jsxs(L,{className:"text-muted-foreground",style:{lineHeight:1.6},children:["Sim. Cobrimos ",y," e toda a região metropolitana. Confirme a área exata pelo ",e.jsx("strong",{children:"0800 111 8686"})," antes de acionar o serviço."]})]}),e.jsxs($,{value:"faq-4",className:"bg-background rounded-lg border px-6",children:[e.jsxs(E,{className:"text-left font-semibold text-foreground hover:no-underline",children:["Quais formas de pagamento aceitam para chaveiro em ",y,"?"]}),e.jsxs(L,{className:"text-muted-foreground",style:{lineHeight:1.6},children:["Em ",y," aceitamos PIX, cartão de crédito, débito e dinheiro. Clientes com plano Sempre Comigo já têm o serviço incluído na mensalidade."]})]}),e.jsxs($,{value:"faq-5",className:"bg-background rounded-lg border px-6",children:[e.jsxs(E,{className:"text-left font-semibold text-foreground hover:no-underline",children:["O chaveiro em ",y," faz cópia de chave codificada?"]}),e.jsxs(L,{className:"text-muted-foreground",style:{lineHeight:1.6},children:["Sim. Em ",y," fazemos cópia de chave simples, chave canivete e chave com transponder (codificada). Para chaves presence (smart key), confirme a marca e modelo do veículo no acionamento."]})]})]})]})]}),e.jsx(n,{})]})}export{O as default};