PageSourceSearch

https://www.dayoutwiththekids.co.uk/_next/static/chunks/pages/tickets/checkout/[id]-b44fd2f018359c9e.js

js dayoutwiththekids.co.uk collected 2026-09-24 09:25:02 UTC 69,274 bytes, 1 lines download raw bytes

1!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="e63ed7fc-7dd4-4d23-a702-f65820240da9",e._sentryDebugIdIdentifier="sentry-dbid-e63ed7fc-7dd4-4d23-a702-f65820240da9")}catch(e){}}(),(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1460],{20593:function(e,n,o){(window.__NEXT_P=window.__NEXT_P||[]).push(["/tickets/checkout/[id]",function(){return o(9307)}])},92535:function(e,n,o){"use strict";o.d(n,{v:function(){return BookingMeta}});var t=o(72253),i=o(85893),r=o(80082),s=o(42298),a=o(85283),BookingMeta=function(e){var n,o,c=e.bookingDate?(0,s.default)(new Date(e.bookingDate||""),"EEEE do MMMM yyyy "):null,l=e.ticketType===e.title,d=e.pricingGroup===e.ticketType,u=l&&d||!e.ticketType?null:l?e.pricingGroup||null:e.pricingGroup&&!d?"".concat(e.ticketType," - ").concat(e.pricingGroup):e.ticketType;return(0,i.jsxs)("div",{className:"".concat(e.className," bg-white rounded-lg border-[#DAC9FC] border"),children:[(0,i.jsxs)("div",{className:"flex justify-between items-center px-4 py-3",children:[(0,i.jsx)("h2",{className:"w-[calc(100%-64px)] headline-3--inter",children:e.title}),e.logo&&(0,i.jsx)(r.w,{imageUrl:null===(n=e.logo)||void 0===n?void 0:n.url,alt:(null===(o=e.logo)||void 0===o?void 0:o.alt_text)||"".concat(e.title," - logo"),pictureClassName:"rounded-full",imageClassName:"w-[60px] h-[60px] rounded-full",width:60,height:60})]}),(0,i.jsx)("hr",{className:"border-[#DAC9FC] border-b border-dashed"}),(0,i.jsxs)("div",{className:"flex flex-col gap-2 p-4",children:[e.ticketType?(0,i.jsxs)(i.Fragment,{children:[u&&(0,i.jsx)(BookingMetaEntry,{icon:"ticket",text:u}),(0,i.jsx)(BookingMetaEntry,{icon:"calendar",text:c||"Please select a date"})]}):(0,i.jsx)(BookingMetaEntry,{icon:"ticket",text:"Please select a ticket"}),e.admissionTimeSlot&&(0,i.jsx)(BookingMetaEntry,{icon:"timer",text:"".concat((0,a.TM)(e.admissionTimeSlot,e.ticketId))}),e.admissionTime&&!e.admissionTimeSlot&&(0,i.jsx)(BookingMetaEntry,{icon:"timer",text:"acd9bdde-9ede-4531-8d79-0683031d640f"===e.ticketId||"15d53982-e819-47de-b35e-893975aab7ed"===e.ticketId?(0,a.Oq)(e.admissionTime):e.admissionTime}),e.pricingOptions&&e.pricingOptions.length>0&&(0,i.jsx)("div",{className:"flex flex-col gap-2",children:e.pricingOptions.map(function(e,n){return(0,i.jsx)(PricingOptionSelection,(0,t._)({},e),n)})}),e.bookingDetails&&e.bookingDetails.pricingOptionSelection.selections.length>0&&(0,i.jsx)("div",{className:"flex flex-col gap-2",children:e.bookingDetails.pricingOptionSelection.selections.map(function(e){return(0,i.jsx)(PricingSelectionFromBookingDetails,(0,t._)({},e),e.pricingOptionId)})})]}),(0,i.jsx)(TicketDivider,{}),(0,i.jsxs)("div",{className:"p-4",children:[e.bookingFee?(0,i.jsxs)("div",{className:"flex justify-between items-center gap-4 text-grey-600",children:[(0,i.jsx)("span",{className:"copy--small",children:"Booking fee"}),(0,i.jsxs)("span",{className:"flex items-center gap-4 copy--small",children:["\xa3",e.bookingFee.toFixed(2).toString()]})]}):null,(0,i.jsxs)("div",{className:"flex justify-between items-center mb-1",children:[(0,i.jsx)("span",{className:"font-medium copy--regular",children:"Total"}),(0,i.jsxs)("span",{className:"font-medium copy--small",children:[e.totalUndiscountedCost&&(0,i.jsxs)("s",{className:"text-grey-600 line-through label--x-small",children:["\xa3",e.totalUndiscountedCost]})," \xa3",e.totalCost.toFixed(2).toString()]})]})]})]})},PricingOptionSelection=function(e){var n=(0,a.Px)((0,t._)({},e.price));return(0,i.jsxs)("div",{className:"flex justify-between items-center gap-4",children:[(0,i.jsxs)("span",{className:"copy--small",children:[e.quantity,"x ",e.display_name||e.name]}),n.hasDiscount?(0,i.jsxs)("span",{className:"copy--small",children:[(0,i.jsxs)("s",{className:"text-grey-600 line-through label--x-small",children:["\xa3",n.originalPrice]})," \xa3",n.discountedPrice]}):(0,i.jsxs)("span",{className:"copy--small",children:["\xa3",n.originalPrice]})]})},PricingSelectionFromBookingDetails=function(e){var n=(0,a.Px)({value:e.price,original_value:e.original_value});return(0,i.jsxs)("div",{className:"flex justify-between items-center gap-4",children:[(0,i.jsxs)("span",{className:"copy--small",children:[e.quantity,"x ",e.name]}),n.hasDiscount?(0,i.jsxs)("span",{className:"copy--small",children:[(0,i.jsxs)("s",{className:"text-grey-600 line-through label--x-small",children:["\xa3",n.originalPrice]})," \xa3",n.discountedPrice]}):(0,i.jsxs)("span",{className:"copy--small",children:["\xa3",n.originalPrice]})]})},BookingMetaEntry=function(e){var n=e.icon,o=e.text,t="";switch(n){case"calendar":t="calendar_wkvf8j";break;case"timer":t="timer_rlhyak";break;case"ticket":t="ticket-angled_bcayxm"}return(0,i.jsxs)("div",{className:"flex items-center gap-1",children:[(0,i.jsx)("img",{src:"https://res.dayoutwiththekids.co.uk/image/upload/v1730289451/components/icons/".concat(t,".svg"),alt:"placeholder",loading:"lazy",width:16,height:16}),(0,i.jsx)("span",{className:"copy--small",children:o})]})},TicketDivider=function(){return(0,i.jsx)("hr",{className:"border-[#DAC9FC] border-b border-dashed translate-y-[1px] transform"})}},86303:function(e,n,o){"use strict";o.d(n,{Y:function(){return DynamicQuestionInput}});var t=o(85893),i=o(80711),r=o(75918),s="__CUSTOM_ADDRESS__",DynamicQuestionInput=function(e){var n=e.question,o=e.onChange,a=e.invalid,c=e.invalidMessage,l=e.className,d="block mb-1 text-[12px] leading-[18px]",u="relative p-3 border w-full copy--small".concat(a?" error-border":" border-grey-200");switch(n.type){case"text":return(0,t.jsx)(r.X,{id:n.questionId,label:{title:n.label,size:"large",description:n.description||""},type:n.type,required:n.required,placeholder:n.placeholder||"",onChange:function(e){return o(e.target.value)},invalid:a,invalidMessage:c,className:l,value:String(n.answer||"")});case"number":return(0,t.jsxs)("div",{className:l,children:[(0,t.jsxs)("label",{className:d,htmlFor:n.questionId,children:[n.label,n.description?" - ".concat(n.description):"",n.required?" *":"",n.is_priced&&(null===(h=n.pricing)||void 0===h?void 0:h.total_including_tax)&&(0,t.jsxs)("span",{className:"ml-1 text-grey-500",children:["(+\xa3",n.pricing.total_including_tax.toFixed(2)," each)"]}
1)]}),(0,t.jsx)("input",{type:"number",id:n.questionId,name:n.questionId,required:n.required,placeholder:n.placeholder||"",min:n.min,max:n.max,className:u,onChange:function(e){return o(Number(e.target.value))},value:String(n.answer||"")}),a&&(0,t.jsx)(i.w,{text:c,className:"mt-1"})]});case"textarea":return(0,t.jsxs)("div",{className:l,children:[(0,t.jsxs)("label",{className:d,htmlFor:n.questionId,children:[n.label,n.description?" - ".concat(n.description):"",n.required?" *":""]}),(0,t.jsx)("textarea",{id:n.questionId,name:n.questionId,required:n.required,placeholder:n.placeholder||"",maxLength:2048,rows:4,className:u,onChange:function(e){return o(e.target.value)},value:String(n.answer||"")}),a&&(0,t.jsx)(i.w,{text:c,className:"mt-1"})]});case"boolean":if("".concat(n.label).concat(n.description?" - ".concat(n.description):"").length>300)return(0,t.jsxs)("div",{className:l,children:[(0,t.jsxs)("div",{className:"flex items-center",children:[(0,t.jsx)("input",{type:"checkbox",id:n.questionId,name:n.questionId,onChange:function(e){return o(e.target.checked?"true":"false")},checked:!0===n.answer||"true"===n.answer,className:a?"error-border":""}),(0,t.jsxs)("label",{htmlFor:n.questionId,className:"pl-3 copy--small font-medium",children:[n.label,n.required?" *":"",n.is_priced&&(null===(x=n.pricing)||void 0===x?void 0:x.total_including_tax)&&(0,t.jsxs)("span",{className:"ml-1 text-grey-500 font-normal",children:["(+\xa3",n.pricing.total_including_tax.toFixed(2),")"]})]})]}),n.description&&(0,t.jsx)("div",{className:"mt-2 max-h-[150px] overflow-y-auto border rounded-lg p-3 bg-grey-50 copy--small text-grey-600 ".concat(a?"error-border":"border-grey-200"),children:n.description}),a&&(0,t.jsx)(i.w,{text:c,className:"w-full mt-1"})]});return(0,t.jsxs)("div",{className:l,children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center",children:[(0,t.jsx)("input",{type:"checkbox",id:n.questionId,name:n.questionId,onChange:function(e){return o(e.target.checked?"true":"false")},checked:!0===n.answer||"true"===n.answer,className:a?"error-border":""}),(0,t.jsxs)("label",{htmlFor:n.questionId,className:"pl-3 w-[calc(100%-16px)] copy--small",children:[n.label,n.description?" - ".concat(n.description):"",n.required?" *":"",n.is_priced&&(null===(y=n.pricing)||void 0===y?void 0:y.total_including_tax)&&(0,t.jsxs)("span",{className:"ml-1 text-grey-500",children:["(+\xa3",n.pricing.total_including_tax.toFixed(2),")"]})]})]}),a&&(0,t.jsx)(i.w,{text:c,className:"w-full mt-1"})]});case"select":var g="PICKUP_POINT"===n.id,m=g&&(null===(f=n.metadata)||void 0===f?void 0:f.allowCustomTravelerPickup)===!0,p=n.options&&n.options.length>0;if(g&&m&&!p)return(0,t.jsx)(r.X,{id:n.questionId,label:{title:n.label,size:"large",description:n.description||""},type:"text",required:n.required,placeholder:"Enter your pickup address",onChange:function(e){return o(e.target.value)},invalid:a,invalidMessage:c,className:l,value:String(n.answer||"")});if(g&&m&&p){var h,y,x,f,v,b,N,_=String(n.answer||"").startsWith(s)||n.answer&&!(null===(b=n.options)||void 0===b?void 0:b.some(function(e){return e.id===n.answer})),j=_&&n.answer!==s?String(n.answer).replace("".concat(s,":"),""):"";return(0,t.jsxs)("div",{className:l,children:[(0,t.jsxs)("label",{className:d,htmlFor:n.questionId,children:[n.label,n.description?" - ".concat(n.description):"",n.required?" *":""]}),(0,t.jsxs)("div",{className:"select-wrapper",children:[(0,t.jsxs)("select",{id:n.questionId,name:n.questionId,required:n.required,
1className:"p-3 border rounded-lg appearance-none w-full copy--small".concat(a?" border-urgency-red":" border-grey-200"),onChange:function(e){return o(e.target.value)},value:_?s:String(n.answer||""),children:[(0,t.jsx)("option",{value:"",disabled:!0,children:"Select a pickup location"}),null===(N=n.options)||void 0===N?void 0:N.map(function(e){return(0,t.jsxs)("option",{value:e.id,children:[e.name,e.description?" - ".concat(e.description):""]},e.id)}),(0,t.jsx)("option",{value:s,children:"Other (enter address)"})]}),(0,t.jsx)("img",{src:"https://res.dayoutwiththekids.co.uk/image/upload/v1738229194/components/icons/chevron_y7rqta.svg",alt:"Chevron",width:"16",height:"17"})]}),_&&(0,t.jsx)("input",{type:"text",placeholder:"Enter your pickup address",className:"mt-2 p-3 border rounded-lg w-full copy--small".concat(a?" border-urgency-red":" border-grey-200"),onChange:function(e){return o(e.target.value||s)},value:j}),a&&(0,t.jsx)(i.w,{text:c,className:"mt-1"})]})}return(0,t.jsxs)("div",{className:l,children:[(0,t.jsxs)("label",{className:d,htmlFor:n.questionId,children:[n.label,n.description?" - ".concat(n.description):"",n.required?" *":""]}),(0,t.jsxs)("div",{className:"select-wrapper",children:[(0,t.jsxs)("select",{id:n.questionId,name:n.questionId,required:n.required,
1className:"p-3 border rounded-lg appearance-none w-full copy--small".concat(a?" border-urgency-red":" border-grey-200"),onChange:function(e){return o(e.target.value)},value:String(n.answer||""),children:[(0,t.jsx)("option",{value:"",disabled:!0,children:"Select an option"}),null===(v=n.options)||void 0===v?void 0:v.map(function(e){var n;return(0,t.jsxs)("option",{value:e.id,children:[e.name,e.is_priced&&(null===(n=e.pricing)||void 0===n?void 0:n.total_including_tax)?" (+\xa3".concat(e.pricing.total_including_tax.toFixed(2),")"):""]},e.id)})]}),(0,t.jsx)("img",{src:"https://res.dayoutwiththekids.co.uk/image/upload/v1738229194/components/icons/chevron_y7rqta.svg",alt:"Chevron",width:"16",height:"17"})]}),a&&(0,t.jsx)(i.w,{text:c,className:"mt-1"})]});case"number_and_unit":var k,w=n.unit||(null===(k=n.units)||void 0===k?void 0:k[0])||"";return(0,t.jsxs)("div",{className:l,children:[(0,t.jsxs)("label",{className:d,htmlFor:n.questionId,children:[n.label,n.description?" - ".concat(n.description):"",n.required?" *":""]}),(0,t.jsxs)("div",{className:"flex gap-2",children:[(0,t.jsx)("input",{type:"number",id:n.questionId,name:n.questionId,required:n.required,placeholder:"",min:n.min,max:n.max,className:"flex-1 ".concat(u),onChange:function(e){return o({value:e.target.value,unit:w})},value:String(n.answer||"")}),n.units&&n.units.length>0&&(0,t.jsxs)("div",{className:"select-wrapper w-24",children:[(0,t.jsx)("select",{className:"p-3 border rounded-lg appearance-none w-full copy--small".concat(a?" border-urgency-red":" border-grey-200"),value:w,onChange:function(e){return o({value:n.answer,unit:e.target.value})},children:n.units.map(function(e){return(0,t.jsx)("option",{value:e,children:e},e)})}),(0,t.jsx)("img",{src:"https://res.dayoutwiththekids.co.uk/image/upload/v1738229194/components/icons/chevron_y7rqta.svg",alt:"Chevron",width:"16",height:"17"})]})]}),a&&(0,t.jsx)(i.w,{text:c,className:"mt-1"})]});default:return(0,t.jsx)(r.X,{id:n.questionId,label:{title:n.label,size:"large",description:n.description||""},type:"text",required:n.required,placeholder:n.placeholder||"",onChange:function(e){return o(e.target.value)},invalid:a,invalidMessage:c,className:l,value:String(n.answer||"")})}}},36764:function(e,n,o){"use strict";o.d(n,{x:function(){return TicketDescription}});var t=o(85893),TicketDescription=function(e){var n;return(0,t.jsx)("div",{className:"".concat(null!==(n=e.className)&&void 0!==n?n:""),children:(0,t.jsx)("div",{className:"bg-[#F5FAFF] p-4 rounded-lg copy--body",dangerouslySetInnerHTML:{__html:e.ticketDescription}})})}},43713:function(e,n,o){"use strict";o.d(n,{d:function(){return TotalButton}});var t=o(72253),i=o(85893),r=o(9793),s=o(18442),a=o(67800),TotalButton=function(e){return(0,i.jsx)("section",{className:(null==e?void 0:e.className)?null==e?void 0:e.className:"",children:(0,i.jsxs)("div",{className:"bg-white mb-3 p-4 border border-grey-200 rounded-lg",children:[e.children,(0,i.jsxs)("div",{className:"flex justify-between items-center mb-3",children:[(0,i.jsx)("span",{className:"font-medium copy--regular",children:"Total"}),(0,i.jsxs)("span",{className:"font-medium copy--regular",children:[e.totalUndiscountedCost&&(0,i.jsxs)("s",{className:"text-grey-600",children:["\xa3",e.totalUndiscountedCost]})," \xa3",e.totalCost.toFixed(2).toString()]})]}),(0,i.jsx)(r.f,(0,t._)({},e.button)),e.belowButton,(0,i.jsx)("div",{className:"flex justify-center items-center gap-2",children:a.L.map(function(e){return(0,i.jsx)(s.Z,{name:e.icon,width:40,height:20},e.id)})})]})})}},75918:function(e,n,o){"use strict";o.d(n,{X:function(){return UserInputField}});var t=o(85893),i=o(80711),UserInputField=function(e){return(0,t.jsxs)("div",{className:e.className,children:[(0,t.jsxs)("label",{className:"block mb-1 text-[12px] leading-[18px]",htmlFor:e.id,children:[e.label.title,e.label.description?" - ".concat(e.label.description):"",e.required?" *":""]}),(0,t.jsx)("input",{type:e.type,id:e.id,name:e.id,required:e.required,placeholder:e.placeholder,className:"relative p-3 border w-full copy--small".concat(e.invalid?" error-border":" border-grey-200"," "),onChange:e.onChange,value:e.value}
1),e.invalid&&(0,t.jsx)(i.w,{text:e.invalidMessage,className:"mt-1"})]})}},99162:function(e,n,o){"use strict";o.d(n,{M:function(){return UspBlock}});var t=o(85893),UspBlock=function(e){return(0,t.jsxs)("div",{className:"bg-white p-4 border border-grey-200 rounded-lg ".concat(e.className||""),children:[(0,t.jsx)("h3",{className:"mb-3 </div>font-semibold headline-5--inter",children:"Why Book With Day Out With The Kids?"}),(0,t.jsxs)("ul",{className:"flex flex-col gap-2 mb-3",children:[(0,t.jsxs)("li",{className:"flex items-center gap-2",children:[(0,t.jsx)("img",{src:e.widgetConfigurationSettings.first_usp_icon_url||"https://res.dayoutwiththekids.co.uk/image/upload/v1750161440/components/icons/pound-blue_dlxelj.svg",alt:"Money Icon",width:"32",height:"32",loading:"lazy"}),(0,t.jsx)("span",{className:"inline-block font-semibold text-[12px] leading-[16px] tracking-[-0.25px]",children:e.widgetConfigurationSettings.first_usp_label||"We Guarantee Best Prices"})]}),(0,t.jsxs)("li",{className:"flex items-center gap-2",children:[(0,t.jsx)("img",{src:e.widgetConfigurationSettings.second_usp_icon_url||"https://res.dayoutwiththekids.co.uk/image/upload/v1737034694/components/icons/purple-phone_mksbwl.svg",alt:"Mobile Icon",width:"32",height:"32",loading:"lazy"}),(0,t.jsx)("span",{className:"inline-block font-semibold text-[12px] leading-[16px] tracking-[-0.25px]",children:e.widgetConfigurationSettings.second_usp_label||"Mobile E-Tickets No Printing Required"})]}),(0,t.jsxs)("li",{className:"flex items-center gap-2",children:[(0,t.jsx)("img",{src:e.widgetConfigurationSettings.third_usp_icon_url||"https://res.dayoutwiththekids.co.uk/image/upload/v1737034694/components/icons/green-thumbs-up_icj3da.svg",alt:"Shield Icon",width:"32",height:"32",loading:"lazy"}),(0,t.jsx)("span",{className:"inline-block font-semibold text-[12px] leading-[16px] tracking-[-0.25px]",children:e.widgetConfigurationSettings.third_usp_label||"Trusted by 10,000,000 Families"})]})]}),(0,t.jsx)("img",{src:"https://res.dayoutwiththekids.co.uk/image/upload/v1747815103/components/logos/reviews-io-stars_zw595u.svg",width:"163",height:"13",alt:"5 stars on Reviews.io",loading:"lazy",className:"mx-auto"})]})}},9307:function(e,n,o){"use strict";o.r(n),o.d(n,{CheckoutReducer:function(){return CheckoutReducer},__N_SSP:function(){return q},default:function(){return Checkout}});var t=o(11010),i=o(72253),r=o(14932),s=o(91309),a=o(88421),c=o(97582),l=o(85893),d=o(67294),u=o(79738),g=o(62981),m=o(2859),p=o(81630),h=o(92535),y=o(43713),x=o(75918),f=o(4586),v=o(80711),b=[{code:"+44",country:"United Kingdom",iso:"GB",stripLeadingZero:!0,nationalNumberLength:10},{code:"+93",country:"Afghanistan",iso:"AF"},{code:"+355",country:"Albania",iso:"AL"},{code:"+213",country:"Algeria",iso:"DZ"},{code:"+376",country:"Andorra",iso:"AD"},{code:"+244",country:"Angola",iso:"AO"},{code:"+1",country:"Anguilla",iso:"AI"},{code:"+1",country:"Antigua & Barbuda",iso:"AG"},{code:"+54",country:"Argentina",iso:"AR"},{code:"+374",country:"Armenia",iso:"AM"},{code:"+297",country:"Aruba",iso:"AW"},{code:"+61",country:"Australia",iso:"AU",stripLeadingZero:!0},{code:"+43",country:"Austria",iso:"AT",stripLeadingZero:!0},{code:"+994",country:"Azerbaijan",iso:"AZ"},{code:"+1",country:"Bahamas",iso:"BS"},{code:"+973",country:"Bahrain",iso:"BH"},{code:"+880",country:"Bangladesh",iso:"BD"},{code:"+1",country:"Barbados",iso:"BB"},{code:"+375",country:"Belarus",iso:"BY"},{code:"+32",country:"Belgium",iso:"BE",stripLeadingZero:!0},{code:"+501",country:"Belize",iso:"BZ"},{code:"+229",country:"Benin",iso:"BJ"},{code:"+1",country:"Bermuda",iso:"BM"},{code:"+975",country:"Bhutan",iso:"BT"},{code:"+591",country:"Bolivia",iso:"BO"},{code:"+387",country:"Bosnia & Herzegovina",iso:"BA",stripLeadingZero:!0},{code:"+267",country:"Botswana",iso:"BW"},{code:"+55",country:"Brazil",iso:"BR"},{code:"+1",country:"British Virgin Islands",iso:"VG"},{code:"+673",country:"Brunei",iso:"BN"},{code:"+359",country:"Bulgaria",iso:"BG",stripLeadingZero:!0},{code:"+226",country:"Burkina Faso",iso:"BF"},{code:"+257",country:"Burundi",iso:"BI"},{code:"+855",country:"Cambodia",iso:"KH",stripLeadingZero:!0},{code:"+237",country:"Cameroon",iso:"CM"},{code:"+1",country:"Canada",iso:"CA"},{code:"+238",country:"Cape Verde",iso:"CV"},{code:"+1",country:"Cayman Islands",iso:"KY"},{code:"+236",country:"Central African Republic",iso:"CF"},{code:"+235",country:"Chad",iso:"TD"},{code:"+56",country:"Chile",iso:"CL"},{code:"+86",country:"China",iso:"CN"}
1,{code:"+57",country:"Colombia",iso:"CO"},{code:"+269",country:"Comoros",iso:"KM"},{code:"+242",country:"Congo - Brazzaville",iso:"CG"},{code:"+243",country:"Congo - Kinshasa",iso:"CD"},{code:"+682",country:"Cook Islands",iso:"CK"},{code:"+506",country:"Costa Rica",iso:"CR"},{code:"+225",country:"C\xf4te d'Ivoire",iso:"CI"},{code:"+385",country:"Croatia",iso:"HR",stripLeadingZero:!0},{code:"+599",country:"Cura\xe7ao",iso:"CW"},{code:"+357",country:"Cyprus",iso:"CY"},{code:"+420",country:"Czechia",iso:"CZ"},{code:"+45",country:"Denmark",iso:"DK"},{code:"+253",country:"Djibouti",iso:"DJ"},{code:"+1",country:"Dominica",iso:"DM"},{code:"+1",country:"Dominican Republic",iso:"DO"},{code:"+593",country:"Ecuador",iso:"EC",stripLeadingZero:!0},{code:"+20",country:"Egypt",iso:"EG",stripLeadingZero:!0},{code:"+503",country:"El Salvador",iso:"SV"},{code:"+240",country:"Equatorial Guinea",iso:"GQ"},{code:"+291",country:"Eritrea",iso:"ER"},{code:"+372",country:"Estonia",iso:"EE"},{code:"+268",country:"Eswatini",iso:"SZ"},{code:"+251",country:"Ethiopia",iso:"ET",stripLeadingZero:!0},{code:"+500",country:"Falkland Islands",iso:"FK"},{code:"+298",country:"Faroe Islands",iso:"FO"},{code:"+679",country:"Fiji",iso:"FJ"},{code:"+358",country:"Finland",iso:"FI",stripLeadingZero:!0},{code:"+33",country:"France",iso:"FR",stripLeadingZero:!0},{code:"+594",country:"French Guiana",iso:"GF"},{code:"+689",country:"French Polynesia",iso:"PF"},{code:"+241",country:"Gabon",iso:"GA"},{code:"+220",country:"Gambia",iso:"GM"},{code:"+995",country:"Georgia",iso:"GE"},{code:"+49",country:"Germany",iso:"DE",stripLeadingZero:!0},{code:"+233",country:"Ghana",iso:"GH",stripLeadingZero:!0},{code:"+350",country:"Gibraltar",iso:"GI"},{code:"+30",country:"Greece",iso:"GR"},{code:"+299",country:"Greenland",iso:"GL"},{code:"+1",country:"Grenada",iso:"GD"},{code:"+590",country:"Guadeloupe",iso:"GP"},{code:"+1",country:"Guam",iso:"GU"},{code:"+502",country:"Guatemala",iso:"GT"},{code:"+44",country:"Guernsey",iso:"GG",stripLeadingZero:!0,nationalNumberLength:10},{code:"+224",country:"Guinea",iso:"GN"},{code:"+245",country:"Guinea-Bissau",iso:"GW"},{code:"+592",country:"Guyana",iso:"GY"},{code:"+509",country:"Haiti",iso:"HT"},{code:"+504",country:"Honduras",iso:"HN"},{code:"+852",country:"Hong Kong",iso:"HK"},{code:"+36",country:"Hungary",iso:"HU",stripLeadingZero:!0},{code:"+354",country:"Iceland",iso:"IS"},{code:"+91",country:"India",iso:"IN",stripLeadingZero:!0},{code:"+62",country:"Indonesia",iso:"ID",stripLeadingZero:!0},{code:"+964",country:"Iraq",iso:"IQ"},{code:"+353",country:"Ireland",iso:"IE",stripLeadingZero:!0},{code:"+44",country:"Isle of Man",iso:"IM",stripLeadingZero:!0,nationalNumberLength:10},{code:"+972",country:"Israel",iso:"IL",stripLeadingZero:!0},{code:"+39",country:"Italy",iso:"IT"},{code:"+1",country:"Jamaica",iso:"JM"},{code:"+81",country:"Japan",iso:"JP",stripLeadingZero:!0},{code:"+44",country:"Jersey",iso:"JE",stripLeadingZero:!0,nationalNumberLength:10},{code:"+962",country:"Jordan",iso:"JO",stripLeadingZero:!0},{code:"+7",country:"Kazakhstan",iso:"KZ"},{code:"+254",country:"Kenya",iso:"KE",stripLeadingZero:!0},{code:"+686",country:"Kiribati",iso:"KI"},{code:"+383",country:"Kosovo",iso:"XK"},{code:"+965",country:"Kuwait",iso:"KW"},{code:"+996",country:"Kyrgyzstan",iso:"KG"},{code:"+856",country:"Laos",iso:"LA",stripLeadingZero:!0},{code:"+371",country:"Latvia",iso:"LV"},{code:"+961",country:"Lebanon",iso:"LB",stripLeadingZero:!0},{code:"+266",country:"Lesotho",iso:"LS"},{code:"+231",country:"Liberia",iso:"LR"},{code:"+218",country:"Libya",iso:"LY",stripLeadingZero:!0},{code:"+423",country:"Liechtenstein",iso:"LI"},{code:"+370",country:"Lithuania",iso:"LT"},{code:"+352",country:"Luxembourg",iso:"LU"},{code:"+853",country:"Macao",iso:"MO"},{code:"+261",country:"Madagascar",iso:"MG",stripLeadingZero:!0},{code:"+265",country:"Malawi",iso:"MW"},{code:"+60",country:"Malaysia",iso:"MY",stripLeadingZero:!0},{code:"+960",country:"Maldives",iso:"MV"},{code:"+223",country:"Mali",iso:"ML"},{code:"+356",country:"Malta",iso:"MT"},{code:"+596",country:"Martinique",iso:"MQ"},{code:"+222",country:"Mauritania",iso:"MR"},{code:"+230",country:"Mauritius",iso:"MU"},{code:"+262",country:"Mayotte",iso:"YT"},{code:"+52",country:"Mexico",iso:"MX"},{code:"+373",country:"Moldova",iso:"MD",stripLeadingZero:!0},{code:"+377",country:"Monaco",iso:"MC"},{code:"+976",country:"Mongolia",iso:"MN"},{code:"+382",country:"Montenegro",iso:"ME",stripLeadingZero:!0},{code:"+1",country:"Montserrat",iso:"MS"},{code:"+212",country:"Morocco",iso:"MA",stripLeadingZero:!0},{code:"+258",country:"Mozambique",iso:"MZ"},{code:"+95",country:"Myanmar",iso:"MM",stripLeadingZero:!0},{code:"+264",country:"Namibia",iso:"NA",stripLeadingZero:!0},{code:"+674",country:"Nauru",iso:"NR"},{code:"+977",country:"Nepal",iso:"NP"},{code:"+31",country:"Netherlands",iso:"NL",stripLeadingZero:!0},{code:"+687",country:"New Caledonia",iso:"NC"},{code:"+64",country:"New Zealand",iso:"NZ",stripLeadingZero:!0},{code:"+505",country:"Nicaragua",iso:"NI"},{code:"+227",country:"Niger",iso:"NE"}
1,{code:"+234",country:"Nigeria",iso:"NG",stripLeadingZero:!0},{code:"+683",country:"Niue",iso:"NU"},{code:"+389",country:"North Macedonia",iso:"MK",stripLeadingZero:!0},{code:"+47",country:"Norway",iso:"NO"},{code:"+968",country:"Oman",iso:"OM"},{code:"+92",country:"Pakistan",iso:"PK",stripLeadingZero:!0},{code:"+970",country:"Palestinian Territories",iso:"PS",stripLeadingZero:!0},{code:"+507",country:"Panama",iso:"PA"},{code:"+675",country:"Papua New Guinea",iso:"PG"},{code:"+595",country:"Paraguay",iso:"PY",stripLeadingZero:!0},{code:"+51",country:"Peru",iso:"PE"},{code:"+63",country:"Philippines",iso:"PH",stripLeadingZero:!0},{code:"+48",country:"Poland",iso:"PL"},{code:"+351",country:"Portugal",iso:"PT"},{code:"+1",country:"Puerto Rico",iso:"PR"},{code:"+974",country:"Qatar",iso:"QA"},{code:"+262",country:"R\xe9union",iso:"RE"},{code:"+40",country:"Romania",iso:"RO",stripLeadingZero:!0},{code:"+7",country:"Russia",iso:"RU"},{code:"+250",country:"Rwanda",iso:"RW"},{code:"+685",country:"Samoa",iso:"WS"},{code:"+378",country:"San Marino",iso:"SM"},{code:"+239",country:"S\xe3o Tom\xe9 & Pr\xedncipe",iso:"ST"},{code:"+966",country:"Saudi Arabia",iso:"SA",stripLeadingZero:!0},{code:"+221",country:"Senegal",iso:"SN"},{code:"+381",country:"Serbia",iso:"RS",stripLeadingZero:!0},{code:"+248",country:"Seychelles",iso:"SC"},{code:"+232",country:"Sierra Leone",iso:"SL"},{code:"+65",country:"Singapore",iso:"SG"},{code:"+1",country:"Sint Maarten",iso:"SX"},{code:"+421",country:"Slovakia",iso:"SK",stripLeadingZero:!0},{code:"+386",country:"Slovenia",iso:"SI",stripLeadingZero:!0},{code:"+677",country:"Solomon Islands",iso:"SB"},{code:"+252",country:"Somalia",iso:"SO"},{code:"+27",country:"South Africa",iso:"ZA",stripLeadingZero:!0},{code:"+82",country:"South Korea",iso:"KR",stripLeadingZero:!0},{code:"+211",country:"South Sudan",iso:"SS"},{code:"+34",country:"Spain",iso:"ES"},{code:"+94",country:"Sri Lanka",iso:"LK",stripLeadingZero:!0},{code:"+590",country:"St Barth\xe9lemy",iso:"BL"},{code:"+290",country:"St Helena",iso:"SH"},{code:"+1",country:"St Kitts & Nevis",iso:"KN"},{code:"+1",country:"St Lucia",iso:"LC"},{code:"+590",country:"St Martin",iso:"MF"},{code:"+508",country:"St Pierre & Miquelon",iso:"PM"},{code:"+1",country:"St Vincent & Grenadines",iso:"VC"},{code:"+249",country:"Sudan",iso:"SD",stripLeadingZero:!0},{code:"+597",country:"Suriname",iso:"SR"},{code:"+46",country:"Sweden",iso:"SE",stripLeadingZero:!0},{code:"+41",country:"Switzerland",iso:"CH",stripLeadingZero:!0},{code:"+886",country:"Taiwan",iso:"TW",stripLeadingZero:!0},{code:"+992",country:"Tajikistan",iso:"TJ"},{code:"+255",country:"Tanzania",iso:"TZ",stripLeadingZero:!0},{code:"+66",country:"Thailand",iso:"TH",stripLeadingZero:!0},{code:"+670",country:"Timor-Leste",iso:"TL"},{code:"+228",country:"Togo",iso:"TG"},{code:"+690",country:"Tokelau",iso:"TK"},{code:"+676",country:"Tonga",iso:"TO"},{code:"+1",country:"Trinidad & Tobago",iso:"TT"},{code:"+216",country:"Tunisia",iso:"TN"},{code:"+90",country:"Turkey",iso:"TR",stripLeadingZero:!0},{code:"+993",country:"Turkmenistan",iso:"TM"},{code:"+1",country:"Turks & Caicos Islands",iso:"TC"},{code:"+688",country:"Tuvalu",iso:"TV"},{code:"+256",country:"Uganda",iso:"UG",stripLeadingZero:!0},{code:"+380",country:"Ukraine",iso:"UA",stripLeadingZero:!0},{code:"+971",country:"United Arab Emirates",iso:"AE",stripLeadingZero:!0},{code:"+1",country:"United States",iso:"US"},{code:"+598",country:"Uruguay",iso:"UY"},{code:"+998",country:"Uzbekistan",iso:"UZ"},{code:"+678",country:"Vanuatu",iso:"VU"},{code:"+39",country:"Vatican City",iso:"VA"},{code:"+58",country:"Venezuela",iso:"VE",stripLeadingZero:!0},{code:"+84",country:"Vietnam",iso:"VN",stripLeadingZero:!0},{code:"+681",country:"Wallis & Futuna",iso:"WF"},{code:"+967",country:"Yemen",iso:"YE"},{code:"+260",country:"Zambia",iso:"ZM",stripLeadingZero:!0},{code:"+263",country:"Zimbabwe",iso:"ZW"}],N=[b.find(function(e){return"GB"===e.iso})].concat((0,f._)(b.filter(function(e){return"GB"!==e.iso}).sort(function(e,n){return e.country.localeCompare(n.country)}))),formatLocalNumber=function(e,n){var o=e.replace(/\D/g,"");return n.stripLeadingZero&&o.startsWith("0")&&(o=o.slice(1)),o},parsePhoneValue=function(e){if(!e)return{iso:"GB",localNumber:""};var n=(0,f._)(b).sort(function(e,n){return n.code.length-e.code.length}).find(function(n){return e.startsWith(n.code)});return n?{iso:n.iso,localNumber:e.slice(n.code.length).replace(/\s/g,"")}:{iso:"GB",localNumber:e.replace(/^\+?\d{1,4}/,"").replace(/\s/g,"")}},isValidDigitLength=function(e,n){if(!e)return!0;var o=formatLocalNumber(e,n);if(!o||!n.nationalNumberLength)return!0;var t=(0,s._)(Array.isArray(n.nationalNumberLength)?n.nationalNumberLength:[n.nationalNumberLength,n.nationalNumberLength],2),i=t[0],r=t[1];return o.length>=i&&o.length<=r},PhoneInputField=function(e){var n=parsePhoneValue(e.value),o=(0,s._)((0,d.useState)(n.iso),2),t=o[0],i=o[1],r=(0,s._)((0,d.useState)(n.localNumber),2),a=r[0],c=r[1],u=(0,s._)((0,d.useState)(!1),2),g=u[0],m=u[1],p=(0,s._)((0,d.useState)(!1),2),h=p[0],y=p[1],x=b.find(function(e){return e.iso===t})||b[0];return(0,d.useEffect)(function(){var n,o=formatLocalNumber(a,x),t=o?"".concat(x.code).concat(o):"";null===(n=e.onChange)||void 0===n||n.call(e,t)},[t,a]),(0,d.useEffect)(function(){if(!g){var n=parsePhoneValue(e.value);(n.iso!==t||n.localNumber!==a)&&(i(n.iso),c(n.localNumber))}},[e.value]),(0,l.jsxs)("div",{className:e.className,children:[(0,l.jsxs)("label",{className:"block mb-1 text-[12px] leading-[18px]",htmlFor:e.id,children:[e.label.title,e.required?" *":""]}),(0,l.jsxs)("div",{className:"flex border ".concat(e.invalid||h?"error-border":"border-grey-200"),children:[(0,l.jsxs)("div",{className:"relative bg-grey-50 border-r border-grey-200",children:[(0,l.jsx)("div",{className:"px-2 py-3 pr-6 copy--small pointer-events-none select-none",children:x.code}),(0,l.jsx)("select",{value:t,onChange:function(e){i(e.target.value),y(!1)},className:"absolute inset-0 w-full h-full opacity-0 cursor-pointer","aria-label":"Country code",children:N.map(function(e){return(0,l.jsxs)("option",{value:e.iso,children:[e.country," (",e.code,")"]},e.iso)})}),(0,l.jsx)("svg",{className:"absolute right-1 top-1/2 -translate-y-1/2 pointer-events-none",width:"12",height:"12",viewBox:"0 0 12 12",children:(0,l.jsx)("path",{fill:"#666",d:"M6 8L1 3h10z"})})]}),(0,l.jsx)("input",{type:"tel",id:e.id,name:e.id,required:e.required,placeholder:x.stripLeadingZero?"7123 456789":"123 456789",className:"flex-1 p-3 copy--small border-none outline-none min-w-0",value:a,onChange:function(e){m(!0),y(!1),c(e.target.value)},onBlur:function(){m(!1),y(!isValidDigitLength(a,x))},autoComplete:"tel-national"})]}),(e.invalid||h)&&(0,l.jsx)(v.w,{text:e.invalidMessage,className:"mt-1"})]})},_=o(86303),j={AIR:["AIRPORT"],SEA:["PORT"],RAIL:[],OTHER:["HOTEL","LOCATION","OTHER"]},k=["TRANSFER_DEPARTURE_MODE","TRANSFER_AIR_DEPARTURE_","TRANSFER_PORT_DEPARTURE_","TRANSFER_RAIL_DEPARTURE_","TRANSFER_DEPARTURE_DATE","TRANSFER_DEPARTURE_TIME","TRANSFER_DEPARTURE_PICKUP","TRANSFER_DEPARTURE_DROP_OFF"];function isTransferQuestion(e){return!!e&&("PICKUP_POINT"===e||e.startsWith("TRANSFER_"))}function shouldShowQuestionByDependsOn(e,n){return!e.dependsOn||(Array.isArray(e.dependsOn)?e.dependsOn:[e.dependsOn]).some(function(e){var o=n.find(function(n){return n.id===e.questionId});return(null==o?void 0:o.answer)!=null&&e.values.includes(String(o.answer))})}function getMeetingPoint(e){if(!e)return null;var n=null==e?void 0:e.metadata,o=null==n?void 0:n.startLocations;if(o&&o.length>0){var t,i,r,s,a,c=o[0],l=[null===(t=c.address)||void 0===t?void 0:t.street,null===(i=c.address)||void 0===i?void 0:i.city,null===(r=c.address)||void 0===r?void 0:r.state,null===(s=c.address)||void 0===s?void 0:s.postcode,null===(a=c.address)||void 0===a?void 0:a.country].filter(
1Boolean);return{name:c.name,address:l.join(", "),description:c.description}}return null}function MeetingAndPickupSection(e){var n,o,t,a=e.pickupQuestion,c=e.arrivalModeQuestion,u=e.arrivalQuestions,g=e.allQuestions,m=e.onQuestionChange,p=e.errors,h=(0,s._)((0,d.useState)((null==a?void 0:a.answer)!=="MEET_AT_DEPARTURE_POINT"),2),y=h[0],x=h[1],f=getMeetingPoint(a),v=(null==a?void 0:null===(n=a.metadata)||void 0===n?void 0:n.allowCustomTravelerPickup)===!0,b=(null==c?void 0:c.answer)?String(c.answer):null,N=((null==a?void 0:a.options)||[]).some(function(e){return"MEET_AT_DEPARTURE_POINT"===e.id});if(!a&&!f)return null;var k=(0,d.useMemo)(function(){if(!a||!b)return a;var e=j[b]||[];if(0===e.length)return(0,r._)((0,i._)({},a),{options:[]});var n=(a.options||[]).filter(function(n){if("MEET_AT_DEPARTURE_POINT"===n.id)return!1;var o,t=null===(o=n.metadata)||void 0===o?void 0:o.pickupType;return!t||e.includes(t)});return(0,r._)((0,i._)({},a),{options:n})},[a,b]),w=u.filter(function(e){return shouldShowQuestionByDependsOn(e,g)}),C=p.some(function(e){return e.questionId===(null==a?void 0:a.questionId)||e.questionId===(null==c?void 0:c.questionId)||w.some(function(n){return e.questionId===n.questionId})}),S=b&&(null!==(t=null==k?void 0:null===(o=k.options)||void 0===o?void 0:o.length)&&void 0!==t?t:0)>0;return(0,l.jsxs)("div",{className:"mb-6",children:[(0,l.jsx)("h3",{className:"mb-1 font-semibold text-base",children:"Meeting and pickup"}),(0,l.jsx)("p",{className:"mb-3 text-grey-500 text-sm",children:"You can make your own way to the meeting point or request pickup."}),(0,l.jsxs)("div",{className:"bg-white border rounded-lg ".concat(C?"border-urgency-red":"border-grey-200"),children:[(0,l.jsxs)("div",{className:"p-4 cursor-pointer ".concat(y?"bg-grey-50":""," border-b border-grey-100"),onClick:function(){!y&&(x(!0),a&&m(a.questionId,""))},children:[(0,l.jsxs)("label",{className:"flex items-center gap-3 cursor-pointer",children:[(0,l.jsx)("div",{className:"relative w-5 h-5 rounded-full border-2 flex-shrink-0 ".concat(y?"border-purple":"border-grey-400"),children:y&&(0,l.jsx)("div",{className:"absolute inset-1 bg-purple rounded-full"})}),(0,l.jsx)("span",{className:"font-medium text-sm",children:"I'd like to be picked up"})]}),y&&(0,l.jsxs)("div",{className:"mt-4 pl-8 flex flex-col gap-3",children:[c&&(0,l.jsx)(_.Y,{question:(0,r._)((0,i._)({},c),{required:!0}),onChange:function(e){c&&m(c.questionId,e),a&&m(a.questionId,"")},invalid:p.some(function(e){return e.questionId===c.questionId})}),S&&k&&(0,l.jsx)(SearchableLocationPicker,{question:(0,r._)((0,i._)({},k),{required:!0}),onChange:function(e){a&&m(a.questionId,e)},invalid:p.some(function(e){return e.questionId===(null==a?void 0:a.questionId)}),allowCustom:v}),w.map(function(e){return(0,l.jsx)(_.Y,{question:(0,r._)((0,i._)({},e),{required:!0}),onChange:function(n){return m(e.questionId,n)},invalid:p.some(function(n){return n.questionId===e.questionId})},e.questionId)})]})]}),N&&(0,l.jsxs)("div",{className:"p-4 cursor-pointer ".concat(y?"":"bg-grey-50"),onClick:function(){x(!1),a&&m(a.questionId,"MEET_AT_DEPARTURE_POINT"),c&&m(c.questionId,"")},children:[(0,l.jsxs)("label",{className:"flex items-center gap-3 cursor-pointer",children:[(0,l.jsx)("div",{className:"relative w-5 h-5 rounded-full border-2 flex-shrink-0 ".concat(y?"border-grey-400":"border-purple"),children:!y&&(0,l.jsx)("div",{className:"absolute inset-1 bg-purple rounded-full"})}),(0,l.jsx)("span",{className:"font-medium text-sm",children:"I'll make my own way to the meeting point"})]}),!y&&f&&(0,l.jsx)("div",{className:"mt-4 pl-8",children:(0,l.jsxs)("div",{className:"flex gap-3 items-start",children:[(0,l.jsx)("div",{className:"flex-shrink-0 mt-0.5",children:(0,l.jsx)("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,l.jsx)("path",{d:"M12 2C8.13 2 5 5.13 5 9C5 14.25 12 22 12 22C12 22 19 14.25 19 9C19 5.13 15.87 2 12 2ZM12 11.5C10.62 11.5 9.5 10.38 9.5 9C9.5 7.62 10.62 6.5 12 6.5C13.38 6.5 14.5 7.62 14.5 9C14.5 10.38 13.38 11.5 12 11.5Z",fill:"#6B21A8"})})}),(0,l.jsxs)("div",{className:"text-sm text-grey-700",children:[(0,l.jsx)("span",{className:"font-medium",children:f.name}),f.address&&(0,l.jsxs)("span",{children:[", ",f.address]})]})]})})]})]})]})}function SearchableLocationPicker(e){var n=e.question,o=e.onChange,t=e.invalid,i=e.allowCustom,r=(0,s._)((0,d.useState)(!1),2),a=r[0],c=r[1],u=(0,s._)((0,d.useState)(""),2),g=u[0],m=u[1],p=(0,s._)((0,d.useState)(!1),2),h=p[0],y=p[1],x=(0,s._)((0,d.useState)(""),2),f=x[0],v=x[1],b=(0,d.useRef)(null),N=(0,d.useRef)(null),_=n.options||[],j=(0,d.useMemo)(function(){if(!g)return _;var e=g.toLowerCase();return _.filter(function(n){var o,t;return(null===(o=n.name)||void 0===o?void 0:o.toLowerCase().includes(e))||(null===(t=n.description)||void 0===t?void 0:t.toLowerCase().includes(e))})},[_,g]),k=_.find(function(e){return e.id===n.answer});(0,d.useEffect)(function(){var handleClickOutside=function(e){N.current&&!N.current.contains(e.target)&&c(!1)};return document.addEventListener("mousedown",handleClickOutside),function(){return document.removeEventListener("mousedown",handleClickOutside)}},[]);var handleSelectOption=function(e){y(!1),m(""),c(!1),o(e)},handleInputFocus=function(){c(!0)},w=a?g:(null==k?void 0:k.name)||(h?"Other (enter address)":"");return(0,l.jsxs)("div",{children:[(0,l.jsxs)("label",{className:"block mb-1 text-[12px] leading-[18px]",htmlFor:n.questionId,children:[n.label,n.required?" *":""]}),(0,l.jsxs)("div",{className:"relative",ref:N,children:[(0,l.jsxs)("div",{className:"relative",children:[a||!k||h?(0,l.jsx)("input",{ref:b,type:"text",id:n.questionId,placeholder:"Search location",className:"p-3 pr-10 border rounded-lg w-full copy--small".concat(t?" border-urgency-red":" border-grey-200"),value:w,onChange:function(e){m(e.target.value),c(!0)},onFocus:handleInputFocus,autoComplete:"off"}):(0,l.jsxs)("button",{type:"button",onClick:handleInputFocus,className:"p-3 pr-10 border rounded-lg w-full text-left flex items-center gap-1 copy--small overflow-hidden".concat(t?" border-urgency-red":" border-grey-200"),children:[(0,l.jsx)("span",{className:"text-grey-900 flex-shrink-0",children:k.name}),k.description&&(0,l.jsxs)("span",{className:"text-grey-400 truncate min-w-0",children:[", ",k.description]})]}),(0,l.jsx)("div",{className:"absolute right-3 top-1/2 -translate-y-1/2 pointer-events-none",children:(0,l.jsx)("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,l.jsx)("path",{d:"M15.5 14H14.71L14.43 13.73C15.41 12.59 16 11.11 16 9.5C16 5.91 13.09 3 9.5 3C5.91 3 3 5.91 3 9.5C3 13.09 5.91 16 9.5 16C11.11 16 12.59 15.41 13.73 14.43L14 14.71V15.5L19 20.49L20.49 19L15.5 14ZM9.5 14C7.01 14 5 11.99 5 9.5C5 7.01 7.01 5 9.5 5C11.99 5 14 7.01 14 9.5C14 11.99 11.99 14 9.5 14Z",fill:"#9CA3AF"})})})]}),a&&(0,l.jsxs)("div",{className:"absolute z-50 mt-1 w-full bg-white border border-grey-200 rounded-lg shadow-lg max-h-64 overflow-y-auto",children:[0===j.length&&!i&&(0,l.jsx)("div",{className:"p-3 text-sm text-grey-500",children:"No locations foun
1d"}),j.map(function(e){var n,o=null===(n=e.metadata)||void 0===n?void 0:n.pickupType;return(0,l.jsxs)("button",{type:"button",className:"w-full py-2 px-3 text-left hover:bg-grey-50 flex gap-2 items-start border-b border-grey-100 last:border-b-0",onClick:function(){return handleSelectOption(e.id)},children:["AIRPORT"===o?(0,l.jsx)("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"flex-shrink-0",children:(0,l.jsx)("path",{d:"M21 16V14L13 9V3.5C13 2.67 12.33 2 11.5 2C10.67 2 10 2.67 10 3.5V9L2 14V16L10 13.5V19L8 20.5V22L11.5 21L15 22V20.5L13 19V13.5L21 16Z",fill:"#6B7280"})}):"PORT"===o?(0,l.jsx)("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"flex-shrink-0",children:(0,l.jsx)("path",{d:"M20 21C18.61 21 17.22 20.53 16 19.67C13.56 21.38 10.44 21.38 8 19.67C6.78 20.53 5.39 21 4 21H2V19H4C5.37 19 6.74 18.65 8 17.96C10.5 19.33 13.5 19.33 16 17.96C17.26 18.65 18.63 19 20 19H22V21H20ZM3.95 19H4C4.37 19 4.72 18.93 5.05 18.82L5.59 18.58L6.25 18.18C7.52 17.5 8.92 17.14 10.36 17.14C10.9 17.14 11.44 17.21 11.97 17.33L12.5 17.47L3 11.5V19H3.95ZM12 8L21 15V3H3V10.92L12 8Z",fill:"#6B7280"})}):(0,l.jsx)("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"flex-shrink-0",children:(0,l.jsx)("path",{d:"M15 11V5L12 2L9 5V7H3V21H21V11H15ZM7 19H5V17H7V19ZM7 15H5V13H7V15ZM7 11H5V9H7V11ZM13 19H11V17H13V19ZM13 15H11V13H13V15ZM13 11H11V9H13V11ZM13 7H11V5H13V7ZM19 19H17V17H19V19ZM19 15H17V13H19V15Z",fill:"#6B7280"})}),(0,l.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,l.jsx)("div",{className:"text-sm font-medium text-grey-900 truncate leading-snug",children:e.name}),e.description&&(0,l.jsx)("div",{className:"text-xs text-grey-500 truncate leading-snug",children:e.description})]})]},e.id)}),i&&(0,l.jsxs)("button",{type:"button",className:"w-full py-2 px-3 text-left hover:bg-grey-50 flex gap-2 items-center border-t border-grey-200",onClick:function(){y(!0),m(""),c(!1),o("")},children:[(0,l.jsx)("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"flex-shrink-0",children:(0,l.jsx)("path",{d:"M19 13H13V19H11V13H5V11H11V5H13V11H19V13Z",fill:"#6B7280"})}),(0,l.jsx)("span",{className:"text-sm font-medium text-grey-700",children:"Other (enter address)"})]})]})]}),h&&(0,l.jsx)("input",{type:"text",placeholder:"Enter your pickup address",className:"mt-2 p-3 border rounded-lg w-full copy--small".concat(t?" border-urgency-red":" border-grey-200"),value:f,onChange:function(e){v(e.target.value),o(e.target.value)},autoFocus:!0})]})}function ArrivalDetailsSection(e){var n=e.questions,o=e.allQuestions,t=e.onQuestionChange,i=e.errors,r=n.filter(function(e){return!e.dependsOn||shouldShowQuestionByDependsOn(e,o)});if(0===r.length)return null;var s=r.some(function(e){return i.some(function(n){return n.questionId===e.questionId})});return(0,l.jsxs)("div",{className:"mb-6",children:[(0,l.jsx)("h3",{className:"mb-1 font-semibold text-base",children:"Arrival details"}),(0,l.jsx)("p",{className:"mb-3 text-grey-500 text-sm",children:"Provide your arrival details for the transfer."}),(0,l.jsx)("div",{className:"bg-white border rounded-lg p-4 ".concat(s?"border-urgency-red":"border-grey-200"),children:(0,l.jsx)("div",{className:"flex flex-col gap-3",children:r.map(function(e){return(0,l.jsx)(_.Y,{question:e,onChange:function(n){return t(e.questionId,n)},invalid:i.some(function(n){return n.questionId===e.questionId})},e.questionId)})})})]})}function DepartureSection(e){var n=e.questions,o=e.allQuestions,t=e.onQuestionChange,a=e.errors,c=(0,s._)((0,d.useState)(!1),2),u=c[0],g=c[1],m=n.filter(function(e){return shouldShowQuestionByDependsOn(e,o)}),p=(0,f._)(m).sort(function(e,n){return"TRANSFER_DEPARTURE_MODE"===e.id?-1:"TRANSFER_DEPARTURE_MODE"===n.id?1:(e.label||"").localeCompare(n.label||"")});if(0===p.length)return null;var h=u&&p.some(function(e){return a.some(function(n){return n.questionId===e.questionId})});return(0,l.jsxs)("div",{className:"mb-6",children:[(0,l.jsx)("h3",{className:"mb-1 font-semibold text-base",children:"Departure details"}),(0,l.jsx)("p",{className:"mb-3 text-grey-500 text-sm",children:"Provide your departure details if you have it scheduled for tour day."}),(0,l.jsxs)("div",{className:"bg-white border rounded-lg overflow-hidden ".concat(h?"border-urgency-red":"border-grey-200"),children:[(0,l.jsxs)("div",{className:"p-4 cursor-pointer ".concat(u?"bg-grey-50":""," border-b border-grey-100"),onClick:function(){return g(!0)},children:[(0,l.jsxs)("label",{className:"flex items-center gap-3 cursor-pointer",children:[(0,l.jsx)("div",{className:"relative w-5 h-5 rounded-full border-2 flex-shrink-0 ".concat(u?"border-purple":"border-grey-400"),children:u&&(0,l.jsx)("div",{className:"absolute inset-1 bg-purple roun
1ded-full"})}),(0,l.jsx)("span",{className:"font-medium text-sm",children:"My departure info"})]}),u&&(0,l.jsx)("div",{className:"mt-4 pl-8 flex flex-col gap-3",children:p.map(function(e){return(0,l.jsx)(_.Y,{question:(0,r._)((0,i._)({},e),{required:!0}),onChange:function(n){return t(e.questionId,n)},invalid:a.some(function(n){return n.questionId===e.questionId})},e.questionId)})})]}),(0,l.jsx)("div",{className:"p-4 cursor-pointer ".concat(u?"":"bg-grey-50"),onClick:function(){g(!1);var e=p.find(function(e){return"TRANSFER_DEPARTURE_MODE"===e.id});e&&t(e.questionId,"")},children:(0,l.jsxs)("label",{className:"flex items-center gap-3 cursor-pointer",children:[(0,l.jsx)("div",{className:"relative w-5 h-5 rounded-full border-2 flex-shrink-0 ".concat(u?"border-grey-400":"border-purple"),children:!u&&(0,l.jsx)("div",{className:"absolute inset-1 bg-purple rounded-full"})}),(0,l.jsx)("span",{className:"font-medium text-sm",children:"Doesn't apply to me"})]})})]})]})}function MeetAtDeparturePointDisplay(e){var n=e.meetingPoint;return(0,l.jsxs)("div",{className:"mb-6",children:[(0,l.jsx)("h3",{className:"mb-1 font-semibold text-base",children:"Meeting point"}),(0,l.jsx)("div",{className:"bg-white border border-grey-200 rounded-lg p-4",children:(0,l.jsxs)("div",{className:"flex gap-3 items-start",children:[(0,l.jsx)("div",{className:"flex-shrink-0 mt-0.5",children:(0,l.jsx)("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,l.jsx)("path",{d:"M12 2C8.13 2 5 5.13 5 9C5 14.25 12 22 12 22C12 22 19 14.25 19 9C19 5.13 15.87 2 12 2ZM12 11.5C10.62 11.5 9.5 10.38 9.5 9C9.5 7.62 10.62 6.5 12 6.5C13.38 6.5 14.5 7.62 14.5 9C14.5 10.38 13.38 11.5 12 11.5Z",fill:"#6B21A8"})})}),(0,l.jsxs)("div",{className:"text-sm text-grey-700",children:[(0,l.jsx)("span",{className:"font-medium",children:n.name}),n.address&&(0,l.jsxs)("span",{children:[", ",n.address]}),n.description&&(0,l.jsx)("p",{className:"mt-1 text-grey-500 text-xs",children:n.description})]})]})})]})}function TransferQuestionsSection(e){var n,o=e.questions,t=e.allQuestions,i=e.onQuestionChange,r=e.errors,s=e.className,a=o.find(function(e){return"PICKUP_POINT"===e.id}),c=o.find(function(e){return"TRANSFER_ARRIVAL_MODE"===e.id}),u=(null==c?void 0:c.answer)?String(c.answer):null,g=(null===(n=o.find(function(e){return"TRANSFER_DEPARTURE_MODE"===e.id}))||void 0===n?void 0:n.answer)?String(o.find(function(e){return"TRANSFER_DEPARTURE_MODE"===e.id}).answer):null,m="SEA"!==u&&"SEA"===g,p=(0,d.useMemo)(function(){return o.filter(function(e){return"PICKUP_POINT"!==e.id&&"TRANSFER_ARRIVAL_MODE"!==e.id&&"TRANSFER_MEETING_POINT"!==e.id&&!(m&&"TRANSFER_PORT_CRUISE_SHIP"===e.id)&&!k.some(function(n){return e.id===n||e.id.startsWith(n)})})},[o,m]),h=(0,d.useMemo)(function(){var e=o.filter(function(e){return k.some(function(n){return e.id===n||e.id.startsWith(n)})});if(m){var n=o.find(function(e){return"TRANSFER_PORT_CRUISE_SHIP"===e.id});n&&!e.some(function(e){return"TRANSFER_PORT_CRUISE_SHIP"===e.id})&&e.unshift(n)}return e},[o,m]),y=a||p.length>0,x=h.length>0;if(!y&&!x)return null;var f=getMeetingPoint(o.find(function(e){return"TRANSFER_MEETING_POINT"===e.id}));return(0,l.jsxs)("div",{className:s,children:[a&&(0,l.jsx)(MeetingAndPickupSection,{pickupQuestion:a,arrivalModeQuestion:c,arrivalQuestions:p,allQuestions:t,onQuestionChange:i,errors:r}),!a&&p.length>0&&(0,l.jsx)(ArrivalDetailsSection,{questions:p,allQuestions:t,onQuestionChange:i,errors:r}),x&&(0,l.jsx)(DepartureSection,{questions:h,allQuestions:t,onQuestionChange:i,errors:r}),f&&(0,l.jsx)(MeetAtDeparturePointDisplay,{meetingPoint:f})]})}function UserInputCheckbox(e){return(0,l.jsxs)("div",{className:e.className,children:[e.label.title&&(0,l.jsx)("span",{className:"mb-2 font-medium copy--small",children:e.label.title}),(0,l.jsxs)("div",{className:"flex flex-wrap justify-between items-center",children:[(0,l.jsx)("input",{type:"checkbox",id:e.id,name:e.id,onChange:e.onChange,checked:e.checked}),(0,l.jsx)("label",{htmlFor:e.id,className:"pl-3 w-[calc(100%-16px)] [&_a]:underline copy--small",children:e.label.description}
1),e.invalid&&(0,l.jsx)(v.w,{className:"w-full"})]})]})}var UserSelectField=function(e){return(0,l.jsxs)("div",{className:e.className,children:[(0,l.jsx)("label",{className:"mb-1 font-semibold copy--small",htmlFor:e.id,children:e.label.title}),(0,l.jsxs)("div",{className:"select-wrapper",children:[(0,l.jsxs)("select",{id:e.id,name:e.id,required:e.required,placeholder:e.placeholder,className:"p-3 border rounded-lg appearance-none w-full copy--small".concat(e.invalid?" border-urgency-red":" border-grey-200"," "),onChange:e.onChange,value:e.value||"",children:[(0,l.jsx)("option",{value:"",disabled:!0,children:e.placeholder}),e.options.map(function(e){return(0,l.jsx)("option",{value:e.id,children:e.name},e.id)})]}),(0,l.jsx)("img",{src:"https://res.dayoutwiththekids.co.uk/image/upload/v1738229194/components/icons/chevron_y7rqta.svg",alt:"Chevron",width:"16",height:"17"})]}),e.invalid&&(0,l.jsx)(v.w,{text:e.invalidMessage})]})};function getBrowserCookie(e){if("object"==typeof document&&"string"==typeof document.cookie)for(var n=e+"=",o=decodeURIComponent(document.cookie).split(";"),t=0;t<o.length;t++){for(var i=o[t];" "===i.charAt(0);)i=i.substring(1);if(0===i.indexOf(n))return i.substring(n.length,i.length)}}var w=o(85283),C=o(98130),S=o(34035),I=o(99162),L=o(36764),E=o(96028),T=o(88626),M=o(12343),P=(0,d.lazy)(function(){return o.e(7429).then(o.bind(o,47429))}),A=(0,d.lazy)(function(){return o.e(5508).then(o.bind(o,95508))}),calculateCustomFieldsCost=function(e,n){var o=0,calculateQuestionCost=function(e){if("select"===e.type&&e.answer&&e.options){var n,o,t,i=e.options.find(function(n){return n.id===e.answer});return(null==i?void 0:i.is_priced)&&(null===(t=i.pricing)||void 0===t?void 0:t.total_including_tax)?i.pricing.total_including_tax:0}return e.is_priced?"boolean"===e.type&&(!0===e.answer||"true"===e.answer)?(null===(n=e.pricing)||void 0===n?void 0:n.total_including_tax)||0:"number"===e.type&&"number"==typeof e.answer&&e.answer>0?((null===(o=e.pricing)||void 0===o?void 0:o.total_including_tax)||0)*e.answer:0:0},t=!0,i=!1,r=void 0;try{for(var s,a=e[Symbol.iterator]();!(t=(s=a.next()).done);t=!0){var c=s.value,l=!0,d=!1,u=void 0;try{for(var g,m=c.questions[Symbol.iterator]();!(l=(g=m.next()).done);l=!0){var p=g.value;o+=calculateQuestionCost(p)}}catch(e){d=!0,u=e}finally{try{l||null==m.return||m.return()}finally{if(d)throw u}}}}catch(e){i=!0,r=e}finally{try{t||null==a.return||a.return()}finally{if(i)throw r}}var h=!0,y=!1,x=void 0;try{for(var f,v=n[Symbol.iterator]();!(h=(f=v.next()).done);h=!0){var b=f.value;o+=calculateQuestionCost(b)}}catch(e){y=!0,x=e}finally{try{h||null==v.return||v.return()}finally{if(y)throw x}}return Math.round(100*o)/100},shouldShowQuestion=function(e,n){if(e.dependsOn){var o=Array.isArray(e.dependsOn)?e.dependsOn:[e.dependsOn],t=!0,i=!1,r=void 0;try{for(var s,c=o[Symbol.iterator]();!(t=(s=c.next()).done);t=!0){var l=function(){var e=s.value,o=n.find(function(n){return n.id===e.questionId});if(!(null==o?void 0:o.answer)||!e.values.includes(String(o.answer)))return{v:!1}}();if("object"===(0,a._)(l))return l.v}}catch(e){i=!0,r=e}finally{try{t||null==c.return||c.return()}finally{if(i)throw r}}}return!0},q=!0,CheckoutReducer=function(e,n){if((e.loading.discountCode||e.loading.paymentUrl)&&"set_errors"!==n.type)return e;switch(n.type){case"set_booking_email":return(0,r._)((0,i._)({},e),{bookingEmail:n.bookingEmail,errors:[]});case"set_booking_first_name":return(0,r._)((0,i._)({},e),{bookingFirstName:n.bookingFirstName,errors:[]});case"set_booking_last_name":return(0,r._)((0,i._)({},e),{bookingLastName:n.bookingLastName,errors:[]});case"set_booking_phone":return(0,r._)((0,i._)({},e),{bookingPhoneNo:n.bookingPhoneNo,errors:[]});case"set_newsletter":return(0,r._)((0,i._)({},e),{newsletter:n.newsletter});case"set_terms_and_conditions":return(0,r._)((0,i._)({},e),{termsAndConditions:n.termsAndConditions,errors:[]});case"set_discount_code":return(0,r._)((0,i._)({},e),{disCountCode:{code:n.code,applied:!1},errors:[]});case"set_errors":return(0,r._)((0,i._)({},e),{loading:{paymentUrl:!1,discountCode:!1},errors:n.errors});case"set_payment_url_loading":return(0,r._)((0,i._)({},e),{loading:(0,r._)((0,i._)({},e.loading),{paymentUrl:!0})});case"set_discount_code_loading":return(0,r._)((0,i._)({},e),{loading:(0,r._)((0,i._)({},e.loading),{discountCode:!0})});case"set_payment_url":return(0,r._)((0,i._)({},e),{paymentUrl:n.paymentUrl,loading:(0,r._)((0,i._)({},e.loading),{paymentUrl:!1})});case"set_delivery_method":return(0,r._)((0,i._)({},e),{deliveryMethodId:n.deliveryMethodId,errors:[]});case"set_selected_language_guide":return(0,r._)((0,i._)({},e),{selectedLanguageGuide:n.selectedLanguageGuide,errors:[]});case"restore_user_inputs":var o,t,s,a,c,l,d;return(0,r._)((0,i._)({},e),{bookingFirstName:null!==(o=n.bookingFirstName)&&void 0!==o?o:e.bookingFirstName,bookingLastName:null!==(t=n.bookingLastName)&&void 0!==t?t:e.bookingLastName,bookingPhoneNo:null!==(s=n.bookingPhoneNo)&&void 0!==s?s:e.bookingPhoneNo,bookingEmail:null!==(a=n.bookingEmail)&&void 0!==a?a:e.bookingEmail,selectedLanguageGuide:null!==(c=n.selectedLanguageGuide)&&void 0!==c?c:e.selectedLanguageGuide,termsAndConditions:null!==(l=n.termsAndConditions)&&void 0!==l?l:e.termsAndConditions,deliveryMethodId:null!==(d=n.deliveryMethodId)&&void 0!==d?d:e.deliveryMethodId});case"set_terms_and_conditions_modal":return(0,r._)((0,i._)({},e),{termsAndConditionsModal:n.show,errors:[]});case"accepted_terms_and_conditions_via_modal":return(0,r._)((0,i._)({},e),{termsAndConditionsModal:!1,termsAndConditions:!0,errors:[]});case"update_traveler_question":var g=n.travelerId,m=n.questionId,p=n.value,h=e.travelers.find(function(e){return e.travelerId===g});if(!h)return(0,r._)((0,i._)({},e),{errors:[{type:u.t.BookingQuestionError,message:"An error occurred while attempting to update traveler question"}]});var y=null==h?void 0:h.questions.findIndex(function(e){return e.questionId===m});h&&void 0!==y&&y>=0&&("object"==typeof p&&null!==p&&"unit"in p?(h.questions[y].answer=p.value,h.questions[y].unit=p.unit):h.questions[y].answer=p);var x=e.travelers.map(function(e){return e.travelerId===g&&h?h:e});return(0,r._)((0,i._)({},e),{travelers:x,customFieldsCost:calculateCustomFieldsCost(x,e.additionalBookingQuestions)});case"update_additional_questions":var f=n.questionId,v=n.value;if(!e.additionalBookingQuestions.some(function(e){return e.questionId===f}))return(0,r._)((0,i._)({},e),{errors:[{type:u.t.BookingQuestionError,message:"An error occurred while attempting to update an additional question"}]});var b=e.additionalBookingQuestions.map(function(e){return e.questionId!==f?e:"object"==typeof v&&null!==v&&"unit"in v?(0,r._)((0,i._)({},e),{answer:v.value,unit:v.unit}):(0,r._)((0,i._)({},e),{answer:v})});return(0,r._)((0,i._)({},e),{additionalBookingQuestions:b,customFieldsCost:calculateCustomFieldsCost(e.travelers,b)})}throw Error("Unknown action: "+n.type)};function Checkout(e){var n,o=(0,d.useRef)(!1),a=(0,s._)((0,d.useReducer)(CheckoutReducer,e.initialCheckoutState),2),f=a[0],v=a[1],b=(0,s._)((0,d.useState)(!1),2),N=b[0],j=b[1],k=null!==e.totalUndiscountedCost;(0,d.useEffect)(function(){var e="checkout_inputs_".concat(f.bookingId);try{var n=sessionStorage.getItem(e);if(n){var o=JSON.parse(n);v((0,i._)({type:"restore_user_inputs"},o))}}catch(e){}},[]);var C=[u.t.BookingFirstNameError,u.t.BookingLastNameError,u.t.BookingEmailError,u.t.BookingPhoneNoError,u.t.DeliveryMethodNotSelected,u.t.LanguageGuideNotSelected,u.t.TermsAndConditionsNotAccepted,u.t.BookingQuestionError];(0,d.useEffect)(function(){f.errors.length>1?f.errors.filter(function(e){return C.includes(e.type)}).length>2?(0,S.Sl)({trackingProps:f.trackingProps,error:{type:u.t.MultipleUserInputFields,message:""}}
1):f.errors.forEach(function(e){(0,S.Sl)({trackingProps:f.trackingProps,error:e})}):1===f.errors.length&&(0,S.Sl)({trackingProps:f.trackingProps,error:f.errors[0]})},[f]),(0,d.useEffect)(function(){o.current||((0,S.YN)({eventName:"view_checkout",trackingProps:(0,r._)((0,i._)({},f.trackingProps),{currency:"GBP",value:e.totalCost}),bookingDetails:e.bookingDetails}),o.current=!0)},[]),(0,t._)(function(){var e,n,o,t;return(0,c.Jh)(this,function(i){switch(i.label){case 0:if(!f.disCountCode.code)return v({type:"set_errors",errors:[{message:"Please enter a discount code",type:u.t.DiscountCodeError}]}),[2];i.label=1;case 1:return i.trys.push([1,7,,8]),v({type:"set_discount_code_loading",loading:!0}),e={},[4,function(){var e,n=arguments.length>0&&void 0!==arguments[0]&&arguments[0],o=!(arguments.length>1)||void 0===arguments[1]||arguments[1],t=getBrowserCookie("jwt");if(t){if(e=t,o){var i,r=(i=t.split(".")[1].replace(/-/g,"+").replace(/_/g,"/"),JSON.parse(decodeURIComponent(window.atob(i).split("").map(function(e){return"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2)}).join(""))));e=r?r.id:null}}else n||(e=function(e){var n=getBrowserCookie("_ga");if(n)return function(e){if(e){var n=e.split(".").slice(-2);if(2===n.length)return n.join("-")}}(n)}(0));return e}(!0,!1)];case 2:return(n=i.sent())&&(e.Authorization="Bearer ".concat(n)),[4,fetch("/api/ticketing/apply-discount-code",{method:"POST",body:JSON.stringify({bookingId:f.bookingId,discountCode:f.disCountCode.code}),headers:e})];case 3:if(!(200!==(o=i.sent()).status))return[3,5];return[4,o.json()];case 4:return v({type:"set_errors",errors:[{message:i.sent().error,type:u.t.DiscountCodeError}]}),[2];case 5:return[4,o.json()];case 6:return t=i.sent().booking_id,window.location.href="/tickets/checkout/".concat(t,"?v=").concat(f.shortId),[3,8];case 7:return i.sent(),[3,8];case 8:return[2]}})});var q=(n=(0,t._)(function(n){var o,t,s,a,l;return(0,c.Jh)(this,function(c){switch(c.label){case 0:if(n.loading.paymentUrl)return[2];if(!(o=(0,w.mG)(n)).valid)return v({type:"set_errors",errors:o.errors}),[2];return v({type:"set_payment_url_loading"}),t=Math.round((e.totalCost+n.customFieldsCost)*100)/100,[4,fetch("/api/ticketing/v2/booking-payment-link",{method:"POST",body:JSON.stringify((0,r._)((0,i._)({},n),{expectedTotal:t}))})];case 1:if(!(200!==(s=c.sent()).status))return[3,3];return[4,s.json()];case 2:return v({type:"set_errors",errors:[c.sent()]}),[2];case 3:return[4,s.json()];case 4:if(!(a=c.sent().paymentUrl))return v({type:"set_errors",errors:[{type:"payment_link_error",message:"Something when wrong when generating the payment link. Please refresh and try again."}]}),[2];v({type:"set_payment_url",paymentUrl:a});try{l="checkout_inputs_".concat(n.bookingId),sessionStorage.setItem(l,JSON.stringify({bookingFirstName:n.bookingFirstName,bookingLastName:n.bookingLastName,bookingPhoneNo:n.bookingPhoneNo,bookingEmail:n.bookingEmail,selectedLanguageGuide:n.selectedLanguageGuide,termsAndConditions:n.termsAndConditions,deliveryMethodId:n.deliveryMethodId}))}catch(e){}return(0,S.YN)({eventName:"begin_checkout",trackingProps:(0,r._)((0,i._)({},n.trackingProps),{currency:"GBP",value:e.totalCost}),bookingDetails:e.bookingDetails,callback:function(){window.location=a}}),[2]}})}),function(e){return n.apply(this,arguments)}),timeoutSession=function(){j(!0)};return(0,d.useEffect)(function(){N&&(window.location.href="/tickets/order-cancelled/".concat(f.bookingId,"?reason=session_timeout"))},[N]),(0,t._)(function(e){return(0,c.Jh)(this,function(n){switch(n.label){case 0:if(confirm("Are you sure you want to cancel your reservation?"))return[3,1];return e.preventDefault(),[3,3];case 1:return[4,fetch("/api/ticketing/cancel-booking",{method:"POST",body:JSON.stringify({bookingId:f.bookingId})})];case 2:n.sent(),n.label=3;case 3:return[2]}})}),(0,l.jsxs)(g.Z,{head:e.head,dataLayer:e.dataLayer,disableAds:!0,adConfig:m.de,ticketJourney:!0,ticketJourneyStep:p.Xy.CHECKOUT,children:[(0,l.jsx)(ReservationTimer,{expiresAt:e.expiresAt,timeoutSession:timeoutSession,className:"lg:hidden"}),(0,l.jsxs)("div",{className:"lg:hidden bg-[#F9F7FD] p-4",children:[(0,l.jsx)("h1",{className:"mb-4 text-center headline-5--inter",children:"Order Summary"}),(0,l.jsx)(h.v,{title:e.attractionInfo.attractionTitle,logo:e.attractionInfo.attractionLogo,bookingDate:e.bookingDetails.date,admissionTime:e.bookingDetails.time||null,bookingDetails:e.bookingDetails,totalCost:e.totalCost,bookingFee:e.bookingFee,ticketType:e.ticketName,ticketId:e.ticketId,pricingGroup:e.pricingGroupName,className:"mb-3"})]}),(0,l.jsxs)("div",{className:"lg:flex 2xl:container",children:[(0,l.jsxs)("div",{className:"lg:order-1 lg:px-8 pt-6 border-[#DAC9FC] border-t lg:border-none lg:w-[calc(100%-475px)]",children:[(0,l.jsx)(ReservationTimer,{expiresAt:e.expiresAt,timeoutSession:timeoutSession,className:"hidden lg:block mb-6 border-none rounded-lg"}),(0,l.jsxs)("div",{className:"px-4 lg:px-0 pb-3",children:[(0,l.jsx)("h2",{className:"mb-6 headline-2--inter",children:"Your Details"}),(0,l.jsx)(M.Y,{memberDiscount:e.memberDiscountMeta,hasDiscountApplied:k,className:"mb-4"}),(0,l.jsx)(x.X,{id:"first_name",label:{title:"First Name",size:"large"},type:"text",required:!0,placeholder:"",onChange:function(e){v({type:"set_booking_first_name",bookingFirstName:e.target.value})},className:"mb-3",invalid:f.errors.some(function(e){return e.type===u.t.BookingFirstNameError}),invalidMessage:"Please enter first name",value:f.bookingFirstName}),(0,l.jsx)(x.X,{id:"last_name",label:{title:"Last Name",size:"large"},type:"text",required:!0,placeholder:"",onChange:function(e){v({type:"set_booking_last_name",bookingLastName:e.target.value})},className:"mb-3",invalid:f.errors.some(function(e){return e.type===u.t.BookingLastNameError}),invalidMessage:"Please enter last name",value:f.bookingLastName}),(0,l.jsx)(PhoneInputField,{id:"phone_no",label:{title:"Phone Number",size:"large"},required:!0,onChange:function(e){v({type:"set_booking_phone",bookingPhoneNo:e})},className:"mb-3",invalid:f.errors.some(function(e){return e.type===u.t.BookingPhoneNoError}),invalidMessage:"Please enter a valid phone number",value:f.bookingPhoneNo}),(0,l.jsx)(x.X,{id:"email",label:{title:"Email Address",size:"large"},type:"email",required:!0,placeholder:"",onChange:function(e){v({type:"set_booking_email",bookingEmail:e.target.value})},className:"mb-3",invalid:f.errors.some(function(e){return e.type===u.t.BookingEmailError}),invalidMessage:"Please enter a valid email address",value:f.bookingEmail}),f.languageGuides.length>0&&(0,l.jsx)(UserSelectField,{id:"languageGuide",label:{title:"Language Guide"},required:f.languageGuides.length>1,placeholder:"Select Language Guide",onChange:function(e){v({type:"set_selected_language_guide",selectedLanguageGuide:f.languageGuides.find(function(n){return"".concat(n.language,"-").concat(n.type)===e.target.value})||null})},invalid:f.errors.some(function(e){return e.type===u.t.LanguageGuideNotSelected}),options:f.languageGuides.map(function(e){return{id:"".concat(e.language,"-").concat(e.type),name:"".concat((0,p.vY)(e.language)," - ").concat(e.type.charAt(0)+e.type.slice(1).toLowerCase())}}),value:f.selectedLanguageGuide?"".concat(f.selectedLanguageGuide.language,"-").concat(f.selectedLanguageGuide.type):"",className:"mb-3"}),f.additionalBookingQuestions.filter(function(e){return isTransferQuestion(e.id)}).length>0&&(0,l.jsx)(TransferQuestionsSection,{questions:f.additionalBookingQuestions.filter(function(e){return isTransferQuestion(e.id)}),allQuestions:f.additionalBookingQuestions,onQuestionChange:function(e,n){return v({type:"update_additional_questions",questionId:e,value:n})},errors:f.errors}),f.additionalBookingQuestions.length>0&&f.additionalBookingQuestions.filter(function(e){return!isTransferQuestion(e.id)}).filter(function(e){return shouldShowQuestion(e,f.additionalBookingQuestions)}).map(function(e){return(0,l.jsx)(_.Y,{question:e,onChange:function(n){return v({type:"update_additional_questions",questionId:e.questionId,value:n})},invalid:f.errors.some(function(n){return n.questionId===e.questionId}),className:"mb-3"},e.questionId)})]}),f.travelers.length>0&&(0,l.jsx)("div",{className:"px-4 lg:px-0 pt-6 pb-3 border-grey-150 border-t",children:(0,l.jsxs)(d.Suspense,{children:[(0,l.jsx)("h2",{className:"mb-1 headline-2--inter",children:"Additional Questions"}),(0,l.jsx)(A,{travelers:f.travelers,checkoutState:f,checkoutDispatch:v,className:"mb-4"})]})}),e.showDescription&&e.ticketDescription&&(0,l.jsx)(L.x,{ticketDescription:e.ticketDescription,className:"hidden lg:block mb-6"}),e.cancellationPolicy&&(0,l.jsx)("div",{className:"hidden lg:block mb-6 px-4 lg:px-0",children:(0,l.jsx)(T.b,{cancellationPolicy:e.cancellationPolicy})})]}),(0,l.jsxs)("div",{className:"lg:order-2 bg-[#F9F7FD] p-4 xl:px-12 xl:pt-6 lg:w-[475px] lg:min-h-[calc(100vh-151px)]",children:[(0,l.jsx)(h.v,{title:e.attractionInfo.attractionTitle,logo:e.attractionInfo.attractionLogo,bookingDate:e.bookingDetails.date,admissionTime:e.bookingDetails.time||null,bookingDetails:e.bookingDetails,bookingFee:e.bookingFee,totalCost:e.totalCost,ticketType:e.ticketName,className:"hidden lg:block mb-3",ticketId:e.ticketId,pricingGroup:e.pricingGroupName}),(0,l.jsxs)(y.d,{totalCost:e.totalCost+f.customFieldsCost,totalUndiscountedCost:e.totalUndiscountedCost,button:{title:"Proceed to Payment",loading:f.loading.paymentUrl,loadingText:"Loading Payment...",onClick:function(){return q(f)},className:"mb-3"},className:"mb-4",belowButton:f.requiredTermsAndConditions&&(0,l.jsxs)("div",{className:"relative",children:[(0,l.jsx)(UserInputCheckbox,{id:"terms",label:{description:(0,l.jsxs)(l.Fragment,{children:["I agree to the ",(0,l.jsx)("button",{className:"underline",onClick:function(){return v({type:"set_terms_and_conditions_modal",show:!0})},children:"terms and conditions"}),", including safety, refunds, and other policies"]}
1)},required:!1,onChange:function(e){return v({type:"set_terms_and_conditions",termsAndConditions:e.target.checked})},invalid:f.errors.some(function(e){return e.type===u.t.TermsAndConditionsNotAccepted}),checked:f.termsAndConditions,className:"my-3"}),f.termsAndConditionsModal&&(0,l.jsx)(d.Suspense,{children:(0,l.jsx)(P,{title:"Booking Terms & Safety Info",closeCallback:function(){v({type:"set_terms_and_conditions_modal",show:!1})},actionCallback:function(){v({type:"accepted_terms_and_conditions_via_modal"})},buttonTitle:"Agree and Continue",children:(0,l.jsx)("div",{className:"p-4 body-1",dangerouslySetInnerHTML:{__html:e.termsAndConditions}})})})]}),children:[(null==f?void 0:f.deliveryMethods)&&(f.deliveryMethods.length>1||f.deliveryMethods.some(function(e){var n;return(null===(n=e.name)||void 0===n?void 0:n.toLowerCase())!="print at home"}))&&(0,l.jsx)(UserSelectField,{id:"deliveryMethod",label:{title:"Delivery Method"},required:!0,placeholder:"Select Delivery Method",onChange:function(e){v({type:"set_delivery_method",deliveryMethodId:e.target.value})},invalid:f.errors.some(function(e){return e.type===u.t.DeliveryMethodNotSelected}),options:f.deliveryMethods,value:f.deliveryMethodId||"",className:"mb-3"}),(0,l.jsx)(E.T,{errors:f.errors,errorTypes:[u.t.PaymentLinkError],className:"mb-3"}),(0,l.jsx)(E.T,{errors:f.errors,message:"One or more fields have an error. Please check and try again.",errorTypes:C,className:"mb-3"})]}),(0,l.jsx)(I.M,{widgetConfigurationSettings:e.widgetConfiguration})]}),e.showDescription&&e.ticketDescription&&(0,l.jsx)(L.x,{ticketDescription:e.ticketDescription,className:"lg:hidden px-4 py-6"}),e.cancellationPolicy&&(0,l.jsx)("div",{className:"lg:hidden px-4 pb-6",children:(0,l.jsx)(T.b,{cancellationPolicy:e.cancellationPolicy})})]})]})}var ReservationTimer=function(e){var n=e.expiresAt,o=e.timeoutSession,t=e.className,i=void 0===t?"":t,r=(0,s._)((0,d.useState)(!1),2),a=r[0],c=r[1];return((0,d.useEffect)(function(){c(!0)},[]),a)?(0,l.jsx)("section",{className:"bg-[#FDEFEE] p-4 border-t border-b border-[#E46152] ".concat(i?" ".concat(i):""),children:(0,l.jsx)(C.ZP,{date:1e3*n,renderer:function(e){var n=e.minutes,o=e.seconds,t=e.completed;return(0,l.jsx)("div",{className:"flex justify-center items-center gap-2 w-full text-[#E46152] copy--small",children:(0,l.jsxs)("span",{children:["We will hold your tickets for ",(0,l.jsx)("strong",{className:"font-semibold text-[#E41902]",children:t?0:"".concat((0,C.Bu)(n),":").concat((0,C.Bu)(o))})," minutes"]})})},zeroPadTime:2,onComplete:function(){return o()}})}):null}}},function(e){e.O(0,[9734,2298,8764,8130,2981,2292,7711,8626,9774,2888,179],function(){return e(e.s=20593)}),_N_E=e.O()}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.