1!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="78e0dc1d-d793-4b90-8aba-19c488449c3f",e._sentryDebugIdIdentifier="sentry-dbid-78e0dc1d-d793-4b90-8aba-19c488449c3f")}catch(e){}}(),(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[529,680,3732],{3574:e=>{e.exports={RowData:"input_RowData__xtdAa",floatingLabel:"input_floatingLabel__E_RVU",asterisk:"input_asterisk__CqnWN",floatingLabel1:"input_floatingLabel1___vo4o",floatingLabel2:"input_floatingLabel2__dCR3q",floatingLabelWrap:"input_floatingLabelWrap__41TrF",noFloatingLabelWrap:"input_noFloatingLabelWrap__iLMQx",ErrorCont:"input_ErrorCont__QpBsl",ifBirthday:"input_ifBirthday__ueGbM",birthday:"input_birthday__CKO8d",isAllCourses:"input_isAllCourses__JDEob",birthdayMT:"input_birthdayMT__w7zC1",phone:"input_phone__AQgCK",ifNotes:"input_ifNotes__tYCpc",ifNotesMT:"input_ifNotesMT__lCg9I",inputField1:"input_inputField1__cKsYS",inputField2:"input_inputField2__HzI5k",Label1:"input_Label1__1C1QJ",hrLine:"input_hrLine__GJRPG",information:"input_information__SynNO",labelHolder:"input_labelHolder__EPwQw",Cancellation:"input_Cancellation__wwEAC",CancellationDescription:"input_CancellationDescription__Cim8W",CustomInput:"input_CustomInput__3kldm",CustomInputLabel:"input_CustomInputLabel__85EUK",CustomIn:"input_CustomIn__79iNC",datemodal:"input_datemodal__A_0ZB",inputWrapper:"input_inputWrapper__6IMHu",inputBox:"input_inputBox__TDX6p",inputLabel:"input_inputLabel__v6EU3",zipCode:"input_zipCode__bi7ep",checkBoxContainer:"input_checkBoxContainer__u_wkj",checkBoxImage:"input_checkBoxImage__5MPRf",checkBoxTitle:"input_checkBoxTitle___lcdA",checkBoxDescription:"input_checkBoxDescription__Xj7Tr"}},5016:e=>{e.exports={container:"layout_container__YX1XY",container1:"layout_container1__1LfzL",logo:"layout_logo__wrJtS",hover:"layout_hover__MWSJI",footerBody:"layout_footerBody__CWtKL",footer1Body:"layout_footer1Body__uoEYt",footerBgBody:"layout_footerBgBody__DZikN","footer-parallax":"layout_footer-parallax__PS8La",navigate:"layout_navigate__N3OpN",footerRightIcon:"layout_footerRightIcon__tNcmO",SocialIcons:"layout_SocialIcons__42Afx",SocialIconsTemp1:"layout_SocialIconsTemp1___wK9M",burgerButton:"layout_burgerButton__icA_3",burgerButtonDisabled:"layout_burgerButtonDisabled__4ycPs",burgerBar:"layout_burgerBar__pgj6A",burgerBarDisabled:"layout_burgerBarDisabled__EVNSl",header:"layout_header__j_PPA",headerGrid:"layout_headerGrid__fDlvb",headlogo:"layout_headlogo__J65pM",navbar:"layout_navbar__XAeT0",navbarHam:"layout_navbarHam__NoeZY",navbarContainer:"layout_navbarContainer__IAlDg",footerContainer:"layout_footerContainer__MCWu6",footerEnd:"layout_footerEnd__YqtZc",footerEnd1:"layout_footerEnd1__qiJuV",InputContainer:"layout_InputContainer__3dHuw",inputField:"layout_inputField__U3J3B",hubSpotBtn:"layout_hubSpotBtn___cz8b",center:"layout_center__9nN9Z",center1:"layout_center1__flA8C",left1:"layout_left1__ILwQ5",left2:"layout_left2__oFbEV",imageMargin:"layout_imageMargin__XRBZS",hubClass:"layout_hubClass__Ejc_K",reviewBox:"layout_reviewBox__hnWHA",firstBox:"layout_firstBox__CdVI7",secondBox:"layout_secondBox__7xQIi",title:"layout_title__3WRyA",title1:"layout_title1__PUzwm",subtitle:"layout_subtitle__cpMQJ",ratingClass:"layout_ratingClass__YsaED",images:"layout_images__D0SgA",ratings:"layout_ratings__bMWx0",badgesText:"layout_badgesText__IYBmV",recommend:"layout_recommend__i0sYc",recommendDiv:"layout_recommendDiv__CavJy",badges:"layout_badges__nu11k",imgChecked:"layout_imgChecked__L24lm",imageClass:"layout_imageClass__v0ClE",reactQuill:"layout_reactQuill__SS7en",imageDrop:"layout_imageDrop__UyaAP",imageDrop1:"layout_imageDrop1__v2Q_G",help:"layout_help___gYkI",submitBtn:"layout_submitBtn__fk7pG",lastPage:"layout_lastPage__hw6r7",addpic:"layout_addpic__UV36j",RateReviewCoverpicture:"layout_RateReviewCoverpicture__NRVAK",RateReviewCoverpicture1:"layout_RateReviewCoverpicture1__jXtVH",ImgCont:"layout_ImgCont__8wfww",ImgCont1:"layout_ImgCont1__U_xaF",RateReviewCoverpictureInner:"layout_RateReviewCoverpictureInner__YGoX7",close:"layout_close__6Qt4H",Cover:"layout_Cover__d_7Lg",picRemove:"layout_picRemove__HzdbV",descContainer__input
1:"layout_descContainer__input__yuj7A",submitBtnDis:"layout_submitBtnDis__jMGN6",ImageUpload:"layout_ImageUpload__Wex84",sticky_search:"layout_sticky_search__y5Zny",sticky_search_container:"layout_sticky_search_container__ZhvFW",sticky_search_box:"layout_sticky_search_box__ntcZE",sticky_search_box_text:"layout_sticky_search_box_text__dwHkc",mobileFooterOverlay:"layout_mobileFooterOverlay__oBEW6",subCat:"layout_subCat__F58eW",waiverContainer:"layout_waiverContainer__3bcqe",mobile_user_dropdown:"layout_mobile_user_dropdown__jT9SY"}},5906:(e,t,l)=>{"use strict";l.r(t),l.d(t,{__N_SSP:()=>tk,default:()=>tS});var n=l(37876),a=l(14232),i=l(803),o=l(61902),r=l(48815),s=l.n(r),d=l(8714),u=l(14445),c=l(52804),p=l(14e3),m=l(6155),_=l(39853),v=l(33435),g=l.n(v),h=l(44830),y=l(75423),f=l(75890),x=l(86144),b=l(56557),C=l.n(b),j=l(21862);let N=e=>{let t=Number(e);return Number.isFinite(t)?t:null},w=(e,t)=>{var l,n;let a=(e=>Array.isArray(null==e?void 0:e.ratecard_sessions)?e.ratecard_sessions.filter(e=>!(null==e?void 0:e.is_deleted)):[])(e);if(!a.length)return[];let i=null!=t?null==e||null==(l=e.rates)?void 0:l.find(e=>N(null==e?void 0:e.id)===N(t)):null==e||null==(n=e.rates)?void 0:n[0];if(!i)return a;let o=a.filter(e=>N(null==e?void 0:e.ratecard_rate_id)===N(i.id));return a.some(e=>null!=N(null==e?void 0:e.ratecard_rate_id))&&(o.length>0||null!=t)?o:a},D=(e,t)=>!!(null==e?void 0:e.is_classes)&&w(e,t).length>0,k=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=new Set;return e.forEach(e=>{e&&t.add(C()(e).format("YYYY-MM-DD"))}),t},S=e=>{var t;let{schedule:l,rateCardId:n,session:a,selectedRateId:i,calendarDateStr:o,tripAnchorDate:r=null}=e;if(!(null==l?void 0:l.length)||!a||!o)return!1;let s=C()(o).format("YYYY-MM-DD");if(k(E(l,n)).has(s))return!1;let d=a.day_offset||a.offset_day||0,u=r?C()(r).format("YYYY-MM-DD"):C()(o).subtract(d,"day").format("YYYY-MM-DD");if(u<C()().add(1,"day").format("YYYY-MM-DD"))return!1;let c=l.find(e=>e.date===u);if(!c)return!1;let p=(c.available_rates||[]).filter(e=>N(null==e?void 0:e.guide_ratecard_id)===N(n)),m=null!=i?p.find(e=>N(null==e?void 0:e.id)===N(i)):p[0];if(!m)return!1;let _=a.default_vehicle_guid;if(!_)return!0;let v=null==(t=m.available_sessions)?void 0:t.find(e=>e.session_number===a.session_number),g=((null==v?void 0:v.vehicles)||[]).find(e=>e.vehicle_guid===_);return!g||!(0>=(g.available_seats||0))},A=function(e,t){let l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(!t||!(null==e?void 0:e.length))return{};let n=C()(t).format("YYYY-MM-DD"),a=l&&n?{...l,tripAnchorDate:C()(n).format("YYYY-MM-DD")}:l,i={};return e.forEach((t,l)=>{let o;if(0===l)o=n;else{var r;let n=e[l-1],s=null==(r=i[n.id])?void 0:r.date;o=(e=>{var t;let{session:l,prevSession:n,prevDate:a,sessions:i,availabilityContext:o}=e,r=Math.max(0,(l.day_offset||0)-(n.day_offset||0)),s=C()(a).add(r,"day").format("YYYY-MM-DD");return(null==o||null==(t=o.schedule)?void 0:t.length)&&(null==o?void 0:o.rateCardId)!=null&&(s=(e=>{let{schedule:t,rateCardId:l,session:n,sessions:a,selectedRateId:i,candidateDate:o,minDate:r=null,maxSearchDays:s=366,tripAnchorDate:d=null}=e,u=C()(o).startOf("day"),c=u,p=r?C()(r).startOf("day"):c;c.isBefore(p)&&(c=p);for(let e=0;e<s;e+=1){let e=c.format("YYYY-MM-DD");if(S({schedule:t,rateCardId:l,session:n,selectedRateId:i,calendarDateStr:e,tripAnchorDate:d}))return e;c=c.add(1,"day")}return u.format("YYYY-MM-DD")})({...o,session:l,sessions:i,candidateDate:s,minDate:s,tripAnchorDate:o.tripAnchorDate})),s})({session:t,prevSession:n,prevDate:s,sessions:e,availabilityContext:a})}i[t.id]={date:o,time:t.default_start_time||"",vehicle_guid:t.default_vehicle_guid||null}}),i},E=(e,t)=>{let l=C()().add(1,"day").format("YYYY-MM-DD");return(e||[]).filter(e=>{var n;return!(null==(n=e.available_rates)?void 0:n.some(e=>N(e.guide_ratecard_id)===N(t)))||e.date<l}).map(e=>new Date(e.date.replace(/-/g,"/")))},T=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{tripDetailsContext:t,context:l,guideDetails:n,cartItems:i,setCartItems:o,postCart:r}=e,[s,d]=(0,a.useState)(null),[u,c]=(0,a.useState)(null),[p,m]=(0,a.useState)([]),[_,v]=(0,a.useState)(0),g=(0,a.useCallback)(e=>[...e,...(null==i?void 0:i.filter(e=>"course"===e.product_type))||[]],[i]),h=(0,a.useCallback)(e=>{(0,x.Bo)((0,x.serializeCheckoutCartForStorage)(e)),o&&o(e)},[o]),y=(0,a.useCallback)(()=>{var e;null==t||null==(e=t.setPromo)||e.call(t,e=>({...e,applied:!1,response:"",show:!1,promoCode:""}))},[t]),b=(0,a.useCallback)(async(e,t,l)=>{var a,i,o,s,d,u,c;if(!r)return;let p=e[l],m=t[l];await r({cart_items:{new:[{ratecard_id:null==(a=m.selectedRateCard)?void 0:a.id,ratecard_rate_id:null==(i=m.selectedHour)?void 0:i.id,trip_date:m.selectedDay,is_group:(null==n||null==(o=n.page_attributes)?void 0:o.is_mt)||!1,guid:(null==n||null==(s=n.page_attributes)?void 0:s.is_mt)?null==n||null==(d=n.group_details)?void 0:d.group_guid:null==n?void 0:n.guideguid}],old:[{ratecard_id:null==(u=p.selectedRateCard)?void 0:u.id,ratecard_rate_id:null==(c=p.selectedHour)?void 0:c.id,trip_date:p.selectedDay}]}},"update")},[r,n]),C=(0,a.useCallback)((e,t)=>{v(e)},[]),j=(0,a.useCallback)(e=>{v(e),d(e),c("guests"),C(e,"guests")},[C]),N=(0,a.useCallback)(()=>{d(null),c(null),requestAnimationFrame(()=>{"undefined"!=typeof document&&(document.querySelector(".ReactModal__Overlay--after-open")||(document.body.classList.remove("ReactModal__Body--open"),document.documentElement.classList.remove("ReactModal__Html--open"),document.body.style.removeProperty("overflow"),document.body.style.removeProperty("padding-right")))})},[]),k=(0,a.useCallback)(async()=>{let e=(null==i?void 0:i.filter(e=>"course"!==e.product_type))||[];if(null!=s){var a,o;let t=e[s],l=p[s];t&&l&&!(e=>{var t,l;let n="object"==typeof(null==e?void 0:e.selectedRateCard)?e.selectedRateCard:null,a=null!=(l=null==e||null==(t=e.selectedHour)?void 0:t.id)?l:null==e?void 0:e.selectedHour,i=(null==e?void 0:e.sessionOverrides)&&Object.keys(e.sessionOverrides).length>0?e.sessionOverrides:n?((e,t,l)=>{if((null==e?void 0:e.sessionOverrides)&&Object.keys(e.sessionOverrides).length>0)return e.sessionOverrides;if(!t||!D(t,l))return null;let n=w(t,l);return n.length&&(null==e?void 0:e.selectedDay)?A(n,e.selectedDay):null})(e,n,a):null;return!!i&&!!Object.keys(i).length&&(null!=n&&!!n.is_classes||D(n,a))})(l)&&(t.selectedDay!==l.selectedDay||(null==(a=t.selectedHour)?void 0:a.id)!==(null==(o=l.selectedHour)?void 0:o.id))&&await b(e,p,s)}let r=g(p);h(r),y(),f.i&&t&&l&&n&&(0,f.i)(t,l,n,r,null,null,{preserveRes:!0}),N()},[s,p,i,b,g,h,y,t,l,n,N]);return{bookingEditHubIndex:s,hubExpandedSection:u,localData:p,currentRateCardIndex:_,setHubExpandedSection:c,setLocalData:m,setCurrentRateCardIndex:v,openB
1ookingEditHub:j,closeBookingEditHub:N,finishBookingEditHub:k,prepareHubSection:C,buildMergedCheckoutCart:g,persistCheckoutCart:h,handleClear:y,handleUpdateCart:b}};var R=l(36031),M=l(32252),I=l(97719),P=l(60929),B=l(17464),F=l(3574),q=l.n(F),Y=l(69750),H=l(91040),L=l(33345),G=l(20355),O=l.n(G);function z(e,t){var l,n;if((null==e||null==(l=e.page_attributes)?void 0:l.otherDets)!==!0||!t||t.length<=1)return!1;let a=(null==(n=t[0])?void 0:n.totalGuests)||1;if(a<=1)return!1;let i=e=>{let t=Array.isArray(null==e?void 0:e.guest_groups)?e.guest_groups:[];if(t.length>0)return t.filter(e=>Number((null==e?void 0:e.seat_count)||0)>0).sort((e,t)=>String((null==e?void 0:e.label)||"").toLowerCase().localeCompare(String((null==t?void 0:t.label)||"").toLowerCase())).map(e=>"".concat(String((null==e?void 0:e.label)||"").toLowerCase(),":").concat(Number((null==e?void 0:e.seat_count)||0))).join("|");let l=null==e?void 0:e.guestCount;return l&&"object"==typeof l?Object.keys(l).filter(e=>Number(l[e]||0)>0).sort().map(e=>"".concat(String(e).toLowerCase(),":").concat(Number(l[e]||0))).join("|"):"total:".concat(Number((null==e?void 0:e.totalGuests)||1))},o=i(t[0]);return t.every(e=>((null==e?void 0:e.totalGuests)||1)===a&&i(e)===o)}let W=(e,t)=>{let l=0;for(let n=0;n<t;n++)l+=e[n].totalGuests||1;return l},V=(e,t)=>{let{fname:l,lname:n,mtemail:a,phone:i,birthday:o}=e;return{firstName:l[t]||"",lastName:n[t]||"",email:a[t]||"",phone:i[t]||"",birthday:o[t]||""}},U=(e,t,l)=>{e(e=>{let n=[...e];return n[t]=l,n})},K=(e,t,l)=>{let{setFName:n,setLName:a,setMtEmail:i,setPhone:o,setPhoneNumber:r,setBirthday:s}=e;U(n,t,l.firstName),U(a,t,l.lastName),U(i,t,l.email),U(o,t,l.phone),U(r,t,l.phone),U(s,t,l.birthday)},Z=(e,t)=>{K(e,t,{firstName:"",lastName:"",email:"",phone:"",birthday:""})};var Q=l(83251),J=l(81248),X=l(92679);C().extend(O());let $=e=>{var t,l,i,o,r,d,u,c,p,_,v,h,y,f;let{setValidation:x,validation:b,guideDetails:N,status:w,birthdayCheck:D,cardDetails:k,sameGuestDetailsForAllTrips:S,openBookingEditHub:A}=e,E=(null==N||null==(t=N.page_attributes)?void 0:t.notesBox)===!0||(null==N||null==(l=N.page_attributes)?void 0:l.notesBox)===void 0,T=(null==N||null==(i=N.page_attributes)?void 0:i.medicalInsights)===!0,R=(null==N||null==(o=N.page_attributes)?void 0:o.otherDets)===!0,M=(null==N||null==(r=N.page_attributes)?void 0:r.is_mt)===!0,F=(null==N||null==(d=N.page_attributes)?void 0:d.phoneReq)===!0,G=(null==N||null==(u=N.page_attributes)?void 0:u.emailReq)===!0,[O,U]=(0,a.useState)(!1),[$,ee]=(0,a.useState)([0]),[et,el]=(0,a.useState)({}),[en,ea]=(0,a.useState)({}),ei=(0,a.useRef)({}),eo=(0,a.useRef)({}),er=(null==N||null==(c=N.page_attributes)?void 0:c.template)!=="Classic",{setFName:es,setLName:ed,setMtEmail:eu,setPhoneNumber:ec,setPhone:ep,setRequiredFn:em,setRequiredLn:e_,setRequiredEmail:ev,setRequiredPhone:eg,fname:eh,lname:ey,mtemail:ef,phone:ex,phoneNumber:eb,requireFn:eC,requireLn:ej,requireEmail:eN,requirePhone:ew,birthday:eD,setBirthday:ek,notes:eS,setNotes:eA,medicalInsights:eE,setMedicalInsights:eT,setRequiredBirthday:eR,requireBirthday:eM,setError:eI,error:eP,cartItems:eB}=(0,a.useContext)(m.A),eF=(null==eB||null==(p=eB[0])?void 0:p.totalGuests)||1,eq=z(N,eB),eY=!!(eq&&S),eH=(null==eB?void 0:eB.length)===1,eL=eH?{xxl:12,xl:12,lg:12,md:12,sm:12,xs:12,className:"p-0"}:{xxl:4,xl:4,lg:4,md:6,sm:6,xs:12},eG={xxl:12,xl:12,lg:12,md:12,sm:12,xs:12,...eH?{className:"p-0"}:{}},eO=(0,a.useMemo)(()=>{let e=[],t=0;for(let n=0;n<(eB||[]).length;n++){var l;e[n]=t,t+=(null==eB||null==(l=eB[n])?void 0:l.totalGuests)||1}return e},[eB]),ez=(0,a.useRef)(S),eW=(0,a.useRef)((null==eB?void 0:eB.map(e=>(null==e?void 0:e.totalGuests)||1))||[]),eV=(0,a.useRef)(!1),eU=(0,a.useCallback)(e=>!R||0===e||!!eO&&0!==eO.length&&eO.includes(e),[R,eO]),eK=eB.some(e=>{var t;return null==(t=e.selectedRateCard)?void 0:t.is_course}),eZ=eB.some(e=>"course"===e.product_type);(0,a.useEffect)(()=>{w&&(eC?document.getElementById("first-name-0").focus():!eC&&ej?document.getElementById("last-name-0").focus():eC||ej||!eN?eC||ej||eN||!ew||document.getElementById("phone-number-0").focus():document.getElementById("email-0").focus())},[w]),(0,a.useEffect)(()=>{ei.current=et},[et]),(0,a.useEffect)(()=>{eo.current=en},[en]);let eQ=(0,a.useCallback)(e=>{var t;let l=ei.current,n=eo.current,a=R?(()=>{if(!eO||0===eO.length)return 0;for(let l=eO.length-1;l>=0;l--){var t;if(e>=(null!=(t=eO[l])?t:0))return l}return 0})():e;a>0&&l[a]&&el(e=>({...e,[a]:!1}));let i=!R||e===(null!=(t=null==eO?void 0:eO[a])?t:0);a>0&&i&&n[a]&&ea(e=>({...e,[a]:!1}))},[R,eO]);(0,a.useEffect)(()=>
1{if(!eH&&R){let e=ei.current;Object.keys(e).forEach(t=>{let l=Number(t);if(l>0&&e[l]){var n,a,i,o;let e=null!=(i=null==eO?void 0:eO[0])?i:0,t=null!=(o=null==eO?void 0:eO[l])?o:0,r=Math.min((null==eB||null==(n=eB[0])?void 0:n.totalGuests)||1,(null==eB||null==(a=eB[l])?void 0:a.totalGuests)||1);for(let l=1;l<r;l++)te(e+l,t+l)}})}},[eh,ey,ef,ex,eD,et,R]),(0,a.useEffect)(()=>{if(!eH){let e=eo.current,t=ei.current;Object.keys(e).forEach(l=>{let n=Number(l);if(n>0&&e[n]&&!t[n]){var a,i;te(R&&null!=(a=null==eO?void 0:eO[0])?a:0,R?null!=(i=null==eO?void 0:eO[n])?i:0:n)}})}},[null==eh?void 0:eh[0],null==ey?void 0:ey[0],null==ef?void 0:ef[0],null==ex?void 0:ex[0],null==eD?void 0:eD[0],en,R]);let eJ=(0,a.useCallback)((e,t,l)=>{eQ(l);let n=e.target.value.replace(/[0-9!@#$%^&*()_+{}\[\]:;<>,.?~\\/-/'"|]/g,""),a="firstName"===t,i=[...eC],o=[...ej];n.trim()?a?i[l]=!1:o[l]=!1:a?i[l]=!0:o[l]=!0,em(i),e_(o),a?es(e=>{let t=[...e];return t[l]=n,t}):ed(e=>{let t=[...e];return t[l]=n,t})},[es,ed,eC,ej,eQ]),eX=(0,a.useCallback)((e,t)=>{let l=/^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\.[a-zA-Z]{2,5}$/.test(e),n=G||eU(t);x(n=>{let a=[...n];return a[t]||(a[t]={isValidEmail:!1,inValidPhone:!1,inValidBirthday:!1}),a[t].isValidEmail=!!e&&!l,a}),ev(l=>{let a=[...l];return a[t]=!!n&&!e,a})},[ev,eU,G]),e$=(0,a.useCallback)((e,t)=>{eQ(t);let l=e.target.value,n=[...ef];n[t]=l,eu(n),eX(l,t)},[eu,eX,ef,eQ]),e0=(0,a.useCallback)((e,t)=>{let l=!!e&&(0,Y.isValidPhoneNumber)(e),n=F||eU(t);x(n=>{let a=[...n];return a[t]||(a[t]={isValidEmail:!1,inValidPhone:!1,inValidBirthday:!1}),a[t].inValidPhone=!!e&&!l,a}),eg(l=>{let a=[...l];return a[t]=!!n&&!e,a})},[eg,eU,F]),e1=(0,a.useCallback)((e,t)=>{eQ(t),ep(l=>{let n=[...l];return n[t]=e,n}),ec(l=>{let n=[...l];return n[t]=e,n}),e0(e,t)},[e0,ec,ep,eQ]);(0,a.useEffect)(()=>{H.A.get("https://ipinfo.io/json").then(e=>{var t;(null==e||null==(t=e.data)?void 0:t.region)=="Washington"&&U(!0)}).catch(e=>console.error("Error fetching location:",e))},[]);let e2=(null==eB?void 0:eB.reduce((e,t)=>e+(t.totalGuests||0),0))||1,e5=R?e2:(null==eB?void 0:eB.length)||1,e3=(0,a.useMemo)(()=>{var e,t,l,n;if(!R)return Array.from({length:(null==eB?void 0:eB.length)||1},(e,t)=>t);if(eY)return Array.from({length:eF},(e,t)=>t);if((eB||[]).length>1&&!S){let l=[];for(let n=0;n<eB.length;n++){let a=null!=(t=null==eO?void 0:eO[n])?t:0,i=(null==(e=eB[n])?void 0:e.totalGuests)||1;for(let e=0;e<i;e++)l.push(a+e)}return l}if((eB||[]).length>1){let e=[0];for(let t=0;t<eB.length;t++){let a=null!=(n=null==eO?void 0:eO[t])?n:0,i=(null==(l=eB[t])?void 0:l.totalGuests)||1;for(let t=1;t<i;t++)e.push(a+t)}return e}return Array.from({length:e5},(e,t)=>t)},[R,eY,eF,e5,eB,eO,S]),e4=e3.length,e8=(0,a.useCallback)(e=>{if(!eO||0===eO.length)return 0;for(let l=eO.length-1;l>=0;l--){var t;if(e>=(null!=(t=eO[l])?t:0))return l}return 0},[eO]);(0,a.useEffect)(()=>{if(!(null==eB?void 0:eB.length)||0===e5)return;let e=(0,L.gL)();if(eh.length!==e5||b.length!==e5){let l=Array(e5).fill(""),n=Array(e5).fill(""),a=Array(e5).fill(""),i=Array(e5).fill(""),o=Array(e5).fill(""),r=Array(e5).fill(null).map(()=>({...tt})),s=Array(e5).fill(!1),d=Array(e5).fill(!1),u=Array(e5).fill(!1),c=Array(e5).fill(!1),p=Array(e5).fill(!1),m=eW.current||[],_=e=>{var t;return R&&(null==(t=eB[e])?void 0:t.totalGuests)||1},v=e=>R?m[e]||0:1,g=0;for(let e=0;e<eB.length;e++){var t;let m=R?null!=(t=eO[e])?t:0:e,h=_(e),y=v(e),f=Math.min(y,h);for(let e=0;e<f;e++){let t=m+e,_=g+e;_<eh.length&&(l[t]=eh[_]||"",n[t]=ey[_]||"",a[t]=ef[_]||"",i[t]=ex[_]||"",o[t]=eD[_]||"",r[t]=b[_]||{...tt},s[t]=eC[_]||!1,d[t]=ej[_]||!1,u[t]=eN[_]||!1,c[t]=ew[_]||!1,p[t]=eM[_]||!1)}g+=y||1}l[0]||(l[0]=(null==e?void 0:e.firstname)||""),n[0]||(n[0]=(null==e?void 0:e.lastname)||""),a[0]||(a[0]=(null==e?void 0:e.email)||""),i[0]||(i[0]=(null==e?void 0:e.phone)||""),es(l),ed(n),eu(a),ep(i),ec(i),x(r),em(s),e_(d),ev(u),eg(c),eR(p),ek(o),eV.current=!0}eW.current=eB.map(e=>(null==e?void 0:e.totalGuests)||1)},[e5,eB]);let e6=(0,a.useRef)(!1),e9=(0,a.useRef)(!1);(0,a.useEffect)(()=>{if(e9.current||!eB||eB.length<=1)return;e9.current=!0;let e={};for(let t=1;t<eB.length;t++)e[t]=!0;ea(e)},[eB]),(0,a.useEffect)(()=>
1{if(!e6.current&&eB&&!(eB.length<=1)&&((null==eh?void 0:eh[0])||(null==ey?void 0:ey[0]))){e6.current=!0;for(let l=1;l<eB.length;l++){var e,t;e7(R&&null!=(e=null==eO?void 0:eO[0])?e:0,R?null!=(t=null==eO?void 0:eO[l])?t:0:l)}}},[eB,null==eh?void 0:eh[0],null==ey?void 0:ey[0],R,eO]),((e,t,l,n,a,i,o,r,s,d,u,c,p)=>{let m={fname:t,lname:l,mtemail:n,phone:a,birthday:i},_={setFName:o,setLName:r,setMtEmail:s,setPhone:d,setPhoneNumber:u,setBirthday:c};return(t,l)=>{p(e=>({...e,[t]:l}));let n={cartItems:e,itemIndex:t,guestArrays:m,setters:_};l?(e=>{let{cartItems:t,itemIndex:l,guestArrays:n,setters:a}=e,i=t[0].totalGuests||1,o=W(t,l),r=Math.min(i,t[l].totalGuests||1);for(let e=0;e<r;e++){let t=0+e;K(a,o+e,V(n,t))}})(n):(e=>{let{cartItems:t,itemIndex:l,setters:n}=e,a=W(t,l),i=t[l].totalGuests||1;for(let e=0;e<i;e++)Z(n,a+e)})(n)}})(eB,eh,ey,ef,ex,eD,es,ed,eu,ep,ec,ek,el);let e7=(e,t)=>{es(l=>{let n=[...l];return n[t]=l[e]||"",n}),ed(l=>{let n=[...l];return n[t]=l[e]||"",n}),eu(l=>{let n=[...l];return n[t]=l[e]||"",n}),ep(l=>{let n=[...l];return n[t]=l[e]||"",n}),ec(l=>{let n=[...l];return n[t]=l[e]||"",n}),ek(l=>{let n=[...l];return n[t]=l[e]||"",n})},te=(e,t)=>{eh[t]!==eh[e]&&es(l=>{let n=[...l];return n[t]=l[e]||"",n}),ey[t]!==ey[e]&&ed(l=>{let n=[...l];return n[t]=l[e]||"",n}),ef[t]!==ef[e]&&eu(l=>{let n=[...l];return n[t]=l[e]||"",n}),ex[t]!==ex[e]&&(ep(l=>{let n=[...l];return n[t]=l[e]||"",n}),ec(l=>{let n=[...l];return n[t]=l[e]||"",n})),eD[t]!==eD[e]&&ek(l=>{let n=[...l];return n[t]=l[e]||"",n})},tt={isValidEmail:!1,inValidPhone:!1,inValidBirthday:!1},tl=(0,a.useCallback)(()=>{if(!eq||!S||!eB||eB.length<=1)return;if(eV.current){eV.current=!1;return}let e=eB.length,t=[...eh||[]],l=[...ey||[]],n=[...ef||[]],a=[...ex||[]],i=[...eb||[]],o=[...eD||[]],r=[...eC||[]],s=[...ej||[]],d=[...eN||[]],u=[...ew||[]],c=[...eM||[]],p=[...b||[]].map(e=>({...tt||{},...e||{}})),m=!1;for(let v=1;v<e;v++){var _;let e=null!=(_=null==eO?void 0:eO[v])?_:0;for(let _=0;_<eF;_++){let v=_,g=e+_;t[g]!==eh[v]&&(t[g]=eh[v],m=!0),l[g]!==ey[v]&&(l[g]=ey[v],m=!0),n[g]!==ef[v]&&(n[g]=ef[v],m=!0),a[g]!==ex[v]&&(a[g]=ex[v],m=!0),i[g]!==eb[v]&&(i[g]=eb[v],m=!0),o[g]!==eD[v]&&(o[g]=eD[v],m=!0),r[g]!==eC[v]&&(r[g]=eC[v],m=!0),s[g]!==ej[v]&&(s[g]=ej[v],m=!0),d[g]!==eN[v]&&(d[g]=eN[v],m=!0),u[g]!==ew[v]&&(u[g]=ew[v],m=!0),c[g]!==eM[v]&&(c[g]=eM[v],m=!0);let h=(b||[])[v]||tt,y=p[g]||tt;(y.isValidEmail!==h.isValidEmail||y.inValidPhone!==h.inValidPhone||y.inValidBirthday!==h.inValidBirthday)&&(p[g]={...h},m=!0)}}m&&(es(t),ed(l),eu(n),ep(a),ec(i),ek(o),em(r),e_(s),ev(d),eg(u),eR(c),x(p))},[eq,S,eB,eF,eh,ey,ef,ex,eb,eD,eC,ej,eN,ew,eM,b,eO,es,ed,eu,ep,ec,ek,em,e_,ev,eg,eR,x]);(0,a.useEffect)(()=>{if(eq){if(ez.current!==S)if(S)tl();else{var e,t,l;let n=(null==eB?void 0:eB.length)||0,a=[...eh||[]],i=[...ey||[]],o=[...ef||[]],r=[...ex||[]],s=[...eb||[]],d=[...eD||[]],u=[...eC||[]],c=[...ej||[]],p=[...eN||[]],m=[...ew||[]],_=[...eM||[]],v=[...b||[]].map(e=>({...tt,...e||{}}));for(let t=1;t<n;t++){let l=null!=(e=null==eO?void 0:eO[t])?e:0;for(let e=0;e<eF;e++){let t=l+e;a[t]="",i[t]="",o[t]="",r[t]="",s[t]="",d[t]="",v[t]={...tt},u[t]=!1,c[t]=!1,p[t]=!1,m[t]=!1,_[t]=!1}}es(a),ed(i),eu(o),ep(r),ec(s),ek(d),em(u),e_(c),ev(p),eg(m),eR(_),x(v);let g=eo.current;for(let e=1;e<n;e++)if(g[e]){let n=R&&null!=(t=null==eO?void 0:eO[0])?t:0,u=R?null!=(l=null==eO?void 0:eO[e])?l:0:e;a[u]=a[n]||"",i[u]=i[n]||"",o[u]=o[n]||"",r[u]=r[n]||"",s[u]=s[n]||"",d[u]=d[n]||""}es([...a]),ed([...i]),eu([...o]),ep([...r]),ec([...s]),ek([...d])}ez.current=S}},[eq,S,eB,eF,eh,ey,ef,ex,eb,eD,eC,ej,eN,ew,eM,b,eO,tl]),(0,a.useEffect)(()=>{eq&&S&&tl()},[eq,S,tl]);let tn=(0,a.useMemo)(()=>{var e,t;if(!(null==eB?void 0:eB.length))return[{tripIndex:null,guests:e3||[]}];if(1===eB.length)return[{tripIndex:0,guests:e3||[]}];let l=[],n=eB||[],a=eO||[],i=e3||[];if(!R){for(let e=0;e<n.length;e++)l.push({tripIndex:e,guests:[e]});return l}if(S)return[{tripIndex:0,guests:Array.from({length:(null==(e=n[0])?void 0:e.totalGuests)||1},(e,t)=>t)}];for(let e=0;e<n.length;e++){let o=null!=(t=a[e])?t:0,r=n[e],s=(null==r?void 0:r.totalGuests)||1,d=[];for(let e=0;e<s;
1e++){let t=o+e;i.includes(t)&&d.push(t)}d.length>0&&l.push({tripIndex:e,guests:d})}return l.length>0?l:[{tripIndex:null,guests:i}]},[e3,eB,eO,S,R]);return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{className:q().hrLine}),(0,n.jsxs)("div",{id:"myInfo",children:[(0,n.jsx)("div",{className:"newInfoClass ".concat(g().checkoutNoInnerGuestScroll),children:(tn||[]).map((t,l)=>{var a,i,o,r;let{tripIndex:s,guests:d}=t||{},u=d||[],c=null!==s&&(null==eB?void 0:eB[s])?eB[s]:null;return null==c||null==(a=c.selectedRateCard)||a.title,(0,n.jsxs)("div",{className:eH?"":g().accordionItem,children:[(()=>{var t,a;let i=null!==s?s:l,o=c||(null==eB?void 0:eB[0]),r=(null==o||null==(t=o.selectedRateCard)?void 0:t.title)||"Trip ".concat((null!=s?s:l)+1),d=(()=>{var e;let t=[];if(null==o?void 0:o.selectedDay){let e=C()(o.selectedDay).format("ddd, MMM D, YYYY");t.push(e)}if(null==o||null==(e=o.selectedHour)?void 0:e.start_time){let e=(0,j.Ay)(o.selectedHour.start_time),l=o.selectedHour?(0,j.Ds)(o.selectedHour):"";t.push(l?"".concat(e," (").concat(l,")"):e)}return t.join(" - ")})();return eH?null:(0,n.jsxs)("div",{onClick:()=>(e=>{ee(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])})(i),className:"".concat(g().accordionButton," ").concat(eH&&g().accordionButton_Disabled," ").concat($.includes(i)?g().accordionButton_Open:g().accordionButton_Closed),children:[(0,n.jsx)("span",{className:g().accordionButton__Title,children:eH?r:(0,n.jsxs)(n.Fragment,{children:[(null==eB?void 0:eB.length)>0&&!S?(0,n.jsxs)(n.Fragment,{children:["Trip ",(null!=s?s:l)+1," of ",eB.length," - "]}):(0,n.jsxs)("h3",{children:[(0,B.D5)(e.flag,null==N||null==(a=N.page_attributes)?void 0:a.guest_verbiage)||"Guest","s"," details for ",(null==eB?void 0:eB.length)||1," ",eH?"trip":"trips"]}),(null==eB?void 0:eB.length)>0&&!S&&(0,n.jsx)("span",{className:g().accordionButton__SubTitle,children:r})]})}),(0,n.jsxs)("div",{className:g().accordionButton__Meta,children:[d&&(null==eB?void 0:eB.length)>0&&!S?(0,n.jsx)("span",{className:g().accordionButton__Date,children:d}):null,R?(0,n.jsxs)("span",{className:g().accordionButton__Badge,children:[(null==u?void 0:u.length)||0," ",(null==u?void 0:u.length)===1?"Guest":"Guests"]}):null]}),eH?null:(0,n.jsx)("span",{className:g().accordionButton_Icon,children:(0,n.jsx)(X.default,{url:$.includes(i)?J.A:Q.A,size:28,alt:"Arrow Toggle"})})]})})(),(0,n.jsxs)("div",{className:eH?"":"newInfoClass ".concat(g().accordionContent," ").concat($.includes(null!==s?s:l)?"":g().accordionHidden),children:[!eH&&!S&&R&&(()=>{var e,t,l;let a=null!==s?s:0,i=null==eB?void 0:eB[a];if(!i)return null;let o=e=>{var t;let l=null==N||null==(t=N.poi)?void 0:t.find(t=>t.poiguid===e);return null==l?void 0:l.description},r=(null==i||null==(t=i.selectedRateCard)||null==(e=t.poi_guids)?void 0:e.length)>0&&(null==N||null==(l=N.poi)?void 0:l.length)>0;return(0,n.jsxs)("div",{className:g().meetingLocationBox,children:[r&&(0,n.jsxs)("div",{className:g().meetingLocation,children:[(0,n.jsx)("strong",{className:g().nowrap,children:"Meeting location: "}),(e=>{var t,l,n;return!!(null==N||null==(t=N.poi)?void 0:t.length)&&(null==e||null==(l=e.selectedRateCard)||!l.is_classes||(null==e||null==(n=e.selectedRateCard)?void 0:n.class_type)!=="Digital")&&!!o(null==e?void 0:e.meeting_spot)})(i)?o(i.meeting_spot):"Not selected"]}),(0,n.jsx)("button",{type:"button",className:"".concat(g().checkoutBookingFieldChange," ").concat(g().EditText," ").concat(M?"mt-blue-text":""),onClick:()=>A(a),children:"Edit Trip"})]})})(),!eH&&(0,n.jsxs)("div",{className:"mt-3 mb-4",children:[(0,n.jsxs)("h4",{className:"mb-2",children:[(0,B.D5)(e.flag,null==N||null==(i=N.page_attributes)?void 0:i.guest_verbiage)||"Guest",u.length>1?"s":""," ",S?"info":"for this trip"]}),(0,n.jsxs)("p",{className:"m-0 ".concat(g().infoText),children:["Add details for all ",u.length>1?"".concat((0,B.D5)(e.flag,null==N||null==(o=N.page_attributes)?void 0:o.guest_verbiage)||"Guest","s"):"".concat((0,B.D5)(e.flag,null==N||null==(r=N.page_attributes)?void 0:r.guest_verbiage)||"Guest")," going on this trip."]})]}),u.map(t=>{var a,i,o,r;let s=(e3||[]).indexOf(t),d=eY?0:e8(t);eB&&eB[d]&&eB[d];let u=(()=>{var l,a,i,o,r,d;if(0===s)return(0,n.jsxs)(n.Fragment,{children:[(0,B.D5)(e.flag,null==N||null==(a=N.page_attributes)?void 0:a.guest_verbiage)||"Guest"," 1",(0,n.jsx)("span",{children:"(Primary)"})]});if(!S&&!eH){let l=e8(t),a=t-(null!=(o=eO&&eO[l])?o:0),s=null==eB?void 0:eB[l];return(null==s||null==(i=s.selectedRateCard)||i.title,0===a)?(0,n.jsxs)(n.Fragment,{children:[(0,B.D5)(e.flag,null==N||null==(r=N.page_attributes)?void 0:r.guest_verbiage)||"Guest"," ",a+1,(0,n.jsx)("span",{children:"(Primary)"})]}):"".concat((0,B.D5)(e.flag,null==N||null==(d=N.page_attributes)?void 0:d.guest_verbiage)||"Guest"," ").concat(a+1)}return"".concat((0,B.D5)(e.flag,null==N||null==(l=N.page_attributes)?void 0:l.guest_verbiage)||"Guest"," ").concat(s+1)})(),c=!R||0===t||(()=>{var e;let l=e8(t);return t===(null!=(e=null==eO?void 0:eO[l])?e:0)})();return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("div",{className:eH?"infoClass":"infoClass ".concat(g().guestItem),children:[(0,n.jsx)(I.A,{container:!0,spacing:2,children:(0,n.jsx)(P.A,{item:!0,xxl:12,xl:12,lg:12,md:12,sm:12,xs:12,className:eH?"p-0":"",children:(0,n.jsx)("div",{className:g().sameGuestsGuestHeading,style:{margin:e.isNarrow?"1em 0px":eH?"5px 0px 5px 0px":"5px 0px 15px 0px"},children:R?eH?(()=>{var l,a;if(0===t)return(0,n.jsx)("span",{className:"mtColor pb-0",children:"My Info"});let i=null==eB?void 0:eB[0],o=[];(null==i?void 0:i.selectedDay)&&o.push(C()(i.selectedDay).format("MMMM Do, YYYY")),(null==i||null==(l=i.selectedHour)?void 0:l.start_time)&&o.push((0,j.Ay)(i.selectedHour.start_time));let r=o.length>0?" (".concat(o.join(" - "),")"):"";return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("span",{className:"mtColor pb-0",children:"".concat((0,B.D5)(e.flag,null==N||null==(a=N.page_attributes)?void 0:a.guest_verbiage)||"Guest"," ").concat(t+1," Info")}),(0,n.jsx)("span",{className:g().sameGuestsGuestMeta,children:r})]})})():(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("span",{className:g().guestNumber,children:(()=>{var e;let l=e8(t);return t-(null!=(e=eO&&eO[l])?e:0)+1})()}),(0,n.jsx)("span",{children:u})]}):(0,n.jsx)("span",{children:"My Info"})})})}),(0,n.jsxs)(I.A,{container:!0,spacing:2,className:eH?"".concat(g().rateCardContainer," mtrateCardContainer"):"",style:eH&&e4>1&&s!==e4-1?{marginBottom:10}:{},children:[(0,n.jsx)(P.A,{item:!0,...eL,children:(0,n.jsxs)("div",{className:"".concat(eH?q().RowData:q().inputWrapper," ").concat(eh[t]?q().floatingLabelWrap:q().noFloatingLabelWrap),style:(null==N?void 0:N.is_mt)?{}:{borderWidth:"1px"},children:[!eH&&(0,n.jsxs)("span",{className:q().inputLabel,children:["First Name ",(0,n.jsx)("span",{className:q().asterisk,children:"*"})]}
1),(0,n.jsx)("input",{type:"text",onChange:e=>eJ(e,"firstName",t),value:eh&&eh[t]||"",minLength:"3",maxLength:"20",id:"first-name-".concat(t),autoComplete:"given-name",className:"".concat(q().inputField," mtinputField"),...!eH?{placeholder:"Enter First Name"}:{}}),eH&&(0,n.jsxs)("span",{className:eh[t]?"".concat(q().floatingLabel1," floatingLabel1 mtinputField"):"".concat(q().floatingLabel," floatingLabel"),children:["First Name ",(0,n.jsx)("span",{className:q().asterisk,children:"*"})]}),eC&&eC[t]&&(0,n.jsx)("span",{className:q().ErrorCont,children:"First Name is required*"})]})}),(0,n.jsx)(P.A,{item:!0,...eL,children:(0,n.jsxs)("div",{className:"".concat(eH?q().RowData:q().inputWrapper," ").concat(ey&&ey[t]?q().floatingLabelWrap:q().noFloatingLabelWrap),style:(null==N?void 0:N.is_mt)?{}:{borderWidth:"1px"},children:[!eH&&(0,n.jsxs)("span",{className:q().inputLabel,children:["Last Name ",(0,n.jsx)("span",{className:q().asterisk,children:"*"})]}),(0,n.jsx)("input",{type:"text",onChange:e=>eJ(e,"lastName",t),value:ey&&ey[t]||"",minLength:"3",maxLength:"20",id:"last-name-".concat(t),className:"".concat(q().inputField," mtinputField"),autoComplete:"family-name",...!eH?{placeholder:"Enter Last Name"}:{}}),eH&&(0,n.jsxs)("span",{className:ey&&ey[t]?"".concat(q().floatingLabel1," floatingLabel1 mtinputField"):"".concat(q().floatingLabel," floatingLabel"),children:["Last Name ",(0,n.jsx)("span",{className:q().asterisk,children:"*"})]}),ej&&ej[t]&&(0,n.jsx)("span",{className:q().ErrorCont,children:"Last Name is required*"})]})}),(0,n.jsx)(P.A,{item:!0,...eL,children:(0,n.jsxs)("div",{className:"".concat(eH?q().RowData:q().inputWrapper," ").concat(ef&&ef[t]?q().floatingLabelWrap:q().noFloatingLabelWrap),style:(null==N?void 0:N.is_mt)?{}:{borderWidth:"1px"},children:[!eH&&(0,n.jsxs)("span",{className:q().inputLabel,children:["Email ",(G||c)&&(0,n.jsx)("span",{className:q().asterisk,children:"*"})]}),(0,n.jsx)("input",{type:eH?"text":"email",onChange:e=>e$(e,t),value:ef&&ef[t]||"",id:"email-".concat(t),className:"".concat(q().inputField," mtinputField"),required:eH?0===t||G:G||c,...!eH?{autoComplete:"email",placeholder:"Enter Email Address"}:{}}),eH&&(0,n.jsxs)("span",{className:ef&&ef[t]?"".concat(q().floatingLabel1," floatingLabel1 mtinputField"):"".concat(q().floatingLabel," floatingLabel"),children:["Email ",(G||c)&&(0,n.jsx)("span",{className:q().asterisk,children:"*"})]}),eH?(0,n.jsx)(n.Fragment,{children:0==t||G?eN&&eN[t]&&(0,n.jsx)("span",{className:q().ErrorCont,children:"Email is required* "}):null}):(0,n.jsx)(n.Fragment,{children:eN&&eN[t]&&(0,n.jsx)("span",{className:q().ErrorCont,children:"Email is required* "})}),b&&(null==(a=b[t])?void 0:a.isValidEmail)&&(0,n.jsx)("span",{className:q().ErrorCont,children:"Please provide a valid Email*"})]})}),(0,n.jsx)(P.A,{item:!0,...eL,children:(0,n.jsxs)("div",{className:eH?E||D||eK||(null==e?void 0:e.isAllECourses)||eZ?"".concat(q().RowData," ").concat(q().ifBirthday):"".concat(q().RowData," ").concat(q().phone):"".concat(q().inputWrapper," ").concat(E||D||eK||(null==e?void 0:e.isAllECourses)||eZ?"".concat(q().ifBirthday):"".concat(q().phone)),style:eH?(null==N?void 0:N.is_mt)?{borderWidth:"2px"}:{}:{borderWidth:"0px"},children:[eH?(0,n.jsx)("div",{className:"labelHolder",children:(0,n.jsxs)("span",{className:"".concat(q().Label1," mtinputField floatingLabel"),style:{minWidth:40,display:"inline-block",paddingBottom:4},children:["Phone ",(F||c)&&(0,n.jsx)("span",{className:q().asterisk,children:"*"})]})}):(0,n.jsxs)("span",{className:q().inputLabel,children:["Phone ",(F||c)&&(0,n.jsx)("span",{className:q().asterisk,children:"*"})]}),(0,n.jsx)("form",{className:eH?g().form:"".concat(g().form," ").concat(q().inputBox),children:(0,n.jsx)(Y.Ay,{country:"US",placeholder:"(000) 000-0000",defaultCountry:"US",countryCallingCodeEditable:!1,initialValueFormat:"national",value:ex&&ex[t]||"",onChange:e=>e1(e,t),minLength:8,maxLength:15,required:eH?0===t||F:F||c,isInvalid:b&&(null==(i=b[t])?void 0:i.inValidPhone)||!1,className:"".concat(g().Phone_Input," Phone_Input mtinputField")})}),(0,n.jsxs)("form",{className:"".concat(q().ErrorCont," ").concat(eH?"mt-1":""," "),id:"phone-number-".concat(t),children:[eH?0===t||F?ew&&ew[t]&&(0,n.jsx)("span",{className:"error_message",children:"Phone is required* "}):null:ew&&ew[t]&&(0,n.jsx)("span",{className:"error_message",children:"Phone is required* "}),b&&(null==(o=b[t])?void 0:o.inValidPhone)&&(0,n.jsx)("span",{className:"error_message",children:"Please provide a valid Phone number*"})]})]})}
1),D&&er||eK||(null==e?void 0:e.isAllECourses)||eZ?(0,n.jsx)(P.A,{item:!0,...eL,children:(0,n.jsxs)("div",{className:"".concat(eH?q().RowData:q().inputWrapper," ").concat(q().birthday," ").concat(eK||(null==e?void 0:e.isAllECourses)||eZ?q().isAllCourses:"").concat(eH&&0===t?q().ifNotes:""),style:eH&&(null==N?void 0:N.is_mt)?{borderWidth:"2px"}:{},children:[eH?(0,n.jsxs)("span",{className:"".concat(q().Label1," floatingLabel mtinputField"),children:[eK||(null==e?void 0:e.isAllECourses)||eZ?"Birth Date":"Birthday"," ",(0,n.jsx)("span",{className:q().asterisk,children:"*"})]}):(0,n.jsxs)("span",{className:q().inputLabel,children:[eK||(null==e?void 0:e.isAllECourses)||eZ?"Birth Date":"Birthday"," ",(0,n.jsx)("span",{className:q().asterisk,children:"*"})]}),(0,n.jsx)("input",{type:"text",placeholder:"MM-DD-YYYY",maxLength:10,onChange:e=>((e,t)=>{eQ(t);let l=e.target.value,n=eD[t]||"";if(l.length<n.length){ek(e=>{let n=[...e];return n[t]=l,n}),x(e=>{let l=[...e];return l[t].inValidBirthday=!0,l});let e=[...eM];e[t]=!0,eR(e);return}let a=l;(2===l.length||5===l.length)&&(a+="-"),ek(e=>{let l=[...e];return l[t]=a,l});let i=((e,t)=>{if(/--/g.test(e)||!/^(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])-\d{4}$/.test(e))return!1;let[l,n,a]=e.split("-"),i=new Date(a,l-1,n),o=new Date;return i.getFullYear()===parseInt(a,10)&&i.getMonth()+1===parseInt(l,10)&&i.getDate()===parseInt(n,10)&&i<=o})(a);x(e=>{let l=[...e];return l[t].inValidBirthday=!i,l});let o=[...eM];o[t]=!i,eR(o)})(e,t),value:eD&&eD[t]||"",id:"birthday-".concat(t),className:"".concat(q().inputField," mtinputField")}),(0,n.jsxs)("span",{className:q().ErrorCont,children:[eM&&eM[t]&&(0,n.jsxs)("span",{className:q().errorMsg,children:[eK||(null==e?void 0:e.isAllECourses)||eZ?"Birth Date":"Birthday"," is required*"," "]}),b&&(null==(r=b[t])?void 0:r.inValidBirthday)&&(0,n.jsx)("span",{className:q().errorMsg,children:"Please enter a valid past date in MM-DD-YYYY format."})]})]})}):null,0===t&&E&&er&&!(null==e?void 0:e.isAllECourses)?(0,n.jsx)(P.A,{item:!0,...eG,children:(0,n.jsxs)("div",{className:"".concat(eH?q().RowData:q().inputWrapper," ").concat(q().birthday),style:(null==N?void 0:N.is_mt)?{borderWidth:"2px"}:{},children:[eH?(0,n.jsx)("span",{className:"".concat(q().Label1," floatingLabel mtinputField "),style:{display:"block"},children:"Notes/Requests"}):(0,n.jsx)("span",{className:q().inputLabel,children:"Notes/Requests"}),(0,n.jsx)("input",{type:"text",placeholder:"None Added",onChange:e=>{eA(e.target.value)},value:eS||"",minLength:"3",id:"notes",className:"".concat(q().inputField," mtinputField")})]})}):null,0!==t||O||!T||(B.SS||[]).includes(null==k?void 0:k.zipCode)||(null==e?void 0:e.isAllECourses)?null:(0,n.jsx)(P.A,{item:!0,...eG,children:(0,n.jsxs)("div",{className:"".concat(eH?q().RowData:q().inputWrapper," ").concat(q().birthday),style:eH?{borderWidth:(null==N?void 0:N.is_mt)?"2px":"",borderTop:"1px solid #d4d4d4"}:{},children:[eH?(0,n.jsx)("span",{className:"".concat(q().Label1," floatingLabel mtinputField "),style:{display:"block"},children:"Medical Information We Should Know"}):(0,n.jsx)("span",{className:q().inputLabel,children:"Medical Information We Should Know"}),(0,n.jsx)("input",{type:"text",placeholder:"None Added",onChange:e=>{eT(e.target.value)},value:eE||"",minLength:"3",id:"medical_insight",className:"".concat(q().inputField," mtinputField")})]})})]})]},t),0!==l&&c&&(0,n.jsxs)("div",{className:"Waiver d-flex align-items-center justify-content-start mt-0 mb-3 ".concat(g().copyGuestDetailsContainer),children:[(0,n.jsx)("input",{id:"copyPrimaryGuestDetails-".concat(l),type:"checkbox",checked:en[l]||!1,onChange:e=>((e,t)=>{var l,n,a;if(ea(l=>({...l,[e]:t})),t){let t=R&&null!=(l=null==eO?void 0:eO[0])?l:0,a=R?null!=(n=null==eO?void 0:eO[e])?n:0:e;e7(t,a),(e=>{em(t=>{let l=[...t];return l[e]=!1,l}),e_(t=>{let l=[...t];return l[e]=!1,l}),ev(t=>{let l=[...t];return l[e]=!1,l}),eg(t=>{let l=[...t];return l[e]=!1,l}),eR(t=>{let l=[...t];return l[e]=!1,l})})(a)}else el(t=>({...t,[e]:!1})),(e=>{es(t=>{let l=[...t];return l[e]="",l}),ed(t=>{let l=[...t];return l[e]="",l}),eu(t=>{let l=[...t];return l[e]="",l}),ep(t=>{let l=[...t];return l[e]="",l}),ec(t=>{let l=[...t];return l[e]="",l}),ek(t=>{let l=[...t];return l[e]="",l})})(R?null!=(a=null==eO?void 0:eO[e])?a:0:e)})(l,e.target.checked)}),(0,n.jsx)("label",{htmlFor:"copyPrimaryGuestDetails-".concat(l),children:"Copy Primary Guest Details from Trip 1"})]})]})})]})]},l||0)})}),!eH&&(0,n.jsxs)("div",{className:g().tripShortDetails,children:[(0,n.jsx)("img",{src:"".concat(s().cloudfront,"filters:format(webp)/images/marlin/InfoDarkBlue1.svg"),alt:"info",className:g().tripShortDetailsIcon,width:20,height:20}),(0,n.jsxs)("div",{children:[(0,n.jsxs)("p",{children:["You are booking ",(null==eB?void 0:eB.length)||1," ",eH?"trip":"trips"," with ",S?(null==eB||null==(_=eB[0])?void 0:_.totalGuests)||1:null==eB?void 0:eB.reduce((e,t)=>
1e+(t.totalGuests||1),0)," ",S?"common":"total"," ",(null==(v=(0,B.D5)(e.flag,null==N||null==(h=N.page_attributes)?void 0:h.guest_verbiage))?void 0:v.toLowerCase())||"guest",(S?(null==eB||null==(y=eB[0])?void 0:y.totalGuests)||1:null==eB?void 0:eB.reduce((e,t)=>e+(t.totalGuests||1),0))>1?"s":"","."]}),(0,n.jsxs)("p",{children:[(0,B.D5)(e.flag,null==N||null==(f=N.page_attributes)?void 0:f.guest_verbiage)||"Guest"," details are collected separately for each trip."]})]})]})]})]})};var ee=l(661),et=l(56671),el=l.n(et),en=l(9361),ea=l(62747),ei=l(18435);let eo={src:"/_next/static/media/tag.1b994a6c.svg",height:18,width:18,blurWidth:0,blurHeight:0};var er=l(15832);let es="https://guidesly-assets.s3.us-east-2.amazonaws.com/web/static/images/checked.svg",ed="https://guidesly-assets.s3.us-east-2.amazonaws.com/web/static/images/uncheck.svg",eu={display:"flex",paddingTop:5,paddingBottom:5,alignItems:"center"},ec={margin:0,padding:0,borderRadius:0,marginRight:10,height:17,width:17,border:"1px solid grey"},ep={padding:"0px 20px",fontSize:"14px",height:"30px"},em=e=>{var t,l,i,o,r,s,d,u,c,p,_,v,h,y,f,b,C;let{isAllCourses:j,isAllECourses:N,template:w,is_MT:D,...k}=e,S=(0,a.useRef)(null),A=(0,a.useContext)(m.A),{setTippercentage:E,cartItems:T,IndDepositDetails:R,setCartItems:M,addOnFees:I,stateTaxAdd:P,mealTaxAdd:B,stateTaxCustom:F,setPromoLoader:Y,giftCards:H,setGiftCards:L,addOnCheck:G,promoloader:O}=A,[z,W]=(0,a.useState)(!1),[V,U]=(0,a.useState)({tipamount:"uponCash",tiptype:"Cash Tip on Trip"}),[K,Z]=(0,a.useState)(!1),[Q,J]=(0,a.useState)(0),[$,et]=(0,a.useState)(""),[em,ev]=(0,a.useState)([]),eg=(null==k||null==(l=k.guideDetails)||null==(t=l.page_attributes)?void 0:t.showTip)===!0||(null==k||null==(o=k.guideDetails)||null==(i=o.page_attributes)?void 0:i.showTip)===void 0,eh=!(N||j)&&D?eg:!w||w&⪚(0,a.useEffect)(()=>{var e,t,l;J((null==A||null==(e=A.tripCal)?void 0:e.total_trip_amount)-(null==A||null==(t=A.tripCal)?void 0:t.addons)-(null==A||null==(l=A.tripCal)?void 0:l.tip))},[A.tripCal]),(0,a.useEffect)(()=>{A.setTipamount("uponCash"),A.setTipType("Cash Tip on Trip")},[]);let ey=(e,t)=>{let l=null==t?void 0:t.find(e=>"STATE_FEE"===e.type);return(null==l?void 0:l.active)&&[null,!0,void 0].includes(null==l?void 0:l.fee_applicability)?(null==e?void 0:e.consumerStateTaxAddOn)*(Number(null==l?void 0:l.charge_percentage)/100):0},ef=(e,t)=>{let l=null==t?void 0:t.find(e=>"STATE_FEE"===e.type);return(null==l?void 0:l.active)?(null==e?void 0:e.meals)*(Number(null==l?void 0:l.charge_percentage)/100):0};(0,a.useEffect)(()=>{let e=[];T.forEach(t=>{var l,n,a,i;let o="".concat(null==(l=t.selectedRateCard)?void 0:l.id,"|").concat(null==(n=t.selectedHour)?void 0:n.id,"|").concat(t.selectedDay),r=null==R?void 0:R.find(e=>e.uniqueID===o),s=ey(r,null==(a=t.selectedRateCard)?void 0:a.addon_fees)+ef(r,null==(i=t.selectedRateCard)?void 0:i.addon_fees);e.push({uniqueID:o,total:s})}),ev(e)},[T,I,R]),(0,a.useEffect)(()=>{console.log("changes in cart or addons"),A.setPromoList([]),L([]),A.setPromo({show:!1,promoCode:"",error:"",applied:!1,response:"",promo_details:[]})},[T,G]);let ex=async e=>{var t,l,n,a;if(Y(!0),!((null==T?void 0:T.length)>1)||(null==(l=A.promo)||null==(t=l.response)?void 0:t.is_gift))A.setPromo({show:!1,promoCode:"",error:"",applied:!1,response:"",promo_details:[]}),(null==H?void 0:H.length)>0&&L(await eD(H));else{let t=[...new Set((null==(n=(0,ea.H8)(null==A||null==(a=A.promoList)?void 0:a.filter(e=>null==e?void 0:e.valid)))?void 0:n.filter(t=>{var l;return!(null==(l=t.code)?void 0:l.includes(e))})).map(e=>e.code))];if(t.length>0){let e=await ek(t);if(A.setPromoList(e),e.length>0){let t=e[e.length-1];A.setPromo({...A.promo,applied:!0,response:t,promoCode:t.code})}(null==H?void 0:H.length)>0&&L(await ew(null,H))}else A.setPromoList([]),A.setPromo({show:!1,promoCode:"",error:"",applied:!1,response:"",promo_details:[]}),(null==H?void 0:H.length)>0&&L(await eD(H))}Y(!1)},eb=async e=>{var t,l,n,a,i,o,r,s;Y(!0);let d=H.filter(t=>t.code!==e),u=(null==(t=A.promo)?void 0:t.applied)&&(null==(l=A.promo)?void 0:l.response)&&!(null==(a=A.promo)||null==(n=a.response)?void 0:n.is_gift),c=null==A||null==(i=A.promoList)?void 0:i.filter(e=>(null==e?void 0:e.valid)&&(null==e?void 0:e.is_promo)),p=(null==c?void 0:c.length)>0,m=[...new Set((null==c?void 0:c.map(e=>e.code))||[])],_=u&&!p?(null==(o=A.promo)?void 0:o.promoCode)||(null==(s=A.promo)||null==(r=s.response)?void 0:r.code):null,v=_?[...new Set([...m,_])]:m;if(0!==d.length||u||p)if(v.length>0){let e=await ek(v);if((p||(null==T?void 0:T.length)>1)&&A.setPromoList(e),e.length>0){let t=e[e.length-1];A.setPromo({...A.promo,applied:!0,response:t,promoCode:t.code,promo_details:t.promo_bookings})}if(d.length>0){let t=e.length>0?e[e.length-1]:null;L(await ew(t,d))}else L([])}else d.length>0?L(await eD(d)):L([]);else L([]),A.setPromo({show:!1,promoCode:"",error:"",applied:!1,response:"",promo_details:[]});Y(!1)},eC=(e,t,l)=>{var n,a,i,o,r,s,d,u,c,p,m,_,v,g,h,y,f;let x={source_guid:null==k||null==(a=k.guideDetails)||null==(n=a.page_attributes)?void 0:n.app_guid,trips:T.map(e=>{var t,n,a,i,o,r;let s="".concat(null==(t=e.selectedRateCard)?void 0:t.id,"|").concat(null==(n=e.selectedHour)?void 0:n.id,"|").concat(e.selectedDay),d=(null==l||null==(a=l.find(e=>null==e?void 0:e.id.includes(s)))?void 0:a.amount)||0;return{source_guid:null==k||null==(o=k.guideDetails)||null==(i=o.page_attributes)?void 0:i.app_guid,migrated_gc:!1,trip_cost:"course"===e.product_type?Number((null==e?void 0:e.course_cost)*e.quantity):d,ratecard_id:"course"===e.product_type?Number(null==e?void 0:e.course_id):null==(r=e.selectedRateCard)?void 0:r.id,tripdate:e.selectedDay}})};return{code:e,trip_cost:t,guideguid:(null==(o=k.guideDetails)||null==(i=o.page_attributes)?void 0:i.is_mt)?null==k||null==(r=k.guideDetails)?void 0:r.group_guid:null==k||null==(s=k.guideDetails)?void 0:s.guideguid,booking_source:(null==(u=k.guideDetails)||null==(d=u.page_attributes)?void 0:d.is_mt)?"BS":"Marlin",bookingAmou
1nts:l,trip:{source_guid:null==k||null==(p=k.guideDetails)||null==(c=p.page_attributes)?void 0:c.app_guid,migrated_gc:null==k||null==(_=k.guideDetails)||null==(m=_.page_attributes)?void 0:m.migrated_gc},ratecard_id:(null==(v=T[0])?void 0:v.product_type)==="course"?Number(null==(g=T[0])?void 0:g.course_id):null==(y=T[0])||null==(h=y.selectedRateCard)?void 0:h.id,tripdate:null==(f=T[0])?void 0:f.selectedDay,...(null==T?void 0:T.length)>1&&x}},ej=(e,t,l)=>{let n=t-((null==e?void 0:e.guests)||0);if((null==e?void 0:e.is_auto_add_perperson)&&n>=1){if("P"===e.additional_perperson_rate_type)return e.additional_perperson_rate/100*l*n;if("V"===e.additional_perperson_rate_type)return e.additional_perperson_rate*n}return 0},eN=()=>{let e=[];for(let r of T)if("course"!==r.product_type){var t,l,n,a,i,o;let s="".concat(null==(t=r.selectedRateCard)?void 0:t.id,"|").concat(null==(l=r.selectedHour)?void 0:l.id,"|").concat(r.selectedDay),d=(null==r||null==(n=r.selectedHour)?void 0:n.rate)||0,u=ej(r.selectedRateCard,r.totalGuests,d),c=(null==I||null==(a=I.filter(e=>{var t;return Number(e.ratecard_id)===Number(null==(t=r.selectedRateCard)?void 0:t.id)&&e.uniqueID===s}))?void 0:a.reduce((e,t)=>e+(t.charge_price||0),0))||0,p=null==R?void 0:R.find(e=>e.uniqueID===s),m=ey(p,null==(i=r.selectedRateCard)?void 0:i.addon_fees),_=ef(p,null==(o=r.selectedRateCard)?void 0:o.addon_fees),v=(null==p?void 0:p.consumerAddOn)||0,g=(0,ea.ZU)(null==k?void 0:k.guideDetails),h=d+u+c+v+(g?m:0)+(g?_:0);e.push({id:s,amount:h})}for(let t of T)if("course"===t.product_type){let l=(null==t?void 0:t.course_id)+"-"+(null==t?void 0:t.course_sku)+"-"+Number(null==t?void 0:t.course_cost);e.push({id:l,amount:Number(null==t?void 0:t.course_cost)})}return e},ew=async(e,t)=>{let l=[],n=eN();if(e){let t=new Map;(null==e?void 0:e.trips)&&e.trips.length>0?e.trips.forEach(e=>{var l;null==(l=e.promo_bookings)||l.forEach(e=>{t.set(e.id,e.promo_amount||0)})}):(null==e?void 0:e.promo_bookings)&&e.promo_bookings.forEach(e=>{t.set(e.id,e.promo_amount||0)}),n=n.map(e=>({id:e.id,amount:Math.max(0,e.amount-(t.get(e.id)||0))}))}for(let e of t){let t=n.reduce((e,t)=>e+(t.amount||0),0);if(t<=0)break;let o=eC(e.code,t,n);try{let t=await (0,ei.post)("payment/verify_code",o,{headers:{Authorization:"Bearer ".concat(A.token)}});if(t.data.valid){var a,i;if(((null==(a=t.data.promo_bookings)?void 0:a.reduce((e,t)=>e+(t.promo_amount||0),0))||0)>0){let a={id:t.data.id,code:e.code,amount_off:t.data.amount_off,is_gift:!0,is_promo:t.data.is_promo,valid:t.data.valid,promo_bookings:t.data.promo_bookings};l.push(a),null==(i=t.data.promo_bookings)||i.forEach(e=>{let t=n.findIndex(t=>t.id===e.id);-1!==t&&(n[t].amount=Math.max(0,n[t].amount-(e.promo_amount||0)))})}}}catch(t){console.error("Failed to recalculate gift card ".concat(e.code,":"),t)}}return l},eD=async e=>{let t=[],l=eN();for(let i of e){let e=l.reduce((e,t)=>e+(t.amount||0),0);if(e<=0)break;let o=eC(i.code,e,l);try{let e=await (0,ei.post)("payment/verify_code",o,{headers:{Authorization:"Bearer ".concat(A.token)}});if(e.data.valid){var n,a;if(((null==(n=e.data.promo_bookings)?void 0:n.reduce((e,t)=>e+(t.promo_amount||0),0))||0)>0){let n={id:e.data.id,code:i.code,amount_off:e.data.amount_off,is_gift:!0,is_promo:e.data.is_promo,valid:e.data.valid,promo_bookings:e.data.promo_bookings};t.push(n),null==(a=e.data.promo_bookings)||a.forEach(e=>{let t=l.findIndex(t=>t.id===e.id);-1!==t&&(l[t].amount=Math.max(0,l[t].amount-(e.promo_amount||0)))})}}}catch(e){console.error("Failed to recalculate gift card ".concat(i.code,":"),e)}}return t},ek=async e=>{let t=[],l=eN(),n=l.reduce((e,t)=>e+(t.amount||0),0);for(let a of e){let e=eC(a,n,l);try{let l=await (0,ei.post)("payment/verify_code",e,{headers:{Authorization:"Bearer ".concat(A.token)}});l.data.valid&&!l.data.is_gift&&(l.data.trips?l.data.trips.forEach(e=>{e.valid&&t.push({...e,code:a})}):t.push({...l.data,code:a}))}catch(e){console.error("Failed to re-verify promo code ".concat(a,":"),e)}}return t},eS=async(e,t)=>{var l,n,a,i,o,r,s,d,u,c,p,m,_,v;if(Y(!0),H.some(t=>{var l;return(null==(l=t.code)?void 0:l.toLowerCase())===(null==e?void 0:e.toLowerCase())})){A.setPromo({...A.promo,error:"This gift card has already been applied.",show:!0}),Y(!1);return}let g=P+((null==I||null==(l=I.find(e=>"STATE_FEE"===e.type))?void 0:l.charge_price)||0)+B+(F||0),h=eC(e,(null==(n=T[0])?void 0:n.product_type)==="course"?Number((null==(a=T[0])?void 0:a.course_cost)*T[0].quantity):(null==A||null==(i=A.tripCal)?void 0:i.total_trip_amount)-((0,ea.ZU)(null==k?void 0:k.guideDetails)?0:g),eN());try{let l=(await (0,ei.post)("payment/verify_code",h,{headers:{Authorization:"Bearer ".concat(A.token)}})).data;if(l.code=e,!1===l.valid){null!=l.error?A.setPromo({...A.promo,error:l.error.message}
1):t&&A.setPromo({...A.promo,error:"This code is invalid."}),Y(!1);return}if(l.is_gift){let t=(null==(o=A.promo)?void 0:o.applied)&&!(null==(s=A.promo)||null==(r=s.response)?void 0:r.is_gift)&&(null==(c=A.promo)||null==(u=c.response)||null==(d=u.promo_bookings)?void 0:d.length)>0?A.promo.response:null,l=((e,t)=>{var l;let n=eN(),a=new Map,i=null==A||null==(l=A.promoList)?void 0:l.filter(e=>(null==e?void 0:e.valid)&&(null==e?void 0:e.is_promo));return(null==i?void 0:i.length)>0?i.forEach(e=>{var t;null==(t=e.promo_bookings)||t.forEach(e=>{a.set(e.id,e.promo_amount||0)})}):e&&((null==e?void 0:e.trips)&&e.trips.length>0?e.trips.forEach(e=>{var t;null==(t=e.promo_bookings)||t.forEach(e=>{a.set(e.id,e.promo_amount||0)})}):(null==e?void 0:e.promo_bookings)&&e.promo_bookings.forEach(e=>{a.set(e.id,e.promo_amount||0)})),a.size>0&&(n=n.map(e=>({id:e.id,amount:Math.max(0,e.amount-(a.get(e.id)||0))}))),null==t||t.forEach((e,t)=>{var l,a;null==(l=e.promo_bookings)||l.reduce((e,t)=>e+(t.promo_amount||0),0),null==(a=e.promo_bookings)||a.forEach(e=>{let t=n.findIndex(t=>t.id===e.id);-1!==t?n[t].amount=Math.max(0,n[t].amount-(e.promo_amount||0)):console.log(" WARNING: Trip ID ".concat(e.id," not found in allTrips!"))})}),n})(t,H),n=l.reduce((e,t)=>e+(t.amount||0),0);if(n<=0){A.setPromo({...A.promo,error:"Total cart value is already zero. No more discounts can be applied."}),Y(!1);return}let a=eC(e,n,l),i=await (0,ei.post)("payment/verify_code",a,{headers:{Authorization:"Bearer ".concat(A.token)}});if(i.data.valid){let t=i.data;if(0>=((null==(p=t.promo_bookings)?void 0:p.reduce((e,t)=>e+(t.promo_amount||0),0))||0)){A.setPromo({...A.promo,error:"Total cart value is already zero. This gift card cannot be applied."}),Y(!1);return}L(l=>[...l,{id:t.id,code:e,amount_off:t.amount_off,is_gift:!0,is_promo:t.is_promo,valid:t.valid,promo_bookings:t.promo_bookings}]),!(null==(m=A.promo)?void 0:m.applied)||(null==(v=A.promo)||null==(_=v.response)?void 0:_.is_gift)?A.setPromo({...A.promo,error:"",applied:!0,response:t,promoCode:e,show:!1,promo_details:null==t?void 0:t.promo_bookings}):A.setPromo({...A.promo,error:"",show:!1})}}else{if((null==H?void 0:H.length)>0){let e=await ew(l,H);L(e)}A.setPromo({...A.promo,error:"",applied:!0,response:l,promoCode:e,show:!1,promo_details:null==l?void 0:l.promo_bookings}),(null==l?void 0:l.trips)&&A.setPromoList(e=>[...e||[],...l.trips])}l.valid&&t&&Z(!1),Y(!1)}catch(e){Y(!1),console.error("Error applying promo/gift card:",e),A.setPromo({...A.promo,error:"Failed to apply code. Please try again."})}};return null==A||null==(d=A.promo)||null==(s=d.response)||null==(r=s.trips)||r.reduce((e,t)=>e+((null==t?void 0:t.valid)&&(null==t?void 0:t.amount_off)||0),0),(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{className:q().hrLine}),(0,n.jsxs)("div",{style:{width:"100%",padding:"0px"},children:[(0,n.jsxs)("p",{className:"mtColor",style:{margin:(null==k?void 0:k.isNarrow)?"1em 0px":"5px 0px",fontSize:18},children:[" ",(0,n.jsx)("strong",{children:eh?"Tips & Discounts":"Discounts"})]}),(0,n.jsxs)("div",{className:"".concat(q().information," mtrateCardContainer"),style:{padding:"10px 0px"},children:[eh&&(0,n.jsxs)("div",{className:k.is_MT?"".concat(k.is_MT?"".concat(g().TripDateHolder," mtTripDateHolder"):g().TripDateHolder," mtTripDateHolder"):k.is_MT?"".concat(g().TripDateHolder," mtTripDateHolder"):g().TripDateHolder,children:[(0,n.jsxs)("div",{children:[(0,n.jsx)("p",{className:"mtrateCardContainer_title",children:"Pre Tip "}),(0,n.jsx)("span",{className:g().TripDate,children:!isNaN(A.tipamount)&&A.tipamount&&0!==Number(A.tipamount)?"$".concat(A.tipamount," (").concat("Custom"===A.tipType?Number.parseFloat(100*A.tipamount/Q).toFixed(2):Math.round(100*A.tipamount/Q),"%)"):"".concat("Cash Tip on Trip"===A.tipType?"Cash Tip on Trip":"Custom"===A.tipType?"0 USD":"Add Tip Amount")})]}),(null==(u=(0,x.je)())?void 0:u.length)===1&&!["www.aquaexcursions.net","www.2854-preview.guideslytesting.com"].includes(window.location.host)&&(0,n.jsx)("div",{children:(0,n.jsx)("span",{className:g().EditText,onClick:()=>{var e;
1return Q?W(!z):null==(e=document.getElementById("tripData"))?void 0:e.scrollIntoView({behavior:"auto",block:"center",inline:"center"})},children:"Edit"})})]}),(0,n.jsx)("p",{className:eh?"".concat(g().promo):"".concat(g().promo," ").concat(g().promoMargin),onClick:()=>{Z(!K),et("")},children:"Enter a coupon"}),(null==H?void 0:H.length)>0&&(0,n.jsxs)("div",{className:k.is_MT?"".concat(g().TripDateHolder," mtTripDateHolder"):g().TripDateHolder,style:{display:"block"},children:[(0,n.jsx)("div",{children:(0,n.jsxs)("p",{children:["Gift Card",H.length>1?"s":""," Applied "]})}),H.map((e,t)=>{var l;let a=(null==e||null==(l=e.promo_bookings)?void 0:l.reduce((e,t)=>e+(t.promo_amount||0),0))||0;return(0,n.jsxs)("div",{style:{display:"flex",flexDirection:"row",width:"100%",marginBottom:"5px"},children:[(0,n.jsxs)("div",{style:{display:"flex",flexDirection:"column",width:"65%"},children:[(0,n.jsxs)("p",{className:g().PromoBtn,children:[(0,n.jsx)(X.default,{url:eo,size:18,alt:"tag",style:{padding:"0px"}}),(0,n.jsx)("span",{style:{padding:"0px 5px"},children:e.code}),(0,n.jsx)("span",{onClick:()=>eb(e.code),style:{cursor:"pointer"},children:(0,n.jsx)(X.default,{url:er.A,size:22,alt:"close",style:{padding:"0px"}})})]}),(0,n.jsx)("p",{className:g().amountOff,children:"$ ".concat(a.toFixed(2)," off")})]}),(0,n.jsx)("div",{style:{display:"flex",flexDirection:"row",width:"35%",justifyContent:"flex-end"},children:(0,n.jsx)("div",{style:{display:"flex",alignItems:"center",fontSize:"14px"},children:"-$".concat(a.toFixed(2))})})]},"gift-card-".concat(t))})]}),A.promo.applied&&!(null==(p=A.promo)||null==(c=p.response)?void 0:c.is_gift)&&(0,n.jsxs)("div",{className:k.is_MT?"".concat(g().TripDateHolder," mtTripDateHolder"):g().TripDateHolder,style:{display:"block",paddingTop:(null==H?void 0:H.length)>0?"0px":void 0},children:[(0,n.jsx)("div",{children:(0,n.jsx)("p",{children:"Coupon Applied "})}),(0,n.jsx)(n.Fragment,{children:(null==T?void 0:T.length)>1?(0,n.jsx)(n.Fragment,{children:(0,ea.My)((0,ea.H8)(null==A||null==(_=A.promoList)?void 0:_.filter(e=>null==e?void 0:e.valid))).map(e=>{var t;return(0,n.jsxs)("div",{style:{display:"flex",flexDirection:"row",width:"100%"},children:[(0,n.jsxs)("div",{style:{display:"flex",flexDirection:"column",width:"65%"},children:[(0,n.jsxs)("p",{className:g().PromoBtn,children:[" ",(0,n.jsx)(X.default,{url:eo,size:18,alt:"tag",style:{padding:"0px"}})," ",(0,n.jsx)("span",{style:{padding:"0px 5px"},children:null==(t=e.code.split("="))?void 0:t[1]})," ",(0,n.jsx)("span",{onClick:()=>{var t;return ex(null==(t=e.code.split("="))?void 0:t[1])},style:{cursor:"pointer"},children:(0,n.jsx)(X.default,{url:er.A,size:22,alt:"close",style:{padding:"0px"}})})]}),(0,n.jsx)("p",{className:g().amountOff,children:"$ ".concat(Number((null==e?void 0:e.amount_off)||0).toFixed(2)," off")})]}),(0,n.jsx)("div",{style:{display:"flex",flexDirection:"row",width:"35%",justifyContent:"flex-end"},children:(0,n.jsx)("div",{style:{display:"flex",alignItems:"center",fontSize:"14px"},children:(0,n.jsxs)(n.Fragment,{children:["-$",Number((null==e?void 0:e.amount_off)||0).toFixed(2)]})})})]})})}):(0,n.jsxs)("div",{style:{display:"flex",flexDirection:"row",width:"100%",marginBottom:"5px"},children:[(0,n.jsxs)("div",{style:{display:"flex",flexDirection:"column",width:"65%"},children:[(0,n.jsxs)("p",{className:g().PromoBtn,children:[" ",(0,n.jsx)(X.default,{url:eo,size:18,alt:"tag",style:{padding:"0px"}})," ",(0,n.jsx)("span",{style:{padding:"0px 5px"},children:A.promo.response.code})," ",(0,n.jsx)("span",{onClick:ex,style:{cursor:"pointer"},children:(0,n.jsx)(X.default,{url:er.A,size:22,alt:"close",style:{padding:"0px"}})})]}),(0,n.jsx)("p",{className:g().amountOff,children:"$ ".concat(Number((null==(v=A.promo.response)?void 0:v.is_promo)?null==(h=A.promo.response)?void 0:h.amount_off:(null==(y=A.promo.response)?void 0:y.amount_off)/100).toFixed(2)," off")})]}),(0,n.jsx)("div",{style:{display:"flex",flexDirection:"row",width:"35%",justifyContent:"flex-end"},children:(0,n.jsx)("div",{style:{display:"flex",alignItems:"center",fontSize:"14px"},children:(0,n.jsxs)(n.Fragment,{children:["-$",Number((null==(f=A.promo.response)?void 0:f.is_promo)?null==(b=A.promo.response)?void 0:b.amount_off:(null==(C=A.promo.response)?void 0:C.amount_off)/100).toFixed(2)]})})})]})})]})]})]}),(0,n.jsx)(en.A,{show:z,onHide:()=>{U({...V,tipamount:"uponCash"!==A.tipamount?Number(A.tipamount).toFixed(2):"uponCash",t
1iptype:A.tipType}),W(!1)},size:"md",style1:g().Gmodal1,header:"Pre Tip",children:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{style:{maxHeight:"310px",overflowY:"auto",paddingBottom:"15px"},children:(0,n.jsxs)("div",{className:g().fullWidth,children:[[{percentage:.18,label:"18%"},{percentage:.2,label:"20%"},{percentage:.25,label:"25%"}].map(e=>{var t;return(0,n.jsx)(e_,{percentage:e.percentage,label:e.label,isSelected:V.tipamount===(V.tipCost*e.percentage).toFixed(2),handleClick:()=>(e=>{var t,l;(null==T||null==(l=T[0])||null==(t=l.selectedHour)?void 0:t.rate)?U({tipamount:(Q*e).toFixed(2),tiptype:"Predefined",tipPercent:"".concat(100*e,"%"),tipCost:Q}):U({tipamount:"0.00",tiptype:"Predefined",tipPercent:"".concat(0,"%"),tipCost:Q})})(e.percentage),currencySymbol:el()(null==A||null==(t=A.userData)?void 0:t.currency)||"$",totalTripCost:Q},e.percentage)}),(0,n.jsxs)("div",{style:eu,id:"custom-tip-amount",children:[(0,n.jsx)("img",{src:V.tipamount!==(.18*V.tipCost).toFixed(2)&&V.tipamount!==(.2*V.tipCost).toFixed(2)&&V.tipamount!==(.25*V.tipCost).toFixed(2)&&"uponCash"!==V.tipamount&&""!==V.tipamount?es:ed,onClick:()=>S.current.focus(),style:ec,width:"17",height:"17"}),(0,n.jsxs)("div",{className:"triptypeTitle",children:["Custom Tip - ",(0,n.jsx)("input",{ref:S,className:"".concat(g().customTipValue," customTipValue"),onChange:e=>U({tipamount:e.target.value>0?Number(e.target.value):0,tiptype:"Custom"}),type:"number",placeholder:"Enter a custom amount",style:{height:"30px",marginTop:"5px"}})]})]}),(0,n.jsxs)("div",{style:eu,id:"cash-tip-upon-trip",children:[(0,n.jsx)("img",{src:"uponCash"===V.tipamount?es:ed,onClick:()=>U({tipamount:"uponCash",tiptype:"Cash Tip on Trip"}),style:ec,width:"17",height:"17"}),(0,n.jsx)("div",{onClick:()=>U({tipamount:"uponCash",tiptype:"Cash Tip on Trip"}),className:"triptypeTitle",children:"Cash Tip on Trip"})]})]})}),(0,n.jsxs)("div",{className:g().displayButtons,children:[(0,n.jsx)("p",{onClick:()=>{U({...V,tipamount:"uponCash"!==A.tipamount?Number(A.tipamount).toFixed(2):"uponCash",tiptype:A.tipType}),W(!1)},children:"Cancel"}),(0,n.jsx)("button",{onClick:()=>{A.setTipamount(V.tipamount),A.setTipType(V.tiptype),E(V.tipPercent),W(!1)},style:ep,className:(null==k?void 0:k.is_MT)?"gradientBtn bookNowBtn mtBtn":"gradientBtn bookNowBtn",children:"Save"})]})]})}),(0,n.jsx)(en.A,{show:K,onHide:()=>{var e,t,l,n;Z(!K),(null==(e=A.promo)?void 0:e.applied)&&(null==(t=A.promo)?void 0:t.response)&&!(null==(n=A.promo)||null==(l=n.response)?void 0:l.is_gift)||(null==H?void 0:H.length)?A.setPromo({...A.promo,show:!1,error:""}):A.setPromo({...A.promo,show:!1,promoCode:"",error:"",applied:!1,response:""})},size:"md",style1:g().Gmodal1,header:"Coupons",children:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("div",{style:{paddingBottom:"15px"},children:[(0,n.jsxs)(ee.A.Group,{className:"".concat(g().promoCont," "),children:[(0,n.jsx)(ee.A.Control,{type:"text",value:$,className:"".concat(g().inputField),onChange:e=>{(e=>{var t,l,n,a,i,o;let r=e.target.value,s=(null==(t=A.promo)?void 0:t.applied)&&(null==(l=A.promo)?void 0:l.response)&&!(null==(a=A.promo)||null==(n=a.response)?void 0:n.is_gift);!((null==T?void 0:T.length)>1)||(null==(o=A.promo)||null==(i=o.response)?void 0:i.is_gift)?(r.length>=1&&A.setPromo({...A.promo,show:!0,promoCode:r,error:"",applied:!!s,response:s?A.promo.response:"",promo_details:s?A.promo.promo_details:[]}),0===r.length&&A.setPromo({...A.promo,show:!1,promoCode:r,error:"",applied:!!s,response:s?A.promo.response:"",promo_details:s?A.promo.promo_details:[]})):A.setPromo({...A.promo,show:!0,promoCode:r,error:"",applied:s,response:s?A.promo.response:"",promo_details:s?A.promo.promo_details:[]})})(e),et(e.target.value)},style:{height:"40px !important"}}),(0,n.jsx)("span",{className:$?g().ftLabel1:g().ftLabel,style:{left:"10px"},children:"Add Promotion or Gift Code"})]}),""!==A.promo.error?(0,n.jsxs)("p",{className:"".concat(g().promoError),children:[A.promo.error," "]}):null]}),(0,n.jsxs)("div",{className:g().displayButtons,children:[(0,n.jsx)("p",{onClick:()=>{var e,t,l,n;Z(!K),(null==(e=A.promo)?void 0:e.applied)&&(null==(t=A.promo)?void 0:t.response)&&!(null==(n=A.promo)||null==(l=n.response)?void 0:l.is_gift)||(null==H?void 0:H.length)?A.setPromo({...A.promo,show:!1,error:""}):A.setPromo({...A.promo,show:!1,promoCode:"",error:"",applied:!1,response:""})},children:"Cancel"}),(0,n.jsx)("button",{className:"gradientBtn bookNowBtn",onClick:()=>eS($,!0),disabled:0===$||""===$||O,style:{opacity:O?.7:1,cursor:O?"not-allowed":"pointer"},children:O?"Applying...":"Apply"})]})]})})]})},e_=e=>{let{percentage:t,label:l,isSelected:a,handleClick:i,currencySymbol:o,totalTripCost:r}=e;return(0,n.jsxs)("div",{style:eu,id:"tip-".concat(100*t),children:[(0,n.jsx)("img",{src:a?es:ed,onClick:i,style:ec,width:"17",height:"17"}),(0,n.jsxs)("div",{onClick:i,className:"triptypeTitle",style:{cursor:"pointer"},children:[l," - ",o,(0,ea.BZ)((r*t).toFixed(2))]})]})};var ev=l(35527),eg=l.n(ev);C().extend(eg());let eh=e=>{var t,l,i,o,r,s;let{paytype:d,setPaytype:u,tripCal:c,selectedDay:p,isNarrow:_,cartItems:v}=e,g=(0,a.useContext)(m.A),h=(e,t)=>(0,n.jsx)("div",{className:"Payradio",children:(0,n.jsxs)("label",{children:[!!t&&t,(0,n.jsx)("input",{type:"radio",name:"mode",value:t,checked:d===e,onChange:()=>{u(e)}})]})}),{chargetoday:y,total:f}=c,x=0===y?"".concat(el()(null==g||null==(t=g.userData)?void 0:t.currency)||"$","0"):"".concat(el()(null==g||null==(l=g.userData)?void 0:l.currency)||"$").concat((0,ea.BZ)(Number(y).toFixed(2))),b=0===f?"".concat(el()(null==g||null==(i=g.userData)?void 0:i.currency)||"$","0"):"".concat(el()(null==g||null==(o=g.userData)?void 0:o.currency)||"$").concat((0,ea.BZ)(Number(f).toFixed(2))),j=0===f?"".concat(el()(null==g||null==(r=g.userData)?void 0:r.currency)||"$","0"):"".concat(el()(null==g||null==(s=g.userData)?void 0:s.currency)||"$").concat((0,ea.BZ)((Number(f)-Number(y)).toFixed(2)));return(0,n.jsxs)("div",{className:"p-0",children:[(0,n.jsx)("div",{className:q().hrLine}),(0,n.jsxs)("p",{className:"mtColor",style:{margin:_?"1em 0px":"5px 0px"},children:[" ",(0,n.jsx)("strong",{children:"Choose How to Pay"})]}),(0,n.jsx)("div",{className:"full"===d?"full PayActive":"full",children:(0,n.jsxs)("div",{className:"paynow",children:[(0,n.jsxs)("div",{className:"TripDateHolder",children:[(0,n.jsx)("p",{children:"Pay in full "}),h("full",b)]}),(0,n.jsx)("span",{children:"Pay the total now and you're all set."})]})}),(0,n.jsx)("div",{className:"partial"===d?"half PayActive":"half",children:(0,n.jsxs)("div",{className:"paynow",children:[(0,n.jsxs)("div",{className:"TripDateHolder",children:[(0,n.jsx)("p",{children:"Pay part now, part later "}),h("partial",x)]}),(0,n.jsxs)("span",{children:["Pay ",x," now, and the rest (",j,") will be automatically charged to the same payment method on ",(null==v?void 0:v.length)>1?"the day of trip":p&&C()(p).format("MMM DD, YYYY"),". "]})]})})]})},ey=e=>{let{index:t,handleChange:l,status:a,isMT:i}=e;return(0,n.jsxs)("div",{className:"d-flex",style:{marginLeft:"-5px"},children:[(0,n.jsxs)("label",{className:"d-flex justify-content-center align-items-center ".concat(i?g().mtRadio:""),children:[(0,n.jsx)("input",{type:"radio",name:"yesno".concat(t),value:"true",checked:!0===a,onChange:()=>{l(t,!0)},style:{width:"20px",height:"20px"}}),(0,n.jsx)("span",{className:g().radio_label,style:{fontSize:"14px !important"},children:"Yes"})]}),(0,n.jsxs)("label",{className:"d-flex justify-content-center align-items-center ".concat(i?g().mtRadio:""),style:{marginLeft:"1rem"},children:[(0,n.jsx)("input",{type:"radio",name:"yesno".concat(t),value:"false",checked:!1===a,onChange:()=>{l(t,!1)},style:{width:"20px",height:"20px"}}),(0,n.jsx)("span",{className:g().radio_label,style:{fontSize:"14px !important"},children:"No"})]})]})};var ef=l(30529),ex=l(99135),eb=l(39200),eC=l.n(eb);C().extend(eg()),C().extend(O());let ej=e=>{let{handleChange:t,index:l,setShowDate:a,disabled:i,mindate:o,maxdate:r,selectedValue:s,handleHover:d,monthChange:u,excludeddates:c,monthsDisplay:p}=e;return(0,n.jsx)(eC(),{inline:!0,disabled:i||!1,minDate:o,maxDate:r,selected:s,showYearDropdown:!0,onChange:e=>{t(l,C()(e).format("MM-DD-YYYY")),a(!1)},dropdownMode:"select",excludeDates:c,monthsShown:p||1})};C().extend(eg()),C().extend(O());let eN=e=>{let{handleChange:t,index:l,dates:i,isMT:o,from:r,active:s}=e,[d,u]=(0,a.useState)(!1),c=window.matchMedia("only screen and (max-width: 768px)").matches;return(0,n.jsxs)("div",{children:[(0,n.jsx)("input",{type:"text",placeholder:"MM-DD-YYYY",maxLength:10,onClick:()=>u(!0),className:"".concat(q().inputField," ").concat(g().checkoutRe
1sponse," ").concat(o?g().mtinputField:""),value:i&&C()(i,["YYYY-MM-DD","MM-DD-YYYY","MM/DD/YYYY"]).isValid()?C()(i,["YYYY-MM-DD","MM-DD-YYYY","MM/DD/YYYY"]).format("MM-DD-YYYY"):"",style:{cursor:"pointer"}}),(0,n.jsx)(en.A,{show:d,onHide:()=>{u(!d)},size:"md",style1:g().Gmodal1,children:(0,n.jsxs)("div",{children:[(0,n.jsxs)("div",{className:ex.Header,children:[(0,n.jsx)("div",{className:ex.Content,children:(0,n.jsxs)("p",{className:ex.title,children:["Pick a Date"," "]})}),(0,n.jsx)("div",{className:ex.Dates,children:(0,n.jsxs)("div",{className:"".concat(ex.Active," cursor-default"),children:[(0,n.jsx)("p",{className:ex.title1,children:"Your Selection"}),(0,n.jsxs)("p",{className:ex.choosenDate,children:[" ",i?C()(i).format("MMM Do, YYYY"):"Pick a date"]})]})})]}),(0,n.jsx)("div",{id:"reactDatePicker",className:"CalendarBlock BoxCalender checkoutCalendar checkoutCalendarYear",children:(0,n.jsx)(ej,{handleChange:t,index:l,setShowDate:u,selectedValue:i?C()(i,["YYYY-MM-DD","MM-DD-YYYY","MM/DD/YYYY"]).toDate():null,monthsDisplay:c?1:2})})]})})]})},ew=e=>{let{questions:t,qaError:l,isMT:i}=e,o=(0,a.useContext)(m.A),[r,s]=(0,a.useState)([]);(0,a.useEffect)(()=>{(null==t?void 0:t.length)>0&&JSON.stringify(t)!==JSON.stringify(r)&&(s(t),o.setCheckoutQA(t))},[t]);let d=(e,t)=>{let l=[...r];l[e].answer=t,s(l),o.setCheckoutQA(l)};return(0,n.jsxs)("div",{style:{borderRadius:5,padding:"10px 0px",marginTop:"5px"},className:"".concat(g().rateCardContainer," mtrateCardContainer ").concat(g().checkout_qa_container),id:"qadetails",xs:12,sm:12,md:12,lg:12,children:[l&&(0,B.ow)(o.checkoutQA)?(0,n.jsx)("span",{className:g().ErrorCont,children:1===t?"Please enter the mandatory field":"Please enter all the mandatory fields"}):null,null==t?void 0:t.map((e,t)=>(0,n.jsxs)("div",{className:"".concat(g().checkout_qa),children:[(0,n.jsx)("p",{className:g().question,children:e.question}),((e,t)=>{let l="text";switch(null==e?void 0:e.format){case"text":l=(0,n.jsx)("input",{className:"".concat(g().checkoutResponse," ").concat(i?g().mtinputField:""),type:"text",value:null==e?void 0:e.answer,placeholder:"Enter your details",onChange:e=>{d(t,e.target.value)}});break;case"date":l=(0,n.jsx)(eN,{handleChange:d,index:t,dates:null==e?void 0:e.answer,isMT:i});break;case"radio":l=(0,n.jsx)(ey,{handleChange:d,index:t,status:null==e?void 0:e.answer,isMT:i})}return l})(e,t)]},t))]})},eD=["card","us_bank_account","link"],ek="off_session",eS=["apple_pay","google_pay"];function eA(e){return eS.includes(e)}function eE(){let{country:e,postalCode:t}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},l={country:e||"US",postal_code:t||void 0};return l.postal_code||delete l.postal_code,{payment_method_data:{billing_details:{address:l}}}}function eT(e,t){let l="string"==typeof(null==e?void 0:e.message)?e.message.trim():"",n=(null==e?void 0:e.code)||"";return/card details/i.test(l)||"incomplete"===n||"incomplete_number"===n||"incomplete_expiry"===n||"incomplete_cvc"===n||/cancel/i.test(l)||"canceled"===n||!l?"".concat("google_pay"===t?"Google Pay":"Apple Pay"," was closed before the payment finished. Please try again."):l}function eR(){var e,t,l;let n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},a=(null==(t=n.payment_method_data)||null==(e=t.billing_details)?void 0:e.address)||{},i=eE({country:a.country,postalCode:a.postal_code});return{...n,return_url:n.return_url||"".concat(window.location.origin,"/payment-confirmation"),payment_method_data:{...n.payment_method_data,...i.payment_method_data,billing_details:{...null==(l=n.payment_method_data)?void 0:l.billing_details,...i.payment_method_data.billing_details,address:{...a,...i.payment_method_data.billing_details.address}}}}}let eM=e=>new Promise(t=>setTimeout(t,e)),eI=(e,t)=>({Authorization:"Bearer ".concat(e),"Content-Type":"application/json",...t?{"x-app-id":t}:{}}),eP=e=>{let t=null==e?void 0:e.data;if(!t||"object"!=typeof t)return t;let l=t.data;return null!=t.status||t.master_trip_reserve_guid?t:l&&"object"==typeof l&&!Array.isArray(l)&&(l.client_secret||l.master_trip_reserve_guid||l.pi_id||l.status||l.bookings)?l:t.client_secret||t.pi_id||t.bookings?t:null!=l?l:t};async function eB(e){let{chargeAmount:t,currency:l="USD"}=e,n=Number(t)||0,a=await ei.axiosReq.post("v2/payment/create_payment_intent",{charge_amount:n,currency:l,payment_method_types:eD,...n>0?{setup_future_usage:ek}:{}},{headers:{"Content-Type":"application/json"}});if(null==a?void 0:a.response)throw a;return eP(a)}async function eF(e){let{body:t,token:l,xAppId:n}=e,a=await ei.axiosReq.put("v2/payment/reserve_trips",t,{headers:eI(l,n)});if(null==a?void 0:a.response)throw a;return eP(a)}async function eq(e){let{masterTripReserveGuid:t,setupIntents:l,token:n,xAppId:a}=e,i=await ei.axiosReq.put("v2/payment/create_trips",{is_marlin_booking:!0,master_trip_reserve_guid:t,setupIntents:l},{headers:eI(n,a)});if(null==i?void 0:i.response)throw i;return eP(i)}async function eY(e,t){let{token:l,xAppId:n}=t,a=await ei.axiosReq.get("v2/payment/payment_process_status/master/".concat(e),{headers:eI(l,n)});if(null==a?void 0:a.response)throw a;return eP(a)}async function eH(e){let{token:t,xAppId:l,intervalMs:n=2e3,timeoutMs:a=9e4}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=Date.now(),o=null;for(;Date.now()-i<a;){let a=null==(o=await eY(e,{token:t,xAppId:l}))?void 0:o.status;if("Success"===a||"Failed"===a)return o;await eM(n)}let r=Error("Booking is taking longer than expected. Please check your email or contact support.");throw r.pollStatus=o,r}let eL=null,eG=(0,i.loadStripe)(s().stripeKey),eO=new Map,ez=(0,a.forwardRef)(function(e,t){let{onCompleteChange:l,enableWallets:i}=e,r=(0,o.useStripe)(),s=(0,o.useElements)(),d=(0,a.useRef)(r),u=(0,a.useRef)(s);d.current=r,u.current=s;let c=(0,a.useMemo)(()=>({layout:{type:"accordion",defaultCollapsed:!1,radios:"always",spacedAccordionItems:!1},paymentMethodOrder:i?["card","apple_pay","google_pay","link"]:["card","link"],wallets:i?{applePay:"auto",googlePay:"auto"}:{applePay:"never",googlePay:"never"},fields:i?{billingDetails:{address:{postalCode:"auto",country:"auto"}}}:{billingDetails:{address:{postalCode:"never",country:"never"}}},defaultValues:{billingDetails:{address:{country:"US"}}},terms:{card:"never"}}),[i]),p=async()=>{let e=u.current;return e?e.submit():{error:{message:"Payment form is not ready. Please try again."}}},m=async function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},l=d.current,n=u.current;if(!l||!n)return{error:{message:"Payment form is not ready. Please try again."}};let a={elements:n,redirect:"if_required",confirmParams:eR(t)};return e&&(a.clientSecret=e),l.confirmPayment(a)},_=async function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},l=d.current,n=u.current;if(!l||!n)return{error:{message:"Payment form is not ready. Please try again."}};let a={elements:n,redirect:"if_required",confirmParams:eR(t)};return e&&(a.clientSecret=e),l.confirmSetup(a)};return(0,a.useEffect)(()=>
1{if(!r||!s)return void(eL=null);return eL={confirmPayment:m,confirmSetup:_,submitElements:p},()=>{eL=null}},[r,s]),(0,a.useImperativeHandle)(t,()=>({confirmPayment:m,confirmSetup:_,submitElements:p}),[]),(0,n.jsx)("div",{style:{padding:"0 25px 10px",margin:"12px 0"},children:(0,n.jsx)(o.PaymentElement,{options:c,onChange:e=>{var t;null==l||l(!!e.complete,null==(t=e.value)?void 0:t.type)},className:g().stripeElement})})}),eW=(0,a.forwardRef)(function(e,t){var l,i,r,s,d,u;let{cartItems:c,cardErrors:p,setCardErrors:m,setCardDetails:_,cardDetails:v,is_MT:h,guideDetails:y,cancelationDay:f,res:x,isNarrow:b,qaError:j,setQaError:N,template:w,isAllECourses:D,customQuestions:k,chargeAmount:S,chargeReady:A=!0,currency:E,onPaymentIntentReady:T,onPaymentElementComplete:R,setPaymentCardDetails:M,paymentIntentKey:I}=e,[P,F]=(0,a.useState)(!1),[Y,H]=(0,a.useState)(null),[L,G]=(0,a.useState)(null),[O,z]=(0,a.useState)(null),[W,V]=(0,a.useState)(!1),[U,K]=(0,a.useState)(""),Z=(0,a.useRef)(!1),Q=(0,a.useRef)(""),J=(0,a.useRef)(null),X=(0,a.useRef)(null),$=(0,a.useRef)(null),ee=!!(h||w),et=!ee&&!eA(null==v?void 0:v.paymentMethodType);X.current=L,$.current=O,(0,a.useImperativeHandle)(t,()=>({confirmPayment:async(e,t)=>{var l;return(null==(l=J.current)?void 0:l.confirmPayment)?J.current.confirmPayment(e,t):{error:{message:"Payment form is not ready. Please try again."}}},confirmSetup:async(e,t)=>{var l;return(null==(l=J.current)?void 0:l.confirmSetup)?J.current.confirmSetup(e,t):{error:{message:"Payment form is not ready. Please try again."}}},submitElements:async()=>{var e;return(null==(e=J.current)?void 0:e.submitElements)?J.current.submitElements():{error:{message:"Payment form is not ready. Please try again."}}},getClientSecret:()=>X.current,getPiId:()=>$.current}),[]),(0,a.useEffect)(()=>{el()},[c,x]);let el=()=>{if(c&&c.length>0){let e=c.map(e=>{var t,l,n;let a=C()(e.selectedDay),i=h?f:null==(t=e.selectedRateCard)?void 0:t.allowed_cancellation_days,o=a.subtract(i,"days");return(null==(l=e.selectedRateCard)?void 0:l.is_referral)?null:{title:(null==e||null==(n=e.selectedRateCard)?void 0:n.title)||"No Title",cancellationDate:o.format("MMM Do, YYYY"),course:(null==e?void 0:e.product_type)==="course"}}).filter(Boolean),t=[...new Set(e.map(e=>null==e?void 0:e.cancellationDate))];1===t.length?H([{title:"All Items",cancellationDate:t[0]}]):H(e),F(!0)}else F(!1)};(0,a.useEffect)(()=>{let e=Number(S);if(!A||Number.isNaN(e)||e<0)return;let t="".concat(Number(e).toFixed(2),"|").concat((E||"USD").toUpperCase(),"|").concat(I||"");if(Q.current===t&&X.current)return;let l=!1;V(!0),K("");let n=setTimeout(()=>{if(l)return;if(Q.current===t&&X.current)return void V(!1);Q.current&&Q.current!==t&&(G(null),z(null),null==T||T(null));let n=eO.get(t);n||(n=eB({chargeAmount:e,currency:E||"USD"}),eO.set(t,n),n.finally(()=>{setTimeout(()=>{eO.get(t)===n&&eO.delete(t)},0)})),Z.current=!0,n.then(n=>{if(l)return;let a=null==n?void 0:n.client_secret,i=null==n?void 0:n.pi_id;if(!a||!i)throw Error("Unable to initialize payment form.");Q.current=t,G(a),z(i),null==T||T({pi_id:i,client_secret:a,is_setup_intent:!!(null==n?void 0:n.is_setup_intent)||0===e})}).catch(e=>{var t,n,a,i,o,r;l||(K((null==e||null==(i=e.response)||null==(a=i.data)||null==(n=a.err)||null==(t=n[0])?void 0:t.message)||(null==e||null==(r=e.response)||null==(o=r.data)?void 0:o.message)||(null==e?void 0:e.message)||"Unable to load payment form."),G(null),z(null),Q.current="",null==T||T(null))}).finally(()=>{Z.current=!1,l||V(!1)})},350);return()=>{l=!0,clearTimeout(n)}},[S,A,E,I,T]);let en=(0,a.useMemo)(()=>L?{clientSecret:L,appearance:{theme:"stripe",variables:{colorPrimary:"#0666fe",borderRadius:"4px"}}}:null,[L]);return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{className:q().hrLine}),(0,n.jsxs)("div",{style:{marginBottom:15,padding:"0px"},xs:12,id:"paymentdetails",children:[(0,n.jsx)("p",{style:{margin:b?"1em 0px":"5px 0px",fontWeight:"bolder",fontSize:18},className:"mtColor",children:"Card Details"}),(0,n.jsxs)("div",{className:"".concat(g().rateCardContainer," mtrateCardContainer ").concat(h?"ccdetail
1s":""),style:{borderRadius:5},children:[(!A||W)&&!L&&(0,n.jsx)("p",{style:{padding:"16px 25px",color:"#837d7c"},children:"Loading payment formâ¦"}),U&&(0,n.jsx)("p",{className:"cardErrors",style:{padding:"8px 25px"},children:U}),en&&(0,n.jsx)(o.Elements,{stripe:eG,options:en,children:(0,n.jsx)(ez,{ref:J,enableWallets:ee,onCompleteChange:(e,t)=>{null==R||R(e),_(l=>({...l,paymentElementComplete:e,paymentMethodType:t||l.paymentMethodType})),eA(t)&&m(e=>({...e,zipCode:""}))}})},L),et&&(0,n.jsxs)("div",{style:{padding:"0 25px",margin:"12px 0",borderRadius:5},children:[(0,n.jsx)("span",{className:"cardDetail",children:"Billing Zip Code"}),(0,n.jsx)("form",{className:q().zipCode,error:!!(null==p?void 0:p.zipCode),children:(0,n.jsx)("input",{value:v.zipCode,placeholder:"12345",onChange:e=>{_(t=>({...t,zipCode:e.target.value})),m(t=>({...t,zipCode:e.target.value?"":"Please enter zip code"}))},className:g().placeholder,style:{height:"30px",padding:0,fontSize:"16px",color:"#aab7c4"},inputMode:"numeric",pattern:"[0-9]*",id:"zipcode",name:"zipcode",autoComplete:"zipcode"})}),(null==p?void 0:p.zipCode)&&(0,n.jsx)("p",{className:"cardErrors",children:null==p?void 0:p.zipCode})]})]})]}),(null==y||null==(i=y.page_attributes)||null==(l=i.checkout_qa)?void 0:l.length)>0&&((null==y||null==(r=y.page_attributes)?void 0:r.is_mt)||w)&&!D||(null==k?void 0:k.length)>0?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{className:(null==y||null==(s=y.page_attributes)?void 0:s.is_mt)?"".concat(g().QATitle," "):"",style:{marginTop:"5px"},children:(0,n.jsx)("h3",{children:"Additional Details"})}),(0,n.jsx)(ew,{questions:[...(null==y||null==(d=y.page_attributes)?void 0:d.checkout_qa)||[],...k||[]],qaError:j,setQaError:N,isMT:null==y||null==(u=y.page_attributes)?void 0:u.is_mt})]}):null,B.Ij.includes(null==y?void 0:y.guideid)||D?null:(0,n.jsx)(n.Fragment,{children:P&&(0,n.jsx)("div",{style:{borderRadius:5,padding:"10px 0px",marginTop:"15px"},className:"".concat(g().rateCardContainer," mtrateCardContainer ").concat(g().cancellation_policy_box),xs:12,sm:12,md:12,lg:12,children:(0,n.jsxs)("div",{style:{padding:"0 ",margin:"12px 0"},children:[(0,n.jsx)("div",{className:q().Cancellation,style:{marginTop:"5px",padding:"0px 25px"},children:(0,n.jsx)("h3",{children:"Cancellation Policy"})}),null==Y?void 0:Y.filter(e=>!e.course).map((e,t)=>{var l;let i=t===(null==Y?void 0:Y.filter(e=>!e.course).length)-1;return(0,n.jsxs)(a.Fragment,{children:[(0,n.jsxs)("p",{className:"".concat(q().CancellationDescription," cancellation_policy "),style:{padding:"0px 25px"},children:[(0,n.jsxs)("b",{children:[(null==e?void 0:e.title)!="All Items"&&(0,n.jsx)("span",{style:{display:"block"},children:null==e?void 0:e.title}),"Free cancellation before ",null==e?void 0:e.cancellationDate,"."," "]})," ",(null==x?void 0:x.cancellation_text)?null==x||null==(l=x.cancellation_text)?void 0:l.normalize("NFKD"):"Cancel before this guideâs cancellation window to get a full refund."]}),!i&&(0,n.jsx)("div",{style:{borderBottom:h?"2px solid #c7cbce":"1px solid #c7cbce",margin:"0.5rem 0px"}})]},"".concat(null==e?void 0:e.title,"-").concat(null==e?void 0:e.cancellationDate,"-").concat(t))})]})})})]})}),eV=e=>{var t,l,i;let{guideDetails:o}=e;null==o||null==(t=o.page_attributes)||t.is_mt;let{fname:r,lname:s,mtemail:d,phone:u,cartItems:c,contactInfo:p,setContactInfo:_,contactSubmitted:v}=(0,a.useContext)(m.A),[h,y]=(0,a.useState)({isValidEmail:!1,inValidPhone:!1}),[f,x]=(0,a.useState)({name:!1,email:!1,phone:!1}),b=(0,a.useCallback)(()=>{let e="".concat((null==r?void 0:r[0])||""," ").concat((null==s?void 0:s[0])||"").trim();return{name:e,email:(null==d?void 0:d[0])||"",phone:(null==u?void 0:u[0])||""}},[r,s,d,u]),C=(0,a.useCallback)(()=>{let e=!p.usePrimaryGuest;if(e){let t=b();_({name:t.name,email:t.email,phone:t.phone,usePrimaryGuest:e}),x({name:!1,email:!1,phone:!1}),y({isValidEmail:!1,inValidPhone:!1})}else _({name:"",email:"",phone:"",usePrimaryGuest:!1}),x({name:!1,email:!1,phone:!1}),y({isValidEmail:!1,inValidPhone:!1})},[p,b,_]);(0,a.useEffect)(()=>{if(p.usePrimaryGuest){let e=b();
1(p.name!==e.name||p.email!==e.email||p.phone!==e.phone)&&_({name:e.name,email:e.email,phone:e.phone,usePrimaryGuest:!0})}},[p.usePrimaryGuest,p.name,p.email,p.phone,b,_]);let j=(0,a.useCallback)(e=>{let t=e.target.value.replace(/[0-9!@#$%^&*()_+{}\[\]:;<>,.?~\\/-/'"|]/g,"");_({...p,name:t,usePrimaryGuest:!1}),x(e=>({...e,name:!t.trim()}))},[p,_]),N=(0,a.useCallback)(e=>{let t=/^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\.[a-zA-Z]{2,5}$/.test(e);return y(l=>({...l,isValidEmail:!!e&&!t})),x(e=>({...e,email:!t})),t},[]),w=(0,a.useCallback)(e=>{let t=e.target.value;_({...p,email:t,usePrimaryGuest:!1}),N(t)},[p,_,N]),D=(0,a.useCallback)(e=>{let t=e&&(0,Y.isValidPhoneNumber)(e);return y(l=>({...l,inValidPhone:!!e&&!t})),x(e=>({...e,phone:!t})),t},[]),k=(0,a.useCallback)(e=>{_({...p,phone:e,usePrimaryGuest:!1}),e&&D(e)},[p,_,D]);return(0,n.jsx)(n.Fragment,{children:(0,n.jsxs)("div",{id:"contactInfo",className:"".concat(g().contactInfo," ").concat(g().rateCardConptainer," ").concat(g().boxShadow," mtrateCardContainer"),children:[(0,n.jsxs)("h4",{className:g().title,children:["Billing Information ",(0,n.jsx)("span",{children:"(For this booking)"})]}),(0,n.jsxs)("div",{className:"infoClass1",style:{padding:0},children:[(0,n.jsxs)("div",{className:q().inputWrapper,children:[(0,n.jsxs)("span",{className:q().inputLabel,children:["Contact Name ",(0,n.jsx)("span",{className:q().asterisk,children:"*"})]}),(0,n.jsx)("input",{type:"text",onChange:j,value:p.name,minLength:"3",maxLength:"50",id:"contact-name",autoComplete:"name",className:"".concat(q().inputField," mtinputField"),placeholder:"Enter Contact Name"}),(f.name||v&&!(null==(l=p.name)?void 0:l.trim()))&&(0,n.jsx)("span",{className:q().ErrorCont,children:"Contact Name is required*"})]}),(0,n.jsxs)("div",{className:"".concat(q().inputWrapper),children:[(0,n.jsxs)("span",{className:q().inputLabel,children:["Email ",(0,n.jsx)("span",{className:q().asterisk,children:"*"})]}),(0,n.jsx)("input",{type:"email",onChange:w,value:p.email,id:"contact-email",className:"".concat(q().inputField," mtinputField"),autoComplete:"email",placeholder:"Enter Email Address"}),(f.email||v&&!(null==(i=p.email)?void 0:i.trim()))&&(0,n.jsx)("span",{className:q().ErrorCont,children:"Email is required* "}),h.isValidEmail&&(0,n.jsx)("span",{className:q().ErrorCont,children:"Please provide a valid Email*"})]}),(0,n.jsxs)("div",{className:"".concat(q().phone," ").concat(q().inputWrapper),children:[(0,n.jsx)("div",{className:"labelHolder",children:(0,n.jsxs)("span",{className:q().inputLabel,children:["Phone ",(0,n.jsx)("span",{className:q().asterisk,children:"*"})]})}),(0,n.jsx)("form",{className:"".concat(g().form," ").concat(q().inputBox," mb-0"),children:(0,n.jsx)(Y.Ay,{country:"US",placeholder:"(000) 000-0000",defaultCountry:"US",countryCallingCodeEditable:!1,initialValueFormat:"national",value:p.phone,onChange:k,minLength:8,maxLength:15,isInvalid:h.inValidPhone,className:"".concat(g().Phone_Input," Phone_Input mtinputField")})}),(0,n.jsxs)("form",{className:" errorLabels mtinputField",id:"contact-phone-form",children:[(f.phone||v&&!p.phone)&&(0,n.jsx)("span",{className:"error_message",children:"Phone is required* "}),h.inValidPhone&&(0,n.jsx)("span",{className:"error_message",children:"Please provide a valid Phone number*"})]})]}),(0,n.jsxs)("div",{className:q().checkBoxContainer,children:[(0,n.jsx)("img",{src:p.usePrimaryGuest?"https://guidesly-assets.s3.us-east-2.amazonaws.com/web/static/images/orangechecked.svg":"https://guidesly-assets.s3.us-east-2.amazonaws.com/web/static/images/uncheck.svg",onClick:C,className:q().checkBoxImage,width:"20",height:"20",alt:"Use Primary Guest as Contact"}),(0,n.jsxs)("div",{className:"mtSelection",children:[(0,n.jsx)("p",{className:q().checkBoxTitle,children:"Use Primary Guest as Contact"}),(0,n.jsx)("span",{className:q().checkBoxDescription,children:"Auto-fill contact details from Guest 1 of Trip 1."})]})]})]})]})})};l(64625);var eU=l(37130),eK=l(80796);let eZ={src:"/_next/static/media/arrowRightCircle.8c6fdb66.svg",height:23,width:23,blurWidth:0,blurHeight:0},eQ={src:"/_next/static/media/arrowLeftCircle.dc04a16d.svg",height:23,width:23,blurWidth:0,blurHeight:0};var eJ=l(15130),eX=l(41116),e$=l.n(eX);let e0=e=>{let{show:t,size:l,onHide:a,header:i,children:o,style1:r,isNarrow:s,desktopwidth:d}=e;return(0,n.jsx)(e$(),{isOpen:!!t,onRequestClose:a,style:{content:{top:"50%",left:"50%",right:"auto",bottom:"auto",marginRight:"-50%",transform:"translate(-50%, -50%)",width:s?"95%":d||"36rem",borderRadius:"10px",padding:"0px",zIndex:9999},overlay:{zIndex:2e3}},children:o})};C().extend(eg()),C().extend(O());let e1=e=>{var t;let{handleDayClick:l,modifiers:i,setCalendarShow:o,setShow:r,is_MT:s,handleClear:d,endDate:u,selectedDay:c,selectedRateCard:p,setLocalData:m,currentItem:_,handleHide:v,setRes:g,res:h,localData:y}=e,f=window.matchMedia("only screen and (max-width: 768px)").matches,[x,b]=(0,a.useState)({from:!c&&i.availability.length>0?i.availability[0]:c,active:"start"});(0,a.useEffect)(()=>{b({from:!c&&i.availability.length>0?i.availability[0]:c,active:"start"})},[c]),new Date(new Date().setFullYear(new Date().getFullYear()+2)).setHours(0,0,0,0),new Date().setHours(0,0,0,0),x.from,new Date(new Date().setFullYear(new Date().getFullYear()-1)).setHours(0,0,0,0);let{active:j,from:N}=x;return(0,n.jsxs)("div",{children:[(0,n.jsx)(X.default,{url:er.A,class_name:ex.CloseIcon,handleClick:()=>void(r(!1),v()),size:20,alt:"icon_close",style:{cursor:"pointer"}}),(0,n.jsxs)("div",{className:ex.Header,children:[(0,n.jsxs)("div",{className:ex.Content,children:[(0,n.jsxs)("p",{className:ex.title,children:[(null==p?void 0:p.title)?p.title:"All Trips Offered"," "]}),(0,n.jsx)("p",{className:ex.subtitle,children:N?C()(N).format("MMM Do, YYYY"):"Choose a date"})]}),(0,n.jsx)("div",{className:ex.Dates,children:(0,n.jsxs)("div",{className:"start"===j?ex.Active:ex.Disable,onClick:()=>b({...x,active:"start"}),children:[(0,n.jsx)("p",{className:ex.title1,children:"Your Trip Date"}),(0,n.jsxs)("p",{className:ex.choosenDate,children:[" ",N?C()(N).format("MMM Do, YYYY"):"Pick a date"]})]})})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)("div",{id:"reactDatePicker",className:f?" CalendarBlock checkoutCalendar BoxCalender ":" CalendarBlock Twomonth BoxCalender checkoutCalendar",children:(0,n.jsx)(ef.default,{mindate:null==i||null==(t=i.availability)?void 0:t[0],maxdate:null!=u?u:"",selectedValue:x.from?C()(x.from).toDate():null,handleChange:e=>{(e=>{var t;b({...x,from:e}),null===e&&(o&&o(!1),r(!1));let l=JSON.parse(JSON.stringify(y)).map(t=>{var l,n,a,i,o;return(null==(l=t.selectedHour)?void 0:l.id)===(null==_||null==(n=_.selectedHour)?void 0:n.id)&&t.selectedDay===(null==_?void 0:_.selectedDay)?{...t,selectedDay:C()(e).format("YYYY-MM-DD"),selectedHour:null==(i=(0,eJ.xy)(null==h||null==(o=h.data)?void 0:o.schedule,C()(e).format("YYYY-MM-DD")))||null==(a=i.available_rates)?void 0:a.find(e=>{var t;return(null==e?void 0:e.id)===(null==_||null==(t=_.selectedHour)?void 0:t.id)})}:t});m(l);let n=(0,eJ.YG)(null==h||null==(t=h.data)?void 0:t.schedule,l);g(e=>({...e,data:{...e.data,schedule:n}}))})(e)},excludeddates:i.scheduleDisable,monthsDisplay:f?1:2})}),(0,n.jsx)("div",{children:(0,n.jsx)("div",{className:ex.displayButtons,style:{border:"none",justifyContent:"center",paddingBottom:"10px"},children:(0,n.jsx)("button",{className:s?"gradientBtn bookNowBtn mtBtn customSave":"gradientBtn bookNowBtn customSave",onClick:()=>{(null==x?void 0:x.from)&&l(C()(x.from).toDate(),i),null===x.from&&(o&&o(!1),x&&(null==x?void 0:x.from)!==""||d()),r&&(r(!1),x&&(null==x?void 0:x.from)!==""||d())},children:"Save"})})})]})]})},e2="https://guidesly-assets.s3.us-east-2.amazonaws.com/web/static/images/orangechecked.svg",e5="https://guidesly-assets.s3.us-east-2.amazonaws.com/web/static/images/uncheck.svg",e3=e=>{var t,l,i,o,r,s,d,u,c,p,v,f,x,b,N,w,D,k,S,A,E,T,R,M,I,P;let{guideDetails:F,openBookingEditHub:Y,closeBookingEditHub:H,finishBookingEditHub:L,bookingEditHubIndex:G,hubExpandedSection:O,setHubExpandedSection:z,localData:W,setLocalData:V,currentRateCardIndex:U,setCurrentRateCardIndex:K}=e,Z=(null==F||null==(t=F.page_attributes)?void 0:t.is_mt)===!0,Q=(0,a.useContext)(m.A),J=(0,a.useContext)(_.A),{cartItems:$,setCartItems:ee,res:et,setModifiers:ea,modifiers:ei,needEquipments:eo,setNeedEquipments:er,loadingMask:es,setLoa
1dingMask:ed,setRes:eu}=(0,a.useContext)(m.A),[ec,ep]=(0,a.useState)(!1),[em,e_]=(0,a.useState)(!1),[ev,eg]=(0,a.useState)(!1),[eh,ey]=(0,a.useState)(!1),[ef,ex]=(0,a.useState)([]),[eb,eC]=(0,a.useState)([]),[ej,eN]=(0,a.useState)(null),[ew,eD]=(0,a.useState)(!1),ek=(null==F||null==(l=F.page_attributes)?void 0:l.template)!="Classic",{postCart:eS}=(0,y.A)(F),eA=(0,a.useCallback)(()=>{let e=W||[],t=Math.max(0,Math.min(U,e.length-1));return e[t]||{}},[W,U]),eE=(0,a.useMemo)(()=>eA(),[eA]),eT=(0,a.useMemo)(()=>$.filter(e=>"course"!==e.product_type),[$]);(0,a.useEffect)(()=>{if(V&&(null==eT?void 0:eT.length)>0&&(V(eT),eT[0]&&null==ej)){var t,l,n;let{selectedRateCard:a,selectedHour:i,selectedDay:o}=eT[0],r=null==(l=e.guideDetails)||null==(t=l.page_attributes)?void 0:t.is_mt,s=(0,eJ.Kt)(null==J||null==(n=J.schrecords)?void 0:n.schedule,i,o,r),d=(r?null==i?void 0:i.is_shared_trip:null==a?void 0:a.is_shared_trip)?s:(null==a?void 0:a.maximum)||1;eN(eI(d,i,o)||d||(null==a?void 0:a.maximum)||1)}},[eT,G,V,ej,e.guideDetails,null==J||null==(i=J.schrecords)?void 0:i.schedule]),(0,a.useEffect)(()=>{null!=G&&(null==eT?void 0:eT.length)>0&&(null==W?void 0:W.length)>0&&(W[G]&&eP(null,"Date",G),H&&H())},[G,W]);let eR=(e,t,l)=>{let n,a=(W||eT||[]).length-1;K(n="prev"===t?U>0?U-1:a:U<a?U+1:0),eP(e,l,n)},eM=()=>{var e,t,l,n;let a=(null==(t=W[U])||null==(e=t.guest_groups)?void 0:e.length)===0?[{label:"Guest",seat_count:(null==eE||null==(l=eE.guestCount)?void 0:l.adult)||1}]:null==(n=W[U])?void 0:n.guest_groups;return(null==a?void 0:a.reduce((e,t)=>e+t.seat_count,0))||0},eI=(e,t,l)=>{var n,a,i,o,r,s,d;if(!t||null==t||!t.link_rates||!((null==t||null==(n=t.link_rates)?void 0:n.length)>0))return e;{let n=(null==J||null==(a=J.schrecords)?void 0:a.schedule)&&(null==J||null==(o=J.schrecords)||null==(i=o.schedule)?void 0:i.find(e=>C()(e.date).format("YYYY-MM-DD")===C()(l).format("YYYY-MM-DD"))),u=(null==n||null==(r=n.available_rates.find(e=>e.id===(null==t?void 0:t.id)))?void 0:r.maximum)||e,c=t.link_rates.reduce((e,l)=>{var a,i;let o=null==n||null==(i=n.available_rates.find(e=>e.id===(null==t?void 0:t.id)))||null==(a=i.link_rates)?void 0:a.find(e=>e.id===(null==l?void 0:l.id));return e+((null==o?void 0:o.seats)-(null==o?void 0:o.booked_seats)||0)},0);return(null==t||null==(d=t.link_rates)||null==(s=d[0])?void 0:s.link_rates_max_seats)||c+u}},eP=(0,a.useCallback)((t,l,n)=>{var a,i,o,r,s,d,u,c,p;let m=W[n];if(!m)return;let{selectedRateCard:_,selectedHour:v,selectedDay:g}=m;switch(l){case"Guests":case"Divers":{let t=null==(i=e.guideDetails)||null==(a=i.page_attributes)?void 0:a.is_mt,l=(0,eJ.Kt)(null==J||null==(o=J.schrecords)?void 0:o.schedule,v,g,t);if(eN(eI((t?null==v?void 0:v.is_shared_trip:null==_?void 0:_.is_shared_trip)?l:(null==_?void 0:_.id)?_.maximum:Math.max(...rateCards.map(e=>e.maximum||0)),v,g)),(!m.guest_groups||0===m.guest_groups.length||m.guest_groups.length!==(null==_||null==(r=_.guest_age_groups)?void 0:r.length))&&(null==_||null==(s=_.guest_age_groups)?void 0:s.length)>0){let e=_.guest_age_groups.map((e,t)=>({label:e.label,seat_count:0===t?m.totalGuests||1:0}));V(t=>t.map((t,l)=>l===n?{...t,guest_groups:e}:t))}ep(!0);break}case"Meeting Location":eC((null==F||null==(d=F.poi)?void 0:d.filter(e=>{var t;return null==_||null==(t=_.poi_guids)?void 0:t.includes(null==e?void 0:e.poiguid)}))||[]),e_(!0);break;case"Date":{t&&(["Next Month","Previous Month"].includes(t.target.getAttribute("aria-label")||"")||eD(!ew));let{availability:e,scheduleDisable:l}=(0,eJ.lt)({availableSchedules:null==et||null==(u=et.data)?void 0:u.schedule,hourCard:v});ea(t=>({...t,availability:e,scheduleDisable:l})),eg(!0);break}case"Start Time & Length":{let e=null==et||null==(c=et.data)?void 0:c.schedule.find(e=>e.date===C()(null==m?void 0:m.selectedDay).format("YYYY-MM-DD")),t=(0,eJ.ve)(JSON.parse(JSON.stringify([{...null==m?void 0:m.selectedRateCard}])),e),l=(null==t||null==(p=t[0])?void 0:p.rates.filter(e=>!(null==e?void 0:e.disabled))).filter(e=>e.id!==v.id);ex([{...v},...l]),ey(!0)}}},[eT,null==et||null==(o=et.data)?void 0:o.schedule,null==F?void 0:F.poi,U]),eB=(t,l)=>{var a;return(0,n.jsx)(n.Fragment,{children:(0,n.jsxs)("div",{className:"".concat(g().TripDateHolder," mtTripDateHolder"),style:{alignItems:"center"},children:[(0,n.jsxs)("div",{children:[(0,n.jsxs)("p",{children:["Guests"===t?(0,B.D5)(e.flag,null==F||null==(a=F.page_attributes)?void 0:a.guest_verbiage):t," "]}),null==eT?void 0:eT.map((e,a)=>{var i,o;return"Meeting Location"===t&&(null==e||null==(i=e.selectedRateCard)?void 0:i.is_classes)&&
1(null==e||null==(o=e.selectedRateCard)?void 0:o.class_type)==="Digital"?null:(0,n.jsx)("span",{className:g().TripDate,style:{display:"block",lineHeight:"20px",fontSize:"13px"},children:l(e)},"cartItem-".concat(a))})]}),(0,n.jsx)("div",{style:{margin:"0px 0px 0px 15px"},onClick:e=>{es||(K(0),eP(e,t,0))},children:(0,n.jsx)("span",{className:"".concat(g().EditText," ").concat(Z?"mt-blue-text":""),style:es?{cursor:"default"}:{},children:"Edit"})})]})})},eF=(e,t)=>{var l;let n="increment"===e,a=(0===W[U].guest_groups.length?[{label:"Guest",seat_count:(null==eE||null==(l=eE.guestCount)?void 0:l.adult)||1}]:W[U].guest_groups).map((e,l)=>l===t?{...e,seat_count:e.seat_count+(n?1:-1)}:e),i=a.reduce((e,t)=>e+t.seat_count,0);V(e=>e.map((e,t)=>t===U?{...e,guest_groups:a,totalGuests:i,guestCount:{adult:i||1,child:e.guestCount.child}}:e))},eq=(e,t,l)=>{var a,i,o,r;let s=(null==(i=W[U])||null==(a=i.guest_groups)?void 0:a.length)===0?[{label:"Guest",seat_count:(null==eE||null==(o=eE.guestCount)?void 0:o.adult)||1}]:null==(r=W[U])?void 0:r.guest_groups,d=null==s?void 0:s[l],u=(null==d?void 0:d.seat_count)||0,c=(null==s?void 0:s.reduce((e,t)=>e+(t.seat_count||0),0))||0,p=0===u||1===s.length&&1===c&&1===u;return(0,n.jsxs)("div",{className:g().guests__container,style:{padding:"10px 0px",borderBottom:"none"},children:[(0,n.jsxs)("div",{className:g().guests__text,children:[(0,n.jsx)("div",{style:{fontSize:"14px",fontWeight:"normal",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e}),(0,n.jsx)("div",{style:{fontSize:"12px",fontWeight:"normal",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:t})]}),(0,n.jsxs)("div",{className:g().guests__button,children:[(0,n.jsx)("button",{type:"button",id:"group-size-decrement",className:g().guests__button__icon,disabled:p,style:p?{opacity:"0.5"}:null,onClick:()=>eF("decrement",l),children:(0,n.jsx)(X.default,{url:eK.A,size:12,alt:"minus",style:{padding:"0px"}})}),(0,n.jsx)("span",{className:g().form__guest__count,style:{fontSize:"14px"},children:u}),(0,n.jsx)("button",{type:"button",id:"group-size-increment",disabled:ej<=c,style:ej<=c?{opacity:"0.5"}:null,className:g().guests__button__icon,onClick:()=>eF("increment",l),children:(0,n.jsx)(X.default,{url:eU.A,size:12,alt:"plus",style:{padding:"0px"}})})]})]},e)},eY=()=>{var e;K(0),V(eT);let t=(0,eJ.YG)(null==et||null==(e=et.data)?void 0:e.schedule,eT);eu(e=>({...e,data:{...e.data,schedule:t}}))},eH=e=>{var t;let l=W||eT||[],a=Math.max(0,Math.min(U,l.length-1)),i=l[a]||{},o=(null==i||null==(t=i.selectedRateCard)?void 0:t.title)||"Trip ".concat(a+1);return l.length>1?(0,n.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",marginBottom:"10px"},children:[(0,n.jsx)("button",{type:"button",onClick:()=>{eR(null,"prev",e)},style:{background:"none",border:"none",cursor:"pointer",padding:"5px",display:"flex",alignItems:"center"},children:(0,n.jsx)(X.default,{url:eQ,size:23,alt:"Previous Trip"})}),(0,n.jsx)("span",{className:g().TripDate,style:{display:"block",lineHeight:"20px",width:"70%",textAlign:"center"},children:o},"cartItem-".concat(a,"-").concat(o)),(0,n.jsx)("button",{type:"button",onClick:()=>{eR(null,"next",e)},style:{background:"none",border:"none",cursor:"pointer",padding:"5px",display:"flex",alignItems:"center"},children:(0,n.jsx)(X.default,{url:eZ,size:23,alt:"Next Trip"})})]}):null},eL=e=>{V(t=>t.map((t,l)=>l===U?{...t,meeting_spot:e.poiguid}:t))},eG=()=>{null==Q||Q.setPromo(e=>({...e,applied:!1,response:"",show:!1,promoCode:""}))},eO=e=>{var t;let l=JSON.parse(JSON.stringify(W)).map((t,l)=>l===U?{...t,selectedHour:e}:t);V(l),(0,eJ.jc)(null==et||null==(t=et.data)?void 0:t.schedule,l),eG()},ez=async function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};e.setHours(0,0,0,0),t.availability&&(await eW(eT,W,U),ee(W),eG())},eW=async(e,t,l)=>{var n,a,i,o,r,s,d;let u=e[l],c=t[l];await eS({cart_items:{new:[{ratecard_id:null==(n=c.selectedRateCard)?void 0:n.id,ratecard_rate_id:null==(a=c.selectedHour)?void 0:a.id,trip_date:c.selectedDay,is_group:(null==F||null==(i=F.page_attributes)?void 0:i.is_mt)||!1,guid:(null==F||null==(o=F.page_attributes)?void 0:o.is_mt)?null==F||null==(r=F.group_details)?void 0:r.group_guid:null==F?void 0:F.guideguid}],old:[{ratecard_id:null==(s=u.selectedRateCard)?void 0:s.id,ratecard_rate_id:null==(d=u.selectedHour)?void 0:d.id,trip_date:u.selectedDay}]}},"update")};return(0,n.jsxs)("div",{style:(null==F?void 0:F.is_mt)?{borderRadius:5}:{borderRadius:5,padding:"15px 0px"},className:"".concat(g().rateCardContainer," ").concat(q().CustomIn," mtrateCardContainer"),children:[(null==eT?void 0:eT.length)>0&&eB("Date",e=>{var t;return"".concat(null==e||null==(t=e.selectedRateCard)?void 0:t.t
1itle," | ").concat(C()(null==e?void 0:e.selectedDay).format("MMMM D, YYYY"))}),(null==eT?void 0:eT.length)>0&&eB("".concat((0,B.D5)(e.flag,null==F||null==(r=F.page_attributes)?void 0:r.guest_verbiage),"s"),t=>{var l,n,a;return"".concat(null==t||null==(l=t.selectedRateCard)?void 0:l.title," | ").concat((null==t?void 0:t.totalGuests)>1?"".concat(t.totalGuests," ").concat((0,B.D5)(e.flag,null==F||null==(n=F.page_attributes)?void 0:n.guest_verbiage),"s"):"".concat(t.totalGuests," ").concat((0,B.D5)(e.flag,null==F||null==(a=F.page_attributes)?void 0:a.guest_verbiage)))}),(null==eT?void 0:eT.length)>0&&eB("Start Time & Length",e=>{var t,l,n,a;return"".concat(null==e||null==(t=e.selectedRateCard)?void 0:t.title," | ").concat((0,j.Ay)(null==e||null==(l=e.selectedHour)?void 0:l.start_time)," (").concat((0,j.Ds)(null==e?void 0:e.selectedHour)," trip) - ").concat(el()(null==Q||null==(n=Q.userData)?void 0:n.currency)||"$").concat((0,B.BZ)(null==e||null==(a=e.selectedHour)?void 0:a.rate))}),(null==eT?void 0:eT.length)>0&&(null==F||null==(s=F.poi)?void 0:s.length)>0&&!(1===eT.length&&eT.some(e=>{var t,l;return(null==e||null==(t=e.selectedRateCard)?void 0:t.is_classes)&&(null==e||null==(l=e.selectedRateCard)?void 0:l.class_type)==="Digital"}))&&eB("Meeting Location",e=>{var t;return"".concat(null==e||null==(t=e.selectedRateCard)?void 0:t.title," | ").concat((e=>{var t;let l=null==F||null==(t=F.poi)?void 0:t.find(t=>t.poiguid===e);return null==l?void 0:l.description})(null==e?void 0:e.meeting_spot))}
1),ek&&((null==F||null==(d=F.page_attributes)?void 0:d.guestEquipment)===!0||(null==F||null==(u=F.page_attributes)?void 0:u.guestEquipment)===void 0)?(0,n.jsxs)("div",{style:{display:"flex",padding:"5px 25px",marginTop:5,marginBottom:5},children:[(0,n.jsx)("img",{src:eo?e2:e5,onClick:()=>{er(!eo)},style:{margin:0,padding:0,borderRadius:0,marginRight:10,height:20,width:20,border:"1px solid grey"},width:"20",height:"20"}),(0,n.jsx)("span",{className:"mtSelection",children:(null==eT?void 0:eT.length)>1?(0,n.jsx)(n.Fragment,{children:(0,n.jsxs)("span",{className:"mtSelection",children:[" ","Need guide equipment (free)"]})}):(0,n.jsx)(n.Fragment,{children:(null==F||null==(c=F.page_attributes)?void 0:c.custom_equipment_name)?null==F||null==(p=F.page_attributes)?void 0:p.custom_equipment_name:(0,n.jsx)("span",{className:"mtSelection",children:(null==eT||null==(f=eT[0])||null==(v=f.selectedRateCard)?void 0:v.activity_type.includes("snow_sports"))||(null==eT||null==(b=eT[0])||null==(x=b.selectedRateCard)?void 0:x.activity_type.includes("water_sports"))?"Need ".concat((null==eT||null==(w=eT[0])||null==(N=w.selectedRateCard)?void 0:N.ratetype).toLowerCase()," equipment (free)"):"Need ".concat(null==(D=(0,h.Nz)(null==eT||null==(S=eT[0])||null==(k=S.selectedRateCard)?void 0:k.activity_type))?void 0:D.toLowerCase()," equipment (free)")})})})]}):null,(0,n.jsx)(e0,{show:ev,onHide:()=>void(eg(!ev),eY()),size:"xl",desktopwidth:"45rem",header:"Message",style1:g().dynamicModal,isNarrow:null==e?void 0:e.isNarrow,children:(0,n.jsxs)("div",{style:{padding:"5%"},className:q().datemodal,children:[(0,n.jsx)(e1,{endDate:C()(new Date(new Date().setFullYear(new Date().getFullYear()+2))).format("YYYY-MM-DD"),selectedDay:null==W||null==(A=W[U])?void 0:A.selectedDay,selectedRateCard:null==W||null==(E=W[U])?void 0:E.selectedRateCard,handleDayClick:ez,modifiers:ei,setCalendarShow:eD,show:ev,setShow:eg,setLocalData:V,currentItem:eE,handleHide:eY,setRes:eu,res:et,localData:W}),(null==eT?void 0:eT.length)>1&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("hr",{}),eH("Date")]})]})}),(0,n.jsx)(en.A,{show:ec,onHide:()=>{eY(),ep(!ec)},size:"md",style1:g().Gmodal1,header:"".concat((0,B.D5)(e.flag,null==F||null==(T=F.page_attributes)?void 0:T.guest_verbiage),"s"),children:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("p",{style:{fontSize:"12px"},children:["This trip has a maximum of ",ej," total ","".concat((0,B.D5)(e.flag,null==F||null==(R=F.page_attributes)?void 0:R.guest_verbiage)).concat(1===ej?"":"s")," allowed."]}),(0,n.jsx)("div",{className:g().guestScrollContainer,children:(null==eE||null==(I=eE.selectedRateCard)||null==(M=I.guest_age_groups)?void 0:M.length)>0?eE.selectedRateCard.guest_age_groups.map((e,t)=>{var l;return(0,n.jsx)("div",{children:eq(e.label,(e=>e.below?"0-".concat(e.max_age):e.above?"".concat(e.min_age," and above"):"".concat(e.min_age,"-").concat(e.max_age))(e),t)},"".concat(null==eE||null==(l=eE.selectedRateCard)?void 0:l.id,"-").concat(t))}):(0,n.jsx)("div",{children:eq("Guest","All ages",0)},"".concat(null==eE||null==(P=eE.selectedRateCard)?void 0:P.id,"-default"))}),(0,n.jsx)("div",{className:g().displayButtons,style:{justifyContent:"center",paddingBottom:8,border:"none"},children:(0,n.jsx)("button",{onClick:()=>{ee(W),ep(!ec)},disabled:0>=eM(),style:0>=eM()?{opacity:.5}:{},className:"gradientBtn bookNowBtn customSave",children:"Save"})}),(null==eT?void 0:eT.length)>1&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("hr",{}),eH("Guests")]})]})}),(0,n.jsx)(en.A,{show:eh,onHide:()=>{eY(),ey(!eh)},size:"md",style1:g().Gmodal1,header:"Start Time & Length",children:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{style:{maxHeight:"310px",overflowY:"auto"},children:(null==ef?void 0:ef.length)>0&&(null==ef?void 0:ef.map((e,t)=>{let l=t===(null==ef?void 0:ef.length)-1,a=W[U];if(!e.disabled){var i,o;return(0,n.jsxs)("div",{style:{display:"flex",borderBottom:l?"none":"1px solid #ccc",width:"100%",margin:"5px 0px 15px",paddingBottom:15,cursor:e.disabled?"not-allowed":"pointer",backgroundColor:e.disabled?"#d3d3d3":""},children:[(0,n.jsx)("img",{onClick:()=>{e.disabled||eO(e)},src:(null==a||null==(i=a.selectedHour)?void 0:i.id)===e.id?e2:e5,style:{padding:0,margin:0,borderRadius:0,marginRight:10,height:20,width:20,border:"1px solid grey"},width:"20",height:"20"}),(0,n.jsxs)("div",{onClick:()=>{eO(e)},style:{cursor:"pointer"},className:"triptypeTitle",children:[(0,j.Ay)(e.start_time)," at ",(0,j.Ds)(e)," "," for "," ",el()(null==Q||null==(o=Q.userData)?void 0:o.currency)||"$",(0,B.BZ)(e.rate)]})]},t)}}))}),(0,n.jsx)("div",{className:g().displayButtons,style:{border:"0px",justifyContent:"center"},children:(0,n.jsx)("button",{onClick:async()=>{await eW(eT,W,U),ee(W),ey(!1)},className:"gradientBtn bookNowBtn customSave",children:"Save"})}),(null==eT?void 0:eT.length)>1&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("hr",{}),eH("Start Time & Length")]})]})}),(0,n.jsx)(en.A,{show:em,onHide:()=>{e_(!1),eY()},size:"md",style1:g().Gmodal1,header:"Meeting Location",children:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{style:{maxHeight:"310px",overflowY:"auto"},children:(0,n.jsx)("div",{className:g().fullWidth,children:null==eb?void 0:eb.map((e,t)=>{var l;let a=W[U],i=t===eb.length-1;return(0,n.jsx)(n.Fragment,{children:(0,n.jsxs)("div",{style:{display:"flex",borderBottom:i?"none":"1px solid #ccc",paddingTop:5,paddingBottom:10,margin:"5px 0px"},children:[(0,n.jsx)("img",{src:(null==a?void 0:a.meeting_spot)===e.poiguid?e2:e5,onClick:()=>{eL(e)},style:{margin:0,padding:0,borderRadius:0,marginRight:10,height:20,width:20,border:"1px solid grey"},width:"20",height:"20"}),(0,n.jsx)("div",{onClick:()=>{eL(e)},style:{cursor:"pointer"},className:"triptypeTitle",children:null==(l=e.description)?void 0:l.normalize("NFKD")})]},t)})})})}),(0,n.jsx)("div",{className:g().displayButtons,style:{justifyContent:"center",paddingBottom:8,border:"none"},children:(0,n.jsx)("button",{onClick:()=>{ee(W),e_(!1)},className:"gradientBtn bookNowBtn customSave",children:"Save"})}),(null==eT?void 0:eT.length)>1&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("hr",{}),eH("Meeting Location")]})]})})]})},e4=e=>{var t;let{guideDetails:l,sameGuestDetailsForAllTrips:i,setSameGuestDetailsForAllTrips:o,underSectionTitle:r=!1}=e,{cartItems:s}=(0,a.useContext)(m.A),d=(null==l||null==(t=l.page_attributes)?void 0:t.mt_theme)==="mt_dark_theme";return z(l,s)?(0,n.jsx)("div",{className:r?"".concat(g().sameGuestsBelowTripTitle," ").concat(g().sameGuestsUnderSectionTitle):g().sameGuestsBelowTripTitle,children:(0,n.jsx)("div",{className:g().sameGuestsToggleRow,children:(0,n.jsx)("div",{style:{display:"flex",padding:"5px 25px 5px 0",marginTop:5,marginBottom:5},children:(0,n.jsxs)("label",{className:g().sameGuestsCheckboxLabel,style:{width:"auto"},children:[(0,n.jsx)("input",{type:"checkbox",checked:i,onChange:e=>o(e.target.checked),className:"".concat(g().sameGuestsCheckboxInput," ").concat(d?g().sameGuestsCheckboxInputDark:"")}),(0,n.jsx)("span",{className:"mtSelection ".concat(d?g().sameGuestsToggleTextDark:g().sameGuestsToggleTextLight),children:i?"The guests for all trips are the same":"Guests for the attached trips are different"})]})})})}):null},e8=e=>{let{consumerAddOn:t,setAddonCheck:l,addOnCheck:i,currency:o,ratecards:r,isNarrow:s,is_mt:d,setUpdated:u,sameGuestDetailsForAllTrips:c,cartItems:p,guideDetails:_}=e,[v,h]=(0,a.useState)({}),y=(0,B.Uv)(o)||"$",{fname:f,lname:x}=(0,a.useContext)(m.A),b=e=>{var t;return(null==e||null==(t=e.addon_options)?void 0:t.filter(e=>{var t;return(null==e||null==(t=e.addon_options)?void 0:t.length)>0}))||[]},C=e=>b(e).map(e=>({guid:e.guid,value:1===e.addon_options.length?e.addon_options[0]:""})),N=e=>{u(e),l(e)},w=(e,t,l)=>i.map(e=>{if(!l(e))return e;let n="increment"===t?e.qty+1:e.qty-1;return{...e,qty:n>0?n:0}}),D=(e,t)=>i.map(l=>{if(!t(l))return l;let n=(l.selected_options||[]).filter((t,l)=>l!==e);return{...l,qty:n.length,selected_options:n}}),k=(e,t)=>i.map(l=>{if(!t(l))return l;let n=l.selected_options||[];return{...l,qty:(l.qty||0)+1,selected_options:[...n,C(e)]}}),S=(e,t,l,n)=>i.map(a=>{if(!n(a))return a;let i=a.selected_options||[],o=C(e).map(e=>e.guid===t?{...e,value:l}:e);return{...a,qty:(a.qty||0)+1,selected_options:[...i,o]}}),A=(e,t,l,n)=>i.map(a=>{if(!n(a))return a;let i=(a.selected_options||[]).map((n,a)=>
1{if(!l.includes(a))return n;let i=[...n||[]],o=i.findIndex(t=>t.guid===e);return o>-1?i[o]={...i[o],value:t}:i.push({guid:e,value:t}),i});return{...a,selected_options:i}}),E=e=>t=>(null==t?void 0:t.uniqueId)===(null==e?void 0:e.uniqueId)&&e.id===(null==t?void 0:t.id)&&!t._guestKey,T=(e,t)=>N(w(e,t,E(e))),R=(e,t)=>"".concat(e.uniqueId,"|guest_").concat(t),M=(e,t)=>l=>l._guestKey===t&&l.id===e.id,I=(e,t,l)=>{let n=R(e,l);if(i.find(M(e,n)))return void N(w(e,t,M(e,n)));let a=+("increment"===t),o=a>0&&b(e).length>0?[C(e)]:[];N([...i,{...e,_guestKey:n,guestIndex:l,qty:a,selected_options:o}])},P=t.reduce((e,t)=>{let l=t.uniqueId;return e[l]||(e[l]=[]),e[l].push(t),e},{}),F=e=>{let t=null==e?void 0:e.split("|"),l=null==p?void 0:p.filter(e=>{var l,n;return String(null==e||null==(l=e.selectedRateCard)?void 0:l.id)===(null==t?void 0:t[0])&&String(null==e||null==(n=e.selectedHour)?void 0:n.id)===(null==t?void 0:t[1])&&String(null==e?void 0:e.selectedDay)===(null==t?void 0:t[2])});if((null==l?void 0:l.length)>0)return l.reduce((e,t)=>e+((null==t?void 0:t.totalGuests)||1),0);let n=null==p?void 0:p.find(e=>{var l,n;return String(null==e||null==(l=e.selectedRateCard)?void 0:l.id)===(null==t?void 0:t[0])&&String(null==e||null==(n=e.selectedHour)?void 0:n.id)===(null==t?void 0:t[1])});return(null==n?void 0:n.totalGuests)||1};(0,a.useEffect)(()=>{if(!(null==i?void 0:i.length))return;let e=i.filter(e=>{var t;if(!(null==e?void 0:e._guestKey))return!0;let l=F(e.uniqueId);return(null!=(t=e.guestIndex)?t:0)<l});e.length!==i.length&&(u(e),l(e))},[p,i]);let Y=e=>{h(t=>({...t,[e]:!t[e]}))},H=(e,t,l)=>{let{onCountIncrement:a,onCountDecrement:i,onComboDecrement:o,onAddVariant:r,onComboOptionChange:s,onStartVariantOption:d}=l,u=b(e),c=u.length>0,p=parseFloat(e.charge_value)||0,m=(null==t?void 0:t.qty)||0,_=(0,n.jsxs)("div",{className:g().addonRowTitle,children:[e.title," (",y,(0,ea.gm)(e.charge_value),")"]});if(!c)return(0,n.jsx)("div",{className:g().addonRowItem,children:(0,n.jsxs)("div",{className:g().addonRowMain,children:[_,(0,n.jsxs)("div",{className:g().addonRowCounter,children:[(0,n.jsx)("button",{type:"button",className:g().guests__button__icon,onClick:i,disabled:0===m,style:0===m?{opacity:"0.5"}:void 0,children:(0,n.jsx)(X.default,{url:eK.A,size:12,alt:"minus",style:{padding:"0px"}})}),(0,n.jsx)("span",{className:g().form__guest__count,children:m}),(0,n.jsx)("button",{type:"button",className:g().guests__button__icon,onClick:a,children:(0,n.jsx)(X.default,{url:eU.A,size:12,alt:"plus",style:{padding:"0px"}})})]}),(0,n.jsxs)("div",{className:g().addonRowPrice,children:[y,(0,ea.BZ)((p*m).toFixed(2))]})]})});let v=((e,t)=>{let l=b(e),n=[];return(t||[]).forEach((e,t)=>{let a=l.map(t=>{var l;return"".concat(t.guid,":").concat((null==(l=(e||[]).find(e=>e.guid===t.guid))?void 0:l.value)||"")}).join("|"),i=n.find(e=>e.key===a);i||(i={key:a,unitOpts:e,count:0,unitIndices:[]},n.push(i)),i.count+=1,i.unitIndices.push(t)}),n})(e,null==t?void 0:t.selected_options),h=e=>u.some(t=>{var l,n;return!(null==(n=e.unitOpts)||null==(l=n.find(e=>e.guid===t.guid))?void 0:l.value)}),f=v.some(h),x=v.length>0?v:[{key:"__empty__",unitOpts:[],count:0,unitIndices:[]}];return(0,n.jsxs)(n.Fragment,{children:[x.map((e,t)=>{let l=e.unitIndices[0];h(e);let a=0===e.count;return(0,n.jsx)("div",{className:g().addonRowItem,children:(0,n.jsxs)("div",{className:g().addonRowMain,children:[_,(0,n.jsx)("div",{className:g().addonRowOptions,children:u.map((t,l)=>{var i,o,r,u;let c=(null==(o=e.unitOpts)||null==(i=o.find(e=>e.guid===t.guid))?void 0:i.value)||"";return(0,n.jsxs)("select",{value:c,onChange:l=>a?d(t.guid,l.target.value):s(t.guid,l.target.value,e.unitIndices),className:g().addonOptionSelect,children:[((null==(r=t.addon_options)?void 0:r.length)>1||a)&&(0,n.jsx)("option",{value:"",disabled:!0,hidden:!0,children:t.title||"Select"}),null==(u=t.addon_options)?void 0:u.map((e,t)=>(0,n.jsx)("option",{value:e,children:e},t))]},l)})}),(0,n.jsxs)("div",{className:g().addonRowCounter,children:[(0,n.jsx)("button",{type:"button",className:g().guests__button__icon,onClick:()=>o(l),disabled:a,style:a?{opacity:"0.5"}:void 0,children:(0,n.jsx)(X.default,{url:eK.A,size:12,alt:"minus",style:{padding:"0px"}})}),(0,n.jsx)("span",{className:g().form__guest__count,children:e.count}),(0,n.jsx)("button",{type:"button",className:g().guests__button__icon,onClick:r,disabled:!a&&f,style:!a&&f?{opacity:"0.5"}:void 0,children:(0,n.jsx)(X.default,{url:eU.A,size:12,alt:"plus",style:{padding:"0px"}})})]}),(0,n.jsxs)("div",{className:g().addonRowPrice,children:[y,(0,ea.BZ)((p*e.count).toFixed(2))]})]})},e.key||t)}),f&&(0,n.jsx)("div",{className:"m-0 pl-0 ".concat(g().ErrorCont),children:"Please choose all add-on options before booking"})]})};return(0,n.jsx)(n.Fragment,{children:(null==t?void 0:t.length)>0&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{className:q().hrLine}),(0,n.jsxs)("div",{id:"optionaladdon",style:{padding:"0px"},children:[(0,n.jsx)("p",{style:{margin:s?"1em 0px":"5px 0px",fontWeight:"bolder",fontSize:18},className:"mtColor",children:"Add-ons"}),(0,n.jsx)("div",{className:"".concat(g().rateCardContainer," ").concat(g().addonContainer," mtrateCardContainer"),children:Object.keys(P).map((e,t)=>{var l,a,o;let s=null==e?void 0:e.split("|"),d=F(e),u=P[e].filter(e=>"guest"===e.assignment_scope),m=P[e].filter(e=>"guest"!==e.assignment_scope),h=(null==_||null==(l=_.page_attributes)?void 0:l.otherDets)===!0,b=null!=(a=null==p?void 0:p.findIndex(e=>{var t,l;return String(null==e||null==(t=e.selectedRateCard)?void 0:t.id)===(null==s?void 0:s[0])&&String(null==e||null==(l=e.selectedHour)?void 0:l.id)===(null==s?void 0:s[1])&&String(null==e?void 0:e.selectedDay)===(null==s?void 0:s[2])}))?a:0,w=0;if(h)if(c)w=0;else for(let e=0;e<b;e++)w+=(null==p||null==(o=p[e])?void 0:o.totalGuests)||1;else w=b;return(0,n.jsxs)("div",{className:g().addonTripGroup,children:[(0,n.jsx)("div",{className:g().addonTripHeader,children:(0,n.jsx)("strong",{children:(e=>{var t;let l=null==r?void 0:r.find(t=>Number(t.id)===Number(null==e?void 0:e[0])),n=null==l||null==(t=l.rates)?void 0:t.find(t=>Number(t.id)===Number(null==e?void 0:e[1]));return l&&n?"".concat(l.title," | ").concat((0,j.Ay)(null==n?void 0:n.start_time)," (").concat((0,j.Ds)(n)," trip) \xb7 ").concat(y).concat((0,ea.BZ)(null==n?void 0:n.rate)):""})(s)})}),u.length>0&&Array.from({length:d}).map((t,l)=>{let a="".concat(e,"-guest-").concat(l),o=!1!==v[a],r=u.reduce((e,t)=>
1{let n=R(t,l),a=null==i?void 0:i.find(e=>e._guestKey===n&&e.id===t.id);return e+((null==a?void 0:a.qty)||0)*(parseFloat(t.charge_value)||0)},0);return(0,n.jsxs)("div",{className:g().addonGuestSection,children:[(0,n.jsxs)("div",{className:g().addonGuestHeader,onClick:()=>Y(a),children:[(0,n.jsx)("span",{className:g().addonGuestTitle,children:(()=>{var e;return(null==_||null==(e=_.page_attributes)?void 0:e.otherDets)!==!0?0===l&&"".concat((null==f?void 0:f[w])||""," ").concat((null==x?void 0:x[w])||"").trim()||"Guest ".concat(l+1):"".concat((null==f?void 0:f[w+l])||""," ").concat((null==x?void 0:x[w+l])||"").trim()||"Guest ".concat(l+1)})()}),(0,n.jsxs)("div",{className:"d-flex align-items-center",children:[(0,n.jsxs)("div",{className:g().addonGuestHeader_Price,children:[y,(0,ea.BZ)(r.toFixed(2))]}),(0,n.jsx)(X.default,{url:o?J.A:Q.A,size:18,alt:"toggle"})]})]}),o&&(0,n.jsx)("div",{className:g().addonGuestBody,children:u.map((e,t)=>{let a=R(e,l),o=null==i?void 0:i.find(t=>t._guestKey===a&&t.id===e.id);return(0,n.jsx)("div",{className:g().addonRowMainItem,children:H(e,o,{onCountIncrement:()=>I(e,"increment",l),onCountDecrement:()=>I(e,"decrement",l),onComboDecrement:t=>((e,t,l)=>{let n=R(e,l);N(D(t,M(e,n)))})(e,t,l),onAddVariant:()=>((e,t)=>{let l=R(e,t);if(i.find(M(e,l)))return void N(k(e,M(e,l)));N([...i,{...e,_guestKey:l,guestIndex:t,qty:1,selected_options:[C(e)]}])})(e,l),onComboOptionChange:(t,n,a)=>((e,t,l,n,a)=>{let i=R(e,a);N(A(t,l,n,M(e,i)))})(e,t,n,a,l),onStartVariantOption:(t,n)=>((e,t,l,n)=>{let a=R(e,n);if(i.find(M(e,a)))return void N(S(e,t,l,M(e,a)));let o=C(e).map(e=>e.guid===t?{...e,value:l}:e);N([...i,{...e,_guestKey:a,guestIndex:n,qty:1,selected_options:[o]}])})(e,t,n,l)})},t)})})]},l)}),m.length>0&&(()=>{let t="".concat(e,"-trip"),l=!1!==v[t],a=m.reduce((e,t)=>{let l=null==i?void 0:i.find(e=>String(e.uniqueId)===String(t.uniqueId)&&e.id===t.id&&!e._guestKey);return e+((null==l?void 0:l.qty)||0)*(parseFloat(t.charge_value)||0)},0);return(0,n.jsxs)("div",{className:g().addonGuestSection,children:[(0,n.jsxs)("div",{className:g().addonGuestHeader,onClick:()=>Y(t),children:[(0,n.jsx)("span",{className:g().addonGuestTitle,children:"Trip Add-ons (For Entire Booking)"}),(0,n.jsxs)("div",{className:"d-flex align-items-center",children:[(0,n.jsxs)("div",{className:g().addonGuestHeader_Price,children:[y,(0,ea.BZ)(a.toFixed(2))]}),(0,n.jsx)(X.default,{url:l?J.A:Q.A,size:18,alt:"toggle"})]})]}),l&&(0,n.jsx)("div",{className:g().addonGuestBody,children:m.map((e,t)=>{let l=null==i?void 0:i.find(t=>String(t.uniqueId)===String(e.uniqueId)&&t.id===e.id&&!t._guestKey);return(0,n.jsx)("div",{className:g().addonRowMainItem,children:H(e,l,{onCountIncrement:()=>T(e,"increment"),onCountDecrement:()=>T(e,"decrement"),onComboDecrement:t=>N(D(t,E(e))),onAddVariant:()=>(e=>N(k(e,E(e))))(e),onComboOptionChange:(t,l,n)=>N(A(t,l,n,E(e))),onStartVariantOption:(t,l)=>((e,t,l)=>N(S(e,t,l,E(e))))(e,t,l)})},t)})})]})})()]},e)})})]})]})})};var e6=l(76631),e9=l(91009),e7=l(47949),te=l(40073);let tt=e=>{var t,l,i,o,r,d,u,c,p,m,_,v,g,h,y,f,x,b,C,j,N,w,D,k,S,A,E,T,R,M,I;let{cartItems:P,guideDetails:B}=e,F=(0,a.useCallback)(()=>(0,n.jsx)(X.default,{url:e7.A,size:14,alt:"star_icon",class_name:"customstars"}),[]);return(0,n.jsx)(n.Fragment,{children:P&&(null==P?void 0:P.length)>0&&(null==P?void 0:P.length)>1?(0,n.jsx)(e9.A,{data:P,template:null==B||null==(t=B.page_attributes)?void 0:t.template,guideDetails:B}):P&&(null==P?void 0:P.length)>0&&(null==P?void 0:P.length)===1?(0,n.jsxs)("div",{className:"ImageContainerCheckout",style:{padding:"10px"},children:[(0,n.jsx)("img",{src:"".concat(s().cloudfront,"filters:format(webp)/").concat((null==P||null==(i=P[0])||null==(l=i.selectedRateCard)?void 0:l.coverpicture)||"images/marlin/capecodfishing.jpg"),onError:e=>e.target.src=te.A.src,width:124,height:106}),(0,n.jsxs)("div",{style:{width:"calc(100% - 124px)"},className:"ImageContainerCheckout_info",children:[(0,n.jsxs)("div",{children:[(null==P||null==(r=P[0])||null==(o=r.selectedRateCard)?void 0:o.title)?(0,n.jsx)("h6",{children:null==P||null==(c=P[0])||null==(u=c.selectedRateCard)||null==(d=u.title)?void 0:d.normalize("NFKD")}):null,(0,n.jsx)("p",{style:{fontWeight:"normal",margin:"0px"}
1,children:(null==P||null==(m=P[0])||null==(p=m.selectedRateCard)?void 0:p.is_referral)?(null==P||null==(v=P[0])||null==(_=v.referral_guide_details)?void 0:_.company)?(0,n.jsxs)("span",{children:[null==P||null==(h=P[0])||null==(g=h.referral_guide_details)?void 0:g.company,(0,n.jsx)("i",{style:{fontWeight:"700"},children:" (Booking partner of ".concat(null==B||null==(y=B.seo_snippets)?void 0:y.s1_company,")")})]}):(0,n.jsxs)("span",{children:[null==P||null==(x=P[0])||null==(f=x.selectedRateCard)?void 0:f.rateType,(0,n.jsx)("i",{style:{fontWeight:"700"},children:" (Booking partner of ".concat(null==B||null==(b=B.seo_snippets)?void 0:b.s1_company,")")})]}):(0,n.jsx)("span",{children:null==B||null==(C=B.seo_snippets)?void 0:C.s1_company})})]}),(0,n.jsx)("div",{children:(null==P||null==(N=P[0])||null==(j=N.selectedRateCard)?void 0:j.is_referral)?(0,n.jsxs)("p",{className:"location",children:[(null==P||null==(S=P[0])||null==(k=S.referral_guide_details)?void 0:k.review)&&(0,n.jsxs)("span",{children:[F()," ",Number(null==P||null==(E=P[0])||null==(A=E.referral_guide_details)?void 0:A.review).toFixed(1)]}),(0,n.jsx)("span",{className:"techlabel",children:(null==P||null==(R=P[0])||null==(T=R.referral_guide_details)?void 0:T.display_location)?null==P||null==(I=P[0])||null==(M=I.referral_guide_details)?void 0:M.display_location:""})]}):(0,n.jsxs)("p",{className:"location",children:[(0,n.jsx)("span",{className:"s1_company",children:(null==B||null==(w=B.reviews_summary)?void 0:w.average)&&(0,n.jsxs)(n.Fragment,{children:[F()," ",Number(null==B||null==(D=B.reviews_summary)?void 0:D.average).toFixed(1)]})}),(0,n.jsx)("span",{className:"techlabel",children:(null==B?void 0:B.display_location)?null==B?void 0:B.display_location:""})]})})]})]}):null})},tl=e=>{let{cartItems:t,setCartItems:l,is_mt:i,isNarrow:o,currency:r}=e,[s,d]=(0,a.useState)(t);(0,a.useEffect)(()=>{d(t)},[t]);let u=(e,t,n)=>{let a=s.map((e,l)=>{if((null==e?void 0:e.course_id)===n){let l="increment"===t?e.quantity+1:e.quantity-1;return{...e,quantity:l>0?l:1}}return e});d(a),l(a)};return(0,n.jsx)("div",{id:"optionaladdon",style:{padding:"0px",marginBottom:"20px"},children:(0,n.jsx)("div",{style:i?{borderRadius:5}:{borderRadius:"5px",padding:"14px 25px"},className:"".concat(g().rateCardContainer," ").concat(q().CustomIn," mtrateCardContainer"),children:null==s?void 0:s.filter(e=>"course"===e.product_type).map((e,t)=>(0,n.jsxs)("div",{className:q().CustomInput,children:[(0,n.jsxs)("div",{className:g().guests__button,style:{width:"120px"},children:[(0,n.jsx)("button",{type:"button",id:"group-size-decrement",className:g().guests__button__icon,disabled:(null==e?void 0:e.quantity)===1,style:(null==e?void 0:e.quantity)===1?{opacity:"0.5"}:null,onClick:()=>u(t,"decrement",null==e?void 0:e.course_id),children:(0,n.jsx)(X.default,{url:eK.A,size:12,alt:"minus",style:{padding:"0px"}})}),(0,n.jsx)("span",{className:g().form__guest__count,children:null==e?void 0:e.quantity}),(0,n.jsx)("button",{type:"button",id:"group-size-increment",className:g().guests__button__icon,onClick:()=>u(t,"increment",null==e?void 0:e.course_id),children:(0,n.jsx)(X.default,{url:eU.A,size:12,alt:"plus",style:{padding:"0px"}})})]}),(0,n.jsx)("span",{style:{marginRight:5},children:e.course_title}),(0,n.jsx)("span",{style:{marginRight:5},children:"- ".concat(el()(r)||"$").concat((0,ea.gm)(e.course_cost))})]},t))})})};var tn=l(7078),ta=l.n(tn);let ti=e=>{let{children:t,onClick:l,item:i}=e,[o,r]=(0,a.useState)(!1),[s,d]=(0,a.useState)(!1),[u,c]=(0,a.useState)(0),p=(0,a.useRef)(null);return(0,a.useEffect)(()=>{let e=p.current;if(!e)return;e.style.WebkitLineClamp="unset",e.style.display="block";let t=e.clientHeight;e.style.WebkitLineClamp=3,e.style.display="-webkit-box",d(t>e.clientHeight)},[i]),(0,n.jsxs)("div",{style:{position:"relative"},children:[(0,n.jsx)("div",{ref:p,style:o?{display:"block"}:{textAlign:"left",display:"-webkit-box",textOverflow:"ellipsis",WebkitLineClamp:3,WebkitBoxOrient:"vertical",overflow:"hidden",wordBreak:"break-word"},children:t}),s&&(0,n.jsx)("span",{onClick:()=>{o?setTimeout(()=>{window.scrollTo({top:u,behavior:"instant"})},0):c(window.scrollY),r(!o),null==l||l()},style:{display:"block",textAlign:"right",fontSize:"13px",fontWeight:700,backgroundColor:"#fff",cursor:"pointer",textDecoration:"underline",marginTop:"4px",padding:"0 3px"},children:o?"Read Less":"Read More"})]})};var to=l(10841),tr=l.n(to);let ts=e=>{let{cartItems:t,ratecards:l,isNarrow:i,mealsAddOn:o,mealsCheck:r,setMealsCheck:d,setMealFees:u,is_mt:c,currency:p}=e,[m,_]=(0,a.useState)({}),[v,h]=(0,a.useState)(!1),y=e=>e?Object.keys(e).filter(t=>{if(!t.endsWith("_price"))return!1;let l=t.replace("_price","");return void 0!==e[t]&&!1!==e["".concat(l,"_enabled")]}).map(e=>e.replace("_price","")):[],f=(e,t)=>{if(!(null==e?void 0:e.guest_groups)||!Array.isArray(e.guest_groups))return 0;let l=e.guest_groups.find(e=>(e.label||"").toLowerCase()===t.toLowerCase());return(null==l?void 0:l.seat_count)||0},x=(e,t)=>{var l;let n="".concat(t,"_quantity");return(null==r||null==(l=r.filter(t=>t.uniqueId===e))?void 0:l.reduce((e,t)=>
1e+(t[n]||0),0))||0},b=o.reduce((e,t)=>{let l=t.uniqueID||t.uniqueId;return e[l]||(e[l]=[]),e[l].push(t),e},{});(0,a.useEffect)(()=>{u&&u(o.map(e=>{let t=e.uniqueID||e.uniqueId,l=null==r?void 0:r.find(l=>l.uniqueId===t&&l.id===e.item_guid);if(!l)return null;let n=y(e),a=0,i={};return n.filter(t=>!1!==e["".concat(t,"_enabled")]).forEach(t=>{var n;let o="".concat(t,"_quantity"),r=l[o]||0,s=parseFloat(null==(n=e["".concat(t,"_price")])?void 0:n.replace("$",""))||0;i[o]=r,a+=r*s}),{...e,...i,total_price:a}}).filter(e=>!!e&&y(e).some(t=>(e["".concat(t,"_quantity")]||0)>0)))},[r]);let C=(e,l,n)=>{if(!1===e["".concat(n,"_enabled")])return;let a=e.uniqueID||e.uniqueId,i=null==r?void 0:r.find(t=>String(t.uniqueId)===String(a)&&t.id===e.item_guid),o="".concat(n,"_quantity");if("increment"===l){let[l,r,s]=a.split("|"),u=null==t?void 0:t.find(e=>{var t,n;let a=e.selectedDay;return String(null==(t=e.selectedRateCard)?void 0:t.id)===String(l)&&String(null==(n=e.selectedHour)?void 0:n.id)===String(r)&&a===s});if(!u)return;let c=f(u,n);if(x(a,n)>=c)return;if(i)d(t=>t.map(t=>t.uniqueId===a&&t.id===e.item_guid?{...t,[o]:(t[o]||0)+1}:t));else{let t=y(e),l={uniqueId:a,id:e.item_guid};t.filter(t=>!1!==e["".concat(t,"_enabled")]).forEach(e=>{l["".concat(e,"_quantity")]=+(e===n)}),d(e=>[...e,l])}}else"decrement"===l&&i&&(i[o]||0)>0&&(0===y(e).reduce((e,t)=>{let l=i["".concat(t,"_quantity")]||0;return e+(t===n?l-1:l)},0)?d(t=>t.filter(t=>t.uniqueId!==a||t.id!==e.item_guid)):d(t=>t.map(t=>t.uniqueId===a&&t.id===e.item_guid?{...t,[o]:(t[o]||0)-1}:t)))},N=e=>{let[l,n,a]=(e.uniqueID||e.uniqueId).split("|"),i=null==t?void 0:t.find(e=>{var t,i;let o=e.selectedDay;return String(null==(t=e.selectedRateCard)?void 0:t.id)===String(l)&&String(null==(i=e.selectedHour)?void 0:i.id)===String(n)&&o===a});if(!i)return!0;let o=e.meal_buffer;if(o&&"based_on_rate_card_availability"!==o){var r;let e=Number(o.split("_")[0]),t=tr()("".concat(i.selectedDay," ").concat(null==(r=i.selectedHour)?void 0:r.start_time),"YYYY-MM-DD HH:mm:ss").clone().subtract(e,"hours");return tr()().isAfter(t)}return!1},w=(e,l)=>{if(!1===e["".concat(l,"_enabled")])return!0;let n=e.uniqueID||e.uniqueId,[a,i,o]=n.split("|"),r=null==t?void 0:t.find(e=>{var t,l;return String(null==(t=e.selectedRateCard)?void 0:t.id)===String(a)&&String(null==(l=e.selectedHour)?void 0:l.id)===String(i)&&e.selectedDay===o});if(!r||N(e))return!0;let s=f(r,l);return x(n,l)>=s},D=()=>{h(!v)};return(0,n.jsx)(n.Fragment,{children:(null==o?void 0:o.length)>0?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{className:q().hrLine}),(0,n.jsxs)("div",{id:"meals",children:[(0,n.jsx)("p",{className:"mtColor ".concat(ta().mealsTitle," ").concat(i?ta().narrow:ta().wide),children:"Meals"}),(0,n.jsx)("div",{className:"".concat(g().rateCardContainer," ").concat(q().CustomIn," mtrateCardContainer ").concat(ta().rateCardContainer," ").concat(c?"":ta().nonMt),children:Object.keys(b).map((e,t)=>{var a;let i=null==e?void 0:e.split("|"),o=b[e].reduce((e,t)=>{let l=t.category_name;return e[l]||(e[l]=[]),e[l].push(t),e},{});return(0,n.jsxs)("div",{className:"".concat(ta().tripSection," ").concat(c?"":ta().nonMt),children:[(0,n.jsx)("p",{className:ta().tripTitle,children:"".concat((e=>{let t=l.find(t=>Number(t.id)===Number(null==e?void 0:e[0])),n=null==t?void 0:t.rates.find(t=>Number(t.id)===Number(null==e?void 0:e[1]));return"".concat(null==t?void 0:t.title," | ").concat((0,j.Ay)(null==n?void 0:n.start_time)," (").concat((0,j.Ds)(n)," trip) - ").concat((0,B.Uv)(p)||"$").concat((0,ea.BZ)(null==n?void 0:n.rate))})(i))}),Object.keys(o).map((e,t)=>{var l,a;return(0,n.jsxs)("div",{className:ta().categorySection,style:{borderBottom:(null==(l=o[e])?void 0:l.length)===t?"0px":"",paddingBottom:(null==(a=o[e])?void 0:a.length)===t?"5px":"0px"},children:[(0,n.jsx)("h4",{className:ta().categoryHeader,children:e}),o[e].map((t,l)=>{let a=null==r?void 0:r.find(e=>String(e.uniqueId)===String(t.uniqueID||t.uniqueId)&&e.id===t.item_guid);return(0,n.jsxs)("div",{className:"".concat(q().CustomInput," ").concat(ta().menuItem," ").concat(!(null==t?void 0:t.item_in_stock)||N(t)?ta().outOfStock:""),children:[(0,n.jsxs)("div",{className:"".concat(ta().meals_container," ").concat(ta().meals_container_img),children:[(0,n.jsx)("div",{children:t.coverpicture&&(0,n.jsx)("img",{src:"".concat(s().cloudfront).concat(t.coverpicture),height:80,width:80,alt:t.title,className:ta().itemImage})}),(0,n.jsxs)("div",{className:ta().itemDetails,children:[(0,n.jsx)("div",{className:ta().itemTitle,children:t.title}),""!=(t.jackai_description||t.description)&&null!=(t.jackai_description||t.description)&&(0,n.jsxs)("div",{className:ta().rcdescription,children:[(0,n.jsx)(ti,{onClick:D,item:t.item_guid,children:(0,n.jsx)("p",{style:{fontSize:"14px",margin:0},dangerouslySetInnerHTML:{__html:t.jackai_description||t.description}})}),(0,n.jsx)("br",{})]})]})]}),(0,n.jsx)("div",{className:"".concat(ta().meals_container," ").concat(ta().meals_container_price),children:(()=>{let e=y(t);return 0===e.length?(0,n.jsx)("div",{style:{color:"red"},children:"No price types found for this item"}):e.filter(e=>!1!==t["".concat(e,"_enabled")]).map(e=>{let l="".concat(e,"_price"),i="".concat(e,"_quantity"),o=e.charAt(0).toUpperCase()+e.slice(1);return(0,n.jsxs)("div",{className:"".concat(g().guests__button," ").concat(ta().quantityControl
1s),children:[(0,n.jsxs)("p",{className:"d-flex flex-column align-items-center",children:[(0,n.jsx)("span",{children:"".concat(o)}),(0,n.jsx)("span",{children:"Price - ".concat(null==t?void 0:t[l])})]}),(0,n.jsxs)("div",{className:"d-flex justify-content-center align-items-center ".concat(ta().quantityPrice),children:[(0,n.jsx)("button",{type:"button",id:"".concat(e,"-size-decrement"),className:"".concat(g().guests__button__icon," ").concat(a&&0!==((null==a?void 0:a[i])||0)?"":ta().disabledButton),disabled:!a||0===((null==a?void 0:a[i])||0),onClick:()=>C(t,"decrement",e),children:(0,n.jsx)(X.default,{url:eK.A,size:12,alt:"minus",style:{padding:"0px"}})}),(0,n.jsx)("span",{className:g().form__guest__count,children:(null==a?void 0:a[i])||0}),(0,n.jsx)("button",{type:"button",id:"".concat(e,"-size-increment"),className:"".concat(g().guests__button__icon," ").concat(w(t,e)?ta().disabledButton:""),disabled:w(t,e),onClick:()=>C(t,"increment",e),children:(0,n.jsx)(X.default,{url:eU.A,size:12,alt:"plus",style:{padding:"0px"}})})]})]},e)})})()})]},"".concat(e,"-").concat(l))})]},e)}),c||(null==(a=Object.keys(b))?void 0:a.length)!==t+1?c?null:(0,n.jsx)("hr",{}):null]},e)})})]})]}):null})},td=e=>{var t,l,i,o,r,s,d,u,c,v,f,x,b,C,j,N;let w=(0,p.useRouter)(),{guideDetails:D,is_MT:k}=e,S=(0,a.useContext)(m.A),A=(0,a.useContext)(_.A),[E,B]=(0,a.useState)(!1),F=(null==D||null==(t=D.page_attributes)?void 0:t.mt_theme)==="mt_dark_theme",{postCart:q}=(0,y.A)(D),{selectedDay:Y,paytype:H,setPaytype:L,tripCal:G,mealsAddOn:O,consumerAddOn:z,setAddonCheck:W,addOnCheck:V,mealsCheck:U,setMealsCheck:K,setMealFees:Z,bsAvailability:Q,cartItems:J,setCartItems:ee,res:et,setAddonupdated:el,customQuestions:en}=S,{bookingEditHubIndex:ea,hubExpandedSection:ei,localData:eo,currentRateCardIndex:er,setHubExpandedSection:es,setLocalData:ed,setCurrentRateCardIndex:eu,openBookingEditHub:ec,closeBookingEditHub:ep,finishBookingEditHub:e_,prepareHubSection:ev,buildMergedCheckoutCart:eg,persistCheckoutCart:ey,handleClear:ef,handleUpdateCart:ex}=T({tripDetailsContext:S,context:A,guideDetails:D,cartItems:J,setCartItems:ee,postCart:q}),[eb,eC]=(0,a.useState)();(0,a.useEffect)(()=>{var e,t;"water_sports"===(null==(t=J[J.length-1])||null==(e=t.selectedRateCard)?void 0:e.activity_type)?eC(!0):eC(!1)},[J]);let ej=J.filter(e=>"course"===e.product_type),eN=J.filter(e=>"course"!=e.product_type),ew=J.every(e=>{var t,l;return(null==(t=e.selectedRateCard)?void 0:t.is_elearning_only)||(null==(l=e.selectedRateCard)?void 0:l.is_course)}),eD=J.every(e=>"course"===e.product_type),ek=J.every(e=>{var t;return null==(t=e.selectedRateCard)?void 0:t.is_course}),eS=eN.every(e=>{var t;return 100===Number(null==(t=e.selectedRateCard)?void 0:t.custom_deposit_percentage)});return(0,n.jsx)(n.Fragment,{children:(0,n.jsxs)("main",{className:"ratesContainer mb-4",children:[(0,n.jsx)("div",{className:"ratePageTitle",children:(0,n.jsx)("h1",{children:(null==D||null==(l=D.page_attributes)?void 0:l.migration)?"".concat(null==D||null==(i=D.seo_snippets)?void 0:i.s1_company," ").concat((null==D||null==(o=D.seo_snippets)?void 0:o.s7_charter_or_guidedtrip)||(null==D||null==(r=D.seo_snippets)?void 0:r.s20_categoryname1)," Prices"):"".concat(null==D||null==(s=D.group_details)?void 0:s.group_name," ").concat((0,h.Nz)(null==D||null==(u=D.ratecards)||null==(d=u[0])?void 0:d.activity_type)," Trip Prices")})}),(0,n.jsx)("div",{className:"ratecardHolder",children:(0,n.jsxs)("div",{container:!0,className:g().container,children:[(null==e?void 0:e.isNarrow)&&(0,n.jsx)(n.Fragment,{children:(0,n.jsx)(tt,{cartItems:J,guideDetails:D})}),(0,n.jsx)(I.A,{container:!0,className:"p-0",children:(0,n.jsxs)(P.A,{item:!0,xs:12,sm:12,md:8,lg:8,className:"p-0",children:[(0,n.jsx)("div",{children:(0,n.jsxs)("p",{className:g().breadcrumb,children:[(0,n.jsx)("span",{className:"".concat(g().bdtext," breadCrumb"),onClick:()=>(()=>{var e,t;let l="/"+(null==(e=(null==D||null==(t=D.seo_snippets)?void 0:t.s110_rates_url)||"rates")?void 0:e.toLowerCase());w.push(l)})(),children:"Trips"}),(0,n.jsx)(X.default,{url:k&&F?M.A:R.A,size:14,alt:"chevronRight"}),(0,n.jsx)("span",{className:"breadCrumb",style:{color:"gray"},children:"Checkout"})]})}),eD?(0,n.jsx)("p",{style:{fontWeight:"bolder",fontSize:18},className:"mtColor",children:"Course List"}):(0,n.jsx)("div",{style:{marginBottom:5,marginTop:5,display:"flex",justifyContent:"space-between"},children:(0,n.jsx)("span",{style:{fontSize:18,fontWeight:"bolder"},className:"mtColor",id:"tripData",children:"Your ".concat(ew?"Course":"Trip"," Details")})}),(null==eN?void 0:eN.length)>0&&!eD?(0,n.jsx)(e4,{guideDetails:D,sameGuestDetailsForAllTrips:e.sameGuestDetailsForAllTrips,setSameGuestDetailsForAllTrips:e.setS
1ameGuestDetailsForAllTrips,underSectionTitle:!0}):null]})}),(0,n.jsxs)(I.A,{container:!0,spacing:2,className:"p-0 ".concat(E?g().disabled:""),children:[(0,n.jsxs)(P.A,{item:!0,xs:12,sm:12,md:6,lg:6,className:"p-0",children:[(null==ej?void 0:ej.length)>0?(0,n.jsx)(tl,{cartItems:J,is_mt:!0,isNarrow:null==e?void 0:e.isNarrow,setCartItems:ee,currency:null===m.A||void 0===m.A||null==(c=m.A.userData)?void 0:c.currency}):null,(null==eN?void 0:eN.length)>0?(0,n.jsx)(n.Fragment,{children:(0,n.jsx)(e3,{...e,flag:eb,openBookingEditHub:ec,closeBookingEditHub:ep,finishBookingEditHub:e_,bookingEditHubIndex:ea,hubExpandedSection:ei,setHubExpandedSection:es,localData:eo,setLocalData:ed,currentRateCardIndex:er,setCurrentRateCardIndex:eu})}):null,(0,n.jsx)(ts,{cartItems:J,ratecards:null==D?void 0:D.ratecards,isNarrow:null==e?void 0:e.isNarrow,mealsAddOn:O,mealsCheck:U,setMealsCheck:K,setMealFees:Z,is_mt:!0,currency:null===m.A||void 0===m.A||null==(v=m.A.userData)?void 0:v.currency}),(0,n.jsx)($,{...e,flag:eb,isAllECourses:eD,openBookingEditHub:ec,consumerAddOn:(null==z?void 0:z.filter(e=>"guest"===e.assignment_scope))||[],setAddonCheck:W,addOnCheck:V,currency:(null===m.A||void 0===m.A||null==(f=m.A.userData)?void 0:f.currency)||(null==D?void 0:D.currency),ratecards:null==D?void 0:D.ratecards,setUpdated:el}),(0,n.jsx)(em,{...e,is_MT:!0,isAllECourses:eD,isAllCourses:ew}),(null==z?void 0:z.length)>0&&(0,n.jsx)(e8,{consumerAddOn:z,setAddonCheck:W,addOnCheck:V,currency:null===m.A||void 0===m.A||null==(x=m.A.userData)?void 0:x.currency,ratecards:null==D?void 0:D.ratecards,setUpdated:el,isNarrow:null==e?void 0:e.isNarrow,is_mt:!0,sameGuestDetailsForAllTrips:e.sameGuestDetailsForAllTrips,cartItems:J,guideDetails:D}),((null==D||null==(b=D.page_attributes)?void 0:b.pay_in_full)===!0||(null==D||null==(C=D.page_attributes)?void 0:C.pay_in_full)===void 0)&&!eS&&!eD&&(0,n.jsx)(eh,{tripCal:G,paytype:H,setPaytype:L,selectedDay:Y,isNarrow:null==e?void 0:e.isNarrow,cartItems:J}),(0,n.jsx)(eV,{guideDetails:D}),(0,n.jsx)(eW,{...e,ref:e.paymentElementsRef,cartItems:J,cancelationDay:null==et||null==(j=et.data)?void 0:j.allowed_cancellation_days,res:null==et?void 0:et.data,isAllECourses:eD,customQuestions:en,chargeAmount:e.piChargeAmount,chargeReady:e.piChargeReady,currency:(null==S||null==(N=S.userData)?void 0:N.currency)||(null==D?void 0:D.currency)||"USD",onPaymentIntentReady:e.onPaymentIntentReady,onPaymentElementComplete:e.onPaymentElementComplete,setPaymentCardDetails:null==S?void 0:S.setPaymentCardDetails,paymentIntentKe
1y:e.paymentIntentKey})]}),(0,n.jsx)(P.A,{item:!0,xs:12,sm:12,md:6,lg:6,className:"p-0",style:(null==e?void 0:e.isNarrow)?void 0:{marginTop:0},children:(0,n.jsx)(e6.A,{...e,confirm:!1,handlePayment:null==e?void 0:e.handlePayment,setPastDateError:null==e?void 0:e.setPastDateError,pastDateError:null==e?void 0:e.pastDateError,pastRatecardsLen:null==e?void 0:e.pastRatecardsLen,pastRatecards:null==e?void 0:e.pastRatecards,loading:null==e?void 0:e.paymentOngoing,setPastRatecardsLen:null==e?void 0:e.setPastRatecardsLen,isAllECourses:eD,onlyCourses:ek})})]})]})})]})})},tu=e=>{var t,l,i,o,r,s,d,u,c;let{guideDetails:p}=e,v=(null==p||null==(t=p.page_attributes)?void 0:t.template)==="Modern",h=(0,a.useContext)(m.A),f=(0,a.useContext)(_.A),[x,b]=(0,a.useState)(!1),{postCart:C}=(0,y.A)(p),{selectedDay:j,paytype:N,setPaytype:w,tripCal:D,mealsAddOn:k,consumerAddOn:S,setAddonCheck:A,addOnCheck:E,mealsCheck:R,setMealsCheck:M,setMealFees:B,setCartItems:F,cartItems:q,res:Y,setAddonupdated:H,customQuestions:L}=h,{bookingEditHubIndex:G,hubExpandedSection:O,localData:z,currentRateCardIndex:W,setHubExpandedSection:V,setLocalData:U,setCurrentRateCardIndex:K,openBookingEditHub:Z,closeBookingEditHub:Q,finishBookingEditHub:J,prepareHubSection:X,buildMergedCheckoutCart:ee,persistCheckoutCart:et,handleClear:el,handleUpdateCart:en}=T({tripDetailsContext:h,context:f,guideDetails:p,cartItems:q,setCartItems:F,postCart:C}),ea=q.filter(e=>"course"===e.product_type),ei=q.filter(e=>"course"!=e.product_type),eo=q.every(e=>{var t;return(null==(t=e.selectedRateCard)?void 0:t.is_course)===!0}),er=q.every(e=>"course"===e.product_type),es=q.every(e=>{var t;return null==(t=e.selectedRateCard)?void 0:t.is_course});return ei.every(e=>{var t;return 100===Number(null==(t=e.selectedRateCard)?void 0:t.custom_deposit_percentage)}),(0,n.jsxs)("main",{className:"main ratesMarginForTop",id:"removeMarginTop",style:v?{}:{backgroundColor:"#efefef"},children:[(0,n.jsx)("div",{className:"sectionheading",style:{margin:"0px"},children:(0,n.jsx)("h1",{children:"Checkout with ".concat(null==p||null==(l=p.seo_snippets)?void 0:l.s1_company)})}),(0,n.jsxs)("div",{className:g().container,children:[(null==e?void 0:e.isNarrow)&&(0,n.jsx)(n.Fragment,{children:(0,n.jsx)(tt,{cartItems:q,guideDetails:p})}),er?(0,n.jsx)("p",{style:{fontWeight:"bolder",fontSize:18},className:"mtColor",children:"Course List"}):(0,n.jsx)("div",{style:{marginBottom:"5px",marginTop:5,display:"flex",justifyContent:"space-between",padding:(null==e?void 0:e.isNarrow)?"1em 0px":"0px"},children:(0,n.jsx)("span",{style:{fontSize:18,fontWeight:"bolder"},className:"mtColor",id:"tripData",children:"Your ".concat(eo?"Course":"Trip"," Details")})}),(null==ei?void 0:ei.length)>0&&!er?(0,n.jsx)(e4,{guideDetails:p,sameGuestDetailsForAllTrips:e.sameGuestDetailsForAllTrips,setSameGuestDetailsForAllTrips:e.setSameGuestDetailsForAllTrips,underSectionTitle:!0}):null,(0,n.jsxs)(I.A,{className:x?g().disabled:"",children:[(0,n.jsxs)(P.A,{xs:12,sm:12,md:6,lg:6,style:{padding:"0px"},className:"mdgridcheckout",children:[(null==ea?void 0:ea.length)>0?(0,n.jsx)(tl,{cartItems:q,is_mt:!1,isNarrow:null==e?void 0:e.isNarrow,setCartItems:F,currency:null===m.A||void 0===m.A||null==(i=m.A.userData)?void 0:i.currency}):null,(null==ei?void 0:ei.length)>0?(0,n.jsx)(n.Fragment,{children:(0,n.jsx)(e3,{...e,openBookingEditHub:Z,closeBookingEditHub:Q,finishBookingEditHub:J,bookingEditHubIndex:G,hubExpandedSection:O,setHubExpandedSection:V,localData:z,setLocalData:U,currentRateCardIndex:W,setCurrentRateCardIndex:K})}):null,(0,n.jsx)(ts,{cartItems:q,ratecards:null==p?void 0:p.ratecards,isNarrow:null==e?void 0:e.isNarrow,mealsAddOn:k,mealsCheck:R,setMealsCheck:M,setMealFees:B,is_mt:!1,currency:null===m.A||void 0===m.A||null==(o=m.A.userData)?void 0:o.currency}),(0,n.jsx)($,{...e,isAllECourses:er,openBookingEditHub:Z,consumerAddOn:(null==S?void 0:S.filter(e=>"guest"===e.assignment_scope))||[],setAddonCheck:A,addOnCheck:E,currency:(null===m.A||void 0===m.A||null==(r=m.A.userData)?void 0:r.currency)||(null==p?void 0:p.currency),ratecards:null==p?void 0:p.ratecards,setUpdated:H}),(0,n.jsx)(em,{...e,template:v,isAllECourses:er,isAllCourses:eo}),(null==S?void 0:S.length)>0&&(0,n.jsx)(e8,{consumerAddOn:S,setAddonCheck:A,addOnCheck:E,currency:null===m.A||void 0===m.A||null==(s=m.A.userData)?void 0:s.currency,ratecards:null==p?void 0:p.ratecards,isNarrow:null==e?void 0:e.isNarrow,setUpdated:H,is_mt:!1,sameGuestDetailsForAllTrips:e.sameGuestDetailsForAllTrips,cartItems:q,guideDetails:p}),v&&((null==p||null==(d=p.page_attributes)?void 0:d.pay_in_full)===!0||(null==p||null==(u=p.page_attributes)?void 0:u.pay_in_full)===void 0)&&(0,n.jsx)(eh,{tripCal:D,paytype:N,setPaytype:w,selectedDay:j,isNarrow:null==e?void 0:e.isNarrow,cartItems:q}),(0,n.jsx)(eV,{guideDetails:p}),(0,n.jsx)(eW,{...e,ref:e.paymentElementsRef,cartItems:q,res:null==Y?void 0:Y.data,template:v,isAllECourses:er,customQuestions:L,chargeAmount:e.piChargeAmount,chargeReady:e.piChargeReady,currency:(null==h||null==(c=h.userData)?void 0:c.currency)||(null==p?void 0:p.currency)||"USD",onPaymentIntentReady:e.onPaymentIntentReady,onPaymentElementComplete:e.onPaymentElementComplete,setPaymentCardDetail
1s:null==h?void 0:h.setPaymentCardDetails,paymentIntentKey:e.paymentIntentKey})]}),(0,n.jsx)(P.A,{xs:12,sm:12,md:6,lg:6,style:{padding:"0px",...(null==e?void 0:e.isNarrow)?{}:{marginTop:0}},className:"mdgridcheckout",id:"paymentError",children:(0,n.jsx)(e6.A,{...e,confirm:!1,handlePayment:null==e?void 0:e.handlePayment,pastDateError:null==e?void 0:e.pastDateError,setPastDateError:null==e?void 0:e.setPastDateError,pastRatecards:null==e?void 0:e.pastRatecards,pastRatecardsLen:null==e?void 0:e.pastRatecardsLen,loading:null==e?void 0:e.paymentOngoing,setPastRatecardsLen:null==e?void 0:e.setPastRatecardsLen,isAllECourses:er,onlyCourses:es})})]})]})]})};var tc=l(44143),tp=l(18334);function tm(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;try{t?(tp.gV({id:t.id||t.userId||"unknown",email:t.email||"unknown",name:t.name||t.fullName||"unknown"}),tp.o("Trip Information",t)):tp.gV(null),"string"==typeof e?tp.wd(e,"warning"):tp.Cp(e instanceof Error?e:Error("string"==typeof e?e:JSON.stringify(e)))}catch(e){console.error("Failed to send error to Sentry:",e)}}let t_={selected:"apple_pay_selected",success:"apple_pay_success",failed:"apple_pay_failed"},tv={selected:"google_pay_selected",success:"google_pay_success",failed:"google_pay_failed"},tg={selected:"other_payment_selected",success:"other_payment_success",failed:"other_payment_failed"},th={success:"Complete Order Clicked",failed:"cart_checkout_failed"},ty={apple_pay:t_,google_pay:tv};function tf(e){return"apple_pay"===e||"google_pay"===e||"link"===e||"us_bank_account"===e||"card"===e?e:"card"}function tx(e){let t=[];return(e||[]).forEach(e=>{if(null==e||""===e)return;let l=String(e);t.includes(l)||t.push(l)}),t.length?t.join(","):void 0}function tb(){var e,t;let l=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(l.cart_id)return String(l.cart_id);let n=null==(e=l.selectedRateCard)?void 0:e.id,a=null==(t=l.selectedHour)?void 0:t.id,i=l.selectedDay;if(null!=n||null!=a||i)return"".concat(null!=n?n:"","|").concat(null!=a?a:"","|").concat(null!=i?i:"")}function tC(){let{paymentMethodType:e,cartItems:t,bookings:l,amount:n,bookingRef:a,failureReason:i,errorCode:o,hostname:r,now:s=new Date}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},d=tx([a,...Array.isArray(l)?l.map(e=>null==e?void 0:e.booking_ref):[]]),u=tx(Array.isArray(l)&&l.some(e=>(null==e?void 0:e.trip_guid)||(null==e?void 0:e.tripguid))?l.map(e=>(null==e?void 0:e.trip_guid)||(null==e?void 0:e.tripguid)):(t||[]).map(e=>{var t;return(null==e?void 0:e.trip_id)||(null==e||null==(t=e.selectedRateCard)?void 0:t.id)})),c={payment_method:tf(e),amount:Number(n)||0,environment:function(e){var t;let l=String(null!=e?e:null==(t=window.location)?void 0:t.hostname).trim().toLowerCase();return!l||"localhost"===l||"127.0.0.1"===l||"::1"===l||l.includes("staged")||l.includes("staging")||l.includes("guideslytesting")||l.includes("beta")||l.includes("preview")?"beta":"prod"}(r),timestamp:s.toISOString()};d&&(c.booking_ref=d),u&&(c.trip_id=u);let p=tx((t||[]).map(tb));p&&(c.cart_id=p),i&&(c.failure_reason=String(i));let m=function(e,t){let l=String(e||"");return"canceled"===t||"cancelled"===t||/closed before the payment finished|payment was cancelled/i.test(l)?t&&"incomplete"!==t&&"incomplete_number"!==t?t:"canceled":t||void 0}(i,o);return m&&(c.error_code=m),c}function tj(e,t){var l;if(e&&(null==(l=window.heap)?void 0:l.track))try{window.heap.track(e,t)}catch(e){console.log("Heap payment analytics error",e)}}function tN(){return"production"}t_.selected,tv.selected,t_.selected,tv.selected,tg.selected,t_.success,tv.success,tg.success,t_.failed,tv.failed,tg.failed,t_.selected,tv.selected,tg.selected,t_.success,t_.success,tv.success,tg.success,tv.success,t_.success,tv.success,tg.success,C().extend(eg()),C().extend(O());let tw=e=>{var t,l,i,o,r,s,d,u;let c=()=>{var e,t,l;let n=null==g||null==(e=g.page_attributes)?void 0:e.requestAge,a=null==g||null==(l=g.ratecards)||null==(t=l[0])?void 0:t.activity_type;return!0===n||!1!==n&&v.includes(a)},v=["snow_sports","off_roading","water_sports"],{guideDetails:g,is_MT:h,companyGuid:y}=e,f=(0,p.useRouter)(),[b,j]=(0,a.useState)(c()),N=(null==g||null==(t=g.page_attributes)?void 0:t.template)!="Classic",w=(0,a.useContext)(m.A),D=(0,a.useContext)(_.A),k=a.useRef({}),S=a.useRef(!1),[A,E]=(0,a.useState)([{isValidEmail:!1,inValidPhone:!1,inValidBirthday:!1}]),[T,R]=(0,a.useState)(!1),[M,I]=(0,a.useState)({zipCode:""}),[P,F]=(0,a.useState)({zipCode:"",paymentElementComplete:!1}
1),[q,H]=(0,a.useState)(null),[L,G]=(0,a.useState)(!1),O=(0,a.useRef)(null),[W,V]=(0,a.useState)(!1),[U,K]=(0,a.useState)(!1),[Z,Q]=(0,a.useState)(""),[J,X]=(0,a.useState)(!1),[$,ee]=(0,a.useState)(0),[et,el]=(0,a.useState)([]),{setSelectedDay:en,selectedHour:eo,setSelectedHour:er,selectedRateCard:es,setSelectedRateCard:ed,cartItems:eu,setCartItems:ec,tripCal:ep,setTripCal:em,addonAmt:e_,setAddonAmt:ev,tipamount:eg,addOnFees:eh,setAddOnFees:ey,setMealFees:ef,mealFees:ex,addOnCheck:eb,setAddonCheck:eC,consumerAddOn:ej,setConsumerAddOn:eN,mealsAddOn:ew,setMealsAddOn:eS,mealsCheck:eR,setMealsCheck:eM,setAddonTooltip:eI,setPromoAmt:eP,promoAmt:eB,setReferralGuideName:eY,depositAmt:eG,IndDepositDetails:eO,setIndDepositDetails:ez,res:eW,setRes:eV,isGuestCountMaxed:eU,setError:eK,error:eZ,setPaymentCardDetails:eQ,stateTaxAdd:eX,setStateTaxAdd:e$,stateTaxCustom:e0,setStateTaxCustom:e1,mealTaxAdd:e2,setMealTaxAdd:e5,addonupdated:e3,customQuestions:e4,setCustomQuestions:e8,giftCards:e6}=w;(0,tc.A)(w,g);let e9=(0,a.useMemo)(()=>z(g,eu),[g,eu]),[e7,te]=(0,a.useState)(!1);(0,a.useEffect)(()=>{var e,t;if(!e9)return void te(!1);let l=null==w||null==(t=w.userData)||null==(e=t.checkout_preferences)?void 0:e.same_guest_details_for_all_trips;te("boolean"==typeof l&&l)},[e9,null==w||null==(i=w.userData)||null==(l=i.checkout_preferences)?void 0:l.same_guest_details_for_all_trips]);let tt=e=>e?Object.keys(e).filter(t=>t.endsWith("_price")&&e[t]).map(e=>e.replace("_price","")):[],tl=(0,a.useMemo)(()=>eR.reduce((e,t)=>(Object.keys(t).forEach(l=>{if(l.endsWith("_quantity")){let n=l.replace("_quantity","");e["total_".concat(n,"_qty")]||(e["total_".concat(n,"_qty")]=0),e["total_".concat(n,"_qty")]+=t[l]||0,e.totalQty=(e.totalQty||0)+(t[l]||0)}}),e),{totalQty:0}),[eR]),tn=(0,a.useMemo)(()=>y,[y]),ta=(0,a.useMemo)(()=>g,[g]),ti=(null==g||null==(o=g.page_attributes)?void 0:o.phoneReq)===!0,to=(null==g||null==(r=g.page_attributes)?void 0:r.emailReq)===!0,{response:tr}=((e,t,l,n,i)=>{let[o,r]=(0,a.useState)(null),s=(0,x.je)(),d=(null==s?void 0:s.length)>0?s.map(e=>({...e,selectedRateCard:{id:e.selectedRateCard},selectedHour:{id:e.selectedHour}})):[],u=(0,a.useCallback)(async()=>{var e,a;null==i||i.setLoadingMask(!0);let o="guide-group/".concat(t,"/ratecards?app_guid=").concat(null==l||null==(e=l.page_attributes)?void 0:e.app_guid);try{let{data:e,status:t}=await (0,ei.get)(o);if(200===t&&Object.keys(e).length>0){((null==e?void 0:e.booking_acceptance_days)||(null==e?void 0:e.booking_acceptance_days)===0)&&(null==e||e.booking_acceptance_days),(0,x.z8)(null!=(a=null==e?void 0:e.apply_vehicle_capacity)&&a),i.setDepositAmt(e.deposit_percentage),r({data:e}),n.setSchRecords(e);let t=(0,eJ.YG)(e.schedule,d);i.setRes({data:{...e,schedule:t}}),i.setRateCards(e.ratecards),i.setCancellationPolicy(null==e?void 0:e.allowed_cancellation_days),null==i||i.setLoadingMask(!1)}}catch(e){null==i||i.setLoadingMask(!1),console.error("Error fetching MT data",e)}},[t]),c=(0,a.useCallback)(async()=>{null==i||i.setLoadingMask(!0);let e=C()().format("YYYY-MM-DD"),t=C()().add(2,"year").format("YYYY-MM-DD"),a="guide/gbs/availability?guide_guid=".concat(null==l?void 0:l.guideguid,"&start_date=").concat(e,"&end_date=").concat(t,"¤t_date=").concat(C()().format("YYYY-MM-DD h:mm:s a"));try{let{data:e,status:t}=await (0,ei.get)(a);if(200===t&&Object.keys(e).length>0){var o;((null==e?void 0:e.booking_acceptance_days)||(null==e?void 0:e.booking_acceptance_days)===0)&&(null==e||e.booking_acceptance_days),localStorage.setItem("applyVehicleCapacity",JSON.stringify(null!=(o=null==e?void 0:e.apply_vehicle_capacity)&&o)),r({data:e}),n.setSchRecords(e);let t=(0,eJ.YG)(e.schedule,d);i.setRes({data:{...e,schedule:t}}),i.setRateCards(e.ratecards),i.setCancellationPolicy(null==e?void 0:e.allowed_cancellation_days),null==i||i.setLoadingMask(!1)}}catch(e){null==i||i.setLoadingMask(!1),console.error("Error fetching MT data",e)}},[l]);return(0,a.useEffect)(()=>{e?u():c()},[e]),{response:o}})(h,tn,ta,D,w),{ratecards:ts}=g;(0,a.useEffect)(()=>{if(tr){var e;eV(tr),eY(null==(e=tr.data)?void 0:e.referral_guides)}},[tr]);let tp=(null==g||null==(s=g.page_attributes)?void 0:s.otherDets)===!0,t_=(null==eu?void 0:eu.reduce((e,t)=>
1e+(t.totalGuests||0),0))||1,tv=tp?t_:(null==eu?void 0:eu.length)||1,tx=Array.from({length:tv},()=>({isValidEmail:!1,inValidPhone:!1,inValidBirthday:!1})),tb=()=>{var e,t,l;return{name:(null==w||null==(e=w.fname)?void 0:e[0])||"",email:(null==w||null==(t=w.mtemail)?void 0:t[0])||"",phone:(null==w||null==(l=w.phone)?void 0:l[0])||"",page:"Checkout",...eu.map(e=>{var t,l,n,a;return{selectedDay:e.selectedDay,rateCardId:null==(t=e.selectedRateCard)?void 0:t.id,title:null==(l=e.selectedRateCard)?void 0:l.title,rateId:null==(n=e.selectedHour)?void 0:n.id,startTime:null==(a=e.selectedHour)?void 0:a.start_time,totalGuests:e.totalGuests}})}};(0,a.useEffect)(()=>{Z&&tm(Z,tb())},[Z]),(0,a.useEffect)(()=>((null==eu?void 0:eu.length)>0&&(E(tx),tw(eu)),()=>{e8([])}),[eu]),(0,a.useEffect)(()=>{if(eu&&eu.length>0){let e=!1;eu.forEach(t=>{var l,n;let a="".concat(null==(l=t.selectedRateCard)?void 0:l.id,"|").concat(null==(n=t.selectedHour)?void 0:n.id,"|").concat(t.selectedDay),i=t.totalGuests||0,o=k.current[a];void 0!==o&&i<o&&(e=!0),k.current[a]=i}),e&&(S.current=!0)}},[eu]);let tw=async e=>{let t=e.map(e=>{var t;return null==(t=e.selectedRateCard)?void 0:t.id}).filter(Boolean);try{let e=await (0,ei.proxypost)("guides/ratecard/custom-questions",{ratecard_ids:t},{}),l=[];for(let t of null==e?void 0:e.data)l.push({question:t.question_text,format:t.question_type,isRequired:t.is_required,ratecard_id:null==t?void 0:t.ratecard_id,answer:""});e8(l)}catch(e){console.error("Error fetching questionnaires:",e)}},tD=eu.some(e=>{var t;return null==(t=e.selectedRateCard)?void 0:t.is_course}),tk=(e,t)=>{let l=null==t?void 0:t.find(e=>"STATE_FEE"===e.type);return(null==l?void 0:l.active)&&[null,!0,void 0].includes(null==l?void 0:l.fee_applicability)?(null==e?void 0:e.consumerStateTaxAddOn)*(Number(null==l?void 0:l.charge_percentage)/100):0},tS=(e,t,l)=>{var n,a;let i=null==l||null==(n=l.selectedHour)?void 0:n.rate,o=null==l?void 0:l.totalGuests,r=(0,ea.LQ)(null==l?void 0:l.selectedRateCard,null==l?void 0:l.totalGuests,null==l||null==(a=l.selectedHour)?void 0:a.rate),s=(Array.isArray(t)?t.filter(e=>(null==e?void 0:e.type)==="CUSTOM_FEE"&&(null==e?void 0:e.active)===!0&&(null==e?void 0:e.fee_applicability)===!0):[]).map(t=>({...t,charge_amount:"BOOKING_AMOUNT"===t.fee_applicability_type?t.charge_value?Number(t.charge_value):(Number(i)+Number(r||0)+Number((null==e?void 0:e.consumerAddOn)||0)+((null==e?void 0:e.meals)||0))/100*Number(t.charge_percentage):t.charge_value?o*Number(t.charge_value):o*(Number(i)/100)*Number(t.charge_percentage)})),d=(null==s?void 0:s.length)>0?s.reduce((e,t)=>e+(Number(null==t?void 0:t.charge_amount)||0),0):0,u=null==t?void 0:t.find(e=>"STATE_FEE"===e.type);return(null==u?void 0:u.active)&&[null,!0,void 0].includes(null==u?void 0:u.fee_applicability)?d*(Number(null==u?void 0:u.charge_percentage)/100):0},tA=(e,t)=>{let l=null==t?void 0:t.find(e=>"STATE_FEE"===e.type);return(null==l?void 0:l.active)?(null==e?void 0:e.meals)*(Number(null==l?void 0:l.charge_percentage)/100):0};(0,a.useEffect)(()=>{var t,l,n,a,i,o;if(j(c()),g&&Object.keys(g).length>0&&(null==(t=(0,x.je)())?void 0:t.length)>0){ec([]),ez([]),w.setPromo({show:!1,promoCode:"",error:"",applied:!1,response:"",promo_details:[]});let t=(0,x.je)(),i=[];for(let l of t)if((null==l?void 0:l.product_type)!="course"){let t=null==ts?void 0:ts.filter(e=>Number(e.id)===Number(l.selectedRateCard));(null==t?void 0:t.length)>0&&t.forEach(t=>{var n,a,o,r,s,d,u,c,p,m,_,v,g,h,y;let f=null==t||null==(n=t.rates)?void 0:n.find(e=>Number(e.id)===Number(l.selectedHour));if(f){let n={selectedDay:null==l?void 0:l.selectedDay,selectedRateCard:t,selectedHour:(null==(o=(0,eJ.xy)(e.is_MT?null==D||null==(r=D.schrecords)?void 0:r.schedule:(null==w||null==(d=w.res)||null==(s=d.data)?void 0:s.schedule)||(null==D||null==(u=D.schrecords)?void 0:u.schedule),null==l?void 0:l.selectedDay))||null==(a=o.available_rates)?void 0:a.find(e=>e.id===(null==f?void 0:f.id)))||f,guestCount:{adult:(null==l||null==(c=l.guestCount)?void 0:c.adult)||1,child:(null==l||null==(p=l.guestCount)?void 0:p.child)||0},totalGuests:(null==l?void 0:l.totalGuests)||1,guest_groups:(null==l?void 0:l.guest_groups)||[],meeting_spot:(null==l?void 0:l.meeting_spot)?null==l?void 0:l.meeting_spot:(null==t||null==(m
1=t.poi_guids)?void 0:m.length)>0?null==t||null==(_=t.poi_guids)?void 0:_[0]:null,...(null==l?void 0:l.guideguid)&&{guideguid:null==l?void 0:l.guideguid},...(null==l?void 0:l.boatguid)&&{boatguid:null==l?void 0:l.boatguid},bsRefferalDeposit:(null==l?void 0:l.bsRefferalDeposit)||0,guideReferralDeposit:(null==l?void 0:l.guideReferralDeposit)||0,bs_group_guid:(null==l?void 0:l.bs_group_guid)||null,refferal_guide_guid:(null==l?void 0:l.refferal_guide_guid)||null,...(null==l?void 0:l.refferal_guide_guid)&&{referral_guide_details:{guidename:(null==l||null==(v=l.referral_guide_details)?void 0:v.guidename)||null,display_location:(null==l||null==(g=l.referral_guide_details)?void 0:g.display_location)||null,company:(null==l||null==(h=l.referral_guide_details)?void 0:h.company)||null,review:(null==l||null==(y=l.referral_guide_details)?void 0:y.review)||null}}};i.push(n)}})}else i.push(l);en(null==(l=i[0])?void 0:l.selectedDay),er(null==(n=i[0])?void 0:n.selectedHour),ed(null==(a=i[0])?void 0:a.selectedRateCard),ec(i)}else f.push(null!=(o="/".concat(null==g||null==(i=g.seo_snippets)?void 0:i.s110_rates_url))?o:"/rates")},[g]),(0,a.useEffect)(()=>{if(eu&&eu.length>0){let e=[],t=[],l=[],n=[],a=[],i=JSON.parse(JSON.stringify(eb)),o=JSON.parse(JSON.stringify(eR));eu.forEach(i=>{var o,r,s,d,u,c,p,m,_,v,g,h,y,f,x,b,C,j,N,D,k;let S="".concat(null==(o=i.selectedRateCard)?void 0:o.id,"|").concat(null==(r=i.selectedHour)?void 0:r.id,"|").concat(i.selectedDay),A=null==ts?void 0:ts.filter(e=>{var t;return Number(e.id)===Number(null==(t=i.selectedRateCard)?void 0:t.id)}),E=null==eO?void 0:eO.find(e=>e.uniqueID===S),T=E?null==E?void 0:E.consumerAddOn:0,R={selectedDay:i.selectedDay,selectedRateCard:null==(s=i.selectedRateCard)?void 0:s.id,selectedHour:null==(d=i.selectedHour)?void 0:d.id,...(null==i?void 0:i.product_type)!="course"&&{guestCount:{adult:null==i||null==(u=i.guestCount)?void 0:u.adult,child:null==i||null==(c=i.guestCount)?void 0:c.child},totalGuests:null==i?void 0:i.totalGuests},guest_groups:(null==i?void 0:i.guest_groups)||[],meeting_spot:null==i?void 0:i.meeting_spot,...(null==i?void 0:i.guideguid)&&{guideguid:null==i?void 0:i.guideguid},...(null==i?void 0:i.boatguid)&&{guideguid:null==i?void 0:i.boatguid},...(null==i?void 0:i.refferal_guide_guid)&&{bsRefferalDeposit:null==i?void 0:i.bsRefferalDeposit,guideReferralDeposit:null==i?void 0:i.guideReferralDeposit,bs_group_guid:null==i?void 0:i.bs_group_guid,refferal_guide_guid:null==i?void 0:i.refferal_guide_guid,referral_guide_details:{guidename:(null==i||null==(p=i.referral_guide_details)?void 0:p.guidename)||null,display_location:(null==i||null==(m=i.referral_guide_details)?void 0:m.display_location)||null,company:(null==i||null==(_=i.referral_guide_details)?void 0:_.company)||null,review:(null==i||null==(v=i.referral_guide_details)?void 0:v.review)||null}},...(null==i?void 0:i.product_type)==="course"&&{course_title:null==i?void 0:i.course_title,course_image:null==i?void 0:i.course_image,course_id:null==i?void 0:i.course_id,course_sku:null==i?void 0:i.course_sku,course_cost:null==i?void 0:i.course_cost,quantity:(null==i?void 0:i.quantity)||1,product_type:"course"}};e.push(R),null==A||A.forEach(e=>{var l,n;let a=null==e||null==(n=e.consumer_addon_fees)||null==(l=n.filter(e=>!1!==e.active))?void 0:l.map((e,t)=>({...e,uniqueId:"".concat(S)}));(null==a?void 0:a.length)>0&&(t=[...t,...a])});let M=null==eW||null==(h=eW.data)||null==(g=h.ratecards)?void 0:g.find(e=>{var t;return e.id===(null==i||null==(t=i.selectedRateCard)?void 0:t.id)}),I=(null==M?void 0:M.offering_meals)?null==M||null==(y=M.meal_categories)?void 0:y.filter(e=>{var t;return(null==e||null==(t=e.meal_items)?void 0:t.length)>0}):[];(null==I?void 0:I.length)>0&&(null==I||null==(f=I.filter(e=>{var t;return(null==e||null==(t=e.meal_items)?void 0:t.length)>0}))||f.forEach(e=>{var t;let l=null==e||null==(t=e.meal_items)?void 0:t.map((t,l)=>({...t,uniqueId:"".concat(S),category_guid:null==e?void 0:e.category_guid,category_name:null==e?void 0:e.category_name}));(null==l?void 0:l.length)>0&&(n=[...n,...l])}));let P=((null==i||null==(x=i.selectedRateCard)?void 0:x.addon_fees)||[]).filter(e=>e.active),B=(0,ea.LQ)(null==i?void 0:i.selectedRateCard,null==i?void 0:i.totalGuests,(null==i||null==(b=i.selectedHour)?void 0:b.rate)||((((null==i?void 0:i.selectedRateCard)||{}).rates||[])[0]||{}).rate),F=(null==(C=w.mealFees)?void 0:C.length)>0?null==(j=w.mealFees)?void 0:j.reduce((e,t)=>
1e+Number(t.total_price)):0;P.forEach(e=>{let t;t="CUSTOM_FEE"===e.type?"BOOKING_AMOUNT"==e.fee_applicability_type?e.charge_value?e.charge_value:(Number(null==i?void 0:i.selectedHour.rate)+Number(B)+Number(T)+Number(F))/100*Number(e.charge_percentage):e.charge_value?i.totalGuests*Number(e.charge_value):i.totalGuests*Number(null==i?void 0:i.selectedHour.rate)/100*Number(e.charge_percentage):e.charge_value?e.charge_value:(Number(null==i?void 0:i.selectedHour.rate)+Number(B))/100*Number(e.charge_percentage),l.push({...e,charge_price:Number(t),uniqueID:S})});let q=(null==i||null==(N=i.selectedRateCard)?void 0:N.offering_meals)?null==i||null==(k=i.selectedRateCard)||null==(D=k.meal_categories)?void 0:D.filter(e=>{var t;return(null==e||null==(t=e.meal_items)?void 0:t.length)>0}):[];(null==q?void 0:q.length)>0&&(null==q||q.forEach(e=>{var t;null==e||null==(t=e.meal_items)||t.forEach(t=>{var l,n;a.push({...t,category_guid:null==e?void 0:e.category_guid,category_name:null==e?void 0:e.category_name,guest_price:null==t||null==(l=t.guest_price)?void 0:l.slice(1),child_price:null==t||null==(n=t.child_price)?void 0:n.slice(1),uniqueID:S})})}))}),eN(t),t.length>0&&eC(Object.values(Object.values([...i,...t.map(e=>({uniqueId:e.uniqueId,id:e.id,qty:0}))].reduce((e,t)=>{let l="".concat(t.uniqueId,"|").concat(t.id,"|").concat(t._guestKey||"trip");return(!e[l]||t.qty>e[l].qty)&&(e[l]=t),e},{}))).flat()),eS(n),n.length>0&&(eM(Object.values(Object.values([...o,...n.map(e=>{let t=tt(e),l={uniqueId:e.uniqueId,id:e.item_guid};return t.forEach(e=>{l["".concat(e,"_quantity")]=0}),l})].reduce((e,t)=>{let l="".concat(t.uniqueId,"|").concat(t.id);if(S.current){if(!e[l]){let a=tt(n.find(e=>e.uniqueId===t.uniqueId&&e.item_guid===t.id)),i={...t};a.forEach(e=>{i["".concat(e,"_quantity")]=0}),e[l]=i}}else if(e[l]){let n=Object.keys(e[l]).filter(e=>e.endsWith("_quantity")).reduce((t,n)=>t+(e[l][n]||0),0);Object.keys(t).filter(e=>e.endsWith("_quantity")).reduce((e,l)=>e+(t[l]||0),0)>n&&(e[l]=t)}else e[l]=t;return e},{}))).flat()),S.current&&(S.current=!1)),ey(l),ef(a),setTimeout(()=>{(0,x.Bo)(e)},500)}},[eu,eW]),(0,a.useEffect)(()=>{if(eu&&(null==eu?void 0:eu.length)>0){let e=ej.map(e=>{let t=eb.filter(t=>t.uniqueId===e.uniqueId&&String(null==t?void 0:t.id)===String(e.id)&&(t.qty||0)>0).reduce((e,t)=>e+(t.qty||0),0),[l,n,...a]=((null==e?void 0:e.uniqueId)||"").split("|"),i=a.join("|"),o=null==eu?void 0:eu.find(e=>{var t,a;return Number(null==(t=e.selectedRateCard)?void 0:t.id)===Number(l)&&Number(null==(a=e.selectedHour)?void 0:a.id)===Number(n)&&e.selectedDay===i}),r=0;if(t>0){var s,d,u,c,p;let l=parseFloat(e.charge_value)||0,n=parseFloat(null==o||null==(s=o.selectedHour)?void 0:s.duration_hours)||0,a=(null==o||null==(d=o.selectedHour)?void 0:d.duration_days)||0;r=((null==(u=e.duration)?void 0:u.is_entire_trip)?l:(null==(c=e.duration)?void 0:c.days)?l*(a||(0,ea.Os)(n)/24):(null==(p=e.duration)?void 0:p.hours)?l*(24*a||(0,ea.Os)(n)):l*(48*a||2*(0,ea.Os)(n)))*t}return{...e,qty:t,amount:r}});ey(eh.map(t=>{if(t.uniqueID&&"CUSTOM_FEE"===t.type&&"BOOKING_AMOUNT"===t.fee_applicability_type&&t.charge_percentage){let[a,i,...o]=t.uniqueID.split("|"),r=o.join("|"),s=e.filter(e=>e.uniqueId===t.uniqueID),d=ex.filter(e=>e.uniqueId===t.uniqueID);if(s.length>0||d.length>0){var l,n;let e=s.reduce((e,t)=>e+(Number(t.amount)||0),0),o=d.reduce((e,t)=>e+(Number(t.total_price)||0),0),u=eu.find(e=>{var t,l;return Number(null==e||null==(t=e.selectedRateCard)?void 0:t.id)===Number(a)&&Number(null==e||null==(l=e.selectedHour)?void 0:l.id)===Number(i)&&(null==e?void 0:e.selectedDay)===r}),c=(0,ea.LQ)(null==u?void 0:u.selectedRateCard,null==u?void 0:u.totalGuests,(null==u||null==(l=u.selectedHour)?void 0:l.rate)||((((null==u?void 0:u.selectedRateCard)||{}).rates||[])[0]||{}).rate),p=(Number(e)+Number(o)+Number(c)+Number(null==u||null==(n=u.selectedHour)?void 0:n.rate))/100*Number(t.charge_percentage||0);return{...t,charge_price:p}}}return t}))}},[e3,ex]),(0,a.useEffect)(()=>{if(eu&&(null==eu?void 0:eu.length)>0){let e=[];ev(null==ej?void 0:ej.reduce((t,l)=>{var n,a,i,o,r,s,d,u;let c=eb.filter(e=>e.uniqueId===l.uniqueId&&String(null==e?void 0:e.id)===String(l.id)&&(e.qty||0)>0),p=c.reduce((e,t)=>
1e+(t.qty||0),0),m=null==l||null==(a=l.uniqueId)||null==(n=a.split("|"))?void 0:n[1],_=((null==l?void 0:l.uniqueId)||"").split("|").slice(2).join("|"),v=null==(i=JSON.parse(JSON.stringify(eu)))?void 0:i.find(e=>{var t,n;return Number(null==(t=e.selectedRateCard)?void 0:t.id)===Number(null==l?void 0:l.ratecard_id)&&Number(null==(n=e.selectedHour)?void 0:n.id)===Number(m)&&e.selectedDay===_}),g={};if(g.title=l.title,g.qty=p>0?p:null,p>0){let n=parseFloat(l.charge_value)||0,a=parseFloat(null==v||null==(o=v.selectedHour)?void 0:o.duration_hours)||0,i=(null==v||null==(r=v.selectedHour)?void 0:r.duration_days)||0,m=0,_=(m=(null==(s=l.duration)?void 0:s.is_entire_trip)?n:(null==(d=l.duration)?void 0:d.days)?n*(i||(0,ea.Os)(a)/24):(null==(u=l.duration)?void 0:u.hours)?n*(24*i||(0,ea.Os)(a)):n*(48*i||2*(0,ea.Os)(a)))*p,g=c.flatMap(e=>(e.selected_options||[]).map(e=>(e||[]).map(e=>e.value).filter(Boolean).join(", ")));if(g.length>0&&g.some(e=>e)){Object.entries(g.filter(e=>e).reduce((e,t)=>(e[t]=(e[t]||0)+1,e),{})).forEach(t=>{let[n,a]=t;e.push({title:l.title,qty:a,addon_options:n,value:m*a})});let t=g.filter(e=>!e).length;t>0&&e.push({title:l.title,qty:t,addon_options:null,value:m*t})}else e.push({title:l.title,qty:p,addon_options:null,value:_});return t+_}return t},0)),eI(e)}},[eu,eb,ej]),(0,a.useEffect)(()=>{if(eu&&eu.length>0){var e,t,l,n,a,i,o,r,s,d,u,c,p,m,_;let v,g=eg&&"uponCash"!==eg?Number(eg):0,h=0,y=0,f=0,x=0,b=0,C=0,j=0,N=0,D=0,k=[];v=!((null==eu?void 0:eu.length)>1)||(null==(t=w.promo)||null==(e=t.response)?void 0:e.is_gift)?(null==(n=w.promo)||null==(l=n.response)?void 0:l.is_gift)?new Map:new Map((null==(p=w.promo)||null==(c=p.promo_details)?void 0:c.map(e=>{let{id:t,promo_amount:l}=e;return[t,l]}))||[]):new Map((null==(d=(0,ea.H8)(null==w||null==(u=w.promoList)?void 0:u.filter(e=>null==e?void 0:e.valid)))?void 0:d.flatMap(e=>{var t;return(null==(t=e.promo_bookings)?void 0:t.map(e=>[e.id,e.promo_amount]))||[]}))||[]);let S=(null==(a=(0,ea.My)((0,ea.H8)(null==w||null==(i=w.promoList)?void 0:i.filter(e=>null==e?void 0:e.valid))))?void 0:a.reduce((e,t)=>e+((null==t?void 0:t.amount_off)||0),0))||0,A=(null==e6?void 0:e6.reduce((e,t)=>{var l;return e+((null==t||null==(l=t.promo_bookings)?void 0:l.reduce((e,t)=>e+(t.promo_amount||0),0))||0)},0))||0,E=new Map;null==e6||e6.forEach(e=>{var t;null==e||null==(t=e.promo_bookings)||t.forEach(e=>{let t=E.get(e.id)||0;E.set(e.id,t+(e.promo_amount||0))})});let T=0;(null==(o=w.promo.response)?void 0:o.amount_off)&&!(null==(s=w.promo)||null==(r=s.response)?void 0:r.is_gift)&&(T=Number((null==eu?void 0:eu.length)>1?S:(null==(m=w.promo.response)?void 0:m.is_promo)?null==(_=w.promo.response)?void 0:_.amount_off:w.promo.response.amount_off/100)),eP(A+T),D=ex.reduce((e,t)=>e+(null==t?void 0:t.total_price),0)||0,eu.forEach(e=>{var t,l,n,a,i,o,r,s,d,u,c,p;let{guideReferralDeposit:m,bsRefferalDeposit:_}=e,w="".concat(null==(t=e.selectedRateCard)?void 0:t.id,"|").concat(null==(l=e.selectedHour)?void 0:l.id,"|").concat(e.selectedDay),D=null==eO?void 0:eO.find(e=>e.uniqueID===w),S=tk(D,null==(n=e.selectedRateCard)?void 0:n.addon_fees),A=tA(D,null==(a=e.selectedRateCard)?void 0:a.addon_fees),T=tS(D,null==(i=e.selectedRateCard)?void 0:i.addon_fees,e),R=null==e?void 0:e.selectedDay,M=null==e?void 0:e.selectedRateCard,I=null==e?void 0:e.totalGuests,P=(null==e||null==(o=e.selectedHour)?void 0:o.rate)||(((M||{}).rates||[])[0]||{}).rate;j+=P;let B=(0,ea.LQ)(M,I,P);C+=B;let F=(null==ex||null==(r=ex.filter(e=>(e.uniqueId||e.uniqueID)===w))?void 0:r.reduce((e,t)=>e+(t.total_price||0),0))||0;if((null==e||null==(s=e.selectedHour)?void 0:s.rate)&&eh){let t="".concat(null==(d=e.selectedRateCard)?void 0:d.id,"|").concat(null==(u=e.selectedHour)?void 0:u.id,"|").concat(e.selectedDay),l=(0,ea.DO)(M,I,P);h=l,v.has(w)&&(h-=Number(v.get(w)));let n=eh.filter(e=>Number(e.ratecard_id)===Number(null==M?void 0:M.id)&&e.uniqueID===t),a=(e=>{var t;return Array.isArray(e)?null==e||null==(t=e.filter(e=>"STATE_FEE"!=e.type))?void 0:t.reduce((e,t)=>e+(Number(null==t?void 0:t.charge_price)||0),0):0})(n),i=Number(Number(Number((e=>{var t;return Array.isArray(e)?null==e||null==(t=e.filter(e=>"STATE_FEE"===e.type))?void 0:t.reduce((e,t)=>
1e+(Number(null==t?void 0:t.charge_price)||0),0):0})(n))+Number(S+A+T)).toFixed(2));N=N+a+i;let o=ej.filter(e=>e.uniqueId===t),r=(0,ea.m8)(o,null==e?void 0:e.selectedHour,eb),s=(null==ex||null==(c=ex.filter(e=>e.uniqueId===t))?void 0:c.reduce((e,t)=>e+(t.total_price||0),0))||0,C=function(e,t,l,n){let a=e.filter(e=>e.uniqueId===t&&[null,!0,void 0].includes(e.fee_applicability));return(0,ea.m8)(a,l,n)}(ej,t,null==e?void 0:e.selectedHour,eb),j=(null==M?void 0:M.custom_deposit_percentage)>0?M.custom_deposit_percentage/100:eG/100||.2,D=l+a+g+r+F+i;b+=D;let B=v.has(w)?Number(v.get(w)):0,q=Math.max(0,D-(B+(E.has(w)?Number(E.get(w)):0)));x+=q;let Y=m&&0!=m?(m/100*(h+a)).toFixed(2):0,H=_&&0!=_?((h+a-parseFloat((h+a)*.2)-Y)*(_/100)).toFixed(2):0,L=(null==M?void 0:M.is_referral)?(parseFloat((q-g)*.2)+parseFloat(Y)+parseFloat(H)).toFixed(2):((q-g)*j).toFixed(2),G={rateCardId:null==M?void 0:M.id,title:null==M?void 0:M.title,percentage:j,total:q,chargeToday:Number(L),selectedDay:R,selectedHour:null==(p=e.selectedHour)?void 0:p.id,promoAmt:e.promoAmt,add_on_fees:a,consumerAddOn:r,consumerStateTaxAddOn:C,uniqueID:w,ratecard_total:l+a+g+r+F+i,meals:s};k.push(G),y+=Number(L),f+=q-L}else if(F>0){let e=(null==M?void 0:M.custom_deposit_percentage)>0?M.custom_deposit_percentage/100:eG/100||.2;x+=F,b+=F;let t=(F*e).toFixed(2);y+=Number(t),f+=F-Number(t)}});let R=x-A,M=A>0&&x>0?Math.max(0,y-y/x*A):y,I=R-M;k.map(e=>{if(A>0&&x>0){let t=A*(e.total/x),l=e.total-t,n=e.chargeToday-t*(e.chargeToday/e.total);return{...e,total:l,meals:D,chargeToday:Number(n.toFixed(2))}}return e}),ez(k),em({chargetoday:Number(M.toFixed(2)),baseTrip:j,total:R,addons:Number(e_),fees:N,tip:Number(g),dayoftrip:Number(I.toFixed(2)),additionalGuestFee:C,total_trip_amount:b,meals:D})}},[eG,e_,eg,ej,eb,w.promo,null==w?void 0:w.promoList,eh,eX,e2,e0,e6,ex,eu]);let tE=(0,a.useMemo)(()=>{if(!(null==eu?void 0:eu.length))return 0;let e=0;return eu.forEach(t=>{var l,n,a,i,o,r,s,d,u,c,p;if((null==t?void 0:t.product_type)==="course"){let l=parseFloat(t.course_cost)*t.quantity,n=Number((null==eu?void 0:eu.length)>1?(null==(r=(0,ea.H8)(null==w||null==(s=w.promoList)?void 0:s.filter(e=>null==e?void 0:e.valid)))||null==(o=r.filter(e=>e.ratecard_id===Number(t.course_id)))||null==(i=o[0])?void 0:i.amount_off)||0:(null==w?void 0:w.promoAmt)||0);e+=Math.max(0,l-n);return}let m="".concat(null==(l=t.selectedRateCard)?void 0:l.id,"|").concat(null==(n=t.selectedHour)?void 0:n.id,"|").concat(t.selectedDay),_=null==eO?void 0:eO.find(e=>e.uniqueID===m);if(null==t||null==(a=t.selectedRateCard)?void 0:a.charity_ratecard){e+=Number(null!=(u=null!=(d=null==_?void 0:_.chargeToday)?d:null==_?void 0:_.total)?u:0);return}(null==w?void 0:w.paytype)==="partial"?e+=Number(null!=(c=null==_?void 0:_.chargeToday)?c:0):e+=Number(null!=(p=null==_?void 0:_.total)?p:0)}),Number(Math.max(0,e).toFixed(2))},[eu,eO,null==w?void 0:w.paytype,null==w?void 0:w.promoAmt,null==w?void 0:w.promoList]),tT=(0,a.useMemo)(()=>!!(null==eu?void 0:eu.length)&&eu.every(e=>{var t,l,n;if((null==e?void 0:e.product_type)==="course")return!0;let a="".concat(null==(t=e.selectedRateCard)?void 0:t.id,"|").concat(null==(l=e.selectedHour)?void 0:l.id,"|").concat(e.selectedDay);return null!=eO&&!!eO.some(e=>e.uniqueID===a)||!Number(null==e||null==(n=e.selectedHour)?void 0:n.rate)}),[eu,eO]),[tR,tM]=(0,a.useState)(0),tI=(0,a.useMemo)(()=>"".concat(tE,"|").concat((null==eu?void 0:eu.length)||0,"|").concat((null==w?void 0:w.paytype)||"full","|").concat(tR),[tE,null==eu?void 0:eu.length,null==w?void 0:w.paytype,tR]),tP=()=>{tM(e=>e+1),H(null),G(!1),F(e=>({...e,paymentElementComplete:!1,paymentMethodType:void 0}))},tB=(0,a.useRef)(null);(0,a.useEffect)(()=>{let e=null==P?void 0:P.paymentMethodType;if(!e){tB.current=null;return}e!==tB.current&&(tB.current=e,function(e){let t=null==e?void 0:e.paymentMethodType;t&&tj((ty[t]||tg).selected,tC(e))}({paymentMethodType:e,cartItems:eu,amount:tE}))},[null==P?void 0:P.paymentMethodType,eu,tE]);let tF=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return/PaymentMethod was previously used|may not be used again/i.test(String(e))};(0,a.useEffect)(()=>{let e=0;eu.forEach(t=>{var l,n,a;let i="".concat(null==(l=t.selectedRateCard)?void 0:l.id,"|").concat(null==(n=t.selectedHour)?void 0:n.id,"|").concat(t.selectedDay),o=null==eO?void 0:eO.find(e=>e.uniqueID===i);e+=tk(o,null==(a=t.selectedRateCard)?void 0:a.addon_fees)}),e$(e)},[eu,eh,eO]),(0,a.useEffect)(()=>{let e=0;eu.forEach(t=>{var l,n,a;let i="".concat(null==(l=t.selectedRateCard)?void 0:l.id,"|").concat(null==(n=t.selectedHour)?void 0:n.id,"|").concat(t.selectedDay),o=null==eO?void 0:eO.find(e=>e.uniqueID===i);e+=tS(o,null==(a=t.selectedRateCard)?void 0:a.addon_fees,t)}),e1(e)},[eu,eh,eO]),(0,a.useEffect)(()=>{let e=0;eu.forEach(t=>{var l,n,a;let i="".concat(null==(l=t.selectedRateCard)?void 0:l.id,"|").concat(null==(n=t.selectedHour)?void 0:n.id,"|").concat(t.selectedDay),o=null==eO?void 0:eO.find(e=>e.uniqueID===i);e+=tA(o,null==(a=t.selectedRateCard)?void 0:a.addon_fees)}),e5(e)},[eu,eO]);let tq=async()=>{var t,l,n,a,i;let{guideid:o}=g||{},{userData:r,fname:s,lname:d,mtemail:u,phone:c,selectedDay:p,setRequiredFn:m,setRequiredLn:_,setRequiredEmail:v,setRequiredPhone:h,birthday:y,setRequiredBirthday:f}=w||{},{rate:x}=eo||{},{title:j}=es||{},{zipCode:D}=P||{},k=window.localStorage.getItem("bookingAcceptance")||0,S=eu.filter(e=>{var t;return((e,t,l)=>{let n=new Date("".concat(e,"T").concat(t));return new Date>new Date(n.getTime()+24*l*36e5)})(e.selectedDay,null==(t=e.selectedHour)?void 0:t.start_time,k)}),E=null==S?void 0:S.length;E>0?(X(!0),ee(E),el(S)):X(!1);let T=eu.some(e=>
1"course"===e.product_type),F=null==eu?void 0:eu.some(e=>{var t,l;let n=null==eW||null==(l=eW.data)||null==(t=l.ratecards)?void 0:t.find(t=>{var l;return t.id===(null==e||null==(l=e.selectedRateCard)?void 0:l.id)});return null==n?void 0:n.is_meal_mandatory}),q=null==eu?void 0:eu.some(e=>{var t;return null==e||null==(t=e.selectedRateCard)?void 0:t.offering_meals}),Y=null==eu?void 0:eu.reduce((e,t)=>e+(t.totalGuests||0),0),H=E>0,G=!p||!j||null==x,z=(null==g||null==(t=g.page_attributes)?void 0:t.otherDets)===!0,W=(null==eu||null==(l=eu[0])?void 0:l.totalGuests)||1,U=!!(z&&(null==eu?void 0:eu.length)>1&&W>1&&e7&&e9),Z=(eu||[]).map((e,t)=>eu.slice(0,t).reduce((e,t)=>e+((null==t?void 0:t.totalGuests)||1),0)),J=z?U?Array.from({length:W},(e,t)=>t):(null==eu?void 0:eu.length)>1?(()=>{let e=[0];for(let n=0;n<eu.length;n++){var t,l;let a=null!=(l=Z[n])?l:0,i=(null==(t=eu[n])?void 0:t.totalGuests)||1;for(let t=1;t<i;t++)e.push(a+t)}return e})():Array.from({length:tv},(e,t)=>t):Array.from({length:(null==eu?void 0:eu.length)||1},(e,t)=>t),$=(()=>{let e=J.some(e=>!(null==s?void 0:s[e])),t=J.some(e=>!(null==d?void 0:d[e])),l=e=>!z||0===e||Z.includes(e),n=J.some(e=>(to||l(e))&&!(null==u?void 0:u[e])),a=J.some(e=>(ti||l(e))&&!(null==c?void 0:c[e])),i=J.some(e=>{var t;return(null==u?void 0:u[e])&&(null==A||null==(t=A[e])?void 0:t.isValidEmail)}),o=J.some(e=>{var t;return(null==c?void 0:c[e])&&(null==A||null==(t=A[e])?void 0:t.inValidPhone)}),r=!!(N&&b||tD||T)&&J.some(e=>{var t;return!(null==y?void 0:y[e])||(null==A||null==(t=A[e])?void 0:t.inValidBirthday)});return e||t||n||a||i||o||r})(),et=!(e.is_MT||N)&&!eA(null==P?void 0:P.paymentMethodType),en=!eA(null==P?void 0:P.paymentMethodType)&&!L||et&&(!(null==P?void 0:P.zipCode)||!!(null==M?void 0:M.zipCode)),ea=(0,B.ow)(w.checkoutQA),ei=null==eb?void 0:eb.some(e=>{var t;if(!e.qty||e.qty<=0)return!1;let l=null==ej?void 0:ej.find(t=>t.uniqueId===e.uniqueId&&t.id===e.id);if(!(null==l||null==(t=l.addon_options)?void 0:t.length))return!1;let n=l.addon_options.filter(e=>{var t;return(null==e||null==(t=e.addon_options)?void 0:t.length)>0});return!!n.length&&(e.selected_options||[]).some(e=>n.some(t=>{var l;return!(null==e||null==(l=e.find(e=>e.guid===t.guid))?void 0:l.value)}))}),er=w.contactInfo||{},ed=!(null==(n=er.name)?void 0:n.trim())||!(null==(a=er.email)?void 0:a.trim())||!er.phone,ec=!!q&&!!F&&(null==tl?void 0:tl.totalQty)<Y,ep=eu.every(e=>{var t,l;let n="".concat(e.selectedDay," ").concat(null==(t=e.selectedHour)?void 0:t.start_time),a=C()(n,"YYYY-MM-DD HH:mm:ss",!0);return a.isValid()||(a=C()(n,"YYYY-MM-DD h:mm a",!0)),((null==e||null==(l=e.selectedRateCard)?void 0:l.meal_categories)||[]).every(e=>(e.meal_items||[]).every(e=>{if(!e.item_in_stock)return!0;let t=e.meal_buffer;if(!t||"based_on_rate_card_availability"===t)return!1;let l=Number(t.split("_")[0]),n=a.clone().subtract(l,"hours");return!!C()().isAfter(n)}))}),em=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:80,l=document.getElementById(e);l&&setTimeout(()=>{let e=l.getBoundingClientRect().top+window.pageYOffset-t;window.scrollTo({top:e,behavior:"smooth"})},100)};if(252===o&&fbq("track","Purchase",{currency:(null==r?void 0:r.currency)||"USD",value:null==x?void 0:x.toFixed(2)}),eU||!T&&G||H||$||en||!T&&ea||!ep&&ec||ei||ed)(()=>{if(eU||H){K(!1),em("tripData");return}if(!T&&G){K(!0),p?j?Q("Trip Detail section is not complete, please select trip time and length"):Q("Trip Detail section is not complete, please select trip type"):Q("Trip Detail section is not complete, please select trip date"),em("tripData");return}if($){m(Array.from({length:tv},(e,t)=>!s[t])),_(Array.from({length:tv},(e,t)=>!d[t]));let e=e=>!z||0===e||Z.includes(e);v(Array.from({length:tv},(t,l)=>(to||e(l))&&(!(null==u?void 0:u[l])||""===u[l]))),h(Array.from({length:tv},(t,l)=>(ti||e(l))&&!(null==c?void 0:c[l]))),(N&&b||tD||T)&&f(tD||T?(null==y?void 0:y.length)===0?[!0]:y.map(e=>!e||""===e):y.map(e=>!e||""===e)),K(!0),Q("My Info section is not complete"),em("myInfo");return}if(en){var e;et&&I(e=>({...e,zipCode:D&&""!=D?"":"Please enter zip code"}));let t=eL;(null==t?void 0:t.submitElements)?t.submitElements().catch(()=>{}):(null==(e=O.current)?void 0:e.submitElements)&&O.current.submitElements().catch(()=>{}),K(!0),Q("Payment details are not complete"),em("paymentdetails");return}if(!T&&ea){V(!0),K(!0),Q("Additional details are not complete"),em("qadetails");return}if((!q||F)&&!ep&&ec){K(!0),Q("Meal details are not complete"),em("meals");return}if(ei){K(!0),Q("Please choose all add-on options before booking"),em("myInfo");return}if(ed){w.setContactSubmitted(!0),K(!0),Q("Contact information is not complete"),em("contactInfo");return}})();else{K(!1),eK({...eZ,paymentError:""});let e=eL,t=(null==e?void 0:e.submitElements)||(null==(i=O.current)?void 0:i.submitElements);if(!t)return void tO("Payment form is not ready. Please wait for the card form to load and try again.");let l=t(),n=eA(null==P?void 0:P.paymentMethodType);if(!n){let e=await l;if(null==e?void 0:e.error)return void tO(e.error.message||"Unable to submit payment details. Please try again.",{errorCode:e.error.code})}R(!0),await tW(null,"CARD",n?l:null)}},tY=null==(d=window)?void 0:d.navigator.userAgent.toLowerCase(),tH=null==(u=window)?void 0:u.navigator.platform.toLowerCase(),tL=tY&&(null==tY?void 0:tY.match(/ip(?:ad|od|hone)/))?"ios":((null==tY?void 0:tY.match(/(?:webos|android)/))||(null==tH?void 0:tH.match(/mac|win|linux/))||["other"])[0],tG=/ios/.test(tL),tO=function(e){var t,l,n,a,i;let o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=(e,t)=>{var l={paymentMethodType:null==P?void 0:P.paymentMethodType,cartItems:eu,amount:tE,bookingRef:o.bookingRef,failureReason:e,errorCode:t||o.errorCode};let n=tf(null==l?void 0:l.paymentMethodType),a=tC({...l,paymentMethodType:n});tj((ty[n]||tg).failed,a),tj(th.failed,{...a,trip_ids:a.cart_id,payment_provider:"Stripe",environment:tN()})};if("string"==typeof e){eK(t=>({...t,paymentError:e}
1)),tm(e,tb()),r(e,o.errorCode);return}let{code:s,data:d,message:u}=(null==e||null==(n=e.response)||null==(l=n.data)||null==(t=l.err)?void 0:t[0])||{},c=null==eu?void 0:eu.filter(e=>{var t,l;return(null==e||null==(t=e.selectedHour)?void 0:t.id)===(null==d?void 0:d.hourCardId)&&Number(null==e||null==(l=e.selectedHour)?void 0:l.guide_ratecard_id)===Number(null==d?void 0:d.rateCardId)});if(["INVALID_GUIDE"].includes(s)){let e="Trip date is no longer available for the selected rate card ".concat(null==c||null==(i=c[0])||null==(a=i.selectedRateCard)?void 0:a.title);eK(t=>({...t,paymentError:e})),r(e,s)}else{let e=u||"Something went wrong";eK(t=>({...t,paymentError:e})),r(e,s)}tm(u||e,tb())},tz=async t=>{var l,n,a,i,o,r;let s,{formData:d,customerToken:u,tripPayloads:c,submitPromise:p}=t,m=null==g||null==(l=g.page_attributes)?void 0:l.XAPPID;if(!(null==q?void 0:q.pi_id)||!(null==q?void 0:q.client_secret))return void tO("Payment form is not ready. Please wait a moment and try again.");let _=Number(d.charge_amount||0),v=function(e){return"apple_pay"===e||"google_pay"===e||"link"===e?e:"us_bank_account"===e?"link":"card"}(null==P?void 0:P.paymentMethodType),h=(d.trips||[]).map(e=>({...e,deposit_payment_sub_type:v})),x={is_marlin_booking:!0,total_charge_amount:_,payment_method:d.payment_method,deposit_payment_sub_type:v,currency:((null==(n=w.userData)?void 0:n.currency)||"USD").toUpperCase(),paymentIntent:{payment_method_types:eD,..._>0?{setup_future_usage:ek}:{},pi_id:q.pi_id,pi_client_secret:q.client_secret},customer_details:d.customer_details,is_bs:!!e.is_MT,trips:h,deviceData:d.deviceData,tip_amount:d.tip_amount,tip_type:d.tip_type,total_amount:d.total_amount,is_full_payment:d.is_full_payment,promo_code:d.promo_code,promo_amount:d.promo_amount,consumer_addon_charge:d.consumer_addon_charge,consumer_addon_state_tax:d.consumer_addon_state_tax,meal_state_tax:d.meal_state_tax,custom_addon_state_tax:d.custom_addon_state_tax,billing_contact_data:d.billing_contact_data,cash_tip_upon_trip:d.cash_tip_upon_trip,...e.is_MT?{group_guid:y}:{}},b=!p;if(p&&(p.then(e=>{b=!0,s=e},e=>{b=!0,s={error:{message:(null==e?void 0:e.message)||"Payment was cancelled. Please try again."}}}),await Promise.resolve(),b&&(null==s?void 0:s.error)))return void tO(eT(s.error,null==P?void 0:P.paymentMethodType),{errorCode:s.error.code});let C=eF({body:x,token:u,xAppId:m});if(p&&!b&&(null==(s=await p)?void 0:s.error))return void tO(eT(s.error,null==P?void 0:P.paymentMethodType),{errorCode:s.error.code});let j=await C,N=function(e){let t=null==e?void 0:e.trip_payment_reserve_guids,l=null==e?void 0:e.booking_refs;return{...e,trip_payment_reserve_guids:Array.isArray(t)?t:t?[t]:[],booking_refs:Array.isArray(l)?l:l?[l]:[]}}((null==j?void 0:j.master_trip_reserve_guid)||(null==j?void 0:j.client_secret)?j:(null==j?void 0:j.data)||j),D=null==N?void 0:N.master_trip_reserve_guid;if(!D)return void tO("Unable to reserve trips. Please try again.");let k=(null==(i=O.current)||null==(a=i.getClientSecret)?void 0:a.call(i))||q.client_secret,S=(null==(r=O.current)||null==(o=r.getPiId)?void 0:o.call(r))||q.pi_id;if(!k)return void tO("Missing payment secret. Please reload the payment form and try again.");let A=eL;if(!(null==A?void 0:A.confirmPayment)&&!(null==A?void 0:A.confirmSetup))return void tO("Payment form is not ready. Please wait for the card form to load and try again.");let E=d.customer_details||{},T=eE({country:E.customer_country_iso_code,postalCode:(null==P?void 0:P.zipCode)||E.customer_zipcode});if(0===_){let e=await A.confirmSetup(k,T);if(null==e?void 0:e.error){tP(),tO(e.error.message||"Card setup failed. Please try again.",{errorCode:e.error.code});return}let t=null==e?void 0:e.setupIntent;await eq({masterTripReserveGuid:D,setupIntents:t?{id:t.id,object:t.object||"setup_intent"}:{id:S||q.pi_id,object:"setup_intent"},token:u,xAppId:m})}else{let e=await A.confirmPayment(k,T);if(null==e?void 0:e.error){tP(),tO(e.error.message||"Payment failed. Please try again.",{errorCode:e.error.code});return}}let R=await eH(D,{token:u,xAppId:m,intervalMs:2e3,timeoutMs:9e4});if((null==R?void 0:R.status)==="Failed"){let e,t=(R.trips||[]).find(e=>"Failed"===e.status),l="Booking failed. Please try again.";try{let n=(null==t?void 0:t.error_data)?JSON.parse(t.error_data):null;l=(null==n?void 0:n.message)||l,e=(null==n?void 0:n.code)||(null==n?void 0:n.error_code)}catch(e){}return tF(l)?void tO("Payment succeeded but booking failed on the server (PaymentMethod already used). Do not pay again â contact support with reserve id ".concat(D,".")):(tP(),void tO(l,{errorCode:e}))}if((null==R?void 0:R.status)!=="Success")return void tO("Booking is taking longer than expected. Please check your email or contact support.");let M=function(e){var t,l;let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],i=null!=(l=null==e||null==(t=e.data)?void 0:t.bookings)?l:null==e?void 0:e.bookings;if(Array.isArray(i)&&i.length>0)return i;let o=(Array.isArray(null==e?void 0:e.trips)?e.trips:[]).map(e=>
1null==e?void 0:e.payment_success_response).filter(Boolean);return o.length>0?o:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return(Array.isArray(null==e?void 0:e.trips)?e.trips:(null==e?void 0:e.trips)?[e.trips]:[]).map((e,n)=>{var a;let i=t[n]||{},o=l[n]||{},r=i.selectedRateCard||{},s=i.selectedHour||{},d=r.waiver;return{trip_guid:e.tripguid,booking_ref:e.booking_ref,short_ref:e.short_ref,charge_amount:null!=(a=o.charge_amount)?a:e.charge_amount,guest_groups:i.guest_groups||[],guideRateCard:{...r,id:r.id,rate:{...s,id:s.id},tripdate:i.selectedDay},waiver_data:d?{...d,trip_guid:e.tripguid,booking_ref:e.booking_ref}:void 0}})}(e,n,a)}(R,eu,c);if(!(null==M?void 0:M.length))return void tO("Booking completed but confirmation data was missing. Please check your email or contact support.");(e=>{window.localStorage.removeItem("cart");let t=null==e?void 0:e.map((e,t)=>{let l=eu.find(t=>{var l,n,a,i,o;return(null==t||null==(l=t.selectedRateCard)?void 0:l.id)===(null==e||null==(n=e.guideRateCard)?void 0:n.id)&&(null==t||null==(a=t.selectedHour)?void 0:a.id)===(null==e||null==(o=e.guideRateCard)||null==(i=o.rate)?void 0:i.id)})||eu[t];return l?{...e,guest_groups:l.guest_groups||[]}:e}),l=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];for(let r of Array.isArray(e)?e:e?[e]:[]){var t,l,n,a,i,o;if(!r||"object"!=typeof r)continue;let e=null!=(a=null!=(n=r.last4)?n:null==(t=r.card)?void 0:t.last4)?a:r.card_last4,s=null!=(o=null!=(i=r.brand)?i:null==(l=r.card)?void 0:l.brand)?o:r.card_brand;if(null!=e||null!=s)return{brand:null!=s?s:void 0,last4:null!=e?e:void 0}}return null}(e);((null==l?void 0:l.brand)||(null==l?void 0:l.last4))&&eQ(l),null==w||w.setCartItems([]),w.setBookingID(t),function(e){let t=tf(null==e?void 0:e.paymentMethodType),l=tC({...e,paymentMethodType:t});tj((ty[t]||tg).success,l),tj(th.success,{...l,payment_type:(null==e?void 0:e.paymentType)||t,payment_provider:"Stripe",trip_total:l.amount,deposit_paid:l.amount,environment:tN()})}({paymentMethodType:null==P?void 0:P.paymentMethodType,cartItems:eu,bookings:t,amount:tE}),f.push("/payment-confirmation")})(M)},tW=async(t,l,n)=>{let a;try{var i,o,r,s,d,u,c,p,m,_,v,h,f,x,b,j,D,k,S,A,E,T,M,I,F,q,H,L,G,O,z,W,V,U,K,Z,Q,J,X,$,ee,et,el,en,eo,er,es,ed,ec,em,ev,eg,ey,ef,ex,eC,eN,ew,eD,ek,eS,eA,eE,eT;let R={};null==g||null==(i=g.page_attributes)||i.otherDets;let eR=await (0,ei.post)("auth/loginguest",{email:w.mtemail[0],firstname:w.fname[0],lastname:w.lname[0]||"",phone:w.phone[0]},{headers:{"x-app-id":null==g||null==(o=g.page_attributes)?void 0:o.XAPPID}});a=null==eR?void 0:eR.data;let eM=null==eR?void 0:eR.status;try{window.heap.identify(null==a?void 0:a.email),window.heap.addUserProperties({...a,email:null==a?void 0:a.guest_email})}catch(e){console.log("Analytics logEvent error",e)}let eI=null==ep||null==(r=ep.total)?void 0:r.toFixed(2),eP={device:(0,B.ZQ)(),deviceVersion:String(navigator.appVersion).substring(0,3),deviceFamily:tG?"Mobile":"Web",userLocation:null,client_ip:null!=(x=null==t?void 0:t.client_ip)?x:null},eB=[],eF=eu.map((e,t)=>eu.slice(0,t).reduce((e,t)=>e+((null==t?void 0:t.totalGuests)||1),0));for(let t=0;t<eu.length;t++){let l,n=eu[t],a=(null==(b=w.checkoutQA)?void 0:b.filter(e=>{var t;return(void 0===e.ratecard_id||null===e.ratecard_id||Number(e.ratecard_id)===Number(null==(t=n.selectedRateCard)?void 0:t.id))&&void 0!==e.answer&&null!==e.answer&&("boolean"==typeof e.answer||"string"==typeof e.answer&&""!==e.answer.trim())}))||[],i="".concat(null==(j=n.selectedRateCard)?void 0:j.id,"|").concat(null==(D=n.selectedHour)?void 0:D.id,"|").concat(n.selectedDay),{promoMap:o,promoCodeMap:r,promoTripcost:s}=((0,ea.My)((0,ea.H8)(null==w||null==(k=w.promoList)?void 0:k.filter(e=>null==e?void 0:e.valid)))||[]).reduce((e,t)=>{let{code:l,amount_off:n}=t,[a,i,o]=l.split("=");return e.promoMap.set(a,n),e.promoCodeMap.set(a,i),e.promoTripcost.set(a,o),e},{promoMap:new Map,promoCodeMap:new Map,promoTripcost:new Map}),d=(null==e6?void 0:e6.reduce((e,t)=>{var l;let n=null==(l=t.promo_bookings)?void 0:l.find(e=>e.id===i);return n?e+(n.promo_amount||0):e},0))||0,u=null==eO?void 0:eO.find(e=>e.uniqueID===i);(null==n?void 0:n.guestCount)&&Object.values(null==n?void 0:n.guestCount).reduce((e,t)=>
1e+t,0);let c=tk(u,null==(S=n.selectedRateCard)?void 0:S.addon_fees),p=tA(u,null==(A=n.selectedRateCard)?void 0:A.addon_fees),m=tS(u,null==(E=n.selectedRateCard)?void 0:E.addon_fees,n),_=c+((null==eh||null==(T=eh.find(e=>"STATE_FEE"===e.type&&e.uniqueID===i))?void 0:T.charge_price)||0)+p+m;if((null==n?void 0:n.product_type)==="course"){let e=parseFloat(n.course_cost)*n.quantity,t=Number((null==eu?void 0:eu.length)>1?(null==(eE=cartPromo.filter(e=>e.ratecard_id===Number(n.course_id)))||null==(eA=eE[0])?void 0:eA.amount_off)||0:null==w?void 0:w.promoAmt);l=e-t}else l=(null==w?void 0:w.paytype)==="partial"?(null==u?void 0:u.chargeToday)!=null?Number(u.chargeToday):0:(null==u?void 0:u.total)!=null?Number(u.total):0;let v={...(null==n||null==(M=n.selectedRateCard)?void 0:M.charity_ratecard)&&{charity_booking:null==n||null==(I=n.selectedRateCard)?void 0:I.charity_ratecard},guideguid:(null==n?void 0:n.product_type)==="course"?null==g?void 0:g.guideguid:e.is_MT?(null==n?void 0:n.guideguid)?null==n?void 0:n.guideguid:null:n.selectedRateCard.is_referral?null==n?void 0:n.refferal_guide_guid:n.selectedRateCard.guideguid,referral_guideguid:(null==n||null==(F=n.selectedRateCard)?void 0:F.is_referral)?null==g?void 0:g.guideguid:null,boatguid:(null==n?void 0:n.boatguid)?null==n?void 0:n.boatguid:null,date:C()().format("YYYY-MM-DD"),tripdate:null==n?void 0:n.selectedDay,starttime:(null==n?void 0:n.product_type)==="course"?null:C()(null==n||null==(q=n.selectedHour)?void 0:q.start_time,["HH:mm:ss"]).format("h:mm a"),triptype:null==n||null==(H=n.selectedRateCard)?void 0:H.ratetype,tripcost:(null==n?void 0:n.product_type)==="course"?(parseFloat(n.course_cost)*n.quantity).toFixed(2):((null==u?void 0:u.ratecard_total)||0)-((null==ep?void 0:ep.tip)||0)-((null==u?void 0:u.consumerAddOn)||0)-((null==u?void 0:u.meals)||0),bookingrate:(null==n?void 0:n.product_type)==="course"?(parseFloat(n.course_cost)*n.quantity).toFixed(2):"".concat(null==n||null==(L=n.selectedHour)?void 0:L.rate),guidegear:!0,currency:(null==(G=w.userData)?void 0:G.currency)||"usd",secondperson:(null==n?void 0:n.totalGuests)>1,guestcount:null==n?void 0:n.totalGuests,poiguid:(null==n?void 0:n.meeting_spot)||null,promo_codes:(()=>{var e,t,l,n,a,o,r,s,d,u,c;let p=[];if((null==eu?void 0:eu.length)>1){let e=null==(a=(0,ea.H8)(null==w||null==(r=w.promoList)||null==(o=r.filter(e=>null==e?void 0:e.valid))?void 0:o.filter(e=>{var t,l;return(null==e||null==(l=e.promo_bookings)||null==(t=l[0])?void 0:t.id)===i})))?void 0:a[0];if(e){let t=null==(s=e.promo_bookings)?void 0:s.find(e=>e.id===i);p.push({promo_code:e.code,promo_amount:(null==t?void 0:t.promo_amount)||e.amount_off||0,is_stripe_promo:e.is_promo||!1,promo_id:e.id||null,amount_off:e.is_promo?e.amount_off:null,percent_off:e.percent_off||null,is_gift:!1})}}else if((null==(t=w.promo)||null==(e=t.response)?void 0:e.code)&&!(null==(n=w.promo)||null==(l=n.response)?void 0:l.is_gift)){let e=null==(d=w.promo)?void 0:d.response,t=null==(c=w.promo)||null==(u=c.promo_details)?void 0:u.find(e=>e.id===i);p.push({promo_code:e.code,promo_amount:(null==t?void 0:t.promo_amount)||e.amount_off||0,is_stripe_promo:e.is_promo||!1,promo_id:e.id||null,amount_off:e.is_promo?e.amount_off:null,percent_off:e.percent_off||null,is_gift:!1})}return null==e6||e6.forEach(e=>{var t;let l=null==(t=e.promo_bookings)?void 0:t.find(e=>e.id===i);l&&e.code&&l.promo_amount>0&&p.push({promo_code:e.code,promo_amount:l.promo_amount,is_stripe_promo:!1,promo_id:e.id||null,amount_off:l.promo_amount,percent_off:null,is_gift:!0})}),p})(),promo_amount:(null==eu?void 0:eu.length)>1?((null==(z=(0,ea.H8)(null==w||null==(V=w.promoList)||null==(W=V.filter(e=>null==e?void 0:e.valid))?void 0:W.filter(e=>{var t,l;return(null==e||null==(l=e.promo_bookings)||null==(t=l[0])?void 0:t.id)===i})))||null==(O=z[0])?void 0:O.amount_off)||0)+d:null==w?void 0:w.promoAmt,new_trip_cost:(null==eu?void 0:eu.length)>1?null==(K=(0,ea.H8)(null==w||null==(Q=w.promoList)||null==(Z=Q.filter(e=>null==e?void 0:e.valid))?void 0:Z.filter(e=>{var t,l;return(null==e||null==(l=e.promo_bookings)||null==(t=l[0])?void 0:t.id)===i})))||null==(U=K[0])?void 0:U.trip_cost:(null==ep?void 0:ep.total_trip_amount)-((0,ea.ZU)(g)?0:_),...(null==n||null==(J=n.selectedRateCard)?void 0:J.is_course)&&{is_padi_course:!0,sku:null==n||null==(X=n.selectedRateCard)?void 0:X.sku,consumer_birthday:(null==w?void 0:w.birthday[0])||""},fishingType:null==n||null==($=n.selectedRateCard)?void 0:$.ratetype,rateCardId:(null==n?void 0:n.product_type)==="course"?null==n?void 0:n.course_id:null==n||null==(ee=n.selectedRateCard)?void 0:ee.id,hourCardId:null==n||null==(et=n.selectedHour)?void 0:et.id,origin,guide_addon_fees:null==n||null==(eo=n.selectedRateCard)||null==(en=eo.addon_fees)||null==(el=en.filter(e=>e.active))?void 0:el.map(e=>({...e,guidesly_take:"STATE_FEE"!==e.type})),waiver_id:(null==n||null==(es=n.selectedRateCard)||null==(er=es.waiver)?void 0:er.id)||null,consumer_add_on:null==eb||null==(ed=eb.filter(e=>e.qty>0&&e.uniqueId===i))?void 0:ed.flatMap(e=>{let{uniqueId:t,_guestKey:l,guestIndex:n,selected_options:a,...i}=e,o=null==ej?void 0:ej.find(e=>e.uniqueId===t&&e.id===i.id);return(null==a?void 0:a.length)>0?a.map(e=>{let t=(e||[]).map(e=>{var t;let l=null==o||null==(t=o.addon_options)?void 0:t.find(t=>
1t.guid===e.guid);return{guid:e.guid,type:(null==l?void 0:l.title)||"",option:e.value}}).filter(e=>e.option);return{id:i.id,quantity:1,addon_options:t}}):[{id:i.id,quantity:i.qty,addon_options:[]}]}),consumer_addon_charge:null==u?void 0:u.consumerAddOn,consumer_addon_state_tax:Number(c),meal_state_tax:Number(p),custom_addon_state_tax:Number(m),add_on_charges:(null==u?void 0:u.add_on_fees)+Number(c.toFixed(2))+Number(m.toFixed(2)),charge_amount:(null==n||null==(ec=n.selectedRateCard)?void 0:ec.charity_ratecard)?Number(l||0).toFixed(2):(null==n?void 0:n.product_type)==="course"?(parseFloat(n.course_cost)*n.quantity).toFixed(2):(null==w?void 0:w.paytype)==="partial"?null==u?void 0:u.chargeToday:null==u?void 0:u.total,...(null==w||null==(ev=w.mealFees)||null==(em=ev.filter(e=>e.uniqueId===i))?void 0:em.length)>0&&{meal_items:null==w||null==(eg=w.mealFees)?void 0:eg.filter(e=>e.uniqueId===i)},bs_affiliate_data:(null==n||null==(ey=n.selectedRateCard)?void 0:ey.is_referral)?{group_guid:null==n?void 0:n.bs_group_guid}:void 0,need_equipment:N&&((null==g||null==(ef=g.page_attributes)?void 0:ef.guestEquipment)===!0||(null==g||null==(ex=g.page_attributes)?void 0:ex.guestEquipment)===void 0)?w.needEquipments:null,tip_amount:null==ep?void 0:ep.tip,...(null==n?void 0:n.product_type)==="course"&&{course_id:null==n?void 0:n.course_sku,quantity:null==n?void 0:n.quantity,guestcount:1,consumer_birthday:(null==w?void 0:w.birthday[0])||""},...(null==a?void 0:a.length)>0&&{trip_questionnaire:{questionnaire:a}},medical_notes:(null===B.SS||void 0===B.SS?void 0:B.SS.includes(null==P?void 0:P.zipCode))||(null==g||null==(eC=g.page_attributes)?void 0:eC.medicalInsights)!==!0?null:null==w?void 0:w.medicalInsights,guest_data:{guest_data:Array.from({length:(null==n?void 0:n.totalGuests)||1},(e,l)=>{var a,i,o,r,s,d,u,c,p,m,_,v;let h=e7?l:((null==eF?void 0:eF[t])||0)+l,y="".concat(null==(a=n.selectedRateCard)?void 0:a.id,"|").concat(null==(i=n.selectedHour)?void 0:i.id,"|").concat(n.selectedDay,"|guest_").concat(l),f=eb.filter(e=>e._guestKey===y&&e.qty>0).flatMap(e=>{var t,l;let n=ej.find(t=>t.uniqueId===e.uniqueId&&t.id===e.id);return n?(null==(t=e.selected_options)?void 0:t.length)>0?e.selected_options.map(e=>{var t;return{id:n.id,quantity:1,charge_amount:parseFloat(n.charge_value)||0,category:n.category||"consumer_addon",title:n.title,description:n.description||n.title,type:"CONSUMER_ADDON_FEE",duration:n.duration,fee_applicability:null==(t=n.fee_applicability)||t,assignment_scope:n.assignment_scope||"guest",addon_options:(e||[]).map(e=>{var t;let l=null==(t=n.addon_options)?void 0:t.find(t=>t.guid===e.guid);return{guid:e.guid,type:(null==l?void 0:l.title)||"",option:e.value}}).filter(e=>e.option)}}):[{id:n.id,quantity:e.qty,charge_amount:parseFloat(n.charge_value)||0,category:n.category||"consumer_addon",title:n.title,description:n.description||n.title,type:"CONSUMER_ADDON_FEE",duration:n.duration,fee_applicability:null==(l=n.fee_applicability)||l,assignment_scope:n.assignment_scope||"guest",addon_options:[]}]:[]});return{is_primary:0===l,customer_firstname:null==(o=w.fname)?void 0:o[h],customer_lastname:null==(r=w.lname)?void 0:r[h],customer_phone:(null==(s=w.phoneNumber)?void 0:s[h])?String(w.phoneNumber[h]).replace(/\D+/g,"").slice(-10):"",customer_country_phone_code:(null==(d=w.phoneNumber)?void 0:d[h])?"+"+(0,Y.lq)(String(w.phoneNumber[h])).countryCallingCode:"",customer_country_iso_code:(null==(u=w.phoneNumber)?void 0:u[h])?null==(c=(0,Y.lq)(String(w.phoneNumber[h])))?void 0:c.country:"",customer_email:(null==(p=w.mtemail)?void 0:p[h])||"",consumer_birthday:(null==g||null==(m=g.page_attributes)?void 0:m.requestAge)===!0||(null==g||null==(_=g.page_attributes)?void 0:_.requestAge)===void 0?null==w||null==(v=w.birthday)?void 0:v[h]:"",guest_add_on:f}})},...(null==n||null==(eN=n.selectedHour)?void 0:eN.link_rates)&&(null==n||null==(eD=n.selectedHour)||null==(ew=eD.link_rates)?void 0:ew.length)>0&&{link_rates:{applied_rates:null==n||null==(eS=n.selectedHour)||null==(ek=eS.link_rates)?void 0:ek.map(e=>({id:null==e?void 0:e.id,booked_seat:(null==n?void 0:n.totalGuests)||1}))}},guest_groups:(null==n?void 0:n.guest_groups)||[]};eB.push(v)}let eq=(null==eu||null==(s=eu.filter(e=>(null==e?void 0:e.product_type)==="course"))?void 0:s.map(e=>parseFloat(e.course_cost)*e.quantity)).reduce((e,t)=>
1e+t,0),eY={customer_firstname:w.fname[0],customer_lastname:w.lname[0],customer_phone:String(w.phoneNumber[0]).replace(/\D+/g,"").slice(-10),customer_country_phone_code:"+"+(0,Y.lq)(String(w.phoneNumber[0])).countryCallingCode,customer_country_iso_code:null==(d=(0,Y.lq)(String(w.phoneNumber[0])))?void 0:d.country,customer_email:w.mtemail[0],customer_zipcode:null==w?void 0:w.zipCode,consumer_birthday:(null==g||null==(u=g.page_attributes)?void 0:u.requestAge)===!0||(null==g||null==(c=g.page_attributes)?void 0:c.requestAge)===void 0?null==w||null==(p=w.birthday)?void 0:p[0]:"",notes:(null==g||null==(m=g.page_attributes)?void 0:m.notesBox)===!0||(null==g||null==(_=g.page_attributes)?void 0:_.notesBox)===void 0?null==w?void 0:w.notes:""};if(R.cash_tip_upon_trip=w.tipamount&&"uponCash"===w.tipamount,R.charge_amount=eB.reduce((e,t)=>e+parseFloat(t.charge_amount||0),0).toFixed(2),R.deviceData=eP,R.payment_method=l,R.tip_amount=null==ep?void 0:ep.tip,R.total_amount=(parseFloat((eq||0).toFixed(2))+parseFloat(eI)).toFixed(2),R.trips=eB,R.customer_details=eY,R.billing_contact_data=(null==(v=w.contactInfo)?void 0:v.name)?{contact_name:w.contactInfo.name,contact_email:w.contactInfo.email,contact_phone:w.contactInfo.phone,is_primary:w.contactInfo.usePrimaryGuest||!1}:null,R.tip_type=w.tipType||null,R.is_full_payment=(null==w?void 0:w.paytype)!=="partial",R.promo_code=(null==(f=w.promo)||null==(h=f.response)?void 0:h.code)||"",R.promo_amount=null==w?void 0:w.promoAmt,R.consumer_addon_charge=e_,R.consumer_addon_state_tax=Number(eX),R.meal_state_tax=Number(e2),R.custom_addon_state_tax=Number(e0),(null===B.SS||void 0===B.SS?void 0:B.SS.includes(null==P?void 0:P.zipCode))||(null==g||null==(eT=g.page_attributes)?void 0:eT.medicalInsights)===!0&&(R.trips.medical_notes=null==w?void 0:w.medicalInsights),e.is_MT&&(R.is_bs=e.is_MT,R.group_guid=y),n||w.setUserToken(null==a?void 0:a.token),200!==eM)return void tO("Something went wrong. Please try again");await tz({formData:R,customerToken:null==a?void 0:a.token,tripPayloads:eB,submitPromise:n})}catch(e){console.error("Payment error",e),"string"==typeof e||(null==e?void 0:e.response)?tO(e):(null==e?void 0:e.message)?tO(e.message):tO("Something went wrong. Please try again"),tm(e instanceof Error?e:Error(String(e)),tb())}finally{n&&(null==a?void 0:a.token)&&w.setUserToken(a.token),R(!1)}};return(0,n.jsx)(n.Fragment,{children:e.is_MT?(0,n.jsx)(td,{...e,sameGuestDetailsForAllTrips:e7,setSameGuestDetailsForAllTrips:te,validation:A,setValidation:E,cardDetails:P,setCardDetails:F,cardErrors:M,qaError:W,setCardErrors:I,setQaError:V,handlePayment:tq,paymentOngoing:T,status:U,errorMsg:Z,birthdayCheck:b,pastDateError:J,setPastDateError:X,pastRatecardsLen:$,pastRatecards:et,setPastRatecardsLen:ee,paymentElementsRef:O,piChargeAmount:tE,piChargeReady:tT,paymentIntentKe
1y:tI,onPaymentIntentReady:H,onPaymentElementComplete:G}):(0,n.jsx)(tu,{...e,sameGuestDetailsForAllTrips:e7,setSameGuestDetailsForAllTrips:te,validation:A,setValidation:E,cardDetails:P,setCardDetails:F,cardErrors:M,qaError:W,setQaError:V,setCardErrors:I,handlePayment:tq,paymentOngoing:T,status:U,errorMsg:Z,birthdayCheck:b,pastDateError:J,setPastDateError:X,pastRatecardsLen:$,pastRatecards:et,setPastRatecardsLen:ee,paymentElementsRef:O,piChargeAmount:tE,piChargeReady:tT,paymentIntentKey:tI,onPaymentIntentReady:H,onPaymentElementComplete:G})})};var tD=l(62867),tk=!0;let tS=e=>{var t,l,r;let{guideDetails:p,domain:_}=e,[v,g]=(0,a.useState)(!1),[h,y]=(0,a.useState)(null),[f,x]=(0,a.useState)(c.Bd&&window.innerWidth<=834),b=(0,a.useContext)(m.A),[C,j]=(0,a.useState)(!1);(0,a.useEffect)(()=>{if(c.Bd)return(0,i.loadStripe)(s().stripeKey).then(y),j(!0),window.addEventListener("resize",N),()=>{window.removeEventListener("resize",N)}},[]);let N=()=>{c.Bd&&window.innerWidth<=834?x(!0):x(!1)};(0,a.useEffect)(()=>{if(c.Bd){g(!0),["#PageNavbarBtn","#PageNavbarHeader","#PageFooter","#checkoutHeading"].forEach(e=>{let t=document.querySelector(e);t&&(t.style.display="none")});let e=document.querySelector("#ratefooter");e&&(e.style.marginBottom="0px")}return()=>{if(c.Bd&&C){var e,t,l;["#PageNavbarHeader","#PageFooter","#checkoutHeading"].forEach(e=>{let t=document.querySelector(e);t&&(t.style.display="#checkoutHeading"===e?"block":"flex")});let n=document.querySelector("#ratefooter");n&&(n.style.marginBottom="60px"),!c.Bd||(null==p||null==(e=p.page_attributes)?void 0:e.is_mt)||(null==p||null==(t=p.page_attributes)?void 0:t.template)!==void 0&&(null==p||null==(l=p.page_attributes)?void 0:l.template)!=="Classic"||(window.localStorage.removeItem("cart"),null==b||b.setCartItems([]))}}},[C]);let w=(null==p||null==(t=p.page_attributes)?void 0:t.is_mt)?u.default:d.default;return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(tD.bV,{nofollow:!0,noindex:!0,title:"Checkout-page"}),(0,n.jsx)(w,{zendeskDomain:_,title:null==p?void 0:p.title,guideDetails:p,windowAvail:v,siteurl:s().siteurl,slug:(null==p||null==(l=p.page_attributes)?void 0:l.is_mt)?"rates":null,children:(0,n.jsx)(o.Elements,{stripe:h,children:C&&(0,n.jsx)(tw,{...e,is_MT:null==p||null==(r=p.page_attributes)?void 0:r.is_mt,isNarrow:f,companyGuid:null==p?void 0:p.group_guid})})})]})}},7078:e=>{e.exports={mealsContainer:"meals_mealsContainer__TOuig",narrow:"meals_narrow__YtOOs",wide:"meals_wide__5NxqF",meals_container:"meals_meals_container__ghJeu",rcdescription:"meals_rcdescription__A7Ac5",meals_container_img:"meals_meals_container_img__Ay_td",meals_container_price:"meals_meals_container_price__ovk8_",mealsTitle:"meals_mealsTitle__t9wwK",overallSummary:"meals_overallSummary__68Vib",overallSummaryText:"meals_overallSummaryText__VG5ZU",rateCardContainer:"meals_rateCardContainer__KVDCW",nonMt:"meals_nonMt__CMSKl",tripSection:"meals_tripSection__v0qmj",tripTitle:"meals_tripTitle__zCW64",mealSummary:"meals_mealSummary__mOMEa",summaryRow:"meals_summaryRow__cn6QN",summaryLabel:"meals_summaryLabel__j3qWj",summaryValue:"meals_summaryValue__0UKVI",summaryPrice:"meals_summaryPrice__PpZtS",summaryBreakdown:"meals_summaryBreakdown__8oVum",allLimitsReached:"meals_allLimitsReached__30uiL",summaryText:"meals_summaryText__bEGGc",limitReached:"meals_limitReached__x0MWi",maxReachedText:"meals_maxReachedText__9nHNW",categorySection:"meals_categorySection__mgnG4",menuItem:"meals_menuItem__lk_Q0",categoryHeader:"meals_categoryHeader__2dmZw",outOfStock:"meals_outOfStock__HH3rV",quantityControls:"meals_quantityControls__n8bzn",quantityPrice:"meals_quantityPrice__94YIK",guestLimit:"meals_guestLimit__KN0l6",itemImage:"meals_itemImage__id_Nn",itemDetails:"meals_itemDetails__IX9c3",itemTitle:"meals_itemTitle__HwSYQ",itemDescription:"meals_itemDescription__DRN_B",truncatedContainer:"meals_truncatedContainer__G4iqt",truncatedText:"meals_truncatedText__fuNgH",readMoreButton:"meals_readMoreButton__EEfsS",disabledButton:"meals_disabledButton__3oI7K",clampedText:"meals_clampedText__wzp0u",unclampedText:"meals_unclampedText__YbP1R",readMoreBtn:"meals_readMoreBtn__IAZWc",readMoreBtnmt:"meals_readMoreBtnmt__ip7rh"}},8714:(e,t,l)=>{"use strict";l.r(t),l.d(t,{default:()=>f});var n=l(37876),a=l(14232),i=l(18847),o=l.n(i);l(32501);var r=l(5016),s=l(14e3),d=l(52804),u=l(6155),c=l(45105),p=l.n(c);let m=o()(()=>l.e(8438).then(l.bind(l,28438)),{loadableGenerated:{webpack:()=>[28438]},ssr:!0}),_=o()(()=>Promise.all([l.e(4587),l.e(8345)]).then(l.bind(l,98345)),{loadableGenerated:{webpack:()=>[98345]},ssr:!0}),v=o()(()=>Promise.all([l.e(4587),l.e(9740)]).then(l.bind(l,9740)),{loadableGenerated:{webpack:()=>[9740]},ssr:!0}),g=o()(()=>l.e(1854).then(l.bind(l,1854)),{loadableGenerated:{webpack:()=>[1854]},ssr:!1}),h=o()(()=>l.e(7321).then(l.bind(l,97321)),{loadableGenerated:{webpack:()=>[97321]},ssr:!1}),y=o()(()=>Promise.all([l.e(9820),l.e(1631),l.e(115),l.e(440),l.e(6149),l.e(5426),l.e(9332),l.e(5190),l.e(7392),l.e(9956),l.e(680)]).then(l.bind(l,99956)),{loadableGenerated:{webpack:()=>[99956]},ssr:!0});function f(e){var t,l,i,o,c,f,x,b;let{children:C,windowAvail:j,guideDetails:N,zendeskDomain:w}=e,D=d.Bd&&(/Mobi|Android|iPad|iPhone|iPod/i.test(navigator.userAgent)||window.innerWidth<=600||600>=((window.screen||{}).width||0)),[k,S]=(0,a.useState)(null),A=(null==N||null==(t=N.page_attributes)?void 0:t.template)==="Modern";(0,s.useRouter)(),(0,a.useEffect)(()=>{let e=window.location.pathname;S(e);let t=document.getElementById("launcher");(null==e?void 0:e.includes("checkout"))?t&&t.style&&(t.style.display="none"):t&&t.style&&(t.style.display="block")},[j]),(0,a.useContext)(u.A);let E=d.Bd&&(null==(i=window)||null==(l=i.location)?void 0:l.href)||"";D&&["about","rates","guide","captain"].some(e=>null==E?void 0:E.includes(e));let T=null==N||null==(c=N.page_attributes)||null==(o=c.pageSlugs)?void 0:o.filter(e=>e.seoURL===(null==k?void 0:k.replace("/","")));return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("div",{className:k&&"/"===k?r.container:r.container1,children:[(0,n.jsx)(m,{guideDetails:N,windowAvail:j}),(0,n.jsx)(y,{children:(0,n.jsx)("div",{className:k&&"/"===k?"":(null==N||null==(f=N.page_attributes)?void 0:f.template)==="Modern"&&(null==N||null==(x=N.fishing_report)?void 0:x.auto_generated)&&(null==k?void 0:k.includes("reports"))&&(null==k||null==(b=k.split("/"))?void 0:b.length)>2?"full_layout reports_layout":"full_layout ".concat((null==T?void 0:T.length)===1?"custom_full_layout":""),children:C})}),(0,n.jsx)(h,{children:(0,n.jsx)(g,{zendeskDomain:w,guideDetails:N})}),A&&(0,n.jsx)(_,{guideDetails:N}),!A&&(0,n.jsx)(v,{guideDetails:N})]}),(0,n.jsx)(p(),{defer:!0,id:"heap-analytics",strategy:"lazyOnload",dangerouslySetInnerHTML:{__html:'\n if ( !window?.heap) {\n window.heap=window.heap||[],heap.load=function(e,t){window.heap.appid=e,window.heap.config=t=t||{};var r=document.createElement("script");r.type="text/javascript",r.async=!0,r.src="https://cdn.heapanalytics.com/js/heap-"+e+".js";var a=document.getElementsByTagName("script")[0];a.parentNode.insertBefore(r,a);for(var n=function(e){return function(){heap.push([e].concat(Array.prototype.slice.call(arguments,0)))}},p=["addEventProperties","addUserProperties","clearEventProperties","identify","resetIdentity","removeEventProperty","setEventProperties","track","unsetEventProperty"],o=0;o<p.length;o++)heap[p[o]]=n(p[o])};\n heap.load("1840371152");\n }\n '}}),["www.earlybirdcharters.com"].includes(w)?(0,n.jsx)(p(),{defer:!0,strategy:"afterInteractive",dangerouslySetInnerHTML:{__html:"var dpwdrsid = 'sHFWYmDaIq';\n var dpwdrsextid = '63120c6e';\n var __ibaseUrl = (('https:' == document.location.protocol) ? 'https://data.processwebsitedata.com' : 'http://data.processwebsitedata.com');\n (function () {\n var va = document.createElement('script'); va.type = 'text/javascript'; va.async = true;\n va.src = __ibaseUrl + '/cscripts/' + dpwdrsid + '-' + dpwdrsextid + '.js';\n var sv = document.getElementsByTagName('script')[0]; sv.parentNode.insertBefore(va, sv);\n })();"}}):null]})}},14445:(e,t,l)=>{"use strict";l.r(t),l.d(t,{default:()=>b});var n=l(37876),a=l(14232),i=l(18847),o=l.n(i),r=l(52804),s=l(14e3),d=l(32501),u=l(58444),c=l(5016),p=l(16079),m=l(90680),_=l(35061),v=l(6155),g=l(39853);let h=o()(()=>l.e(4371).then(l.bind(l,34371)),{loadableGenerated:{webpack:()=>[34371]},ssr:!0}),y=o()(()=>Promise.all([l.e(9820),l.e(1631),l.e(4587),l.e(3266),l.e(2176)]).then(l.bind(l,22176)),{loadableGenerated:{webpack:()=>[22176]},ssr:!0}),f=o()(()=>Promise.all([l.e(3596),l.e(8094),l.e(9820),l.e(1631),l.e(3716),l.e(1104),l.e(4587),l.e(2999),l.e(5130),l.e(1862),l.e(870),l.e(5349),l.e(295)]).then(l.bind(l,76183)),{loadableGenerated:{webpack:()=>[76183]},ssr:!1}),x=o()(()=>Promise.all([l.e(9820),l.e(1631),l.e(115),l.e(440),l.e(6149),l.e(5426),l.e(9332),l.e(5190),l.e(7392),l.e(9956)]).then(l.bind(l,99956)),{loadableGenerated:{webpack:()=>[99956]},ssr:!0});function b(e){var t,l,i,o,b;let{children:C,windowAvail:j,guideDetails:N,slug:w}=e,[D,k]=(0,a.useState)(""),[S,A]=(0,a.useState)(!1),E=(0,a.useRef)(null),[T,R]=(0,a.useState)("trip-details"),M=(0,s.useRouter)(),I=(0,m.D)(),P=(0,a.useContext)(v.A),B=(0,a.useContext)(g.A),F=I&&!window.location.href.includes("rates")&&!window.location.href.includes("trips")&&!window.location.href.includes("checkout"),q=()=>{var e,t,l,n;null==P||null==(e=P.setSelectedDay)||e.call(P,""),null==P||null==(t=P.setSelectedRateCard)||t.call(P,{}),null==P||null==(l=P.setSelectedHour)||l.call(P,{}),null==B||null==(n=B.setTripDate)||n.call(B,"")};(0,a.useEffect)(()=>{var e,t,l,n,a,i,o,s,d,u,c,p,m,v,g,h;r.Bd&&N&&(null==N||null==(e=N.page_attributes)?void 0:e.reportToggle)==!1&&(null==(n=window)||null==(l=n.location)||null==(t=l.pathname)?void 0:t.includes("reports"))&&(null==(u=window)||null==(d=u.location)||null==(s=d.pathname)?void 0:s[(null==(o=window)||null==(i=o.location)||null==(a=i.pathname)?void 0:a.length)-2])!="s"&&(k("/"),(0,_.QF)(M,"/")),r.Bd&&N&&(null==N||null==(c=N.page_attributes)?void 0:c.enableSpecies)==!1&&(null==(h=window)||null==(g=h.location)||null==(v=g.pathname)?void 0:v.includes(null==N||null==(m
1=N.seo_snippets)||null==(p=m.s150_species_url)?void 0:p.toLowerCase()))&&(k("/"),(0,_.QF)(M,"/"))},[N,r.Bd]);let Y=e=>{S&&E.current&&!E.current.contains(e.target)&&(A(!1),R("trip-details"),q())};return(0,a.useEffect)(()=>(document.addEventListener("mousedown",Y),()=>{document.removeEventListener("mousedown",Y)}),[S]),(0,a.useEffect)(()=>{d.A.initialize("1840371152")},[]),(0,a.useEffect)(()=>{k(r.Bd&&window.location.pathname)},[j]),(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("div",{className:c.container,children:[(0,n.jsx)(h,{guideDetails:N,windowAvail:j}),(0,n.jsx)(x,{children:(0,n.jsx)("div",{className:"".concat((null==C||null==(t=C.props)?void 0:t.slugID)||w?"bs__layout":(null==N||null==(l=N.fishing_report)?void 0:l.auto_generated)&&(null==D?void 0:D.includes("reports"))&&(null==D||null==(i=D.split("/"))?void 0:i.length)>2?"bs__home__layout report__layout":"bs__home__layout"),isMT:null==N||null==(o=N.page_attributes)?void 0:o.is_mt,children:C})}),(0,n.jsx)(y,{guideDetails:N})]}),(0,n.jsxs)("div",{className:"".concat(p.widgetModal," ").concat(S?p.open:""),ref:E,children:[F?(0,n.jsx)("button",{onClick:()=>{A(!S)},className:"build_my_trip ".concat(u.opac__booknow__button," ").concat((null==N||null==(b=N.page_attributes)?void 0:b.mt_theme)==="mt_dark_theme"?"".concat(u.dark_button):"".concat(u.light_button)),children:(0,n.jsx)("span",{children:"Build My Trip"})}):null,(0,n.jsx)("div",{className:"".concat(p.widgetWindow," ").concat(S?p.open:""),children:(0,n.jsxs)("div",{className:p.widgetHeader,children:[(0,n.jsx)("span",{className:p.closebtn,onClick:()=>{A(!1),R("trip-details"),q()},children:"\xd7"}),I?(0,n.jsx)(f,{companyId:null==N?void 0:N.group_guid,isOpen:S,setIsOpen:A,guideDetails:N,stepper:T,setStepper:R}):null]})})]})]})}},16079:e=>{e.exports={widgetModal:"payment_widget_widgetModal__qYX9n",widgetWindow:"payment_widget_widgetWindow__BmQXq",open:"payment_widget_open__fs8fR",widgetContainer:"payment_widget_widgetContainer__PacTY",widgetHeader:"payment_widget_widgetHeader__DsxLj",closebtn:"payment_widget_closebtn__9ro2D",upBtn:"payment_widget_upBtn__QnAo_",widgetBody:"payment_widget_widgetBody__tjCyD",slideInRight:"payment_widget_slideInRight__m8fTc",slideinright:"payment_widget_slideinright__oHfxb",slideInLeft:"payment_widget_slideInLeft__kIvew",slideinleft:"payment_widget_slideinleft__MHVju",title:"payment_widget_title__mabJa",loader:"payment_widget_loader__k09gC",shadowPulse:"payment_widget_shadowPulse__OZ4eT",noTrips:"payment_widget_noTrips__V_8uq",rcContainer:"payment_widget_rcContainer__mX9HL",rcDescription:"payment_widget_rcDescription__VcE7A",rcTitle:"payment_widget_rcTitle__3Xa7F",rcDesc:"payment_widget_rcDesc__naFg1",rcButton:"payment_widget_rcButton__TkwhG",TimeSlot:"payment_widget_TimeSlot__0gluZ",TimeSlotMoon:"payment_widget_TimeSlotMoon__hIeF0",TimeSlotSun:"payment_widget_TimeSlotSun__K6VU7",tripCharge:"payment_widget_tripCharge__smXDl",SelectedTimeSlot:"payment_widget_SelectedTimeSlot__kruSb",disabledTimeSlot:"payment_widget_disabledTimeSlot__KLlnq",TimeSlotContainer:"payment_widget_TimeSlotContainer__H0DWC",DateSlotContainer:"payment_widget_DateSlotContainer__opxzb",tripTime:"payment_widget_tripTime__spn9b",tripDuration:"payment_widget_tripDuration__XHG8y",tripIcons:"payment_widget_tripIcons__A0STe",SelectionTitle:"payment_widget_SelectionTitle__6NRWX",selectionContainer:"payment_widget_selectionContainer__9wgaI",SelectionCard:"payment_widget_SelectionCard__6N1SV",MTSelected:"payment_widget_MTSelected__13iiB",SelectiontextCont:"payment_widget_SelectiontextCont__z_Pp3",SelectionIcon:"payment_widget_SelectionIcon__sea0Z",SelectFirstAvailable:"payment_widget_SelectFirstAvailable__msbUS",SelectionPic:"payment_widget_SelectionPic___bHyn",Selectiontext:"payment_widget_Selectiontext__p5d6a",guideSelection:"payment_widget_guideSelection__gh6iX",widgetButton:"payment_widget_widgetButton__ROmxP",tripSummarySection:"payment_widget_tripSummarySection__nF8Bm",openSummary:"payment_widget_openSummary__rYHtB",closeSummary:"payment_widget_closeSummary__VJXj0",tripDesc:"payment_widget_tripDesc__51eNC",tripSummarytitle:"payment_widget_tripSummarytitle__E7O8U",tripSummaryTitleSection:"payment_widget_tripSummaryTitleSection__KolmU",spaceBetween:"payment_widget_spaceBetween__XKFH6",subtitle2:"payment_widget_subtitle2__E0oO_",bold:"payment_widget_bold__bRtNI",divider:"payment_widget_divider__a8sPa",TimeSelector:"payment_widget_TimeSelector__LBOnW",rcList:"payment_widget_rcList__Zj4Wu",tripDate:"payment_widget_tripDate__QdIJ5",shimmer:"payment_widget_shimmer__CYtcp",Shimmer:"payment_widget_Shimmer__kWh8S"}},28142:(e,t,l)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/checkout",function(){return l(5906)}])},30529:(e,t,l)=>{"use strict";l.r(t),l.d(t,{default:()=>s});var n=l(37876),a=l(14232),i=l(56557),o=l.n(i);let r=a.lazy(()=>Promise.all([l.e(5250),l.e(6632)]).then(l.t.bind(l,39200,23))),s=e=>{let{mindate:t,maxdate:l,selectedValue:i,handleChange:s,handleHover:d,monthChange:u,excludeddates:c,monthsDisplay:p,style:m,disabled:_,useCustomHeader:v=!1}=e;return(0,n.jsxs)("div",{className:"datepicker-wrapper",children:[_&&(0,n.jsx)("div",{className:m.DatePickerDisabled}),(0,n.jsx)(a.Suspense,{children:(0,n.jsx)(r,{inline:!0,disabled:_||!1,minDate:t,maxDate:l,selected:i,onChange:e=>{s(e)},...d?{onDayMouseEnter:e=>d(e)}:{},...u?{onMonthChange:e=>u(e)}:{},...v?{renderCustomHeader:e=>{let{date:t,decreaseMonth:l,increaseMonth:a,prevMonthButtonDisabled:i,nextMonthButtonDisabled:r}=e;return(0,n.jsxs)("div",{className:"custom-datepicker-header",children:[(0,n.jsxs)("button",{onClick:l,disabled:i,className:"custom-datepicker-nav-button",children:[(0,n.jsx)("span",{className:"left-triangle"}),o()(t).subtract(1,"month").format("MMMM")]}),(0,n.jsx)("span",{className:"custom-datepicker-current-month",children:o()(t).format("MMMM YYYY")}),(0,n.jsxs)("button",{onClick:a,disabled:r,className:"custom-datepicker-nav-button",children:[o()(t).add(1,"month").format("MMMM"),(0,n.jsx)("span",{className:"right-triangle"})]})]})}}:{},excludeDates:c,monthsShown:p||1})})]})}},32252:(e,t,l)=>{"use strict";l.d(t,{A:()=>n});let n={src:"/_next/static/media/chevronRightwhite.17d6b3fb.svg",height:40,width:40,blurWidth:0,blurHeight:0}},33345:(e,t,l)=>{"use strict";l.d(t,{QY:()=>o,gL:()=>a,sX:()=>i,xe:()=>n});let n=()=>localStorage.getItem("userRegistration"),a=()=>{let e=n();return e?JSON.parse(e):{}},i=e=>{e?localStorage.setItem("userRegistration",JSON.stringify(e)):localStorage.removeItem("userRegistration"),window.dispatchEvent(new CustomEvent("userDataChanged"))},o=()=>{let e=n();if(i(null),e)try{let t=JSON.parse(e);Promise.resolve().then(l.t.bind(l,18435,23)).then(e=>{let{proxypost:l}=e;l("marlin-auth/logout",{},{headers:{Authorization:"Bearer ".concat(null==t?void 0:t.token)}}).catch(e=>{console.error("Error during logout:",e)})})}catch(e){console.error("Error parsing user data:",e)}}},36031:(e,t,l)=>{"use strict";l.d(t,{A:()=>n});let n={src:"/_next/static/media/chevronRight.41fabd87.svg",height:40,width:40,blurWidth:0,blurHeight:0}},37130:(e,t,l)=>{"use strict";l.d(t,{A:()=>n});let n={src:"/_next/static/media/plus.dc077195.svg",height:12,width:12,blurWidth:0,blurHeight:0}},44143:(e,t,l)=>{"use strict";l.d(t,{A:()=>s});var n=l(14232),a=l(14e3),i=l(86144),o=l(17464),r=l(35061);let s=function(e,t){let l=!(arguments.length>2)||void 0===arguments[2]||arguments[2],s=(0,a.useRouter)(),d=(0,n.useRef)(null),u=(0,n.useRef)(null),c=()=>
1{if(l){let l=(0,i.je)();if((null==l?void 0:l.length)>0){var n;let a=l.map(e=>{var t,l;return{selectedRateCard:null==(t=e.selectedRateCard)?void 0:t.id,selectedDay:null==e?void 0:e.selectedDay,selectedHour:null==e||null==(l=e.selectedHour)?void 0:l.id}});(0,o.W3)(a),window.localStorage.removeItem("cart"),null==e||e.setCartItems([]),null==e||e.setPromo({show:!1,promoCode:"",error:"",applied:!1,response:"",promo_details:[]}),null==e||e.setConsumerAddOn([]),null==e||e.setAddonCheck([]),null==e||e.setAddOnFees([]),(0,r.QF)(s,(0,r.dI)(null==t||null==(n=t.seo_snippets)?void 0:n.s110_rates_url))}}},p=()=>{u.current&&clearTimeout(u.current),u.current=setTimeout(()=>{d.current&&clearTimeout(d.current),d.current=setTimeout(c,3e5)},1e3)};return(0,n.useEffect)(()=>{if(!l)return;let e=["mousemove","keydown","mousedown","touchstart"];return e.forEach(e=>window.addEventListener(e,p)),p(),()=>{e.forEach(e=>window.removeEventListener(e,p)),d.current&&clearTimeout(d.current),u.current&&clearTimeout(u.current)}},[]),{reset:p}}},58444:e=>{e.exports={opac__booknow__button:"bscommon_opac__booknow__button__LONZa",light_button:"bscommon_light_button__zcN6u",dark_button:"bscommon_dark_button__fJej2",seo__callout__container:"bscommon_seo__callout__container__XfiXi",seo__callout__img:"bscommon_seo__callout__img__83StY",verticalLimit:"bscommon_verticalLimit__WwhxR",container:"bscommon_container__MRn23",header:"bscommon_header__D3Mog",reports:"bscommon_reports__ENBoN",report:"bscommon_report__lflX0",report_img:"bscommon_report_img__SEKdn",report_imgtag:"bscommon_report_imgtag__Vq5My",report_details:"bscommon_report_details__WSt4E",dark:"bscommon_dark__9Ka27",find_your_trip:"bscommon_find_your_trip__lR3Kp",testimonials_holder:"bscommon_testimonials_holder__pt7o7",find_your_trip_content:"bscommon_find_your_trip_content___zrA5",find_your_trip_content_header:"bscommon_find_your_trip_content_header__HGXMA",testimonials_container:"bscommon_testimonials_container__8PPEo",testimonials_content:"bscommon_testimonials_content__ua7oX",testimonials_mobile_cards:"bscommon_testimonials_mobile_cards__h_oZ0",testimonials_cards_holder:"bscommon_testimonials_cards_holder__FsEGV",testimonials_cards:"bscommon_testimonials_cards__ALb2c",testimonials_review_image:"bscommon_testimonials_review_image__ZaVjF",testimonials_review_comment:"bscommon_testimonials_review_comment__jkYpN",testimonials_review_readmore:"bscommon_testimonials_review_readmore__y1zTZ",testimonials_description:"bscommon_testimonials_description__dD6K9",testimonials_description_box:"bscommon_testimonials_description_box__Iy2IU",find_your_trip_container:"bscommon_find_your_trip_container__SeEiF",trip_type:"bscommon_trip_type__ON8Kq",trip_time:"bscommon_trip_time__tbNhY",testimonials_head_shot:"bscommon_testimonials_head_shot__N4jtE",testimonials_customer_data:"bscommon_testimonials_customer_data__yl_Zq",loadingWrapper:"bscommon_loadingWrapper___r1Ak"}},80796:(e,t,l)=>{"use strict";l.d(t,{A:()=>n});let n={src:"/_next/static/media/minus.da972ede.svg",height:12,width:12,blurWidth:0,blurHeight:0}},90680:(e,t,l)=>{"use strict";l.d(t,{D:()=>a});var n=l(14232);let a=()=>{let[e,t]=(0,n.useState)(!1);return(0,n.useEffect)(()=>{t(!0)},[]),e}},99135:e=>{e.exports={Header:"customdatepicker_Header__tsBZJ",Content:"customdatepicker_Content__QV4aO",title:"customdatepicker_title__UGiH0",subtitle:"customdatepicker_subtitle__2PEO8",Dates:"customdatepicker_Dates__KtKww",title1:"customdatepicker_title1__XJ4Qc",choosenDate:"customdatepicker_choosenDate__h0lCv",Active:"customdatepicker_Active__39P_L",Disable:"customdatepicker_Disable__uvaX4",btnCont:"customdatepicker_btnCont__5yZiH",clear:"customdatepicker_clear__qXqTp",save:"customdatepicker_save__dlyNa",displayButtons:"customdatepicker_displayButtons__fNqdT",savedis:"customdatepicker_savedis__ZCAFs",CloseIcon:"customdatepicker_CloseIcon__M82Vd",dayPickerContainerForNewCustomSingleDatePicker:"customdatepicker_dayPickerContainerForNewCustomSingleDatePicker__OTnb_"}}},e=>{e.O(0,[5250,3716,1104,4587,6632,2867,4e3,1116,9750,8274,5130,1862,1029,6631,115,4625,636,6593,8792],()=>e(e.s=28142)),_N_E=e.O()}]); 2//# sourceMappingURL=checkout-5020d6bbd54dca67.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.