1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8892,9310],{5717:(e,t,s)=>{"use strict";s.d(t,{Q:()=>_});var a=s(78488),i=s(45738),l=s(48339),n=s(42155),r=s.n(n),c=s(40367),o=s(81204),d=s(60766),u=s(43569),x=s(23268),m=s(50596),h=s(89074),f=s(65925),g=s(39556),y=s(48113),v=s(24118),p=s(66886),j=s(60133),w=s(30034),A=s(65382),b=s(33136),S=function(e){return e.ListView="List",e.CalendarView="Calendar",e}({}),C=s(99317),N=s(66020),k=s(17390),F=s(13874),L=s(10371);function _(e){let{pageTitle:t,title:s,venueTypes:n,listViewContent:_,calendarV1Availability:T="none"}=e,E=(0,d.wA)(),{reservationSettings:H}=h.S.useContext(),I=(0,x.o)(),{isPlatformAdministrator:V}=(0,m.u)(),W=(0,d.d4)(g.nv),[B,M]=(0,o.useState)(),[P,z]=(0,o.useState)(),[,R]=(0,o.useState)();(0,o.useEffect)(()=>{W>=2&&E((0,u.y)([(0,g.PC)(),(0,f.HZ)()]))},[]);let Y=(0,c.Tp)(i.sKG.enableFacilitiesGridV2Public),D=(0,c.Tp)(i.sKG.facilitiesCalendarVisualizations),G=Y||"always"===T||"flag-gated"===T&&D,{storedPreference:O,content:X}=function(e){let{onSwitch:t,persistPreference:s=!0}=e,[i,n]=(0,o.useState)("Calendar"),[r,c]=(0,b.A)(A.gM,"Calendar"),d=s?r:i,u=s?c:n;(0,o.useEffect)(()=>{s&&!Object.values(S).includes(r)&&c("List")},[s,r,c]);let x=(0,a.jsxs)(a.Fragment,{children:["Calendar"===d&&(0,a.jsxs)(l.$n.Secondary,{size:"sm",onClick:()=>{u("List"),t()},children:[(0,a.jsx)(w.A,{className:"mr-2"}),"List view"]}),"List"===d&&(0,a.jsxs)(l.$n.Secondary,{size:"sm",onClick:()=>{u("Calendar"),t()},children:[(0,a.jsx)(j.A,{className:"mr-2"}),"Time view"]})]});return{storedPreference:d,content:x}}({onSwitch:()=>{E((0,u.y)([(0,g.V_)(void 0),(0,g.Ll)(void 0),(0,g.C_)(void 0),(0,g.aB)(void 0),(0,g.J3)(void 0),(0,g.Gw)({})]))},persistPreference:!Y}),q=(null==H?void 0:H.maxReservationLength)?(0,y.Cu)(H.maxReservationLength):void 0,Z=!Y&&I;return(0,a.jsxs)(N.A,{ignoreMaxWidth:!0,containerClassName:r()({"my-20 px-28 mmd:mt-8 mmd:px-4":W<2&&!I,"mb-20 mt-0 px-0":W<2&&I,"px-4":W>1}),showFooter:!1,fullScreen:!1,children:[(0,a.jsx)(k.A,{title:t}),(0,a.jsx)(C.A,{className:"mx-auto"}),(0===W||1===W)&&(0,a.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,a.jsxs)("div",{className:r()({"flex flex-col gap-6":!0,"bg-secondary px-4 pb-6 pt-10":I}),children:[(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)(l.EY.TitleLarge,{children:s}),!!q&&!V&&(0,a.jsx)(l.EY.BodySmall,{color:"secondary",children:"Reservations are limited to a maximum of ".concat(q," per visit")})]}),(0,a.jsxs)("div",{className:r()("flex items-center justify-between gap-4",{"flex-wrap":I}),children:[(0,a.jsx)(p.A,{venueTypes:n}),G&&X]})]}),(0,a.jsx)("div",{className:"h-full w-full",children:G&&O===S.CalendarView?(0,a.jsx)("div",{className:r()({"px-4":Z}),children:(0,a.jsx)(v.g,{venueTypesFilter:n})}):(0,a.jsx)("div",{className:r()({"px-4":I}),children:_})})]}),2===W&&(0,a.jsx)(F.A,{onBack:()=>{E((0,u.y)([(0,g.dt)(1),(0,g.PC)(),(0,f.HZ)()]))},onConfirm:(e,t,s)=>{E((0,g.dt)(3)),M(e),z(t),R(s)}}),3===W&&(0,a.jsx)(L.A,{clientSecret:B,customerId:P,onBack:()=>{E((0,g.dt)(2))}})]})}},7933:(e,t,s)=>{"use strict";s.d(t,{U:()=>_});var a=s(78488),i=s(48339),l=s(57179),n=s(63127),r=s(17563),c=s(81204),o=s(60766),d=s(71885),u=s(73957),x=s(24846),m=s(50596),h=s(87601),f=s(53),g=s(46738),y=s(68513),v=s(39556),p=s(56093);let j=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=(0,o.wA)(),{loginWithPopup:s}=(0,h.WB)(),a=(0,p.D)(),{facilities:i}=(0,y.DC)(),{onVenueSelect:l,onEnableRecurrenceChange:n,onFacilitySelect:r,customGuestCheck:d}=e;return(0,c.useCallback)(e=>async(c,o,u)=>{let x=(0,g.X)({facilitySettings:e.info.settings,venueSettings:c.info.settings});if(d){if(!await d(x.requiresHouseholdMember))return}else x.requiresHouseholdMember&&!a&&await s();l&&l(c,e),r&&r(e),n&&n((0,f.e)({facilitySettings:e.info.settings,venueSettings:c.info.settings}).enableRecurrenceSetting),t((0,v.Gk)("".concat(i,"/").concat(u)))},[t,i,a,s,l,n,r,d])};var w=s(45738),A=s(80553),b=s(48113),S=s(25280),C=s(59187),N=s(98348);let k=()=>(0,a.jsxs)(S.A,{className:"mb-6 flex w-full flex-col rounded-md mmd:flex-col",sx:{boxShadow:"4px 4px 4px rgba(203, 203, 203, 0.25)"},children:[(0,a.jsxs)("div",{className:"relative inline-block h-44 min-h-44 w-full rounded-t-md",children:[(0,a.jsx)(C.A,{variant:"rectangular",className:"h-full w-full rounded-t-md",animation:"wave"}),(0,a.jsxs)("div",{className:"absolute left-6 top-6 space-y-4",children:[(0,a.jsx)(C.A,{variant:"text",width:200,height:32,sx:{bgcolor:"rgba(255,255,255,0.3)"}}),(0,a.jsx)(C.A,{variant:"rectangular",width:120,height:32,sx:{bgcolor:"rgba(255,255,255,0.2)"}})]})]}),(0,a.jsx)(S.A,{className:"flex grow flex-col rounded-b-md bg-white p-6 shadow-border",children:[,,].map((e,t)=>(0,a.jsx)(S.A,{className:"px-0 pb-4 pt-6 first:pt-0 last:pb-0",children:(0,a.jsx)("div",{className:"w-full flex-grow",children:(0,a.jsx)("div",{className:"flex w-full flex-col",children:(0,a.jsxs)("div",{className:"flex items-center justify-between msm:flex-col mmd:items-start",children:[(0,a.jsxs)("div",{className:"space-y-2 md:pl-2 mmd:py-2",children:[(0,a.jsx)(C.A,{variant:"text",width:"40%",height:24}),(0,a.jsxs)(S.A,{className:"flex space-x-2",children:[(0,a.jsx)(C.A,{variant:"rectangular",width:60,height:60}),(0,a.jsx)(C.A,{variant:"rectangular",width:60,height:60}),(0,a.jsx)(C.A,{variant:"rectangular",width:60,height:60})]}),(0,a.jsx)(C.A,{variant:"text",width:"30%",height:16})]}),(0,a.jsx)("div",{className:"flex items-center justify-center gap-2 mmd:mt-4",children:(0,a.jsx)(C.A,{variant:"rectangular",width:100,height:36})})]})})})},t))})]}),F=e=>{let{facility:t,isLoading:s,error:i,onClickHandler:l}=e;return s?(0,a.jsx)(k,{}):i||!t?null:(0,a.jsx)(N.Ay,{facilityAndVenue:t,onClickHandler:l})};var L=s(37867);function _(e){let{bookingStatuses:t,venueTypeString:s,venueTypes:h,onChooseFacility:f,customGuestCheck:p}=e;(0,A.bs)();let S=(0,r.useRouter)().query,C=(0,b.el)(S.onBehalfOf),N=(0,o.d4)(y.Cf),{isPlatformAdministrator:k,isResident:_}=(0,m.u)(),T=(0,o.d4)(v.YO),E=(0,o.d4)(v.N8),H=(0,v.gr)(),I=(0,c.useMemo)(()=>E.map(e=>e.id),[E]),{selectedVenue:V,selectedFacility:W,enableRecurrence:B,setEnableRecurrence:M,setVenue:P,setFacility:z,closeDialog:R,isDialogOpen:Y}=(()=>{let[e,t]=(0,c.useState)(),[s,a]=(0,c.useState)(),[i,l]=(0,c.useState)(w.tDZ);return{selectedVenue:e,selectedFacility:s,enableRecurrence:i,setEnableRecurrence:l,openDialog:(e,s)=>{t(e),s&&a(s)},setVenue:e=>{t(e)},setFacility:e=>{a(e)},closeDialog:()=>{t(void 0),a(void 0)},isDialogOpen:!!e}})(),{loadedFacilities:D,loadingFacilityIds:G,loadMore:O,loadInitialBatch:X,hasMore:q,loadingInitialBatch:Z,loadingMore:U,reset:K,totalLoaded:Q,totalTarget:$}=(e=>{let{organizationId:t,venueTypes:s,reservationDate:a,bookingStatuses:i,isPlatformAdministrator:l,isResident:n,sports:r,allFacilityIds:o,initialBatchSize:d,incrementBatchSize:m}=e,[h,f]=(0,c.useState)([]),[g,y]=(0,c.useState)(0),[v,p]=(0,c.useState)(!0),[j,w]=(0,c.useState)(!0),[A,b]=(0,c.useState)(!1),[S,C]=(0,c.useState)(null),N=(0,c.useCallback)((e,t)=>o.slice(e,e+t),[o]),k=(0,c.useCallback)(async e=>{if(!a)return x.A.error("[useIntersectionFacilityLoader] No reservation date provided"),null;try{let c=await (0,u.Pw)({organization_id:t,facility_ids:[e],venue_types:s,reservation_date:a,booking_statuses:i,isPlatformAdministrator:l,isResident:n,sports:r});return(null==c?void 0:c[0])||null}catch(t){return x.A.error("[useIntersectionFacilityLoader] Error loading facility ".concat(e,":"),t),null}},[t,s,a,i,l,n,r]),F=(0,c.useCallback)(async e=>{if(0===e.length)return;let t=await Promise.allSettled(e.map(async e=>{let t=await k(e);return{facilityId:e,data:t}}));f(s=>{let a=s.map(e=>e.facilityId);return[...s,...t.map((t,s)=>"fulfilled"===t.status?{facilityId:t.value.facilityId,data:t.value.data,loading:!1,error:void 0}:{facilityId:e[s],data:null,loading:!1,error:"Failed to load facility"}).filter(e=>!a.includes(e.facilityId))]})},[k]),L=(0,c.useCallback)(async()=>
1{if(!a||0===o.length)return void w(!1);let e=N(0,d);await F(e),y(d),p(d<o.length),w(!1)},[a,o,d,N,F]),_=(0,c.useCallback)(()=>{let e=N(g,m);if(0===e.length||g>=o.length)return void p(!1);j||A||(b(!0),F(e).then(()=>{let t=g+e.length;y(t),t>=o.length?p(!1):p(!0)}).finally(()=>{b(!1)}))},[g,o,m,j,A,N,F]),T=(0,c.useCallback)(()=>{f([]),y(0),p(!0),w(!0),b(!1),C(null)},[]),E=h.filter(e=>null!==e.data),H=E.length,I=h.length-E.length,V=o.length-I;return{loadedFacilities:E,loadingFacilityIds:h.filter(e=>e.loading).map(e=>e.facilityId),hasMore:v,loadMore:_,loadInitialBatch:L,loadingInitialBatch:j,loadingMore:A,error:S,reset:T,totalLoaded:H,totalTarget:V}})({organizationId:N,allFacilityIds:I,venueTypes:h,reservationDate:T,bookingStatuses:t,initialBatchSize:2,incrementBatchSize:1,isPlatformAdministrator:k,isResident:_,sports:H.length>0?H:void 0}),{loadMoreRef:J}=(0,d.X)({onLoadMore:O}),ee=j({onVenueSelect:P,onEnableRecurrenceChange:M,onFacilitySelect:z,customGuestCheck:p});return(0,c.useEffect)(()=>{K(),X()},[X,I,T,H,K]),(0,a.jsxs)("div",{children:[Z&&(0,a.jsxs)("div",{className:"flex w-full justify-center py-8",children:[(0,a.jsx)(l.A,{}),(0,a.jsxs)(i.EY.BodySmall,{className:"ml-4",children:["Loading ",s,"..."]})]}),!Z&&(0,a.jsxs)(n.A,{children:[D.map(e=>(0,a.jsx)(F,{facility:e.data,isLoading:G.includes(e.facilityId),error:e.error,onClickHandler:e.data?ee(e.data):()=>{}},e.facilityId)),(0,a.jsx)("div",{ref:J,className:"flex justify-center py-4",children:q&&Q<$&&(0,a.jsx)(a.Fragment,{children:U?(0,a.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,a.jsx)(l.A,{size:20}),(0,a.jsxs)(i.EY.BodySmall,{color:"secondary",children:["Loading more ",s,"..."]})]}):(0,a.jsxs)(i.EY.BodySmall,{color:"secondary",className:"opacity-50",children:["Scroll to see more ",s]})})}),$>0&&Q<$&&(0,a.jsx)("div",{className:"py-2 text-center",children:(0,a.jsxs)(i.EY.Label,{color:"secondary",children:["Showing ",Q," of ",$," ",s]})})]}),!Z&&0===D.length&&!q&&(0,a.jsx)("div",{className:"flex flex-row items-center justify-center py-8",children:(0,a.jsxs)(i.EY.BodyLarge,{color:"secondary",children:["We're sorry! Your search returned no available ",s,"."]})}),V&&(0,a.jsx)(L.A,{selectedVenue:V,selectedFacilityTitle:null==W?void 0:W.info.title,onConfirm:f,open:Y,onClose:R,venueTypes:h,bookingStatuses:t,enableRecurrence:B,userId:C,showMultipleVenues:!(0,g.X)({facilitySettings:null==W?void 0:W.info.settings,venueSettings:V.info.settings}).requiresHouseholdMember})]})}},11724:(e,t,s)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/[org]/reservation/sports-facility",function(){return s(79624)}])},18358:(e,t,s)=>{"use strict";s.d(t,{au:()=>d,Ay:()=>u});var a=s(78488),i=s(81204);s(60766);var l=s(72788),n=s(65382),r=s(49191),c=s(40904);s(68513),s(66886),s(48339),s(39556),s(48113);var o=s(7933);let d=[l.gWH.MultipurposeField,l.gWH.TurfField,l.gWH.Course,l.gWH.LapLane,l.gWH.Rink,l.gWH.Pool,l.gWH.Gym,l.gWH.GreenSpace,l.gWH.CommunalFacility],u=e=>{var t;let{onChooseField:s,venueTypesFilter:l=d}=e,{getAvailableFacilitiesBookingStatuses:u}=(0,r.Z5)(),{loginGuestWithPopup:x,checkIsGuest:m}=(0,c.s)(),h=null!=(t=null==u?void 0:u.fieldReservations)?t:n._d,f=(0,i.useCallback)(async e=>!m(e)||(await x(),!1),[m,x]);return(0,a.jsx)(o.U,{bookingStatuses:h,venueTypes:l,venueTypeString:"sports facilities",onChooseFacility:s,customGuestCheck:f})}},60133:(e,t,s)=>{"use strict";var a=s(61576);t.A=void 0;var i=a(s(23691)),l=s(78488);t.A=(0,i.default)([(0,l.jsx)("path",{d:"M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2M12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8"},"0"),(0,l.jsx)("path",{d:"M12.5 7H11v6l5.25 3.15.75-1.23-4.5-2.67z"},"1")],"AccessTime")},79624:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>o});var a=s(78488),i=s(60766),l=s(5717),n=s(18358),r=s(89074),c=s(39556);let o=()=>{let e=(0,i.wA)(),{reservationPageTitles:t}=r.S.useContext();return(0,a.jsx)(l.Q,{pageTitle:"Sports Facility Reservation",title:(null==t?void 0:t.sportsFacility)||"Sports Facilities",venueTypes:n.au,calendarV1Availability:"flag-gated",listViewContent:(0,a.jsx)(n.Ay,{onChooseField:()=>{e((0,c.dt)(2))}})})}},99317:(e,t,s)=>{"use strict";s.d(t,{A:()=>j});var a=s(78488),i=s(86255),l=s(49119),n=s(81881),r=s(67214),c=s(25280),o=s(42756),d=s(59174),u=s(85585),x=s(63127),m=s(82417),h=s(21845),f=s(42155),g=s.n(f),y=s(81204),v=s(61277);let p={weekday:"short",year:"numeric",month:"short",day:"numeric",hour:"numeric",minute:"numeric"},j=e=>{let{className:t}=e,{notifications:s}=(0,v.t)(),[f,j]=(0,y.useState)(!1);return(0,a.jsxs)(a.Fragment,{children:[s.length>0&&(0,a.jsx)(l.A,{className:g()("my-4 w-fit px-2",t),severity:"warning",action:(0,a.jsx)(n.A,{onClick:()=>j(!0),children:"View"}),children:"There are important notifications from city staff that may affect your reservation."}),(0,a.jsxs)(r.A,{open:f,onClose:()=>j(!1),fullWidth:!0,scroll:"paper",children:[(0,a.jsxs)(c.A,{display:"flex",justifyContent:"space-between",children:[(0,a.jsxs)(o.A,{className:"px-0 py-4",children:[(0,a.jsx)(d.A,{className:"text-28",children:"Notifications From Staff"}),(0,a.jsx)(d.A,{variant:"body1",className:"text-16",children:"These may affect your upcoming reservation"})]}),(0,a.jsx)("div",{onClick:()=>
1j(!1),style:{width:"min-content",height:"min-content",cursor:"pointer"},children:(0,a.jsx)(i.A,{fontSize:"large"})})]}),(0,a.jsx)(u.A,{dividers:!0,className:"px-0 py-8",children:(0,a.jsx)(x.A,{className:"space-y-2",disablePadding:!0,children:s.map((e,t)=>(0,a.jsx)(m.Ay,{button:!0,children:(0,a.jsxs)("div",{className:"md:p-2 mmd:py-2",children:[(0,a.jsxs)(d.A,{className:"mb-2 font-medium",children:["Updated on"," ",new Date(e.created_at).toLocaleDateString("en-us",p)]}),(0,a.jsxs)(d.A,{color:"secondary",className:"mb-2 text-14 mmd:max-w-[145px]",children:['"',e.message,'"']})]})},"response-list-".concat(t)))})}),(0,a.jsx)(h.A,{children:(0,a.jsx)(n.A,{variant:"outlined",color:"primary",onClick:()=>j(!1),size:"large",className:"h-[40px]",children:"Close"})})]})]})}}},e=>{e.O(0,[7643,5214,9869,3661,5799,2599,4105,320,3630,8344,1958,6123,4098,6055,6482,6943,9436,789,8668,7763,4543,1724,4488,2224,8385,3862,2242,3804,3310,5959,1670,9470,4067,5738,636,6593,8792],()=>e(e.s=11724)),_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.