Spaces:
Running
Running
Cover Charge prototype v0.1.12
Browse files- CHECKSUMS.txt +12 -12
- HOW-TO-INSTALL.txt +1 -1
- README.md +1 -1
- chef-app/_expo/static/js/web/__common-c6c554815e4bb34cad819655b0244c17.js +0 -0
- chef-app/_expo/static/js/web/entry-2abe893a1768655edb418b4c27b64314.js +0 -0
- chef-app/_expo/static/js/web/index-a31eb4179b9ed3be70eb8d0cd82ecd3d.js +0 -0
- chef-app/_expo/static/js/web/index-f3b9a91d34732f43092424f9beb4b9f4.js +10 -0
- chef-app/index.html +2 -2
- chef-app/sw.js +2 -2
- customer-app/_expo/static/js/web/__common-f6f10cdb908fe43987a720e10bb9e0f5.js +0 -0
- customer-app/_expo/static/js/web/entry-1c0e8f423517db12030897bf2de46a94.js +0 -0
- customer-app/_expo/static/js/web/index-93b1fb4a59822430dbc65ee63d8bd82a.js +0 -0
- customer-app/_expo/static/js/web/index-d66067b7a3fefef4ab21eabe87395720.js +10 -0
- customer-app/index.html +2 -2
- customer-app/sw.js +2 -2
- display-app/_expo/static/js/web/__common-df70654cbb893ed0136989be426f3560.js +0 -0
- display-app/_expo/static/js/web/entry-e88a37b9f287e5c20e8736da03641cf7.js +0 -0
- display-app/_expo/static/js/web/index-93b1fb4a59822430dbc65ee63d8bd82a.js +0 -0
- display-app/_expo/static/js/web/index-d66067b7a3fefef4ab21eabe87395720.js +10 -0
- display-app/index.html +2 -2
- display-app/manifest.webmanifest +1 -1
- display-app/sw.js +2 -2
- index.html +7 -4
- owner-app/_expo/static/js/web/__common-158cd186b0bf136d040aa77de780ee38.js +0 -0
- owner-app/_expo/static/js/web/entry-872c16fcefc35aa42a2e871ec021fee0.js +0 -0
- owner-app/_expo/static/js/web/index-07c2ec32566b9c1cbc752be67ea8efce.js +6 -0
- owner-app/_expo/static/js/web/index-0cca6a8eacc0ac399ba0280076bd37b4.js +2 -0
- owner-app/_expo/static/js/web/index-f32fc00a8379cb13e48d49c6f85ef06f.js +0 -0
CHECKSUMS.txt
CHANGED
|
@@ -1,23 +1,23 @@
|
|
| 1 |
-
Cover Charge prototype v0.1.
|
| 2 |
SHA-256 of each web app's start page, service worker, manifest and logo:
|
| 3 |
|
| 4 |
-
|
| 5 |
-
|
| 6 |
f55e319dbc2c60a4fdc484584098bc3c80b780d7ee8b8df280c30a673f94e69d owner-app/manifest.webmanifest
|
| 7 |
cc3dd9b8a359ba6c3f28d625c27cc6a01a46233311c2a5f5c8aaf09e91be8239 owner-app/brand-logo.png
|
| 8 |
-
|
| 9 |
-
|
| 10 |
18923b63d620744c81e8ae77204858313f0e3c54683b0c68a4ef6417975b92e3 staff-app/manifest.webmanifest
|
| 11 |
cc3dd9b8a359ba6c3f28d625c27cc6a01a46233311c2a5f5c8aaf09e91be8239 staff-app/brand-logo.png
|
| 12 |
-
|
| 13 |
-
|
| 14 |
559816eba2698515c255da3cb9240a338f5bf8f5a4826a64e332cf51d5522e09 customer-app/manifest.webmanifest
|
| 15 |
cc3dd9b8a359ba6c3f28d625c27cc6a01a46233311c2a5f5c8aaf09e91be8239 customer-app/brand-logo.png
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
cc3dd9b8a359ba6c3f28d625c27cc6a01a46233311c2a5f5c8aaf09e91be8239 display-app/brand-logo.png
|
| 20 |
-
|
| 21 |
-
|
| 22 |
7aa962371046330167f56dd74180ed58cba417770e3e4bae9ec8289b1837c461 chef-app/manifest.webmanifest
|
| 23 |
cc3dd9b8a359ba6c3f28d625c27cc6a01a46233311c2a5f5c8aaf09e91be8239 chef-app/brand-logo.png
|
|
|
|
| 1 |
+
Cover Charge prototype v0.1.12: web apps, plus the Cover Charge for Display tablet app for Android (downloads/android/, its SHA-256 is in downloads/android/SHA256.txt). No phone APKs were built for v0.1.2 to v0.1.12.
|
| 2 |
SHA-256 of each web app's start page, service worker, manifest and logo:
|
| 3 |
|
| 4 |
+
a1dac0025a9a055c151950303b975da7b9c4c567a5ee3aad19a850c1d9093f4f owner-app/index.html
|
| 5 |
+
94f6558b66a69535a3a2f8364aa874df2fd67ec8d7d9a913a6a6cb42b27f1fd4 owner-app/sw.js
|
| 6 |
f55e319dbc2c60a4fdc484584098bc3c80b780d7ee8b8df280c30a673f94e69d owner-app/manifest.webmanifest
|
| 7 |
cc3dd9b8a359ba6c3f28d625c27cc6a01a46233311c2a5f5c8aaf09e91be8239 owner-app/brand-logo.png
|
| 8 |
+
9ba0c93b07c9fcd4ecc273f727e6c23d2dbb352ffa5cd675566cf9752ad5314b staff-app/index.html
|
| 9 |
+
c8d833907bcb26e1a24a2c885bf36ac63a94c4ed4b6c435a2c69e1defdf926f6 staff-app/sw.js
|
| 10 |
18923b63d620744c81e8ae77204858313f0e3c54683b0c68a4ef6417975b92e3 staff-app/manifest.webmanifest
|
| 11 |
cc3dd9b8a359ba6c3f28d625c27cc6a01a46233311c2a5f5c8aaf09e91be8239 staff-app/brand-logo.png
|
| 12 |
+
ab7acc44730536e99777ed32455f24a7f8d7f7f2835a55ce274634aadebb4a44 customer-app/index.html
|
| 13 |
+
7bdda604d39727b12ba8e9de27933f17a4729800e452f5d567b303c45c88410a customer-app/sw.js
|
| 14 |
559816eba2698515c255da3cb9240a338f5bf8f5a4826a64e332cf51d5522e09 customer-app/manifest.webmanifest
|
| 15 |
cc3dd9b8a359ba6c3f28d625c27cc6a01a46233311c2a5f5c8aaf09e91be8239 customer-app/brand-logo.png
|
| 16 |
+
3eddf243e3c89ae1633068327f2e9e7a63d29061d5af66d947b83b572e89ffb4 display-app/index.html
|
| 17 |
+
a0d51cd91760e4bf65f48aa75bc2ac39c3d2109961dc86b0ad57a08c80320b0b display-app/sw.js
|
| 18 |
+
b49f1c242e5762561c197bf9d76bb50b05f2968affbe71c752c41468d792981c display-app/manifest.webmanifest
|
| 19 |
cc3dd9b8a359ba6c3f28d625c27cc6a01a46233311c2a5f5c8aaf09e91be8239 display-app/brand-logo.png
|
| 20 |
+
d188efe77f1894ef613b3cb42daa9ffa2ec3b4047ecf56e65dfebc3675024241 chef-app/index.html
|
| 21 |
+
84cbbad88ea278d3bf5f4219555402db54b802ca4d6e9e889fecb1384f9872da chef-app/sw.js
|
| 22 |
7aa962371046330167f56dd74180ed58cba417770e3e4bae9ec8289b1837c461 chef-app/manifest.webmanifest
|
| 23 |
cc3dd9b8a359ba6c3f28d625c27cc6a01a46233311c2a5f5c8aaf09e91be8239 chef-app/brand-logo.png
|
HOW-TO-INSTALL.txt
CHANGED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
Cover Charge prototype apps, v0.1.
|
| 2 |
Pilot restaurant: The Anchorage, Harbour View, Dunure
|
| 3 |
|
| 4 |
These are test versions with made-up demo data. No real payments, messages, social posts or location tracking happen.
|
|
|
|
| 1 |
+
Cover Charge prototype apps, v0.1.12 (web apps)
|
| 2 |
Pilot restaurant: The Anchorage, Harbour View, Dunure
|
| 3 |
|
| 4 |
These are test versions with made-up demo data. No real payments, messages, social posts or location tracking happen.
|
README.md
CHANGED
|
@@ -9,7 +9,7 @@ pinned: false
|
|
| 9 |
short_description: Cover Charge prototype, five web apps, demo data
|
| 10 |
---
|
| 11 |
|
| 12 |
-
# Cover Charge apps (prototype v0.1.
|
| 13 |
|
| 14 |
Web apps (PWAs) for The Anchorage, Harbour View, Dunure: Managers, Staff, the customer app, Display and Head Chef.
|
| 15 |
Each one opens in the browser and can be added to the Home screen (Chrome, Huawei Browser, Safari).
|
|
|
|
| 9 |
short_description: Cover Charge prototype, five web apps, demo data
|
| 10 |
---
|
| 11 |
|
| 12 |
+
# Cover Charge apps (prototype v0.1.12)
|
| 13 |
|
| 14 |
Web apps (PWAs) for The Anchorage, Harbour View, Dunure: Managers, Staff, the customer app, Display and Head Chef.
|
| 15 |
Each one opens in the browser and can be added to the Home screen (Chrome, Huawei Browser, Safari).
|
chef-app/_expo/static/js/web/__common-c6c554815e4bb34cad819655b0244c17.js
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
chef-app/_expo/static/js/web/entry-2abe893a1768655edb418b4c27b64314.js
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
chef-app/_expo/static/js/web/index-a31eb4179b9ed3be70eb8d0cd82ecd3d.js
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
chef-app/_expo/static/js/web/index-f3b9a91d34732f43092424f9beb4b9f4.js
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return o}});var t=r(d[0]);r(d[1]);var n=r(d[2]),u=r(d[3]),c=r(d[4]);function o(){return(0,n.canShow)('display')?(0,c.jsx)(u.DisplayBoard,{}):(0,c.jsx)(t.Redirect,{href:n.ENTRY[n.APP_VARIANT]})}},777,[785,12,787,846,6]);
|
| 2 |
+
__d(function(g,_r,_i,_a,_m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.DisplayBoard=function(){const{width:e,height:Y}=(0,n.default)(),_=e>=1e3,q=(0,T.useOwner)(e=>e.site),K=(0,y.useRestaurant)(q),X=(0,y.useOrders)(q),J=(0,y.useBookings)(q),Q=(0,y.useWaitlist)(q),Z=(0,y.useEvents)(q),ee=(0,y.useRatings)(q),se=(0,y.useAudit)(q),le=(0,y.useStore)(e=>e.menu),te=(0,y.useStore)(e=>e.walkIns[q]??0),ae=(0,y.useStore)(e=>e.alertAcks),re=((0,y.useStore)(e=>e.customer),(0,y.useStore)(e=>e.skipMinutes)),oe=(0,y.useNow)(5e3),ne=(0,T.useOwner)(e=>e.staff),ie=(0,T.useOwner)(e=>e.attendance),de=(0,T.useOwner)(e=>e.shifts),ue=(0,T.useOwner)(e=>e.chat),[ce,ge]=(0,s.useState)(!0);l.default.useEffect(()=>{(0,$.ensureAttendance)((0,f.ymd)(oe),oe),(0,v.ensureChat)(oe)},[(0,f.ymd)(oe)]);const he=ie.filter(e=>e.in&&!e.out&&oe.getTime()-new Date(e.in).getTime()<72e6&&oe.getTime()>=new Date(e.in).getTime()),pe=he.length?he.map(e=>F(ne.find(s=>s.id===e.staffId)?.name)).filter(Boolean):['Duty Manager'],[me,be]=(0,s.useState)(null),xe=me&&pe.includes(me)?me:pe[0],[fe,je]=(0,s.useState)(''),[ye,we]=(0,s.useState)('2'),ke=(0,f.ymd)(oe),Te=(0,C.useFrontDoor)(ke,e>Y),ve=(0,B.useDisplaySettings)(q),Ce=ve.privacy,$e=(0,B.usePlan)(q),Be=(0,B.useFloor)(e=>e.live[q]),[Se,Re]=(0,s.useState)('floor'),[Pe,Me]=(0,s.useState)(''),[De,Ae]=(0,s.useState)(null),[Ie,Le]=(0,s.useState)(null),[ze,Ee]=(0,s.useState)(null),[He,Ne]=(0,s.useState)(!1),[We,Oe]=(0,s.useState)(null);l.default.useEffect(()=>{if(!We)return;const e=setTimeout(()=>Oe(null),4500);return()=>clearTimeout(e)},[We]);const Fe=(e,s)=>Ee({title:e,body:s}),Ve=e=>Fe(`Guest details \xb7 ${e.time}`,(0,E.bookingDetails)(e)),Ge=(0,s.useMemo)(()=>(0,p.forecastToday)(K,J,X,Z,oe),[K,J,X,Z,oe.getTime()/6e4|0]),Ue=J.filter(e=>e.date===ke).sort((e,s)=>e.time.localeCompare(s.time)),Ye=te+Ue.filter(e=>e.walkIn&&['seated','finished'].includes(e.status)).reduce((e,s)=>e+s.partySize,0),qe=Ue.filter(e=>!e.walkIn&&'cancelled'!==e.status).reduce((e,s)=>e+s.partySize,0),Ke=Q.filter(e=>'waiting'===e.status||'notified'===e.status).sort((e,s)=>e.number-s.number),Xe=X.filter(e=>!['collected','closed','cancelled'].includes(e.status)).sort((e,s)=>Number('new'===s.status)-Number('new'===e.status)||(e.slotTime??e.createdAt).localeCompare(s.slotTime??s.createdAt)),Je=X.filter(e=>['collected','closed'].includes(e.status)).length,Qe=(0,x.takeawaySlots)(K,X,oe),Ze=Ge.nextHour?Math.min(1.6,Math.max(.8,Ge.nextHour.covers/(.75*K.settings.capacityPerHour))):1,es=(e,s)=>!!(0,z.statusBlock)(e,s,(0,z.linkedBooking)(e,J)),ss=e=>{const s=(0,z.nextStep)(e,(0,z.linkedBooking)(e,J));return!(!s||'table'===s&&!['ready','served'].includes(e.status))},ls=Xe.filter(e=>e.allergies.length&&ss(e)),ts=Ue.filter(e=>e.allergies.length&&!e.allergyAck&&['confirmed','seated'].includes(e.status)&&!Xe.some(s=>s.allergies.length&&(0,z.linkedBooking)(s,[e]))),as=Xe.flatMap(e=>(0,b.readinessFor)(e,K,oe).map(s=>({...s,order:e}))),rs=as.filter(e=>'due'===e.state||'overdue'===e.state),os=as.filter(e=>'upcoming'===e.state).sort((e,s)=>e.due.getTime()-s.due.getTime()),ns=ee.filter(e=>e.stars<=2&&!ae[`rating:${e.id}`]),is=Xe.filter(e=>'new'===e.status&&!e.allergies.length&&(0,f.minsBetween)(new Date(e.createdAt),oe)>=0),ds=le.filter(e=>e.restaurantId===q&&e.soldOut),us=(se.filter(e=>'stamp'===e.kind||'giftcard'===e.kind).slice(0,4),ls.length+ts.length+rs.length+ns.length+is.length),cs=(0,s.useMemo)(()=>(0,S.floorView)($e,J,X,Be??{},oe,K.settings.turnMins),[$e,J,X,Be,oe.getTime()]),gs=$e.areas.some(e=>e.id===Pe)?Pe:$e.areas[0]?.id??'',hs=Object.fromEntries($e.areas.map(e=>{const s=$e.tables.filter(s=>s.areaId===e.id);return[e.id,`${s.filter(e=>'free'===cs[e.name]?.status).length}/${s.length} free`]})),ps=(0,I.hoursFor)(K,oe),ms=ps?(0,f.addMins)(ps.open,-ps.open.getMinutes()):new Date(`${ke}T12:00:00`),bs=ps?(0,f.addMins)(ps.close,120):new Date(`${ke}T23:00:00`),xs=async(e,s)=>{const l=cs[e]?.booking;if(!l||e===s)return;const t=cs[s]?.status;if(t&&!['free','soon'].includes(t))return void Oe('dirty'===t?`Table ${s} needs clearing first.`:`Table ${s} is ${S.STATUS[t].label.toLowerCase()} \u2014 pick a free table.`);await y.repo.bookings.update(l.id,{table:s});const a=Be?.[e]?.stage;B.useFloor.getState().setLive(q,s,{stage:a??'seated',dirty:!1}),B.useFloor.getState().setLive(q,e,{stage:void 0,dirty:!0}),Oe(`${(0,A.privName)(l,Ce)} moved Table ${e} \u2192 ${s}. Table ${e} needs clearing.`)},fs=e=>Fe(`Order ${e.ref} \xb7 details`,(0,W.jsxs)(o.default,{style:{gap:4},children:[(0,W.jsx)(u.T,{weight:"semibold",children:F(e.customerName)}),e.allergies.length?(0,W.jsxs)(u.T,{weight:"bold",colour:k.colours.red,children:["ALLERGY: ",e.allergies.map(e=>`${(0,h.allergenLabel)(e.allergen)} (${(0,h.severityLabel)(e.severity)})`).join(', ')]}):(0,W.jsx)(u.Muted,{children:"No allergies declared."}),e.lines.filter(e=>e.overridden).map((e,s)=>(0,W.jsxs)(u.T,{colour:k.colours.red,children:["OVERRIDE: ",e.name," contains ",e.contains.map(h.allergenLabel).join(', ')]},s)),e.lines.map((e,s)=>(0,W.jsxs)(u.T,{size:15,children:[e.qty,"\xd7 ",e.name,e.notes?` \xb7 \u201c${e.notes}\u201d`:'']},s))]})),js=Ge.hours,ys=Math.max(K.settings.capacityPerHour,...js.map(e=>e.coversHigh)),ws=(0,W.jsxs)(V,{title:`Bookings & waitlist \xb7 ${(0,f.niceDate)(oe)}`,right:(0,W.jsx)(u.Badge,{kind:"gold",label:`${qe} booked \xb7 ${Ye} walk-in covers`}),children:[0===Ue.length?(0,W.jsx)(u.Muted,{children:"No bookings today."}):null,Ue.map(e=>{const s='confirmed'===e.status&&(0,f.minsBetween)(new Date(`${e.date}T${e.time}:00`),oe)>15;return(0,W.jsxs)(o.default,{style:[u.styles.card,{padding:10,opacity:['finished','noshow','cancelled'].includes(e.status)?.5:1,borderColor:e.allergies.length?k.colours.red:s?k.colours.amber:k.colours.border}],children:[(0,W.jsxs)(u.Row,{style:{justifyContent:'space-between'},children:[(0,W.jsxs)(u.T,{weight:"semibold",children:[e.time," \xb7 ",Ce?`${(0,A.privName)(e,!0)} \xb7 ${e.partySize}`:(0,C.walkInLabel)(e)]}),(0,W.jsx)(u.Badge,{kind:'seated'===e.status?'green':'noshow'===e.status?'red':'neutral',label:'noshow'===e.status?'No-show':e.status})]}),(0,W.jsxs)(u.Muted,{children:[e.table?`Table ${e.table}`:e.walkIn?'Table to assign':'Table TBC',e.walkIn?` \xb7 ${e.ref}`:'','none'!==e.security?" \xb7 "+('deposit'===e.security?'Deposit':'Card saved'):'',e.notes?Ce?' \xb7 \u270e':` \xb7 ${e.notes}`:'']}),e.allergies.length&&Ce?(0,W.jsxs)(u.Row,{gap:6,children:[(0,W.jsx)(u.Badge,{kind:"red",label:"\u26a0 Allergy"}),(0,W.jsx)(u.Button,{small:!0,kind:"ghost",label:"Details",onPress:()=>Ve(e)})]}):null,e.allergies.length&&!Ce?(0,W.jsx)(u.Row,{wrap:!0,gap:4,children:e.allergies.map(e=>(0,W.jsx)(u.Badge,{kind:"red",label:`${(0,h.allergenLabel)(e.allergen)} \u2014 ${(0,h.severityLabel)(e.severity)}`},e.allergen))}):null,s?(0,W.jsx)(u.T,{size:13,colour:k.colours.amber,children:"Running late \u2014 15+ min past booking time"}):null,!e.table&&e.walkIn&&'seated'===e.status?(0,W.jsx)(u.Button,{label:"Assign table",onPress:()=>Te.assignTable(e)}):null,'confirmed'===e.status?(0,W.jsxs)(u.Row,{gap:6,children:[(0,W.jsx)(u.Button,{small:!0,label:"Seat",onPress:()=>y.repo.bookings.setStatus(e.id,'seated')}),(0,W.jsx)(u.Button,{small:!0,kind:"secondary",label:"No-show",onPress:()=>y.repo.bookings.setStatus(e.id,'noshow')})]}):'seated'===e.status?(0,W.jsx)(u.Button,{small:!0,kind:"secondary",label:"Finished",onPress:()=>y.repo.bookings.setStatus(e.id,'finished')}):null]},e.id)}),(0,W.jsxs)(u.Row,{style:{justifyContent:'space-between',marginTop:6},children:[(0,W.jsxs)(u.T,{weight:"semibold",colour:k.colours.gold,children:["Waitlist (",Ke.length,")"]}),(0,W.jsxs)(u.Muted,{children:["~",(0,j.estimateWait)(Ke.length+1,K.settings.turnMins,Ze)," min for a new party (est.)"]})]}),Ke.map((e,s)=>(0,W.jsxs)(o.default,{style:[u.styles.card,{padding:10}],children:[(0,W.jsxs)(u.Row,{style:{justifyContent:'space-between'},children:[(0,W.jsxs)(u.T,{weight:"semibold",children:["#",e.number," ",(0,A.pv)(e.name,Ce)," \xb7 ",e.partySize]}),(0,W.jsxs)(u.Muted,{children:["waiting ",(0,f.minsBetween)(new Date(e.joinedAt),oe)," min \xb7 est. ",(0,j.estimateWait)(s+1,K.settings.turnMins,Ze)," min"]})]}),'notified'===e.status?(0,W.jsx)(u.Badge,{kind:"green",label:"Notified \u2014 table ready"}):null,(0,W.jsxs)(u.Row,{gap:6,children:['waiting'===e.status?(0,W.jsx)(u.Button,{small:!0,kind:"secondary",label:"Notify",onPress:()=>y.repo.waitlist.setStatus(e.id,'notified')}):null,(0,W.jsx)(u.Button,{small:!0,label:"Seat",onPress:()=>y.repo.waitlist.setStatus(e.id,'seated')}),(0,W.jsx)(u.Button,{small:!0,kind:"ghost",label:"Remove",onPress:()=>y.repo.waitlist.setStatus(e.id,'removed')})]})]},e.id)),(0,W.jsxs)(u.Row,{gap:6,children:[(0,W.jsx)(r.default,{accessibilityLabel:"Waitlist name",placeholder:"Name for the waitlist",placeholderTextColor:"#7D776C",value:fe,onChangeText:je,style:[u.styles.input,{flex:1,paddingVertical:6}]}),(0,W.jsx)(r.default,{accessibilityLabel:"Party size",value:ye,onChangeText:we,keyboardType:"number-pad",style:[u.styles.input,{width:50,paddingVertical:6}]}),(0,W.jsx)(u.Button,{small:!0,label:"Add",disabled:fe.trim().length<2,onPress:()=>{y.repo.waitlist.join(q,fe.trim(),Math.max(1,Number(ye)||2)),je('')}})]})]}),ks=(0,W.jsxs)(V,{title:"Live orders & kitchen tickets",right:(0,W.jsxs)(u.Row,{gap:6,children:[(0,W.jsx)(u.Chip,{label:"Tickets",selected:ce,onPress:()=>ge(!0)}),(0,W.jsx)(u.Chip,{label:"Full orders",selected:!ce,onPress:()=>ge(!1)})]}),children:[(0,W.jsxs)(u.Muted,{children:[Xe.length," live \xb7 ",Je," done today"]}),0===Xe.length?(0,W.jsx)(u.Muted,{children:"No live orders."}):null,ce?(0,W.jsxs)(o.default,{style:{flexDirection:'row',flexWrap:'wrap',gap:8},children:[Xe.filter(e=>['new','acknowledged','preparing'].includes(e.status)).map(e=>{const s=Math.max(0,(0,f.minsBetween)(new Date(e.createdAt),oe)),l=s>=20?k.colours.red:s>=12?k.colours.amber:k.colours.green;return(0,W.jsxs)(o.default,{testID:`ticket-${e.ref}`,style:{width:210,backgroundColor:'#F4EFE3',borderRadius:6,padding:8,gap:3,borderTopWidth:6,borderTopColor:e.allergies.length?k.colours.red:l},children:[(0,W.jsxs)(u.Row,{style:{justifyContent:'space-between'},children:[(0,W.jsx)(u.T,{weight:"bold",colour:"#111",children:'table'===e.type?`TABLE ${e.tableNo}`:`TAKEAWAY ${e.slotTime?(0,f.hm)(new Date(e.slotTime)):''}`}),(0,W.jsxs)(u.T,{size:13,weight:"bold",colour:s>=20?'#B3261E':'#333',children:[s,"m"]})]}),(0,W.jsxs)(u.T,{size:12,colour:"#444",children:[e.ref," \xb7 ",e.status.toUpperCase()]}),e.allergies.length?(0,W.jsx)(o.default,{style:{backgroundColor:'#B3261E',borderRadius:4,padding:4},children:(0,W.jsxs)(u.T,{size:13,weight:"bold",colour:"#fff",children:["\u26a0 ",Ce?'ALLERGY \u2014 see details':e.allergies.map(e=>(0,h.allergenLabel)(e.allergen)).join(', ').toUpperCase()]})}):null,e.lines.map((e,s)=>(0,W.jsxs)(u.T,{size:15,weight:"semibold",colour:"#111",children:[e.qty,"\xd7 ",e.name,e.choices.length?` (${e.choices.join(', ')})`:'']},s)),e.lines.some(e=>e.notes)?(0,W.jsx)(u.T,{size:12,colour:"#444",children:Ce?'Notes \u2014 see details':`Notes: ${e.lines.filter(e=>e.notes).map(e=>e.notes).join(' \xb7 ')}`}):null,Ce&&(e.allergies.length||e.lines.some(e=>e.notes))?(0,W.jsx)(u.Button,{small:!0,kind:"secondary",label:"Details",onPress:()=>fs(e)}):null,e.allergies.length?(0,W.jsx)(L.AllergyChain,{o:e,me:xe,compact:!0}):null,'new'===e.status?(0,W.jsx)(u.Button,{small:!0,label:es(e,'acknowledged')?'Sign off allergy first':'Acknowledge',disabled:es(e,'acknowledged'),onPress:()=>y.repo.orders.setStatus(e.id,'acknowledged',xe)}):null,'acknowledged'===e.status?(0,W.jsx)(u.Button,{small:!0,label:"Start",onPress:()=>'takeaway'===e.type?y.repo.orders.acknowledgeReadiness(e.id,'cook',xe):y.repo.orders.setStatus(e.id,'preparing',xe)}):null,'preparing'===e.status?(0,W.jsx)(u.Button,{small:!0,kind:"success",label:'takeaway'===e.type?'Ready':'Food out',disabled:es(e,'takeaway'===e.type?'ready':'served'),onPress:()=>y.repo.orders.setStatus(e.id,'takeaway'===e.type?'ready':'served',xe)}):null]},e.id)}),Xe.filter(e=>['ready','served'].includes(e.status)).map(e=>(0,W.jsxs)(o.default,{style:{width:210,backgroundColor:k.colours.surface2,borderRadius:6,padding:8,gap:3,borderTopWidth:6,borderTopColor:k.colours.green},children:[(0,W.jsxs)(u.Row,{style:{justifyContent:'space-between'},children:[(0,W.jsx)(u.T,{weight:"bold",children:'table'===e.type?`Table ${e.tableNo}`:`Takeaway ${e.ref}`}),(0,W.jsx)(u.Badge,{kind:U(e.status),label:e.status.toUpperCase()})]}),(0,W.jsxs)(u.Muted,{children:[(0,A.pv)(e.customerName,Ce),'here'===e.customerSignal?' \xb7 CUSTOMER IS HERE':'']}),e.allergies.length?(0,W.jsx)(L.AllergyChain,{o:e,me:xe,compact:!0}):null,'ready'===e.status?(0,W.jsx)(u.Button,{small:!0,label:"Collected",testID:`collected-${e.ref}`,disabled:es(e,'collected'),onPress:()=>y.repo.orders.setStatus(e.id,'collected',xe)}):null,'served'===e.status?(0,W.jsx)(u.Button,{small:!0,kind:"secondary",label:"Paid at till",onPress:()=>y.repo.orders.payTable(e.id,{shares:99})}):null]},e.id))]}):null,ce?null:Xe.map(e=>{const s=e.allergies.length>0&&ss(e),l=e.lines.filter(e=>e.overridden),t=e.lines.filter(e=>e.contains.length||e.may.length);return(0,W.jsxs)(o.default,{testID:`order-${e.ref}`,style:[u.styles.card,{padding:10,borderColor:s?k.colours.red:'ready'===e.status?k.colours.green:k.colours.border,borderWidth:s?2:1}],children:[(0,W.jsxs)(u.Row,{style:{justifyContent:'space-between'},children:[(0,W.jsxs)(u.Row,{gap:6,children:[(0,W.jsx)(u.T,{weight:"bold",children:e.ref}),(0,W.jsx)(u.Badge,{kind:'takeaway'===e.type?'gold':'blue',label:'takeaway'===e.type?`Takeaway \xb7 ${e.slotTime?(0,f.hm)(new Date(e.slotTime)):''}`:`Table ${e.tableNo}`})]}),(0,W.jsx)(u.Badge,{kind:U(e.status),label:e.status.toUpperCase()})]}),(0,W.jsxs)(u.Muted,{children:[(0,A.pv)(e.customerName,Ce)," \xb7 ",(0,m.gbp)(e.subtotal)," \xb7 ",e.paid>=e.total?'Paid (demo)':e.paid>0?`Part paid ${(0,m.gbp)(e.paid)}`:'Unpaid \u2014 bill at end',e.customerSignal?" \xb7 "+('here'===e.customerSignal?'CUSTOMER IS HERE':'Customer on the way'):'']}),e.allergies.length&&Ce?(0,W.jsxs)(u.Row,{gap:6,children:[(0,W.jsx)(u.Badge,{kind:"red",label:s?'\u26a0 Allergy: sign-off needed':'\u26a0 Allergy (signed off)'}),(0,W.jsx)(u.Button,{small:!0,kind:"ghost",label:"Details",onPress:()=>fs(e)})]}):null,e.allergies.length&&!Ce?(0,W.jsxs)(o.default,{style:{backgroundColor:k.colours.redBg,borderRadius:8,padding:8,borderLeftWidth:5,borderLeftColor:k.colours.red},children:[(0,W.jsxs)(u.T,{weight:"bold",colour:"#FFE3DF",children:["ALLERGY: ",e.allergies.map(e=>`${(0,h.allergenLabel)(e.allergen)} (${(0,h.severityLabel)(e.severity)})`).join(', ')]}),l.length?(0,W.jsxs)(u.T,{size:14,weight:"semibold",colour:"#FFE3DF",children:["Customer OVERRODE block on: ",l.map(e=>`${e.name} [contains ${e.contains.map(h.allergenLabel).join(', ')}]`).join('; ')]}):null,t.filter(e=>!e.overridden&&e.may.length).map((e,s)=>(0,W.jsxs)(u.T,{size:14,colour:"#FFE2A8",children:["May contain: ",e.name," [",e.may.map(h.allergenLabel).join(', '),"]"]},s))]}):null,e.allergies.length?(0,W.jsx)(L.AllergyChain,{o:e,me:xe}):null,e.lines.map((e,s)=>(0,W.jsxs)(u.T,{size:15,children:[e.qty,"\xd7 ",e.name,e.choices.length?` \u2014 ${e.choices.join(', ')}`:'',e.notes?Ce?' \xb7 \u270e':` \xb7 \u201c${e.notes}\u201d`:'']},s)),(0,W.jsxs)(u.Row,{wrap:!0,gap:6,children:['new'===e.status?(0,W.jsx)(u.Button,{small:!0,label:es(e,'acknowledged')?'Sign off allergy first':'Acknowledge',disabled:es(e,'acknowledged'),onPress:()=>y.repo.orders.setStatus(e.id,'acknowledged',xe)}):null,'acknowledged'===e.status?(0,W.jsx)(u.Button,{small:!0,label:"Start preparing",onPress:()=>'takeaway'===e.type?y.repo.orders.acknowledgeReadiness(e.id,'cook',xe):y.repo.orders.setStatus(e.id,'preparing',xe)}):null,'preparing'===e.status&&'takeaway'===e.type?(0,W.jsx)(u.Button,{small:!0,kind:"success",label:"Mark ready (notify customer)",disabled:es(e,'ready'),onPress:()=>y.repo.orders.setStatus(e.id,'ready',xe)}):null,'preparing'===e.status&&'table'===e.type?(0,W.jsx)(u.Button,{small:!0,kind:"success",label:"Food out",disabled:es(e,'served'),onPress:()=>y.repo.orders.setStatus(e.id,'served',xe)}):null,'ready'===e.status?(0,W.jsx)(u.Button,{small:!0,label:"Collected",disabled:es(e,'collected'),onPress:()=>y.repo.orders.setStatus(e.id,'collected',xe)}):null,'served'===e.status?(0,W.jsx)(u.Button,{small:!0,kind:"secondary",label:"Paid at till",onPress:()=>y.repo.orders.payTable(e.id,{shares:99})}):null]})]},e.id)})]}),Ts=({colour:e,title:s,children:l})=>(0,W.jsxs)(o.default,{style:{backgroundColor:k.colours.surface2,borderRadius:10,padding:10,borderLeftWidth:6,borderLeftColor:e,gap:4},children:[(0,W.jsx)(u.T,{weight:"bold",colour:e,children:s}),l]}),vs={cook:'START COOKING',bag:'BAG IT',ready:'READY'},Cs=(0,W.jsxs)(V,{title:"Allergy & takeaway alerts",right:(0,W.jsx)(u.Badge,{kind:us?'red':'green',label:`${us} need action`}),children:[ls.map(e=>(0,W.jsxs)(Ts,{colour:k.colours.red,title:`ALLERGY \u2014 ${e.ref} ${'table'===e.type?`(Table ${e.tableNo})`:'(takeaway)'}`,children:[Ce?(0,W.jsx)(u.Button,{small:!0,kind:"secondary",label:"Show allergy details",onPress:()=>fs(e)}):(0,W.jsx)(u.T,{size:15,children:e.allergies.map(e=>`${(0,h.allergenLabel)(e.allergen)} \u2014 ${(0,h.severityLabel)(e.severity)}`).join('; ')}),Ce?null:e.lines.filter(e=>e.overridden).map((e,s)=>(0,W.jsxs)(u.T,{size:14,colour:k.colours.red,weight:"semibold",children:["OVERRIDE: ",e.name," contains ",e.contains.map(h.allergenLabel).join(', ')]},s)),(0,W.jsx)(L.AllergyChain,{o:e,me:xe,compact:!0})]},e.id)),ts.map(e=>(0,W.jsxs)(Ts,{colour:k.colours.red,title:`ALLERGY \u2014 booking ${e.time} ${(0,A.privName)(e,Ce)} (${e.partySize})`,children:[Ce?(0,W.jsx)(u.Button,{small:!0,kind:"secondary",label:"Show allergy details",onPress:()=>Ve(e)}):(0,W.jsx)(u.T,{size:15,children:e.allergies.map(e=>`${(0,h.allergenLabel)(e.allergen)} \u2014 ${(0,h.severityLabel)(e.severity)}`).join('; ')}),(0,W.jsx)(L.BookingAllergyChain,{b:e,me:xe})]},e.id)),rs.map(e=>(0,W.jsxs)(Ts,{colour:'overdue'===e.state?k.colours.red:k.colours.amber,title:`${vs[e.stage]} \u2014 ${e.order.ref} \xb7 pickup ${(0,f.hm)(new Date(e.order.slotTime))}${'overdue'===e.state?' \xb7 OVERDUE':''}`,children:[(0,W.jsx)(u.T,{size:14,children:e.detail}),(0,W.jsxs)(u.Muted,{children:["Due ",(0,f.hm)(e.due)," (slot \u2212 prep \u2212 ",K.settings.bufferMins," min buffer)",e.order.allergies.length?' \xb7 \u26a0 allergy order':'']}),'ready'===e.stage?(0,W.jsx)(u.Button,{small:!0,kind:"success",label:"Mark ready (notify customer)",onPress:()=>y.repo.orders.setStatus(e.orderId,'ready',xe)}):(0,W.jsx)(u.Button,{small:!0,label:'cook'===e.stage?'Started cooking':'Bagged & checked',disabled:es(e.order,'preparing'),onPress:()=>y.repo.orders.acknowledgeReadiness(e.orderId,e.stage,xe)})]},e.id)),is.map(e=>(0,W.jsx)(Ts,{colour:k.colours.amber,title:`New order ${e.ref} \u2014 not yet acknowledged`,children:(0,W.jsx)(u.Button,{small:!0,label:"Acknowledge",onPress:()=>y.repo.orders.setStatus(e.id,'acknowledged',xe)})},e.id)),ns.map(e=>(0,W.jsxs)(Ts,{colour:k.colours.red,title:`LOW RATING ${e.stars}/5 \u2014 ${e.context}`,children:[Ce?(0,W.jsx)(u.Button,{small:!0,kind:"secondary",label:"Show comment",onPress:()=>Fe(`Rating ${e.stars}/5`,(0,W.jsxs)(u.T,{children:[F(e.customerName),e.comment?`: \u201c${e.comment}\u201d`:'']}))}):(0,W.jsxs)(u.T,{size:15,children:[e.customerName,e.comment?`: \u201c${e.comment}\u201d`:'']}),(0,W.jsx)(u.Muted,{children:"Manager: speak to the guest while they\u2019re still here."}),(0,W.jsx)(u.Button,{small:!0,kind:"secondary",label:`Handled \u2014 ${xe}`,onPress:()=>y.repo.alerts.acknowledge(`rating:${e.id}`,xe)})]},e.id)),0===us?(0,W.jsx)(u.Muted,{children:"No alerts need action."}):null,os.length?(0,W.jsxs)(o.default,{style:{gap:4},children:[(0,W.jsx)(u.T,{weight:"semibold",colour:k.colours.gold,children:"Upcoming takeaway timings"}),os.slice(0,6).map(e=>(0,W.jsxs)(u.T,{size:14,children:[(0,f.hm)(e.due)," \xb7 ",vs[e.stage]," \xb7 ",e.order.ref," (pickup ",(0,f.hm)(new Date(e.order.slotTime)),")"]},e.id))]}):null,ds.length?(0,W.jsx)(Ts,{colour:k.colours.muted,title:"Sold out",children:(0,W.jsx)(u.T,{size:14,children:ds.map(e=>e.name).join(', ')})}):null,(0,W.jsxs)(o.default,{style:{gap:2,marginTop:6},children:[(0,W.jsx)(u.T,{weight:"semibold",colour:k.colours.gold,children:"Allergy log"}),Ce?(0,W.jsxs)(u.Muted,{children:[se.filter(e=>'allergy'===e.kind).length," entries today \u2014 full log in the Managers app (privacy mode)."]}):se.filter(e=>'allergy'===e.kind).slice(0,5).map(e=>(0,W.jsxs)(u.T,{size:13,colour:"#FFD9D4",children:[(0,f.hm)(new Date(e.at))," \xb7 ",e.text]},e.id))]})]}),$s=de.filter(e=>e.day===(0,$.weekday)(oe)&&!he.some(s=>s.staffId===e.staffId)&&60*e.start>60*oe.getHours()+oe.getMinutes()).sort((e,s)=>e.start-s.start),Bs=ue.filter(e=>'all'===e.ch&&!e.removed).sort((e,s)=>Number(!!s.pinned)-Number(!!e.pinned)||s.at.localeCompare(e.at)).slice(0,6),Ss=(0,W.jsxs)(o.default,{style:{flex:.8,gap:10},children:[(0,W.jsxs)(V,{title:"Who's on",right:(0,W.jsx)(u.Badge,{kind:"green",label:`${he.length} clocked in`}),children:[0===he.length?(0,W.jsx)(u.Muted,{children:"Nobody clocked in yet."}):null,he.map(e=>{const s=ne.find(s=>s.id===e.staffId),l=de.find(s=>s.staffId===e.staffId&&s.day===(0,$.weekday)(oe));return(0,W.jsxs)(u.Row,{style:{justifyContent:'space-between'},children:[(0,W.jsx)(N.StaffAvatar,{id:e.staffId,size:34}),(0,W.jsxs)(o.default,{style:{flex:1},children:[(0,W.jsx)(u.T,{weight:"semibold",children:F(s?.name)}),(0,W.jsxs)(u.Muted,{children:[s?.job,l?` \xb7 rota ${(0,$.fmtH)(l.start)}\u2013${(0,$.fmtH)(l.end)}`:'']})]}),(0,W.jsx)(u.Badge,{kind:"green",label:`in ${(0,f.hm)(new Date(e.in))}`})]},e.id)}),$s.map(e=>(0,W.jsxs)(u.Muted,{children:["Due in ",(0,$.fmtH)(e.start),": ",F(ne.find(s=>s.id===e.staffId)?.name)]},e.id))]}),(0,W.jsxs)(V,{title:"Staff announcements",right:(0,W.jsx)(u.Muted,{children:"All staff chat"}),children:[0===Bs.length?(0,W.jsx)(u.Muted,{children:"No announcements."}):null,Bs.map(e=>(0,W.jsxs)(o.default,{style:{gap:2,borderLeftWidth:3,borderLeftColor:e.pinned?k.colours.gold:k.colours.border,paddingLeft:8},children:[(0,W.jsxs)(u.T,{size:12,colour:e.pinned?k.colours.gold:k.colours.muted,children:[e.pinned?'\ud83d\udccc ':'','system'===e.from?'Cover Charge':F(ne.find(s=>s.id===e.from)?.name)," \xb7 ",(0,f.hm)(new Date(e.at))]}),(0,W.jsx)(u.T,{size:14,children:e.text??(e.photo?`Photo: ${e.photo.caption}`:'')})]},e.id)),(0,W.jsx)(u.Muted,{children:"Read-only on the display. Post from Cover Charge for Staff or Cover Charge for Managers."})]})]}),Rs=_||e>=900,Ps=(0,W.jsx)(E.WaitlistPanel,{rid:q,r:K,plan:$e,view:cs,todays:Ue,waiting:Ke,now:oe,privacy:Ce,busy:Ze,onToast:Oe}),Ms=(0,W.jsx)(E.PacePanel,{r:K,fc:Ge,todays:Ue,now:oe,walkInCount:te,staffOn:he.length||1,onSummary:()=>Ne(!0)}),Ds=s=>Rs?(0,W.jsx)(t.default,{style:{width:e>=1200?340:300,flexGrow:0},contentContainerStyle:{gap:10,paddingBottom:20},children:s}):(0,W.jsx)(o.default,{style:{gap:10},children:s}),As=(0,W.jsxs)(o.default,{style:{flex:1,flexDirection:Rs?'row':'column',gap:10,padding:12,paddingTop:6},children:[(0,W.jsxs)(o.default,{style:{flex:1,gap:6,minHeight:Rs?void 0:420},children:[(0,W.jsx)(E.ArrivalsStrip,{todays:Ue,now:oe,privacy:Ce}),(0,W.jsx)(P.AreaTabs,{plan:$e,area:gs,onPick:Me,counts:hs}),Ie?(0,W.jsxs)(u.Row,{gap:8,style:{backgroundColor:k.colours.goldTint,borderRadius:10,padding:8},children:[(0,W.jsxs)(u.T,{weight:"semibold",colour:k.colours.goldLight,style:{flex:1},children:["Moving the party from Table ",Ie,": tap the new table (or drag it there)."]}),(0,W.jsx)(u.Button,{small:!0,kind:"ghost",label:"Cancel",onPress:()=>Le(null)})]}):null,(0,W.jsx)(o.default,{style:{flex:1,minHeight:Rs?300:Math.min(520,.62*e)},children:(0,W.jsx)(R.FloorCanvas,{plan:$e,areaId:gs,mode:"live",fit:"contain",view:cs,privacy:Ce,sectionColours:!0,turnBase:K.settings.turnMins,highlight:Ie?[Ie]:void 0,onTap:e=>{Ie?(e.name!==Ie&&xs(Ie,e.name),Le(null)):Ae(e.name)},onDrop:(e,s)=>xs(e.name,s.name)})}),(0,W.jsx)(E.Legend,{})]}),Ds((0,W.jsxs)(W.Fragment,{children:[Ps,Ms]}))]}),Is=(0,W.jsxs)(o.default,{style:{flex:1,flexDirection:Rs?'row':'column',gap:10,padding:12,paddingTop:6},children:[(0,W.jsx)(o.default,{style:{flex:1,minHeight:420},children:(0,W.jsx)(M.Timeline,{plan:$e,bookings:Ue,now:oe,privacy:Ce,turnBase:K.settings.turnMins,t0:ms,t1:bs,onOpen:e=>{const s=(0,B.tablesOf)(e.table)[0];s&&cs[s]?Ae(s):Ve(e)}})}),Ds((0,W.jsx)(W.Fragment,{children:Ps}))]}),Ls=(0,W.jsxs)(t.default,{style:{flex:1},contentContainerStyle:{padding:12,gap:10,flexGrow:1},scrollEnabled:!_,children:[(0,W.jsxs)(u.Row,{wrap:!0,style:{gap:6},children:[(0,W.jsx)(u.Muted,{children:"Signing off as (who's on):"}),pe.map(e=>(0,W.jsx)(u.Chip,{label:e,selected:xe===e,onPress:()=>be(e)},e))]}),(0,W.jsxs)(o.default,{testID:"forecast-strip",style:{gap:8},children:[(0,W.jsxs)(u.Row,{wrap:!0,gap:8,style:{alignItems:'stretch'},children:[(0,W.jsx)(G,{label:"Next hour"+(Ge.nextHour?` \xb7 ${String(Ge.nextHour.hour).padStart(2,'0')}:00\u2013${String(Ge.nextHour.hour+1).padStart(2,'0')}:00`:''),badge:"Estimate",value:Ge.nextHour?`${Ge.nextHour.coversLow}\u2013${Ge.nextHour.coversHigh} covers`:Ge.open?'Kitchen closing':'Closed',sub:Ge.nextHour?`${Ge.nextHour.booked} booked + ~${Ge.nextHour.walkIns} walk-ins \xb7 ~${Ge.nextHour.takeaway} takeaway (${Ge.nextHour.takeawayPlaced} placed)`:void 0}),(0,W.jsx)(G,{label:"Rest of today",badge:"Estimate",value:Ge.open?`${Ge.restOfDay.low}\u2013${Ge.restOfDay.high} covers`:'\u2014',sub:Ge.open?`${Ge.restOfDay.booked} booked \xb7 ~${Ge.restOfDay.takeaway} takeaway orders \xb7 ${Ye} walk-in covers seated so far`:void 0}),(0,W.jsx)(G,{label:"Waitlist",value:`${Ke.length} part${1===Ke.length?'y':'ies'}`,sub:`${Ke.reduce((e,s)=>e+s.partySize,0)} covers \xb7 next wait ~${(0,j.estimateWait)(Ke.length+1,K.settings.turnMins,Ze)} min (est.)`}),(0,W.jsx)(G,{label:"Takeaway slots",value:K.settings.takeawayPaused?'PAUSED':`${Qe.filter(e=>!e.full).length} open`,sub:`Cap ${K.settings.slotCap} per ${K.settings.slotMinutes} min`,children:(0,W.jsxs)(u.Row,{gap:8,children:[(0,W.jsx)(a.default,{accessibilityLabel:"Pause takeaway slots",value:K.settings.takeawayPaused,onValueChange:e=>y.repo.restaurants.updateSettings(q,{takeawayPaused:e}),trackColor:{true:k.colours.redSolid,false:'#444'}}),(0,W.jsx)(u.T,{size:14,children:K.settings.takeawayPaused?'Resume':'Pause'})]})}),(0,W.jsx)(G,{label:"Walk-ins seated (today)",value:`${Ye} covers`,sub:"Use Walk-in above; or quick-count here without a table",children:(0,W.jsx)(u.Row,{gap:6,children:[1,2,4].map(e=>(0,W.jsx)(u.Button,{small:!0,kind:"secondary",label:`+${e}`,onPress:()=>y.repo.waitlist.addWalkIn(q,e)},e))})})]}),(0,W.jsxs)(u.Row,{wrap:!0,gap:12,style:{backgroundColor:k.colours.surface,borderRadius:12,padding:10,borderWidth:1,borderColor:k.colours.border,alignItems:'flex-end'},children:[(0,W.jsxs)(o.default,{style:{gap:2,flexBasis:340,flexGrow:1},children:[(0,W.jsxs)(u.Row,{gap:6,children:[(0,W.jsx)(u.T,{weight:"semibold",colour:k.colours.gold,children:"Forecast \u2014 suggested actions"}),(0,W.jsx)(u.Badge,{kind:"amber",label:"ESTIMATE"})]}),Ge.suggestions.map((e,s)=>(0,W.jsxs)(u.T,{size:14,children:["\u2022 ",e]},s)),(0,W.jsxs)(u.Muted,{children:[Ge.flags.length?`Calendar flags today: ${Ge.flags.join(', ')} \xb7 `:'',"Baseline v1: confirmed bookings + example weekday/hour averages + expected walk-ins (",Math.round(100*K.settings.walkInShare),"% share). ",w.EXAMPLE_ACCURACY,"."]})]}),(0,W.jsx)(u.Row,{gap:4,style:{alignItems:"flex-end"},children:js.map(e=>{const s=Ge.nextHour?.hour===e.hour;return(0,W.jsxs)(o.default,{style:{alignItems:'center',width:30},children:[(0,W.jsx)(u.T,{size:11,colour:k.colours.muted,children:e.covers}),(0,W.jsxs)(o.default,{style:{height:70,width:18,justifyContent:'flex-end',borderBottomWidth:1,borderColor:k.colours.border},children:[(0,W.jsx)(o.default,{style:{height:e.walkIns/ys*70,backgroundColor:s?k.colours.goldLight:'#6B5A3A'}}),(0,W.jsx)(o.default,{style:{height:e.booked/ys*70,backgroundColor:s?k.colours.gold:'#9C7C45'}})]}),(0,W.jsx)(u.T,{size:11,colour:s?k.colours.gold:k.colours.muted,children:e.hour})]},e.hour)})})]})]}),(0,W.jsxs)(o.default,{style:{flexDirection:_?'row':'column',gap:10,flex:_?1:void 0,minHeight:_?380:void 0},children:[ws,(0,W.jsx)(o.default,{style:{flex:1.5,gap:10},children:ks}),Cs,Ss]})]}),zs=(0,W.jsx)(t.default,{style:{flex:1},contentContainerStyle:{padding:12,gap:10},children:(0,W.jsx)(P.FloorEditor,{rid:q,compact:!Rs,maxH:Math.max(300,Y-330)})});return(0,W.jsxs)(i.SafeAreaView,{style:{flex:1,backgroundColor:k.colours.bg},children:[(0,W.jsxs)(u.Row,{wrap:!0,style:{paddingHorizontal:14,paddingVertical:6,gap:10,borderBottomWidth:1,borderBottomColor:k.colours.border},children:[(0,W.jsx)(c.RestaurantBrand,{rid:K.id,size:48,sub:"Display \xb7 Harbour View, Dunure"}),(0,W.jsx)(o.default,{style:{flex:1}}),Ce?(0,W.jsx)(u.Badge,{kind:"gold",label:"\ud83d\udd12 Privacy on"}):(0,W.jsx)(u.Badge,{kind:"amber",label:"Privacy off"}),us?(0,W.jsx)(H.default,{accessibilityRole:"button",accessibilityLabel:"Open alerts",onPress:()=>Re('board'),children:(0,W.jsx)(u.Badge,{kind:"red",label:`${us} alert${us>1?'s':''}`})}):(0,W.jsx)(u.Badge,{kind:"green",label:"All clear"}),(0,W.jsx)(u.T,{size:20,weight:"bold",colour:k.colours.gold,children:(0,f.hm)(oe)}),(0,W.jsx)(u.Muted,{children:(0,f.niceDate)(oe)}),(0,W.jsx)(u.Button,{small:!0,kind:"ghost",label:"Demo +15 min",onPress:()=>re(15)})]}),(0,W.jsxs)(o.default,{testID:"front-door-bar",style:{flexDirection:'row',gap:12,paddingHorizontal:14,paddingTop:8,paddingBottom:4},children:[(0,W.jsx)(u.Button,{label:"Walk-in",onPress:Te.openWalkIn,testID:"add-walkin",style:{flex:1,minHeight:72,borderRadius:18}}),(0,W.jsx)(u.Button,{label:"New booking",onPress:Te.openBooking,testID:"add-booking",style:{flex:1,minHeight:72,borderRadius:18}})]}),(0,W.jsxs)(u.Row,{style:{paddingHorizontal:14,paddingVertical:4,gap:6},children:[O.map(e=>{const s=Se===e.id;return(0,W.jsx)(H.default,{testID:`view-${e.id}`,accessibilityRole:"tab",accessibilityLabel:e.label,accessibilityState:{selected:s},onPress:()=>Re(e.id),style:{minHeight:48,paddingHorizontal:18,justifyContent:'center',borderRadius:12,borderBottomWidth:3,borderBottomColor:s?k.colours.gold:'transparent',backgroundColor:s?k.colours.goldTint:'transparent'},children:(0,W.jsx)(u.T,{weight:"semibold",colour:s?k.colours.goldLight:k.colours.muted,children:e.label})},e.id)}),(0,W.jsx)(o.default,{style:{flex:1}}),(0,W.jsx)(u.Badge,{kind:"gold",label:`${qe} booked \xb7 ${Ye} walk-in covers`})]}),'floor'===Se||'timeline'===Se?Rs?'floor'===Se?As:Is:(0,W.jsx)(t.default,{style:{flex:1},contentContainerStyle:{flexGrow:1},children:'floor'===Se?As:Is}):'plan'===Se?zs:Ls,Te.elements,De?(0,W.jsx)(E.TableSheet,{rid:q,name:De,view:cs,plan:$e,todays:Ue,now:oe,privacy:Ce,turnBase:K.settings.turnMins,onClose:()=>Ae(null),onWalkIn:e=>Te.openWalkInAt(e),onMove:e=>Le(e),onDetails:Ve}):null,ze?(0,W.jsx)(E.DetailsPanel,{title:ze.title,onClose:()=>Ee(null),children:ze.body}):null,He?(0,W.jsx)(E.ServiceSummary,{r:K,todays:Ue,orders:X,waitlistAll:Q,walkInCount:te,onClose:()=>Ne(!1)}):null,We?(0,W.jsx)(o.default,{testID:"floor-toast",pointerEvents:"none",style:{position:'absolute',left:0,right:0,bottom:24,alignItems:'center',zIndex:900},children:(0,W.jsx)(o.default,{style:{backgroundColor:k.colours.surface2,borderColor:k.colours.gold,borderWidth:1.5,borderRadius:14,paddingVertical:10,paddingHorizontal:16,maxWidth:640},children:(0,W.jsx)(u.T,{weight:"semibold",children:We})})}):null,(0,W.jsx)(D.Screensaver,{rid:q,idleMins:ve.idleMins,pinOn:ve.pinOn,pin:ve.pin,tonightCards:ve.tonightCards})]})};var s=_r(d[0]),l=e(s),t=e(_r(d[1])),a=e(_r(d[2])),r=e(_r(d[3])),o=e(_r(d[4])),n=e(_r(d[5])),i=_r(d[6]),u=_r(d[7]),c=_r(d[8]),h=_r(d[9]),p=_r(d[10]),m=_r(d[11]),b=_r(d[12]),x=_r(d[13]),f=_r(d[14]),j=_r(d[15]),y=_r(d[16]),w=_r(d[17]),k=_r(d[18]),T=_r(d[19]),v=_r(d[20]),C=_r(d[21]),$=_r(d[22]),B=_r(d[23]),S=_r(d[24]),R=_r(d[25]),P=_r(d[26]),M=_r(d[27]),D=_r(d[28]),A=_r(d[29]),I=_r(d[30]),L=_r(d[31]),z=_r(d[32]),E=_r(d[33]),H=e(_r(d[34])),N=_r(d[35]),W=_r(d[36]);const O=[{id:'floor',label:'Floor'},{id:'timeline',label:'Timeline'},{id:'board',label:'Board'},{id:'plan',label:'Edit plan'}],F=e=>(e??'').replace(' (example)','');function V({title:e,right:s,children:l,flex:a=1}){return(0,W.jsxs)(o.default,{style:{flex:a,backgroundColor:k.colours.surface,borderRadius:14,borderWidth:1,borderColor:k.colours.border,overflow:'hidden',minHeight:200},children:[(0,W.jsxs)(u.Row,{style:{justifyContent:'space-between',paddingHorizontal:12,paddingVertical:10,borderBottomWidth:1,borderBottomColor:k.colours.border,backgroundColor:k.colours.surface2},children:[(0,W.jsx)(u.T,{weight:"semibold",colour:k.colours.gold,children:e}),s]}),(0,W.jsx)(t.default,{contentContainerStyle:{padding:10,gap:10},children:l})]})}function G({label:e,value:s,sub:l,badge:t,children:a}){return(0,W.jsxs)(o.default,{style:{flex:1,minWidth:170,backgroundColor:k.colours.surface,borderRadius:12,padding:10,borderWidth:1,borderColor:k.colours.border,gap:2},children:[(0,W.jsxs)(u.Row,{style:{justifyContent:'space-between'},children:[(0,W.jsx)(u.T,{size:13,colour:k.colours.muted,weight:"medium",children:e}),t?(0,W.jsx)(u.Badge,{kind:"amber",label:t}):null]}),(0,W.jsx)(u.T,{size:24,weight:"bold",colour:k.colours.text,children:s}),l?(0,W.jsx)(u.T,{size:13,colour:k.colours.muted,children:l}):null,a]})}const U=e=>'new'===e?'red':'ready'===e?'green':'preparing'===e?'amber':'served'===e?'blue':'neutral'},846,[12,133,253,255,109,269,271,790,855,791,842,793,856,794,795,843,796,857,797,802,858,847,859,860,848,849,850,851,853,852,792,861,862,854,245,863,6]);
|
| 3 |
+
__d(function(g,_r,_i,_a,m,_e,_d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"TABLES",{enumerable:!0,get:function(){return x}}),_e.useTableNames=p,_e.resetTableLive=j,_e.useTableUse=k,Object.defineProperty(_e,"walkInLabel",{enumerable:!0,get:function(){return w}}),_e.TablePicker=C,_e.WalkInSheet=S,_e.AssignTableSheet=v,_e.UndoToast=I,_e.NewBookingSheet=P,_e.useFrontDoor=function(e,s){const[l,o]=(0,t.useState)(!1),[n,i]=(0,t.useState)(!1),[a,r]=(0,t.useState)(null),[d,u]=(0,t.useState)(null),c=(0,y.jsxs)(y.Fragment,{children:[l?(0,y.jsx)(S,{wide:s,initialTable:l.table,onClose:()=>o(!1),onSeated:r}):null,n?(0,y.jsx)(P,{wide:s,date:e,onClose:()=>i(!1)}):null,d?(0,y.jsx)(v,{booking:d,onClose:()=>u(null)}):null,a?(0,y.jsx)(I,{booking:a,onDone:()=>r(null)}):null]});return{openWalkIn:()=>o({}),openWalkInAt:e=>o({table:e}),openBooking:()=>i(!0),assignTable:u,elements:c}};var t=_r(_d[0]),s=e(t);_r(_d[1]);var l=e(_r(_d[2])),o=e(_r(_d[3])),n=e(_r(_d[4])),i=_r(_d[5]),a=_r(_d[6]),r=_r(_d[7]),d=_r(_d[8]),u=_r(_d[9]),c=_r(_d[10]),b=_r(_d[11]),h=_r(_d[12]),f=_r(_d[13]),y=_r(_d[14]);const x=Array.from({length:12},(e,t)=>String(t+1));function p(e){const t=(0,f.usePlan)(e);return t.areas.flatMap(e=>t.tables.filter(t=>t.areaId===e.id).map(e=>e.name))}function j(e,t){(0,f.tablesOf)(t).forEach(t=>f.useFloor.getState().setLive(e,t,{stage:'seated',dirty:!1}))}function k(e,t){const s=(0,r.useBookings)(e),l=(0,r.useOrders)(e),o=p(e),n=(0,f.useFloor)(t=>t.live[e])??{},i=(0,c.ymd)(t),a={};for(const e of o)a[e]=n[e]?.blocked?{busy:!0,label:'Blocked'}:n[e]?.dirty?{busy:!0,label:'Needs clearing'}:{busy:!1,label:'Free'};for(const e of s)if(e.date===i&&e.table)for(const s of(0,f.tablesOf)(e.table))if(a[s])if('seated'===e.status)a[s]={busy:!0,label:`${e.walkIn?'Walk-in':`${e.name.slice(0,1)}.`} \xb7 ${e.partySize}`};else if('confirmed'===e.status&&!a[s].busy){const l=(0,c.minsBetween)(t,new Date(`${e.date}T${e.time}:00`));l>=-15&&l<=90&&(a[s]={...a[s],soon:`Booked ${e.time}`})}for(const e of l)'table'===e.type&&e.tableNo&&a[e.tableNo]&&!['closed','cancelled','collected'].includes(e.status)&&!a[e.tableNo].busy&&(a[e.tableNo]={busy:!0,label:'Open order'});return a}const w=e=>e.walkIn?`Walk-in \xb7 ${e.partySize}`:`${e.name} \xb7 ${e.partySize}`;function C({use:e,value:t,onPick:s,big:o,best:i}){const a=Object.keys(e);return(0,y.jsx)(n.default,{style:{flexDirection:'row',flexWrap:'wrap',gap:8},testID:"table-picker",children:a.map(a=>{const r=e[a],d=t===a,u=!!i&&(0,f.tablesOf)(i)[0]===a&&!d;return(0,y.jsxs)(l.default,{accessibilityRole:"button",accessibilityLabel:`Table ${a}, ${r.busy?`in use (${r.label})`:r.soon?`free, ${r.soon}`:'free'}`,accessibilityState:{selected:d},onPress:()=>s(a),style:{width:o?92:64,minHeight:56,borderRadius:12,borderWidth:d?2.5:1.5,padding:6,alignItems:'center',justifyContent:'center',borderColor:d?b.colours.gold:r.busy?b.colours.red:b.colours.green,backgroundColor:d?b.colours.goldTint:r.busy?b.colours.redBg:b.colours.surface2},children:[(0,y.jsx)(h.T,{weight:"bold",size:18,colour:d?b.colours.goldLight:b.colours.text,children:a}),(0,y.jsx)(h.T,{size:11,colour:r.busy?'#FFD9D4':r.soon?'#FFE2A8':'#CFF3D7',center:!0,children:r.busy?'Blocked'===r.label||'Needs clearing'===r.label?r.label:'In use':r.soon??'Free'}),u?(0,y.jsx)(n.default,{testID:"best-table",style:{position:'absolute',top:-8,right:-6,backgroundColor:b.colours.gold,borderRadius:8,paddingHorizontal:5},children:(0,y.jsx)(h.T,{size:10,weight:"bold",colour:b.colours.onGold,children:"BEST"})}):null]},a)})})}const T=[1,2,3,4,5,6,7,8];function S({onClose:e,onSeated:d,wide:x,initialTable:p}){const{rid:w,r:S,now:v}=(0,a.useCtx)(15e3),I=k(w,v),[P,$]=(0,t.useState)(2),[D,F]=(0,t.useState)(!1),[R,W]=(0,t.useState)(p??null),B=(0,f.usePlan)(w),z=(0,r.useBookings)(w),M=s.default.useMemo(()=>{const e=Object.fromEntries(Object.entries(I).map(([e,t])=>[e,{status:t.busy?'seated':'free'}]));return(0,u.suggestTable)(B,z.filter(e=>e.date===(0,c.ymd)(v)),e,P,v,(0,u.turnFor)(P,S.settings.turnMins))?.table??null},[B,z,I,P,v.getTime()]),[N,O]=(0,t.useState)(!1),[A,L]=(0,t.useState)(''),E=(e,t=String(e),s=()=>{F(!1),$(e)})=>{const o='9+'===t?D:!D&&P===e;return(0,y.jsx)(l.default,{accessibilityRole:"button",accessibilityLabel:'9+'===t?'Party of 9 or more':`Party of ${e}`,accessibilityState:{selected:o},onPress:s,style:{width:x?64:60,height:x?64:56,borderRadius:14,borderWidth:2,borderColor:b.colours.gold,alignItems:'center',justifyContent:'center',backgroundColor:o?b.colours.gold:'transparent'},children:(0,y.jsx)(h.T,{weight:"bold",size:22,colour:o?b.colours.onGold:b.colours.gold,children:t})},t)},_=(0,y.jsxs)(h.Row,{gap:12,style:{justifyContent:'center'},children:[(0,y.jsx)(l.default,{accessibilityRole:"button",accessibilityLabel:"One fewer",onPress:()=>$(e=>Math.max(9,e-1)),style:{width:56,height:56,borderRadius:28,borderWidth:2,borderColor:b.colours.gold,alignItems:'center',justifyContent:'center'},children:(0,y.jsx)(h.T,{size:26,colour:b.colours.gold,children:"\u2212"})}),(0,y.jsx)(h.T,{weight:"bold",size:26,children:P}),(0,y.jsx)(l.default,{accessibilityRole:"button",accessibilityLabel:"One more",onPress:()=>$(e=>Math.min(40,e+1)),style:{width:56,height:56,borderRadius:28,borderWidth:2,borderColor:b.colours.gold,alignItems:'center',justifyContent:'center'},children:(0,y.jsx)(h.T,{size:26,colour:b.colours.gold,children:"+"})})]}),H=(0,y.jsxs)(n.default,{style:{gap:8,flex:x?1:void 0},children:[(0,y.jsx)(h.T,{weight:"semibold",children:"How many people?"}),(0,y.jsxs)(n.default,{style:{flexDirection:'row',flexWrap:'wrap',gap:8},testID:"walkin-party",children:[T.map(e=>E(e)),E(9,'9+',()=>{F(!0),$(e=>e>=9?e:9)})]}),D?_:null]}),U=(0,y.jsxs)(n.default,{style:{gap:8,flex:x?1.3:void 0},children:[(0,y.jsxs)(h.Row,{style:{justifyContent:'space-between'},children:[(0,y.jsxs)(h.T,{weight:"semibold",children:["Table ",(0,y.jsx)(h.T,{colour:b.colours.muted,size:14,children:"(optional)"})]}),R?(0,y.jsx)(h.Button,{small:!0,kind:"ghost",label:"Clear table",onPress:()=>W(null)}):null]}),(0,y.jsx)(C,{use:I,value:R,onPick:e=>W(R===e?null:e),big:x,best:M}),M&&!R?(0,y.jsxs)(h.Muted,{children:["Best fit for ",P,": Table ",M," (smallest free table, fewest clashes)."]}):null,'staff'!==i.APP_VARIANT?(0,y.jsx)(h.Muted,{children:"Using Wix Tables too? Also mark the table there; this prototype doesn't connect to it."}):null]});return(0,y.jsxs)(h.Sheet,{visible:!0,onClose:e,title:`Walk-in \xb7 ${(0,c.hm)(v)}`,maxWidth:x?900:void 0,testID:"walkin-sheet",children:[(0,y.jsx)(h.Button,{label:`Seat walk-in \xb7 ${P} ${1===P?'person':'people'}${R?` \xb7 Table ${R}`:''}`,onPress:async()=>{const t=await r.repo.bookings.seatWalkIn(w,P,R??void 0,A);j(w,R??void 0),d(t),e()},testID:"seat-walkin",style:{minHeight:56}}),x?(0,y.jsxs)(h.Row,{gap:16,style:{alignItems:'flex-start'},children:[H,U]}):(0,y.jsxs)(y.Fragment,{children:[H,U]}),N?(0,y.jsx)(o.default,{accessibilityLabel:"Walk-in note",placeholder:"Note (optional), e.g. high chair",placeholderTextColor:"#7D776C",value:A,onChangeText:L,style:h.styles.input,autoFocus:!0}):(0,y.jsx)(h.Button,{small:!0,kind:"ghost",label:"+ Add a note (optional)",onPress:()=>O(!0)}),(0,y.jsx)(h.Muted,{children:"No name needed. Seated now; counts in today's covers and the forecast."})]})}function v({booking:e,onClose:t}){const{rid:s,now:l}=(0,a.useCtx)(15e3),o=k(s,l);return(0,y.jsxs)(h.Sheet,{visible:!0,onClose:t,title:`Assign table \xb7 ${w(e)}`,testID:"assign-table-sheet",children:[(0,y.jsx)(C,{use:o,onPick:async l=>{await r.repo.bookings.assignTable(e.id,l),j(s,l),t()}}),(0,y.jsx)(h.Muted,{children:"Red tables are in use right now; you can still pick one (e.g. joining a table)."})]})}function I({booking:e,onDone:s}){return(0,t.useEffect)(()=>{const e=setTimeout(s,6e3);return()=>clearTimeout(e)},[e.id]),(0,y.jsx)(n.default,{testID:"walkin-toast",style:{position:'fixed',left:12,right:12,bottom:92,zIndex:1e3,alignItems:'center'},pointerEvents:"box-none",children:(0,y.jsxs)(h.Row,{gap:10,style:{backgroundColor:b.colours.surface2,borderColor:b.colours.gold,borderWidth:1.5,borderRadius:14,paddingVertical:8,paddingLeft:14,paddingRight:8,maxWidth:520,width:'100%',justifyContent:'space-between'},children:[(0,y.jsxs)(h.T,{weight:"semibold",style:{flex:1},children:[w(e)," seated \xb7 ",e.table?`Table ${e.table}`:'table to assign'," (",e.ref,")"]}),(0,y.jsx)(h.Button,{kind:"secondary",label:"Undo",onPress:()=>{r.repo.bookings.undoWalkIn(e.id),s()},testID:"undo-walkin"})]})})}function P({date:e,onClose:s,wide:l}){const{rid:o,r:n,now:i}=(0,a.useCtx)(6e4),u=(0,r.useBookings)(o),[b,f]=(0,t.useState)(''),[x,p]=(0,t.useState)(2),[j,k]=(0,t.useState)(null),[w,C]=(0,t.useState)(''),T=(0,c.parseYmd)(e),S=(0,d.bookingSlots)(n,T,t=>u.filter(s=>s.date===e&&s.time===t&&'cancelled'!==s.status&&!s.walkIn).reduce((e,t)=>e+t.partySize,0),x,e===(0,c.ymd)(i)?i:(0,c.addMins)(T,0));return(0,y.jsxs)(h.Sheet,{visible:!0,onClose:s,title:`New booking \xb7 ${(0,c.niceDate)(T)}`,maxWidth:l?760:void 0,testID:"booking-sheet",children:[(0,y.jsx)(h.Field,{label:"Name",value:b,onChangeText:f,placeholder:"e.g. Reid"}),(0,y.jsxs)(h.Row,{style:{justifyContent:'space-between'},children:[(0,y.jsx)(h.T,{children:"Party size"}),(0,y.jsx)(h.Stepper,{value:x,onChange:p,min:1,max:20,label:"party size"})]}),(0,y.jsx)(h.Row,{wrap:!0,gap:6,children:S.map(e=>(0,y.jsx)(h.Chip,{label:e.time,sub:`${e.left} left`,disabled:!e.available,selected:j===e.time,onPress:()=>k(e.time)},e.time))}),S.length?null:(0,y.jsx)(h.Muted,{children:"Closed on this day (per listed hours)."}),(0,y.jsx)(h.Field,{label:"Notes",value:w,onChangeText:C,placeholder:"e.g. high chair, window table"}),x>=n.settings.savedCardFromParty?(0,y.jsxs)(h.Muted,{children:["Parties of ",n.settings.savedCardFromParty,"+ need a saved card; the customer gets a link (demo, nothing is sent)."]}):null,(0,y.jsx)(h.Button,{label:"Save booking",disabled:b.trim().length<2||!j,onPress:()=>{r.repo.bookings.create({restaurantId:o,customerId:null,name:b.trim(),partySize:x,date:e,time:j,allergies:[],notes:w.trim(),security:x>=n.settings.savedCardFromParty?'saved-card':'none',depositPaid:0}),s()}})]})}},847,[12,104,245,255,109,787,859,796,794,848,795,797,790,860,6]);
|
| 4 |
+
__d(function(g,r,_i,_a,m,e,_d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"STATUS",{enumerable:!0,get:function(){return a}}),Object.defineProperty(e,"STAGES",{enumerable:!0,get:function(){return s}}),Object.defineProperty(e,"turnFor",{enumerable:!0,get:function(){return n}}),Object.defineProperty(e,"startOf",{enumerable:!0,get:function(){return l}}),Object.defineProperty(e,"durOf",{enumerable:!0,get:function(){return i}}),Object.defineProperty(e,"endOf",{enumerable:!0,get:function(){return o}}),e.clashes=function(a,s=90){const n=new Set,i=a.filter(t=>d(t)&&t.table);for(let a=0;a<i.length;a++)for(let d=a+1;d<i.length;d++){const c=i[a],u=i[d];(0,t.tablesOf)(c.table).some(a=>(0,t.tablesOf)(u.table).includes(a))&&(l(c)<o(u,s)&&l(u)<o(c,s)&&(n.add(c.id),n.add(u.id)))}return n},e.floorView=function(a,s,n,i,d,u=90){const h={},y=s.filter(t=>t.date===b(d));for(const s of a.tables){const a=i[s.name]??{},b=y.filter(a=>(0,t.tablesOf)(a.table).includes(s.name)),F=b.find(t=>'seated'===t.status),p=b.filter(t=>'confirmed'===t.status).sort((t,a)=>t.time.localeCompare(a.time)).find(t=>f(d,t)>=-20),O=p?Math.round(f(d,p)):void 0,S=n.find(t=>'table'===t.type&&t.tableNo===s.name&&!['closed','cancelled','collected'].includes(t.status));let v='free';a.blocked?v='blocked':F?v=a.stage??'seated':a.dirty?v='dirty':S?v=a.stage??'seated':p&&void 0!==O&&O<=45&&(v='soon');const A=F,T=A?.tags?.find(t=>'VIP'===t)??A?.tags?.find(t=>'Regular'===t)??(A?void 0:p?.tags?.[0]);h[s.name]={table:s,status:v,booking:A,next:p,nextIn:O,covers:A?.partySize??0,orderOnly:!A&&!!S,note:a.note,seatedMins:A?Math.max(0,Math.round((d.getTime()-l(A).getTime())/6e4)):void 0,freeAt:A?o(A,u):void 0,allergy:!!(A?.allergies.length||!A&&p?.allergies.length||S?.allergies.length),vip:T,occasion:A?.occasion??(A?void 0:p?.occasion??c(p?.notes))??c(A?.notes)}}return h},Object.defineProperty(e,"OCCASION_ICON",{enumerable:!0,get:function(){return u}}),e.suggestTable=function(a,s,n,i,c,u,f=90,b){const h=[...a.tables.map(t=>({name:t.name,seats:t.maxSeats,min:t.minSeats,parts:[t.name]})),...a.joins.map(t=>{const s=a.tables.filter(a=>t.tables.includes(a.name));return{name:t.tables.join('+'),seats:s.reduce((t,a)=>t+a.maxSeats,0),min:s.reduce((t,a)=>t+a.minSeats,0),parts:t.tables}})],y=c.getTime()+6e4*u;let F=null;for(const a of h){if(a.seats<i)continue;if(n&&a.parts.some(t=>['blocked'].includes(n[t]?.status)))continue;const u=!!n&&a.parts.some(t=>['seated','mains','dessert','bill','dirty'].includes(n[t]?.status)),h=s.filter(s=>s.id!==b&&d(s)&&(0,t.tablesOf)(s.table).some(t=>a.parts.includes(t))&&l(s).getTime()<y&&o(s,f).getTime()>c.getTime()).length,p=(u?1e3:0)+100*h+10*(a.seats-i)+(i<a.min?5:0)+15*(a.parts.length-1);(!F||p<F.score)&&(F={table:a.name,seats:a.seats,clashes:h+(u?1:0),score:p,why:`${a.seats} seats${h||u?`, ${h+(u?1:0)} clash`:', no clashes'}`})}return F?{table:F.table,seats:F.seats,clashes:F.clashes,why:F.why}:null};var t=r(_d[0]);const a={free:{label:'Free',colour:'#2F7D45',fg:'#E7FBEA'},soon:{label:'Reserved soon',colour:'#3C78B5',fg:'#EAF4FF'},seated:{label:'Seated',colour:'#CFA45F',fg:'#0B0B0B'},mains:{label:'Mains',colour:'#E08A2E',fg:'#0B0B0B'},dessert:{label:'Dessert',colour:'#A77BD0',fg:'#0B0B0B'},bill:{label:'Bill requested',colour:'#D9473A',fg:'#FFFFFF'},dirty:{label:'Needs clearing',colour:'#7A6F5E',fg:'#FFFFFF'},blocked:{label:'Blocked',colour:'#3A3A3A',fg:'#CFCFCF'}},s=['seated','mains','dessert','bill'],n=(t,a=90)=>Math.min(a+60,a+15*Math.max(0,Math.ceil((t-2)/2))),l=t=>'seated'===t.status&&t.seatedAt?new Date(t.seatedAt):new Date(`${t.date}T${t.time}:00`),i=(t,a=90)=>t.durationMins??n(t.partySize,a),o=(t,a=90)=>new Date(l(t).getTime()+6e4*i(t,a)),d=t=>!['cancelled','noshow','finished'].includes(t.status);const c=t=>t?/birthday/i.test(t)?'birthday':/anniversary/i.test(t)?'anniversary':void 0:void 0,u={birthday:'\ud83c\udf82',anniversary:'\ud83d\udc8d',celebration:'\ud83e\udd42'},f=(t,a)=>(new Date(`${a.date}T${a.time}:00`).getTime()-t.getTime())/6e4,b=t=>`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,'0')}-${String(t.getDate()).padStart(2,'0')}`},848,[860]);
|
| 5 |
+
__d(function(_g,r,_i,_a,m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"snap",{enumerable:!0,get:function(){return c}}),_e.FloorCanvas=function(e){const[x,f]=(0,t.useState)({w:0,h:0}),g=x.w?'width'===e.fit?Math.min(x.w/i.PLAN_W,e.maxH?e.maxH/i.PLAN_H:9):Math.min(x.w/i.PLAN_W,x.h/i.PLAN_H):0,v=e.plan.tables.filter(t=>t.areaId===e.areaId),[y,w]=(0,t.useState)(null),M=(0,t.useRef)(null),j=t=>e.plan.sections.find(e=>e.id===t.sectionId),R=t=>e.plan.joins.find(e=>e.tables.includes(t.name)),C=(t,o)=>({onStartShouldSetResponder:()=>!0,onMoveShouldSetResponder:()=>!0,onResponderTerminationRequest:()=>!1,onResponderGrant:e=>{M.current={x:e.nativeEvent.pageX,y:e.nativeEvent.pageY,id:t.id,kind:o}},onResponderMove:n=>{const i=M.current;if(!i)return;const s=n.nativeEvent.pageX-i.x,a=n.nativeEvent.pageY-i.y;Math.abs(s)+Math.abs(a)<6&&!y||('live'!==e.mode||e.onDrop&&e.view&&['seated','mains','dessert','bill'].includes(e.view[t.name]?.status)&&e.view[t.name]?.booking)&&w({id:t.id,dx:s,dy:a,kind:o})},onResponderRelease:n=>{const s=M.current;M.current=null;const a=n.nativeEvent.pageX-(s?.x??0),l=n.nativeEvent.pageY-(s?.y??0);if(w(null),Math.abs(a)+Math.abs(l)<6||!g)return void('move'===o&&e.onTap?.(t));const u=a/g,h=l/g;if('edit'===e.mode&&'move'===o)e.onMove?.(t,b(c(t.x+u,e.snapOn),0,i.PLAN_W-t.w),b(c(t.y+h,e.snapOn),0,i.PLAN_H-t.h));else if('edit'===e.mode&&'resize'===o)e.onResize?.(t,b(c(t.w+u,e.snapOn),50,400),b(c(t.h+h,e.snapOn),50,300));else if('live'===e.mode&&e.onDrop){const o=t.x+t.w/2+u,n=t.y+t.h/2+h,i=v.find(e=>e.id!==t.id&&o>=e.x-10&&o<=e.x+e.w+10&&n>=e.y-10&&n<=e.y+e.h+10);i&&e.onDrop(t,i)}}}),I=e=>e*g,k='width'===e.fit?i.PLAN_H*g||200:void 0;return(0,u.jsx)(n.default,{testID:"floor-canvas",onLayout:e=>f({w:e.nativeEvent.layout.width,h:e.nativeEvent.layout.height}),style:[{width:'100%',borderRadius:16,overflow:'hidden'},'contain'===e.fit?{flex:1}:{height:k}],children:g?(0,u.jsxs)(n.default,{style:{width:I(i.PLAN_W),height:I(i.PLAN_H),alignSelf:'center',backgroundColor:'#0F0E0C',borderRadius:16,borderWidth:1,borderColor:a.colours.border,overflow:'hidden'},children:['edit'===e.mode?Array.from({length:i.PLAN_W/(2*i.GRID)},(e,t)=>(0,u.jsx)(n.default,{style:{position:'absolute',left:I(t*i.GRID*2),top:0,bottom:0,width:1,backgroundColor:'#1E1B16'}},`v${t}`)):null,'edit'===e.mode?Array.from({length:i.PLAN_H/(2*i.GRID)},(e,t)=>(0,u.jsx)(n.default,{style:{position:'absolute',top:I(t*i.GRID*2),left:0,right:0,height:1,backgroundColor:'#1E1B16'}},`h${t}`)):null,e.plan.joins.map(e=>{const t=v.filter(t=>e.tables.includes(t.name));if(t.length<2)return null;const[o,i]=t,s=o.x+o.w/2,a=o.y+o.h/2,l=i.x+i.w/2,h=i.y+i.h/2,c=Math.hypot(l-s,h-a),b=Math.atan2(h-a,l-s);return(0,u.jsx)(n.default,{testID:`join-${e.tables.join('+')}`,style:{position:'absolute',left:I((s+l)/2-c/2),top:I((a+h)/2)-3,width:I(c),height:6,borderRadius:3,backgroundColor:'rgba(207,164,95,0.55)',transform:[{rotate:`${b}rad`}]}},e.id)}),v.map(t=>{const i=e.view?.[t.name],c=i?s.STATUS[i.status]:null,b=y?.id===t.id,x=b&&'resize'===y.kind?Math.max(50,t.w+y.dx/g):t.w,f=b&&'resize'===y.kind?Math.max(50,t.h+y.dy/g):t.h,v=b&&'move'===y.kind?t.x+y.dx/g:t.x,w=b&&'move'===y.kind?t.y+y.dy/g:t.y,M=e.selected===t.id||e.highlight?.includes(t.name),k=j(t),z='edit'===e.mode?'#2A2419':c.colour,$='edit'===e.mode?a.colours.text:c.fg,A='round'===t.shape||'stool'===t.shape?I(Math.min(x,f)/2):I('booth'===t.shape?22:12),S=I(Math.min(x,f))<64,T=Math.max(11,Math.min(22,I(Math.min(x,f))/4)),_='edit'===e.mode?`Table ${t.name}, ${t.shape}, ${t.minSeats}\u2013${t.maxSeats} seats${t.online?', bookable online':''}`:`Table ${t.name}, ${c.label}${void 0!==i?.seatedMins?`, seated ${i.seatedMins} min`:''}${i?.covers?`, ${i.covers} covers`:''}${void 0!==i?.nextIn&&'seated'!==i.status?`, next booking ${i.next?.time}`:''}`,E=void 0!==i?.seatedMins&&i.booking?Math.min(1.2,i.seatedMins/(i.booking.durationMins??(0,s.turnFor)(i.booking.partySize,e.turnBase))):null;return(0,u.jsxs)(o.default.Fragment,{children:[p({...t,w:x,h:f}).map((t,o)=>(0,u.jsx)(n.default,{pointerEvents:"none",style:[{position:'absolute',left:I(v+t.x)-Math.max(4,I(8)),top:I(w+t.y)-Math.max(4,I(8)),width:Math.max(8,I(16)),height:Math.max(8,I(16)),borderRadius:99,backgroundColor:'edit'===e.mode?'#5A4C33':'rgba(255,255,255,0.16)',borderWidth:1,borderColor:'edit'===e.mode?a.colours.gold:'rgba(255,255,255,0.25)'},h()]},o)),(0,u.jsxs)(n.default,{testID:`table-${t.name}`,accessibilityRole:"button",accessibilityLabel:_,...C(t,'move'),style:[{position:'absolute',left:I(v),top:I(w),width:I(x),height:I(f),borderRadius:A,backgroundColor:z,alignItems:'center',justifyContent:'center',padding:2,borderWidth:M?3:e.sectionColours&&k?2.5:1.5,borderColor:M?'#FFFFFF':e.sectionColours&&k?k.colour:'edit'===e.mode?a.colours.gold:'rgba(0,0,0,0.35)',borderTopWidth:'booth'===t.shape?I(18):void 0,transform:[{rotate:`${t.rot}deg`},{scale:b?1.06:1}],zIndex:b?50:1,opacity:b&&'live'===e.mode?.85:1,shadowColor:'#000',shadowOpacity:b?.6:.3,shadowRadius:b?14:6,cursor:'edit'===e.mode?'grab':'pointer',touchAction:'none'},b?null:h()],children:[(0,u.jsxs)(n.default,{style:{alignItems:'center',transform:[{rotate:-t.rot+"deg"}]},pointerEvents:"none",children:[(0,u.jsx)(l.T,{weight:"bold",size:T,colour:$,center:!0,children:t.name}),'edit'===e.mode?S?null:(0,u.jsxs)(l.T,{size:11,colour:a.colours.muted,center:!0,children:[t.minSeats,"\u2013",t.maxSeats,t.online?' \xb7 online':'']}):i?(0,u.jsxs)(u.Fragment,{children:['free'!==i.status||S?null:(0,u.jsxs)(l.T,{size:11,colour:$,center:!0,children:[t.minSeats,"\u2013",t.maxSeats," seats"]}),void 0!==i.seatedMins?(0,u.jsxs)(l.T,{size:12,weight:"semibold",colour:$,center:!0,children:[i.seatedMins,"m \xb7 ",i.covers,"\ud83d\udc65"]}):i.orderOnly?(0,u.jsx)(l.T,{size:11,colour:$,center:!0,children:"Open order"}):null,'soon'===i.status&&i.next?(0,u.jsxs)(l.T,{size:11,weight:"semibold",colour:$,center:!0,children:[i.next.time," \xb7 ",i.nextIn<=0?'due':`${i.nextIn}m`]}):null,'dirty'!==i.status||S?null:(0,u.jsx)(l.T,{size:11,colour:$,center:!0,children:"Clear"}),!S||i.allergy||i.vip?(0,u.jsxs)(l.T,{size:11,colour:$,center:!0,children:[i.allergy?'\u26a0':'',i.vip?'VIP'===i.vip?'\u2605':'\u2665':'',i.occasion?s.OCCASION_ICON[i.occasion]:'',i.note?'\u270e':'']}):null]}):null]}),k&&'live'===e.mode&&e.sectionColours&&!S?(0,u.jsx)(n.default,{pointerEvents:"none",style:{position:'absolute',top:3,right:6,backgroundColor:k.colour,borderRadius:6,paddingHorizontal:3},children:(0,u.jsx)(l.T,{size:9,weight:"bold",colour:"#0B0B0B",children:k.server})}):null,null===E||S?null:(0,u.jsx)(n.default,{pointerEvents:"none",style:{position:'absolute',left:'15%',right:'15%',bottom:5,height:4,borderRadius:2,backgroundColor:'rgba(0,0,0,0.25)'},children:(0,u.jsx)(n.default,{style:{width:`${Math.min(100,100*E)}%`,height:4,borderRadius:2,backgroundColor:E>=1?'#B3261E':'rgba(0,0,0,0.6)'}})}),R(t)&&'edit'===e.mode?(0,u.jsx)(n.default,{pointerEvents:"none",style:{position:'absolute',bottom:2,left:4},children:(0,u.jsx)(l.T,{size:10,colour:a.colours.gold,children:"\u26d3"})}):null]}),'edit'===e.mode&&e.selected===t.id?(0,u.jsx)(n.default,{testID:"resize-handle",accessibilityLabel:"Resize table",...C(t,'resize'),style:{position:'absolute',left:I(v+x)-14,top:I(w+f)-14,width:28,height:28,borderRadius:14,backgroundColor:a.colours.gold,borderWidth:2,borderColor:'#fff',zIndex:60,cursor:'nwse-resize',touchAction:'none'}}):null]},t.id)}),0===v.length?(0,u.jsx)(n.default,{style:{position:'absolute',left:0,right:0,top:'45%'},children:(0,u.jsxs)(l.T,{center:!0,colour:a.colours.muted,children:["No tables in this area yet",'edit'===e.mode?' \u2014 tap + Table':'',"."]})}):null]}):null})};var t=r(d[0]),o=e(t);r(d[1]);var n=e(r(d[2])),i=r(d[3]),s=r(d[4]),a=r(d[5]),l=r(d[6]),u=r(d[7]);const h=(e=250)=>({transitionProperty:'background-color, border-color, transform, left, top, width, height',transitionDuration:`${e}ms`}),c=(e,t=!0)=>t?Math.round(e/i.GRID)*i.GRID:Math.round(e),b=(e,t,o)=>Math.max(t,Math.min(o,e));function p(e){const t=Math.max(1,e.maxSeats),o=[];if('round'===e.shape||'stool'===e.shape){for(let n=0;n<t;n++){const i=2*Math.PI*n/t-Math.PI/2;o.push({x:e.w/2+Math.cos(i)*(e.w/2+11.2),y:e.h/2+Math.sin(i)*(e.h/2+11.2)})}return'stool'===e.shape?[]:o}if('booth'===e.shape){for(let n=0;n<t;n++)o.push({x:e.w*(n+.5)/t,y:e.h+9.6});return o}if('square'===e.shape&&t<=4){return[{x:e.w/2,y:-9.6},{x:e.w/2,y:e.h+9.6},{x:-9.6,y:e.h/2},{x:e.w+9.6,y:e.h/2}].slice(0,t)}const n=Math.ceil(t/2),i=t-n;for(let t=0;t<n;t++)o.push({x:e.w*(t+.5)/n,y:-9.6});for(let t=0;t<i;t++)o.push({x:e.w*(t+.5)/i,y:e.h+9.6});return o}},849,[12,104,109,860,848,797,790,6]);
|
| 6 |
+
__d(function(g,r,i,_a,m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.AreaTabs=p,_e.FloorEditor=function({rid:e,compact:s,maxH:j}){const f=(0,o.usePlan)(e),y=o.useFloor.getState,w=a=>y().setPlan(e,a),[k,S]=(0,a.useState)(f.areas[0]?.id??''),[T,R]=(0,a.useState)(null),[C,P]=(0,a.useState)(!0),[I,D]=(0,a.useState)(!1),[v,B]=(0,a.useState)(null),[z,M]=(0,a.useState)(''),[$,A]=(0,a.useState)(''),L=f.areas.some(e=>e.id===k)?k:f.areas[0]?.id??'',W=f.tables.find(e=>e.id===T)??null,_=a=>W&&y().updateTable(e,W.id,a),H=()=>{let e=1;const a=new Set(f.tables.map(e=>e.name));for(;a.has(String(e));)e++;return String(e)},F=(e,a)=>{for(let s=50;s+a<=o.PLAN_H;s+=50)for(let l=50;l+e<=o.PLAN_W;l+=50)if(!f.tables.some(t=>t.areaId===L&&l<t.x+t.w+25&&t.x<l+e+25&&s<t.y+t.h+25&&t.y<s+a+25))return{x:l,y:s};return{x:50,y:50}},N=e=>{if(!W||e.id===W.id)return;const a=f.joins.filter(a=>!a.tables.includes(W.name)&&!a.tables.includes(e.name)),s=Array.from(new Set([...f.joins.find(e=>e.tables.includes(W.name))?.tables??[W.name],...f.joins.find(a=>a.tables.includes(e.name))?.tables??[e.name]]));w({...f,joins:[...a,{id:(0,o.fid)('j'),tables:s}]}),D(!1),A(`Joined ${s.join('+')} \u2014 book it as one table.`)},V=W?f.joins.find(e=>e.tables.includes(W.name)):void 0,E=W&&f.tables.some(e=>e.id!==W.id&&e.name===W.name),q=W?(0,h.jsxs)(n.default,{testID:"table-tools",style:{gap:10,backgroundColor:c.colours.surface,borderRadius:14,borderWidth:1,borderColor:c.colours.border,padding:12},children:[(0,h.jsxs)(u.Row,{style:{justifyContent:'space-between'},children:[(0,h.jsxs)(u.T,{weight:"semibold",colour:c.colours.gold,children:["Table ",W.name]}),(0,h.jsx)(u.Button,{small:!0,kind:"ghost",label:"Done",onPress:()=>R(null)})]}),(0,h.jsxs)(u.Row,{gap:8,children:[(0,h.jsx)(u.T,{size:14,style:{width:90},children:"Name / no."}),(0,h.jsx)(t.default,{accessibilityLabel:"Table name",value:W.name,onChangeText:e=>_({name:e.replace(/[^A-Za-z0-9-]/g,'').slice(0,6)}),style:[u.styles.input,{flex:1,minWidth:0,width:40,paddingVertical:8}]})]}),E?(0,h.jsx)(u.T,{size:13,colour:c.colours.red,children:"Another table already uses this number."}):null,(0,h.jsx)(u.Row,{wrap:!0,gap:6,children:o.SHAPES.map(e=>(0,h.jsx)(u.Chip,{label:e.label,selected:W.shape===e.id,onPress:()=>_({shape:e.id,w:x[e.id][0],h:x[e.id][1],...'stool'===e.id?{minSeats:1,maxSeats:1}:{}})},e.id))}),(0,h.jsxs)(u.Row,{style:{justifyContent:'space-between'},children:[(0,h.jsx)(u.T,{size:14,children:"Min seats"}),(0,h.jsx)(u.Stepper,{value:W.minSeats,onChange:e=>_({minSeats:e,maxSeats:Math.max(e,W.maxSeats)}),min:1,max:20,label:"min seats"})]}),(0,h.jsxs)(u.Row,{style:{justifyContent:'space-between'},children:[(0,h.jsx)(u.T,{size:14,children:"Max seats"}),(0,h.jsx)(u.Stepper,{value:W.maxSeats,onChange:e=>_({maxSeats:e,minSeats:Math.min(e,W.minSeats)}),min:1,max:24,label:"max seats"})]}),(0,h.jsxs)(u.Row,{wrap:!0,gap:6,children:[(0,h.jsx)(u.Button,{small:!0,kind:"secondary",label:"\u27f2 15\xb0",accessibilityLabel:"Rotate left",onPress:()=>_({rot:(W.rot-15+360)%360})}),(0,h.jsx)(u.Button,{small:!0,kind:"secondary",label:"\u27f3 15\xb0",accessibilityLabel:"Rotate right",onPress:()=>_({rot:(W.rot+15)%360}),testID:"rotate-table"}),(0,h.jsx)(u.Button,{small:!0,kind:"secondary",label:"Bigger",onPress:()=>_({w:Math.min(400,W.w+25),h:Math.min(300,W.h+25)})}),(0,h.jsx)(u.Button,{small:!0,kind:"secondary",label:"Smaller",onPress:()=>_({w:Math.max(50,W.w-25),h:Math.max(50,W.h-25)})})]}),(0,h.jsxs)(u.Row,{wrap:!0,gap:6,children:[(0,h.jsx)(u.T,{size:14,style:{width:'100%'},children:"Area"}),f.areas.map(e=>(0,h.jsx)(u.Chip,{label:e.name,selected:W.areaId===e.id,onPress:()=>{_({areaId:e.id}),S(e.id)}},e.id))]}),f.sections.length?(0,h.jsxs)(u.Row,{wrap:!0,gap:6,children:[(0,h.jsx)(u.T,{size:14,style:{width:'100%'},children:"Server section"}),f.sections.map(e=>(0,h.jsx)(u.Chip,{label:`${e.name} (${e.server})`,selected:W.sectionId===e.id,onPress:()=>_({sectionId:e.id})},e.id))]}):null,(0,h.jsxs)(u.Row,{style:{justifyContent:'space-between'},children:[(0,h.jsxs)(n.default,{style:{flex:1},children:[(0,h.jsx)(u.T,{size:14,children:"Bookable online"}),(0,h.jsx)(u.Muted,{children:"For a later Wix Tables / booking-page mapping. Nothing is synced now."})]}),(0,h.jsx)(l.default,{accessibilityLabel:"Bookable online",value:W.online,onValueChange:e=>{_({online:e})},trackColor:{true:c.colours.gold,false:'#444'}})]}),(0,h.jsxs)(u.Row,{wrap:!0,gap:6,children:[(0,h.jsx)(u.Button,{small:!0,label:"Duplicate",onPress:()=>{if(!W)return;const a=F(W.w,W.h),s={...W,id:(0,o.fid)('t'),name:H(),x:a.x,y:a.y};y().addTable(e,s),R(s.id),A(`Duplicated as Table ${s.name}.`)},testID:"dup-table"}),V?(0,h.jsx)(u.Button,{small:!0,kind:"secondary",label:`Split ${V.tables.join('+')}`,onPress:()=>{w({...f,joins:f.joins.filter(e=>e.id!==V.id)}),A('Split back into separate tables.')},testID:"split-table"}):(0,h.jsx)(u.Button,{small:!0,kind:"secondary",label:I?'Tap a table to join\u2026':'Join with\u2026',onPress:()=>D(!I),testID:"join-table"}),(0,h.jsx)(u.Button,{small:!0,kind:"danger",label:"Delete",onPress:()=>B({kind:'table'}),testID:"delete-table"})]})]}):null,O=(0,h.jsx)(b.FloorCanvas,{plan:f,areaId:L,mode:"edit",fit:"width",maxH:j,selected:T,snapOn:C,highlight:V?.tables,onTap:e=>{I?N(e):R(e.id===T?null:e.id)},onMove:(a,s,l)=>y().updateTable(e,a.id,{x:s,y:l}),onResize:(a,s,l)=>y().updateTable(e,a.id,{w:s,h:l})}),G=f.areas.find(e=>e.id===L),J=Object.fromEntries(f.areas.map(e=>[e.id,String(f.tables.filter(a=>a.areaId===e.id).length)]));return(0,h.jsxs)(n.default,{style:{gap:10},testID:"floor-editor",children:[(0,h.jsx)(p,{plan:f,area:L,onPick:e=>{S(e),R(null)},counts:J}),(0,h.jsxs)(u.Row,{wrap:!0,gap:6,children:[(0,h.jsx)(u.Button,{label:"+ Table",onPress:()=>{const[a,s]=x.square,l=F(a,s),t={id:(0,o.fid)('t'),name:H(),areaId:L,shape:'square',minSeats:2,maxSeats:4,x:l.x,y:l.y,w:a,h:s,rot:0,online:!0,sectionId:f.sections[0]?.id};y().addTable(e,t),R(t.id),A(`Table ${t.name} added \u2014 drag it into place.`)},testID:"add-table",style:{minWidth:110}}),(0,h.jsxs)(u.Row,{gap:6,style:{paddingHorizontal:6},children:[(0,h.jsx)(l.default,{accessibilityLabel:"Snap to grid",value:C,onValueChange:P,trackColor:{true:c.colours.gold,false:'#444'}}),(0,h.jsx)(u.T,{size:14,children:"Snap to grid"})]})]}),$?(0,h.jsx)(u.T,{size:13,colour:c.colours.goldLight,children:$}):null,s?(0,h.jsxs)(h.Fragment,{children:[O,q]}):(0,h.jsxs)(u.Row,{gap:12,style:{alignItems:'flex-start'},children:[(0,h.jsx)(n.default,{style:{flex:1},children:O}),q?(0,h.jsx)(n.default,{style:{width:320},children:q}):null]}),W?null:(0,h.jsx)(u.Muted,{children:"Tap a table to edit it; drag to move (snaps to the grid); drag the gold dot to resize."}),(0,h.jsxs)(n.default,{style:{gap:6,backgroundColor:c.colours.surface,borderRadius:14,borderWidth:1,borderColor:c.colours.border,padding:12},children:[(0,h.jsx)(u.T,{weight:"semibold",colour:c.colours.gold,children:"Areas"}),G?(0,h.jsxs)(u.Row,{gap:6,children:[(0,h.jsx)(u.T,{size:14,style:{width:90},children:"Rename"}),(0,h.jsx)(t.default,{accessibilityLabel:"Area name",value:G.name,onChangeText:e=>w({...f,areas:f.areas.map(a=>a.id===G.id?{...a,name:e.slice(0,24)}:a)}),style:[u.styles.input,{flex:1,minWidth:0,width:40,paddingVertical:8}]})]}):null,(0,h.jsxs)(u.Row,{gap:6,children:[(0,h.jsx)(t.default,{accessibilityLabel:"New area name",placeholder:"New area, e.g. Function room",placeholderTextColor:"#7D776C",value:z,onChangeText:M,style:[u.styles.input,{flex:1,minWidth:0,width:40,paddingVertical:8}]}),(0,h.jsx)(u.Button,{small:!0,label:"+ Area",disabled:z.trim().length<2,onPress:()=>{const e={id:(0,o.fid)('a'),name:z.trim()};w({...f,areas:[...f.areas,e]}),S(e.id),M(''),R(null)},testID:"add-area"})]}),(0,h.jsxs)(u.Row,{wrap:!0,gap:6,children:[(0,h.jsx)(u.Button,{small:!0,kind:"secondary",label:"Delete this area",disabled:f.areas.length<2,onPress:()=>B({kind:'area'}),testID:"delete-area"}),(0,h.jsx)(u.Button,{small:!0,kind:"ghost",label:"Reset to example layout",onPress:()=>B({kind:'reset'})})]}),(0,h.jsxs)(u.Muted,{children:[f.tables.length," tables \xb7 ",f.tables.reduce((e,a)=>e+a.maxSeats,0)," seats \xb7 ",f.tables.filter(e=>e.online).length," bookable online. Example layout made up for the demo; table numbers are the ones you'd match in Wix Tables later (not connected)."]})]}),v?(0,h.jsxs)(u.Sheet,{visible:!0,onClose:()=>B(null),title:'table'===v.kind?`Delete Table ${W?.name}?`:'area'===v.kind?`Delete ${G?.name}?`:'Reset the table plan?',testID:"confirm-sheet",children:[(0,h.jsx)(u.Muted,{children:'table'===v.kind?'It comes off the plan. Bookings keep their table number.':'area'===v.kind?`Its ${J[L]} table(s) move to ${f.areas.find(e=>e.id!==L)?.name}.`:'Puts back the example layout for this venue.'}),(0,h.jsxs)(u.Row,{gap:8,children:[(0,h.jsx)(u.Button,{kind:"danger",label:'reset'===v.kind?'Reset':'Delete',accessibilityLabel:'reset'===v.kind?'Reset':'Confirm delete',testID:"confirm-delete",onPress:()=>{if('table'===v.kind&&W&&(y().removeTable(e,W.id),R(null),A(`Table ${W.name} deleted.`)),'area'===v.kind){const e=f.areas.find(e=>e.id!==L);w({...f,areas:f.areas.filter(e=>e.id!==L),tables:f.tables.map(a=>a.areaId===L?{...a,areaId:e.id}:a)}),S(e.id)}'reset'===v.kind&&(y().resetPlan(e),R(null)),B(null)}}),(0,h.jsx)(u.Button,{kind:"secondary",label:"Cancel",onPress:()=>B(null)})]})]}):null]})};var a=r(d[0]),s=e(r(d[1])),l=e(r(d[2])),t=e(r(d[3])),n=e(r(d[4])),o=r(d[5]),c=r(d[6]),u=r(d[7]),b=r(d[8]),h=r(d[9]);const x={round:[100,100],square:[100,100],rect:[175,100],booth:[200,125],stool:[75,75]};function p({plan:e,area:a,onPick:l,counts:t}){return(0,h.jsx)(u.Row,{wrap:!0,gap:6,style:{alignItems:'center'},children:e.areas.map(e=>{const n=e.id===a;return(0,h.jsx)(s.default,{testID:`area-${e.id}`,accessibilityRole:"tab",accessibilityLabel:`Area ${e.name}`,accessibilityState:{selected:n},onPress:()=>l(e.id),style:{minHeight:48,paddingHorizontal:16,borderRadius:24,borderWidth:1.5,borderColor:n?c.colours.gold:c.colours.border,backgroundColor:n?c.colours.gold:c.colours.surface,justifyContent:'center'},children:(0,h.jsxs)(u.T,{weight:"semibold",size:15,colour:n?c.colours.onGold:c.colours.text,children:[e.name,t?.[e.id]?(0,h.jsxs)(u.T,{size:12,colour:n?c.colours.onGold:c.colours.muted,children:[" ",t[e.id]]}):null]})},e.id)})})}},850,[12,245,253,255,109,860,797,790,849,6]);
|
| 7 |
+
__d(function(_g,_r,_i,_a,m,_e,_d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"SLOT_W",{enumerable:!0,get:function(){return h}}),Object.defineProperty(_e,"ROW_H",{enumerable:!0,get:function(){return b}}),_e.Timeline=function({plan:e,bookings:p,now:y,privacy:x,onOpen:j,turnBase:v,t0:C,t1:k,height:w}){const M=(0,t.useMemo)(()=>[{key:'__none',area:'',name:'To assign'},...e.areas.flatMap(t=>e.tables.filter(e=>e.areaId===t.id).map(e=>({key:e.name,area:t.name,name:e.name})))],[e]),T=p.filter(e=>!['cancelled','noshow'].includes(e.status)),R=(0,t.useMemo)(()=>(0,s.clashes)(T,v),[T,v]),z=Math.ceil((k.getTime()-C.getTime())/9e5),$=e=>(e.getTime()-C.getTime())/9e5*h,[_,B]=(0,t.useState)(null),O=(0,t.useRef)(null),E=(0,t.useRef)(null);(0,t.useEffect)(()=>{const e=Math.max(0,$(y)-120);setTimeout(()=>E.current?.scrollTo({x:e,animated:!1}),50)},[]);const[S,W]=(0,t.useState)(''),D=(e,t)=>({onStartShouldSetResponder:()=>!0,onMoveShouldSetResponder:()=>!0,onResponderTerminationRequest:()=>!1,onResponderGrant:e=>{O.current={x:e.nativeEvent.pageX,y:e.nativeEvent.pageY}},onResponderMove:o=>{if(!O.current)return;const r=o.nativeEvent.pageX-O.current.x,n=o.nativeEvent.pageY-O.current.y;Math.abs(r)+Math.abs(n)>=6&&B({id:e.id,dx:r,dy:n,kind:t})},onResponderRelease:o=>{const r=O.current;O.current=null,B(null);const l=o.nativeEvent.pageX-(r?.x??0),d=o.nativeEvent.pageY-(r?.y??0);if(Math.abs(l)+Math.abs(d)<6)return void('move'===t&&j(e));const c=Math.round(l/h);if('stretch'===t){const t=Math.max(30,(0,s.durOf)(e,v)+15*c);return n.repo.bookings.update(e.id,{durationMins:t}),void W(`${(0,u.privName)(e,x)} now ${t} min`)}const f=M.findIndex(t=>t.key===((0,i.tablesOf)(e.table)[0]??'__none')),g=Math.max(0,Math.min(M.length-1,f+Math.round(d/b))),p={};c&&'confirmed'===e.status&&(p.time=(0,a.hm)((0,a.addMins)((0,s.startOf)(e),15*c))),g!==f&&'__none'!==M[g].key&&(p.table=M[g].key),p.time||p.table?(n.repo.bookings.update(e.id,p),W(`${(0,u.privName)(e,x)} \u2192 ${p.table?`Table ${p.table}`:''}${p.table&&p.time?' at ':''}${p.time??''}`)):c&&'confirmed'!==e.status&&W('Seated parties can move table, not time.')}}),I=$(y);return(0,c.jsxs)(r.default,{style:{flex:1,gap:6},testID:"timeline",children:[(0,c.jsxs)(d.Row,{style:{justifyContent:'space-between'},children:[(0,c.jsxs)(d.Row,{gap:8,children:[(0,c.jsx)(d.Badge,{kind:R.size?'red':'green',label:R.size?`${R.size} bookings clash`:'No clashes'}),(0,c.jsx)(d.Muted,{children:"Drag a booking to another table or time \xb7 drag its right edge to change the length"})]}),(0,c.jsx)(r.default,{testID:"clash-count",accessibilityLabel:`clashes ${R.size}`,children:(0,c.jsx)(d.T,{size:13,colour:l.colours.goldLight,children:S})})]}),(0,c.jsx)(r.default,{style:{flex:w?void 0:1,height:w,flexDirection:'row',borderRadius:14,borderWidth:1,borderColor:l.colours.border,overflow:'hidden',backgroundColor:'#0F0E0C'},children:(0,c.jsxs)(o.default,{style:{flex:1},contentContainerStyle:{flexDirection:'row'},children:[(0,c.jsxs)(r.default,{style:{width:f,borderRightWidth:1,borderColor:l.colours.border,backgroundColor:l.colours.surface},children:[(0,c.jsx)(r.default,{style:{height:30,justifyContent:'center',paddingLeft:8,borderBottomWidth:1,borderColor:l.colours.border},children:(0,c.jsx)(d.T,{size:12,colour:l.colours.muted,children:"Table"})}),M.map((e,t)=>(0,c.jsxs)(r.default,{style:{height:b,justifyContent:'center',paddingLeft:8,borderBottomWidth:1,borderColor:'#211E19',borderTopWidth:t>0&&M[t-1].area!==e.area?2:0,borderTopColor:l.colours.gold},children:[(0,c.jsx)(d.T,{size:14,weight:"semibold",children:'__none'===e.key?e.name:`T${e.name}`}),!e.area||0!==t&&M[t-1].area===e.area?null:(0,c.jsx)(d.T,{size:10,colour:l.colours.gold,children:e.area.toUpperCase()})]},e.key))]}),(0,c.jsx)(o.default,{ref:E,horizontal:!0,style:{flex:1},children:(0,c.jsxs)(r.default,{style:{width:z*h},children:[(0,c.jsx)(r.default,{style:{height:30,flexDirection:'row',borderBottomWidth:1,borderColor:l.colours.border},children:Array.from({length:Math.ceil(z/4)},(e,t)=>(0,c.jsx)(r.default,{style:{width:Math.min(4,z-4*t)*h,justifyContent:'center',borderLeftWidth:1,borderColor:l.colours.border},children:(0,c.jsx)(d.T,{size:11,colour:l.colours.muted,numberOfLines:1,style:{paddingLeft:3},children:(0,a.hm)((0,a.addMins)(C,60*t))})},t))}),M.map((e,t)=>{return(0,c.jsxs)(r.default,{testID:`tl-row-${e.key}`,style:{height:b,borderBottomWidth:1,borderColor:'#211E19',borderTopWidth:t>0&&M[t-1].area!==e.area?2:0,borderTopColor:'rgba(207,164,95,0.4)'},children:[Array.from({length:Math.ceil(z/4)},(e,t)=>(0,c.jsx)(r.default,{pointerEvents:"none",style:{position:'absolute',left:4*t*h,top:0,bottom:0,width:1,backgroundColor:'#1E1B16'}},t)),(o=e.key,T.filter(e=>'__none'===o?!e.table:(0,i.tablesOf)(e.table).includes(o))).map(e=>{const t=_?.id===e.id?_:null,o=$((0,s.startOf)(e))+('move'===t?.kind?t.dx:0),n=Math.max(h,(0,s.durOf)(e,v)/15*h+('stretch'===t?.kind?t.dx:0)),i=R.has(e.id);return(0,c.jsxs)(r.default,{testID:`tl-${e.id}`,accessibilityRole:"button",accessibilityLabel:`${(0,u.privName)(e,x)}, ${e.partySize}, ${(0,a.hm)((0,s.startOf)(e))}, ${(0,s.durOf)(e,v)} min${i?', clash':''}`,...D(e,'move'),style:[{position:'absolute',left:o,top:4+('move'===t?.kind?t.dy:0),width:n,height:36,borderRadius:8,backgroundColor:g(e),borderWidth:i?2.5:1,borderColor:i?'#FF6B5E':'rgba(0,0,0,0.4)',paddingHorizontal:6,justifyContent:'center',zIndex:t?40:2,opacity:'finished'===e.status?.55:1,cursor:'grab',touchAction:'none'},t?null:{transitionProperty:'left, width, top',transitionDuration:'200ms'}],children:[(0,c.jsxs)(d.T,{size:12,weight:"semibold",colour:'confirmed'===e.status?'#EAF4FF':'#0B0B0B',numberOfLines:1,children:[i?'\u26a0 ':'',(0,a.hm)((0,s.startOf)(e))," ",(0,u.privName)(e,x)," \xb7 ",e.partySize,e.allergies.length?' \u26a0':'']}),(0,c.jsx)(r.default,{testID:`tl-stretch-${e.id}`,accessibilityLabel:"Change length",...D(e,'stretch'),style:{position:'absolute',right:0,top:0,bottom:0,width:14,borderTopRightRadius:8,borderBottomRightRadius:8,backgroundColor:'rgba(0,0,0,0.25)',cursor:'ew-resize',touchAction:'none'}})]},e.id)})]},e.key);var o}),I>=0&&I<=z*h?(0,c.jsx)(r.default,{testID:"now-line",pointerEvents:"none",style:{position:'absolute',left:I,top:0,bottom:0,width:2,backgroundColor:l.colours.gold,zIndex:30},children:(0,c.jsx)(r.default,{style:{position:'absolute',top:0,left:-18,width:38,backgroundColor:l.colours.gold,borderRadius:6},children:(0,c.jsx)(d.T,{size:10,weight:"bold",colour:"#0B0B0B",center:!0,children:(0,a.hm)(y)})})}):null]})})]})})]})};var t=_r(_d[0]);_r(_d[1]);var o=e(_r(_d[2])),r=e(_r(_d[3])),n=_r(_d[4]),i=_r(_d[5]),s=_r(_d[6]),a=_r(_d[7]),l=_r(_d[8]),d=_r(_d[9]),u=_r(_d[10]),c=_r(_d[11]);const h=30,b=44,f=96,g=e=>'seated'===e.status?'#CFA45F':'finished'===e.status?'#3A352C':e.walkIn?'#B9925A':'#3C78B5'},851,[12,104,133,109,796,860,848,795,797,790,852,6]);
|
| 8 |
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"initials",{enumerable:!0,get:function(){return n}}),Object.defineProperty(e,"pv",{enumerable:!0,get:function(){return t}}),Object.defineProperty(e,"privName",{enumerable:!0,get:function(){return l}});const n=n=>n.replace(' (example)','').split(/\s+/).filter(Boolean).map(n=>`${n[0].toUpperCase()}.`).join(' '),t=(t,l)=>t?l?n(t):t.replace(' (example)',''):'',l=(n,l)=>n.walkIn?`Walk-in ${n.ref}`:t(n.name,l)},852,[]);
|
| 9 |
+
__d(function(g,r,_i,a,m,_e,_d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.Screensaver=function({rid:e,idleMins:n,pinOn:o,pin:i,tonightCards:u}){const[s,l]=(0,t.useState)(!1),[c,d]=(0,t.useState)(!1),[f,w]=(0,t.useState)(''),b=(0,t.useRef)(Date.now()),x=(0,t.useRef)(!1),R=(0,t.useRef)(0);x.current=s;const j=6e4*n;(0,t.useEffect)(()=>{if(!h)return;const e=e=>'pointerdown'===e.type||'touchstart'===e.type||'mousedown'===e.type||'keydown'===e.type,t=t=>{const n=performance.now();return x.current&&e(t)?(t.preventDefault(),t.stopPropagation(),t.stopImmediatePropagation?.(),R.current=n+800,x.current=!1,window.__ccWokeAt=n,l(!1),k.current&&d(!0),void(b.current=Date.now())):n<R.current&&['pointerup','mouseup','touchend','click','pointerdown','mousedown','touchstart'].includes(t.type)?(t.preventDefault(),t.stopPropagation(),void t.stopImmediatePropagation?.()):void(b.current=Date.now())},n=['pointerdown','pointerup','mousedown','mouseup','touchstart','touchend','click','keydown','wheel'];n.forEach(e=>window.addEventListener(e,t,{capture:!0,passive:!1}));const o=setInterval(()=>{!x.current&&!D.current&&Date.now()-b.current>=j&&(x.current=!0,l(!0))},1e3);return()=>{n.forEach(e=>window.removeEventListener(e,t,{capture:!0})),clearInterval(o)}},[j]);const k=(0,t.useRef)(o);k.current=o;const D=(0,t.useRef)(c);return D.current=c,(0,t.useEffect)(()=>{if(!h)return;let e=null;const t=async()=>{try{e=await(navigator.wakeLock?.request?.('screen')),window.__ccWakeLock=e?'on':'unsupported'}catch{window.__ccWakeLock='refused'}};t();const n=()=>{'visible'===document.visibilityState&&t()};return document.addEventListener('visibilitychange',n),()=>{document.removeEventListener('visibilitychange',n);try{e?.release?.()}catch{}}},[]),c?(0,p.jsx)(y,{pin:i,entry:f,setEntry:w,onOk:()=>{d(!1),w(''),b.current=Date.now()}}):s?(0,p.jsx)(v,{rid:e,tonightCards:u}):null};var t=r(_d[0]),n=e(r(_d[1])),o=e(r(_d[2])),i=e(r(_d[3]));r(_d[4]);var u=e(r(_d[5])),s=e(r(_d[6])),l=e(r(_d[7])),c=r(_d[8]),d=r(_d[9]),f=r(_d[10]),p=r(_d[11]);const h='undefined'!=typeof window;function w({w:e,h:i,seed:u}){const s=(0,t.useRef)(new n.default.Value(0)).current,l=e=>{const t=233280*Math.sin(9301*u+49297*e);return t-Math.floor(t)};(0,t.useEffect)(()=>{const e=n.default.loop(n.default.timing(s,{toValue:1,duration:9e3+9e3*l(1),delay:4e3*l(2),easing:o.default.linear,useNativeDriver:!1}));return e.start(),()=>e.stop()},[]);const d=3+5*l(3);return(0,p.jsx)(n.default.View,{pointerEvents:"none",style:{position:'absolute',left:l(4)*e,top:0,width:d,height:d,borderRadius:d,backgroundColor:c.colours.goldLight,shadowColor:c.colours.gold,shadowRadius:6,shadowOpacity:.9,opacity:s.interpolate({inputRange:[0,.15,.8,1],outputRange:[0,.85,.5,0]}),transform:[{translateY:s.interpolate({inputRange:[0,1],outputRange:[i+20,i*(.15+.3*l(5))]})},{translateX:s.interpolate({inputRange:[0,.5,1],outputRange:[0,60*(l(6)-.5),0]})}]}})}function y({pin:e,entry:t,setEntry:n,onOk:o}){const i=i=>{const u=(t+i).slice(0,4);n(u),4===u.length&&(u===e?o():setTimeout(()=>n(''),300))};return(0,p.jsxs)(s.default,{testID:"wake-pin",style:{position:h?'fixed':'absolute',left:0,right:0,top:0,bottom:0,zIndex:1e5,backgroundColor:'rgba(5,5,5,0.97)',alignItems:'center',justifyContent:'center',gap:16},children:[(0,p.jsx)(f.T,{size:22,weight:"semibold",colour:c.colours.gold,children:"Enter staff PIN"}),(0,p.jsxs)(f.T,{size:30,weight:"bold",children:['\u25cf'.repeat(t.length),'\u25cb'.repeat(4-t.length)]}),(0,p.jsx)(s.default,{style:{flexDirection:'row',flexWrap:'wrap',width:252,gap:12,justifyContent:'center'},children:['1','2','3','4','5','6','7','8','9','0'].map(e=>(0,p.jsx)(u.default,{accessibilityRole:"button",accessibilityLabel:`PIN ${e}`,onPress:()=>i(e),style:{width:72,height:72,borderRadius:36,borderWidth:2,borderColor:c.colours.gold,alignItems:'center',justifyContent:'center'},children:(0,p.jsx)(f.T,{size:26,colour:c.colours.gold,children:e})},e))})]})}function v({rid:e}){const{width:u,height:s}=(0,l.default)(),y=(0,t.useRef)({width:u,height:s});y.current={width:u,height:s};const v=(0,d.useBrand)(e),b=d.HERO_LOGOS[e]??v.logo,x=(0,t.useRef)(new n.default.Value(0)).current,R=(0,t.useRef)(new n.default.Value(0)).current,j=(0,t.useRef)(new n.default.ValueXY({x:0,y:0})).current;(0,t.useEffect)(()=>{n.default.timing(x,{toValue:1,duration:700,useNativeDriver:!1}).start();const e=n.default.loop(n.default.sequence([n.default.timing(R,{toValue:1,duration:14e3,easing:o.default.inOut(o.default.quad),useNativeDriver:!1}),n.default.timing(R,{toValue:0,duration:14e3,easing:o.default.inOut(o.default.quad),useNativeDriver:!1})]));e.start();const t=()=>n.default.timing(j,{toValue:{x:(Math.random()-.5)*y.current.width*.18,y:(Math.random()-.5)*y.current.height*.14},duration:6e3,easing:o.default.inOut(o.default.quad),useNativeDriver:!1}).start();t();const i=setInterval(t,2e4);return()=>{e.stop(),clearInterval(i)}},[]);const k=(0,t.useRef)(!0);(0,t.useEffect)(()=>{k.current?k.current=!1:n.default.timing(j,{toValue:{x:0,y:0},duration:500,easing:o.default.out(o.default.quad),useNativeDriver:!1}).start()},[u>s]);const D=.5*Math.min(u,s);return(0,p.jsxs)(n.default.View,{testID:"screensaver",accessibilityLabel:"Screensaver \u2014 touch to wake",style:{position:h?'fixed':'absolute',left:0,top:0,right:0,bottom:0,zIndex:1e5,backgroundColor:'#050505',opacity:x,overflow:'hidden',cursor:'pointer'},children:[Array.from({length:18},(e,t)=>(0,p.jsx)(w,{w:u,h:s,seed:t+1},t)),(0,p.jsx)(n.default.View,{style:{flex:1,alignItems:'center',justifyContent:'center',transform:[{translateX:j.x},{translateY:j.y}]},children:b?(0,p.jsx)(n.default.View,{style:{transform:[{scale:R.interpolate({inputRange:[0,1],outputRange:[1,1.12]})},{translateX:R.interpolate({inputRange:[0,1],outputRange:[-10,10]})}]},children:(0,p.jsx)(i.default,{source:b,style:{width:D,height:D},resizeMode:"contain",accessibilityLabel:`${v.name} logo`})}):(0,p.jsx)(f.T,{size:48,weight:"bold",colour:c.colours.gold,children:v.name})})]})}},853,[12,102,206,178,104,245,109,269,797,855,790,6]);
|
| 10 |
+
__d(function(g,_r,_i,_a,_m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"Card",{enumerable:!0,get:function(){return y}}),_e.ArrivalsStrip=function({todays:e,now:t,privacy:s}){const r=e.filter(e=>'confirmed'===e.status).map(e=>({b:e,m:(0,m.minsBetween)(t,new Date(`${e.date}T${e.time}:00`))})).filter(e=>e.m>=-20&&e.m<=60).sort((e,t)=>e.m-t.m);return(0,p.jsxs)(a.default,{testID:"arrivals-strip",style:{flexDirection:'row',alignItems:'center',gap:8,minHeight:40},children:[(0,p.jsx)(o.T,{size:13,weight:"semibold",colour:j.colours.gold,children:"NEXT HOUR"}),(0,p.jsxs)(l.default,{horizontal:!0,showsHorizontalScrollIndicator:!1,contentContainerStyle:{gap:6},children:[0===r.length?(0,p.jsx)(o.Muted,{children:"No arrivals due in the next hour."}):null,r.map(({b:e,m:t})=>(0,p.jsxs)(a.default,{style:{flexDirection:'row',alignItems:'center',gap:6,paddingHorizontal:10,paddingVertical:5,borderRadius:16,backgroundColor:t<0?j.colours.amberBg:'#12263D',borderWidth:1,borderColor:t<0?j.colours.amber:'#3C78B5'},children:[(0,p.jsx)(o.T,{size:13,weight:"semibold",children:e.time}),(0,p.jsxs)(o.T,{size:13,children:[(0,i.privName)(e,s)," \xb7 ",e.partySize]}),(0,p.jsx)(o.T,{size:12,colour:j.colours.muted,children:e.table?`T${e.table}`:'no table'}),(0,p.jsx)(o.T,{size:12,colour:t<0?j.colours.amber:j.colours.blue,children:t<0?-t+"m late":0===t?'now':`in ${t}m`}),e.allergies.length?(0,p.jsx)(o.T,{size:12,children:"\u26a0"}):null,e.occasion?(0,p.jsx)(o.T,{size:12,children:b.OCCASION_ICON[e.occasion]}):null]},e.id))]})]})},_e.Legend=function(){return(0,p.jsxs)(o.Row,{wrap:!0,gap:10,style:{paddingVertical:2},children:[Object.keys(b.STATUS).map(e=>(0,p.jsxs)(o.Row,{gap:4,children:[(0,p.jsx)(a.default,{style:{width:12,height:12,borderRadius:4,backgroundColor:b.STATUS[e].colour}}),(0,p.jsx)(o.T,{size:12,colour:j.colours.muted,children:b.STATUS[e].label})]},e)),(0,p.jsx)(o.T,{size:12,colour:j.colours.muted,children:"\u26a0 allergy \xb7 \u2605 VIP \xb7 \u2665 regular \xb7 \ud83c\udf82 birthday \xb7 \ud83d\udc8d anniversary"})]})},_e.DetailsPanel=function({title:e,children:s,onClose:l}){const[r,a]=(0,t.useState)(20);return(0,t.useEffect)(()=>{const e=Date.now(),t=()=>a(20-Math.floor((Date.now()-e)/1e3)),s=setInterval(t,1e3),l=setTimeout(t,2e4);return()=>{clearInterval(s),clearTimeout(l)}},[]),(0,t.useEffect)(()=>{r<=0&&l()},[r]),(0,p.jsxs)(o.Sheet,{visible:!0,onClose:l,title:e,maxWidth:560,testID:"private-details",children:[(0,p.jsx)(o.Badge,{kind:"amber",label:`Private \xb7 closes in ${Math.max(0,r)}s`}),s,(0,p.jsx)(o.Button,{kind:"secondary",label:"Close now",onPress:l})]})},Object.defineProperty(_e,"bookingDetails",{enumerable:!0,get:function(){return w}}),_e.TableSheet=function({rid:e,name:l,view:h,plan:x,todays:f,now:y,privacy:w,turnBase:v,onClose:T,onWalkIn:S,onMove:k,onDetails:$}){const C=h[l],M=c.useFloor.getState(),[z,I]=(0,t.useState)(!1),[B,D]=(0,t.useState)(C?.note??''),[P,R]=(0,t.useState)(!1);if(!C)return null;const A=C.booking,O=['seated','mains','dessert','bill'].includes(C.status),N=f.filter(e=>'confirmed'===e.status).sort((e,t)=>Math.abs((0,m.minsBetween)(y,(0,b.startOf)(e)))-Math.abs((0,m.minsBetween)(y,(0,b.startOf)(t)))),W=e=>e.partySize<=C.table.maxSeats,L=(0,b.turnFor)(C.covers||C.table.maxSeats,v);return(0,p.jsxs)(o.Sheet,{visible:!0,onClose:T,title:`Table ${l} \xb7 ${b.STATUS[C.status].label}`,maxWidth:640,testID:"table-sheet",children:[(0,p.jsxs)(o.Row,{wrap:!0,gap:6,children:[(0,p.jsx)(o.Badge,{kind:"neutral",label:`${C.table.minSeats}\u2013${C.table.maxSeats} seats`}),A?(0,p.jsx)(o.Badge,{kind:"gold",label:`${(0,i.privName)(A,w)} \xb7 ${A.partySize} \xb7 ${C.seatedMins}m`}):null,A?(0,p.jsx)(o.Badge,{kind:C.seatedMins>(0,b.durOf)(A,v)?'red':'neutral',label:`Turn ~${(0,b.durOf)(A,v)} min \xb7 free ~${(0,m.hm)((0,b.endOf)(A,v))} (est.)`}):(0,p.jsx)(o.Badge,{kind:"neutral",label:`Turn estimate for ${C.table.maxSeats}: ~${L} min`}),C.next?(0,p.jsx)(o.Badge,{kind:"blue",label:`Next: ${C.next.time} ${(0,i.privName)(C.next,w)} (${C.next.partySize})`}):null,C.allergy?(0,p.jsx)(o.Badge,{kind:"red",label:"\u26a0 Allergy \u2014 see details"}):null]}),O||'blocked'===C.status?null:(0,p.jsxs)(o.Row,{gap:8,children:[(0,p.jsx)(o.Button,{label:"Seat walk-in here",onPress:()=>{T(),S(l)},testID:"seat-walkin-here",style:{flex:1,minHeight:56}}),(0,p.jsx)(o.Button,{kind:"secondary",label:"Seat a booking",onPress:()=>R(!P),testID:"seat-booking-here",style:{flex:1,minHeight:56}})]}),P?(0,p.jsxs)(a.default,{style:{gap:6},children:[0===N.length?(0,p.jsx)(o.Muted,{children:"No bookings left to seat today."}):null,N.slice(0,8).map(t=>(0,p.jsxs)(s.default,{accessibilityRole:"button",accessibilityLabel:`Seat ${(0,i.privName)(t,w)} ${t.time}`,onPress:async()=>{await u.repo.bookings.update(t.id,{table:l}),await u.repo.bookings.setStatus(t.id,'seated'),(0,n.resetTableLive)(e,l),T()},style:{padding:10,borderRadius:10,borderWidth:1,borderColor:W(t)?j.colours.border:j.colours.amber,backgroundColor:j.colours.surface2},children:[(0,p.jsxs)(o.T,{weight:"semibold",children:[t.time," \xb7 ",(0,i.privName)(t,w)," \xb7 ",t.partySize,t.table?` \xb7 booked T${t.table}`:'',t.allergies.length?' \xb7 \u26a0':'']}),W(t)?null:(0,p.jsxs)(o.T,{size:12,colour:j.colours.amber,children:["Bigger than this table (",C.table.maxSeats," max)"]})]},t.id))]}):null,O?(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(o.T,{size:14,colour:j.colours.muted,children:"Course / status"}),(0,p.jsx)(o.Row,{wrap:!0,gap:6,children:b.STAGES.map(t=>(0,p.jsx)(o.Chip,{label:b.STATUS[t].label,selected:C.status===t,onPress:()=>M.setLive(e,l,{stage:t})},t))}),(0,p.jsxs)(o.Row,{wrap:!0,gap:8,children:[A?(0,p.jsx)(o.Button,{kind:"secondary",label:"Move party\u2026",onPress:()=>{T(),k(l)},testID:"move-party"}):null,(0,p.jsx)(o.Button,{kind:"success",label:"Clear table",testID:"clear-table",onPress:async()=>{A&&await u.repo.bookings.setStatus(A.id,'finished'),M.setLive(e,l,{stage:void 0,dirty:!0}),T()}})]})]}):null,'dirty'===C.status?(0,p.jsx)(o.Button,{kind:"success",label:"Mark clean \u2014 table free",onPress:()=>{M.setLive(e,l,{dirty:!1}),T()},testID:"mark-clean"}):null,(0,p.jsxs)(o.Row,{wrap:!0,gap:8,children:[(0,p.jsx)(o.Button,{kind:"secondary",label:'blocked'===C.status?'Unblock table':'Block table',onPress:()=>{M.setLive(e,l,{blocked:'blocked'!==C.status}),T()},testID:"block-table"}),(0,p.jsx)(o.Button,{kind:"ghost",label:C.note?'Edit note':'+ Note',onPress:()=>I(!z)}),A||C.next?(0,p.jsx)(o.Button,{kind:"ghost",label:"Guest details",onPress:()=>{T(),$(A??C.next)},testID:"guest-details"}):null]}),z?(0,p.jsxs)(o.Row,{gap:6,children:[(0,p.jsx)(r.default,{accessibilityLabel:"Table note",value:B,onChangeText:D,placeholder:"e.g. wobbly leg, high chair here",placeholderTextColor:"#7D776C",style:[o.styles.input,{flex:1}]}),(0,p.jsx)(o.Button,{small:!0,label:"Save",onPress:()=>{M.setLive(e,l,{note:B.trim()||void 0}),I(!1)}})]}):null,w?(0,p.jsx)(o.Muted,{children:"Privacy mode: names as initials; tap Guest details for notes and allergies (closes after 20 s)."}):null,x.joins.some(e=>e.tables.includes(l))?(0,p.jsxs)(o.Muted,{children:["Joins with ",x.joins.find(e=>e.tables.includes(l)).tables.filter(e=>e!==l).join(', ')," for bigger parties (book as ",x.joins.find(e=>e.tables.includes(l)).tables.join('+'),")."]}):null]})},_e.WaitlistPanel=function({rid:e,r:l,plan:h,view:f,todays:w,waiting:v,now:T,privacy:S,busy:k,onToast:$}){const[C,M]=(0,t.useState)(''),[z,I]=(0,t.useState)(2),B=(0,c.useFloor)(e=>e.smsLog);return(0,p.jsxs)(y,{title:`Waitlist (${v.length})`,right:(0,p.jsxs)(o.Muted,{children:["new party ~",(0,x.estimateWait)(v.length+1,l.settings.turnMins,k)," min"]}),testID:"waitlist-panel",children:[0===v.length?(0,p.jsx)(o.Muted,{children:"Nobody waiting."}):null,v.map((t,s)=>{const r=(0,b.suggestTable)(h,w,f,t.partySize,T,(0,b.turnFor)(t.partySize,l.settings.turnMins)),y=(0,x.estimateWait)(s+1,l.settings.turnMins,k),v=Math.max(0,(0,m.minsBetween)(new Date(t.joinedAt),T)),C=B.find(s=>s.rid===e&&s.text.includes(`#${t.number} `));return(0,p.jsxs)(a.default,{style:{backgroundColor:j.colours.surface2,borderRadius:10,padding:8,gap:4},children:[(0,p.jsxs)(o.Row,{style:{justifyContent:'space-between'},children:[(0,p.jsxs)(o.T,{weight:"semibold",children:["#",t.number," ",(0,i.pv)(t.name,S)," \xb7 ",t.partySize]}),(0,p.jsxs)(o.T,{size:12,colour:v>y?j.colours.amber:j.colours.muted,children:["waited ",v,"m \xb7 quoted ~",y,"m"]})]}),r?(0,p.jsxs)(o.T,{size:12,colour:r.clashes?j.colours.amber:j.colours.green,children:["Best table: ",r.table," (",r.why,")"]}):(0,p.jsx)(o.T,{size:12,colour:j.colours.amber,children:"No table big enough \u2014 join tables in the plan"}),(0,p.jsxs)(o.Row,{wrap:!0,gap:6,children:[(0,p.jsx)(o.Button,{small:!0,label:C||'notified'===t.status?'Re-send (demo)':'Table ready text (demo)',testID:`sms-${t.number}`,onPress:()=>{c.useFloor.getState().logSms(e,T.toISOString(),`#${t.number} ${t.partySize}: Your table at ${l.name} is ready.`),u.repo.waitlist.setStatus(t.id,'notified'),$(`DEMO \u2014 no text sent. Would say: "Your table at ${l.name} is ready."`)}}),r?(0,p.jsx)(o.Button,{small:!0,kind:"success",label:`Seat at ${r.table}`,onPress:async()=>{await u.repo.waitlist.setStatus(t.id,'seated'),await u.repo.bookings.seatWalkIn(e,t.partySize,r.table,`From waitlist #${t.number}`),(0,n.resetTableLive)(e,r.table),$(`Waitlist #${t.number} seated at ${r.table}`)}}):null,(0,p.jsx)(o.Button,{small:!0,kind:"ghost",label:"Remove",onPress:()=>u.repo.waitlist.setStatus(t.id,'removed')})]}),'notified'===t.status?(0,p.jsx)(o.Badge,{kind:"green",label:`Told table ready${C?` ${(0,m.hm)(new Date(C.at))}`:''} (demo)`}):null]},t.id)}),(0,p.jsxs)(o.Row,{gap:6,children:[(0,p.jsx)(r.default,{accessibilityLabel:"Waitlist name",placeholder:"Name for the waitlist",placeholderTextColor:"#7D776C",value:C,onChangeText:M,style:[o.styles.input,{flex:1,minWidth:0,width:40,paddingVertical:6}]}),(0,p.jsx)(s.default,{accessibilityLabel:"Waitlist party size",onPress:()=>I(e=>e>=8?1:e+1),style:{width:48,height:48,borderRadius:10,borderWidth:1,borderColor:j.colours.gold,alignItems:'center',justifyContent:'center'},children:(0,p.jsx)(o.T,{weight:"bold",colour:j.colours.gold,children:z})}),(0,p.jsx)(o.Button,{small:!0,label:"Add",disabled:C.trim().length<2,onPress:()=>{u.repo.waitlist.join(e,C.trim(),z),M('')}})]})]})},_e.PacePanel=function({r:e,fc:t,todays:s,now:l,walkInCount:r,staffOn:n,onSummary:i}){const u=r+s.filter(e=>['seated','finished'].includes(e.status)).reduce((e,t)=>e+t.partySize,0),c=l.getHours(),h=Math.round(t.hours.filter(e=>e.hour<c).reduce((e,t)=>e+t.covers,0)+(t.hours.find(e=>e.hour===c)?.covers??0)*(l.getMinutes()/60)),x=h?u/h:1,f=x>=1.1?j.colours.amber:x>=.85?j.colours.green:j.colours.blue,w=Array.from({length:8},(e,t)=>{const r=(0,m.addMins)(l,15*(t-4)-l.getMinutes()%15),a=(0,m.addMins)(r,15),o=s.filter(e=>!['cancelled','noshow'].includes(e.status)).filter(e=>{const t=(0,b.startOf)(e);return t>=r&&t<a}).reduce((e,t)=>e+t.partySize,0);return{from:r,covers:o,future:t>=4}}),v=Math.max(4,Math.round(e.settings.capacityPerHour/4)),T=Math.max(v,...w.map(e=>e.covers)),S=w.filter(e=>e.future&&e.covers>v),k=t.nextHour?.covers??0,$=Math.ceil(k/16);return(0,p.jsxs)(y,{title:"Pace & kitchen",right:(0,p.jsx)(o.Badge,{kind:"amber",label:"ESTIMATE"}),testID:"pace-panel",children:[(0,p.jsxs)(a.default,{testID:"pace-meter",accessibilityLabel:`Covers so far ${u} vs forecast ${h}`,style:{gap:4},children:[(0,p.jsxs)(o.Row,{style:{justifyContent:'space-between'},children:[(0,p.jsx)(o.T,{size:14,children:"Covers so far"}),(0,p.jsxs)(o.T,{weight:"bold",colour:f,children:[u," ",(0,p.jsxs)(o.T,{size:13,colour:j.colours.muted,children:["/ ~",h," forecast"]})]})]}),(0,p.jsx)(a.default,{style:{height:10,borderRadius:5,backgroundColor:'#2A2620',overflow:'hidden'},children:(0,p.jsx)(a.default,{style:{width:`${Math.min(100,75*x)}%`,height:10,borderRadius:5,backgroundColor:f}})}),(0,p.jsxs)(o.Muted,{children:[x>=1.1?'Ahead of forecast':x>=.85?'On pace':'Behind forecast'," \xb7 next hour ~",t.nextHour?`${t.nextHour.coversLow}\u2013${t.nextHour.coversHigh}`:0," covers"]})]}),(0,p.jsx)(o.T,{size:13,colour:j.colours.muted,children:"Covers seated per 15 min (last hour \xb7 next hour)"}),(0,p.jsx)(a.default,{testID:"kitchen-pacing",style:{flexDirection:'row',alignItems:'flex-end',gap:4,height:64},children:w.map((e,t)=>(0,p.jsxs)(a.default,{style:{flex:1,alignItems:'center',gap:2},children:[(0,p.jsx)(o.T,{size:10,colour:j.colours.muted,children:e.covers||''}),(0,p.jsx)(a.default,{style:{width:'80%',height:Math.max(2,e.covers/T*40),borderRadius:3,backgroundColor:e.covers>v?j.colours.red:e.future?'#6B5A3A':j.colours.gold}}),(0,p.jsx)(o.T,{size:9,colour:4===t?j.colours.gold:j.colours.muted,children:(0,m.hm)(e.from)})]},t))}),S.map(e=>(0,p.jsxs)(o.T,{size:13,colour:j.colours.amber,children:["\u26a0 Kitchen: ",e.covers," covers due ",(0,m.hm)(e.from),"\u2013",(0,m.hm)((0,m.addMins)(e.from,15))," (pace ~",v,") \u2014 stagger seating if you can."]},e.from.getTime())),$>n?(0,p.jsxs)(o.T,{size:13,colour:j.colours.amber,children:["\u26a0 Next hour ~",k," covers with ",n," on: about ",$-n," more on the floor suggested."]}):(0,p.jsxs)(o.T,{size:13,colour:j.colours.green,children:["Staffing looks OK for the next hour (",n," on)."]}),(0,p.jsx)(o.Button,{small:!0,kind:"secondary",label:"End-of-service summary",onPress:i,testID:"eos-open"})]})},_e.ServiceSummary=function({r:e,todays:t,orders:s,waitlistAll:l,walkInCount:r,onClose:a}){const n=t.filter(e=>['seated','finished'].includes(e.status)),i=n.reduce((e,t)=>e+t.partySize,0)+r,u=t.filter(e=>e.walkIn),h=t.filter(e=>'finished'===e.status&&e.seatedAt&&e.finishedAt).map(e=>(0,m.minsBetween)(new Date(e.seatedAt),new Date(e.finishedAt))),b=s.reduce((e,t)=>e+t.paid,0),x=(0,c.useFloor)(t=>t.smsLog.filter(t=>t.rid===e.id).length),j=(e,t)=>(0,p.jsxs)(o.Row,{style:{justifyContent:'space-between'},children:[(0,p.jsx)(o.T,{children:e}),(0,p.jsx)(o.T,{weight:"semibold",children:t})]},e);return(0,p.jsxs)(o.Sheet,{visible:!0,onClose:a,title:`End of service \xb7 ${e.name}`,maxWidth:560,testID:"eos-summary",children:[j('Covers served',String(i)),j('Bookings seated',`${n.filter(e=>!e.walkIn).length} of ${t.filter(e=>!e.walkIn&&'cancelled'!==e.status).length}`),j('Walk-ins',`${u.length} parties \xb7 ${u.reduce((e,t)=>e+t.partySize,0)+r} covers`),j('No-shows',String(t.filter(e=>'noshow'===e.status).length)),j('Average table time',h.length?`${Math.round(h.reduce((e,t)=>e+t,0)/h.length)} min`:'\u2014'),j('Waitlist seated',`${l.filter(e=>'seated'===e.status).length} (${l.filter(e=>'removed'===e.status).length} left)`),j('"Table ready" texts',`${x} (demo, none sent)`),j('Taken at the till/app',`${(0,f.gbp)(b)} (demo)`),(0,p.jsx)(o.Muted,{children:"Example data on this device. Nothing is sent anywhere."})]})},Object.defineProperty(_e,"isWeb",{enumerable:!0,get:function(){return v}}),Object.defineProperty(_e,"tablesOf",{enumerable:!0,get:function(){return c.tablesOf}});var t=_r(d[0]);_r(d[1]);var s=e(_r(d[2])),l=e(_r(d[3])),r=e(_r(d[4])),a=e(_r(d[5])),o=_r(d[6]),n=_r(d[7]),i=_r(d[8]),u=_r(d[9]),c=_r(d[10]),h=_r(d[11]),b=_r(d[12]),m=_r(d[13]),x=_r(d[14]),f=_r(d[15]),j=_r(d[16]),p=_r(d[17]);const y=({title:e,right:t,children:s,testID:l})=>(0,p.jsxs)(a.default,{testID:l,style:{backgroundColor:j.colours.surface,borderRadius:14,borderWidth:1,borderColor:j.colours.border,padding:10,gap:6},children:[(0,p.jsxs)(o.Row,{style:{justifyContent:'space-between'},children:[(0,p.jsx)(o.T,{weight:"semibold",colour:j.colours.gold,children:e}),t]}),s]});const w=e=>(0,p.jsxs)(a.default,{style:{gap:6},children:[(0,p.jsxs)(o.T,{size:18,weight:"semibold",children:[e.walkIn?`Walk-in ${e.ref}`:e.name.replace(' (example)','')," \xb7 ",e.partySize]}),(0,p.jsxs)(o.Muted,{children:[e.time," \xb7 ",e.table?`Table ${e.table}`:'No table'," \xb7 ",e.ref,e.tags?.length?` \xb7 ${e.tags.join(', ')}`:'',e.occasion?` \xb7 ${e.occasion}`:'']}),e.notes?(0,p.jsxs)(o.T,{children:["Notes: ",e.notes]}):(0,p.jsx)(o.Muted,{children:"No notes."}),e.allergies.length?(0,p.jsx)(a.default,{style:{backgroundColor:j.colours.redBg,borderRadius:8,padding:8},children:(0,p.jsxs)(o.T,{weight:"bold",colour:"#FFE3DF",children:["ALLERGY: ",e.allergies.map(e=>`${(0,h.allergenLabel)(e.allergen)} \u2014 ${(0,h.severityLabel)(e.severity)}`).join('; ')]})}):(0,p.jsx)(o.Muted,{children:"No allergies declared."}),(0,p.jsx)(o.Muted,{children:"Phone and email stay in the Managers app; the Display never shows them."})]});const v=!0},854,[12,104,245,133,255,109,790,847,852,796,860,791,848,795,843,793,797,6]);
|
chef-app/index.html
CHANGED
|
@@ -42,13 +42,13 @@
|
|
| 42 |
<noscript> You need to enable JavaScript to run this app. </noscript>
|
| 43 |
<!-- The root element for your Expo app. -->
|
| 44 |
<div id="root"><div id="cc-boot" style="position:fixed;inset:0;display:flex;align-items:center;justify-content:center;background:#0B0B0B"><img src="/chef-app/brand-logo.png" alt="The Anchorage" width="180" height="180"/></div></div>
|
| 45 |
-
<script src="/chef-app/_expo/static/js/web/__expo-metro-runtime-8c088df87a31e4e6accd81c554ec290d.js" defer></script><script src="/chef-app/_expo/static/js/web/__common-
|
| 46 |
<script>/* "Add to Home screen" hint for the Cover Charge web apps (injected into each app's index.html by tools/build_site.py).
|
| 47 |
Chrome/Edge/Samsung: an Install button (beforeinstallprompt). Huawei Browser, Chrome without an install prompt,
|
| 48 |
iPhone/iPad Safari: short menu steps. Shown once per app until dismissed; never inside the installed app. */
|
| 49 |
(function () {
|
| 50 |
var APP = 'The Anchorage · Head Chef', KEY = 'cc-install-hint:' + '/chef-app/';
|
| 51 |
-
var standalone = (window.matchMedia && matchMedia('(display-mode: standalone)').matches) || navigator.standalone === true;
|
| 52 |
if (standalone) return;
|
| 53 |
var bip = null, shown = false;
|
| 54 |
window.addEventListener('beforeinstallprompt', function (e) { e.preventDefault(); bip = e; if (shown) render(); });
|
|
|
|
| 42 |
<noscript> You need to enable JavaScript to run this app. </noscript>
|
| 43 |
<!-- The root element for your Expo app. -->
|
| 44 |
<div id="root"><div id="cc-boot" style="position:fixed;inset:0;display:flex;align-items:center;justify-content:center;background:#0B0B0B"><img src="/chef-app/brand-logo.png" alt="The Anchorage" width="180" height="180"/></div></div>
|
| 45 |
+
<script src="/chef-app/_expo/static/js/web/__expo-metro-runtime-8c088df87a31e4e6accd81c554ec290d.js" defer></script><script src="/chef-app/_expo/static/js/web/__common-c6c554815e4bb34cad819655b0244c17.js" defer></script><script src="/chef-app/_expo/static/js/web/entry-2abe893a1768655edb418b4c27b64314.js" defer></script>
|
| 46 |
<script>/* "Add to Home screen" hint for the Cover Charge web apps (injected into each app's index.html by tools/build_site.py).
|
| 47 |
Chrome/Edge/Samsung: an Install button (beforeinstallprompt). Huawei Browser, Chrome without an install prompt,
|
| 48 |
iPhone/iPad Safari: short menu steps. Shown once per app until dismissed; never inside the installed app. */
|
| 49 |
(function () {
|
| 50 |
var APP = 'The Anchorage · Head Chef', KEY = 'cc-install-hint:' + '/chef-app/';
|
| 51 |
+
var standalone = (window.matchMedia && (matchMedia('(display-mode: standalone)').matches || matchMedia('(display-mode: fullscreen)').matches)) || navigator.standalone === true || /CoverChargeTablet/.test(navigator.userAgent);
|
| 52 |
if (standalone) return;
|
| 53 |
var bip = null, shown = false;
|
| 54 |
window.addEventListener('beforeinstallprompt', function (e) { e.preventDefault(); bip = e; if (shown) render(); });
|
chef-app/sw.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
| 1 |
// The Anchorage · Head Chef service worker: precache the app shell so it opens offline after the first visit.
|
| 2 |
-
const V = "cc-chef-
|
| 3 |
const BASE = "/chef-app/";
|
| 4 |
-
const PRECACHE = ["/chef-app/_expo/static/js/web/+not-found-da8ea3ec55bebb0779db542f35c6adf9.js", "/chef-app/_expo/static/js/web/[did]-91eaf603d23bc2b2b79e4e95467ef972.js", "/chef-app/_expo/static/js/web/[n]-e07421962f3951aaf0f9cdf16bfbce72.js", "/chef-app/_expo/static/js/web/[oid]-7361f660100e238663b52e4e1fc71efc.js", "/chef-app/_expo/static/js/web/[section]-11e4dec81ff7b7cd85a190186e1ec965.js", "/chef-app/_expo/static/js/web/__common-
|
| 5 |
// Hugging Face serves large files (fonts) through a redirect to its CDN. Browsers refuse to hand a *redirected* cached
|
| 6 |
// response to a page, so store a plain copy instead (otherwise fonts, and so the app, fail to load offline).
|
| 7 |
const plain = r => r.redirected ? r.blob().then(b => new Response(b, { status: 200, headers: { 'Content-Type': r.headers.get('Content-Type') || b.type || 'application/octet-stream' } })) : Promise.resolve(r);
|
|
|
|
| 1 |
// The Anchorage · Head Chef service worker: precache the app shell so it opens offline after the first visit.
|
| 2 |
+
const V = "cc-chef-923320d324";
|
| 3 |
const BASE = "/chef-app/";
|
| 4 |
+
const PRECACHE = ["/chef-app/_expo/static/js/web/+not-found-da8ea3ec55bebb0779db542f35c6adf9.js", "/chef-app/_expo/static/js/web/[did]-91eaf603d23bc2b2b79e4e95467ef972.js", "/chef-app/_expo/static/js/web/[n]-e07421962f3951aaf0f9cdf16bfbce72.js", "/chef-app/_expo/static/js/web/[oid]-7361f660100e238663b52e4e1fc71efc.js", "/chef-app/_expo/static/js/web/[section]-11e4dec81ff7b7cd85a190186e1ec965.js", "/chef-app/_expo/static/js/web/__common-c6c554815e4bb34cad819655b0244c17.js", "/chef-app/_expo/static/js/web/__expo-metro-runtime-8c088df87a31e4e6accd81c554ec290d.js", "/chef-app/_expo/static/js/web/_layout-81b36bfeddca0b4e38b5954ffb5293f2.js", "/chef-app/_expo/static/js/web/basket-08b87f6408ab6870cfda24769972c955.js", "/chef-app/_expo/static/js/web/book-73d16fd431095875bb01cc0a0c784d3b.js", "/chef-app/_expo/static/js/web/demo-2aeda33db335ba3a45d18733444a4df6.js", "/chef-app/_expo/static/js/web/entry-2abe893a1768655edb418b4c27b64314.js", "/chef-app/_expo/static/js/web/feedback-c3022e0683297c445b34cc46bbd3da7c.js", "/chef-app/_expo/static/js/web/gift-0647b216e00344da5b09e74268994259.js", "/chef-app/_expo/static/js/web/index-262c67710af9665f3d517bccf3c36b47.js", "/chef-app/_expo/static/js/web/index-3ce55512f207e0f4e938fcea314e34d2.js", "/chef-app/_expo/static/js/web/index-42c772ae8e6fc8ffb457607b71499331.js", "/chef-app/_expo/static/js/web/index-74ed5e3887809c4259d725a2965aa3f3.js", "/chef-app/_expo/static/js/web/index-99af37ed24577194995c700759e20e13.js", "/chef-app/_expo/static/js/web/index-a31eb4179b9ed3be70eb8d0cd82ecd3d.js", "/chef-app/_expo/static/js/web/index-e57a61ccf8b16e38bf91548a01cebbf1.js", "/chef-app/_expo/static/js/web/index-f3b9a91d34732f43092424f9beb4b9f4.js", "/chef-app/_expo/static/js/web/index-fbb7a768b57e7588ba2174f223b7bfd2.js", "/chef-app/_expo/static/js/web/lost-7b007fea2d20e11c896c10e43db314be.js", "/chef-app/_expo/static/js/web/loyalty-3afa3f098d21bb7ab00753ff2e0dcc9d.js", "/chef-app/_expo/static/js/web/merch-14abbe5512f1b6eed03bc33e186d67f4.js", "/chef-app/_expo/static/js/web/offers-5900fcc1d50a10eb3a8ff2fd4b42777f.js", "/chef-app/_expo/static/js/web/profile-b0183082b0dcf2e0d1b983ab023ecb11.js", "/chef-app/_expo/static/js/web/refer-0e20085c049a276476e1c515770e9648.js", "/chef-app/_expo/static/js/web/waitlist-66e55b1e298508430a6f018b8afdee7b.js", "/chef-app/_expo/static/js/web/whatson-7bba1c8989b9be2fc455c8ddd8bbc99d.js", "/chef-app/apple-touch-icon.png", "/chef-app/assets/assets/brand/anchorage-hero.0450b828e4f9c1f4456240096598f6f5.png", "/chef-app/assets/assets/brand/anchorage.fea5ce2f6fd18bf2950aa21c0980ed8e.png", "/chef-app/assets/assets/brand/brae.8de9e89ac30966c6669de990370d8e40.png", "/chef-app/assets/assets/brand/saltmarsh.84acbc30d810d7a1cd3bbeb7b62651e8.png", "/chef-app/assets/assets/specials/sample-chalkboard.e7b4e4450a8483d4219bc6a214158d8f.jpg", "/chef-app/assets/node_modules/@expo-google-fonts/poppins/400Regular/Poppins_400Regular.093ee89be9ede30383f39a899c485a82.ttf", "/chef-app/assets/node_modules/@expo-google-fonts/poppins/500Medium/Poppins_500Medium.bf59c687bc6d3a70204d3944082c5cc0.ttf", "/chef-app/assets/node_modules/@expo-google-fonts/poppins/600SemiBold/Poppins_600SemiBold.6f1520d107205975713ba09df778f93f.ttf", "/chef-app/assets/node_modules/@expo-google-fonts/poppins/700Bold/Poppins_700Bold.08c20a487911694291bd8c5de41315ad.ttf", "/chef-app/assets/node_modules/expo-router/assets/arrow_down.017bc6ba3fc25503e5eb5e53826d48a8.png", "/chef-app/assets/node_modules/expo-router/assets/error.d1ea1496f9057eb392d5bbf3732a61b7.png", "/chef-app/assets/node_modules/expo-router/assets/file.19eeb73b9593a38f8e9f418337fc7d10.png", "/chef-app/assets/node_modules/expo-router/assets/forward.d8b800c443b8972542883e0b9de2bdc6.png", "/chef-app/assets/node_modules/expo-router/assets/pkg.ab19f4cbc543357183a20571f68380a3.png", "/chef-app/assets/node_modules/expo-router/assets/react-navigation/elements/back-icon-mask.0a328cd9c1afd0afe8e3b1ec5165b1b4.png", "/chef-app/assets/node_modules/expo-router/assets/react-navigation/elements/back-icon.35ba0eaec5a4f5ed12ca16fabeae451d.png", "/chef-app/assets/node_modules/expo-router/assets/react-navigation/elements/clear-icon.c94f6478e7ae0cdd9f15de1fcb9e5e55.png", "/chef-app/assets/node_modules/expo-router/assets/react-navigation/elements/clear-icon.c94f6478e7ae0cdd9f15de1fcb9e5e55@2x.png", "/chef-app/assets/node_modules/expo-router/assets/react-navigation/elements/clear-icon.c94f6478e7ae0cdd9f15de1fcb9e5e55@3x.png", "/chef-app/assets/node_modules/expo-router/assets/react-navigation/elements/clear-icon.c94f6478e7ae0cdd9f15de1fcb9e5e55@4x.png", "/chef-app/assets/node_modules/expo-router/assets/react-navigation/elements/close-icon.808e1b1b9b53114ec2838071a7e6daa7.png", "/chef-app/assets/node_modules/expo-router/assets/react-navigation/elements/close-icon.808e1b1b9b53114ec2838071a7e6daa7@2x.png", "/chef-app/assets/node_modules/expo-router/assets/react-navigation/elements/close-icon.808e1b1b9b53114ec2838071a7e6daa7@3x.png", "/chef-app/assets/node_modules/expo-router/assets/react-navigation/elements/close-icon.808e1b1b9b53114ec2838071a7e6daa7@4x.png", "/chef-app/assets/node_modules/expo-router/assets/react-navigation/elements/search-icon.286d67d3f74808a60a78d3ebf1a5fb57.png", "/chef-app/assets/node_modules/expo-router/assets/sitemap.412dd9275b6b48ad28f5e3d81bb1f626.png", "/chef-app/assets/node_modules/expo-router/assets/unmatched.20e71bdf79e3a97bf55fd9e164041578.png", "/chef-app/brand-logo.png", "/chef-app/favicon.ico", "/chef-app/icon-192.png", "/chef-app/icon-512.png", "/chef-app/icon-maskable-512.png", "/chef-app/manifest.webmanifest", "/chef-app/index.html"];
|
| 5 |
// Hugging Face serves large files (fonts) through a redirect to its CDN. Browsers refuse to hand a *redirected* cached
|
| 6 |
// response to a page, so store a plain copy instead (otherwise fonts, and so the app, fail to load offline).
|
| 7 |
const plain = r => r.redirected ? r.blob().then(b => new Response(b, { status: 200, headers: { 'Content-Type': r.headers.get('Content-Type') || b.type || 'application/octet-stream' } })) : Promise.resolve(r);
|
customer-app/_expo/static/js/web/__common-f6f10cdb908fe43987a720e10bb9e0f5.js
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
customer-app/_expo/static/js/web/entry-1c0e8f423517db12030897bf2de46a94.js
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
customer-app/_expo/static/js/web/index-93b1fb4a59822430dbc65ee63d8bd82a.js
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
customer-app/_expo/static/js/web/index-d66067b7a3fefef4ab21eabe87395720.js
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return o}});var t=r(d[0]);r(d[1]);var n=r(d[2]),u=r(d[3]),c=r(d[4]);function o(){return(0,n.canShow)('display')?(0,c.jsx)(u.DisplayBoard,{}):(0,c.jsx)(t.Redirect,{href:n.ENTRY[n.APP_VARIANT]})}},777,[785,12,787,850,6]);
|
| 2 |
+
__d(function(g,_r,_i,_a,_m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.DisplayBoard=function(){const{width:e,height:Y}=(0,n.default)(),_=e>=1e3,q=(0,T.useOwner)(e=>e.site),K=(0,y.useRestaurant)(q),X=(0,y.useOrders)(q),J=(0,y.useBookings)(q),Q=(0,y.useWaitlist)(q),Z=(0,y.useEvents)(q),ee=(0,y.useRatings)(q),se=(0,y.useAudit)(q),le=(0,y.useStore)(e=>e.menu),te=(0,y.useStore)(e=>e.walkIns[q]??0),ae=(0,y.useStore)(e=>e.alertAcks),re=((0,y.useStore)(e=>e.customer),(0,y.useStore)(e=>e.skipMinutes)),oe=(0,y.useNow)(5e3),ne=(0,T.useOwner)(e=>e.staff),ie=(0,T.useOwner)(e=>e.attendance),de=(0,T.useOwner)(e=>e.shifts),ue=(0,T.useOwner)(e=>e.chat),[ce,ge]=(0,s.useState)(!0);l.default.useEffect(()=>{(0,$.ensureAttendance)((0,f.ymd)(oe),oe),(0,v.ensureChat)(oe)},[(0,f.ymd)(oe)]);const he=ie.filter(e=>e.in&&!e.out&&oe.getTime()-new Date(e.in).getTime()<72e6&&oe.getTime()>=new Date(e.in).getTime()),pe=he.length?he.map(e=>F(ne.find(s=>s.id===e.staffId)?.name)).filter(Boolean):['Duty Manager'],[me,be]=(0,s.useState)(null),xe=me&&pe.includes(me)?me:pe[0],[fe,je]=(0,s.useState)(''),[ye,we]=(0,s.useState)('2'),ke=(0,f.ymd)(oe),Te=(0,C.useFrontDoor)(ke,e>Y),ve=(0,B.useDisplaySettings)(q),Ce=ve.privacy,$e=(0,B.usePlan)(q),Be=(0,B.useFloor)(e=>e.live[q]),[Se,Re]=(0,s.useState)('floor'),[Pe,Me]=(0,s.useState)(''),[De,Ae]=(0,s.useState)(null),[Ie,Le]=(0,s.useState)(null),[ze,Ee]=(0,s.useState)(null),[He,Ne]=(0,s.useState)(!1),[We,Oe]=(0,s.useState)(null);l.default.useEffect(()=>{if(!We)return;const e=setTimeout(()=>Oe(null),4500);return()=>clearTimeout(e)},[We]);const Fe=(e,s)=>Ee({title:e,body:s}),Ve=e=>Fe(`Guest details \xb7 ${e.time}`,(0,E.bookingDetails)(e)),Ge=(0,s.useMemo)(()=>(0,p.forecastToday)(K,J,X,Z,oe),[K,J,X,Z,oe.getTime()/6e4|0]),Ue=J.filter(e=>e.date===ke).sort((e,s)=>e.time.localeCompare(s.time)),Ye=te+Ue.filter(e=>e.walkIn&&['seated','finished'].includes(e.status)).reduce((e,s)=>e+s.partySize,0),qe=Ue.filter(e=>!e.walkIn&&'cancelled'!==e.status).reduce((e,s)=>e+s.partySize,0),Ke=Q.filter(e=>'waiting'===e.status||'notified'===e.status).sort((e,s)=>e.number-s.number),Xe=X.filter(e=>!['collected','closed','cancelled'].includes(e.status)).sort((e,s)=>Number('new'===s.status)-Number('new'===e.status)||(e.slotTime??e.createdAt).localeCompare(s.slotTime??s.createdAt)),Je=X.filter(e=>['collected','closed'].includes(e.status)).length,Qe=(0,x.takeawaySlots)(K,X,oe),Ze=Ge.nextHour?Math.min(1.6,Math.max(.8,Ge.nextHour.covers/(.75*K.settings.capacityPerHour))):1,es=(e,s)=>!!(0,z.statusBlock)(e,s,(0,z.linkedBooking)(e,J)),ss=e=>{const s=(0,z.nextStep)(e,(0,z.linkedBooking)(e,J));return!(!s||'table'===s&&!['ready','served'].includes(e.status))},ls=Xe.filter(e=>e.allergies.length&&ss(e)),ts=Ue.filter(e=>e.allergies.length&&!e.allergyAck&&['confirmed','seated'].includes(e.status)&&!Xe.some(s=>s.allergies.length&&(0,z.linkedBooking)(s,[e]))),as=Xe.flatMap(e=>(0,b.readinessFor)(e,K,oe).map(s=>({...s,order:e}))),rs=as.filter(e=>'due'===e.state||'overdue'===e.state),os=as.filter(e=>'upcoming'===e.state).sort((e,s)=>e.due.getTime()-s.due.getTime()),ns=ee.filter(e=>e.stars<=2&&!ae[`rating:${e.id}`]),is=Xe.filter(e=>'new'===e.status&&!e.allergies.length&&(0,f.minsBetween)(new Date(e.createdAt),oe)>=0),ds=le.filter(e=>e.restaurantId===q&&e.soldOut),us=(se.filter(e=>'stamp'===e.kind||'giftcard'===e.kind).slice(0,4),ls.length+ts.length+rs.length+ns.length+is.length),cs=(0,s.useMemo)(()=>(0,S.floorView)($e,J,X,Be??{},oe,K.settings.turnMins),[$e,J,X,Be,oe.getTime()]),gs=$e.areas.some(e=>e.id===Pe)?Pe:$e.areas[0]?.id??'',hs=Object.fromEntries($e.areas.map(e=>{const s=$e.tables.filter(s=>s.areaId===e.id);return[e.id,`${s.filter(e=>'free'===cs[e.name]?.status).length}/${s.length} free`]})),ps=(0,I.hoursFor)(K,oe),ms=ps?(0,f.addMins)(ps.open,-ps.open.getMinutes()):new Date(`${ke}T12:00:00`),bs=ps?(0,f.addMins)(ps.close,120):new Date(`${ke}T23:00:00`),xs=async(e,s)=>{const l=cs[e]?.booking;if(!l||e===s)return;const t=cs[s]?.status;if(t&&!['free','soon'].includes(t))return void Oe('dirty'===t?`Table ${s} needs clearing first.`:`Table ${s} is ${S.STATUS[t].label.toLowerCase()} \u2014 pick a free table.`);await y.repo.bookings.update(l.id,{table:s});const a=Be?.[e]?.stage;B.useFloor.getState().setLive(q,s,{stage:a??'seated',dirty:!1}),B.useFloor.getState().setLive(q,e,{stage:void 0,dirty:!0}),Oe(`${(0,A.privName)(l,Ce)} moved Table ${e} \u2192 ${s}. Table ${e} needs clearing.`)},fs=e=>Fe(`Order ${e.ref} \xb7 details`,(0,W.jsxs)(o.default,{style:{gap:4},children:[(0,W.jsx)(u.T,{weight:"semibold",children:F(e.customerName)}),e.allergies.length?(0,W.jsxs)(u.T,{weight:"bold",colour:k.colours.red,children:["ALLERGY: ",e.allergies.map(e=>`${(0,h.allergenLabel)(e.allergen)} (${(0,h.severityLabel)(e.severity)})`).join(', ')]}):(0,W.jsx)(u.Muted,{children:"No allergies declared."}),e.lines.filter(e=>e.overridden).map((e,s)=>(0,W.jsxs)(u.T,{colour:k.colours.red,children:["OVERRIDE: ",e.name," contains ",e.contains.map(h.allergenLabel).join(', ')]},s)),e.lines.map((e,s)=>(0,W.jsxs)(u.T,{size:15,children:[e.qty,"\xd7 ",e.name,e.notes?` \xb7 \u201c${e.notes}\u201d`:'']},s))]})),js=Ge.hours,ys=Math.max(K.settings.capacityPerHour,...js.map(e=>e.coversHigh)),ws=(0,W.jsxs)(V,{title:`Bookings & waitlist \xb7 ${(0,f.niceDate)(oe)}`,right:(0,W.jsx)(u.Badge,{kind:"gold",label:`${qe} booked \xb7 ${Ye} walk-in covers`}),children:[0===Ue.length?(0,W.jsx)(u.Muted,{children:"No bookings today."}):null,Ue.map(e=>{const s='confirmed'===e.status&&(0,f.minsBetween)(new Date(`${e.date}T${e.time}:00`),oe)>15;return(0,W.jsxs)(o.default,{style:[u.styles.card,{padding:10,opacity:['finished','noshow','cancelled'].includes(e.status)?.5:1,borderColor:e.allergies.length?k.colours.red:s?k.colours.amber:k.colours.border}],children:[(0,W.jsxs)(u.Row,{style:{justifyContent:'space-between'},children:[(0,W.jsxs)(u.T,{weight:"semibold",children:[e.time," \xb7 ",Ce?`${(0,A.privName)(e,!0)} \xb7 ${e.partySize}`:(0,C.walkInLabel)(e)]}),(0,W.jsx)(u.Badge,{kind:'seated'===e.status?'green':'noshow'===e.status?'red':'neutral',label:'noshow'===e.status?'No-show':e.status})]}),(0,W.jsxs)(u.Muted,{children:[e.table?`Table ${e.table}`:e.walkIn?'Table to assign':'Table TBC',e.walkIn?` \xb7 ${e.ref}`:'','none'!==e.security?" \xb7 "+('deposit'===e.security?'Deposit':'Card saved'):'',e.notes?Ce?' \xb7 \u270e':` \xb7 ${e.notes}`:'']}),e.allergies.length&&Ce?(0,W.jsxs)(u.Row,{gap:6,children:[(0,W.jsx)(u.Badge,{kind:"red",label:"\u26a0 Allergy"}),(0,W.jsx)(u.Button,{small:!0,kind:"ghost",label:"Details",onPress:()=>Ve(e)})]}):null,e.allergies.length&&!Ce?(0,W.jsx)(u.Row,{wrap:!0,gap:4,children:e.allergies.map(e=>(0,W.jsx)(u.Badge,{kind:"red",label:`${(0,h.allergenLabel)(e.allergen)} \u2014 ${(0,h.severityLabel)(e.severity)}`},e.allergen))}):null,s?(0,W.jsx)(u.T,{size:13,colour:k.colours.amber,children:"Running late \u2014 15+ min past booking time"}):null,!e.table&&e.walkIn&&'seated'===e.status?(0,W.jsx)(u.Button,{label:"Assign table",onPress:()=>Te.assignTable(e)}):null,'confirmed'===e.status?(0,W.jsxs)(u.Row,{gap:6,children:[(0,W.jsx)(u.Button,{small:!0,label:"Seat",onPress:()=>y.repo.bookings.setStatus(e.id,'seated')}),(0,W.jsx)(u.Button,{small:!0,kind:"secondary",label:"No-show",onPress:()=>y.repo.bookings.setStatus(e.id,'noshow')})]}):'seated'===e.status?(0,W.jsx)(u.Button,{small:!0,kind:"secondary",label:"Finished",onPress:()=>y.repo.bookings.setStatus(e.id,'finished')}):null]},e.id)}),(0,W.jsxs)(u.Row,{style:{justifyContent:'space-between',marginTop:6},children:[(0,W.jsxs)(u.T,{weight:"semibold",colour:k.colours.gold,children:["Waitlist (",Ke.length,")"]}),(0,W.jsxs)(u.Muted,{children:["~",(0,j.estimateWait)(Ke.length+1,K.settings.turnMins,Ze)," min for a new party (est.)"]})]}),Ke.map((e,s)=>(0,W.jsxs)(o.default,{style:[u.styles.card,{padding:10}],children:[(0,W.jsxs)(u.Row,{style:{justifyContent:'space-between'},children:[(0,W.jsxs)(u.T,{weight:"semibold",children:["#",e.number," ",(0,A.pv)(e.name,Ce)," \xb7 ",e.partySize]}),(0,W.jsxs)(u.Muted,{children:["waiting ",(0,f.minsBetween)(new Date(e.joinedAt),oe)," min \xb7 est. ",(0,j.estimateWait)(s+1,K.settings.turnMins,Ze)," min"]})]}),'notified'===e.status?(0,W.jsx)(u.Badge,{kind:"green",label:"Notified \u2014 table ready"}):null,(0,W.jsxs)(u.Row,{gap:6,children:['waiting'===e.status?(0,W.jsx)(u.Button,{small:!0,kind:"secondary",label:"Notify",onPress:()=>y.repo.waitlist.setStatus(e.id,'notified')}):null,(0,W.jsx)(u.Button,{small:!0,label:"Seat",onPress:()=>y.repo.waitlist.setStatus(e.id,'seated')}),(0,W.jsx)(u.Button,{small:!0,kind:"ghost",label:"Remove",onPress:()=>y.repo.waitlist.setStatus(e.id,'removed')})]})]},e.id)),(0,W.jsxs)(u.Row,{gap:6,children:[(0,W.jsx)(r.default,{accessibilityLabel:"Waitlist name",placeholder:"Name for the waitlist",placeholderTextColor:"#7D776C",value:fe,onChangeText:je,style:[u.styles.input,{flex:1,paddingVertical:6}]}),(0,W.jsx)(r.default,{accessibilityLabel:"Party size",value:ye,onChangeText:we,keyboardType:"number-pad",style:[u.styles.input,{width:50,paddingVertical:6}]}),(0,W.jsx)(u.Button,{small:!0,label:"Add",disabled:fe.trim().length<2,onPress:()=>{y.repo.waitlist.join(q,fe.trim(),Math.max(1,Number(ye)||2)),je('')}})]})]}),ks=(0,W.jsxs)(V,{title:"Live orders & kitchen tickets",right:(0,W.jsxs)(u.Row,{gap:6,children:[(0,W.jsx)(u.Chip,{label:"Tickets",selected:ce,onPress:()=>ge(!0)}),(0,W.jsx)(u.Chip,{label:"Full orders",selected:!ce,onPress:()=>ge(!1)})]}),children:[(0,W.jsxs)(u.Muted,{children:[Xe.length," live \xb7 ",Je," done today"]}),0===Xe.length?(0,W.jsx)(u.Muted,{children:"No live orders."}):null,ce?(0,W.jsxs)(o.default,{style:{flexDirection:'row',flexWrap:'wrap',gap:8},children:[Xe.filter(e=>['new','acknowledged','preparing'].includes(e.status)).map(e=>{const s=Math.max(0,(0,f.minsBetween)(new Date(e.createdAt),oe)),l=s>=20?k.colours.red:s>=12?k.colours.amber:k.colours.green;return(0,W.jsxs)(o.default,{testID:`ticket-${e.ref}`,style:{width:210,backgroundColor:'#F4EFE3',borderRadius:6,padding:8,gap:3,borderTopWidth:6,borderTopColor:e.allergies.length?k.colours.red:l},children:[(0,W.jsxs)(u.Row,{style:{justifyContent:'space-between'},children:[(0,W.jsx)(u.T,{weight:"bold",colour:"#111",children:'table'===e.type?`TABLE ${e.tableNo}`:`TAKEAWAY ${e.slotTime?(0,f.hm)(new Date(e.slotTime)):''}`}),(0,W.jsxs)(u.T,{size:13,weight:"bold",colour:s>=20?'#B3261E':'#333',children:[s,"m"]})]}),(0,W.jsxs)(u.T,{size:12,colour:"#444",children:[e.ref," \xb7 ",e.status.toUpperCase()]}),e.allergies.length?(0,W.jsx)(o.default,{style:{backgroundColor:'#B3261E',borderRadius:4,padding:4},children:(0,W.jsxs)(u.T,{size:13,weight:"bold",colour:"#fff",children:["\u26a0 ",Ce?'ALLERGY \u2014 see details':e.allergies.map(e=>(0,h.allergenLabel)(e.allergen)).join(', ').toUpperCase()]})}):null,e.lines.map((e,s)=>(0,W.jsxs)(u.T,{size:15,weight:"semibold",colour:"#111",children:[e.qty,"\xd7 ",e.name,e.choices.length?` (${e.choices.join(', ')})`:'']},s)),e.lines.some(e=>e.notes)?(0,W.jsx)(u.T,{size:12,colour:"#444",children:Ce?'Notes \u2014 see details':`Notes: ${e.lines.filter(e=>e.notes).map(e=>e.notes).join(' \xb7 ')}`}):null,Ce&&(e.allergies.length||e.lines.some(e=>e.notes))?(0,W.jsx)(u.Button,{small:!0,kind:"secondary",label:"Details",onPress:()=>fs(e)}):null,e.allergies.length?(0,W.jsx)(L.AllergyChain,{o:e,me:xe,compact:!0}):null,'new'===e.status?(0,W.jsx)(u.Button,{small:!0,label:es(e,'acknowledged')?'Sign off allergy first':'Acknowledge',disabled:es(e,'acknowledged'),onPress:()=>y.repo.orders.setStatus(e.id,'acknowledged',xe)}):null,'acknowledged'===e.status?(0,W.jsx)(u.Button,{small:!0,label:"Start",onPress:()=>'takeaway'===e.type?y.repo.orders.acknowledgeReadiness(e.id,'cook',xe):y.repo.orders.setStatus(e.id,'preparing',xe)}):null,'preparing'===e.status?(0,W.jsx)(u.Button,{small:!0,kind:"success",label:'takeaway'===e.type?'Ready':'Food out',disabled:es(e,'takeaway'===e.type?'ready':'served'),onPress:()=>y.repo.orders.setStatus(e.id,'takeaway'===e.type?'ready':'served',xe)}):null]},e.id)}),Xe.filter(e=>['ready','served'].includes(e.status)).map(e=>(0,W.jsxs)(o.default,{style:{width:210,backgroundColor:k.colours.surface2,borderRadius:6,padding:8,gap:3,borderTopWidth:6,borderTopColor:k.colours.green},children:[(0,W.jsxs)(u.Row,{style:{justifyContent:'space-between'},children:[(0,W.jsx)(u.T,{weight:"bold",children:'table'===e.type?`Table ${e.tableNo}`:`Takeaway ${e.ref}`}),(0,W.jsx)(u.Badge,{kind:U(e.status),label:e.status.toUpperCase()})]}),(0,W.jsxs)(u.Muted,{children:[(0,A.pv)(e.customerName,Ce),'here'===e.customerSignal?' \xb7 CUSTOMER IS HERE':'']}),e.allergies.length?(0,W.jsx)(L.AllergyChain,{o:e,me:xe,compact:!0}):null,'ready'===e.status?(0,W.jsx)(u.Button,{small:!0,label:"Collected",testID:`collected-${e.ref}`,disabled:es(e,'collected'),onPress:()=>y.repo.orders.setStatus(e.id,'collected',xe)}):null,'served'===e.status?(0,W.jsx)(u.Button,{small:!0,kind:"secondary",label:"Paid at till",onPress:()=>y.repo.orders.payTable(e.id,{shares:99})}):null]},e.id))]}):null,ce?null:Xe.map(e=>{const s=e.allergies.length>0&&ss(e),l=e.lines.filter(e=>e.overridden),t=e.lines.filter(e=>e.contains.length||e.may.length);return(0,W.jsxs)(o.default,{testID:`order-${e.ref}`,style:[u.styles.card,{padding:10,borderColor:s?k.colours.red:'ready'===e.status?k.colours.green:k.colours.border,borderWidth:s?2:1}],children:[(0,W.jsxs)(u.Row,{style:{justifyContent:'space-between'},children:[(0,W.jsxs)(u.Row,{gap:6,children:[(0,W.jsx)(u.T,{weight:"bold",children:e.ref}),(0,W.jsx)(u.Badge,{kind:'takeaway'===e.type?'gold':'blue',label:'takeaway'===e.type?`Takeaway \xb7 ${e.slotTime?(0,f.hm)(new Date(e.slotTime)):''}`:`Table ${e.tableNo}`})]}),(0,W.jsx)(u.Badge,{kind:U(e.status),label:e.status.toUpperCase()})]}),(0,W.jsxs)(u.Muted,{children:[(0,A.pv)(e.customerName,Ce)," \xb7 ",(0,m.gbp)(e.subtotal)," \xb7 ",e.paid>=e.total?'Paid (demo)':e.paid>0?`Part paid ${(0,m.gbp)(e.paid)}`:'Unpaid \u2014 bill at end',e.customerSignal?" \xb7 "+('here'===e.customerSignal?'CUSTOMER IS HERE':'Customer on the way'):'']}),e.allergies.length&&Ce?(0,W.jsxs)(u.Row,{gap:6,children:[(0,W.jsx)(u.Badge,{kind:"red",label:s?'\u26a0 Allergy: sign-off needed':'\u26a0 Allergy (signed off)'}),(0,W.jsx)(u.Button,{small:!0,kind:"ghost",label:"Details",onPress:()=>fs(e)})]}):null,e.allergies.length&&!Ce?(0,W.jsxs)(o.default,{style:{backgroundColor:k.colours.redBg,borderRadius:8,padding:8,borderLeftWidth:5,borderLeftColor:k.colours.red},children:[(0,W.jsxs)(u.T,{weight:"bold",colour:"#FFE3DF",children:["ALLERGY: ",e.allergies.map(e=>`${(0,h.allergenLabel)(e.allergen)} (${(0,h.severityLabel)(e.severity)})`).join(', ')]}),l.length?(0,W.jsxs)(u.T,{size:14,weight:"semibold",colour:"#FFE3DF",children:["Customer OVERRODE block on: ",l.map(e=>`${e.name} [contains ${e.contains.map(h.allergenLabel).join(', ')}]`).join('; ')]}):null,t.filter(e=>!e.overridden&&e.may.length).map((e,s)=>(0,W.jsxs)(u.T,{size:14,colour:"#FFE2A8",children:["May contain: ",e.name," [",e.may.map(h.allergenLabel).join(', '),"]"]},s))]}):null,e.allergies.length?(0,W.jsx)(L.AllergyChain,{o:e,me:xe}):null,e.lines.map((e,s)=>(0,W.jsxs)(u.T,{size:15,children:[e.qty,"\xd7 ",e.name,e.choices.length?` \u2014 ${e.choices.join(', ')}`:'',e.notes?Ce?' \xb7 \u270e':` \xb7 \u201c${e.notes}\u201d`:'']},s)),(0,W.jsxs)(u.Row,{wrap:!0,gap:6,children:['new'===e.status?(0,W.jsx)(u.Button,{small:!0,label:es(e,'acknowledged')?'Sign off allergy first':'Acknowledge',disabled:es(e,'acknowledged'),onPress:()=>y.repo.orders.setStatus(e.id,'acknowledged',xe)}):null,'acknowledged'===e.status?(0,W.jsx)(u.Button,{small:!0,label:"Start preparing",onPress:()=>'takeaway'===e.type?y.repo.orders.acknowledgeReadiness(e.id,'cook',xe):y.repo.orders.setStatus(e.id,'preparing',xe)}):null,'preparing'===e.status&&'takeaway'===e.type?(0,W.jsx)(u.Button,{small:!0,kind:"success",label:"Mark ready (notify customer)",disabled:es(e,'ready'),onPress:()=>y.repo.orders.setStatus(e.id,'ready',xe)}):null,'preparing'===e.status&&'table'===e.type?(0,W.jsx)(u.Button,{small:!0,kind:"success",label:"Food out",disabled:es(e,'served'),onPress:()=>y.repo.orders.setStatus(e.id,'served',xe)}):null,'ready'===e.status?(0,W.jsx)(u.Button,{small:!0,label:"Collected",disabled:es(e,'collected'),onPress:()=>y.repo.orders.setStatus(e.id,'collected',xe)}):null,'served'===e.status?(0,W.jsx)(u.Button,{small:!0,kind:"secondary",label:"Paid at till",onPress:()=>y.repo.orders.payTable(e.id,{shares:99})}):null]})]},e.id)})]}),Ts=({colour:e,title:s,children:l})=>(0,W.jsxs)(o.default,{style:{backgroundColor:k.colours.surface2,borderRadius:10,padding:10,borderLeftWidth:6,borderLeftColor:e,gap:4},children:[(0,W.jsx)(u.T,{weight:"bold",colour:e,children:s}),l]}),vs={cook:'START COOKING',bag:'BAG IT',ready:'READY'},Cs=(0,W.jsxs)(V,{title:"Allergy & takeaway alerts",right:(0,W.jsx)(u.Badge,{kind:us?'red':'green',label:`${us} need action`}),children:[ls.map(e=>(0,W.jsxs)(Ts,{colour:k.colours.red,title:`ALLERGY \u2014 ${e.ref} ${'table'===e.type?`(Table ${e.tableNo})`:'(takeaway)'}`,children:[Ce?(0,W.jsx)(u.Button,{small:!0,kind:"secondary",label:"Show allergy details",onPress:()=>fs(e)}):(0,W.jsx)(u.T,{size:15,children:e.allergies.map(e=>`${(0,h.allergenLabel)(e.allergen)} \u2014 ${(0,h.severityLabel)(e.severity)}`).join('; ')}),Ce?null:e.lines.filter(e=>e.overridden).map((e,s)=>(0,W.jsxs)(u.T,{size:14,colour:k.colours.red,weight:"semibold",children:["OVERRIDE: ",e.name," contains ",e.contains.map(h.allergenLabel).join(', ')]},s)),(0,W.jsx)(L.AllergyChain,{o:e,me:xe,compact:!0})]},e.id)),ts.map(e=>(0,W.jsxs)(Ts,{colour:k.colours.red,title:`ALLERGY \u2014 booking ${e.time} ${(0,A.privName)(e,Ce)} (${e.partySize})`,children:[Ce?(0,W.jsx)(u.Button,{small:!0,kind:"secondary",label:"Show allergy details",onPress:()=>Ve(e)}):(0,W.jsx)(u.T,{size:15,children:e.allergies.map(e=>`${(0,h.allergenLabel)(e.allergen)} \u2014 ${(0,h.severityLabel)(e.severity)}`).join('; ')}),(0,W.jsx)(L.BookingAllergyChain,{b:e,me:xe})]},e.id)),rs.map(e=>(0,W.jsxs)(Ts,{colour:'overdue'===e.state?k.colours.red:k.colours.amber,title:`${vs[e.stage]} \u2014 ${e.order.ref} \xb7 pickup ${(0,f.hm)(new Date(e.order.slotTime))}${'overdue'===e.state?' \xb7 OVERDUE':''}`,children:[(0,W.jsx)(u.T,{size:14,children:e.detail}),(0,W.jsxs)(u.Muted,{children:["Due ",(0,f.hm)(e.due)," (slot \u2212 prep \u2212 ",K.settings.bufferMins," min buffer)",e.order.allergies.length?' \xb7 \u26a0 allergy order':'']}),'ready'===e.stage?(0,W.jsx)(u.Button,{small:!0,kind:"success",label:"Mark ready (notify customer)",onPress:()=>y.repo.orders.setStatus(e.orderId,'ready',xe)}):(0,W.jsx)(u.Button,{small:!0,label:'cook'===e.stage?'Started cooking':'Bagged & checked',disabled:es(e.order,'preparing'),onPress:()=>y.repo.orders.acknowledgeReadiness(e.orderId,e.stage,xe)})]},e.id)),is.map(e=>(0,W.jsx)(Ts,{colour:k.colours.amber,title:`New order ${e.ref} \u2014 not yet acknowledged`,children:(0,W.jsx)(u.Button,{small:!0,label:"Acknowledge",onPress:()=>y.repo.orders.setStatus(e.id,'acknowledged',xe)})},e.id)),ns.map(e=>(0,W.jsxs)(Ts,{colour:k.colours.red,title:`LOW RATING ${e.stars}/5 \u2014 ${e.context}`,children:[Ce?(0,W.jsx)(u.Button,{small:!0,kind:"secondary",label:"Show comment",onPress:()=>Fe(`Rating ${e.stars}/5`,(0,W.jsxs)(u.T,{children:[F(e.customerName),e.comment?`: \u201c${e.comment}\u201d`:'']}))}):(0,W.jsxs)(u.T,{size:15,children:[e.customerName,e.comment?`: \u201c${e.comment}\u201d`:'']}),(0,W.jsx)(u.Muted,{children:"Manager: speak to the guest while they\u2019re still here."}),(0,W.jsx)(u.Button,{small:!0,kind:"secondary",label:`Handled \u2014 ${xe}`,onPress:()=>y.repo.alerts.acknowledge(`rating:${e.id}`,xe)})]},e.id)),0===us?(0,W.jsx)(u.Muted,{children:"No alerts need action."}):null,os.length?(0,W.jsxs)(o.default,{style:{gap:4},children:[(0,W.jsx)(u.T,{weight:"semibold",colour:k.colours.gold,children:"Upcoming takeaway timings"}),os.slice(0,6).map(e=>(0,W.jsxs)(u.T,{size:14,children:[(0,f.hm)(e.due)," \xb7 ",vs[e.stage]," \xb7 ",e.order.ref," (pickup ",(0,f.hm)(new Date(e.order.slotTime)),")"]},e.id))]}):null,ds.length?(0,W.jsx)(Ts,{colour:k.colours.muted,title:"Sold out",children:(0,W.jsx)(u.T,{size:14,children:ds.map(e=>e.name).join(', ')})}):null,(0,W.jsxs)(o.default,{style:{gap:2,marginTop:6},children:[(0,W.jsx)(u.T,{weight:"semibold",colour:k.colours.gold,children:"Allergy log"}),Ce?(0,W.jsxs)(u.Muted,{children:[se.filter(e=>'allergy'===e.kind).length," entries today \u2014 full log in the Managers app (privacy mode)."]}):se.filter(e=>'allergy'===e.kind).slice(0,5).map(e=>(0,W.jsxs)(u.T,{size:13,colour:"#FFD9D4",children:[(0,f.hm)(new Date(e.at))," \xb7 ",e.text]},e.id))]})]}),$s=de.filter(e=>e.day===(0,$.weekday)(oe)&&!he.some(s=>s.staffId===e.staffId)&&60*e.start>60*oe.getHours()+oe.getMinutes()).sort((e,s)=>e.start-s.start),Bs=ue.filter(e=>'all'===e.ch&&!e.removed).sort((e,s)=>Number(!!s.pinned)-Number(!!e.pinned)||s.at.localeCompare(e.at)).slice(0,6),Ss=(0,W.jsxs)(o.default,{style:{flex:.8,gap:10},children:[(0,W.jsxs)(V,{title:"Who's on",right:(0,W.jsx)(u.Badge,{kind:"green",label:`${he.length} clocked in`}),children:[0===he.length?(0,W.jsx)(u.Muted,{children:"Nobody clocked in yet."}):null,he.map(e=>{const s=ne.find(s=>s.id===e.staffId),l=de.find(s=>s.staffId===e.staffId&&s.day===(0,$.weekday)(oe));return(0,W.jsxs)(u.Row,{style:{justifyContent:'space-between'},children:[(0,W.jsx)(N.StaffAvatar,{id:e.staffId,size:34}),(0,W.jsxs)(o.default,{style:{flex:1},children:[(0,W.jsx)(u.T,{weight:"semibold",children:F(s?.name)}),(0,W.jsxs)(u.Muted,{children:[s?.job,l?` \xb7 rota ${(0,$.fmtH)(l.start)}\u2013${(0,$.fmtH)(l.end)}`:'']})]}),(0,W.jsx)(u.Badge,{kind:"green",label:`in ${(0,f.hm)(new Date(e.in))}`})]},e.id)}),$s.map(e=>(0,W.jsxs)(u.Muted,{children:["Due in ",(0,$.fmtH)(e.start),": ",F(ne.find(s=>s.id===e.staffId)?.name)]},e.id))]}),(0,W.jsxs)(V,{title:"Staff announcements",right:(0,W.jsx)(u.Muted,{children:"All staff chat"}),children:[0===Bs.length?(0,W.jsx)(u.Muted,{children:"No announcements."}):null,Bs.map(e=>(0,W.jsxs)(o.default,{style:{gap:2,borderLeftWidth:3,borderLeftColor:e.pinned?k.colours.gold:k.colours.border,paddingLeft:8},children:[(0,W.jsxs)(u.T,{size:12,colour:e.pinned?k.colours.gold:k.colours.muted,children:[e.pinned?'\ud83d\udccc ':'','system'===e.from?'Cover Charge':F(ne.find(s=>s.id===e.from)?.name)," \xb7 ",(0,f.hm)(new Date(e.at))]}),(0,W.jsx)(u.T,{size:14,children:e.text??(e.photo?`Photo: ${e.photo.caption}`:'')})]},e.id)),(0,W.jsx)(u.Muted,{children:"Read-only on the display. Post from Cover Charge for Staff or Cover Charge for Managers."})]})]}),Rs=_||e>=900,Ps=(0,W.jsx)(E.WaitlistPanel,{rid:q,r:K,plan:$e,view:cs,todays:Ue,waiting:Ke,now:oe,privacy:Ce,busy:Ze,onToast:Oe}),Ms=(0,W.jsx)(E.PacePanel,{r:K,fc:Ge,todays:Ue,now:oe,walkInCount:te,staffOn:he.length||1,onSummary:()=>Ne(!0)}),Ds=s=>Rs?(0,W.jsx)(t.default,{style:{width:e>=1200?340:300,flexGrow:0},contentContainerStyle:{gap:10,paddingBottom:20},children:s}):(0,W.jsx)(o.default,{style:{gap:10},children:s}),As=(0,W.jsxs)(o.default,{style:{flex:1,flexDirection:Rs?'row':'column',gap:10,padding:12,paddingTop:6},children:[(0,W.jsxs)(o.default,{style:{flex:1,gap:6,minHeight:Rs?void 0:420},children:[(0,W.jsx)(E.ArrivalsStrip,{todays:Ue,now:oe,privacy:Ce}),(0,W.jsx)(P.AreaTabs,{plan:$e,area:gs,onPick:Me,counts:hs}),Ie?(0,W.jsxs)(u.Row,{gap:8,style:{backgroundColor:k.colours.goldTint,borderRadius:10,padding:8},children:[(0,W.jsxs)(u.T,{weight:"semibold",colour:k.colours.goldLight,style:{flex:1},children:["Moving the party from Table ",Ie,": tap the new table (or drag it there)."]}),(0,W.jsx)(u.Button,{small:!0,kind:"ghost",label:"Cancel",onPress:()=>Le(null)})]}):null,(0,W.jsx)(o.default,{style:{flex:1,minHeight:Rs?300:Math.min(520,.62*e)},children:(0,W.jsx)(R.FloorCanvas,{plan:$e,areaId:gs,mode:"live",fit:"contain",view:cs,privacy:Ce,sectionColours:!0,turnBase:K.settings.turnMins,highlight:Ie?[Ie]:void 0,onTap:e=>{Ie?(e.name!==Ie&&xs(Ie,e.name),Le(null)):Ae(e.name)},onDrop:(e,s)=>xs(e.name,s.name)})}),(0,W.jsx)(E.Legend,{})]}),Ds((0,W.jsxs)(W.Fragment,{children:[Ps,Ms]}))]}),Is=(0,W.jsxs)(o.default,{style:{flex:1,flexDirection:Rs?'row':'column',gap:10,padding:12,paddingTop:6},children:[(0,W.jsx)(o.default,{style:{flex:1,minHeight:420},children:(0,W.jsx)(M.Timeline,{plan:$e,bookings:Ue,now:oe,privacy:Ce,turnBase:K.settings.turnMins,t0:ms,t1:bs,onOpen:e=>{const s=(0,B.tablesOf)(e.table)[0];s&&cs[s]?Ae(s):Ve(e)}})}),Ds((0,W.jsx)(W.Fragment,{children:Ps}))]}),Ls=(0,W.jsxs)(t.default,{style:{flex:1},contentContainerStyle:{padding:12,gap:10,flexGrow:1},scrollEnabled:!_,children:[(0,W.jsxs)(u.Row,{wrap:!0,style:{gap:6},children:[(0,W.jsx)(u.Muted,{children:"Signing off as (who's on):"}),pe.map(e=>(0,W.jsx)(u.Chip,{label:e,selected:xe===e,onPress:()=>be(e)},e))]}),(0,W.jsxs)(o.default,{testID:"forecast-strip",style:{gap:8},children:[(0,W.jsxs)(u.Row,{wrap:!0,gap:8,style:{alignItems:'stretch'},children:[(0,W.jsx)(G,{label:"Next hour"+(Ge.nextHour?` \xb7 ${String(Ge.nextHour.hour).padStart(2,'0')}:00\u2013${String(Ge.nextHour.hour+1).padStart(2,'0')}:00`:''),badge:"Estimate",value:Ge.nextHour?`${Ge.nextHour.coversLow}\u2013${Ge.nextHour.coversHigh} covers`:Ge.open?'Kitchen closing':'Closed',sub:Ge.nextHour?`${Ge.nextHour.booked} booked + ~${Ge.nextHour.walkIns} walk-ins \xb7 ~${Ge.nextHour.takeaway} takeaway (${Ge.nextHour.takeawayPlaced} placed)`:void 0}),(0,W.jsx)(G,{label:"Rest of today",badge:"Estimate",value:Ge.open?`${Ge.restOfDay.low}\u2013${Ge.restOfDay.high} covers`:'\u2014',sub:Ge.open?`${Ge.restOfDay.booked} booked \xb7 ~${Ge.restOfDay.takeaway} takeaway orders \xb7 ${Ye} walk-in covers seated so far`:void 0}),(0,W.jsx)(G,{label:"Waitlist",value:`${Ke.length} part${1===Ke.length?'y':'ies'}`,sub:`${Ke.reduce((e,s)=>e+s.partySize,0)} covers \xb7 next wait ~${(0,j.estimateWait)(Ke.length+1,K.settings.turnMins,Ze)} min (est.)`}),(0,W.jsx)(G,{label:"Takeaway slots",value:K.settings.takeawayPaused?'PAUSED':`${Qe.filter(e=>!e.full).length} open`,sub:`Cap ${K.settings.slotCap} per ${K.settings.slotMinutes} min`,children:(0,W.jsxs)(u.Row,{gap:8,children:[(0,W.jsx)(a.default,{accessibilityLabel:"Pause takeaway slots",value:K.settings.takeawayPaused,onValueChange:e=>y.repo.restaurants.updateSettings(q,{takeawayPaused:e}),trackColor:{true:k.colours.redSolid,false:'#444'}}),(0,W.jsx)(u.T,{size:14,children:K.settings.takeawayPaused?'Resume':'Pause'})]})}),(0,W.jsx)(G,{label:"Walk-ins seated (today)",value:`${Ye} covers`,sub:"Use Walk-in above; or quick-count here without a table",children:(0,W.jsx)(u.Row,{gap:6,children:[1,2,4].map(e=>(0,W.jsx)(u.Button,{small:!0,kind:"secondary",label:`+${e}`,onPress:()=>y.repo.waitlist.addWalkIn(q,e)},e))})})]}),(0,W.jsxs)(u.Row,{wrap:!0,gap:12,style:{backgroundColor:k.colours.surface,borderRadius:12,padding:10,borderWidth:1,borderColor:k.colours.border,alignItems:'flex-end'},children:[(0,W.jsxs)(o.default,{style:{gap:2,flexBasis:340,flexGrow:1},children:[(0,W.jsxs)(u.Row,{gap:6,children:[(0,W.jsx)(u.T,{weight:"semibold",colour:k.colours.gold,children:"Forecast \u2014 suggested actions"}),(0,W.jsx)(u.Badge,{kind:"amber",label:"ESTIMATE"})]}),Ge.suggestions.map((e,s)=>(0,W.jsxs)(u.T,{size:14,children:["\u2022 ",e]},s)),(0,W.jsxs)(u.Muted,{children:[Ge.flags.length?`Calendar flags today: ${Ge.flags.join(', ')} \xb7 `:'',"Baseline v1: confirmed bookings + example weekday/hour averages + expected walk-ins (",Math.round(100*K.settings.walkInShare),"% share). ",w.EXAMPLE_ACCURACY,"."]})]}),(0,W.jsx)(u.Row,{gap:4,style:{alignItems:"flex-end"},children:js.map(e=>{const s=Ge.nextHour?.hour===e.hour;return(0,W.jsxs)(o.default,{style:{alignItems:'center',width:30},children:[(0,W.jsx)(u.T,{size:11,colour:k.colours.muted,children:e.covers}),(0,W.jsxs)(o.default,{style:{height:70,width:18,justifyContent:'flex-end',borderBottomWidth:1,borderColor:k.colours.border},children:[(0,W.jsx)(o.default,{style:{height:e.walkIns/ys*70,backgroundColor:s?k.colours.goldLight:'#6B5A3A'}}),(0,W.jsx)(o.default,{style:{height:e.booked/ys*70,backgroundColor:s?k.colours.gold:'#9C7C45'}})]}),(0,W.jsx)(u.T,{size:11,colour:s?k.colours.gold:k.colours.muted,children:e.hour})]},e.hour)})})]})]}),(0,W.jsxs)(o.default,{style:{flexDirection:_?'row':'column',gap:10,flex:_?1:void 0,minHeight:_?380:void 0},children:[ws,(0,W.jsx)(o.default,{style:{flex:1.5,gap:10},children:ks}),Cs,Ss]})]}),zs=(0,W.jsx)(t.default,{style:{flex:1},contentContainerStyle:{padding:12,gap:10},children:(0,W.jsx)(P.FloorEditor,{rid:q,compact:!Rs,maxH:Math.max(300,Y-330)})});return(0,W.jsxs)(i.SafeAreaView,{style:{flex:1,backgroundColor:k.colours.bg},children:[(0,W.jsxs)(u.Row,{wrap:!0,style:{paddingHorizontal:14,paddingVertical:6,gap:10,borderBottomWidth:1,borderBottomColor:k.colours.border},children:[(0,W.jsx)(c.RestaurantBrand,{rid:K.id,size:48,sub:"Display \xb7 Harbour View, Dunure"}),(0,W.jsx)(o.default,{style:{flex:1}}),Ce?(0,W.jsx)(u.Badge,{kind:"gold",label:"\ud83d\udd12 Privacy on"}):(0,W.jsx)(u.Badge,{kind:"amber",label:"Privacy off"}),us?(0,W.jsx)(H.default,{accessibilityRole:"button",accessibilityLabel:"Open alerts",onPress:()=>Re('board'),children:(0,W.jsx)(u.Badge,{kind:"red",label:`${us} alert${us>1?'s':''}`})}):(0,W.jsx)(u.Badge,{kind:"green",label:"All clear"}),(0,W.jsx)(u.T,{size:20,weight:"bold",colour:k.colours.gold,children:(0,f.hm)(oe)}),(0,W.jsx)(u.Muted,{children:(0,f.niceDate)(oe)}),(0,W.jsx)(u.Button,{small:!0,kind:"ghost",label:"Demo +15 min",onPress:()=>re(15)})]}),(0,W.jsxs)(o.default,{testID:"front-door-bar",style:{flexDirection:'row',gap:12,paddingHorizontal:14,paddingTop:8,paddingBottom:4},children:[(0,W.jsx)(u.Button,{label:"Walk-in",onPress:Te.openWalkIn,testID:"add-walkin",style:{flex:1,minHeight:72,borderRadius:18}}),(0,W.jsx)(u.Button,{label:"New booking",onPress:Te.openBooking,testID:"add-booking",style:{flex:1,minHeight:72,borderRadius:18}})]}),(0,W.jsxs)(u.Row,{style:{paddingHorizontal:14,paddingVertical:4,gap:6},children:[O.map(e=>{const s=Se===e.id;return(0,W.jsx)(H.default,{testID:`view-${e.id}`,accessibilityRole:"tab",accessibilityLabel:e.label,accessibilityState:{selected:s},onPress:()=>Re(e.id),style:{minHeight:48,paddingHorizontal:18,justifyContent:'center',borderRadius:12,borderBottomWidth:3,borderBottomColor:s?k.colours.gold:'transparent',backgroundColor:s?k.colours.goldTint:'transparent'},children:(0,W.jsx)(u.T,{weight:"semibold",colour:s?k.colours.goldLight:k.colours.muted,children:e.label})},e.id)}),(0,W.jsx)(o.default,{style:{flex:1}}),(0,W.jsx)(u.Badge,{kind:"gold",label:`${qe} booked \xb7 ${Ye} walk-in covers`})]}),'floor'===Se||'timeline'===Se?Rs?'floor'===Se?As:Is:(0,W.jsx)(t.default,{style:{flex:1},contentContainerStyle:{flexGrow:1},children:'floor'===Se?As:Is}):'plan'===Se?zs:Ls,Te.elements,De?(0,W.jsx)(E.TableSheet,{rid:q,name:De,view:cs,plan:$e,todays:Ue,now:oe,privacy:Ce,turnBase:K.settings.turnMins,onClose:()=>Ae(null),onWalkIn:e=>Te.openWalkInAt(e),onMove:e=>Le(e),onDetails:Ve}):null,ze?(0,W.jsx)(E.DetailsPanel,{title:ze.title,onClose:()=>Ee(null),children:ze.body}):null,He?(0,W.jsx)(E.ServiceSummary,{r:K,todays:Ue,orders:X,waitlistAll:Q,walkInCount:te,onClose:()=>Ne(!1)}):null,We?(0,W.jsx)(o.default,{testID:"floor-toast",pointerEvents:"none",style:{position:'absolute',left:0,right:0,bottom:24,alignItems:'center',zIndex:900},children:(0,W.jsx)(o.default,{style:{backgroundColor:k.colours.surface2,borderColor:k.colours.gold,borderWidth:1.5,borderRadius:14,paddingVertical:10,paddingHorizontal:16,maxWidth:640},children:(0,W.jsx)(u.T,{weight:"semibold",children:We})})}):null,(0,W.jsx)(D.Screensaver,{rid:q,idleMins:ve.idleMins,pinOn:ve.pinOn,pin:ve.pin,tonightCards:ve.tonightCards})]})};var s=_r(d[0]),l=e(s),t=e(_r(d[1])),a=e(_r(d[2])),r=e(_r(d[3])),o=e(_r(d[4])),n=e(_r(d[5])),i=_r(d[6]),u=_r(d[7]),c=_r(d[8]),h=_r(d[9]),p=_r(d[10]),m=_r(d[11]),b=_r(d[12]),x=_r(d[13]),f=_r(d[14]),j=_r(d[15]),y=_r(d[16]),w=_r(d[17]),k=_r(d[18]),T=_r(d[19]),v=_r(d[20]),C=_r(d[21]),$=_r(d[22]),B=_r(d[23]),S=_r(d[24]),R=_r(d[25]),P=_r(d[26]),M=_r(d[27]),D=_r(d[28]),A=_r(d[29]),I=_r(d[30]),L=_r(d[31]),z=_r(d[32]),E=_r(d[33]),H=e(_r(d[34])),N=_r(d[35]),W=_r(d[36]);const O=[{id:'floor',label:'Floor'},{id:'timeline',label:'Timeline'},{id:'board',label:'Board'},{id:'plan',label:'Edit plan'}],F=e=>(e??'').replace(' (example)','');function V({title:e,right:s,children:l,flex:a=1}){return(0,W.jsxs)(o.default,{style:{flex:a,backgroundColor:k.colours.surface,borderRadius:14,borderWidth:1,borderColor:k.colours.border,overflow:'hidden',minHeight:200},children:[(0,W.jsxs)(u.Row,{style:{justifyContent:'space-between',paddingHorizontal:12,paddingVertical:10,borderBottomWidth:1,borderBottomColor:k.colours.border,backgroundColor:k.colours.surface2},children:[(0,W.jsx)(u.T,{weight:"semibold",colour:k.colours.gold,children:e}),s]}),(0,W.jsx)(t.default,{contentContainerStyle:{padding:10,gap:10},children:l})]})}function G({label:e,value:s,sub:l,badge:t,children:a}){return(0,W.jsxs)(o.default,{style:{flex:1,minWidth:170,backgroundColor:k.colours.surface,borderRadius:12,padding:10,borderWidth:1,borderColor:k.colours.border,gap:2},children:[(0,W.jsxs)(u.Row,{style:{justifyContent:'space-between'},children:[(0,W.jsx)(u.T,{size:13,colour:k.colours.muted,weight:"medium",children:e}),t?(0,W.jsx)(u.Badge,{kind:"amber",label:t}):null]}),(0,W.jsx)(u.T,{size:24,weight:"bold",colour:k.colours.text,children:s}),l?(0,W.jsx)(u.T,{size:13,colour:k.colours.muted,children:l}):null,a]})}const U=e=>'new'===e?'red':'ready'===e?'green':'preparing'===e?'amber':'served'===e?'blue':'neutral'},850,[12,133,253,255,109,269,271,790,859,791,847,793,860,794,795,848,796,861,797,806,862,851,863,864,852,853,854,855,857,856,792,865,866,858,245,867,6]);
|
| 3 |
+
__d(function(g,_r,_i,_a,m,_e,_d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"TABLES",{enumerable:!0,get:function(){return x}}),_e.useTableNames=p,_e.resetTableLive=j,_e.useTableUse=k,Object.defineProperty(_e,"walkInLabel",{enumerable:!0,get:function(){return w}}),_e.TablePicker=C,_e.WalkInSheet=S,_e.AssignTableSheet=v,_e.UndoToast=I,_e.NewBookingSheet=P,_e.useFrontDoor=function(e,s){const[l,o]=(0,t.useState)(!1),[n,i]=(0,t.useState)(!1),[a,r]=(0,t.useState)(null),[d,u]=(0,t.useState)(null),c=(0,y.jsxs)(y.Fragment,{children:[l?(0,y.jsx)(S,{wide:s,initialTable:l.table,onClose:()=>o(!1),onSeated:r}):null,n?(0,y.jsx)(P,{wide:s,date:e,onClose:()=>i(!1)}):null,d?(0,y.jsx)(v,{booking:d,onClose:()=>u(null)}):null,a?(0,y.jsx)(I,{booking:a,onDone:()=>r(null)}):null]});return{openWalkIn:()=>o({}),openWalkInAt:e=>o({table:e}),openBooking:()=>i(!0),assignTable:u,elements:c}};var t=_r(_d[0]),s=e(t);_r(_d[1]);var l=e(_r(_d[2])),o=e(_r(_d[3])),n=e(_r(_d[4])),i=_r(_d[5]),a=_r(_d[6]),r=_r(_d[7]),d=_r(_d[8]),u=_r(_d[9]),c=_r(_d[10]),b=_r(_d[11]),h=_r(_d[12]),f=_r(_d[13]),y=_r(_d[14]);const x=Array.from({length:12},(e,t)=>String(t+1));function p(e){const t=(0,f.usePlan)(e);return t.areas.flatMap(e=>t.tables.filter(t=>t.areaId===e.id).map(e=>e.name))}function j(e,t){(0,f.tablesOf)(t).forEach(t=>f.useFloor.getState().setLive(e,t,{stage:'seated',dirty:!1}))}function k(e,t){const s=(0,r.useBookings)(e),l=(0,r.useOrders)(e),o=p(e),n=(0,f.useFloor)(t=>t.live[e])??{},i=(0,c.ymd)(t),a={};for(const e of o)a[e]=n[e]?.blocked?{busy:!0,label:'Blocked'}:n[e]?.dirty?{busy:!0,label:'Needs clearing'}:{busy:!1,label:'Free'};for(const e of s)if(e.date===i&&e.table)for(const s of(0,f.tablesOf)(e.table))if(a[s])if('seated'===e.status)a[s]={busy:!0,label:`${e.walkIn?'Walk-in':`${e.name.slice(0,1)}.`} \xb7 ${e.partySize}`};else if('confirmed'===e.status&&!a[s].busy){const l=(0,c.minsBetween)(t,new Date(`${e.date}T${e.time}:00`));l>=-15&&l<=90&&(a[s]={...a[s],soon:`Booked ${e.time}`})}for(const e of l)'table'===e.type&&e.tableNo&&a[e.tableNo]&&!['closed','cancelled','collected'].includes(e.status)&&!a[e.tableNo].busy&&(a[e.tableNo]={busy:!0,label:'Open order'});return a}const w=e=>e.walkIn?`Walk-in \xb7 ${e.partySize}`:`${e.name} \xb7 ${e.partySize}`;function C({use:e,value:t,onPick:s,big:o,best:i}){const a=Object.keys(e);return(0,y.jsx)(n.default,{style:{flexDirection:'row',flexWrap:'wrap',gap:8},testID:"table-picker",children:a.map(a=>{const r=e[a],d=t===a,u=!!i&&(0,f.tablesOf)(i)[0]===a&&!d;return(0,y.jsxs)(l.default,{accessibilityRole:"button",accessibilityLabel:`Table ${a}, ${r.busy?`in use (${r.label})`:r.soon?`free, ${r.soon}`:'free'}`,accessibilityState:{selected:d},onPress:()=>s(a),style:{width:o?92:64,minHeight:56,borderRadius:12,borderWidth:d?2.5:1.5,padding:6,alignItems:'center',justifyContent:'center',borderColor:d?b.colours.gold:r.busy?b.colours.red:b.colours.green,backgroundColor:d?b.colours.goldTint:r.busy?b.colours.redBg:b.colours.surface2},children:[(0,y.jsx)(h.T,{weight:"bold",size:18,colour:d?b.colours.goldLight:b.colours.text,children:a}),(0,y.jsx)(h.T,{size:11,colour:r.busy?'#FFD9D4':r.soon?'#FFE2A8':'#CFF3D7',center:!0,children:r.busy?'Blocked'===r.label||'Needs clearing'===r.label?r.label:'In use':r.soon??'Free'}),u?(0,y.jsx)(n.default,{testID:"best-table",style:{position:'absolute',top:-8,right:-6,backgroundColor:b.colours.gold,borderRadius:8,paddingHorizontal:5},children:(0,y.jsx)(h.T,{size:10,weight:"bold",colour:b.colours.onGold,children:"BEST"})}):null]},a)})})}const T=[1,2,3,4,5,6,7,8];function S({onClose:e,onSeated:d,wide:x,initialTable:p}){const{rid:w,r:S,now:v}=(0,a.useCtx)(15e3),I=k(w,v),[P,$]=(0,t.useState)(2),[D,F]=(0,t.useState)(!1),[R,W]=(0,t.useState)(p??null),B=(0,f.usePlan)(w),z=(0,r.useBookings)(w),M=s.default.useMemo(()=>{const e=Object.fromEntries(Object.entries(I).map(([e,t])=>[e,{status:t.busy?'seated':'free'}]));return(0,u.suggestTable)(B,z.filter(e=>e.date===(0,c.ymd)(v)),e,P,v,(0,u.turnFor)(P,S.settings.turnMins))?.table??null},[B,z,I,P,v.getTime()]),[N,O]=(0,t.useState)(!1),[A,L]=(0,t.useState)(''),E=(e,t=String(e),s=()=>{F(!1),$(e)})=>{const o='9+'===t?D:!D&&P===e;return(0,y.jsx)(l.default,{accessibilityRole:"button",accessibilityLabel:'9+'===t?'Party of 9 or more':`Party of ${e}`,accessibilityState:{selected:o},onPress:s,style:{width:x?64:60,height:x?64:56,borderRadius:14,borderWidth:2,borderColor:b.colours.gold,alignItems:'center',justifyContent:'center',backgroundColor:o?b.colours.gold:'transparent'},children:(0,y.jsx)(h.T,{weight:"bold",size:22,colour:o?b.colours.onGold:b.colours.gold,children:t})},t)},_=(0,y.jsxs)(h.Row,{gap:12,style:{justifyContent:'center'},children:[(0,y.jsx)(l.default,{accessibilityRole:"button",accessibilityLabel:"One fewer",onPress:()=>$(e=>Math.max(9,e-1)),style:{width:56,height:56,borderRadius:28,borderWidth:2,borderColor:b.colours.gold,alignItems:'center',justifyContent:'center'},children:(0,y.jsx)(h.T,{size:26,colour:b.colours.gold,children:"\u2212"})}),(0,y.jsx)(h.T,{weight:"bold",size:26,children:P}),(0,y.jsx)(l.default,{accessibilityRole:"button",accessibilityLabel:"One more",onPress:()=>$(e=>Math.min(40,e+1)),style:{width:56,height:56,borderRadius:28,borderWidth:2,borderColor:b.colours.gold,alignItems:'center',justifyContent:'center'},children:(0,y.jsx)(h.T,{size:26,colour:b.colours.gold,children:"+"})})]}),H=(0,y.jsxs)(n.default,{style:{gap:8,flex:x?1:void 0},children:[(0,y.jsx)(h.T,{weight:"semibold",children:"How many people?"}),(0,y.jsxs)(n.default,{style:{flexDirection:'row',flexWrap:'wrap',gap:8},testID:"walkin-party",children:[T.map(e=>E(e)),E(9,'9+',()=>{F(!0),$(e=>e>=9?e:9)})]}),D?_:null]}),U=(0,y.jsxs)(n.default,{style:{gap:8,flex:x?1.3:void 0},children:[(0,y.jsxs)(h.Row,{style:{justifyContent:'space-between'},children:[(0,y.jsxs)(h.T,{weight:"semibold",children:["Table ",(0,y.jsx)(h.T,{colour:b.colours.muted,size:14,children:"(optional)"})]}),R?(0,y.jsx)(h.Button,{small:!0,kind:"ghost",label:"Clear table",onPress:()=>W(null)}):null]}),(0,y.jsx)(C,{use:I,value:R,onPick:e=>W(R===e?null:e),big:x,best:M}),M&&!R?(0,y.jsxs)(h.Muted,{children:["Best fit for ",P,": Table ",M," (smallest free table, fewest clashes)."]}):null,'staff'!==i.APP_VARIANT?(0,y.jsx)(h.Muted,{children:"Using Wix Tables too? Also mark the table there; this prototype doesn't connect to it."}):null]});return(0,y.jsxs)(h.Sheet,{visible:!0,onClose:e,title:`Walk-in \xb7 ${(0,c.hm)(v)}`,maxWidth:x?900:void 0,testID:"walkin-sheet",children:[(0,y.jsx)(h.Button,{label:`Seat walk-in \xb7 ${P} ${1===P?'person':'people'}${R?` \xb7 Table ${R}`:''}`,onPress:async()=>{const t=await r.repo.bookings.seatWalkIn(w,P,R??void 0,A);j(w,R??void 0),d(t),e()},testID:"seat-walkin",style:{minHeight:56}}),x?(0,y.jsxs)(h.Row,{gap:16,style:{alignItems:'flex-start'},children:[H,U]}):(0,y.jsxs)(y.Fragment,{children:[H,U]}),N?(0,y.jsx)(o.default,{accessibilityLabel:"Walk-in note",placeholder:"Note (optional), e.g. high chair",placeholderTextColor:"#7D776C",value:A,onChangeText:L,style:h.styles.input,autoFocus:!0}):(0,y.jsx)(h.Button,{small:!0,kind:"ghost",label:"+ Add a note (optional)",onPress:()=>O(!0)}),(0,y.jsx)(h.Muted,{children:"No name needed. Seated now; counts in today's covers and the forecast."})]})}function v({booking:e,onClose:t}){const{rid:s,now:l}=(0,a.useCtx)(15e3),o=k(s,l);return(0,y.jsxs)(h.Sheet,{visible:!0,onClose:t,title:`Assign table \xb7 ${w(e)}`,testID:"assign-table-sheet",children:[(0,y.jsx)(C,{use:o,onPick:async l=>{await r.repo.bookings.assignTable(e.id,l),j(s,l),t()}}),(0,y.jsx)(h.Muted,{children:"Red tables are in use right now; you can still pick one (e.g. joining a table)."})]})}function I({booking:e,onDone:s}){return(0,t.useEffect)(()=>{const e=setTimeout(s,6e3);return()=>clearTimeout(e)},[e.id]),(0,y.jsx)(n.default,{testID:"walkin-toast",style:{position:'fixed',left:12,right:12,bottom:92,zIndex:1e3,alignItems:'center'},pointerEvents:"box-none",children:(0,y.jsxs)(h.Row,{gap:10,style:{backgroundColor:b.colours.surface2,borderColor:b.colours.gold,borderWidth:1.5,borderRadius:14,paddingVertical:8,paddingLeft:14,paddingRight:8,maxWidth:520,width:'100%',justifyContent:'space-between'},children:[(0,y.jsxs)(h.T,{weight:"semibold",style:{flex:1},children:[w(e)," seated \xb7 ",e.table?`Table ${e.table}`:'table to assign'," (",e.ref,")"]}),(0,y.jsx)(h.Button,{kind:"secondary",label:"Undo",onPress:()=>{r.repo.bookings.undoWalkIn(e.id),s()},testID:"undo-walkin"})]})})}function P({date:e,onClose:s,wide:l}){const{rid:o,r:n,now:i}=(0,a.useCtx)(6e4),u=(0,r.useBookings)(o),[b,f]=(0,t.useState)(''),[x,p]=(0,t.useState)(2),[j,k]=(0,t.useState)(null),[w,C]=(0,t.useState)(''),T=(0,c.parseYmd)(e),S=(0,d.bookingSlots)(n,T,t=>u.filter(s=>s.date===e&&s.time===t&&'cancelled'!==s.status&&!s.walkIn).reduce((e,t)=>e+t.partySize,0),x,e===(0,c.ymd)(i)?i:(0,c.addMins)(T,0));return(0,y.jsxs)(h.Sheet,{visible:!0,onClose:s,title:`New booking \xb7 ${(0,c.niceDate)(T)}`,maxWidth:l?760:void 0,testID:"booking-sheet",children:[(0,y.jsx)(h.Field,{label:"Name",value:b,onChangeText:f,placeholder:"e.g. Reid"}),(0,y.jsxs)(h.Row,{style:{justifyContent:'space-between'},children:[(0,y.jsx)(h.T,{children:"Party size"}),(0,y.jsx)(h.Stepper,{value:x,onChange:p,min:1,max:20,label:"party size"})]}),(0,y.jsx)(h.Row,{wrap:!0,gap:6,children:S.map(e=>(0,y.jsx)(h.Chip,{label:e.time,sub:`${e.left} left`,disabled:!e.available,selected:j===e.time,onPress:()=>k(e.time)},e.time))}),S.length?null:(0,y.jsx)(h.Muted,{children:"Closed on this day (per listed hours)."}),(0,y.jsx)(h.Field,{label:"Notes",value:w,onChangeText:C,placeholder:"e.g. high chair, window table"}),x>=n.settings.savedCardFromParty?(0,y.jsxs)(h.Muted,{children:["Parties of ",n.settings.savedCardFromParty,"+ need a saved card; the customer gets a link (demo, nothing is sent)."]}):null,(0,y.jsx)(h.Button,{label:"Save booking",disabled:b.trim().length<2||!j,onPress:()=>{r.repo.bookings.create({restaurantId:o,customerId:null,name:b.trim(),partySize:x,date:e,time:j,allergies:[],notes:w.trim(),security:x>=n.settings.savedCardFromParty?'saved-card':'none',depositPaid:0}),s()}})]})}},851,[12,104,245,255,109,787,863,796,794,852,795,797,790,864,6]);
|
| 4 |
+
__d(function(g,r,_i,_a,m,e,_d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"STATUS",{enumerable:!0,get:function(){return a}}),Object.defineProperty(e,"STAGES",{enumerable:!0,get:function(){return s}}),Object.defineProperty(e,"turnFor",{enumerable:!0,get:function(){return n}}),Object.defineProperty(e,"startOf",{enumerable:!0,get:function(){return l}}),Object.defineProperty(e,"durOf",{enumerable:!0,get:function(){return i}}),Object.defineProperty(e,"endOf",{enumerable:!0,get:function(){return o}}),e.clashes=function(a,s=90){const n=new Set,i=a.filter(t=>d(t)&&t.table);for(let a=0;a<i.length;a++)for(let d=a+1;d<i.length;d++){const c=i[a],u=i[d];(0,t.tablesOf)(c.table).some(a=>(0,t.tablesOf)(u.table).includes(a))&&(l(c)<o(u,s)&&l(u)<o(c,s)&&(n.add(c.id),n.add(u.id)))}return n},e.floorView=function(a,s,n,i,d,u=90){const h={},y=s.filter(t=>t.date===b(d));for(const s of a.tables){const a=i[s.name]??{},b=y.filter(a=>(0,t.tablesOf)(a.table).includes(s.name)),F=b.find(t=>'seated'===t.status),p=b.filter(t=>'confirmed'===t.status).sort((t,a)=>t.time.localeCompare(a.time)).find(t=>f(d,t)>=-20),O=p?Math.round(f(d,p)):void 0,S=n.find(t=>'table'===t.type&&t.tableNo===s.name&&!['closed','cancelled','collected'].includes(t.status));let v='free';a.blocked?v='blocked':F?v=a.stage??'seated':a.dirty?v='dirty':S?v=a.stage??'seated':p&&void 0!==O&&O<=45&&(v='soon');const A=F,T=A?.tags?.find(t=>'VIP'===t)??A?.tags?.find(t=>'Regular'===t)??(A?void 0:p?.tags?.[0]);h[s.name]={table:s,status:v,booking:A,next:p,nextIn:O,covers:A?.partySize??0,orderOnly:!A&&!!S,note:a.note,seatedMins:A?Math.max(0,Math.round((d.getTime()-l(A).getTime())/6e4)):void 0,freeAt:A?o(A,u):void 0,allergy:!!(A?.allergies.length||!A&&p?.allergies.length||S?.allergies.length),vip:T,occasion:A?.occasion??(A?void 0:p?.occasion??c(p?.notes))??c(A?.notes)}}return h},Object.defineProperty(e,"OCCASION_ICON",{enumerable:!0,get:function(){return u}}),e.suggestTable=function(a,s,n,i,c,u,f=90,b){const h=[...a.tables.map(t=>({name:t.name,seats:t.maxSeats,min:t.minSeats,parts:[t.name]})),...a.joins.map(t=>{const s=a.tables.filter(a=>t.tables.includes(a.name));return{name:t.tables.join('+'),seats:s.reduce((t,a)=>t+a.maxSeats,0),min:s.reduce((t,a)=>t+a.minSeats,0),parts:t.tables}})],y=c.getTime()+6e4*u;let F=null;for(const a of h){if(a.seats<i)continue;if(n&&a.parts.some(t=>['blocked'].includes(n[t]?.status)))continue;const u=!!n&&a.parts.some(t=>['seated','mains','dessert','bill','dirty'].includes(n[t]?.status)),h=s.filter(s=>s.id!==b&&d(s)&&(0,t.tablesOf)(s.table).some(t=>a.parts.includes(t))&&l(s).getTime()<y&&o(s,f).getTime()>c.getTime()).length,p=(u?1e3:0)+100*h+10*(a.seats-i)+(i<a.min?5:0)+15*(a.parts.length-1);(!F||p<F.score)&&(F={table:a.name,seats:a.seats,clashes:h+(u?1:0),score:p,why:`${a.seats} seats${h||u?`, ${h+(u?1:0)} clash`:', no clashes'}`})}return F?{table:F.table,seats:F.seats,clashes:F.clashes,why:F.why}:null};var t=r(_d[0]);const a={free:{label:'Free',colour:'#2F7D45',fg:'#E7FBEA'},soon:{label:'Reserved soon',colour:'#3C78B5',fg:'#EAF4FF'},seated:{label:'Seated',colour:'#CFA45F',fg:'#0B0B0B'},mains:{label:'Mains',colour:'#E08A2E',fg:'#0B0B0B'},dessert:{label:'Dessert',colour:'#A77BD0',fg:'#0B0B0B'},bill:{label:'Bill requested',colour:'#D9473A',fg:'#FFFFFF'},dirty:{label:'Needs clearing',colour:'#7A6F5E',fg:'#FFFFFF'},blocked:{label:'Blocked',colour:'#3A3A3A',fg:'#CFCFCF'}},s=['seated','mains','dessert','bill'],n=(t,a=90)=>Math.min(a+60,a+15*Math.max(0,Math.ceil((t-2)/2))),l=t=>'seated'===t.status&&t.seatedAt?new Date(t.seatedAt):new Date(`${t.date}T${t.time}:00`),i=(t,a=90)=>t.durationMins??n(t.partySize,a),o=(t,a=90)=>new Date(l(t).getTime()+6e4*i(t,a)),d=t=>!['cancelled','noshow','finished'].includes(t.status);const c=t=>t?/birthday/i.test(t)?'birthday':/anniversary/i.test(t)?'anniversary':void 0:void 0,u={birthday:'\ud83c\udf82',anniversary:'\ud83d\udc8d',celebration:'\ud83e\udd42'},f=(t,a)=>(new Date(`${a.date}T${a.time}:00`).getTime()-t.getTime())/6e4,b=t=>`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,'0')}-${String(t.getDate()).padStart(2,'0')}`},852,[864]);
|
| 5 |
+
__d(function(_g,r,_i,_a,m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"snap",{enumerable:!0,get:function(){return c}}),_e.FloorCanvas=function(e){const[x,f]=(0,t.useState)({w:0,h:0}),g=x.w?'width'===e.fit?Math.min(x.w/i.PLAN_W,e.maxH?e.maxH/i.PLAN_H:9):Math.min(x.w/i.PLAN_W,x.h/i.PLAN_H):0,v=e.plan.tables.filter(t=>t.areaId===e.areaId),[y,w]=(0,t.useState)(null),M=(0,t.useRef)(null),j=t=>e.plan.sections.find(e=>e.id===t.sectionId),R=t=>e.plan.joins.find(e=>e.tables.includes(t.name)),C=(t,o)=>({onStartShouldSetResponder:()=>!0,onMoveShouldSetResponder:()=>!0,onResponderTerminationRequest:()=>!1,onResponderGrant:e=>{M.current={x:e.nativeEvent.pageX,y:e.nativeEvent.pageY,id:t.id,kind:o}},onResponderMove:n=>{const i=M.current;if(!i)return;const s=n.nativeEvent.pageX-i.x,a=n.nativeEvent.pageY-i.y;Math.abs(s)+Math.abs(a)<6&&!y||('live'!==e.mode||e.onDrop&&e.view&&['seated','mains','dessert','bill'].includes(e.view[t.name]?.status)&&e.view[t.name]?.booking)&&w({id:t.id,dx:s,dy:a,kind:o})},onResponderRelease:n=>{const s=M.current;M.current=null;const a=n.nativeEvent.pageX-(s?.x??0),l=n.nativeEvent.pageY-(s?.y??0);if(w(null),Math.abs(a)+Math.abs(l)<6||!g)return void('move'===o&&e.onTap?.(t));const u=a/g,h=l/g;if('edit'===e.mode&&'move'===o)e.onMove?.(t,b(c(t.x+u,e.snapOn),0,i.PLAN_W-t.w),b(c(t.y+h,e.snapOn),0,i.PLAN_H-t.h));else if('edit'===e.mode&&'resize'===o)e.onResize?.(t,b(c(t.w+u,e.snapOn),50,400),b(c(t.h+h,e.snapOn),50,300));else if('live'===e.mode&&e.onDrop){const o=t.x+t.w/2+u,n=t.y+t.h/2+h,i=v.find(e=>e.id!==t.id&&o>=e.x-10&&o<=e.x+e.w+10&&n>=e.y-10&&n<=e.y+e.h+10);i&&e.onDrop(t,i)}}}),I=e=>e*g,k='width'===e.fit?i.PLAN_H*g||200:void 0;return(0,u.jsx)(n.default,{testID:"floor-canvas",onLayout:e=>f({w:e.nativeEvent.layout.width,h:e.nativeEvent.layout.height}),style:[{width:'100%',borderRadius:16,overflow:'hidden'},'contain'===e.fit?{flex:1}:{height:k}],children:g?(0,u.jsxs)(n.default,{style:{width:I(i.PLAN_W),height:I(i.PLAN_H),alignSelf:'center',backgroundColor:'#0F0E0C',borderRadius:16,borderWidth:1,borderColor:a.colours.border,overflow:'hidden'},children:['edit'===e.mode?Array.from({length:i.PLAN_W/(2*i.GRID)},(e,t)=>(0,u.jsx)(n.default,{style:{position:'absolute',left:I(t*i.GRID*2),top:0,bottom:0,width:1,backgroundColor:'#1E1B16'}},`v${t}`)):null,'edit'===e.mode?Array.from({length:i.PLAN_H/(2*i.GRID)},(e,t)=>(0,u.jsx)(n.default,{style:{position:'absolute',top:I(t*i.GRID*2),left:0,right:0,height:1,backgroundColor:'#1E1B16'}},`h${t}`)):null,e.plan.joins.map(e=>{const t=v.filter(t=>e.tables.includes(t.name));if(t.length<2)return null;const[o,i]=t,s=o.x+o.w/2,a=o.y+o.h/2,l=i.x+i.w/2,h=i.y+i.h/2,c=Math.hypot(l-s,h-a),b=Math.atan2(h-a,l-s);return(0,u.jsx)(n.default,{testID:`join-${e.tables.join('+')}`,style:{position:'absolute',left:I((s+l)/2-c/2),top:I((a+h)/2)-3,width:I(c),height:6,borderRadius:3,backgroundColor:'rgba(207,164,95,0.55)',transform:[{rotate:`${b}rad`}]}},e.id)}),v.map(t=>{const i=e.view?.[t.name],c=i?s.STATUS[i.status]:null,b=y?.id===t.id,x=b&&'resize'===y.kind?Math.max(50,t.w+y.dx/g):t.w,f=b&&'resize'===y.kind?Math.max(50,t.h+y.dy/g):t.h,v=b&&'move'===y.kind?t.x+y.dx/g:t.x,w=b&&'move'===y.kind?t.y+y.dy/g:t.y,M=e.selected===t.id||e.highlight?.includes(t.name),k=j(t),z='edit'===e.mode?'#2A2419':c.colour,$='edit'===e.mode?a.colours.text:c.fg,A='round'===t.shape||'stool'===t.shape?I(Math.min(x,f)/2):I('booth'===t.shape?22:12),S=I(Math.min(x,f))<64,T=Math.max(11,Math.min(22,I(Math.min(x,f))/4)),_='edit'===e.mode?`Table ${t.name}, ${t.shape}, ${t.minSeats}\u2013${t.maxSeats} seats${t.online?', bookable online':''}`:`Table ${t.name}, ${c.label}${void 0!==i?.seatedMins?`, seated ${i.seatedMins} min`:''}${i?.covers?`, ${i.covers} covers`:''}${void 0!==i?.nextIn&&'seated'!==i.status?`, next booking ${i.next?.time}`:''}`,E=void 0!==i?.seatedMins&&i.booking?Math.min(1.2,i.seatedMins/(i.booking.durationMins??(0,s.turnFor)(i.booking.partySize,e.turnBase))):null;return(0,u.jsxs)(o.default.Fragment,{children:[p({...t,w:x,h:f}).map((t,o)=>(0,u.jsx)(n.default,{pointerEvents:"none",style:[{position:'absolute',left:I(v+t.x)-Math.max(4,I(8)),top:I(w+t.y)-Math.max(4,I(8)),width:Math.max(8,I(16)),height:Math.max(8,I(16)),borderRadius:99,backgroundColor:'edit'===e.mode?'#5A4C33':'rgba(255,255,255,0.16)',borderWidth:1,borderColor:'edit'===e.mode?a.colours.gold:'rgba(255,255,255,0.25)'},h()]},o)),(0,u.jsxs)(n.default,{testID:`table-${t.name}`,accessibilityRole:"button",accessibilityLabel:_,...C(t,'move'),style:[{position:'absolute',left:I(v),top:I(w),width:I(x),height:I(f),borderRadius:A,backgroundColor:z,alignItems:'center',justifyContent:'center',padding:2,borderWidth:M?3:e.sectionColours&&k?2.5:1.5,borderColor:M?'#FFFFFF':e.sectionColours&&k?k.colour:'edit'===e.mode?a.colours.gold:'rgba(0,0,0,0.35)',borderTopWidth:'booth'===t.shape?I(18):void 0,transform:[{rotate:`${t.rot}deg`},{scale:b?1.06:1}],zIndex:b?50:1,opacity:b&&'live'===e.mode?.85:1,shadowColor:'#000',shadowOpacity:b?.6:.3,shadowRadius:b?14:6,cursor:'edit'===e.mode?'grab':'pointer',touchAction:'none'},b?null:h()],children:[(0,u.jsxs)(n.default,{style:{alignItems:'center',transform:[{rotate:-t.rot+"deg"}]},pointerEvents:"none",children:[(0,u.jsx)(l.T,{weight:"bold",size:T,colour:$,center:!0,children:t.name}),'edit'===e.mode?S?null:(0,u.jsxs)(l.T,{size:11,colour:a.colours.muted,center:!0,children:[t.minSeats,"\u2013",t.maxSeats,t.online?' \xb7 online':'']}):i?(0,u.jsxs)(u.Fragment,{children:['free'!==i.status||S?null:(0,u.jsxs)(l.T,{size:11,colour:$,center:!0,children:[t.minSeats,"\u2013",t.maxSeats," seats"]}),void 0!==i.seatedMins?(0,u.jsxs)(l.T,{size:12,weight:"semibold",colour:$,center:!0,children:[i.seatedMins,"m \xb7 ",i.covers,"\ud83d\udc65"]}):i.orderOnly?(0,u.jsx)(l.T,{size:11,colour:$,center:!0,children:"Open order"}):null,'soon'===i.status&&i.next?(0,u.jsxs)(l.T,{size:11,weight:"semibold",colour:$,center:!0,children:[i.next.time," \xb7 ",i.nextIn<=0?'due':`${i.nextIn}m`]}):null,'dirty'!==i.status||S?null:(0,u.jsx)(l.T,{size:11,colour:$,center:!0,children:"Clear"}),!S||i.allergy||i.vip?(0,u.jsxs)(l.T,{size:11,colour:$,center:!0,children:[i.allergy?'\u26a0':'',i.vip?'VIP'===i.vip?'\u2605':'\u2665':'',i.occasion?s.OCCASION_ICON[i.occasion]:'',i.note?'\u270e':'']}):null]}):null]}),k&&'live'===e.mode&&e.sectionColours&&!S?(0,u.jsx)(n.default,{pointerEvents:"none",style:{position:'absolute',top:3,right:6,backgroundColor:k.colour,borderRadius:6,paddingHorizontal:3},children:(0,u.jsx)(l.T,{size:9,weight:"bold",colour:"#0B0B0B",children:k.server})}):null,null===E||S?null:(0,u.jsx)(n.default,{pointerEvents:"none",style:{position:'absolute',left:'15%',right:'15%',bottom:5,height:4,borderRadius:2,backgroundColor:'rgba(0,0,0,0.25)'},children:(0,u.jsx)(n.default,{style:{width:`${Math.min(100,100*E)}%`,height:4,borderRadius:2,backgroundColor:E>=1?'#B3261E':'rgba(0,0,0,0.6)'}})}),R(t)&&'edit'===e.mode?(0,u.jsx)(n.default,{pointerEvents:"none",style:{position:'absolute',bottom:2,left:4},children:(0,u.jsx)(l.T,{size:10,colour:a.colours.gold,children:"\u26d3"})}):null]}),'edit'===e.mode&&e.selected===t.id?(0,u.jsx)(n.default,{testID:"resize-handle",accessibilityLabel:"Resize table",...C(t,'resize'),style:{position:'absolute',left:I(v+x)-14,top:I(w+f)-14,width:28,height:28,borderRadius:14,backgroundColor:a.colours.gold,borderWidth:2,borderColor:'#fff',zIndex:60,cursor:'nwse-resize',touchAction:'none'}}):null]},t.id)}),0===v.length?(0,u.jsx)(n.default,{style:{position:'absolute',left:0,right:0,top:'45%'},children:(0,u.jsxs)(l.T,{center:!0,colour:a.colours.muted,children:["No tables in this area yet",'edit'===e.mode?' \u2014 tap + Table':'',"."]})}):null]}):null})};var t=r(d[0]),o=e(t);r(d[1]);var n=e(r(d[2])),i=r(d[3]),s=r(d[4]),a=r(d[5]),l=r(d[6]),u=r(d[7]);const h=(e=250)=>({transitionProperty:'background-color, border-color, transform, left, top, width, height',transitionDuration:`${e}ms`}),c=(e,t=!0)=>t?Math.round(e/i.GRID)*i.GRID:Math.round(e),b=(e,t,o)=>Math.max(t,Math.min(o,e));function p(e){const t=Math.max(1,e.maxSeats),o=[];if('round'===e.shape||'stool'===e.shape){for(let n=0;n<t;n++){const i=2*Math.PI*n/t-Math.PI/2;o.push({x:e.w/2+Math.cos(i)*(e.w/2+11.2),y:e.h/2+Math.sin(i)*(e.h/2+11.2)})}return'stool'===e.shape?[]:o}if('booth'===e.shape){for(let n=0;n<t;n++)o.push({x:e.w*(n+.5)/t,y:e.h+9.6});return o}if('square'===e.shape&&t<=4){return[{x:e.w/2,y:-9.6},{x:e.w/2,y:e.h+9.6},{x:-9.6,y:e.h/2},{x:e.w+9.6,y:e.h/2}].slice(0,t)}const n=Math.ceil(t/2),i=t-n;for(let t=0;t<n;t++)o.push({x:e.w*(t+.5)/n,y:-9.6});for(let t=0;t<i;t++)o.push({x:e.w*(t+.5)/i,y:e.h+9.6});return o}},853,[12,104,109,864,852,797,790,6]);
|
| 6 |
+
__d(function(g,r,i,_a,m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.AreaTabs=p,_e.FloorEditor=function({rid:e,compact:s,maxH:j}){const f=(0,o.usePlan)(e),y=o.useFloor.getState,w=a=>y().setPlan(e,a),[k,S]=(0,a.useState)(f.areas[0]?.id??''),[T,R]=(0,a.useState)(null),[C,P]=(0,a.useState)(!0),[I,D]=(0,a.useState)(!1),[v,B]=(0,a.useState)(null),[z,M]=(0,a.useState)(''),[$,A]=(0,a.useState)(''),L=f.areas.some(e=>e.id===k)?k:f.areas[0]?.id??'',W=f.tables.find(e=>e.id===T)??null,_=a=>W&&y().updateTable(e,W.id,a),H=()=>{let e=1;const a=new Set(f.tables.map(e=>e.name));for(;a.has(String(e));)e++;return String(e)},F=(e,a)=>{for(let s=50;s+a<=o.PLAN_H;s+=50)for(let l=50;l+e<=o.PLAN_W;l+=50)if(!f.tables.some(t=>t.areaId===L&&l<t.x+t.w+25&&t.x<l+e+25&&s<t.y+t.h+25&&t.y<s+a+25))return{x:l,y:s};return{x:50,y:50}},N=e=>{if(!W||e.id===W.id)return;const a=f.joins.filter(a=>!a.tables.includes(W.name)&&!a.tables.includes(e.name)),s=Array.from(new Set([...f.joins.find(e=>e.tables.includes(W.name))?.tables??[W.name],...f.joins.find(a=>a.tables.includes(e.name))?.tables??[e.name]]));w({...f,joins:[...a,{id:(0,o.fid)('j'),tables:s}]}),D(!1),A(`Joined ${s.join('+')} \u2014 book it as one table.`)},V=W?f.joins.find(e=>e.tables.includes(W.name)):void 0,E=W&&f.tables.some(e=>e.id!==W.id&&e.name===W.name),q=W?(0,h.jsxs)(n.default,{testID:"table-tools",style:{gap:10,backgroundColor:c.colours.surface,borderRadius:14,borderWidth:1,borderColor:c.colours.border,padding:12},children:[(0,h.jsxs)(u.Row,{style:{justifyContent:'space-between'},children:[(0,h.jsxs)(u.T,{weight:"semibold",colour:c.colours.gold,children:["Table ",W.name]}),(0,h.jsx)(u.Button,{small:!0,kind:"ghost",label:"Done",onPress:()=>R(null)})]}),(0,h.jsxs)(u.Row,{gap:8,children:[(0,h.jsx)(u.T,{size:14,style:{width:90},children:"Name / no."}),(0,h.jsx)(t.default,{accessibilityLabel:"Table name",value:W.name,onChangeText:e=>_({name:e.replace(/[^A-Za-z0-9-]/g,'').slice(0,6)}),style:[u.styles.input,{flex:1,minWidth:0,width:40,paddingVertical:8}]})]}),E?(0,h.jsx)(u.T,{size:13,colour:c.colours.red,children:"Another table already uses this number."}):null,(0,h.jsx)(u.Row,{wrap:!0,gap:6,children:o.SHAPES.map(e=>(0,h.jsx)(u.Chip,{label:e.label,selected:W.shape===e.id,onPress:()=>_({shape:e.id,w:x[e.id][0],h:x[e.id][1],...'stool'===e.id?{minSeats:1,maxSeats:1}:{}})},e.id))}),(0,h.jsxs)(u.Row,{style:{justifyContent:'space-between'},children:[(0,h.jsx)(u.T,{size:14,children:"Min seats"}),(0,h.jsx)(u.Stepper,{value:W.minSeats,onChange:e=>_({minSeats:e,maxSeats:Math.max(e,W.maxSeats)}),min:1,max:20,label:"min seats"})]}),(0,h.jsxs)(u.Row,{style:{justifyContent:'space-between'},children:[(0,h.jsx)(u.T,{size:14,children:"Max seats"}),(0,h.jsx)(u.Stepper,{value:W.maxSeats,onChange:e=>_({maxSeats:e,minSeats:Math.min(e,W.minSeats)}),min:1,max:24,label:"max seats"})]}),(0,h.jsxs)(u.Row,{wrap:!0,gap:6,children:[(0,h.jsx)(u.Button,{small:!0,kind:"secondary",label:"\u27f2 15\xb0",accessibilityLabel:"Rotate left",onPress:()=>_({rot:(W.rot-15+360)%360})}),(0,h.jsx)(u.Button,{small:!0,kind:"secondary",label:"\u27f3 15\xb0",accessibilityLabel:"Rotate right",onPress:()=>_({rot:(W.rot+15)%360}),testID:"rotate-table"}),(0,h.jsx)(u.Button,{small:!0,kind:"secondary",label:"Bigger",onPress:()=>_({w:Math.min(400,W.w+25),h:Math.min(300,W.h+25)})}),(0,h.jsx)(u.Button,{small:!0,kind:"secondary",label:"Smaller",onPress:()=>_({w:Math.max(50,W.w-25),h:Math.max(50,W.h-25)})})]}),(0,h.jsxs)(u.Row,{wrap:!0,gap:6,children:[(0,h.jsx)(u.T,{size:14,style:{width:'100%'},children:"Area"}),f.areas.map(e=>(0,h.jsx)(u.Chip,{label:e.name,selected:W.areaId===e.id,onPress:()=>{_({areaId:e.id}),S(e.id)}},e.id))]}),f.sections.length?(0,h.jsxs)(u.Row,{wrap:!0,gap:6,children:[(0,h.jsx)(u.T,{size:14,style:{width:'100%'},children:"Server section"}),f.sections.map(e=>(0,h.jsx)(u.Chip,{label:`${e.name} (${e.server})`,selected:W.sectionId===e.id,onPress:()=>_({sectionId:e.id})},e.id))]}):null,(0,h.jsxs)(u.Row,{style:{justifyContent:'space-between'},children:[(0,h.jsxs)(n.default,{style:{flex:1},children:[(0,h.jsx)(u.T,{size:14,children:"Bookable online"}),(0,h.jsx)(u.Muted,{children:"For a later Wix Tables / booking-page mapping. Nothing is synced now."})]}),(0,h.jsx)(l.default,{accessibilityLabel:"Bookable online",value:W.online,onValueChange:e=>{_({online:e})},trackColor:{true:c.colours.gold,false:'#444'}})]}),(0,h.jsxs)(u.Row,{wrap:!0,gap:6,children:[(0,h.jsx)(u.Button,{small:!0,label:"Duplicate",onPress:()=>{if(!W)return;const a=F(W.w,W.h),s={...W,id:(0,o.fid)('t'),name:H(),x:a.x,y:a.y};y().addTable(e,s),R(s.id),A(`Duplicated as Table ${s.name}.`)},testID:"dup-table"}),V?(0,h.jsx)(u.Button,{small:!0,kind:"secondary",label:`Split ${V.tables.join('+')}`,onPress:()=>{w({...f,joins:f.joins.filter(e=>e.id!==V.id)}),A('Split back into separate tables.')},testID:"split-table"}):(0,h.jsx)(u.Button,{small:!0,kind:"secondary",label:I?'Tap a table to join\u2026':'Join with\u2026',onPress:()=>D(!I),testID:"join-table"}),(0,h.jsx)(u.Button,{small:!0,kind:"danger",label:"Delete",onPress:()=>B({kind:'table'}),testID:"delete-table"})]})]}):null,O=(0,h.jsx)(b.FloorCanvas,{plan:f,areaId:L,mode:"edit",fit:"width",maxH:j,selected:T,snapOn:C,highlight:V?.tables,onTap:e=>{I?N(e):R(e.id===T?null:e.id)},onMove:(a,s,l)=>y().updateTable(e,a.id,{x:s,y:l}),onResize:(a,s,l)=>y().updateTable(e,a.id,{w:s,h:l})}),G=f.areas.find(e=>e.id===L),J=Object.fromEntries(f.areas.map(e=>[e.id,String(f.tables.filter(a=>a.areaId===e.id).length)]));return(0,h.jsxs)(n.default,{style:{gap:10},testID:"floor-editor",children:[(0,h.jsx)(p,{plan:f,area:L,onPick:e=>{S(e),R(null)},counts:J}),(0,h.jsxs)(u.Row,{wrap:!0,gap:6,children:[(0,h.jsx)(u.Button,{label:"+ Table",onPress:()=>{const[a,s]=x.square,l=F(a,s),t={id:(0,o.fid)('t'),name:H(),areaId:L,shape:'square',minSeats:2,maxSeats:4,x:l.x,y:l.y,w:a,h:s,rot:0,online:!0,sectionId:f.sections[0]?.id};y().addTable(e,t),R(t.id),A(`Table ${t.name} added \u2014 drag it into place.`)},testID:"add-table",style:{minWidth:110}}),(0,h.jsxs)(u.Row,{gap:6,style:{paddingHorizontal:6},children:[(0,h.jsx)(l.default,{accessibilityLabel:"Snap to grid",value:C,onValueChange:P,trackColor:{true:c.colours.gold,false:'#444'}}),(0,h.jsx)(u.T,{size:14,children:"Snap to grid"})]})]}),$?(0,h.jsx)(u.T,{size:13,colour:c.colours.goldLight,children:$}):null,s?(0,h.jsxs)(h.Fragment,{children:[O,q]}):(0,h.jsxs)(u.Row,{gap:12,style:{alignItems:'flex-start'},children:[(0,h.jsx)(n.default,{style:{flex:1},children:O}),q?(0,h.jsx)(n.default,{style:{width:320},children:q}):null]}),W?null:(0,h.jsx)(u.Muted,{children:"Tap a table to edit it; drag to move (snaps to the grid); drag the gold dot to resize."}),(0,h.jsxs)(n.default,{style:{gap:6,backgroundColor:c.colours.surface,borderRadius:14,borderWidth:1,borderColor:c.colours.border,padding:12},children:[(0,h.jsx)(u.T,{weight:"semibold",colour:c.colours.gold,children:"Areas"}),G?(0,h.jsxs)(u.Row,{gap:6,children:[(0,h.jsx)(u.T,{size:14,style:{width:90},children:"Rename"}),(0,h.jsx)(t.default,{accessibilityLabel:"Area name",value:G.name,onChangeText:e=>w({...f,areas:f.areas.map(a=>a.id===G.id?{...a,name:e.slice(0,24)}:a)}),style:[u.styles.input,{flex:1,minWidth:0,width:40,paddingVertical:8}]})]}):null,(0,h.jsxs)(u.Row,{gap:6,children:[(0,h.jsx)(t.default,{accessibilityLabel:"New area name",placeholder:"New area, e.g. Function room",placeholderTextColor:"#7D776C",value:z,onChangeText:M,style:[u.styles.input,{flex:1,minWidth:0,width:40,paddingVertical:8}]}),(0,h.jsx)(u.Button,{small:!0,label:"+ Area",disabled:z.trim().length<2,onPress:()=>{const e={id:(0,o.fid)('a'),name:z.trim()};w({...f,areas:[...f.areas,e]}),S(e.id),M(''),R(null)},testID:"add-area"})]}),(0,h.jsxs)(u.Row,{wrap:!0,gap:6,children:[(0,h.jsx)(u.Button,{small:!0,kind:"secondary",label:"Delete this area",disabled:f.areas.length<2,onPress:()=>B({kind:'area'}),testID:"delete-area"}),(0,h.jsx)(u.Button,{small:!0,kind:"ghost",label:"Reset to example layout",onPress:()=>B({kind:'reset'})})]}),(0,h.jsxs)(u.Muted,{children:[f.tables.length," tables \xb7 ",f.tables.reduce((e,a)=>e+a.maxSeats,0)," seats \xb7 ",f.tables.filter(e=>e.online).length," bookable online. Example layout made up for the demo; table numbers are the ones you'd match in Wix Tables later (not connected)."]})]}),v?(0,h.jsxs)(u.Sheet,{visible:!0,onClose:()=>B(null),title:'table'===v.kind?`Delete Table ${W?.name}?`:'area'===v.kind?`Delete ${G?.name}?`:'Reset the table plan?',testID:"confirm-sheet",children:[(0,h.jsx)(u.Muted,{children:'table'===v.kind?'It comes off the plan. Bookings keep their table number.':'area'===v.kind?`Its ${J[L]} table(s) move to ${f.areas.find(e=>e.id!==L)?.name}.`:'Puts back the example layout for this venue.'}),(0,h.jsxs)(u.Row,{gap:8,children:[(0,h.jsx)(u.Button,{kind:"danger",label:'reset'===v.kind?'Reset':'Delete',accessibilityLabel:'reset'===v.kind?'Reset':'Confirm delete',testID:"confirm-delete",onPress:()=>{if('table'===v.kind&&W&&(y().removeTable(e,W.id),R(null),A(`Table ${W.name} deleted.`)),'area'===v.kind){const e=f.areas.find(e=>e.id!==L);w({...f,areas:f.areas.filter(e=>e.id!==L),tables:f.tables.map(a=>a.areaId===L?{...a,areaId:e.id}:a)}),S(e.id)}'reset'===v.kind&&(y().resetPlan(e),R(null)),B(null)}}),(0,h.jsx)(u.Button,{kind:"secondary",label:"Cancel",onPress:()=>B(null)})]})]}):null]})};var a=r(d[0]),s=e(r(d[1])),l=e(r(d[2])),t=e(r(d[3])),n=e(r(d[4])),o=r(d[5]),c=r(d[6]),u=r(d[7]),b=r(d[8]),h=r(d[9]);const x={round:[100,100],square:[100,100],rect:[175,100],booth:[200,125],stool:[75,75]};function p({plan:e,area:a,onPick:l,counts:t}){return(0,h.jsx)(u.Row,{wrap:!0,gap:6,style:{alignItems:'center'},children:e.areas.map(e=>{const n=e.id===a;return(0,h.jsx)(s.default,{testID:`area-${e.id}`,accessibilityRole:"tab",accessibilityLabel:`Area ${e.name}`,accessibilityState:{selected:n},onPress:()=>l(e.id),style:{minHeight:48,paddingHorizontal:16,borderRadius:24,borderWidth:1.5,borderColor:n?c.colours.gold:c.colours.border,backgroundColor:n?c.colours.gold:c.colours.surface,justifyContent:'center'},children:(0,h.jsxs)(u.T,{weight:"semibold",size:15,colour:n?c.colours.onGold:c.colours.text,children:[e.name,t?.[e.id]?(0,h.jsxs)(u.T,{size:12,colour:n?c.colours.onGold:c.colours.muted,children:[" ",t[e.id]]}):null]})},e.id)})})}},854,[12,245,253,255,109,864,797,790,853,6]);
|
| 7 |
+
__d(function(_g,_r,_i,_a,m,_e,_d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"SLOT_W",{enumerable:!0,get:function(){return h}}),Object.defineProperty(_e,"ROW_H",{enumerable:!0,get:function(){return b}}),_e.Timeline=function({plan:e,bookings:p,now:y,privacy:x,onOpen:j,turnBase:v,t0:C,t1:k,height:w}){const M=(0,t.useMemo)(()=>[{key:'__none',area:'',name:'To assign'},...e.areas.flatMap(t=>e.tables.filter(e=>e.areaId===t.id).map(e=>({key:e.name,area:t.name,name:e.name})))],[e]),T=p.filter(e=>!['cancelled','noshow'].includes(e.status)),R=(0,t.useMemo)(()=>(0,s.clashes)(T,v),[T,v]),z=Math.ceil((k.getTime()-C.getTime())/9e5),$=e=>(e.getTime()-C.getTime())/9e5*h,[_,B]=(0,t.useState)(null),O=(0,t.useRef)(null),E=(0,t.useRef)(null);(0,t.useEffect)(()=>{const e=Math.max(0,$(y)-120);setTimeout(()=>E.current?.scrollTo({x:e,animated:!1}),50)},[]);const[S,W]=(0,t.useState)(''),D=(e,t)=>({onStartShouldSetResponder:()=>!0,onMoveShouldSetResponder:()=>!0,onResponderTerminationRequest:()=>!1,onResponderGrant:e=>{O.current={x:e.nativeEvent.pageX,y:e.nativeEvent.pageY}},onResponderMove:o=>{if(!O.current)return;const r=o.nativeEvent.pageX-O.current.x,n=o.nativeEvent.pageY-O.current.y;Math.abs(r)+Math.abs(n)>=6&&B({id:e.id,dx:r,dy:n,kind:t})},onResponderRelease:o=>{const r=O.current;O.current=null,B(null);const l=o.nativeEvent.pageX-(r?.x??0),d=o.nativeEvent.pageY-(r?.y??0);if(Math.abs(l)+Math.abs(d)<6)return void('move'===t&&j(e));const c=Math.round(l/h);if('stretch'===t){const t=Math.max(30,(0,s.durOf)(e,v)+15*c);return n.repo.bookings.update(e.id,{durationMins:t}),void W(`${(0,u.privName)(e,x)} now ${t} min`)}const f=M.findIndex(t=>t.key===((0,i.tablesOf)(e.table)[0]??'__none')),g=Math.max(0,Math.min(M.length-1,f+Math.round(d/b))),p={};c&&'confirmed'===e.status&&(p.time=(0,a.hm)((0,a.addMins)((0,s.startOf)(e),15*c))),g!==f&&'__none'!==M[g].key&&(p.table=M[g].key),p.time||p.table?(n.repo.bookings.update(e.id,p),W(`${(0,u.privName)(e,x)} \u2192 ${p.table?`Table ${p.table}`:''}${p.table&&p.time?' at ':''}${p.time??''}`)):c&&'confirmed'!==e.status&&W('Seated parties can move table, not time.')}}),I=$(y);return(0,c.jsxs)(r.default,{style:{flex:1,gap:6},testID:"timeline",children:[(0,c.jsxs)(d.Row,{style:{justifyContent:'space-between'},children:[(0,c.jsxs)(d.Row,{gap:8,children:[(0,c.jsx)(d.Badge,{kind:R.size?'red':'green',label:R.size?`${R.size} bookings clash`:'No clashes'}),(0,c.jsx)(d.Muted,{children:"Drag a booking to another table or time \xb7 drag its right edge to change the length"})]}),(0,c.jsx)(r.default,{testID:"clash-count",accessibilityLabel:`clashes ${R.size}`,children:(0,c.jsx)(d.T,{size:13,colour:l.colours.goldLight,children:S})})]}),(0,c.jsx)(r.default,{style:{flex:w?void 0:1,height:w,flexDirection:'row',borderRadius:14,borderWidth:1,borderColor:l.colours.border,overflow:'hidden',backgroundColor:'#0F0E0C'},children:(0,c.jsxs)(o.default,{style:{flex:1},contentContainerStyle:{flexDirection:'row'},children:[(0,c.jsxs)(r.default,{style:{width:f,borderRightWidth:1,borderColor:l.colours.border,backgroundColor:l.colours.surface},children:[(0,c.jsx)(r.default,{style:{height:30,justifyContent:'center',paddingLeft:8,borderBottomWidth:1,borderColor:l.colours.border},children:(0,c.jsx)(d.T,{size:12,colour:l.colours.muted,children:"Table"})}),M.map((e,t)=>(0,c.jsxs)(r.default,{style:{height:b,justifyContent:'center',paddingLeft:8,borderBottomWidth:1,borderColor:'#211E19',borderTopWidth:t>0&&M[t-1].area!==e.area?2:0,borderTopColor:l.colours.gold},children:[(0,c.jsx)(d.T,{size:14,weight:"semibold",children:'__none'===e.key?e.name:`T${e.name}`}),!e.area||0!==t&&M[t-1].area===e.area?null:(0,c.jsx)(d.T,{size:10,colour:l.colours.gold,children:e.area.toUpperCase()})]},e.key))]}),(0,c.jsx)(o.default,{ref:E,horizontal:!0,style:{flex:1},children:(0,c.jsxs)(r.default,{style:{width:z*h},children:[(0,c.jsx)(r.default,{style:{height:30,flexDirection:'row',borderBottomWidth:1,borderColor:l.colours.border},children:Array.from({length:Math.ceil(z/4)},(e,t)=>(0,c.jsx)(r.default,{style:{width:Math.min(4,z-4*t)*h,justifyContent:'center',borderLeftWidth:1,borderColor:l.colours.border},children:(0,c.jsx)(d.T,{size:11,colour:l.colours.muted,numberOfLines:1,style:{paddingLeft:3},children:(0,a.hm)((0,a.addMins)(C,60*t))})},t))}),M.map((e,t)=>{return(0,c.jsxs)(r.default,{testID:`tl-row-${e.key}`,style:{height:b,borderBottomWidth:1,borderColor:'#211E19',borderTopWidth:t>0&&M[t-1].area!==e.area?2:0,borderTopColor:'rgba(207,164,95,0.4)'},children:[Array.from({length:Math.ceil(z/4)},(e,t)=>(0,c.jsx)(r.default,{pointerEvents:"none",style:{position:'absolute',left:4*t*h,top:0,bottom:0,width:1,backgroundColor:'#1E1B16'}},t)),(o=e.key,T.filter(e=>'__none'===o?!e.table:(0,i.tablesOf)(e.table).includes(o))).map(e=>{const t=_?.id===e.id?_:null,o=$((0,s.startOf)(e))+('move'===t?.kind?t.dx:0),n=Math.max(h,(0,s.durOf)(e,v)/15*h+('stretch'===t?.kind?t.dx:0)),i=R.has(e.id);return(0,c.jsxs)(r.default,{testID:`tl-${e.id}`,accessibilityRole:"button",accessibilityLabel:`${(0,u.privName)(e,x)}, ${e.partySize}, ${(0,a.hm)((0,s.startOf)(e))}, ${(0,s.durOf)(e,v)} min${i?', clash':''}`,...D(e,'move'),style:[{position:'absolute',left:o,top:4+('move'===t?.kind?t.dy:0),width:n,height:36,borderRadius:8,backgroundColor:g(e),borderWidth:i?2.5:1,borderColor:i?'#FF6B5E':'rgba(0,0,0,0.4)',paddingHorizontal:6,justifyContent:'center',zIndex:t?40:2,opacity:'finished'===e.status?.55:1,cursor:'grab',touchAction:'none'},t?null:{transitionProperty:'left, width, top',transitionDuration:'200ms'}],children:[(0,c.jsxs)(d.T,{size:12,weight:"semibold",colour:'confirmed'===e.status?'#EAF4FF':'#0B0B0B',numberOfLines:1,children:[i?'\u26a0 ':'',(0,a.hm)((0,s.startOf)(e))," ",(0,u.privName)(e,x)," \xb7 ",e.partySize,e.allergies.length?' \u26a0':'']}),(0,c.jsx)(r.default,{testID:`tl-stretch-${e.id}`,accessibilityLabel:"Change length",...D(e,'stretch'),style:{position:'absolute',right:0,top:0,bottom:0,width:14,borderTopRightRadius:8,borderBottomRightRadius:8,backgroundColor:'rgba(0,0,0,0.25)',cursor:'ew-resize',touchAction:'none'}})]},e.id)})]},e.key);var o}),I>=0&&I<=z*h?(0,c.jsx)(r.default,{testID:"now-line",pointerEvents:"none",style:{position:'absolute',left:I,top:0,bottom:0,width:2,backgroundColor:l.colours.gold,zIndex:30},children:(0,c.jsx)(r.default,{style:{position:'absolute',top:0,left:-18,width:38,backgroundColor:l.colours.gold,borderRadius:6},children:(0,c.jsx)(d.T,{size:10,weight:"bold",colour:"#0B0B0B",center:!0,children:(0,a.hm)(y)})})}):null]})})]})})]})};var t=_r(_d[0]);_r(_d[1]);var o=e(_r(_d[2])),r=e(_r(_d[3])),n=_r(_d[4]),i=_r(_d[5]),s=_r(_d[6]),a=_r(_d[7]),l=_r(_d[8]),d=_r(_d[9]),u=_r(_d[10]),c=_r(_d[11]);const h=30,b=44,f=96,g=e=>'seated'===e.status?'#CFA45F':'finished'===e.status?'#3A352C':e.walkIn?'#B9925A':'#3C78B5'},855,[12,104,133,109,796,864,852,795,797,790,856,6]);
|
| 8 |
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"initials",{enumerable:!0,get:function(){return n}}),Object.defineProperty(e,"pv",{enumerable:!0,get:function(){return t}}),Object.defineProperty(e,"privName",{enumerable:!0,get:function(){return l}});const n=n=>n.replace(' (example)','').split(/\s+/).filter(Boolean).map(n=>`${n[0].toUpperCase()}.`).join(' '),t=(t,l)=>t?l?n(t):t.replace(' (example)',''):'',l=(n,l)=>n.walkIn?`Walk-in ${n.ref}`:t(n.name,l)},856,[]);
|
| 9 |
+
__d(function(g,r,_i,a,m,_e,_d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.Screensaver=function({rid:e,idleMins:n,pinOn:o,pin:i,tonightCards:u}){const[s,l]=(0,t.useState)(!1),[c,d]=(0,t.useState)(!1),[f,w]=(0,t.useState)(''),b=(0,t.useRef)(Date.now()),x=(0,t.useRef)(!1),R=(0,t.useRef)(0);x.current=s;const j=6e4*n;(0,t.useEffect)(()=>{if(!h)return;const e=e=>'pointerdown'===e.type||'touchstart'===e.type||'mousedown'===e.type||'keydown'===e.type,t=t=>{const n=performance.now();return x.current&&e(t)?(t.preventDefault(),t.stopPropagation(),t.stopImmediatePropagation?.(),R.current=n+800,x.current=!1,window.__ccWokeAt=n,l(!1),k.current&&d(!0),void(b.current=Date.now())):n<R.current&&['pointerup','mouseup','touchend','click','pointerdown','mousedown','touchstart'].includes(t.type)?(t.preventDefault(),t.stopPropagation(),void t.stopImmediatePropagation?.()):void(b.current=Date.now())},n=['pointerdown','pointerup','mousedown','mouseup','touchstart','touchend','click','keydown','wheel'];n.forEach(e=>window.addEventListener(e,t,{capture:!0,passive:!1}));const o=setInterval(()=>{!x.current&&!D.current&&Date.now()-b.current>=j&&(x.current=!0,l(!0))},1e3);return()=>{n.forEach(e=>window.removeEventListener(e,t,{capture:!0})),clearInterval(o)}},[j]);const k=(0,t.useRef)(o);k.current=o;const D=(0,t.useRef)(c);return D.current=c,(0,t.useEffect)(()=>{if(!h)return;let e=null;const t=async()=>{try{e=await(navigator.wakeLock?.request?.('screen')),window.__ccWakeLock=e?'on':'unsupported'}catch{window.__ccWakeLock='refused'}};t();const n=()=>{'visible'===document.visibilityState&&t()};return document.addEventListener('visibilitychange',n),()=>{document.removeEventListener('visibilitychange',n);try{e?.release?.()}catch{}}},[]),c?(0,p.jsx)(y,{pin:i,entry:f,setEntry:w,onOk:()=>{d(!1),w(''),b.current=Date.now()}}):s?(0,p.jsx)(v,{rid:e,tonightCards:u}):null};var t=r(_d[0]),n=e(r(_d[1])),o=e(r(_d[2])),i=e(r(_d[3]));r(_d[4]);var u=e(r(_d[5])),s=e(r(_d[6])),l=e(r(_d[7])),c=r(_d[8]),d=r(_d[9]),f=r(_d[10]),p=r(_d[11]);const h='undefined'!=typeof window;function w({w:e,h:i,seed:u}){const s=(0,t.useRef)(new n.default.Value(0)).current,l=e=>{const t=233280*Math.sin(9301*u+49297*e);return t-Math.floor(t)};(0,t.useEffect)(()=>{const e=n.default.loop(n.default.timing(s,{toValue:1,duration:9e3+9e3*l(1),delay:4e3*l(2),easing:o.default.linear,useNativeDriver:!1}));return e.start(),()=>e.stop()},[]);const d=3+5*l(3);return(0,p.jsx)(n.default.View,{pointerEvents:"none",style:{position:'absolute',left:l(4)*e,top:0,width:d,height:d,borderRadius:d,backgroundColor:c.colours.goldLight,shadowColor:c.colours.gold,shadowRadius:6,shadowOpacity:.9,opacity:s.interpolate({inputRange:[0,.15,.8,1],outputRange:[0,.85,.5,0]}),transform:[{translateY:s.interpolate({inputRange:[0,1],outputRange:[i+20,i*(.15+.3*l(5))]})},{translateX:s.interpolate({inputRange:[0,.5,1],outputRange:[0,60*(l(6)-.5),0]})}]}})}function y({pin:e,entry:t,setEntry:n,onOk:o}){const i=i=>{const u=(t+i).slice(0,4);n(u),4===u.length&&(u===e?o():setTimeout(()=>n(''),300))};return(0,p.jsxs)(s.default,{testID:"wake-pin",style:{position:h?'fixed':'absolute',left:0,right:0,top:0,bottom:0,zIndex:1e5,backgroundColor:'rgba(5,5,5,0.97)',alignItems:'center',justifyContent:'center',gap:16},children:[(0,p.jsx)(f.T,{size:22,weight:"semibold",colour:c.colours.gold,children:"Enter staff PIN"}),(0,p.jsxs)(f.T,{size:30,weight:"bold",children:['\u25cf'.repeat(t.length),'\u25cb'.repeat(4-t.length)]}),(0,p.jsx)(s.default,{style:{flexDirection:'row',flexWrap:'wrap',width:252,gap:12,justifyContent:'center'},children:['1','2','3','4','5','6','7','8','9','0'].map(e=>(0,p.jsx)(u.default,{accessibilityRole:"button",accessibilityLabel:`PIN ${e}`,onPress:()=>i(e),style:{width:72,height:72,borderRadius:36,borderWidth:2,borderColor:c.colours.gold,alignItems:'center',justifyContent:'center'},children:(0,p.jsx)(f.T,{size:26,colour:c.colours.gold,children:e})},e))})]})}function v({rid:e}){const{width:u,height:s}=(0,l.default)(),y=(0,t.useRef)({width:u,height:s});y.current={width:u,height:s};const v=(0,d.useBrand)(e),b=d.HERO_LOGOS[e]??v.logo,x=(0,t.useRef)(new n.default.Value(0)).current,R=(0,t.useRef)(new n.default.Value(0)).current,j=(0,t.useRef)(new n.default.ValueXY({x:0,y:0})).current;(0,t.useEffect)(()=>{n.default.timing(x,{toValue:1,duration:700,useNativeDriver:!1}).start();const e=n.default.loop(n.default.sequence([n.default.timing(R,{toValue:1,duration:14e3,easing:o.default.inOut(o.default.quad),useNativeDriver:!1}),n.default.timing(R,{toValue:0,duration:14e3,easing:o.default.inOut(o.default.quad),useNativeDriver:!1})]));e.start();const t=()=>n.default.timing(j,{toValue:{x:(Math.random()-.5)*y.current.width*.18,y:(Math.random()-.5)*y.current.height*.14},duration:6e3,easing:o.default.inOut(o.default.quad),useNativeDriver:!1}).start();t();const i=setInterval(t,2e4);return()=>{e.stop(),clearInterval(i)}},[]);const k=(0,t.useRef)(!0);(0,t.useEffect)(()=>{k.current?k.current=!1:n.default.timing(j,{toValue:{x:0,y:0},duration:500,easing:o.default.out(o.default.quad),useNativeDriver:!1}).start()},[u>s]);const D=.5*Math.min(u,s);return(0,p.jsxs)(n.default.View,{testID:"screensaver",accessibilityLabel:"Screensaver \u2014 touch to wake",style:{position:h?'fixed':'absolute',left:0,top:0,right:0,bottom:0,zIndex:1e5,backgroundColor:'#050505',opacity:x,overflow:'hidden',cursor:'pointer'},children:[Array.from({length:18},(e,t)=>(0,p.jsx)(w,{w:u,h:s,seed:t+1},t)),(0,p.jsx)(n.default.View,{style:{flex:1,alignItems:'center',justifyContent:'center',transform:[{translateX:j.x},{translateY:j.y}]},children:b?(0,p.jsx)(n.default.View,{style:{transform:[{scale:R.interpolate({inputRange:[0,1],outputRange:[1,1.12]})},{translateX:R.interpolate({inputRange:[0,1],outputRange:[-10,10]})}]},children:(0,p.jsx)(i.default,{source:b,style:{width:D,height:D},resizeMode:"contain",accessibilityLabel:`${v.name} logo`})}):(0,p.jsx)(f.T,{size:48,weight:"bold",colour:c.colours.gold,children:v.name})})]})}},857,[12,102,206,178,104,245,109,269,797,859,790,6]);
|
| 10 |
+
__d(function(g,_r,_i,_a,_m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"Card",{enumerable:!0,get:function(){return y}}),_e.ArrivalsStrip=function({todays:e,now:t,privacy:s}){const r=e.filter(e=>'confirmed'===e.status).map(e=>({b:e,m:(0,m.minsBetween)(t,new Date(`${e.date}T${e.time}:00`))})).filter(e=>e.m>=-20&&e.m<=60).sort((e,t)=>e.m-t.m);return(0,p.jsxs)(a.default,{testID:"arrivals-strip",style:{flexDirection:'row',alignItems:'center',gap:8,minHeight:40},children:[(0,p.jsx)(o.T,{size:13,weight:"semibold",colour:j.colours.gold,children:"NEXT HOUR"}),(0,p.jsxs)(l.default,{horizontal:!0,showsHorizontalScrollIndicator:!1,contentContainerStyle:{gap:6},children:[0===r.length?(0,p.jsx)(o.Muted,{children:"No arrivals due in the next hour."}):null,r.map(({b:e,m:t})=>(0,p.jsxs)(a.default,{style:{flexDirection:'row',alignItems:'center',gap:6,paddingHorizontal:10,paddingVertical:5,borderRadius:16,backgroundColor:t<0?j.colours.amberBg:'#12263D',borderWidth:1,borderColor:t<0?j.colours.amber:'#3C78B5'},children:[(0,p.jsx)(o.T,{size:13,weight:"semibold",children:e.time}),(0,p.jsxs)(o.T,{size:13,children:[(0,i.privName)(e,s)," \xb7 ",e.partySize]}),(0,p.jsx)(o.T,{size:12,colour:j.colours.muted,children:e.table?`T${e.table}`:'no table'}),(0,p.jsx)(o.T,{size:12,colour:t<0?j.colours.amber:j.colours.blue,children:t<0?-t+"m late":0===t?'now':`in ${t}m`}),e.allergies.length?(0,p.jsx)(o.T,{size:12,children:"\u26a0"}):null,e.occasion?(0,p.jsx)(o.T,{size:12,children:b.OCCASION_ICON[e.occasion]}):null]},e.id))]})]})},_e.Legend=function(){return(0,p.jsxs)(o.Row,{wrap:!0,gap:10,style:{paddingVertical:2},children:[Object.keys(b.STATUS).map(e=>(0,p.jsxs)(o.Row,{gap:4,children:[(0,p.jsx)(a.default,{style:{width:12,height:12,borderRadius:4,backgroundColor:b.STATUS[e].colour}}),(0,p.jsx)(o.T,{size:12,colour:j.colours.muted,children:b.STATUS[e].label})]},e)),(0,p.jsx)(o.T,{size:12,colour:j.colours.muted,children:"\u26a0 allergy \xb7 \u2605 VIP \xb7 \u2665 regular \xb7 \ud83c\udf82 birthday \xb7 \ud83d\udc8d anniversary"})]})},_e.DetailsPanel=function({title:e,children:s,onClose:l}){const[r,a]=(0,t.useState)(20);return(0,t.useEffect)(()=>{const e=Date.now(),t=()=>a(20-Math.floor((Date.now()-e)/1e3)),s=setInterval(t,1e3),l=setTimeout(t,2e4);return()=>{clearInterval(s),clearTimeout(l)}},[]),(0,t.useEffect)(()=>{r<=0&&l()},[r]),(0,p.jsxs)(o.Sheet,{visible:!0,onClose:l,title:e,maxWidth:560,testID:"private-details",children:[(0,p.jsx)(o.Badge,{kind:"amber",label:`Private \xb7 closes in ${Math.max(0,r)}s`}),s,(0,p.jsx)(o.Button,{kind:"secondary",label:"Close now",onPress:l})]})},Object.defineProperty(_e,"bookingDetails",{enumerable:!0,get:function(){return w}}),_e.TableSheet=function({rid:e,name:l,view:h,plan:x,todays:f,now:y,privacy:w,turnBase:v,onClose:T,onWalkIn:S,onMove:k,onDetails:$}){const C=h[l],M=c.useFloor.getState(),[z,I]=(0,t.useState)(!1),[B,D]=(0,t.useState)(C?.note??''),[P,R]=(0,t.useState)(!1);if(!C)return null;const A=C.booking,O=['seated','mains','dessert','bill'].includes(C.status),N=f.filter(e=>'confirmed'===e.status).sort((e,t)=>Math.abs((0,m.minsBetween)(y,(0,b.startOf)(e)))-Math.abs((0,m.minsBetween)(y,(0,b.startOf)(t)))),W=e=>e.partySize<=C.table.maxSeats,L=(0,b.turnFor)(C.covers||C.table.maxSeats,v);return(0,p.jsxs)(o.Sheet,{visible:!0,onClose:T,title:`Table ${l} \xb7 ${b.STATUS[C.status].label}`,maxWidth:640,testID:"table-sheet",children:[(0,p.jsxs)(o.Row,{wrap:!0,gap:6,children:[(0,p.jsx)(o.Badge,{kind:"neutral",label:`${C.table.minSeats}\u2013${C.table.maxSeats} seats`}),A?(0,p.jsx)(o.Badge,{kind:"gold",label:`${(0,i.privName)(A,w)} \xb7 ${A.partySize} \xb7 ${C.seatedMins}m`}):null,A?(0,p.jsx)(o.Badge,{kind:C.seatedMins>(0,b.durOf)(A,v)?'red':'neutral',label:`Turn ~${(0,b.durOf)(A,v)} min \xb7 free ~${(0,m.hm)((0,b.endOf)(A,v))} (est.)`}):(0,p.jsx)(o.Badge,{kind:"neutral",label:`Turn estimate for ${C.table.maxSeats}: ~${L} min`}),C.next?(0,p.jsx)(o.Badge,{kind:"blue",label:`Next: ${C.next.time} ${(0,i.privName)(C.next,w)} (${C.next.partySize})`}):null,C.allergy?(0,p.jsx)(o.Badge,{kind:"red",label:"\u26a0 Allergy \u2014 see details"}):null]}),O||'blocked'===C.status?null:(0,p.jsxs)(o.Row,{gap:8,children:[(0,p.jsx)(o.Button,{label:"Seat walk-in here",onPress:()=>{T(),S(l)},testID:"seat-walkin-here",style:{flex:1,minHeight:56}}),(0,p.jsx)(o.Button,{kind:"secondary",label:"Seat a booking",onPress:()=>R(!P),testID:"seat-booking-here",style:{flex:1,minHeight:56}})]}),P?(0,p.jsxs)(a.default,{style:{gap:6},children:[0===N.length?(0,p.jsx)(o.Muted,{children:"No bookings left to seat today."}):null,N.slice(0,8).map(t=>(0,p.jsxs)(s.default,{accessibilityRole:"button",accessibilityLabel:`Seat ${(0,i.privName)(t,w)} ${t.time}`,onPress:async()=>{await u.repo.bookings.update(t.id,{table:l}),await u.repo.bookings.setStatus(t.id,'seated'),(0,n.resetTableLive)(e,l),T()},style:{padding:10,borderRadius:10,borderWidth:1,borderColor:W(t)?j.colours.border:j.colours.amber,backgroundColor:j.colours.surface2},children:[(0,p.jsxs)(o.T,{weight:"semibold",children:[t.time," \xb7 ",(0,i.privName)(t,w)," \xb7 ",t.partySize,t.table?` \xb7 booked T${t.table}`:'',t.allergies.length?' \xb7 \u26a0':'']}),W(t)?null:(0,p.jsxs)(o.T,{size:12,colour:j.colours.amber,children:["Bigger than this table (",C.table.maxSeats," max)"]})]},t.id))]}):null,O?(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(o.T,{size:14,colour:j.colours.muted,children:"Course / status"}),(0,p.jsx)(o.Row,{wrap:!0,gap:6,children:b.STAGES.map(t=>(0,p.jsx)(o.Chip,{label:b.STATUS[t].label,selected:C.status===t,onPress:()=>M.setLive(e,l,{stage:t})},t))}),(0,p.jsxs)(o.Row,{wrap:!0,gap:8,children:[A?(0,p.jsx)(o.Button,{kind:"secondary",label:"Move party\u2026",onPress:()=>{T(),k(l)},testID:"move-party"}):null,(0,p.jsx)(o.Button,{kind:"success",label:"Clear table",testID:"clear-table",onPress:async()=>{A&&await u.repo.bookings.setStatus(A.id,'finished'),M.setLive(e,l,{stage:void 0,dirty:!0}),T()}})]})]}):null,'dirty'===C.status?(0,p.jsx)(o.Button,{kind:"success",label:"Mark clean \u2014 table free",onPress:()=>{M.setLive(e,l,{dirty:!1}),T()},testID:"mark-clean"}):null,(0,p.jsxs)(o.Row,{wrap:!0,gap:8,children:[(0,p.jsx)(o.Button,{kind:"secondary",label:'blocked'===C.status?'Unblock table':'Block table',onPress:()=>{M.setLive(e,l,{blocked:'blocked'!==C.status}),T()},testID:"block-table"}),(0,p.jsx)(o.Button,{kind:"ghost",label:C.note?'Edit note':'+ Note',onPress:()=>I(!z)}),A||C.next?(0,p.jsx)(o.Button,{kind:"ghost",label:"Guest details",onPress:()=>{T(),$(A??C.next)},testID:"guest-details"}):null]}),z?(0,p.jsxs)(o.Row,{gap:6,children:[(0,p.jsx)(r.default,{accessibilityLabel:"Table note",value:B,onChangeText:D,placeholder:"e.g. wobbly leg, high chair here",placeholderTextColor:"#7D776C",style:[o.styles.input,{flex:1}]}),(0,p.jsx)(o.Button,{small:!0,label:"Save",onPress:()=>{M.setLive(e,l,{note:B.trim()||void 0}),I(!1)}})]}):null,w?(0,p.jsx)(o.Muted,{children:"Privacy mode: names as initials; tap Guest details for notes and allergies (closes after 20 s)."}):null,x.joins.some(e=>e.tables.includes(l))?(0,p.jsxs)(o.Muted,{children:["Joins with ",x.joins.find(e=>e.tables.includes(l)).tables.filter(e=>e!==l).join(', ')," for bigger parties (book as ",x.joins.find(e=>e.tables.includes(l)).tables.join('+'),")."]}):null]})},_e.WaitlistPanel=function({rid:e,r:l,plan:h,view:f,todays:w,waiting:v,now:T,privacy:S,busy:k,onToast:$}){const[C,M]=(0,t.useState)(''),[z,I]=(0,t.useState)(2),B=(0,c.useFloor)(e=>e.smsLog);return(0,p.jsxs)(y,{title:`Waitlist (${v.length})`,right:(0,p.jsxs)(o.Muted,{children:["new party ~",(0,x.estimateWait)(v.length+1,l.settings.turnMins,k)," min"]}),testID:"waitlist-panel",children:[0===v.length?(0,p.jsx)(o.Muted,{children:"Nobody waiting."}):null,v.map((t,s)=>{const r=(0,b.suggestTable)(h,w,f,t.partySize,T,(0,b.turnFor)(t.partySize,l.settings.turnMins)),y=(0,x.estimateWait)(s+1,l.settings.turnMins,k),v=Math.max(0,(0,m.minsBetween)(new Date(t.joinedAt),T)),C=B.find(s=>s.rid===e&&s.text.includes(`#${t.number} `));return(0,p.jsxs)(a.default,{style:{backgroundColor:j.colours.surface2,borderRadius:10,padding:8,gap:4},children:[(0,p.jsxs)(o.Row,{style:{justifyContent:'space-between'},children:[(0,p.jsxs)(o.T,{weight:"semibold",children:["#",t.number," ",(0,i.pv)(t.name,S)," \xb7 ",t.partySize]}),(0,p.jsxs)(o.T,{size:12,colour:v>y?j.colours.amber:j.colours.muted,children:["waited ",v,"m \xb7 quoted ~",y,"m"]})]}),r?(0,p.jsxs)(o.T,{size:12,colour:r.clashes?j.colours.amber:j.colours.green,children:["Best table: ",r.table," (",r.why,")"]}):(0,p.jsx)(o.T,{size:12,colour:j.colours.amber,children:"No table big enough \u2014 join tables in the plan"}),(0,p.jsxs)(o.Row,{wrap:!0,gap:6,children:[(0,p.jsx)(o.Button,{small:!0,label:C||'notified'===t.status?'Re-send (demo)':'Table ready text (demo)',testID:`sms-${t.number}`,onPress:()=>{c.useFloor.getState().logSms(e,T.toISOString(),`#${t.number} ${t.partySize}: Your table at ${l.name} is ready.`),u.repo.waitlist.setStatus(t.id,'notified'),$(`DEMO \u2014 no text sent. Would say: "Your table at ${l.name} is ready."`)}}),r?(0,p.jsx)(o.Button,{small:!0,kind:"success",label:`Seat at ${r.table}`,onPress:async()=>{await u.repo.waitlist.setStatus(t.id,'seated'),await u.repo.bookings.seatWalkIn(e,t.partySize,r.table,`From waitlist #${t.number}`),(0,n.resetTableLive)(e,r.table),$(`Waitlist #${t.number} seated at ${r.table}`)}}):null,(0,p.jsx)(o.Button,{small:!0,kind:"ghost",label:"Remove",onPress:()=>u.repo.waitlist.setStatus(t.id,'removed')})]}),'notified'===t.status?(0,p.jsx)(o.Badge,{kind:"green",label:`Told table ready${C?` ${(0,m.hm)(new Date(C.at))}`:''} (demo)`}):null]},t.id)}),(0,p.jsxs)(o.Row,{gap:6,children:[(0,p.jsx)(r.default,{accessibilityLabel:"Waitlist name",placeholder:"Name for the waitlist",placeholderTextColor:"#7D776C",value:C,onChangeText:M,style:[o.styles.input,{flex:1,minWidth:0,width:40,paddingVertical:6}]}),(0,p.jsx)(s.default,{accessibilityLabel:"Waitlist party size",onPress:()=>I(e=>e>=8?1:e+1),style:{width:48,height:48,borderRadius:10,borderWidth:1,borderColor:j.colours.gold,alignItems:'center',justifyContent:'center'},children:(0,p.jsx)(o.T,{weight:"bold",colour:j.colours.gold,children:z})}),(0,p.jsx)(o.Button,{small:!0,label:"Add",disabled:C.trim().length<2,onPress:()=>{u.repo.waitlist.join(e,C.trim(),z),M('')}})]})]})},_e.PacePanel=function({r:e,fc:t,todays:s,now:l,walkInCount:r,staffOn:n,onSummary:i}){const u=r+s.filter(e=>['seated','finished'].includes(e.status)).reduce((e,t)=>e+t.partySize,0),c=l.getHours(),h=Math.round(t.hours.filter(e=>e.hour<c).reduce((e,t)=>e+t.covers,0)+(t.hours.find(e=>e.hour===c)?.covers??0)*(l.getMinutes()/60)),x=h?u/h:1,f=x>=1.1?j.colours.amber:x>=.85?j.colours.green:j.colours.blue,w=Array.from({length:8},(e,t)=>{const r=(0,m.addMins)(l,15*(t-4)-l.getMinutes()%15),a=(0,m.addMins)(r,15),o=s.filter(e=>!['cancelled','noshow'].includes(e.status)).filter(e=>{const t=(0,b.startOf)(e);return t>=r&&t<a}).reduce((e,t)=>e+t.partySize,0);return{from:r,covers:o,future:t>=4}}),v=Math.max(4,Math.round(e.settings.capacityPerHour/4)),T=Math.max(v,...w.map(e=>e.covers)),S=w.filter(e=>e.future&&e.covers>v),k=t.nextHour?.covers??0,$=Math.ceil(k/16);return(0,p.jsxs)(y,{title:"Pace & kitchen",right:(0,p.jsx)(o.Badge,{kind:"amber",label:"ESTIMATE"}),testID:"pace-panel",children:[(0,p.jsxs)(a.default,{testID:"pace-meter",accessibilityLabel:`Covers so far ${u} vs forecast ${h}`,style:{gap:4},children:[(0,p.jsxs)(o.Row,{style:{justifyContent:'space-between'},children:[(0,p.jsx)(o.T,{size:14,children:"Covers so far"}),(0,p.jsxs)(o.T,{weight:"bold",colour:f,children:[u," ",(0,p.jsxs)(o.T,{size:13,colour:j.colours.muted,children:["/ ~",h," forecast"]})]})]}),(0,p.jsx)(a.default,{style:{height:10,borderRadius:5,backgroundColor:'#2A2620',overflow:'hidden'},children:(0,p.jsx)(a.default,{style:{width:`${Math.min(100,75*x)}%`,height:10,borderRadius:5,backgroundColor:f}})}),(0,p.jsxs)(o.Muted,{children:[x>=1.1?'Ahead of forecast':x>=.85?'On pace':'Behind forecast'," \xb7 next hour ~",t.nextHour?`${t.nextHour.coversLow}\u2013${t.nextHour.coversHigh}`:0," covers"]})]}),(0,p.jsx)(o.T,{size:13,colour:j.colours.muted,children:"Covers seated per 15 min (last hour \xb7 next hour)"}),(0,p.jsx)(a.default,{testID:"kitchen-pacing",style:{flexDirection:'row',alignItems:'flex-end',gap:4,height:64},children:w.map((e,t)=>(0,p.jsxs)(a.default,{style:{flex:1,alignItems:'center',gap:2},children:[(0,p.jsx)(o.T,{size:10,colour:j.colours.muted,children:e.covers||''}),(0,p.jsx)(a.default,{style:{width:'80%',height:Math.max(2,e.covers/T*40),borderRadius:3,backgroundColor:e.covers>v?j.colours.red:e.future?'#6B5A3A':j.colours.gold}}),(0,p.jsx)(o.T,{size:9,colour:4===t?j.colours.gold:j.colours.muted,children:(0,m.hm)(e.from)})]},t))}),S.map(e=>(0,p.jsxs)(o.T,{size:13,colour:j.colours.amber,children:["\u26a0 Kitchen: ",e.covers," covers due ",(0,m.hm)(e.from),"\u2013",(0,m.hm)((0,m.addMins)(e.from,15))," (pace ~",v,") \u2014 stagger seating if you can."]},e.from.getTime())),$>n?(0,p.jsxs)(o.T,{size:13,colour:j.colours.amber,children:["\u26a0 Next hour ~",k," covers with ",n," on: about ",$-n," more on the floor suggested."]}):(0,p.jsxs)(o.T,{size:13,colour:j.colours.green,children:["Staffing looks OK for the next hour (",n," on)."]}),(0,p.jsx)(o.Button,{small:!0,kind:"secondary",label:"End-of-service summary",onPress:i,testID:"eos-open"})]})},_e.ServiceSummary=function({r:e,todays:t,orders:s,waitlistAll:l,walkInCount:r,onClose:a}){const n=t.filter(e=>['seated','finished'].includes(e.status)),i=n.reduce((e,t)=>e+t.partySize,0)+r,u=t.filter(e=>e.walkIn),h=t.filter(e=>'finished'===e.status&&e.seatedAt&&e.finishedAt).map(e=>(0,m.minsBetween)(new Date(e.seatedAt),new Date(e.finishedAt))),b=s.reduce((e,t)=>e+t.paid,0),x=(0,c.useFloor)(t=>t.smsLog.filter(t=>t.rid===e.id).length),j=(e,t)=>(0,p.jsxs)(o.Row,{style:{justifyContent:'space-between'},children:[(0,p.jsx)(o.T,{children:e}),(0,p.jsx)(o.T,{weight:"semibold",children:t})]},e);return(0,p.jsxs)(o.Sheet,{visible:!0,onClose:a,title:`End of service \xb7 ${e.name}`,maxWidth:560,testID:"eos-summary",children:[j('Covers served',String(i)),j('Bookings seated',`${n.filter(e=>!e.walkIn).length} of ${t.filter(e=>!e.walkIn&&'cancelled'!==e.status).length}`),j('Walk-ins',`${u.length} parties \xb7 ${u.reduce((e,t)=>e+t.partySize,0)+r} covers`),j('No-shows',String(t.filter(e=>'noshow'===e.status).length)),j('Average table time',h.length?`${Math.round(h.reduce((e,t)=>e+t,0)/h.length)} min`:'\u2014'),j('Waitlist seated',`${l.filter(e=>'seated'===e.status).length} (${l.filter(e=>'removed'===e.status).length} left)`),j('"Table ready" texts',`${x} (demo, none sent)`),j('Taken at the till/app',`${(0,f.gbp)(b)} (demo)`),(0,p.jsx)(o.Muted,{children:"Example data on this device. Nothing is sent anywhere."})]})},Object.defineProperty(_e,"isWeb",{enumerable:!0,get:function(){return v}}),Object.defineProperty(_e,"tablesOf",{enumerable:!0,get:function(){return c.tablesOf}});var t=_r(d[0]);_r(d[1]);var s=e(_r(d[2])),l=e(_r(d[3])),r=e(_r(d[4])),a=e(_r(d[5])),o=_r(d[6]),n=_r(d[7]),i=_r(d[8]),u=_r(d[9]),c=_r(d[10]),h=_r(d[11]),b=_r(d[12]),m=_r(d[13]),x=_r(d[14]),f=_r(d[15]),j=_r(d[16]),p=_r(d[17]);const y=({title:e,right:t,children:s,testID:l})=>(0,p.jsxs)(a.default,{testID:l,style:{backgroundColor:j.colours.surface,borderRadius:14,borderWidth:1,borderColor:j.colours.border,padding:10,gap:6},children:[(0,p.jsxs)(o.Row,{style:{justifyContent:'space-between'},children:[(0,p.jsx)(o.T,{weight:"semibold",colour:j.colours.gold,children:e}),t]}),s]});const w=e=>(0,p.jsxs)(a.default,{style:{gap:6},children:[(0,p.jsxs)(o.T,{size:18,weight:"semibold",children:[e.walkIn?`Walk-in ${e.ref}`:e.name.replace(' (example)','')," \xb7 ",e.partySize]}),(0,p.jsxs)(o.Muted,{children:[e.time," \xb7 ",e.table?`Table ${e.table}`:'No table'," \xb7 ",e.ref,e.tags?.length?` \xb7 ${e.tags.join(', ')}`:'',e.occasion?` \xb7 ${e.occasion}`:'']}),e.notes?(0,p.jsxs)(o.T,{children:["Notes: ",e.notes]}):(0,p.jsx)(o.Muted,{children:"No notes."}),e.allergies.length?(0,p.jsx)(a.default,{style:{backgroundColor:j.colours.redBg,borderRadius:8,padding:8},children:(0,p.jsxs)(o.T,{weight:"bold",colour:"#FFE3DF",children:["ALLERGY: ",e.allergies.map(e=>`${(0,h.allergenLabel)(e.allergen)} \u2014 ${(0,h.severityLabel)(e.severity)}`).join('; ')]})}):(0,p.jsx)(o.Muted,{children:"No allergies declared."}),(0,p.jsx)(o.Muted,{children:"Phone and email stay in the Managers app; the Display never shows them."})]});const v=!0},858,[12,104,245,133,255,109,790,851,856,796,864,791,852,795,848,793,797,6]);
|
customer-app/index.html
CHANGED
|
@@ -42,13 +42,13 @@
|
|
| 42 |
<noscript> You need to enable JavaScript to run this app. </noscript>
|
| 43 |
<!-- The root element for your Expo app. -->
|
| 44 |
<div id="root"><div id="cc-boot" style="position:fixed;inset:0;display:flex;align-items:center;justify-content:center;background:#0B0B0B"><img src="/customer-app/brand-logo.png" alt="The Anchorage" width="180" height="180"/></div></div>
|
| 45 |
-
<script src="/customer-app/_expo/static/js/web/__expo-metro-runtime-8c088df87a31e4e6accd81c554ec290d.js" defer></script><script src="/customer-app/_expo/static/js/web/__common-
|
| 46 |
<script>/* "Add to Home screen" hint for the Cover Charge web apps (injected into each app's index.html by tools/build_site.py).
|
| 47 |
Chrome/Edge/Samsung: an Install button (beforeinstallprompt). Huawei Browser, Chrome without an install prompt,
|
| 48 |
iPhone/iPad Safari: short menu steps. Shown once per app until dismissed; never inside the installed app. */
|
| 49 |
(function () {
|
| 50 |
var APP = 'The Anchorage', KEY = 'cc-install-hint:' + '/customer-app/';
|
| 51 |
-
var standalone = (window.matchMedia && matchMedia('(display-mode: standalone)').matches) || navigator.standalone === true;
|
| 52 |
if (standalone) return;
|
| 53 |
var bip = null, shown = false;
|
| 54 |
window.addEventListener('beforeinstallprompt', function (e) { e.preventDefault(); bip = e; if (shown) render(); });
|
|
|
|
| 42 |
<noscript> You need to enable JavaScript to run this app. </noscript>
|
| 43 |
<!-- The root element for your Expo app. -->
|
| 44 |
<div id="root"><div id="cc-boot" style="position:fixed;inset:0;display:flex;align-items:center;justify-content:center;background:#0B0B0B"><img src="/customer-app/brand-logo.png" alt="The Anchorage" width="180" height="180"/></div></div>
|
| 45 |
+
<script src="/customer-app/_expo/static/js/web/__expo-metro-runtime-8c088df87a31e4e6accd81c554ec290d.js" defer></script><script src="/customer-app/_expo/static/js/web/__common-f6f10cdb908fe43987a720e10bb9e0f5.js" defer></script><script src="/customer-app/_expo/static/js/web/entry-1c0e8f423517db12030897bf2de46a94.js" defer></script>
|
| 46 |
<script>/* "Add to Home screen" hint for the Cover Charge web apps (injected into each app's index.html by tools/build_site.py).
|
| 47 |
Chrome/Edge/Samsung: an Install button (beforeinstallprompt). Huawei Browser, Chrome without an install prompt,
|
| 48 |
iPhone/iPad Safari: short menu steps. Shown once per app until dismissed; never inside the installed app. */
|
| 49 |
(function () {
|
| 50 |
var APP = 'The Anchorage', KEY = 'cc-install-hint:' + '/customer-app/';
|
| 51 |
+
var standalone = (window.matchMedia && (matchMedia('(display-mode: standalone)').matches || matchMedia('(display-mode: fullscreen)').matches)) || navigator.standalone === true || /CoverChargeTablet/.test(navigator.userAgent);
|
| 52 |
if (standalone) return;
|
| 53 |
var bip = null, shown = false;
|
| 54 |
window.addEventListener('beforeinstallprompt', function (e) { e.preventDefault(); bip = e; if (shown) render(); });
|
customer-app/sw.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
| 1 |
// The Anchorage service worker: precache the app shell so it opens offline after the first visit.
|
| 2 |
-
const V = "cc-customer-
|
| 3 |
const BASE = "/customer-app/";
|
| 4 |
-
const PRECACHE = ["/customer-app/_expo/static/js/web/+not-found-da8ea3ec55bebb0779db542f35c6adf9.js", "/customer-app/_expo/static/js/web/[did]-91eaf603d23bc2b2b79e4e95467ef972.js", "/customer-app/_expo/static/js/web/[n]-e07421962f3951aaf0f9cdf16bfbce72.js", "/customer-app/_expo/static/js/web/[oid]-7361f660100e238663b52e4e1fc71efc.js", "/customer-app/_expo/static/js/web/[section]-11e4dec81ff7b7cd85a190186e1ec965.js", "/customer-app/_expo/static/js/web/__common-
|
| 5 |
// Hugging Face serves large files (fonts) through a redirect to its CDN. Browsers refuse to hand a *redirected* cached
|
| 6 |
// response to a page, so store a plain copy instead (otherwise fonts, and so the app, fail to load offline).
|
| 7 |
const plain = r => r.redirected ? r.blob().then(b => new Response(b, { status: 200, headers: { 'Content-Type': r.headers.get('Content-Type') || b.type || 'application/octet-stream' } })) : Promise.resolve(r);
|
|
|
|
| 1 |
// The Anchorage service worker: precache the app shell so it opens offline after the first visit.
|
| 2 |
+
const V = "cc-customer-fb50d4dd0c";
|
| 3 |
const BASE = "/customer-app/";
|
| 4 |
+
const PRECACHE = ["/customer-app/_expo/static/js/web/+not-found-da8ea3ec55bebb0779db542f35c6adf9.js", "/customer-app/_expo/static/js/web/[did]-91eaf603d23bc2b2b79e4e95467ef972.js", "/customer-app/_expo/static/js/web/[n]-e07421962f3951aaf0f9cdf16bfbce72.js", "/customer-app/_expo/static/js/web/[oid]-7361f660100e238663b52e4e1fc71efc.js", "/customer-app/_expo/static/js/web/[section]-11e4dec81ff7b7cd85a190186e1ec965.js", "/customer-app/_expo/static/js/web/__common-f6f10cdb908fe43987a720e10bb9e0f5.js", "/customer-app/_expo/static/js/web/__expo-metro-runtime-8c088df87a31e4e6accd81c554ec290d.js", "/customer-app/_expo/static/js/web/_layout-72d1f9d242ed3df39e3595f80415e5c0.js", "/customer-app/_expo/static/js/web/basket-7e40802cfccc7e1a593fc9dd94641696.js", "/customer-app/_expo/static/js/web/book-73d16fd431095875bb01cc0a0c784d3b.js", "/customer-app/_expo/static/js/web/demo-2aeda33db335ba3a45d18733444a4df6.js", "/customer-app/_expo/static/js/web/entry-1c0e8f423517db12030897bf2de46a94.js", "/customer-app/_expo/static/js/web/feedback-c3022e0683297c445b34cc46bbd3da7c.js", "/customer-app/_expo/static/js/web/gift-0647b216e00344da5b09e74268994259.js", "/customer-app/_expo/static/js/web/index-3ce55512f207e0f4e938fcea314e34d2.js", "/customer-app/_expo/static/js/web/index-42c772ae8e6fc8ffb457607b71499331.js", "/customer-app/_expo/static/js/web/index-74ed5e3887809c4259d725a2965aa3f3.js", "/customer-app/_expo/static/js/web/index-881bce8519f411b0e7328fa0ee1d4148.js", "/customer-app/_expo/static/js/web/index-93b1fb4a59822430dbc65ee63d8bd82a.js", "/customer-app/_expo/static/js/web/index-d66067b7a3fefef4ab21eabe87395720.js", "/customer-app/_expo/static/js/web/index-ddeb20887106bbdac6659359c0a93594.js", "/customer-app/_expo/static/js/web/index-e57a61ccf8b16e38bf91548a01cebbf1.js", "/customer-app/_expo/static/js/web/index-e93c25959d1ede6b9cf32cbe0805fe0b.js", "/customer-app/_expo/static/js/web/lost-e899dbdc482f3468b2e05f535e9c0241.js", "/customer-app/_expo/static/js/web/loyalty-d1b9579347eb30ae07e6c533a0b84f09.js", "/customer-app/_expo/static/js/web/merch-88b52c267bd3ca9a3422ea337662265a.js", "/customer-app/_expo/static/js/web/offers-5713ecb8599cec0ed78a8576c4b43692.js", "/customer-app/_expo/static/js/web/profile-86ef019a072354ddf929fc5c7e1c6542.js", "/customer-app/_expo/static/js/web/refer-81c419266ae8d02761be62f17cc198c0.js", "/customer-app/_expo/static/js/web/waitlist-b490af7ba5840b0a9602d6761ffdc63a.js", "/customer-app/_expo/static/js/web/whatson-7bba1c8989b9be2fc455c8ddd8bbc99d.js", "/customer-app/apple-touch-icon.png", "/customer-app/assets/assets/brand/anchorage-hero.0450b828e4f9c1f4456240096598f6f5.png", "/customer-app/assets/assets/brand/anchorage.fea5ce2f6fd18bf2950aa21c0980ed8e.png", "/customer-app/assets/assets/brand/brae.8de9e89ac30966c6669de990370d8e40.png", "/customer-app/assets/assets/brand/saltmarsh.84acbc30d810d7a1cd3bbeb7b62651e8.png", "/customer-app/assets/assets/specials/sample-chalkboard.e7b4e4450a8483d4219bc6a214158d8f.jpg", "/customer-app/assets/node_modules/@expo-google-fonts/poppins/400Regular/Poppins_400Regular.093ee89be9ede30383f39a899c485a82.ttf", "/customer-app/assets/node_modules/@expo-google-fonts/poppins/500Medium/Poppins_500Medium.bf59c687bc6d3a70204d3944082c5cc0.ttf", "/customer-app/assets/node_modules/@expo-google-fonts/poppins/600SemiBold/Poppins_600SemiBold.6f1520d107205975713ba09df778f93f.ttf", "/customer-app/assets/node_modules/@expo-google-fonts/poppins/700Bold/Poppins_700Bold.08c20a487911694291bd8c5de41315ad.ttf", "/customer-app/assets/node_modules/expo-router/assets/arrow_down.017bc6ba3fc25503e5eb5e53826d48a8.png", "/customer-app/assets/node_modules/expo-router/assets/error.d1ea1496f9057eb392d5bbf3732a61b7.png", "/customer-app/assets/node_modules/expo-router/assets/file.19eeb73b9593a38f8e9f418337fc7d10.png", "/customer-app/assets/node_modules/expo-router/assets/forward.d8b800c443b8972542883e0b9de2bdc6.png", "/customer-app/assets/node_modules/expo-router/assets/pkg.ab19f4cbc543357183a20571f68380a3.png", "/customer-app/assets/node_modules/expo-router/assets/react-navigation/elements/back-icon-mask.0a328cd9c1afd0afe8e3b1ec5165b1b4.png", "/customer-app/assets/node_modules/expo-router/assets/react-navigation/elements/back-icon.35ba0eaec5a4f5ed12ca16fabeae451d.png", "/customer-app/assets/node_modules/expo-router/assets/react-navigation/elements/clear-icon.c94f6478e7ae0cdd9f15de1fcb9e5e55.png", "/customer-app/assets/node_modules/expo-router/assets/react-navigation/elements/clear-icon.c94f6478e7ae0cdd9f15de1fcb9e5e55@2x.png", "/customer-app/assets/node_modules/expo-router/assets/react-navigation/elements/clear-icon.c94f6478e7ae0cdd9f15de1fcb9e5e55@3x.png", "/customer-app/assets/node_modules/expo-router/assets/react-navigation/elements/clear-icon.c94f6478e7ae0cdd9f15de1fcb9e5e55@4x.png", "/customer-app/assets/node_modules/expo-router/assets/react-navigation/elements/close-icon.808e1b1b9b53114ec2838071a7e6daa7.png", "/customer-app/assets/node_modules/expo-router/assets/react-navigation/elements/close-icon.808e1b1b9b53114ec2838071a7e6daa7@2x.png", "/customer-app/assets/node_modules/expo-router/assets/react-navigation/elements/close-icon.808e1b1b9b53114ec2838071a7e6daa7@3x.png", "/customer-app/assets/node_modules/expo-router/assets/react-navigation/elements/close-icon.808e1b1b9b53114ec2838071a7e6daa7@4x.png", "/customer-app/assets/node_modules/expo-router/assets/react-navigation/elements/search-icon.286d67d3f74808a60a78d3ebf1a5fb57.png", "/customer-app/assets/node_modules/expo-router/assets/sitemap.412dd9275b6b48ad28f5e3d81bb1f626.png", "/customer-app/assets/node_modules/expo-router/assets/unmatched.20e71bdf79e3a97bf55fd9e164041578.png", "/customer-app/brand-logo.png", "/customer-app/favicon.ico", "/customer-app/icon-192.png", "/customer-app/icon-512.png", "/customer-app/icon-maskable-512.png", "/customer-app/manifest.webmanifest", "/customer-app/index.html"];
|
| 5 |
// Hugging Face serves large files (fonts) through a redirect to its CDN. Browsers refuse to hand a *redirected* cached
|
| 6 |
// response to a page, so store a plain copy instead (otherwise fonts, and so the app, fail to load offline).
|
| 7 |
const plain = r => r.redirected ? r.blob().then(b => new Response(b, { status: 200, headers: { 'Content-Type': r.headers.get('Content-Type') || b.type || 'application/octet-stream' } })) : Promise.resolve(r);
|
display-app/_expo/static/js/web/__common-df70654cbb893ed0136989be426f3560.js
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
display-app/_expo/static/js/web/entry-e88a37b9f287e5c20e8736da03641cf7.js
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
display-app/_expo/static/js/web/index-93b1fb4a59822430dbc65ee63d8bd82a.js
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
display-app/_expo/static/js/web/index-d66067b7a3fefef4ab21eabe87395720.js
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return o}});var t=r(d[0]);r(d[1]);var n=r(d[2]),u=r(d[3]),c=r(d[4]);function o(){return(0,n.canShow)('display')?(0,c.jsx)(u.DisplayBoard,{}):(0,c.jsx)(t.Redirect,{href:n.ENTRY[n.APP_VARIANT]})}},777,[785,12,787,850,6]);
|
| 2 |
+
__d(function(g,_r,_i,_a,_m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.DisplayBoard=function(){const{width:e,height:Y}=(0,n.default)(),_=e>=1e3,q=(0,T.useOwner)(e=>e.site),K=(0,y.useRestaurant)(q),X=(0,y.useOrders)(q),J=(0,y.useBookings)(q),Q=(0,y.useWaitlist)(q),Z=(0,y.useEvents)(q),ee=(0,y.useRatings)(q),se=(0,y.useAudit)(q),le=(0,y.useStore)(e=>e.menu),te=(0,y.useStore)(e=>e.walkIns[q]??0),ae=(0,y.useStore)(e=>e.alertAcks),re=((0,y.useStore)(e=>e.customer),(0,y.useStore)(e=>e.skipMinutes)),oe=(0,y.useNow)(5e3),ne=(0,T.useOwner)(e=>e.staff),ie=(0,T.useOwner)(e=>e.attendance),de=(0,T.useOwner)(e=>e.shifts),ue=(0,T.useOwner)(e=>e.chat),[ce,ge]=(0,s.useState)(!0);l.default.useEffect(()=>{(0,$.ensureAttendance)((0,f.ymd)(oe),oe),(0,v.ensureChat)(oe)},[(0,f.ymd)(oe)]);const he=ie.filter(e=>e.in&&!e.out&&oe.getTime()-new Date(e.in).getTime()<72e6&&oe.getTime()>=new Date(e.in).getTime()),pe=he.length?he.map(e=>F(ne.find(s=>s.id===e.staffId)?.name)).filter(Boolean):['Duty Manager'],[me,be]=(0,s.useState)(null),xe=me&&pe.includes(me)?me:pe[0],[fe,je]=(0,s.useState)(''),[ye,we]=(0,s.useState)('2'),ke=(0,f.ymd)(oe),Te=(0,C.useFrontDoor)(ke,e>Y),ve=(0,B.useDisplaySettings)(q),Ce=ve.privacy,$e=(0,B.usePlan)(q),Be=(0,B.useFloor)(e=>e.live[q]),[Se,Re]=(0,s.useState)('floor'),[Pe,Me]=(0,s.useState)(''),[De,Ae]=(0,s.useState)(null),[Ie,Le]=(0,s.useState)(null),[ze,Ee]=(0,s.useState)(null),[He,Ne]=(0,s.useState)(!1),[We,Oe]=(0,s.useState)(null);l.default.useEffect(()=>{if(!We)return;const e=setTimeout(()=>Oe(null),4500);return()=>clearTimeout(e)},[We]);const Fe=(e,s)=>Ee({title:e,body:s}),Ve=e=>Fe(`Guest details \xb7 ${e.time}`,(0,E.bookingDetails)(e)),Ge=(0,s.useMemo)(()=>(0,p.forecastToday)(K,J,X,Z,oe),[K,J,X,Z,oe.getTime()/6e4|0]),Ue=J.filter(e=>e.date===ke).sort((e,s)=>e.time.localeCompare(s.time)),Ye=te+Ue.filter(e=>e.walkIn&&['seated','finished'].includes(e.status)).reduce((e,s)=>e+s.partySize,0),qe=Ue.filter(e=>!e.walkIn&&'cancelled'!==e.status).reduce((e,s)=>e+s.partySize,0),Ke=Q.filter(e=>'waiting'===e.status||'notified'===e.status).sort((e,s)=>e.number-s.number),Xe=X.filter(e=>!['collected','closed','cancelled'].includes(e.status)).sort((e,s)=>Number('new'===s.status)-Number('new'===e.status)||(e.slotTime??e.createdAt).localeCompare(s.slotTime??s.createdAt)),Je=X.filter(e=>['collected','closed'].includes(e.status)).length,Qe=(0,x.takeawaySlots)(K,X,oe),Ze=Ge.nextHour?Math.min(1.6,Math.max(.8,Ge.nextHour.covers/(.75*K.settings.capacityPerHour))):1,es=(e,s)=>!!(0,z.statusBlock)(e,s,(0,z.linkedBooking)(e,J)),ss=e=>{const s=(0,z.nextStep)(e,(0,z.linkedBooking)(e,J));return!(!s||'table'===s&&!['ready','served'].includes(e.status))},ls=Xe.filter(e=>e.allergies.length&&ss(e)),ts=Ue.filter(e=>e.allergies.length&&!e.allergyAck&&['confirmed','seated'].includes(e.status)&&!Xe.some(s=>s.allergies.length&&(0,z.linkedBooking)(s,[e]))),as=Xe.flatMap(e=>(0,b.readinessFor)(e,K,oe).map(s=>({...s,order:e}))),rs=as.filter(e=>'due'===e.state||'overdue'===e.state),os=as.filter(e=>'upcoming'===e.state).sort((e,s)=>e.due.getTime()-s.due.getTime()),ns=ee.filter(e=>e.stars<=2&&!ae[`rating:${e.id}`]),is=Xe.filter(e=>'new'===e.status&&!e.allergies.length&&(0,f.minsBetween)(new Date(e.createdAt),oe)>=0),ds=le.filter(e=>e.restaurantId===q&&e.soldOut),us=(se.filter(e=>'stamp'===e.kind||'giftcard'===e.kind).slice(0,4),ls.length+ts.length+rs.length+ns.length+is.length),cs=(0,s.useMemo)(()=>(0,S.floorView)($e,J,X,Be??{},oe,K.settings.turnMins),[$e,J,X,Be,oe.getTime()]),gs=$e.areas.some(e=>e.id===Pe)?Pe:$e.areas[0]?.id??'',hs=Object.fromEntries($e.areas.map(e=>{const s=$e.tables.filter(s=>s.areaId===e.id);return[e.id,`${s.filter(e=>'free'===cs[e.name]?.status).length}/${s.length} free`]})),ps=(0,I.hoursFor)(K,oe),ms=ps?(0,f.addMins)(ps.open,-ps.open.getMinutes()):new Date(`${ke}T12:00:00`),bs=ps?(0,f.addMins)(ps.close,120):new Date(`${ke}T23:00:00`),xs=async(e,s)=>{const l=cs[e]?.booking;if(!l||e===s)return;const t=cs[s]?.status;if(t&&!['free','soon'].includes(t))return void Oe('dirty'===t?`Table ${s} needs clearing first.`:`Table ${s} is ${S.STATUS[t].label.toLowerCase()} \u2014 pick a free table.`);await y.repo.bookings.update(l.id,{table:s});const a=Be?.[e]?.stage;B.useFloor.getState().setLive(q,s,{stage:a??'seated',dirty:!1}),B.useFloor.getState().setLive(q,e,{stage:void 0,dirty:!0}),Oe(`${(0,A.privName)(l,Ce)} moved Table ${e} \u2192 ${s}. Table ${e} needs clearing.`)},fs=e=>Fe(`Order ${e.ref} \xb7 details`,(0,W.jsxs)(o.default,{style:{gap:4},children:[(0,W.jsx)(u.T,{weight:"semibold",children:F(e.customerName)}),e.allergies.length?(0,W.jsxs)(u.T,{weight:"bold",colour:k.colours.red,children:["ALLERGY: ",e.allergies.map(e=>`${(0,h.allergenLabel)(e.allergen)} (${(0,h.severityLabel)(e.severity)})`).join(', ')]}):(0,W.jsx)(u.Muted,{children:"No allergies declared."}),e.lines.filter(e=>e.overridden).map((e,s)=>(0,W.jsxs)(u.T,{colour:k.colours.red,children:["OVERRIDE: ",e.name," contains ",e.contains.map(h.allergenLabel).join(', ')]},s)),e.lines.map((e,s)=>(0,W.jsxs)(u.T,{size:15,children:[e.qty,"\xd7 ",e.name,e.notes?` \xb7 \u201c${e.notes}\u201d`:'']},s))]})),js=Ge.hours,ys=Math.max(K.settings.capacityPerHour,...js.map(e=>e.coversHigh)),ws=(0,W.jsxs)(V,{title:`Bookings & waitlist \xb7 ${(0,f.niceDate)(oe)}`,right:(0,W.jsx)(u.Badge,{kind:"gold",label:`${qe} booked \xb7 ${Ye} walk-in covers`}),children:[0===Ue.length?(0,W.jsx)(u.Muted,{children:"No bookings today."}):null,Ue.map(e=>{const s='confirmed'===e.status&&(0,f.minsBetween)(new Date(`${e.date}T${e.time}:00`),oe)>15;return(0,W.jsxs)(o.default,{style:[u.styles.card,{padding:10,opacity:['finished','noshow','cancelled'].includes(e.status)?.5:1,borderColor:e.allergies.length?k.colours.red:s?k.colours.amber:k.colours.border}],children:[(0,W.jsxs)(u.Row,{style:{justifyContent:'space-between'},children:[(0,W.jsxs)(u.T,{weight:"semibold",children:[e.time," \xb7 ",Ce?`${(0,A.privName)(e,!0)} \xb7 ${e.partySize}`:(0,C.walkInLabel)(e)]}),(0,W.jsx)(u.Badge,{kind:'seated'===e.status?'green':'noshow'===e.status?'red':'neutral',label:'noshow'===e.status?'No-show':e.status})]}),(0,W.jsxs)(u.Muted,{children:[e.table?`Table ${e.table}`:e.walkIn?'Table to assign':'Table TBC',e.walkIn?` \xb7 ${e.ref}`:'','none'!==e.security?" \xb7 "+('deposit'===e.security?'Deposit':'Card saved'):'',e.notes?Ce?' \xb7 \u270e':` \xb7 ${e.notes}`:'']}),e.allergies.length&&Ce?(0,W.jsxs)(u.Row,{gap:6,children:[(0,W.jsx)(u.Badge,{kind:"red",label:"\u26a0 Allergy"}),(0,W.jsx)(u.Button,{small:!0,kind:"ghost",label:"Details",onPress:()=>Ve(e)})]}):null,e.allergies.length&&!Ce?(0,W.jsx)(u.Row,{wrap:!0,gap:4,children:e.allergies.map(e=>(0,W.jsx)(u.Badge,{kind:"red",label:`${(0,h.allergenLabel)(e.allergen)} \u2014 ${(0,h.severityLabel)(e.severity)}`},e.allergen))}):null,s?(0,W.jsx)(u.T,{size:13,colour:k.colours.amber,children:"Running late \u2014 15+ min past booking time"}):null,!e.table&&e.walkIn&&'seated'===e.status?(0,W.jsx)(u.Button,{label:"Assign table",onPress:()=>Te.assignTable(e)}):null,'confirmed'===e.status?(0,W.jsxs)(u.Row,{gap:6,children:[(0,W.jsx)(u.Button,{small:!0,label:"Seat",onPress:()=>y.repo.bookings.setStatus(e.id,'seated')}),(0,W.jsx)(u.Button,{small:!0,kind:"secondary",label:"No-show",onPress:()=>y.repo.bookings.setStatus(e.id,'noshow')})]}):'seated'===e.status?(0,W.jsx)(u.Button,{small:!0,kind:"secondary",label:"Finished",onPress:()=>y.repo.bookings.setStatus(e.id,'finished')}):null]},e.id)}),(0,W.jsxs)(u.Row,{style:{justifyContent:'space-between',marginTop:6},children:[(0,W.jsxs)(u.T,{weight:"semibold",colour:k.colours.gold,children:["Waitlist (",Ke.length,")"]}),(0,W.jsxs)(u.Muted,{children:["~",(0,j.estimateWait)(Ke.length+1,K.settings.turnMins,Ze)," min for a new party (est.)"]})]}),Ke.map((e,s)=>(0,W.jsxs)(o.default,{style:[u.styles.card,{padding:10}],children:[(0,W.jsxs)(u.Row,{style:{justifyContent:'space-between'},children:[(0,W.jsxs)(u.T,{weight:"semibold",children:["#",e.number," ",(0,A.pv)(e.name,Ce)," \xb7 ",e.partySize]}),(0,W.jsxs)(u.Muted,{children:["waiting ",(0,f.minsBetween)(new Date(e.joinedAt),oe)," min \xb7 est. ",(0,j.estimateWait)(s+1,K.settings.turnMins,Ze)," min"]})]}),'notified'===e.status?(0,W.jsx)(u.Badge,{kind:"green",label:"Notified \u2014 table ready"}):null,(0,W.jsxs)(u.Row,{gap:6,children:['waiting'===e.status?(0,W.jsx)(u.Button,{small:!0,kind:"secondary",label:"Notify",onPress:()=>y.repo.waitlist.setStatus(e.id,'notified')}):null,(0,W.jsx)(u.Button,{small:!0,label:"Seat",onPress:()=>y.repo.waitlist.setStatus(e.id,'seated')}),(0,W.jsx)(u.Button,{small:!0,kind:"ghost",label:"Remove",onPress:()=>y.repo.waitlist.setStatus(e.id,'removed')})]})]},e.id)),(0,W.jsxs)(u.Row,{gap:6,children:[(0,W.jsx)(r.default,{accessibilityLabel:"Waitlist name",placeholder:"Name for the waitlist",placeholderTextColor:"#7D776C",value:fe,onChangeText:je,style:[u.styles.input,{flex:1,paddingVertical:6}]}),(0,W.jsx)(r.default,{accessibilityLabel:"Party size",value:ye,onChangeText:we,keyboardType:"number-pad",style:[u.styles.input,{width:50,paddingVertical:6}]}),(0,W.jsx)(u.Button,{small:!0,label:"Add",disabled:fe.trim().length<2,onPress:()=>{y.repo.waitlist.join(q,fe.trim(),Math.max(1,Number(ye)||2)),je('')}})]})]}),ks=(0,W.jsxs)(V,{title:"Live orders & kitchen tickets",right:(0,W.jsxs)(u.Row,{gap:6,children:[(0,W.jsx)(u.Chip,{label:"Tickets",selected:ce,onPress:()=>ge(!0)}),(0,W.jsx)(u.Chip,{label:"Full orders",selected:!ce,onPress:()=>ge(!1)})]}),children:[(0,W.jsxs)(u.Muted,{children:[Xe.length," live \xb7 ",Je," done today"]}),0===Xe.length?(0,W.jsx)(u.Muted,{children:"No live orders."}):null,ce?(0,W.jsxs)(o.default,{style:{flexDirection:'row',flexWrap:'wrap',gap:8},children:[Xe.filter(e=>['new','acknowledged','preparing'].includes(e.status)).map(e=>{const s=Math.max(0,(0,f.minsBetween)(new Date(e.createdAt),oe)),l=s>=20?k.colours.red:s>=12?k.colours.amber:k.colours.green;return(0,W.jsxs)(o.default,{testID:`ticket-${e.ref}`,style:{width:210,backgroundColor:'#F4EFE3',borderRadius:6,padding:8,gap:3,borderTopWidth:6,borderTopColor:e.allergies.length?k.colours.red:l},children:[(0,W.jsxs)(u.Row,{style:{justifyContent:'space-between'},children:[(0,W.jsx)(u.T,{weight:"bold",colour:"#111",children:'table'===e.type?`TABLE ${e.tableNo}`:`TAKEAWAY ${e.slotTime?(0,f.hm)(new Date(e.slotTime)):''}`}),(0,W.jsxs)(u.T,{size:13,weight:"bold",colour:s>=20?'#B3261E':'#333',children:[s,"m"]})]}),(0,W.jsxs)(u.T,{size:12,colour:"#444",children:[e.ref," \xb7 ",e.status.toUpperCase()]}),e.allergies.length?(0,W.jsx)(o.default,{style:{backgroundColor:'#B3261E',borderRadius:4,padding:4},children:(0,W.jsxs)(u.T,{size:13,weight:"bold",colour:"#fff",children:["\u26a0 ",Ce?'ALLERGY \u2014 see details':e.allergies.map(e=>(0,h.allergenLabel)(e.allergen)).join(', ').toUpperCase()]})}):null,e.lines.map((e,s)=>(0,W.jsxs)(u.T,{size:15,weight:"semibold",colour:"#111",children:[e.qty,"\xd7 ",e.name,e.choices.length?` (${e.choices.join(', ')})`:'']},s)),e.lines.some(e=>e.notes)?(0,W.jsx)(u.T,{size:12,colour:"#444",children:Ce?'Notes \u2014 see details':`Notes: ${e.lines.filter(e=>e.notes).map(e=>e.notes).join(' \xb7 ')}`}):null,Ce&&(e.allergies.length||e.lines.some(e=>e.notes))?(0,W.jsx)(u.Button,{small:!0,kind:"secondary",label:"Details",onPress:()=>fs(e)}):null,e.allergies.length?(0,W.jsx)(L.AllergyChain,{o:e,me:xe,compact:!0}):null,'new'===e.status?(0,W.jsx)(u.Button,{small:!0,label:es(e,'acknowledged')?'Sign off allergy first':'Acknowledge',disabled:es(e,'acknowledged'),onPress:()=>y.repo.orders.setStatus(e.id,'acknowledged',xe)}):null,'acknowledged'===e.status?(0,W.jsx)(u.Button,{small:!0,label:"Start",onPress:()=>'takeaway'===e.type?y.repo.orders.acknowledgeReadiness(e.id,'cook',xe):y.repo.orders.setStatus(e.id,'preparing',xe)}):null,'preparing'===e.status?(0,W.jsx)(u.Button,{small:!0,kind:"success",label:'takeaway'===e.type?'Ready':'Food out',disabled:es(e,'takeaway'===e.type?'ready':'served'),onPress:()=>y.repo.orders.setStatus(e.id,'takeaway'===e.type?'ready':'served',xe)}):null]},e.id)}),Xe.filter(e=>['ready','served'].includes(e.status)).map(e=>(0,W.jsxs)(o.default,{style:{width:210,backgroundColor:k.colours.surface2,borderRadius:6,padding:8,gap:3,borderTopWidth:6,borderTopColor:k.colours.green},children:[(0,W.jsxs)(u.Row,{style:{justifyContent:'space-between'},children:[(0,W.jsx)(u.T,{weight:"bold",children:'table'===e.type?`Table ${e.tableNo}`:`Takeaway ${e.ref}`}),(0,W.jsx)(u.Badge,{kind:U(e.status),label:e.status.toUpperCase()})]}),(0,W.jsxs)(u.Muted,{children:[(0,A.pv)(e.customerName,Ce),'here'===e.customerSignal?' \xb7 CUSTOMER IS HERE':'']}),e.allergies.length?(0,W.jsx)(L.AllergyChain,{o:e,me:xe,compact:!0}):null,'ready'===e.status?(0,W.jsx)(u.Button,{small:!0,label:"Collected",testID:`collected-${e.ref}`,disabled:es(e,'collected'),onPress:()=>y.repo.orders.setStatus(e.id,'collected',xe)}):null,'served'===e.status?(0,W.jsx)(u.Button,{small:!0,kind:"secondary",label:"Paid at till",onPress:()=>y.repo.orders.payTable(e.id,{shares:99})}):null]},e.id))]}):null,ce?null:Xe.map(e=>{const s=e.allergies.length>0&&ss(e),l=e.lines.filter(e=>e.overridden),t=e.lines.filter(e=>e.contains.length||e.may.length);return(0,W.jsxs)(o.default,{testID:`order-${e.ref}`,style:[u.styles.card,{padding:10,borderColor:s?k.colours.red:'ready'===e.status?k.colours.green:k.colours.border,borderWidth:s?2:1}],children:[(0,W.jsxs)(u.Row,{style:{justifyContent:'space-between'},children:[(0,W.jsxs)(u.Row,{gap:6,children:[(0,W.jsx)(u.T,{weight:"bold",children:e.ref}),(0,W.jsx)(u.Badge,{kind:'takeaway'===e.type?'gold':'blue',label:'takeaway'===e.type?`Takeaway \xb7 ${e.slotTime?(0,f.hm)(new Date(e.slotTime)):''}`:`Table ${e.tableNo}`})]}),(0,W.jsx)(u.Badge,{kind:U(e.status),label:e.status.toUpperCase()})]}),(0,W.jsxs)(u.Muted,{children:[(0,A.pv)(e.customerName,Ce)," \xb7 ",(0,m.gbp)(e.subtotal)," \xb7 ",e.paid>=e.total?'Paid (demo)':e.paid>0?`Part paid ${(0,m.gbp)(e.paid)}`:'Unpaid \u2014 bill at end',e.customerSignal?" \xb7 "+('here'===e.customerSignal?'CUSTOMER IS HERE':'Customer on the way'):'']}),e.allergies.length&&Ce?(0,W.jsxs)(u.Row,{gap:6,children:[(0,W.jsx)(u.Badge,{kind:"red",label:s?'\u26a0 Allergy: sign-off needed':'\u26a0 Allergy (signed off)'}),(0,W.jsx)(u.Button,{small:!0,kind:"ghost",label:"Details",onPress:()=>fs(e)})]}):null,e.allergies.length&&!Ce?(0,W.jsxs)(o.default,{style:{backgroundColor:k.colours.redBg,borderRadius:8,padding:8,borderLeftWidth:5,borderLeftColor:k.colours.red},children:[(0,W.jsxs)(u.T,{weight:"bold",colour:"#FFE3DF",children:["ALLERGY: ",e.allergies.map(e=>`${(0,h.allergenLabel)(e.allergen)} (${(0,h.severityLabel)(e.severity)})`).join(', ')]}),l.length?(0,W.jsxs)(u.T,{size:14,weight:"semibold",colour:"#FFE3DF",children:["Customer OVERRODE block on: ",l.map(e=>`${e.name} [contains ${e.contains.map(h.allergenLabel).join(', ')}]`).join('; ')]}):null,t.filter(e=>!e.overridden&&e.may.length).map((e,s)=>(0,W.jsxs)(u.T,{size:14,colour:"#FFE2A8",children:["May contain: ",e.name," [",e.may.map(h.allergenLabel).join(', '),"]"]},s))]}):null,e.allergies.length?(0,W.jsx)(L.AllergyChain,{o:e,me:xe}):null,e.lines.map((e,s)=>(0,W.jsxs)(u.T,{size:15,children:[e.qty,"\xd7 ",e.name,e.choices.length?` \u2014 ${e.choices.join(', ')}`:'',e.notes?Ce?' \xb7 \u270e':` \xb7 \u201c${e.notes}\u201d`:'']},s)),(0,W.jsxs)(u.Row,{wrap:!0,gap:6,children:['new'===e.status?(0,W.jsx)(u.Button,{small:!0,label:es(e,'acknowledged')?'Sign off allergy first':'Acknowledge',disabled:es(e,'acknowledged'),onPress:()=>y.repo.orders.setStatus(e.id,'acknowledged',xe)}):null,'acknowledged'===e.status?(0,W.jsx)(u.Button,{small:!0,label:"Start preparing",onPress:()=>'takeaway'===e.type?y.repo.orders.acknowledgeReadiness(e.id,'cook',xe):y.repo.orders.setStatus(e.id,'preparing',xe)}):null,'preparing'===e.status&&'takeaway'===e.type?(0,W.jsx)(u.Button,{small:!0,kind:"success",label:"Mark ready (notify customer)",disabled:es(e,'ready'),onPress:()=>y.repo.orders.setStatus(e.id,'ready',xe)}):null,'preparing'===e.status&&'table'===e.type?(0,W.jsx)(u.Button,{small:!0,kind:"success",label:"Food out",disabled:es(e,'served'),onPress:()=>y.repo.orders.setStatus(e.id,'served',xe)}):null,'ready'===e.status?(0,W.jsx)(u.Button,{small:!0,label:"Collected",disabled:es(e,'collected'),onPress:()=>y.repo.orders.setStatus(e.id,'collected',xe)}):null,'served'===e.status?(0,W.jsx)(u.Button,{small:!0,kind:"secondary",label:"Paid at till",onPress:()=>y.repo.orders.payTable(e.id,{shares:99})}):null]})]},e.id)})]}),Ts=({colour:e,title:s,children:l})=>(0,W.jsxs)(o.default,{style:{backgroundColor:k.colours.surface2,borderRadius:10,padding:10,borderLeftWidth:6,borderLeftColor:e,gap:4},children:[(0,W.jsx)(u.T,{weight:"bold",colour:e,children:s}),l]}),vs={cook:'START COOKING',bag:'BAG IT',ready:'READY'},Cs=(0,W.jsxs)(V,{title:"Allergy & takeaway alerts",right:(0,W.jsx)(u.Badge,{kind:us?'red':'green',label:`${us} need action`}),children:[ls.map(e=>(0,W.jsxs)(Ts,{colour:k.colours.red,title:`ALLERGY \u2014 ${e.ref} ${'table'===e.type?`(Table ${e.tableNo})`:'(takeaway)'}`,children:[Ce?(0,W.jsx)(u.Button,{small:!0,kind:"secondary",label:"Show allergy details",onPress:()=>fs(e)}):(0,W.jsx)(u.T,{size:15,children:e.allergies.map(e=>`${(0,h.allergenLabel)(e.allergen)} \u2014 ${(0,h.severityLabel)(e.severity)}`).join('; ')}),Ce?null:e.lines.filter(e=>e.overridden).map((e,s)=>(0,W.jsxs)(u.T,{size:14,colour:k.colours.red,weight:"semibold",children:["OVERRIDE: ",e.name," contains ",e.contains.map(h.allergenLabel).join(', ')]},s)),(0,W.jsx)(L.AllergyChain,{o:e,me:xe,compact:!0})]},e.id)),ts.map(e=>(0,W.jsxs)(Ts,{colour:k.colours.red,title:`ALLERGY \u2014 booking ${e.time} ${(0,A.privName)(e,Ce)} (${e.partySize})`,children:[Ce?(0,W.jsx)(u.Button,{small:!0,kind:"secondary",label:"Show allergy details",onPress:()=>Ve(e)}):(0,W.jsx)(u.T,{size:15,children:e.allergies.map(e=>`${(0,h.allergenLabel)(e.allergen)} \u2014 ${(0,h.severityLabel)(e.severity)}`).join('; ')}),(0,W.jsx)(L.BookingAllergyChain,{b:e,me:xe})]},e.id)),rs.map(e=>(0,W.jsxs)(Ts,{colour:'overdue'===e.state?k.colours.red:k.colours.amber,title:`${vs[e.stage]} \u2014 ${e.order.ref} \xb7 pickup ${(0,f.hm)(new Date(e.order.slotTime))}${'overdue'===e.state?' \xb7 OVERDUE':''}`,children:[(0,W.jsx)(u.T,{size:14,children:e.detail}),(0,W.jsxs)(u.Muted,{children:["Due ",(0,f.hm)(e.due)," (slot \u2212 prep \u2212 ",K.settings.bufferMins," min buffer)",e.order.allergies.length?' \xb7 \u26a0 allergy order':'']}),'ready'===e.stage?(0,W.jsx)(u.Button,{small:!0,kind:"success",label:"Mark ready (notify customer)",onPress:()=>y.repo.orders.setStatus(e.orderId,'ready',xe)}):(0,W.jsx)(u.Button,{small:!0,label:'cook'===e.stage?'Started cooking':'Bagged & checked',disabled:es(e.order,'preparing'),onPress:()=>y.repo.orders.acknowledgeReadiness(e.orderId,e.stage,xe)})]},e.id)),is.map(e=>(0,W.jsx)(Ts,{colour:k.colours.amber,title:`New order ${e.ref} \u2014 not yet acknowledged`,children:(0,W.jsx)(u.Button,{small:!0,label:"Acknowledge",onPress:()=>y.repo.orders.setStatus(e.id,'acknowledged',xe)})},e.id)),ns.map(e=>(0,W.jsxs)(Ts,{colour:k.colours.red,title:`LOW RATING ${e.stars}/5 \u2014 ${e.context}`,children:[Ce?(0,W.jsx)(u.Button,{small:!0,kind:"secondary",label:"Show comment",onPress:()=>Fe(`Rating ${e.stars}/5`,(0,W.jsxs)(u.T,{children:[F(e.customerName),e.comment?`: \u201c${e.comment}\u201d`:'']}))}):(0,W.jsxs)(u.T,{size:15,children:[e.customerName,e.comment?`: \u201c${e.comment}\u201d`:'']}),(0,W.jsx)(u.Muted,{children:"Manager: speak to the guest while they\u2019re still here."}),(0,W.jsx)(u.Button,{small:!0,kind:"secondary",label:`Handled \u2014 ${xe}`,onPress:()=>y.repo.alerts.acknowledge(`rating:${e.id}`,xe)})]},e.id)),0===us?(0,W.jsx)(u.Muted,{children:"No alerts need action."}):null,os.length?(0,W.jsxs)(o.default,{style:{gap:4},children:[(0,W.jsx)(u.T,{weight:"semibold",colour:k.colours.gold,children:"Upcoming takeaway timings"}),os.slice(0,6).map(e=>(0,W.jsxs)(u.T,{size:14,children:[(0,f.hm)(e.due)," \xb7 ",vs[e.stage]," \xb7 ",e.order.ref," (pickup ",(0,f.hm)(new Date(e.order.slotTime)),")"]},e.id))]}):null,ds.length?(0,W.jsx)(Ts,{colour:k.colours.muted,title:"Sold out",children:(0,W.jsx)(u.T,{size:14,children:ds.map(e=>e.name).join(', ')})}):null,(0,W.jsxs)(o.default,{style:{gap:2,marginTop:6},children:[(0,W.jsx)(u.T,{weight:"semibold",colour:k.colours.gold,children:"Allergy log"}),Ce?(0,W.jsxs)(u.Muted,{children:[se.filter(e=>'allergy'===e.kind).length," entries today \u2014 full log in the Managers app (privacy mode)."]}):se.filter(e=>'allergy'===e.kind).slice(0,5).map(e=>(0,W.jsxs)(u.T,{size:13,colour:"#FFD9D4",children:[(0,f.hm)(new Date(e.at))," \xb7 ",e.text]},e.id))]})]}),$s=de.filter(e=>e.day===(0,$.weekday)(oe)&&!he.some(s=>s.staffId===e.staffId)&&60*e.start>60*oe.getHours()+oe.getMinutes()).sort((e,s)=>e.start-s.start),Bs=ue.filter(e=>'all'===e.ch&&!e.removed).sort((e,s)=>Number(!!s.pinned)-Number(!!e.pinned)||s.at.localeCompare(e.at)).slice(0,6),Ss=(0,W.jsxs)(o.default,{style:{flex:.8,gap:10},children:[(0,W.jsxs)(V,{title:"Who's on",right:(0,W.jsx)(u.Badge,{kind:"green",label:`${he.length} clocked in`}),children:[0===he.length?(0,W.jsx)(u.Muted,{children:"Nobody clocked in yet."}):null,he.map(e=>{const s=ne.find(s=>s.id===e.staffId),l=de.find(s=>s.staffId===e.staffId&&s.day===(0,$.weekday)(oe));return(0,W.jsxs)(u.Row,{style:{justifyContent:'space-between'},children:[(0,W.jsx)(N.StaffAvatar,{id:e.staffId,size:34}),(0,W.jsxs)(o.default,{style:{flex:1},children:[(0,W.jsx)(u.T,{weight:"semibold",children:F(s?.name)}),(0,W.jsxs)(u.Muted,{children:[s?.job,l?` \xb7 rota ${(0,$.fmtH)(l.start)}\u2013${(0,$.fmtH)(l.end)}`:'']})]}),(0,W.jsx)(u.Badge,{kind:"green",label:`in ${(0,f.hm)(new Date(e.in))}`})]},e.id)}),$s.map(e=>(0,W.jsxs)(u.Muted,{children:["Due in ",(0,$.fmtH)(e.start),": ",F(ne.find(s=>s.id===e.staffId)?.name)]},e.id))]}),(0,W.jsxs)(V,{title:"Staff announcements",right:(0,W.jsx)(u.Muted,{children:"All staff chat"}),children:[0===Bs.length?(0,W.jsx)(u.Muted,{children:"No announcements."}):null,Bs.map(e=>(0,W.jsxs)(o.default,{style:{gap:2,borderLeftWidth:3,borderLeftColor:e.pinned?k.colours.gold:k.colours.border,paddingLeft:8},children:[(0,W.jsxs)(u.T,{size:12,colour:e.pinned?k.colours.gold:k.colours.muted,children:[e.pinned?'\ud83d\udccc ':'','system'===e.from?'Cover Charge':F(ne.find(s=>s.id===e.from)?.name)," \xb7 ",(0,f.hm)(new Date(e.at))]}),(0,W.jsx)(u.T,{size:14,children:e.text??(e.photo?`Photo: ${e.photo.caption}`:'')})]},e.id)),(0,W.jsx)(u.Muted,{children:"Read-only on the display. Post from Cover Charge for Staff or Cover Charge for Managers."})]})]}),Rs=_||e>=900,Ps=(0,W.jsx)(E.WaitlistPanel,{rid:q,r:K,plan:$e,view:cs,todays:Ue,waiting:Ke,now:oe,privacy:Ce,busy:Ze,onToast:Oe}),Ms=(0,W.jsx)(E.PacePanel,{r:K,fc:Ge,todays:Ue,now:oe,walkInCount:te,staffOn:he.length||1,onSummary:()=>Ne(!0)}),Ds=s=>Rs?(0,W.jsx)(t.default,{style:{width:e>=1200?340:300,flexGrow:0},contentContainerStyle:{gap:10,paddingBottom:20},children:s}):(0,W.jsx)(o.default,{style:{gap:10},children:s}),As=(0,W.jsxs)(o.default,{style:{flex:1,flexDirection:Rs?'row':'column',gap:10,padding:12,paddingTop:6},children:[(0,W.jsxs)(o.default,{style:{flex:1,gap:6,minHeight:Rs?void 0:420},children:[(0,W.jsx)(E.ArrivalsStrip,{todays:Ue,now:oe,privacy:Ce}),(0,W.jsx)(P.AreaTabs,{plan:$e,area:gs,onPick:Me,counts:hs}),Ie?(0,W.jsxs)(u.Row,{gap:8,style:{backgroundColor:k.colours.goldTint,borderRadius:10,padding:8},children:[(0,W.jsxs)(u.T,{weight:"semibold",colour:k.colours.goldLight,style:{flex:1},children:["Moving the party from Table ",Ie,": tap the new table (or drag it there)."]}),(0,W.jsx)(u.Button,{small:!0,kind:"ghost",label:"Cancel",onPress:()=>Le(null)})]}):null,(0,W.jsx)(o.default,{style:{flex:1,minHeight:Rs?300:Math.min(520,.62*e)},children:(0,W.jsx)(R.FloorCanvas,{plan:$e,areaId:gs,mode:"live",fit:"contain",view:cs,privacy:Ce,sectionColours:!0,turnBase:K.settings.turnMins,highlight:Ie?[Ie]:void 0,onTap:e=>{Ie?(e.name!==Ie&&xs(Ie,e.name),Le(null)):Ae(e.name)},onDrop:(e,s)=>xs(e.name,s.name)})}),(0,W.jsx)(E.Legend,{})]}),Ds((0,W.jsxs)(W.Fragment,{children:[Ps,Ms]}))]}),Is=(0,W.jsxs)(o.default,{style:{flex:1,flexDirection:Rs?'row':'column',gap:10,padding:12,paddingTop:6},children:[(0,W.jsx)(o.default,{style:{flex:1,minHeight:420},children:(0,W.jsx)(M.Timeline,{plan:$e,bookings:Ue,now:oe,privacy:Ce,turnBase:K.settings.turnMins,t0:ms,t1:bs,onOpen:e=>{const s=(0,B.tablesOf)(e.table)[0];s&&cs[s]?Ae(s):Ve(e)}})}),Ds((0,W.jsx)(W.Fragment,{children:Ps}))]}),Ls=(0,W.jsxs)(t.default,{style:{flex:1},contentContainerStyle:{padding:12,gap:10,flexGrow:1},scrollEnabled:!_,children:[(0,W.jsxs)(u.Row,{wrap:!0,style:{gap:6},children:[(0,W.jsx)(u.Muted,{children:"Signing off as (who's on):"}),pe.map(e=>(0,W.jsx)(u.Chip,{label:e,selected:xe===e,onPress:()=>be(e)},e))]}),(0,W.jsxs)(o.default,{testID:"forecast-strip",style:{gap:8},children:[(0,W.jsxs)(u.Row,{wrap:!0,gap:8,style:{alignItems:'stretch'},children:[(0,W.jsx)(G,{label:"Next hour"+(Ge.nextHour?` \xb7 ${String(Ge.nextHour.hour).padStart(2,'0')}:00\u2013${String(Ge.nextHour.hour+1).padStart(2,'0')}:00`:''),badge:"Estimate",value:Ge.nextHour?`${Ge.nextHour.coversLow}\u2013${Ge.nextHour.coversHigh} covers`:Ge.open?'Kitchen closing':'Closed',sub:Ge.nextHour?`${Ge.nextHour.booked} booked + ~${Ge.nextHour.walkIns} walk-ins \xb7 ~${Ge.nextHour.takeaway} takeaway (${Ge.nextHour.takeawayPlaced} placed)`:void 0}),(0,W.jsx)(G,{label:"Rest of today",badge:"Estimate",value:Ge.open?`${Ge.restOfDay.low}\u2013${Ge.restOfDay.high} covers`:'\u2014',sub:Ge.open?`${Ge.restOfDay.booked} booked \xb7 ~${Ge.restOfDay.takeaway} takeaway orders \xb7 ${Ye} walk-in covers seated so far`:void 0}),(0,W.jsx)(G,{label:"Waitlist",value:`${Ke.length} part${1===Ke.length?'y':'ies'}`,sub:`${Ke.reduce((e,s)=>e+s.partySize,0)} covers \xb7 next wait ~${(0,j.estimateWait)(Ke.length+1,K.settings.turnMins,Ze)} min (est.)`}),(0,W.jsx)(G,{label:"Takeaway slots",value:K.settings.takeawayPaused?'PAUSED':`${Qe.filter(e=>!e.full).length} open`,sub:`Cap ${K.settings.slotCap} per ${K.settings.slotMinutes} min`,children:(0,W.jsxs)(u.Row,{gap:8,children:[(0,W.jsx)(a.default,{accessibilityLabel:"Pause takeaway slots",value:K.settings.takeawayPaused,onValueChange:e=>y.repo.restaurants.updateSettings(q,{takeawayPaused:e}),trackColor:{true:k.colours.redSolid,false:'#444'}}),(0,W.jsx)(u.T,{size:14,children:K.settings.takeawayPaused?'Resume':'Pause'})]})}),(0,W.jsx)(G,{label:"Walk-ins seated (today)",value:`${Ye} covers`,sub:"Use Walk-in above; or quick-count here without a table",children:(0,W.jsx)(u.Row,{gap:6,children:[1,2,4].map(e=>(0,W.jsx)(u.Button,{small:!0,kind:"secondary",label:`+${e}`,onPress:()=>y.repo.waitlist.addWalkIn(q,e)},e))})})]}),(0,W.jsxs)(u.Row,{wrap:!0,gap:12,style:{backgroundColor:k.colours.surface,borderRadius:12,padding:10,borderWidth:1,borderColor:k.colours.border,alignItems:'flex-end'},children:[(0,W.jsxs)(o.default,{style:{gap:2,flexBasis:340,flexGrow:1},children:[(0,W.jsxs)(u.Row,{gap:6,children:[(0,W.jsx)(u.T,{weight:"semibold",colour:k.colours.gold,children:"Forecast \u2014 suggested actions"}),(0,W.jsx)(u.Badge,{kind:"amber",label:"ESTIMATE"})]}),Ge.suggestions.map((e,s)=>(0,W.jsxs)(u.T,{size:14,children:["\u2022 ",e]},s)),(0,W.jsxs)(u.Muted,{children:[Ge.flags.length?`Calendar flags today: ${Ge.flags.join(', ')} \xb7 `:'',"Baseline v1: confirmed bookings + example weekday/hour averages + expected walk-ins (",Math.round(100*K.settings.walkInShare),"% share). ",w.EXAMPLE_ACCURACY,"."]})]}),(0,W.jsx)(u.Row,{gap:4,style:{alignItems:"flex-end"},children:js.map(e=>{const s=Ge.nextHour?.hour===e.hour;return(0,W.jsxs)(o.default,{style:{alignItems:'center',width:30},children:[(0,W.jsx)(u.T,{size:11,colour:k.colours.muted,children:e.covers}),(0,W.jsxs)(o.default,{style:{height:70,width:18,justifyContent:'flex-end',borderBottomWidth:1,borderColor:k.colours.border},children:[(0,W.jsx)(o.default,{style:{height:e.walkIns/ys*70,backgroundColor:s?k.colours.goldLight:'#6B5A3A'}}),(0,W.jsx)(o.default,{style:{height:e.booked/ys*70,backgroundColor:s?k.colours.gold:'#9C7C45'}})]}),(0,W.jsx)(u.T,{size:11,colour:s?k.colours.gold:k.colours.muted,children:e.hour})]},e.hour)})})]})]}),(0,W.jsxs)(o.default,{style:{flexDirection:_?'row':'column',gap:10,flex:_?1:void 0,minHeight:_?380:void 0},children:[ws,(0,W.jsx)(o.default,{style:{flex:1.5,gap:10},children:ks}),Cs,Ss]})]}),zs=(0,W.jsx)(t.default,{style:{flex:1},contentContainerStyle:{padding:12,gap:10},children:(0,W.jsx)(P.FloorEditor,{rid:q,compact:!Rs,maxH:Math.max(300,Y-330)})});return(0,W.jsxs)(i.SafeAreaView,{style:{flex:1,backgroundColor:k.colours.bg},children:[(0,W.jsxs)(u.Row,{wrap:!0,style:{paddingHorizontal:14,paddingVertical:6,gap:10,borderBottomWidth:1,borderBottomColor:k.colours.border},children:[(0,W.jsx)(c.RestaurantBrand,{rid:K.id,size:48,sub:"Display \xb7 Harbour View, Dunure"}),(0,W.jsx)(o.default,{style:{flex:1}}),Ce?(0,W.jsx)(u.Badge,{kind:"gold",label:"\ud83d\udd12 Privacy on"}):(0,W.jsx)(u.Badge,{kind:"amber",label:"Privacy off"}),us?(0,W.jsx)(H.default,{accessibilityRole:"button",accessibilityLabel:"Open alerts",onPress:()=>Re('board'),children:(0,W.jsx)(u.Badge,{kind:"red",label:`${us} alert${us>1?'s':''}`})}):(0,W.jsx)(u.Badge,{kind:"green",label:"All clear"}),(0,W.jsx)(u.T,{size:20,weight:"bold",colour:k.colours.gold,children:(0,f.hm)(oe)}),(0,W.jsx)(u.Muted,{children:(0,f.niceDate)(oe)}),(0,W.jsx)(u.Button,{small:!0,kind:"ghost",label:"Demo +15 min",onPress:()=>re(15)})]}),(0,W.jsxs)(o.default,{testID:"front-door-bar",style:{flexDirection:'row',gap:12,paddingHorizontal:14,paddingTop:8,paddingBottom:4},children:[(0,W.jsx)(u.Button,{label:"Walk-in",onPress:Te.openWalkIn,testID:"add-walkin",style:{flex:1,minHeight:72,borderRadius:18}}),(0,W.jsx)(u.Button,{label:"New booking",onPress:Te.openBooking,testID:"add-booking",style:{flex:1,minHeight:72,borderRadius:18}})]}),(0,W.jsxs)(u.Row,{style:{paddingHorizontal:14,paddingVertical:4,gap:6},children:[O.map(e=>{const s=Se===e.id;return(0,W.jsx)(H.default,{testID:`view-${e.id}`,accessibilityRole:"tab",accessibilityLabel:e.label,accessibilityState:{selected:s},onPress:()=>Re(e.id),style:{minHeight:48,paddingHorizontal:18,justifyContent:'center',borderRadius:12,borderBottomWidth:3,borderBottomColor:s?k.colours.gold:'transparent',backgroundColor:s?k.colours.goldTint:'transparent'},children:(0,W.jsx)(u.T,{weight:"semibold",colour:s?k.colours.goldLight:k.colours.muted,children:e.label})},e.id)}),(0,W.jsx)(o.default,{style:{flex:1}}),(0,W.jsx)(u.Badge,{kind:"gold",label:`${qe} booked \xb7 ${Ye} walk-in covers`})]}),'floor'===Se||'timeline'===Se?Rs?'floor'===Se?As:Is:(0,W.jsx)(t.default,{style:{flex:1},contentContainerStyle:{flexGrow:1},children:'floor'===Se?As:Is}):'plan'===Se?zs:Ls,Te.elements,De?(0,W.jsx)(E.TableSheet,{rid:q,name:De,view:cs,plan:$e,todays:Ue,now:oe,privacy:Ce,turnBase:K.settings.turnMins,onClose:()=>Ae(null),onWalkIn:e=>Te.openWalkInAt(e),onMove:e=>Le(e),onDetails:Ve}):null,ze?(0,W.jsx)(E.DetailsPanel,{title:ze.title,onClose:()=>Ee(null),children:ze.body}):null,He?(0,W.jsx)(E.ServiceSummary,{r:K,todays:Ue,orders:X,waitlistAll:Q,walkInCount:te,onClose:()=>Ne(!1)}):null,We?(0,W.jsx)(o.default,{testID:"floor-toast",pointerEvents:"none",style:{position:'absolute',left:0,right:0,bottom:24,alignItems:'center',zIndex:900},children:(0,W.jsx)(o.default,{style:{backgroundColor:k.colours.surface2,borderColor:k.colours.gold,borderWidth:1.5,borderRadius:14,paddingVertical:10,paddingHorizontal:16,maxWidth:640},children:(0,W.jsx)(u.T,{weight:"semibold",children:We})})}):null,(0,W.jsx)(D.Screensaver,{rid:q,idleMins:ve.idleMins,pinOn:ve.pinOn,pin:ve.pin,tonightCards:ve.tonightCards})]})};var s=_r(d[0]),l=e(s),t=e(_r(d[1])),a=e(_r(d[2])),r=e(_r(d[3])),o=e(_r(d[4])),n=e(_r(d[5])),i=_r(d[6]),u=_r(d[7]),c=_r(d[8]),h=_r(d[9]),p=_r(d[10]),m=_r(d[11]),b=_r(d[12]),x=_r(d[13]),f=_r(d[14]),j=_r(d[15]),y=_r(d[16]),w=_r(d[17]),k=_r(d[18]),T=_r(d[19]),v=_r(d[20]),C=_r(d[21]),$=_r(d[22]),B=_r(d[23]),S=_r(d[24]),R=_r(d[25]),P=_r(d[26]),M=_r(d[27]),D=_r(d[28]),A=_r(d[29]),I=_r(d[30]),L=_r(d[31]),z=_r(d[32]),E=_r(d[33]),H=e(_r(d[34])),N=_r(d[35]),W=_r(d[36]);const O=[{id:'floor',label:'Floor'},{id:'timeline',label:'Timeline'},{id:'board',label:'Board'},{id:'plan',label:'Edit plan'}],F=e=>(e??'').replace(' (example)','');function V({title:e,right:s,children:l,flex:a=1}){return(0,W.jsxs)(o.default,{style:{flex:a,backgroundColor:k.colours.surface,borderRadius:14,borderWidth:1,borderColor:k.colours.border,overflow:'hidden',minHeight:200},children:[(0,W.jsxs)(u.Row,{style:{justifyContent:'space-between',paddingHorizontal:12,paddingVertical:10,borderBottomWidth:1,borderBottomColor:k.colours.border,backgroundColor:k.colours.surface2},children:[(0,W.jsx)(u.T,{weight:"semibold",colour:k.colours.gold,children:e}),s]}),(0,W.jsx)(t.default,{contentContainerStyle:{padding:10,gap:10},children:l})]})}function G({label:e,value:s,sub:l,badge:t,children:a}){return(0,W.jsxs)(o.default,{style:{flex:1,minWidth:170,backgroundColor:k.colours.surface,borderRadius:12,padding:10,borderWidth:1,borderColor:k.colours.border,gap:2},children:[(0,W.jsxs)(u.Row,{style:{justifyContent:'space-between'},children:[(0,W.jsx)(u.T,{size:13,colour:k.colours.muted,weight:"medium",children:e}),t?(0,W.jsx)(u.Badge,{kind:"amber",label:t}):null]}),(0,W.jsx)(u.T,{size:24,weight:"bold",colour:k.colours.text,children:s}),l?(0,W.jsx)(u.T,{size:13,colour:k.colours.muted,children:l}):null,a]})}const U=e=>'new'===e?'red':'ready'===e?'green':'preparing'===e?'amber':'served'===e?'blue':'neutral'},850,[12,133,253,255,109,269,271,790,859,791,847,793,860,794,795,848,796,861,797,806,862,851,863,864,852,853,854,855,857,856,792,865,866,858,245,867,6]);
|
| 3 |
+
__d(function(g,_r,_i,_a,m,_e,_d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"TABLES",{enumerable:!0,get:function(){return x}}),_e.useTableNames=p,_e.resetTableLive=j,_e.useTableUse=k,Object.defineProperty(_e,"walkInLabel",{enumerable:!0,get:function(){return w}}),_e.TablePicker=C,_e.WalkInSheet=S,_e.AssignTableSheet=v,_e.UndoToast=I,_e.NewBookingSheet=P,_e.useFrontDoor=function(e,s){const[l,o]=(0,t.useState)(!1),[n,i]=(0,t.useState)(!1),[a,r]=(0,t.useState)(null),[d,u]=(0,t.useState)(null),c=(0,y.jsxs)(y.Fragment,{children:[l?(0,y.jsx)(S,{wide:s,initialTable:l.table,onClose:()=>o(!1),onSeated:r}):null,n?(0,y.jsx)(P,{wide:s,date:e,onClose:()=>i(!1)}):null,d?(0,y.jsx)(v,{booking:d,onClose:()=>u(null)}):null,a?(0,y.jsx)(I,{booking:a,onDone:()=>r(null)}):null]});return{openWalkIn:()=>o({}),openWalkInAt:e=>o({table:e}),openBooking:()=>i(!0),assignTable:u,elements:c}};var t=_r(_d[0]),s=e(t);_r(_d[1]);var l=e(_r(_d[2])),o=e(_r(_d[3])),n=e(_r(_d[4])),i=_r(_d[5]),a=_r(_d[6]),r=_r(_d[7]),d=_r(_d[8]),u=_r(_d[9]),c=_r(_d[10]),b=_r(_d[11]),h=_r(_d[12]),f=_r(_d[13]),y=_r(_d[14]);const x=Array.from({length:12},(e,t)=>String(t+1));function p(e){const t=(0,f.usePlan)(e);return t.areas.flatMap(e=>t.tables.filter(t=>t.areaId===e.id).map(e=>e.name))}function j(e,t){(0,f.tablesOf)(t).forEach(t=>f.useFloor.getState().setLive(e,t,{stage:'seated',dirty:!1}))}function k(e,t){const s=(0,r.useBookings)(e),l=(0,r.useOrders)(e),o=p(e),n=(0,f.useFloor)(t=>t.live[e])??{},i=(0,c.ymd)(t),a={};for(const e of o)a[e]=n[e]?.blocked?{busy:!0,label:'Blocked'}:n[e]?.dirty?{busy:!0,label:'Needs clearing'}:{busy:!1,label:'Free'};for(const e of s)if(e.date===i&&e.table)for(const s of(0,f.tablesOf)(e.table))if(a[s])if('seated'===e.status)a[s]={busy:!0,label:`${e.walkIn?'Walk-in':`${e.name.slice(0,1)}.`} \xb7 ${e.partySize}`};else if('confirmed'===e.status&&!a[s].busy){const l=(0,c.minsBetween)(t,new Date(`${e.date}T${e.time}:00`));l>=-15&&l<=90&&(a[s]={...a[s],soon:`Booked ${e.time}`})}for(const e of l)'table'===e.type&&e.tableNo&&a[e.tableNo]&&!['closed','cancelled','collected'].includes(e.status)&&!a[e.tableNo].busy&&(a[e.tableNo]={busy:!0,label:'Open order'});return a}const w=e=>e.walkIn?`Walk-in \xb7 ${e.partySize}`:`${e.name} \xb7 ${e.partySize}`;function C({use:e,value:t,onPick:s,big:o,best:i}){const a=Object.keys(e);return(0,y.jsx)(n.default,{style:{flexDirection:'row',flexWrap:'wrap',gap:8},testID:"table-picker",children:a.map(a=>{const r=e[a],d=t===a,u=!!i&&(0,f.tablesOf)(i)[0]===a&&!d;return(0,y.jsxs)(l.default,{accessibilityRole:"button",accessibilityLabel:`Table ${a}, ${r.busy?`in use (${r.label})`:r.soon?`free, ${r.soon}`:'free'}`,accessibilityState:{selected:d},onPress:()=>s(a),style:{width:o?92:64,minHeight:56,borderRadius:12,borderWidth:d?2.5:1.5,padding:6,alignItems:'center',justifyContent:'center',borderColor:d?b.colours.gold:r.busy?b.colours.red:b.colours.green,backgroundColor:d?b.colours.goldTint:r.busy?b.colours.redBg:b.colours.surface2},children:[(0,y.jsx)(h.T,{weight:"bold",size:18,colour:d?b.colours.goldLight:b.colours.text,children:a}),(0,y.jsx)(h.T,{size:11,colour:r.busy?'#FFD9D4':r.soon?'#FFE2A8':'#CFF3D7',center:!0,children:r.busy?'Blocked'===r.label||'Needs clearing'===r.label?r.label:'In use':r.soon??'Free'}),u?(0,y.jsx)(n.default,{testID:"best-table",style:{position:'absolute',top:-8,right:-6,backgroundColor:b.colours.gold,borderRadius:8,paddingHorizontal:5},children:(0,y.jsx)(h.T,{size:10,weight:"bold",colour:b.colours.onGold,children:"BEST"})}):null]},a)})})}const T=[1,2,3,4,5,6,7,8];function S({onClose:e,onSeated:d,wide:x,initialTable:p}){const{rid:w,r:S,now:v}=(0,a.useCtx)(15e3),I=k(w,v),[P,$]=(0,t.useState)(2),[D,F]=(0,t.useState)(!1),[R,W]=(0,t.useState)(p??null),B=(0,f.usePlan)(w),z=(0,r.useBookings)(w),M=s.default.useMemo(()=>{const e=Object.fromEntries(Object.entries(I).map(([e,t])=>[e,{status:t.busy?'seated':'free'}]));return(0,u.suggestTable)(B,z.filter(e=>e.date===(0,c.ymd)(v)),e,P,v,(0,u.turnFor)(P,S.settings.turnMins))?.table??null},[B,z,I,P,v.getTime()]),[N,O]=(0,t.useState)(!1),[A,L]=(0,t.useState)(''),E=(e,t=String(e),s=()=>{F(!1),$(e)})=>{const o='9+'===t?D:!D&&P===e;return(0,y.jsx)(l.default,{accessibilityRole:"button",accessibilityLabel:'9+'===t?'Party of 9 or more':`Party of ${e}`,accessibilityState:{selected:o},onPress:s,style:{width:x?64:60,height:x?64:56,borderRadius:14,borderWidth:2,borderColor:b.colours.gold,alignItems:'center',justifyContent:'center',backgroundColor:o?b.colours.gold:'transparent'},children:(0,y.jsx)(h.T,{weight:"bold",size:22,colour:o?b.colours.onGold:b.colours.gold,children:t})},t)},_=(0,y.jsxs)(h.Row,{gap:12,style:{justifyContent:'center'},children:[(0,y.jsx)(l.default,{accessibilityRole:"button",accessibilityLabel:"One fewer",onPress:()=>$(e=>Math.max(9,e-1)),style:{width:56,height:56,borderRadius:28,borderWidth:2,borderColor:b.colours.gold,alignItems:'center',justifyContent:'center'},children:(0,y.jsx)(h.T,{size:26,colour:b.colours.gold,children:"\u2212"})}),(0,y.jsx)(h.T,{weight:"bold",size:26,children:P}),(0,y.jsx)(l.default,{accessibilityRole:"button",accessibilityLabel:"One more",onPress:()=>$(e=>Math.min(40,e+1)),style:{width:56,height:56,borderRadius:28,borderWidth:2,borderColor:b.colours.gold,alignItems:'center',justifyContent:'center'},children:(0,y.jsx)(h.T,{size:26,colour:b.colours.gold,children:"+"})})]}),H=(0,y.jsxs)(n.default,{style:{gap:8,flex:x?1:void 0},children:[(0,y.jsx)(h.T,{weight:"semibold",children:"How many people?"}),(0,y.jsxs)(n.default,{style:{flexDirection:'row',flexWrap:'wrap',gap:8},testID:"walkin-party",children:[T.map(e=>E(e)),E(9,'9+',()=>{F(!0),$(e=>e>=9?e:9)})]}),D?_:null]}),U=(0,y.jsxs)(n.default,{style:{gap:8,flex:x?1.3:void 0},children:[(0,y.jsxs)(h.Row,{style:{justifyContent:'space-between'},children:[(0,y.jsxs)(h.T,{weight:"semibold",children:["Table ",(0,y.jsx)(h.T,{colour:b.colours.muted,size:14,children:"(optional)"})]}),R?(0,y.jsx)(h.Button,{small:!0,kind:"ghost",label:"Clear table",onPress:()=>W(null)}):null]}),(0,y.jsx)(C,{use:I,value:R,onPick:e=>W(R===e?null:e),big:x,best:M}),M&&!R?(0,y.jsxs)(h.Muted,{children:["Best fit for ",P,": Table ",M," (smallest free table, fewest clashes)."]}):null,'staff'!==i.APP_VARIANT?(0,y.jsx)(h.Muted,{children:"Using Wix Tables too? Also mark the table there; this prototype doesn't connect to it."}):null]});return(0,y.jsxs)(h.Sheet,{visible:!0,onClose:e,title:`Walk-in \xb7 ${(0,c.hm)(v)}`,maxWidth:x?900:void 0,testID:"walkin-sheet",children:[(0,y.jsx)(h.Button,{label:`Seat walk-in \xb7 ${P} ${1===P?'person':'people'}${R?` \xb7 Table ${R}`:''}`,onPress:async()=>{const t=await r.repo.bookings.seatWalkIn(w,P,R??void 0,A);j(w,R??void 0),d(t),e()},testID:"seat-walkin",style:{minHeight:56}}),x?(0,y.jsxs)(h.Row,{gap:16,style:{alignItems:'flex-start'},children:[H,U]}):(0,y.jsxs)(y.Fragment,{children:[H,U]}),N?(0,y.jsx)(o.default,{accessibilityLabel:"Walk-in note",placeholder:"Note (optional), e.g. high chair",placeholderTextColor:"#7D776C",value:A,onChangeText:L,style:h.styles.input,autoFocus:!0}):(0,y.jsx)(h.Button,{small:!0,kind:"ghost",label:"+ Add a note (optional)",onPress:()=>O(!0)}),(0,y.jsx)(h.Muted,{children:"No name needed. Seated now; counts in today's covers and the forecast."})]})}function v({booking:e,onClose:t}){const{rid:s,now:l}=(0,a.useCtx)(15e3),o=k(s,l);return(0,y.jsxs)(h.Sheet,{visible:!0,onClose:t,title:`Assign table \xb7 ${w(e)}`,testID:"assign-table-sheet",children:[(0,y.jsx)(C,{use:o,onPick:async l=>{await r.repo.bookings.assignTable(e.id,l),j(s,l),t()}}),(0,y.jsx)(h.Muted,{children:"Red tables are in use right now; you can still pick one (e.g. joining a table)."})]})}function I({booking:e,onDone:s}){return(0,t.useEffect)(()=>{const e=setTimeout(s,6e3);return()=>clearTimeout(e)},[e.id]),(0,y.jsx)(n.default,{testID:"walkin-toast",style:{position:'fixed',left:12,right:12,bottom:92,zIndex:1e3,alignItems:'center'},pointerEvents:"box-none",children:(0,y.jsxs)(h.Row,{gap:10,style:{backgroundColor:b.colours.surface2,borderColor:b.colours.gold,borderWidth:1.5,borderRadius:14,paddingVertical:8,paddingLeft:14,paddingRight:8,maxWidth:520,width:'100%',justifyContent:'space-between'},children:[(0,y.jsxs)(h.T,{weight:"semibold",style:{flex:1},children:[w(e)," seated \xb7 ",e.table?`Table ${e.table}`:'table to assign'," (",e.ref,")"]}),(0,y.jsx)(h.Button,{kind:"secondary",label:"Undo",onPress:()=>{r.repo.bookings.undoWalkIn(e.id),s()},testID:"undo-walkin"})]})})}function P({date:e,onClose:s,wide:l}){const{rid:o,r:n,now:i}=(0,a.useCtx)(6e4),u=(0,r.useBookings)(o),[b,f]=(0,t.useState)(''),[x,p]=(0,t.useState)(2),[j,k]=(0,t.useState)(null),[w,C]=(0,t.useState)(''),T=(0,c.parseYmd)(e),S=(0,d.bookingSlots)(n,T,t=>u.filter(s=>s.date===e&&s.time===t&&'cancelled'!==s.status&&!s.walkIn).reduce((e,t)=>e+t.partySize,0),x,e===(0,c.ymd)(i)?i:(0,c.addMins)(T,0));return(0,y.jsxs)(h.Sheet,{visible:!0,onClose:s,title:`New booking \xb7 ${(0,c.niceDate)(T)}`,maxWidth:l?760:void 0,testID:"booking-sheet",children:[(0,y.jsx)(h.Field,{label:"Name",value:b,onChangeText:f,placeholder:"e.g. Reid"}),(0,y.jsxs)(h.Row,{style:{justifyContent:'space-between'},children:[(0,y.jsx)(h.T,{children:"Party size"}),(0,y.jsx)(h.Stepper,{value:x,onChange:p,min:1,max:20,label:"party size"})]}),(0,y.jsx)(h.Row,{wrap:!0,gap:6,children:S.map(e=>(0,y.jsx)(h.Chip,{label:e.time,sub:`${e.left} left`,disabled:!e.available,selected:j===e.time,onPress:()=>k(e.time)},e.time))}),S.length?null:(0,y.jsx)(h.Muted,{children:"Closed on this day (per listed hours)."}),(0,y.jsx)(h.Field,{label:"Notes",value:w,onChangeText:C,placeholder:"e.g. high chair, window table"}),x>=n.settings.savedCardFromParty?(0,y.jsxs)(h.Muted,{children:["Parties of ",n.settings.savedCardFromParty,"+ need a saved card; the customer gets a link (demo, nothing is sent)."]}):null,(0,y.jsx)(h.Button,{label:"Save booking",disabled:b.trim().length<2||!j,onPress:()=>{r.repo.bookings.create({restaurantId:o,customerId:null,name:b.trim(),partySize:x,date:e,time:j,allergies:[],notes:w.trim(),security:x>=n.settings.savedCardFromParty?'saved-card':'none',depositPaid:0}),s()}})]})}},851,[12,104,245,255,109,787,863,796,794,852,795,797,790,864,6]);
|
| 4 |
+
__d(function(g,r,_i,_a,m,e,_d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"STATUS",{enumerable:!0,get:function(){return a}}),Object.defineProperty(e,"STAGES",{enumerable:!0,get:function(){return s}}),Object.defineProperty(e,"turnFor",{enumerable:!0,get:function(){return n}}),Object.defineProperty(e,"startOf",{enumerable:!0,get:function(){return l}}),Object.defineProperty(e,"durOf",{enumerable:!0,get:function(){return i}}),Object.defineProperty(e,"endOf",{enumerable:!0,get:function(){return o}}),e.clashes=function(a,s=90){const n=new Set,i=a.filter(t=>d(t)&&t.table);for(let a=0;a<i.length;a++)for(let d=a+1;d<i.length;d++){const c=i[a],u=i[d];(0,t.tablesOf)(c.table).some(a=>(0,t.tablesOf)(u.table).includes(a))&&(l(c)<o(u,s)&&l(u)<o(c,s)&&(n.add(c.id),n.add(u.id)))}return n},e.floorView=function(a,s,n,i,d,u=90){const h={},y=s.filter(t=>t.date===b(d));for(const s of a.tables){const a=i[s.name]??{},b=y.filter(a=>(0,t.tablesOf)(a.table).includes(s.name)),F=b.find(t=>'seated'===t.status),p=b.filter(t=>'confirmed'===t.status).sort((t,a)=>t.time.localeCompare(a.time)).find(t=>f(d,t)>=-20),O=p?Math.round(f(d,p)):void 0,S=n.find(t=>'table'===t.type&&t.tableNo===s.name&&!['closed','cancelled','collected'].includes(t.status));let v='free';a.blocked?v='blocked':F?v=a.stage??'seated':a.dirty?v='dirty':S?v=a.stage??'seated':p&&void 0!==O&&O<=45&&(v='soon');const A=F,T=A?.tags?.find(t=>'VIP'===t)??A?.tags?.find(t=>'Regular'===t)??(A?void 0:p?.tags?.[0]);h[s.name]={table:s,status:v,booking:A,next:p,nextIn:O,covers:A?.partySize??0,orderOnly:!A&&!!S,note:a.note,seatedMins:A?Math.max(0,Math.round((d.getTime()-l(A).getTime())/6e4)):void 0,freeAt:A?o(A,u):void 0,allergy:!!(A?.allergies.length||!A&&p?.allergies.length||S?.allergies.length),vip:T,occasion:A?.occasion??(A?void 0:p?.occasion??c(p?.notes))??c(A?.notes)}}return h},Object.defineProperty(e,"OCCASION_ICON",{enumerable:!0,get:function(){return u}}),e.suggestTable=function(a,s,n,i,c,u,f=90,b){const h=[...a.tables.map(t=>({name:t.name,seats:t.maxSeats,min:t.minSeats,parts:[t.name]})),...a.joins.map(t=>{const s=a.tables.filter(a=>t.tables.includes(a.name));return{name:t.tables.join('+'),seats:s.reduce((t,a)=>t+a.maxSeats,0),min:s.reduce((t,a)=>t+a.minSeats,0),parts:t.tables}})],y=c.getTime()+6e4*u;let F=null;for(const a of h){if(a.seats<i)continue;if(n&&a.parts.some(t=>['blocked'].includes(n[t]?.status)))continue;const u=!!n&&a.parts.some(t=>['seated','mains','dessert','bill','dirty'].includes(n[t]?.status)),h=s.filter(s=>s.id!==b&&d(s)&&(0,t.tablesOf)(s.table).some(t=>a.parts.includes(t))&&l(s).getTime()<y&&o(s,f).getTime()>c.getTime()).length,p=(u?1e3:0)+100*h+10*(a.seats-i)+(i<a.min?5:0)+15*(a.parts.length-1);(!F||p<F.score)&&(F={table:a.name,seats:a.seats,clashes:h+(u?1:0),score:p,why:`${a.seats} seats${h||u?`, ${h+(u?1:0)} clash`:', no clashes'}`})}return F?{table:F.table,seats:F.seats,clashes:F.clashes,why:F.why}:null};var t=r(_d[0]);const a={free:{label:'Free',colour:'#2F7D45',fg:'#E7FBEA'},soon:{label:'Reserved soon',colour:'#3C78B5',fg:'#EAF4FF'},seated:{label:'Seated',colour:'#CFA45F',fg:'#0B0B0B'},mains:{label:'Mains',colour:'#E08A2E',fg:'#0B0B0B'},dessert:{label:'Dessert',colour:'#A77BD0',fg:'#0B0B0B'},bill:{label:'Bill requested',colour:'#D9473A',fg:'#FFFFFF'},dirty:{label:'Needs clearing',colour:'#7A6F5E',fg:'#FFFFFF'},blocked:{label:'Blocked',colour:'#3A3A3A',fg:'#CFCFCF'}},s=['seated','mains','dessert','bill'],n=(t,a=90)=>Math.min(a+60,a+15*Math.max(0,Math.ceil((t-2)/2))),l=t=>'seated'===t.status&&t.seatedAt?new Date(t.seatedAt):new Date(`${t.date}T${t.time}:00`),i=(t,a=90)=>t.durationMins??n(t.partySize,a),o=(t,a=90)=>new Date(l(t).getTime()+6e4*i(t,a)),d=t=>!['cancelled','noshow','finished'].includes(t.status);const c=t=>t?/birthday/i.test(t)?'birthday':/anniversary/i.test(t)?'anniversary':void 0:void 0,u={birthday:'\ud83c\udf82',anniversary:'\ud83d\udc8d',celebration:'\ud83e\udd42'},f=(t,a)=>(new Date(`${a.date}T${a.time}:00`).getTime()-t.getTime())/6e4,b=t=>`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,'0')}-${String(t.getDate()).padStart(2,'0')}`},852,[864]);
|
| 5 |
+
__d(function(_g,r,_i,_a,m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"snap",{enumerable:!0,get:function(){return c}}),_e.FloorCanvas=function(e){const[x,f]=(0,t.useState)({w:0,h:0}),g=x.w?'width'===e.fit?Math.min(x.w/i.PLAN_W,e.maxH?e.maxH/i.PLAN_H:9):Math.min(x.w/i.PLAN_W,x.h/i.PLAN_H):0,v=e.plan.tables.filter(t=>t.areaId===e.areaId),[y,w]=(0,t.useState)(null),M=(0,t.useRef)(null),j=t=>e.plan.sections.find(e=>e.id===t.sectionId),R=t=>e.plan.joins.find(e=>e.tables.includes(t.name)),C=(t,o)=>({onStartShouldSetResponder:()=>!0,onMoveShouldSetResponder:()=>!0,onResponderTerminationRequest:()=>!1,onResponderGrant:e=>{M.current={x:e.nativeEvent.pageX,y:e.nativeEvent.pageY,id:t.id,kind:o}},onResponderMove:n=>{const i=M.current;if(!i)return;const s=n.nativeEvent.pageX-i.x,a=n.nativeEvent.pageY-i.y;Math.abs(s)+Math.abs(a)<6&&!y||('live'!==e.mode||e.onDrop&&e.view&&['seated','mains','dessert','bill'].includes(e.view[t.name]?.status)&&e.view[t.name]?.booking)&&w({id:t.id,dx:s,dy:a,kind:o})},onResponderRelease:n=>{const s=M.current;M.current=null;const a=n.nativeEvent.pageX-(s?.x??0),l=n.nativeEvent.pageY-(s?.y??0);if(w(null),Math.abs(a)+Math.abs(l)<6||!g)return void('move'===o&&e.onTap?.(t));const u=a/g,h=l/g;if('edit'===e.mode&&'move'===o)e.onMove?.(t,b(c(t.x+u,e.snapOn),0,i.PLAN_W-t.w),b(c(t.y+h,e.snapOn),0,i.PLAN_H-t.h));else if('edit'===e.mode&&'resize'===o)e.onResize?.(t,b(c(t.w+u,e.snapOn),50,400),b(c(t.h+h,e.snapOn),50,300));else if('live'===e.mode&&e.onDrop){const o=t.x+t.w/2+u,n=t.y+t.h/2+h,i=v.find(e=>e.id!==t.id&&o>=e.x-10&&o<=e.x+e.w+10&&n>=e.y-10&&n<=e.y+e.h+10);i&&e.onDrop(t,i)}}}),I=e=>e*g,k='width'===e.fit?i.PLAN_H*g||200:void 0;return(0,u.jsx)(n.default,{testID:"floor-canvas",onLayout:e=>f({w:e.nativeEvent.layout.width,h:e.nativeEvent.layout.height}),style:[{width:'100%',borderRadius:16,overflow:'hidden'},'contain'===e.fit?{flex:1}:{height:k}],children:g?(0,u.jsxs)(n.default,{style:{width:I(i.PLAN_W),height:I(i.PLAN_H),alignSelf:'center',backgroundColor:'#0F0E0C',borderRadius:16,borderWidth:1,borderColor:a.colours.border,overflow:'hidden'},children:['edit'===e.mode?Array.from({length:i.PLAN_W/(2*i.GRID)},(e,t)=>(0,u.jsx)(n.default,{style:{position:'absolute',left:I(t*i.GRID*2),top:0,bottom:0,width:1,backgroundColor:'#1E1B16'}},`v${t}`)):null,'edit'===e.mode?Array.from({length:i.PLAN_H/(2*i.GRID)},(e,t)=>(0,u.jsx)(n.default,{style:{position:'absolute',top:I(t*i.GRID*2),left:0,right:0,height:1,backgroundColor:'#1E1B16'}},`h${t}`)):null,e.plan.joins.map(e=>{const t=v.filter(t=>e.tables.includes(t.name));if(t.length<2)return null;const[o,i]=t,s=o.x+o.w/2,a=o.y+o.h/2,l=i.x+i.w/2,h=i.y+i.h/2,c=Math.hypot(l-s,h-a),b=Math.atan2(h-a,l-s);return(0,u.jsx)(n.default,{testID:`join-${e.tables.join('+')}`,style:{position:'absolute',left:I((s+l)/2-c/2),top:I((a+h)/2)-3,width:I(c),height:6,borderRadius:3,backgroundColor:'rgba(207,164,95,0.55)',transform:[{rotate:`${b}rad`}]}},e.id)}),v.map(t=>{const i=e.view?.[t.name],c=i?s.STATUS[i.status]:null,b=y?.id===t.id,x=b&&'resize'===y.kind?Math.max(50,t.w+y.dx/g):t.w,f=b&&'resize'===y.kind?Math.max(50,t.h+y.dy/g):t.h,v=b&&'move'===y.kind?t.x+y.dx/g:t.x,w=b&&'move'===y.kind?t.y+y.dy/g:t.y,M=e.selected===t.id||e.highlight?.includes(t.name),k=j(t),z='edit'===e.mode?'#2A2419':c.colour,$='edit'===e.mode?a.colours.text:c.fg,A='round'===t.shape||'stool'===t.shape?I(Math.min(x,f)/2):I('booth'===t.shape?22:12),S=I(Math.min(x,f))<64,T=Math.max(11,Math.min(22,I(Math.min(x,f))/4)),_='edit'===e.mode?`Table ${t.name}, ${t.shape}, ${t.minSeats}\u2013${t.maxSeats} seats${t.online?', bookable online':''}`:`Table ${t.name}, ${c.label}${void 0!==i?.seatedMins?`, seated ${i.seatedMins} min`:''}${i?.covers?`, ${i.covers} covers`:''}${void 0!==i?.nextIn&&'seated'!==i.status?`, next booking ${i.next?.time}`:''}`,E=void 0!==i?.seatedMins&&i.booking?Math.min(1.2,i.seatedMins/(i.booking.durationMins??(0,s.turnFor)(i.booking.partySize,e.turnBase))):null;return(0,u.jsxs)(o.default.Fragment,{children:[p({...t,w:x,h:f}).map((t,o)=>(0,u.jsx)(n.default,{pointerEvents:"none",style:[{position:'absolute',left:I(v+t.x)-Math.max(4,I(8)),top:I(w+t.y)-Math.max(4,I(8)),width:Math.max(8,I(16)),height:Math.max(8,I(16)),borderRadius:99,backgroundColor:'edit'===e.mode?'#5A4C33':'rgba(255,255,255,0.16)',borderWidth:1,borderColor:'edit'===e.mode?a.colours.gold:'rgba(255,255,255,0.25)'},h()]},o)),(0,u.jsxs)(n.default,{testID:`table-${t.name}`,accessibilityRole:"button",accessibilityLabel:_,...C(t,'move'),style:[{position:'absolute',left:I(v),top:I(w),width:I(x),height:I(f),borderRadius:A,backgroundColor:z,alignItems:'center',justifyContent:'center',padding:2,borderWidth:M?3:e.sectionColours&&k?2.5:1.5,borderColor:M?'#FFFFFF':e.sectionColours&&k?k.colour:'edit'===e.mode?a.colours.gold:'rgba(0,0,0,0.35)',borderTopWidth:'booth'===t.shape?I(18):void 0,transform:[{rotate:`${t.rot}deg`},{scale:b?1.06:1}],zIndex:b?50:1,opacity:b&&'live'===e.mode?.85:1,shadowColor:'#000',shadowOpacity:b?.6:.3,shadowRadius:b?14:6,cursor:'edit'===e.mode?'grab':'pointer',touchAction:'none'},b?null:h()],children:[(0,u.jsxs)(n.default,{style:{alignItems:'center',transform:[{rotate:-t.rot+"deg"}]},pointerEvents:"none",children:[(0,u.jsx)(l.T,{weight:"bold",size:T,colour:$,center:!0,children:t.name}),'edit'===e.mode?S?null:(0,u.jsxs)(l.T,{size:11,colour:a.colours.muted,center:!0,children:[t.minSeats,"\u2013",t.maxSeats,t.online?' \xb7 online':'']}):i?(0,u.jsxs)(u.Fragment,{children:['free'!==i.status||S?null:(0,u.jsxs)(l.T,{size:11,colour:$,center:!0,children:[t.minSeats,"\u2013",t.maxSeats," seats"]}),void 0!==i.seatedMins?(0,u.jsxs)(l.T,{size:12,weight:"semibold",colour:$,center:!0,children:[i.seatedMins,"m \xb7 ",i.covers,"\ud83d\udc65"]}):i.orderOnly?(0,u.jsx)(l.T,{size:11,colour:$,center:!0,children:"Open order"}):null,'soon'===i.status&&i.next?(0,u.jsxs)(l.T,{size:11,weight:"semibold",colour:$,center:!0,children:[i.next.time," \xb7 ",i.nextIn<=0?'due':`${i.nextIn}m`]}):null,'dirty'!==i.status||S?null:(0,u.jsx)(l.T,{size:11,colour:$,center:!0,children:"Clear"}),!S||i.allergy||i.vip?(0,u.jsxs)(l.T,{size:11,colour:$,center:!0,children:[i.allergy?'\u26a0':'',i.vip?'VIP'===i.vip?'\u2605':'\u2665':'',i.occasion?s.OCCASION_ICON[i.occasion]:'',i.note?'\u270e':'']}):null]}):null]}),k&&'live'===e.mode&&e.sectionColours&&!S?(0,u.jsx)(n.default,{pointerEvents:"none",style:{position:'absolute',top:3,right:6,backgroundColor:k.colour,borderRadius:6,paddingHorizontal:3},children:(0,u.jsx)(l.T,{size:9,weight:"bold",colour:"#0B0B0B",children:k.server})}):null,null===E||S?null:(0,u.jsx)(n.default,{pointerEvents:"none",style:{position:'absolute',left:'15%',right:'15%',bottom:5,height:4,borderRadius:2,backgroundColor:'rgba(0,0,0,0.25)'},children:(0,u.jsx)(n.default,{style:{width:`${Math.min(100,100*E)}%`,height:4,borderRadius:2,backgroundColor:E>=1?'#B3261E':'rgba(0,0,0,0.6)'}})}),R(t)&&'edit'===e.mode?(0,u.jsx)(n.default,{pointerEvents:"none",style:{position:'absolute',bottom:2,left:4},children:(0,u.jsx)(l.T,{size:10,colour:a.colours.gold,children:"\u26d3"})}):null]}),'edit'===e.mode&&e.selected===t.id?(0,u.jsx)(n.default,{testID:"resize-handle",accessibilityLabel:"Resize table",...C(t,'resize'),style:{position:'absolute',left:I(v+x)-14,top:I(w+f)-14,width:28,height:28,borderRadius:14,backgroundColor:a.colours.gold,borderWidth:2,borderColor:'#fff',zIndex:60,cursor:'nwse-resize',touchAction:'none'}}):null]},t.id)}),0===v.length?(0,u.jsx)(n.default,{style:{position:'absolute',left:0,right:0,top:'45%'},children:(0,u.jsxs)(l.T,{center:!0,colour:a.colours.muted,children:["No tables in this area yet",'edit'===e.mode?' \u2014 tap + Table':'',"."]})}):null]}):null})};var t=r(d[0]),o=e(t);r(d[1]);var n=e(r(d[2])),i=r(d[3]),s=r(d[4]),a=r(d[5]),l=r(d[6]),u=r(d[7]);const h=(e=250)=>({transitionProperty:'background-color, border-color, transform, left, top, width, height',transitionDuration:`${e}ms`}),c=(e,t=!0)=>t?Math.round(e/i.GRID)*i.GRID:Math.round(e),b=(e,t,o)=>Math.max(t,Math.min(o,e));function p(e){const t=Math.max(1,e.maxSeats),o=[];if('round'===e.shape||'stool'===e.shape){for(let n=0;n<t;n++){const i=2*Math.PI*n/t-Math.PI/2;o.push({x:e.w/2+Math.cos(i)*(e.w/2+11.2),y:e.h/2+Math.sin(i)*(e.h/2+11.2)})}return'stool'===e.shape?[]:o}if('booth'===e.shape){for(let n=0;n<t;n++)o.push({x:e.w*(n+.5)/t,y:e.h+9.6});return o}if('square'===e.shape&&t<=4){return[{x:e.w/2,y:-9.6},{x:e.w/2,y:e.h+9.6},{x:-9.6,y:e.h/2},{x:e.w+9.6,y:e.h/2}].slice(0,t)}const n=Math.ceil(t/2),i=t-n;for(let t=0;t<n;t++)o.push({x:e.w*(t+.5)/n,y:-9.6});for(let t=0;t<i;t++)o.push({x:e.w*(t+.5)/i,y:e.h+9.6});return o}},853,[12,104,109,864,852,797,790,6]);
|
| 6 |
+
__d(function(g,r,i,_a,m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.AreaTabs=p,_e.FloorEditor=function({rid:e,compact:s,maxH:j}){const f=(0,o.usePlan)(e),y=o.useFloor.getState,w=a=>y().setPlan(e,a),[k,S]=(0,a.useState)(f.areas[0]?.id??''),[T,R]=(0,a.useState)(null),[C,P]=(0,a.useState)(!0),[I,D]=(0,a.useState)(!1),[v,B]=(0,a.useState)(null),[z,M]=(0,a.useState)(''),[$,A]=(0,a.useState)(''),L=f.areas.some(e=>e.id===k)?k:f.areas[0]?.id??'',W=f.tables.find(e=>e.id===T)??null,_=a=>W&&y().updateTable(e,W.id,a),H=()=>{let e=1;const a=new Set(f.tables.map(e=>e.name));for(;a.has(String(e));)e++;return String(e)},F=(e,a)=>{for(let s=50;s+a<=o.PLAN_H;s+=50)for(let l=50;l+e<=o.PLAN_W;l+=50)if(!f.tables.some(t=>t.areaId===L&&l<t.x+t.w+25&&t.x<l+e+25&&s<t.y+t.h+25&&t.y<s+a+25))return{x:l,y:s};return{x:50,y:50}},N=e=>{if(!W||e.id===W.id)return;const a=f.joins.filter(a=>!a.tables.includes(W.name)&&!a.tables.includes(e.name)),s=Array.from(new Set([...f.joins.find(e=>e.tables.includes(W.name))?.tables??[W.name],...f.joins.find(a=>a.tables.includes(e.name))?.tables??[e.name]]));w({...f,joins:[...a,{id:(0,o.fid)('j'),tables:s}]}),D(!1),A(`Joined ${s.join('+')} \u2014 book it as one table.`)},V=W?f.joins.find(e=>e.tables.includes(W.name)):void 0,E=W&&f.tables.some(e=>e.id!==W.id&&e.name===W.name),q=W?(0,h.jsxs)(n.default,{testID:"table-tools",style:{gap:10,backgroundColor:c.colours.surface,borderRadius:14,borderWidth:1,borderColor:c.colours.border,padding:12},children:[(0,h.jsxs)(u.Row,{style:{justifyContent:'space-between'},children:[(0,h.jsxs)(u.T,{weight:"semibold",colour:c.colours.gold,children:["Table ",W.name]}),(0,h.jsx)(u.Button,{small:!0,kind:"ghost",label:"Done",onPress:()=>R(null)})]}),(0,h.jsxs)(u.Row,{gap:8,children:[(0,h.jsx)(u.T,{size:14,style:{width:90},children:"Name / no."}),(0,h.jsx)(t.default,{accessibilityLabel:"Table name",value:W.name,onChangeText:e=>_({name:e.replace(/[^A-Za-z0-9-]/g,'').slice(0,6)}),style:[u.styles.input,{flex:1,minWidth:0,width:40,paddingVertical:8}]})]}),E?(0,h.jsx)(u.T,{size:13,colour:c.colours.red,children:"Another table already uses this number."}):null,(0,h.jsx)(u.Row,{wrap:!0,gap:6,children:o.SHAPES.map(e=>(0,h.jsx)(u.Chip,{label:e.label,selected:W.shape===e.id,onPress:()=>_({shape:e.id,w:x[e.id][0],h:x[e.id][1],...'stool'===e.id?{minSeats:1,maxSeats:1}:{}})},e.id))}),(0,h.jsxs)(u.Row,{style:{justifyContent:'space-between'},children:[(0,h.jsx)(u.T,{size:14,children:"Min seats"}),(0,h.jsx)(u.Stepper,{value:W.minSeats,onChange:e=>_({minSeats:e,maxSeats:Math.max(e,W.maxSeats)}),min:1,max:20,label:"min seats"})]}),(0,h.jsxs)(u.Row,{style:{justifyContent:'space-between'},children:[(0,h.jsx)(u.T,{size:14,children:"Max seats"}),(0,h.jsx)(u.Stepper,{value:W.maxSeats,onChange:e=>_({maxSeats:e,minSeats:Math.min(e,W.minSeats)}),min:1,max:24,label:"max seats"})]}),(0,h.jsxs)(u.Row,{wrap:!0,gap:6,children:[(0,h.jsx)(u.Button,{small:!0,kind:"secondary",label:"\u27f2 15\xb0",accessibilityLabel:"Rotate left",onPress:()=>_({rot:(W.rot-15+360)%360})}),(0,h.jsx)(u.Button,{small:!0,kind:"secondary",label:"\u27f3 15\xb0",accessibilityLabel:"Rotate right",onPress:()=>_({rot:(W.rot+15)%360}),testID:"rotate-table"}),(0,h.jsx)(u.Button,{small:!0,kind:"secondary",label:"Bigger",onPress:()=>_({w:Math.min(400,W.w+25),h:Math.min(300,W.h+25)})}),(0,h.jsx)(u.Button,{small:!0,kind:"secondary",label:"Smaller",onPress:()=>_({w:Math.max(50,W.w-25),h:Math.max(50,W.h-25)})})]}),(0,h.jsxs)(u.Row,{wrap:!0,gap:6,children:[(0,h.jsx)(u.T,{size:14,style:{width:'100%'},children:"Area"}),f.areas.map(e=>(0,h.jsx)(u.Chip,{label:e.name,selected:W.areaId===e.id,onPress:()=>{_({areaId:e.id}),S(e.id)}},e.id))]}),f.sections.length?(0,h.jsxs)(u.Row,{wrap:!0,gap:6,children:[(0,h.jsx)(u.T,{size:14,style:{width:'100%'},children:"Server section"}),f.sections.map(e=>(0,h.jsx)(u.Chip,{label:`${e.name} (${e.server})`,selected:W.sectionId===e.id,onPress:()=>_({sectionId:e.id})},e.id))]}):null,(0,h.jsxs)(u.Row,{style:{justifyContent:'space-between'},children:[(0,h.jsxs)(n.default,{style:{flex:1},children:[(0,h.jsx)(u.T,{size:14,children:"Bookable online"}),(0,h.jsx)(u.Muted,{children:"For a later Wix Tables / booking-page mapping. Nothing is synced now."})]}),(0,h.jsx)(l.default,{accessibilityLabel:"Bookable online",value:W.online,onValueChange:e=>{_({online:e})},trackColor:{true:c.colours.gold,false:'#444'}})]}),(0,h.jsxs)(u.Row,{wrap:!0,gap:6,children:[(0,h.jsx)(u.Button,{small:!0,label:"Duplicate",onPress:()=>{if(!W)return;const a=F(W.w,W.h),s={...W,id:(0,o.fid)('t'),name:H(),x:a.x,y:a.y};y().addTable(e,s),R(s.id),A(`Duplicated as Table ${s.name}.`)},testID:"dup-table"}),V?(0,h.jsx)(u.Button,{small:!0,kind:"secondary",label:`Split ${V.tables.join('+')}`,onPress:()=>{w({...f,joins:f.joins.filter(e=>e.id!==V.id)}),A('Split back into separate tables.')},testID:"split-table"}):(0,h.jsx)(u.Button,{small:!0,kind:"secondary",label:I?'Tap a table to join\u2026':'Join with\u2026',onPress:()=>D(!I),testID:"join-table"}),(0,h.jsx)(u.Button,{small:!0,kind:"danger",label:"Delete",onPress:()=>B({kind:'table'}),testID:"delete-table"})]})]}):null,O=(0,h.jsx)(b.FloorCanvas,{plan:f,areaId:L,mode:"edit",fit:"width",maxH:j,selected:T,snapOn:C,highlight:V?.tables,onTap:e=>{I?N(e):R(e.id===T?null:e.id)},onMove:(a,s,l)=>y().updateTable(e,a.id,{x:s,y:l}),onResize:(a,s,l)=>y().updateTable(e,a.id,{w:s,h:l})}),G=f.areas.find(e=>e.id===L),J=Object.fromEntries(f.areas.map(e=>[e.id,String(f.tables.filter(a=>a.areaId===e.id).length)]));return(0,h.jsxs)(n.default,{style:{gap:10},testID:"floor-editor",children:[(0,h.jsx)(p,{plan:f,area:L,onPick:e=>{S(e),R(null)},counts:J}),(0,h.jsxs)(u.Row,{wrap:!0,gap:6,children:[(0,h.jsx)(u.Button,{label:"+ Table",onPress:()=>{const[a,s]=x.square,l=F(a,s),t={id:(0,o.fid)('t'),name:H(),areaId:L,shape:'square',minSeats:2,maxSeats:4,x:l.x,y:l.y,w:a,h:s,rot:0,online:!0,sectionId:f.sections[0]?.id};y().addTable(e,t),R(t.id),A(`Table ${t.name} added \u2014 drag it into place.`)},testID:"add-table",style:{minWidth:110}}),(0,h.jsxs)(u.Row,{gap:6,style:{paddingHorizontal:6},children:[(0,h.jsx)(l.default,{accessibilityLabel:"Snap to grid",value:C,onValueChange:P,trackColor:{true:c.colours.gold,false:'#444'}}),(0,h.jsx)(u.T,{size:14,children:"Snap to grid"})]})]}),$?(0,h.jsx)(u.T,{size:13,colour:c.colours.goldLight,children:$}):null,s?(0,h.jsxs)(h.Fragment,{children:[O,q]}):(0,h.jsxs)(u.Row,{gap:12,style:{alignItems:'flex-start'},children:[(0,h.jsx)(n.default,{style:{flex:1},children:O}),q?(0,h.jsx)(n.default,{style:{width:320},children:q}):null]}),W?null:(0,h.jsx)(u.Muted,{children:"Tap a table to edit it; drag to move (snaps to the grid); drag the gold dot to resize."}),(0,h.jsxs)(n.default,{style:{gap:6,backgroundColor:c.colours.surface,borderRadius:14,borderWidth:1,borderColor:c.colours.border,padding:12},children:[(0,h.jsx)(u.T,{weight:"semibold",colour:c.colours.gold,children:"Areas"}),G?(0,h.jsxs)(u.Row,{gap:6,children:[(0,h.jsx)(u.T,{size:14,style:{width:90},children:"Rename"}),(0,h.jsx)(t.default,{accessibilityLabel:"Area name",value:G.name,onChangeText:e=>w({...f,areas:f.areas.map(a=>a.id===G.id?{...a,name:e.slice(0,24)}:a)}),style:[u.styles.input,{flex:1,minWidth:0,width:40,paddingVertical:8}]})]}):null,(0,h.jsxs)(u.Row,{gap:6,children:[(0,h.jsx)(t.default,{accessibilityLabel:"New area name",placeholder:"New area, e.g. Function room",placeholderTextColor:"#7D776C",value:z,onChangeText:M,style:[u.styles.input,{flex:1,minWidth:0,width:40,paddingVertical:8}]}),(0,h.jsx)(u.Button,{small:!0,label:"+ Area",disabled:z.trim().length<2,onPress:()=>{const e={id:(0,o.fid)('a'),name:z.trim()};w({...f,areas:[...f.areas,e]}),S(e.id),M(''),R(null)},testID:"add-area"})]}),(0,h.jsxs)(u.Row,{wrap:!0,gap:6,children:[(0,h.jsx)(u.Button,{small:!0,kind:"secondary",label:"Delete this area",disabled:f.areas.length<2,onPress:()=>B({kind:'area'}),testID:"delete-area"}),(0,h.jsx)(u.Button,{small:!0,kind:"ghost",label:"Reset to example layout",onPress:()=>B({kind:'reset'})})]}),(0,h.jsxs)(u.Muted,{children:[f.tables.length," tables \xb7 ",f.tables.reduce((e,a)=>e+a.maxSeats,0)," seats \xb7 ",f.tables.filter(e=>e.online).length," bookable online. Example layout made up for the demo; table numbers are the ones you'd match in Wix Tables later (not connected)."]})]}),v?(0,h.jsxs)(u.Sheet,{visible:!0,onClose:()=>B(null),title:'table'===v.kind?`Delete Table ${W?.name}?`:'area'===v.kind?`Delete ${G?.name}?`:'Reset the table plan?',testID:"confirm-sheet",children:[(0,h.jsx)(u.Muted,{children:'table'===v.kind?'It comes off the plan. Bookings keep their table number.':'area'===v.kind?`Its ${J[L]} table(s) move to ${f.areas.find(e=>e.id!==L)?.name}.`:'Puts back the example layout for this venue.'}),(0,h.jsxs)(u.Row,{gap:8,children:[(0,h.jsx)(u.Button,{kind:"danger",label:'reset'===v.kind?'Reset':'Delete',accessibilityLabel:'reset'===v.kind?'Reset':'Confirm delete',testID:"confirm-delete",onPress:()=>{if('table'===v.kind&&W&&(y().removeTable(e,W.id),R(null),A(`Table ${W.name} deleted.`)),'area'===v.kind){const e=f.areas.find(e=>e.id!==L);w({...f,areas:f.areas.filter(e=>e.id!==L),tables:f.tables.map(a=>a.areaId===L?{...a,areaId:e.id}:a)}),S(e.id)}'reset'===v.kind&&(y().resetPlan(e),R(null)),B(null)}}),(0,h.jsx)(u.Button,{kind:"secondary",label:"Cancel",onPress:()=>B(null)})]})]}):null]})};var a=r(d[0]),s=e(r(d[1])),l=e(r(d[2])),t=e(r(d[3])),n=e(r(d[4])),o=r(d[5]),c=r(d[6]),u=r(d[7]),b=r(d[8]),h=r(d[9]);const x={round:[100,100],square:[100,100],rect:[175,100],booth:[200,125],stool:[75,75]};function p({plan:e,area:a,onPick:l,counts:t}){return(0,h.jsx)(u.Row,{wrap:!0,gap:6,style:{alignItems:'center'},children:e.areas.map(e=>{const n=e.id===a;return(0,h.jsx)(s.default,{testID:`area-${e.id}`,accessibilityRole:"tab",accessibilityLabel:`Area ${e.name}`,accessibilityState:{selected:n},onPress:()=>l(e.id),style:{minHeight:48,paddingHorizontal:16,borderRadius:24,borderWidth:1.5,borderColor:n?c.colours.gold:c.colours.border,backgroundColor:n?c.colours.gold:c.colours.surface,justifyContent:'center'},children:(0,h.jsxs)(u.T,{weight:"semibold",size:15,colour:n?c.colours.onGold:c.colours.text,children:[e.name,t?.[e.id]?(0,h.jsxs)(u.T,{size:12,colour:n?c.colours.onGold:c.colours.muted,children:[" ",t[e.id]]}):null]})},e.id)})})}},854,[12,245,253,255,109,864,797,790,853,6]);
|
| 7 |
+
__d(function(_g,_r,_i,_a,m,_e,_d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"SLOT_W",{enumerable:!0,get:function(){return h}}),Object.defineProperty(_e,"ROW_H",{enumerable:!0,get:function(){return b}}),_e.Timeline=function({plan:e,bookings:p,now:y,privacy:x,onOpen:j,turnBase:v,t0:C,t1:k,height:w}){const M=(0,t.useMemo)(()=>[{key:'__none',area:'',name:'To assign'},...e.areas.flatMap(t=>e.tables.filter(e=>e.areaId===t.id).map(e=>({key:e.name,area:t.name,name:e.name})))],[e]),T=p.filter(e=>!['cancelled','noshow'].includes(e.status)),R=(0,t.useMemo)(()=>(0,s.clashes)(T,v),[T,v]),z=Math.ceil((k.getTime()-C.getTime())/9e5),$=e=>(e.getTime()-C.getTime())/9e5*h,[_,B]=(0,t.useState)(null),O=(0,t.useRef)(null),E=(0,t.useRef)(null);(0,t.useEffect)(()=>{const e=Math.max(0,$(y)-120);setTimeout(()=>E.current?.scrollTo({x:e,animated:!1}),50)},[]);const[S,W]=(0,t.useState)(''),D=(e,t)=>({onStartShouldSetResponder:()=>!0,onMoveShouldSetResponder:()=>!0,onResponderTerminationRequest:()=>!1,onResponderGrant:e=>{O.current={x:e.nativeEvent.pageX,y:e.nativeEvent.pageY}},onResponderMove:o=>{if(!O.current)return;const r=o.nativeEvent.pageX-O.current.x,n=o.nativeEvent.pageY-O.current.y;Math.abs(r)+Math.abs(n)>=6&&B({id:e.id,dx:r,dy:n,kind:t})},onResponderRelease:o=>{const r=O.current;O.current=null,B(null);const l=o.nativeEvent.pageX-(r?.x??0),d=o.nativeEvent.pageY-(r?.y??0);if(Math.abs(l)+Math.abs(d)<6)return void('move'===t&&j(e));const c=Math.round(l/h);if('stretch'===t){const t=Math.max(30,(0,s.durOf)(e,v)+15*c);return n.repo.bookings.update(e.id,{durationMins:t}),void W(`${(0,u.privName)(e,x)} now ${t} min`)}const f=M.findIndex(t=>t.key===((0,i.tablesOf)(e.table)[0]??'__none')),g=Math.max(0,Math.min(M.length-1,f+Math.round(d/b))),p={};c&&'confirmed'===e.status&&(p.time=(0,a.hm)((0,a.addMins)((0,s.startOf)(e),15*c))),g!==f&&'__none'!==M[g].key&&(p.table=M[g].key),p.time||p.table?(n.repo.bookings.update(e.id,p),W(`${(0,u.privName)(e,x)} \u2192 ${p.table?`Table ${p.table}`:''}${p.table&&p.time?' at ':''}${p.time??''}`)):c&&'confirmed'!==e.status&&W('Seated parties can move table, not time.')}}),I=$(y);return(0,c.jsxs)(r.default,{style:{flex:1,gap:6},testID:"timeline",children:[(0,c.jsxs)(d.Row,{style:{justifyContent:'space-between'},children:[(0,c.jsxs)(d.Row,{gap:8,children:[(0,c.jsx)(d.Badge,{kind:R.size?'red':'green',label:R.size?`${R.size} bookings clash`:'No clashes'}),(0,c.jsx)(d.Muted,{children:"Drag a booking to another table or time \xb7 drag its right edge to change the length"})]}),(0,c.jsx)(r.default,{testID:"clash-count",accessibilityLabel:`clashes ${R.size}`,children:(0,c.jsx)(d.T,{size:13,colour:l.colours.goldLight,children:S})})]}),(0,c.jsx)(r.default,{style:{flex:w?void 0:1,height:w,flexDirection:'row',borderRadius:14,borderWidth:1,borderColor:l.colours.border,overflow:'hidden',backgroundColor:'#0F0E0C'},children:(0,c.jsxs)(o.default,{style:{flex:1},contentContainerStyle:{flexDirection:'row'},children:[(0,c.jsxs)(r.default,{style:{width:f,borderRightWidth:1,borderColor:l.colours.border,backgroundColor:l.colours.surface},children:[(0,c.jsx)(r.default,{style:{height:30,justifyContent:'center',paddingLeft:8,borderBottomWidth:1,borderColor:l.colours.border},children:(0,c.jsx)(d.T,{size:12,colour:l.colours.muted,children:"Table"})}),M.map((e,t)=>(0,c.jsxs)(r.default,{style:{height:b,justifyContent:'center',paddingLeft:8,borderBottomWidth:1,borderColor:'#211E19',borderTopWidth:t>0&&M[t-1].area!==e.area?2:0,borderTopColor:l.colours.gold},children:[(0,c.jsx)(d.T,{size:14,weight:"semibold",children:'__none'===e.key?e.name:`T${e.name}`}),!e.area||0!==t&&M[t-1].area===e.area?null:(0,c.jsx)(d.T,{size:10,colour:l.colours.gold,children:e.area.toUpperCase()})]},e.key))]}),(0,c.jsx)(o.default,{ref:E,horizontal:!0,style:{flex:1},children:(0,c.jsxs)(r.default,{style:{width:z*h},children:[(0,c.jsx)(r.default,{style:{height:30,flexDirection:'row',borderBottomWidth:1,borderColor:l.colours.border},children:Array.from({length:Math.ceil(z/4)},(e,t)=>(0,c.jsx)(r.default,{style:{width:Math.min(4,z-4*t)*h,justifyContent:'center',borderLeftWidth:1,borderColor:l.colours.border},children:(0,c.jsx)(d.T,{size:11,colour:l.colours.muted,numberOfLines:1,style:{paddingLeft:3},children:(0,a.hm)((0,a.addMins)(C,60*t))})},t))}),M.map((e,t)=>{return(0,c.jsxs)(r.default,{testID:`tl-row-${e.key}`,style:{height:b,borderBottomWidth:1,borderColor:'#211E19',borderTopWidth:t>0&&M[t-1].area!==e.area?2:0,borderTopColor:'rgba(207,164,95,0.4)'},children:[Array.from({length:Math.ceil(z/4)},(e,t)=>(0,c.jsx)(r.default,{pointerEvents:"none",style:{position:'absolute',left:4*t*h,top:0,bottom:0,width:1,backgroundColor:'#1E1B16'}},t)),(o=e.key,T.filter(e=>'__none'===o?!e.table:(0,i.tablesOf)(e.table).includes(o))).map(e=>{const t=_?.id===e.id?_:null,o=$((0,s.startOf)(e))+('move'===t?.kind?t.dx:0),n=Math.max(h,(0,s.durOf)(e,v)/15*h+('stretch'===t?.kind?t.dx:0)),i=R.has(e.id);return(0,c.jsxs)(r.default,{testID:`tl-${e.id}`,accessibilityRole:"button",accessibilityLabel:`${(0,u.privName)(e,x)}, ${e.partySize}, ${(0,a.hm)((0,s.startOf)(e))}, ${(0,s.durOf)(e,v)} min${i?', clash':''}`,...D(e,'move'),style:[{position:'absolute',left:o,top:4+('move'===t?.kind?t.dy:0),width:n,height:36,borderRadius:8,backgroundColor:g(e),borderWidth:i?2.5:1,borderColor:i?'#FF6B5E':'rgba(0,0,0,0.4)',paddingHorizontal:6,justifyContent:'center',zIndex:t?40:2,opacity:'finished'===e.status?.55:1,cursor:'grab',touchAction:'none'},t?null:{transitionProperty:'left, width, top',transitionDuration:'200ms'}],children:[(0,c.jsxs)(d.T,{size:12,weight:"semibold",colour:'confirmed'===e.status?'#EAF4FF':'#0B0B0B',numberOfLines:1,children:[i?'\u26a0 ':'',(0,a.hm)((0,s.startOf)(e))," ",(0,u.privName)(e,x)," \xb7 ",e.partySize,e.allergies.length?' \u26a0':'']}),(0,c.jsx)(r.default,{testID:`tl-stretch-${e.id}`,accessibilityLabel:"Change length",...D(e,'stretch'),style:{position:'absolute',right:0,top:0,bottom:0,width:14,borderTopRightRadius:8,borderBottomRightRadius:8,backgroundColor:'rgba(0,0,0,0.25)',cursor:'ew-resize',touchAction:'none'}})]},e.id)})]},e.key);var o}),I>=0&&I<=z*h?(0,c.jsx)(r.default,{testID:"now-line",pointerEvents:"none",style:{position:'absolute',left:I,top:0,bottom:0,width:2,backgroundColor:l.colours.gold,zIndex:30},children:(0,c.jsx)(r.default,{style:{position:'absolute',top:0,left:-18,width:38,backgroundColor:l.colours.gold,borderRadius:6},children:(0,c.jsx)(d.T,{size:10,weight:"bold",colour:"#0B0B0B",center:!0,children:(0,a.hm)(y)})})}):null]})})]})})]})};var t=_r(_d[0]);_r(_d[1]);var o=e(_r(_d[2])),r=e(_r(_d[3])),n=_r(_d[4]),i=_r(_d[5]),s=_r(_d[6]),a=_r(_d[7]),l=_r(_d[8]),d=_r(_d[9]),u=_r(_d[10]),c=_r(_d[11]);const h=30,b=44,f=96,g=e=>'seated'===e.status?'#CFA45F':'finished'===e.status?'#3A352C':e.walkIn?'#B9925A':'#3C78B5'},855,[12,104,133,109,796,864,852,795,797,790,856,6]);
|
| 8 |
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"initials",{enumerable:!0,get:function(){return n}}),Object.defineProperty(e,"pv",{enumerable:!0,get:function(){return t}}),Object.defineProperty(e,"privName",{enumerable:!0,get:function(){return l}});const n=n=>n.replace(' (example)','').split(/\s+/).filter(Boolean).map(n=>`${n[0].toUpperCase()}.`).join(' '),t=(t,l)=>t?l?n(t):t.replace(' (example)',''):'',l=(n,l)=>n.walkIn?`Walk-in ${n.ref}`:t(n.name,l)},856,[]);
|
| 9 |
+
__d(function(g,r,_i,a,m,_e,_d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.Screensaver=function({rid:e,idleMins:n,pinOn:o,pin:i,tonightCards:u}){const[s,l]=(0,t.useState)(!1),[c,d]=(0,t.useState)(!1),[f,w]=(0,t.useState)(''),b=(0,t.useRef)(Date.now()),x=(0,t.useRef)(!1),R=(0,t.useRef)(0);x.current=s;const j=6e4*n;(0,t.useEffect)(()=>{if(!h)return;const e=e=>'pointerdown'===e.type||'touchstart'===e.type||'mousedown'===e.type||'keydown'===e.type,t=t=>{const n=performance.now();return x.current&&e(t)?(t.preventDefault(),t.stopPropagation(),t.stopImmediatePropagation?.(),R.current=n+800,x.current=!1,window.__ccWokeAt=n,l(!1),k.current&&d(!0),void(b.current=Date.now())):n<R.current&&['pointerup','mouseup','touchend','click','pointerdown','mousedown','touchstart'].includes(t.type)?(t.preventDefault(),t.stopPropagation(),void t.stopImmediatePropagation?.()):void(b.current=Date.now())},n=['pointerdown','pointerup','mousedown','mouseup','touchstart','touchend','click','keydown','wheel'];n.forEach(e=>window.addEventListener(e,t,{capture:!0,passive:!1}));const o=setInterval(()=>{!x.current&&!D.current&&Date.now()-b.current>=j&&(x.current=!0,l(!0))},1e3);return()=>{n.forEach(e=>window.removeEventListener(e,t,{capture:!0})),clearInterval(o)}},[j]);const k=(0,t.useRef)(o);k.current=o;const D=(0,t.useRef)(c);return D.current=c,(0,t.useEffect)(()=>{if(!h)return;let e=null;const t=async()=>{try{e=await(navigator.wakeLock?.request?.('screen')),window.__ccWakeLock=e?'on':'unsupported'}catch{window.__ccWakeLock='refused'}};t();const n=()=>{'visible'===document.visibilityState&&t()};return document.addEventListener('visibilitychange',n),()=>{document.removeEventListener('visibilitychange',n);try{e?.release?.()}catch{}}},[]),c?(0,p.jsx)(y,{pin:i,entry:f,setEntry:w,onOk:()=>{d(!1),w(''),b.current=Date.now()}}):s?(0,p.jsx)(v,{rid:e,tonightCards:u}):null};var t=r(_d[0]),n=e(r(_d[1])),o=e(r(_d[2])),i=e(r(_d[3]));r(_d[4]);var u=e(r(_d[5])),s=e(r(_d[6])),l=e(r(_d[7])),c=r(_d[8]),d=r(_d[9]),f=r(_d[10]),p=r(_d[11]);const h='undefined'!=typeof window;function w({w:e,h:i,seed:u}){const s=(0,t.useRef)(new n.default.Value(0)).current,l=e=>{const t=233280*Math.sin(9301*u+49297*e);return t-Math.floor(t)};(0,t.useEffect)(()=>{const e=n.default.loop(n.default.timing(s,{toValue:1,duration:9e3+9e3*l(1),delay:4e3*l(2),easing:o.default.linear,useNativeDriver:!1}));return e.start(),()=>e.stop()},[]);const d=3+5*l(3);return(0,p.jsx)(n.default.View,{pointerEvents:"none",style:{position:'absolute',left:l(4)*e,top:0,width:d,height:d,borderRadius:d,backgroundColor:c.colours.goldLight,shadowColor:c.colours.gold,shadowRadius:6,shadowOpacity:.9,opacity:s.interpolate({inputRange:[0,.15,.8,1],outputRange:[0,.85,.5,0]}),transform:[{translateY:s.interpolate({inputRange:[0,1],outputRange:[i+20,i*(.15+.3*l(5))]})},{translateX:s.interpolate({inputRange:[0,.5,1],outputRange:[0,60*(l(6)-.5),0]})}]}})}function y({pin:e,entry:t,setEntry:n,onOk:o}){const i=i=>{const u=(t+i).slice(0,4);n(u),4===u.length&&(u===e?o():setTimeout(()=>n(''),300))};return(0,p.jsxs)(s.default,{testID:"wake-pin",style:{position:h?'fixed':'absolute',left:0,right:0,top:0,bottom:0,zIndex:1e5,backgroundColor:'rgba(5,5,5,0.97)',alignItems:'center',justifyContent:'center',gap:16},children:[(0,p.jsx)(f.T,{size:22,weight:"semibold",colour:c.colours.gold,children:"Enter staff PIN"}),(0,p.jsxs)(f.T,{size:30,weight:"bold",children:['\u25cf'.repeat(t.length),'\u25cb'.repeat(4-t.length)]}),(0,p.jsx)(s.default,{style:{flexDirection:'row',flexWrap:'wrap',width:252,gap:12,justifyContent:'center'},children:['1','2','3','4','5','6','7','8','9','0'].map(e=>(0,p.jsx)(u.default,{accessibilityRole:"button",accessibilityLabel:`PIN ${e}`,onPress:()=>i(e),style:{width:72,height:72,borderRadius:36,borderWidth:2,borderColor:c.colours.gold,alignItems:'center',justifyContent:'center'},children:(0,p.jsx)(f.T,{size:26,colour:c.colours.gold,children:e})},e))})]})}function v({rid:e}){const{width:u,height:s}=(0,l.default)(),y=(0,t.useRef)({width:u,height:s});y.current={width:u,height:s};const v=(0,d.useBrand)(e),b=d.HERO_LOGOS[e]??v.logo,x=(0,t.useRef)(new n.default.Value(0)).current,R=(0,t.useRef)(new n.default.Value(0)).current,j=(0,t.useRef)(new n.default.ValueXY({x:0,y:0})).current;(0,t.useEffect)(()=>{n.default.timing(x,{toValue:1,duration:700,useNativeDriver:!1}).start();const e=n.default.loop(n.default.sequence([n.default.timing(R,{toValue:1,duration:14e3,easing:o.default.inOut(o.default.quad),useNativeDriver:!1}),n.default.timing(R,{toValue:0,duration:14e3,easing:o.default.inOut(o.default.quad),useNativeDriver:!1})]));e.start();const t=()=>n.default.timing(j,{toValue:{x:(Math.random()-.5)*y.current.width*.18,y:(Math.random()-.5)*y.current.height*.14},duration:6e3,easing:o.default.inOut(o.default.quad),useNativeDriver:!1}).start();t();const i=setInterval(t,2e4);return()=>{e.stop(),clearInterval(i)}},[]);const k=(0,t.useRef)(!0);(0,t.useEffect)(()=>{k.current?k.current=!1:n.default.timing(j,{toValue:{x:0,y:0},duration:500,easing:o.default.out(o.default.quad),useNativeDriver:!1}).start()},[u>s]);const D=.5*Math.min(u,s);return(0,p.jsxs)(n.default.View,{testID:"screensaver",accessibilityLabel:"Screensaver \u2014 touch to wake",style:{position:h?'fixed':'absolute',left:0,top:0,right:0,bottom:0,zIndex:1e5,backgroundColor:'#050505',opacity:x,overflow:'hidden',cursor:'pointer'},children:[Array.from({length:18},(e,t)=>(0,p.jsx)(w,{w:u,h:s,seed:t+1},t)),(0,p.jsx)(n.default.View,{style:{flex:1,alignItems:'center',justifyContent:'center',transform:[{translateX:j.x},{translateY:j.y}]},children:b?(0,p.jsx)(n.default.View,{style:{transform:[{scale:R.interpolate({inputRange:[0,1],outputRange:[1,1.12]})},{translateX:R.interpolate({inputRange:[0,1],outputRange:[-10,10]})}]},children:(0,p.jsx)(i.default,{source:b,style:{width:D,height:D},resizeMode:"contain",accessibilityLabel:`${v.name} logo`})}):(0,p.jsx)(f.T,{size:48,weight:"bold",colour:c.colours.gold,children:v.name})})]})}},857,[12,102,206,178,104,245,109,269,797,859,790,6]);
|
| 10 |
+
__d(function(g,_r,_i,_a,_m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"Card",{enumerable:!0,get:function(){return y}}),_e.ArrivalsStrip=function({todays:e,now:t,privacy:s}){const r=e.filter(e=>'confirmed'===e.status).map(e=>({b:e,m:(0,m.minsBetween)(t,new Date(`${e.date}T${e.time}:00`))})).filter(e=>e.m>=-20&&e.m<=60).sort((e,t)=>e.m-t.m);return(0,p.jsxs)(a.default,{testID:"arrivals-strip",style:{flexDirection:'row',alignItems:'center',gap:8,minHeight:40},children:[(0,p.jsx)(o.T,{size:13,weight:"semibold",colour:j.colours.gold,children:"NEXT HOUR"}),(0,p.jsxs)(l.default,{horizontal:!0,showsHorizontalScrollIndicator:!1,contentContainerStyle:{gap:6},children:[0===r.length?(0,p.jsx)(o.Muted,{children:"No arrivals due in the next hour."}):null,r.map(({b:e,m:t})=>(0,p.jsxs)(a.default,{style:{flexDirection:'row',alignItems:'center',gap:6,paddingHorizontal:10,paddingVertical:5,borderRadius:16,backgroundColor:t<0?j.colours.amberBg:'#12263D',borderWidth:1,borderColor:t<0?j.colours.amber:'#3C78B5'},children:[(0,p.jsx)(o.T,{size:13,weight:"semibold",children:e.time}),(0,p.jsxs)(o.T,{size:13,children:[(0,i.privName)(e,s)," \xb7 ",e.partySize]}),(0,p.jsx)(o.T,{size:12,colour:j.colours.muted,children:e.table?`T${e.table}`:'no table'}),(0,p.jsx)(o.T,{size:12,colour:t<0?j.colours.amber:j.colours.blue,children:t<0?-t+"m late":0===t?'now':`in ${t}m`}),e.allergies.length?(0,p.jsx)(o.T,{size:12,children:"\u26a0"}):null,e.occasion?(0,p.jsx)(o.T,{size:12,children:b.OCCASION_ICON[e.occasion]}):null]},e.id))]})]})},_e.Legend=function(){return(0,p.jsxs)(o.Row,{wrap:!0,gap:10,style:{paddingVertical:2},children:[Object.keys(b.STATUS).map(e=>(0,p.jsxs)(o.Row,{gap:4,children:[(0,p.jsx)(a.default,{style:{width:12,height:12,borderRadius:4,backgroundColor:b.STATUS[e].colour}}),(0,p.jsx)(o.T,{size:12,colour:j.colours.muted,children:b.STATUS[e].label})]},e)),(0,p.jsx)(o.T,{size:12,colour:j.colours.muted,children:"\u26a0 allergy \xb7 \u2605 VIP \xb7 \u2665 regular \xb7 \ud83c\udf82 birthday \xb7 \ud83d\udc8d anniversary"})]})},_e.DetailsPanel=function({title:e,children:s,onClose:l}){const[r,a]=(0,t.useState)(20);return(0,t.useEffect)(()=>{const e=Date.now(),t=()=>a(20-Math.floor((Date.now()-e)/1e3)),s=setInterval(t,1e3),l=setTimeout(t,2e4);return()=>{clearInterval(s),clearTimeout(l)}},[]),(0,t.useEffect)(()=>{r<=0&&l()},[r]),(0,p.jsxs)(o.Sheet,{visible:!0,onClose:l,title:e,maxWidth:560,testID:"private-details",children:[(0,p.jsx)(o.Badge,{kind:"amber",label:`Private \xb7 closes in ${Math.max(0,r)}s`}),s,(0,p.jsx)(o.Button,{kind:"secondary",label:"Close now",onPress:l})]})},Object.defineProperty(_e,"bookingDetails",{enumerable:!0,get:function(){return w}}),_e.TableSheet=function({rid:e,name:l,view:h,plan:x,todays:f,now:y,privacy:w,turnBase:v,onClose:T,onWalkIn:S,onMove:k,onDetails:$}){const C=h[l],M=c.useFloor.getState(),[z,I]=(0,t.useState)(!1),[B,D]=(0,t.useState)(C?.note??''),[P,R]=(0,t.useState)(!1);if(!C)return null;const A=C.booking,O=['seated','mains','dessert','bill'].includes(C.status),N=f.filter(e=>'confirmed'===e.status).sort((e,t)=>Math.abs((0,m.minsBetween)(y,(0,b.startOf)(e)))-Math.abs((0,m.minsBetween)(y,(0,b.startOf)(t)))),W=e=>e.partySize<=C.table.maxSeats,L=(0,b.turnFor)(C.covers||C.table.maxSeats,v);return(0,p.jsxs)(o.Sheet,{visible:!0,onClose:T,title:`Table ${l} \xb7 ${b.STATUS[C.status].label}`,maxWidth:640,testID:"table-sheet",children:[(0,p.jsxs)(o.Row,{wrap:!0,gap:6,children:[(0,p.jsx)(o.Badge,{kind:"neutral",label:`${C.table.minSeats}\u2013${C.table.maxSeats} seats`}),A?(0,p.jsx)(o.Badge,{kind:"gold",label:`${(0,i.privName)(A,w)} \xb7 ${A.partySize} \xb7 ${C.seatedMins}m`}):null,A?(0,p.jsx)(o.Badge,{kind:C.seatedMins>(0,b.durOf)(A,v)?'red':'neutral',label:`Turn ~${(0,b.durOf)(A,v)} min \xb7 free ~${(0,m.hm)((0,b.endOf)(A,v))} (est.)`}):(0,p.jsx)(o.Badge,{kind:"neutral",label:`Turn estimate for ${C.table.maxSeats}: ~${L} min`}),C.next?(0,p.jsx)(o.Badge,{kind:"blue",label:`Next: ${C.next.time} ${(0,i.privName)(C.next,w)} (${C.next.partySize})`}):null,C.allergy?(0,p.jsx)(o.Badge,{kind:"red",label:"\u26a0 Allergy \u2014 see details"}):null]}),O||'blocked'===C.status?null:(0,p.jsxs)(o.Row,{gap:8,children:[(0,p.jsx)(o.Button,{label:"Seat walk-in here",onPress:()=>{T(),S(l)},testID:"seat-walkin-here",style:{flex:1,minHeight:56}}),(0,p.jsx)(o.Button,{kind:"secondary",label:"Seat a booking",onPress:()=>R(!P),testID:"seat-booking-here",style:{flex:1,minHeight:56}})]}),P?(0,p.jsxs)(a.default,{style:{gap:6},children:[0===N.length?(0,p.jsx)(o.Muted,{children:"No bookings left to seat today."}):null,N.slice(0,8).map(t=>(0,p.jsxs)(s.default,{accessibilityRole:"button",accessibilityLabel:`Seat ${(0,i.privName)(t,w)} ${t.time}`,onPress:async()=>{await u.repo.bookings.update(t.id,{table:l}),await u.repo.bookings.setStatus(t.id,'seated'),(0,n.resetTableLive)(e,l),T()},style:{padding:10,borderRadius:10,borderWidth:1,borderColor:W(t)?j.colours.border:j.colours.amber,backgroundColor:j.colours.surface2},children:[(0,p.jsxs)(o.T,{weight:"semibold",children:[t.time," \xb7 ",(0,i.privName)(t,w)," \xb7 ",t.partySize,t.table?` \xb7 booked T${t.table}`:'',t.allergies.length?' \xb7 \u26a0':'']}),W(t)?null:(0,p.jsxs)(o.T,{size:12,colour:j.colours.amber,children:["Bigger than this table (",C.table.maxSeats," max)"]})]},t.id))]}):null,O?(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(o.T,{size:14,colour:j.colours.muted,children:"Course / status"}),(0,p.jsx)(o.Row,{wrap:!0,gap:6,children:b.STAGES.map(t=>(0,p.jsx)(o.Chip,{label:b.STATUS[t].label,selected:C.status===t,onPress:()=>M.setLive(e,l,{stage:t})},t))}),(0,p.jsxs)(o.Row,{wrap:!0,gap:8,children:[A?(0,p.jsx)(o.Button,{kind:"secondary",label:"Move party\u2026",onPress:()=>{T(),k(l)},testID:"move-party"}):null,(0,p.jsx)(o.Button,{kind:"success",label:"Clear table",testID:"clear-table",onPress:async()=>{A&&await u.repo.bookings.setStatus(A.id,'finished'),M.setLive(e,l,{stage:void 0,dirty:!0}),T()}})]})]}):null,'dirty'===C.status?(0,p.jsx)(o.Button,{kind:"success",label:"Mark clean \u2014 table free",onPress:()=>{M.setLive(e,l,{dirty:!1}),T()},testID:"mark-clean"}):null,(0,p.jsxs)(o.Row,{wrap:!0,gap:8,children:[(0,p.jsx)(o.Button,{kind:"secondary",label:'blocked'===C.status?'Unblock table':'Block table',onPress:()=>{M.setLive(e,l,{blocked:'blocked'!==C.status}),T()},testID:"block-table"}),(0,p.jsx)(o.Button,{kind:"ghost",label:C.note?'Edit note':'+ Note',onPress:()=>I(!z)}),A||C.next?(0,p.jsx)(o.Button,{kind:"ghost",label:"Guest details",onPress:()=>{T(),$(A??C.next)},testID:"guest-details"}):null]}),z?(0,p.jsxs)(o.Row,{gap:6,children:[(0,p.jsx)(r.default,{accessibilityLabel:"Table note",value:B,onChangeText:D,placeholder:"e.g. wobbly leg, high chair here",placeholderTextColor:"#7D776C",style:[o.styles.input,{flex:1}]}),(0,p.jsx)(o.Button,{small:!0,label:"Save",onPress:()=>{M.setLive(e,l,{note:B.trim()||void 0}),I(!1)}})]}):null,w?(0,p.jsx)(o.Muted,{children:"Privacy mode: names as initials; tap Guest details for notes and allergies (closes after 20 s)."}):null,x.joins.some(e=>e.tables.includes(l))?(0,p.jsxs)(o.Muted,{children:["Joins with ",x.joins.find(e=>e.tables.includes(l)).tables.filter(e=>e!==l).join(', ')," for bigger parties (book as ",x.joins.find(e=>e.tables.includes(l)).tables.join('+'),")."]}):null]})},_e.WaitlistPanel=function({rid:e,r:l,plan:h,view:f,todays:w,waiting:v,now:T,privacy:S,busy:k,onToast:$}){const[C,M]=(0,t.useState)(''),[z,I]=(0,t.useState)(2),B=(0,c.useFloor)(e=>e.smsLog);return(0,p.jsxs)(y,{title:`Waitlist (${v.length})`,right:(0,p.jsxs)(o.Muted,{children:["new party ~",(0,x.estimateWait)(v.length+1,l.settings.turnMins,k)," min"]}),testID:"waitlist-panel",children:[0===v.length?(0,p.jsx)(o.Muted,{children:"Nobody waiting."}):null,v.map((t,s)=>{const r=(0,b.suggestTable)(h,w,f,t.partySize,T,(0,b.turnFor)(t.partySize,l.settings.turnMins)),y=(0,x.estimateWait)(s+1,l.settings.turnMins,k),v=Math.max(0,(0,m.minsBetween)(new Date(t.joinedAt),T)),C=B.find(s=>s.rid===e&&s.text.includes(`#${t.number} `));return(0,p.jsxs)(a.default,{style:{backgroundColor:j.colours.surface2,borderRadius:10,padding:8,gap:4},children:[(0,p.jsxs)(o.Row,{style:{justifyContent:'space-between'},children:[(0,p.jsxs)(o.T,{weight:"semibold",children:["#",t.number," ",(0,i.pv)(t.name,S)," \xb7 ",t.partySize]}),(0,p.jsxs)(o.T,{size:12,colour:v>y?j.colours.amber:j.colours.muted,children:["waited ",v,"m \xb7 quoted ~",y,"m"]})]}),r?(0,p.jsxs)(o.T,{size:12,colour:r.clashes?j.colours.amber:j.colours.green,children:["Best table: ",r.table," (",r.why,")"]}):(0,p.jsx)(o.T,{size:12,colour:j.colours.amber,children:"No table big enough \u2014 join tables in the plan"}),(0,p.jsxs)(o.Row,{wrap:!0,gap:6,children:[(0,p.jsx)(o.Button,{small:!0,label:C||'notified'===t.status?'Re-send (demo)':'Table ready text (demo)',testID:`sms-${t.number}`,onPress:()=>{c.useFloor.getState().logSms(e,T.toISOString(),`#${t.number} ${t.partySize}: Your table at ${l.name} is ready.`),u.repo.waitlist.setStatus(t.id,'notified'),$(`DEMO \u2014 no text sent. Would say: "Your table at ${l.name} is ready."`)}}),r?(0,p.jsx)(o.Button,{small:!0,kind:"success",label:`Seat at ${r.table}`,onPress:async()=>{await u.repo.waitlist.setStatus(t.id,'seated'),await u.repo.bookings.seatWalkIn(e,t.partySize,r.table,`From waitlist #${t.number}`),(0,n.resetTableLive)(e,r.table),$(`Waitlist #${t.number} seated at ${r.table}`)}}):null,(0,p.jsx)(o.Button,{small:!0,kind:"ghost",label:"Remove",onPress:()=>u.repo.waitlist.setStatus(t.id,'removed')})]}),'notified'===t.status?(0,p.jsx)(o.Badge,{kind:"green",label:`Told table ready${C?` ${(0,m.hm)(new Date(C.at))}`:''} (demo)`}):null]},t.id)}),(0,p.jsxs)(o.Row,{gap:6,children:[(0,p.jsx)(r.default,{accessibilityLabel:"Waitlist name",placeholder:"Name for the waitlist",placeholderTextColor:"#7D776C",value:C,onChangeText:M,style:[o.styles.input,{flex:1,minWidth:0,width:40,paddingVertical:6}]}),(0,p.jsx)(s.default,{accessibilityLabel:"Waitlist party size",onPress:()=>I(e=>e>=8?1:e+1),style:{width:48,height:48,borderRadius:10,borderWidth:1,borderColor:j.colours.gold,alignItems:'center',justifyContent:'center'},children:(0,p.jsx)(o.T,{weight:"bold",colour:j.colours.gold,children:z})}),(0,p.jsx)(o.Button,{small:!0,label:"Add",disabled:C.trim().length<2,onPress:()=>{u.repo.waitlist.join(e,C.trim(),z),M('')}})]})]})},_e.PacePanel=function({r:e,fc:t,todays:s,now:l,walkInCount:r,staffOn:n,onSummary:i}){const u=r+s.filter(e=>['seated','finished'].includes(e.status)).reduce((e,t)=>e+t.partySize,0),c=l.getHours(),h=Math.round(t.hours.filter(e=>e.hour<c).reduce((e,t)=>e+t.covers,0)+(t.hours.find(e=>e.hour===c)?.covers??0)*(l.getMinutes()/60)),x=h?u/h:1,f=x>=1.1?j.colours.amber:x>=.85?j.colours.green:j.colours.blue,w=Array.from({length:8},(e,t)=>{const r=(0,m.addMins)(l,15*(t-4)-l.getMinutes()%15),a=(0,m.addMins)(r,15),o=s.filter(e=>!['cancelled','noshow'].includes(e.status)).filter(e=>{const t=(0,b.startOf)(e);return t>=r&&t<a}).reduce((e,t)=>e+t.partySize,0);return{from:r,covers:o,future:t>=4}}),v=Math.max(4,Math.round(e.settings.capacityPerHour/4)),T=Math.max(v,...w.map(e=>e.covers)),S=w.filter(e=>e.future&&e.covers>v),k=t.nextHour?.covers??0,$=Math.ceil(k/16);return(0,p.jsxs)(y,{title:"Pace & kitchen",right:(0,p.jsx)(o.Badge,{kind:"amber",label:"ESTIMATE"}),testID:"pace-panel",children:[(0,p.jsxs)(a.default,{testID:"pace-meter",accessibilityLabel:`Covers so far ${u} vs forecast ${h}`,style:{gap:4},children:[(0,p.jsxs)(o.Row,{style:{justifyContent:'space-between'},children:[(0,p.jsx)(o.T,{size:14,children:"Covers so far"}),(0,p.jsxs)(o.T,{weight:"bold",colour:f,children:[u," ",(0,p.jsxs)(o.T,{size:13,colour:j.colours.muted,children:["/ ~",h," forecast"]})]})]}),(0,p.jsx)(a.default,{style:{height:10,borderRadius:5,backgroundColor:'#2A2620',overflow:'hidden'},children:(0,p.jsx)(a.default,{style:{width:`${Math.min(100,75*x)}%`,height:10,borderRadius:5,backgroundColor:f}})}),(0,p.jsxs)(o.Muted,{children:[x>=1.1?'Ahead of forecast':x>=.85?'On pace':'Behind forecast'," \xb7 next hour ~",t.nextHour?`${t.nextHour.coversLow}\u2013${t.nextHour.coversHigh}`:0," covers"]})]}),(0,p.jsx)(o.T,{size:13,colour:j.colours.muted,children:"Covers seated per 15 min (last hour \xb7 next hour)"}),(0,p.jsx)(a.default,{testID:"kitchen-pacing",style:{flexDirection:'row',alignItems:'flex-end',gap:4,height:64},children:w.map((e,t)=>(0,p.jsxs)(a.default,{style:{flex:1,alignItems:'center',gap:2},children:[(0,p.jsx)(o.T,{size:10,colour:j.colours.muted,children:e.covers||''}),(0,p.jsx)(a.default,{style:{width:'80%',height:Math.max(2,e.covers/T*40),borderRadius:3,backgroundColor:e.covers>v?j.colours.red:e.future?'#6B5A3A':j.colours.gold}}),(0,p.jsx)(o.T,{size:9,colour:4===t?j.colours.gold:j.colours.muted,children:(0,m.hm)(e.from)})]},t))}),S.map(e=>(0,p.jsxs)(o.T,{size:13,colour:j.colours.amber,children:["\u26a0 Kitchen: ",e.covers," covers due ",(0,m.hm)(e.from),"\u2013",(0,m.hm)((0,m.addMins)(e.from,15))," (pace ~",v,") \u2014 stagger seating if you can."]},e.from.getTime())),$>n?(0,p.jsxs)(o.T,{size:13,colour:j.colours.amber,children:["\u26a0 Next hour ~",k," covers with ",n," on: about ",$-n," more on the floor suggested."]}):(0,p.jsxs)(o.T,{size:13,colour:j.colours.green,children:["Staffing looks OK for the next hour (",n," on)."]}),(0,p.jsx)(o.Button,{small:!0,kind:"secondary",label:"End-of-service summary",onPress:i,testID:"eos-open"})]})},_e.ServiceSummary=function({r:e,todays:t,orders:s,waitlistAll:l,walkInCount:r,onClose:a}){const n=t.filter(e=>['seated','finished'].includes(e.status)),i=n.reduce((e,t)=>e+t.partySize,0)+r,u=t.filter(e=>e.walkIn),h=t.filter(e=>'finished'===e.status&&e.seatedAt&&e.finishedAt).map(e=>(0,m.minsBetween)(new Date(e.seatedAt),new Date(e.finishedAt))),b=s.reduce((e,t)=>e+t.paid,0),x=(0,c.useFloor)(t=>t.smsLog.filter(t=>t.rid===e.id).length),j=(e,t)=>(0,p.jsxs)(o.Row,{style:{justifyContent:'space-between'},children:[(0,p.jsx)(o.T,{children:e}),(0,p.jsx)(o.T,{weight:"semibold",children:t})]},e);return(0,p.jsxs)(o.Sheet,{visible:!0,onClose:a,title:`End of service \xb7 ${e.name}`,maxWidth:560,testID:"eos-summary",children:[j('Covers served',String(i)),j('Bookings seated',`${n.filter(e=>!e.walkIn).length} of ${t.filter(e=>!e.walkIn&&'cancelled'!==e.status).length}`),j('Walk-ins',`${u.length} parties \xb7 ${u.reduce((e,t)=>e+t.partySize,0)+r} covers`),j('No-shows',String(t.filter(e=>'noshow'===e.status).length)),j('Average table time',h.length?`${Math.round(h.reduce((e,t)=>e+t,0)/h.length)} min`:'\u2014'),j('Waitlist seated',`${l.filter(e=>'seated'===e.status).length} (${l.filter(e=>'removed'===e.status).length} left)`),j('"Table ready" texts',`${x} (demo, none sent)`),j('Taken at the till/app',`${(0,f.gbp)(b)} (demo)`),(0,p.jsx)(o.Muted,{children:"Example data on this device. Nothing is sent anywhere."})]})},Object.defineProperty(_e,"isWeb",{enumerable:!0,get:function(){return v}}),Object.defineProperty(_e,"tablesOf",{enumerable:!0,get:function(){return c.tablesOf}});var t=_r(d[0]);_r(d[1]);var s=e(_r(d[2])),l=e(_r(d[3])),r=e(_r(d[4])),a=e(_r(d[5])),o=_r(d[6]),n=_r(d[7]),i=_r(d[8]),u=_r(d[9]),c=_r(d[10]),h=_r(d[11]),b=_r(d[12]),m=_r(d[13]),x=_r(d[14]),f=_r(d[15]),j=_r(d[16]),p=_r(d[17]);const y=({title:e,right:t,children:s,testID:l})=>(0,p.jsxs)(a.default,{testID:l,style:{backgroundColor:j.colours.surface,borderRadius:14,borderWidth:1,borderColor:j.colours.border,padding:10,gap:6},children:[(0,p.jsxs)(o.Row,{style:{justifyContent:'space-between'},children:[(0,p.jsx)(o.T,{weight:"semibold",colour:j.colours.gold,children:e}),t]}),s]});const w=e=>(0,p.jsxs)(a.default,{style:{gap:6},children:[(0,p.jsxs)(o.T,{size:18,weight:"semibold",children:[e.walkIn?`Walk-in ${e.ref}`:e.name.replace(' (example)','')," \xb7 ",e.partySize]}),(0,p.jsxs)(o.Muted,{children:[e.time," \xb7 ",e.table?`Table ${e.table}`:'No table'," \xb7 ",e.ref,e.tags?.length?` \xb7 ${e.tags.join(', ')}`:'',e.occasion?` \xb7 ${e.occasion}`:'']}),e.notes?(0,p.jsxs)(o.T,{children:["Notes: ",e.notes]}):(0,p.jsx)(o.Muted,{children:"No notes."}),e.allergies.length?(0,p.jsx)(a.default,{style:{backgroundColor:j.colours.redBg,borderRadius:8,padding:8},children:(0,p.jsxs)(o.T,{weight:"bold",colour:"#FFE3DF",children:["ALLERGY: ",e.allergies.map(e=>`${(0,h.allergenLabel)(e.allergen)} \u2014 ${(0,h.severityLabel)(e.severity)}`).join('; ')]})}):(0,p.jsx)(o.Muted,{children:"No allergies declared."}),(0,p.jsx)(o.Muted,{children:"Phone and email stay in the Managers app; the Display never shows them."})]});const v=!0},858,[12,104,245,133,255,109,790,851,856,796,864,791,852,795,848,793,797,6]);
|
display-app/index.html
CHANGED
|
@@ -42,13 +42,13 @@
|
|
| 42 |
<noscript> You need to enable JavaScript to run this app. </noscript>
|
| 43 |
<!-- The root element for your Expo app. -->
|
| 44 |
<div id="root"><div id="cc-boot" style="position:fixed;inset:0;display:flex;align-items:center;justify-content:center;background:#0B0B0B"><img src="/display-app/brand-logo.png" alt="The Anchorage" width="180" height="180"/></div></div>
|
| 45 |
-
<script src="/display-app/_expo/static/js/web/__expo-metro-runtime-8c088df87a31e4e6accd81c554ec290d.js" defer></script><script src="/display-app/_expo/static/js/web/__common-
|
| 46 |
<script>/* "Add to Home screen" hint for the Cover Charge web apps (injected into each app's index.html by tools/build_site.py).
|
| 47 |
Chrome/Edge/Samsung: an Install button (beforeinstallprompt). Huawei Browser, Chrome without an install prompt,
|
| 48 |
iPhone/iPad Safari: short menu steps. Shown once per app until dismissed; never inside the installed app. */
|
| 49 |
(function () {
|
| 50 |
var APP = 'The Anchorage · Display', KEY = 'cc-install-hint:' + '/display-app/';
|
| 51 |
-
var standalone = (window.matchMedia && matchMedia('(display-mode: standalone)').matches) || navigator.standalone === true;
|
| 52 |
if (standalone) return;
|
| 53 |
var bip = null, shown = false;
|
| 54 |
window.addEventListener('beforeinstallprompt', function (e) { e.preventDefault(); bip = e; if (shown) render(); });
|
|
|
|
| 42 |
<noscript> You need to enable JavaScript to run this app. </noscript>
|
| 43 |
<!-- The root element for your Expo app. -->
|
| 44 |
<div id="root"><div id="cc-boot" style="position:fixed;inset:0;display:flex;align-items:center;justify-content:center;background:#0B0B0B"><img src="/display-app/brand-logo.png" alt="The Anchorage" width="180" height="180"/></div></div>
|
| 45 |
+
<script src="/display-app/_expo/static/js/web/__expo-metro-runtime-8c088df87a31e4e6accd81c554ec290d.js" defer></script><script src="/display-app/_expo/static/js/web/__common-df70654cbb893ed0136989be426f3560.js" defer></script><script src="/display-app/_expo/static/js/web/entry-e88a37b9f287e5c20e8736da03641cf7.js" defer></script>
|
| 46 |
<script>/* "Add to Home screen" hint for the Cover Charge web apps (injected into each app's index.html by tools/build_site.py).
|
| 47 |
Chrome/Edge/Samsung: an Install button (beforeinstallprompt). Huawei Browser, Chrome without an install prompt,
|
| 48 |
iPhone/iPad Safari: short menu steps. Shown once per app until dismissed; never inside the installed app. */
|
| 49 |
(function () {
|
| 50 |
var APP = 'The Anchorage · Display', KEY = 'cc-install-hint:' + '/display-app/';
|
| 51 |
+
var standalone = (window.matchMedia && (matchMedia('(display-mode: standalone)').matches || matchMedia('(display-mode: fullscreen)').matches)) || navigator.standalone === true || /CoverChargeTablet/.test(navigator.userAgent);
|
| 52 |
if (standalone) return;
|
| 53 |
var bip = null, shown = false;
|
| 54 |
window.addEventListener('beforeinstallprompt', function (e) { e.preventDefault(); bip = e; if (shown) render(); });
|
display-app/manifest.webmanifest
CHANGED
|
@@ -6,7 +6,7 @@
|
|
| 6 |
"start_url": "/display-app/index.html",
|
| 7 |
"scope": "/display-app/",
|
| 8 |
"display": "standalone",
|
| 9 |
-
"orientation": "
|
| 10 |
"background_color": "#000000",
|
| 11 |
"theme_color": "#000000",
|
| 12 |
"lang": "en-GB",
|
|
|
|
| 6 |
"start_url": "/display-app/index.html",
|
| 7 |
"scope": "/display-app/",
|
| 8 |
"display": "standalone",
|
| 9 |
+
"orientation": "any",
|
| 10 |
"background_color": "#000000",
|
| 11 |
"theme_color": "#000000",
|
| 12 |
"lang": "en-GB",
|
display-app/sw.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
| 1 |
// The Anchorage · Display service worker: precache the app shell so it opens offline after the first visit.
|
| 2 |
-
const V = "cc-display-
|
| 3 |
const BASE = "/display-app/";
|
| 4 |
-
const PRECACHE = ["/display-app/_expo/static/js/web/+not-found-da8ea3ec55bebb0779db542f35c6adf9.js", "/display-app/_expo/static/js/web/[did]-91eaf603d23bc2b2b79e4e95467ef972.js", "/display-app/_expo/static/js/web/[n]-e07421962f3951aaf0f9cdf16bfbce72.js", "/display-app/_expo/static/js/web/[oid]-7361f660100e238663b52e4e1fc71efc.js", "/display-app/_expo/static/js/web/[section]-11e4dec81ff7b7cd85a190186e1ec965.js", "/display-app/_expo/static/js/web/__common-
|
| 5 |
// Hugging Face serves large files (fonts) through a redirect to its CDN. Browsers refuse to hand a *redirected* cached
|
| 6 |
// response to a page, so store a plain copy instead (otherwise fonts, and so the app, fail to load offline).
|
| 7 |
const plain = r => r.redirected ? r.blob().then(b => new Response(b, { status: 200, headers: { 'Content-Type': r.headers.get('Content-Type') || b.type || 'application/octet-stream' } })) : Promise.resolve(r);
|
|
|
|
| 1 |
// The Anchorage · Display service worker: precache the app shell so it opens offline after the first visit.
|
| 2 |
+
const V = "cc-display-60528fc0b2";
|
| 3 |
const BASE = "/display-app/";
|
| 4 |
+
const PRECACHE = ["/display-app/_expo/static/js/web/+not-found-da8ea3ec55bebb0779db542f35c6adf9.js", "/display-app/_expo/static/js/web/[did]-91eaf603d23bc2b2b79e4e95467ef972.js", "/display-app/_expo/static/js/web/[n]-e07421962f3951aaf0f9cdf16bfbce72.js", "/display-app/_expo/static/js/web/[oid]-7361f660100e238663b52e4e1fc71efc.js", "/display-app/_expo/static/js/web/[section]-11e4dec81ff7b7cd85a190186e1ec965.js", "/display-app/_expo/static/js/web/__common-df70654cbb893ed0136989be426f3560.js", "/display-app/_expo/static/js/web/__expo-metro-runtime-8c088df87a31e4e6accd81c554ec290d.js", "/display-app/_expo/static/js/web/_layout-aec601139020af312bccb41d75107657.js", "/display-app/_expo/static/js/web/basket-7e40802cfccc7e1a593fc9dd94641696.js", "/display-app/_expo/static/js/web/book-73d16fd431095875bb01cc0a0c784d3b.js", "/display-app/_expo/static/js/web/demo-2aeda33db335ba3a45d18733444a4df6.js", "/display-app/_expo/static/js/web/entry-e88a37b9f287e5c20e8736da03641cf7.js", "/display-app/_expo/static/js/web/feedback-c3022e0683297c445b34cc46bbd3da7c.js", "/display-app/_expo/static/js/web/gift-0647b216e00344da5b09e74268994259.js", "/display-app/_expo/static/js/web/index-2295f4c308e07a412bff2d3b7c467e39.js", "/display-app/_expo/static/js/web/index-3ce55512f207e0f4e938fcea314e34d2.js", "/display-app/_expo/static/js/web/index-42c772ae8e6fc8ffb457607b71499331.js", "/display-app/_expo/static/js/web/index-74ed5e3887809c4259d725a2965aa3f3.js", "/display-app/_expo/static/js/web/index-881bce8519f411b0e7328fa0ee1d4148.js", "/display-app/_expo/static/js/web/index-93b1fb4a59822430dbc65ee63d8bd82a.js", "/display-app/_expo/static/js/web/index-d66067b7a3fefef4ab21eabe87395720.js", "/display-app/_expo/static/js/web/index-e57a61ccf8b16e38bf91548a01cebbf1.js", "/display-app/_expo/static/js/web/index-e93c25959d1ede6b9cf32cbe0805fe0b.js", "/display-app/_expo/static/js/web/lost-e899dbdc482f3468b2e05f535e9c0241.js", "/display-app/_expo/static/js/web/loyalty-d1b9579347eb30ae07e6c533a0b84f09.js", "/display-app/_expo/static/js/web/merch-88b52c267bd3ca9a3422ea337662265a.js", "/display-app/_expo/static/js/web/offers-5713ecb8599cec0ed78a8576c4b43692.js", "/display-app/_expo/static/js/web/profile-86ef019a072354ddf929fc5c7e1c6542.js", "/display-app/_expo/static/js/web/refer-81c419266ae8d02761be62f17cc198c0.js", "/display-app/_expo/static/js/web/waitlist-b490af7ba5840b0a9602d6761ffdc63a.js", "/display-app/_expo/static/js/web/whatson-7bba1c8989b9be2fc455c8ddd8bbc99d.js", "/display-app/apple-touch-icon.png", "/display-app/assets/assets/brand/anchorage-hero.0450b828e4f9c1f4456240096598f6f5.png", "/display-app/assets/assets/brand/anchorage.fea5ce2f6fd18bf2950aa21c0980ed8e.png", "/display-app/assets/assets/brand/brae.8de9e89ac30966c6669de990370d8e40.png", "/display-app/assets/assets/brand/saltmarsh.84acbc30d810d7a1cd3bbeb7b62651e8.png", "/display-app/assets/assets/specials/sample-chalkboard.e7b4e4450a8483d4219bc6a214158d8f.jpg", "/display-app/assets/node_modules/@expo-google-fonts/poppins/400Regular/Poppins_400Regular.093ee89be9ede30383f39a899c485a82.ttf", "/display-app/assets/node_modules/@expo-google-fonts/poppins/500Medium/Poppins_500Medium.bf59c687bc6d3a70204d3944082c5cc0.ttf", "/display-app/assets/node_modules/@expo-google-fonts/poppins/600SemiBold/Poppins_600SemiBold.6f1520d107205975713ba09df778f93f.ttf", "/display-app/assets/node_modules/@expo-google-fonts/poppins/700Bold/Poppins_700Bold.08c20a487911694291bd8c5de41315ad.ttf", "/display-app/assets/node_modules/expo-router/assets/arrow_down.017bc6ba3fc25503e5eb5e53826d48a8.png", "/display-app/assets/node_modules/expo-router/assets/error.d1ea1496f9057eb392d5bbf3732a61b7.png", "/display-app/assets/node_modules/expo-router/assets/file.19eeb73b9593a38f8e9f418337fc7d10.png", "/display-app/assets/node_modules/expo-router/assets/forward.d8b800c443b8972542883e0b9de2bdc6.png", "/display-app/assets/node_modules/expo-router/assets/pkg.ab19f4cbc543357183a20571f68380a3.png", "/display-app/assets/node_modules/expo-router/assets/react-navigation/elements/back-icon-mask.0a328cd9c1afd0afe8e3b1ec5165b1b4.png", "/display-app/assets/node_modules/expo-router/assets/react-navigation/elements/back-icon.35ba0eaec5a4f5ed12ca16fabeae451d.png", "/display-app/assets/node_modules/expo-router/assets/react-navigation/elements/clear-icon.c94f6478e7ae0cdd9f15de1fcb9e5e55.png", "/display-app/assets/node_modules/expo-router/assets/react-navigation/elements/clear-icon.c94f6478e7ae0cdd9f15de1fcb9e5e55@2x.png", "/display-app/assets/node_modules/expo-router/assets/react-navigation/elements/clear-icon.c94f6478e7ae0cdd9f15de1fcb9e5e55@3x.png", "/display-app/assets/node_modules/expo-router/assets/react-navigation/elements/clear-icon.c94f6478e7ae0cdd9f15de1fcb9e5e55@4x.png", "/display-app/assets/node_modules/expo-router/assets/react-navigation/elements/close-icon.808e1b1b9b53114ec2838071a7e6daa7.png", "/display-app/assets/node_modules/expo-router/assets/react-navigation/elements/close-icon.808e1b1b9b53114ec2838071a7e6daa7@2x.png", "/display-app/assets/node_modules/expo-router/assets/react-navigation/elements/close-icon.808e1b1b9b53114ec2838071a7e6daa7@3x.png", "/display-app/assets/node_modules/expo-router/assets/react-navigation/elements/close-icon.808e1b1b9b53114ec2838071a7e6daa7@4x.png", "/display-app/assets/node_modules/expo-router/assets/react-navigation/elements/search-icon.286d67d3f74808a60a78d3ebf1a5fb57.png", "/display-app/assets/node_modules/expo-router/assets/sitemap.412dd9275b6b48ad28f5e3d81bb1f626.png", "/display-app/assets/node_modules/expo-router/assets/unmatched.20e71bdf79e3a97bf55fd9e164041578.png", "/display-app/brand-logo.png", "/display-app/favicon.ico", "/display-app/icon-192.png", "/display-app/icon-512.png", "/display-app/icon-maskable-512.png", "/display-app/manifest.webmanifest", "/display-app/index.html"];
|
| 5 |
// Hugging Face serves large files (fonts) through a redirect to its CDN. Browsers refuse to hand a *redirected* cached
|
| 6 |
// response to a page, so store a plain copy instead (otherwise fonts, and so the app, fail to load offline).
|
| 7 |
const plain = r => r.redirected ? r.blob().then(b => new Response(b, { status: 200, headers: { 'Content-Type': r.headers.get('Content-Type') || b.type || 'application/octet-stream' } })) : Promise.resolve(r);
|
index.html
CHANGED
|
@@ -3,7 +3,7 @@
|
|
| 3 |
<head>
|
| 4 |
<meta charset="utf-8">
|
| 5 |
<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover">
|
| 6 |
-
<title>Cover Charge: try the apps (prototype v0.1.
|
| 7 |
<meta name="description" content="Try the five Cover Charge prototype web apps: Cover Charge for Managers, Cover Charge for Staff, Cover Charge, Cover Charge for Display and Cover Charge for Head Chef. Demo data only, no real payments.">
|
| 8 |
<meta name="theme-color" content="#000000">
|
| 9 |
<link rel="icon" href="favicon.ico">
|
|
@@ -60,7 +60,7 @@ footer{margin-top:28px;color:var(--muted);font-size:.8rem;text-align:center}
|
|
| 60 |
<img src="assets/logo-256.png" alt="Cover Charge logo" width="112" height="112">
|
| 61 |
<p class="word"><span class="c">cover</span><span class="g">charge</span></p>
|
| 62 |
<p class="tag">All in one restaurant booking app</p>
|
| 63 |
-
<h1>Cover Charge: try the apps (prototype v0.1.
|
| 64 |
<p class="pilot">Pilot: The Anchorage, Harbour View, Dunure · demo data only, no real payments</p>
|
| 65 |
<span class="pill">Prototype · nothing is sent or charged</span>
|
| 66 |
</header>
|
|
@@ -84,12 +84,15 @@ footer{margin-top:28px;color:var(--muted);font-size:.8rem;text-align:center}
|
|
| 84 |
<a class="btn primary" href="customer-app/index.html">Open app</a>
|
| 85 |
</article>
|
| 86 |
<article class="card" id="display">
|
| 87 |
-
<div class="top"><img src="display-app/icon-192.png" alt="" width="56" height="56"><div><h2>Cover Charge for Display</h2><div class="pkg">For a tablet in the restaurant
|
| 88 |
<p>Today's bookings, live orders and kitchen tickets, allergy and takeaway alerts, who's on and the next-hour forecast.</p>
|
| 89 |
<a class="btn primary" href="display-app/index.html">Open app</a>
|
| 90 |
<a class="btn ghost" href="downloads/mac/Cover-Charge-for-Display-v0.1.11-mac-intel.zip" download>Mac app: Intel (macOS 10.13+)</a>
|
| 91 |
<a class="btn ghost" href="downloads/mac/Cover-Charge-for-Display-v0.1.11-mac-apple-silicon.zip" download>Mac app: Apple Silicon M1–M4 (macOS 11+)</a>
|
| 92 |
<p class="note">Mac app for testing (about 100 MB, works offline). First time: right-click the app > Open. <a href="downloads/mac/HOW-TO-OPEN-ON-MAC.txt">How to open on a Mac</a></p>
|
|
|
|
|
|
|
|
|
|
| 93 |
</article>
|
| 94 |
<article class="card" id="chef">
|
| 95 |
<div class="top"><img src="chef-app/icon-192.png" alt="" width="56" height="56"><div><h2>Cover Charge for Head Chef</h2><div class="pkg">For the head chef and kitchen</div></div></div>
|
|
@@ -121,7 +124,7 @@ footer{margin-top:28px;color:var(--muted);font-size:.8rem;text-align:center}
|
|
| 121 |
</section>
|
| 122 |
|
| 123 |
<footer>
|
| 124 |
-
<p>Cover Charge prototype v0.1.
|
| 125 |
</footer>
|
| 126 |
</main>
|
| 127 |
</body>
|
|
|
|
| 3 |
<head>
|
| 4 |
<meta charset="utf-8">
|
| 5 |
<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover">
|
| 6 |
+
<title>Cover Charge: try the apps (prototype v0.1.12)</title>
|
| 7 |
<meta name="description" content="Try the five Cover Charge prototype web apps: Cover Charge for Managers, Cover Charge for Staff, Cover Charge, Cover Charge for Display and Cover Charge for Head Chef. Demo data only, no real payments.">
|
| 8 |
<meta name="theme-color" content="#000000">
|
| 9 |
<link rel="icon" href="favicon.ico">
|
|
|
|
| 60 |
<img src="assets/logo-256.png" alt="Cover Charge logo" width="112" height="112">
|
| 61 |
<p class="word"><span class="c">cover</span><span class="g">charge</span></p>
|
| 62 |
<p class="tag">All in one restaurant booking app</p>
|
| 63 |
+
<h1>Cover Charge: try the apps (prototype v0.1.12)</h1>
|
| 64 |
<p class="pilot">Pilot: The Anchorage, Harbour View, Dunure · demo data only, no real payments</p>
|
| 65 |
<span class="pill">Prototype · nothing is sent or charged</span>
|
| 66 |
</header>
|
|
|
|
| 84 |
<a class="btn primary" href="customer-app/index.html">Open app</a>
|
| 85 |
</article>
|
| 86 |
<article class="card" id="display">
|
| 87 |
+
<div class="top"><img src="display-app/icon-192.png" alt="" width="56" height="56"><div><h2>Cover Charge for Display</h2><div class="pkg">For a tablet in the restaurant: best held sideways, turns with the tablet</div></div></div>
|
| 88 |
<p>Today's bookings, live orders and kitchen tickets, allergy and takeaway alerts, who's on and the next-hour forecast.</p>
|
| 89 |
<a class="btn primary" href="display-app/index.html">Open app</a>
|
| 90 |
<a class="btn ghost" href="downloads/mac/Cover-Charge-for-Display-v0.1.11-mac-intel.zip" download>Mac app: Intel (macOS 10.13+)</a>
|
| 91 |
<a class="btn ghost" href="downloads/mac/Cover-Charge-for-Display-v0.1.11-mac-apple-silicon.zip" download>Mac app: Apple Silicon M1–M4 (macOS 11+)</a>
|
| 92 |
<p class="note">Mac app for testing (about 100 MB, works offline). First time: right-click the app > Open. <a href="downloads/mac/HOW-TO-OPEN-ON-MAC.txt">How to open on a Mac</a></p>
|
| 93 |
+
<a class="btn ghost" href="downloads/android/Cover-Charge-for-Display-v0.1.12-tablet.apk" download>Tablet app (Android)</a>
|
| 94 |
+
<p class="note">Android tablet app (Android 7 or newer, about 2 MB, works offline, full screen, turns with the tablet). Download it on the tablet, allow installs from this source when asked, then Install and Open. <a href="downloads/android/HOW-TO-INSTALL-ON-TABLET.txt">How to install on a tablet</a></p>
|
| 95 |
+
<p class="note"><b>iPad: add to home screen.</b> Open this page in Safari, tap <b>Open app</b> above, then <b>Share</b> (square with an arrow) › <b>Add to Home Screen</b> › <b>Add</b>. It opens full screen like an app and turns with the iPad.</p>
|
| 96 |
</article>
|
| 97 |
<article class="card" id="chef">
|
| 98 |
<div class="top"><img src="chef-app/icon-192.png" alt="" width="56" height="56"><div><h2>Cover Charge for Head Chef</h2><div class="pkg">For the head chef and kitchen</div></div></div>
|
|
|
|
| 124 |
</section>
|
| 125 |
|
| 126 |
<footer>
|
| 127 |
+
<p>Cover Charge prototype v0.1.12 · Demo data only. No real payments, messages or location tracking.</p>
|
| 128 |
</footer>
|
| 129 |
</main>
|
| 130 |
</body>
|
owner-app/_expo/static/js/web/__common-158cd186b0bf136d040aa77de780ee38.js
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
owner-app/_expo/static/js/web/entry-872c16fcefc35aa42a2e871ec021fee0.js
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
owner-app/_expo/static/js/web/index-07c2ec32566b9c1cbc752be67ea8efce.js
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return o}});var t=r(d[0]);r(d[1]);var n=r(d[2]),u=r(d[3]),c=r(d[4]);function o(){return(0,n.canShow)('display')?(0,c.jsx)(u.DisplayBoard,{}):(0,c.jsx)(t.Redirect,{href:n.ENTRY[n.APP_VARIANT]})}},777,[785,12,787,811,6]);
|
| 2 |
+
__d(function(g,_r,_i,_a,_m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.DisplayBoard=function(){const{width:e,height:Y}=(0,n.default)(),_=e>=1e3,q=(0,T.useOwner)(e=>e.site),K=(0,y.useRestaurant)(q),X=(0,y.useOrders)(q),J=(0,y.useBookings)(q),Q=(0,y.useWaitlist)(q),Z=(0,y.useEvents)(q),ee=(0,y.useRatings)(q),se=(0,y.useAudit)(q),le=(0,y.useStore)(e=>e.menu),te=(0,y.useStore)(e=>e.walkIns[q]??0),ae=(0,y.useStore)(e=>e.alertAcks),re=((0,y.useStore)(e=>e.customer),(0,y.useStore)(e=>e.skipMinutes)),oe=(0,y.useNow)(5e3),ne=(0,T.useOwner)(e=>e.staff),ie=(0,T.useOwner)(e=>e.attendance),de=(0,T.useOwner)(e=>e.shifts),ue=(0,T.useOwner)(e=>e.chat),[ce,ge]=(0,s.useState)(!0);l.default.useEffect(()=>{(0,$.ensureAttendance)((0,f.ymd)(oe),oe),(0,v.ensureChat)(oe)},[(0,f.ymd)(oe)]);const he=ie.filter(e=>e.in&&!e.out&&oe.getTime()-new Date(e.in).getTime()<72e6&&oe.getTime()>=new Date(e.in).getTime()),pe=he.length?he.map(e=>F(ne.find(s=>s.id===e.staffId)?.name)).filter(Boolean):['Duty Manager'],[me,be]=(0,s.useState)(null),xe=me&&pe.includes(me)?me:pe[0],[fe,je]=(0,s.useState)(''),[ye,we]=(0,s.useState)('2'),ke=(0,f.ymd)(oe),Te=(0,C.useFrontDoor)(ke,e>Y),ve=(0,B.useDisplaySettings)(q),Ce=ve.privacy,$e=(0,B.usePlan)(q),Be=(0,B.useFloor)(e=>e.live[q]),[Se,Re]=(0,s.useState)('floor'),[Pe,Me]=(0,s.useState)(''),[De,Ae]=(0,s.useState)(null),[Ie,Le]=(0,s.useState)(null),[ze,Ee]=(0,s.useState)(null),[He,Ne]=(0,s.useState)(!1),[We,Oe]=(0,s.useState)(null);l.default.useEffect(()=>{if(!We)return;const e=setTimeout(()=>Oe(null),4500);return()=>clearTimeout(e)},[We]);const Fe=(e,s)=>Ee({title:e,body:s}),Ve=e=>Fe(`Guest details \xb7 ${e.time}`,(0,E.bookingDetails)(e)),Ge=(0,s.useMemo)(()=>(0,p.forecastToday)(K,J,X,Z,oe),[K,J,X,Z,oe.getTime()/6e4|0]),Ue=J.filter(e=>e.date===ke).sort((e,s)=>e.time.localeCompare(s.time)),Ye=te+Ue.filter(e=>e.walkIn&&['seated','finished'].includes(e.status)).reduce((e,s)=>e+s.partySize,0),qe=Ue.filter(e=>!e.walkIn&&'cancelled'!==e.status).reduce((e,s)=>e+s.partySize,0),Ke=Q.filter(e=>'waiting'===e.status||'notified'===e.status).sort((e,s)=>e.number-s.number),Xe=X.filter(e=>!['collected','closed','cancelled'].includes(e.status)).sort((e,s)=>Number('new'===s.status)-Number('new'===e.status)||(e.slotTime??e.createdAt).localeCompare(s.slotTime??s.createdAt)),Je=X.filter(e=>['collected','closed'].includes(e.status)).length,Qe=(0,x.takeawaySlots)(K,X,oe),Ze=Ge.nextHour?Math.min(1.6,Math.max(.8,Ge.nextHour.covers/(.75*K.settings.capacityPerHour))):1,es=(e,s)=>!!(0,z.statusBlock)(e,s,(0,z.linkedBooking)(e,J)),ss=e=>{const s=(0,z.nextStep)(e,(0,z.linkedBooking)(e,J));return!(!s||'table'===s&&!['ready','served'].includes(e.status))},ls=Xe.filter(e=>e.allergies.length&&ss(e)),ts=Ue.filter(e=>e.allergies.length&&!e.allergyAck&&['confirmed','seated'].includes(e.status)&&!Xe.some(s=>s.allergies.length&&(0,z.linkedBooking)(s,[e]))),as=Xe.flatMap(e=>(0,b.readinessFor)(e,K,oe).map(s=>({...s,order:e}))),rs=as.filter(e=>'due'===e.state||'overdue'===e.state),os=as.filter(e=>'upcoming'===e.state).sort((e,s)=>e.due.getTime()-s.due.getTime()),ns=ee.filter(e=>e.stars<=2&&!ae[`rating:${e.id}`]),is=Xe.filter(e=>'new'===e.status&&!e.allergies.length&&(0,f.minsBetween)(new Date(e.createdAt),oe)>=0),ds=le.filter(e=>e.restaurantId===q&&e.soldOut),us=(se.filter(e=>'stamp'===e.kind||'giftcard'===e.kind).slice(0,4),ls.length+ts.length+rs.length+ns.length+is.length),cs=(0,s.useMemo)(()=>(0,S.floorView)($e,J,X,Be??{},oe,K.settings.turnMins),[$e,J,X,Be,oe.getTime()]),gs=$e.areas.some(e=>e.id===Pe)?Pe:$e.areas[0]?.id??'',hs=Object.fromEntries($e.areas.map(e=>{const s=$e.tables.filter(s=>s.areaId===e.id);return[e.id,`${s.filter(e=>'free'===cs[e.name]?.status).length}/${s.length} free`]})),ps=(0,I.hoursFor)(K,oe),ms=ps?(0,f.addMins)(ps.open,-ps.open.getMinutes()):new Date(`${ke}T12:00:00`),bs=ps?(0,f.addMins)(ps.close,120):new Date(`${ke}T23:00:00`),xs=async(e,s)=>{const l=cs[e]?.booking;if(!l||e===s)return;const t=cs[s]?.status;if(t&&!['free','soon'].includes(t))return void Oe('dirty'===t?`Table ${s} needs clearing first.`:`Table ${s} is ${S.STATUS[t].label.toLowerCase()} \u2014 pick a free table.`);await y.repo.bookings.update(l.id,{table:s});const a=Be?.[e]?.stage;B.useFloor.getState().setLive(q,s,{stage:a??'seated',dirty:!1}),B.useFloor.getState().setLive(q,e,{stage:void 0,dirty:!0}),Oe(`${(0,A.privName)(l,Ce)} moved Table ${e} \u2192 ${s}. Table ${e} needs clearing.`)},fs=e=>Fe(`Order ${e.ref} \xb7 details`,(0,W.jsxs)(o.default,{style:{gap:4},children:[(0,W.jsx)(u.T,{weight:"semibold",children:F(e.customerName)}),e.allergies.length?(0,W.jsxs)(u.T,{weight:"bold",colour:k.colours.red,children:["ALLERGY: ",e.allergies.map(e=>`${(0,h.allergenLabel)(e.allergen)} (${(0,h.severityLabel)(e.severity)})`).join(', ')]}):(0,W.jsx)(u.Muted,{children:"No allergies declared."}),e.lines.filter(e=>e.overridden).map((e,s)=>(0,W.jsxs)(u.T,{colour:k.colours.red,children:["OVERRIDE: ",e.name," contains ",e.contains.map(h.allergenLabel).join(', ')]},s)),e.lines.map((e,s)=>(0,W.jsxs)(u.T,{size:15,children:[e.qty,"\xd7 ",e.name,e.notes?` \xb7 \u201c${e.notes}\u201d`:'']},s))]})),js=Ge.hours,ys=Math.max(K.settings.capacityPerHour,...js.map(e=>e.coversHigh)),ws=(0,W.jsxs)(V,{title:`Bookings & waitlist \xb7 ${(0,f.niceDate)(oe)}`,right:(0,W.jsx)(u.Badge,{kind:"gold",label:`${qe} booked \xb7 ${Ye} walk-in covers`}),children:[0===Ue.length?(0,W.jsx)(u.Muted,{children:"No bookings today."}):null,Ue.map(e=>{const s='confirmed'===e.status&&(0,f.minsBetween)(new Date(`${e.date}T${e.time}:00`),oe)>15;return(0,W.jsxs)(o.default,{style:[u.styles.card,{padding:10,opacity:['finished','noshow','cancelled'].includes(e.status)?.5:1,borderColor:e.allergies.length?k.colours.red:s?k.colours.amber:k.colours.border}],children:[(0,W.jsxs)(u.Row,{style:{justifyContent:'space-between'},children:[(0,W.jsxs)(u.T,{weight:"semibold",children:[e.time," \xb7 ",Ce?`${(0,A.privName)(e,!0)} \xb7 ${e.partySize}`:(0,C.walkInLabel)(e)]}),(0,W.jsx)(u.Badge,{kind:'seated'===e.status?'green':'noshow'===e.status?'red':'neutral',label:'noshow'===e.status?'No-show':e.status})]}),(0,W.jsxs)(u.Muted,{children:[e.table?`Table ${e.table}`:e.walkIn?'Table to assign':'Table TBC',e.walkIn?` \xb7 ${e.ref}`:'','none'!==e.security?" \xb7 "+('deposit'===e.security?'Deposit':'Card saved'):'',e.notes?Ce?' \xb7 \u270e':` \xb7 ${e.notes}`:'']}),e.allergies.length&&Ce?(0,W.jsxs)(u.Row,{gap:6,children:[(0,W.jsx)(u.Badge,{kind:"red",label:"\u26a0 Allergy"}),(0,W.jsx)(u.Button,{small:!0,kind:"ghost",label:"Details",onPress:()=>Ve(e)})]}):null,e.allergies.length&&!Ce?(0,W.jsx)(u.Row,{wrap:!0,gap:4,children:e.allergies.map(e=>(0,W.jsx)(u.Badge,{kind:"red",label:`${(0,h.allergenLabel)(e.allergen)} \u2014 ${(0,h.severityLabel)(e.severity)}`},e.allergen))}):null,s?(0,W.jsx)(u.T,{size:13,colour:k.colours.amber,children:"Running late \u2014 15+ min past booking time"}):null,!e.table&&e.walkIn&&'seated'===e.status?(0,W.jsx)(u.Button,{label:"Assign table",onPress:()=>Te.assignTable(e)}):null,'confirmed'===e.status?(0,W.jsxs)(u.Row,{gap:6,children:[(0,W.jsx)(u.Button,{small:!0,label:"Seat",onPress:()=>y.repo.bookings.setStatus(e.id,'seated')}),(0,W.jsx)(u.Button,{small:!0,kind:"secondary",label:"No-show",onPress:()=>y.repo.bookings.setStatus(e.id,'noshow')})]}):'seated'===e.status?(0,W.jsx)(u.Button,{small:!0,kind:"secondary",label:"Finished",onPress:()=>y.repo.bookings.setStatus(e.id,'finished')}):null]},e.id)}),(0,W.jsxs)(u.Row,{style:{justifyContent:'space-between',marginTop:6},children:[(0,W.jsxs)(u.T,{weight:"semibold",colour:k.colours.gold,children:["Waitlist (",Ke.length,")"]}),(0,W.jsxs)(u.Muted,{children:["~",(0,j.estimateWait)(Ke.length+1,K.settings.turnMins,Ze)," min for a new party (est.)"]})]}),Ke.map((e,s)=>(0,W.jsxs)(o.default,{style:[u.styles.card,{padding:10}],children:[(0,W.jsxs)(u.Row,{style:{justifyContent:'space-between'},children:[(0,W.jsxs)(u.T,{weight:"semibold",children:["#",e.number," ",(0,A.pv)(e.name,Ce)," \xb7 ",e.partySize]}),(0,W.jsxs)(u.Muted,{children:["waiting ",(0,f.minsBetween)(new Date(e.joinedAt),oe)," min \xb7 est. ",(0,j.estimateWait)(s+1,K.settings.turnMins,Ze)," min"]})]}),'notified'===e.status?(0,W.jsx)(u.Badge,{kind:"green",label:"Notified \u2014 table ready"}):null,(0,W.jsxs)(u.Row,{gap:6,children:['waiting'===e.status?(0,W.jsx)(u.Button,{small:!0,kind:"secondary",label:"Notify",onPress:()=>y.repo.waitlist.setStatus(e.id,'notified')}):null,(0,W.jsx)(u.Button,{small:!0,label:"Seat",onPress:()=>y.repo.waitlist.setStatus(e.id,'seated')}),(0,W.jsx)(u.Button,{small:!0,kind:"ghost",label:"Remove",onPress:()=>y.repo.waitlist.setStatus(e.id,'removed')})]})]},e.id)),(0,W.jsxs)(u.Row,{gap:6,children:[(0,W.jsx)(r.default,{accessibilityLabel:"Waitlist name",placeholder:"Name for the waitlist",placeholderTextColor:"#7D776C",value:fe,onChangeText:je,style:[u.styles.input,{flex:1,paddingVertical:6}]}),(0,W.jsx)(r.default,{accessibilityLabel:"Party size",value:ye,onChangeText:we,keyboardType:"number-pad",style:[u.styles.input,{width:50,paddingVertical:6}]}),(0,W.jsx)(u.Button,{small:!0,label:"Add",disabled:fe.trim().length<2,onPress:()=>{y.repo.waitlist.join(q,fe.trim(),Math.max(1,Number(ye)||2)),je('')}})]})]}),ks=(0,W.jsxs)(V,{title:"Live orders & kitchen tickets",right:(0,W.jsxs)(u.Row,{gap:6,children:[(0,W.jsx)(u.Chip,{label:"Tickets",selected:ce,onPress:()=>ge(!0)}),(0,W.jsx)(u.Chip,{label:"Full orders",selected:!ce,onPress:()=>ge(!1)})]}),children:[(0,W.jsxs)(u.Muted,{children:[Xe.length," live \xb7 ",Je," done today"]}),0===Xe.length?(0,W.jsx)(u.Muted,{children:"No live orders."}):null,ce?(0,W.jsxs)(o.default,{style:{flexDirection:'row',flexWrap:'wrap',gap:8},children:[Xe.filter(e=>['new','acknowledged','preparing'].includes(e.status)).map(e=>{const s=Math.max(0,(0,f.minsBetween)(new Date(e.createdAt),oe)),l=s>=20?k.colours.red:s>=12?k.colours.amber:k.colours.green;return(0,W.jsxs)(o.default,{testID:`ticket-${e.ref}`,style:{width:210,backgroundColor:'#F4EFE3',borderRadius:6,padding:8,gap:3,borderTopWidth:6,borderTopColor:e.allergies.length?k.colours.red:l},children:[(0,W.jsxs)(u.Row,{style:{justifyContent:'space-between'},children:[(0,W.jsx)(u.T,{weight:"bold",colour:"#111",children:'table'===e.type?`TABLE ${e.tableNo}`:`TAKEAWAY ${e.slotTime?(0,f.hm)(new Date(e.slotTime)):''}`}),(0,W.jsxs)(u.T,{size:13,weight:"bold",colour:s>=20?'#B3261E':'#333',children:[s,"m"]})]}),(0,W.jsxs)(u.T,{size:12,colour:"#444",children:[e.ref," \xb7 ",e.status.toUpperCase()]}),e.allergies.length?(0,W.jsx)(o.default,{style:{backgroundColor:'#B3261E',borderRadius:4,padding:4},children:(0,W.jsxs)(u.T,{size:13,weight:"bold",colour:"#fff",children:["\u26a0 ",Ce?'ALLERGY \u2014 see details':e.allergies.map(e=>(0,h.allergenLabel)(e.allergen)).join(', ').toUpperCase()]})}):null,e.lines.map((e,s)=>(0,W.jsxs)(u.T,{size:15,weight:"semibold",colour:"#111",children:[e.qty,"\xd7 ",e.name,e.choices.length?` (${e.choices.join(', ')})`:'']},s)),e.lines.some(e=>e.notes)?(0,W.jsx)(u.T,{size:12,colour:"#444",children:Ce?'Notes \u2014 see details':`Notes: ${e.lines.filter(e=>e.notes).map(e=>e.notes).join(' \xb7 ')}`}):null,Ce&&(e.allergies.length||e.lines.some(e=>e.notes))?(0,W.jsx)(u.Button,{small:!0,kind:"secondary",label:"Details",onPress:()=>fs(e)}):null,e.allergies.length?(0,W.jsx)(L.AllergyChain,{o:e,me:xe,compact:!0}):null,'new'===e.status?(0,W.jsx)(u.Button,{small:!0,label:es(e,'acknowledged')?'Sign off allergy first':'Acknowledge',disabled:es(e,'acknowledged'),onPress:()=>y.repo.orders.setStatus(e.id,'acknowledged',xe)}):null,'acknowledged'===e.status?(0,W.jsx)(u.Button,{small:!0,label:"Start",onPress:()=>'takeaway'===e.type?y.repo.orders.acknowledgeReadiness(e.id,'cook',xe):y.repo.orders.setStatus(e.id,'preparing',xe)}):null,'preparing'===e.status?(0,W.jsx)(u.Button,{small:!0,kind:"success",label:'takeaway'===e.type?'Ready':'Food out',disabled:es(e,'takeaway'===e.type?'ready':'served'),onPress:()=>y.repo.orders.setStatus(e.id,'takeaway'===e.type?'ready':'served',xe)}):null]},e.id)}),Xe.filter(e=>['ready','served'].includes(e.status)).map(e=>(0,W.jsxs)(o.default,{style:{width:210,backgroundColor:k.colours.surface2,borderRadius:6,padding:8,gap:3,borderTopWidth:6,borderTopColor:k.colours.green},children:[(0,W.jsxs)(u.Row,{style:{justifyContent:'space-between'},children:[(0,W.jsx)(u.T,{weight:"bold",children:'table'===e.type?`Table ${e.tableNo}`:`Takeaway ${e.ref}`}),(0,W.jsx)(u.Badge,{kind:U(e.status),label:e.status.toUpperCase()})]}),(0,W.jsxs)(u.Muted,{children:[(0,A.pv)(e.customerName,Ce),'here'===e.customerSignal?' \xb7 CUSTOMER IS HERE':'']}),e.allergies.length?(0,W.jsx)(L.AllergyChain,{o:e,me:xe,compact:!0}):null,'ready'===e.status?(0,W.jsx)(u.Button,{small:!0,label:"Collected",testID:`collected-${e.ref}`,disabled:es(e,'collected'),onPress:()=>y.repo.orders.setStatus(e.id,'collected',xe)}):null,'served'===e.status?(0,W.jsx)(u.Button,{small:!0,kind:"secondary",label:"Paid at till",onPress:()=>y.repo.orders.payTable(e.id,{shares:99})}):null]},e.id))]}):null,ce?null:Xe.map(e=>{const s=e.allergies.length>0&&ss(e),l=e.lines.filter(e=>e.overridden),t=e.lines.filter(e=>e.contains.length||e.may.length);return(0,W.jsxs)(o.default,{testID:`order-${e.ref}`,style:[u.styles.card,{padding:10,borderColor:s?k.colours.red:'ready'===e.status?k.colours.green:k.colours.border,borderWidth:s?2:1}],children:[(0,W.jsxs)(u.Row,{style:{justifyContent:'space-between'},children:[(0,W.jsxs)(u.Row,{gap:6,children:[(0,W.jsx)(u.T,{weight:"bold",children:e.ref}),(0,W.jsx)(u.Badge,{kind:'takeaway'===e.type?'gold':'blue',label:'takeaway'===e.type?`Takeaway \xb7 ${e.slotTime?(0,f.hm)(new Date(e.slotTime)):''}`:`Table ${e.tableNo}`})]}),(0,W.jsx)(u.Badge,{kind:U(e.status),label:e.status.toUpperCase()})]}),(0,W.jsxs)(u.Muted,{children:[(0,A.pv)(e.customerName,Ce)," \xb7 ",(0,m.gbp)(e.subtotal)," \xb7 ",e.paid>=e.total?'Paid (demo)':e.paid>0?`Part paid ${(0,m.gbp)(e.paid)}`:'Unpaid \u2014 bill at end',e.customerSignal?" \xb7 "+('here'===e.customerSignal?'CUSTOMER IS HERE':'Customer on the way'):'']}),e.allergies.length&&Ce?(0,W.jsxs)(u.Row,{gap:6,children:[(0,W.jsx)(u.Badge,{kind:"red",label:s?'\u26a0 Allergy: sign-off needed':'\u26a0 Allergy (signed off)'}),(0,W.jsx)(u.Button,{small:!0,kind:"ghost",label:"Details",onPress:()=>fs(e)})]}):null,e.allergies.length&&!Ce?(0,W.jsxs)(o.default,{style:{backgroundColor:k.colours.redBg,borderRadius:8,padding:8,borderLeftWidth:5,borderLeftColor:k.colours.red},children:[(0,W.jsxs)(u.T,{weight:"bold",colour:"#FFE3DF",children:["ALLERGY: ",e.allergies.map(e=>`${(0,h.allergenLabel)(e.allergen)} (${(0,h.severityLabel)(e.severity)})`).join(', ')]}),l.length?(0,W.jsxs)(u.T,{size:14,weight:"semibold",colour:"#FFE3DF",children:["Customer OVERRODE block on: ",l.map(e=>`${e.name} [contains ${e.contains.map(h.allergenLabel).join(', ')}]`).join('; ')]}):null,t.filter(e=>!e.overridden&&e.may.length).map((e,s)=>(0,W.jsxs)(u.T,{size:14,colour:"#FFE2A8",children:["May contain: ",e.name," [",e.may.map(h.allergenLabel).join(', '),"]"]},s))]}):null,e.allergies.length?(0,W.jsx)(L.AllergyChain,{o:e,me:xe}):null,e.lines.map((e,s)=>(0,W.jsxs)(u.T,{size:15,children:[e.qty,"\xd7 ",e.name,e.choices.length?` \u2014 ${e.choices.join(', ')}`:'',e.notes?Ce?' \xb7 \u270e':` \xb7 \u201c${e.notes}\u201d`:'']},s)),(0,W.jsxs)(u.Row,{wrap:!0,gap:6,children:['new'===e.status?(0,W.jsx)(u.Button,{small:!0,label:es(e,'acknowledged')?'Sign off allergy first':'Acknowledge',disabled:es(e,'acknowledged'),onPress:()=>y.repo.orders.setStatus(e.id,'acknowledged',xe)}):null,'acknowledged'===e.status?(0,W.jsx)(u.Button,{small:!0,label:"Start preparing",onPress:()=>'takeaway'===e.type?y.repo.orders.acknowledgeReadiness(e.id,'cook',xe):y.repo.orders.setStatus(e.id,'preparing',xe)}):null,'preparing'===e.status&&'takeaway'===e.type?(0,W.jsx)(u.Button,{small:!0,kind:"success",label:"Mark ready (notify customer)",disabled:es(e,'ready'),onPress:()=>y.repo.orders.setStatus(e.id,'ready',xe)}):null,'preparing'===e.status&&'table'===e.type?(0,W.jsx)(u.Button,{small:!0,kind:"success",label:"Food out",disabled:es(e,'served'),onPress:()=>y.repo.orders.setStatus(e.id,'served',xe)}):null,'ready'===e.status?(0,W.jsx)(u.Button,{small:!0,label:"Collected",disabled:es(e,'collected'),onPress:()=>y.repo.orders.setStatus(e.id,'collected',xe)}):null,'served'===e.status?(0,W.jsx)(u.Button,{small:!0,kind:"secondary",label:"Paid at till",onPress:()=>y.repo.orders.payTable(e.id,{shares:99})}):null]})]},e.id)})]}),Ts=({colour:e,title:s,children:l})=>(0,W.jsxs)(o.default,{style:{backgroundColor:k.colours.surface2,borderRadius:10,padding:10,borderLeftWidth:6,borderLeftColor:e,gap:4},children:[(0,W.jsx)(u.T,{weight:"bold",colour:e,children:s}),l]}),vs={cook:'START COOKING',bag:'BAG IT',ready:'READY'},Cs=(0,W.jsxs)(V,{title:"Allergy & takeaway alerts",right:(0,W.jsx)(u.Badge,{kind:us?'red':'green',label:`${us} need action`}),children:[ls.map(e=>(0,W.jsxs)(Ts,{colour:k.colours.red,title:`ALLERGY \u2014 ${e.ref} ${'table'===e.type?`(Table ${e.tableNo})`:'(takeaway)'}`,children:[Ce?(0,W.jsx)(u.Button,{small:!0,kind:"secondary",label:"Show allergy details",onPress:()=>fs(e)}):(0,W.jsx)(u.T,{size:15,children:e.allergies.map(e=>`${(0,h.allergenLabel)(e.allergen)} \u2014 ${(0,h.severityLabel)(e.severity)}`).join('; ')}),Ce?null:e.lines.filter(e=>e.overridden).map((e,s)=>(0,W.jsxs)(u.T,{size:14,colour:k.colours.red,weight:"semibold",children:["OVERRIDE: ",e.name," contains ",e.contains.map(h.allergenLabel).join(', ')]},s)),(0,W.jsx)(L.AllergyChain,{o:e,me:xe,compact:!0})]},e.id)),ts.map(e=>(0,W.jsxs)(Ts,{colour:k.colours.red,title:`ALLERGY \u2014 booking ${e.time} ${(0,A.privName)(e,Ce)} (${e.partySize})`,children:[Ce?(0,W.jsx)(u.Button,{small:!0,kind:"secondary",label:"Show allergy details",onPress:()=>Ve(e)}):(0,W.jsx)(u.T,{size:15,children:e.allergies.map(e=>`${(0,h.allergenLabel)(e.allergen)} \u2014 ${(0,h.severityLabel)(e.severity)}`).join('; ')}),(0,W.jsx)(L.BookingAllergyChain,{b:e,me:xe})]},e.id)),rs.map(e=>(0,W.jsxs)(Ts,{colour:'overdue'===e.state?k.colours.red:k.colours.amber,title:`${vs[e.stage]} \u2014 ${e.order.ref} \xb7 pickup ${(0,f.hm)(new Date(e.order.slotTime))}${'overdue'===e.state?' \xb7 OVERDUE':''}`,children:[(0,W.jsx)(u.T,{size:14,children:e.detail}),(0,W.jsxs)(u.Muted,{children:["Due ",(0,f.hm)(e.due)," (slot \u2212 prep \u2212 ",K.settings.bufferMins," min buffer)",e.order.allergies.length?' \xb7 \u26a0 allergy order':'']}),'ready'===e.stage?(0,W.jsx)(u.Button,{small:!0,kind:"success",label:"Mark ready (notify customer)",onPress:()=>y.repo.orders.setStatus(e.orderId,'ready',xe)}):(0,W.jsx)(u.Button,{small:!0,label:'cook'===e.stage?'Started cooking':'Bagged & checked',disabled:es(e.order,'preparing'),onPress:()=>y.repo.orders.acknowledgeReadiness(e.orderId,e.stage,xe)})]},e.id)),is.map(e=>(0,W.jsx)(Ts,{colour:k.colours.amber,title:`New order ${e.ref} \u2014 not yet acknowledged`,children:(0,W.jsx)(u.Button,{small:!0,label:"Acknowledge",onPress:()=>y.repo.orders.setStatus(e.id,'acknowledged',xe)})},e.id)),ns.map(e=>(0,W.jsxs)(Ts,{colour:k.colours.red,title:`LOW RATING ${e.stars}/5 \u2014 ${e.context}`,children:[Ce?(0,W.jsx)(u.Button,{small:!0,kind:"secondary",label:"Show comment",onPress:()=>Fe(`Rating ${e.stars}/5`,(0,W.jsxs)(u.T,{children:[F(e.customerName),e.comment?`: \u201c${e.comment}\u201d`:'']}))}):(0,W.jsxs)(u.T,{size:15,children:[e.customerName,e.comment?`: \u201c${e.comment}\u201d`:'']}),(0,W.jsx)(u.Muted,{children:"Manager: speak to the guest while they\u2019re still here."}),(0,W.jsx)(u.Button,{small:!0,kind:"secondary",label:`Handled \u2014 ${xe}`,onPress:()=>y.repo.alerts.acknowledge(`rating:${e.id}`,xe)})]},e.id)),0===us?(0,W.jsx)(u.Muted,{children:"No alerts need action."}):null,os.length?(0,W.jsxs)(o.default,{style:{gap:4},children:[(0,W.jsx)(u.T,{weight:"semibold",colour:k.colours.gold,children:"Upcoming takeaway timings"}),os.slice(0,6).map(e=>(0,W.jsxs)(u.T,{size:14,children:[(0,f.hm)(e.due)," \xb7 ",vs[e.stage]," \xb7 ",e.order.ref," (pickup ",(0,f.hm)(new Date(e.order.slotTime)),")"]},e.id))]}):null,ds.length?(0,W.jsx)(Ts,{colour:k.colours.muted,title:"Sold out",children:(0,W.jsx)(u.T,{size:14,children:ds.map(e=>e.name).join(', ')})}):null,(0,W.jsxs)(o.default,{style:{gap:2,marginTop:6},children:[(0,W.jsx)(u.T,{weight:"semibold",colour:k.colours.gold,children:"Allergy log"}),Ce?(0,W.jsxs)(u.Muted,{children:[se.filter(e=>'allergy'===e.kind).length," entries today \u2014 full log in the Managers app (privacy mode)."]}):se.filter(e=>'allergy'===e.kind).slice(0,5).map(e=>(0,W.jsxs)(u.T,{size:13,colour:"#FFD9D4",children:[(0,f.hm)(new Date(e.at))," \xb7 ",e.text]},e.id))]})]}),$s=de.filter(e=>e.day===(0,$.weekday)(oe)&&!he.some(s=>s.staffId===e.staffId)&&60*e.start>60*oe.getHours()+oe.getMinutes()).sort((e,s)=>e.start-s.start),Bs=ue.filter(e=>'all'===e.ch&&!e.removed).sort((e,s)=>Number(!!s.pinned)-Number(!!e.pinned)||s.at.localeCompare(e.at)).slice(0,6),Ss=(0,W.jsxs)(o.default,{style:{flex:.8,gap:10},children:[(0,W.jsxs)(V,{title:"Who's on",right:(0,W.jsx)(u.Badge,{kind:"green",label:`${he.length} clocked in`}),children:[0===he.length?(0,W.jsx)(u.Muted,{children:"Nobody clocked in yet."}):null,he.map(e=>{const s=ne.find(s=>s.id===e.staffId),l=de.find(s=>s.staffId===e.staffId&&s.day===(0,$.weekday)(oe));return(0,W.jsxs)(u.Row,{style:{justifyContent:'space-between'},children:[(0,W.jsx)(N.StaffAvatar,{id:e.staffId,size:34}),(0,W.jsxs)(o.default,{style:{flex:1},children:[(0,W.jsx)(u.T,{weight:"semibold",children:F(s?.name)}),(0,W.jsxs)(u.Muted,{children:[s?.job,l?` \xb7 rota ${(0,$.fmtH)(l.start)}\u2013${(0,$.fmtH)(l.end)}`:'']})]}),(0,W.jsx)(u.Badge,{kind:"green",label:`in ${(0,f.hm)(new Date(e.in))}`})]},e.id)}),$s.map(e=>(0,W.jsxs)(u.Muted,{children:["Due in ",(0,$.fmtH)(e.start),": ",F(ne.find(s=>s.id===e.staffId)?.name)]},e.id))]}),(0,W.jsxs)(V,{title:"Staff announcements",right:(0,W.jsx)(u.Muted,{children:"All staff chat"}),children:[0===Bs.length?(0,W.jsx)(u.Muted,{children:"No announcements."}):null,Bs.map(e=>(0,W.jsxs)(o.default,{style:{gap:2,borderLeftWidth:3,borderLeftColor:e.pinned?k.colours.gold:k.colours.border,paddingLeft:8},children:[(0,W.jsxs)(u.T,{size:12,colour:e.pinned?k.colours.gold:k.colours.muted,children:[e.pinned?'\ud83d\udccc ':'','system'===e.from?'Cover Charge':F(ne.find(s=>s.id===e.from)?.name)," \xb7 ",(0,f.hm)(new Date(e.at))]}),(0,W.jsx)(u.T,{size:14,children:e.text??(e.photo?`Photo: ${e.photo.caption}`:'')})]},e.id)),(0,W.jsx)(u.Muted,{children:"Read-only on the display. Post from Cover Charge for Staff or Cover Charge for Managers."})]})]}),Rs=_||e>=900,Ps=(0,W.jsx)(E.WaitlistPanel,{rid:q,r:K,plan:$e,view:cs,todays:Ue,waiting:Ke,now:oe,privacy:Ce,busy:Ze,onToast:Oe}),Ms=(0,W.jsx)(E.PacePanel,{r:K,fc:Ge,todays:Ue,now:oe,walkInCount:te,staffOn:he.length||1,onSummary:()=>Ne(!0)}),Ds=s=>Rs?(0,W.jsx)(t.default,{style:{width:e>=1200?340:300,flexGrow:0},contentContainerStyle:{gap:10,paddingBottom:20},children:s}):(0,W.jsx)(o.default,{style:{gap:10},children:s}),As=(0,W.jsxs)(o.default,{style:{flex:1,flexDirection:Rs?'row':'column',gap:10,padding:12,paddingTop:6},children:[(0,W.jsxs)(o.default,{style:{flex:1,gap:6,minHeight:Rs?void 0:420},children:[(0,W.jsx)(E.ArrivalsStrip,{todays:Ue,now:oe,privacy:Ce}),(0,W.jsx)(P.AreaTabs,{plan:$e,area:gs,onPick:Me,counts:hs}),Ie?(0,W.jsxs)(u.Row,{gap:8,style:{backgroundColor:k.colours.goldTint,borderRadius:10,padding:8},children:[(0,W.jsxs)(u.T,{weight:"semibold",colour:k.colours.goldLight,style:{flex:1},children:["Moving the party from Table ",Ie,": tap the new table (or drag it there)."]}),(0,W.jsx)(u.Button,{small:!0,kind:"ghost",label:"Cancel",onPress:()=>Le(null)})]}):null,(0,W.jsx)(o.default,{style:{flex:1,minHeight:Rs?300:Math.min(520,.62*e)},children:(0,W.jsx)(R.FloorCanvas,{plan:$e,areaId:gs,mode:"live",fit:"contain",view:cs,privacy:Ce,sectionColours:!0,turnBase:K.settings.turnMins,highlight:Ie?[Ie]:void 0,onTap:e=>{Ie?(e.name!==Ie&&xs(Ie,e.name),Le(null)):Ae(e.name)},onDrop:(e,s)=>xs(e.name,s.name)})}),(0,W.jsx)(E.Legend,{})]}),Ds((0,W.jsxs)(W.Fragment,{children:[Ps,Ms]}))]}),Is=(0,W.jsxs)(o.default,{style:{flex:1,flexDirection:Rs?'row':'column',gap:10,padding:12,paddingTop:6},children:[(0,W.jsx)(o.default,{style:{flex:1,minHeight:420},children:(0,W.jsx)(M.Timeline,{plan:$e,bookings:Ue,now:oe,privacy:Ce,turnBase:K.settings.turnMins,t0:ms,t1:bs,onOpen:e=>{const s=(0,B.tablesOf)(e.table)[0];s&&cs[s]?Ae(s):Ve(e)}})}),Ds((0,W.jsx)(W.Fragment,{children:Ps}))]}),Ls=(0,W.jsxs)(t.default,{style:{flex:1},contentContainerStyle:{padding:12,gap:10,flexGrow:1},scrollEnabled:!_,children:[(0,W.jsxs)(u.Row,{wrap:!0,style:{gap:6},children:[(0,W.jsx)(u.Muted,{children:"Signing off as (who's on):"}),pe.map(e=>(0,W.jsx)(u.Chip,{label:e,selected:xe===e,onPress:()=>be(e)},e))]}),(0,W.jsxs)(o.default,{testID:"forecast-strip",style:{gap:8},children:[(0,W.jsxs)(u.Row,{wrap:!0,gap:8,style:{alignItems:'stretch'},children:[(0,W.jsx)(G,{label:"Next hour"+(Ge.nextHour?` \xb7 ${String(Ge.nextHour.hour).padStart(2,'0')}:00\u2013${String(Ge.nextHour.hour+1).padStart(2,'0')}:00`:''),badge:"Estimate",value:Ge.nextHour?`${Ge.nextHour.coversLow}\u2013${Ge.nextHour.coversHigh} covers`:Ge.open?'Kitchen closing':'Closed',sub:Ge.nextHour?`${Ge.nextHour.booked} booked + ~${Ge.nextHour.walkIns} walk-ins \xb7 ~${Ge.nextHour.takeaway} takeaway (${Ge.nextHour.takeawayPlaced} placed)`:void 0}),(0,W.jsx)(G,{label:"Rest of today",badge:"Estimate",value:Ge.open?`${Ge.restOfDay.low}\u2013${Ge.restOfDay.high} covers`:'\u2014',sub:Ge.open?`${Ge.restOfDay.booked} booked \xb7 ~${Ge.restOfDay.takeaway} takeaway orders \xb7 ${Ye} walk-in covers seated so far`:void 0}),(0,W.jsx)(G,{label:"Waitlist",value:`${Ke.length} part${1===Ke.length?'y':'ies'}`,sub:`${Ke.reduce((e,s)=>e+s.partySize,0)} covers \xb7 next wait ~${(0,j.estimateWait)(Ke.length+1,K.settings.turnMins,Ze)} min (est.)`}),(0,W.jsx)(G,{label:"Takeaway slots",value:K.settings.takeawayPaused?'PAUSED':`${Qe.filter(e=>!e.full).length} open`,sub:`Cap ${K.settings.slotCap} per ${K.settings.slotMinutes} min`,children:(0,W.jsxs)(u.Row,{gap:8,children:[(0,W.jsx)(a.default,{accessibilityLabel:"Pause takeaway slots",value:K.settings.takeawayPaused,onValueChange:e=>y.repo.restaurants.updateSettings(q,{takeawayPaused:e}),trackColor:{true:k.colours.redSolid,false:'#444'}}),(0,W.jsx)(u.T,{size:14,children:K.settings.takeawayPaused?'Resume':'Pause'})]})}),(0,W.jsx)(G,{label:"Walk-ins seated (today)",value:`${Ye} covers`,sub:"Use Walk-in above; or quick-count here without a table",children:(0,W.jsx)(u.Row,{gap:6,children:[1,2,4].map(e=>(0,W.jsx)(u.Button,{small:!0,kind:"secondary",label:`+${e}`,onPress:()=>y.repo.waitlist.addWalkIn(q,e)},e))})})]}),(0,W.jsxs)(u.Row,{wrap:!0,gap:12,style:{backgroundColor:k.colours.surface,borderRadius:12,padding:10,borderWidth:1,borderColor:k.colours.border,alignItems:'flex-end'},children:[(0,W.jsxs)(o.default,{style:{gap:2,flexBasis:340,flexGrow:1},children:[(0,W.jsxs)(u.Row,{gap:6,children:[(0,W.jsx)(u.T,{weight:"semibold",colour:k.colours.gold,children:"Forecast \u2014 suggested actions"}),(0,W.jsx)(u.Badge,{kind:"amber",label:"ESTIMATE"})]}),Ge.suggestions.map((e,s)=>(0,W.jsxs)(u.T,{size:14,children:["\u2022 ",e]},s)),(0,W.jsxs)(u.Muted,{children:[Ge.flags.length?`Calendar flags today: ${Ge.flags.join(', ')} \xb7 `:'',"Baseline v1: confirmed bookings + example weekday/hour averages + expected walk-ins (",Math.round(100*K.settings.walkInShare),"% share). ",w.EXAMPLE_ACCURACY,"."]})]}),(0,W.jsx)(u.Row,{gap:4,style:{alignItems:"flex-end"},children:js.map(e=>{const s=Ge.nextHour?.hour===e.hour;return(0,W.jsxs)(o.default,{style:{alignItems:'center',width:30},children:[(0,W.jsx)(u.T,{size:11,colour:k.colours.muted,children:e.covers}),(0,W.jsxs)(o.default,{style:{height:70,width:18,justifyContent:'flex-end',borderBottomWidth:1,borderColor:k.colours.border},children:[(0,W.jsx)(o.default,{style:{height:e.walkIns/ys*70,backgroundColor:s?k.colours.goldLight:'#6B5A3A'}}),(0,W.jsx)(o.default,{style:{height:e.booked/ys*70,backgroundColor:s?k.colours.gold:'#9C7C45'}})]}),(0,W.jsx)(u.T,{size:11,colour:s?k.colours.gold:k.colours.muted,children:e.hour})]},e.hour)})})]})]}),(0,W.jsxs)(o.default,{style:{flexDirection:_?'row':'column',gap:10,flex:_?1:void 0,minHeight:_?380:void 0},children:[ws,(0,W.jsx)(o.default,{style:{flex:1.5,gap:10},children:ks}),Cs,Ss]})]}),zs=(0,W.jsx)(t.default,{style:{flex:1},contentContainerStyle:{padding:12,gap:10},children:(0,W.jsx)(P.FloorEditor,{rid:q,compact:!Rs,maxH:Math.max(300,Y-330)})});return(0,W.jsxs)(i.SafeAreaView,{style:{flex:1,backgroundColor:k.colours.bg},children:[(0,W.jsxs)(u.Row,{wrap:!0,style:{paddingHorizontal:14,paddingVertical:6,gap:10,borderBottomWidth:1,borderBottomColor:k.colours.border},children:[(0,W.jsx)(c.RestaurantBrand,{rid:K.id,size:48,sub:"Display \xb7 Harbour View, Dunure"}),(0,W.jsx)(o.default,{style:{flex:1}}),Ce?(0,W.jsx)(u.Badge,{kind:"gold",label:"\ud83d\udd12 Privacy on"}):(0,W.jsx)(u.Badge,{kind:"amber",label:"Privacy off"}),us?(0,W.jsx)(H.default,{accessibilityRole:"button",accessibilityLabel:"Open alerts",onPress:()=>Re('board'),children:(0,W.jsx)(u.Badge,{kind:"red",label:`${us} alert${us>1?'s':''}`})}):(0,W.jsx)(u.Badge,{kind:"green",label:"All clear"}),(0,W.jsx)(u.T,{size:20,weight:"bold",colour:k.colours.gold,children:(0,f.hm)(oe)}),(0,W.jsx)(u.Muted,{children:(0,f.niceDate)(oe)}),(0,W.jsx)(u.Button,{small:!0,kind:"ghost",label:"Demo +15 min",onPress:()=>re(15)})]}),(0,W.jsxs)(o.default,{testID:"front-door-bar",style:{flexDirection:'row',gap:12,paddingHorizontal:14,paddingTop:8,paddingBottom:4},children:[(0,W.jsx)(u.Button,{label:"Walk-in",onPress:Te.openWalkIn,testID:"add-walkin",style:{flex:1,minHeight:72,borderRadius:18}}),(0,W.jsx)(u.Button,{label:"New booking",onPress:Te.openBooking,testID:"add-booking",style:{flex:1,minHeight:72,borderRadius:18}})]}),(0,W.jsxs)(u.Row,{style:{paddingHorizontal:14,paddingVertical:4,gap:6},children:[O.map(e=>{const s=Se===e.id;return(0,W.jsx)(H.default,{testID:`view-${e.id}`,accessibilityRole:"tab",accessibilityLabel:e.label,accessibilityState:{selected:s},onPress:()=>Re(e.id),style:{minHeight:48,paddingHorizontal:18,justifyContent:'center',borderRadius:12,borderBottomWidth:3,borderBottomColor:s?k.colours.gold:'transparent',backgroundColor:s?k.colours.goldTint:'transparent'},children:(0,W.jsx)(u.T,{weight:"semibold",colour:s?k.colours.goldLight:k.colours.muted,children:e.label})},e.id)}),(0,W.jsx)(o.default,{style:{flex:1}}),(0,W.jsx)(u.Badge,{kind:"gold",label:`${qe} booked \xb7 ${Ye} walk-in covers`})]}),'floor'===Se||'timeline'===Se?Rs?'floor'===Se?As:Is:(0,W.jsx)(t.default,{style:{flex:1},contentContainerStyle:{flexGrow:1},children:'floor'===Se?As:Is}):'plan'===Se?zs:Ls,Te.elements,De?(0,W.jsx)(E.TableSheet,{rid:q,name:De,view:cs,plan:$e,todays:Ue,now:oe,privacy:Ce,turnBase:K.settings.turnMins,onClose:()=>Ae(null),onWalkIn:e=>Te.openWalkInAt(e),onMove:e=>Le(e),onDetails:Ve}):null,ze?(0,W.jsx)(E.DetailsPanel,{title:ze.title,onClose:()=>Ee(null),children:ze.body}):null,He?(0,W.jsx)(E.ServiceSummary,{r:K,todays:Ue,orders:X,waitlistAll:Q,walkInCount:te,onClose:()=>Ne(!1)}):null,We?(0,W.jsx)(o.default,{testID:"floor-toast",pointerEvents:"none",style:{position:'absolute',left:0,right:0,bottom:24,alignItems:'center',zIndex:900},children:(0,W.jsx)(o.default,{style:{backgroundColor:k.colours.surface2,borderColor:k.colours.gold,borderWidth:1.5,borderRadius:14,paddingVertical:10,paddingHorizontal:16,maxWidth:640},children:(0,W.jsx)(u.T,{weight:"semibold",children:We})})}):null,(0,W.jsx)(D.Screensaver,{rid:q,idleMins:ve.idleMins,pinOn:ve.pinOn,pin:ve.pin,tonightCards:ve.tonightCards})]})};var s=_r(d[0]),l=e(s),t=e(_r(d[1])),a=e(_r(d[2])),r=e(_r(d[3])),o=e(_r(d[4])),n=e(_r(d[5])),i=_r(d[6]),u=_r(d[7]),c=_r(d[8]),h=_r(d[9]),p=_r(d[10]),m=_r(d[11]),b=_r(d[12]),x=_r(d[13]),f=_r(d[14]),j=_r(d[15]),y=_r(d[16]),w=_r(d[17]),k=_r(d[18]),T=_r(d[19]),v=_r(d[20]),C=_r(d[21]),$=_r(d[22]),B=_r(d[23]),S=_r(d[24]),R=_r(d[25]),P=_r(d[26]),M=_r(d[27]),D=_r(d[28]),A=_r(d[29]),I=_r(d[30]),L=_r(d[31]),z=_r(d[32]),E=_r(d[33]),H=e(_r(d[34])),N=_r(d[35]),W=_r(d[36]);const O=[{id:'floor',label:'Floor'},{id:'timeline',label:'Timeline'},{id:'board',label:'Board'},{id:'plan',label:'Edit plan'}],F=e=>(e??'').replace(' (example)','');function V({title:e,right:s,children:l,flex:a=1}){return(0,W.jsxs)(o.default,{style:{flex:a,backgroundColor:k.colours.surface,borderRadius:14,borderWidth:1,borderColor:k.colours.border,overflow:'hidden',minHeight:200},children:[(0,W.jsxs)(u.Row,{style:{justifyContent:'space-between',paddingHorizontal:12,paddingVertical:10,borderBottomWidth:1,borderBottomColor:k.colours.border,backgroundColor:k.colours.surface2},children:[(0,W.jsx)(u.T,{weight:"semibold",colour:k.colours.gold,children:e}),s]}),(0,W.jsx)(t.default,{contentContainerStyle:{padding:10,gap:10},children:l})]})}function G({label:e,value:s,sub:l,badge:t,children:a}){return(0,W.jsxs)(o.default,{style:{flex:1,minWidth:170,backgroundColor:k.colours.surface,borderRadius:12,padding:10,borderWidth:1,borderColor:k.colours.border,gap:2},children:[(0,W.jsxs)(u.Row,{style:{justifyContent:'space-between'},children:[(0,W.jsx)(u.T,{size:13,colour:k.colours.muted,weight:"medium",children:e}),t?(0,W.jsx)(u.Badge,{kind:"amber",label:t}):null]}),(0,W.jsx)(u.T,{size:24,weight:"bold",colour:k.colours.text,children:s}),l?(0,W.jsx)(u.T,{size:13,colour:k.colours.muted,children:l}):null,a]})}const U=e=>'new'===e?'red':'ready'===e?'green':'preparing'===e?'amber':'served'===e?'blue':'neutral'},811,[12,133,253,255,109,269,271,790,816,791,807,793,817,794,795,808,796,818,797,802,819,820,821,822,823,824,825,812,814,813,792,826,827,815,245,828,6]);
|
| 3 |
+
__d(function(_g,_r,_i,_a,m,_e,_d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"SLOT_W",{enumerable:!0,get:function(){return h}}),Object.defineProperty(_e,"ROW_H",{enumerable:!0,get:function(){return b}}),_e.Timeline=function({plan:e,bookings:p,now:y,privacy:x,onOpen:j,turnBase:v,t0:C,t1:k,height:w}){const M=(0,t.useMemo)(()=>[{key:'__none',area:'',name:'To assign'},...e.areas.flatMap(t=>e.tables.filter(e=>e.areaId===t.id).map(e=>({key:e.name,area:t.name,name:e.name})))],[e]),T=p.filter(e=>!['cancelled','noshow'].includes(e.status)),R=(0,t.useMemo)(()=>(0,s.clashes)(T,v),[T,v]),z=Math.ceil((k.getTime()-C.getTime())/9e5),$=e=>(e.getTime()-C.getTime())/9e5*h,[_,B]=(0,t.useState)(null),O=(0,t.useRef)(null),E=(0,t.useRef)(null);(0,t.useEffect)(()=>{const e=Math.max(0,$(y)-120);setTimeout(()=>E.current?.scrollTo({x:e,animated:!1}),50)},[]);const[S,W]=(0,t.useState)(''),D=(e,t)=>({onStartShouldSetResponder:()=>!0,onMoveShouldSetResponder:()=>!0,onResponderTerminationRequest:()=>!1,onResponderGrant:e=>{O.current={x:e.nativeEvent.pageX,y:e.nativeEvent.pageY}},onResponderMove:o=>{if(!O.current)return;const r=o.nativeEvent.pageX-O.current.x,n=o.nativeEvent.pageY-O.current.y;Math.abs(r)+Math.abs(n)>=6&&B({id:e.id,dx:r,dy:n,kind:t})},onResponderRelease:o=>{const r=O.current;O.current=null,B(null);const l=o.nativeEvent.pageX-(r?.x??0),d=o.nativeEvent.pageY-(r?.y??0);if(Math.abs(l)+Math.abs(d)<6)return void('move'===t&&j(e));const c=Math.round(l/h);if('stretch'===t){const t=Math.max(30,(0,s.durOf)(e,v)+15*c);return n.repo.bookings.update(e.id,{durationMins:t}),void W(`${(0,u.privName)(e,x)} now ${t} min`)}const f=M.findIndex(t=>t.key===((0,i.tablesOf)(e.table)[0]??'__none')),g=Math.max(0,Math.min(M.length-1,f+Math.round(d/b))),p={};c&&'confirmed'===e.status&&(p.time=(0,a.hm)((0,a.addMins)((0,s.startOf)(e),15*c))),g!==f&&'__none'!==M[g].key&&(p.table=M[g].key),p.time||p.table?(n.repo.bookings.update(e.id,p),W(`${(0,u.privName)(e,x)} \u2192 ${p.table?`Table ${p.table}`:''}${p.table&&p.time?' at ':''}${p.time??''}`)):c&&'confirmed'!==e.status&&W('Seated parties can move table, not time.')}}),I=$(y);return(0,c.jsxs)(r.default,{style:{flex:1,gap:6},testID:"timeline",children:[(0,c.jsxs)(d.Row,{style:{justifyContent:'space-between'},children:[(0,c.jsxs)(d.Row,{gap:8,children:[(0,c.jsx)(d.Badge,{kind:R.size?'red':'green',label:R.size?`${R.size} bookings clash`:'No clashes'}),(0,c.jsx)(d.Muted,{children:"Drag a booking to another table or time \xb7 drag its right edge to change the length"})]}),(0,c.jsx)(r.default,{testID:"clash-count",accessibilityLabel:`clashes ${R.size}`,children:(0,c.jsx)(d.T,{size:13,colour:l.colours.goldLight,children:S})})]}),(0,c.jsx)(r.default,{style:{flex:w?void 0:1,height:w,flexDirection:'row',borderRadius:14,borderWidth:1,borderColor:l.colours.border,overflow:'hidden',backgroundColor:'#0F0E0C'},children:(0,c.jsxs)(o.default,{style:{flex:1},contentContainerStyle:{flexDirection:'row'},children:[(0,c.jsxs)(r.default,{style:{width:f,borderRightWidth:1,borderColor:l.colours.border,backgroundColor:l.colours.surface},children:[(0,c.jsx)(r.default,{style:{height:30,justifyContent:'center',paddingLeft:8,borderBottomWidth:1,borderColor:l.colours.border},children:(0,c.jsx)(d.T,{size:12,colour:l.colours.muted,children:"Table"})}),M.map((e,t)=>(0,c.jsxs)(r.default,{style:{height:b,justifyContent:'center',paddingLeft:8,borderBottomWidth:1,borderColor:'#211E19',borderTopWidth:t>0&&M[t-1].area!==e.area?2:0,borderTopColor:l.colours.gold},children:[(0,c.jsx)(d.T,{size:14,weight:"semibold",children:'__none'===e.key?e.name:`T${e.name}`}),!e.area||0!==t&&M[t-1].area===e.area?null:(0,c.jsx)(d.T,{size:10,colour:l.colours.gold,children:e.area.toUpperCase()})]},e.key))]}),(0,c.jsx)(o.default,{ref:E,horizontal:!0,style:{flex:1},children:(0,c.jsxs)(r.default,{style:{width:z*h},children:[(0,c.jsx)(r.default,{style:{height:30,flexDirection:'row',borderBottomWidth:1,borderColor:l.colours.border},children:Array.from({length:Math.ceil(z/4)},(e,t)=>(0,c.jsx)(r.default,{style:{width:Math.min(4,z-4*t)*h,justifyContent:'center',borderLeftWidth:1,borderColor:l.colours.border},children:(0,c.jsx)(d.T,{size:11,colour:l.colours.muted,numberOfLines:1,style:{paddingLeft:3},children:(0,a.hm)((0,a.addMins)(C,60*t))})},t))}),M.map((e,t)=>{return(0,c.jsxs)(r.default,{testID:`tl-row-${e.key}`,style:{height:b,borderBottomWidth:1,borderColor:'#211E19',borderTopWidth:t>0&&M[t-1].area!==e.area?2:0,borderTopColor:'rgba(207,164,95,0.4)'},children:[Array.from({length:Math.ceil(z/4)},(e,t)=>(0,c.jsx)(r.default,{pointerEvents:"none",style:{position:'absolute',left:4*t*h,top:0,bottom:0,width:1,backgroundColor:'#1E1B16'}},t)),(o=e.key,T.filter(e=>'__none'===o?!e.table:(0,i.tablesOf)(e.table).includes(o))).map(e=>{const t=_?.id===e.id?_:null,o=$((0,s.startOf)(e))+('move'===t?.kind?t.dx:0),n=Math.max(h,(0,s.durOf)(e,v)/15*h+('stretch'===t?.kind?t.dx:0)),i=R.has(e.id);return(0,c.jsxs)(r.default,{testID:`tl-${e.id}`,accessibilityRole:"button",accessibilityLabel:`${(0,u.privName)(e,x)}, ${e.partySize}, ${(0,a.hm)((0,s.startOf)(e))}, ${(0,s.durOf)(e,v)} min${i?', clash':''}`,...D(e,'move'),style:[{position:'absolute',left:o,top:4+('move'===t?.kind?t.dy:0),width:n,height:36,borderRadius:8,backgroundColor:g(e),borderWidth:i?2.5:1,borderColor:i?'#FF6B5E':'rgba(0,0,0,0.4)',paddingHorizontal:6,justifyContent:'center',zIndex:t?40:2,opacity:'finished'===e.status?.55:1,cursor:'grab',touchAction:'none'},t?null:{transitionProperty:'left, width, top',transitionDuration:'200ms'}],children:[(0,c.jsxs)(d.T,{size:12,weight:"semibold",colour:'confirmed'===e.status?'#EAF4FF':'#0B0B0B',numberOfLines:1,children:[i?'\u26a0 ':'',(0,a.hm)((0,s.startOf)(e))," ",(0,u.privName)(e,x)," \xb7 ",e.partySize,e.allergies.length?' \u26a0':'']}),(0,c.jsx)(r.default,{testID:`tl-stretch-${e.id}`,accessibilityLabel:"Change length",...D(e,'stretch'),style:{position:'absolute',right:0,top:0,bottom:0,width:14,borderTopRightRadius:8,borderBottomRightRadius:8,backgroundColor:'rgba(0,0,0,0.25)',cursor:'ew-resize',touchAction:'none'}})]},e.id)})]},e.key);var o}),I>=0&&I<=z*h?(0,c.jsx)(r.default,{testID:"now-line",pointerEvents:"none",style:{position:'absolute',left:I,top:0,bottom:0,width:2,backgroundColor:l.colours.gold,zIndex:30},children:(0,c.jsx)(r.default,{style:{position:'absolute',top:0,left:-18,width:38,backgroundColor:l.colours.gold,borderRadius:6},children:(0,c.jsx)(d.T,{size:10,weight:"bold",colour:"#0B0B0B",center:!0,children:(0,a.hm)(y)})})}):null]})})]})})]})};var t=_r(_d[0]);_r(_d[1]);var o=e(_r(_d[2])),r=e(_r(_d[3])),n=_r(_d[4]),i=_r(_d[5]),s=_r(_d[6]),a=_r(_d[7]),l=_r(_d[8]),d=_r(_d[9]),u=_r(_d[10]),c=_r(_d[11]);const h=30,b=44,f=96,g=e=>'seated'===e.status?'#CFA45F':'finished'===e.status?'#3A352C':e.walkIn?'#B9925A':'#3C78B5'},812,[12,104,133,109,796,822,823,795,797,790,813,6]);
|
| 4 |
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"initials",{enumerable:!0,get:function(){return n}}),Object.defineProperty(e,"pv",{enumerable:!0,get:function(){return t}}),Object.defineProperty(e,"privName",{enumerable:!0,get:function(){return l}});const n=n=>n.replace(' (example)','').split(/\s+/).filter(Boolean).map(n=>`${n[0].toUpperCase()}.`).join(' '),t=(t,l)=>t?l?n(t):t.replace(' (example)',''):'',l=(n,l)=>n.walkIn?`Walk-in ${n.ref}`:t(n.name,l)},813,[]);
|
| 5 |
+
__d(function(g,r,_i,a,m,_e,_d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.Screensaver=function({rid:e,idleMins:n,pinOn:o,pin:i,tonightCards:u}){const[s,l]=(0,t.useState)(!1),[c,d]=(0,t.useState)(!1),[f,w]=(0,t.useState)(''),b=(0,t.useRef)(Date.now()),x=(0,t.useRef)(!1),R=(0,t.useRef)(0);x.current=s;const j=6e4*n;(0,t.useEffect)(()=>{if(!h)return;const e=e=>'pointerdown'===e.type||'touchstart'===e.type||'mousedown'===e.type||'keydown'===e.type,t=t=>{const n=performance.now();return x.current&&e(t)?(t.preventDefault(),t.stopPropagation(),t.stopImmediatePropagation?.(),R.current=n+800,x.current=!1,window.__ccWokeAt=n,l(!1),k.current&&d(!0),void(b.current=Date.now())):n<R.current&&['pointerup','mouseup','touchend','click','pointerdown','mousedown','touchstart'].includes(t.type)?(t.preventDefault(),t.stopPropagation(),void t.stopImmediatePropagation?.()):void(b.current=Date.now())},n=['pointerdown','pointerup','mousedown','mouseup','touchstart','touchend','click','keydown','wheel'];n.forEach(e=>window.addEventListener(e,t,{capture:!0,passive:!1}));const o=setInterval(()=>{!x.current&&!D.current&&Date.now()-b.current>=j&&(x.current=!0,l(!0))},1e3);return()=>{n.forEach(e=>window.removeEventListener(e,t,{capture:!0})),clearInterval(o)}},[j]);const k=(0,t.useRef)(o);k.current=o;const D=(0,t.useRef)(c);return D.current=c,(0,t.useEffect)(()=>{if(!h)return;let e=null;const t=async()=>{try{e=await(navigator.wakeLock?.request?.('screen')),window.__ccWakeLock=e?'on':'unsupported'}catch{window.__ccWakeLock='refused'}};t();const n=()=>{'visible'===document.visibilityState&&t()};return document.addEventListener('visibilitychange',n),()=>{document.removeEventListener('visibilitychange',n);try{e?.release?.()}catch{}}},[]),c?(0,p.jsx)(y,{pin:i,entry:f,setEntry:w,onOk:()=>{d(!1),w(''),b.current=Date.now()}}):s?(0,p.jsx)(v,{rid:e,tonightCards:u}):null};var t=r(_d[0]),n=e(r(_d[1])),o=e(r(_d[2])),i=e(r(_d[3]));r(_d[4]);var u=e(r(_d[5])),s=e(r(_d[6])),l=e(r(_d[7])),c=r(_d[8]),d=r(_d[9]),f=r(_d[10]),p=r(_d[11]);const h='undefined'!=typeof window;function w({w:e,h:i,seed:u}){const s=(0,t.useRef)(new n.default.Value(0)).current,l=e=>{const t=233280*Math.sin(9301*u+49297*e);return t-Math.floor(t)};(0,t.useEffect)(()=>{const e=n.default.loop(n.default.timing(s,{toValue:1,duration:9e3+9e3*l(1),delay:4e3*l(2),easing:o.default.linear,useNativeDriver:!1}));return e.start(),()=>e.stop()},[]);const d=3+5*l(3);return(0,p.jsx)(n.default.View,{pointerEvents:"none",style:{position:'absolute',left:l(4)*e,top:0,width:d,height:d,borderRadius:d,backgroundColor:c.colours.goldLight,shadowColor:c.colours.gold,shadowRadius:6,shadowOpacity:.9,opacity:s.interpolate({inputRange:[0,.15,.8,1],outputRange:[0,.85,.5,0]}),transform:[{translateY:s.interpolate({inputRange:[0,1],outputRange:[i+20,i*(.15+.3*l(5))]})},{translateX:s.interpolate({inputRange:[0,.5,1],outputRange:[0,60*(l(6)-.5),0]})}]}})}function y({pin:e,entry:t,setEntry:n,onOk:o}){const i=i=>{const u=(t+i).slice(0,4);n(u),4===u.length&&(u===e?o():setTimeout(()=>n(''),300))};return(0,p.jsxs)(s.default,{testID:"wake-pin",style:{position:h?'fixed':'absolute',left:0,right:0,top:0,bottom:0,zIndex:1e5,backgroundColor:'rgba(5,5,5,0.97)',alignItems:'center',justifyContent:'center',gap:16},children:[(0,p.jsx)(f.T,{size:22,weight:"semibold",colour:c.colours.gold,children:"Enter staff PIN"}),(0,p.jsxs)(f.T,{size:30,weight:"bold",children:['\u25cf'.repeat(t.length),'\u25cb'.repeat(4-t.length)]}),(0,p.jsx)(s.default,{style:{flexDirection:'row',flexWrap:'wrap',width:252,gap:12,justifyContent:'center'},children:['1','2','3','4','5','6','7','8','9','0'].map(e=>(0,p.jsx)(u.default,{accessibilityRole:"button",accessibilityLabel:`PIN ${e}`,onPress:()=>i(e),style:{width:72,height:72,borderRadius:36,borderWidth:2,borderColor:c.colours.gold,alignItems:'center',justifyContent:'center'},children:(0,p.jsx)(f.T,{size:26,colour:c.colours.gold,children:e})},e))})]})}function v({rid:e}){const{width:u,height:s}=(0,l.default)(),y=(0,t.useRef)({width:u,height:s});y.current={width:u,height:s};const v=(0,d.useBrand)(e),b=d.HERO_LOGOS[e]??v.logo,x=(0,t.useRef)(new n.default.Value(0)).current,R=(0,t.useRef)(new n.default.Value(0)).current,j=(0,t.useRef)(new n.default.ValueXY({x:0,y:0})).current;(0,t.useEffect)(()=>{n.default.timing(x,{toValue:1,duration:700,useNativeDriver:!1}).start();const e=n.default.loop(n.default.sequence([n.default.timing(R,{toValue:1,duration:14e3,easing:o.default.inOut(o.default.quad),useNativeDriver:!1}),n.default.timing(R,{toValue:0,duration:14e3,easing:o.default.inOut(o.default.quad),useNativeDriver:!1})]));e.start();const t=()=>n.default.timing(j,{toValue:{x:(Math.random()-.5)*y.current.width*.18,y:(Math.random()-.5)*y.current.height*.14},duration:6e3,easing:o.default.inOut(o.default.quad),useNativeDriver:!1}).start();t();const i=setInterval(t,2e4);return()=>{e.stop(),clearInterval(i)}},[]);const k=(0,t.useRef)(!0);(0,t.useEffect)(()=>{k.current?k.current=!1:n.default.timing(j,{toValue:{x:0,y:0},duration:500,easing:o.default.out(o.default.quad),useNativeDriver:!1}).start()},[u>s]);const D=.5*Math.min(u,s);return(0,p.jsxs)(n.default.View,{testID:"screensaver",accessibilityLabel:"Screensaver \u2014 touch to wake",style:{position:h?'fixed':'absolute',left:0,top:0,right:0,bottom:0,zIndex:1e5,backgroundColor:'#050505',opacity:x,overflow:'hidden',cursor:'pointer'},children:[Array.from({length:18},(e,t)=>(0,p.jsx)(w,{w:u,h:s,seed:t+1},t)),(0,p.jsx)(n.default.View,{style:{flex:1,alignItems:'center',justifyContent:'center',transform:[{translateX:j.x},{translateY:j.y}]},children:b?(0,p.jsx)(n.default.View,{style:{transform:[{scale:R.interpolate({inputRange:[0,1],outputRange:[1,1.12]})},{translateX:R.interpolate({inputRange:[0,1],outputRange:[-10,10]})}]},children:(0,p.jsx)(i.default,{source:b,style:{width:D,height:D},resizeMode:"contain",accessibilityLabel:`${v.name} logo`})}):(0,p.jsx)(f.T,{size:48,weight:"bold",colour:c.colours.gold,children:v.name})})]})}},814,[12,102,206,178,104,245,109,269,797,816,790,6]);
|
| 6 |
+
__d(function(g,_r,_i,_a,_m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"Card",{enumerable:!0,get:function(){return y}}),_e.ArrivalsStrip=function({todays:e,now:t,privacy:s}){const r=e.filter(e=>'confirmed'===e.status).map(e=>({b:e,m:(0,m.minsBetween)(t,new Date(`${e.date}T${e.time}:00`))})).filter(e=>e.m>=-20&&e.m<=60).sort((e,t)=>e.m-t.m);return(0,p.jsxs)(a.default,{testID:"arrivals-strip",style:{flexDirection:'row',alignItems:'center',gap:8,minHeight:40},children:[(0,p.jsx)(o.T,{size:13,weight:"semibold",colour:j.colours.gold,children:"NEXT HOUR"}),(0,p.jsxs)(l.default,{horizontal:!0,showsHorizontalScrollIndicator:!1,contentContainerStyle:{gap:6},children:[0===r.length?(0,p.jsx)(o.Muted,{children:"No arrivals due in the next hour."}):null,r.map(({b:e,m:t})=>(0,p.jsxs)(a.default,{style:{flexDirection:'row',alignItems:'center',gap:6,paddingHorizontal:10,paddingVertical:5,borderRadius:16,backgroundColor:t<0?j.colours.amberBg:'#12263D',borderWidth:1,borderColor:t<0?j.colours.amber:'#3C78B5'},children:[(0,p.jsx)(o.T,{size:13,weight:"semibold",children:e.time}),(0,p.jsxs)(o.T,{size:13,children:[(0,i.privName)(e,s)," \xb7 ",e.partySize]}),(0,p.jsx)(o.T,{size:12,colour:j.colours.muted,children:e.table?`T${e.table}`:'no table'}),(0,p.jsx)(o.T,{size:12,colour:t<0?j.colours.amber:j.colours.blue,children:t<0?-t+"m late":0===t?'now':`in ${t}m`}),e.allergies.length?(0,p.jsx)(o.T,{size:12,children:"\u26a0"}):null,e.occasion?(0,p.jsx)(o.T,{size:12,children:b.OCCASION_ICON[e.occasion]}):null]},e.id))]})]})},_e.Legend=function(){return(0,p.jsxs)(o.Row,{wrap:!0,gap:10,style:{paddingVertical:2},children:[Object.keys(b.STATUS).map(e=>(0,p.jsxs)(o.Row,{gap:4,children:[(0,p.jsx)(a.default,{style:{width:12,height:12,borderRadius:4,backgroundColor:b.STATUS[e].colour}}),(0,p.jsx)(o.T,{size:12,colour:j.colours.muted,children:b.STATUS[e].label})]},e)),(0,p.jsx)(o.T,{size:12,colour:j.colours.muted,children:"\u26a0 allergy \xb7 \u2605 VIP \xb7 \u2665 regular \xb7 \ud83c\udf82 birthday \xb7 \ud83d\udc8d anniversary"})]})},_e.DetailsPanel=function({title:e,children:s,onClose:l}){const[r,a]=(0,t.useState)(20);return(0,t.useEffect)(()=>{const e=Date.now(),t=()=>a(20-Math.floor((Date.now()-e)/1e3)),s=setInterval(t,1e3),l=setTimeout(t,2e4);return()=>{clearInterval(s),clearTimeout(l)}},[]),(0,t.useEffect)(()=>{r<=0&&l()},[r]),(0,p.jsxs)(o.Sheet,{visible:!0,onClose:l,title:e,maxWidth:560,testID:"private-details",children:[(0,p.jsx)(o.Badge,{kind:"amber",label:`Private \xb7 closes in ${Math.max(0,r)}s`}),s,(0,p.jsx)(o.Button,{kind:"secondary",label:"Close now",onPress:l})]})},Object.defineProperty(_e,"bookingDetails",{enumerable:!0,get:function(){return w}}),_e.TableSheet=function({rid:e,name:l,view:h,plan:x,todays:f,now:y,privacy:w,turnBase:v,onClose:T,onWalkIn:S,onMove:k,onDetails:$}){const C=h[l],M=c.useFloor.getState(),[z,I]=(0,t.useState)(!1),[B,D]=(0,t.useState)(C?.note??''),[P,R]=(0,t.useState)(!1);if(!C)return null;const A=C.booking,O=['seated','mains','dessert','bill'].includes(C.status),N=f.filter(e=>'confirmed'===e.status).sort((e,t)=>Math.abs((0,m.minsBetween)(y,(0,b.startOf)(e)))-Math.abs((0,m.minsBetween)(y,(0,b.startOf)(t)))),W=e=>e.partySize<=C.table.maxSeats,L=(0,b.turnFor)(C.covers||C.table.maxSeats,v);return(0,p.jsxs)(o.Sheet,{visible:!0,onClose:T,title:`Table ${l} \xb7 ${b.STATUS[C.status].label}`,maxWidth:640,testID:"table-sheet",children:[(0,p.jsxs)(o.Row,{wrap:!0,gap:6,children:[(0,p.jsx)(o.Badge,{kind:"neutral",label:`${C.table.minSeats}\u2013${C.table.maxSeats} seats`}),A?(0,p.jsx)(o.Badge,{kind:"gold",label:`${(0,i.privName)(A,w)} \xb7 ${A.partySize} \xb7 ${C.seatedMins}m`}):null,A?(0,p.jsx)(o.Badge,{kind:C.seatedMins>(0,b.durOf)(A,v)?'red':'neutral',label:`Turn ~${(0,b.durOf)(A,v)} min \xb7 free ~${(0,m.hm)((0,b.endOf)(A,v))} (est.)`}):(0,p.jsx)(o.Badge,{kind:"neutral",label:`Turn estimate for ${C.table.maxSeats}: ~${L} min`}),C.next?(0,p.jsx)(o.Badge,{kind:"blue",label:`Next: ${C.next.time} ${(0,i.privName)(C.next,w)} (${C.next.partySize})`}):null,C.allergy?(0,p.jsx)(o.Badge,{kind:"red",label:"\u26a0 Allergy \u2014 see details"}):null]}),O||'blocked'===C.status?null:(0,p.jsxs)(o.Row,{gap:8,children:[(0,p.jsx)(o.Button,{label:"Seat walk-in here",onPress:()=>{T(),S(l)},testID:"seat-walkin-here",style:{flex:1,minHeight:56}}),(0,p.jsx)(o.Button,{kind:"secondary",label:"Seat a booking",onPress:()=>R(!P),testID:"seat-booking-here",style:{flex:1,minHeight:56}})]}),P?(0,p.jsxs)(a.default,{style:{gap:6},children:[0===N.length?(0,p.jsx)(o.Muted,{children:"No bookings left to seat today."}):null,N.slice(0,8).map(t=>(0,p.jsxs)(s.default,{accessibilityRole:"button",accessibilityLabel:`Seat ${(0,i.privName)(t,w)} ${t.time}`,onPress:async()=>{await u.repo.bookings.update(t.id,{table:l}),await u.repo.bookings.setStatus(t.id,'seated'),(0,n.resetTableLive)(e,l),T()},style:{padding:10,borderRadius:10,borderWidth:1,borderColor:W(t)?j.colours.border:j.colours.amber,backgroundColor:j.colours.surface2},children:[(0,p.jsxs)(o.T,{weight:"semibold",children:[t.time," \xb7 ",(0,i.privName)(t,w)," \xb7 ",t.partySize,t.table?` \xb7 booked T${t.table}`:'',t.allergies.length?' \xb7 \u26a0':'']}),W(t)?null:(0,p.jsxs)(o.T,{size:12,colour:j.colours.amber,children:["Bigger than this table (",C.table.maxSeats," max)"]})]},t.id))]}):null,O?(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(o.T,{size:14,colour:j.colours.muted,children:"Course / status"}),(0,p.jsx)(o.Row,{wrap:!0,gap:6,children:b.STAGES.map(t=>(0,p.jsx)(o.Chip,{label:b.STATUS[t].label,selected:C.status===t,onPress:()=>M.setLive(e,l,{stage:t})},t))}),(0,p.jsxs)(o.Row,{wrap:!0,gap:8,children:[A?(0,p.jsx)(o.Button,{kind:"secondary",label:"Move party\u2026",onPress:()=>{T(),k(l)},testID:"move-party"}):null,(0,p.jsx)(o.Button,{kind:"success",label:"Clear table",testID:"clear-table",onPress:async()=>{A&&await u.repo.bookings.setStatus(A.id,'finished'),M.setLive(e,l,{stage:void 0,dirty:!0}),T()}})]})]}):null,'dirty'===C.status?(0,p.jsx)(o.Button,{kind:"success",label:"Mark clean \u2014 table free",onPress:()=>{M.setLive(e,l,{dirty:!1}),T()},testID:"mark-clean"}):null,(0,p.jsxs)(o.Row,{wrap:!0,gap:8,children:[(0,p.jsx)(o.Button,{kind:"secondary",label:'blocked'===C.status?'Unblock table':'Block table',onPress:()=>{M.setLive(e,l,{blocked:'blocked'!==C.status}),T()},testID:"block-table"}),(0,p.jsx)(o.Button,{kind:"ghost",label:C.note?'Edit note':'+ Note',onPress:()=>I(!z)}),A||C.next?(0,p.jsx)(o.Button,{kind:"ghost",label:"Guest details",onPress:()=>{T(),$(A??C.next)},testID:"guest-details"}):null]}),z?(0,p.jsxs)(o.Row,{gap:6,children:[(0,p.jsx)(r.default,{accessibilityLabel:"Table note",value:B,onChangeText:D,placeholder:"e.g. wobbly leg, high chair here",placeholderTextColor:"#7D776C",style:[o.styles.input,{flex:1}]}),(0,p.jsx)(o.Button,{small:!0,label:"Save",onPress:()=>{M.setLive(e,l,{note:B.trim()||void 0}),I(!1)}})]}):null,w?(0,p.jsx)(o.Muted,{children:"Privacy mode: names as initials; tap Guest details for notes and allergies (closes after 20 s)."}):null,x.joins.some(e=>e.tables.includes(l))?(0,p.jsxs)(o.Muted,{children:["Joins with ",x.joins.find(e=>e.tables.includes(l)).tables.filter(e=>e!==l).join(', ')," for bigger parties (book as ",x.joins.find(e=>e.tables.includes(l)).tables.join('+'),")."]}):null]})},_e.WaitlistPanel=function({rid:e,r:l,plan:h,view:f,todays:w,waiting:v,now:T,privacy:S,busy:k,onToast:$}){const[C,M]=(0,t.useState)(''),[z,I]=(0,t.useState)(2),B=(0,c.useFloor)(e=>e.smsLog);return(0,p.jsxs)(y,{title:`Waitlist (${v.length})`,right:(0,p.jsxs)(o.Muted,{children:["new party ~",(0,x.estimateWait)(v.length+1,l.settings.turnMins,k)," min"]}),testID:"waitlist-panel",children:[0===v.length?(0,p.jsx)(o.Muted,{children:"Nobody waiting."}):null,v.map((t,s)=>{const r=(0,b.suggestTable)(h,w,f,t.partySize,T,(0,b.turnFor)(t.partySize,l.settings.turnMins)),y=(0,x.estimateWait)(s+1,l.settings.turnMins,k),v=Math.max(0,(0,m.minsBetween)(new Date(t.joinedAt),T)),C=B.find(s=>s.rid===e&&s.text.includes(`#${t.number} `));return(0,p.jsxs)(a.default,{style:{backgroundColor:j.colours.surface2,borderRadius:10,padding:8,gap:4},children:[(0,p.jsxs)(o.Row,{style:{justifyContent:'space-between'},children:[(0,p.jsxs)(o.T,{weight:"semibold",children:["#",t.number," ",(0,i.pv)(t.name,S)," \xb7 ",t.partySize]}),(0,p.jsxs)(o.T,{size:12,colour:v>y?j.colours.amber:j.colours.muted,children:["waited ",v,"m \xb7 quoted ~",y,"m"]})]}),r?(0,p.jsxs)(o.T,{size:12,colour:r.clashes?j.colours.amber:j.colours.green,children:["Best table: ",r.table," (",r.why,")"]}):(0,p.jsx)(o.T,{size:12,colour:j.colours.amber,children:"No table big enough \u2014 join tables in the plan"}),(0,p.jsxs)(o.Row,{wrap:!0,gap:6,children:[(0,p.jsx)(o.Button,{small:!0,label:C||'notified'===t.status?'Re-send (demo)':'Table ready text (demo)',testID:`sms-${t.number}`,onPress:()=>{c.useFloor.getState().logSms(e,T.toISOString(),`#${t.number} ${t.partySize}: Your table at ${l.name} is ready.`),u.repo.waitlist.setStatus(t.id,'notified'),$(`DEMO \u2014 no text sent. Would say: "Your table at ${l.name} is ready."`)}}),r?(0,p.jsx)(o.Button,{small:!0,kind:"success",label:`Seat at ${r.table}`,onPress:async()=>{await u.repo.waitlist.setStatus(t.id,'seated'),await u.repo.bookings.seatWalkIn(e,t.partySize,r.table,`From waitlist #${t.number}`),(0,n.resetTableLive)(e,r.table),$(`Waitlist #${t.number} seated at ${r.table}`)}}):null,(0,p.jsx)(o.Button,{small:!0,kind:"ghost",label:"Remove",onPress:()=>u.repo.waitlist.setStatus(t.id,'removed')})]}),'notified'===t.status?(0,p.jsx)(o.Badge,{kind:"green",label:`Told table ready${C?` ${(0,m.hm)(new Date(C.at))}`:''} (demo)`}):null]},t.id)}),(0,p.jsxs)(o.Row,{gap:6,children:[(0,p.jsx)(r.default,{accessibilityLabel:"Waitlist name",placeholder:"Name for the waitlist",placeholderTextColor:"#7D776C",value:C,onChangeText:M,style:[o.styles.input,{flex:1,minWidth:0,width:40,paddingVertical:6}]}),(0,p.jsx)(s.default,{accessibilityLabel:"Waitlist party size",onPress:()=>I(e=>e>=8?1:e+1),style:{width:48,height:48,borderRadius:10,borderWidth:1,borderColor:j.colours.gold,alignItems:'center',justifyContent:'center'},children:(0,p.jsx)(o.T,{weight:"bold",colour:j.colours.gold,children:z})}),(0,p.jsx)(o.Button,{small:!0,label:"Add",disabled:C.trim().length<2,onPress:()=>{u.repo.waitlist.join(e,C.trim(),z),M('')}})]})]})},_e.PacePanel=function({r:e,fc:t,todays:s,now:l,walkInCount:r,staffOn:n,onSummary:i}){const u=r+s.filter(e=>['seated','finished'].includes(e.status)).reduce((e,t)=>e+t.partySize,0),c=l.getHours(),h=Math.round(t.hours.filter(e=>e.hour<c).reduce((e,t)=>e+t.covers,0)+(t.hours.find(e=>e.hour===c)?.covers??0)*(l.getMinutes()/60)),x=h?u/h:1,f=x>=1.1?j.colours.amber:x>=.85?j.colours.green:j.colours.blue,w=Array.from({length:8},(e,t)=>{const r=(0,m.addMins)(l,15*(t-4)-l.getMinutes()%15),a=(0,m.addMins)(r,15),o=s.filter(e=>!['cancelled','noshow'].includes(e.status)).filter(e=>{const t=(0,b.startOf)(e);return t>=r&&t<a}).reduce((e,t)=>e+t.partySize,0);return{from:r,covers:o,future:t>=4}}),v=Math.max(4,Math.round(e.settings.capacityPerHour/4)),T=Math.max(v,...w.map(e=>e.covers)),S=w.filter(e=>e.future&&e.covers>v),k=t.nextHour?.covers??0,$=Math.ceil(k/16);return(0,p.jsxs)(y,{title:"Pace & kitchen",right:(0,p.jsx)(o.Badge,{kind:"amber",label:"ESTIMATE"}),testID:"pace-panel",children:[(0,p.jsxs)(a.default,{testID:"pace-meter",accessibilityLabel:`Covers so far ${u} vs forecast ${h}`,style:{gap:4},children:[(0,p.jsxs)(o.Row,{style:{justifyContent:'space-between'},children:[(0,p.jsx)(o.T,{size:14,children:"Covers so far"}),(0,p.jsxs)(o.T,{weight:"bold",colour:f,children:[u," ",(0,p.jsxs)(o.T,{size:13,colour:j.colours.muted,children:["/ ~",h," forecast"]})]})]}),(0,p.jsx)(a.default,{style:{height:10,borderRadius:5,backgroundColor:'#2A2620',overflow:'hidden'},children:(0,p.jsx)(a.default,{style:{width:`${Math.min(100,75*x)}%`,height:10,borderRadius:5,backgroundColor:f}})}),(0,p.jsxs)(o.Muted,{children:[x>=1.1?'Ahead of forecast':x>=.85?'On pace':'Behind forecast'," \xb7 next hour ~",t.nextHour?`${t.nextHour.coversLow}\u2013${t.nextHour.coversHigh}`:0," covers"]})]}),(0,p.jsx)(o.T,{size:13,colour:j.colours.muted,children:"Covers seated per 15 min (last hour \xb7 next hour)"}),(0,p.jsx)(a.default,{testID:"kitchen-pacing",style:{flexDirection:'row',alignItems:'flex-end',gap:4,height:64},children:w.map((e,t)=>(0,p.jsxs)(a.default,{style:{flex:1,alignItems:'center',gap:2},children:[(0,p.jsx)(o.T,{size:10,colour:j.colours.muted,children:e.covers||''}),(0,p.jsx)(a.default,{style:{width:'80%',height:Math.max(2,e.covers/T*40),borderRadius:3,backgroundColor:e.covers>v?j.colours.red:e.future?'#6B5A3A':j.colours.gold}}),(0,p.jsx)(o.T,{size:9,colour:4===t?j.colours.gold:j.colours.muted,children:(0,m.hm)(e.from)})]},t))}),S.map(e=>(0,p.jsxs)(o.T,{size:13,colour:j.colours.amber,children:["\u26a0 Kitchen: ",e.covers," covers due ",(0,m.hm)(e.from),"\u2013",(0,m.hm)((0,m.addMins)(e.from,15))," (pace ~",v,") \u2014 stagger seating if you can."]},e.from.getTime())),$>n?(0,p.jsxs)(o.T,{size:13,colour:j.colours.amber,children:["\u26a0 Next hour ~",k," covers with ",n," on: about ",$-n," more on the floor suggested."]}):(0,p.jsxs)(o.T,{size:13,colour:j.colours.green,children:["Staffing looks OK for the next hour (",n," on)."]}),(0,p.jsx)(o.Button,{small:!0,kind:"secondary",label:"End-of-service summary",onPress:i,testID:"eos-open"})]})},_e.ServiceSummary=function({r:e,todays:t,orders:s,waitlistAll:l,walkInCount:r,onClose:a}){const n=t.filter(e=>['seated','finished'].includes(e.status)),i=n.reduce((e,t)=>e+t.partySize,0)+r,u=t.filter(e=>e.walkIn),h=t.filter(e=>'finished'===e.status&&e.seatedAt&&e.finishedAt).map(e=>(0,m.minsBetween)(new Date(e.seatedAt),new Date(e.finishedAt))),b=s.reduce((e,t)=>e+t.paid,0),x=(0,c.useFloor)(t=>t.smsLog.filter(t=>t.rid===e.id).length),j=(e,t)=>(0,p.jsxs)(o.Row,{style:{justifyContent:'space-between'},children:[(0,p.jsx)(o.T,{children:e}),(0,p.jsx)(o.T,{weight:"semibold",children:t})]},e);return(0,p.jsxs)(o.Sheet,{visible:!0,onClose:a,title:`End of service \xb7 ${e.name}`,maxWidth:560,testID:"eos-summary",children:[j('Covers served',String(i)),j('Bookings seated',`${n.filter(e=>!e.walkIn).length} of ${t.filter(e=>!e.walkIn&&'cancelled'!==e.status).length}`),j('Walk-ins',`${u.length} parties \xb7 ${u.reduce((e,t)=>e+t.partySize,0)+r} covers`),j('No-shows',String(t.filter(e=>'noshow'===e.status).length)),j('Average table time',h.length?`${Math.round(h.reduce((e,t)=>e+t,0)/h.length)} min`:'\u2014'),j('Waitlist seated',`${l.filter(e=>'seated'===e.status).length} (${l.filter(e=>'removed'===e.status).length} left)`),j('"Table ready" texts',`${x} (demo, none sent)`),j('Taken at the till/app',`${(0,f.gbp)(b)} (demo)`),(0,p.jsx)(o.Muted,{children:"Example data on this device. Nothing is sent anywhere."})]})},Object.defineProperty(_e,"isWeb",{enumerable:!0,get:function(){return v}}),Object.defineProperty(_e,"tablesOf",{enumerable:!0,get:function(){return c.tablesOf}});var t=_r(d[0]);_r(d[1]);var s=e(_r(d[2])),l=e(_r(d[3])),r=e(_r(d[4])),a=e(_r(d[5])),o=_r(d[6]),n=_r(d[7]),i=_r(d[8]),u=_r(d[9]),c=_r(d[10]),h=_r(d[11]),b=_r(d[12]),m=_r(d[13]),x=_r(d[14]),f=_r(d[15]),j=_r(d[16]),p=_r(d[17]);const y=({title:e,right:t,children:s,testID:l})=>(0,p.jsxs)(a.default,{testID:l,style:{backgroundColor:j.colours.surface,borderRadius:14,borderWidth:1,borderColor:j.colours.border,padding:10,gap:6},children:[(0,p.jsxs)(o.Row,{style:{justifyContent:'space-between'},children:[(0,p.jsx)(o.T,{weight:"semibold",colour:j.colours.gold,children:e}),t]}),s]});const w=e=>(0,p.jsxs)(a.default,{style:{gap:6},children:[(0,p.jsxs)(o.T,{size:18,weight:"semibold",children:[e.walkIn?`Walk-in ${e.ref}`:e.name.replace(' (example)','')," \xb7 ",e.partySize]}),(0,p.jsxs)(o.Muted,{children:[e.time," \xb7 ",e.table?`Table ${e.table}`:'No table'," \xb7 ",e.ref,e.tags?.length?` \xb7 ${e.tags.join(', ')}`:'',e.occasion?` \xb7 ${e.occasion}`:'']}),e.notes?(0,p.jsxs)(o.T,{children:["Notes: ",e.notes]}):(0,p.jsx)(o.Muted,{children:"No notes."}),e.allergies.length?(0,p.jsx)(a.default,{style:{backgroundColor:j.colours.redBg,borderRadius:8,padding:8},children:(0,p.jsxs)(o.T,{weight:"bold",colour:"#FFE3DF",children:["ALLERGY: ",e.allergies.map(e=>`${(0,h.allergenLabel)(e.allergen)} \u2014 ${(0,h.severityLabel)(e.severity)}`).join('; ')]})}):(0,p.jsx)(o.Muted,{children:"No allergies declared."}),(0,p.jsx)(o.Muted,{children:"Phone and email stay in the Managers app; the Display never shows them."})]});const v=!0},815,[12,104,245,133,255,109,790,820,813,796,822,791,823,795,808,793,797,6]);
|
owner-app/_expo/static/js/web/index-0cca6a8eacc0ac399ba0280076bd37b4.js
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
|
|
|
| 1 |
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return c}});var t=r(d[0]);r(d[1]);var n=r(d[2]),f=r(d[3]),u=r(d[4]);function c(){return(0,n.canShow)('staff')?(0,u.jsx)(f.StaffApp,{}):(0,u.jsx)(t.Redirect,{href:n.ENTRY[n.APP_VARIANT]})}},781,[785,12,787,877,6]);
|
| 2 |
+
__d(function(g,_r,_i,a,m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.StaffApp=function(){return(0,M.jsx)(p.StaffAppCtx.Provider,{value:!0,children:(0,M.jsx)(A,{})})};var t=_r(d[0]),s=e(_r(d[1])),o=e(_r(d[2])),i=e(_r(d[3])),l=e(_r(d[4])),r=_r(d[5]),n=_r(d[6]),c=_r(d[7]),u=_r(d[8]),h=_r(d[9]),f=_r(d[10]),p=_r(d[11]),b=_r(d[12]),y=_r(d[13]),x=_r(d[14]),j=_r(d[15]),w=_r(d[16]),k=_r(d[17]),C=_r(d[18]),v=_r(d[19]),S=_r(d[20]),T=_r(d[21]),M=_r(d[22]);const R=[{id:'home',label:'Home',icon:'home'},{id:'clock',label:'Clock',icon:'clock'},{id:'rota',label:'Rota',icon:'bookings'},{id:'chat',label:'Chat',icon:'chat'},{id:'me',label:'Me',icon:'user'}],z={home:'Today',clock:'Clock in / out',rota:'Rota, swaps & leave',chat:'Staff chat',me:'Me'},P=[{id:'avatar',title:'My avatar',sub:'Your space-age avatar, or create one from a photo'},{id:'haccp',title:'Food safety checks',sub:'Record fridge, freezer, cooking and other checks (say or type)'},{id:'accidents',title:'Accident book',sub:'Report an accident or near miss; see your own entries'},{id:'mypay',title:'My hours & pay',sub:'Shifts, paid hours and estimated pay'},{id:'mytips',title:'My tips',sub:'Your share of the tronc each period'},{id:'timesheets',title:'My timesheets',sub:'Your clock-ins, breaks and any changes'},{id:'suppliers',title:'Suppliers',sub:'Contacts and order days (if your manager allows)'},{id:'privacy',title:'Privacy & location',sub:'What Cover Charge for Staff stores about you'}];function A(){const{r:e,me:A,meId:I,today:L,now:W}=(0,p.useCtx)(3e4),B=(0,u.useOwner)(e=>e.staff),_=(0,u.useOwner)(e=>e.staffCanViewSuppliers),[H,O]=(0,t.useState)('home'),[V,Y]=(0,t.useState)(null),[D,E]=(0,t.useState)(!1),N=(0,t.useRef)(null);(0,t.useEffect)(()=>{(0,p.ensureAttendance)(L,W),(0,f.ensureChat)(W)},[L]),globalThis.__ccNow=W.getTime();const $=(0,f.useChatUnread)().total,F=(0,t.useCallback)((e,t=null)=>{O(e),Y(t),N.current?.scrollTo({y:0,animated:!1})},[]),U=(0,t.useCallback)((e,t=null)=>'chat'===e?F('chat'):'clock'===t?F('clock'):'rota'===t?F('rota'):t&&P.some(e=>e.id===t)?F('me',t):void F('home'===e?'home':'me'),[F]);(0,t.useEffect)(()=>{const e=s.default.addEventListener('hardwareBackPress',()=>V?(Y(null),!0):'home'!==H&&(O('home'),!0));return()=>e.remove()},[H,V]);const q='me'===H&&V?P.find(e=>e.id===V):void 0,G=P.filter(e=>'suppliers'!==e.id||_),J=B.filter(e=>e.active&&'staff'===e.role);return(0,M.jsxs)(r.SafeAreaView,{style:{flex:1,backgroundColor:h.colours.bg},edges:['top','left','right','bottom'],children:[(0,M.jsxs)(l.default,{style:{paddingHorizontal:14,paddingTop:8,paddingBottom:8,borderBottomWidth:1,borderColor:h.colours.border},children:[(0,M.jsx)(c.PoweredBy,{}),(0,M.jsxs)(n.Row,{children:[(0,M.jsx)(c.RestaurantLogo,{rid:e.id}),(0,M.jsxs)(l.default,{style:{flex:1},children:[(0,M.jsx)(n.T,{weight:"semibold",numberOfLines:1,children:e.name}),(0,M.jsx)(n.Muted,{numberOfLines:1,children:"Staff \xb7 Harbour View, Dunure"})]}),(0,M.jsx)(o.default,{accessibilityRole:"button",accessibilityLabel:"Signed in as",onPress:()=>E(!0),style:{borderWidth:1,borderColor:h.colours.gold,borderRadius:14,paddingHorizontal:8,paddingVertical:3},children:(0,M.jsxs)(n.Row,{gap:6,children:[(0,M.jsx)(S.StaffAvatar,{id:I,size:22,ring:!1}),(0,M.jsx)(n.T,{size:12,colour:h.colours.gold,children:A.replace(' (example)','')})]})})]})]}),(0,M.jsxs)(i.default,{ref:N,contentContainerStyle:{padding:14,paddingBottom:30,gap:12,width:'100%',maxWidth:760,alignSelf:'center'},keyboardShouldPersistTaps:"handled",children:[(0,M.jsxs)(n.Row,{style:{justifyContent:'space-between'},children:[q?(0,M.jsx)(o.default,{accessibilityRole:"button",accessibilityLabel:"Back",onPress:()=>Y(null),hitSlop:10,children:(0,M.jsx)(n.T,{size:15,colour:h.colours.gold,children:"\u2039 Me"})}):null,(0,M.jsx)(n.T,{size:22,weight:"bold",style:{flex:1,textAlign:q?'right':'left'},children:q?q.title:z[H]})]}),'home'===H?(0,M.jsx)(k.StaffHome,{go:U}):null,'clock'===H?(0,M.jsx)(j.ClockInOut,{}):null,'rota'===H?(0,M.jsx)(j.Rota,{}):null,'chat'===H?(0,M.jsx)(f.Chat,{go:U}):null,'me'!==H||q?null:(0,M.jsxs)(l.default,{style:{gap:10},children:[(0,M.jsx)(l.default,{style:{borderRadius:14,borderWidth:1,borderColor:h.colours.border,backgroundColor:h.colours.surface,overflow:'hidden'},children:G.map((e,t)=>(0,M.jsx)(o.default,{accessibilityRole:"button",accessibilityLabel:e.title,onPress:()=>Y(e.id),style:({pressed:e})=>({padding:12,borderTopWidth:t?1:0,borderColor:h.colours.border,backgroundColor:e?'#1d1a14':'transparent'}),children:(0,M.jsxs)(n.Row,{style:{justifyContent:'space-between'},children:[(0,M.jsxs)(l.default,{style:{flex:1},children:[(0,M.jsx)(n.T,{weight:"medium",children:e.title}),(0,M.jsx)(n.Muted,{children:e.sub})]}),(0,M.jsx)(n.T,{colour:h.colours.muted,children:"\u203a"})]})},e.id))}),_?null:(0,M.jsx)(n.Muted,{children:"Suppliers are hidden: your manager hasn't shared them with staff."}),(0,M.jsx)(n.Muted,{center:!0,children:"Staff app \xb7 prototype v0.1.12 \xb7 data is stored on this device only"})]}),'avatar'===q?.id?(0,M.jsx)(T.AvatarMaker,{meId:I,me:A}):null,'haccp'===q?.id?(0,M.jsx)(v.HaccpLog,{mode:"staff",me:A,meId:I,now:W}):null,'accidents'===q?.id?(0,M.jsx)(C.AccidentBook,{app:"staff",me:A,meId:I,now:W,seeAll:!1}):null,'mypay'===q?.id?(0,M.jsx)(y.MyHoursPay,{staffId:I}):null,'mytips'===q?.id?(0,M.jsx)(w.MyTips,{}):null,'timesheets'===q?.id?(0,M.jsx)(j.Timesheets,{}):null,'suppliers'===q?.id?_?(0,M.jsx)(x.Suppliers,{}):(0,M.jsx)(n.Muted,{children:"Your manager hasn't shared suppliers with staff."}):null,'privacy'===q?.id?(0,M.jsxs)(l.default,{style:{gap:8},children:[(0,M.jsx)(n.T,{size:14,children:"\u2022 Location is checked only when you tap Clock in or Clock out, never in the background."}),(0,M.jsx)(n.T,{size:14,children:"\u2022 We keep \"inside / outside the venue area\" and the time, not your coordinates."}),(0,M.jsx)(n.T,{size:14,children:"\u2022 You see only your own hours, pay estimates and tips. Managers see the team's."}),(0,M.jsxs)(n.T,{size:14,children:["\u2022 Chat messages stay within ",e.name,"'s team."]}),(0,M.jsx)(n.T,{size:14,children:"\u2022 Pay figures are estimates before tax and deductions; your payslip is the official record."}),(0,M.jsx)(n.Muted,{children:"Prototype: everything is stored on this device. Nothing is sent."})]}):null]}),(0,M.jsx)(l.default,{style:{flexDirection:'row',borderTopWidth:1,borderColor:h.colours.border,backgroundColor:'#0d0d0d'},children:R.map(e=>{const t=H===e.id;return(0,M.jsxs)(o.default,{accessibilityRole:"tab",accessibilityState:{selected:t},accessibilityLabel:e.label,onPress:()=>F(e.id),style:{flex:1,alignItems:'center',paddingVertical:8,gap:2},children:[(0,M.jsxs)(l.default,{children:[(0,M.jsx)(b.Icon,{name:e.icon,colour:t?h.colours.gold:h.colours.muted}),'chat'===e.id&&$?(0,M.jsx)(l.default,{style:{position:'absolute',right:-8,top:-4,backgroundColor:h.colours.red,borderRadius:8,minWidth:16,height:16,alignItems:'center',justifyContent:'center'},children:(0,M.jsx)(n.T,{size:10,weight:"bold",children:$})}):null]}),(0,M.jsx)(n.T,{size:11,colour:t?h.colours.gold:h.colours.muted,children:e.label})]},e.id)})}),(0,M.jsxs)(n.Sheet,{visible:D,onClose:()=>E(!1),title:"Signed in as",children:[(0,M.jsx)(n.Muted,{children:"Demo sign-in: pick a team member to see the app as them. In production each person signs in with their own account."}),J.map(e=>(0,M.jsxs)(n.Row,{gap:8,children:[(0,M.jsx)(S.StaffAvatar,{id:e.id,size:36}),(0,M.jsx)(n.Button,{kind:e.id===I?'primary':'secondary',label:`${e.name.replace(' (example)','')} \xb7 ${e.job}`,onPress:()=>{u.useOwner.setState({staffAs:e.id}),E(!1),F('home')},style:{flex:1}})]},e.id))]})]})}},877,[12,215,245,133,109,271,790,816,802,797,819,821,857,864,865,862,863,856,873,875,828,872,6]);
|
owner-app/_expo/static/js/web/index-f32fc00a8379cb13e48d49c6f85ef06f.js
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|