1import{j as e,r as n}from"./react-BEJkGLFG.js";import{C as mt,T as pt,L as ft,b as R,bQ as xt,bR as ta,bS as aa,bT as sa,bU as ra,u as na,bx as ia,bV as oa,bW as la,ad as Ce,aa as Se,bC as ca,bm as De,bX as da,bY as ua,bZ as ma}from"./index-Sl14MJ-E.js";import{h as pa,f as fa,s as xa}from"./googleMapsLoader-DqgfqVHa.js";import{j as ha,e as ga,l as ba,f as ka,g as ja,h as wa,S as Na,U as ya,i as va,C as Pa,t as Ca,s as Sa}from"./InsiderUpsellCard-LP7mmeZ0.js";import{u as Da}from"./supplierLocale-CgZWSzJM.js";import{d as et,e as tt,n as Ra,m as Re,b as Ta,f as at,g as $a,a as J}from"./useHotelHeroImage-D050WP_r.js";import{g as Te,A as Aa}from"./nearestAirport-DJbqtqIP.js";import{S as Fa,a as La,b as Ma,c as Ia,d as Ea}from"./transferAirport-ID9_DEGA.js";import{m as Ua,_ as Va,y as Ae,e as $e,l as st,N as rt,A as Ba,F as Ja,$ as Wa,c as Ya,d as _a}from"./icons-DKTTGi8G.js";import{r as Ha,p as Ka}from"./sanitizeHtml--acPRgW7.js";import{G as Oa,J as qa,K as ht,M as gt,N as bt,O as kt,Q as jt,U as wt}from"./radix-YpfejCpa.js";import{f as za}from"./member.index-Bos1xC7n.js";import{p as nt,w as it,c as Ga,f as Qa}from"./carRateChainRef-CmfKtxQe.js";function Nt({className:a="",linkClassName:s="underline hover:no-underline"}){return e.jsx("p",{className:a,children:e.jsx(pt,{i18nKey:"insiderLegal.disclosure",components:[e.jsx(ft,{to:"/terms",target:"_blank",rel:"noopener",className:s},"0")]})})}function js({children:a}){const{t:s}=mt();return e.jsxs("div",{className:"mt-5 border-t border-white/25 pt-5",children:[e.jsx("p",{className:"text-sm text-[#F0D3B3]",children:s("insiderLegal.leadIn")}),e.jsx(Nt,{className:"mt-3 text-sm text-[#F0D3B3]"}),a]})}const Xa=Oa,Za=qa,yt=n.forwardRef(({className:a,...s},o)=>e.jsx(wt,{className:R("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",a),...s,ref:o}));yt.displayName=wt.displayName;const vt=n.forwardRef(({className:a,...s},o)=>e.jsxs(Za,{children:[e.jsx(yt,{}),e.jsx(ht,{ref:o,className:R("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",a),...s})]}));vt.displayName=ht.displayName;const Pt=({className:a,...s})=>e.jsx("div",{className:R("flex flex-col space-y-2 text-center sm:text-left",a),...s});Pt.displayName="AlertDialogHeader";const Ct=({className:a,...s})=>e.jsx("div",{className:R("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",a),...s});Ct.displayName="AlertDialogFooter";const St=n.forwardRef(({className:a,...s},o)=>e.jsx(bt,{ref:o,className:R("text-lg font-semibold",a),...s}));St.displayName=bt.displayName;const Dt=n.forwardRef(({className:a,...s},o)=>e.jsx(kt,{ref:o,className:R("text-sm text-muted-foreground",a),...s}));Dt.displayName=kt.displayName;const Rt=n.forwardRef(({className:a,...s},o)=>e.jsx(jt,{ref:o,className:R(xt(),a),...s}));Rt.displayName=jt.displayName;const Tt=n.forwardRef(({className:a,...s},o)=>e.jsx(gt,{ref:o,className:R(xt({variant:"outline"}),"mt-2 sm:mt-0",a),...s}));Tt.displayName=gt.displayName;const Fe=["Enterprise","Avis","Budget","Hertz","Sixt","Thrifty","Dollar","Fox"];function es(a){const s=String(a.supplier??a.vendor??"").toLowerCase(),o=Fe.findIndex(m=>s.includes(m.toLowerCase()));return o===-1?Fe.length:o}function $t(a,s){const o=Fe.map(()=>[]);for(const h of a){const T=es(h);T<o.length&&o[T].push(h)}const m=[];for(const h of o)m.push(...h.slice(0,s));const w=new Set(m);for(const h of a)w.has(h)||m.push(h);return m}function ts(a,s=4){return $t(a,1).slice(0,s)}function as(a){return $t(a,4)}const ss=(()=>{const a=[];for(let s=0;s<24;s++)for(const o of[0,30])a.push(`${String(s).padStart(2,"0")}
1:${String(o).padStart(2,"0")}`);return a})();function rs(a){const[s,o]=a.split(":"),m=Number(s),w=Number(o);if(!isFinite(m)||!isFinite(w))return a;const h=m>=12?"PM":"AM";return`${(m+11)%12+1}:${String(w).padStart(2,"0")} ${h}`}function ot(a){if(!a)return;const[s,o,m]=a.split("-").map(Number);if(!(!s||!o||!m))return new Date(s,o-1,m)}function ns(a){const s=o=>String(o).padStart(2,"0");return`${a.getFullYear()}-${s(a.getMonth()+1)}-${s(a.getDate())}`}function lt({label:a,icon:s,date:o,time:m,onDateChange:w,onTimeChange:h,minDate:T}){const[Z,k]=n.useState(!1),E=ot(o),b=ot(T||""),me=E?E.toLocaleDateString([],{weekday:"short",month:"short",day:"numeric"}):"Pick a date";return e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"text-[10px] font-bold uppercase tracking-widest text-muted-foreground inline-flex items-center gap-1.5",children:[s," ",a]}),e.jsxs("div",{className:"grid grid-cols-1 gap-2 sm:grid-cols-[1fr_auto]",children:[e.jsxs(ta,{open:Z,onOpenChange:k,children:[e.jsx(aa,{asChild:!0,children:e.jsxs("button",{type:"button",className:R("h-11 w-full rounded-lg border border-border bg-background px-3","inline-flex items-center gap-2 text-sm font-semibold text-left","hover:border-primary/60 hover:bg-accent/40 focus:outline-none focus:ring-2 focus:ring-primary/40",!E&&"text-muted-foreground font-normal"),children:[e.jsx(Ua,{className:"h-4 w-4 text-primary shrink-0"}),e.jsx("span",{className:"truncate",children:me})]})}),e.jsx(sa,{className:"w-auto p-0",align:"start",children:e.jsx(ra,{mode:"single",selected:E,defaultMonth:E,onSelect:D=>{D&&(w(ns(D)),k(!1))},disabled:b?{before:b}:void 0,initialFocus:!0,className:R("p-3 pointer-events-auto")})})]}),e.jsxs(Fa,{value:m,onValueChange:h,children:[e.jsx(La,{className:R("h-11 w-full min-w-0 shrink sm:w-[120px] rounded-lg border-border bg-background","flex items-center py-0 leading-none","text-sm font-semibold hover:border-primary/60 hover:bg-accent/40","focus:ring-2 focus:ring-primary/40"),children:e.jsxs("span",{className:"!inline-flex items-center gap-1.5 whitespace-nowrap min-w-0 leading-none [&>span]:leading-none [&>span]:line-clamp-none [&>span]:block",children:[e.jsx(Va,{className:"h-4 w-4 text-primary"}),e.jsx(Ma,{placeholder:"Time"})]})}),e.jsx(Ia,{className:"max-h-72",children:ss.map(D=>e.jsx(Ea,{value:D,className:"text-sm",children:rs(D)},D))})]})]})]})}function is({open:a,onOpenChange:s,kindLabel:o,current:m,next:w,onConfirm:h}){return e.jsx(Xa,{open:a,onOpenChange:s,children:e.jsxs(vt,{children:[e.jsxs(Pt,{children:[e.jsxs(St,{children:["Replace your ",o,"?"]}),e.jsxs(Dt,{children:["Your trip can include one ",o,". Adding this one removes the ",o," already in your trip and updates your Trip Summary."]})]}),e.jsxs("div",{className:"grid gap-3 sm:grid-cols-[1fr_auto_1fr] items-center text-sm",children:[e.jsxs("div",{className:"rounded-lg border border-border p-3 min-w-0",children:[e.jsx("div",{className:"text-[10px] font-bold uppercase tracking-widest text-muted-foreground",children:"In your trip"}),e.jsx("div",{className:"font-semibold truncate",children:m?.name??"â"}),e.jsx("div",{className:"text-muted-foreground",children:m?.price??""})]}),e.jsx(Ae,{className:"h-4 w-4 text-muted-foreground mx-auto hidden sm:block"}),e.jsxs("div",{className:"rounded-lg border-2 border-primary p-3 min-w-0",children:[e.jsx("div",{className:"text-[10px] font-bold uppercase tracking-widest text-primary",children:"Replacing with"}),e.jsx("div",{className:"font-semibold truncate",children:w?.name??"â"}),e.jsx("div",{className:"text-muted-foreground",children:w?.price??""})]})]}),e.jsxs(Ct,{children:[e.jsxs(Tt,{children:["Keep current ",o]}),e.jsx(Rt,{onClick:h,children:"Replace"})]})]})})}const ct=a=>xa(a);function dt(a){if(!a)return"";const s=new Date(a);if(!isFinite(s.getTime()))return a.slice(0,10);const o=m=>String(m).padStart(2,"0");return`${s.getFullYear()}-${o(s.getMonth()+1)}-${o(s.getDate())}`}function ut(a){if(!a)return"10:00";const s=new Date(a);if(!isFinite(s.getTime()))return"10:00";const o=s.getHours()*60+s.getMinutes(),m=Math.round(o/30)*30,w=Math.min(23,Math.floor(m/60)),h=m%60;return`${String(w).padStart(2,"0")}
1:${String(h).padStart(2,"0")}`}function ws({arrivalAirport:a,airportName:s,airportDistanceKm:o,stayOrigin:m,editableAirport:w=!1,arrivalDateTime:h,returnDepartDateTime:T,endDate:Z,currency:k="USD",stayCurrency:E,isInsider:b=!1,isMember:me=!1,selectedCarId:D,selectedCar:u,onRemoveSelected:Le,onSelectInsider:pe,onChange:fe,returnTo:xe="/review/air",railOpen:L,hideOnFailure:At=!1,showEmptyState:ee=!1,hideAddToTrip:Me=!1,largeTitle:Ft=!1}){const te=na(ia);ha("RealCarPicks",L);const{t:i,i18n:Lt}=mt(),Mt=pa()?Lt.language:"en",q=t=>b?Ca(t,Mt):t,[l,he]=n.useState(a),Ie=n.useRef(!1),[It,Et]=n.useState(!1),[Ut,Ee]=n.useState(a),ge=n.useRef(a),Vt=t=>{Ie.current=!0,Et(!0),he(t)};n.useEffect(()=>{a&&!Ie.current&&he(a)},[a]),n.useEffect(()=>{Ee(l),ge.current=l},[l]);const U=It||!!l&&l.toUpperCase()!==(a||"").toUpperCase(),W=U?et(l):s??et(l),Ue=U?tt(m,l):typeof o=="number"?o:tt(m,l),ae=n.useMemo(()=>Ra(m,{limit:4,maxKm:250,exclude:[a||""]}),[m?.lat,m?.lng,a]),Bt=ae.join(","),[Ve,be]=n.useState(null),ke=n.useRef(null),Y=oa(),Jt=la();Y&&(b=!1);const se=Da({flow:"car",confirmLabel:Ce(),alwaysPrompt:!0}),N=fa(E),[_,Be]=n.useState(null),[H,re]=n.useState(!0),[M,z]=n.useState(null),[je,we]=n.useState(!1),[Wt,Yt]=n.useState(0),[A,K]=n.useState(D),[ne,Je]=n.useState(!1),[F,ie]=n.useState(null),[We,Ne]=n.useState(null),[_t,Ye]=n.useState("");ga({rail:"car",loading:H,ok:!M,count:_?.length??0});const[y,oe]=n.useState(!!b),O=n.useRef(null);n.useEffect(()=>{if(b&&(oe(!0),A)){const t=_?.find(r=>r.id===A);t&&Xe(t,!0)}},[b]),n.useEffect(()=>{K(D),D||(O.current=null)},[D]);const{defaultPickupDate:le,defaultPickupTime:ce,defaultDropoffDate:de,defaultDropoffTime:ue}=n.useMemo(()=>{const t=(p,d=0)=>{if(!p)return"";const f=new Date(p).getTime();return Number.isFinite(f)?new Date(f+d).toISOString():""},r=t(h,54e5);let c=T?t(T,-5400*1e3):Z||"";if(!T&&r){const p=new Date(r),d=new Date(p.getFullYear(),p.getMonth(),p.getDate()+1,10,0,0,0);c=t(d)}return r&&c&&Number.isFinite(new Date(c).getTime())&&new Date(c).getTime()<=new Date(r).getTime()&&(c=t(r,14400*1e3)),{defaultPickupDate:dt(r),defaultPickupTime:ut(r),defaultDropoffDate:dt(c),defaultDropoffTime:ut(c)}},[h,T,Z]),[x,_e]=n.useState(le),[C,He]=n.useState(ce),[g,Ke]=n.useState(de),[S,Oe]=n.useState(ue),[V,qe]=n.useState(null);n.useEffect(()=>{le&&_e(le)},[le]),n.useEffect(()=>{ce&&He(ce)},[ce]),n.useEffect(()=>{de&&Ke(de)},[de]),n.useEffect(()=>{ue&&Oe(ue)},[ue]);const v=n.useMemo(()=>{if(!x||!g)return 1;const t=new Date(`${g}T${S}`).getTime()-new Date(`${x}T${C}`).getTime();return Math.max(1,Math.round(t/(1e3*60*60*24)))},[x,C,g,S]);n.useEffect(()=>{if(!l||!x||!g){re(!1);return}if(ke.current===`${l}|${x}|${C}|${g}|${S}`)return;let t=!0;return re(!0),z(null),we(!1),(async()=>{try{const r=P=>({pickupLocation:P,dropoffLocation:P,pickupDate:x,pickupTime:C,dropoffDate:g,dropoffTime:S}),c=r(l),p=Date.now();let d=await Te(te,c);if(!t)return;let f=d?.ok&&d?.data?Re(d.data,v):[];const X=f.length===0;if(f.length===0){if(await new Promise(P=>setTimeout(P,500)),!t)return;try{d=await Te(te,c)}catch{d=null}if(!t)return;f=d?.ok&&d?.data?Re(d.data,v):[],X&&f.length>0?console.info("[cars.retry.recovered]",{key:`${c.pickupLocation}|${c.pickupDate}|${c.dropoffDate}`,count:f.length,elapsedMs:Date.now()-p}):X&&console.debug("[cars.retry.empty]",{elapsedMs:Date.now()-p})}if(f.length>0){Ne({requestJson:String(d?.meta?.searchRequestJson||""),responseJson:JSON.stringify(d?.data??{})});try{if(typeof window<"u"){nt();const P=d?.meta?.chainId;P?(it(String(P)),Ye(String(P))):console.error("[carChain] rail search returned results with no server rate chain")}}catch{}}else Ne(null);if(f.length===0&&!U&&ae.length>0){const P=await Promise.all(ae.map(async B=>{try{const I=await Te(te,r(B));return{code:B,alt:I,picks:I?.ok&&I?.data?Re(I.data,v):[]}}catch{return{code:B,alt:null,picks:[]}}}));if(!t)return;for(const{code:B,alt:I,picks:ve}of P){if(!t)return;if(ve.length!==0){console.info("[cars.airportFallback]",{from:l,to:B,count:ve.length,elapsedMs:Date.now()-p});try{if(typeof window<"u"){nt();const Pe=I?.meta?.chainId;Pe?(it(String(Pe)),Ye(String(Pe))):console.error("[carChain] fallback airport returned results with no server rate chain")}}catch{}Ne({requestJson:String(I?.meta?.searchRequestJson||""),responseJson:JSON.stringify(I?.data??{})}),Be(ve),z(null),be(l),ke.current=`${B}|${x}|${C}|${g}|${S}`,he(B),re(!1);return}}}if(f.length>0&&(be(null),ke.current=`${l}|${x}|${C}|${g}|${S}`),Be(f),f.length===0)if(!d||d.ok!==!0){const P=ct(d?.error);d?.error&&console.error("[cars.searchFailed]",d.error),we(!0),z(`Car availability could not be retrieved â ${P}. Please try again.`)}else z(ae.length>0?"No rental cars are available for these dates at any airport near your stay.":"No rental cars are available for these dates and location.")}catch(r){t&&(console.error("[cars.searchThrew]",r),we(!0),z(`Car availability could not be retrieved â ${ct(r instanceof Error?r.message:"")}. Please try again.`))}finally{t&&re(!1)}})(),()=>{t=!1}},[te,l,x,C,g,S,v,U,Bt,Wt]);const ze=n.useRef(null);n.useEffect(()=>{if(!ee||!je||!M)return;const t=`${l}|${x}|${g}|${M}`;ze.current!==t&&(ze.current=t,ba({data:{product:"cars",destination:l,startDate:x,endDate:g,error:M}}).catch(()=>{}))},[ee,je,M,l,x,g]);const j=n.useMemo(()=>
1{if(!_)return[];const t=r=>b?J(r):r.ratePerDay;return[..._].sort((r,c)=>(c.image?1:0)-(r.image?1:0)||t(r)-t(c))},[_,b]),G=ka(),Ht=n.useMemo(()=>{if(j.length===0)return[];const t=j.filter(d=>d.image),r=t.length>0?t:j,c=ts(r,G),p=new Set(c.map(d=>d.id));return[...c,...r.filter(d=>!p.has(d.id))]},[j,G]),Kt=`${l}|${x}|${C}|${g}|${S}`,$=ja(Ht,G,Kt),Ot=n.useMemo(()=>as(j),[j]),qt=n.useMemo(()=>{if(!A||$.some(r=>r.id===A))return $;const t=j.find(r=>r.id===A);return t?[t,...$].slice(0,G):$},[$,j,A,G]),Ge=u?.id?String(u.id):void 0,Qe=(ne?Ot.slice(0,20):qt).filter(t=>!Ge||t.id!==Ge);wa({count:j.length,fromPrice:j.length?Math.min(...j.map(t=>Number(t.ratePerDay)||1/0).filter(t=>isFinite(t)&&t>0)):null,loading:H});const zt=t=>{if(u&&u.id&&u.id!==t.id){ie({car:t,insider:y});return}const r=L?t.id:A===t.id?void 0:t.id;if(K(r),!r){O.current=null,fe?.(null);return}Q(t,y)},Gt=t=>{se.gate(()=>{if(u&&u.id&&u.id!==t.id){ie({car:t,insider:!0});return}K(t.id),oe(!0),Q(t,!0),b||pe?.()})},Qt=()=>{const t=F;ie(null),t&&(K(t.car.id),t.insider?se.gate(()=>{oe(!0),Q(t.car,!0),b||pe?.()}):Q(t.car,y))},Xe=(t,r)=>{const c=Ta(t,r,ea());return fe?.(c),ne&&(Je(!1),typeof window<"u"&&setTimeout(()=>{document.getElementById("car-upsell")?.scrollIntoView({behavior:"smooth",block:"start"})},50)),c},Q=(t,r)=>{const c=Xe(t,r);if(!L)return;const p=`${t.id}:${r?"insider":"standard"}`;O.current!==p&&(O.current=p,ye(c))},Xt=()=>new URLSearchParams({pickupLocation:l,dropoffLocation:l,pickupDate:x||"",pickupTime:C||"",dropoffDate:g||"",dropoffTime:S||""}).toString(),Zt=t=>{De({title:"We couldn't open your car booking",description:"This page couldn't open the car rental step. Your stay is untouched and nothing has been booked or charged. Try again, or book a car from the Cars page.",onRetry:()=>{t()}})},ea=()=>({pickupLocation:l,dropoffLocation:l,pickupDate:x,pickupTime:C,dropoffDate:g,dropoffTime:S,days:v,searchRequestJson:We?.requestJson||"",searchResponseJson:We?.responseJson||""}),ye=t=>{try{const r=_t,c=typeof crypto<"u"&&crypto.randomUUID?crypto.randomUUID():"";if(!c||!r||!t?.raw?.vehAvail)return De({title:"We couldn't lock in this car",description:"The current supplier rate is incomplete. Nothing has been booked or charged â please refresh the car options."}),!1;const p={...t,chainId:c};Ga(),za(p),da(c,p);const d=ua(p),f=L?.("/review/car",{...c?{carStash:c}:{},...d?{railCar:d}:{}});return f==="opened"&&c?Qa({data:{sourceId:r,id:c,selection:p,vehAvail:t.raw.vehAvail}})?.then?.(()=>{Sa(c)})?.catch?.(P=>console.error("[RealCarPicks.railStartPick] stash write failed",P)):(ma(c),O.current=null,K(void 0),f!=="refused"&&Zt(()=>{ye(t)})),f==="opened"}catch(r){return console.error("[RealCarPicks.railStartPick] rail open threw",r),De({title:"We couldn't open your car booking",description:"Something went wrong opening the rental step. Your stay is untouched and nothing has been charged.",onRetry:()=>{ye(t)}}),!1}},Ze=b?2:me?1:0;return e.jsxs("section",{id:"car-upsell",className:"rounded-2xl border border-border bg-card p-6 space-y-5 shadow-sm",children:[e.jsxs("header",{className:"flex items-end justify-between gap-4 flex-wrap",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"text-[11px] font-bold tracking-[0.2em] uppercase text-primary inline-flex items-center gap-1.5",children:[e.jsx($e,{className:"h-3.5 w-3.5"})," ",i("realCarPicks.header")]}),e.jsx("h2",{className:Ft?"weip-section-title font-display text-4xl font-bold leading-[1.05]":"font-display text-2xl font-bold",children:i("realCarPicks.title")}),e.jsx("p",{className:"text-sm text-muted-foreground",children:l?i("realCarPicks.subtitle",{airport:l}):i("realCarPicks.subtitleFallback")}),l&&W?e.jsx("p",{className:"text-xs text-muted-foreground",children:!U&&typeof Ue=="number"?i("realCarPicks.closestAirportWithMiles",{code:l,name:W,miles:Math.round(Ue*.621371),defaultValue:"Pickup at {{code}} â {{name}}, the closest airport to your stay (about {{miles}} miles away)."}):i(U?"realCarPicks.chosenAirport":"realCarPicks.closestAirport",{code:l,name:W,defaultValue:U?"Pickup at {{code}} â {{name}}.":"Pickup at {{code}} â {{name}}, the closest airport to your stay."})}):null,Ve?e.jsx("p",{className:"text-xs text-muted-foreground",children:i("realCarPicks.airportFallbackNotice",{from:Ve,code:l,defaultValue:"{{from}} has no rentals for these dates, so we've shown the next closest airport with availability."})}):null,b&&!Y&&e.jsxs("div",{className:"inline-flex items-center gap-1.5 rounded-md bg-[#C9A57B]/15 border border-[#C9A57B]/40 px-2 py-1 text-[10px] font-bold uppercase tracking-widest text-[#00154a]",children:[e.jsx(Se,{className:"h-[0.975rem] w-[0.975rem] text-[#C9A57B]"})," ",i("realCarPicks.insiderBadge")]})]}),e.jsx("span",{className:"text-xs text-muted-foreground",children:i("realCarPicks.days",{count:v})})]}),e.jsxs("div",{className:"rounded-xl border border-border bg-card p-4 space-y-3 shadow-card",children:[e.jsx("div",{className:"flex items-center justify-between gap-3 flex-wrap",children:e.jsx("div",{className:"text-sm font-semibold text-foreground",children:i("realCarPicks.pickupDropoffTitle",{defaultValue:"Pick-Up & Drop-Off"})})}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-[1fr_auto_1fr] items-start",children:[e.jsxs("div",{className:"min-w-0 space-y-2",children:[w?e.jsxs("div",{className:"rounded-lg border border-border bg-background px-3 py-2",children:[e.jsx("div",{className:"text-[10px] font-semibold uppercase tracking-widest text-muted-foreground mb-1",children:i("realCarPicks.pickupAirportLabel",{defaultValue:"Pickup airport"})}),e.jsx(Aa,{excludeMetro:!0,value:Ut,seedLabel:W?`${W} (${l})`:void 0,placeholder:i("realCarPicks.pickupAirportPlaceholder",{defaultValue:"Airport code or city"}),onChange:t=>{const r=(t||"").toUpperCase();Ee(r),ge.current=r},onPicked:()=>{const t=(ge.current||"").toUpperCase();!/^[A-Z]{3}$/.test(t)||t===l||(be(null),Vt(t))}})]}):e.jsx("div",{className:"text-sm font-semibold truncate",children:i("realCarPicks.airportLabel",{airport:l})}),e.jsx(lt,{label:i("realCarPicks.pickup"),icon:e.jsx(st,{className:"h-3 w-3"}),date:x,time:C,onDateChange:_e,onTimeChange:He})]}),e.jsx(Ae,{className:"h-5 w-5 text-primary/60 hidden sm:block self-center"}),e.jsxs("div",{className:"min-w-0 space-y-2",children:[w?e.jsxs("div",{className:"rounded-lg border border-border bg-muted/40 px-3 py-2",children:[e.jsx("div",{className:"text-[10px] font-semibold uppercase tracking-widest text-muted-foreground mb-1",children:i("realCarPicks.dropoffAirportLabel",{defaultValue:"Drop-Off airport"})}),e.jsxs("div",{className:"flex items-center gap-2 min-w-0 text-[14px]",children:[e.jsx("span",{className:"inline-flex items-center justify-center rounded-md bg-gold px-2 py-0.5 font-mono text-[11px] font-bold tracking-wider text-gold-foreground shrink-0",children:l}),e.jsx("span",{className:"truncate font-semibold text-foreground",children:W||i("realCarPicks.airportLabel",{airport:l})})]})]}):e.jsx("div",{className:"text-sm font-semibold truncate",children:i("realCarPicks.airportLabel",{airport:l})}),e.jsx(lt,{label:i("realCarPicks.dropoff"),icon:e.jsx(st,{className:"h-3 w-3"}),date:g,time:S,onDateChange:Ke,onTimeChange:Oe,minDate:x})]})]})]}),!Y&&$.length>0&&$.some(t=>at(t))&&e.jsxs("div",{className:"rounded-xl border border-[#C9A57B]/50 bg-gradient-to-r from-[#C9A57B]/10 to-[#00154a]/5 p-3 flex items-center justify-between gap-3 flex-wrap",children:[e.jsxs("div",{className:"flex items-start gap-2.5 min-w-0",children:[e.jsx(Se,{className:"h-7 w-7 text-[#C9A57B] mt-0.5 shrink-0"}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:"text-[11px] font-bold tracking-widest uppercase text-[#00154a]",children:i(y?"realCarPicks.insiderRateSelected":"realCarPicks.insiderAvailable")}),e.jsx("div",{className:"text-xs text-muted-foreground",children:e.jsx(pt,{i18nKey:"realCarPicks.insiderSaveBlurb",components:{1:e.jsx("strong",{className:"text-[#00154a]"})}})}),Jt&&e.jsx(Nt,{className:"mt-1 text-[11px] text-muted-foreground"})]})]}),y?null:e.jsxs("button",{type:"button",onClick:()=>se.gate(()=>{oe(!0);const t=_?.find(r=>r.id===A);t&&Q(t,!0),b||pe?.()}
1),className:"rounded-md bg-[#00154a] hover:bg-[#001f6b] text-white px-3 py-1.5 text-[11px] font-bold uppercase tracking-[0.15em] inline-flex items-center gap-1.5 shrink-0",children:[e.jsx(Se,{className:"h-[1.1375rem] w-[1.1375rem] text-white"})," ",Ce()]})]}),u&&e.jsxs("div",{className:"space-y-2",children:[e.jsx("div",{className:"text-[11px] font-bold uppercase tracking-[0.18em] text-muted-foreground",children:i("realCarPicks.inYourTrip")}),e.jsx("div",{className:"grid gap-4 sm:grid-cols-2 xl:grid-cols-3",children:e.jsx(Na,{id:String(u.id),mediaFit:"contain",image:u.image,fallbackIcon:e.jsx($e,{className:"h-14 w-14 text-muted-foreground"}),category:u.vendor,title:u.vehicleClass||u.name,meta:u.example||u.name,insiderTone:!!u.insiderRate,price:N(Number(u.total)||0,k),priceQualifier:u.pricePerDay?`${N.usd(Number(u.pricePerDay)||0)||N(Number(u.pricePerDay)||0,k)}${i("realCarPicks.perDay")}`:void 0,struckPrice:Number(u.stdTotal)>(Number(u.total)||0)?N(Number(u.stdTotal),k):void 0,savings:Number(u.stdTotal)>(Number(u.total)||0)?i("realCarPicks.youSave",{amount:N(Number(u.stdTotal)-(Number(u.total)||0),k)}):void 0,removeLabel:"Remove car",onRemove:()=>{K(void 0),O.current=null,Le?Le():fe?.(null)}})})]}),e.jsx(is,{open:!!F,onOpenChange:t=>{t||ie(null)},kindLabel:"car",current:u?{name:String(u.name||u.vehicleClass||"Car"),price:N(Number(u.total)||0,k)}:null,next:F?{name:`${F.car.supplier} · ${F.car.vehicleClass}`,price:N(F.insider?$a(F.car):F.car.standardTotal??F.car.ratePerDay*v,k)}:null,onConfirm:Qt}),H&&e.jsx("div",{className:"grid gap-4 sm:grid-cols-2 xl:grid-cols-3","aria-busy":"true","aria-label":i("realCarPicks.fetching",{airport:l||i("realCarPicks.fetchingFallback")}),children:[0,1,2].map(t=>e.jsxs("div",{className:"rounded-xl border border-border bg-background overflow-hidden flex flex-col",children:[e.jsx("div",{className:"aspect-[16/8] bg-muted/50"}),e.jsxs("div",{className:"p-5 space-y-3",children:[e.jsx("div",{className:"h-3 w-24 rounded skeleton-shimmer"}),e.jsx("div",{className:"h-5 w-40 rounded skeleton-shimmer"}),e.jsx("div",{className:"h-3 w-56 rounded skeleton-shimmer"}),e.jsx("div",{className:"h-8 w-32 rounded skeleton-shimmer mt-3"})]})]},t))}),ee&&!H&&M&&$.length===0&&(je?e.jsxs("div",{className:"rounded-md border border-amber-300 bg-amber-50 text-amber-900 px-4 py-3 text-sm inline-flex items-center gap-3",children:[e.jsx(rt,{className:"h-4 w-4 shrink-0"}),e.jsx("span",{children:i("realCarPicks.loadFailed",{defaultValue:"We couldn't load cars just now."})}),e.jsx("button",{type:"button",onClick:()=>Yt(t=>t+1),className:"font-semibold underline underline-offset-2 hover:no-underline",children:i("realCarPicks.tryAgain",{defaultValue:"Try again"})})]}):e.jsx("p",{className:"text-sm text-muted-foreground",children:i("realCarPicks.noneForDates",{defaultValue:"No cars available for these dates."})})),!H&&M&&$.length===0&&!At&&!ee&&e.jsxs("div",{className:"rounded-md border border-amber-300 bg-amber-50 text-amber-900 px-3 py-2 text-xs inline-flex items-start gap-2",children:[e.jsx(rt,{className:"h-3.5 w-3.5 mt-0.5"}),e.jsx("span",{children:M})]}),!H&&j.length>0&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"grid gap-4 sm:grid-cols-2 xl:grid-cols-3",children:Qe.map((t,r)=>{const c=!L&&A===t.id,p=y?J(t):t.ratePerDay,d=p*v,f=t.ratePerDay*v,X=Math.floor(d)*Ze;return e.jsx(ya,{className:!ne&&r===3?"hidden sm:flex xl:hidden":void 0,mediaFit:"contain",media:t.image?e.jsx("img",{src:t.image,alt:`${t.vehicleClass} â ${t.exampleModel}`,loading:"lazy"}):e.jsx($e,{className:"h-14 w-14 text-muted-foreground"}),category:t.supplier,title:t.vehicleClass,essentialMeta:t.exampleModel,badges:e.jsxs(e.Fragment,{children:[e.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full bg-muted px-2 py-0.5 text-[11px]",children:[e.jsx(Ja,{className:"h-3 w-3"})," ",t.passengers]}),e.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full bg-muted px-2 py-0.5 text-[11px]",children:[e.jsx(Wa,{className:"h-3 w-3"})," ",t.bags]}),e.jsx("span",{className:"inline-flex items-center gap-1 rounded-full bg-muted px-2 py-0.5 text-[11px]",children:t.transmission})]}),insiderTone:y,struckPrice:y&&t.ratePerDay>p?N(t.ratePerDay,k):void 0,price:e.jsxs(e.Fragment,{children:[N(p,k),e.jsx("span",{className:"text-xs font-normal text-muted-foreground",children:i("realCarPicks.perDay")})]}),priceQualifier:i("realCarPicks.totalLabel",{total:N.usd(d)||N(d,k)}),savings:y&&f>d?i("realCarPicks.youSave",{amount:N(f-d,k)}):void 0,priceExtrasPlacement:"below",priceExtras:!Me&&!Y&&!y&&at(t)?e.jsx(va,{ctaVariant:"outline",label:i("realCarPicks.insiderBadge"),price:e.jsxs(e.Fragment,{children:[N(J(t),k),e.jsx("span",{className:"text-xs font-normal text-muted-foreground",children:i("realCarPicks.perDay")})]}),savings:J(t)*v<f?i("realCarPicks.youCouldSave",{amount:N(f-J(t)*v,k)}):void 0,ctaLabel:Ce(),title:i("realCarPicks.switchToInsider"),onUnlock:()=>Gt(t)}):void 0,priceFootnote:Ze>0?e.jsxs("div",{className:"inline-flex items-center gap-1 text-[10px] font-bold text-primary",children:[e.jsx(Ba,{className:"h-3 w-3"})," ",i("realCarPicks.earnPts",{pts:new Intl.NumberFormat().format(X)}
1),b&&!Y&&e.jsx("span",{className:"bg-[#00154a] text-white px-1 rounded text-[8px] tracking-wider",children:"2X"})]}):void 0,onDetails:()=>qe(t),secondaryLabel:i("realCarPicks.detailsLabel"),selected:c,selectedBadgeLabel:q(i("realCarPicks.addedToTrip")),ctaLabel:q(i(c?"realCarPicks.addedToTrip":"realCarPicks.addToTrip")),onCta:()=>zt(t),ctaVariant:"filled",hideCta:Me},t.id)})}),e.jsxs("div",{className:"flex items-center justify-between gap-3 flex-wrap pt-1",children:[e.jsxs("div",{className:"text-xs text-muted-foreground",children:[i("realCarPicks.showingCount",{count:j.length,visible:Qe.length,total:j.length,airport:l}),b&&!Y?i("realCarPicks.insiderRatesSuffix"):"","."]}),e.jsxs("div",{className:"grid w-full grid-cols-2 gap-2 sm:flex sm:w-auto sm:items-center",children:[e.jsx("button",{type:"button",onClick:()=>Je(t=>(t&&requestAnimationFrame(()=>{document.getElementById("car-upsell")?.scrollIntoView({behavior:"smooth",block:"start"})}),!t)),disabled:j.length<=3,className:"weip-btn weip-btn-secondary-light min-h-11 justify-center rounded-md border border-[#0a1a3a] bg-transparent text-[#0a1a3a] px-4 py-2 text-[11px] font-bold uppercase tracking-[0.15em] transition-colors inline-flex items-center gap-1.5 disabled:cursor-not-allowed disabled:opacity-50",children:ne?e.jsxs(e.Fragment,{children:[q(i("realCarPicks.showFewer"))," ",e.jsx(Ya,{className:"h-3.5 w-3.5"})]}):e.jsxs(e.Fragment,{children:[q(i("confirmationV2Page.cars.showMore",{defaultValue:"Show more options"}))," ",e.jsx(_a,{className:"h-3.5 w-3.5"})]})}),e.jsxs(ft,{to:"/search/car",search:{pickupLocation:l,dropoffLocation:l,pickupDate:x,pickupTime:C,dropoffDate:g,dropoffTime:S},onClick:t=>{const r=!!L;try{xe&&!r&&!ca(xe)?sessionStorage.setItem("wr:carReturnTo",xe):sessionStorage.removeItem("wr:carReturnTo")}catch{}try{Ha(),Ka()}catch{}L&&L(`/search/car?${Xt()}`)!=="not-a-rail"&&t.preventDefault()},className:"weip-btn weip-btn-primary-light min-h-11 justify-center rounded-md bg-[#0a1a3a] text-white px-3 py-2.5 text-[11px] font-bold uppercase tracking-[0.15em] inline-flex items-center gap-1.5 transition-colors",children:[q(i("realCarPicks.viewAllCars",{defaultValue:"View all cars"}))," ",e.jsx(Ae,{className:"h-3.5 w-3.5"})]})]})]})]}),V&&e.jsx(Pa,{car:{...V,pickupLocation:l,dropoffLocation:l,pickupDate:x,pickupTime:C,dropoffDate:g,dropoffTime:S,days:v,insider:y,selectedTier:y?"insider":"standard",ratePerDay:y?J(V):V.ratePerDay,total:(y?J(V):V.ratePerDay)*v,standardTotal:V.ratePerDay*v},onClose:()=>qe(null)}),se.dialog]})}export{Xa as A,lt as D,js as I,ws as R,is as a,vt as b,Tt as c,Pt as d,St as e,Dt as f,Ct as g,Rt as h,Nt as i,ts as j,as as k};
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.