PageSourceSearch

https://www.wyndhamhotels.com/travel-packages/itinerary/assets/trips-DTnO2KnR.js

js wyndhamhotels.com collected 2026-10-09 21:41:20 UTC 32,929 bytes, 1 lines download raw bytes

1import{j as e,r as c}from"./react-BEJkGLFG.js";import{C as Ne,B as O,L as ye,bF as ve,bG as Re,bH as _e,bI as Fe,bJ as Be,bK as Ve,a$ as Ue,bn as $e,r as ce,bL as J,u as U,bM as Oe,bN as Me,bO as Ee,v as Z,W as We,w as He,bP as Ge,bc as me,aY as Ye,b1 as ue,bQ as ze}from"./index-C2R9cRGb.js";import{p as Ke}from"./_lang.all-inclusive-vacations.Search-DeSq78tb.js";import{T as pe}from"./trips._tripId-DAAFdTxj.js";import{C as Je}from"./QuietPageTransition-gft8FEAY.js";import{S as Ze}from"./confirm-reservation-CHigbMJn.js";import{a as qe}from"./airlines-BUy1DAb2.js";import{d as Qe}from"./_sessionId-DsUZALOV.js";import{B as Xe}from"./member.theme-parks-entertainment-MYpDmybf.js";import{aB as et,s as tt,C as st,l as at,k as rt,w as nt,x as we,m as xe,_ as he,J as ot,ar as it,aC as lt,u as dt,P as ge,K as ct,A as mt,c as ut,d as pt,T as xt,e as fe,H as ht}from"./icons-CI-onX_J.js";import{l as gt,a as ft,f as bt,A as jt}from"./AirItineraryHandoff-B0FPk8DW.js";import{W as ke}from"./confirm-reservation-3Yo_25U7.js";import{u as Nt}from"./useHotelHeroImage-DK8lZa0B.js";import"./radix-YpfejCpa.js";import"./googleMapsLoader-mROqU5v4.js";import"./badge-Z9QSMLz4.js";import"./FluentAdUnit-BJYUmMPt.js";import"./MobilePayBar-bevIgxIA.js";import"./abEvents.functions-h02B5QoL.js";import"./separator-DBSDNa76.js";import"./sanitizeHtml-DxOhF2DR.js";import"./SelectedAddons-DYyyNXHs.js";import"./HotelInfoModal-DU_eFeir.js";import"./search.hotel-BHYq8yQN.js";import"./insider-upsell-confirmation-DwDv-I1B.js";import"./DualCurrencyPriceCards-BwZl3GO7.js";import"./CollapsibleTripSummary-CidvGrTs.js";import"./fareAmenities-C1kiw8-4.js";import"./InsiderUpsellCard-BEaKgvN5.js";import"./ActivityDetailsModal-EpHN4U68.js";import"./places.functions-CgFg7pHQ.js";import"./supplierLocale-z6ycKUyO.js";import"./transferPicks-C1vVsMHD.js";import"./_lang.Transfer.Search-B44OxBxV.js";import"./ops.rail-perf-D9yU4X2Z.js";import"./nearestAirport-C4RVKZhh.js";import"./RealCarPicks-mSF2YYiv.js";import"./transferAirport-DcE20qDg.js";import"./carRateChainRef-CnZxgv3s.js";import"./WeipNearbyMap-DfmAg0Oq.js";import"./nearestAirport.functions-DnPWpqFJ.js";import"./agent.villa-itinerary-B78ayPBx.js";function yt({name:t,className:d=""}){const{t:o}=Ne();return e.jsxs("div",{role:"img","aria-label":o("hotel.noPhoto.aria",{name:t||o("hotel.noPhoto.property")}),className:`flex h-full w-full flex-col items-center justify-center gap-2 bg-muted text-muted-foreground ${d}`,children:[e.jsx(et,{className:"h-6 w-6 opacity-60","aria-hidden":"true"}),e.jsx("span",{className:"px-3 text-center text-xs font-medium",children:o("hotel.noPhoto.label")})]})}function $(t,d=!1){const o=/^(\d{4})-(\d{2})-(\d{2})/.exec(t);return o?new Date(Date.UTC(+o[1],+o[2]-1,+o[3],12)).toLocaleDateString("en-US",{timeZone:"UTC",weekday:d?"short":void 0,month:"short",day:"numeric",year:"numeric"}):t}const R=(t,d)=>new Intl.NumberFormat("en-US",{style:"currency",currency:d||"USD",minimumFractionDigits:2}).format(t);function vt({v:t}){const[d,o]=c.useState(0),[j,y]=c.useState(!1),[g,v]=c.useState(null),r=t.home,u=r?.photos??[],h=!!g||/cancel/i.test(t.status),m=`${t.adults} adult${t.adults===1?"":"s"}${t.children?`, ${t.children} child${t.children===1?"":"ren"}`:""}`,f=(i,I)=>I==null?null:e.jsxs("div",{className:"flex justify-between gap-3",children:[e.jsx("span",{className:"text-muted-foreground",children:i}),e.jsx("span",{children:R(I,t.currency)})]}),p=t.cancelNbr??g?.cx??null;return e.jsxs("div",{className:"overflow-hidden rounded-2xl border border-border bg-card text-sm shadow-sm",children:[u.length>0&&e.jsxs("div",{className:"relative grid h-72 gap-1 sm:h-96 sm:grid-cols-[2fr_1fr]",children:[e.jsxs("div",{className:"relative overflow-hidden",children:[e.jsx("img",{src:u[d],alt:t.villaName,className:"h-full w-full object-cover"}),u.length>1&&e.jsxs(e.Fragment,{children:[e.jsx("button",{type:"button","aria-label":"Previous photo",onClick:()=>o((d-1+u.length)%u.length),className:"absolute left-3 top-1/2 -translate-y-1/2 rounded-full bg-background/80 p-2 shadow",children:e.jsx(tt,{className:"h-4 w-4"})}
1),e.jsx("button",{type:"button","aria-label":"Next photo",onClick:()=>o((d+1)%u.length),className:"absolute right-3 top-1/2 -translate-y-1/2 rounded-full bg-background/80 p-2 shadow",children:e.jsx(st,{className:"h-4 w-4"})}),e.jsxs("span",{className:"absolute bottom-3 right-3 rounded-full bg-background/80 px-2 py-0.5 text-xs font-semibold",children:[d+1," / ",u.length]})]})]}),e.jsx("div",{className:"hidden grid-rows-2 gap-1 sm:grid",children:[1,2].map(i=>u[(d+i)%u.length]&&e.jsx("button",{type:"button",onClick:()=>o((d+i)%u.length),className:"overflow-hidden",children:e.jsx("img",{src:u[(d+i)%u.length],alt:"",className:"h-full w-full object-cover transition-transform hover:scale-105"})},i))})]}),e.jsxs("div",{className:"space-y-6 p-6",children:[e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[e.jsxs("div",{children:[e.jsx("div",{className:"text-xs font-bold uppercase tracking-[0.2em] text-primary",children:"Homes & Havens"}),e.jsx("h3",{className:"font-display text-2xl font-bold",children:t.villaName}),(r?.address||r?.town)&&e.jsxs("p",{className:"mt-1 flex items-center gap-1 text-muted-foreground",children:[e.jsx(at,{className:"h-4 w-4"}),r.address??r.town]})]}),e.jsxs("div",{className:"text-right",children:[e.jsx("span",{className:`inline-block rounded-full px-3 py-1 text-xs font-bold uppercase tracking-wider ${h?"bg-destructive/10 text-destructive":"bg-primary/10 text-primary"}`,children:h?"Cancelled":t.supplierStatus==="Confirmed"?"Confirmed":t.status}),e.jsxs("p",{className:"mt-2 text-muted-foreground",children:["Confirmation ",e.jsx("strong",{className:"font-mono text-foreground",children:t.reference})]})]})]}),r&&(r.bedrooms||r.bathrooms||r.sleeps)?e.jsxs("div",{className:"flex flex-wrap gap-5 border-y border-border py-3",children:[r.bedrooms?e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(rt,{className:"h-4 w-4 text-primary"}),r.bedrooms," Bedrooms"]}):null,r.bathrooms?e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(nt,{className:"h-4 w-4 text-primary"}),r.bathrooms," Bathrooms"]}):null,r.sleeps?e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(we,{className:"h-4 w-4 text-primary"}),"Sleeps ",r.sleeps]}):null]}):null,r?.headline&&e.jsx("p",{className:"text-base text-muted-foreground",children:r.headline}),e.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[e.jsxs("div",{className:"space-y-3 rounded-xl border border-border p-4",children:[e.jsx("p",{className:"text-xs font-bold uppercase tracking-wider",children:"Your stay"}),e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsxs("div",{children:[e.jsxs("p",{className:"flex items-center gap-1 text-xs uppercase text-muted-foreground",children:[e.jsx(xe,{className:"h-3.5 w-3.5"}),"Check-in"]}),e.jsx("p",{className:"font-semibold",children:$(t.checkin,!0)}),r?.checkinTime&&e.jsxs("p",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[e.jsx(he,{className:"h-3 w-3"}),"From ",r.checkinTime]})]}),e.jsxs("div",{children:[e.jsxs("p",{className:"flex items-center gap-1 text-xs uppercase text-muted-foreground",children:[e.jsx(xe,{className:"h-3.5 w-3.5"}),"Check-out"]}),e.jsx("p",{className:"font-semibold",children:$(t.checkout,!0)}),r?.checkoutTime&&e.jsxs("p",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[e.jsx(he,{className:"h-3 w-3"}),"By ",r.checkoutTime]})]})]}),e.jsxs("div",{className:"space-y-1 border-t border-border pt-3",children:[e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-muted-foreground",children:"Nights"}),e.jsx("span",{children:t.nights})]}),e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-muted-foreground",children:"Guests"}),e.jsx("span",{children:m})]}),e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-muted-foreground",children:"Lead guest"}),e.jsx("span",{children:t.guestName})]}),t.bookedAt&&e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-muted-foreground",children:"Booked"}),e.jsx("span",{children:$(t.bookedAt)})]})]})]}),e.jsxs("div",{className:"space-y-1 rounded-xl border border-border p-4",children:[e.jsx("p",{className:"mb-2 text-xs font-bold uppercase tracking-wider",children:"Price summary"}),f("Accommodation",t.accommodation),t.fees.map(i=>e.jsx("div",{children:f(i.name,i.amount)},i.name)),f("Taxes",t.taxes),f("Service fee",t.serviceFee),t.pointsRedeemed>0&&e.jsxs("div",{className:"flex justify-between gap-3",children:[e.jsx("span",{className:"text-muted-foreground",children:"Wyndham Rewards points redeemed"}
1),e.jsx("span",{children:t.pointsRedeemed.toLocaleString("en-US")})]}),t.totalCharged!=null&&e.jsxs("div",{className:"flex justify-between gap-3 border-t border-border pt-2 text-base font-bold",children:[e.jsx("span",{children:"Total charged"}),e.jsx("span",{children:R(t.totalCharged,t.currency)})]})]})]}),r?.highlights?.length?e.jsx("div",{className:"flex flex-wrap gap-2",children:r.highlights.map(i=>e.jsx("span",{className:"rounded-full bg-muted px-3 py-1 text-xs",children:i},i))}):null,e.jsxs("div",{className:"rounded-xl border border-border p-4",children:[e.jsxs("p",{className:"mb-2 flex items-center gap-2 text-xs font-bold uppercase tracking-wider",children:[e.jsx(ot,{className:"h-4 w-4 text-primary"}),"Cancellation policy"]}),t.policyText?e.jsx("p",{className:"whitespace-pre-line",children:t.policyText}):e.jsx("p",{className:"text-muted-foreground",children:"No cancellation policy was returned."})]}),h&&e.jsxs("div",{className:"rounded-xl border border-destructive/40 bg-destructive/5 p-4",children:[e.jsxs("p",{className:"mb-2 flex items-center gap-2 font-semibold text-destructive",children:[e.jsx(it,{className:"h-4 w-4"}),"This reservation has been cancelled"]}),e.jsxs("div",{className:"grid grid-cols-2 gap-1",children:[e.jsx("span",{className:"text-muted-foreground",children:"Cancel confirmation number"}),e.jsx("span",{className:"text-right font-mono font-semibold",children:p??"Reference to follow"}),t.cancelledAt&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"text-muted-foreground",children:"Cancelled on"}),e.jsx("span",{className:"text-right",children:$(t.cancelledAt)})]}),t.cancelPenalty!=null&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"text-muted-foreground",children:"Cancellation penalty"}),e.jsx("span",{className:"text-right",children:R(t.cancelPenalty,t.currency)})]}),t.refundDue!=null&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"text-muted-foreground",children:"Refund to your card"}),e.jsx("span",{className:"text-right",children:t.refundDue>0?R(t.refundDue,t.currency):"Nothing"})]}),t.serviceFeeRetained!=null&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"text-muted-foreground",children:"Service fee (not refunded)"}),e.jsx("span",{className:"text-right",children:R(t.serviceFeeRetained,t.currency)})]})]})]}),(r?.checkinDetails||r?.houseRules)&&!h&&e.jsxs("details",{className:"rounded-xl border border-border p-4",children:[e.jsx("summary",{className:"cursor-pointer text-xs font-bold uppercase tracking-wider",children:"Arrival & house rules"}),r.checkinDetails&&e.jsx("p",{className:"mt-3 whitespace-pre-line",children:r.checkinDetails}),r.houseRules&&e.jsx("p",{className:"mt-3 whitespace-pre-line text-muted-foreground",children:r.houseRules})]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-3 border-t border-border pt-4",children:[r?.link&&e.jsx(O,{asChild:!0,variant:"outline",children:e.jsx(ye,{to:"/villas/stayterra/$property/$unitId",params:{property:r.link.property,unitId:r.link.unitId},search:{},children:"View the home"})}),h?null:t.isPoints?e.jsx("p",{className:"text-muted-foreground",children:"This stay was paid with Wyndham Rewards points. To cancel it, please contact an agent."}):t.guestCancellable?e.jsx(O,{className:Xe,onClick:()=>y(!0),children:"Cancel Property Reservation"}):null]})]}),t.guestCancellable&&e.jsx(Qe,{open:j,onOpenChange:y,onCancelled:i=>v({cx:i}
1),known:{reference:t.reference,proof:t.proof,stay:{villaName:t.villaName,checkin:t.checkin,checkout:t.checkout,nights:t.nights,guest:t.guestName,totalCharged:t.totalCharged,currency:t.currency}}})]})}function wt({candidates:t,hotel:d,alt:o,fallback:j}){const y=Nt(t,{hotelId:d?.id,brandId:d?.brand,brandTier:d?.brandTier}),g=d?.id?null:t.find(r=>!!r&&/^https?:\/\//i.test(String(r))&&Ye(r)),v=y||g||"";return v?e.jsx("img",{src:v,alt:o,loading:"lazy",className:"w-full h-full object-cover"}):d?.id?e.jsx(yt,{name:o}):e.jsx(e.Fragment,{children:j})}function be(t){const d=t.stripe_session_id;if(!d)return null;const o=t.payload??{},j=o?.outcome?.summarySnapshot??{},y=Re(o?.intentPayload,o?.summary,o?.outcome?.summarySnapshot),g=String(t.kind??"")==="air",v=!!o?.bundleLeg,r=g||!v?y:(()=>{const{itin:p,origin:i,dest:I,carrier:M,heroDates:q,brand:E,fare:W,...F}=y??{};return F})(),u=r?.traveler||j?.traveler||o?.travelerName||(t.lead_first_name&&t.lead_last_name?`${t.lead_first_name} ${t.lead_last_name}`:void 0),h=Number(t.retail_total)||Number(t.charged_now)||0,m={id:d,confirmation:(()=>{const p=String(t.confirmation||"").trim();return!p||/^(cs_|pts_|pi_|seti_|sub_)/i.test(p)?"":p.toUpperCase()})(),createdAt:new Date(t.created_at).getTime(),type:t.kind||"air",status:t.status==="cancelled"||t.cancel_state==="cancelled"||t.cancelled_at?"cancelled":"upcoming",cancelState:t.cancel_state??(t.status==="cancelled"||t.cancelled_at?"cancelled":void 0),origin:r?.origin,dest:r?.dest,carrier:r?.carrier,heroDates:r?.heroDates,pax:r?.pax,traveler:u,email:t.payload?.email||r?.email,total:h,ccy:(t.currency||"USD").toUpperCase(),displayAmount:h,displayCurrency:(t.currency||"USD").toUpperCase(),retailTotal:Number(t.retail_total)||void 0,chargedNowUSD:Number(t.charged_now)||0,dueAtPickupUSD:Number(t.due_at_pickup)||0,supplierBookingId:t.supplier_booking_id||void 0,pnr:t.confirmation||void 0,itin:r?.itin,extras:{...r,leadTravelerName:u,travelerName:u,sessionId:d,bookingToken:t.booking_token??r?.bookingToken??void 0,itineraryId:t.itinerary_id??r?.itineraryId??void 0,hotelRateCode:o?.hotelRateCode??r?.hotelRateCode??void 0,hotelCancelPolicy:o?.hotelCancelPolicy??r?.hotelCancelPolicy??void 0,cancelPolicy:o?.cancelPolicy??r?.cancelPolicy??void 0,paymentMode:t.settlement_mode??o?.paymentMode??r?.paymentMode??void 0,pointsRedeemed:Number(t.points_redeemed)||Number(o?.pointsRedeemed)||Number(r?.pointsRedeemed)||void 0,stripeSessionId:d},bookingToken:t.booking_token??void 0,pointsToBurn:Number(t.points_redeemed)||void 0,bookingStatus:t.status==="confirmed"?"booked":"pending"},f=o?.legAddon;if(f){const p={id:d,confirmation:m.confirmation,createdAt:m.createdAt,traveler:m.traveler,email:m.email,ccy:m.ccy,pax:m.pax},i=t.kind==="hotel"?_e(f,p):t.kind==="car"?Fe(f,p):t.kind==="transfer"?Be(f,p):t.kind==="activity"?Ve(f,p):null;if(i)return{...m,dest:m.dest??i.dest,heroDates:m.heroDates??i.heroDates,pax:m.pax??i.pax,total:m.total||i.total,displayAmount:m.displayAmount||i.displayAmount,pointsToBurn:m.pointsToBurn??i.pointsToBurn,extras:{...i.extras??{},...m.extras??{}}}}return m}function _(t){return Ge(t)||!!t.confirmation||!!t.supplierBookingId}function ps(){const{stay:t}=ve.useLoaderData();return t?e.jsx(ke,{weipPurlId:t.weipPurlId,partnerToken:t.partnerToken,initial:t.initial},`${t.weipPurlId}:${t.partnerToken??""}`):e.jsx(kt,{})}function kt(){const{t,i18n:d}=Ne(),o=ve.useSearch(),j=Ue(),y=$e(),g=d.resolvedLanguage??d.language,v=(s,a="USD")=>ue(s,a,{locale:g}),r=(s,a)=>
1{const n=(a||"USD").toUpperCase();return ue(ze(Number(s)||0,"USD",n,y.rates),n,{locale:g})},u=s=>{try{return new Date(s).toLocaleDateString(g,{month:"short",day:"numeric",year:"numeric"})}catch{return""}},[h,m]=c.useState(()=>!!j?.isAuthenticated||!!ce()),[f,p]=c.useState(()=>J().filter(_)),[i,I]=c.useState(null),M=c.useRef({}),[q,E]=c.useState(!1),W=U(gt),F=U(ft),Ce=U(bt),Pe=U(Oe),[H,Q]=c.useState(o.firstName??""),[G,X]=c.useState(o.lastName??""),[Y,ee]=c.useState(o.confirmation??""),[D,te]=c.useState(null),[k,B]=c.useState([]),[L,se]=c.useState([]),ae=o.lookup!=="1"&&!!(o.firstName??"").trim()&&!!(o.lastName??"").trim()&&!!(o.confirmation??"").trim(),[A,re]=c.useState(ae),[z,S]=c.useState(null),[T,Se]=c.useState(null),ne=t("tripsPage.guestLookup.failed",{defaultValue:"We couldn't complete your search just now. Your reservation hasn't been affected — please try again in a moment."}),Te=t("tripsPage.guestLookup.none",{defaultValue:"We couldn't find a reservation matching those details. Check the traveller's name and reservation number exactly as they appear on your confirmation email, or contact support and we'll pull it up for you."}),oe=async s=>{re(!0),S(null);try{const a=(s?.firstName??H).trim(),n=(s?.lastName??G).trim(),l=(s?.reference??Y).trim().toUpperCase(),b=me(l)||/^[A-Z]{2}-/i.test(l)?l:`CS-${l}`,N=await Ce({data:{firstName:a,lastName:n,reference:b}});se(N?.villas??[]);const C=(N?.records??[]).map(be).filter(x=>!!x&&_(x));if(!C.length&&(N?.villas??[]).length)return;if(!C.length&&N?.failed){S(ne);return}if(!C.length){if(me(b)){const x=await Pe({data:{firstName:a,lastName:n,confirmation:b}});if(x?.ok&&x.weipPurlId){Se({weipPurlId:String(x.weipPurlId),partnerToken:x.partnerToken?String(x.partnerToken):void 0,initial:null});return}}S(Te);return}te({firstName:a,lastName:n,reference:b}),B(C),S(null)}catch{S(ne)}finally{re(!1)}},ie=c.useRef(!1);c.useEffect(()=>{if(ie.current||o.lookup==="1")return;const s=(o.firstName??"").trim(),a=(o.lastName??"").trim(),n=(o.confirmation??"").trim();!s||!a||!n||(ie.current=!0,oe({firstName:s,lastName:a,reference:n}))},[o.firstName,o.lastName,o.confirmation]),c.useEffect(()=>{if(!h)return;let s=!1;return(async()=>{try{const a=[];try{const n=await W();n?.ok&&a.push(...n.records??[])}catch(n){console.warn("[trips] bearer trip_records merge unavailable",n)}try{const n=await F();n?.ok&&a.push(...n.records??[])}catch(n){console.warn("[trips] SSO trip_records merge unavailable",n)}if(s||!a.length)return;p(n=>{const l=Me(n,a),b=new Set(l.map(w=>w.id)),N=new Set(l.map(w=>w.supplierBookingId).filter(Boolean)),C=new Set(l.map(w=>w.extras?.sessionId).filter(Boolean)),x=[];for(const w of a){const P=be(w);P&&(C.has(P.id)||b.has(P.id)||P.supplierBookingId&&N.has(P.supplierBookingId)||x.push(P))}if(l===n&&!x.length)return n;const V=[...l,...x.filter(_)];return Ee(V),V})}catch(a){console.warn("[trips] server trip_records merge failed",a)}})(),()=>{s=!0}},[h,W,F]);const Ie=s=>{const a=s.extras??{};return a?.hotel?.hotel?.image||a?.car?.image||a?.transfer?.image||a?.activity?.image||a?.activity?.hero||a?.hotel?.image||a?.image||null},K=s=>{const a=s.extras??{},n=s.itin??{},l=n?.OriginDestinationOptions?.[0]?.FlightSegments?.[0]??n?.originDestinationOptions?.[0]?.flightSegments?.[0]??n?.segments?.[0]??null,b=n?.OriginDestinationOptions?.[n?.OriginDestinationOptions?.length-1]??n?.originDestinationOptions?.[n?.originDestinationOptions?.length-1]??null,N=b?.FlightSegments?.[b.FlightSegments.length-1]??b?.flightSegments?.[b.flightSegments.length-1]??l,C=s.origin||l?.DepartureAirportLocationCode||l?.departureAirportLocationCode||l?.from||void 0,x=s.dest||N?.ArrivalAirportLocationCode||N?.arrivalAirportLocationCode||N?.to||a?.hotel?.hotel?.city||a?.hotel?.city||a?.activity?.destination||a?.dest||void 0,V=s.carrier||l?.MarketingAirlineCode||l?.marketingAirlineCode||l?.carrier||void 0,w=s.heroDates||a?.heroDates||void 0,P=a?.activity?.title||a?.activity?.name||a?.hotel?.hotel?.name||a?.hotel?.name||a?.car?.name||a?.car?.exampleModel||a?.transfer?.name||a?.transfer?.exampleModel||void 0;return{origin:C,dest:x,carrier:V,heroDates:w,title:P}},De=s=>
1{switch(s.type){case"hotel":return e.jsx(ht,{className:"h-7 w-7 text-muted-foreground"});case"car":return e.jsx(fe,{className:"h-7 w-7 text-muted-foreground"});case"transfer":return e.jsx(fe,{className:"h-7 w-7 text-muted-foreground"});case"activity":return e.jsx(xt,{className:"h-7 w-7 text-muted-foreground"});default:return e.jsx(ge,{className:"h-7 w-7 text-muted-foreground"})}};c.useEffect(()=>{const s=()=>{m(!!j?.isAuthenticated||!!ce()),p(J().filter(_))};s();const a=window.setTimeout(s,250);return window.addEventListener("focus",s),window.addEventListener("storage",s),()=>{window.clearTimeout(a),window.removeEventListener("focus",s),window.removeEventListener("storage",s)}},[j?.isAuthenticated]),c.useEffect(()=>{h&&p(J().filter(_))},[h]);const Le=!!(o.firstName??"").trim()&&!!(o.lastName??"").trim()&&!!(o.confirmation??"").trim(),le=o.lookup==="1"||Le||A||!!D||k.length>0,Ae=le&&!k.length,de=le?[]:f;return T?e.jsx(ke,{weipPurlId:T.weipPurlId,partnerToken:T.partnerToken,initial:T.initial},`${T.weipPurlId}:${T.partnerToken??""}`):ae&&A&&!z&&!k.length?e.jsx("div",{className:"bg-muted/30 min-h-screen",children:e.jsxs("div",{className:"container mx-auto max-w-4xl py-12 px-4",children:[e.jsxs("div",{className:"mb-8",children:[e.jsx("div",{className:"text-[11px] font-bold tracking-[0.2em] uppercase text-primary",children:t("tripsPage.eyebrow")}),e.jsx("h1",{className:"font-display text-4xl font-bold mt-1",children:t("tripsPage.title")}),e.jsx("p",{className:"text-sm text-muted-foreground mt-2",children:t("tripsPage.subtitle")})]}),e.jsx(je,{})]})}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"bg-muted/30 min-h-screen",children:e.jsxs("div",{className:"container mx-auto max-w-4xl py-12 px-4",children:[e.jsxs("div",{className:"mb-8",children:[e.jsx("div",{className:"text-[11px] font-bold tracking-[0.2em] uppercase text-primary",children:t("tripsPage.eyebrow")}),e.jsx("h1",{className:"font-display text-4xl font-bold mt-1",children:t("tripsPage.title")}),e.jsx("p",{className:"text-sm text-muted-foreground mt-2",children:t("tripsPage.subtitle")})]}),A&&!k.length?e.jsx("div",{className:"mb-8",children:e.jsx(je,{})}):D&&k.length>0||L.length>0?e.jsxs("div",{className:"mb-8 rounded-2xl border border-border bg-card px-5 py-4 flex flex-wrap items-center justify-between gap-3",children:[e.jsxs("div",{className:"text-sm",children:[e.jsx("span",{className:"text-muted-foreground",children:"Reservation found: "}),e.jsx("span",{className:"font-mono font-semibold",children:D?.reference??L[0]?.reference})]}),e.jsx("button",{type:"button",className:"text-sm text-primary font-semibold underline underline-offset-2",onClick:()=>{B([]),se([]),te(null),Q(""),X(""),ee(""),S(null)},children:"Search for another reservation"})]}):e.jsxs("div",{className:"mb-8 rounded-2xl border border-border bg-card p-5",children:[e.jsx("h2",{className:"font-display text-lg font-bold",children:t("tripsPage.guestLookup.title",{defaultValue:"Find a reservation"})}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:t("tripsPage.guestLookup.body",{defaultValue:"Enter the traveller's first and last name and the reservation number from your confirmation email."})}),e.jsxs("form",{className:"mt-4 grid gap-3 sm:grid-cols-[1fr_1fr_1fr_auto]",onSubmit:s=>{s.preventDefault(),oe()},children:[e.jsx(Z,{value:H,onChange:s=>Q(s.target.value),placeholder:t("tripsPage.guestLookup.firstPlaceholder",{defaultValue:"First name"}),"aria-label":t("tripsPage.guestLookup.firstPlaceholder",{defaultValue:"First name"}),autoComplete:"given-name"}),e.jsx(Z,{value:G,onChange:s=>X(s.target.value),placeholder:t("tripsPage.guestLookup.lastPlaceholder",{defaultValue:"Last name"}),"aria-label":t("tripsPage.guestLookup.lastPlaceholder",{defaultValue:"Last name"}),autoComplete:"family-name"}),e.jsx("div",{className:"relative",children:e.jsx(Z,{value:Y,onChange:s=>ee(s.target.value.toUpperCase()),placeholder:t("tripsPage.guestLookup.refPlaceholder",{defaultValue:"Reservation number"}),"aria-label":t("tripsPage.guestLookup.refAria",{defaultValue:"Reservation number"}),inputMode:"text",autoComplete:"off"})}),e.jsx(O,{type:"submit",disabled:A||!H.trim()||!G.trim()||!Y.trim(),children:A?t("tripsPage.guestLookup.searching",{defaultValue:"Searching…"}):t("tripsPage.guestLookup.cta",{defaultValue:"Find my reservations"})})]}),z&&e.jsx("p",{className:"text-sm text-muted-foreground mt-3",children:z})]}),L.length>0&&e.jsxs("div",{className:"mb-8 space-y-4",children:[e.jsx("h2",{className:"font-display text-lg font-bold",children:"Your Property Reservation"}),L.map(s=>e.jsx(vt,{v:s},s.reference))]}),k.length>0&&D&&e.jsxs("div",{className:"mb-8 space-y-4",children:[e.jsx("h2",{className:"font-display text-lg font-bold",children:"Your reservation"}),k.map(s=>e.jsxs("div",{className:"rounded-2xl border border-border bg-card p-5 space-y-4 shadow-sm",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3 text-xs",children:[e.jsx("span",{className:`inline-flex items-center gap-1.5 px-2 py-0.5 rounded-full font-bold uppercase tracking-wider text-[10px] ${s.status==="cancelled"?"bg-destructive/15 text-destructive":"bg-emerald-500/15 text-emerald-700"}`,children:t(`tripsPage.status.${s.status}`,{defaultValue:s.status})}),e.jsxs("span",{className:"text-muted-foreground",children:[t("tripsPage.confirmation"),e.jsx("strong",{className:"text-foreground",children:s.confirmation})]})]}),e.jsx(Je,{trip:s,proof:D,onChange:a=>B(n=>n.map(l=>l.id===a.id?a:l))}),e.jsx(pe,{trip:s,hideManageNotice:!0,onChange:a=>B(n=>n.map(l=>l.id===a.id?a:l))})]},`found-${s.id}`))]}),Ae||k.length>0||L.length>0?null:de.length===0?e.jsxs("div",{className:"rounded-2xl border border-border bg-card p-12 text-center",children:[e.jsx("div",{className:"h-14 w-14 mx-auto rounded-full bg-muted inline-flex items-center justify-center",children:e.jsx(lt,{className:"h-7 w-7 text-muted-foreground"})}),e.jsx("h2",{className:"font-display text-2xl font-bold mt-4",children:t("tripsPage.empty.title")}),e.jsx("p",{className:"text-sm text-muted-foreground mt-2",children:t("tripsPage.empty.body")}),e.jsx(O,{asChild:!0,className:"mt-5",children:e.jsx(ye,{to:"/bookings",children:t("tripsPage.empty.cta")})})]}):e.jsx("div",{className:"space-y-4",children:de.map(s=>e.jsxs("div",{ref:a=>{M.current[s.id]=a},className:"rounded-2xl border border-border bg-card overflow-hidden shadow-sm scroll-mt-24",children:[e.jsxs("button",{type:"button",onClick:()=>{I(a=>{const n=a===s.id?null:s.id;return n&&requestAnimationFrame(()=>
1{M.current[s.id]?.scrollIntoView({block:"start",behavior:"smooth"})}),n})},"aria-expanded":i===s.id,className:"block w-full text-left hover:bg-muted/20 transition",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3 px-5 py-3 border-b border-border bg-muted/30",children:[e.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[e.jsx("span",{className:`inline-flex items-center gap-1.5 px-2 py-0.5 rounded-full font-bold uppercase tracking-wider text-[10px] ${s.status==="cancelled"?"bg-destructive/15 text-destructive":"bg-emerald-500/15 text-emerald-700"}`,children:t(`tripsPage.status.${s.status}`,{defaultValue:s.status})}),e.jsxs("span",{className:"text-muted-foreground",children:[t("tripsPage.confirmation"),e.jsx("strong",{className:"text-foreground",children:s.confirmation})]})]}),e.jsx("div",{className:"text-xs text-muted-foreground",children:t("tripsPage.booked",{date:u(s.createdAt)})})]}),e.jsxs("div",{className:"p-5 grid sm:grid-cols-[auto_1fr_auto] gap-4 items-center",children:[e.jsx("div",{className:"relative h-20 w-28 sm:h-24 sm:w-32 shrink-0 rounded-xl overflow-hidden bg-muted inline-flex items-center justify-center",children:e.jsx(wt,{candidates:[Ie(s)],hotel:(()=>{const a=(s.extras??{})?.hotel?.hotel??(s.extras??{})?.hotel;return a?.id?{id:a.id,brand:a.brand,brandTier:a.brandTier}:null})(),alt:s.dest||"",fallback:De(s)})}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:"font-display text-2xl font-bold inline-flex items-center gap-3",children:(()=>{const a=K(s);return a.origin&&a.dest?e.jsxs(e.Fragment,{children:[a.origin," ",e.jsx(dt,{className:"h-5 w-5 text-muted-foreground"})," ",a.dest]}):e.jsx(e.Fragment,{children:a.title||a.dest||a.origin||t(`tripsPage.kind.${s.type}`,{defaultValue:s.type})})})()}),(()=>{const a=K(s);return a.dest&&a.title?e.jsx("div",{className:"text-sm text-muted-foreground mt-0.5",children:a.dest}):null})(),e.jsx("div",{className:"text-sm text-muted-foreground mt-1.5 flex flex-wrap items-center gap-x-4 gap-y-1",children:(()=>{const a=K(s);return e.jsxs(e.Fragment,{children:[a.carrier&&e.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[e.jsx(ge,{className:"h-3.5 w-3.5"})," ",qe(a.carrier)]}),a.heroDates&&e.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[e.jsx(ct,{className:"h-3.5 w-3.5"})," ",Ke(a.heroDates)]}),s.pax&&e.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[e.jsx(we,{className:"h-3.5 w-3.5"}
1)," ",t("tripsPage.travelerCount",{count:s.pax})]})]})})()}),s.insiderPurchase&&e.jsxs("div",{className:"mt-2 inline-flex items-center gap-1.5 text-xs font-bold text-[#00154a]",children:[e.jsx(mt,{className:"h-3.5 w-3.5 text-[#C9A57B]"})," ",t("tripsPage.insiderBooking")]})]}),e.jsxs("div",{className:"text-right",children:[e.jsx("div",{className:"text-[10px] font-bold tracking-[0.2em] uppercase text-muted-foreground",children:t("tripsPage.totalPaid")}),e.jsx("div",{className:"font-display text-xl font-bold",children:s.pointsToBurn&&s.pointsToBurn>0?`${new Intl.NumberFormat(g).format(s.pointsToBurn)} ${t("common.pointsLower")}`:s.extras?.pointsRedeemed>0?`${new Intl.NumberFormat(g).format(s.extras.pointsRedeemed)} ${t("common.pointsLower")}`:(()=>{const a=s.retailTotal??s.displayAmount??s.total??s.chargedAmount??0,n=s.displayCurrency??s.ccy??s.chargedCurrency??"USD";return a?v(a,n):e.jsx("span",{className:"block text-xs font-semibold leading-snug text-muted-foreground max-w-[13rem]",children:t("tripsPage.amountNotOnFile",{defaultValue:"Amount not on file — contact support"})})})()}),(s.dueAtPickupUSD??0)>0&&e.jsxs("div",{className:"text-[10px] text-muted-foreground mt-0.5",children:[t("tripsPage.paidNow",{defaultValue:"Paid now"})," ",r(s.chargedNowUSD??0,s.ccy)," · ",t("tripsPage.dueAtPickup",{defaultValue:"Due at pickup"})," ",r(s.dueAtPickupUSD??0,s.ccy)]}),s.chargedAmount!=null&&s.chargedCurrency&&(s.displayCurrency??s.ccy)&&s.chargedCurrency!==(s.displayCurrency??s.ccy)&&e.jsx("div",{className:"text-[10px] text-muted-foreground mt-0.5",children:t("tripsPage.chargedAs",{defaultValue:"Charged {{amount}}",amount:v(s.chargedAmount,s.chargedCurrency)})}),e.jsx("div",{className:"mt-2 inline-flex items-center gap-1 text-xs text-primary font-semibold",children:i===s.id?e.jsxs(e.Fragment,{children:[t("tripsPage.hideDetails")," ",e.jsx(ut,{className:"h-3 w-3"})]}):e.jsxs(e.Fragment,{children:[t("tripsPage.viewDetails")," ",e.jsx(pt,{className:"h-3 w-3"})]})})]})]})]}),i===s.id&&e.jsxs("div",{className:"px-5 py-5 border-t border-border bg-muted/10",children:[s.type==="air"?e.jsx(jt,{reference:s.confirmation,bookingToken:s.bookingToken,confirmed:s.bookingStatus!=="failed"&&!(s.cancelled??!1),className:"mb-5 rounded-xl border border-border bg-card p-4 flex flex-wrap items-center justify-between gap-3"}):null,e.jsx(pe,{trip:s,onChange:a=>p(n=>n.map(l=>l.id===a.id?a:l))}),(()=>{const a=s.extras??{},n=a?.supplierIds??{},l=[{label:t("tripsPage.support.confirmation",{defaultValue:"Confirmation"}),value:s.confirmation||n?.confirmation},{label:t("tripsPage.support.supplierBookingId",{defaultValue:"Supplier booking ID"}),value:s.supplierBookingId||n?.bookingId},{label:t("tripsPage.support.pnr",{defaultValue:"PNR"}),value:s.pnr},{label:t("tripsPage.support.itineraryId",{defaultValue:"Itinerary ID"}),value:a?.itineraryId||n?.itineraryId},{label:t("tripsPage.support.purlId",{defaultValue:"PURL ID"}),value:a?.purlId||n?.purlId},{label:t("tripsPage.support.customerId",{defaultValue:"Customer ID"}),value:a?.customerId??n?.customerId?String(a?.customerId??n?.customerId):void 0},{label:t("tripsPage.support.sessionId",{defaultValue:"Session ID"}),value:a?.sessionId}];return e.jsx("div",{className:"mt-5",children:e.jsx(Ze,{rows:l})})})()]})]},s.id))})]})}),e.jsx(We,{open:q,onClose:()=>E(!1),onSignedIn:s=>{He({...s,insider:!1}),m(!0),E(!1)}})]})}function je(){return e.jsxs("div",{className:"overflow-hidden rounded-2xl border border-border bg-card shadow-sm","aria-busy":"true","aria-label":"Loading your reservation",children:[e.jsx("div",{className:"h-72 animate-pulse bg-muted sm:h-96"}),e.jsxs("div",{className:"space-y-4 p-6",children:[e.jsx("div",{className:"h-3 w-28 animate-pulse rounded bg-muted"}),e.jsx("div",{className:"h-7 w-2/3 animate-pulse rounded bg-muted"}),e.jsx("div",{className:"h-4 w-1/2 animate-pulse rounded bg-muted"}),e.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[e.jsx("div",{className:"h-40 animate-pulse rounded-xl bg-muted"}),e.jsx("div",{className:"h-40 animate-pulse rounded-xl bg-muted"})]})]})]})}export{ps as component,be as recordToTrip};

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.