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]="415f1d19-1f86-493c-a3bf-c4feb99c898a",e._sentryDebugIdIdentifier="sentry-dbid-415f1d19-1f86-493c-a3bf-c4feb99c898a")}catch(e){}}(),(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6120],{62123:function(e,t,i){(window.__NEXT_P=window.__NEXT_P||[]).push(["/[[...slug]]",function(){return i(81389)}])},80122:function(e,t,i){"use strict";function getCapturedReferrer(){try{var e,t,i;let n=null!==(i=null===(e=window.__SPOTHERO)||void 0===e?void 0:e.capturedReferrer)&&void 0!==i?i:null===(t=window.document)||void 0===t?void 0:t.referrer;return n||null}catch(e){return null}}i.d(t,{T:function(){return getCapturedReferrer}})},36944:function(e,t,i){"use strict";i.d(t,{C:function(){return r}});var n=i(68690),a=i(4462),o=i(21423);let r={SEARCH:"SEARCH",DATE_CHANGED:"DATE_CHANGED"},s=[r.SEARCH,r.DATE_CHANGED];t.Z={updateAction(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:r.SEARCH;a.default.remove(o.BU.SEARCH_TRACKING.COOKIES.ACTION_UUID_COOKIE,o.f5.COOKIE),s.find(t=>t===e)&&a.default.remove(o.BU.SEARCH_TRACKING.COOKIES.SEARCH_UUID_COOKIE,o.f5.COOKIE),a.default.set(o.BU.SEARCH_TRACKING.COOKIES.ACTION_COOKIE,e,o.f5.COOKIE,o.xR.HALF_HOUR_IN_DAYS)},getValues(){let e=a.default.get(o.BU.SEARCH_TRACKING.COOKIES.SESSION_UUID_COOKIE,o.f5.COOKIE),t=a.default.get(o.BU.SEARCH_TRACKING.COOKIES.SEARCH_UUID_COOKIE,o.f5.COOKIE),i=a.default.get(o.BU.SEARCH_TRACKING.COOKIES.ACTION_UUID_COOKIE,o.f5.COOKIE),s=a.default.get(o.BU.SEARCH_TRACKING.COOKIES.ACTION_COOKIE,o.f5.COOKIE),l=e||(0,n.Z)(),c=e&&t&&/\S/.test(t)?t:(0,n.Z)(),d=e&&t&&i?i:(0,n.Z)(),u=s||r.SEARCH;return a.default.set(o.BU.SEARCH_TRACKING.COOKIES.SESSION_UUID_COOKIE,l,o.f5.COOKIE,o.xR.HALF_HOUR_IN_DAYS),a.default.set(o.BU.SEARCH_TRACKING.COOKIES.SEARCH_UUID_COOKIE,c,o.f5.COOKIE,o.xR.HALF_HOUR_IN_DAYS),a.default.set(o.BU.SEARCH_TRACKING.COOKIES.ACTION_UUID_COOKIE,d,o.f5.COOKIE,o.xR.HALF_HOUR_IN_DAYS),a.default.set(o.BU.SEARCH_TRACKING.COOKIES.ACTION_COOKIE,u,o.f5.COOKIE,o.xR.HALF_HOUR_IN_DAYS),{sessionUUID:l,searchUUID:c,actionUUID:d,action:u}}}},92177:function(e,t,i){"use strict";i.d(t,{Z:function(){return trackNonEventParkingClick}});var n=i(91581),a=i(91699);function trackNonEventParkingClick(e){let{destination:t}=e;if(t)try{n.Z.track({event:"Find Non-Event Parking Clicked",properties:{destination_name:t.title,destination_id:t.id}})}catch(e){a.Z.sendSentryMessage({error:e,customErrorMessage:"Segment Event Failed - trackNonEventParkingClick"})}}},45656:function(e,t,i){"use strict";i.d(t,{Z:function(){return use_event_parking_modal_data}});var n=i(52983),a=i(42958),o=i(53617),r=i(91699);let getDestinationForClient=async(e,t)=>{try{let i=new URL("".concat(t,"/destinations/").concat(e,"/"));i.searchParams.append("include","can_have_events,has_upcoming_events,destination,airport,spothero_city_slug");let n=await window.fetch(i.href),a=await (0,o.L)(n).json();return a.data}catch(t){return r.Z.sendSentryMessage({error:t,customErrorMessage:"getDestinationForClient Failed - ID: ".concat(e)}),null}};var s=i(68867),use_event_parking_modal_data=()=>{let{spotheroV1ApiUrl:e}=(0,a.Z)(),t=(0,n.useCallback)(t=>getDestinationForClient(t,e),[e]),i=(0,n.useCallback)(async t=>(0,s.vw)({destinationId:t,numberOfEvents:150,spotheroV1ApiUrl:e}),[e]);return{fetchDestination:t,fetchEvents:i}}},81389:function(e,t,i){"use strict";i.r(t),i.d(t,{__N_SSG:function(){return eK},default:function(){return HomePage}});var n=i(97458),a=i(52983),o=i(89659),r=i(15759),s=i(53310),l=i(43400),c=i(91581),d=i(80122),u=i(92593),g=i(44717),h=i(41483),p=i(95720),m=i(58067),f=i(86163),v=i(4462),_=i(4233),S=i(93463),k=i(28411),x=i(5186),y=i(91699);let b={GOOGLE:"google",APPLE:"apple",EMAIL_PASSWORD:"email_password"},C="/api/consumer-checkout/auth/login",O={[b.GOOGLE]:{text:"Continue with Google",IconComponent:k.Z,href:"".concat(C,"?connection=").concat(m.t.GOOGLE),clickTarget:"Continue with Google"},[b.APPLE]:{text:"Continue with Apple",IconComponent:S.Z,href:"".concat(C,"?connection=").concat(m.t.APPLE),clickTarget:"Continue with Apple"},[b.EMAIL_PASSWORD]:{text:"Log in with Password",IconComponent:x.Z,href:C,clickTarget:"Continue with Email"}},trackClick=e=>{(0,f.h5)({clickTarget:e,segment:c.Z,onError:y.Z.sendSentryMessage})},LastLoginButtonFull=e=>{let{type:t}=e,{text:i,IconComponent:a,href:o,clickTarget:r}=O[t],s=t===b.GOOGLE||t===b.APPLE;return(0,n.jsx)(u.zx,{"data-testid":"LastLoginModal-primary-".concat(t),onClick:()=>trackClick(r),height:"3.25rem",as:"a",href:o,width:"100%",variant:"primary",color:"white",borderWidth:0,textTransform:"none",...s&&{backgroundColor:"black",_hover:{backgroundColor:"black"}},children:(0,n.jsxs)(h.k,{alignItems:"center",gap:3,children:[s&&(0,n.jsx)(_.J,{as:a,height:5,width:5}),i]})})},LastLoginButtonSmall=e=>{let{type:t}=e,{IconComponent:i,href:a,clickTarget:o}=O[t];return(0,n.jsx)(u.zx,{"data-testid":"LastLoginModal-secondary-".concat(t),onClick:()=>trackClick(o),height:"3.25rem",as:"a",href:a,width:"100%",textTransform:"none",variant:"secondary",color:"black",backgroundColor:"white",children:(0,n.jsx)(h.k,{alignItems:"center",gap:3,children:(0,n.jsx)(_.J,{color:"black",as:i,height:5,width:5})})})};var E=i(83247),R=i(64993),I=i(9555);let isValidLastLoginMethod=e=>null===e||Object.values(b).includes(e);var last_login_modal_useShowLastLoginModal=()=>{let e=v.default.get(m.o,"cookie"),t=v.default.get(m.s,"session"),i=(0,E.Nt)("last_login_modal_home_screen")===R.Sg,{isUserLoading:n,user:{isLoggedIn:a}}=(0,I.Z)(),o=isValidLastLoginMethod(e)?e:null;return{showLastLoginModal:o&&!t&&i&&!n&&!a,lastLoginMethod:o}},F=i(58428);let j={color:"text.secondary.light",textDecoration:"underline",target:"_blank",rel:"noopener noreferrer",fontWeight:"normal",_hover:{textDecoration:"underline",color:"primary.600"}};var last_login_modal_LastLoginModal=()=>{let[e,t]=(0,a.useState)(!1),{showLastLoginModal:i,lastLoginMethod:r}=last_login_modal_useShowLastLoginModal(),s=(0,F.useRouter)();(0,a.useEffect)(()=>{let n=null;return!e&&i&&(n=setTimeout(()=>{t(!0),(0,f.mt)({loginPromptLocation:s.pathname,variation:"Last Login Modal",segment:c.Z,onError:y.Z.sendSentryMessage}),v.default.set(m.s,"true","session")},500)),()=>{n&&clearTimeout(n)}},[e,i,s.pathname]);let l=null,d=null,_="";return r===b.GOOGLE?(l=b.EMAIL_PASSWORD,d=b.APPLE,_="Google"):r===b.APPLE?(l=b.GOOGLE,d=b.EMAIL_PASSWORD,_="Apple"):r===b.EMAIL_PASSWORD&&(l=b.GOOGLE,d=b.APPLE,_="a password"),(0,n.jsx)(u.u_,{size:"sm-md",isOpen:e,onClose:()=>{t(!1),(0,f.h5)({clickTarget:"Close Button",segment:c.Z,onError:y.Z.sendSentryMessage})},children:(0,n.jsx)(g.f,{width:"100%",justifyContent:"center",alignItems:"center",children:(0,n.jsxs)(h.k,{flexDirection:"column",alignItems:"center",maxWidth:{base:"100%",tablet:"25rem"},children:[(0,n.jsx)(u.X6,{fontSize:"xl",marginBottom:3,children:"Welcome back!"}),(0,n.jsxs)(u.xv,{marginBottom:6,children:["You used ",_," to log in before"]}),r&&(0,n.jsx)(LastLoginButtonFull,{type:r}),(0,n.jsxs)(h.k,{width:"100%",alignItems:"center",gap:3,marginY:4,children:[(0,n.jsx)(o.xu,{flex:"1",height:"1px",backgroundColor:"gray.200"}),(0,n.jsx)(u.xv,{fontSize:"xs",color:"black",textTransform:"uppercase",fontWeight:"semibold",children:"Or"}),(0,n.jsx)(o.xu,{flex:"1",height:"1px",backgroundColor:"gray.200"})]}),(0,n.jsxs)(h.k,{width:"100%",gap:3,children:[l&&(0,n.jsx)(LastLoginButtonSmall,{type:l}),d&&(0,n.jsx)(LastLoginButtonSmall,{type:d})]}),(0,n.jsxs)(u.xv,{color:"text.secondary.light",textAlign:"center",fontSize:"sm",marginTop:6,children:["By logging in, I agree to the SpotHero"," ",(0,n.jsx)(p.r,{href:"/legal/terms-of-use","data-testid":"PreCheckoutLogin-terms",...j,children:"Terms and Conditions"})," ","and"," ",(0,n.jsx)(p.r,{href:"/legal/privacy-policy","data-testid":"PreCheckoutLogin-privacy",...j,children:"Privacy Policy"}),". If I'm a seller, I also agree to the"," ",(0,n.jsx)(p.r,{href:"/seller-terms-of-use","data-testid":"PreCheckoutLogin-operator-terms",...j,children:"Operator Dashboard Terms"}),"."]})]})})})};let w=(0,a.createContext)({interacted:!1,markInteracted:()=>void 0}),SearchInteractionProvider=e=>{let{children:t}=e,[i,o]=(0,a.useState)(!1),r=(0,a.useCallback)(()=>o(!0),[]),s=(0,a.useMemo)(()=>({interacted:i,markInteracted:r}),[i,r]);return(0,n.jsx)(w.Provider,{value:s,children:t})},useSearchInteraction=()=>(0,a.useContext)(w);var A=i(90041),L=i(53617);let T=["id","title","timezone","city","state","latitude","longitude","images"];var M=i(30379);let mapSavedSpotFacility=e=>{var t;let i=M.default.camelizeKeys(e),[n]=null!==(t=i.images)&&void 0!==t?t:[];return{id:i.id,title:i.title,timezone:i.timezone,city:i.city,state:i.state,latitude:i.latitude,longitude:i.longitude,image:n?{id:n.id,urlTemplate:n.urlTemplate}:null}},mapSavedSpotFacilities=e=>e.map(mapSavedSpotFacility),mapRecentFacility=e=>({...mapSavedSpotFacility(e),lastBooked:e.last_booked,rentalStarts:e.rental_starts,rentalEnds:e.rental_ends}),mapRecentFacilities=e=>e.map(mapRecentFacility);var P=i(70157);let Z=[...T,"last_booked","rental_starts","rental_ends"];async function getRecentFacilities(e){var t,i;let{userId:n,limit:a}=e,o=new URLSearchParams;o.set("only",Z.join(",")),null!=a&&o.set("limit",String(a));let r=o.toString()?"?".concat(o):"",s=await fetch("".concat("/api/consumer-c
1heckout","/users/").concat(encodeURIComponent(String(n)),"/recent-facilities").concat(r));(0,L.L)(s);let l=await s.json();return mapRecentFacilities(null!==(i=null===(t=l.data)||void 0===t?void 0:t.results)&&void 0!==i?i:[])}async function getRecentGuestFacilities(e){var t,i;let{limit:n}=e,a=new URLSearchParams;a.set("only",Z.join(",")),null!=n&&a.set("limit",String(n));let o=(0,P.e)(),r=a.toString()?"?".concat(a):"",s=await fetch("".concat(o,"/guest-recent-facilities/").concat(r));(0,L.L)(s);let l=await s.json();return mapRecentFacilities(null!==(i=null===(t=l.data)||void 0===t?void 0:t.results)&&void 0!==i?i:[])}var D=i(24543);function useRecentFacilitiesQuery(){let{user:e,isUserLoading:t}=(0,I.Z)(),{id:i}=e;return(0,A.a)({queryKey:["recentFacilities",i,4],queryFn:()=>null===i?getRecentGuestFacilities({limit:4}):getRecentFacilities({userId:i,limit:4}),staleTime:D.G,enabled:!t,retry:!1,retryOnMount:!1,refetchOnWindowFocus:!1})}var H=i(80363),K=i(99561),U=i(91352),B=i(15849),N=i(27406);let MutationObserver=class MutationObserver extends N.l{constructor(e,t){super(),this.client=e,this.setOptions(t),this.bindMethods(),this.updateResult()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){var t;let i=this.options;this.options=this.client.defaultMutationOptions(e),(0,K.VS)(i,this.options)||this.client.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.currentMutation,observer:this}),null==(t=this.currentMutation)||t.setOptions(this.options)}onUnsubscribe(){if(!this.hasListeners()){var e;null==(e=this.currentMutation)||e.removeObserver(this)}}onMutationUpdate(e){this.updateResult();let t={listeners:!0};"success"===e.type?t.onSuccess=!0:"error"===e.type&&(t.onError=!0),this.notify(t)}getCurrentResult(){return this.currentResult}reset(){this.currentMutation=void 0,this.updateResult(),this.notify({listeners:!0})}mutate(e,t){return this.mutateOptions=t,this.currentMutation&&this.currentMutation.removeObserver(this),this.currentMutation=this.client.getMutationCache().build(this.client,{...this.options,variables:void 0!==e?e:this.options.variables}),this.currentMutation.addObserver(this),this.currentMutation.execute()}updateResult(){let e=this.currentMutation?this.currentMutation.state:(0,U.R)(),t="loading"===e.status,i={...e,isLoading:t,isPending:t,isSuccess:"success"===e.status,isError:"error"===e.status,isIdle:"idle"===e.status,mutate:this.mutate,reset:this.reset};this.currentResult=i}notify(e){B.V.batch(()=>{if(this.mutateOptions&&this.hasListeners()){var t,i,n,a,o,r,s,l;e.onSuccess?(null==(t=(i=this.mutateOptions).onSuccess)||t.call(i,this.currentResult.data,this.currentResult.variables,this.currentResult.context),null==(n=(a=this.mutateOptions).onSettled)||n.call(a,this.currentResult.data,null,this.currentResult.variables,this.currentResult.context)):e.onError&&(null==(o=(r=this.mutateOptions).onError)||o.call(r,this.currentResult.error,this.currentResult.variables,this.currentResult.context),null==(s=(l=this.mutateOptions).onSettled)||s.call(l,void 0,this.currentResult.error,this.currentResult.variables,this.currentResult.context))}e.listeners&&this.listeners.forEach(({listener:e})=>{e(this.currentResult)})})}};var G=i(77631),z=i(74765);function noop(){}let V="/api/consumer-checkout";async function getFavoriteFacilities(e){var t,i;let{userId:n,limit:a}=e,o=new URLSearchParams;o.set("only",T.join(",")),null!=a&&o.set("limit",String(a));let r=o.toString()?"?".concat(o):"",s=await fetch("".concat(V,"/users/").concat(encodeURIComponent(String(n)),"/favorite-facilities").concat(r));(0,L.L)(s);let l=await s.json();return mapSavedSpotFacilities(null!==(i=null===(t=l.data)||void 0===t?void 0:t.results)&&void 0!==i?i:[])}async function toggleFavoriteFacility(e){let{userId:t,facilityId:i,favorite:n}=e,a=await fetch("".concat(V,"/users/").concat(encodeURIComponent(String(t)),"/favorite-facilities"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({facility_id:i,favorite:n})});(0,L.L)(a)}let Q="favoriteFacilities";function useFavoriteFacilitiesQuery(){let{user:e}=(0,I.Z)(),{id:t}=e;return(0,A.a)({queryKey:[Q,t,9],queryFn:()=>null===t?Promise.reject(Error("User id is required")):getFavoriteFacilities({userId:t,limit:9}),staleTime:D.G,enabled:null!==t,retry:!1,retryOnMount:!1,refetchOnWindowFocus:!1})}var W=i(54550),q=i(76447),X=i(22866),Y=i(15593),J=i(26352),$=i(80422),ee=i(65960),et=i(6918),ei=i(92177),en=i(91993),ea=i(94254),eo=i(78900),er=i(37258),es=i(25388),el=i(60380),ec=i(18553),ed=i(13522),eu=i(45656),home_search_section_HomeSearchSection=e=>{var t;let{siteUrl:i,eventDestinationsHash:r,markInteracted:s}=e,{googleMapsLibraries:l,useNewGooglePlacesApi:c}=(0,ea.e)(),{resolvedLocation:d,nearbyEvents:u}=(0,W.T)(),{fetchDestination:g,fetchEvents:h}=(0,eu.Z)(),{searchEvents:p,handleOnChangeForEvents:m}=(0,eo.ZP)({latitude:null==d?void 0:d.latitude,longitude:null==d?void 0:d.longitude,country:(null==d?void 0:d.country)||"US",showSearchEventsResults:!0}),{searchPerformers:f,handleOnChangeForPerformers:v}=(0,ec.Z)(),_=p.length>0?p:u,S=(0,a.useCallback)(e=>{let{previousTab:t,selectedTab:i}=e;(0,es.Z)({pageType:"homepage",previousTab:t,selectedTab:i})},[]),k=null!==(t=(0,ed.S)({base:!0,tablet:!1}))&&void 0!==t&&t,x={siteUrl:i,eventDestinationsHash:r,locationBias:d,trackEventListItemSelected:Y.Z,trackSearchSuggestionSelected:J.ZP,trackDateEntered:$.Z,trackErrorMessageDisplayed:ee.Z,trackFindParkingNearMeClicked:et.Z,onNonEventParkingClick:ei.Z,trackSwitchedVerticalTabs:S,trackPowerBookingOpened:el.Z,PoweredByGoogle:en.Z,FindParkingSpotsButton:er.Z,useNewGooglePlacesApi:c,clientRendered:{googleMapsLibraries:l,searchEvents:_,handleOnChangeForEvents:m,isMobile:k,searchPerformers:f,handleOnChangeForPerformers:v,useNewGooglePlacesApi:c,locationBias:d},isMobile:k,enableEventsPopupModal:!0,fetchDestination:g,fetchEvents:h};return(0,n.jsx)(o.xu,{onFocus:s,style:{display:"contents"},children:(0,n.jsx)(X.SearchComponentStoreProvider,{...x,children:(0,n.jsx)(q.Z,{})})})};async function getQuickRebookFacility(e){let{facilityId:t}=e,i=new URLSearchParams;i.set("only",T.join(","));let n=await fetch("".concat((0,P.e)(),"/facilities/").concat(encodeURIComponent(String(t)),"/?").concat(i));(0,L.L)(n);let a=await n.json();return a.data?mapSavedSpotFacility(a.data):null}var eg=i(10442),eh=i(89384),ep=i(42958),em=i(82378),ef=i(11169),ev=i(68649),e_=i(80906),eS=i(77177);let showFavoriteToast=e=>{let{toast:t,status:i,icon:a,iconProps:o,message:r}=e;t({position:"bottom-right",duration:2500,render:()=>(0,n.jsx)(u.bZ,{status:i,showIcon:!0,icon:a,iconProps:o,alignItems:"center",description:(0,n.jsx)(u.xv,{fontWeight:"semibold",children:r})}),containerStyle:{width:{base:"calc(100vw - 1rem)",tablet:"auto"},maxWidth:{base:"100%",tablet:"35rem"}}})};var ek=i(2781),ex=i(80512),favorite_spot_button_RemoveFavoriteSpotModal=e=>{let{isOpen:t,onClose:i,onConfirm:a,isLoading:o=!1}=e;return(0,n.jsxs)(u.u_,{hasHeader:!0,hasFooter:!0,size:"sm",isOpen:t,onClose:i,"data-testid":"RemoveFavoriteSpotModal",children:[(0,n.jsx)(ek.x,{margin:0,as:"h1",fontSize:"lg",children:"Remove favorite spot?"}),(0,n.jsx)(g.f,{children:(0,n.jsx)(u.xv,{children:"Remove this spot from your favorites?"})}),(0,n.jsxs)(ex.m,{children:[(0,n.jsx)(u.zx,{onClick:a,isLoading:o,fontFamily:"body",variant:"destructive",children:"Remove"}),(0,n.jsx)(u.zx,{onClick:i,isDisabled:o,fontFamily:"body",variant:"secondary",children:"Cancel"})]})]})}
1,favorite_spot_button_FavoriteSpotButton=e=>{let{facility:t,initiatedFromScreen:i,confirmRemoval:r=!1}=e,{user:s}=(0,I.Z)(),{data:l}=useFavoriteFacilitiesQuery(),{mutate:d,isLoading:u}=function(){let e=(0,H.NL)(),{user:t}=(0,I.Z)(),{id:i}=t,n=[Q,i,9];return function(e,t,i){let n=(0,K.lV)(e,void 0,void 0),o=(0,H.NL)({context:n.context}),[r]=a.useState(()=>new MutationObserver(o,n));a.useEffect(()=>{r.setOptions(n)},[r,n]);let s=(0,G.$)(a.useCallback(e=>r.subscribe(B.V.batchCalls(e)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),l=a.useCallback((e,t)=>{r.mutate(e,t).catch(noop)},[r]);if(s.error&&(0,z.L)(r.options.useErrorBoundary,[s.error]))throw s.error;return{...s,mutate:l,mutateAsync:s.mutate}}({mutationFn:e=>{let{facility:t,favorite:n}=e;return null===i?Promise.reject(Error("User id is required")):toggleFavoriteFacility({userId:i,facilityId:t.id,favorite:n})},onMutate:async t=>{let{facility:i,favorite:a}=t;await e.cancelQueries({queryKey:n});let o=e.getQueryData(n);return e.setQueryData(n,function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return a?e.some(e=>e.id===i.id)?e:[i,...e]:e.filter(e=>e.id!==i.id)}),{previousFavorites:o}},onError:(t,i,a)=>{y.Z.sendSentryMessage({error:t,customErrorMessage:"Failed to toggle favorite facility"}),e.setQueryData(n,null==a?void 0:a.previousFavorites)},onSettled:()=>{e.invalidateQueries({queryKey:[Q,i]})}})}(),g=function(e){let{theme:t}=(0,e_.uP)(),i=(0,ef.OX)();return(0,a.useMemo)(()=>(0,ev.Cj)(t.direction,{...i,...e}),[e,t.direction,i])}(),[h,p]=(0,a.useState)(!1);if(!s.isLoggedIn)return null;let m=(null!=l?l:[]).some(e=>e.id===t.id),f=m?eS.P72:eS.kE$,toggleFavorite=e=>{d({facility:t,favorite:e},{onSuccess:()=>{e?function(e){let{facilityId:t,initiatedFromScreen:i}=e;try{c.Z.track({event:"Favorite Spot Added",properties:{facility_id:t,initiated_from_screen:i},additionalOptions:{context:{protocols:{event_version:1}}}})}catch(e){y.Z.sendSentryMessage({error:e,customErrorMessage:"Segment Event Failed - trackFavoriteSpotAdded"})}}({facilityId:t.id,initiatedFromScreen:i}):function(e){let{facilityId:t,initiatedFromScreen:i}=e;try{c.Z.track({event:"Favorite Spot Deleted",properties:{facility_id:t,initiated_from_screen:i},additionalOptions:{context:{protocols:{event_version:1}}}})}catch(e){y.Z.sendSentryMessage({error:e,customErrorMessage:"Segment Event Failed - trackFavoriteSpotDeleted"})}}({facilityId:t.id,initiatedFromScreen:i}),showFavoriteToast({toast:g,status:"neutral",icon:e?eS.m9i:eS.Xdw,iconProps:{fill:e?"red.600":"black"},message:e?"Favorite spot added":"Favorite spot removed"})},onError:()=>{showFavoriteToast({toast:g,status:"error",message:"Couldn't update this spot. Try again in a moment."})}})};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(o.xu,{as:"button",type:"button","aria-label":m?"Remove favorite":"Save spot",disabled:u,onClick:()=>{if(m&&r){p(!0);return}toggleFavorite(!m)},position:"absolute",top:0,right:0,zIndex:1,display:"flex",alignItems:"center",justifyContent:"center",paddingTop:3,paddingRight:4,width:"auto",height:"auto",cursor:"pointer","data-testid":"FavoriteSpotButton-".concat(t.id),children:(0,n.jsx)(_.J,{as:f,width:"1.5rem",height:"1.5rem",filter:"auto",dropShadow:"0 0 18px rgba(0, 0, 0, 0.20)",fill:m?"red.600":"gray.700"})}),r&&(0,n.jsx)(favorite_spot_button_RemoveFavoriteSpotModal,{isOpen:h,onClose:()=>p(!1),onConfirm:()=>{p(!1),toggleFavorite(!1)},isLoading:u})]})};let buildTemplateImageUrl=(e,t)=>{let{width:i,height:n,quality:a=80}=t;return e.replace("{{WIDTH}}",String(i)).replace("{{HEIGHT}}",String(n)).replace("{{QUALITY}}",String(a))},ey="9rem";var spot_preview_SavedSpotCard=e=>{let{facility:t,onBookAgain:i,initiatedFromScreen:a,showViewDetails:r=!1,showLastBooked:s=!0,onViewDetailsClick:l,testIdName:c,confirmFavoriteRemoval:d=!1}=e,{siteUrl:g}=(0,ep.Z)(),p=t.image?buildTemplateImageUrl(t.image.urlTemplate,{width:400,height:260}):"".concat(g,"/img/missing-image.png");return(0,n.jsxs)(u.Zb,{padding:"none",overflow:"hidden",border:"1px solid",borderColor:"gray.medium",display:"flex",flexDirection:"column",height:"100%",boxShadow:"none",children:[(0,n.jsxs)(o.xu,{background:"gray.medium",position:"relative",minHeight:ey,sx:{".Image":{height:ey}},children:[(0,n.jsx)(eh.Z,{alt:"Photo of ".concat(t.title),src:p,loader:()=>p,isLazyLoaded:!0,layout:"fill",objectFit:"cover",objectPosition:"center"}),(0,n.jsx)(favorite_spot_button_FavoriteSpotButton,{facility:t,initiatedFromScreen:a,confirmRemoval:d})]}),(0,n.jsxs)(h.k,{flexFlow:"column",gap:1,paddingX:4,paddingTop:3.5,flex:"1 1 auto",children:[(0,n.jsx)(u.xv,{fontWeight:"semibold",fontSize:"base",color:"black",title:t.title,lineHeight:1.15,noOfLines:2,children:t.title}),s&&t.lastBooked?(0,n.jsxs)(u.xv,{lineHeight:1.15,marginTop:1,fontSize:"xs",color:"gray.600",children:["Last booked"," ",(0,em.Z)(t.lastBooked).format("ddd, MMM D")]}):null]}),(0,n.jsxs)(h.k,{marginTop:4,marginX:4,marginBottom:4,gap:3,children:[r&&(0,n.jsx)(u.zx,{asAnchor:!0,href:"/facility/".concat(t.id),variant:"secondary",flex:"1 1 0",paddingY:2,lineHeight:1,fontSize:"sm",textTransform:"none",onClick:l||void 0,paddingX:3,"data-testid":"".concat(c,"-").concat(t.id,"-view-details-button"),children:"View details"}),(0,n.jsx)(u.zx,{flex:"1 1 0",paddingY:2,lineHeight:1,fontSize:"sm",onClick:i,textTransform:"none",paddingX:r?3:8,"data-testid":"".concat(c,"-").concat(t.id,"-book-again-button"),children:"Book again"})]})]})},eb=i(48389),eC=i(18870),eO=i(89618);let getRebookDefaultRange=(e,t,i)=>{if(!t||!i||!(0,em.Z)(t).isValid()||!(0,em.Z)(i).isValid())return(0,X.getDefaultRange)(e);let n=(0,em.Z)().tz(e).set("second",0).set("millisecond",0),a=(0,em.Z)(t).tz(e),o=n.set("hour",a.hour()).set("minute",a.minute());if(o.isAfter(n)){let n=(0,eO.He)({time:o,mode:"start"}),a=(0,em.Z)(i).tz(e).diff((0,em.Z)(t).tz(e)),r=n.add(a,"millisecond");return{startDate:n.toDate(),endDate:r.toDate()}}return(0,X.getDefaultRange)(e)},eE={QUICK_REBOOK:"Quick Rebook",FAVORITE_SPOTS:"Favorite Spots"};function trackHomepageClick(e){let{clickTarget:t,section:i}=e;try{c.Z.track({event:"Homepage Click",properties:{click_target:t,section:i},additionalOptions:{context:{protocols:{event_version:1}}}})}catch(e){y.Z.sendSentryMessage({error:e,customErrorMessage:"Segment Event Failed - trackHomepageClick"})}}var eR=i(90814),eI=i(36944),eF=i(21423);let ej={QUICK_REBOOK:"quick_rebook",FAVORITE_SPOTS_HOMEPAGE:"favorite_spots_homepage"};function calculateTimeDifference(e){let{starts:t,ends:i,unit:n="hour",isFloatingPointNumber:a=!0}=e,o=(0,em.Z)(t),r=(0,em.Z)(i);return r.diff(o,n,a)||0}var rebook_modal_RebookModal=e=>{let{isOpen:t,onClose:i,facility:r,rentalStarts:s,rentalEnds:l,section:d,searchSource:h}=e,{id:p,timezone:m}=r,f=(0,ed.S)({base:!0,tablet:!1}),v=(0,a.useMemo)(()=>getRebookDefaultRange(m,s,l),[m,s,l]),[_,S]=(0,a.useState)(v),[k,x]=(0,a.useState)(!1),b=(0,a.useCallback)(e=>{S(e)},[]),C=(0,em.Z)(_.startDate).tz(m).format(eb.Ak),O=(0,em.Z)(_.endDate).tz(m).format(eb.Ak),E=(0,eC.hN)({spotId:String(p),starts:C,ends:O,timezone:m}),R=(0,a.useCallback)(()=>{trackHomepageClick({clickTarget:"Rebook Modal Confirm",section:d}),function(e){let{starts:t,ends:i,facility:n,timezone:a,searchSource:o}=e;try{var r,s;let{sessionUUID:e,searchUUID:l,actionUUID:d,action:u}=eI.Z.getValues(),g={page_type:eR.T3.HOME,action_id:d,action_type:u,city:null!==(r=n.city)&&void 0!==r?r:null,state:null!==(s=n.state)&&void 0!==s?s:null,filters:[],map_center:{latitude:n.latitude,longitude:n.longitude},parking_type:"transient",query:"",search_api_version:2,search_end_time_utc:(0,em.Z)(i).toISOString(),search_id:l,search_lead_time:calculateTimeDifference({starts:(0,em.Z)().tz(a),ends:(0,em.Z)(t).tz(a,!0),unit:"minute"}),search_length:calculateTimeDifference({starts:t,ends:i}),search_source:o,search_start_time_utc:(0,em.Z)(t).toISOString(),session_id:e,sort_by:"n/a",top_search_results_list:[{visual_flags:[],facility_id:"".concat(n.id),rank:1,number_of_hours:calculateTimeDifference({starts:t,ends:i}),official_parking:!1,spots_left_displayed:!1,tag_displayed_in_search:!1}],power_booking:!1,view:"home",partner_affiliate:(0,eF.Mo)()};c.Z.track({event:"Products Searched",properties:g,additionalOptions:{context:{protocols:{event_version:25}}}})}catch(e){y.Z.sendSentryMessage({error:e,customErrorMessage:"Segment Event Failed - trackSavedSpotProductsSearched"})}}({starts:C,ends:O,facility:r,timezone:m,searchSource:h}),x(!0)},[d,h,C,O,r,m]),I=(0,a.useCallback)(()=>{trackHomepageClick({clickTarget:"Rebook Modal Cancel",section:d}),i(),x(!1)},[d,i]);return(0,n.jsxs)(u.u_,{hasHeader:!0,hasFooter:!0,size:"sm-md",contentStyling:{height:{base:"90%",tablet:"auto"}},isOpen:t,onClose:I,closeOnOverlayClick:!0,"data-testid":"RebookModal",isMobile:f,children:[(0,n.jsx)(ek.x,{fontSize:"lg",children:"When are you parking?"}),(0,n.jsx)(g.f,{children:(0,n.jsx)(o.xu,{width:"100%",paddingBottom:{base:0,tablet:4},children:(0,n.jsx)(X.StandaloneDateRangePicker,{timezone:m,defaultStartDate:v.startDate,defaultEndDate:v.endDate,startLabel:"Enter after",endLabel:"Exit before",showParkingDuration:!1,onChange:b})})}),(0,n.jsxs)(ex.m,{justifyContent:"end",gap:4,flexDirection:{base:"column",desktop:"row-reverse"},children:[(0,n.jsx)(u.zx,{asAnchor:!0,href:E,onClick:R,"data-testid":"RebookModal-confirm-button",width:{base:"100%",desktop:"auto"},isLoading:k,loadingText:(0,n.jsx)(o.xu,{as:"span",children:"Confirm"}),children:(0,n.jsx)(o.xu,{as:"span",children:"Confirm"})}),(0,n.jsx)(u.zx,{onClick:I,"data-testid":"RebookModal-cancel-button",variant:"secondary",width:{base:"100%",desktop:"auto"},children:"Cancel"})]})]})};let ew="quick_rebook_facility_id",eA="quick_rebook_rental_starts",eL="quick_rebook_rental_ends",buildRebookHref=(e,t,i,n)=>{let a=t.asPath.includes("?")?"&":"?",o="".concat(t.asPath).concat(a).concat(ew,"=").concat(e);return i&&n&&(o+="&".concat(eA,"=").concat(encodeURIComponent(i))+"&".concat(eL,"=").concat(encodeURIComponent(n))),o};var quick_rebook_section_QuickRebookSection=()=>{var e;let t,i;let r=(0,F.useRouter)(),{user:s,isUserLoading:l}=(0,I.Z)(),{data:d,isLoading:g}=useRecentFacilitiesQuery(),[m,v]=(0,a.useState)(null),[_,S]=(0,a.useState)(null),[k,x]=(0,a.useState)(null),[b,C]=(0,a.useState)(null),[O,E]=(0,a.useState)(null),{data:R}=(0,A.a)({queryKey:["quickRebookFacility",_],queryFn:()=>getQuickRebookFacility({facilityId:_}),enabled:null!=_,retry:!1,staleTime:1/0}),j=r.isReady?r.query[ew]:void 0;(0,a.useEffect)(()=>
1{if(null==j)return;let e=Number(j);Number.isFinite(e)&&S(e);let t=r.query[eA],i=r.query[eL];"string"==typeof t&&"string"==typeof i&&(x(t),C(i));let n={...r.query};delete n[ew],delete n[eA],delete n[eL],r.replace({pathname:r.pathname,query:n},void 0,{shallow:!0})},[j,r]),(0,a.useEffect)(()=>{null==_||l||s.isLoggedIn||E(buildRebookHref(_,r,k,b))},[_,k,b,l,s.isLoggedIn,r]);let w=null;m?(w=m,t=m.rentalStarts,i=m.rentalEnds):s.isLoggedIn&&(w=R,t=null!=k?k:void 0,i=null!=b?b:void 0);let handleBookAgain=e=>{trackHomepageClick({clickTarget:"Book Again",section:eE.QUICK_REBOOK}),s.isLoggedIn?v(e):E(buildRebookHref(e.id,r,e.rentalStarts,e.rentalEnds))},L=!l&&!g&&!!(null==d?void 0:d.length),T=null!==(e=null==d?void 0:d.slice(0,4))&&void 0!==e?e:[],M=T.length<4?3:4;return(0,n.jsxs)(n.Fragment,{children:[L&&(0,n.jsx)(o.xu,{as:"section",paddingTop:{base:8,tablet:12},children:(0,n.jsxs)(u.W2,{paddingX:0,children:[(0,n.jsxs)(h.k,{justifyContent:"space-between",alignItems:"center",marginBottom:4,children:[(0,n.jsx)(u.X6,{as:"h2",fontSize:"xl",marginLeft:4,children:"Book again"}),(0,n.jsx)(p.r,{fontSize:{base:"base",tablet:"sm"},href:"".concat(eg.A,"?reservations=past"),fontWeight:"semibold",onClick:()=>{trackHomepageClick({clickTarget:"View All",section:eE.QUICK_REBOOK})},"data-testid":"QuickRebook-View-All-Button",marginRight:4,children:"View all"})]}),(0,n.jsx)(o.xu,{display:{base:"flex",desktop:"grid"},gridTemplateColumns:{desktop:"repeat(".concat(M,", 1fr)")},overflowX:{base:"auto",desktop:"visible"},gap:4,sx:{scrollSnapType:"x mandatory",scrollPaddingLeft:"1rem",scrollbarWidth:"none"},paddingX:4,children:T.map(e=>(0,n.jsx)(o.xu,{flex:"1 1 auto",sx:{scrollSnapAlign:"start"},minWidth:64,"data-testid":"QuickRebook-Spot",children:(0,n.jsx)(spot_preview_SavedSpotCard,{facility:e,onBookAgain:()=>handleBookAgain(e),initiatedFromScreen:ej.QUICK_REBOOK,testIdName:"QuickRebook",showLastBooked:!0})},e.id))})]})}),w&&(0,n.jsx)(rebook_modal_RebookModal,{isOpen:!0,onClose:()=>{v(null),S(null),x(null),C(null)},facility:w,rentalStarts:t,rentalEnds:i,section:eE.QUICK_REBOOK,searchSource:ej.QUICK_REBOOK}),O&&(0,n.jsx)(f._A,{segment:c.Z,onError:y.Z.sendSentryMessage,isOpen:!0,onClose:()=>E(null),location:r.pathname,returnTo:O,hideSubtitle:!0,headingText:"Log in or sign up"})]})},eT=i(25512),eM=i(33408),eP=i(67081),eZ=i(96572);let eD=(0,eT.E)(o.xu),eH={duration:.3,ease:[.25,.1,.25,1]};var favorite_spots_section_FavoriteSpotsSection=()=>{var e;let{user:t,isUserLoading:i}=(0,I.Z)(),{data:r,isLoading:s}=useFavoriteFacilitiesQuery(),[l,c]=(0,a.useState)(null),d=function(){eP.O.current||(0,eM.A)();let[e]=(0,a.useState)(eP.n.current);return e}(),g=Math.min(null!==(e=null==r?void 0:r.length)&&void 0!==e?e:0,8),m=function(e){let{delayMs:t=300,instant:i=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},[n,o]=(0,a.useState)(e),r=(0,a.useRef)(null);return(0,a.useEffect)(()=>{let clear=()=>{r.current&&(clearTimeout(r.current),r.current=null)};return i||e>=n?(clear(),o(e)):(clear(),r.current=setTimeout(()=>{o(e),r.current=null},t)),clear},[e,n,t,i]),n}(g>=4?4:3,{instant:!!d});if(i||s||!t.isLoggedIn)return null;let f=null!=r?r:[],v=f.slice(0,8),_=f.length>8,S=v.length>0,handleBookAgain=e=>{trackHomepageClick({clickTarget:"Book Again",section:eE.FAVORITE_SPOTS}),c(e)},handleViewDetailsClick=()=>{trackHomepageClick({clickTarget:"View Details",section:eE.FAVORITE_SPOTS})};return(0,n.jsx)(eZ.M,{initial:!1,children:S&&(0,n.jsx)(eD,{as:"section",overflow:"hidden",initial:!d&&{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:d?{duration:0}:eH,children:(0,n.jsxs)(o.xu,{paddingTop:{base:8,tablet:12},children:[(0,n.jsxs)(u.W2,{paddingX:0,children:[(0,n.jsxs)(h.k,{justifyContent:"space-between",alignItems:"center",marginBottom:4,children:[(0,n.jsx)(u.X6,{as:"h2",fontSize:"xl",marginLeft:4,children:"Favorite spots"}),_&&(0,n.jsx)(p.r,{fontSize:{base:"base",tablet:"sm"},href:"/my-account?page=favorite-spots",fontWeight:"semibold",onClick:()=>{trackHomepageClick({clickTarget:"View All",section:eE.FAVORITE_SPOTS})},"data-testid":"FavoriteSpots-View-All-Button",marginRight:4,children:"View all"})]}),(0,n.jsx)(o.xu,{position:"relative",display:{base:"flex",desktop:"grid"},gridAutoFlow:{desktop:"row"},gridTemplateRows:{desktop:v.length>4?"repeat(2, auto)":"auto"},gridTemplateColumns:{desktop:"repeat(".concat(m,", 1fr)")},overflowX:{base:"auto",desktop:"visible"},gap:4,sx:{scrollSnapType:"x mandatory",scrollPaddingLeft:"1rem",scrollbarWidth:"none"},paddingX:4,children:(0,n.jsx)(eZ.M,{mode:"popLayout",initial:!1,children:v.map((e,t)=>(0,n.jsx)(eD,{layout:!d,initial:!d&&{opacity:0,x:-40},animate:d?{opacity:1}:{opacity:1,x:0},exit:d?{opacity:0}
1:{opacity:0,scale:.95},transition:d?{duration:0}:eH,flex:"1 1 auto",minWidth:64,maxWidth:"22.75rem",sx:{scrollSnapAlign:"start",zIndex:t},"data-testid":"FavoriteSpots-spot",children:(0,n.jsx)(spot_preview_SavedSpotCard,{facility:e,onBookAgain:()=>handleBookAgain(e),initiatedFromScreen:ej.FAVORITE_SPOTS_HOMEPAGE,showViewDetails:!0,showLastBooked:!1,onViewDetailsClick:handleViewDetailsClick,testIdName:"FavoriteSpots",confirmFavoriteRemoval:!0})},e.id))})})]}),l&&(0,n.jsx)(rebook_modal_RebookModal,{isOpen:!0,onClose:()=>c(null),facility:l,section:eE.FAVORITE_SPOTS,searchSource:ej.FAVORITE_SPOTS_HOMEPAGE})]})},"favorite-spots-section")})},components_Home=e=>{let{page:t,page:{body:i},pageType:u,appRating:g,eventDestinationsHash:h,config:{siteUrl:p}}=e;(0,a.useEffect)(()=>{let e=(0,d.T)();c.Z.page({name:"Web Landing",properties:{referrer:e}})},[]),function(){let{isUserLoading:e}=(0,I.Z)(),{data:t,isInitialLoading:i}=useRecentFacilitiesQuery(),{data:n,isInitialLoading:o}=useFavoriteFacilitiesQuery(),r=(0,a.useRef)(!1);(0,a.useEffect)(()=>{var a,s;r.current||e||i||o||(r.current=!0,function(e){let{quickRebookSpotCount:t,favoriteSpotsCount:i}=e;try{c.Z.track({event:"Landing Started",properties:{quickbook_spot_count:t,favorite_spots_number:i},additionalOptions:{context:{protocols:{event_version:1}}}})}catch(e){y.Z.sendSentryMessage({error:e,customErrorMessage:"Segment Event Failed - trackLandingStarted"})}}({quickRebookSpotCount:null!==(a=null==t?void 0:t.length)&&void 0!==a?a:0,favoriteSpotsCount:null!==(s=null==n?void 0:n.length)&&void 0!==s?s:0}))},[e,i,o,t,n])}();let{markInteracted:m}=useSearchInteraction(),{isUserLoading:f}=(0,I.Z)(),{isLoading:v}=useRecentFacilitiesQuery(),{isInitialLoading:_}=useFavoriteFacilitiesQuery();return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(o.xu,{"data-testid":"Home",minHeight:"70dvh",children:[(0,n.jsx)(l.Z,{fallbackTitle:null,page:t}),(0,n.jsx)(s.Z,{appRating:g}),(0,n.jsx)(W.v,{children:(0,n.jsx)(home_search_section_HomeSearchSection,{siteUrl:p,eventDestinationsHash:h,markInteracted:m})}),!f&&!v&&!_&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(quick_rebook_section_QuickRebookSection,{}),(0,n.jsx)(favorite_spots_section_FavoriteSpotsSection,{})]}),(0,n.jsx)(o.xu,{as:"main","data-testid":"Home-pricmic-slices",children:(0,r.U)({slices:i,pageType:u})})]}),(0,n.jsx)(last_login_modal_LastLoginModal,{})]})},eK=!0;function HomePage(e){return(0,n.jsx)(ea.u,{children:(0,n.jsx)(SearchInteractionProvider,{children:(0,n.jsx)(components_Home,{...e})})})}}},function(e){e.O(0,[4448,831,9142,41,2100,7408,4616,3889,3493,2741,9774,2888,179],function(){return e(e.s=62123)}),_N_E=e.O()}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.