1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8180],{96245:function(e,a,t){"use strict";function s(e){this.message=e}s.prototype=Error(),s.prototype.name="InvalidCharacterError";var r="undefined"!=typeof window&&window.atob&&window.atob.bind(window)||function(e){var a=String(e).replace(/=+$/,"");if(a.length%4==1)throw new s("'atob' failed: The string to be decoded is not correctly encoded.");for(var t,r,l=0,n=0,i="";r=a.charAt(n++);~r&&(t=l%4?64*t+r:r,l++%4)&&(i+=String.fromCharCode(255&t>>(-2*l&6))))r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(r);return i};function l(e){this.message=e}l.prototype=Error(),l.prototype.name="InvalidTokenError",a.Z=function(e,a){if("string"!=typeof e)throw new l("Invalid token specified");var t=!0===(a=a||{}).header?0:1;try{return JSON.parse(function(e){var a,t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:t+="==";break;case 3:t+="=";break;default:throw"Illegal base64url string!"}try{return a=t,decodeURIComponent(r(a).replace(/(.)/g,function(e,a){var t=a.charCodeAt(0).toString(16).toUpperCase();return t.length<2&&(t="0"+t),"%"+t}))}catch(e){return r(t)}}(e.split(".")[t]))}catch(e){throw new l("Invalid token specified: "+e.message)}}},99937:function(e,a,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/chat",function(){return t(76245)}])},32112:function(e,a,t){"use strict";t.d(a,{z:function(){return l}});var s=t(44682),r=t(84678);function l(){let e=(0,s.Sz)(r.V,e=>e.user),a=(0,s.Sz)(r.V,e=>e.token),t=(0,s.Sz)(r.V,e=>e.setUser),l=(0,s.Sz)(r.V,e=>e.setToken);return{user:e,token:a,setUser:t,setToken:l}}},76245:function(e,a,t){"use strict";t.r(a),t.d(a,{default:function(){return es}});var s=t(85893),r=t(67294),l=t(9008),n=t.n(l),i=t(98974);/** 2 * @license lucide-react v1.26.0 - ISC 3 * 4 * This source code is licensed under the ISC license. 5 * See the LICENSE file in the root directory of this source tree. 6 */let o=(...e)=>e.filter((e,a,t)=>!!e&&""!==e.trim()&&t.indexOf(e)===a).join(" ").trim(),d=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),c=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,a,t)=>t?t.toUpperCase():a.toLowerCase()),x=e=>{let a=c(e);return a.charAt(0).toUpperCase()+a.slice(1)};/** 7 * @license lucide-react v1.26.0 - ISC 8 * 9 * This source code is licensed under the ISC license. 10 * See the LICENSE file in the root directory of this source tree. 11 */var m={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/** 12 * @license lucide-react v1.26.0 - ISC 13 * 14 * This source code is licensed under the ISC license. 15 * See the LICENSE file in the root directory of this source tree. 16 */let p=e=>{for(let a in e)if(a.startsWith("aria-")||"role"===a||"title"===a)return!0;return!1},u=(0,r.createContext)({}),h=()=>(0,r.useContext)(u),g=(0,r.forwardRef)(({color:e,size:a,strokeWidth:t,absoluteStrokeWidth:s,className:l="",children:n,iconNode:i,...d},c)=>{let{size:x=24,strokeWidth:u=2,absoluteStrokeWidth:g=!1,color:f="currentColor",className:b=""}=h()??{},y=s??g?24*Number(t??u)/Number(a??x):t??u;return(0,r.createElement)("svg",{ref:c,...m,width:a??x??m.width,height:a??x??m.height,stroke:e??f,strokeWidth:y,className:o("lucide",b,l),...!n&&!p(d)&&{"aria-hidden":"true"},...d},[...i.map(([e,a])=>(0,r.createElement)(e,a)),...Array.isArray(n)?n:[n]])}),f=(e,a)=>{let t=(0,r.forwardRef)(({className:t,...s},l)=>(0,r.createElement)(g,{ref:l,iconNode:a,className:o(`lucide-${d(x(e))}`,`lucide-${e}`,t),...s}));return t.displayName=x(e),t},b=f("bus",[["path",{d:"M8 6v6",key:"18i7km"}],["path",{d:"M15 6v6",key:"1sg6z9"}],["path",{d:"M2 12h19.6",key:"de5uta"}],["path",{d:"M18 18h3s.5-1.7.8-2.8c.1-.4.2-.8.2-1.2 0-.4-.1-.8-.2-1.2l-1.4-5C20.1 6.8 19.1 6 18 6H4a2 2 0 0 0-2 2v10h3",key:"1wwztk"}],["circle",{cx:"7",cy:"18",r:"2",key:"19iecd"}],["path",{d:"M9 18h5",key:"lrx6i"}],["circle",{cx:"16",cy:"18",r:"2",key:"1v4tcr"}]]),y=f("refresh-cw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]),v=f("headset",[["path",{d:"M3 11h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-5Zm0 0a9 9 0 1 1 18 0m0 0v5a2 2 0 0 1-2 2h-1a2 2 0 0 1-2-2v-3a2 2 0 0 1 2-2h3Z",key:"12oyoe"}],["path",{d:"M21 16v2a4 4 0 0 1-4 4h-5",key:"1x7m43"}]]),j=f("file-text",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}
16]]),w=f("dog",[["path",{d:"M11.25 16.25h1.5L12 17z",key:"w7jh35"}],["path",{d:"M16 14v.5",key:"1lajdz"}],["path",{d:"M4.42 11.247A13.152 13.152 0 0 0 4 14.556C4 18.728 7.582 21 12 21s8-2.272 8-6.444a11.702 11.702 0 0 0-.493-3.309",key:"u7s9ue"}],["path",{d:"M8 14v.5",key:"1nzgdb"}],["path",{d:"M8.5 8.5c-.384 1.05-1.083 2.028-2.344 2.5-1.931.722-3.576-.297-3.656-1-.113-.994 1.177-6.53 4-7 1.923-.321 3.651.845 3.651 2.235A7.497 7.497 0 0 1 14 5.277c0-1.39 1.844-2.598 3.767-2.277 2.823.47 4.113 6.006 4 7-.08.703-1.725 1.722-3.656 1-1.261-.472-1.855-1.45-2.239-2.5",key:"v8hric"}]]),N=f("package",[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]]),k=f("compass",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m16.24 7.76-1.804 5.411a2 2 0 0 1-1.265 1.265L7.76 16.24l1.804-5.411a2 2 0 0 1 1.265-1.265z",key:"9ktpf1"}]]),C=f("panel-left",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]]),S=f("panel-left-close",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"m16 15-3-3 3-3",key:"14y99z"}]]),A=f("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]),E=f("message-square-plus",[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}],["path",{d:"M12 8v6",key:"1ib9pf"}],["path",{d:"M9 11h6",key:"1fldmi"}]]),D=f("sparkles",[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}
16],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]]),T=f("send-horizontal",[["path",{d:"M3.714 3.048a.498.498 0 0 0-.683.627l2.843 7.627a2 2 0 0 1 0 1.396l-2.842 7.627a.498.498 0 0 0 .682.627l18-8.5a.5.5 0 0 0 0-.904z",key:"117uat"}],["path",{d:"M6 12h16",key:"s4cdu5"}]]),R=f("arrow-up-right",[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]]),P=f("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);var M=t(11163),I=t.n(M),L=t(87005),_=t(29567),O=t(25675),V=t.n(O),z=t(67378);let B={SEM_SELECAO:"0",VENDIDA:"1",DE_REAPROVEITAMENTO:"2",LP:"3",MOTORISTA:"4",RESERVADA:"5",SELECIONADA:"6",ESCOLHIDA:"7",BLOQUEADA:"8",REMOVIDA:"51"},U=[B.SEM_SELECAO,B.VENDIDA,B.LP,B.RESERVADA,B.BLOQUEADA,B.REMOVIDA],F=e=>{var a;let{busLayout:t,busLayoutData:l,trip:n,maxSelection:i=4,onContinue:o}=e,d=t||l,c=(null==d?void 0:d.type)==="connection"&&Array.isArray(null==d?void 0:d.data),x=(0,r.useMemo)(()=>d?c?d.data:d.data&&!Array.isArray(d.data)?[d.data]:[d]:[],[d,c]),[m,p]=(0,r.useState)(0),[u,h]=(0,r.useState)({}),[g,f]=(0,r.useState)(0),b=x[m]||{},y=(null==b?void 0:b.maxSelection)||i,v=(0,r.useMemo)(()=>{var e;return b?Array.isArray(null===(e=b.busLayout)||void 0===e?void 0:e.decks)?b.busLayout.decks:Array.isArray(b.decks)?b.decks:Array.isArray(b.seats)?[{seats:b.seats}]:[]:[]},[b]),j=v[g]||v[0]||{seats:[]},w=(null==j?void 0:j.seats)||[],N=u[m]||[],{maxColumns:k,hasFourRows:C}=(0,r.useMemo)(()=>{if(!w.length)return{maxColumns:10,hasFourRows:!0};let e=1,a=!1;return w.forEach(t=>{let s=parseInt(String(t.x),10),r=parseInt(String(t.y),10);isNaN(s)||(e=Math.max(e,s)),4===r&&(a=!0)}),{maxColumns:Math.max(e,10),hasFourRows:a}},[w]),S=e=>U.includes(String(e)),A=e=>{let a=String(e.type),t="mot"===e.id||"mot"===e.x||a===B.MOTORISTA;if(S(a)||t)return;let s=e.label||e.number||e.id;if(N.includes(s))h(e=>({...e,[m]:(e[m]||[]).filter(e=>e!==s)}));else{if(N.length>=y){alert("Voc\xea s\xf3 pode selecionar at\xe9 ".concat(y," assento(s) para este trecho."));return}h(e=>({...e,[m]:[...e[m]||[],s]}))}};if(!v.length||!w.length)return(0,s.jsx)("div",{className:"bg-white p-6 rounded-2xl border border-slate-100 shadow-md text-center text-slate-400 text-sm my-3 max-w-2xl mx-auto",children:"Mapa de assentos indispon\xedvel para esta viagem."});let E=e=>{if(!e)return"N\xe3o informada";if(!e.includes("T")&&!e.includes("-"))return e;try{let a=new Date(e);if(isNaN(a.getTime()))return e;let t=a.toLocaleDateString("pt-BR",{day:"2-digit",month:"2-digit"}),s=a.toLocaleTimeString("pt-BR",{hour:"2-digit",minute:"2-digit"});return"".concat(t," \xe0s ").concat(s)}catch(a){return e}};return(0,s.jsxs)("div",{className:"bg-white p-2 sm:p-3 rounded-2xl my-3 max-w-5xl mx-auto w-full font-['Poppins',sans-serif]",children:[c&&(0,s.jsxs)("div",{className:"mb-6",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between mb-3 px-1",children:[(0,s.jsx)("span",{className:"text-xs font-bold tracking-wider text-slate-400 uppercase",children:"Trechos da Conex\xe3o"}),(0,s.jsx)("span",{className:"text-[11px] text-slate-400 font-medium hidden sm:inline",children:"Clique no trecho para selecionar a poltrona"})]}),(0,s.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:x.map((e,a)=>{let t=u[a]||[],r=t.length>0,l=m===a,n=e.travel||{},i=n.originName||n.origin||"Origem ".concat(a+1),o=n.service,d=n.destinationName||n.destination||"Destino ".concat(a+1),c=E(n.departureTime||n.departure||n.departureFormatted),x=E(n.arrivalTime||n.arrival||n.arrivalFormatted);return(0,s.jsxs)("button",{type:"button",onClick:()=>{p(a),f(0)},className:"relative flex flex-col justify-between p-4 rounded-2xl text-left transition-all border ".concat(l?"border-primary bg-primary/[0.02] shadow-md ring-2 ring-primary/20":"border-slate-200 bg-white hover:border-slate-300 hover:bg-slate-50/60"),children:[(0,s.jsxs)("div",{className:"flex items-center justify-between pb-3 border-b border-slate-100 mb-3",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("span",{className:"w-2.5 h-2.5 rounded-full shrink-0 ".concat(r?"bg-secondary":"bg-slate-300")}),(0,s.jsxs)("span",{className:"text-xs font-extrabold uppercase tracking-wide ".concat(l?"text-primary":"text-slate-600"),children:[a+1,"\xba Trecho"]})]}),(0,s.jsx)("p",{className:"text-xs font-bold text-slate-900 truncate",children:o}),l&&(0,s.jsx)("span",{className:"text-[10px] bg-primary/10 text-primary font-extrabold px-2 py-0.5 rounded-full uppercase tracking-wider",children:"Ativo"})]}),(0,s.jsxs)("div",{className:"flex flex-col gap-2 my-1",children:[(0,s.jsxs)("div",{className:"flex items-start gap-3",children:[(0,s.jsxs)("div",{className:"flex flex-col items-center mt-1",children:[(0,s.jsx)("div",{className:"w-2.5 h-2.5 rounded-full border-2 border-primary bg-white shrink-0"}),(0,s.jsx)("div",{className:"w-0.5 h-7 bg-slate-200 my-0.5"})]}),(0,s.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,s.jsxs)("p",{className:"text-[11px] font-semibold text-slate-400 leading-none mb-1",children:["Sa\xedda: ",(0,s.jsx)("span",{className:"text-slate-700 font-bold",children:c})]}),(0,s.jsx)("p",{className:"text-xs font-bold text-slate-900 truncate",children:i})]})]}),(0,s.jsxs)("div",{className:"flex items-start gap-3",children:[(0,s.jsx)("div",{className:"flex flex-col items-center shrink-0",children:(0,s.jsx)("div",{className:"w-2.5 h-2.5 rounded-full bg-secondary shrink-0"})}),(0,s.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,s.jsxs)("p",{className:"text-[11px] font-semibold text-slate-400 leading-none mb-1",children:["Chegada: ",(0,s.jsx)("span",{className:"text-slate-700 font-bold",children:x})]}),(0,s.jsx)("p",{className:"text-xs font-bold text-slate-900 truncate",children:d})]})]})]}),(0,s.jsxs)("div",{className:"mt-4 pt-3 border-t border-slate-100 flex items-center justify-between",children:[(0,s.jsx)("span",{className:"text-slate-400 text-xs font-medium",children:"Poltrona:"}),r?(0,s.jsx)("span",{className:"bg-secondary text-white text-xs font-extrabold px-3 py-1 rounded-lg shadow-sm",children:t.join(", ")}):(0,s.jsx)("span",{className:"text-amber-600 bg-amber-50 text-[11px] font-bold px-2.5 py-1 rounded-lg border border-amber-200/60 uppercase tracking-wide",children:"Pendente"})]})]},a)})})]}),(0,s.jsxs)("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-3 mb-4",children:[(0,s.jsx)("p",{className:"text-[#181818]/60 text-xs font-semibold max-w-xs leading-snug",children:"Selecione a poltrona desejada para o trecho atual:"}),(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-x-4 gap-y-1",children:[(0,s.jsxs)("div",{className:"flex items-center gap-1.5 whitespace-nowrap",children:[(0,s.jsx)("div",{className:"w-3.5 h-3.5 rounded bg-secondary shrink-0"}),(0,s.jsx)("span",{className:"text-[#181818]/60 text-[11px] font-bold uppercase tracking-wider",children:"Selecionado"})]}),(0,s.jsxs)("div",{className:"flex items-center gap-1.5 whitespace-nowrap",children:[(0,s.jsx)("div",{className:"w-3.5 h-3.5 rounded bg-[#4ADE80] shrink-0"}),(0,s.jsx)("span",{className:"text-[#181818]/60 text-[11px] font-bold uppercase tracking-wider",children:"Dispon\xedvel"})]}),(0,s.jsxs)("div",{className:"flex items-center gap-1.5 whitespace-nowrap",children:[(0,s.jsx)("div",{className:"w-3.5 h-3.5 rounded bg-[#9ea7b4] shrink-0"}),(0,s.jsx)("span",{className:"text-[#181818]/60 text-[11px] font-bold uppercase tracking-wider",children:"Ocupado"})]})]})]}),v.length>1&&(0,s.jsx)("div",{className:"flex gap-2 mb-3 justify-center",children:v.map((e,a)=>(0,s.jsx)("button",{type:"button",onClick:()=>f(a),className:"text-xs px-3 py-1 rounded-lg font-semibold transition-all ".concat(g===a?"bg-secondary text-white shadow-sm":"bg-slate-100 text-slate-600 hover:bg-slate-200"),children:e.name||"".concat(a+1,"\xba Andar")},e.id||a))}),(0,s.jsx)("div",{className:"bg-[#e4e7ec] rounded-3xl p-5 sm:p-6 overflow-x-auto scrollbar-thin",children:(0,s.jsxs)("div",{className:"flex items-stretch gap-6 min-w-max",children:[(0,s.jsx)("div",{className:"flex flex-col justify-end items-center pr-4 border-r border-[#cbd5e1] pb-1",children:(0,s.jsx)(V(),{src:z.Z,alt:"volante",height:38,width:38})}),(0,s.jsx)("div",{className:"grid gap-x-2 gap-y-1.5 items-center justify-center",style:{gridTemplateColumns:"repeat(".concat(k,", minmax(40px, 1fr))"),gridTemplateRows:C?"repeat(2, minmax(40px, 1fr)) 20px repeat(2, minmax(40px, 1fr))":"repeat(2, minmax(40px, 1fr)) 20px minmax(40px, 1fr)"},children:w.map((e,a)=>{let t=e.label||e.number||e.id,r=String(e.type),l="mot"===e.id||"mot"===e.x||r===B.MOTORISTA,n=S(r),i=N.includes(t)||r===B.ESCOLHIDA,o=!n&&!l,d=parseInt(String(e.x),10),c=parseInt(String(e.y),10),x=isNaN(d)?1:d,p=isNaN(c)?1:c,u=4;C?3===p?u=1:4===p?u=2:2===p?u=4:1===p&&(u=5):3===p?u=1:2===p?u=2:1===p&&(u=4);let h={gridColumn:x,gridRow:u},f="seat-".concat(m,"-").concat(g,"-").concat(e.id||a,"-").concat(e.x,"-").concat(e.y);return l?null:(0,s.jsx)("button",{type:"button",style:h,disabled:!o,onClick:()=>A(e),className:"w-10 h-10 rounded-lg text-sm font-extrabold transition-all flex items-center justify-center text-white ".concat(i?"bg-secondary scale-105 shadow-md":o?"bg-[#4ADE80] hover:opacity-90 active:scale-95 cursor-pointer shadow-sm":"bg-[#9ea7b4] cursor-not-allowed"),children:t},f)})})]})}),(0,s.jsxs)("div",{className:"mt-4 flex flex-col sm:flex-row justify-between items-center pt-3 border-t border-slate-100 gap-3",children:[(0,s.jsxs)("div",{className:"text-center sm:text-left",children:[(0,s.jsx)("p",{className:"text-[11px] uppercase font-bold text-slate-400",children:c?"Poltrona selecionada (".concat((null===(a=b.travel)||void 0===a?void 0:a.originName)||"Trecho ".concat(m+1),"):"):"Poltronas selecionadas:"}),(0,s.jsx)("p",{className:"text-sm font-semibold text-slate-800",children:N.length>0?N.join(", "):"Nenhuma poltrona selecionada"})]}),(0,s.jsx)("button",{type:"button",onClick:()=>
16{if(!o)return;if(c){let e=x.findIndex((e,a)=>{var t;return!(null===(t=u[a])||void 0===t?void 0:t.length)});if(-1!==e){p(e),f(0);return}let a=[];x.forEach((e,t)=>{var s;let r=(null===(s=e.busLayout)||void 0===s?void 0:s.decks)||e.decks||[{seats:e.seats||[]}],l=r.flatMap(e=>e.seats||[]),n=u[t]||[],i=l.filter(e=>{let a=e.label||e.number||e.id;return n.includes(a)});a.push(...i)}),o(a);return}let e=v.flatMap(e=>e.seats||[]),a=u[0]||[],t=e.filter(e=>{let t=e.label||e.number||e.id;return a.includes(t)});o(t)},className:"w-full sm:w-auto bg-secondary hover:opacity-95 text-white text-xs px-5 py-2.5 rounded-xl font-bold transition-all shadow-md active:scale-95 uppercase tracking-wider",children:c&&m<x.length-1?"Avan\xe7ar para o pr\xf3ximo trecho":"Avan\xe7ar com a reserva"})]})]})};var H=t(87395),$=t(32112),q=t(26444),Q=t(61617),Z=t(36231),G=t(20464),W=t(46942),J=t(7441),Y=t(627),X=t(41664),K=t.n(X),ee=t(86426),ea=t(96245),et=t(9134);function es(){let{state:e,enviarMensagem:a,carregarConfiguracoesSilencioso:t,reiniciarChat:l,anexarViagensNaUltimaMensagem:o,naoEncontrouViagens:d}=(0,i.E)(),[c,x]=(0,r.useState)(""),m=(0,r.useRef)(null),[p,u]=(0,r.useState)(!1),[h,g]=(0,r.useState)([]),[f,M]=(0,r.useState)(!1),O=(0,r.useRef)(null),z=(0,r.useRef)(null),[B,U]=(0,r.useState)(null),X=(0,r.useRef)(null),[es,er]=(0,r.useState)(!1),[el,en]=(0,r.useState)(null),[ei,eo]=(0,r.useState)(!1),[ed,ec]=(0,r.useState)(null),[ex,em]=(0,r.useState)(!1),[ep,eu]=(0,r.useState)(""),[eh,eg]=(0,r.useState)(""),[ef,eb]=(0,r.useState)(!1),[ey,ev]=(0,r.useState)(null),[ej,ew]=(0,r.useState)(null),[eN,ek]=(0,r.useState)([]),[eC,eS]=(0,r.useState)([]),[eA,eE]=(0,r.useState)(!1),[eD,eT]=(0,r.useState)(!1),[eR,eP]=(0,r.useState)("pix"),[eM,eI]=(0,r.useState)(!1),[eL,e_]=(0,r.useState)(null),[eO,eV]=(0,r.useState)(!1),{user:ez,setUser:eB,setToken:eU}=(0,$.z)(),[eF,eH]=(0,r.useState)(!1),[e$,eq]=(0,r.useState)(!1),[eQ,eZ]=(0,r.useState)(!1),eG=(0,r.useRef)(""),[eW,eJ]=(0,r.useState)(""),[eY,eX]=(0,r.useState)(""),[eK,e0]=(0,r.useState)(""),[e1,e2]=(0,r.useState)(""),[e5,e4]=(0,r.useState)(""),[e3,e6]=(0,r.useState)(""),[e8,e7]=(0,r.useState)(""),[e9,ae]=(0,r.useState)(""),[aa,at]=(0,r.useState)(""),[as,ar]=(0,r.useState)(""),[al,an]=(0,r.useState)([]),[ai,ao]=(0,r.useState)(!1),ad=function(e){let a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:70,t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:35,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:2e3,[l,n]=(0,r.useState)(""),[i,o]=(0,r.useState)(0),[d,c]=(0,r.useState)(0),[x,m]=(0,r.useState)(!1),p=(e,a)=>{let t;if(a<=1)return 0;do t=Math.floor(Math.random()*a);while(t===e);return t};return(0,r.useEffect)(()=>{let r=e[i],l=setTimeout(()=>{x?(n(r.substring(0,d-1)),c(e=>e-1),d-1==0&&(m(!1),o(a=>p(a,e.length)))):(n(r.substring(0,d+1)),c(e=>e+1),d+1===r.length&&setTimeout(()=>m(!0),s))},x?t:a);return()=>clearTimeout(l)},[d,x,i,e,a,t,s]),l}(["Digite sua d\xfavida ou destino...","Quero ir de Goi\xe2nia para Bras\xedlia...","Como remarcar a data da minha viagem?","Como posso cancelar minha passagem?","Hor\xe1rios de \xf4nibus para Belo Horizonte...","Passagens em promo\xe7\xe3o para o FDS...","Posso levar meu pet na viagem?","Qual o valor da passagem para o Rio de Janeiro?","Consigo parcelar no cart\xe3o de cr\xe9dito?","Aceita pagamento via Pix?","Qual o hor\xe1rio para S\xe3o Paulo?"]),[ac,ax]=(0,r.useState)({uf:"",localidade:"",logradouro:""}),am=e=>e.replace(/\D/g,"").replace(/(\d{4})/g,"$1 ").trim().slice(0,19),ap=e=>e.replace(/\D/g,"").replace(/(\d{2})(\d)/,"$1/$2").slice(0,5),au=e=>e.replace(/\D/g,"").slice(0,4),ah=e=>e.replace(/\D/g,"").replace(/(\d{3})(\d)/,"$1.$2").replace(/(\d{3})(\d)/,"$1.$2").replace(/(\d{3})(\d{1,2})$/,"$1-$2").slice(0,14),ag=e=>e.replace(/\D/g,"").replace(/(\d{2})(\d)/,"$1/$2").replace(/(\d{2})(\d)/,"$1/$2").slice(0,10),af=e=>e.replace(/\D/g,"").replace(/^(\d{5})(\d)/,"$1-$2").slice(0,9),ab=e=>e.replace(/\D/g,"").replace(/^(\d{2})(\d)/g,"($1) $2").replace(/(\d)(\d{4})$/,"$1-$2").slice(0,15),ay=()=>{if(!eC||0===eC.length)return alert("Nenhuma poltrona selecionada."),!1;for(let i=0;i<eC.length;i++){var e,a,t,s,r,l,n;let o=null===(e=eC[i])||void 0===e?void 0:e.passenger,d=(null===(a=eC[i])||void 0===a?void 0:a.label)||i+1;if(!(null==o?void 0:null===(t=o.name)||void 0===t?void 0:t.trim()))return alert("Preencha o Nome Completo do passageiro da poltrona ".concat(d,".")),!1;if(!(null==o?void 0:null===(s=o.fone)||void 0===s?void 0:s.trim())||o.fone.length<10)return alert("Preencha um Telefone v\xe1lido para o passageiro da poltrona ".concat(d,".")),!1;if(!(null==o?void 0:null===(r=o.docNumber)||void 0===r?void 0:r.trim()))return alert("Preencha o N\xfamero do RG do passageiro da poltrona ".concat(d,".")),!1;if(!(null==o?void 0:null===(l=o.docDispatcher)||void 0===l?void 0:l.trim()))return alert("Preencha o \xd3rg\xe3o Emissor do RG do passageiro da poltrona ".concat(d,".")),!1;if(!(null==o?void 0:null===(n=o.docUf)||void 0===n?void 0:n.trim())||o.docUf.length<2)return alert("Preencha a UF do RG do passageiro da poltrona ".concat(d,".")),!1}return!0},av=()=>{let e=eW.replace(/\D/g,""),a=eY.replace(/\D/g,""),t=eK.replace(/\D/g,""),s=e5.replace(/\D/g,""),r=e3.replace(/\D/g,""),l=e8.replace(/\D/g,""),n=e9.replace(/\D/g,"");return e.length<13?(alert("Por favor, informe um n\xfamero de cart\xe3o v\xe1lido."),!1):4!==a.length?(alert("Informe a validade no formato MM/AA."),!1):t.length<3?(alert("Informe o CVV do cart\xe3o."),!1):e1.trim()?11!==s.length?(alert("Informe um CPF v\xe1lido."),!1):8!==r.length?(alert("Informe a data de nascimento completa."),!1):8!==l.length?(alert("Informe um CEP v\xe1lido."),!1):n.length<10?(alert("Informe um telefone v\xe1lido com DDD."),!1):aa.trim()&&aa.includes("@")?!!as||(alert("Selecione o n\xfamero de parcelas."),!1):(alert("Informe um e-mail v\xe1lido."),!1):(alert("Informe o nome impresso no cart\xe3o."),!1)},aj=(0,r.useMemo)(()=>{let e=(null==ej?void 0:ej.price)||0,a=(null==ej?void 0:ej.serviceTax)||0,t=(null==eC?void 0:eC.length)||0;return(e+a)*t},[ej,eC]),aw=al.find(e=>e.times===Number(as)),aN=async e=>{let a=e.replace(/\D/g,"");if(8===a.length)try{let e=await fetch("https://viacep.com.br/ws/".concat(a,"/json/")),t=await e.json();t.erro||ax({uf:t.uf,localidade:t.localidade,logradouro:t.logradouro})}catch(e){console.error("Erro ao buscar CEP:",e)}},ak=eY.replace(/\D/g,""),aC=ak.slice(0,2),aS=ak.slice(2);2===aS.length&&(aS="20".concat(aS));let aA="".concat(aC,"/").concat(aS),aE={cardNumber:eW.replace(/\D/g,""),holderName:e1,cardholderName:e1,expiryDate:aA,expirationMonth:aC,expirationYear:aS,cvv:eK,securityCode:eK,cpf:e5.replace(/\D/g,""),birthDate:e3,cep:e8.replace(/\D/g,""),uf:ac.uf,localidade:ac.localidade,logradouro:ac.logradouro,phone:e9.replace(/\D/g,""),email:aa,installments:Number(as),totalAmount:aw?aw.total:aj,installmentAmount:aw?aw.amount:aj},aD=e=>{let a=e.replace(/\D/g,"");return/^4/.test(a)?"visa":/^(5[1-5]|22[2-9]|2[3-6]|27[0-1]|2720)/.test(a)?"master":/^(34|37)/.test(a)?"amex":/^(401178|401179|431274|438935|451416|457393|457631|457632|504175|627780|636297|636368)/.test(a)?"elo":/^(606282|3841)/.test(a)?"hipercard":"unknown"};async function aT(e){if(!e)return"";let a=new TextEncoder().encode(e),t=await crypto.subtle.digest("SHA-1",a),s=Array.from(new Uint8Array(t)),r=s.map(e=>e.toString(16).padStart(2,"0")).join("");return r}(0,r.useEffect)(()=>{let e=eW.replace(/\D/g,""),a=e.slice(0,6);if(a.length<6||aj<=0){an([]),ao(!1);return}let t=async()=>{try{var e,t,s,r,l,n,i,o;ao(!0);let d=aD?aD(a):"",c=await (0,Z.iV)(aj,a,d);if(!c||!Array.isArray(c)){an([]);return}let x=c.map(a=>({times:Number(null!==(t=null!==(e=a.installments)&&void 0!==e?e:a.times)&&void 0!==t?t:0),amount:Number(null!==(r=null!==(s=a.installment_amount)&&void 0!==s?s:a.amount)&&void 0!==r?r:0),rate:Number(null!==(n=null!==(l=a.installment_rate)&&void 0!==l?l:a.rate)&&void 0!==n?n:0),total:Number(null!==(o=null!==(i=a.total_amount)&&void 0!==i?i:a.total)&&void 0!==o?o:0)}));an(x)}catch(e){an([])}finally{ao(!1)}},s=setTimeout(t,400);return()=>clearTimeout(s)},[eW,aj]);let aR=async e=>{var a,t,s;if(e.preventDefault(),ep&&eh){eb(!0);try{let e=await aT(eh),t=await (0,H.x4)(ep,e,0);if(!t.data||!t.data.data){alert("Houve um erro com o seu login! ".concat((null==t?void 0:null===(a=t.data)||void 0===a?void 0:a.mensagem)||"Erro desconhecido"));return}let{token:s,clienteWeb:r}=t.data.data;localStorage.setItem("token",s),localStorage.setItem("user",JSON.stringify(r)),eB(r),eU(s),em(!1),ey&&(ew(ey.trip),eS(ey.seats),eE(!0),ev(null))}catch(e){alert("Erro ao realizar login: ".concat((null==e?void 0:null===(s=e.response)||void 0===s?void 0:null===(t=s.data)||void 0===t?void 0:t.mensagem)||"Verifique suas credenciais."))}finally{eb(!1)}}},aP=async e=>{eb(!0);try{var a;let t=(0,ea.Z)(e.credential),s={email:t.email,id:t.sub,nome:null!==(a=t.name)&&void 0!==a?a:""},r=await (0,H.z3)(s.email,s.id);if(!r.data.data){await aM(r.data,s);return}let{clienteWeb:l,token:n}=r.data.data;localStorage.setItem("token",n),localStorage.setItem("user",JSON.stringify(l)),eB(l),eU(n),em(!1),console.log(ey),ey&&(ew(ey.trip),eS(ey.seats),eE(!0),ev(null))}catch(e){console.error("Erro no processamento:",e),et.Am.error("Ocorreu um erro ao processar sua autentica\xe7\xe3o.")}finally{eb(!1)}},aM=async(e,a)=>{let t=e.mensagem||"Erro ao fazer login";if(t.includes("Sua conta ainda n\xe3o foi ativada")){et.Am.error(t);return}try{let e=await (0,H.DO)(a.nome,a.email,a.id),t=(null==e?void 0:e.mensagem)||"Erro no cadastro";(null==e?void 0:e.success)==="success"?et.Am.success(t):et.Am.error(t)}catch(e){et.Am.error("Falha na comunica\xe7\xe3o com o servidor de cadastro.")}},aI=async e=>{let a="".concat(e.busCompany,"_").concat(e.id,"_").concat(e.cseId);if(ed===a){ec(null),en(null),ew(null),eS([]),em(!1),ev(null),eE(!1),e_(null),eI(!1),eT(!1);return}ec(a),en(null),ew(null),eS([]),em(!1),ev(null),eo(!0),eE(!1),e_(null),eI(!1),eT(!1);try{let a=await L.w.getBusLayout(e);en(a)}catch(e){console.error("Erro ao buscar layout do \xf4nibus:",e)}finally{eo(!1)}},aL=e=>{U(e),setTimeout(()=>{var e;null===(e=X.current)||void 0===e||e.scrollIntoView({behavior:"smooth",block:"start"})},50)},a_=(e,a)=>e&&0!==e.length?a?[...e].filter(e=>{let[t,s]=e.departure?e.departure.split("T"):["","00:00"],r=parseInt(s.split(":")[0],10);return"manha"===a?r>=6&&r<12:"tarde"===a?r>=12&&r<18:"noite"!==a||r>=18||r<6}).sort((e,t)=>
16{if("cedo"===a)return new Date(e.departure).getTime()-new Date(t.departure).getTime();if("barato"===a)return Number(e.price||0)-Number(t.price||0);if("rapido"===a){let a=new Date(e.arrival).getTime()-new Date(e.departure).getTime(),s=new Date(t.arrival).getTime()-new Date(t.departure).getTime();return a-s}return 0}):e:[];(0,r.useEffect)(()=>{t()},[]),(0,r.useEffect)(()=>{let e=setTimeout(()=>{var e;null===(e=m.current)||void 0===e||e.scrollIntoView({behavior:"smooth"})},50);return()=>clearTimeout(e)},[e.mensagens,e.loading,eA,eM]),(0,r.useEffect)(()=>{e.mensagens.length>0&&requestAnimationFrame(()=>{var e;null===(e=z.current)||void 0===e||e.focus()})},[e.mensagens.length]);let aO=t=>{let s=t||c;s.trim()&&!e.loading&&(x(""),er(!0),eG.current="",a(s),requestAnimationFrame(()=>{var a,t;0===e.mensagens.length?null===(a=O.current)||void 0===a||a.focus():null===(t=z.current)||void 0===t||t.focus()}))};return(0,r.useEffect)(()=>{let a=!0,t=async()=>{let{origem:t,destino:s,data:r}=e;if(!t||!s||!r)return;let l="".concat(t.toLowerCase().trim(),"_").concat(s.toLowerCase().trim(),"_").concat(r.trim());if(eG.current!==l)try{eG.current=l,M(!0);let[e,n]=await Promise.all([L.w.searchAgency(t).catch(()=>[]),L.w.searchAgency(s).catch(()=>[])]);if(!a)return;if(!(null==e?void 0:e.length)||!(null==n?void 0:n.length)){a&&(g([]),d());return}let i=r.includes("-")&&4===r.split("-")[0].length?r.split("-").reverse().join("-"):r,c=[];for(let a of e)for(let e of n){let t=_.p.get("pbr/search-travel",{params:{date:i,origin:a.urlAmigavel,destination:e.urlAmigavel}}).then(e=>{var a;return(null==e?void 0:null===(a=e.data)||void 0===a?void 0:a.list)||[]}).catch(()=>[]);c.push(t)}let x=await Promise.all(c);if(a){let e=x.flat();ec(null),en(null),ew(null),eS([]),em(!1),ev(null),eE(!1),e_(null),eI(!1),eT(!1),g(e),e.length>0?o(e):d()}}catch(e){a&&(g([]),d())}finally{a&&M(!1)}};return t(),()=>{a=!1}},[e.origem,e.destino,e.data]),(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(n(),{children:[(0,s.jsx)("title",{children:"Atendimento com IA - PassagensBR"}),(0,s.jsx)("meta",{name:"description",content:"Tire suas d\xfavidas sobre passagens, regulamentos de viagem e suporte com nosso assistente virtual."}),(0,s.jsx)("meta",{name:"viewport",content:"width=device-width, initial-scale=1"})]}),(0,s.jsxs)("div",{className:"flex h-screen bg-[#F2F4F7] text-slate-800 overflow-hidden p-2 sm:p-3 gap-3 font-['Poppins',sans-serif]",children:[(0,s.jsxs)("aside",{className:"bg-white/80 backdrop-blur-xl border border-white/60 rounded-3xl flex flex-col justify-between p-4 hidden md:flex shrink-0 transition-all duration-300 ease-in-out shadow-sm ".concat(p?"w-20 items-center":"w-64"),children:[(0,s.jsxs)("div",{className:"w-full",children:[(0,s.jsxs)("div",{className:"flex items-center mb-6 ".concat(p?"justify-center":"justify-between px-1"),children:[!p&&(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("div",{className:"w-8 h-8 rounded-2xl bg-primary/10 text-primary flex items-center justify-center font-bold",children:(0,s.jsx)(k,{className:"w-4 h-4 text-primary"})}),(0,s.jsx)("span",{className:"font-bold text-slate-800 text-sm tracking-tight",children:"PassagensBR"})]}),(0,s.jsx)("button",{onClick:()=>u(!p),title:p?"Expandir menu":"Recolher menu",className:"text-slate-400 hover:text-primary hover:bg-primary/5 p-2 rounded-2xl transition-all active:scale-95",children:p?(0,s.jsx)(C,{className:"w-5 h-5"}):(0,s.jsx)(S,{className:"w-5 h-5"})})]}),(0,s.jsxs)("button",{onClick:()=>{l(),g([]),ec(null),en(null),requestAnimationFrame(()=>{var e;return null===(e=O.current)||void 0===e?void 0:e.focus()})},title:"Novo chat",className:"w-full bg-primary hover:bg-primary/90 text-white font-medium rounded-2xl flex items-center shadow-md shadow-primary/20 transition-all mb-6 text-sm active:scale-95 ".concat(p?"h-11 w-11 justify-center p-0 mx-auto":"px-4 py-3 justify-start gap-2.5"),children:[(0,s.jsx)(A,{className:"w-5 h-5 shrink-0"}),!p&&(0,s.jsx)("span",{className:"font-medium",children:"Nova conversa"})]}),!p&&(0,s.jsx)("p",{className:"text-xs text-slate-400 font-normal leading-relaxed px-1",children:"Acesse suas conversas e resolva suas d\xfavidas em poucos segundos."})]}),(0,s.jsx)("div",{className:"border-t border-slate-100 pt-3 w-full",children:p?(0,s.jsxs)("button",{title:"Avaliar experi\xeancia",className:"w-full flex justify-center items-center text-slate-400 hover:text-primary hover:bg-primary/5 p-2.5 rounded-2xl transition-all relative active:scale-95",children:[(0,s.jsx)(E,{className:"w-5 h-5"}),(0,s.jsx)("span",{className:"absolute top-2 right-2 w-2 h-2 bg-primary rounded-full ring-2 ring-white"})]}):(0,s.jsxs)("div",{className:"bg-gradient-to-br from-white to-purple-50/50 p-3.5 rounded-2xl border border-purple-100/80 shadow-2xs flex flex-col gap-2",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2 text-slate-700",children:[(0,s.jsx)(E,{className:"w-4 h-4 text-primary shrink-0"}),(0,s.jsx)("span",{className:"text-xs font-semibold text-slate-800",children:"Sua opini\xe3o importa"})]}),(0,s.jsx)("p",{className:"text-[11px] text-slate-500 leading-snug",children:"Avalie nosso atendimento para continuarmos melhorando."}),(0,s.jsx)("button",{onClick:()=>I().push("/fale-conosco"),className:"mt-1 w-full bg-white hover:bg-primary/5 text-primary border border-primary/20 font-semibold text-xs py-2 px-3 rounded-xl transition-all active:scale-95",children:"Avaliar experi\xeancia"})]})})]}),(0,s.jsxs)("main",{className:"flex-1 flex flex-col justify-between h-full relative overflow-hidden bg-white/70 backdrop-blur-xl sm:rounded-3xl border border-white/80 shadow-sm",children:[(0,s.jsx)("div",{className:"flex-1 overflow-y-auto p-4 sm:p-8 space-y-6 scrollbar-thin scrollbar-thumb-slate-200",children:0===e.mensagens.length?(0,s.jsxs)("div",{className:"min-h-[75vh] flex flex-col items-center justify-center text-center px-2 max-w-2xl mx-auto my-auto relative font-['Poppins',sans-serif]",children:[(0,s.jsx)("div",{className:"absolute -top-12 w-72 h-72 bg-primary/10 rounded-full blur-3xl pointer-events-none"}),(0,s.jsxs)("div",{className:"inline-flex items-center gap-1.5 px-3 py-1 rounded-full bg-primary/10 text-primary text-xs font-semibold mb-3",children:[(0,s.jsx)(D,{className:"w-3.5 h-3.5"}),(0,s.jsx)("span",{children:"Assistente Virtual"})]}),(0,s.jsx)("h1",{className:"text-2xl sm:text-4xl font-semibold text-slate-900 tracking-tight mb-2",children:"Para onde deseja viajar?"}),(0,s.jsx)("p",{className:"text-slate-500 text-xs sm:text-sm mb-8 max-w-md",children:"Pergunte sobre passagens, regulamentos de bagagem, troca de bilhetes ou suporte."}),(0,s.jsx)("div",{className:"w-full mb-8",children:(0,s.jsx)("div",{className:"p-[1.0px] rounded-2xl bg-gradient-to-r from-primary via-secondary to-primary bg-[size:200%_200%] animate-border-pulse shadow-lg shadow-primary/10",children:(0,s.jsxs)("form",{onSubmit:e=>{e.preventDefault(),aO()},className:"relative flex items-center bg-white rounded-2xl px-4 py-2 sm:py-2.5 transition-all",children:[(0,s.jsx)("input",{ref:O,type:"text",value:c,onChange:e=>x(e.target.value),placeholder:ad,className:"w-full bg-transparent text-slate-800 placeholder-slate-400 outline-none text-xs sm:text-sm pr-10"}),(0,s.jsx)("button",{type:"submit",onMouseDown:e=>e.preventDefault(),disabled:!c.trim()||(null==e?void 0:e.loading),className:"absolute right-2.5 bg-primary hover:bg-primary/90 text-white p-2 rounded-xl disabled:opacity-30 transition-all active:scale-95 shadow-xs",title:"Enviar mensagem",children:(0,s.jsx)(T,{className:"w-4 h-4"})})]})})}),(0,s.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3 w-full text-left",children:[{label:"Buscar passagens",sub:"Hor\xe1rios e rotas",icon:b},{label:"Cancelar passagem",sub:"Reembolso e prazos",icon:y},{label:"Atendimento humano",sub:"Falar com suporte",icon:v},{label:"Documentos para viagem",sub:"O que apresentar",icon:j},{label:"Posso levar pet?",sub:"Regras de transporte",icon:w},{label:"Envio de encomendas",sub:"Cargas e fretes",icon:N}].map((e,a)=>{let t=e.icon;return(0,s.jsxs)("button",{onMouseDown:e=>e.preventDefault(),onClick:()=>aO(e.label),className:"group p-3.5 rounded-2xl border border-slate-200/70 bg-white/80 hover:bg-white hover:border-primary/40 hover:shadow-md hover:shadow-
16primary/5 transition-all flex items-center justify-between gap-3 active:scale-[0.98]",children:[(0,s.jsxs)("div",{className:"flex items-start gap-3 min-w-0",children:[(0,s.jsx)("div",{className:"p-2 rounded-xl bg-primary/10 text-primary group-hover:bg-primary group-hover:text-white transition-colors shrink-0 mt-0.5",children:(0,s.jsx)(t,{className:"w-4 h-4"})}),(0,s.jsxs)("div",{className:"flex flex-col text-left min-w-0",children:[(0,s.jsx)("h3",{className:"text-xs font-semibold text-slate-800 group-hover:text-primary transition-colors leading-tight truncate",children:e.label}),(0,s.jsx)("p",{className:"text-[11px] text-slate-400 leading-tight mt-1 truncate",children:e.sub})]})]}),(0,s.jsx)(R,{className:"w-4 h-4 text-slate-300 group-hover:text-primary transition-colors shrink-0 self-center"})]},a)})})]}):(0,s.jsxs)("div",{className:"max-w-3xl mx-auto space-y-5 pt-2 px-2 sm:px-0",children:[(()=>{let a=e.mensagens.findLastIndex(e=>e.viagens&&e.viagens.length>0);return e.mensagens.map((e,t)=>{let r="Voce"===e.autor,l=t===a;return(0,s.jsxs)("div",{className:"flex flex-col ".concat(r?"items-end":"items-start"," animate-fade-in"),children:[!r&&(0,s.jsxs)("div",{className:"flex items-center gap-2 mb-1.5 px-1",children:[(0,s.jsx)("div",{className:"w-2 h-2 rounded-full bg-primary"}),(0,s.jsx)("span",{className:"text-xs font-semibold text-slate-700 tracking-tight",children:"Assistente PassagensBR"})]}),(0,s.jsx)("div",{className:"max-w-[85%] sm:max-w-[75%] px-4 py-3 rounded-2xl text-xs sm:text-sm leading-relaxed break-words whitespace-pre-line transition-all ".concat(r?"bg-primary text-white rounded-br-xs shadow-sm":"bg-white text-slate-800 border border-slate-200/70 rounded-bl-xs shadow-xs"),children:e.texto}),(0,s.jsx)("span",{className:"text-[10px] font-medium text-slate-400 mt-1 px-1",children:new Date(e.data).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}),!r&&l&&e.viagens&&e.viagens.length>0&&(()=>{let a=a_(e.viagens,B);return(0,s.jsxs)("div",{ref:X,className:"flex flex-col gap-3 my-4 animate-fade-in scroll-mt-4 font-['Poppins',sans-serif] w-full max-w-[85%] sm:max-w-[75%]",children:[(0,s.jsx)("div",{className:"flex flex-col gap-0.5 px-1",children:(0,s.jsxs)("p",{className:"text-xs font-semibold text-slate-500 uppercase tracking-wider",children:["Op\xe7\xf5es de viagens encontradas (",a.length,")"]})}),a.map(e=>{let a="".concat(e.busCompany,"_").concat(e.id,"_").concat(e.cseId),r=ed===a,[l,n]=e.departure?e.departure.split("T"):["","--:--"],[i,o]=e.arrival?e.arrival.split("T"):["","--:--"],d=e=>{if(!e)return"";let[a,t,s]=e.split("-");return"".concat(s,"/").concat(t,"/").concat(a)},c="";if(e.departure&&e.arrival){let a=new Date(e.arrival).getTime()-new Date(e.departure).getTime();if(a>0){let e=Math.floor(a%36e5/6e4);c="".concat(Math.floor(a/36e5),"h ").concat(e>0?"".concat(e,"min"):"")}}let x=e.isConexao?"CONEX\xc3O":e.service||"EXECUTIVO",m="https://passagensbrassets.s3-sa-east-1.amazonaws.com/empresas/".concat(e.busCompany,"/img/").concat(e.urlLogo),p=Number(e.price||0),u=p.toFixed(2).replace(".",","),h=Number(e.priceRate||0),g=h.toFixed(2).replace(".",","),f=h>p,b=e.freeSeats,y=(e.busCompanyName||"Via\xe7\xe3o Parceira").replace(/\s*\(PassagensBR\)/gi,"").trim();return(0,s.jsxs)("div",{className:"p-4 sm:p-5 bg-white border rounded-2xl shadow-xs flex flex-col gap-4 transition-all ".concat(r?"border-primary ring-1 ring-primary/20":"border-slate-200/90 hover:border-primary/50"),children:[(0,s.jsxs)("div",{className:"flex items-center justify-between border-b border-slate-100 pb-3 gap-2",children:[(0,s.jsxs)("div",{className:"flex items-center gap-3 min-w-0 flex-1",children:[(0,s.jsx)("div",{className:"h-6 flex items-center shrink-0",children:e.urlLogo&&(0,s.jsx)("img",{src:m,alt:y,className:"h-5 max-w-[100px] object-contain object-left",onError:e=>{e.target.style.display="none"}})}),(0,s.jsx)("span",{className:"font-medium text-slate-800 text-xs truncate",children:y})]}),(0,s.jsxs)("div",{className:"flex items-center gap-1.5 shrink-0",children:[null!=b&&b<8&&(0,s.jsx)("span",{className:"text-[9px] sm:text-[10px] font-semibold text-rose-600 bg-rose-50 px-2 py-0.5 rounded-md animate-pulse whitespace-nowrap",children:1===b?"\xdaltima vaga!":"\xdaltimas ".concat(b," vagas!")}),(0,s.jsx)("span",{className:"text-[9px] sm:text-[10px] font-bold px-2 py-0.5 rounded-md uppercase tracking-wider whitespace-nowrap ".concat(e.isConexao?"bg-amber-100 text-amber-800":"bg-slate-100 text-slate-700"),
16children:x})]})]}),(0,s.jsxs)("div",{className:"flex flex-col sm:flex-row items-center justify-between gap-4",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between sm:justify-start gap-4 w-full sm:w-auto flex-1",children:[(0,s.jsxs)("div",{className:"flex flex-col",children:[(0,s.jsx)("span",{className:"text-[10px] font-semibold text-slate-400 uppercase",children:"Sa\xedda"}),(0,s.jsx)("span",{className:"text-lg sm:text-xl font-semibold text-slate-900 tracking-tight",children:n}),(0,s.jsx)("span",{className:"text-[10px] text-slate-500",children:d(l)}),(0,s.jsx)("span",{className:"text-[10px] text-slate-500",children:e.originName})]}),(0,s.jsxs)("div",{className:"flex flex-col items-center px-2",children:[(0,s.jsx)("span",{className:"text-[10px] font-medium text-slate-400",children:c||"--"}),(0,s.jsx)("div",{className:"w-20 sm:w-24 h-[2px] bg-slate-200 rounded-full my-1.5 relative flex items-center justify-center",children:(0,s.jsx)("div",{className:"w-1.5 h-1.5 rounded-full bg-primary"})})]}),(0,s.jsxs)("div",{className:"flex flex-col",children:[(0,s.jsx)("span",{className:"text-[10px] font-semibold text-slate-400 uppercase",children:"Chegada"}),(0,s.jsx)("span",{className:"text-lg sm:text-xl font-semibold text-slate-900 tracking-tight",children:o}),(0,s.jsx)("span",{className:"text-[10px] text-slate-500",children:d(i)}),(0,s.jsx)("span",{className:"text-[10px] font-semibold text-slate-500",children:e.destinationName})]})]}),(0,s.jsxs)("div",{className:"flex items-center justify-between sm:justify-end w-full sm:w-auto border-t sm:border-t-0 pt-3 sm:pt-0 border-slate-100 gap-4",children:[(0,s.jsxs)("div",{className:"flex flex-col items-start sm:items-end justify-center",children:[(0,s.jsx)("span",{className:"text-[10px] font-semibold text-slate-400 uppercase sm:hidden mb-0.5",children:"Valor"}),f&&(0,s.jsxs)("div",{className:"flex items-center gap-1.5 leading-none",children:[(0,s.jsxs)("span",{className:"text-xs text-slate-400 line-through font-medium",children:["R$ ",g]}),(0,s.jsxs)("span",{className:"text-[10px] font-bold text-emerald-700 bg-emerald-100/80 px-1.5 py-0.5 rounded-md",children:[f?Math.round((h-p)/h*100):0,"% OFF"]})]}),(0,s.jsxs)("div",{className:"text-xl font-black text-secondary tracking-tight",children:[(0,s.jsx)("span",{className:"text-xs font-semibold mr-0.5",children:"R$"}),u]})]}),(0,s.jsx)("button",{onClick:()=>aI(e),className:"text-xs px-6 py-2.5 rounded-xl font-semibold transition-all active:scale-95 shadow-xs ".concat(r?"bg-slate-200 text-slate-800 hover:bg-slate-300":"bg-primary hover:bg-primary/90 text-white"),children:r?"Fechar":"Selecionar"})]})]}),r&&(0,s.jsx)("div",{className:"border-t border-slate-100 pt-4 mt-2 animate-fade-in",children:ei?(0,s.jsxs)("div",{className:"flex items-center justify-center gap-2 py-8 text-slate-500",children:[(0,s.jsx)(P,{className:"w-5 h-5 animate-spin text-primary"}),(0,s.jsx)("span",{className:"text-xs font-medium",children:"Carregando mapa de poltronas..."})]}):ex?(0,s.jsxs)("div",{className:"bg-white p-6 rounded-2xl border border-slate-200 max-w-md mx-auto my-3 shadow-md",children:[(0,s.jsxs)("div",{className:"text-center mb-5",children:[(0,s.jsx)("h3",{className:"text-base font-bold text-slate-800",children:"Acesse sua conta da PassagensBR"}),(0,s.jsx)("p",{className:"text-xs text-slate-500 mt-1",children:"Fa\xe7a login para continuar sua reserva sem perder os assentos."})]}),(0,s.jsxs)("div",{className:"relative w-full mb-4",children:[(0,s.jsxs)("button",{type:"button",className:"w-full bg-blue-500 hover:bg-blue-600 text-white text-sm py-3 px-4 rounded-xl font-bold transition-all flex items-center justify-center gap-2.5 shadow-xs",children:[(0,s.jsx)("img",{src:"https://upload.wikimedia.org/wikipedia/commons/c/c1/Google_%22G%22_logo.svg",alt:"Google",className:"w-5 h-5 bg-white rounded-full p-0.5"}),"CONTINUE COM GOOGLE"]}),(0,s.jsx)("div",{className:"absolute inset-0 opacity-0 cursor-pointer overflow-hidden rounded-xl",children:(0,s.jsx)(ee.kZ,{onSuccess:async e=>{aP(e)},onError:()=>console.error("Falha no login"),width:"100%"})})]}),(0,s.jsxs)("div",{className:"relative flex py-1 items-center mb-4",children:[(0,s.jsx)("div",{className:"flex-grow border-t border-slate-200"}),(0,s.jsx)("span",{className:"flex-shrink mx-3 text-xs text-slate-400 font-medium uppercase",children:"ou"}),(0,s.jsx)("div",{className:"flex-grow border-t border-slate-200"})]}),(0,s.jsxs)("form",{onSubmit:aR,className:"space-y-3.5",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-xs font-bold text-slate-600 uppercase mb-1.5",children:"E-mail"}),(0,s.jsx)("input",{type:"email",value:ep,onChange:e=>eu(e.target.value),placeholder:"Seu endere\xe7o de e-mail",required:!0,className:"w-full px-3.5 py-2.5 text-sm rounded-xl border border-slate-200 focus:outline-none focus:ring-2 focus:ring-primary/50 text-slate-800 bg-slate-50/50"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-xs font-bold text-slate-600 uppercase mb-1.5",children:"Senha"}),(0,s.jsx)("input",{type:"password",value:eh,onChange:e=>eg(e.target.value),placeholder:"Sua senha",required:!0,className:"w-full px-3.5 py-2.5 text-sm rounded-xl border border-slate-200 focus:outline-none focus:ring-2 focus:ring-primary/50 text-slate-800 bg-slate-50/50"})]}),(0,s.jsxs)("div",{className:"flex gap-2.5 pt-2",children:[(0,s.jsx)("button",{type:"button",onClick:()=>em(!1),className:"w-1/3 bg-slate-100 hover:bg-slate-200 text-slate-600 text-xs py-3 rounded-xl font-bold transition-all",children:"Voltar"}),(0,s.jsx)("button",{type:"submit",disabled:ef,className:"w-2/3 bg-orange-500 hover:bg-orange-600 text-white text-xs py-3 rounded-xl font-bold transition-all flex items-center justify-center gap-2 shadow-xs",children:ef?(0,s.jsx)(P,{className:"w-4 h-4 animate-spin"}):"ENTRAR"})]})]}),(0,s.jsxs)("div",{className:"text-center mt-4 pt-3 border-t border-slate-100 space-y-1.5",children:[(0,s.jsxs)("p",{className:"text-xs text-slate-500",children:["Ainda n\xe3o tem conta?"," ",(0,s.jsx)(K(),{href:"/auth/register",className:"text-primary font-bold hover:underline",children:"Fa\xe7a seu cadastro"})]}),(0,s.jsx)("div",{children:(0,s.jsx)(K(),{href:"/auth/forgot-password",className:"text-xs text-slate-400 hover:text-slate-600 hover:underline",children:"Esqueceu sua senha?"})})]})]}):el?(0,s.jsx)(F,{busLayout:el,trip:e,onContinue:a=>{eZ(!0);let t=localStorage.getItem("token");if(!t){ev({trip:e,seats:a}),em(!0);return}ew(e),console.log(el),(null==el?void 0:el.type)==="connection"&&Array.isArray(null==el?void 0:el.data)?ek(el.data):ek([]),eS(a),eE(!0)}}):(0,s.jsx)("div",{className:"text-center py-4 text-xs text-slate-500",children:"N\xe3o foi poss\xedvel carregar o mapa de assentos para este \xf4nibus."})})]},"".concat(a,"-").concat(t))}),(0,s.jsx)("div",{className:"flex items-center gap-1.5 overflow-x-auto py-1.5 px-1 scrollbar-none",children:[{label:"Ver todas",filtro:null},{label:"Mais cedo",filtro:"cedo"},{label:"Mais r\xe1pida",filtro:"rapido"},{label:"Mais barata",filtro:"barato"},{label:"De manh\xe3",filtro:"manha"},{label:"\xc0 tarde",filtro:"tarde"}
16,{label:"\xc0 noite",filtro:"noite"}].map((e,a)=>{let t=B===e.filtro;return(0,s.jsx)("button",{onClick:()=>aL(e.filtro),className:"text-[11px] px-2.5 py-1 rounded-full font-medium transition-all whitespace-nowrap shrink-0 active:scale-95 border ".concat(t?"bg-primary text-white border-primary shadow-xs":"bg-slate-100 hover:bg-slate-200 text-slate-600 border-slate-200/60"),children:e.label},a)})}),eA&&ej&&(()=>{var e,a,t,r;let l=(e,a,t)=>{if(eD)return;let s=t;"fone"===a?s=t.replace(/\D/g,"").replace(/^(\d{2})(\d)/g,"($1) $2").replace(/(\d{5})(\d{4}).*/,"$1-$2"):"docUf"===a?s=t.toUpperCase().slice(0,2):"docNumber"===a&&(s=t.replace(/\D/g,""));let r=[...eC];r[e]={...r[e],passenger:{name:"",fone:"",docNumber:"",docDispatcher:"",docUf:"",...r[e].passenger||{},[a]:s}},eS(r)};return(0,s.jsxs)("div",{className:"max-w-full my-4 bg-white rounded-lg border border-slate-200 shadow-sm animate-fade-in font-['Poppins',sans-serif]",children:[(0,s.jsxs)("div",{className:"p-4 pb-3 flex justify-between items-start",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("h2",{className:"text-sm font-bold text-gray-900 uppercase tracking-wide",children:"Trecho de Ida"}),(0,s.jsxs)("p",{className:"text-[11px] text-gray-500 uppercase mt-0.5 tracking-wider",children:["Saindo ",new Date(ej.departure).toLocaleDateString("pt-BR",{weekday:"long",day:"numeric",month:"long"}).replace("-feira","")]})]}),(0,s.jsxs)("div",{className:"flex flex-col items-end",children:[(0,s.jsx)("img",{src:"https://passagensbrassets.s3-sa-east-1.amazonaws.com/empresas/".concat(ej.busCompany,"/img/").concat(ej.urlLogo),alt:ej.busCompanyName||"Logo da empresa",className:"h-5 max-w-[100px] object-contain mb-1"}),(0,s.jsx)("span",{className:"text-[11px] font-bold text-gray-800 uppercase tracking-wider",children:ej.service})]})]}),(0,s.jsx)("div",{className:"px-4 pb-4 border-b border-gray-200",children:eN&&eN.length>0?(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsxs)("span",{className:"text-[10px] bg-primary/10 text-primary font-extrabold px-2 py-0.5 rounded-full uppercase tracking-wider inline-block mb-1",children:["Viagem com ",eN.length," Trechos"]}),eN.map((e,a)=>{let t=e.travel||{},r=t.departureTime||t.departure||"",l=t.arrivalTime||t.arrival||"",n=t.originName||t.origin||"",i=t.destinationName||t.destination||"";return(0,s.jsxs)("div",{className:"pb-3 border-b border-gray-100 last:border-none",children:[(0,s.jsxs)("p",{className:"text-xs font-bold text-gray-800 mb-2",children:[a+1,"\xba Trecho"]}),(0,s.jsx)("h1",{className:"text-lg text-gray-900 mb-2 font-light",children:r.split("T")[1]||"--:--"}),(0,s.jsxs)("div",{className:"relative",children:[(0,s.jsx)("div",{className:"absolute left-[11px] top-[24px] bottom-[24px] w-[2px] bg-gray-200"}),(0,s.jsxs)("p",{className:"text-xs flex items-center mb-2 relative z-10",children:[(0,s.jsx)(V(),{src:q.Z,alt:"partida",width:24,height:24,className:"mr-3 bg-white rounded-full"}),(0,s.jsxs)("span",{className:"font-semibold text-gray-900",children:[r.split("T")[1]||"--:--"," ⢠",n]})]}),(0,s.jsxs)("p",{className:"text-xs flex items-center relative z-10",children:[(0,s.jsx)(V(),{src:Q.Z,alt:"chegada",width:24,height:24,className:"mr-3 bg-white rounded-full"}),(0,s.jsxs)("span",{className:"font-semibold text-gray-900",children:[l?"".concat(l.split("T")[0].split("-").slice(1,3).reverse().join("/")," - ").concat(l.split("T")[1]):""," ⢠",i]})]})]})]},a)})]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("h1",{className:"text-xl text-gray-900 mb-3 font-light",children:(null===(e=ej.departure)||void 0===e?void 0:e.split("T")[1])||"--:--"}),(0,s.jsxs)("div",{className:"relative",children:[(0,s.jsx)("div",{className:"absolute left-[11px] top-[24px] bottom-[24px] w-[2px] bg-gray-200"}),(0,s.jsxs)("p",{className:"text-xs flex items-center mb-3 relative z-10",children:[(0,s.jsx)(V(),{src:q.Z,alt:"partida",width:24,height:24,className:"mr-3 bg-white rounded-full"}),(0,s.jsxs)("span",{className:"font-semibold text-gray-900",children:[null===(a=ej.departure)||void 0===a?void 0:a.split("T")[1]," ⢠",ej.originName]})]}),(0,s.jsx)("div",{className:"flex items-center text-[11px] text-gray-500 ml-[36px] mb-3",children:(0,s.jsx)("span",{className:"bg-gray-100 px-2 py-0.5 rounded mr-2 font-bold",children:ej.time?(0,s.jsxs)(s.Fragment,{children:["00"===ej.time.split(":")[1]?"".concat(parseInt(ej.time.split(":")[0]),"h"):"".concat(parseInt(ej.time.split(":")[0]),"h ").concat(parseInt(ej.time.split(":")[1]),"min")," ","de dura\xe7\xe3o"]}):"---"})}),(0,s.jsxs)("p",{className:"text-xs flex items-center relative z-10",children:[(0,s.jsx)(V(),{src:
16Q.Z,alt:"chegada",width:24,height:24,className:"mr-3 bg-white rounded-full"}),(0,s.jsxs)("span",{className:"font-semibold text-gray-900",children:[null===(t=ej.arrival)||void 0===t?void 0:t.split("T")[0].split("-").slice(1,3).reverse().join("/")," - ",null===(r=ej.arrival)||void 0===r?void 0:r.split("T")[1]," ⢠",ej.destinationName]})]})]})]})}),(0,s.jsx)("div",{className:"bg-gray-50/50",children:eC.map((e,a)=>{var t,r,n,i,o;return(0,s.jsxs)("div",{className:"p-4 border-b border-gray-200 transition-all duration-300",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between cursor-pointer mb-3",children:[(0,s.jsxs)("div",{className:"flex items-center gap-3",children:[(0,s.jsx)("div",{className:"w-8 h-8 bg-primary/10 text-primary rounded-xl flex items-center justify-center font-bold text-xs border border-primary/20 shadow-sm",children:e.number}),(0,s.jsxs)("div",{className:"flex flex-col",children:[(0,s.jsxs)("span",{className:"text-[10px] font-bold text-gray-500 uppercase tracking-wide",children:[e.trechoLabel||e.trechoNumber?"Trecho ".concat(e.trechoNumber||e.trechoIndex+1," ⢠"):"","Poltrona ",e.number]}),(0,s.jsxs)("span",{className:"text-gray-700 text-xs font-medium",children:["Dados do ",(0,s.jsx)("strong",{className:"text-gray-900 font-bold",children:"Passageiro"})]})]})]}),eD&&(0,s.jsx)("span",{className:"text-[10px] font-bold text-emerald-600 bg-emerald-50 px-2 py-0.5 rounded-full border border-emerald-200",children:"Bloqueado"})]}),(0,s.jsxs)("div",{className:"bg-white p-3 rounded-xl border border-gray-100 shadow-sm space-y-3",children:[(0,s.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:[(0,s.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,s.jsx)("label",{className:"text-[10px] font-bold text-gray-600 uppercase tracking-wide",children:"Nome Completo"}),(0,s.jsx)("input",{type:"text",disabled:eD,placeholder:"Ex: Jo\xe3o da Silva",value:(null===(t=e.passenger)||void 0===t?void 0:t.name)||"",onChange:e=>l(a,"name",e.target.value),className:"w-full px-3 py-3 rounded-lg border border-gray-300 focus:outline-none focus:border-primary text-xs text-gray-800 placeholder-gray-400 disabled:bg-gray-100 disabled:text-gray-600 disabled:cursor-not-allowed font-['Poppins',sans-serif]"})]}),(0,s.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,s.jsx)("label",{className:"text-[10px] font-bold text-gray-600 uppercase tracking-wide",children:"Telefone"}),(0,s.jsx)("input",{type:"tel",disabled:eD,placeholder:"(00) 00000-0000",maxLength:15,value:(null===(r=e.passenger)||void 0===r?void 0:r.fone)||"",onChange:e=>l(a,"fone",e.target.value),className:"w-full px-3 py-3 rounded-lg border border-gray-300 focus:outline-none focus:border-primary text-xs text-gray-800 placeholder-gray-400 disabled:bg-gray-100 disabled:text-gray-600 disabled:cursor-not-allowed font-['Poppins',sans-serif]"})]})]}),(0,s.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-[2fr_1fr_80px] gap-3",children:[(0,s.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,s.jsx)("label",{className:"text-[10px] font-bold text-gray-600 uppercase tracking-wide",children:"N\xfamero RG"}),(0,s.jsx)("input",{type:"text",disabled:eD,placeholder:"Apenas n\xfameros",value:(null===(n=e.passenger)||void 0===n?void 0:n.docNumber)||"",onChange:e=>l(a,"docNumber",e.target.value),className:"w-full px-3 py-3 rounded-lg border border-gray-300 focus:outline-none focus:border-primary text-xs text-gray-800 placeholder-gray-400 disabled:bg-gray-100 disabled:text-gray-600 disabled:cursor-not-allowed font-['Poppins',sans-serif]"})]}),(0,s.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,s.jsx)("label",{className:"text-[10px] font-bold text-gray-600 uppercase tracking-wide",children:"\xd3rg\xe3o Emissor"}),(0,s.jsx)("input",{type:"text",disabled:eD,placeholder:"Ex: SSP",value:(null===(i=e.passenger)||void 0===i?void 0:i.docDispatcher)||"",onChange:e=>l(a,"docDispatcher",e.target.value),className:"w-full px-3 py-3 rounded-lg border border-gray-300 focus:outline-none focus:border-primary text-xs text-gray-800 placeholder-gray-400 disabled:bg-gray-100 disabled:text-gray-600 disabled:cursor-not-allowed uppercase font-['Poppins',sans-serif]"})]}),(0,s.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,s.jsx)("label",{className:"text-[10px] font-bold text-gray-600 uppercase tracking-wide",children:"UF"}),(0,s.jsx)("input",{type:"text",disabled:eD,placeholder:"SP",maxLength:2,value:(null===(o=e.passenger)||void 0===o?void 0:o.docUf)||"",onChange:e=>l(a,"docUf",e.target.value),className:"w-full px-3 py-3 rounded-lg border border-gray-300 focus:outline-none focus:border-primary text-xs text-gray-800 placeholder-gray-400 disabled:bg-gray-100 disabled:text-gray-600 disabled:cursor-not-allowed uppercase font-['Poppins',sans-serif] text-center font-bold"})]})]})]})]},e.id||a)})}),(0,s.jsxs)("div",{className:"p-4 bg-white border-t border-gray-200 rounded-b-lg",children:[(0,s.jsx)("h3",{className:"text-sm font-bold text-gray-900 uppercase tracking-wide mb-3",children:"Resumo da Compra"}),(()=>{let e=void 0!==eN&&eN&&eN.length>0,a=e?ej.price||0:(ej.price||0)*eC.length,t=e?ej.serviceTax||0:(ej.serviceTax||0)*eC.length;return(0,s.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,s.jsxs)("div",{className:"flex justify-between items-center text-xs text-gray-600",children:[(0,s.jsxs)("span",{children:["Passagem ",!e&&"(".concat(eC.length,"x)")]}),(0,s.jsx)("span",{className:"font-medium",children:Number(a).toLocaleStr
16ing("pt-BR",{style:"currency",currency:"BRL"})})]}),(0,s.jsxs)("div",{className:"flex justify-between items-center text-xs text-gray-600",children:[(0,s.jsxs)("span",{children:["Taxas e Servi\xe7os ",!e&&"(".concat(eC.length,"x)")]}),(0,s.jsx)("span",{className:"font-medium",children:Number(t).toLocaleString("pt-BR",{style:"currency",currency:"BRL"})})]}),(0,s.jsx)("div",{className:"my-2 border-t border-gray-100"}),(0,s.jsxs)("div",{className:"flex justify-between items-center text-sm font-bold text-gray-900",children:[(0,s.jsx)("span",{className:"uppercase tracking-wide text-xs",children:"Valor Total"}),(0,s.jsx)("span",{className:"text-emerald-600 text-lg",children:Number(a+t).toLocaleString("pt-BR",{style:"currency",currency:"BRL"})})]})]})})()]}),eD&&(0,s.jsxs)("div",{className:"p-4 bg-slate-50 border-t border-gray-200 space-y-4 animate-fade-in",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("h2",{className:"text-xs font-extrabold text-gray-900 uppercase tracking-wider",children:"Forma de Pagamento"}),(0,s.jsx)("p",{className:"text-[11px] text-gray-500 font-medium",children:"Selecione a op\xe7\xe3o desejada para concluir"})]}),(0,s.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3",children:[(0,s.jsxs)("div",{onClick:()=>eP("pix"),className:"cursor-pointer rounded-xl p-3.5 border transition-all flex flex-col justify-between ".concat("pix"===eR?"border-primary bg-primary/5 shadow-sm ring-0.5 ring-primary":"border-gray-200 bg-white hover:border-gray-300"),children:[(0,s.jsxs)("div",{className:"flex items-center justify-between mb-1.5",children:[(0,s.jsx)("span",{className:"text-xs font-bold text-gray-900",children:"Pix"}),(0,s.jsx)("div",{className:"w-4 h-4 rounded-full border flex items-center justify-center ".concat("pix"===eR?"border-primary bg-primary":"border-gray-300"),children:"pix"===eR&&(0,s.jsx)("div",{className:"w-1.5 h-1.5 bg-white rounded-full"})})]}),(0,s.jsx)("span",{className:"text-[11px] text-gray-500",children:"Aprova\xe7\xe3o imediata"})]}),(0,s.jsxs)("div",{onClick:()=>eP("card"),className:"cursor-pointer rounded-xl p-3.5 border transition-all flex flex-col justify-between ".concat("card"===eR?"border-primary bg-primary/5 shadow-sm ring-0.5 ring-primary":"border-gray-200 bg-white hover:border-gray-300"),children:[(0,s.jsxs)("div",{className:"flex items-center justify-between mb-1.5",children:[(0,s.jsx)("span",{className:"text-xs font-bold text-gray-900",children:"Cart\xe3o de Cr\xe9dito"}),(0,s.jsx)("div",{className:"w-4 h-4 rounded-full border flex items-center justify-center ".concat("card"===eR?"border-primary bg-primary":"border-gray-300"),children:"card"===eR&&(0,s.jsx)("div",{className:"w-1.5 h-1.5 bg-white rounded-full"})})]}),(0,s.jsx)("span",{className:"text-[11px] text-gray-500",children:"Parcelamento dispon\xedvel"})]})]}),(0,s.jsx)("div",{className:"bg-white border border-gray-200 rounded-xl p-4 text-xs text-gray-700 space-y-5 shadow-sm",children:"pix"===eR?(0,s.jsx)(s.Fragment,{children:(0,s.jsxs)("div",{className:"space-y-2 border-l-2 border-emerald-500 pl-3 py-0.5",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("span",{className:"text-xs font-semibold text-gray-900 tracking-tight",children:"Aprova\xe7\xe3o imediata"}),(0,s.jsx)("span",{className:"text-[10px] font-medium text-emerald-700 bg-emerald-50 px-1.5 py-0.5 rounded",children:"Pix"})]}),(0,s.jsxs)("p",{className:"text-gray-500 text-xs leading-relaxed max-w-sm",children:["O QR Code ser\xe1 gerado na pr\xf3xima etapa. Voc\xea ter\xe1 ",(0,s.jsx)("span",{className:"text-gray-800 font-medium",children:"6 minutos"})," para concluir o pagamento no aplicativo do seu banco."]})]})}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"flex flex-wrap border border-gray-100 bg-gray-50/50 p-3.5 rounded-lg items-center gap-3 justify-between mb-4",children:[(0,s.jsx)("p",{className:"uppercase font-bold text-[11px] text-gray-700 tracking-wider",children:"Parcele em at\xe9 12x com:"}),(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)(V(),{src:G.Z,alt:"Visa",width:36,height:28,className:"object-contain"}),(0,s.jsx)(V(),{src:W.Z,alt:"Hipercard",width:36,height:28,className:"object-contain"}),(0,s.jsx)(V(),{src:J.Z,alt:"Amex",width:36,height:28,className:"object-contain"}),(0,s.jsx)(V(),{src:Y.Z,alt:"Elo",width:36,height:28,className:"object-contain"})]})]}),(0,s.jsxs)("div",{className:"space-y-3",children:[(0,s.jsx)("h4",{className:"text-[11px] font-bold text-gray-900 tracking-wider up
16percase",children:"Dados do Cart\xe3o"}),(0,s.jsx)("div",{children:(0,s.jsx)("input",{type:"text",inputMode:"numeric",placeholder:"N\xfamero do cart\xe3o",value:eW,onChange:e=>eJ(am(e.target.value)),className:"w-full px-3 py-2.5 text-xs border border-gray-200 rounded-lg focus:ring-2 focus:ring-secondary/20 focus:border-secondary outline-none transition-all placeholder:text-gray-400"})}),(0,s.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,s.jsx)("input",{type:"text",inputMode:"numeric",placeholder:"Validade (MM/AA)",value:eY,onChange:e=>eX(ap(e.target.value)),className:"w-full px-3 py-2.5 text-xs border border-gray-200 rounded-lg focus:ring-2 focus:ring-secondary/20 focus:border-secondary outline-none transition-all placeholder:text-gray-400"}),(0,s.jsx)("input",{type:"text",inputMode:"numeric",placeholder:"C\xf3digo (CVV)",value:eK,onChange:e=>e0(au(e.target.value)),className:"w-full px-3 py-2.5 text-xs border border-gray-200 rounded-lg focus:ring-2 focus:ring-secondary/20 focus:border-secondary outline-none transition-all placeholder:text-gray-400"})]})]}),(0,s.jsxs)("div",{className:"space-y-3 pt-3 border-t border-gray-100",children:[(0,s.jsx)("h4",{className:"text-[11px] font-bold text-gray-900 tracking-wider uppercase",children:"Dados do Titular"}),(0,s.jsx)("div",{children:(0,s.jsx)("input",{type:"text",placeholder:"Nome impresso no cart\xe3o",value:e1,onChange:e=>e2(e.target.value.toUpperCase()),className:"w-full px-3 py-2.5 text-xs border border-gray-200 rounded-lg focus:ring-2 focus:ring-secondary/20 focus:border-secondary outline-none transition-all placeholder:text-gray-400"})}),(0,s.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,s.jsx)("input",{type:"text",inputMode:"numeric",placeholder:"CPF do titular",value:e5,onChange:e=>e4(ah(e.target.value)),className:"w-full px-3 py-2.5 text-xs border border-gray-200 rounded-lg focus:ring-2 focus:ring-secondary/20 focus:border-secondary outline-none transition-all placeholder:text-gray-400"}),(0,s.jsx)("input",{type:"text",inputMode:"numeric",placeholder:"Data de nascimento",value:e3,onChange:e=>e6(ag(e.target.value)),className:"w-full px-3 py-2.5 text-xs border border-gray-200 rounded-lg focus:ring-2 focus:ring-secondary/20 focus:border-secondary outline-none transition-all placeholder:text-gray-400"})]}),(0,s.jsx)("div",{children:(0,s.jsx)("input",{type:"text",inputMode:"numeric",placeholder:"CEP da fatura",value:e8,onChange:e=>{let a=af(e.target.value);e7(a);let t=a.replace(/\D/g,"");8===t.length&&aN(t)},className:"w-full px-3 py-2.5 text-xs border border-gray-200 rounded-lg focus:ring-2 focus:ring-secondary/20 focus:border-secondary outline-none transition-all placeholder:text-gray-400"})})]}),(0,s.jsxs)("div",{className:"space-y-3 pt-3 border-t border-gray-100",children:[(0,s.jsx)("h4",{className:"text-[11px] font-bold text-gray-900 tracking-wider uppercase",children:"Contato"}),(0,s.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,s.jsx)("input",{type:"tel",inputMode:"tel",placeholder:"Telefone",value:e9,onChange:e=>ae(ab(e.target.value)),className:"w-full px-3 py-2.5 text-xs border border-gray-200 rounded-lg focus:ring-2 focus:ring-secondary/20 focus:border-secondary outline-none transition-all placeholder:text-gray-400"}),(0,s.jsx)("input",{type:"email",placeholder:"E-mail",value:aa,onChange:e=>at(e.target.value),className:"w-full px-3 py-2.5 text-xs border border-gray-200 rounded-lg focus:ring-2 focus:ring-secondary/20 focus:border-secondary outline-none transition-all placeholder:text-gray-400"})]})]}),(0,s.jsxs)("div",{className:"space-y-2 pt-3 border-t border-gray-100",children:[(0,s.jsx)("h4",{className:"text-[11px] font-bold text-gray-900",children:"Em quantas parcelas?"}),(0,s.jsxs)("div",{className:"relative",children:[(0,s.jsx)("select",{value:as,onChange:e=>ar(e.target.value),disabled:ai||0===al.length,className:"w-full px-3 py-2.5 text-xs border border-gray-200 rounded-lg focus:ring-2 focus:ring-secondary/20 focus:border-secondary outline-none transition-all bg-white text-gray-700 appearance-none disabled:bg-gray-50 disabled:text-gray-400",children:ai?(0,s.jsx)("option",{value:"",children:"Calculando parcelas..."}):0===al.length?(0,s.jsx)("option",{value:"",children:"Insira o
16n\xfamero do cart\xe3o para ver as parcelas"}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("option",{value:"",children:"Selecione o parcelamento"}),al.map(e=>{let a=e.amount.toLocaleString("pt-BR",{style:"currency",currency:"BRL"}),t=e.total.toLocaleString("pt-BR",{style:"currency",currency:"BRL"}),r=e.rate>0,l="number"==typeof e.rate?e.rate.toFixed(2).replace(".",","):e.rate,n=r?"(total ".concat(t," - juros de ").concat(l,"%)"):"sem juros";return(0,s.jsxs)("option",{value:e.times,children:[e.times,"x de ",a," ",n]},e.times)})]})}),(0,s.jsx)("div",{className:"pointer-events-none absolute inset-y-0 right-0 flex items-center px-3 text-gray-400",children:(0,s.jsx)("svg",{className:"w-4 h-4 fill-current",viewBox:"0 0 20 20",children:(0,s.jsx)("path",{d:"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z"})})})]})]})]})})]}),eM&&eL&&(()=>{let e=null!=eL&&!!eL.pixPaymentSessionValidity&&new Date>new Date(eL.pixPaymentSessionValidity);return(0,s.jsxs)("div",{className:"w-full max-w-sm mx-auto p-5 bg-white border-y border-slate-200/80 shadow-sm space-y-4 text-center",children:[(0,s.jsxs)("div",{className:"space-y-1",children:[(0,s.jsxs)("div",{className:"inline-flex items-center gap-1.5 px-2.5 py-0.5 rounded-full border text-[11px] font-semibold ".concat(e?"bg-rose-50 border-rose-200/60 text-rose-700":"bg-emerald-50 border-emerald-200/60 text-emerald-700"),children:[(0,s.jsxs)("span",{className:"relative flex h-2 w-2",children:[!e&&(0,s.jsx)("span",{className:"animate-ping absolute inline-flex h-full w-full rounded-full bg-emerald-400 opacity-75"}),(0,s.jsx)("span",{className:"relative inline-flex rounded-full h-2 w-2 ".concat(e?"bg-rose-500":"bg-emerald-500")})]}),e?"Pagamento expirado":"Aguardando pagamento"]}),(0,s.jsx)("h3",{className:"text-lg font-bold text-slate-800 tracking-tight",children:"Pagamento via Pix"}),(0,s.jsx)("p",{className:"text-[11px] text-slate-500",children:e?"Este c\xf3digo Pix n\xe3o \xe9 mais v\xe1lido.":"Escaneie o QR Code ou copie o c\xf3digo abaixo."})]}),(0,s.jsx)("div",{className:"flex justify-center",children:(0,s.jsx)("div",{className:"p-3 bg-white border rounded-xl shadow-xs ".concat(e?"opacity-40 grayscale border-rose-200":"border-slate-200"),children:(null==eL?void 0:eL.pixQRCodeUrl)?(0,s.jsx)("img",{src:"data:image/png;base64,".concat(eL.pixQRCodeUrl),alt:"QR Code Pix",className:"w-44 h-44 object-contain"}):(0,s.jsx)("div",{className:"w-44 h-44 bg-slate-50 rounded-lg flex items-center justify-center text-xs text-slate-400",children:"Carregando QR Code..."})})}),(0,s.jsxs)("div",{className:"space-y-1 text-left",children:[(0,s.jsx)("label",{className:"text-[11px] font-medium text-slate-600 block pl-0.5",children:"C\xf3digo Pix Copia e Cola"}),(0,s.jsxs)("div",{className:"flex items-center bg-slate-50 border border-slate-200 rounded-lg p-1 focus-within:border-slate-400 transition-colors",children:[(0,s.jsx)("input",{type:"text",readOnly:!0,disabled:e,value:(null==eL?void 0:eL.pixQRCodeData)||"",className:"w-full text-xs px-2 py-1 text-slate-600 bg-transparent focus:outline-none font-mono overflow-hidden text-ellipsis whitespace-nowrap disabled:opacity-50"}),(0,s.jsx)("button",{type:"button",disabled:e,onClick:()=>{(null==eL?void 0:eL.pixQRCodeData)&&!e&&(navigator.clipboard.writeText(eL.pixQRCodeData),eV(!0),setTimeout(()=>eV(!1),3e3))},className:"px-3 py-1.5 text-xs font-semibold rounded-md transition-all shrink-0 uppercase tracking-wider ".concat(e?"bg-slate-300 text-slate-500 cursor-not-allowed":eO?"bg-emerald-600 text-white":"bg-slate-900 text-white hover:bg-slate-800 active:scale-95"),children:eO?"Copiado!":"Copiar"})]})]}),(null==eL?void 0:eL.pixPaymentSessionValidity)&&(0,s.jsx)("div",{className:"pt-2 border-t flex items-center justify-center gap-1.5 text-[11px] ".concat(e?"border-rose-100 text-rose-600 font-medium":"border-slate-100 text-amber-700"),children:(0,s.jsx)("span",{children:e?"Pix expirado. Refa\xe7a a pesquisa para reservar seu assento novamente.":(0,s.jsxs)(s.Fragment,{children:["V\xe1lido at\xe9: ",(0,s.jsx)("strong",{children:new Date(eL.pixPaymentSessionValidity).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})})]})})})]})})(),(0,s.jsx)("div",{className:"flex flex-col md:flex-row gap-3 p-4 bg-white border-t border-gray-200 rounded-b-lg",children:!eM&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("button",{type:"button",onClick:()=>{eD?eT(!1):(eE(!1),eS([]),ew(null))},className:"w-full md:w-1/3 bg-slate-100 hover:bg-slate-200 text-slate-700 text-xs px-5 py-2.5 rounded-xl font-bold transition-all shadow-md active:scale-95 uppercase tracking-wider font-['Poppins',sans-serif]",children:eD?"Editar Dados":"Cancelar"}),(0,s.jsx)("button",{type:"button",disabled:eF,onClick:async()=>
16{if(eD){if("pix"===eR){if(ay()){eH(!0);try{let e=eC.map(e=>{var a;return{...e,passenger:{...e.passenger,fone:(null===(a=e.passenger)||void 0===a?void 0:a.fone)?e.passenger.fone.replace(/\D/g,""):""}}}),a=await (0,Z.fZ)(ej,e,ez,eN);if(a&&a.pixQRCodeData){e_(a),eI(!0);let e=setInterval(async()=>{try{let t=await (0,Z.pq)(a.vewId);t&&!0===t.pixPagoComSucesso&&(clearInterval(e),eI(!1),eq(!0))}catch(e){console.error("Erro ao verificar status do Pix:",e)}},5e3)}else alert("Erro ao gerar o QR Code Pix. Tente novamente.")}catch(e){alert("Erro ao processar o Pix. Tente novamente em alguns instantes.")}finally{eH(!1)}}}else{if(!ay()||!av())return;eH(!0);try{let e=eC.map(e=>{var a;return{...e,passenger:{...e.passenger,fone:(null===(a=e.passenger)||void 0===a?void 0:a.fone)?e.passenger.fone.replace(/\D/g,""):""}}}),a=await (0,Z.oJ)(ej,e,ez,aE,eN);200===a.status||201===a.status?eq(!0):alert("N\xe3o foi poss\xedvel concluir a compra. Tente novamente.")}catch(e){alert("Ocorreu um erro ao processar o pagamento. Verifique os dados do cart\xe3o.")}finally{eH(!1)}}}else{if(!ay())return;eT(!0)}},className:"w-full md:w-2/3 text-white text-xs px-5 py-2.5 rounded-xl font-bold transition-all shadow-md active:scale-95 uppercase tracking-wider font-['Poppins',sans-serif] flex items-center justify-center gap-2 ".concat(eF?"opacity-75 cursor-not-allowed":""," ").concat(eD&&"card"===eR?"bg-primary hover:opacity-90":"bg-orange-500 hover:bg-orange-600"),children:eF?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("svg",{className:"animate-spin h-4 w-4 text-white",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[(0,s.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),(0,s.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),(0,s.jsx)("span",{children:"Gerando Pix..."})]}):eD?"pix"===eR?"Gerar QR Code Pix":"Pagar com Cart\xe3o":"Ir para o Pagamento"})]})})]})})()]})})()]},t)})})(),f&&(0,s.jsxs)("div",{className:"flex items-center gap-2.5 text-slate-600 bg-white border border-slate-200/80 px-4 py-3 rounded-2xl rounded-bl-xs shadow-xs w-fit animate-fade-in",children:[(0,s.jsx)(D,{className:"w-4 h-4 text-primary animate-pulse shrink-0"}),(0,s.jsx)("span",{className:"text-xs font-medium text-slate-500",children:"Buscando viagens dispon\xedveis..."})]}),!f&&0===h.length&&!es&&e.origem&&e.destino&&e.data&&(0,s.jsxs)("div",{className:"p-4 bg-white border border-slate-200/90 rounded-2xl text-center my-4 text-xs sm:text-sm text-slate-600 shadow-xs relative",children:[(0,s.jsx)("button",{onClick:()=>er(!0),className:"absolute top-2 right-3 text-slate-400 hover:text-slate-600 text-xs font-bold",children:"â"}),"N\xe3o encontrei nenhuma viagem dispon\xedvel para esta data e rota."]}),e.loading&&!f&&(0,s.jsxs)("div",{className:"flex items-center gap-2.5 text-slate-600 bg-white border border-slate-200/80 px-4 py-3 rounded-2xl rounded-bl-xs shadow-xs w-fit font-['Poppins',sans-serif]",children:[(0,s.jsx)(D,{className:"w-4 h-4 text-primary animate-pulse shrink-0"}),(0,s.jsx)("span",{className:"text-xs font-medium text-slate-500",children:"Digitando..."})]}),(0,s.jsx)("div",{ref:m})]})}),e.mensagens.length>0&&(0,s.jsx)("div",{className:"p-3 sm:p-4 bg-white/80 backdrop-blur-md border-t border-slate-100 font-['Poppins',sans-serif]",children:(0,s.jsxs)("form",{onSubmit:e=>{e.preventDefault(),aO()},className:"max-w-3xl mx-auto flex items-center bg-slate-100/70 border border-slate-200 rounded-2xl px-3 py-1.5 focus-within:border-primary focus-within:bg-white transition-all shadow-inner",children:[(0,s.jsx)("input",{ref:z,type:"text",value:c,onChange:e=>x(e.target.value),placeholder:"Digite sua mensagem...",disabled:e.loading,className:"flex-1 bg-transparent text-slate-800 placeholder-slate-400 text-xs sm:text-sm outline-none px-2 py-1"}),(0,s.jsx)("button",{type:"submit",onMouseDown:e=>e.preventDefault(),disabled:!c.trim()||e.loading,className:"bg-primary hover:bg-primary/90 text-white p-2 rounded-xl disabled:opacity-30 transition-all active:scale-95 ml-1",children:(0,s.jsx)(T,{className:"w-4 h-4"})})]})}),e$&&(0,s.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-sm p-4 animate-fade-in font-['Poppins',sans-serif]",children:(0,s.jsxs)("div",{className:"bg-white w-full max-w-md rounded-2xl p-6 shadow-2xl border border-gray-100 text-center transform transition-all scale-100",children:[(0,s.jsx)("div",{className:"mx-auto flex items-center justify-center h-16 w-16 rounded-full bg-primary/10 mb-4 text-primary animate-bounce",children:(0,s.jsx)("svg",{className:"h-8 w-8",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2.5",d:"M5 13l4 4L19 7"})})}),(0,s.jsx)("h3",{className:"text-xl font-extrabold text-primary tracking-wide uppercase",children:"Pagamento Confirmado!"}),(0,s.jsx)("p",{className:"text-sm text-gray-600 mt-2 leading-relaxed",children:"Sua passagem foi emitida com sucesso e enviada diretamente para o seu e-mail registrado."}),(0,s.jsxs)("div",{className:"mt-4 p-3 bg-secondary/10 border border-secondary/20 rounded-xl text-left flex items-start gap-3",children:[(0,s.jsx)("span",{className:"text-secondary text-base",children:"\uD83D\uDCA1"}),(0,s.jsxs)("p",{className:"text-xs text-gray-700 leading-tight",children:[(0,s.jsx)("strong",{children:"N\xe3o encontrou na caixa de entrada?"})," Lembre-se de dar uma olhada na sua pasta de ",(0,s.jsx)("strong",{className:"text-secondary",children:"Spam"})," ou ",(0,s.jsx)("strong",{className:"text-secondary",children:"Lixo Eletr\xf4nico"}),"."]})]}),(0,s.jsx)("button",{type:"button",onClick:()=>{eq(!1),g([]),x(""),a("Compra efetuada com sucesso!"),er(!0),ec(null),en(null),ew(null),eS([]),em(!1),ev(null),eE(!1)},className:"mt-6 w-full bg-primary hover:bg-primary/90 text-white font-bold py-3 px-4 roun
16ded-xl shadow-lg transition-all active:scale-95 uppercase text-xs tracking-wider cursor-pointer",children:"Entendido, obrigado!"})]})}),(0,s.jsx)("footer",{className:"py-2 px-4 bg-white/50 text-center border-t border-slate-100 shrink-0",children:(0,s.jsxs)("p",{className:"text-[10px] text-slate-400 leading-relaxed",children:["Atendimento via IA. Respostas podem conter imprecis\xf5es. Consulte nossos"," ",(0,s.jsx)(K(),{href:"/termos-e-condicoes",className:"text-primary font-medium hover:underline",children:"Termos de Uso"})]})})]})]})]})}},87005:function(e,a,t){"use strict";t.d(a,{w:function(){return l}});var s=t(29567),r=t(90277);let l={async searchAgency(e){if(!e||e.length<3)return[];try{let{data:a}=await s.p.get("".concat(r.b.PBR.SEARCH_AGENCY,"?value=").concat(e));return(null==a?void 0:a.list)||[]}catch(e){return console.error("Erro na busca de ag\xeancia:",e),[]}},async searchTravel(e,a,t){try{let{data:l}=await s.p.get(r.b.PBR.SEARCH_TRAVEL,{params:{date:e,origin:a,destination:t}});return(null==l?void 0:l.list)||[]}catch(e){return console.error("Erro na busca de viagens:",e),[]}},async getBusLayout(e){let a={date:e.departure,origin:e.origin,destination:e.destination,busCompany:e.busCompany,id:e.id};if(e.isConexao){let{data:t}=await s.p.get(r.b.PBR.SEARCH_BUS_LAYOUT_CONNECTION,{params:{...a,cseId:e.cseId,possuiPricing:e.possuiPricing}});return{type:"connection",data:t.list}}{let{data:t}=await s.p.get(r.b.PBR.SEARCH_BUS_LAYOUT,{params:{...a,cseId:e.cseId,possuiPricing:e.possuiPricing}});return{type:"standard",data:t.busLayout}}}}},87395:function(e,a,t){"use strict";t.d(a,{DO:function(){return o},f8:function(){return l},r4:function(){return d},x4:function(){return n},z3:function(){return i}});var s=t(29567),r=t(81417);let l=async e=>{let a=await s.p.post("clientes-web/password/request",{email:e});return a.data},n=async(e,a,t)=>{let r=await s.p.post("ti/session/logar",{email:e,senha:a,tipoDaConta:t});return r},i=async(e,a)=>{let t=await s.p.post("ti/session/logar",{email:e,senha:"",idDaConta:a,tipoDaConta:1},{headers:(0,r.rJ)()});return t},o=async(e,a,t)=>{let l=await s.p.post("clientes-web/cadastrar-novo-usuario",{email:a,idDaConta:t,senha:"",nome:e,tipoDaConta:1},{headers:(0,r.rJ)()});return l.data},d=async(e,a,t)=>{let r=await s.p.post("clientes-web/cadastrar-novo-usuario",{nome:e,email:a,senha:t,tipoDaConta:0});return r.data}},90277:function(e,a,t){"use strict";t.d(a,{b:function(){return s}});let s={PBR:{PURCHASE_CREATE:"/pbr/purchase/create",SEARCH_PARCELAS:"/pbr/config-juros-parcelas",GET_PIX_STATUS:e=>"/pbr1/pix/".concat(e),SEARCH_AGENCY:"/pbr/search-agency",SEARCH_TRAVEL:"/pbr/search-travel",SEARCH_BUS_LAYOUT:"/pbr/bus-layout",SEARCH_BUS_LAYOUT_CONNECTION:"/pbr/bus-layout-connection",UPDATE_CLIENT_WEB:"/clientes-web/update",SEARCH_MAIN_ROUTES:"/pbr/principais-viacoes",SEARCH_VIACOES:"/pbr/todas-viacoes",SEARCH_TERMINAIS:"/pbr/todas-rodoviarias",SEARCH_MAIN_DESTINATIONS:"/pbr/principais-destinos",SEARCH_MOST_POPULAR_PASSAGES:"/pbr/passagens-mais-populares",SEARCH_PURCHASE:"/clientes-web/sales-orders",REQUEST_CANCELATION:"/clientes-web/refunds",ACTIVATION_ACCOUNT:"/ti/session/activate",CHECK_TOKEN:"/clientes-web/password/token/check",RESET_PASSWORD:"/clientes-web/password/redefine"}}}},function(e){e.O(0,[3690,9774,2888,179],function(){return e(e.s=99937)}),_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.