PageSourceSearch

https://waccess.net/assets/VentaRapida-Oc8Mzi_6.js

js waccess.net collected 2026-10-06 15:24:39 UTC 20,738 bytes, 2 lines download raw bytes

1import{j as e,a as d}from"./react-vendor-Cr2t-8qL.js";import{B as I,u as Be,p as Ce,q as _e,t as f,a as b}from"./index-XWHW1WUH.js";import{a as Se,u as ke,b as Ae}from"./query-vendor-84h9mXBw.js";import{O as Ee}from"./OrganizerShell-JcCm7eFr.js";import{g as Pe}from"./plans-CNJLP2JR.js";import{a as Te,m as De,q as Ie,D as Me,F as Ve,e as Fe,aQ as Re}from"./icons-vendor-LBcSlOvB.js";import{n as le,g as Le,b as qe,c as ze}from"./getCloudflareTicketUrl-C75rJ8l9.js";import{o as ce,a as Qe}from"./whatsappSalesUtils-B9CLI8Sp.js";import{B as de,i as me,e as G}from"./rapidSaleUtils-BuVDvx3n.js";import{e as We,f as $e,g as Ke}from"./analytics-DUP2qICR.js";import{u as Ue}from"./useOrganizerEvents-CfQM-omC.js";import{r as Xe,u as Oe}from"./shared-snqCb0ln.js";import"./pdf-vendor-g9Gz2X9y.js";import"./charts-vendor-CsIgoOPm.js";import"./router-vendor-y7cRrtaC.js";import"./eventSeo-CZh7H4z2.js";function Ge({event:n,onBack:l}){return e.jsx("div",{className:"sticky top-0 z-20 rounded-3xl border border-[#9BBCC7]/35 bg-white/95 backdrop-blur",children:e.jsxs("div",{className:"mx-auto flex max-w-3xl items-center gap-3 px-4 py-4",children:[e.jsx(I,{type:"button",variant:"outline",size:"icon",onClick:l,className:"border-[#9BBCC7]/45 bg-white text-slate-700 hover:border-[#F26A4B]/40 hover:bg-[#F26A4B]/8 hover:text-[#F26A4B]",children:e.jsx(Te,{className:"h-4 w-4"})}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"text-xs font-medium uppercase tracking-[0.2em] text-[#F26A4B]",children:"Venta rápida"}),e.jsx("h1",{className:"truncate text-lg font-semibold text-slate-900",children:(n==null?void 0:n.name)||"Waccess"}),(n==null?void 0:n.date)&&e.jsx("p",{className:"text-xs text-slate-500",children:new Date(n.date).toLocaleDateString("es-MX",{day:"2-digit",month:"short",year:"numeric"})})]})]})})}function He({buyerForm:n,onChange:l}){return e.jsxs("div",{className:"rounded-3xl border border-[#9BBCC7]/35 bg-white p-5 shadow-sm",children:[e.jsx("h2",{className:"text-base font-semibold text-slate-900",children:"Datos del comprador"}),e.jsxs("div",{className:"mt-4 space-y-3",children:[e.jsx("input",{value:n.buyer_name,onChange:x=>l("buyer_name",x.target.value),placeholder:"Nombre *",className:"w-full rounded-2xl border border-[#9BBCC7]/45 bg-white px-4 py-4 text-base text-slate-900 outline-none placeholder:text-slate-500 focus:border-[#F26A4B]"}),e.jsx("input",{value:n.buyer_phone,onChange:x=>l("buyer_phone",x.target.value),placeholder:"Teléfono *",inputMode:"tel",className:"w-full rounded-2xl border border-[#9BBCC7]/45 bg-white px-4 py-4 text-base text-slate-900 outline-none placeholder:text-slate-500 focus:border-[#F26A4B]"}),e.jsx("input",{value:n.buyer_email,onChange:x=>l("buyer_email",x.target.value),placeholder:"Correo (opcional)",inputMode:"email",className:"w-full rounded-2xl border border-[#9BBCC7]/45 bg-white px-4 py-4 text-base text-slate-900 outline-none placeholder:text-slate-500 focus:border-[#F26A4B]"})]})]})}const Je=(n,l)=>l?"border-slate-500 bg-slate-100 text-slate-950":n.status==="available"?"border-slate-700 bg-slate-950 text-slate-100":"border-[#374151] bg-[#4B5563] text-white";function Ye({isGeneralAdmission:n,sections:l,selectedSectionId:x,onSelectSection:h,rows:r,selectedRowLabel:g,onSelectRow:u,seats:B,selectedSeatIds:v,onToggleSeat:M,ticketTypes:k,selectedTicketTypeId:A,selectedTicketType:N,onSelectTicketType:C,generalQuantity:E,onGeneralQuantityChange:Q,total:W=0}){return e.jsxs("div",{className:"rounded-3xl border border-[#9BBCC7]/35 bg-white p-5 shadow-sm",children:[e.jsx("h2",{className:"text-base font-semibold text-slate-900",children:"Selecciona lugares"}),n?e.jsxs("div",{className:"mt-4 space-y-4",children:[e.jsx("div",{className:"grid gap-3",children:(k||[]).map(o=>e.jsxs("button",{type:"button",onClick:()=>C(o.id),className:`rounded-2xl border px-4 py-4 text-left ${A===o.id?"border-[#F26A4B]/45 bg-[#F26A4B]/8":"border-[#9BBCC7]/35 bg-[#f8fafc]"}`,children:[e.jsx("p",{className:"font-semibold text-slate-900",children:o.name}),e.jsxs("p",{className:"mt-1 text-sm text-slate-500",children:["$",Number(o.price||0).toLocaleStr
1ing("es-MX")]})]},o.id))}),e.jsx("input",{type:"number",min:"1",value:E,onChange:o=>Q(o.target.value),className:"w-full rounded-2xl border border-[#9BBCC7]/45 bg-white px-4 py-4 text-base text-slate-900 outline-none placeholder:text-slate-500 focus:border-[#F26A4B]",placeholder:"Cantidad"}),e.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[e.jsxs("div",{className:"rounded-2xl border border-[#9BBCC7]/35 bg-[#f8fafc] px-4 py-4",children:[e.jsx("p",{className:"text-xs font-medium uppercase tracking-[0.16em] text-slate-500",children:"Precio c/u"}),e.jsxs("p",{className:"mt-2 text-lg font-semibold text-slate-900",children:["$",Number((N==null?void 0:N.price)||0).toLocaleString("es-MX",{minimumFractionDigits:2})]})]}),e.jsxs("div",{className:"rounded-2xl border border-[#9BBCC7]/35 bg-[#f8fafc] px-4 py-4",children:[e.jsx("p",{className:"text-xs font-medium uppercase tracking-[0.16em] text-slate-500",children:"Total"}),e.jsxs("p",{className:"mt-2 text-lg font-semibold text-slate-900",children:["$",Number(W||0).toLocaleString("es-MX",{minimumFractionDigits:2})]})]})]})]}):e.jsxs("div",{className:"mt-4 space-y-4",children:[e.jsxs("div",{children:[e.jsx("p",{className:"mb-2 text-sm font-medium text-slate-400",children:"Zona o sección"}),e.jsx("div",{className:"flex gap-2 overflow-x-auto pb-1",children:l.map(o=>e.jsx("button",{type:"button",onClick:()=>h(o.id),className:`whitespace-nowrap rounded-full border px-4 py-3 text-sm font-medium ${x===o.id?"border-[#F26A4B]/45 bg-[#F26A4B]/8 text-[#F26A4B]":"border-[#9BBCC7]/35 bg-white text-slate-600"}`,children:o.name},o.id))})]}),!!r.length&&e.jsxs("div",{children:[e.jsx("p",{className:"mb-2 text-sm font-medium text-slate-600",children:"Fila"}),e.jsx("div",{className:"flex gap-2 overflow-x-auto pb-1",children:r.map(o=>e.jsx("button",{type:"button",onClick:()=>u(o),className:`min-w-[52px] rounded-2xl border px-4 py-3 text-sm font-semibold ${g===o?"border-[#F26A4B]/45 bg-[#F26A4B]/8 text-[#F26A4B]":"border-[#9BBCC7]/35 bg-white text-slate-600"}`,children:o},o))})]}),!!B.length&&e.jsxs("div",{children:[e.jsx("p",{className:"mb-2 text-sm font-medium text-slate-600",children:"Lugares"}),e.jsx("div",{className:"grid grid-cols-3 gap-2 sm:grid-cols-4",children:B.map(o=>{const $=v.includes(o.id);return e.jsx("button",{type:"button",disabled:o.status!=="available"&&!$,onClick:()=>M(o),className:`rounded-2xl border px-3 py-4 text-center text-sm font-semibold transition ${Je(o,$)}`,children:o.seat_number},o.id)})}),e.jsxs("div",{className:"mt-3 flex flex-wrap gap-3 text-xs text-slate-500",children:[e.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[e.jsx("span",{className:"inline-block h-3 w-3 rounded-sm bg-slate-950 border border-slate-700"}),"Disponible"]}),e.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[e.jsx("span",{className:"inline-block h-3 w-3 rounded-sm bg-[#4B5563] border border-[#374151]"}),"Ocupado"]}),e.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[e.jsx("span",{className:"inline-block h-3 w-3 rounded-sm bg-slate-100 border border-slate-400"}),"Seleccionado"]})]})]})]})]})}function Ze({quantity:n,total:l,disabled:x,isLoading:h,statusText:r,onSubmit:g}){return e.jsx("div",{className:"sticky bottom-0 z-20 rounded-3xl border border-[#9BBCC7]/35 bg-white/95 p-4 backdrop-blur shadow-sm",children:e.jsxs("div",{className:"mx-auto flex max-w-3xl items-center justify-between gap-4",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-xs uppercase tracking-[0.2em] text-[#F26A4B]",children:"Resumen"}),e.jsxs("p",{className:"text-sm font-medium text-slate-600",children:[n," boleto",n===1?"":"s"]}),e.jsxs("p",{className:"text-xl font-semibold text-slate-900",children:["$",Number(l||0).toLocaleString("es-MX",{minimumFractionDigits:2})]}),r&&e.jsx("p",{className:"mt-1 text-xs text-slate-500",children:r})]}),e.jsx(I,{disabled:x||h,onClick:g,className:"h-14 min-w-[180px] rounded-2xl bg-[#F26A4B] px-6 text-base text-white hover:bg-[#dd5c3f]",children:h?e.jsxs(e.Fragment,{children:[e.jsx(De,{className:"mr-2 h-4 w-4 animate-spin"}),"Procesando compra..."]}):"Comprar"})]})})}function et({saleResult:n,onDownload:l,onWhatsApp:x,onEmail:h,onReset:r,onEmailChange:g,loadingAction:u}){return e.jsxs("div",{className:"rounded-3xl border border-[#9BBCC7]/35 bg-white p-6 shadow-sm",children:[e.jsxs("div",{className:"flex flex-col items-center text-center",children:[e.jsx(Ie,{className:"h-14 w-14 text-emerald-400"}),e.jsx("h2",{className:"mt-4 text-2xl font-semibold text-slate-900",children:"Venta realizada"}),e.jsx("p",{className:"mt-2 text-sm text-slate-500",children:"Los boletos ya fueron generados en Waccess."})]}),e.jsxs("div",{className:"mt-6 rounded-2xl border border-[#9BBCC7]/35 bg-[#f8fafc] p-4 text-sm text-slate-700",children:[e.jsxs("p",{children:[e.jsx("strong",{children:"Comprador:"})," ",n.buyer_name]}),e.jsxs("p",{children:[e.jsx("strong",{children:"Teléfono:"})," ",n.buyer_phone]}),n.buyer_email?e.jsxs("p",{children:[e.jsx("strong",{children:"Correo:"})," ",n.buyer_email]}):e.jsxs("div",{className:"mt-3",children:[e.jsx("label",{className:"mb-2 block text-xs font-medium text-slate-600",children:"Correo para enviar boleto en Waccess"}),e.jsx("input",{value:n.emailDraft||"",onChange:B=>g==null?void 0:g(B.target.value),placeholder:"[email protected]",className:"w-full rounded-xl border border-[#9BBCC7]/45 bg-white px-3 py-2.5 text-sm text-slate-900 placeholder:text-slate-500"})]}),e.jsxs("p",{children:[e.jsx("strong",{children:"Boletos:"})," ",n.tickets.length]}),e.jsxs("p",{children:[e.jsx("strong",{children:"Total:"}
1)," $",Number(n.total).toLocaleString("es-MX",{minimumFractionDigits:2})]})]}),e.jsxs("div",{className:"mt-6 grid gap-3",children:[e.jsxs(I,{onClick:l,className:"h-12 rounded-2xl bg-[#F26A4B] hover:bg-[#dd5c3f]",children:[e.jsx(Me,{className:"mr-2 h-4 w-4"}),u==="download"?"Abriendo boleto...":"Ver/Descargar boleto"]}),e.jsxs(I,{onClick:x,variant:"outline",className:"h-12 rounded-2xl border-[#9BBCC7]/45 bg-white text-slate-700 hover:bg-[#9BBCC7]/12 hover:text-slate-900",children:[e.jsx(Ve,{className:"mr-2 h-4 w-4"}),u==="whatsapp"?"Preparando WhatsApp...":"Enviar por WhatsApp"]}),e.jsxs(I,{onClick:h,variant:"outline",className:"h-12 rounded-2xl border-[#9BBCC7]/45 bg-white text-slate-700 hover:bg-[#9BBCC7]/12 hover:text-slate-900",children:[e.jsx(Fe,{className:"mr-2 h-4 w-4"}),u==="email"?"Enviando correo...":"Enviar por correo"]}),e.jsxs(I,{onClick:r,variant:"ghost",className:"h-12 rounded-2xl text-slate-500 hover:bg-[#9BBCC7]/12 hover:text-slate-900",children:[e.jsx(Re,{className:"mr-2 h-4 w-4"}),"Nueva venta"]})]})]})}function gt(){var re,ne;const n=Se(),{data:l}=Be(),x=Ce(l),h=_e(l,x);console.log("[VENTA RAPIDA] route mounted");const[r,g]=d.useState(()=>Xe()),[u,B]=d.useState(de),[v,M]=d.useState(""),[k,A]=d.useState(""),[N,C]=d.useState([]),[E,Q]=d.useState(""),[W,o]=d.useState("1"),[$,P]=d.useState(""),[i,K]=d.useState(null),[ue,T]=d.useState("");d.useEffect(()=>{console.log("[VENTA RAPIDA] component mounted")},[]);const{data:V=[],isLoading:U,error:y}=Ue(h),{data:H}=Oe(h);Number((H==null?void 0:H.total)??0),d.useEffect(()=>{!r&&V.length&&g(V[0].id)},[V,r]);const{data:s,isLoading:J,error:_}=ke({queryKey:["venta-rapida-data",r,(re=l==null?void 0:l.user)==null?void 0:re.id],enabled:!!r&&!!(l!=null&&l.isAuthenticated),queryFn:async()=>{var ie;console.log("[VENTA RAPIDA] loading map data",{event_id:r});const[t,a,c,m]=await Promise.all([b.entities.Event.filter({id:r},"-created_at",1),b.entities.SeatMap.filter({event_id:r},"-created_at",1),b.entities.Subscription.filter({user_email:h}).catch(()=>[]),b.entities.OrganizerProfile.filter({user_email:h})]),w=t[0]||null,S=a[0]||null,[q,z,we,oe]=await Promise.all([S?b.entities.SeatSection.filter({seat_map_id:S.id}):Promise.resolve([]),S?b.entities.Seat.filter({seat_map_id:S.id},"created_at",3e3):Promise.resolve([]),b.entities.Ticket.filter({event_id:r},"-created_at",300),b.entities.TicketType.filter({event_id:r})]);console.log("[VENTA RAPIDA] map data loaded",{event_id:r,has_map:!!S,sections:q.length,seats:z.length}),console.log("[VENTA RAPIDA] loading ticket types",{event_id:r,count:oe.length});const ye=c.find(je=>["active","trial","past_due"].includes(je.status))||c[0]||null;return console.log("[VENTA RAPIDA] organizer profile loaded",{has_profile:!!((ie=m[0])!=null&&ie.id)}),{event:w,seatMap:S,sections:q,seats:z,tickets:we,ticketTypes:oe,profile:m[0]||null,subscription:ye}}}),j=!((ne=s==null?void 0:s.event)!=null&&ne.has_seat_map),F=(s==null?void 0:s.ticketTypes)||[],p=F.find(t=>t.id===E)||F[0]||null,X=String((u==null?void 0:u.buyer_name)||""),O=String((u==null?void 0:u.buyer_phone)||""),te=String((u==null?void 0:u.buyer_email)||"");d.useEffect(()=>{p!=null&&p.id&&!E&&Q(p.id)},[p==null?void 0:p.id,E]),d.useEffect(()=>{M(""),A(""),C([]),K(null)},[r]);const Y=d.useMemo(()=>{const t=(s==null?void 0:s.seats)||[];return((s==null?void 0:s.sections)||[]).filter(a=>t.some(c=>c.section_id===a.id&&c.status==="available"))},[s==null?void 0:s.sections,s==null?void 0:s.seats]),Z=d.useMemo(()=>{if(!v)return[];const t=new Set(((s==null?void 0:s.seats)||[]).filter(a=>a.section_id===v&&a.status==="available").map(a=>a.row_label));return Array.from(t).sort()},[s==null?void 0:s.seats,v]),ee=d.useMemo(()=>!v||!k?[]:((s==null?void 0:s.seats)||[]).filter(t=>t.section_id===v&&t.row_label===k).sort((t,a)=>Number(t.seat_number)-Number(a.seat_number)),[s==null?void 0:s.seats,v,k]),se=d.useMemo(()=>((s==null?void 0:s.seats)||[]).filter(t=>N.includes(t.id)),[s==null?void 0:s.seats,N]),R=j?Math.max(Number(W||0),0):se.length,L=j?R*Number((p==null?void 0:p.price)||0):se.reduce((t,a)=>t+Number(a.price_override||0),0),xe=!!(X.trim()&&me(O)&&R>0),D=d.useMemo(()=>r?U||J?"":s!=null&&s.event?j&&!F.length?"Este evento no tiene tipos de boleto configurados.":!j&&!(Y.length||Z.length||ee.length)?"No hay mapa disponible para este evento o 
1no hay lugares libres.":"":"No se pudo cargar el evento seleccionado.":"Selecciona un evento para comenzar.",[r,U,J,s==null?void 0:s.event,j,F.length,Y.length,Z.length,ee.length]);d.useEffect(()=>{y&&console.error("[VENTA RAPIDA] error:",y),_&&console.error("[VENTA RAPIDA] error:",_),D&&console.warn("[VENTA RAPIDA] render blocked by:",D)},[y,_,D]);const pe=(t,a)=>B(c=>({...c,[t]:a})),be=t=>{t.status==="available"&&C(a=>a.includes(t.id)?a.filter(c=>c!==t.id):[...a,t.id])},ae=Ae({mutationFn:async()=>{var q;if(!(s!=null&&s.event))throw new Error("Selecciona un evento.");if(!X.trim())throw new Error("Ingresa el nombre del comprador.");if(!me(O))throw new Error("Ingresa un teléfono válido.");if(R<=0)throw new Error("Selecciona al menos un lugar o cantidad.");Pe((q=s==null?void 0:s.subscription)==null?void 0:q.plan_id);const t=X.trim(),a=le(O.trim());if(!a)throw new Error("El teléfono ingresado no es válido. Debe tener 10 dígitos mexicanos.");const c=te.trim();P("Validando disponibilidad...");const m={eventId:r,buyerName:t,buyerPhone:a,buyerEmail:c,paymentMethod:"Efectivo"};if(j){if(!p)throw new Error("Selecciona un tipo de boleto.");m.ticketTypeId=p.id,m.quantity=R}else{if(!N.length)throw new Error("Selecciona zona, fila y lugares disponibles.");m.seatIds=N}P("Procesando venta...");const w=await b.functions.invoke("createQuickSale",m);if(!(w!=null&&w.success))throw new Error((w==null?void 0:w.error)||"No se pudo completar la venta.");return P("Generando boletos..."),await Promise.all((w.tickets||[]).map(async z=>{try{return await G(z,12,900)}catch{return z}}))},onSuccess:async t=>{var m;const a=We((s==null?void 0:s.event)||{},{ticket_quantity:t.length,ticket_price:t.length?Number(L||0)/t.length:0,value:Number(L||0),currency:"MXN",payment_method:"Efectivo",checkout_type:j?"quick_sale_general":"quick_sale_map"});$e(a),Ke({...a,ticket_count:t.length}),await n.invalidateQueries({queryKey:["venta-rapida-data",r]}),await n.refetchQueries({queryKey:["venta-rapida-data",r],exact:!1}),await n.invalidateQueries({queryKey:["venta-data",r]}),await n.refetchQueries({queryKey:["venta-data",r],exact:!1}),await n.invalidateQueries({queryKey:["events-page"]});const c=le(O.trim())||"";K({tickets:t,total:L,buyer_name:X.trim(),buyer_phone:c,buyer_email:te.trim(),event_name:((m=s==null?void 0:s.event)==null?void 0:m.name)||"Waccess"}),P(""),f.success("Venta realizada y boletos generados correctamente.")},onError:t=>{P(""),f.error(t.message||"No se pudo completar la venta rápida.")}}),he=async()=>{if(i){T("download");try{(await Promise.all(i.tickets.map(a=>G(a)))).forEach(a=>{window.open(Le(a),"_blank")}),f.success("Boleto abierto.")}catch(t){f.error(t.message||"No se pudo abrir el boleto.")}finally{T("")}}},ge=async()=>{if(i){if(!i.buyer_phone){f.error("Agrega un teléfono del comprador para enviar por WhatsApp.");return}T("whatsapp");try{const t=await Promise.all(i.tickets.map(a=>G(a)));if(t.length===1){const a=await qe(t[0],{channel:"manual_whatsapp"});ce(i.buyer_phone,Qe({eventName:i.event_name,ticketNumber:t[0].ticket_number,ticketPageUrl:a}))}else{const a=await ze(t,i.event_name,{channel:"manual_whatsapp_bundle"});ce(i.buyer_phone,`Tus boletos para ${i.event_name}:
2${a}`)}f.success("WhatsApp listo.")}catch(t){f.error(t.message||"No se pudo preparar WhatsApp.")}finally{T("")}}},fe=async()=>{var a;const t=(i==null?void 0:i.buyer_email)||(i==null?void 0:i.emailDraft)||"";if(!t.trim()){f.error("Agrega un correo del comprador para enviar los boletos.");return}T("email");try{for(const m of i.tickets)m.buyer_email!==t.trim()&&await b.entities.Ticket.update(m.id,{buyer_email:t.trim()});const c=await Promise.all(i.tickets.map(m=>G(m)));c.length>1?await b.functions.invoke("sendTicketBundleEmail",{ticketIds:c.map(m=>m.id),buyer_email:t.trim(),buyer_name:i.buyer_name,event_name:i.event_name,sendMode:"manual"}):(a=c[0])!=null&&a.id&&await b.functions.invoke("sendTicketEmail",{ticketId:c[0].id,assetUrl:c[0].pdf_url,sendMode:"manual"}),f.success("Boletos enviados por correo.")}catch(c){f.error(c.message||"No se pudo enviar el correo.")}finally{T("")}},ve=()=>{B(de),M(""),A(""),C([]),o("1"),K(null),P(""),n.invalidateQueries({queryKey:["venta-rapida-data",r]})},Ne=()=>{const t=r?`/Venta?eventId=${r}`:"/Venta";window.history.length>1?window.history.back():window.location.href=t};return e.jsxs(Ee,{eyebrow:"Waccess",title:"Venta rápida",description:"Vende boletos en segundos desde tu teléfono con un flujo móvil, claro y rápido.",children:[e.jsxs("div",{className:"mx-auto max-w-3xl space-y-4",children:[e.jsx(Ge,{event:s==null?void 0:s.event,onBack:Ne}),e.jsxs("div",{className:"rounded-3xl border border-[#9BBCC7]/35 bg-white p-4 shadow-sm",children:[e.jsx("label",{className:"mb-2 block text-sm font-medium text-slate-600",children:"Evento"}),e.jsxs("select",{value:r,onChange:t=>g(t.target.value),className:"w-full rounded-2xl border border-[#9BBCC7]/45 bg-white px-4 py-4 text-base text-slate-900",children:[e.jsx("option",{value:"",children:"Selecciona un evento"}),V.map(t=>e.jsx("option",{value:t.id,children:t.name},t.id))]})]}),(y||_)&&e.jsxs("div",{className:"rounded-3xl border border-amber-200 bg-amber-50 p-4 text-sm text-amber-900",children:[e.jsx("p",{className:"font-semibold",children:"No se pudieron cargar algunos datos"}),e.jsx("p",{className:"mt-1",children:(y==null?void 0:y.message)||(_==null?void 0:_.message)||"Intenta actualizar o volver a entrar."}),e.jsx("p",{className:"mt-2 text-xs text-amber-700",children:"[VENTA RAPIDA] fallback rendered"})]}),!V.length&&!U&&!y&&e.jsx("div",{className:"rounded-3xl border border-slate-200 bg-white p-4 text-sm text-slate-700",children:"No tienes eventos disponibles para vender por ahora."}),(U||r&&J)&&e.jsx("div",{className:"rounded-3xl border border-slate-200 bg-white p-4 text-sm text-slate-700",children:"Cargando datos de venta rápida..."}),r?i?e.jsx(et,{saleResult:i,loadingAction:ue,onDownload:he,onWhatsApp:ge,onEmail:fe,onEmailChange:t=>K(a=>({...a,emailDraft:t})),onReset:ve}):e.jsxs(e.Fragment,{children:[e.jsx(He,{buyerForm:u,onChange:pe}),D?e.jsx("div",{className:"rounded-3xl border border-slate-200 bg-white p-5 text-sm text-slate-700",children:D}):e.jsx(Ye,{isGeneralAdmission:j,sections:Y,selectedSectionId:v,onSelectSection:t=>{M(t),A(""),C([])},rows:Z,selectedRowLabel:k,onSelectRow:t=>{A(t),C([])},seats:ee,selectedSeatIds:N,onToggleSeat:be,ticketTypes:F,selectedTicketTypeId:E,selectedTicketType:p,onSelectTicketType:Q,generalQuantity:W,onGeneralQuantityChange:o,total:L})]}):null]}),!!r&&!i&&!D&&e.jsx(Ze,{quantity:R,total:L,disabled:!xe,isLoading:ae.isPending,statusText:$,onSubmit:()=>ae.mutate()})]})}export{gt 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.