1"use strict";(self.webpackChunkredfunnel_consumer_booking=self.webpackChunkredfunnel_consumer_booking||[]).push([[649],{3231:(e,t,l)=>{l.d(t,{q:()=>s});var i=l(2388);const s=(e,t)=>i.Z.post("https://api.hsforms.com/submissions/v3/integration/submit/145627256/5369d928-7c07-4e7e-a116-c790ebd40d43",{fields:[{objectTypeId:"0-1",name:"firstname",value:null===e||void 0===e?void 0:e.firstName},{objectTypeId:"0-1",name:"email",value:null===e||void 0===e?void 0:e.email},{objectTypeId:"0-1",name:"customer_type",value:t}],legalConsentOptions:{consent:{consentToProcess:!0,text:"By clicking \u2018submit\u2019 you agree to receive marketing emails from Red Funnel. You can stop these at any time by clicking the unsubscribe link at the bottom of each email.",communications:[{value:!0,subscriptionTypeId:999,text:"By clicking \u2018submit\u2019 you agree to receive marketing emails from Red Funnel. You can stop these at any time by clicking the unsubscribe link at the bottom of each email."}]}}},{headers:{"Content-Type":"application/json"}})},8716:(e,t,l)=>{l.d(t,{Z:()=>N});var i=l(9434),s=l(7999),n=l(6970),a=l(8452),o=l(9518),r=l(453),d=l(2791),c=l(1724),u=l(2506),m=l(3597),v=l(5853),x=l(3385),p=l(6849),h=l(5757),g=l(5793),b=l(184);const f=e=>{let{initialValues:t,submit:l,error:i,loading:s,handleBackButton:a,requiresTermsCheckbox:o,submitText:r,baseUrl:f}=e;const[j,y]=(0,d.useState)(!1),N=c.Ry({...g.Z,firstName:c.Z_().required().label("First Name"),lastName:c.Z_().required().label("Last Name"),language:c.Z_().required().label("Language"),address1:c.Z_().required().label("Address 1"),address2:c.Z_().nullable().label("Address 2"),city:c.Z_().required().label("City"),county:c.Z_().label("County"),postalCode:c.Z_().required().label("Postal Code"),countryCode:c.Z_().required().label("Country"),mobilePhoneNumber:c.Z_().test("phone number format","Phone number is not in the correct format.",(e=>!e||(0,m.yf)(e))),homePhoneNumber:c.Z_().test("phone number format","Phone number is not in the correct format.",(e=>!e||(0,m.yf)(e))),emailAddress:c.Z_().email("Please enter a valid email address").label("Email address").required(),acceptsContact:c.Xg(),terms:o?c.O7().test("must accept","You must accept the terms and conditions",(e=>!!e)):c.O7(),promotion:c.Z_()}),w="Invalid request"===i?"This email address already exists.":i;return(0,b.jsx)(u.J9,{initialValues:t,onSubmit:l,validationSchema:N,children:e=>{let{handleSubmit:t,isSubmitting:l,values:i,dirty:d,errors:c,touched:m,setFieldTouched:g,validateForm:N}=e;const C=e=>{var t,l;const i=null===e||void 0===e||null===(t=e.target)||void 0===t?void 0:t.name;"insertText"!==(null===e||void 0===e||null===(l=e.nativeEvent)||void 0===l?void 0:l.inputType)&&(g(i,!0,!0),N())},k=Object.keys(c).some((e=>m[e]));return(0,b.jsxs)("form",{onSubmit:t,className:"UserDetailsForm",children:[(0,b.jsx)("h3",{children:"Name"}),(0,b.jsxs)("div",{className:"row name",children:[(0,b.jsx)(x.Z,{name:"firstName",label:"First Name",handleInput:C,renderField:e=>{let{field:t}=e;return(0,b.jsx)("input",{type:"text",...t,placeholder:"Enter First Name"})}}),(0,b.jsx)(x.Z,{name:"lastName",label:"Last Name",handleInput:C,renderField:e=>{let{field:t}=e;return(0,b.jsx)("input",{type:"text",...t,placeholder:"Enter Last Name"})}})]}),(0,b.jsx)(u.gN,{type:"hidden",name:"language"}),(0,b.jsx)("h3",{children:"Address"}),(0,b.jsxs)("div",{className:"row",children:[(0,b.jsx)(x.Z,{name:"address1",label:"Address 1",handleInput:C,renderField:e=>{let{field:t}=e;return(0,b.jsx)("input",{type:"text",...t,placeholder:"Enter Address 1"})}}),(0,b.jsx)(x.Z,{name:"address2",label:"Address 2 (optional)",handleInput:C,renderField:e=>{let{field:t}=e;return(0,b.jsx)("input",{type:"text",...t,placeholder:"Enter Address 2"})}})]}),(0,b.jsxs)("div",{className:"row",children:[(0,b.jsx)(x.Z,{name:"city",label:"City",handleInput:C,renderField:e=>{let{field:t}=e;return(0,b.jsx)("input",{type:"text",...t,placeholder:"Enter Town/City"})}}),(0,b.jsx)(x.Z,{name:"county",label:"County (optional)",handleInput:C,renderField:e=>{let{field:t}=e;return(0,b.jsx)("input",{type:"text",...t,placeholder:"Enter County"})}})]}),(0,b.jsxs)("div",{className:"row",children:[(0,b.jsx)(x.Z,{name:"postalCode",label:"Postal Code",handleInput:C,renderField:e=>{let{field:t}=e;return(0,b.jsx)("input",{type:"text",...t,placeholder:"Enter Postal Code"})}}),(0,b.jsx)(x.Z,{name:"countryCode",label:"Country",renderField:e=>{let{field:t}=e;return(0,b.jsxs)("select",{...t,className:"bg-white ".concat(""===t.value?"blank":""),children:[(0,b.jsx)("option",{value:"",children:"Select Country"}),p.Z.map((e=>{let{value:t,name:l}=e;return(0,b.jsx)("option",{value:t,children:l},t)}))]})}})]}),(0,b.jsx)("h3",{children:"Contact"}),(0,b.jsx)("div",{className:"grid grid-cols-[1fr_1fr] gap-2",children:(0,b.jsx)(v.Z,{className:"[&_.feedback-text]:bottom-[-12px]",name:"mobilePhoneNumber",label:"Mobile Phone",placeholder:"Mobile Phone Number (Optional)",handleInput:C})}),(0,b.jsx)(v.Z,{className:"[&_.feedback-text]:bottom-[-12px]",name:"homePhoneNumber",label:"Landline",placeholder:"Home Phone Number (Optional)",handleInput:C}),(0,b.jsx)("h3",{children:"Email & Password"}),(0,b.jsx)(x.Z,{name:"emailAddress",label:"Email Address",handleInput:C,renderField:e=>{let{field:t}=e;return(0,b.jsx)("input",{type:"email",...t,placeholder:"Enter Email Address"})}}),(0,b.jsxs)("div",{className:"password",children:[(0,b.jsx)("div",{className:"md:w-1/2",children:(0,b.jsx)(x.Z,{name:"password",label:"Password",handleFocus:()=>y(!0),handleBlur:()=>y(!1),handleInput:C,renderField:e=>{let{field:t}=e;return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("input",{type:"password",...t,placeholder:"Enter Password"}),(0,b.jsx)(h.Z,{show:j&&d&&!(null===c||void 0===c||!c.password),password:i.password})]})}})}),(0,b.jsx)("div",{className:"md:w-1/2",children:(0,b.jsx)(x.Z,{name:"confirmPassword",label:"Verify Password",handleInput:C,renderField:e=>{let{field:t}=e;return(0,b.jsx)("input",{type:"password",...t,placeholder:"Re-enter Password"})}})})]}),(0,b.jsx)("h3",{children:"My Rewards"}),(0,b.jsx)(x.Z,{name:"rewardsOptIn",renderField:e=>{let{field:t}=e;return(0,b.jsxs)("label",{className:"my-rewards",children:[(0,b.jsx)("input",{...t,type:"checkbox",name:"rewardsOptIn",className:"min-w-[20px]"}),(0,b.jsxs)("div",{children:[(0,b.jsx)("h4",{children:"Sign up for FREE to My Rewards and start earning points"}),(0,b.jsxs)("div",{children:["Earn up to 5 points for every \xa31 that you spend with us. Each point is worth 1p. Qualifying products include private vehicle ferry booking, foot passenger tickets and food & drinks."," ",(0,b.jsx)("a",{href:"".concat(f,"/loyalty-rewards"),target:"_blank",rel:"noopener noreferrer",className:"red",children:"Terms & Conditions"})]})]})]})}}),(0,b.jsx)("h3",{children:"Emails Promotions & Updates"}),(0,b.jsx)("p",{className:"!mt-4 !text-base",children:"Sign up for our latest news and offers by ticking the relevant box below."}),(0,b.jsx)(x.Z,{className:"",name:"promotion",renderField:e=>{let{field:t}=e;return(0,b.jsxs)("label",{className:"font-heading text-[21px]",children:[(0,b.jsx)("input",{...t,type:"radio",value:"Mainland",className:"size-4 mr-2"}),"General news, offers and updates"]})}}),(0,b.jsx)(x.Z,{className:"",name:"promotion",renderField:e=>{let{field:t}=e;return(0,b.jsxs)("label",{className:"font-heading text-[21px]",children:[(0,b.jsx)("input",{...t,type:"radio",value:"Island",className:"size-4 mr-2"}),"Isle of Wight residents news, offers and updates"]})}}),o&&(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("hr",{}),(0,b.jsxs)("label",{className:"flex items-baseline",htmlFor:"terms",children:[(0,b.jsx)(u.gN,{type:"checkbox",name:"terms",id:"terms"}),(0,b.jsxs)("div",{children:[(0,b.jsxs)("div",{className:"font-heading text-[21px]",children:["I have read the information regarding use of my data and accept the terms stated"," ",(0,b.jsx)("a",{href:"".concat(f,"/cookie-privacy-policy"),target:"_blank",rel:"noopener noreferrer",className:"red",children:"Privacy Policy"})]}),(0,b.jsx)(u.Bc,{name:"terms",children:e=>(0,b.jsx)("div",{className:"error",children:e})})]})]})]}),(0,b.jsxs)("div",{className:"actions",children:[a&&(0,b.jsx)("button",{type:"button",className:"btn-quaternary",onClick:e=>{e.preventDefault(),a()},disabled:s||l,children:"Back"}),(0,b.jsx)("button",{className:"btn-primary",type:"submit",disabled:s||l,onClick:async()=>{const e=await N();Object.keys(e).length>0&&(0,n.Z)("error_message",{message:Object.values(e).join(", ")})},children:r})]}
1),k&&(0,b.jsx)("p",{className:"text-xs text-red",children:"There are some errors in the form"}),w&&(0,b.jsx)("p",{className:"request-error",children:w})]})}})};f.defaultProps={error:"",loading:!1,requiresTermsCheckbox:!1,submitText:"Sign Up"};const j=f;var y=l(3231);const N=e=>{let{onSuccess:t,onBackButton:l}=e;const d=(0,i.v9)(a.FV),c=(0,i.I0)(),{loading:u,error:m}=(0,i.v9)(o._9),v={title:"",firstName:"",lastName:"",language:"en",gender:"",passengerType:"A",address1:"",address2:"",city:"",county:"",postalCode:"",countryCode:"",mobilePhoneNumber:"",homePhoneNumber:"",emailAddress:"",password:"",confirmPassword:"",acceptsContact:!1,defaultProductCode:d,rewardsOptIn:!1,promotion:"",terms:!1};return(0,b.jsxs)("div",{className:"max-w-[800px] mx-auto",children:[(0,b.jsx)("h1",{className:"text-center py-8",children:"Create an Account"}),(0,b.jsx)("div",{className:"border border-solid border-lighter-grey bg-white rounded-sm",children:(0,b.jsx)("div",{className:"py-8 px-4 md:py-14 md:px-8",children:(0,b.jsx)(j,{initialValues:v,submit:e=>{const l={...e,address:"".concat(e.address1," ").concat(e.address2).trim()};return null!==l&&void 0!==l&&l.homePhoneNumber&&(l.homePhoneNumber=l.homePhoneNumber.replace(/ /g,"")),null!==l&&void 0!==l&&l.mobilePhoneNumber&&(l.mobilePhoneNumber=l.mobilePhoneNumber.replace(/ /g,"")),r.Z.registerCustomer(l).then((i=>{var a,d;(c((0,o.uZ)(i)),e.promotion&&(0,y.q)({firstName:e.firstName,email:e.emailAddress},e.promotion),(0,s.y9)(i.customerAccount).then((e=>{(0,n.Z)("epsilon_signup",e)})),l.rewardsOptIn)?r.Z.registerLoyaltyAccount(null===i||void 0===i||null===(a=i.customerAccount)||void 0===a?void 0:a.customerNumber,null===i||void 0===i||null===(d=i.customerAccount)||void 0===d?void 0:d.groupCode).catch((()=>{})).finally((()=>t())):t()})).catch((e=>{var t,l;c((0,o.S3)((null===e||void 0===e||null===(t=e.response)||void 0===t||null===(l=t.data)||void 0===l?void 0:l["hydra:description"])||(null===e||void 0===e?void 0:e.message)||"Unable to register user"))}))},error:m,loading:u,handleBackButton:l,requiresTermsCheckbox:!0,baseUrl:"https://www.redfunnel.co.uk"})})})]})}},1019:(e,t,l)=>{l.r(t),l.d(t,{default:()=>Nl});var i=l(2791),s=l(9434),n=l(7689),a=l(763),o=l(5401),r=l(8452),d=l(6426),c=l(7892),u=l.n(c),m=l(4245),v=l(4270),x=l(7321),p=l(8036),h=l(2035),g=l(2136),b=l(4366),f=l(3566),j=l(911),y=l(3232),N=l(453),w=l(1087),C=l(890),k=l(6535),T=l(32),A=l(184);const P=e=>{var t,l;let{attraction:i={}}=e;const{media:s,name:n,location:a,amenities:o,discounts:r}=i,d=(0,T.Z)(n);return(0,A.jsx)("div",{className:"bg-white flex-grow h-full flex flex-col",children:(0,A.jsxs)(w.rU,{to:"/book/attractions/".concat(d),className:"flex flex-col flex-grow rounded-b shadow-lg",children:[null!==s&&void 0!==s&&s.length?(0,A.jsxs)("div",{className:"relative",children:[(0,A.jsx)("img",{src:null===(t=s[0])||void 0===t?void 0:t.path,alt:null===(l=s[0])||void 0===l?void 0:l.description,className:"w-full h-[200px] rounded-t object-cover"}),(0,A.jsx)("div",{className:"absolute bottom-0 right-0",children:(0,A.jsx)("img",{src:C.Z,alt:"gallery"})})]}):null,(0,A.jsxs)("div",{className:"p-4 flex-grow flex flex-col",children:[a&&(0,A.jsxs)("div",{className:"flex items-center mb-2",children:[(0,A.jsx)("img",{className:"mr-1",src:k.Z,alt:"location"}),(0,A.jsx)("p",{className:"text-darker-grey text-[10px] uppercase font-bold",children:a})]}),(0,A.jsx)("h3",{className:"text-black text-3xl leading-10 mb-2 font-medium",children:n}),null!==o&&void 0!==o&&o.length?(0,A.jsx)("div",{className:"flex flex-grow text-xs font-normal leading-5 text-darker-grey",children:o.map((e=>e.name)).join(" \u2022 ")}):null,r&&(0,A.jsxs)("div",{className:"font-bold text-red text-xs my-2",children:["*",r]})]})]})})};var D=l(9235),S=l(1741),R=l(9140),E=l(491),O=l(2808),L=l(3455),Z=l(9185),_=l(2563);const I=l.p+"static/media/search.1f48404154a08ae685e8d59d1e70779a.svg";var F=l(5672),Y=l(2194),M=l(5969),W=l(8655),B=l(6915),V=l(2892),H=l(11);const U=e=>{var t,l,s,n,o,r,d,c,m,v,x,p,h,g;let{searchFilters:b,availableFilters:f,attractions:j,handleFilterUpdate:y,isLoading:N,onDateChange:w}=e;const[C,k]=(0,i.useState)(!1),[T,P]=(0,i.useState)(!1),[D,U]=(0,i.useState)({types:!0}),G=(0,i.useMemo)((()=>{const e={};
1return(j||[]).forEach((t=>{((null===t||void 0===t?void 0:t.amenities)||[]).forEach((t=>{var l;const i=null===t||void 0===t?void 0:t.name,s=(null===t||void 0===t||null===(l=t.image)||void 0===l?void 0:l.path)||(null===t||void 0===t?void 0:t.path);i&&s&&!e[i.toLowerCase()]&&(e[i.toLowerCase()]=s)}))})),e}),[j]),z=(e,t)=>{let l=b[e]||[];-1!==(0,a.indexOf)(l,t)?l=l.filter((e=>e!==t)):l.push(t),y({...b,[e]:l})},q=()=>{y({...b,petFriendlyRequired:!1,...Object.keys(f||{}).reduce(((e,t)=>(e[t]=[],e)),{})})},X=e=>{U((t=>({...t,[e]:!t[e]})))},J=(e,t)=>(e||[]).find((e=>t.test(e))),K=((e,t)=>(e||[]).filter((e=>t.test(e))))(null===f||void 0===f?void 0:f.facilities,/accessib/i),Q=J(null===f||void 0===f?void 0:f.targetGroups,/adult/i),$=J(null===f||void 0===f?void 0:f.targetGroups,/famil/i),ee=[{key:"accessible",label:"Accessible",icon:Y.Z,available:K.length>0,selected:K.length>0&&K.every((e=>{var t;return null===b||void 0===b||null===(t=b.facilities)||void 0===t?void 0:t.includes(e)})),onToggle:()=>((e,t)=>{const l=b[e]||[],i=t.length>0&&t.every((e=>l.includes(e)))?l.filter((e=>!t.includes(e))):[...l,...t.filter((e=>!l.includes(e)))];y({...b,[e]:i})})("facilities",K)},{key:"adultsOnly",label:"Adults Only",icon:M.Z,available:!!Q,selected:!!Q&&(null===b||void 0===b||null===(t=b.targetGroups)||void 0===t?void 0:t.includes(Q)),onToggle:()=>z("targetGroups",Q)},{key:"families",label:"Families",icon:W.Z,available:!!$,selected:!!$&&(null===b||void 0===b||null===(l=b.targetGroups)||void 0===l?void 0:l.includes($)),onToggle:()=>z("targetGroups",$)},{key:"petFriendly",label:"Pet Friendly",icon:B.Z,available:!0,selected:!(null===b||void 0===b||!b.petFriendlyRequired),onToggle:()=>{y({...b,petFriendlyRequired:!b.petFriendlyRequired})}}],te=[...(null===b||void 0===b?void 0:b.types)||[],...(null===b||void 0===b?void 0:b.facilities)||[],...(null===b||void 0===b?void 0:b.locations)||[],...(null===b||void 0===b?void 0:b.targetGroups)||[],...null!==b&&void 0!==b&&b.petFriendlyRequired?["pet"]:[]].length;return(0,A.jsxs)("div",{className:"border px-4 md:px-8 py-6 bg-white relative attraction-filters",children:[(0,A.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[(0,A.jsx)(R.Z,{handleClickAway:()=>k(!1),className:"flex-1",children:(0,A.jsxs)("div",{className:"relative",children:[(0,A.jsx)("button",{type:"button",className:"border w-full text-left rounded-[2px]",onClick:()=>k(!0),disabled:N,children:(0,A.jsxs)("div",{className:"pt-1 pr-3 pl-3 pb-2",children:[(0,A.jsx)("p",{className:"text-xs font-normal leading-[21px]",children:"Date"}),(0,A.jsxs)("div",{className:"flex gap-2 items-center",children:[(0,A.jsx)("img",{src:_.Z,alt:"calendar"}),(0,A.jsx)("p",{className:"font-heading text-black text-xl font-medium leading-[18px]",children:u()(b.date).format("ddd DD MMM YYYY")})]})]})}),C&&(0,A.jsx)(E.Z,{handleSelectDate:e=>{w(e.format("YYYY-MM-DD")),k(!1)},date:b.date,selectedDates:[b.date],endDate:null,monthsToShow:1,isOneWay:!0})]})}),(0,A.jsxs)("div",{className:"border rounded-[2px] w-full min-h-[65px] px-3 pt-1 pb-2",children:[(0,A.jsx)("p",{className:"text-xs font-normal leading-[21px]",children:"Search"}),(0,A.jsxs)("div",{className:"flex gap-2 items-center",children:[(0,A.jsx)("img",{src:I,alt:"search"}),(0,A.jsx)("input",{className:"font-heading font-medium leading-[18px] text-xl h-full w-full placeholder-black placeholder-opacity-[.58]",type:"text",placeholder:"Search Attractions",value:b.textSearch,onChange:e=>{y({...b,textSearch:e.target.value})}})]})]})]}),(0,A.jsxs)("div",{className:"md:flex justify-between mt-2",children:[(0,A.jsxs)("div",{className:"md:flex flex-wrap items-stretch flex-1 ",children:[(0,A.jsxs)("button",{className:"flex flex-row items-center",type:"button",onClick:()=>P(!0),children:[(0,A.jsx)("img",{className:"px-4 h-5",src:O.Z,alt:"filter"}),(0,A.jsxs)("div",{className:"text-black font-heading text-[18px] flex flex-row relative",children:[(0,A.jsx)("p",{children:"Filters"}),+te>0&&(0,A.jsx)("span",{className:"w-4 inline-flex h-4 items-center justify-center absolute -right-4 -top-1 text-xs font-semibold rounded-full border-0 bg-red text-white",children:te})]})]}),(0,A.jsx)(S.Z,{isOpen:T,onRequestClose:()=>P(!1),children:(0,A.jsxs)("div",{className:"flex flex-col items-center bg-white px-8 py-4 max-h-[80vh] w-[90vw] md:w-[60vw] lg:w-[40vw] overflow-y-auto",children:[(0,A.jsx)("button",{className:"absolute font-semibold right-4 top-4 cursor-pointer border-0 bg-transparent text-xs text-red",type:"button",onClick:()=>P(!1),children:"CLOSE X"}),(0,A.jsx)("div",{className:"border-b py-5 text-center w-full",children:(0,A.jsx)("h2",{className:"font-semibold uppercase text-black",children:"FILTER BY"})}),(0,A.jsx)("div",{className:"flex w-full items-center justify-between gap-2 py-4",children:ee.map((e=>(0,A.jsxs)("button",{type:"button",disabled:!e.available,onClick:e.onToggle,className:"flex h-[80px] w-[82px] flex-col items-center justify-center gap-2 rounded-[4px] p-2 disabled:opacity-40 ".concat(e.selected?"bg-light-grey border-2 border-red":"bg-slightly-off-white border border-text"),children:[(0,A.jsx)("img",{src:e.icon,alt:e.label,className:"h-10 w-10 object-contain"}),(0,A.jsx)("span",{className:"font-heading text-md leading-[0.9] text-black text-center",children:e.label})]},e.key)))}),(0,A.jsxs)("div",{children:[(null===f||void 0===f||null===(s=f.types)||void 0===s?void 0:s.length)>0&&(0,A.jsxs)("section",{className:"mb-4 mt-4 bg-slightly-off-white p-4",children:[(0,A.jsxs)("button",{className:"flex w-full items-center justify-between",type:"button",onClick:()=>X("types"),children:[(0,A.jsx)("h3",{children:"Attraction Type"}),null!==D&&void 0!==D&&D.types?(0,A.jsx)("img",{className:"px-4",src:L.Z,alt:"arrow"}):(0,A.jsx)("img",{className:"px-4",src:Z.Z,alt:"arrow"})]}),(null===D||void 0===D?void 0:D.types)&&(0,A.jsx)("div",{className:"flex flex-wrap gap-3 mt-4",children:null===f||void 0===f||null===(n=f.types)||void 0===n||null===(o=n.filter(
1Boolean))||void 0===o?void 0:o.map((e=>{var t;const l=null===b||void 0===b||null===(t=b.types)||void 0===t?void 0:t.includes(e);return(0,A.jsxs)("button",{type:"button",onClick:()=>z("types",e),className:"px-4 py-2 text-black text-sm font-normal box-border flex items-center gap-2 ".concat(l?"outline outline-2 outline-red bg-gray-200":"border-text"),children:[(0,A.jsx)("img",{src:V.Z,alt:"",className:"h-5 w-5 flex-shrink-0 object-contain"}),e]},e)}))})]}),(null===f||void 0===f||null===(r=f.facilities)||void 0===r?void 0:r.length)>0&&(0,A.jsxs)("section",{className:"mb-4 mt-4 bg-slightly-off-white p-4",children:[(0,A.jsxs)("button",{className:"flex w-full items-center justify-between",type:"button",onClick:()=>X("facilities"),children:[(0,A.jsx)("h3",{children:"Facilities"}),null!==D&&void 0!==D&&D.facilities?(0,A.jsx)("img",{className:"px-4",src:L.Z,alt:"arrow"}):(0,A.jsx)("img",{className:"px-4",src:Z.Z,alt:"arrow"})]}),(null===D||void 0===D?void 0:D.facilities)&&(0,A.jsx)("div",{className:"flex flex-wrap gap-3 mt-4",children:null===f||void 0===f||null===(d=f.facilities)||void 0===d||null===(c=d.filter(Boolean))||void 0===c?void 0:c.map((e=>{var t;const l=null===b||void 0===b||null===(t=b.facilities)||void 0===t?void 0:t.includes(e),i=G[null===e||void 0===e?void 0:e.toLowerCase()];return(0,A.jsxs)("button",{type:"button",onClick:()=>z("facilities",e),className:"px-4 py-2 text-black text-sm font-normal box-border flex items-center gap-2 ".concat(l?"outline outline-2 outline-red bg-gray-200":"border-text"),children:[i&&(0,A.jsx)("img",{src:i,alt:"",className:"h-5 w-5 flex-shrink-0 object-contain brightness-0"}),e]},e)}))})]}),(null===f||void 0===f||null===(m=f.locations)||void 0===m?void 0:m.length)>0&&(0,A.jsxs)("section",{className:"mb-4 mt-4 bg-slightly-off-white p-4",children:[(0,A.jsxs)("button",{className:"flex w-full items-center justify-between",type:"button",onClick:()=>X("locations"),children:[(0,A.jsx)("h3",{children:"Locations/Areas"}),null!==D&&void 0!==D&&D.locations?(0,A.jsx)("img",{className:"px-4",src:L.Z,alt:"arrow"}):(0,A.jsx)("img",{className:"px-4",src:Z.Z,alt:"arrow"})]}),(null===D||void 0===D?void 0:D.locations)&&(0,A.jsx)("div",{className:"flex flex-wrap gap-3 mt-4",children:null===f||void 0===f||null===(v=f.locations)||void 0===v||null===(x=v.filter(Boolean))||void 0===x?void 0:x.map((e=>{var t;const l=null===b||void 0===b||null===(t=b.locations)||void 0===t?void 0:t.includes(e);return(0,A.jsxs)("button",{type:"button",onClick:()=>z("locations",e),className:"px-4 py-2 text-black text-sm font-normal box-border flex items-center gap-2 ".concat(l?"outline outline-2 outline-red bg-gray-200":"border-text"),children:[(0,A.jsx)("img",{src:F.Z,alt:"",className:"h-5 w-5 flex-shrink-0 object-contain"}),e]},e)}))})]}),(null===f||void 0===f||null===(p=f.targetGroups)||void 0===p?void 0:p.length)>0&&(0,A.jsxs)("section",{className:"mb-4 mt-4 bg-slightly-off-white p-4",children:[(0,A.jsxs)("button",{className:"flex w-full items-center justify-between",type:"button",onClick:()=>X("targetGroups"),children:[(0,A.jsx)("h3",{children:"Good For"}),null!==D&&void 0!==D&&D.targetGroups?(0,A.jsx)("img",{className:"px-4",src:L.Z,alt:"arrow"}):(0,A.jsx)("img",{className:"px-4",src:Z.Z,alt:"arrow"})]}),(null===D||void 0===D?void 0:D.targetGroups)&&(0,A.jsx)("div",{className:"flex flex-wrap gap-3 mt-4",children:null===f||void 0===f||null===(h=f.targetGroups)||void 0===h||null===(g=h.filter(Boolean))||void 0===g?void 0:g.map((e=>{var t;const l=null===b||void 0===b||null===(t=b.targetGroups)||void 0===t?void 0:t.includes(e);return(0,A.jsxs)("button",{type:"button",onClick:()=>z("targetGroups",e),className:"px-4 py-2 text-black text-sm font-normal box-border flex items-center gap-2 ".concat(l?"outline outline-2 outline-red bg-gray-200":"border-text"),children:[(0,A.jsx)("img",{src:H.Z,alt:"",className:"h-5 w-5 flex-shrink-0 object-contain"}),e]},e)}))})]})]}),(0,A.jsx)("div",{className:"mt-4 flex-col sm:flex-row flex w-full items-center justify-between gap-6",children:(0,A.jsx)("button",{type:"button",onClick:()=>{q(),P(!1)},className:"btn-inverted border-none flex-1",children:"X CLEAR FILTERS"})})]})}),(0,A.jsx)("div",{className:"flex-shrink-0 flex items-center mt-2 md:mt-0 md:ml-14 ",children:(0,A.jsxs)("label",{className:"flex items-center mr-5",children:[(0,A.jsx)("p",{className:"text-sm leading-[21px] mr-2 cursor-pointer min-w-[90px]",children:"Pet Friendly"}),(0,A.jsx)("input",{className:'appearance-none bg-white rounded-[72px] border-2 flex-shrink-0 h-5 w-[30px] border-dark-grey relative before:content[""] before:absolute before:top-[-6px] before:right-[-6px] before:bottom-[-6px] after:content[""] after:h-[14px] after:w-[14px] after:rounded-full after:bg-white after:border-dark-grey after:border-2 after:absolute after:top-[1px] after:left-[1px] checked:bg-dark-grey checked:after:bg-white checked:after:left-[13px] curs
1or-pointer',type:"checkbox",checked:!!b.petFriendlyRequired,onChange:e=>{y({...b,petFriendlyRequired:e.target.checked})}})]})})]}),(0,A.jsx)("div",{className:"flex-shrink-0 flex items-center mt-4 md:mt-0 md:ml-4 ",children:(0,A.jsx)("button",{type:"button",onClick:q,className:"btn-inverted border-none",children:"X CLEAR FILTERS"})})]})]})};U.defaultProps={isLoading:!1,availableFilters:null,attractions:[]};const G=U;var z=l(2944),q=l(676),X=l(9842),J=l(3083),K=l(6005),Q=l(6750);const $=e=>{let{activeFilters:t,attractions:l=[],availableFilters:s,isError:n,isLoading:o,onDateChange:r,setActiveFilters:d,basePath:c}=e;const[u,m]=(0,i.useState)("list"),[v,x]=(0,i.useState)("featured"),p=l.filter((e=>{var l,i,s,n,o;if(null!==(l=t.facilities)&&void 0!==l&&l.length&&!t.facilities.some((t=>{var l;return null===e||void 0===e||null===(l=e.amenities)||void 0===l?void 0:l.some((e=>e.name===t))})))return!1;if(null!==(i=t.types)&&void 0!==i&&i.length&&(!e.type||!t.types.some((t=>e.type.some((e=>e===t))))))return!1;if(null!==(s=t.locations)&&void 0!==s&&s.length&&-1===(0,a.indexOf)(t.locations,e.location))return!1;if(null!==(n=t.targetGroups)&&void 0!==n&&n.length&&(null===e||void 0===e||!e.targetGroups||!t.targetGroups.some((t=>{var l;return null===e||void 0===e||null===(l=e.targetGroups)||void 0===l?void 0:l.some((e=>e===t))}))))return!1;if(t.textSearch){var r;const l=t.textSearch.toLowerCase();return null===(r=e.searchTerms)||void 0===r?void 0:r.some((e=>null===e||void 0===e?void 0:e.toLowerCase().includes(l.toLowerCase())))}return!t.petFriendlyRequired||(null===(o=e.amenities)||void 0===o?void 0:o.some((e=>{var t,l,i,s;return(null===(t=e.name)||void 0===t||null===(l=t.toLowerCase())||void 0===l?void 0:l.includes("pet friendly"))||(null===(i=e.name)||void 0===i||null===(s=i.toLowerCase())||void 0===s?void 0:s.includes("dogs allowed"))})))})),h=null===p||void 0===p?void 0:p.length;return(0,A.jsxs)("div",{className:"max-sm:px-2 max-lg:px-6 px-8",children:[(0,A.jsx)("div",{children:(0,A.jsxs)("div",{className:"bg-slightly-off-white",children:[(0,A.jsx)("div",{className:"w-full max-w-5xl mx-auto py-10",children:(0,A.jsx)("h1",{className:"text-[64px] text-red uppercase leading-[70px]",children:"Book Attractions"})}),(0,A.jsx)("div",{className:"bg-half-grey",children:(0,A.jsxs)("div",{className:"w-full max-w-5xl mx-auto",children:[(0,A.jsxs)("div",{className:"flex flex-wrap gap-x-8 mb-3",children:[(0,A.jsx)("div",{children:(0,A.jsxs)(w.rU,{to:f.Z.departureCrossing,className:"flex items-center text-lg font-semibold font-heading uppercase text-gray3",children:[(0,A.jsx)(J.r,{className:"w-5 mr-3 text-gray3"}),"Ferry"]})}),(0,A.jsx)("div",{children:(0,A.jsxs)(w.rU,{to:f.Z.accommodations,className:"flex items-center text-lg font-semibold font-heading uppercase text-gray3",children:[(0,A.jsx)(K.r,{className:"w-5 mr-3 text-gray3"}),"Accommodation"]})}),(0,A.jsx)("div",{children:(0,A.jsxs)(w.rU,{to:f.Z.attractions,className:"flex items-center text-lg font-semibold font-heading uppercase text-red",children:[(0,A.jsx)(Q.r,{className:"w-5 mr-3 text-red"}),"Attractions"]})})]}),(0,A.jsx)(G,{searchFilters:t,handleFilterUpdate:e=>{d(e)},isLoading:o,availableFilters:s,attractions:l,onDateChange:r})]})})]})}),(0,A.jsx)("div",{className:"bg-white pt-10",children:(0,A.jsx)("div",{className:"w-full max-w-5xl mx-auto",children:o?(0,A.jsx)("div",{className:"text-center",children:(0,A.jsx)(D.Z,{})}):(0,A.jsxs)(A.Fragment,{children:[(0,A.jsxs)("div",{className:"flex flex-col md:flex-row justify-between my-6",children:[(0,A.jsx)("h2",{className:"leading-10 mb-4 md:mb-0",children:"Choose Attractions"}),(0,A.jsxs)("div",{className:"flex flex-row ".concat("list"===u?"justify-between":"justify-end"),children:["list"===u&&(0,A.jsxs)("div",{"data-prefix":"Sort by:",className:"flex flex-col md:flex-row md:items-center mr-4",children:[(0,A.jsx)("label",{className:"mr-2",htmlFor:"attractions-sort",children:"Sort by:"}),(0,A.jsxs)("select",{id:"attractions-sort",className:"border border-lighter-grey pl-2 pr-8 py-2 rounded-[2px] appearance-none\tbg-dropdown bg-no-repeat bg-right-3",onChange:e=>x(e.target.value),value:v,children:[(0,A.jsx)("option",{value:"featured",children:"Featured"}),(0,A.jsx)("option",{value:"alphaAsc",children:"Alphabetical"}),(0,A.jsx)("option",{value:"priceHighToLow",children:"Price (high to low)"}),(0,A.jsx)("option",{value:"priceLowToHigh",children:"Price (low to high)"})]})]}),(0,A.jsxs)("div",{className:"grid grid-cols-2 bg-lighter-grey p-[1px] gap-[1px] rounded self-end",children:[(0,A.jsx)("button",{type:"button",className:"".concat("list"===u?"btn-primary":"btn-secondary"," px-[36px] h-[40p
1x]"),onClick:()=>m("list"),"aria-label":"view results as list","aria-pressed":"list"===u,children:(0,A.jsx)(q.r,{})}),(0,A.jsx)("button",{type:"button",className:"".concat("map"===u?"btn-primary":"btn-secondary"," px-[36px] h-[40px]"),onClick:()=>m("map"),"aria-label":"view results as map","aria-pressed":"map"===u,children:(0,A.jsx)(X.r,{})})]})]})]}),h?(0,A.jsxs)(A.Fragment,{children:["list"===u&&(0,A.jsx)("div",{className:"grid grid-cols-1 md:max-lg:grid-cols-2 lg:grid-cols-3 gap-6 my-6",children:p.sort(ee(v)).map((e=>{const{id:t}=e;return(0,A.jsx)("div",{children:(0,A.jsx)(P,{attraction:e})},t)}))}),"map"===u&&(0,A.jsx)("div",{className:"w-full h-[645px] my-6",children:(0,A.jsx)(z.Z,{items:p,itemBaseUrl:c,renderPopup:e=>(0,A.jsx)(P,{attraction:e})})})]}):n?(0,A.jsx)("p",{className:"pb-10 text-red",children:"We were unable to process your search at this time."}):(0,A.jsx)("p",{className:"pb-10",children:"No results"})]})})})]})};function ee(e){switch(e){case"alphaAsc":return(e,t)=>e.name<t.name?-1:e.name>t.name?1:0;case"featured":return(e,t)=>e.isFeatured===t.isFeatured&&e.hasCapacity===t.hasCapacity?0:e.isFeatured&&e.hasCapacity>t.hasCapacity||!e.isFeatured&&e.hasCapacity>t.hasCapacity?-1:1;case"priceHighToLow":return(e,t)=>e.hasCapacity&&t.hasCapacity?t.priceFrom-e.priceFrom:e.hasCapacity?-1:t.hasCapacity?1:0;case"priceLowToHigh":return(e,t)=>e.hasCapacity&&t.hasCapacity?e.priceFrom-t.priceFrom:e.hasCapacity?-1:t.hasCapacity?1:0;default:return()=>0}}$.defaultProps={attractions:[],isError:!1,isLoading:!1,availableFilters:null};const te=$;var le=l(4511),ie=l(2316),se=l(7061);const ne=e=>{var t,l,s;let{resources:n,isLoading:r,handleNewSearch:d,initialDate:c,handleSubmit:m}=e;const{cartState:v}=(0,o.Z)(),[x,p]=(0,i.useState)(c),[h,g]=(0,i.useState)(!1),[b,f]=(0,i.useState)(function(e,t,l){return null===e||void 0===e?void 0:e.reduce(((e,i)=>(i.startDate===l&&t.some((e=>e.id===i.resourceCode))&&(e[i.resourceCode]=i.amount),e)),{})}((null===v||void 0===v||null===(t=v.selections)||void 0===t?void 0:t.attractions)||[],n,c)),[j,y]=(0,i.useState)(!1),N=Object.entries(b).reduce(((e,t)=>{var l;let[i,s]=t;const a=null===n||void 0===n?void 0:n.find((e=>e.id===i)),o=null===a||void 0===a||null===(l=a.prices)||void 0===l?void 0:l.find((e=>"Z"===(null===e||void 0===e?void 0:e.priceList)));return e+ +((null===o||void 0===o?void 0:o.value)||0)*s}),0);return(0,A.jsxs)("div",{children:[(0,A.jsxs)("div",{className:"flex justify-between items-center mb-5",children:[(0,A.jsx)(R.Z,{handleClickAway:()=>g(!1),className:"flex-1 mr-2",children:(0,A.jsxs)("div",{className:"relative",children:[(0,A.jsx)("button",{type:"button",className:"border w-full text-left",onClick:()=>g(!0),children:(0,A.jsxs)("div",{className:"pt-[2px] pb-2 px-4",children:[(0,A.jsx)("p",{className:"text-xs text-darker-grey font-normal leading-5",children:"When are you going?"}),(0,A.jsxs)("div",{className:"flex items-center",children:[(0,A.jsx)("img",{className:"mr-3",src:_.Z,alt:"calendar"}),(0,A.jsx)("p",{className:"font-heading text-black font-medium text-xl leading-[18px]",children:u()(x).format("ddd DD MMM YYYY")})]})]})}),h&&(0,A.jsx)(E.Z,{handleSelectDate:e=>{p(e.format("YYYY-MM-DD")),g(!1)},date:x,selectedDates:[x],endDate:null,monthsToShow:1,isOneWay:!0})]})}),(0,A.jsx)("button",{type:"button",className:"btn-primary h-full text-lg py-4 px-8",onClick:()=>d(x),disabled:r,children:"Check Availability"})]}),r?(0,A.jsx)(D.Z,{}):(0,A.jsx)("div",{children:null!==n&&void 0!==n&&n.length&&"0.0"!==(null===(l=n[0])||void 0===l?void 0:l.capacity)?(0,A.jsxs)("div",{children:[n.map((e=>{var t,l;let{id:i,description:s,prices:n,capacity:o}=e;const r=null===n||void 0===n||null===(t=n.find((e=>"Z"===(null===e||void 0===e?void 0:e.priceList))))||void 0===t?void 0:t.value,d=+r,c=+(null===n||void 0===n||null===(l=n.find((e=>"Z9"===(null===e||void 0===e?void 0:e.priceList))))||void 0===l?void 0:l.value),u=(0,a.isNaN)(c)?"":"\xa3".concat((0,se.Z)(c)),m=(null===b||void 0===b?void 0:b[i])||0,v=!+o,x=Object.values(b).reduce(((e,t)=>e+t),0);return(0,A.jsxs)("div",{className:"block md:flex items-start justify-between border max-sm:py-4 py-6 mb-4 rounded ".concat(v?"opacity-60":""," ").concat(null!==b&&void 0!==b&&b[i]?"border-red":""),children:[(0,A.jsxs)("div",{className:"px-4",children:[(0,A.jsx)("div",{className:"flex items-center gap-1 font-body text-[10px] text-darker-grey font-bold uppercase mb-1",children:(0,A.jsxs)("div",{className:"flex items-center gap-1 uppercase",children:[(0,A.jsx)("img",{src:_.Z,alt:"calendar",className:"w-[24px] h-[24px]"}),v?"Sold Out":"Available"," "]})}),(0,A.jsx)("p",{className:"max-sm:col-span-3 max-sm:mb-3 font-heading text-3xl font-semibold leading-10",children:s})]}),(0,A.jsxs)("div",{className:"self-stretch flex justify-end md:justify-between gap-6 border-l py-2 px-6 md:w-[260px]",children:[(0,A.jsx)("div",{className:"flex flex-col items-end",children:(0,A.jsxs)("div",{className:"text-left",children:[!v&&u&&c>d&&(0,A.jsxs)("h6",{className:"text-[14px]",children:[(0,A.jsx)("span",{className:"text-red line-through text-[16px]",children:u})," ","gate price"]}),(0,A.jsx)("h2",{className:"leading-none text-left text-[30px]",children:v?"--":0===d?"Free":"\xa3".concat((0,se.Z)(d))}),(0,A.jsx)("h6",{className:"text-[14px]",children:"per ticket"})]})}),(0,A.jsxs)("div",{className:"flex md:justify-end justify-start items-center min-w-[100px]",children:[(0,A.jsx)("button",{type:"button",disabled:!m||v,className:"disabled:opacity-[.38]",onClick:()=>f({...b,[i]:m-1}),children:(0,A.jsx)("img",{src:ie,className:"w-8",alt:"Decrease"})}),(0,A.jsx)("p",{className:"font-heading text-black font-medium text-xl text-center px-2 w-[32px]",children:m}),(0,A.jsx)("button",{type:"button",disabled:v||x>7,className:"disabled:opacity-[.38]",onClick:()=>f({...b,[i]:m+1}),children:(0,A.jsx)("img",{src:le,className:"w-8",alt:"Increase"})})]})]})]},i)})),(0,A.jsxs)("div",{className:"flex items-end justify-end my-10",children:[(0,A.jsx)("p",{className:"font-heading text-black text-[28px] font-semibold leading-[28px] mr-6 mb-1",children:"Subtotal"}),(0,A.jsxs)("p",{className:"font-heading text-black max-sm:text-5xl text-[52px] font-semibold leading-[52px]",children:["\xa3",N.toFixed(2)]})]}),(0,A.jsx)("div",{className:"flex items-center justify-end",children:(0,A.jsxs)("label",{className:"flex",children:[(0,A.jsx)("input",{type:"checkbox",className:"appearance-none w-[21px] h-[21px] border border-dark-grey checked:bg-checkMark bg-no-repeat bg-center mr-[10px] mt-[6px] flex-shrink-0 checked:bg-[length:17px_17px]",checked:j,onChange:e=>y(e.target.checked)}),(0,A.jsxs)("p",{className:"text-text text-[15px] font-normal leading-9",children:["I have read and understand Red Funnel\u2019s"," ",(0,A.jsx)("a",{className:"underline text-[15px] font-normal leading-9 text-darker-blue",target:"_blank",rel:"noopener noreferrer",href:"".concat("https://www.redfunnel.co.uk","/policies-and-conditions"),children:"Terms & Conditions"})]})]})}),(0,A.jsx)("div",{className:"flex items-center justify-end mt-4 pb-14",children:(0,A.jsx)("button",{type:"button",className:"btn-primary h-full text-lg py-[16px]",disabled:!j||!(null!==(s=Object.values(b))&&void 0!==s&&s.some((e=>!!e))),onClick:()=>m({selections:b,date:x}),children:"Add to Booking"})})]}):(0,A.jsx)("div",{className:"border bg-red/[.06] py-7 mb-10 font-normal",children:(0,A.jsx)("p",{className:"text-center",children:"No Results for this time frame. Try different dates"})})})]})};ne.defaultProps={isLoading:!1};const ae=ne;const oe=l.p+"static/media/calendar-blue.853a45c7ac6b857b4c8288e640863bf1.svg";const re=l.p+"static/media/phone-blue.415a691a5ff04c3f4c5b7e34196d0e1c.svg";const de=l.p+"static/media/facebook.e1dbe04cb40312ced4cb4cb844f89014.svg";const ce=l.p+"static/media/instagram.8aff3ac4eb9b14f82d7d52ad5137a60e.svg";const ue=l.p+"static/media/x.49bc636703aae7d9f1a5ba8c54f7048c.svg",me=e=>{var t,l,i,n,a;let{attraction:o,basePath:d}=e;const c=null===o||void 0===o?void 0:o.name,u=(0,s.v9)(r.S),m=null===u||void 0===u?void 0:u.find((e=>(null===e||void 0===e?void 0:e.slug)===(null===o||void 0===o?void 0:o.slug))),x="".concat("https://www.redfunnel.co.uk").concat(d,"/").concat((0,T.Z)(c)),p=(null===o||void 0===o||null===(t=o.media)||void 0===t||null===(l=t.find((e=>"image"===e.type&&!!e.path)))||void 0===l?void 0:l.path)||"";let h="";try{var g,b,f,j,y,N,w;if(null!==m&&void 0!==m&&m.jsonLdSchema)h=JSON.stringify(m.jsonLdSchema);else h=JSON.stringify({"@context":"https://schema.org","@type":"Organization",additionalType:"LocalBusiness","@id":x,description:o.description||c,url:x,telephone:(null===o||void 0===o?void 0:o.phone)||"",address:{"@type":"PostalAddress",streetAddress:(null===o||void 0===o||null===(g=o.address)||void 0===g||null===(b=g.addressLine)||void 0===b?void 0:b[0])||"",addressLocality:(null===o||void 0===o||null===(f=o.address)||void 0===f?void 0:f.cityName)||"",addressRegion:(null===o||void 0===o||null===(j=o.address)||void 0===j?void 0:j.stateProv)||(null===o||void 0===o||null===(y=o.address)||void 0===y?void 0:y.region)||"",postalCode:(null===o||void 0===o||null===(N=o.address)||void 0===N?void 0:N.postalCode)||"",addressCountry:(null===o||void 0===o||null===(w=o.address)||void 0===w?void 0:w.countryName)||""},image:{"@type":"ImageObject",url:p}})}catch(C){}return(0,A.jsxs)(v.q,{encodeSpecialCharacters:!1,children:[(0,A.jsx)("link",{rel:"canonical",href:x}),(0,A.jsx)("meta",{name:"name",content:c}),(null===o||void 0===o||null===(i=o.metatags)||void 0===i?void 0:i.title)&&(0,A.jsx)("title",{children:o.metatags.title}),(0,A.jsx)("meta",{name:"robots",content:"max-image-preview:large"}),(null===o||void 0===o||null===(n=o.metatags)||void 0===n?void 0:n.description)&&(0,A.jsx)("meta",{name:"description",content:null===o||void 0===o||null===(a=o.metatags)||void 0===a?void 0:a.description}),(0,A.jsx)("script",{type:"application/ld+json",children:h})]})};var ve=l(7018);const xe={facebook:de,instagram:ce,twitter:ue},pe=e=>{var t,l,s,a,o,r;let{attractions:d,initialSearchDate:c,attractionsAreLoading:u,onViewAttractionType:m,handleSubmit:v,basePath:x}=e;const{attractionSlug:p}=(0,n.UO)(),h=d?null===d||void 0===d?void 0:d.find((e=>e.slug===p||(0,T.Z)(e.name)===p)):null,g=null===h||void 0===h?void 0:h.id,[b,f]=(0,i.useState)(!1),[j,y]=(0,i.useState)(c),[w,C]=(0,i.useState)({[c]:(null===h||void 0===h?void 0:h.resources)||[]}),k=(0,n.s0)();(0,i.useEffect)((()=>{h||u||k("/book/attractions")}),[h,u]);const P=null===w||void 0===w?void 0:w[j],D=null===h||void 0===h||null===(t=h.socialMediaLinks)||void 0===t?void 0:t.filter((e=>!!e.link));return h&&(0,A.jsxs)("div",{children:[(0,A.jsx)(me,{attraction:h,basePath:x}),(0,A.jsx)(ve.Z,{basePath:x||"/book/attractions",pageType:"attraction",locationTag:(null===h||void 0===h?void 0:h.location)||"",onViewType:e=>{k(x||"/book/attractions"),m(e)},typeTags:(null===h||void 0===h?void 0:h.type)||null,targetGroups:null,title:null===h||void 0===h?void 0:h.name,availabilityInfo:null,images:(null===h||void 0===h?void 0:h.media)||null,aboutContent:null===h||void 0===h?void 0:h.longDescription,infoSections:(null===h||void 0===h?void 0:h.ticketInfos)||null,infoSectionsIsLoading:!1,facilities:(null===h||void 0===h?void 0:h.amenities)||null,mapData:{destination:null===h||void 0===h||null===(l=h.directions)||void 0===l?void 0:l.destination,origin:null===h||void 0===h||null===(s=h.directions)||void 0===s?void 0:s.origin,text:null===h||void 0===h||null===(a=h.directions)||void 0===a?void 0:a.text,url:null===h||void 0===h||null===(o=h.directions)||void 0===o?void 0:o.url},socialLinks:(0,A.jsxs)("div",{className:"flex items-center",children:[(0,A.jsxs)("a",{"aria-label":"View Website",target:"_blank",rel:"noreferrer noopener",href:null===h||void 0===h?void 0:h.url,className:"text-xs xs:text-base flex text-darker-blue underline",children:[(0,A.jsx)("img",{alt:"",src:oe,className:"mr-1 xs:mr-2"}),"View Website"]}),D.length>0?(0,A.jsx)("span",{className:"mx-2 xs:mx-4 text-lighter-text",children:"\u2022"}):null,(0,A.jsx)("div",{className:"flex gap-3 items-center",children:null===D||void 0===D?void 0:D.map((e=>null!==h&&void 0!==h&&h.socialMediaLinks?(0,A.jsx)("a",{"aria-label":e.platform,target:"_blank",rel:"noreferrer noopener",href:e.link,children:(0,A.jsx)("img",{alt:xe[e.platform],src:xe[e.platform],className:"mr-2 last:mr-0"})},e.platform):null))}),(0,A.jsx)("span",{className:"mx-2 xs:mx-4 text-lighter-text",children:"\u2022"}),(0,A.jsxs)("a",{"aria-label":"Phone",target:"_blank",rel:"noreferrer noopener",href:"tel:".concat(null===h||void 0===h||null===(r=h.phone)||void 0===r?void 0:r.replaceAll(" ","")),className:"text-xs xs:text-base flex text-darker-blue underline",children:[(0,A.jsx)("img",{alt:"",src:re,className:"mr-1 xs:mr-2"}),null===h||void 0===h?void 0:h.phone]})]}),children:(0,A.jsxs)(A.Fragment,{children:[(0,A.jsxs)("div",{className:"py-5 border-b border-light-grey mb-5 target:scroll-mt-[136px] sm:target:scroll-mt-[160px] lg:target:scroll-mt-[167px]",children:[(0,A.jsxs)("div",{className:"flex max-md:flex-col md:justify-between items-center",children:[(0,A.jsx)("p",{className:"font-heading text-3xl font-semibold leading-10",children:"Availability"}),(0,A.jsx)("p",{className:"font-heading text-base font-normal text-lighter-text",children:h.operatingTimes})]}),!1===h.hasCapacity?(0,A.jsx)("div",{className:"border bg-red/[.06] py-7 font-normal mt-5",children:(0,A.jsx)("p",{className:"text-center",children:"Closed"})}):null]}),(0,A.jsx)(ae,{resources:P||[],isLoading:b,handleNewSearch:e=>{f(!0),N.Z.getAttractions({startDate:e}).then((t=>{var l;let{data:i}=t;const s=(null===i||void 0===i||null===(l=i.find((e=>e.id===g)))||void 0===l?void 0:l.resources)||[];C({...w,[e]:s}),y(e)})).catch((e=>e)).finally((()=>f(!1)))},initialDate:j,handleSubmit:e=>{let{selections:t,date:l}=e;return v({selections:t,date:l,attractionId:g})}})]})})]})},he=pe;pe.defaultProps={attractions:null,initialSearchDate:"",attractionsAreLoading:!1,handleSubmit:null};const ge=e=>{let{initialStartDate:t,handleSubmit:l,basePath:s}=e;const[{isLoading:o,attractions:r,isError:d},c]=(0,i.useState)({isLoading:!0,attractions:[],isError:!1}),m=(0,n.TH)(),v=m.pathname,x=null===v||void 0===v?void 0:v.includes("firework-cruise");(0,i.useLayoutEffect)((()=>{window.scrollTo(0,0)}),[m.pathname]);const[p,h]=(0,i.useState)(x?"2026-08-07":t||u().tz().format("YYYY-MM-DD")),[g,b]=(0,i.useState)(null),[f,j]=(0,i.useState)({date:p,textSearch:""}),w=(0,i.useCallback)((e=>{j({...f,types:[e]})}),[f]),C=e=>{c({isLoading:!0,attractions:r,isError:!1}),N.Z.getAttractions({startDate:e}).then((e=>{let{data:t}=e;const l=null===t||void 0===t?void 0:t.reduce(((e,t)=>{var l,i,s;return null===(l=t.type)||void 0===l||l.forEach((t=>
1e.types.push(t))),null===(i=t.amenities)||void 0===i||i.forEach((t=>e.facilities.push(t.name))),t.location&&e.locations.push(t.location),null===(s=t.targetGroups)||void 0===s||s.forEach((t=>e.targetGroups.push(t))),e}),{types:[],facilities:[],locations:[],targetGroups:[]});(0,a.forEach)(l,((e,t)=>{l[t]=(0,a.sortBy)((0,a.uniq)((0,a.filter)(e)))})),b(l),c({isLoading:!1,attractions:(null===t||void 0===t?void 0:t.sort(((e,t)=>e.priority<t.priority?-1:1)))||[],isError:!1})})).catch((()=>{c({isLoading:!1,attractions:r,isError:!0})}))};return(0,y.Z)((()=>C(p))),(0,A.jsx)("main",{children:(0,A.jsxs)(n.Z5,{children:[(0,A.jsx)(n.AW,{path:"/",element:(0,A.jsx)(te,{activeFilters:f,availableFilters:g,attractions:r,isError:d,isLoading:o,initialDate:p,onDateChange:e=>{j({...f,date:e}),C(e),h(e)},setActiveFilters:j,basePath:s})}),(0,A.jsx)(n.AW,{path:"/:attractionSlug",element:o?(0,A.jsx)("div",{children:(0,A.jsx)(D.Z,{})}):(0,A.jsx)(he,{attractionsAreLoading:o,attractions:r,initialSearchDate:p,onViewAttractionType:w,handleSubmit:l,basePath:s})})]})})};ge.defaultProps={initialStartDate:null};const be=ge;var fe=l(3931),je=l(6069),ye=l(7450),Ne=l(7377),we=l(2693);const Ce=e=>{let{type:t}=e;return(0,A.jsx)("div",{className:"flex justify-center border border-solid border-lighter-grey p-6 mb-10 print:hidden",children:(0,A.jsx)(w.rU,{className:"font-semibold text-2xl md:text-[28px] leading-[28px] font-heading text-blue uppercase",to:f.Z["".concat(t,"s")],children:"+ Add ".concat(t)})})};var ke=l(9110),Te=l(572),Ae=l(8435),Pe=l(6753),De=l(8245),Se=l(9518),Re=l(4835),Ee=l(590),Oe=l(6686);const Le=e=>{var t,l,i,a,o,d,c,m,v,x,p,h,g,b,j,y,C,k,T,P,D,S,R,E,O,L,Z,_,I,F,Y,M,W;let{cart:B,handleRemoveCrossings:V,handleContinue:H,handleRemoveAll:U,handleRemoveAccommodationItem:G,handleRemoveAttractionItem:z,continueText:q,handleClearCart:X,checkoutEligibilityError:J,hotelGuests:K}=e;const Q=(0,n.s0)(),{vehiclesData:$,vehicleOptions:ee}=(0,Ne.Z)(),te=(0,s.v9)(r.k1),le=(0,s.v9)(Se.nC),ie=(0,s.v9)(r.SZ),ne=null===B||void 0===B||null===(t=B.items)||void 0===t||null===(l=t.ferries)||void 0===l||null===(i=l[0])||void 0===i||null===(a=i.crossings)||void 0===a||null===(o=a[0])||void 0===o?void 0:o.routeCode,ae="customer"===le&&Re.LT.some((e=>e===ne)),oe=(null===B||void 0===B||null===(d=B.items)||void 0===d||null===(c=d.ferries)||void 0===c?void 0:c.filter((e=>{var t;return!(null===e||void 0===e||null===(t=e.crossings)||void 0===t||!t.length)})))||[],re=!(null===oe||void 0===oe||null===(m=oe[0])||void 0===m||null===(v=m.crossings)||void 0===v||!v.length),de=re&&1===(null===oe||void 0===oe||null===(x=oe[0])||void 0===x||null===(p=x.crossings)||void 0===p?void 0:p.length),ce=(null===B||void 0===B||null===(h=B.items)||void 0===h?void 0:h.hotels)||[],ue=(null===B||void 0===B||null===(g=B.items)||void 0===g?void 0:g.attractions)||[],me=null===B||void 0===B||null===(b=B.costTotals)||void 0===b?void 0:b.amountAfterTax,ve=null===B||void 0===B||null===(j=B.costTotals)||void 0===j?void 0:j.amountBeforeTax,xe=(null===oe||void 0===oe||null===(y=oe[0])||void 0===y||null===(C=y.crossings)||void 0===C||null===(k=C[0])||void 0===k||null===(T=k.vehiclePriceLines)||void 0===T||null===(P=T[0])||void 0===P?void 0:P.resourceCode)||"",pe=we.t2.includes(xe),he=null===B||void 0===B?void 0:B.customerInfos,ge=null!==oe&&void 0!==oe&&null!==(D=oe[0])&&void 0!==D&&D.startDate?u()(null===oe||void 0===oe||null===(S=oe[0])||void 0===S?void 0:S.startDate).tz().format("YYYY-MM-DD"):u().tz().format("YYYY-MM-DD"),be=null!==oe&&void 0!==oe&&null!==(R=oe[0])&&void 0!==R&&R.endDate?u()(null===oe||void 0===oe||null===(E=oe[0])||void 0===E?void 0:E.endDate).tz().format("YYYY-MM-DD"):u()().add(2,"day").tz().format("YYYY-MM-DD"),Le=re&&u()(ge).isSame(u()(be),"day")&&!de,Ze=(null===oe||void 0===oe||null===(O=oe[0])||void 0===O||null===(L=O.crossings)||void 0===L||null===(Z=L[0])||void 0===Z?void 0:Z.guestCount)||1,_e=null===B||void 0===B||null===(_=B.items)||void 0===_||null===(I=_.ferries)||void 0===I||null===(F=I[0])||void 0===F?void 0:F.fees,Ie=null===te||void 0===te||null===(Y=te.ferry)||void 0===Y||null===(M=Y.options)||void 0===M||null===(W=M.cargoResourceCodes)||void 0===W?void 0:W.includes(xe);return(0,A.jsxs)("div",{children:[(0,A.jsx)(fe.Z,{title:"Your Booking",totalCost:me,subTotalCost:ve,hasVat:pe}),null!==oe&&void 0!==oe&&oe.length?(0,A.jsx)("div",{children:null===oe||void 0===oe?void 0:oe.map((e=>{const{rph:t,crossings:l}=e;return(0,A.jsxs)("div",{children:[(0,A.jsxs)("div",{className:"flex max-xs:flex-col justify-between xs:items-center my-6 my-5 sm:mt-8 lg:mt-12 sm:mb-8",children:[(0,A.jsx)("h1",{className:"text-3xl sm:text-5xl lg:text-[56px] whitespace-nowrap font-semibold uppercase max-xs:mb-6 mr-8",children:"Ferry Travel"}),(0,A.jsxs)("div",{className:"print:hidden",children:[(0,A.jsx)("button",{type:"button",onClick:()=>{Q(f.Z.departureCrossing)},className:"btn-primary text-base px-8 py-[10px] lg:py-3",children:"Amend"}),(0,A.jsx)("button",{type:"button",onClick:V,className:"btn-primary text-base px-8 py-[10px] lg:py-3 ml-6 bg-black",children:"Remove"})]})]}),null!==l&&void 0!==l&&l.length?l.map(((e,t)=>{var l,i,s,n,a,o,r,d;const c=0===t?"Outward":"Return",u=(null===e||void 0===e||null===(l=e.vehicles)||void 0===l?void 0:l.length)&&e.vehicles[0].resourceCode,m=(0,we.zj)(ee,u,$),v=(null===m||void 0===m||null===(i=m.icon)||void 0===i?void 0:i.title)||(null===e||void 0===e||null===(s=e.vehiclePriceLines)||void 0===s||null===(n=s[0])||void 0===n?void 0:n.description),x=(0,ke.Z)((0,Te.Z)(e,he)),p=(0,Ae.Z)(x),h=(0,Pe.Z)(null===e||void 0===e?void 0:e.addOns);return(0,A.jsx)("div",{children:(0,A.jsx)(De.Z,{tripType:c,passengerString:p,vehicleDescription:v,displayPrice:pe&&null!==e&&void 0!==e&&null!==(a=e.priceData)&&void 0!==a&&a.subTotal?"\xa3".concat((0,se.Z)(null===e||void 0===e||null===(o=e.priceData)||void 0===o?void 0:o.subTotal)):null!==e&&void 0!==e&&null!==(r=e.priceData)&&void 0!==r&&r.total?"\xa3".concat((0,se.Z)(null===e||void 0===e||null===(d=e.priceData)||void 0===d?void 0:d.total)):null,departureDate:e.departureDate,departureTime:e.departureTime,arrivalDate:e.arrivalDate,arrivalTime:e.arrivalTime,shipName:e.shipName,renderBanner:null,routeDescription:e.routeDescription,addOns:h,hasVat:pe})},null===e||void 0===e?void 0:e.routeCode)})):null,null!==_e&&void 0!==_e&&_e.length?(0,A.jsx)("div",{children:_e.map((e=>(0,A.jsxs)("div",{className:"flex flex-wrap gap-4 items-end justify-end text-lg font-heading font-bold",children:[(0,A.jsx)("p",{className:"",children:e.description}),(0,A.jsxs)("p",{className:"text-2xl text-black",children:["\xa3",(0,se.Z)(e.price)]})]},e.resourceCode)))}):null]},t)}))}):(0,A.jsxs)("div",{className:"flex justify-between items-center mt-10 pb-5 lg:pb-10 print:hidden",children:[(0,A.jsx)("h1",{className:"text-3xl md:text-[56px] whitespace-nowrap font-semibold leading-[70px] uppercase",children:"Ferry Travel"}),(0,A.jsx)(w.rU,{to:f.Z.ferryBookingRoute,className:"ml-auto font-semibold text-2xl md:text-[28px] leading-[28px] font-heading text-blue uppercase",children:"+ Add Ferry Travel"})]}),(0,A.jsxs)("div",{className:"mt-14",children:[null!==ce&&void 0!==ce&&ce.length?(0,A.jsxs)(A.Fragment,{children:[(0,A.jsxs)("div",{className:"flex max-xs:flex-col xs:items-center justify-between mb-10",children:[(0,A.jsx)("h1",{className:"text-3xl md:text-[56px] whitespace-nowrap font-semibold leading-[70px] uppercase mr-8",children:"Accommodation"}),(0,A.jsxs)("div",{className:"print:hidden",children:[(0,A.jsx)("button",{type:"button",onClick:()=>{Q(f.Z.accommodations,{state:{clearSelectionsOnSubmit:!0}})},className:"btn-primary text-base px-8 py-[10px] lg:py-3",children:"Amend"}),(0,A.jsx)("button",{type:"button",onClick:()=>U("accommodations"),className:"btn-primary text-base px-8 py-[10px] lg:py-3 ml-6 bg-black",children:"".concat(ce.length>1?"Remove All":"Remove")})]})]}),(0,A.jsxs)(A.Fragment,{children:[ce.map((e=>{const t={hotelCode:null===e||void 0===e?void 0:e.hotelCode,resourceCode:null===e||void 0===e?void 0:e.resourceCode,startDate:null===e||void 0===e?void 0:e.startDate,endD
1ate:null===e||void 0===e?void 0:e.endDate,roomName:null===e||void 0===e?void 0:e.roomName,id:null===e||void 0===e?void 0:e.id,guests:{adults:e.adults,children:e.children}};return(0,A.jsx)(je.Z,{startDate:null===e||void 0===e?void 0:e.startDate,hotelName:null===e||void 0===e?void 0:e.hotelName,roomName:null===e||void 0===e?void 0:e.roomName,roomAmount:null===e||void 0===e?void 0:e.numberOfUnits,price:null===e||void 0===e?void 0:e.price,length:null===ce||void 0===ce?void 0:ce.length,handleRemoveAccommodationItem:G,accommodationItem:t},"".concat(null===e||void 0===e?void 0:e.resourceCode,"-").concat(null===e||void 0===e?void 0:e.key))})),(0,A.jsx)(Ce,{type:"accommodation"})]})]}):null,ue.length>0?(0,A.jsxs)(A.Fragment,{children:[(0,A.jsxs)("div",{className:"flex max-xs:flex-col xs:items-center justify-between mb-10 ".concat(ae||ue.length?"":"hidden"),children:[(0,A.jsx)("h1",{className:"text-3xl md:text-[56px] whitespace-nowrap font-semibold leading-[70px] uppercase mr-8",children:"Attractions"}),(0,A.jsxs)("div",{className:"print:hidden",children:[(0,A.jsx)("button",{type:"button",onClick:()=>{Q(f.Z.attractions)},className:"btn-primary text-base px-8 py-[10px] lg:py-3",children:"Amend"}),(0,A.jsx)("button",{type:"button",onClick:()=>U("attractions"),className:"btn-primary text-base px-8 py-[10px] lg:py-3 ml-6 bg-black",children:"".concat(ue.length>1?"Remove All":"Remove")})]})]}),(0,A.jsxs)(A.Fragment,{children:[ue.map((e=>(0,A.jsx)(ye.Z,{attraction:e,length:ue.length,handleRemoveAttractionItem:z,price:null===e||void 0===e?void 0:e.price},"".concat(e.resourceCode)))),(0,A.jsx)(Ce,{type:"attraction"})]})]}):null,!(null!==ce&&void 0!==ce&&ce.length)&&ae&&!Le&&!Ie&&!ie&&(0,A.jsxs)("div",{className:"print:hidden",children:[(0,A.jsxs)("div",{className:"flex max-xs:flex-col xs:items-center justify-between mb-10",children:[(0,A.jsx)("h1",{className:"text-3xl md:text-[56px] whitespace-nowrap font-semibold leading-[70px] uppercase mr-8",children:"Accommodation"}),(0,A.jsx)(w.rU,{className:"xs:ml-auto font-semibold text-2xl md:text-[28px] leading-[28px] font-heading text-blue uppercase",to:f.Z.accommodations,children:"+ Add Accommodation"})]}),(0,A.jsx)(Ee.Z,{type:"accommodations",handleFetch:()=>N.Z.getAccommodations({startDate:ge,endDate:u()(be).isSame(ge,"day")?u()(ge).add(1,"days").format("YYYY-MM-DD"):be,adults:(null===K||void 0===K?void 0:K.adults)||Ze||1,children:(null===K||void 0===K?void 0:K.children)||0}).then((e=>{let{data:t}=e;return(null===t||void 0===t?void 0:t.sort(((e,t)=>e.priority<t.priority?-1:1)))||[]})),handleSelectItem:e=>{Q("/book/accommodation/".concat(e.urlSlug))}})]}),!(null!==ue&&void 0!==ue&&ue.length)&&ae&&!Ie&&(0,A.jsxs)("div",{className:" print:hidden",children:[(0,A.jsxs)("div",{className:"flex max-xs:flex-col xs:items-center justify-between mb-10 ".concat(ae||ue.length?"":"hidden"," "),children:[(0,A.jsx)("h1",{className:"text-3xl md:text-[56px] whitespace-nowrap font-semibold leading-[70px] uppercase mr-8",children:"Attractions"}),(0,A.jsx)(w.rU,{className:"xs:ml-auto font-semibold text-2xl md:text-[28px] leading-[28px] font-heading text-blue uppercase",to:f.Z.attractions,children:"+ Add Attraction"})]}),(0,A.jsx)(Ee.Z,{type:"attractions",handleFetch:()=>N.Z.getAttractions({startDate:ge}).then((e=>{let{data:t}=e;return(null===t||void 0===t?void 0:t.sort(((e,t)=>e.priority<t.priority?-1:1)))||[]})),handleSelectItem:e=>{Q("/book/attractions/".concat(e.urlSlug))}})]}),J&&(0,A.jsx)(Oe.Z,{className:"border border-[#E0E0E0] bg-red bg-opacity-[.04] text-gray5 mb-8",children:(0,A.jsx)("p",{children:J})}),(0,A.jsxs)("div",{className:"w-full flex justify-between flex-col-reverse gap-4 md:flex-row print:hidden",children:[X&&(0,A.jsx)("button",{type:"button",onClick:X,className:"btn btn-inverted text-[14px] md:text-lg px-20 py-[12px] md:py-5 rounded-sm",children:"Clear Cart & Start New Search"}),(0,A.jsx)("button",{type:"button",className:"btn-primary text-[14px] md:text-lg px-20 py-[12px] md:py-5 rounded-sm",onClick:H,disabled:!!J,children:q})]})]})]})};Le.defaultProps={handleClearCart:null,checkoutEligibilityError:"",cart:null,hotelGuests:null};const Ze=Le;var _e,Ie,Fe=l(8281),Ye=l(4808),Me=l(4769),We=l(9359),Be=l(7051),Ve=l(1724),He=l(2506),Ue=l(8843);function Ge(){return Ge=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var l=arguments[t];for(var i in l)Object.prototype.hasOwnProperty.call(l,i)&&(e[i]=l[i])}return e},Ge.apply(this,arguments)}function ze(e,t){let{title:l,titleId:s,...n}=e;return i.createElement("svg",Ge({width:25,height:25,viewBox:"0 0 25 25",fill:"none",xmlns:"http://www.w3.org/2000/svg",ref:t,"aria-labelledby":s},n),l?i.createElement("title",{id:s},l):null,_e||(_e=i.createElement("path",{d:"M12.4755 12.9899C15.9057 12.9899 18.7098 10.1872 18.7098 6.75865C18.7098 3.33005 15.9057 0.527344 12.4755 0.527344C9.04523 0.527344 6.24121 3.33005 6.24121 6.75865C6.24121 10.1872 9.04528 12.9899 12.4755 12.9899Z",fill:"black"})),Ie||(Ie=i.createElement("path",{d:"M23.1749 17.9713C23.0116 17.5632 22.7938 17.1822 22.5488 16.8285C21.2965 14.9781 19.3636 13.7536 17.1857 13.4543C16.9135 13.4271 16.614 13.4815 16.3962 13.6448C15.2528 14.4883 13.8916 14.9237 12.4759 14.9237C11.0602 14.9237 9.69902 14.4883 8.5556 13.6448C8.33779 13.4815 8.03832 13.3999 7.76611 13.4543C5.58818 13.7536 3.62806 14.9781 2.40298 16.8285C2.15797 17.1822 1.94016 17.5904 1.77685 17.9713C1.69519 18.1346 1.72239 18.3251 1.80405 18.4884C2.02186 18.8693 2.29408
119.2503 2.53909 19.5768C2.92022 20.0938 3.32859 20.5564 3.79142 20.9917C4.17254 21.3727 4.60812 21.7264 5.04374 22.0802C7.19442 23.6857 9.78073 24.5291 12.4487 24.5291C15.1166 24.5291 17.703 23.6856 19.8536 22.0802C20.2892 21.7537 20.7248 21.3727 21.106 20.9917C21.5415 20.5564 21.9771 20.0938 22.3583 19.5768C22.6305 19.223 22.8756 18.8693 23.0933 18.4884C23.2294 18.3251 23.2566 18.1346 23.1749 17.9713Z",fill:"black"})))}const qe=i.forwardRef(ze),Xe=(l.p,e=>{var t,l;let{onSubmit:i,initialValues:n,hidePromoField:a=!1,navigateToLogin:o=null}=e;const c=(0,s.v9)(r.N2),m=(0,s.v9)(r.BC),v=(0,s.v9)(Se.dy),x=n||{departureRouteCode:d.RE||(null===m||void 0===m||null===(t=m[0])||void 0===t?void 0:t.code)||"",returnRouteCode:d.yb||(null===m||void 0===m||null===(l=m[1])||void 0===l?void 0:l.code)||"",isOneWay:!1,promoCode:"",departureDate:u()().tz().format("YYYY-MM-DD"),returnDate:u()().tz().add(1,"days").format("YYYY-MM-DD")},p=Ve.Ry({departureRouteCode:Ve.Z_().required(),returnRouteCode:Ve.Z_().when("isOneWay",{is:!1,then:e=>e.required(),otherwise:e=>e}),departureDate:Ve.Z_().required(),returnDate:Ve.Z_().when("isOneWay",{is:!1,then:e=>e.required(),otherwise:e=>e})});return(0,A.jsxs)("div",{children:[(0,A.jsx)("h1",{className:"text-center text-3xl md:text-5xl font-bold py-10",children:c.route||"Route"}),!v&&o&&(0,A.jsx)("div",{className:"'block md:hidden max-w-[598px] mx-auto bg-white border mb-2",children:(0,A.jsxs)("div",{className:"flex justify-center items-center py-4 px-6",children:[(0,A.jsx)("div",{className:"w-[24px] mr-3",children:(0,A.jsx)(qe,{})}),(0,A.jsxs)("p",{className:"text-sm font-normal",children:[(0,A.jsxs)("button",{onClick:o,className:"text-red p-0",type:"button",children:["Login"," "]})," ","to an existing account for a faster checkout"]})]})}),(null===m||void 0===m?void 0:m.length)>0&&(0,A.jsx)("div",{className:"max-w-[598px] mx-auto bg-white border py-4 md:py-12 px-3 md:px-15",children:(0,A.jsx)(He.J9,{onSubmit:i,initialValues:x,validationSchema:p,children:e=>{var t;let{values:l,setFieldValue:i,setValues:s,handleSubmit:n,errors:o}=e;return(0,A.jsxs)("form",{onSubmit:n,children:[(0,A.jsxs)("div",{className:" my-4 flex gap-y-2 flex-col md:flex-row relative",children:[(0,A.jsxs)("div",{className:"flex flex-grow flex-shrink-0 w-3/6-[8px] flex-col py-2 md:py-3 pr-[2px] pl-4 border border-solid border-light-grey rounded-sm",children:[(0,A.jsx)("p",{className:"text-[11px] md:text-xs font-body text-gray5",children:"Outward Route"}),(0,A.jsx)("select",{className:"font-heading text-[17px] md:text-xl text-black font-medium appearance-none bg-white","aria-label":"Outward Route",onChange:e=>{var t;const i=null===(t=m.find((t=>t.startPort===e.target.value.substring(2)&&t.endPort===e.target.value.substring(0,2))))||void 0===t?void 0:t.code;s({...l,departureRouteCode:e.target.value,returnRouteCode:i})},value:l.departureRouteCode,children:m.map((e=>(0,A.jsx)("option",{value:e.code,children:e.description},e.code)))})]}),!l.isOneWay&&(0,A.jsxs)("div",{className:"flex flex-grow flex-shrink-0 w-3/6-[8px] flex-col py-2 md:py-3 pr-[2px] pl-4 border border-solid border-light-grey md:border-l-0 rounded-sm",children:[(0,A.jsx)("p",{className:"text-[11px] md:text-xs font-body text-gray5",children:"Return Route"}),(0,A.jsxs)("select",{className:"font-heading text-[17px] md:text-xl text-black font-medium appearance-none bg-white","aria-label":"Return Route",onChange:e=>{s({...l,returnRouteCode:e.target.value})},value:l.returnRouteCode,children:[(0,A.jsx)("option",{value:"",children:"Select Route"}),m.map((e=>(0,A.jsx)("option",{value:e.code,disabled:l.departureRouteCode===e.code,children:e.description},e.code)))]})]})]}),(0,A.jsx)("div",{children:(0,A.jsxs)("label",{className:"flex items-center",children:[(0,A.jsx)("input",{type:"checkbox",className:"appearance-none w-[18px] h-[18px] border border-darker-grey checked:bg-checkMark checked:bg-[length:14px_14px] bg-no-repeat bg-center mr-2 flex-shrink-0",defaultChecked:l.isOneWay,onChange:e=>{s({...l,isOneWay:e.target.checked})}}),(0,A.jsx)("p",{className:"text-[17px] md:text-[21px] uppercase text-gray5 font-heading font-medium",children:"Single"})]})}),(0,A.jsx)("div",{className:"py-4",children:(0,A.jsx)(Ue.Z,{className:"",dateWrapperClassName:"border-light-grey",dateClassName:"text-lg",labelClassName:"text-xs font-body text-gray-500",startDate:l.departureDate,endD
1ate:l.returnDate,handleSelectDate:(e,t)=>{const i={...l};"startDate"===e?(i.departureDate=t,i.returnDate=""):"endDate"===e&&(i.returnDate=t),s({...i})},isOneWay:l.isOneWay})}),a?null:(0,A.jsx)("div",{className:"border border-solid border-light-grey rounded-[2px] py-3 px-4 mb-4 md:mb-8",children:(0,A.jsxs)("label",{children:[(0,A.jsx)("p",{className:"font-body text-[11px] text-gray5 font-normal",children:"Promo Code"}),(0,A.jsx)("input",{type:"text",className:"font-heading text-black text-lg font-medium w-full",onChange:e=>i("promoCode",e.target.value),value:l.promoCode,placeholder:"Enter Code"})]})}),(0,A.jsx)("button",{className:"btn-primary text-base md:text-lg tracking-wider w-full py-[14px] md:p-6",type:"submit",disabled:!(null===(t=Object.keys(o))||void 0===t||!t.length),children:"SOWC"===l.departureRouteCode||"WCSO"===l.departureRouteCode?"Continue to Passenger Information":c.continueToVehicleInformationBtn||"Search"})]})}})})]})}),Je=Xe;Xe.defaultProps={hidePromoField:!1,navigateToLogin:null};var Ke=l(5491),Qe=l(9796),$e=l(1359),et=l(1133);const tt=e=>{let{title:t,passengerString:l,vehicleDescription:i,trailerText:s,ports:n,editLink:a,departureDate:o,departureTime:r,arrivalTime:d,rateTile:c,addOns:m,shipName:v,totalCost:x,standardCost:p,isLowestFare:h,showEditWithTitle:g,hasVAT:b}=e;return(0,A.jsxs)("div",{className:"grid grid-cols-[1fr_auto] mb-10 ",children:[(0,A.jsxs)("div",{className:"flex items-center col-start-1 col-span-2 md:col-span-1",children:[(0,A.jsx)("h2",{className:"font-semibold text-3xl leading-10 text-black mr-5",children:t}),g&&(0,A.jsx)(w.rU,{to:a,className:"text-red font-heading uppercase leading-4 font-semibold ml-4",children:"Edit"}),l&&(0,A.jsx)("p",{className:"font-heading font-semibold text-[18px] leading-10 capitalize",children:l}),i&&(0,A.jsxs)("p",{className:"font-heading font-semibold text-[18px] leading-10",children:[(0,A.jsxs)("span",{className:"max-md:hidden",children:["\xa0"," \u2013 "," \xa0"]}),i,s||null]})]}),(0,A.jsxs)("div",{className:"flex items-center col-start-1 col-span-2 md:col-start-2 md:col-span-1",children:[(null===n||void 0===n?void 0:n.length)>0?(0,A.jsx)("div",{className:"flex items-center text-lg font-heading text-black font-semibold",children:null===n||void 0===n?void 0:n.map(((e,t)=>0===t?(0,A.jsxs)("div",{className:"flex items-center",children:[(0,A.jsx)("p",{children:e}),(0,A.jsx)("img",{src:et,alt:"Arrow Icon",className:"mx-3"})]},e):(0,A.jsx)("p",{children:e},e)))}):null,!g&&(0,A.jsx)(w.rU,{className:"font-heading font-semibold text-xl leading-5 text-red uppercase ml-6",to:a,children:"Edit"})]}),(0,A.jsx)("div",{className:"col-start-2 col-span-1 border-l border-r border-t",children:(0,A.jsx)("p",{className:"hidden md:block font-heading font-bold uppercase text-base text-center",children:c})}),(0,A.jsx)("div",{className:"col-start-1 col-span-2 md:col-span-1 border md:border-r-0",children:(0,A.jsxs)("div",{className:"flex md:flex-row flex-wrap items-center justify-between p-2 md:p-6 ",children:[(0,A.jsxs)("div",{className:"flex flex-col",children:[(0,A.jsxs)("div",{className:"flex font-heading md:text-2xl ",children:[(0,A.jsx)("p",{className:"hidden lg:block font-heading font-semibold leading-10 text-black mr-2",children:"Depart"}),(0,A.jsxs)("p",{className:"font-heading font-semibold leading-10 text-black",children:[u()(o).format("ddd DD MMM YYYY"),"\xa0 "," \xb7 "," \xa0"]}),(0,A.jsxs)("div",{className:"inline-flex items-center",children:[(0,A.jsx)("p",{className:"font-heading font-semibold leading-10 ",children:u()(r).locale("en").format("HH:mm")}),(0,A.jsx)("img",{src:et,alt:"Arrow Icon",className:"mx-2"}),(0,A.jsx)("p",{className:"font-heading font-semibold leading-10 ",children:u()(d).locale("en").format("HH:mm")})]})]}),m&&(0,A.jsx)("h6",{className:"text-text text-lg",dangerouslySetInnerHTML:{__html:m}})]}),v&&(0,A.jsxs)("div",{className:"flex items-center",children:[(0,A.jsx)(J.r,{className:"text-black mr-3 w-4 lg:w-6"}),(0,A.jsx)("p",{className:"font-normal text-xs md:text-sm md:leading-[18px] text-lighter-text mr-2",children:v})]})]})}),(0,A.jsxs)("div",{className:"border col-start-1 col-span-2 md:col-start-2 md:col-span-1 \n flex flex-row flex-wrap max-md:gap-2 md:flex-col max-md:p-2 max-md:items-center ".concat(h?"border-t-0":""),children:[(0,A.jsx)("div",{className:"md:hidden",children:(0,A.jsx)("p",{className:"font-heading font-bold uppercase text-sm xs:text-base text-center",children:c})}),h&&(0,A.jsx)("div",{className:"bg-darker-green text-xs text-white text-center py-1 max-md:px-2",children:(0,A.jsx)("p",{children:"Lowest Fare"})}),(0,A.jsxs)("div",{className:"md:flex-1 flex flex-col items-end md:items-center justify-center ml-auto md:ml-0",children:[p&&+p>+(null!==x&&void 0!==x?x:0)?(0,A.jsxs)("span",{className:"line-through text-text opacity-80 font-heading font-semibold text-xs xs:max-md:text-sm md:text-[18px]",children:["\xa3 ",(0,se.Z)(p)]}):null,(0,A.jsxs)("p",{className:"font-heading font-semibold text-sm xs:max-md:text-base md:text-3xl text-center text-black",children:["\xa3 ",(0,se.Z)(x),b&&(0,A.jsxs)("span",{className:"font-heading font-semibold text-sm xs:max-md:text-base md:text-3xl lg:leading-[52px] text-black",children:[" ","+VAT"]})]})]})]})]})};tt.defaultProps={passengerString:null,ports:[],shipName:null,standardCost:null,isLowestFare:!1,showEditWithTitle:!1,addOns:"",vehicleDescription:"",trailerText:"",hasVAT:!1};const lt=tt;var it=l(8679);function st(e){var t,l,i,s,n,a,o,r,d,c,u,m,v,x,p,h,g,b,f;let{departureRouteData:j,baseRoute:y,passengers:N}=e;const w=null===j||void 0===j||null===(t=j.crossing)||void 0===t||null===(l=t.description)||void 0===l?void 0:l.split(" to "),C=null===j||void 0===j||null===(i=j.crossing)||void 0===i?void 0:i.departureDate,k=null===j||void 0===j||null===(s=j.crossing)||void 0===s?void 0:s.departureDateTime,T=null===j||void 0===j||null===(n=j.crossing)||void 0===n?void 0:n.arrivalDateTime,P=null===j||void 0===j||null===(a=j.crossing)||void 0===a||null===(o=a.ship)||void 0===o?void 0:o.label,D=null===j||void 0===j||null===(r=j.rate)||void 0===r?void 0:r.title,S=null===j||void 0===j||null===(d=j.rate)||void 0===d?void 0:d.isLowestFare,R=null===j||void 0===j||null===(c=j.rate)||void 0===c?void 0:c.code,E=null===j||void 0===j||null===(u=j.crossing)||void 0===u?void 0:u.pricing,O=null===E||void 0===E?void 0:E.find((e=>{let{code:t}=e;return t===R})),L=null===O||void 0===O||null===(m=O.bestRate)||void 0===m?void 0:m.totalPrice,Z=null===j||void 0===j||null===(v=j.crossing)||void 0===v||null===(x=v.pricing)||void 0===x||null===(p=x[0])||void 0===p||null===(h=p.resources)||void 0===h||null===(g=h[0])||void 0===g?void 0:g.resourceCode,_=null===we.t2||void 0===we.t2?void 0:we.t2.includes(Z),I=(null===j||void 0===j||null===(b=j.crossing)||void 0===b||null===(f=b.addOns)||void 0===f?void 0:f.reduce(((e,t)=>{var l;const i=null===j||void 0===j||null===(l=j.addOns)||void 0===l?void 0:l.find((e=>{let{resourceCode:l}=e;return t.resourceCode===l}));if(i){const l=(0,it.Z)({passengers:N,addOn:t});e.push({...t,...i,countsFor:l,totalPrice:+t.price*l})}return e}),[]))||[],F=I.reduce(((e,t)=>e+(t.totalPrice?t.totalPrice:0)),0)||0;return(0,A.jsx)("div",{className:"py-4 lg:pt-10 lg:pb-0",children:(0,A.jsx)(lt,{title:"Outward Sailing",ports:w||[],editLink:"".concat(y,"/crossings/departure"),departureDate:C,departureTime:k,arrivalTime:T,rateTile:D,addOns:I.map((e=>{let{description:t}=e;return t})).join(" \xb7 "),shipName:P,totalCost:L?+L+F:void 0,isLowestFare:S,showEditWithTitle:!0,hasVAT:_})})}const nt=e=>{var t,l,i,a,o,d,c,v,x,p,h,g,b,f,j,N,w;let{handleSelectCrossing:C,clearCrossingSelections:k,currentSelections:T,fetchCrossings:P,availabilityData:S,baseRoute:R="/book",userSelections:E}=e;const{direction:O}=(0,n.UO)(),L=(0,n.s0)(),Z=(0,n.TH)(),_=m.parse(Z.search),I=(0,s.v9)(r.BC),F=null===E||void 0===E||null===(t=E.routes)||void 0===t?void 0:t.departureRouteCode,Y=null===E||void 0===E||null===(l=E.routes)||void 0===l?void 0:l.returnRouteCode,M=null===I||void 0===I?void 0:I.find((e=>(null===e||void 0===e?void 0:e.code)===F)),W=null===I||void 0===I?void 0:I.find((e=>(null===e||void 0===e?void 0:e.code)===Y)),B=null===M||void 0===M||null===(i=M.description)||void 0===i?void 0:i.split(" to "),V=null===W||void 0===W||null===(a=W.description)||void 0===a?void 0:a.split(" to ");(0,y.Z)((()=>(null!==_&&void 0!==_&&_.showVehicleSelection||P(),"departure"===O&&k(),"return"!==O||null!==T&&void 0!==T&&T.departure?L(Z.pathname,{replace:!0}):(k(),L("".concat(R,"/crossings/departure"))))));const H=e=>{let{crossing:t,rate:l,addOns:i}=e;C(O,{crossing:t,rate:l,addOns:i})},U=e=>{if(!e)return null;let t=null;return Object.keys(e).forEach((l=>{t=!t||e[l]<t?e[l]:t})),t},G=U(null===S||void 0===S||null===(o=S.data)||void 0===o?void 0:o.bestOutwardRates),z=U(null===S||void 0===S||null===(d=S.data)||void 0===d?void 0:d.bestReturn
1Rates),q=null!==E&&void 0!==E&&null!==(c=E.routes)&&void 0!==c&&c.departureDate&&u()(null===E||void 0===E||null===(v=E.routes)||void 0===v?void 0:v.departureDate).isSame(u()(),"day")?u().tz().format("YYYY-MM-DD HH:mm"):null,X=(null===E||void 0===E||null===(x=E.routes)||void 0===x?void 0:x.departureDate)===(null===E||void 0===E||null===(p=E.routes)||void 0===p?void 0:p.returnDate)&&null!==T&&void 0!==T&&null!==(h=T.departure)&&void 0!==h&&null!==(g=h.crossing)&&void 0!==g&&g.arrivalDateTime?u()(T.departure.crossing.arrivalDateTime).format():null,J=!(null!==E&&void 0!==E&&E.vehicle);return(0,A.jsx)("div",{className:"w-full max-w-5xl mx-auto mb-24",children:null!==S&&void 0!==S&&S.isLoading?(0,A.jsx)("div",{className:"text-center w-full pt-8",children:(0,A.jsx)(D.Z,{})}):(0,A.jsxs)(A.Fragment,{children:[(null===S||void 0===S?void 0:S.error)&&(0,A.jsx)(Oe.Z,{className:"bg-red bg-opacity-[.04]",children:(0,A.jsx)("p",{className:"text-center text-text",children:null===S||void 0===S?void 0:S.error})}),"departure"===O?(0,A.jsx)($e.Z,{crossings:(null===S||void 0===S||null===(b=S.data)||void 0===b?void 0:b.outwardDepartures)||[],listTitle:"Outward Sailings",noAvailabilityMessage:"No sailings available on your selected departure date",handleSelectRate:H,lowestRate:G,minTime:q,isWalkOn:J,ports:B}):(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(st,{departureRouteData:null===T||void 0===T?void 0:T.departure,baseRoute:R,passengers:null===E||void 0===E||null===(f=E.passengers)||void 0===f?void 0:f.departure}),(0,A.jsx)($e.Z,{crossings:(null===S||void 0===S||null===(j=S.data)||void 0===j?void 0:j.returnDepartures)||[],listTitle:"Return Sailings",noAvailabilityMessage:"No sailings available on your selected return date",handleSelectRate:H,lowestRate:z,minTime:X,isWalkOn:J,limitToRateCode:(null===T||void 0===T||null===(N=T.departure)||void 0===N||null===(w=N.rate)||void 0===w?void 0:w.code)||null,ports:V})]})]})})};nt.defaultProps={availabilityData:{data:{}},currentSelections:{departure:{crossing:{ship:""}}}};const at=nt;function ot(e){var t,l,i,s,n,o;let{crossingTotals:r,shipName:d,title:c,departureDate:u,departureTime:m,arrivalTime:v,routeData:x,editLink:p,addOns:h,hasVAT:g}=e;const b=null===r||void 0===r||null===(t=r.selectedRate)||void 0===t?void 0:t.isLowestFare,f=x.description.split(" to "),j=(null===r||void 0===r?void 0:r.grandTotal)||(null===r||void 0===r||null===(l=r.selectedRate)||void 0===l?void 0:l.totalPrice),y=null===r||void 0===r||null===(i=r.selectedRate)||void 0===i?void 0:i.totalPrice,N=null===r||void 0===r||null===(s=r.selectedRate)||void 0===s?void 0:s.standardPrice,w=N&&y&&+N>+y?+N-+y+ +j:null,C=Object.entries(null===r||void 0===r?void 0:r.passengers).map((e=>{let[t,l]=e;return[t,l.count]})).reduce(((e,t,l,i)=>{let s=(0,a.cloneDeep)(e);const[n,o]=t;return o&&+o>0&&(s+="".concat(o," ").concat(n).concat(o>1?"child"!==n?"s":"ren":"").concat(l<i.length-1?", ":"")),s}),"");return(0,A.jsx)(lt,{arrivalTime:v,hasVAT:g,passengerString:C,ports:f,title:c,vehicleDescription:null===r||void 0===r?void 0:r.vehicleDescription,trailerText:null===r||void 0===r?void 0:r.trailerText,editLink:p,rateTile:(null===r||void 0===r||null===(n=r.selectedRate)||void 0===n?void 0:n.title)||(null===r||void 0===r||null===(o=r.selectedRate)||void 0===o?void 0:o.description),departureDate:u,departureTime:m,addOns:h,shipName:d,isLowestFare:b,totalCost:j,standardCost:w})}ot.defaultProps={shipName:"",addOns:"",hasVAT:!1};const rt=ot;var dt,ct,ut,mt=l(726);function vt(){return vt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var l=arguments[t];for(var i in l)Object.prototype.hasOwnProperty.call(l,i)&&(e[i]=l[i])}return e},vt.apply(this,arguments)}function xt(e,t){let{title:l,titleId:s,...n}=e;return i.createElement("svg",vt({width:32,height:32,viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",ref:t,"aria-labelledby":s},n),l?i.createElement("title",{id:s},l):null,dt||(dt=i.createElement("circle",{cx:16,cy:16,r:15.5,fill:"white",stroke:"#ECECEC"})),ct||(ct=i.createElement("path",{d:"M8 12.9335C7.77909 12.9335 7.6 13.1126 7.6 13.3335C7.6 13.5544 7.77909 13.7335 8 13.7335L8 12.9335ZM24.2828 13.6163C24.4391 13.4601 24.4391 13.2069 24.2828 13.0507L21.7373 10.5051C21.581 10.3489 21.3278 10.3489 21.1716 10.5051C21.0154 10.6613 21.0154 10.9145 21.1716 11.0708L23.4343 13.3335L21.1716 15.5962C21.0154 15.7524 21.0154 16.0057 21.1716 16.1619C21.3278 16.3181 21.581 16.3181 21.7373 16.1619L24.2828 13.6163ZM8 13.7335L24 13.7335L24 12.9335L8 12.9335L8 13.7335Z",fill:"#CD1919"})),ut||(ut=i.createElement("path",{d:"M24 20.4C24.2209 20.4 24.4 20.2209 24.4 20C24.4 19.7791 24.2209 19.6 24 19.6L24 20.4ZM7.71716 19.7172C7.56095 19.8734 7.56095 20.1266 7.71716 20.2828L10.2627 22.8284C10.419 22.9846 10.6722 22.9846 10.8284 22.8284C10.9846 22.6722 10.9846 22.419 10.8284 22.2627L8.56569 20L10.8284 17.7373C10.9846 17.581 10.9846 17.3278 10.8284 17.1716C10.6722 17.0154 10.419 17.0154 10.2627 17.1716L7.71716 19.7172ZM24 19.6L8 19.6L8 20.4L24 20.4L24 19.6Z",fill:"#CD1919"})))}const pt=i.forwardRef(xt);l.p;var ht=l(422);const gt=e=>{var t,l,i,n,a,o,d,c,m;let{userSelections:v,handleSubmit:x,isAmend:p,baseRoute:h,initialStartDate:g="",initialEndDate:b="",initialFerr
1yPrice:f=""}=e;const{ferryVehicles:j}=(0,ht.Z)(),y=(e=>{var t,l,i,s,n,a,o,r,d,c,u,m,v,x,p,h,g,b,f,j,y,N,w,C,k;let{userSelections:T,ferryVehicles:A}=e;const P=Object.entries((null===T||void 0===T?void 0:T.crossings)||{}).reduce(((e,t)=>{var l,i,s,n,a,o,r,d,c,u,m,v,x,p,h;let[g,{crossing:b,addOns:f,rate:j}]=t;const y=null===b||void 0===b||null===(l=b.pricing)||void 0===l||null===(i=l.find((e=>e.code===j.code)))||void 0===i?void 0:i.bestRate,N=(null===T||void 0===T||null===(s=T.crossings)||void 0===s||null===(n=s[g])||void 0===n||null===(a=n.crossing)||void 0===a?void 0:a.addOns)||[],w=(null===T||void 0===T||null===(o=T.passengers)||void 0===o?void 0:o[g])||{},C=N.reduce(((e,t)=>{const l=null===f||void 0===f?void 0:f.find((e=>{let{resourceCode:l}=e;return t.resourceCode===l}));if(l){const i=(0,it.Z)({passengers:w,addOn:t});e.push({...t,...l,countsFor:i,totalPrice:+t.price*i})}return e}),[]),k=null===C||void 0===C?void 0:C.reduce(((e,t)=>e+ +((null===t||void 0===t?void 0:t.totalPrice)||(null===t||void 0===t?void 0:t.price)||0)),0),P=Object.values(w).reduce(((e,t)=>{let{count:l}=t;return e+ +l}),0),D=!(null===T||void 0===T||null===(r=T.vehicle)||void 0===r||!r.isBringingTrailer),S=null!==j&&void 0!==j&&j.resourceCode?null===A||void 0===A||null===(d=A.find((e=>e.code===(null===j||void 0===j?void 0:j.resourceCode))))||void 0===d||null===(c=d.icon)||void 0===c?void 0:c.title:null;return{...e,[g]:{selectedRate:{...y,title:j.title,description:null===j||void 0===j?void 0:j.description,displayFewLeft:null===j||void 0===j?void 0:j.displayFewLeft,isLowestFare:null===j||void 0===j?void 0:j.isLowestFare},selectedAddOns:C,totalAddOnCost:k,passengerCount:P,passengers:w,grandTotal:(null!==y&&void 0!==y&&y.totalPrice?+y.totalPrice:0)+(k||0),vehicleLabel:(null===T||void 0===T||null===(u=T.vehicle)||void 0===u?void 0:u.groupName)||null,vehicleResourceCode:(null===T||void 0===T||null===(m=T.vehicle)||void 0===m?void 0:m.resourceCode)||null,vehicleDescription:S||(D?"Private Vehicle":null===T||void 0===T||null===(v=T.vehicle)||void 0===v||null===(x=v.vehicleIcon)||void 0===x||null===(p=x.icon)||void 0===p?void 0:p.title),trailerText:S?null:D?" + Trailer ".concat((null===T||void 0===T||null===(h=T.vehicle)||void 0===h?void 0:h.trailerLength)||""):null}}}),{}),D=Object.values((null===T||void 0===T?void 0:T.passengers)||{}).reduce(((e,t)=>{const l=Object.values(t||{}).reduce(((e,t)=>null!==t&&void 0!==t&&t.count&&+t.count?e+ +t.count:e),0);return l>e?l:e}),0),S=Object.values(P).reduce(((e,t)=>{var l,i;const s=null===t||void 0===t||null===(l=t.selectedRate)||void 0===l?void 0:l.standardPrice,n=null===t||void 0===t||null===(i=t.selectedRate)||void 0===i?void 0:i.totalPrice;return s&&n&&+s>+n?e+(+s-+n):e}),0);return{crossingTotals:P,isOneWay:null===T||void 0===T||null===(t=T.routes)||void 0===t?void 0:t.isOneWay,maxGuestCount:D,more:"Info",departureDate:null===T||void 0===T||null===(l=T.routes)||void 0===l?void 0:l.departureDate,returnDate:null===T||void 0===T||null===(i=T.routes)||void 0===i?void 0:i.returnDate,totalSaving:S,grandTotal:+((null===P||void 0===P||null===(s=P.departure)||void 0===s?void 0:s.grandTotal)||0)+ +((null===P||void 0===P||null===(n=P.return)||void 0===n?void 0:n.grandTotal)||0),departureShipName:null===T||void 0===T||null===(a=T.crossings)||void 0===a||null===(o=a.departure)||void 0===o||null===(r=o.crossing)||void 0===r||null===(d=r.ship)||void 0===d?void 0:d.label,returnShipName:null===T||void 0===T||null===(c=T.crossings)||void 0===c||null===(u=c.return)||void 0===u||null===(m=u.crossing)||void 0===m||null===(v=m.ship)||void 0===v?void 0:v.label,outwardDepartTime:null===T||void 0===T||null===(x=T.crossings)||void 0===x||null===(p=x.departure)||void 0===p||null===(h=p.crossing)||void 0===h?void 0:h.departureDateTime,outwardArrivalTime:null===T||void 0===T||null===(g=T.crossings)||void 0===g||null===(b=g.departure)||void 0===b||null===(f=b.crossing)||void 0===f?void 0:f.arrivalDateTime,returnDepartTime:null===T||void 0===T||null===(j=T.crossings)||void 0===j||null===(y=j.return)||void 0===y||null===(N=y.crossing)||void 0===N?void 0:N.departureDateTime,returnArrivalTime:null===T||void 0===T||null===(w=T.crossings)||void 0===w||null===(C=w.return)||void 0===C||null===(k=C.crossing)||void 0===k?void 0:k.arrivalDateTime}})({userSelections:v,ferryVehicles:j}),{isOneWay:N}=y,w=+f-(null!==y&&void 0!==y&&y.grandTotal?+y.grandTotal:0),C=(0,s.v9)((e=>{var t;return(0,r.gA)(e,null===v||void 0===v||null===(t=v.routes)||void 0===t?void 0:t.departureRouteCode)})),T=(0,s.v9)((e=>{var t;return(0,r.gA)(e,null===v||void 0===v||null===(t=v.routes)||void 0===t?void 0:t.returnRouteCode)})),P=!p||(N?u()(g).format("YYYY-MM-DD")===u()(null===y||void 0===y?void 0:y.departureDate).format("YYYY-MM-DD"):u()(g).format("YYYY-MM-DD")===u()(null===y||void 0===y?void 0:y.departureDate).format("YYYY-MM-DD")&&u()(b).format("YYYY-MM-DD")===u()(null===y||void 0===y?void 0:y.returnDate).format("YYYY-MM-DD")),D=C.description.split(" to "),S=(0,Pe.Z)(null===y||void 0===y||null===(t=y.crossingTotals)||void 0===t||null===(l=t.departure)||void 0===l?void 0:l.selectedAddOns),R=(0,Pe.Z)(null===y||void 0===y||null===(i=y.crossingTotals)||void 0===i||null===(n=i.return)||void 0===n?void 0:n.selectedAddOns),E=we.t2.includes(null===v||void 0===v||null===(a=v.vehicle)||void 0===a?void 0:a.resourceCode);return(0,A.jsx)("div",{className:"py-8 px-2 md:px-4",children:(0,A.jsxs)("div",{className:"w-full max-w-5xl mx-auto",children:[(0,A.jsxs)("div",{className:"flex flex-wrap gap-2 font-bold text-xs uppercase items-center",children:[(0,A.jsx)(k.r,{}),(0,A.jsx)("p",{children:N?"Single":"Return"}),(0,A.jsx)("p",{children:" \u2022 "}),(0,A.jsx)(mt.r,{}),(0,A.jsxs)("p",{children:[null===y||void 0===y?void 0:y.maxGuestCount," passenger",(null===y||void 0===y?void 0:y.maxGuestCount)>1?"s":""]}),(0,A.jsx)("p",{children:" \u2022 "}),(0,A.jsx)(_.r,{}),(0,A.jsxs)("p",{children:[u()(null===y||void 0===y?void 0:y.departureDate).format("ddd DD MMM YYYY"),N?null:" - ".concat(u()(null===y||void 0===y?void 0:y.returnDate).format("ddd DD MMM YYYY"))]})]}),(0,A.jsxs)("div",{className:"flex justify-between flex-wrap gap-4 text-3xl font-bold items-end pt-4 pb-2",children:[(0,A.jsx)("div",{className:"flex items-center font-heading font-semibold text-2xl lg:text-5xl lg:leading-[60px] text-black",children:D.map(((e,t)=>0===t?(0,A.jsxs)("div",{className:"flex items-center",children:[(0,A.jsx)("p",{children:e}),(0,A.jsx)(pt,{className:"mx-2"})]},e):(0,A.jsx)("p",{children:e},e)))}),(0,A.jsxs)("div",{className:"flex flex-col items-end",children:[(0,A.jsxs)("p",{className:"font-heading font-semibold text-base lg:text-[28px] leading-7 text-black",children:["Subtotal",(0,A.jsxs)("span",{className:"font-heading font-semibold text-2xl lg:text-[52px] lg:leading-[52px] text-black",children:[" ","\xa3 ",(0,se.Z)(null===y||void 0===y?void 0:y.grandTotal)]}),E&&(0,A.jsxs)("span",{className:"font-heading font-semibold text-2xl lg:text-[26px] lg:leading-[52px] text-black",children:[" ","+VAT"]})]}),(null===y||void 0===y?void 0:y.totalSaving)>0&&(0,A.jsxs)("p",{className:"font-heading font-semibold text-base lg:text-[20px] leading-none text-right text-darker-green capitalize mt-1",children:["Total savings \xa3",(0,se.Z)(y.totalSaving)]})]})]}),f&&(0,A.jsx)("p",{className:"text-right pb-2 text-darker-green font-heading font-semibold",children:"\xa3".concat(w," Difference")}),(null===y||void 0===y||null===(o=y.crossingTotals)||void 0===o?void 0:o.departure)&&(0,A.jsx)("div",{className:"mt-10",children:(0,A.jsx)(rt,{crossingTotals:null===y||void 0===y||null===(d=y.crossingTotals)||void 0===d?void 0:d.departure,t
1itle:"Outward",departureDate:y.departureDate,departureTime:y.outwardDepartTime,arrivalTime:y.outwardArrivalTime,shipName:y.departureShipName,routeData:C,editLink:"".concat(h,"/crossings/departure"),addOns:S,hasVAT:E})}),!N&&(null===y||void 0===y||null===(c=y.crossingTotals)||void 0===c?void 0:c.return)&&(0,A.jsx)("div",{children:(0,A.jsx)(rt,{crossingTotals:null===y||void 0===y||null===(m=y.crossingTotals)||void 0===m?void 0:m.return,title:"Return",departureDate:null===y||void 0===y?void 0:y.returnDate,departureTime:y.returnDepartTime,arrivalTime:y.returnArrivalTime,shipName:y.returnShipName,routeData:T,editLink:"".concat(h,"/crossings/return"),addOns:R,hasVAT:E})}),p&&!P&&(0,A.jsx)("div",{className:"py-4 px-8 border border-solid border-lighter-grey bg-opaque-red mb-8",children:(0,A.jsx)("p",{className:"text-center",children:"These dates do not match your current accommodation date."})}),(0,A.jsx)("div",{className:"flex justify-end",children:(0,A.jsx)("button",{type:"button",className:"btn-primary float-right py-6 px-8 text-lg leading-[14px]",onClick:x,children:"Add To Booking"})})]})})};gt.defaultProps={initialStartDate:"",initialEndDate:"",initialFerryPrice:""};const bt=gt;var ft,jt,yt,Nt=l(6279),wt=l(3940);function Ct(){return Ct=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var l=arguments[t];for(var i in l)Object.prototype.hasOwnProperty.call(l,i)&&(e[i]=l[i])}return e},Ct.apply(this,arguments)}function kt(e,t){let{title:l,titleId:s,...n}=e;return i.createElement("svg",Ct({viewBox:"0 0 24 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",ref:t,"aria-labelledby":s},n),l?i.createElement("title",{id:s},l):null,ft||(ft=i.createElement("path",{d:"M0.118124 10.7194C0.182327 10.6231 0.269316 10.5441 0.371367 10.4895C0.473417 10.4348 0.587376 10.4063 0.703125 10.4062H23.2969C23.4834 10.4062 23.6622 10.4803 23.7941 10.6122C23.9259 10.7441 24 10.9229 24 11.1094V16.7344C24 16.9209 23.9259 17.0997 23.7941 17.2316C23.6622 17.3634 23.4834 17.4375 23.2969 17.4375H4.92188C4.22757 17.4387 3.54853 17.2337 2.97081 16.8486C2.3931 16.4635 1.94271 15.9156 1.67672 15.2742L0.0539055 11.3798C0.00941467 11.273 -0.00800323 11.1568 0.00320053 11.0416C0.0144024 10.9263 0.0538788 10.8157 0.118124 10.7194Z",fill:"currentColor"})),jt||(jt=i.createElement("path",{d:"M2.90625 8.06274C2.90625 7.62762 3.0791 7.21032 3.38678 6.90265C3.69445 6.59497 4.11175 6.42212 4.54688 6.42212H20.4844C20.9195 6.42212 21.3368 6.59497 21.6445 6.90265C21.9521 7.21032 22.125 7.62762 22.125 8.06274V9.70337H2.90625V8.06274Z",fill:"currentColor"})),yt||(yt=i.createElement("path",{d:"M14.482 1.85941C14.562 1.493 14.7645 1.16482 15.0561 0.929013C15.3478 0.693209 15.7111 0.563882 16.0861 0.562378H17.6719C18.107 0.562378 18.5243 0.735229 18.832 1.04291C19.1396 1.35058 19.3125 1.76788 19.3125 2.203V5.71863H13.6547L14.482 1.85941Z",fill:"currentColor"})))}const Tt=i.forwardRef(kt);l.p;var At=l(6221);const Pt=[{title:"Outward",path:f.Z.departureCrossing,icon:(0,A.jsx)(J.r,{width:24})},{title:"Return",path:f.Z.returnCrossing,icon:(0,A.jsx)(At.r,{width:24})},{title:"Summary",path:f.Z.crossingSummary,icon:(0,A.jsx)(Tt,{width:24})}],Dt=()=>{const e=(0,n.TH)();return(0,A.jsx)("div",{className:"flex border border-lighter-grey pt-4 pb-3 px-8",children:Pt.map(((t,l)=>{const s=t.path===e.pathname,n=l+1<Pt.length;return(0,A.jsxs)(i.Fragment,{children:[(0,A.jsxs)("div",{className:"flex items-center justify-center uppercase font-heading text-xl relative flex-1 font-[600] pb-2\n ".concat(s?"text-red border-b-2 border-red":"text-black opacity-60","\n "),children:[t.icon,(0,A.jsx)("p",{className:"ml-2 text-[18px] hidden md:block",children:t.title})]}),n&&(0,A.jsx)("div",{className:"pb-2 flex",children:(0,A.jsx)(wt.r,{width:12,className:"mx-4"})})]},t.title)}))})};var St=l(4170),Rt=l(4069);const Et=[{title:"Route",path:"",icon:(0,A.jsx)(J.r,{width:20})},{title:"Vehicle",path:"vehicles",icon:(0,A.jsx)(St.r,{width:24})},{title:"Passengers",path:"passengers",icon:(0,A.jsx)(Rt.r,{width:24})}],Ot=e=>{let{baseRoute:t}=e;const l=(0,n.TH)();return(0,A.jsx)("div",{className:"flex border border-lighter-grey pt-4 pb-3 px-8",children:Et.map(((e,s)=>{const n=l.pathname.replaceAll("/","")==="".concat(t,"/").concat(e.path).replaceAll("/",""),a=s+1<Et.length;return(0,A.jsxs)(i.Fragment,{children:[(0,A.jsxs)(w.OL,{to:"".concat(t,"/").concat(e.path),className:"flex items-center justify-center uppercase font-heading text-xl relative flex-1 font-[600] pb-2\n ".concat(n?"text-red border-b-2 border-red":"text-black opacity-60","\n "),children:[e.icon,(0,A.jsx)("p",{className:"ml-2 text-[18px] hidden md:block",children:e.title})]},e.title),a&&(0,A.jsx)("div",{className:"pb-2 flex",children:(0,A.jsx)(wt.r,{width:12,className:"mx-4"})})]},e.title)}))})};var Lt,Zt=l(900);function _t(){return _t=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var l=arguments[t];for(var i in l)Object.prototype.hasOwnProperty.call(l,i)&&(e[i]=l[i])}return e},_t.apply(this,arguments)}function It(e,t){let{title:l,titleId:s,...n}=e;return i.createElement("svg",_t({width:20,height:10,viewBox:"0 0 20 10",fill:"none",xmlns:"http://www.w3.org/2000/svg",ref:t,"aria-labelledby":s},n),l?i.createElement("title",{id:s}
1,l):null,Lt||(Lt=i.createElement("path",{d:"M19.3375 5.59218C19.6689 5.59076 19.9364 5.32097 19.935 4.98961C19.9335 4.65824 19.6637 4.39077 19.3324 4.39219L19.3375 5.59218ZM0.574743 4.64862C0.341439 4.88394 0.343074 5.26384 0.578393 5.49714L4.41316 9.29906C4.64848 9.53236 5.02838 9.53073 5.26168 9.29541C5.49499 9.06009 5.49335 8.68019 5.25803 8.44689L1.84935 5.06741L5.22883 1.65872C5.46214 1.4234 5.4605 1.04351 5.22518 0.810203C4.98986 0.576899 4.60996 0.578533 4.37666 0.813853L0.574743 4.64862ZM19.3324 4.39219L0.998248 4.47106L1.00341 5.67105L19.3375 5.59218L19.3324 4.39219Z",fill:"#CD1919"})))}const Ft=i.forwardRef(It);l.p;var Yt=l(5341);const Mt=e=>{let{isLoading:t,appCustomizations:l,promoData:i}=e;if(t||(null===i||void 0===i||!i.searchedPromo)&&(null===l||void 0===l||!l.productCode))return null;const s=(null===i||void 0===i?void 0:i.hasValidPromo)||(null===l||void 0===l?void 0:l.productCode),n=s||null!==l&&void 0!==l&&l.hidePromoField?null!==l&&void 0!==l&&l.campaignTitle?(0,A.jsx)("p",{className:"font-heading text-xl font-semibold",children:l.campaignTitle}):(0,A.jsxs)("p",{className:"text-base",children:["Promo code ",(0,A.jsx)("span",{className:"font-bold",children:null===i||void 0===i?void 0:i.searchedPromo})," ","has been applied to your search."]}):(0,A.jsxs)("p",{children:[" ","The promo code you entered is invalid. Please check the code and retry."]}),a=s&&null!==l&&void 0!==l&&l.campaignDescription?l.campaignDescription:null;return(0,A.jsxs)(Oe.Z,{className:"mt-8 ".concat(s?"bg-darker-green bg-opacity-[.08]":"bg-red bg-opacity-[.04]"),children:[(0,A.jsx)("div",{className:"font-body text-base text-center text-text",children:n}),a&&(0,A.jsx)("p",{className:"text-sm",children:a})]})};Mt.defaultProps={isLoading:!1,appCustomizations:null,promoData:null};const Wt=Mt,Bt=e=>{var t,l,i,s,n,o,r,d,c,m,v,x,p,h,g,b,f,j,y,N,w,C,k,T,A,P,D;let{selections:S,passengerResourceCode:R,walkOnResourceCode:E,productCode:O}=e;const L=(null===S||void 0===S||null===(t=S.vehicle)||void 0===t?void 0:t.isBringingTrailer)&&(null===S||void 0===S||null===(l=S.vehicle)||void 0===l?void 0:l.allowTrailer),Z={departureDate:null===S||void 0===S||null===(i=S.routes)||void 0===i?void 0:i.departureDate,departureRoute:null===S||void 0===S||null===(s=S.routes)||void 0===s?void 0:s.departureRouteCode,departureResourceCodes:null!==S&&void 0!==S&&null!==(n=S.vehicle)&&void 0!==n&&n.resourceCode?"".concat(R,"|").concat(null===S||void 0===S||null===(o=S.vehicle)||void 0===o?void 0:o.resourceCode):E,departurePassengers:Object.values((null===S||void 0===S||null===(r=S.passengers)||void 0===r?void 0:r.departure)||{}).map((e=>{let{count:t,type:l}=e;return"".concat(t,"|").concat(l)})).join(","),departureHasVehicle:!(null===S||void 0===S||null===(d=S.vehicle)||void 0===d||!d.resourceCode),departureVehicleResourceCode:(null===S||void 0===S||null===(c=S.vehicle)||void 0===c?void 0:c.resourceCode)||"",departureHasTrailer:L,departureTrailerLength:L&&null!==S&&void 0!==S&&null!==(m=S.vehicle)&&void 0!==m&&m.trailerLength?null===S||void 0===S||null===(v=S.vehicle)||void 0===v?void 0:v.trailerLength:"",departureTrailerHeight:L&&null!==S&&void 0!==S&&null!==(x=S.vehicle)&&void 0!==x&&x.trailerHeight?null===S||void 0===S||null===(p=S.vehicle)||void 0===p?void 0:p.trailerHeight:"",couponCode:(null===S||void 0===S||null===(h=S.routes)||void 0===h?void 0:h.promoCode)||"",returnDate:(null===S||void 0===S||null===(g=S.routes)||void 0===g?void 0:g.returnDate)||u()(null===S||void 0===S||null===(b=S.routes)||void 0===b?void 0:b.departureDate).add(1,"days").format("YYYY-MM-DD")},_=null!==S&&void 0!==S&&null!==(f=S.routes)&&void 0!==f&&f.isOneWay?{}:{returnRoute:null===S||void 0===S||null===(j=S.routes)||void 0===j?void 0:j.returnRouteCode,returnResourceCodes:null!==S&&void 0!==S&&null!==(y=S.vehicle)&&void 0!==y&&y.resourceCode?"".concat(R,"|").concat(null===S||void 0===S||null===(N=S.vehicle)||void 0===N?void 0:N.resourceCode):E,returnPassengers:Object.values((null===S||void 0===S||null===(w=S.passengers)||void 0===w?void 0:w.return)||{}).map((e=>{let{count:t,type:l}=e;return"".concat(t,"|").concat(l)})).join(","),returnHasVehicle:!(null===S||void 0===S||null===(C=S.vehicle)||void 0===C||!C.resourceCode),returnVehicleResourceCode:(null===S||void 0===S||null===(k=S.vehicle)||void 0===k?void 0:k.resourceCode)||"",returnHasTrailer:L,returnTrailerLength:L&&null!==S&&void 0!==S&&null!==(T=S.vehicle)&&void 0!==T&&T.trailerLength?null===S||void 0===S||null===(A=S.vehicle)||void 0===A?void 0:A.trailerLength:"",returnTrailerHeight:L&&null!==S&&void 0!==S&&null!==(P=S.vehicle)&&void 0!==P&&P.trailerHeight?null===S||void 0===S||null===(D=S.vehicle)||void 0===D?void 0:D.trailerHeight:""};
1return(0,a.omitBy)({currency:"GBP",productCode:O,...Z,..._,useTravelCard:""},(e=>""===e||void 0===e))},Vt="STDW",Ht=e=>{var t,l;let{user:i,userRole:s,productCode:n}=e;if(!n)return!1;if(!(!!i&&"customer"===s))return n!==Vt;if(!("GENCON"===(null===i||void 0===i||null===(t=i.customerAccount)||void 0===t?void 0:t.groupCode)))return!1;const a=null===i||void 0===i||null===(l=i.customerAccount)||void 0===l?void 0:l.defaultProductCode;return!!a&&n!==a},Ut=e=>{const t={};return(e||[]).forEach((e=>{if(null===e||void 0===e||!e.id)return;const l={};((null===e||void 0===e?void 0:e.pricing)||[]).forEach((e=>{var t;const i=null===e||void 0===e||null===(t=e.bestRate)||void 0===t?void 0:t.totalPrice;null!=(null===e||void 0===e?void 0:e.code)&&null!=i&&""!==i&&(l[e.code]=+i)})),t[e.id]=l})),t},Gt=(e,t)=>(e||[]).map((e=>{const l=t[null===e||void 0===e?void 0:e.id]||{};return{...e,pricing:((null===e||void 0===e?void 0:e.pricing)||[]).map((e=>{var t,i;const s=l[null===e||void 0===e?void 0:e.code],n=+(null!==(t=null===e||void 0===e||null===(i=e.bestRate)||void 0===i?void 0:i.totalPrice)&&void 0!==t?t:0);return null!=s&&!Number.isNaN(n)&&s>n?{...e,standardPrice:s,bestRate:{...e.bestRate,standardPrice:s}}:e}))}})),zt=(e,t)=>e&&t?{...e,outwardDepartures:Gt(e.outwardDepartures,Ut(t.outwardDepartures)),returnDepartures:Gt(e.returnDepartures,Ut(t.returnDepartures))}:e,qt=e=>{var t,l,o,d,c;let{initialSearchParams:m,handleSubmitCrossings:v,onNewSearch:x,currentProductCode:p,baseRoute:h="/book",ferryTravelTitle:g="BOOK FERRY TRAVEL",initialFerryPrice:b="",isAmend:j=!1,appCustomizations:y,showDateWarning:C,accommodationDates:k,navigateToLogin:T=null}=e;const{sessionIsExpired:P}=(0,Be.Z)(),[D,R]=(0,i.useState)((e=>{var t,l,i;if(!e)return{};const s={};return e.routes&&null!==(t=Object.keys(e.routes))&&void 0!==t&&t.length&&(s.routes={...e.routes}),e.vehicle&&null!==(l=Object.keys(e.vehicle))&&void 0!==l&&l.length&&(s.vehicle={...e.vehicle}),e.passengers&&null!==(i=Object.keys(e.passengers))&&void 0!==i&&i.length&&(s.passengers={...e.passengers}),s})(m)),[E,O]=(0,i.useState)(!1);(0,i.useEffect)((()=>{P&&O(!1)}),[P]);const L=(0,s.v9)(r.FV),Z=p||L,_=null===m||void 0===m||null===(t=m.routes)||void 0===t?void 0:t.departureDate,I=null===m||void 0===m||null===(l=m.routes)||void 0===l?void 0:l.returnDate,F=(0,n.s0)(),Y=(0,s.v9)(r.Dh),M=(0,s.v9)(r.xz),W=(0,s.v9)(Se.yH),B=(0,s.v9)(Se.dy),V=(0,s.v9)(Se.nC),H=(0,s.v9)(r.SZ),[U,G]=(0,i.useState)({isLoading:!1,crossings:null}),z=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{...D};x&&x(e),G({...U,isLoading:!0,error:null});const t=Bt({selections:e,passengerResourceCode:M,walkOnResourceCode:Y,productCode:Z}),l={};return N.Z.getCrossings(t).then((async e=>{let{data:i}=e;if(l.data=i,Ht({user:B,userRole:V,productCode:(null===i||void 0===i?void 0:i.productCode)||Z}))try{const e=await N.Z.getCrossings({...t,productCode:Vt,couponCode:""});l.data=zt(i,null===e||void 0===e?void 0:e.data)}catch(s){}})).catch((e=>{var t,i;l.error=(null===e||void 0===e||null===(t=e.response)||void 0===t||null===(i=t.data)||void 0===i?void 0:i["hydra:description"])||(null===e||void 0===e?void 0:e.message)||"unable to fetch crossings"})).finally((()=>{G({...l,isLoading:!1})}))},q=null===U||void 0===U||null===(o=U.data)||void 0===o?void 0:o.promoData;return(0,A.jsx)("main",{children:(0,A.jsxs)(n.Z5,{children:[(0,A.jsx)(n.AW,{path:"/",exact:!0,element:(0,A.jsxs)("div",{className:"px-2 pb-10",children:[(0,A.jsx)("div",{className:"w-full max-w-5xl mx-auto md:pt-8 px-0",children:(0,A.jsx)("div",{className:"hidden md:block",children:(0,A.jsx)(Ot,{baseRoute:h})})}),(0,A.jsx)(Je,{initialValues:(null===D||void 0===D?void 0:D.routes)||{},onSubmit:e=>{const t=[e.departureRouteCode,e.returnRouteCode].some((e=>["WCSO","SOWC"].some((t=>t===e))));R({...D,routes:{...e,isWalkOn:t},vehicle:t?null:null!==D&&void 0!==D&&D.vehicle?D.vehicle:{}}),F("".concat(h,t?"/passengers":"/vehicles"))},hidePromoField:!(null===y||void 0===y||!y.hidePromoField),navigateToLogin:T})]})}),(0,A.jsx)(n.AW,{path:"/vehicles",element:null!==D&&void 0!==D&&D.routes?(0,A.jsxs)("div",{className:"px-2 pb-10",children:[(0,A.jsxs)("div",{className:"max-w-xl lg:max-w-5xl mx-auto pb-28",children:[(0,A.jsxs)("div",{children:[(0,A.jsx)("div",{className:"flex flex-col block md:hidden py-4",children:(0,A.jsx)(w.rU,{to:h,children:(0,A.jsxs)("div",{className:"flex items-center",children:[(0,A.jsx)(Ft,{width:"24"}),(0,A.jsx)("p",{className:"font-heading text-sm font-semibold ml-2",children:"Return to Route"})]})})}),(0,A.jsxs)("div",{className:"w-full max-w-5xl mx-auto md:pt-8 px-0",children:[(0,A.jsx)("div",{className:"hidden md:block",children:(0,A.jsx)(Ot,{baseRoute:h})}),(0,A.jsx)("h1",{className:"text-center text-3xl md:text-5xl font-semibold leading-[60px] md:py-10",children:"Vehicle Information"})]}),(0,A.jsx)("div",{className:"flex justify-center md:justify-end mb-3",children:(0,A.jsx)("button",{className:"underline text-red font-normal text-xs",onClick:()=>O(!0),type:"button",children:"Learn more about our fares and tickets"})})]}),(0,A.jsx)(Ke.Z,{routeSelections:(null===D||void 0===D?void 0:D.routes)||{},onSelectVehicle:e=>{R({...D,vehicle:null!==e&&void 0!==e&&e.isWalkOn?null:e,routes:{...D.routes||{},isWalkOn:!(null===e||void 0===e||!e.isWalkOn)}}),F("".concat(h,"/passengers"))},initialValues:null===D||void 0===D?void 0:D.vehicle})]}),(0,A.jsx)(S.Z,{isOpen:E,onRequestClose:()=>O(!1),children:(0,A.jsxs)("div",{className:"bg-white p-8 flex flex-col max-w-[730px] leading-8",children:[(0,A.jsx)("button",{className:"flex ml-auto mb-8",onClick:()=>O(!1),type:"button",children:(0,A.jsx)(Yt.r,{})}),(0,A.jsx)("h2",{className:"text-red uppercase text-center mb-8",children:"booking the correct vehicle type"}),(0,A.jsx)("p",{className:"mb-8",children:"To avoid delays and additional port charges please provide accurate information about your vehicle. The fare depends on the vehicle type, its size and whether you are towing a trailer or caravan."}),(0,A.jsxs)("p",{className:"mb-8",children:["When calculating the height of your vehicle please take into account any"," ",(0,A.jsx)("span",{className:"font-bold",children:"roof mounted loads"})," and also whether the vehicle has"," ",(0,A.jsx)("span",{className:"font-bold",children:"particularly low clearance"}),". If you have any concerns about boarding or disembarking the ferry, please contact us on"," ",(0,A.jsx)("a",{className:"underline text-blue",rel:"noreferrer noopener",href:"tel:+02380019192",children:"023 8001 9192"})," ","with your vehicle details, and we'll be more than happy to help. Full"," ",(0,A.jsx)("a",{className:"underline text-blue",target:"_blank",rel:"noopener noreferrer",href:"".concat("https://www.redfunnel.co.uk","/conditions-of-carriage"),children:"terms and conditions of carriage"})," ","apply."]}),(0,A.jsx)("button",{className:"btn btn-primary self-center p-5 w-[296px] text-lg",onClick:()=>O(!1),type:"button",children:"Close"})]})})]}):(0,A.jsx)(n.Fg,{to:h})}),(0,A.jsx)(n.AW,{path:"/passengers",element:null!==D&&void 0!==D&&D.routes?(0,A.jsxs)("div",{className:"px-2 pb-10",children:[(0,A.jsxs)("div",{children:[(0,A.jsx)("div",{className:"block md:hidden py-4",children:(0,A.jsx)(w.rU,{to:"".concat(h,"/vehicles"),children:(0,A.jsxs)("div",{className:"flex items-center",children:[(0,A.jsx)(Ft,{width:"24"}),(0,A.jsx)("p",{className:"font-heading text-sm font-semibold ml-2",children:"Return to Vehicle Info"})]})})}),(0,A.jsxs)("div",{className:"w-full max-w-5xl mx-auto md:pt-8 px-0",children:[(0,A.jsx)("div",{className:"hidden md:block",children:(0,A.jsx)(Ot,{baseRoute:h})}),(0,A.jsx)("h1",{className:"text-center text-3xl md:text-5xl pb-10 md:pt-10",children:"Passengers"})]})]}),(0,A.jsx)("div",{className:"max-w-xl mx-auto",children:(0,A.jsx)(Qe.Z,{handleSubmit:e=>{R({...D,passengers:e}),F("".concat(h,"/crossings/departure"))},routes:D.routes,maxPassengers:null===(d=D.vehicle)||void 0===d?void 0:d.maxPassengers,initialValues:(null===D||void 0===D?void 0:D.passengers)||null})})]}):(0,A.jsx)(n.Fg,{to:h})}),(0,A.jsx)(n.AW,{path:"/crossings/:direction",element:null!==D&&void 0!==D&&D.routes?(0,A.jsxs)(A.Fragment,{children:[(0,A.jsxs)("div",{className:"bg-slightly-off-white",children:[(0,A.jsx)("div",{className:"px-2 md:px-6 lg:px-8",children:(0,A.jsxs)("div",{className:"w-full max-w-5xl mx-auto pt-8",children:[(0,A.jsx)("div",{className:"hidden md:block",children:(0,A.jsx)(Dt,{})}),(0,A.jsx)("h1",{className:" my-4 md:my-12 text-red text-[40px] md:text-[64px] uppercase text-center md:text-left",children:g})]})}),(0,A.jsx)("div",{className:"lg:bg-half-grey px-2 md:px-6 lg:px-8 ".concat(null!==U&&void 0!==U&&U.error?"pb-8":""),children:(0,A.jsxs)("div",{className:"max-w-5xl mx-auto w-full",children:[(0,A.jsxs)("div",{className:"flex flex-wrap gap-x-8 mb-3",children:[(0,A.jsx)("div",{children:(0,A.jsxs)(w.rU,{to:f.Z.departureCrossing,className:"flex items-center text-lg font-semibold font-heading uppercase text-red",children:[(0,A.jsx)(J.r,{className:"w-5 mr-3 text-red"}),"Ferry"]}
1)}),!W&&!H&&(0,A.jsx)("div",{children:(0,A.jsxs)(w.rU,{to:f.Z.accommodations,className:"flex items-center text-lg font-semibold font-heading uppercase text-gray3",children:[(0,A.jsx)(K.r,{className:"w-5 mr-3 text-gray3"}),"Accommodation"]})}),(0,A.jsx)("div",{children:(0,A.jsxs)(w.rU,{to:f.Z.attractions,className:"flex items-center text-lg font-semibold font-heading uppercase text-gray3",children:[(0,A.jsx)(Q.r,{className:"w-5 mr-3 text-gray3"}),"Attractions"]})})]}),(0,A.jsx)(Nt.Z,{initialValues:D,isLoading:U.isLoading,onSubmit:e=>{R({...e}),z(e),F(f.Z.departureCrossing)},promoCode:null===D||void 0===D||null===(c=D.routes)||void 0===c?void 0:c.promoCode,hidePromoField:!(null===y||void 0===y||!y.hidePromoField)}),(0,A.jsx)(Wt,{promoData:q,isLoading:U.isLoading,appCustomizations:y}),(0,A.jsx)(Oe.Z,{className:"border border-[#E0E0E0] bg-red bg-opacity-[.04] text-gray5 mt-4",children:(0,A.jsxs)("p",{children:["VEHICLE FERRY BOOKINGS:"," ",(0,A.jsx)("strong",{children:"Do you need to use the lift on your crossing?"})," ","If so, please call us on"," ",(0,A.jsx)("a",{className:"underline",href:"tel:023 8001 9192",children:"023 8001 9192"})," ","for assistance."]})})]})})]}),(0,A.jsxs)("div",{className:"bg-slightly-off-white lg:bg-white px-2 md:px-6 lg:px-8 pb-4",children:[C&&(0,A.jsx)("div",{className:"w-full max-w-5xl mx-auto pt-8",children:(0,A.jsx)(Oe.Z,{className:"border border-[#E0E0E0] bg-red bg-opacity-[.04] text-gray5",children:(0,A.jsxs)("p",{children:["Your selected accommodation dates"," ",null!==k&&void 0!==k&&k.start&&null!==k&&void 0!==k&&k.end?"(".concat(u().tz(null===k||void 0===k?void 0:k.start).format("ddd MMM DD")," - ").concat(u().tz(null===k||void 0===k?void 0:k.end).format("ddd MMM DD"),")"):null," ","do not match your ferry travel dates."]})})}),(0,A.jsx)(at,{fetchCrossings:z,availabilityData:U,productCode:Z,userSelections:D,handleSelectCrossing:(e,t)=>{var l;const i=(0,a.cloneDeep)(D),s=(0,a.cloneDeep)(i.crossings||{});R({...i,crossings:{...s,[e]:t}});const n=(null===D||void 0===D||null===(l=D.routes)||void 0===l?void 0:l.isOneWay)||!1;if("departure"===e&&!n)return F("".concat(h,"/crossings/return")),void window.scrollTo(0,0);F("".concat(h,"/crossing/summary"))},clearCrossingSelections:()=>{R((0,a.omit)(D,"crossings"))},currentSelections:D.crossings||{},baseRoute:h})]})]}):(0,A.jsx)(n.Fg,{to:h})}),(0,A.jsx)(n.AW,{path:"/crossing/summary",exact:!0,element:null!==D&&void 0!==D&&D.crossings?(0,A.jsxs)("div",{className:"relative",children:[(0,A.jsx)("div",{className:"max-xl:max-w-5xl max-xl:mx-auto max-xl:mt-7 max-lg:ml-3 xl:absolute xl:left-8 xl:top-7",children:(0,A.jsx)(w.rU,{to:"".concat(h,"/crossings/departure"),children:(0,A.jsxs)("div",{className:"flex items-center",children:[(0,A.jsx)(Zt.r,{width:"24"}),(0,A.jsx)("p",{className:"ml-2",children:"Back"})]})})}),(0,A.jsx)("div",{className:"mx-auto max-w-5xl py-8 px-2 xl:px-0",children:(0,A.jsx)(Dt,{})}),(0,A.jsx)(bt,{initialStartDate:_,initialEndDate:I,initialFerryPrice:b,userSelections:D,handleSubmit:()=>{v({ferrySelections:D})},baseRoute:h,isAmend:j})]}):(0,A.jsx)(n.Fg,{to:"".concat(h,"/crossings/departure")})})]})})};qt.defaultProps={onNewSearch:null,currentProductCode:null,baseRoute:"/book",ferryTravelTitle:"BOOK FERRY TRAVEL",initialFerryPrice:"",isAmend:!1,appCustomizations:null,showDateWarning:!1,accommodationDates:null,navigateToLogin:null};const Xt=qt;var Jt=l(7317),Kt=l(8716);const Qt=e=>{var t;let{onLoginSuccess:l,basePath:a,hideGuest:o=!1}=e;const r=(0,s.I0)(),d=(0,n.TH)(),c=(0,n.s0)(),u=(0,i.useRef)((null===d||void 0===d||null===(t=d.state)||void 0===t?void 0:t.from)||"/my-account");return(0,A.jsxs)(n.Z5,{children:[(0,A.jsx)(n.AW,{path:"/login",element:(0,A.jsxs)("div",{className:"px-2 md:px-6 lg:px-8",children:[(0,A.jsx)("h1",{className:"text-center text-5xl mt-10",children:"Complete Your Booking"}),(0,A.jsxs)("div",{className:"my-5 flex gap-2 justify-center flex-wrap",children:[(0,A.jsxs)("div",{className:"border mx-2 md:mx-0 px-10 py-9 bg-white w-[450px] rounded-sm",children:[(0,A.jsx)("h2",{className:"mb-7 text-[32px] font-medium leading-none",children:"Returning Customers"}),(0,A.jsx)(Jt.Z,{login:e=>{let{id:t,password:i}=e;return N.Z.universalLogin({id:t,password:i}).then((e=>{l&&l(e),r((0,Se.uZ)(e))}))},isAgentLabel:!0})]}),(0,A.jsxs)("div",{className:"border mx-2 md:mx-0 pl-10 pr-4 pt-9 pb-12 bg-white w-[450px] rounded-sm",children:[(0,A.jsx)("h2",{className:"mb-7 text-[32px] font-medium leading-none",children:"New Customers"}),(0,A.jsx)("p",{className:"my-5 text-[15px] font-normal",children:o?"An account is required to book accommodations.":"Guest Checkout now available for Ferry-Only Travel"}),(0,A.jsxs)("div",{className:"w-[218px] grid grid-cols-1 gap-1",children:[!
1o&&(0,A.jsx)("button",{type:"button",onClick:()=>c(u.current||"/book",{replace:!0}),className:"btn-quaternary block w-full py-4 text-lg",children:"Continue as a Guest"}),(0,A.jsx)(w.rU,{className:"btn-primary block w-full my-4 py-4 text-lg text-center",to:"".concat(a,"/register"),replace:!0,children:"Create an Account"})]}),(0,A.jsx)("a",{className:"block mt-3 text-[13px] underline decoration-text",target:"_blank",rel:"noopener noreferrer",href:"".concat("https://www.redfunnel.co.uk","/policies-and-conditions"),children:"Terms & Conditions"})]})]})]})}),(0,A.jsx)(n.AW,{path:"/register",element:(0,A.jsx)("div",{className:"pb-28",children:(0,A.jsx)(Kt.Z,{onSuccess:()=>c(u.current,{replace:!0}),onBackButton:()=>c("".concat(a,"/login"),{replace:!0,state:{from:u.current}})})})})]})};Qt.defaultProps={hideGuest:!1};const $t=Qt;var el=l(4874);const tl=l.p+"static/media/accommodation-placeholder-2.7284e62e51f4eaac2764.jpg",ll=l.p+"static/media/attractions-placeholder.d1c7b8303b5825e7e6da.jpg",il=l.p+"static/media/ferry-placeholder.11b7052a36b4fb7ecca8.jpg",sl=l.p+"static/media/addons-placeholder.ec66566411f473b2e337.jpg",nl={ferry:{path:il,alt:"ferry image",title:"Add A Ferry Crossing",copy:"Choose from 35 conveniently-scheduled daily crossings, with easy online booking (and great rates that make it even easier to book)."},accommodations:{path:tl,alt:"accommodations image",title:"Add Accommodation",copy:"Our team have selected places to stay that are perfectly suited for all budgets, styles, and groups sizes \u2013 find your home away from home on the Isle of Wight."},attractions:{path:ll,alt:"ticketed attractions image",title:"Add Ticketed Attractions",copy:"Home to festivals, museums, historical sites, and nature sanctuaries, the Isle of Wight offers unforgettable experiences for every type of traveler."}},al=e=>{let{itemsToShow:t,handleContinueClick:l,onItemClick:i,addOnsToShow:s,closeModal:n}=e;return(0,A.jsxs)("div",{className:"bg-white py-6 px-8",children:[s.length?(0,A.jsxs)("div",{className:"flex flex-col lg:flex-row",children:[(0,A.jsx)("img",{className:"w-full lg:w-[220px]",src:sl,alt:"passengers having fun"}),(0,A.jsxs)("div",{className:"p-4 border border-light-grey bg-[rgba(48,129,198,0.04)] flex-grow",children:[(0,A.jsx)("h3",{className:"text-3xl mb-2",children:"Enhance Your Travel Experience"}),s.map((e=>(0,A.jsx)("div",{className:"flex mb-1 last-of-type:mb-2",children:(0,A.jsxs)("p",{children:[(0,A.jsx)("span",{className:"mx-2",children:"\u2022"}),null===e||void 0===e?void 0:e.replace(/<\/?[^>]+(>|$)/g,"")]})},e))),(0,A.jsx)(w.rU,{className:"text-lg font-semibold uppercase text-blue font-heading",to:null===f.Z||void 0===f.Z?void 0:f.Z.departureCrossing,onClick:n,children:"+ ADD TO BOOKING"})]})]}):null,(0,A.jsx)("h1",{className:"text-red text-2xl text-center my-8",children:"WHILE ON THE ISLAND"}),(0,A.jsx)("div",{className:"flex flex-col lg:flex-row mb-8 justify-center gap-4",children:(null===t||void 0===t?void 0:t.map((e=>{const t=nl[e.type];return(0,A.jsxs)("div",{className:"flex flex-col w-full max-lg:first-of-type:mb-2 lg:w-[305px] border border-solid border-light-grey",children:[(0,A.jsx)("img",{src:null===t||void 0===t?void 0:t.path,alt:null===t||void 0===t?void 0:t.alt,className:"object-cover w-full lg:max-h-[184px]"}),(0,A.jsxs)("div",{className:"p-4 flex flex-col flex-grow",children:[(0,A.jsx)("h2",{className:"text-2xl mb-2",children:null===t||void 0===t?void 0:t.title}),(0,A.jsx)("p",{className:"mb-4 flex flex-grow",children:null===t||void 0===t?void 0:t.copy}),(null===e||void 0===e?void 0:e.target)&&(0,A.jsxs)(w.rU,{onClick:()=>i?i():null,to:null===e||void 0===e?void 0:e.target,className:"font-heading font-semibold uppercase text-red flex text-lg",children:["Continue",(0,A.jsx)("img",{src:el.Z,alt:"red arrow icon",className:"ml-2 max-w-[32px]"})]})]})]},e.type)})))||null}),(0,A.jsx)("div",{className:"flex",children:(0,A.jsx)("button",{type:"button",className:"bg-red text-white mx-auto w-[296px] py-6 text-lg uppercase font-semibold font-heading hover:bg-white hover:text-red border border-solid border-red",onClick:l,children:"No Thank You"})})]})};al.defaultProps={addOnsToShow:[]};const ol=al;
1var rl=l(3517),dl=l(283),cl=l(5170),ul=l(787);const ml=(e,t)=>{var l,i,s,n,o,r,d,c,m,v,x,p,h,g;const b=[],f=null===e||void 0===e||null===(l=e.items)||void 0===l||null===(i=l.ferries)||void 0===i?void 0:i.some((e=>{var t;return null===e||void 0===e||null===(t=e.crossings)||void 0===t?void 0:t.length})),j=f&&(null===e||void 0===e||null===(s=e.items)||void 0===s||null===(n=s.ferries)||void 0===n?void 0:n.some((e=>{var t;return(null===e||void 0===e||null===(t=e.crossings)||void 0===t?void 0:t.length)>1}))),y=f&&j&&(null===e||void 0===e||null===(o=e.items)||void 0===o?void 0:o.ferries.some((e=>u()(null===e||void 0===e?void 0:e.startDate).isSame(u()(null===e||void 0===e?void 0:e.endDate),"day")))),N=f?null===e||void 0===e||null===(r=e.items)||void 0===r||null===(d=r.ferries)||void 0===d||null===(c=d[0])||void 0===c?void 0:c.crossings:[],w=[];return Object.values(null===e||void 0===e?void 0:e.potentialAddons).forEach(((e,t)=>{null===e||void 0===e||e.forEach((e=>{var l,i;return null!==N&&void 0!==N&&null!==(l=N[t])&&void 0!==l&&null!==(i=l.addOns)&&void 0!==i&&i.some((t=>(null===t||void 0===t?void 0:t.resourceCode)===(null===e||void 0===e?void 0:e.resourceCode)))?null:w.push(null===e||void 0===e?void 0:e.description)}))})),null!==e&&void 0!==e&&null!==(m=e.items)&&void 0!==m&&null!==(v=m.ferries)&&void 0!==v&&v.some((e=>{var t;return null===e||void 0===e||null===(t=e.crossings)||void 0===t?void 0:t.length}))||b.push({type:"ferry",target:"/book/"}),null!==e&&void 0!==e&&null!==(x=e.items)&&void 0!==x&&null!==(p=x.hotels)&&void 0!==p&&p.length||y||t||b.push({type:"accommodations",target:"/book/accommodation"}),null!==e&&void 0!==e&&null!==(h=e.items)&&void 0!==h&&null!==(g=h.attractions)&&void 0!==g&&g.length||b.push({type:"attractions",target:"/book/attractions"}),{items:b,addOns:(0,a.uniq)(w)}};var vl=l(26),xl=l(3087),pl=l(6970);const hl=l.p+"static/media/timer.43ae235649e68be5bbbb133f919b8e14.svg",gl=e=>{let t=Math.floor(e%60),l=Math.floor(e/60%60);return l=l<10?"0".concat(l):l,t=t<10?"0".concat(t):t,"".concat(l,":").concat(t)},bl=e=>{let{onExpired:t}=e;const[l,s]=(0,i.useState)(600);return(0,i.useEffect)((()=>{let e;return l<=0?t():e=setInterval((()=>s(l-1)),1e3),()=>clearInterval(e)}),[l]),(0,A.jsxs)("div",{className:"flex gap-2 bg-[rgba(252,202,48,0.28)] border-gray5 px-8 py-6",children:[(0,A.jsx)("div",{className:"flex-shrink-0 pt-2",children:(0,A.jsx)("img",{src:hl,alt:""})}),(0,A.jsxs)("div",{children:[(0,A.jsxs)("div",{className:"flex flex-wrap md:text-[27px] text-black gap-1 font-heading font-bold mb-2",children:[(0,A.jsxs)("p",{className:"min-w-[36px] md:min-w-[64px]",children:[gl(l)," "]}),(0,A.jsx)("p",{className:"flex-shrink-0",children:"-"}),(0,A.jsx)("p",{children:"We're holding your room."})]}),(0,A.jsx)("p",{children:"Check out in the next 10 minutes to secure your booking. Unsecured accommodation will be released back into our system and may take up to 20 minutes to reappear."})]})]})};function fl(e){var t,l,d,c,y,w,C,k,T,P,R,E,O,L,Z,_,I,F,Y,M,W,B,V,H,U,G,z,q,X,J,K,Q,$;let{user:ee,searchParams:te,setSearchParams:le,appCustomizations:ie,itineraryDrawerIsOpen:se,setItineraryDrawerIsOpen:ne,resetFlow:ae}=e;const oe=(0,s.v9)(Se.nC),re=(0,s.v9)(Se.yH),de=(0,s.v9)(Se.PF),ce=(0,s.v9)(Se.kQ),ue=(0,s.v9)(r.SZ),{childrenAge:me}=(0,s.v9)(h.p6),ve=(0,n.TH)(),xe=(0,n.s0)(),pe=m.parse(window.location.search),he=!(null===pe||void 0===pe||!pe.paymentFailed),ge="callCentre"===oe||!(null!==Re.LT&&void 0!==Re.LT&&Re.LT.some((e=>{var t;return e===(null===te||void 0===te||null===(t=te.routes)||void 0===t?void 0:t.departureRouteCode)}))),{cartState:fe,updateCart:je,removeAccommodationItem:ye,removeAttractionItem:Ne,removeAllItems:we,resetCart:Ce,persistedCartIsLoading:ke,removePersistedCart:Te}=(0,o.Z)(),{sessionIsExpired:Ae}=(0,Be.Z)(),Pe=()=>{Ce(),ae(),Te(),xe("/book")};(0,i.useEffect)((()=>{Ae&&Pe()}),[Ae]),(0,i.useEffect)((()=>{window.scrollTo({top:0,left:0,behavior:"instant"}),(0,pl.Z)("checkout_step",{current_step:ve.pathname})}),[ve.pathname]);const[De,Ee]=(0,i.useState)({isOpen:!1,itemsToShow:[],nextRoute:null,addOnsToShow:[]}),[Le,_e]=(0,i.useState)(!1),[Ie,Ve]=(0,i.useState)({isLoading:!1,error:null}),[He,Ue]=(0,i.useState)(!1),Ge=(0,s.v9)(r.n1),ze=(0,s.v9)(r.FV),qe=(0,s.v9)(r.k1),Xe=(0,We.Bp)(null===fe||void 0===fe?void 0:fe.data),Je=(null===Xe||void 0===Xe?void 0:Xe.startDate)||(null===te||void 0===te||null===(t=te.routes)||void 0===t?void 0:t.departureDate),Ke=(null===Xe||void 0===Xe?void 0:Xe.endDate)||(null===te||void 0===te||null===(l=te.routes)||void 0===l?void 0:l.returnDate),Qe=(0,rl.W)(null===te||void 0===te||null===(d=te.passengers)||void 0===d?void 0:d.departure),$e=!(null===fe||void 0===fe||null===(c=fe.data)||void 0===c||null===(y=c.items)||void 0===y||null===(w=y.ferries)||void 0===w||!w.some((e=>{var t;return!(null===e||void 0===e||null===(t=e.crossings)||void 0===t||!t.length)}))),et=!(null===fe||void 0===fe||null===(C=fe.selections)||void 0===C||null===(k=C.accommodations)||void 0===k||!k.some((e=>{var t,l;return null===e||void 0===e||null===(t=e.hotelData)||void 0===t||null===(l=t.selections)||void 0===l?void 0:l.some((e=>null===e||void 0===e?void 0:e.campingPackage))}))),tt=(e=>{var t,l,i,s,n,a;const o=null===e||void 0===e||null===(t=e.data)||void 0===t?void 0:t.items,r=null===e||void 0===e?void 0:e.selections;if(!o)return"empty cart";const d=!(null===o||void 0===o||null===(l=o.ferries)||void 0===l||!l.some((e=>{var t;return null===(t=e.crossings)||void 0===t?void 0:t.length}))),c=!(null===o||void 0===o||null===(i=o.hotels)||void 0===i||!i.length),u=!(null===o||void 0===o||null===(s=o.attractions)||void 0===s||!s.length),m=null===r||void 0===r||null===(n=r.accommodations)||void 0===n?void 0:n.some((e=>{var t,l;return null===e||void 0===e||null===(t=e.hotelData)||void 0===t||null===(l=t.selections)||void 0===l?void 0:l.some((e=>null===e||void 0===e?void 0:e.campingPackage))})),v=!(null===o||void 0===o||null===(a=o.attractions)||void 0===a||!a.some((e=>p.d.has(null===e||void 0===e?void 0:e.resourceCode))));return!u||d||v?m&&!d?"You must add a ferry crossing for this accommodation type to continue":d||c||v?"":"You must add a ferry crossing or accommodation to continue":"You must add a ferry crossing to continue"})(fe),lt=!tt,it=(e,t)=>
1{Ne(e,t)},st=null===fe||void 0===fe||null===(T=fe.data)||void 0===T||null===(P=T.items)||void 0===P||null===(R=P.hotels)||void 0===R?void 0:R.map((e=>e.bookitProductId)),nt=null===st||void 0===st?void 0:st.some((e=>"HCT"===e)),at=null!==ie&&void 0!==ie&&ie.productCode?null===ie||void 0===ie?void 0:ie.productCode:nt?"HCT":null!==st&&void 0!==st&&st[0]?null===st||void 0===st?void 0:st[0]:ze,ot=(0,We.Li)(null===fe||void 0===fe?void 0:fe.data),rt=(0,We.cH)(null===fe||void 0===fe?void 0:fe.data),dt=()=>{Ce(),Te(),xe("/book"),_e(!1)},ct=()=>{xe("/book/user/login",{replace:!0,state:{from:ve.pathname}})},ut=null===(E=ve.pathname)||void 0===E?void 0:E.includes("/summary"),mt=null===(O=ve.pathname)||void 0===O?void 0:O.includes("/payment"),vt=!(null===fe||void 0===fe||null===(L=fe.data)||void 0===L||null===(Z=L.items)||void 0===Z||null===(_=Z.hotels)||void 0===_||!_.length);return(0,A.jsxs)(ht.t,{children:[(0,A.jsx)(v.q,{children:(0,A.jsx)("script",{defer:!0,src:"https://www.paypal.com/sdk/js?client-id=".concat("ATloNQ3zawvuc8JIFSphGBdFEkwTJwfmn5y4JploSWmCNACUTfXzXp_s8lFXkWuOE7xOnOu-w7tpPVrz","¤cy=GBP&locale=en_GB&enable-funding=paylater").concat({NODE_ENV:"production",PUBLIC_URL:"/book",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0,REACT_APP_CLIENT_ID:"redfunnel",REACT_APP_BASE_PATH:"/",REACT_APP_DOLLI_ENDPOINT:"https://redfunnel.dolli.cloud/api",REACT_APP_MY_ACCOUNT_URL:"https://www.redfunnel.co.uk/my-account",REACT_APP_AGENT_PORTAL_URL:"https://www.redfunnel.co.uk/agent-portal",REACT_APP_MAP_KEY:"AIzaSyANCU_lFU46Qp1P4Hw2b27HuOG
1LxZVU3cY",REACT_APP_MAPBOX_ACCESS_TOKEN:"pk.eyJ1IjoidmVyYi1tYXBib3giLCJhIjoiY2xmYjI2azJoMmw1cDN5cHE4NW5jajg0byJ9.E_IX9zN575RHvjPPHOb5Bw",REACT_APP_DRUPAL_HOME:"https://www.redfunnel.co.uk",REACT_APP_ALLOW_MARKER:"false",REACT_APP_SUMMARY_URL:"https://www.redfunnel.co.uk/book/summary",REACT_APP_EKASHU_URL:"https://live.ekashu.com/",REACT_APP_PAYPAL_CLIENT_ID:"ATloNQ3zawvuc8JIFSphGBdFEkwTJwfmn5y4JploSWmCNACUTfXzXp_s8lFXkWuOE7xOnOu-w7tpPVrz",REACT_APP_DISABLE_INVOICES:"false",REACT_APP_DISABLE_INVOICE_PAYMENT:"false",REACT_APP_INCLUDE_ANALYTICS:"true",REACT_APP_MAX_INVOICE_PAYMENT:"5",REACT_APP_MAX_HOTELS_GUESTS:"20",REACT_APP_AMEND_WHITELIST:""}.REACT_APP_PAYPAL_BUYER_LOCAL?"&buyer-country=".concat({NODE_ENV:"production",PUBLIC_URL:"/book",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0,REACT_APP_CLIENT_ID:"redfunnel",REACT_APP_BASE_PATH:"/",REACT_APP_DOLLI_ENDPOINT:"https://redfunnel.dolli.cloud/api",REACT_APP_MY_ACCOUNT_URL:"https://www.redfunnel.co.uk/my-account",REACT_APP_AGENT_PORTAL_URL:"https://www.redfunnel.co.uk/agent-portal",REACT_APP_MAP_KEY:"AIzaSyANCU_lFU46Qp1P4Hw2b27HuOG
1LxZVU3cY",REACT_APP_MAPBOX_ACCESS_TOKEN:"pk.eyJ1IjoidmVyYi1tYXBib3giLCJhIjoiY2xmYjI2azJoMmw1cDN5cHE4NW5jajg0byJ9.E_IX9zN575RHvjPPHOb5Bw",REACT_APP_DRUPAL_HOME:"https://www.redfunnel.co.uk",REACT_APP_ALLOW_MARKER:"false",REACT_APP_SUMMARY_URL:"https://www.redfunnel.co.uk/book/summary",REACT_APP_EKASHU_URL:"https://live.ekashu.com/",REACT_APP_PAYPAL_CLIENT_ID:"ATloNQ3zawvuc8JIFSphGBdFEkwTJwfmn5y4JploSWmCNACUTfXzXp_s8lFXkWuOE7xOnOu-w7tpPVrz",REACT_APP_DISABLE_INVOICES:"false",REACT_APP_DISABLE_INVOICE_PAYMENT:"false",REACT_APP_INCLUDE_ANALYTICS:"true",REACT_APP_MAX_INVOICE_PAYMENT:"5",REACT_APP_MAX_HOTELS_GUESTS:"20",REACT_APP_AMEND_WHITELIST:""}.REACT_APP_PAYPAL_BUYER_LOCAL):"")})}),(0,A.jsxs)("div",{className:"flex-1 shrink-0 bg-slightly-off-white",children:[(0,A.jsx)(g.Z,{onCartClick:ut||mt&&vt?null:()=>ne(!se),navigateToLogin:ct,cart:ut?null:fe.data,onDashboardClick:re?()=>xe("/agent-portal"):null,onLogout:Pe}),!ke&&(0,A.jsxs)(n.Z5,{children:[(0,A.jsx)(n.AW,{path:"/*",element:(0,A.jsx)(Xt,{initialSearchParams:te,handleSubmitCrossings:e=>{let{ferrySelections:t}=e;return je("ferries",t).then((e=>{var t,l,i,s,n,a,o,r,d,c,u;const m=ge?null:ml(e,re||ue),v=null===e||void 0===e||null===(t=e.items)||void 0===t||null===(l=t.ferries)||void 0===l||null===(i=l[0])||void 0===i||null===(s=i.crossings)||void 0===s||null===(n=s[0])||void 0===n||null===(a=n.vehicles)||void 0===a||null===(o=a[0])||void 0===o?void 0:o.resourceCode,x=null===qe||void 0===qe||null===(r=qe.ferry)||void 0===r||null===(d=r.options)||void 0===d||null===(c=d.cargoResourceCodes)||void 0===c?void 0:c.includes(v);null!==m&&void 0!==m&&null!==(u=m.items)&&void 0!==u&&u.length&&!x?Ee({isOpen:!0,itemsToShow:null===m||void 0===m?void 0:m.items,nextRoute:f.Z.review,addOnsToShow:null===m||void 0===m?void 0:m.addOns}):xe(f.Z.review)}))},onNewSearch:le,baseRoute:"/book",currentProductCode:at,appCustomizations:ie,bookedAccommodationDates:rt,showDateWarning:(0,ul.Q)({bookedTimes:rt,startDate:(null===te||void 0===te||null===(I=te.routes)||void 0===I?void 0:I.departureDate)||null,endDate:(null===te||void 0===te||null===(F=te.routes)||void 0===F?void 0:F.returnDate)||null}),accommodationDates:rt,navigateToLogin:ct})}),(0,A.jsx)(n.AW,{path:"/accommodation/*",element:re?(0,A.jsx)(n.Fg,{to:null!==fe&&void 0!==fe&&fe.data?"/book/review":"/book/crossings/departure"}):(0,A.jsx)(cl.F,{children:(0,A.jsx)(j.Z,{cart:fe,initialStartDate:Je,initialEndDate:Ke,initialRoomCounts:te.hotelRooms||[Qe],initialChildrenAges:null!==(Y=te.childrenAges)&&void 0!==Y?Y:me,basePath:"/book/accommodation",handleSubmit:(e,t)=>je("accommodations",e,t).then((t=>{var l,i;const s=null===e||void 0===e||null===(l=e.selections)||void 0===l?void 0:l.some((e=>null===e||void 0===e?void 0:e.campingPackage)),n={...te};var o,r,d;if(((0,a.set)(n,"hotelRooms",e.searchParams.rooms),!$e)&&(null!==e&&void 0!==e&&null!==(o=e.searchParams)&&void 0!==o&&o.startDate&&null!==e&&void 0!==e&&null!==(r=e.searchParams)&&void 0!==r&&r.endDate&&((0,a.set)(n,"routes.departureDate",e.searchParams.startDate),(0,a.set)(n,"routes.returnDate",e.searchParams.endDate)),null!==e&&void 0!==e&&null!==(d=e.searchParams)&&void 0!==d&&d.rooms)){var c;const t=(0,rl.I)({rooms:null===e||void 0===e||null===(c=e.searchParams)||void 0===c?void 0:c.rooms,defaultPassengerTypes:Ge});(0,a.set)(n,"passengers.departure",t),(0,a.set)(n,"passengers.return",t)}if(le(n),(et||s)&&!$e)return xe("/book/crossings/departure?showVehicleSelection=true");const u=ge||re?null:ml(t);return null!==u&&void 0!==u&&null!==(i=u.items)&&void 0!==i&&i.length?Ee({isOpen:!0,itemsToShow:null===u||void 0===u?void 0:u.items,nextRoute:f.Z.review,addOnsToShow:null===u||void 0===u?void 0:u.addOns}):xe(f.Z.review)})),onNewSearch:e=>{if(!$e){const t=(0,a.cloneDeep)(te),l=(0,rl.I)({rooms:e.rooms,defaultPassengerTypes:Ge});(0,a.set)(t,"routes.departureDate",e.start),(0,a.set)(t,"routes.returnDate",e.end),(0,a.set)(t,"passengers.departure",l),(0,a.set)(t,"passengers.return",l),le(t)}},bookedFerryTimes:ot})})}),(0,A.jsx)(n.AW,{path:"/attractions/*",element:(0,A.jsx)(be,{initialStartDate:Je,handleSubmit:e=>{var t,l;let{attractionId:i,selections:s,date:n}=e;const o=(0,a.cloneDeep)(te);return $e||null!==fe&&void 0!==fe&&null!==(t=fe.data)&&void 0!==t&&null!==(l=t.hotels)&&void 0!==l&&l.length||((0,a.set)(o,"routes.departureDate",n),(0,a.set)(o,"routes.returnDate",u()(n).format("YYYY-MM-DD"))),le(
1o),je("attractions",{attractionId:i,selections:s,date:n}).then((e=>{var t,l;const i=!(null===e||void 0===e||null===(t=e.items)||void 0===t||!t.attractions.some((e=>p.d.has(null===e||void 0===e?void 0:e.resourceCode))));if(!$e&&!i)return xe("/book/crossings/departure",{state:{isPassengerModalOpen:!0}});const s=ge||re?null:ml(e,ue);return null!==s&&void 0!==s&&null!==(l=s.items)&&void 0!==l&&l.length?Ee({isOpen:!0,itemsToShow:null===s||void 0===s?void 0:s.items,nextRoute:f.Z.review,addOnsToShow:null===s||void 0===s?void 0:s.addOns}):xe(f.Z.review)}))},basePath:"/book/attractions"})}),(0,A.jsx)(n.AW,{path:"/review",element:(0,A.jsx)("div",{className:"max-sm:px-3 max-lg:px-5 px-8",children:(0,A.jsx)("div",{className:"pb-20 max-w-5xl mx-auto",children:(0,A.jsx)(Ze,{checkoutEligibilityError:tt,cart:fe.data,handleRemoveCrossings:()=>je("ferries",[]),handleRemoveAll:e=>{we(e)},handleRemoveAttractionItem:it,handleRemoveAccommodationItem:e=>{ye(e)},continueText:"Next: Booking Details",handleContinue:()=>ee?xe("/book/customer-details"):xe("/book/user/login",{state:{from:"/book/customer-details"}}),handleClearCart:()=>{_e(!0)},hotelGuests:Qe})})})}),(0,A.jsx)(n.AW,{path:"/user/*",element:(0,A.jsx)($t,{basePath:"/book/user",onLoginSuccess:()=>{var e;const t=(null===(e=ve.state)||void 0===e?void 0:e.from)||f.Z.crossingSummary;xe(t,{replace:!0})},hideGuest:(null===fe||void 0===fe||null===(M=fe.data)||void 0===M||null===(W=M.items)||void 0===W||null===(B=W.hotels)||void 0===B?void 0:B.length)>0||!1})}),(0,A.jsx)(n.AW,{path:"/customer-details",element:lt?(0,A.jsx)("div",{className:"px-2 sm:px-4 md:px-8",children:(0,A.jsxs)("div",{className:"lg:max-w-[1260px] max-w-[800px] w-full mx-auto",children:[(0,A.jsx)("h2",{className:"text-left py-8 pt-16",children:"Booking Details"}),(0,A.jsxs)("div",{className:"w-full flex flex-col-reverse lg:flex-row max-lg:items-center justify-center lg:justify-between mb-12 gap-4",children:[(0,A.jsx)("div",{className:"max-w-[800px] flex-grow max-lg:min-w-full",children:(0,A.jsx)(Fe.Z,{cart:null===fe||void 0===fe?void 0:fe.data,isCreditAccount:de,handleRemoveAttractionItem:it,onSubmit:e=>{const t=(0,a.cloneDeep)(e);return(0,a.set)(t,"address",ee&&"customer"===oe?{addressLine:[(null===ee||void 0===ee?void 0:ee.address)||""],cityName:(null===ee||void 0===ee?void 0:ee.city)||"",postalCode:(null===ee||void 0===ee?void 0:ee.postCode)||"",stateProv:(null===ee||void 0===ee?void 0:ee.customerAccount.county)||"",countryName:(null===ee||void 0===ee?void 0:ee.countryCode)||"",region:(null===ee||void 0===ee?void 0:ee.customerAccount.county)||""}:{}),"agent"!==oe&&"accountAgent"!==oe||(0,a.set)(t,"emailAddress",t.eTicketEmail),je("contactInfos",[t],!1,!0).then((e=>{var t,l;return xe(de?"/book/summary?itineraryId=".concat(null===e||void 0===e||null===(t=e.reserveResponse)||void 0===t||null===(l=t.data)||void 0===l?void 0:l.itineraryId,"&success=true"):"/book/payment")}))},initialCotySundry:re?null:(null===fe||void 0===fe||null===(V=fe.data)||void 0===V||null===(H=V.items)||void 0===H||null===(U=H.donations)||void 0===U?void 0:U[0])||null,onCotySubmit:re?null:e=>{je("coty",e)},showCancellationProtection:!re})}),(0,A.jsx)("div",{className:"max-w-[400px] max-lg:mb-6 w-full",children:(0,A.jsx)(dl.Z,{cart:null===fe||void 0===fe?void 0:fe.data,handleRemoveAttractionItem:it,routes:{...f.Z}})})]})]})}):(0,A.jsx)(n.Fg,{to:"/book/crossings/departure"})}),(0,A.jsx)(n.AW,{path:"/payment",element:(0,A.jsxs)("div",{className:"lg:max-w-[1260px] max-w-[800px] w-full mx-auto px-2 sm:px-4 md:px-8",children:[vt?(0,A.jsx)("div",{className:"mt-8",children:(0,A.jsx)(bl,{onExpired:dt})}):null,(0,A.jsx)("h2",{className:"text-left py-8 pt-16",children:"Payment Information"}),he&&(0,A.jsx)("div",{className:"pb-8",children:(0,A.jsx)(Oe.Z,{className:"bg-red bg-opacity-[.04] text-gray5",children:(0,A.jsx)("p",{children:"There was an issue processing your payment. Please try again or select a different payment method."})})}),(0,A.jsxs)("div",{className:"w-full flex flex-col-reverse lg:flex-row max-lg:items-center justify-center lg:justify-between mb-12 gap-4",children:[(0,A.jsx)("div",{className:"max-w-[800px] flex-grow max-lg:min-w-full",children:(0,A.jsx)(Ye.Z,{totalOwing:null===fe||void 0===fe||null===(G=fe.data)||void 0===G||null===(z=G.costTotals)||void 0===z?void 0:z.amountAfterTax,applicableLoyalty:(null===fe||void 0===fe||null===(q=fe.data)||void 0===q?void 0:q.applicableLoyalty)||null,disabled:!(null!==fe&&void 0!==fe&&fe.data),onSubmit:e=>(e=>{var t,l,i,s,n;let{paymentData:a={},itineraryId:o}=e;Ve({isLoading:!0,error:null});const r={...a||{}};re&&null!==ee&&void 0!==ee&&ee.agentNumber?r.agentNumber=ee.agentNumber:null!==ee&&void 0!==ee&&ee.customerNumber&&(r.customerNumber=null===ee||void 0===ee?void 0:ee.customerNumber);const d=ee?null:(null===fe||void 0===fe||null===(t=fe.data)||void 0===t||null===(l=t.customerInfos)||void 0===l||null===(i=l[0])||void 0===i||null===(s=i.customer)||void 0===s?void 0:s.email)||"";return d&&(r.email=d),N.Z.itineraryPayment({itineraryId:o||(null===fe||void 0===fe||null===(n=fe.data)||void 0===n?void 0:n.itineraryId),paymentData:r,options:{successRedirect:"https://www.redfunnel.co.uk/book/summary",failRedirect:"https://www.redfunnel.co.uk/book/summary"}}).then((e=>{var t,l;Te(),sessionStorage.setItem("anonymousUserEmail",d),null!==(t=e.data)&&void 0!==t&&t.ekashu?(0,We.SV)("https://live.ek
1ashu.com/",e.data.ekashu):(xe("/book/summary?itineraryId=".concat(e.itineraryId,"&success=true"),{state:{isPayPal:!(null===a||void 0===a||!a.payPalResponse),paymentSource:(null===a||void 0===a||null===(l=a.payPalResponse)||void 0===l?void 0:l.paymentSource)||(null===a||void 0===a?void 0:a.pointOption)}}),Ve({...Ie,isLoading:!1}))})).catch((e=>{const t=(0,xl.Z)(e,"unable to finalise payment");throw Ve({isLoading:!1,error:t}),new Error(t)}))})({paymentData:e}),submitText:"Complete Payment",payPalParams:(0,vl.W3)(null===fe||void 0===fe?void 0:fe.data),paymentPlan:null===fe||void 0===fe||null===(X=fe.data)||void 0===X?void 0:X.paymentPlan,showPaymentPlanUi:!(!ee||"customer"!==oe&&!ce),setShowPaymentPlanInSideCard:Ue})}),(0,A.jsx)("div",{className:"max-w-[400px] max-lg:mb-6 w-full",children:(0,A.jsx)(dl.Z,{cart:null===fe||void 0===fe?void 0:fe.data,handleRemoveAttractionItem:it,routes:{...f.Z},paymentPlan:He?null===fe||void 0===fe||null===(J=fe.data)||void 0===J?void 0:J.paymentPlan:null,disableEdits:!(null===fe||void 0===fe||null===(K=fe.data)||void 0===K||null===(Q=K.items)||void 0===Q||null===($=Q.hotels)||void 0===$||!$.length)})})]})]})}),(0,A.jsx)(n.AW,{path:"/summary",element:(0,A.jsx)(Me.Z,{onNewBookingClick:()=>{Ce(),ae(),xe("/book")}})})]}),(0,A.jsx)(b.Z,{isOpen:se,cart:null===fe||void 0===fe?void 0:fe.data,handleToggle:()=>ne(!se),handleRemoveAttractionItem:it,routes:{...f.Z}}),(0,A.jsx)(S.Z,{isOpen:De.isOpen,children:(0,A.jsx)(ol,{itemsToShow:De.itemsToShow,addOnsToShow:null===De||void 0===De?void 0:De.addOnsToShow,closeModal:()=>Ee((e=>({...e,isOpen:!1}))),onItemClick:()=>Ee({isOpen:!1,itemsToShow:[],nextRoute:null,addOnsToShow:[]}),handleContinueClick:()=>{xe(De.nextRoute),Ee({isOpen:!1,itemsToShow:[],nextRoute:null,addOnsToShow:[]})},removeAttraction:Ne})}),(0,A.jsx)(S.Z,{isOpen:Ie.isLoading,overlayClassName:"bg-opacity-80",whiteBg:!0,children:(0,A.jsx)(D.Z,{})}),(0,A.jsx)(S.Z,{isOpen:!(null===Ie||void 0===Ie||!Ie.error),onRequestClose:()=>Ve({...Ie,error:null}),children:(0,A.jsxs)("div",{className:"bg-white p-8",children:[(0,A.jsx)("h2",{children:"Error"}),(0,A.jsx)("p",{className:"my-4",children:Ie.error}),(0,A.jsx)("button",{type:"button",className:"btn btn-primary",onClick:()=>Ve({...Ie,error:null}),children:"Dismiss"})]})}),(0,A.jsx)(S.Z,{isOpen:Le,onRequestClose:()=>_e(!1),className:"w-full px-8 max-w-3xl",children:(0,A.jsxs)("div",{className:"bg-white p-8",children:[(0,A.jsx)("div",{className:"flex justify-end",children:(0,A.jsx)("button",{onClick:()=>_e(!1),"aria-label":"dismiss",type:"button",children:(0,A.jsx)(x.r,{className:"text-red"})})}),(0,A.jsxs)("div",{className:"px-4",children:[(0,A.jsx)("h1",{className:"text-red uppercase text-5xl text-center my-8",children:"Clear Your Current Booking?"}),(0,A.jsxs)("div",{className:"text-center text-base text-text leading-8",children:[(0,A.jsx)("p",{children:"This will clear your current booking and start a fresh search."}),(0,A.jsx)("p",{children:"Is this what you would like to do?"})]}),(0,A.jsxs)("div",{className:"flex flex-wrap gap-8 pt-8",children:[(0,A.jsx)("button",{className:"btn btn-inverted flex-1 py-4 whitespace-nowrap",type:"button",onClick:()=>_e(!1),children:"Nevermind"}),(0,A.jsx)("button",{className:"btn btn-primary flex-1 py-4 whitespace-nowrap",type:"button",onClick:dt,children:"Start New Search"})]})]})]})})]})]})}fl.defaultProps={user:null,appCustomizations:null};const jl=fl,yl=e=>{let{user:t}=e;const l=(0,n.s0)(),c=(0,s.v9)(r.k1),u=(0,s.v9)(r.n1),m=(0,d.ZP)(c),[v,x]=(0,i.useState)(null===m||void 0===m?void 0:m.initialFerrySearchParams),p=(0,s.v9)(Se.yH),[h,g]=(0,i.useState)(!1),[b,f]=(0,i.useState)(null===m||void 0===m?void 0:m.appCustomizations);return(0,A.jsx)(o.G,{shouldPersist:!p,onPersistedCartCreate:e=>{let{userSelections:t,cart:i}=e,s={...v};if(i){var n;const e=(0,We.Ph)(i);if(null!==t&&void 0!==t&&null!==(n=t.ferries)&&void 0!==n&&n.routes)s=t.ferries;else{const{startDate:t,endDate:l}=(0,We.Bp)(i);if(t&&l&&((0,a.set)(s,"routes.departureDate",t),(0,a.set)(s,"routes.returnDate",l)),e){const t=(0,rl.I)({rooms:e,defaultPassengerTypes:u});(0,a.set)(s,"passengers.departure",t),(0,a.set)(s,"passengers.return",t)}}null!==e&&void 0!==e&&e.length&&(s.hotelRooms=e),x(s),g(!0),l("/book/review")}},onAbandonCart:()=>l("/book"),children:(0,A.jsx)(jl,{user:t,searchParams:v,setSearchParams:x,appCustomizations:b,itineraryDrawerIsOpen:h,setItineraryDrawerIsOpen:g,resetFlow:()=>{var e;
1x(null===(e=(0,d.ZP)(c))||void 0===e?void 0:e.initialFerrySearchParams),f({})}})})};yl.defaultProps={user:null};const Nl=yl}}]); 2//# sourceMappingURL=649.6c2203df.chunk.js.map
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.