PageSourceSearch

https://repuestos-d6c3d.firebaseapp.com/_nuxt/IM-2RIYO.js

js repuestos-d6c3d.firebaseapp.com collected 2026-10-03 08:14:11 UTC 9,770 bytes, 1 lines download raw bytes

1import{_ as N}from"./BsqTxom4.js";import{a9 as L,u as M,k as R,r as x,l as _,q as T,c as n,b as t,e as c,a as p,t as a,h,p as j,F as S,x as V,i as g,j as B,_ as F,o as d}from"#entry";import{_ as W}from"./WWy_r-EY.js";const q={class:"min-h-screen bg-gray-50 py-12 px-4"},H={class:"max-w-3xl mx-auto"},O={key:0,class:"text-center py-12"},U={key:1,class:"bg-red-50 border border-red-200 rounded-lg p-6"},G={class:"text-red-700"},J={key:2},K={class:"mb-6"},Q={class:"bg-white rounded-lg shadow p-6 mb-6"},X={class:"grid grid-cols-1 md:grid-cols-2 gap-4"},Y={class:"font-medium text-gray-800"},Z={class:"font-medium text-gray-800"},ee={key:0},te={class:"font-medium text-gray-800"},oe={class:"font-medium text-gray-800"},se={class:"font-medium text-lg text-blue-600"},ae={key:1},ne={class:"font-medium text-gray-800"},de={class:"bg-white rounded-lg shadow p-6 mb-6"},re={class:"space-y-3"},le={class:"flex-1"},ie={class:"font-medium text-gray-800"},ue={class:"text-sm text-gray-600"},ce={class:"font-medium text-gray-800"},me={key:0,class:"bg-white rounded-lg shadow p-6 mb-6"},pe={class:"grid grid-cols-1 md:grid-cols-2 gap-4"},ge={class:"font-medium text-gray-800"},xe={class:"font-medium text-gray-800"},ve={class:"font-medium text-gray-800"},ye={class:"font-medium text-gray-800"},fe={key:0},be={class:"font-medium text-gray-800"},_e={key:1,class:"bg-green-50 border border-green-200 rounded-lg p-6"},he={class:"text-green-800 font-semibold mb-2 flex items-center gap-2"},we={key:2,class:"bg-red-50 border border-red-200 rounded-lg p-6"},Ce={class:"text-red-800 font-semibold mb-2 flex items-center gap-2"},Pe={class:"text-red-700 text-sm"},ke={key:3,class:"bg-yellow-50 border border-yellow-200 rounded-lg p-6"},Ae={class:"text-yellow-800 font-semibold mb-2 flex items-center gap-2"},Ee={class:"mt-6 flex gap-3"},Ne=L({__name:"[id]",setup($e){M({title:"Estado de la Compra - AutoPiezas360",meta:[{name:"description",content:"Consulta el estado de tu compra en AutoPiezas360"},{name:"robots",content:"noindex, nofollow"}]});const f=R(),v=x(!0),i=x(""),o=x(null),l=x(null),w=_(()=>{if(!o.value)return"";const s=o.value.estado,e="px-4 py-2 rounded-full text-sm font-semibold";switch(s){case"approved":return`${e} bg-green-100 text-green-800`;case"rejected":return`${e} bg-red-100 text-red-800`;case"in_process":case"pending":return`${e} bg-yellow-100 text-yellow-800`;case"refunded":return`${e} bg-purple-100 text-purple-800`;case"cancelled":return`${e} bg-gray-100 text-gray-800`;default:return`${e} bg-gray-100 text-gray-800`}}),C=_(()=>{if(!o.value)return"";const s=o.value.estado;return{approved:"Aprobado",rejected:"Rechazado",in_process:"En Proceso",pending:"Pendiente",refunded:"Reembolsado",cancelled:"Cancelado"}[s]||s}),b=s=>s?(s.toDate?s.toDate():new Date(s.seconds*1e3)).toLocaleDateString("es-CL",{year:"numeric",month:"long",day:"numeric",hour:"2-digit",minute:"2-digit"}):"",P=s=>({visa:"Visa",master:"Mastercard",amex:"American Express",ticket:"Efectivo"})[s]||s,k=s=>({approved:"Aprobado",rejected:"Rechazado",pending:"Pendiente",in_process:"En Proceso",refunded:"Reembolsado",cancelled:"Cancelado"})[s]||s,A=()=>{const s=`Hola! Tengo una consulta sobre mi compra #${o.value?.id||"N/A"}. ¿Podrían ayudarme?`,u=`https://wa.me/${"+56944622816".replace("+","")}?text=${encodeURIComponent(s)}`;window.open(u,"_blank")},E=async()=>{try{v.value=!0,i.value="";const s=f.params.id,e=f.query.payment_id;if(!s){i.value="ID de compra no válido";return}const{$firestore:u}=B(),{doc:m,getDoc:r}=await N(async()=>{const{doc:z,getDoc:D}=await import("#entry").then(I=>I.aC);return{doc:z,getDoc:D}},[],import.meta.url),$=m(u,"ventas",s),y=await r($);if(!y.exists()){i.value="Compra no encontrada";return}o.value={id:y.id,...y.data()},e&&o.value.mercadopagoPaymentId&&(l.value={id:o.value.mercadopagoPaymentId,payment_method_id:o.value.paymentMethod||"N/A",status:o.value.estado,transaction_amount:o.value.transactionAmount||o.value.total,installments:o.value.installments||1,payment_type_id:o.value.paymentType||"N/A"})}catch(s){console.error("Error cargando compra:",s),i.value=s.message||"Error al cargar la compra"}finally{v.value=!1}};return T(()=>{E()}),(s,e)=>{const u=F,m=W;return d(),n("div",q,[t("div",H,[e[24]||(e[24]=t("h1",{class:"text-3xl font-bold mb-8 text-gray-800"},"Estado de tu Compra",-1)),v.value?(d(),n("div",O,[...e[0]||(e[0]=[t("div",{class:"animate-spin rounded-full h-12 w-12 border-b-2 border-blue-600 mx-auto"},null,-1),t("p",{class:"mt-4 text-gray-600"},"Consultando estado de la compra...",-1)])])):i.value?(d(),n("div",U,[e[2]||(e[2]=t("h3",{class:"text-red-800 font-semibold mb-2"},"Error",-1)),t("p",G,a(i.value),1),p(u,{to:"/",class:"inline-block mt-4 text-blue-600 hover:text-blue-700 underline"},{default:h(()=>[...e[1]||(e[1]=[g(" Volver al inicio ",-1)])]),_:1})])):o.value?(d(),n("div",J,[t("div",K,[t("span",{class:j([w.value,"px-4 py-2 rounded-full text-sm font-semibold"])},a(C.value),3)]),t("div",Q,[e[9]||(e[9]=t("h2",{class:"text-xl font-semibold mb-4 text-gray-800"},"Información de la Compra",-1)),t("dl",X,[t("div",null,[e[3]||(e[3]=t("dt",{class:"text-sm text-gray-600"},"ID de Compra",-1)),t("dd",Y,a(o.value.id),1)]),t("div",null,[e[4]||(e[4]=t("dt",{class:"text-sm text-gray-600"},"Email",-1)),t("dd",Z,a(o.value.email),1)]),o.value.nombre&&o.value.apellido?(d(),n("div",ee,[e[5]||
1(e[5]=t("dt",{class:"text-sm text-gray-600"},"Cliente",-1)),t("dd",te,a(o.value.nombre)+" "+a(o.value.apellido),1)])):c("",!0),t("div",null,[e[6]||(e[6]=t("dt",{class:"text-sm text-gray-600"},"Fecha",-1)),t("dd",oe,a(b(o.value.createdAt)),1)]),t("div",null,[e[7]||(e[7]=t("dt",{class:"text-sm text-gray-600"},"Total",-1)),t("dd",se,"$"+a(o.value.total.toLocaleString()),1)]),o.value.paidAt?(d(),n("div",ae,[e[8]||(e[8]=t("dt",{class:"text-sm text-gray-600"},"Fecha de Pago",-1)),t("dd",ne,a(b(o.value.paidAt)),1)])):c("",!0)])]),t("div",de,[e[10]||(e[10]=t("h2",{class:"text-xl font-semibold mb-4 text-gray-800"},"Productos",-1)),t("div",re,[(d(!0),n(S,null,V(o.value.items,r=>(d(),n("div",{key:r.productId,class:"flex justify-between items-center py-3 border-b last:border-b-0"},[t("div",le,[t("p",ie,a(r.nombre),1),t("p",ue,a(r.marca)+" "+a(r.modelo)+" "+a(r.anio)+" · Cantidad: "+a(r.cantidad),1)]),t("span",ce,"$"+a(r.subtotal.toLocaleString()),1)]))),128))])]),l.value?(d(),n("div",me,[e[16]||(e[16]=t("h2",{class:"text-xl font-semibold mb-4 text-gray-800"},"Información del Pago",-1)),t("dl",pe,[t("div",null,[e[11]||(e[11]=t("dt",{class:"text-sm text-gray-600"},"ID de Pago",-1)),t("dd",ge,a(l.value.id),1)]),t("div",null,[e[12]||(e[12]=t("dt",{class:"text-sm text-gray-600"},"Método de Pago",-1)),t("dd",xe,a(P(l.value.payment_method_id)),1)]),t("div",null,[e[13]||(e[13]=t("dt",{class:"text-sm text-gray-600"},"Estado",-1)),t("dd",ve,a(k(l.value.status)),1)]),t("div",null,[e[14]||(e[14]=t("dt",{class:"text-sm text-gray-600"},"Monto",-1)),t("dd",ye,"$"+a(l.value.transaction_amount.toLocaleString()),1)]),l.value.installments>1?(d(),n("div",fe,[e[15]||(e[15]=t("dt",{class:"text-sm text-gray-600"},"Cuotas",-1)),t("dd",be,a(l.value.installments)+"x",1)])):c("",!0)])])):c("",!0),o.value.estado==="approved"?(d(),n("div",_e,[t("h3",he,[p(m,{name:"check-circle",size:"sm"}),e[17]||(e[17]=g(" Pago Confirmado ",-1))]),e[18]||(e[18]=t("p",{class:"text-green-700 text-sm"}," Tu compra ha sido confirmada y está siendo procesada. Nos contactaremos contigo pronto para coordinar la entrega. ",-1))])):o.value.estado==="rejected"?(d(),n("div",we,[t("h3",Ce,[p(m,{name:"x-circle",size:"sm"}),e[19]||(e[19]=g(" Pago Rechazado ",-1))]),t("p",Pe,a(o.value.isPartialPayment?"El pago fue rechazado por ser parcial. Por favor, realiza el pago completo.":"El pago fue rechazado. Por favor, contacta con nosotros para más información."),1)])):o.value.estado==="in_process"||o.value.estado==="pending"?(d(),n("div",ke,[t("h3",Ae,[p(m,{name:"clock",size:"sm"}),e[20]||(e[20]=g(" Pago en Proceso ",-1))]),e[21]||(e[21]=t("p",{class:"text-yellow-700 text-sm"}," Tu pago está siendo procesado. Te notificaremos cuando se confirme. ",-1))])):c("",!0),t("div",Ee,[p(u,{to:"/repuestos",class:"flex-1 bg-blue-600 hover:bg-blue-700 text-white py-3 px-6 rounded-lg font-medium text-center transition-colors"},{default:h(()=>[...e[22]||(e[22]=[g(" Seguir Comprando ",-1)])]),_:1}),t("button",{onClick:A,class:"flex-1 bg-green-500 hover:bg-green-600 text-white py-3 px-6 rounded-lg font-medium transition-colors flex items-center justify-center space-x-2"},[...e[23]||(e[23]=[t("svg",{class:"w-5 h-5",fill:"currentColor",viewBox:"0 0 24 24"},[t("path",{d:"M17.472 14.382c-.297-.149-1.758-.867-2.03-.967-.273-.099-.471-.148-.67.15-.197.297-.767.966-.94 1.164-.173.199-.347.223-.644.075-.297-.15-1.255-.463-2.39-1.475-.883-.788-1.48-1.761-1.653-2.059-.173-.297-.018-.458.13-.606.134-.133.298-.347.446-.52.149-.174.198-.298.298-.497.099-.198.05-.371-.025-.52-.075-.149-.669-1.612-.916-2.207-.242-.579-.487-.5-.669-.51-.173-.008-.371-.01-.57-.01-.198 0-.52.074-.792.372-.272.297-1.04 1.016-1.04 2.479 0 1.462 1.065 2.875 1.213 3.074.149.198 2.096 3.2 5.077 4.487.709.306 1.262.489 1.694.625.712.227 1.36.195 1.871.118.571-.085 1.758-.719 2.006-1.413.248-.694.248-1.289.173-1.413-.074-.124-.272-.198-.57-.347m-5.421 7.403h-.004a9.87 9.87 0 01-5.031-1.378l-.361-.214-3.741.982.998-3.648-.235-.374a9.86 9.86 0 01-1.51-5.26c.001-5.45 4.436-9.884 9.888-9.884 2.64 0 5.122 1.03 6.988 2.898a9.825 9.825 0 012.893 6.994c-.003 5.45-4.437 9.884-9.885 9.884m8.413-18.297A11.815 11.815 0 0012.05 0C5.495 0 .16 5.335.157 11.892c0 2.096.547 4.142 1.588 5.945L.057 24l6.305-1.654a11.882 11.882 0 005.683 1.448h.005c6.554 0 11.89-5.335 11.893-11.893A11.821 11.821 0 0020.885 3.488"})],-1),t("span",null,"Contactar",-1)])])])])):c("",!0)])])}}});
1export{Ne 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.