1"use strict";(globalThis["webpackChunkgk_jss_app"]=globalThis["webpackChunkgk_jss_app"]||[]).push([[2324],{5019:(e,a,t)=>{t.d(a,{AW:()=>c,DS:()=>r,PI:()=>u});var i=t(13855),n=t(74353),o=t.n(n);const l=1,r=0,s=999,u={isAdultsInRange:e=>null!=e&&e>=l&&e<=s,isChildrenInRange:e=>null!=e&&e>=r&&e<=s,isTotalCoversInRange:e=>null!=e&&e>=l+r&&e<=s};function c(e){const a={numberRange:(a,t)=>e("booking-app-validation-msg-number-range",{min:a,max:t}),totalCoversRange:(a,t)=>e("booking-app-validation-msg-total-covers-range",{min:a,max:t})},t={numberRange:(t,n)=>({required:i._$.withMessage(e("booking-app-validation-msg-number-required"),i.mw),minValue:i._$.withMessage(a.numberRange(t,n),(0,i.Ww)(t)),maxValue:i._$.withMessage(a.numberRange(t,n),(0,i.cG)(n))}),emailAddress:{email:i._$.withMessage(e("booking-app-validation-msg-email"),i.Rp),emailRegex:i._$.withMessage(e("booking-app-validation-msg-email"),i._$.regex(/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+.[a-zA-Z]{2,}$/))},restrictedChars:i._$.withMessage(e("booking-app-validation-msg-restricted-chars"),i._$.regex(/^[\x20-\x7E]*$/)),dateAfter:a=>i._$.withMessage(e("booking-app-validation-msg-date"),(0,i.Ww)(a)),dateBefore:a=>i._$.withMessage(e("booking-app-validation-msg-date"),(0,i.cG)(a)),dateNotInDisabledDates:a=>i._$.withMessage(e("booking-app-validation-msg-date"),(e=>!a?.includes(o()(e).format("YYYY-MM-DD")))),dateNotInDisabledWeekDays:a=>i._$.withMessage(e("booking-app-validation-msg-date"),(e=>!a?.includes(o()(e).day())))},n={adults:{...t.numberRange(l,s),required:i._$.withMessage(e("booking-app-validation-msg-adults-required"),i.mw)},children:{...t.numberRange(r,s),required:i._$.withMessage(e("booking-app-validation-msg-children-required"),i.mw)},date:(a=[],n=[])=>({required:i._$.withMessage(e("booking-app-validation-msg-date-required"),i.mw),dateAfter:t.dateAfter(o()().startOf("day").toDate()),dateBefore:t.dateBefore(o()().add(1,"year").endOf("day").toDate()),dateNotInDisabledDates:t.dateNotInDisabledDates(a),dateNotInDisabledWeekDays:t.dateNotInDisabledWeekDays(n)}),firstName:{required:i._$.withMessage(e("booking-app-validation-msg-first-name-required"),i.mw),restrictedChars:t.restrictedChars},lastName:{required:i._$.withMessage(e("booking-app-validation-msg-last-name-required"),i.mw),restrictedChars:t.restrictedChars},emailAddress:{...t.emailAddress,required:i._$.withMessage(e("booking-app-validation-msg-email-address-required"),i.mw)},confirmationEmail:a=>({...t.emailAddress,required:i._$.withMessage(e("booking-app-validation-msg-email-confirmation-required"),i.mw),sameAs:i._$.withMessage(e("booking-app-validation-msg-same-as-email"),(0,i.f4)(a))}),telephoneNumber:{required:i._$.withMessage(e("booking-app-validation-msg-telephone-number-required"),i.mw),regex:i._$.withMessage(e("booking-app-validation-msg-telephone-number"),i._$.regex(/^[0+]\d{8,15}$/))},termsAndConditions:{checked:i._$.withMessage(e("booking-app-validation-msg-terms-and-conditions"),(e=>e))},occasion:{required:i._$.withMessage(e("booking-app-validation-msg-occasion-required"),i.mw)},area:{required:i._$.withMessage(e("booking-app-validation-msg-area-required"),i.mw)},menu:{required:i._$.withMessage(e("booking-app-validation-msg-menu-required"),i.mw)},timeslot:{required:i._$.withMessage(e("booking-app-validation-msg-timeslot-required"),i.mw)},totalCovers:{minValue:i._$.withMessage(a.totalCoversRange(l+r,s),(0,i.Ww)(l+r)),maxValue:i._$.withMessage(a.totalCoversRange(l+r,s),(0,i.cG)(s))},wheelchairAccess:{required:i._$.withMessage(e("booking-app-validation-msg-wheelchair-access-required"),i.mw)}};return{validationHelpers:u,rules:t,fieldRules:n}}},18693:(e,a,t)=>{t.d(a,{a:()=>u});var i=t(20641),n=t(46146),o=t(10141),l=t(72324),r=t(72632),s=t(5019);function u(){const e=(0,l.D)(),a=(0,n.j)(),t=(0,i.EW)((()=>e.venueId?s.PI.isAdultsInRange(e.adults)?s.PI.isChildrenInRange(e.children)?e.date?e.selectedOccasion?e.selectedArea?s.PI.isTotalCoversInRange(e.adults+e.children)?null:new Error("Invalid sum of covers"):new Error("Missing required parameter: areaId"):new Error("Missing required parameter: occasionId"):new Error("Missing required parameter: date"):new Error("Invalid number of children"):new Error("Invalid number of adults"):new Error("Missing required parameter: venueId"))),u=(0,i.EW)((()=>({venueId:e.venueId,bookingDate:e.date,occasionId:e.selectedOccasion,adults:c.value,children:m.value,areaId:e.selectedArea,menuStartTime:e.selectedMenuItem?.startTime,menuEndTime:e.selectedMenuItem?.endTime}))),c=(0,i.EW)((()=>"enquiry"===e.currentStepId?d.value:e.adults)),d=(0,i.EW)((()=>{let a=e.enquiryTimeslotsAdults;return e.selectedOccasionItem&&e.selectedOccasionItem.minimumCovers>0&&(a=e.selectedOccasionItem.minimumCovers),e.selectedAreaItem&&e.selectedAreaItem.minimumAllowableCovers>0&&(a=Math.max(a,e.selectedAreaItem.minimumAllowableCovers)),a})),m=(0,i.EW)((()=>"enquiry"===e.currentStepId?0:e.children)),v=(0,i.EW)((()=>!t.value&&!e.useTimeslotsDetailed)),E=(0,i.EW)((()=>["booking-app","timeslots",u])),p=(0,o.I)({queryKey:E.value,queryFn:async()=>r.z.availability.getTimeslots(u.value),enabled:v,refetchOnWindowFocus:!1,refetchOnReconnect:!0,refetchOnMount:!0,retry:1,staleTime:3e5}),b=async()=>a.invalidateQueries({queryKey:E.value});
1return{...p,validationError:t,invalidateTimeslots:b}}},21177:(e,a,t)=>{t.d(a,{B:()=>u});var i=t(50953),n=t(20641),o=t(10810),l=t(50258),r=t(561);function s(e){const a=e.replaceAll(/\D/g,"");return e?`<a href="tel:${a}">${e}</a>`:""}const u=(0,o.nY)("bookingAppError",(()=>{const{t:e}=(0,l.s9)(),a={BOOKING:"booking",ENQUIRY:"enquiry"},t={errorType:null,errorCode:null,modalErrors:null,isModalButtonLoading:!1,modalType:a.BOOKING,callOrEnquiry:!1,overridePhoneVisible:null,overrideEnquiryVisible:null,customMessage:null,extraErrorData:null},o={GENERAL:"general",ERROR_422:"error422",VALIDATION:"validation",OCCASIONS_EMPTY:"occasions_empty",VERIFICATION_FAILED:"verification_failed",CAPACITY_RULES_FAILED:"capacity_rules_failed",NO_CAPACITY:"noCapacity",AREAS_EMPTY:"areas_empty",MENUS_EMPTY:"menus_empty",FULLY_BOOKED:"fullyBooked",OCCASION_FULLY_BOOKED:"occasion_fully_booked",OCCASION_FULLY_BOOKED_ENQUIRY:"occasion_fully_booked_enquiry",NO_NETWORK:"no-network",EXTRA_MINIMUM_NOTICE:"extraMinimumNotice",EXTRA_MINIMUM_QUANTITY:"extraMinimumQuantity",EXTRA_MAXIMUM_QUANTITY:"extraMaximumQuantity",EXTRA_REMAINING_QUANTITY:"extraRemainingQuantity",EXTRA_REDUCED_AVAILABILITY:"extraReducedAvailability",MINIMUM_NOTICE:"MinimumNotice",EVENT_NOT_FOUND:"EventNotFound",EVENT_NOT_BOOKABLE:"EventNotBookable",EVENT_OCCASION_UNAVAILABLE:"EventOccasionUnavailable",HOLD_EXPIRED_SLOT_AVAILABLE:"HoldExpiredSlotAvailable",HOLD_EXPIRED_SLOT_UNAVAILABLE:"HoldExpiredSlotUnavailable",HOLD_EXPIRED_NO_TIMESLOTS:"HoldExpiredNoTimeslots",TIMESLOT_UNAVAILABLE_OTHER_AVAILABLE:"TimeslotUnavailableOtherAvailable",TIMESLOT_UNAVAILABLE_NONE_AVAILABLE:"TimeslotUnavailableNoneAvailable",NO_AVAILABLE_TIMESLOTS:"NoAvailableTimeslots"},u={[o.EVENT_NOT_FOUND]:{titleKey:"booking-app-event-not-found-title",messageKey:"booking-app-event-not-found"},[o.EVENT_NOT_BOOKABLE]:{titleKey:"booking-app-event-not-bookable-title",messageKey:"booking-app-event-not-bookable"},[o.EVENT_OCCASION_UNAVAILABLE]:{titleKey:"booking-app-event-occasion-unavailable-title",messageKey:"booking-app-event-occasion-unavailable"}},c=(0,i.KR)(null),d=(0,i.KR)([]),m=(0,i.KR)(t.errorType),v=(0,i.KR)(t.errorCode),E=(0,i.KR)(t.modalErrors),p=(0,i.KR)(t.isModalButtonLoading),b=(0,i.KR)(t.modalType),A=(0,i.KR)(null),R=(0,i.KR)(null),g=(0,i.KR)(t.callOrEnquiry),T=(0,i.KR)(t.overridePhoneVisible),y=(0,i.KR)(t.overrideEnquiryVisible),I=(0,i.KR)(t.customMessage),O=(0,i.KR)(t.extraErrorData),S=(e=A,a=!0)=>async()=>{if(e.value)try{a&&(p.value=!0),await(e.value?.()),c.value?.isModalVisible&&c.value?.closeModal()}catch{a&&(p.value=!1)}finally{a&&(p.value=!1)}},k=(0,n.EW)((()=>b.value===a.ENQUIRY?_():h()));function h(){const a={[o.NO_CAPACITY]:()=>({title:e("booking-app-timeslot-unavailable-title"),message:e("booking-app-timeslot-unavailable"),messageFooter:e("booking-app-timeslot-unavailable-footer"),buttonText:e("booking-app-timeslot-unavailable-button"),isCancelDisabled:!0,closeModalOnButtonAction:!1,category:r.Uu.CUSTOMER_FACING_MESSAGE,buttonCallback:S()}),[o.ERROR_422]:()=>({title:e("booking-app-zonal-error-title"),message:e("booking-app-zonal-error"),messageFooter:e("booking-app-zonal-error-footer"),buttonText:e("booking-app-zonal-error-button"),isCancelDisabled:!0,closeModalOnButtonAction:!1,errors:E.value,category:r.Uu.TECHNICAL_ERROR,buttonCallback:S()}),[o.VALIDATION]:()=>({title:e("booking-app-validation-error-title"),message:e("booking-app-validation-error"),buttonText:e("booking-app-validation-error-button"),isCancelDisabled:!1,closeModalOnButtonAction:!0,errors:E.value,category:r.Uu.VALIDATION_ERROR,buttonCallback:S()}),[o.OCCASIONS_EMPTY]:()=>({message:e("booking-app-modal-occasions-na"),category:r.Uu.CUSTOMER_FACING_MESSAGE,type:"occasions-na",buttonCallback:S()}),[o.VERIFICATION_FAILED]:()=>({type:"edit",message:I.value,callOrEnquiry:g.value,closeModalOnButtonAction:!0,errors:E.value?.split(","),category:r.Uu.CUSTOMER_FACING_MESSAGE,buttonCallback:S()}),[o.OCCASION_FULLY_BOOKED]:()=>({type:"custom",category:r.Uu.CUSTOMER_FACING_MESSAGE,title:e("booking-app-occasion-fully-booked-error-title"),message:e("booking-app-occasion-fully-booked-error"),buttonText:e("booking-app-occasion-alt-venues-link"),callOrEnquiry:!1,closeModalOnButtonAction:!0,buttonCallback:S()}),[o.OCCASION_FULLY_BOOKED_ENQUIRY]:()=>({type:"custom",category:r.Uu.CUSTOMER_FACING_MESSAGE,title:e("booking-app-occasion-fully-booked-error-title"),message:e("booking-app-occasion-fully-booked-enquiry-error"),buttonText:e("booking-app-occasion-alt-venues-link"),callOrEnquiry:!0,closeModalOnButtonAction:!0,buttonCallback:S()}),[o.CAPACITY_RULES_FAILED]:()=>({type:"custom",message:I.value,callOrEnquiry:!0,closeModalOnButtonAction:!0,category:r.Uu.CUSTOMER_FACING_MESSAGE,buttonCallback:S()}),[o.AREAS_EMPTY]:()=>({type:"custom",category:r.Uu.CUSTOMER_FACING_MESSAGE,title:e("booking-app-occasion-party-size-error-title"),message:e("booking-app-occasion-party-size-error"),callOrEnquiry:!0,closeModalOnButtonAction:!0,buttonCallback:S()}),[o.MENUS_EMPTY]:()=>({title:e("booking-app-modal-enquiry-menus-na-title"),message:e("booking-app-modal-enquiry-menus-na"),buttonText:e("booking-app-modal-enquiry-menus-na-button"),category:r.Uu.CUSTOMER_FACING_MESSAGE,type:"enquiry-menus-na",callOrEnquiry:!0,isCancelDisabled:!1,closeModalOnButtonAction:!0,buttonCallback:S()}),[o.FULLY_BOOKED]:()=>({type:"custom",title:e("booking-app-fully-booked-error-title"),message:e("booking-app-fully-booked-error"),messageFooter:I.value,callOrEnquiry:g.value,overridePhoneVisible:T.value,overrideEnquiryVisible:y.value,closeModalOnButtonAction:!0,buttonText:e("booking-app-occasion-alt-venues-link"),category:r.Uu.CUSTOMER_FACING_MESSAGE,buttonCallback:S()}),[o.NO_NETWORK]:()=>({type:"custom",title:e("booking-app-network-error-title"),message:e("booking-app-network-error"),buttonText:e("booking-app-network-error-button"),isCancelDisabled:!0,callOrEnquiry:!1,closeModalOnButtonAction:!1,category:r.Uu.TECHNICAL_ERROR,buttonCallback:S()}),[o.EXTRA_MINIMUM_NOTICE]:()=>{const a=s(O.value?.phoneNumber||"");return{title:e("booking-app-extras-minimum-notice-error-title"),message:e("booking-app-extras-minimum-notice-error",{extraMinNotice:O.value?.minimumNotice||"",phoneNumber:a}),buttonText:e("booking-app-extras-minimum-notice-error-button"),isCancelDisabled:!0,closeModalOnButtonAction:!1,category:r.Uu.CUSTOMER_FACING_MESSAGE,buttonCallback:S()}},[o.EXTRA_MINIMUM_QUANTITY]:()=>({title:e("booking-app-extras-minimum-notice-error-title"),message:e("booking-app-extras-minimum-quantity",{extraName:O.value?.extraName||"",extraMinQuantity:O.value?.minimumQuantity||""}),buttonText:e("booking-app-extras-minimum-notice-error-button"),isCancelDisabled:!0,closeModalOnButtonAction:!1,category:r.Uu.CUSTOMER_FACING_MESSAGE,buttonCallback:S()}),[o.EXTRA_MAXIMUM_QUANTITY]:()=>({title:e("booking-app-extras-minimum-notice-error-title"),message:e("booking-app-extras-maximum-quantity",{extraName:O.value?.extraName||"",extraMaxQuantity:O.value?.maximumQuantity||""}),buttonText:e("booking-app-extras-minimum-notice-error-button"),isCancelDisabled:!0,closeModalOnButtonAction:!1,category:r.Uu.CUSTOMER_FACING_MESSAGE,buttonCallback:S()}),[o.EXTRA_REMAINING_QUANTITY]:()=>({title:e("booking-app-extras-minimum-notice-error-title"),message:e("booking-app-extras-remaining-quantity",{extraName:O.value?.extraName||"",extraRemainingQuantity:O.value?.remainingQuantity||""}),buttonText:e("booking-app-extras-minimum-notice-error-button"),isCancelDisabled:!0,closeModalOnButtonAction:!1,category:r.Uu.CUSTOMER_FACING_MESSAGE,buttonCallback:S()}),[o.EXTRA_REDUCED_AVAILABILITY]:()=>({title:e("booking-app-extras-minimum-notice-error-title"),message:e("booking-app-extras-reduced-availability-error"),buttonText:e("booking-app-extras-minimum-notice-error-button"),isCancelDisabled:!0,closeModalOnButtonAction:!1,category:r.Uu.CUSTOMER_FACING_MESSAGE,buttonCallback:S()}),[o.MINIMUM_NOTICE]:()=>{const a=s(O.value?.phoneNumber||"");return{type:"custom",title:e("booking-app-minimum-notice-error-title"),message:e("booking-app-minimum-notice-error",{occasionMinNotice:O.value?.minimumNotice||"",phoneNumber:a}),buttonText:e("booking-app-minimum-notice-error-button"),isCancelDisabled:!0,callOrEnquiry:!1,closeModalOnButtonAction:!1,category:r.Uu.CUSTOMER_FACING_MESSAGE,buttonCallback:S()}},[o.HOLD_EXPIRED_SLOT_AVAILABLE]:()=>({type:"hold-expired",trackingComponent:"Booking Timeout Alert",title:e("booking-slot-available-title"),message:e("booking-slot-available-text"),category:r.Uu.CUSTOMER_FACING_MESSAGE,isCancelDisabled:!0,closeModalOnButtonAction:!1,buttonText:e("booking-slot-book-again"),buttonCallback:S(),secondaryButtonText:e("booking-slot-start-again"),secondaryButtonCallback:S(R,!1)}),[o.HOLD_EXPIRED_SLOT_UNAVAILABLE]:()=>({type:"hold-expired",trackingComponent:"Booking Timeout Alert",title:e("booking-slot-other-available-title"),message:e("booking-slot-other-available-text"),category:r.Uu.CUSTOMER_FACING_MESSAGE,isCancelDisabled:!0,closeModalOnButtonAction:!1,buttonText:e("booking-slot-change"),buttonCallback:S()}),[o.HOLD_EXPIRED_NO_TIMESLOTS]:()=>({type:"hold-expired",trackingComponent:"Booking Timeout Alert",title:e("booking-slot-not-available-title"),message:[e("booking-slot-not-available-text"),e("booking-slot-not-available-continue-text")],category:r.Uu.CUSTOMER_FACING_MESSAGE,isCancelDisabled:!0,closeModalOnButtonAction:!1,buttonText:e("booking-slot-start-again"),buttonCallback:S()}
1),[o.TIMESLOT_UNAVAILABLE_OTHER_AVAILABLE]:()=>({type:"custom",title:e("booking-app-timeslots-other-slots-available-title"),message:e("booking-app-timeslots-other-slots-available-text"),category:r.Uu.CUSTOMER_FACING_MESSAGE,isCancelDisabled:!0,closeModalOnButtonAction:!1,buttonText:e("booking-app-timeslot-unavailable-button"),buttonCallback:S()}),[o.TIMESLOT_UNAVAILABLE_NONE_AVAILABLE]:()=>({type:"custom",title:e("booking-app-timeslots-no-slots-available-title"),message:[e("booking-app-timeslots-no-slots-available-text"),e("booking-app-timeslots-no-slots-available-continue-text")],category:r.Uu.CUSTOMER_FACING_MESSAGE,isCancelDisabled:!0,closeModalOnButtonAction:!1,buttonText:e("booking-slot-start-again"),buttonCallback:S()}),[o.NO_AVAILABLE_TIMESLOTS]:()=>({type:"timeslots-na",title:e("booking-app-no-available-timeslots-title"),message:e("booking-app-no-available-timeslots-message"),category:r.Uu.CUSTOMER_FACING_MESSAGE,trackingComponent:"Timeslots Not Available",callOrEnquiry:!0,isCancelDisabled:!1,closeModalOnButtonAction:!1,buttonText:e("booking-app-general-error-button"),buttonCallback:S()})},t=a[m.value];if(t)return t();const i=u[m.value];return i?{type:"custom",title:e(i.titleKey),message:e(i.messageKey),buttonText:e("booking-app-event-error-button"),isCancelDisabled:!0,callOrEnquiry:!1,closeModalOnButtonAction:!1,category:r.Uu.TECHNICAL_ERROR,buttonCallback:S()}:{title:e("booking-app-general-error-title"),message:e("booking-app-general-error"),messageFooter:e("booking-app-general-error-footer"),buttonText:e("booking-app-general-error-button"),isCancelDisabled:!0,closeModalOnButtonAction:!0,category:r.Uu.TECHNICAL_ERROR,buttonCallback:S()}}function _(){return m.value===o.VALIDATION?{title:e("booking-app-enquiry-error-title"),message:e("booking-app-enquiry-error"),buttonText:e("booking-app-enquiry-edit"),isCancelDisabled:!1,closeModalOnButtonAction:!0,errors:E.value,category:r.Uu.VALIDATION_ERROR,buttonCallback:S()}:m.value===o.AREAS_EMPTY?{title:e("booking-app-modal-enquiry-areas-na-title"),message:e("booking-app-modal-enquiry-areas-na"),buttonText:e("booking-app-modal-enquiry-areas-na-button"),category:r.Uu.CUSTOMER_FACING_MESSAGE,type:"enquiry-areas-na",callOrEnquiry:!0,isCancelDisabled:!0,closeModalOnButtonAction:!0,buttonCallback:S()}:m.value===o.MENUS_EMPTY?{title:e("booking-app-modal-enquiry-menus-na-title"),message:e("booking-app-modal-enquiry-menus-na"),buttonText:e("booking-app-modal-enquiry-menus-na-button"),category:r.Uu.CUSTOMER_FACING_MESSAGE,type:"enquiry-menus-na",callOrEnquiry:!0,isCancelDisabled:!0,closeModalOnButtonAction:!0,buttonCallback:S()}:{title:e("booking-app-general-error-title"),message:e("booking-app-general-error"),messageFooter:e("booking-app-general-error-footer"),buttonText:e("booking-app-general-error-button"),isCancelDisabled:!1,closeModalOnButtonAction:!0,category:r.Uu.TECHNICAL_ERROR,buttonCallback:S()}}const C=(0,n.EW)((()=>c.value?.isModalVisible)),M=e=>{m.value=e.type,v.value=e.errorCode??null,A.value=e.buttonCallback??null,R.value=e.secondaryButtonCallback??null,g.value=e.callOrEnquiry??!1,T.value=e.overridePhoneVisible??null,y.value=e.overrideEnquiryVisible??null,I.value=e.customMessage??null,O.value=e.extraErrorData??null,e.errors?E.value=Array.isArray(e.errors)?e.errors:e.errors.split(","):E.value=null};(0,n.wB)(C,(e=>{if(e||0===d.value.length)return;const a=d.value.shift();M(a),c.value?.openModal()}),{flush:"sync"});const N=()=>{c.value?.isModalVisible&&c.value.closeModal()},L=(e={})=>{c.value&&(C.value?d.value.push(e):(M(e),c.value.openModal()))},U=e=>{b.value=e},D=()=>{m.value=t.errorType,v.value=t.errorCode,E.value=t.modalErrors,p.value=t.isModalButtonLoading,b.value=t.modalType,A.value=null,R.value=null,g.value=t.callOrEnquiry,T.value=t.overridePhoneVisible,y.value=t.overrideEnquiryVisible,I.value=t.customMessage,O.value=t.extraErrorData,d.value=[]};return{MODAL_TYPES:a,ERROR_TYPES:o,modalType:b,isModalOpen:C,modalRef:c,modalContent:k,errorType:m,errorCode:v,isModalButtonLoading:p,openErrorModal:L,closeErrorModal:N,setModalType:U,$reset:D}}))},69543:(e,a,t)=>{t.d(a,{r:()=>v});t(22489),t(20116),t(61701);var i=t(20641),n=t(72324),o=t(21177),l=t(18693),r=t(91669),s=t(83725),u=t(5499),c=t(46146),d=t(96035),m=t(30843);const v=()=>{const e=(0,n.D)(),a=(0,o.B)(),t=(0,u.rd)(),{invalidateTimeslots:v}=(0,l.a)(),{invalidateTimeslots:E}=(0,r.q)(),{refetch:p}=(0,s.f)(),b=(0,c.j)(),A=(0,m.B)(),R=(0,i.EW)((()=>A.siteVirtualFolder||"/")),g=()=>{e.$reset(!0,!0),e.resetOnPresetJourney(),a.$reset(),b.removeQueries({queryKey:["booking-app"],predicate:e=>"venueDetails"!==e.queryKey[1]}),e.handleResetTracking()},T=({type:a,message:t=null,contactAvailable:i=!1})=>{a===e.VERIFICATION_RESULT_TYPES.NO_NETWORK?h():a===e.VERIFICATION_RESULT_TYPES.NO_AVAILABLE_OCCASIONS?C():a===e.VERIFICATION_RESULT_TYPES.VERIFICATION_FAILED?M(t,i):a===e.VERIFICATION_RESULT_TYPES.FULLY_BOOKED?D(t):a!==e.VERIFICATION_RESULT_TYPES.NO_AVAILABLE_AREAS&&a!==e.VERIFICATION_RESULT_TYPES.CAPACITY_RULES_FAILED||e.canEnquireTimeslots?a===e.VERIFICATION_RESULT_TYPES.NO_AVAILABLE_AREAS&&e.canEnquireTimeslots&&e.selectedOccasionFullyBooked?B():a===e.VERIFICATION_RESULT_TYPES.CAPACITY_RULES_FAILED?N(t):a===e.VERIFICATION_RESULT_TYPES.NO_AVAILABLE_AREAS?L():a===e.VERIFICATION_RESULT_TYPES.NO_AVAILABLE_MENUS?U():a===e.VERIFICATION_RESULT_TYPES.NO_AVAILABLE_TIMESLOTS&&j():f()},y=e=>{const t=e?.cause?.response?.data?.value?.errorType,i=e?.cause?.response?.status,n={[a.ERROR_TYPES.EVENT_NOT_FOUND]:V,[a.ERROR_TYPES.EVENT_NOT_BOOKABLE]:Y,[a.ERROR_TYPES.EVENT_OCCASION_UNAVAILABLE]:Q},o=n[t];o?o({status:i}):_(e)},I=({errors:i,status:n})=>{a.openErrorModal({type:a.ERROR_TYPES.ERROR_422,errors:i,errorCode:n,buttonCallback:async()=>{await t.push(R.value),e.$reset(),a.$reset()}})},O=({status:t})=>{a.openErrorModal({type:a.ERROR_TYPES.NO_CAPACITY,errorCode:t,buttonCallback:async()=>{e.selectedTimeslot="",e.setStepValid(e.STEP_ID.TIMESLOTS,!1),await(e.useTimeslotsDetailed?E():v()),e.setCurrentStep(e.STEP_ID.TIMESLOTS,!0)}})},S=({errors:e,status:t})=>{a.openErrorModal({type:a.ERROR_TYPES.VALIDATION,errors:e,errorCode:t})},k=()=>new Promise(((e,a)=>
1{d.t.isOnline()?(b.invalidateQueries({queryKey:["booking-app"],predicate:e=>"error"===e.state.status}),e()):setTimeout((()=>{a(new Error("Offline"))}),1e3)})),h=()=>{console.warn("booking-app-network-error"),a.openErrorModal({type:a.ERROR_TYPES.NO_NETWORK,errorCode:"NETWORK_ERROR",buttonCallback:k})},_=(i,n=!0)=>{!n||d.t.isOnline()&&i.cause?.response?(console.warn("booking-app-general-error"),a.openErrorModal({type:a.ERROR_TYPES.GENERAL,errorCode:i.cause.response?.status,buttonCallback:async()=>{await t.push(R.value),e.$reset(),a.$reset()}})):h()},C=()=>{a.openErrorModal({type:a.ERROR_TYPES.OCCASIONS_EMPTY})},M=(e,t=!1)=>{a.openErrorModal({type:a.ERROR_TYPES.VERIFICATION_FAILED,customMessage:e,callOrEnquiry:t})},N=e=>{a.openErrorModal({type:a.ERROR_TYPES.CAPACITY_RULES_FAILED,customMessage:e,callOrEnquiry:!0})},L=()=>{a.openErrorModal({type:a.ERROR_TYPES.AREAS_EMPTY,buttonCallback:async()=>{await t.push(R.value),e.$reset(),a.$reset()}})},U=()=>{a.openErrorModal({type:a.ERROR_TYPES.MENUS_EMPTY,buttonCallback:async()=>{await t.push(R.value),e.$reset(),a.$reset()}})},D=i=>{const n=e.canEnquire,o=e.isWithinBookingThreshold,l=n&&o,r=n&&!o;a.openErrorModal({type:a.ERROR_TYPES.FULLY_BOOKED,customMessage:i,callOrEnquiry:n,overridePhoneVisible:l,overrideEnquiryVisible:r,buttonCallback:async()=>{const i=e.venueFinderLink?.href;i&&await t.push(i),e.$reset(),a.$reset()}})},f=()=>{a.openErrorModal({type:a.ERROR_TYPES.OCCASION_FULLY_BOOKED,buttonCallback:async()=>{const i=e.venueFinderLink?.href;i&&await t.push(i),e.$reset(),a.$reset()}})},B=()=>{a.openErrorModal({type:a.ERROR_TYPES.OCCASION_FULLY_BOOKED_ENQUIRY,buttonCallback:async()=>{const i=e.venueFinderLink?.href;i&&await t.push(i),e.$reset(),a.$reset()}})},x=({status:t,extraErrorData:i})=>{a.openErrorModal({type:a.ERROR_TYPES.EXTRA_MINIMUM_NOTICE,errorCode:t,extraErrorData:i,buttonCallback:async()=>{e.setCurrentStep(e.STEP_ID.EXTRAS,!0)}})},K=({status:t,extraErrorData:i})=>{a.openErrorModal({type:a.ERROR_TYPES.EXTRA_MINIMUM_QUANTITY,errorCode:t,extraErrorData:i,buttonCallback:async()=>{e.setCurrentStep(e.STEP_ID.EXTRAS,!0)}})},q=({status:t,extraErrorData:i})=>{a.openErrorModal({type:a.ERROR_TYPES.EXTRA_MAXIMUM_QUANTITY,errorCode:t,extraErrorData:i,buttonCallback:async()=>{e.setCurrentStep(e.STEP_ID.EXTRAS,!0)}})},w=({status:t,extraErrorData:i,errorType:n=a.ERROR_TYPES.EXTRA_REMAINING_QUANTITY}={})=>{a.openErrorModal({type:n,errorCode:t,extraErrorData:i,buttonCallback:async()=>{const a=await p(),t=a.data?.value?.extras||[];e.selectedExtras=e.selectedExtras.map((e=>{const a=t.find((a=>a.id===e.id));if(!a||!a.available||0===a.remainingQuantity)return null;const{remainingQuantity:i}=a,n=null!==i?Math.min(e.quantity,i):e.quantity;return{...e,quantity:n}})).filter(Boolean);const i=t.filter((e=>e.available&&(null===e.remainingQuantity||e.remainingQuantity>0))),n=i.length>0?e.STEP_ID.EXTRAS:e.STEP_ID.TIMESLOTS;e.setCurrentStep(n,!0)}})},P=({status:t,extraErrorData:i}={})=>{a.openErrorModal({type:a.ERROR_TYPES.MINIMUM_NOTICE,errorCode:t,extraErrorData:i,buttonCallback:async()=>{e.setStepValid(e.STEP_ID.TIMESLOTS,!1),e.useTimeslotsDetailed?await E():await v(),e.setCurrentStep(e.STEP_ID.TIMESLOTS,!0)}})},F=(e,{status:t}={})=>{a.openErrorModal({type:e,errorCode:t,buttonCallback:async()=>{g()}})},V=({status:e}={})=>{F(a.ERROR_TYPES.EVENT_NOT_FOUND,{status:e})},Y=({status:e}={})=>{F(a.ERROR_TYPES.EVENT_NOT_BOOKABLE,{status:e})},Q=({status:e}={})=>{F(a.ERROR_TYPES.EVENT_OCCASION_UNAVAILABLE,{status:e})},W=()=>{a.openErrorModal({type:a.ERROR_TYPES.HOLD_EXPIRED_SLOT_AVAILABLE,buttonCallback:e.placeHoldAndStartTimer,secondaryButtonCallback:async()=>{g()}})},$=()=>{a.openErrorModal({type:a.ERROR_TYPES.HOLD_EXPIRED_SLOT_UNAVAILABLE,buttonCallback:()=>{e.setCurrentStep(e.STEP_ID.TIMESLOTS,!0)}})},G=()=>{a.openErrorModal({type:a.ERROR_TYPES.HOLD_EXPIRED_NO_TIMESLOTS,buttonCallback:async()=>{g()}})},H=()=>{a.openErrorModal({type:a.ERROR_TYPES.TIMESLOT_UNAVAILABLE_OTHER_AVAILABLE,buttonCallback:async()=>{e.selectedTimeslot="",e.setStepValid(e.STEP_ID.TIMESLOTS,!1),await(e.useTimeslotsDetailed?E():v()),e.setCurrentStep(e.STEP_ID.TIMESLOTS,!0)}})},X=()=>{a.openErrorModal({type:a.ERROR_TYPES.TIMESLOT_UNAVAILABLE_NONE_AVAILABLE,buttonCallback:async()=>{g()}})},j=()=>
1{a.openErrorModal({type:a.ERROR_TYPES.NO_AVAILABLE_TIMESLOTS,callOrEnquiry:!0,buttonCallback:async()=>{await t.push(R.value),e.$reset(),a.$reset()}})};return{handleUnavailabilityError:T,handle422Error:I,handleVerificationFailedError:M,handleCapacityRulesError:N,handleNoAvailableAreasError:L,handleNoAvailableMenusError:U,handleValidationError:S,handleNetworkError:h,handleGeneralError:_,handleOccasionsEmptyError:C,handleNoCapacityError:O,handleFullyBookedError:D,handleOccasionFullyBooked:f,handleExtraMinimumNoticeError:x,handleExtraMinimumQuantityError:K,handleExtraMaximumQuantityError:q,handleExtraRemainingQuantityError:w,handleOccasionMinimumNoticeError:P,handleEventNotFoundError:V,handleEventNotBookableError:Y,handleEventOccasionUnavailableError:Q,handleOccasionErrorResponse:y,handleOccasionFullyBookedWithEnquiry:B,handleHoldExpiredSlotAvailable:W,handleHoldExpiredSlotUnavailable:$,handleHoldExpiredNoTimeslots:G,handleTimeslotUnavailableOtherAvailable:H,handleTimeslotUnavailableNoneAvailable:X,handleNoAvailableTimeslotsError:j}}},72324:(e,a,t)=>{t.d(a,{D:()=>g});t(81148),t(22489),t(20116),t(7588),t(61701),t(18237),t(13579);var i=t(50953),n=t(20641),o=t(74353),l=t.n(o),r=t(10810),s=t(50258),u=t(96035),c=t(30843),d=t(85878),m=t(72632),v=t(69543),E=t(18693),p=t(91669);function b(e,a,t){const{handleGeneralError:i,handleTimeslotUnavailableOtherAvailable:o,handleTimeslotUnavailableNoneAvailable:l}=(0,v.r)(),{refetch:r}=(0,E.a)(),{refetch:s}=(0,p.q)(),u=g(),c=(0,d.n)({mutationFn:()=>m.z.holdCapacity.placeHold(e()),retry:!1,onSuccess:e=>{e?.value?.holdEventId&&a(e.value.holdEventId),e?.value?.errorType&&"None"!==e.value.errorType&&console.warn(`Hold capacity returned error type: ${e.value.errorType}`,e.value.errors)},onError:async e=>{const a=e.cause?.response?.status;if(422===a)return await(u.useTimeslotsDetailed?s():r()),await(0,n.dY)(),void(t?.()?o():l());i(e,!1)}});return c}var A=t(77233),R=t(561);const g=(0,r.nY)("bookingApp",(()=>{const{t:e}=(0,s.s9)(),a=(0,c.B)(),t=[{id:R.RA.BOOK_WITH_US,label:"Book with Us",isValid:!1,completed:!1,isLoading:!1,isSkipped:!1},{id:R.RA.OCCASIONS,label:"Occasions",isValid:!1,completed:!1,isLoading:!1,isSkipped:!1},{id:R.RA.MENUS,label:"Menus",isValid:!1,completed:!1,isLoading:!1,isSkipped:!1},{id:R.RA.AREAS,label:"Areas",isValid:!1,completed:!1,isLoading:!1,isSkipped:!1},{id:R.RA.TIMESLOTS,label:"Timeslots",isValid:!1,completed:!1,isLoading:!1,isSkipped:!1},{id:R.RA.EXTRAS,label:"Optional Extras",isValid:!1,completed:!1,isLoading:!1,isSkipped:!1},{id:R.RA.YOUR_DETAILS,label:"Your Details",isValid:!1,completed:!1,isLoading:!1,isSkipped:!1},{id:R.RA.DEPOSIT,label:"Pay deposit",isValid:!1,completed:!1,isLoading:!1,isSkipped:!1},{id:R.RA.CONFIRMATION,label:"Confirmation",isValid:!1,completed:!1,isLoading:!1,isSkipped:!1},{id:R.RA.ENQUIRY,label:"Enquiry",isValid:!1,completed:!1,isLoading:!1,isSkipped:!0},{id:R.RA.ENQUIRY_CONFIRMATION,label:"Confirmation",isValid:!1,completed:!1,isLoading:!1,isSkipped:!0}],o=[R.RA.OCCASIONS,R.RA.MENUS,R.RA.AREAS,R.RA.TIMESLOTS],r=600,d={apiUrl:"",currentStepId:R.RA.BOOK_WITH_US,bookingFunnelAllSteps:"",bookingFunnelKeySteps:"",isStartAgain:!1,stepBeforeEnquiry:R.RA.OCCASIONS,enquiryEntryReason:"",isSummaryVisible:!1,isLoading:!1,isQuickBookLoading:!1,isQuickBookDataApplied:!1,isQuickBookJourney:!1,mobileApp:!1,adults:2,enquiryTimeslotsAdults:2,children:0,date:null,sportId:"",inPubEventId:"",occasionFromQuickbook:"",eventId:"",menuFromQuickbook:"",areaFromQuickbook:"",firstName:"",lastName:"",emailAddress:"",telephoneNumber:"",venueDetails:{siteId:"",termsAndConditionsUrl:"",maxCovers:0,minCovers:0,isWetLed:!1,phoneNumber:"",disabledDates:[],disabledWeekDays:[],address:{}},competition:null,timeslots:[],timeslotsDetailed:[],groupsAvailabilities:[],timeslotsLowestAvailability:"Full",timeslotsHighestAvailability:"Full",occasions:[],menus:[],areas:[],extras:[],createdEvent:null,createdEnquiry:null,wheelchairAccess:"no",specialRequest:"",highchairs:0,requirements:{},competitionOptIn:!1,menuTermsOptIn:!1,enquiryFormEnabled:!1,canEnquire:!1,isWithinBookingThreshold:!1,fullyBooked:!1,selectedOccasion:"",selectedMenu:"",selectedArea:"",selectedTimeslot:"",selectedExtras:[],lastTrackedExtras:{},notificationModalType:"custom",notificationModalContactAvailable:!0,verificationMessage:"",verifyOccasionData:{},skipIntervalId:null,consentStatement:null,payment:{},updatedPayment:{},journeyType:R.yQ.CORE,initialJourneyType:null,initialSelectedAreaName:"",checkoutCount:1,beginCheckoutTimestamp:null,rejoinCheckoutPending:!1,bookingEntrySource:null,useTimeslotsDetailed:!0,venueFinderLink:null,bookingStepCount:1,isCheckoutRe
1started:!1,currentStepNumber:1,rememberMe:!1,numberOfDaysToStoreUserData:30,hasSavedUserDataOnInit:!1,occasionsTagsEnabled:!1,menusTagsEnabled:!1,areasTagsEnabled:!1,sendEventNameToZonal:!1,holdEventId:null,holdDuration:600},m=(0,i.KR)(d.apiUrl),v=(0,i.KR)(d.currentStepId),E=(0,i.KR)(d.bookingFunnelAllSteps),p=(0,i.KR)(d.bookingFunnelKeySteps),g=(0,i.KR)(d.isStartAgain),T=(0,i.KR)(d.stepBeforeEnquiry),y=(0,i.KR)(d.enquiryEntryReason),I=(0,i.KR)(t),O=(0,i.KR)(d.isSummaryVisible),S=(0,i.KR)(d.isLoading),k=(0,i.KR)(d.isQuickBookLoading),h=(0,i.KR)(d.currentStepNumber),_=(0,i.KR)(d.isQuickBookDataApplied),C=(0,i.KR)(d.isQuickBookJourney),M=(0,i.KR)(d.mobileApp),N=(0,i.KR)(d.adults),L=(0,i.KR)(d.enquiryTimeslotsAdults),U=(0,i.KR)(d.children),D=(0,i.KR)(d.date),f=(0,i.KR)(d.sportId),B=(0,i.KR)(d.inPubEventId),x=(0,i.KR)(d.occasionFromQuickbook),K=(0,i.KR)(d.eventId),q=(0,i.KR)(d.menuFromQuickbook),w=(0,i.KR)(d.areaFromQuickbook),P=(0,i.KR)(d.firstName),F=(0,i.KR)(d.lastName),V=(0,i.KR)(d.emailAddress),Y=(0,i.KR)(d.emailAddress),Q=(0,i.KR)(d.telephoneNumber),W=(0,i.KR)(d.venueDetails),$=(0,i.KR)(d.competition),G=(0,i.KR)(d.timeslots),H=(0,i.KR)(d.timeslotsDetailed),X=(0,i.KR)(d.groupsAvailabilities),j=(0,i.KR)(d.timeslotsLowestAvailability),z=(0,i.KR)(d.timeslotsHighestAvailability),J=(0,i.KR)(d.occasions),Z=(0,i.KR)(d.menus),ee=(0,i.KR)(d.areas),ae=(0,i.KR)(d.extras),te=(0,i.KR)(d.createdEvent),ie=(0,i.KR)(d.createdEnquiry),ne=(0,i.KR)(d.wheelchairAccess),oe=(0,i.KR)(d.specialRequest),le=(0,i.KR)(d.highchairs),re=(0,i.KR)(d.competitionOptIn),se=(0,i.KR)(d.menuTermsOptIn),ue=(0,i.KR)(d.enquiryFormEnabled),ce=(0,i.KR)(d.canEnquire),de=(0,i.KR)(d.isWithinBookingThreshold),me=(0,i.KR)(d.fullyBooked),ve=(0,i.KR)(d.selectedOccasion),Ee=(0,i.KR)(d.selectedMenu),pe=(0,i.KR)(d.selectedArea),be=(0,i.KR)(d.selectedTimeslot),Ae=(0,i.KR)(d.selectedExtras),Re=(0,i.KR)(d.lastTrackedExtras),ge=(0,i.KR)(d.notificationModalType),Te=(0,i.KR)(d.notificationModalContactAvailable),ye=(0,i.KR)(d.verificationMessage),Ie=(0,i.KR)(null),Oe=(0,i.KR)(d.verifyOccasionData),Se=(0,i.KR)(d.skipIntervalId),ke=(0,i.KR)(d.consentStatement),he=(0,i.KR)(d.requirements),_e=(0,i.KR)(d.payment),Ce=(0,i.KR)(d.updatedPayment),Me=(0,i.KR)(d.journeyType),Ne=(0,i.KR)(d.initialJourneyType),Le=(0,i.KR)(d.initialSelectedAreaName),Ue=(0,i.KR)(d.checkoutCount),De=(0,i.KR)("unknown"),fe=(0,i.KR)(d.beginCheckoutTimestamp),Be=(0,i.KR)(d.rejoinCheckoutPending),xe=(0,i.KR)(d.bookingEntrySource),Ke=(0,i.KR)(d.useTimeslotsDetailed),qe=(0,i.KR)(d.venueFinderLink),we=(0,i.KR)(d.bookingStepCount),Pe=(0,i.KR)(d.isCheckoutRestarted),Fe=(0,i.KR)(d.rememberMe),Ve=(0,i.KR)(d.numberOfDaysToStoreUserData),Ye=(0,i.KR)(d.hasSavedUserDataOnInit),Qe=(0,i.KR)(d.occasionsTagsEnabled),We=(0,i.KR)(d.menusTagsEnabled),$e=(0,i.KR)(d.areasTagsEnabled),Ge=(0,i.KR)(d.sendEventNameToZonal),He=(0,i.KR)(d.holdEventId),Xe=(0,i.KR)(d.holdDuration),je={payment:{startTimestamp:(0,i.KR)(null),timer:(0,i.KR)(r),timeIsUp:(0,i.KR)(!1),isRunning:!1,onExpire:null},holdCapacity:{startTimestamp:(0,i.KR)(null),timer:(0,i.KR)(r),isRunning:!1,onExpire:null}};let ze=null;const Je=(0,n.EW)((()=>a.venueId?.toString().padStart(4,"0"))),Ze=(0,n.EW)((()=>"true"===a.$state["Foundation.Bookings.HoldCapacity.Enabled"])),ea=(0,n.EW)((()=>I.value.find((e=>e.id===v.value)))),aa=(0,n.EW)((()=>e=>I.value.find((a=>a.id===e)))),ta=(0,n.EW)((()=>I.value.findIndex((e=>e.id===v.value)))),ia=(0,n.EW)((()=>+N.value+ +U.value)),na=(0,n.EW)((()=>Xa.value?.depositTotal>0)),oa=(0,n.EW)((()=>({adults:N.value,areaId:pe.value,children:U.value,competition:re.value,consentStatement:ke.value,consentMenuTerms:se.value,consentTerms:!0,date:D.value,emailAddress:V.value,firstName:P.value,lastName:F.value,menus:[Ee.value].filter(Boolean),occasionId:ve.value,siteId:W.value?.siteId,specialRequest:[tt.value&&ne.value,le.value&&`Highchairs: ${le.value}`,oe.value].filter(Boolean).join(", "),telephoneNumber:Q.value,time:be.value,extras:Ae.value.map((e=>{const a=ae.value.find((a=>a.id===e.id));return{id:e.id,quantity:e.quantity,minimumNoticeInterval:a?.minimumNotice?.interval??null,minimumNoticeType:a?.minimumNotice?.type??null,minimumQuantity:a?.minimumQuantity??null,maximumQuantity:a?.maximumQuantity??null,remainingQuantity:a?.remainingQuantity??null}})),...He.value&&{eventId:He.value},fixtureName:za.value?.fixtureDetails?.name||"",eventName:za.value?.eventDetails?.name||"",minimumNoticeInterval:za.value?.minimumNotice?.interval??null,minimumNoticeType:za.value?.minimumNotice?.type??null}))),la=(e=!1,a=!1)=>{e||(m.value=d.apiUrl,Qe.value=d.occasionsTagsEnabled,We.value=d.menusTagsEnabled,$e.value=d.areasTagsEnabled,Ge.value=d.sendEventNameToZonal,Xe.value=d.holdDuration,W.value={...d.venueDetails}
1,M.value=d.mobileApp,Ve.value=d.numberOfDaysToStoreUserData),a||(Ue.value=d.checkoutCount,E.value=d.bookingFunnelAllSteps,p.value=d.bookingFunnelKeySteps,fe.value=d.beginCheckoutTimestamp,Be.value=d.rejoinCheckoutPending,xe.value=d.bookingEntrySource,we.value=d.bookingStepCount),v.value=d.currentStepId,g.value=d.isStartAgain,T.value=d.stepBeforeEnquiry,y.value=d.enquiryEntryReason,O.value=d.isSummaryVisible,S.value=d.isLoading,k.value=d.isQuickBookLoading,_.value=d.isQuickBookDataApplied,C.value=d.isQuickBookJourney,$.value=d.competition,N.value=d.adults,L.value=d.enquiryTimeslotsAdults,U.value=d.children,D.value=d.date,P.value=d.firstName,F.value=d.lastName,V.value=d.emailAddress,Y.value=d.emailAddress,Q.value=d.telephoneNumber,I.value=[...t],G.value=d.timeslots,H.value=d.timeslotsDetailed,X.value=d.groupsAvailabilities,j.value=d.timeslotsLowestAvailability,z.value=d.timeslotsHighestAvailability,J.value=d.occasions,Z.value=d.menus,ee.value=d.areas,ae.value=d.extras,Ae.value=d.selectedExtras,Re.value=d.lastTrackedExtras,te.value=d.createdEvent,ie.value=d.createdEnquiry,ne.value=d.wheelchairAccess,oe.value=d.specialRequest,le.value=d.highchairs,re.value=d.competitionOptIn,se.value=d.menuTermsOptIn,ue.value=d.enquiryFormEnabled,ce.value=d.canEnquire,de.value=d.isWithinBookingThreshold,me.value=d.fullyBooked,Oe.value=d.verifyOccasionData,Se.value=d.skipIntervalId,ke.value=d.consentStatement,clearInterval(ze),ze=null,je.payment.startTimestamp.value=null,je.payment.timeIsUp.value=!1,je.payment.timer.value=r,je.payment.isRunning=!1,je.holdCapacity.startTimestamp.value=null,je.holdCapacity.timer.value=r,je.holdCapacity.isRunning=!1,_e.value=d.payment,Ce.value=d.updatedPayment,Me.value=d.journeyType,Ne.value=d.initialJourneyType,Le.value=d.initialSelectedAreaName,f.value=d.sportId,B.value=d.inPubEventId,x.value=d.occasionFromQuickbook,K.value=d.eventId,q.value=d.menuFromQuickbook,w.value=d.areaFromQuickbook,Ke.value=d.useTimeslotsDetailed,h.value=d.currentStepNumber,Pe.value=!0,Fe.value=d.rememberMe,Ye.value=!1,He.value=d.holdEventId},ra=()=>{N.value=d.adults,U.value=d.children,D.value=d.date,Me.value=d.journeyType,f.value=d.sportId,B.value=d.inPubEventId,x.value=d.occasionFromQuickbook,K.value=d.eventId,q.value=d.menuFromQuickbook,w.value=d.areaFromQuickbook},sa=(e,a=!1)=>{const t=I.value.findIndex((a=>a.id===e));-1!==t&&(v.value=e,I.value=I.value.map(((e,a)=>({...e,completed:a<t}))),a&&(h.value=Rt(e)))},ua=e=>{T.value=e},ca=(e,a)=>{I.value=I.value.map((t=>{const i=t.id===e;return i?{...t,isValid:a}:t}))},da=(e,a)=>{I.value=I.value.map((t=>{const i=t.id===e;return i?{...t,isLoading:a}:t}))},ma=(e,a)=>{I.value=I.value.map((t=>{const i=t.id===e;return i?{...t,isSkipped:a}:t}))},va=(0,n.EW)((()=>{const e=I.value.find((e=>e.id===v.value));return!e||e.isValid})),Ea=(0,n.EW)((()=>J.value.filter((e=>e.available)))),pa=(0,n.EW)((()=>Z.value.filter((e=>e.available)))),ba=(0,n.EW)((()=>ee.value.filter((e=>e.available)))),Aa=(0,n.EW)((()=>ae.value.filter((e=>e.available&&(0,A.B)(e)>0)))),Ra=(0,n.EW)((()=>G.value.filter((e=>e.available)))),ga=(0,n.EW)((()=>Me.value===R.yQ.SPORTS||Me.value===R.yQ.EVENT_LISTING||Me.value===R.yQ.MULTI_DAY_EVENT)),Ta=(0,n.EW)((()=>Me.value===R.yQ.MULTI_DAY_EVENT)),ya=(0,n.EW)((()=>{const e=l()().startOf("day");return(J.value[0]?.eventDetails?.availableDays||[]).filter((a=>!l()(a).startOf("day").isBefore(e)))})),Ia=(0,n.EW)((()=>{if(!q.value)return!1;const e=pa.value.find((e=>e.id===q.value));return e&&!e.depositTotal})),Oa=(0,n.EW)((()=>w.value&&ba.value.some((e=>e.id===w.value)))),Sa={[R.RA.OCCASIONS]:()=>1===Ea.value.length&&(!Qe.value||!Ea.value[0]?.keywords?.length),[R.RA.MENUS]:()=>1===pa.value.length&&!pa.value[0].depositTotal&&(!We.value||!pa.value[0]?.keywords?.length)||Ia.value,[R.RA.AREAS]:()=>1===ee.value.length&&1===ba.value.length&&(!$e.value||!ba.value[0]?.keywords?.length)||Oa.value,[R.RA.EXTRAS]:()=>0===Aa.value.length,[R.RA.DEPOSIT]:()=>!na.value&&!at.value},ka=e=>{const a=o.indexOf(e);-1!==a&&o.slice(a+1).forEach((e=>{ma(e,!1)}))},ha={[R.RA.OCCASIONS]:()=>{Sa[R.RA.OCCASIONS]()&&(ve.value=Ea.value[0]?.id,ma(R.RA.OCCASIONS,!0))},[R.RA.MENUS]:()=>{Sa[R.RA.MENUS]()&&ma(R.RA.MENUS,!0)},[R.RA.AREAS]:()=>{Sa[R.RA.AREAS]()&&ma(R.RA.AREAS,!0)},[R.RA.EXTRAS]:()=>{Sa[R.RA.EXTRAS]()&&ma(R.RA.EXTRAS,!0)},[R.RA.DEPOSIT]:()=>{Sa[R.RA.DEPOSIT]()&&ma(R.RA.DEPOSIT,!0)}},_a=e=>Sa[e]?.()||!1,{mutateAsync:Ca}=b((()=>({venueId:Je.value,occasionId:ve.value,areaId:pe.value,date:D.value,time:be.value,adults:N.value,children:U.value,minimumNotice:za.value?.minimumNotice??null,holdEventId:He.value??null})),(e=>{He.value=e}),(()=>X.value?.some((e=>e.groupAvailability.some((e=>e.availability!==R.M$.NONE))))||!1)),Ma=async()=>{await Ca(),Wa()},Na={[R.RA.TIMESLOTS]:async()=>
1{if(!Ze.value||He.value)return{success:!0};Ha();try{return await Ma(),{success:!0}}catch{return{success:!1}}},[R.RA.BOOK_WITH_US]:async()=>(await Ua(I.value.findIndex((e=>e.id===R.RA.OCCASIONS))),Ea.value.length?me.value?{type:R.Ub.FULLY_BOOKED,success:!1}:{success:!0}:{type:R.Ub.NO_AVAILABLE_OCCASIONS,success:!1}),[R.RA.OCCASIONS]:async()=>{const e=mt();return e.success?(await Ua(I.value.findIndex((e=>e.id===R.RA.AREAS))),ba.value.length?(await Ua(I.value.findIndex((e=>e.id===R.RA.MENUS))),pa.value.length?{success:!0}:{type:R.Ub.NO_AVAILABLE_MENUS,success:!1}):(await La(),{type:R.Ub.NO_AVAILABLE_AREAS,success:!1})):(await La(),e)},[R.RA.AREAS]:async()=>{const e=I.value.findIndex((e=>e.id===R.RA.TIMESLOTS));return-1!==e&&I.value[e].isLoading&&await Ua(e),z.value===R.M$.NONE?{type:R.Ub.NO_AVAILABLE_TIMESLOTS,success:!1}:{success:!0}}},La=()=>{const e=I.value.findIndex((e=>e.id===R.RA.TIMESLOTS));return-1!==e&&I.value[e].isLoading?Ua(e):Promise.resolve()},Ua=e=>new Promise((a=>{if(!I.value[e].isLoading)return a();Se.value&&(clearInterval(Se.value),Se.value=d.skipIntervalId);const t=setInterval((()=>{const i=I.value[e];i.isLoading||(clearInterval(t),Se.value=d.skipIntervalId,a())}),100);Se.value=t})),Da=()=>{Se.value&&(clearInterval(Se.value),Se.value=d.skipIntervalId)},fa=async(e,a)=>{if(-1===a)return sa(R.RA.BOOK_WITH_US),{success:!0};const t=e===R.M8.FORWARD?a+1:a-1;if(t<0||t>=I.value.length)return{success:!1,type:"out-of-range"};if(S.value=!0,e===R.M8.FORWARD){if(!u.t.isOnline())return S.value=!1,{success:!1,type:R.Ub.NO_NETWORK};const e=await(Na[I.value[a].id]?.());if(e&&!e.success)return S.value=!1,e}return await Ua(t),_a(I.value[t].id)?(ha[I.value[t].id]?.(e),await(0,n.dY)(),await fa(e,t)):(sa(I.value[t].id),S.value=!1,{success:!0})},Ba=async()=>{if(S.value)return{success:!1,type:"is-loading"};h.value++;const e=await fa(R.M8.FORWARD,ta.value);return e.success||h.value--,e},xa=async()=>{if(Se.value)return Da(),S.value=!1,{success:!0,type:"cancelled"};if(v.value===R.RA.ENQUIRY)return sa(T.value),h.value--,{success:!0};h.value--;const e=await fa(R.M8.BACKWARD,ta.value);return e.success||h.value++,e},Ka=e=>{const a=I.value.findIndex((a=>a.id===e));return ta.value<a},qa=(e=je.payment)=>{const a=Math.floor((Date.now()-e.startTimestamp.value)/1e3);return Math.max((e.duration??r)-a,0)},wa=()=>{Object.values(je).some((e=>e.isRunning))||(clearInterval(ze),ze=null)},Pa=()=>{Object.values(je).forEach((e=>{e.isRunning&&(e.timer.value=qa(e),0===e.timer.value&&(e.isRunning=!1,e.onExpire?.(),wa()))}))},Fa=()=>{ze||(ze=setInterval(Pa,1e3))},Va=()=>{je.payment.timeIsUp.value=!0},Ya=()=>{je.payment.startTimestamp.value=Date.now(),je.payment.timeIsUp.value=!1,je.payment.isRunning=!0,je.payment.onExpire=Va,je.payment.timer.value=qa(je.payment),Fa()},Qa=e=>{je.holdCapacity.onExpire=e},Wa=()=>{je.holdCapacity.duration=Xe.value,je.holdCapacity.startTimestamp.value=Date.now(),je.holdCapacity.isRunning=!0,je.holdCapacity.timer.value=qa(je.holdCapacity),Fa()},$a=(e=r)=>{je.payment.startTimestamp.value=Date.now()-1e3*(r-e),je.payment.timer.value=e,je.payment.timeIsUp.value=!1},Ga=()=>{je.payment.isRunning=!1,wa()},Ha=()=>{je.holdCapacity.isRunning=!1,wa()},Xa=(0,n.EW)((()=>Z.value.find((e=>e.id===Ee.value)))),ja=(0,n.EW)((()=>ee.value.find((e=>e.id===pe.value)))),za=(0,n.EW)((()=>J.value.find((e=>e.id===ve.value)))),Ja=(0,n.EW)((()=>G.value.find((e=>e.time===be.value)))),Za=(0,n.EW)((()=>Ae.value.map((e=>{const a=ae.value.find((a=>a.id===e.id));return a?{...a,quantity:e.quantity,totalPrice:a.price*e.quantity}:null})).filter(Boolean))),et=(0,n.EW)((()=>Za.value.reduce(((e,a)=>e+a.totalPrice),0))),at=(0,n.EW)((()=>et.value>0)),tt=(0,n.EW)((()=>ne.value&&"no"!==ne.value)),it=(0,n.EW)((()=>{const e=Xa.value?.depositPerAdult||0;return e*N.value})),nt=(0,n.EW)((()=>{const e=Xa.value?.depositPerChild||0;return e*U.value})),ot=(0,n.EW)((()=>it.value+nt.value+(Xa.value?.depositPerBooking||0))),lt=(0,n.EW)((()=>ot.value+et.value)),rt=(e,a)=>{const t=ae.value.find((a=>a.id===e));if(!t)return;const i=Math.max(t.minimumQuantity??0,1);if(a<i)return void(Ae.value=Ae.value.filter((a=>a.id!==e)));const n=Math.min(a,(0,A.B)(t)),o=Ae.value.find((a=>a.id===e));Ae.value=o?Ae.value.map((a=>a.id===e?{...a,quantity:n}:a)):[...Ae.value,{id:e,quantity:n}]};(0,n.wB)(v,(e=>{e===R.RA.CONFIRMATION&&(Ga(),Ha())}));const st=(0,i.KR)(!1);(0,n.wB)([v,Z,ve,ee,ue],(()=>{!ve.value||Z.value.length&&ee.value.length?st.value=ue.value:st.value=!1}),{immediate:!0});const ut=(0,n.EW)((()=>H.value.some((e=>e.availabilities.some((e=>!0===e.canEnquire)))))),ct=(0,n.EW)((()=>ee.value.every((e=>"FullyBooked"===e.unavailabilityReason)))),dt=(a,t)=>
1!(!a&&!t)&&(a&&ia.value<a?(ye.value=[e("booking-app-msg-min-covers",{minCovers:a})],!0):!!(t&&ia.value>t)&&(ye.value=[e("booking-app-msg-max-covers",{maxCovers:t})],!0)),mt=()=>{const e=Oe.value?.messages;return e?.length>0?(ve.value=d.selectedOccasion,{success:!1,type:R.Ub.VERIFICATION_FAILED,message:e[0],contactAvailable:Oe.value?.contactAvailable}):dt(za.value?.minimumCovers,za.value?.maximumCovers)?{success:!1,type:R.Ub.CAPACITY_RULES_FAILED,message:ye.value[0]}:{success:!0,type:"success"}},vt=e=>{Me.value=e,Ne.value??=e},Et=()=>{Ue.value+=1},pt=()=>{E.value=d.bookingFunnelAllSteps,p.value=d.bookingFunnelKeySteps},bt=()=>{I.value.forEach((e=>{e.isSkipped=!1}))},At=e=>e===R.RA.TIMESLOTS&&Ke.value&&ba.value.length>1?"timeslots-area":e,Rt=e=>{if(!E.value)return 1;const a=At(e),t=E.value.split("|").find((e=>e.split("-").slice(1).join("-")===a));return t?Number(t.split("-")[0]):1},gt=e=>{g.value=e},Tt=()=>{we.value=d.bookingStepCount},yt=()=>{Pe.value=!0},It=e=>{De.value=e||"unknown"},Ot=e=>{Ve.value=e},St=()=>{we.value+=1},kt=()=>{yt(),C.value=!1,Et(),h.value=1};return(0,n.wB)(ba,(e=>{v.value!==R.RA.ENQUIRY&&pe.value&&!e.some((e=>e.id===pe.value))&&(pe.value=d.selectedArea)})),(0,n.wB)(pa,(e=>{Ee.value&&!e.some((e=>e.id===Ee.value))&&(Ee.value=d.selectedMenu)})),(0,n.wB)(Ea,(e=>{ve.value&&!e.some((e=>e.id===ve.value))&&(ve.value=d.selectedOccasion)})),(0,n.wB)(Ra,(e=>{be.value&&!e.some((e=>e.time===be.value))&&(be.value=d.selectedTimeslot)})),(0,n.wB)(ve,(e=>{v.value!==R.RA.ENQUIRY&&ca(R.RA.OCCASIONS,!!e),ka(R.RA.OCCASIONS)})),(0,n.wB)(Ee,(e=>{v.value!==R.RA.ENQUIRY&&ca(R.RA.MENUS,!!e),se.value=d.menuTermsOptIn,Ae.value=d.selectedExtras,Re.value=d.lastTrackedExtras,ka(R.RA.MENUS)})),(0,n.wB)(pe,(e=>{Le.value||(Le.value=ja.value?.name),v.value!==R.RA.ENQUIRY&&ca(R.RA.AREAS,!!e),ka(R.RA.AREAS)})),(0,n.wB)(be,(e=>{v.value!==R.RA.ENQUIRY&&ca(R.RA.TIMESLOTS,!!e),ka(R.RA.TIMESLOTS)})),(0,n.wB)(v,((e,a)=>{a===R.RA.ENQUIRY&&e!==R.RA.ENQUIRY&&(pe.value&&!ba.value.some((e=>e.id===pe.value))&&(pe.value=d.selectedArea),ca(R.RA.OCCASIONS,!!ve.value),ca(R.RA.MENUS,!!Ee.value),ca(R.RA.AREAS,!!pe.value),ca(R.RA.TIMESLOTS,!!be.value)),a&&e!==a&&St()})),(0,n.wB)([pe,H],(([,e],[,a])=>{H.value.length?pe.value&&(G.value=H.value.reduce(((e,a)=>{const t=a.availabilities.find((e=>e.areaId===pe.value));return t&&e.push({time:a.time,group:a.group,...t}),e}),[])||[]):e!==a&&(G.value=[])})),(0,n.wB)([pe,X],(()=>{if(!pe.value||!X.value.length)return j.value=R.M$.NONE,void(z.value=R.M$.NONE);const e=X.value.find((e=>e.areaId===pe.value)),a=e?.groupAvailability||[],t=[R.M$.NONE,R.M$.LIMITED,R.M$.MODERATE,R.M$.FULL],i=a.map((e=>e.availability)),n=i.map((e=>t.indexOf(e))).filter((e=>-1!==e)),o=n.length?Math.min(...n):0;j.value=t[o]||R.M$.NONE;const l=n.length?Math.max(...n):0;z.value=t[l]||R.M$.NONE})),{STEP_ID:R.RA,JOURNEY_TYPE:R.yQ,VERIFICATION_RESULT_TYPES:R.Ub,apiUrl:m,currentStepId:v,stepBeforeEnquiry:T,enquiryEntryReason:y,steps:I,isSummaryVisible:O,isLoading:S,isQuickBookLoading:k,mobileApp:M,adults:N,enquiryTimeslotsAdults:L,children:U,date:D,sportId:f,inPubEventId:B,occasionFromQuickbook:x,eventId:K,menuFromQuickbook:q,areaFromQuickbook:w,firstName:P,lastName:F,emailAddress:V,confirmationEmail:Y,telephoneNumber:Q,rememberMe:Fe,specialRequest:oe,wheelchairAccess:ne,highchairs:le,competitionOptIn:re,menuTermsOptIn:se,selectedOccasion:ve,selectedMenu:Ee,selectedArea:pe,selectedTimeslot:be,skipIntervalId:Se,consentStatement:ke,bookingEntryPage:De,beginCheckoutTimestamp:fe,rejoinCheckoutPending:Be,bookingEntrySource:xe,useTimeslotsDetailed:Ke,availableOccasions:Ea,availableMenus:pa,availableAreas:ba,selectedMenuItem:Xa,selectedAreaItem:ja,selectedOccasionItem:za,selectedTimeslotItem:Ja,selectedExtras:Ae,lastTrackedExtras:Re,selectedExtrasItems:Za,selectedExtrasTotal:et,hasPaidExtrasSelected:at,hasWheelchairAccess:tt,depositPerAdultTotal:it,depositPerChildTotal:nt,depositOnlyTotal:ot,depositSummaryTotal:lt,venueDetails:W,venueFinderLink:qe,competition:$,occasions:J,menus:Z,timeslots:G,timeslotsDetailed:H,groupsAvailabilities:X,timeslotsLowestAvailability:j,timeslotsHighestAvailability:z,areas:ee,extras:ae,createdEvent:te,createdEnquiry:ie,requirements:he,verifyOccasionData:Oe,occasionsTagsEnabled:Qe,menusTagsEnabled:We,areasTagsEnabled:$e,sendEventNameToZonal:Ge,venueId:Je,getCurrentStep:ea,bookingData:oa,getStep:aa,isCurrentStepValid:va,isDepositRequired:na,numberOfCovers:ia,enquiryFormEnabled:ue,canEnquire:ce,isWithinBookingThreshold:de,shouldShowEnquiryForm:st,canEnquireTimeslots:ut,fullyBooked:me,notificationModalType:ge,notificationModalContactAvailable:Te,verificationMessage:ye,unavailableModalRef:Ie,selectedOccasionFullyBooked:ct,$reset:la,resetBookingFunnel:pt,resetStepsSkippedStatus:bt,resetOnPresetJourney:ra,setCurrentStep:sa,setStepBeforeEnquiry:ua,setStepValid:ca,setStepLoading:da,hasSavedUserDataOnInit:Ye,numberOfDaysToStoreUserData:Ve,setNumberOfDaysToStoreUserData:Ot,goToNextStep:Ba,goToPreviousStep:xa,shouldSkipStep:_a,skipConditions:Sa,isBeforeStep:Ka,getCurrentStepIndex:ta,checkUnavailabilityRules:mt,setCheckoutRe
1started:yt,setStepSkipped:ma,setBookingEntryPage:It,checkCapacityRules:dt,timers:je,timer:je.payment.timer,timeIsUp:je.payment.timeIsUp,startTimer:Ya,startTimerForHoldCapacity:Wa,placeHoldAndStartTimer:Ma,resetTimer:$a,stopTimer:Ga,stopTimerForHoldCapacity:Ha,registerHoldExpireCallback:Qa,calculateTimeLeft:qa,payment:_e,updatedPayment:Ce,journeyType:Me,isQuickBookDataApplied:_,isQuickBookJourney:C,isPresetJourney:ga,isMultiDayEventJourney:Ta,filteredAvailableDays:ya,isCheckoutRestarted:Pe,currentStepNumber:h,initialJourneyType:Ne,initialSelectedAreaName:Le,setJourneyType:vt,checkoutCount:Ue,increaseCheckoutCount:Et,bookingFunnelAllSteps:E,bookingFunnelKeySteps:p,isStartAgain:g,bookingStepCount:we,incrementBookingStepCount:St,resetStepsCount:Tt,setStartAgain:gt,handleResetTracking:kt,getBookingStepName:At,setExtraQuantity:rt,holdEventId:He,holdDuration:Xe,isHoldCapacityEnabled:Ze}}))},72632:(e,a,t)=>{t.d(a,{z:()=>s});var i=t(23041),n=t(72324);const o=(e,a)=>{const t=i.A.create({baseURL:e,headers:{"Content-Type":"application/json"},..."get"===a?{timeout:1e4}:{}});return t.interceptors.response.use((e=>e.data),(e=>{let a;return a=e.response?e.response.data?.errorMessage:e.message?`${e.message} (${e.code})`:"An unexpected error occurred",Promise.reject(new Error(a,{cause:e}))})),t},l=()=>{const e=(0,n.D)();return e.apiUrl?Promise.resolve(e.apiUrl):new Promise((a=>{const t=setInterval((()=>{e.apiUrl&&(clearInterval(t),a(e.apiUrl))}),50)}))},r=async(e,a,t={})=>{const i=await l(),n=o(i,e);return n[e](a,t)},s={venue:{getDetails:e=>r("get","/Venue",{params:{venueId:e}})},availability:{getOccasions:e=>r("get","/Availability/occasions",{params:e}),verifyOccasion:({occasionId:e,adults:a,children:t,date:i,venueId:n})=>r("get",`/Availability/occasions/${e}/verification`,{params:{adults:a,children:t,date:i,venueId:n}}),getTimeslots:e=>r("get","/Availability/timeslots",{params:e}),getTimeslotsDetailed:e=>r("get","/Availability/timeslots/detailed",{params:e}),getMenus:e=>r("get","/Availability/menus",{params:e}),getAreas:e=>r("get","/Availability/areas",{params:e}),getExtras:e=>r("get","/Availability/extras",{params:e}),getRequirements:e=>r("get","/Availability/requirements",{params:e})},holdCapacity:{placeHold:e=>r("post","/HoldCapacity",e)},event:{create:e=>r("post","/Event",e),cancel:(e,a,t)=>r("post",`/Event/${e}`,{reason:a,venueId:t})},completeBooking:{submit:e=>r("post","/CompleteBooking",e)},enquiry:{create:e=>r("post","/Enquiry",e)},payment:{create:e=>r("post","/Payment/",{...e}),update:(e,a)=>r("put",`/Payment/${e}`,{...a})}}},77233:(e,a,t)=>{t.d(a,{B:()=>i});const i=e=>{const{remainingQuantity:a,maximumQuantity:t}=e,i=[a,t].filter((e=>"number"===typeof e));return i.length?Math.min(...i):1/0}},83725:(e,a,t)=>{t.d(a,{f:()=>s});var i=t(20641),n=t(10141),o=t(72324),l=t(72632),r=t(5019);function s(){const e=(0,o.D)(),a=(0,i.EW)((()=>e.venueId?e.selectedOccasion?e.date?e.selectedTimeslot?r.PI.isAdultsInRange(e.adults)?r.PI.isChildrenInRange(e.children)?r.PI.isTotalCoversInRange(e.adults+e.children)?null:new Error("Invalid sum of covers"):new Error("Invalid number of children"):new Error("Invalid number of adults"):new Error("Missing required parameter: time"):new Error("Missing required parameter: date"):new Error("Missing required parameter: occasionId"):new Error("Missing required parameter: venueId"))),t=(0,i.EW)((()=>({venueId:e.venueId,occasionId:e.selectedOccasion,dates:e.date,time:e.selectedTimeslot,adults:e.adults,children:e.children}))),s=(0,n.I)({queryKey:["booking-app","extras",t],queryFn:async()=>l.z.availability.getExtras(t.value),enabled:(0,i.EW)((()=>!a.value)),refetchOnWindowFocus:!1,refetchOnReconnect:!0,refetchOnMount:!0,retry:1,staleTime:3e5});return{...s,validationError:a}}},85878:(e,a,t)=>{t.d(a,{n:()=>m});var i=t(20641),n=t(50953),o=t(36158),l=t(26261),r=t(66500),s=t(24880),u=class extends r.Q{#e;#a=void 0;#t;#i;constructor(e,a){super(),this.#e=e,this.setOptions(a),this.bindMethods(),this.#n()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){const a=this.options;this.options=this.#e.defaultMutationOptions(e),(0,s.f8)(this.options,a)||this.#e.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#t,observer:this}),a?.mutationKey&&this.options.mutationKey&&(0,s.EN)(a.mutationKey)!==(0,s.EN)(this.options.mutationKey)?this.reset():"pending"===this.#t?.state.status&&this.#t.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#t?.removeObserver(this)}onMutationUpdate(e){this.#n(),this.#o(e)}getCurrentResult(){return this.#a}reset(){this.#t?.removeObserver(this),this.#t=void 0,this.#n(),this.#o()}mutate(e,a){return this.#i=a,this.#t?.removeObserver(this),this.#t=this.#e.getMutationCache().build(this.#e,this.options),this.#t.addObserver(this),this.#t.execute(e)}#n(){const e=this.#t?.state??(0,o.$)();this.#a={...e,isPending:"pending"===e.status,isSuccess:"success"===e.status,isError:"error"===e.status,isIdle:"idle"===e.status,mutate:this.mutate,reset:this.reset}}#o(e){l.jG.batch((()=>
1{if(this.#i&&this.hasListeners()){const a=this.#a.variables,t=this.#a.context,i={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};"success"===e?.type?(this.#i.onSuccess?.(e.data,a,t,i),this.#i.onSettled?.(e.data,null,a,t,i)):"error"===e?.type&&(this.#i.onError?.(e.error,a,t,i),this.#i.onSettled?.(void 0,e.error,a,t,i))}this.listeners.forEach((e=>{e(this.#a)}))}))}},c=t(65911),d=t(46146);function m(e,a){const t=a||(0,d.j)(),o=(0,i.EW)((()=>t.defaultMutationOptions((0,c.Ww)(e)))),l=new u(t,o.value),r=o.value.shallow?(0,n.Gc)(l.getCurrentResult()):(0,n.Kh)(l.getCurrentResult()),m=l.subscribe((e=>{(0,c.$j)(r,e)})),v=(e,a)=>{l.mutate(e,a).catch((()=>{}))};(0,i.wB)(o,(()=>{l.setOptions(o.value)})),(0,n.jr)((()=>{m()}));const E=o.value.shallow?(0,n.nD)(r):(0,n.tB)(r),p=(0,n.QW)(E);return(0,i.wB)((()=>r.error),(e=>{if(e&&(0,s.GU)(o.value.throwOnError,[e]))throw e})),{...p,mutate:v,mutateAsync:r.mutate,reset:r.reset}}},91669:(e,a,t)=>{t.d(a,{q:()=>c});var i=t(20641),n=t(46146),o=t(10141),l=t(72324),r=t(72632),s=t(5019),u=t(561);function c(){const e=(0,l.D)(),a=(0,n.j)(),t=(0,i.EW)((()=>e.venueId?s.PI.isAdultsInRange(e.adults)?s.PI.isChildrenInRange(e.children)?e.date?e.selectedOccasion?s.PI.isTotalCoversInRange(e.adults+e.children)?null:new Error("Invalid sum of covers"):new Error("Missing required parameter: occasionId"):new Error("Missing required parameter: date"):new Error("Invalid number of children"):new Error("Invalid number of adults"):new Error("Missing required parameter: venueId"))),c=(0,i.EW)((()=>{const a=e.currentStepId===u.RA.ENQUIRY,t={venueId:e.venueId,date:e.date,occasionId:e.selectedOccasion,adults:e.adults,children:e.children,menuStartTime:e.selectedMenuItem?.startTime,menuEndTime:e.selectedMenuItem?.endTime};return a&&(t.occasionStartTime=e.selectedOccasionItem?.startTime,t.occasionEndTime=e.selectedOccasionItem?.endTime),t})),d=(0,i.EW)((()=>["booking-app","timeslots-detailed",c])),m=(0,i.EW)((()=>!t.value&&e.useTimeslotsDetailed)),v=(0,o.I)({queryKey:d.value,queryFn:async()=>r.z.availability.getTimeslotsDetailed(c.value),enabled:m,refetchOnWindowFocus:!1,refetchOnReconnect:!0,refetchOnMount:!0,retry:1,staleTime:3e5}),E=async()=>a.invalidateQueries({queryKey:d.value});return{...v,validationError:t,invalidateTimeslots:E}}}}]); 2//# sourceMappingURL=2324.0d14526b.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.