PageSourceSearch

https://hub-workspace.infinitearea.com/assets/BookingViewFactory-24LNwifg.js

js infinitearea.com collected 2026-10-05 06:14:48 UTC 5,769 bytes, 1 lines download raw bytes

1import{j as e}from"./vendor-puck-lPnaRYA0.js";import{u as ie}from"./useTrackStorePage-_-pZ4UlJ.js";import{u as F,e as M,d as _,r as o,L as ce,f as le,N as ue}from"./vendor-react-TOOSQ9Q-.js";import{P as f,R as H,O,b as T,au as de,dd as me,d as A,u as K,de as U,J as z,l as E,g as P,aw as ge,df as W,N as V,dg as q,a as pe,K as he,b$ as D,a7 as xe}from"./index-dcVfDZSV.js";import{u as w}from"./vendor-i18n-eTj0Pfmx.js";import{L as G}from"./LoadingGrid-V3c-3EZ3.js";import{F as je}from"./FloorPlanCanvas-YB3yJq9M.js";import{L as J}from"./LoadingOverlay-Ms1Tnmph.js";import{N as Se}from"./NoResults-y-7y02d7.js";import{a as I}from"./vendor-bootstrap-fxQA9rHL.js";import{M as fe}from"./MapWithLocations-shVPoC6j.js";import"./lastVisitedStorePage-sp1kLLAv.js";import"./vendor-luxon-2n2xc3QM.js";import"./vendor-calendar-WlMSM93F.js";import"./vendor-motion-BX6prKAE.js";import"./ArkSmallCard-bcGD1agf.js";import"./index-mN_LO1uJ.js";import"./ArkLargeCard-WLFrQjE5.js";import"./HorizontalOverflowFade-9eHsP9GZ.js";const be=()=>{const{t}=w("common",{useSuspense:!0});return e.jsxs(e.Fragment,{children:[e.jsx(f,{title:t("Room availability - Calendar")}),e.jsx(H,{name:O.ResourceCalendar})]})},ve=({data:t})=>{const{getRoutePath:n}=T(),d=F(),{t:r}=w(),g=de(),{floorPlans:b,resources:v}=me(),p=M(),{business:y}=A(),{httpClient:L}=K(),[R]=_(),i=R.get("floorplan_id"),h=o.useRef(t.startDateM),x=o.useRef(t.endDateM);o.useEffect(()=>{h.current=t.startDateM,x.current=t.endDateM},[t.startDateM,t.endDateM]);const c=b.map(a=>({key:String(a.Id),value:String(a.Id),label:a.Name})),j=p.type==="all"?void 0:U(p.type),k=j!=null?v.Resources.filter(a=>Number(a.SystemResourceType)===j).map(a=>String(a.Id)):void 0,{resource:m,isLoading:N}=z(L,i?E.bookings.floorPlans.getById(Number(i),y):null),S=a=>{g.updateQuerystring([{name:"floorplan_id",value:String(a)}])};o.useEffect(()=>{c.length===1&&!i&&S(Number(c[0].value))},[c,i]);const C=o.useCallback(a=>{d(n(P.public_booking_edit,void 0,{resource_id:a.ResourceId,start:h.current.toISO(),end:x.current.toISO(),desk:a.Id}))},[t.startDateM.toISO(),t.endDateM.toISO()]);return c.length===0?e.jsx("section",{className:"pt-0 mt-7",children:e.jsx(I,{children:e.jsx(Se,{title:r("No floor plans are available yet"),subtitle:r("Browse the available resources in the list view instead."),children:e.jsx(ce,{className:"btn btn-primary mt-4 align-self-center",to:n(P.public_booking_view,{view:"list"},"keep"),children:r("Back to list view")})})})}):e.jsx("section",{className:"pt-0 mt-7",children:e.jsx(I,{children:e.jsx("div",{className:"bg-mode shadow rounded-3",children:e.jsxs("div",{style:{height:"calc(100vh - 270px)"},children:[e.jsx("div",{className:"text-center p-2",children:e.jsx(ge,{className:"p-3 rounded-3 w-100 text-start",title:r("Select a level"),items:c,selectedValue:String(i),onSelect:a=>S(Number(a)),searchable:!0})}),e.jsx(J,{style:{height:"calc(100vh - 350px)"},loading:i!=null&&(N||!m),children:m?.id&&e.jsx(je,{onItemSelect:C,includedResourceIds:k,canvasHeight:"calc(100vh - 350px)",start:t.startDateM,end:t.endDateM,layoutData:m})})]})})})})},ye=()=>{const t=W();return e.jsxs(e.Fragment,{children:[e.jsx(f,{title:"Home"}),e.jsxs("main",{children:[e.jsx(V,{fixedHeader:!0}),e.jsx(q,{data:t}),e.jsx(o.Suspense,{fallback:e.jsx(G,{}),children:e.jsx(ve,{data:t})})]})]})},Le=()=>{const{t}=w();return e.jsxs(e.Fragment,{children:[e.jsx(f,{title:t("Room availability - List")}),e.jsx(H,{name:O.ResourceList})]})},Re=()=>{const t=le(),[n]=_(),d=F(),{business:r,integrations:g,canAccessSection:b}=A(),{getRoutePath:v}=T(),{getResourceImageUrl:p}=pe(),y=b(he.bookings.access),L=n.get("maplat")??r.Latitude,R=n.get("maplng")??r.Longitude,i=n.get("mapzoom"),[h,x]=o.useState(Number(L)),[c,j]=o.useState(Number(R)),[k,m]=o.useState(null),[N,S]=o.useState(0),{httpClient:C}=K(),[a]=D(k,750),[B]=D(N,750),[Q]=D(t.search,750),Z=M(),X=s=>{d(`${v(P.public_booking_edit)}${t.search}&resource_id=${s}`)},Y=s=>{const{bounds:l,radiusInMeters:$,zoom:oe}=s;m(l),S($);const u=new URLSearchParams(n.toString());u.set("maplat",String(l.getCenter().lat())),u.set("maplng",String(l.getCenter().lng())),u.set("mapradius",String($)),u.set("mapzoom",String(oe??12));for(const[ne,re]of u.entries())re||u.delete(ne);d(`${t.pathname}?${u.toString()}`,{replace:!0})},ee=s=>{const l=new URLSearchParams(n.toString());x(s.lat),j(s.lng),l.set("maplat",String(s.lat)),l.set("maplng",String(s.lng)),d(`${t.pathname}?${l.toString()}`,{replace:!0})},{resource:te,isLoading:se}=z(C,y&&a&&B>0?`${E.bookings.bookingsSearch}${Q}&resourceType=${U(Z.type)}&distance=${B}&latitude=${a.getCenter().lat()}&longitude=${a.getCenter().lng()}`:null,{queryConfig:{placeholderData:s=>s}}),ae=te?.Resources.map(s=>({id:String(s.Id),description:s.ResourceTypeName,name:s.Name,image:p(r,s,500,200),lat:s.Latitude,lng:s.Longitude,type:"meeting_room",available:s.IsAvailable}))??[];return e.jsx("section",{className:"pt-0 mt-7",children:e.jsx(I,{children:e.jsx(J,{loading:se,children:e.jsxs("div",{className:"bg-mode shadow rounded-3",style:{position:"relative"},children:[e.jsx(fe,{initialLat:h,initialLng:c,initialZoom:i,apiKey:g.googleApiKey,locations:ae,onMapChange:Y,onMarkerClick:X}
1),e.jsx("div",{style:{top:20,position:"absolute",width:"calc(100% - 40px)",marginLeft:20},children:e.jsx(xe,{apiKey:g.googleApiKey,onCoordinatesSelected:s=>{ee(s)}})})]})})})})},ke=()=>{const t=W();return e.jsxs(e.Fragment,{children:[e.jsx(f,{title:"Home"}),e.jsxs("main",{children:[e.jsx(V,{fixedHeader:!0}),e.jsx(q,{data:t}),e.jsx(o.Suspense,{fallback:e.jsx(G,{}),children:e.jsx(Re,{})})]})]})},We=()=>{ie("bookings");const t=M();return t.view=="list"?e.jsx(Le,{}):t.view=="calendar"?e.jsx(be,{}):t.view=="map"?e.jsx(ke,{}):t.view=="floorplan"?e.jsx(ye,{}):e.jsx(ue,{to:"/"})};export{We as default};

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.