diff --git a/CHECKSUMS.txt b/CHECKSUMS.txt index e1441e5c19faddbf617a2e3f1e07bbe8894ad3ce..4c0d477a5b0649be058394386533451f36835513 100644 --- a/CHECKSUMS.txt +++ b/CHECKSUMS.txt @@ -1,28 +1,28 @@ -Cover Charge v0.3.12.121: 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.3.12.121. +Cover Charge v0.3.12.122: 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.3.12.122. SHA-256 of each web app's start page, service worker, manifest and logo: -d88343a319ccaef868b48ad030a76fc309b9e9d57e49a4564dfe2ba801f741d0 owner-app/index.html -f9f952ca577777e526e25befd4ca1e7315256b7af899074ed7221d1ca8fe1d55 owner-app/sw.js +fbdb83fbf4777f56607bcb264e057ee3894d2cc1d6a302cae8fb903466c2db01 owner-app/index.html +327e78363155aa93d6ee2282715cfd85ea0dd2e38e899f087ea5b5d08c874167 owner-app/sw.js e305c44d11a9c25f37372f3fa4d329d4ffb04df2edee6e7b4b9ac91f3875ac67 owner-app/manifest.webmanifest cc3dd9b8a359ba6c3f28d625c27cc6a01a46233311c2a5f5c8aaf09e91be8239 owner-app/brand-logo.png -20fca0c627bddf557969e1baa63b0ab845cd9d094fe0b947d7f3bd965f8e6374 staff-app/index.html -77c6f6d52cdd07f21dd5226855e13c116e790bc724dee73a07a3b10c18137d13 staff-app/sw.js +2e0d4cb5357ebf1cf8ecb155c845c4399f29760444d3cc26a74220d6d628bbc4 staff-app/index.html +a156889af517c50868010b8f5b8708c3c4827760bf2ca9a2ca4910c68cfec61a staff-app/sw.js bd1d310ebf8e2a80808e100c41fb7fe1c4369d3026478f3ad8eececaeadaf4ac staff-app/manifest.webmanifest cc3dd9b8a359ba6c3f28d625c27cc6a01a46233311c2a5f5c8aaf09e91be8239 staff-app/brand-logo.png -d33129cbfda140723936fbbc88918bce8535ad5a0b41215e12214403bc672272 customer-app/index.html -fc706e3e7c27fde623e99bc0835122bd9ae34c38a925aa24ed19b58a31f7f1fb customer-app/sw.js +3ac6d5cf2b86affd8eb873115a3329f3cd8dfc237c36a0b98771d7b7754bf0fd customer-app/index.html +a8ec486f35e7475580bfa5f59217ee9584d5fbfb69c98647d28bda5aebd59c8e customer-app/sw.js 3bfb1fd10cc13f09ca6be65c461e1f6b5750ae51a3ece12e079750b2a066052e customer-app/manifest.webmanifest cc3dd9b8a359ba6c3f28d625c27cc6a01a46233311c2a5f5c8aaf09e91be8239 customer-app/brand-logo.png -c0361cb559836e2abebfdbb7107020228e8fced72f49abc0ceba0c806c94e328 display-app/index.html -03926ab176d65d70d75ab0e9c48aa68f5e3c2a8f8b83a952cb6b191d1365b870 display-app/sw.js +c158f9b9dc85567bc330956b8ea51a8f844b8b94f283306b406e0283223427bd display-app/index.html +de966e812d551833c9d5c5f117fde73931846bd8061feb736a44c713992ed264 display-app/sw.js 35e2721b86eb1ae1605e55bee64177adcee72f4e53a24ac417d19ea2873434a1 display-app/manifest.webmanifest cc3dd9b8a359ba6c3f28d625c27cc6a01a46233311c2a5f5c8aaf09e91be8239 display-app/brand-logo.png -0388e7dfcb92104dcace2d72381dd89d095435aebdff7212bed59615f0fe785d chef-app/index.html -aebd43136364c0953218854de6a17c25afcf625ff3c440a0013e968aaca18510 chef-app/sw.js +0bee0c592ad6dc9c4a64752c7457973283f980aeeabb7d21685412610b205883 chef-app/index.html +66564ee82f90b5599c75d8db313ee18295ce11d3a3b57a07644235870d9489d9 chef-app/sw.js 97ed43decde8a888e22b7411e13a2122c6f8b9944cf38b2e28e8f62ef2e25397 chef-app/manifest.webmanifest cc3dd9b8a359ba6c3f28d625c27cc6a01a46233311c2a5f5c8aaf09e91be8239 chef-app/brand-logo.png -b95ac801353db01a327aa1c7f5a094ce9c9eae99dcac3443dc3a38f18280958b car-app/index.html -4901967a3777fc8715cc2cfa2ddc061d54bd445b3f2c470d6b2e5e264be543ad car-app/sw.js +faa4f57375da7973f255a94c951feb301e9c0244b6a1845691ccb5863dbd4a4c car-app/index.html +0126b941aeb21a49512edd296b3d1b42d9b7d3f1e18f7cd001d83c5165b96cca car-app/sw.js 091b9f96d36153d270b44dbf458aa99e4fd5e2f127769d030436fcd1d51e724a car-app/manifest.webmanifest cc3dd9b8a359ba6c3f28d625c27cc6a01a46233311c2a5f5c8aaf09e91be8239 car-app/brand-logo.png 4c75c3bcf346006a2f8e28e5abf372f0dffd57ab1ce49cde9b0f62526889910b car.html diff --git a/car-app/_expo/static/js/web/bundle.js b/car-app/_expo/static/js/web/bundle.js index ff00fc06250cccc89e07bcf7fdfc4dae89dcabf7..c1cbbbc0cbf78fc4883cc4e36378643c14f64828 100644 --- a/car-app/_expo/static/js/web/bundle.js +++ b/car-app/_expo/static/js/web/bundle.js @@ -1122,7 +1122,7 @@ __d(function(g,r,i,a,m,e,d){m.exports=r(d[0])},1038,[1039]); __d(function(g,r,i,a,m,e,d){function n(n,t){const o=globalThis[`${__METRO_GLOBAL_PREFIX__??''}__loadBundleAsync`];if(null!=o){const s=String(n);if(null!=t){const n=t[s];if(null!=n)return o(n)}}}function t(t,o,s){const u=()=>r.importAll(t,s);{const l=o?.[String(t)];if(Array.isArray(l)){const c=globalThis[`${__METRO_GLOBAL_PREFIX__??''}__loadBundleAsync`];if(c?.isReady?.(l))return u();const f=n(t,o);if(null!=f)return f.then(u);throw new Error(`Cannot import module ${s??t}: the async bundle loader is unavailable. Load the initial Expo bundle before importing these chunks: ${l.join(', ')}`)}try{return u()}catch(s){const l=n(t,o);if(null!=l)return l.then(u);throw s}}const l=n(t,o);return null!=l?l.then(u):u()}function o(n,o,s){const u=t(n,o,s),l=Promise.resolve(u);return l._result=u,l}o.unstable_importMaybeSync=function(n,o){return t(n,o)},o.prefetch=function(t,o,s){n(t,o)?.then(()=>{},()=>{})},o.unstable_resolve=function(n,t){if(!t)throw new Error('Bundle splitting is required for Web Worker imports');const o=t[n];if(!o)throw new Error('Worker import is missing from split bundle paths: '+o);return o},o.unstable_createWorker=function(n,t){if('undefined'==typeof crossOriginIsolated||!crossOriginIsolated)return new Worker(n,t);try{const s=(o=n,`\n const ASYNC_WORKER_BASE = ${JSON.stringify(o)};\n const IMPORT_SCRIPTS = importScripts;\n const FETCH = fetch;\n const fromBaseURL = (input) => new URL(input, ASYNC_WORKER_BASE).href;\n self.fetch = function(input, init) {\n return FETCH(typeof input === 'string' ? fromBaseURL(input) : input, init);\n };\n self.importScripts = function(...urls) {\n return IMPORT_SCRIPTS.apply(self, urls.map(fromBaseURL));\n };\n importScripts(ASYNC_WORKER_BASE);\n `);return n=URL.createObjectURL(new Blob([s],{type:'text/javascript'})),new Worker(n,t)}finally{URL.revokeObjectURL(n)}var o},m.exports=o},1039,[]); __d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"currentScrollY",{enumerable:!0,get:function(){return u}}),Object.defineProperty(_e,"screenGeneration",{enumerable:!0,get:function(){return c}}),Object.defineProperty(_e,"restoreScroll",{enumerable:!0,get:function(){return o}}),_e.useScrollMemory=function(u){const c=(0,e.useRef)(0),o=(0,e.useRef)(0),l=(0,e.useRef)(0),s=(0,e.useRef)(0),f=(0,e.useRef)(0),v=(0,e.useRef)(null),y=(0,e.useRef)([]),h=()=>{y.current.forEach(clearTimeout),y.current=[]},b=()=>{const e=v.current;null!=e&&(u.current?.scrollTo({y:e,animated:!1}),f.current-s.current>=e-2&&(c.current=e,o.current=e,v.current=null,h()))},p=(0,e.useCallback)(e=>{if(h(),v.current=Math.max(0,e),e<=0)return v.current=null,u.current?.scrollTo({y:0,animated:!1}),c.current=0,void(o.current=0);for(const e of[0,30,80,160,320,600,1e3,1600,2500])y.current.push(setTimeout(b,e));y.current.push(setTimeout(()=>{v.current=null},2600))},[]);t={y:()=>o.current,restore:p};const R=(0,e.useCallback)(()=>{n++;return o.current},[]);return{props:{scrollEventThrottle:32,onScroll:e=>{const t=e.nativeEvent.contentOffset.y;c.current=t,s.current=e.nativeEvent.layoutMeasurement.height,f.current=e.nativeEvent.contentSize.height,Date.now()-l.current>250&&null==v.current&&(o.current=t)},onScrollBeginDrag:()=>{v.current=null,h()},onContentSizeChange:(e,t)=>{f.current=t,l.current=Date.now(),b()},onLayout:e=>{s.current=e.nativeEvent.layout.height}},restore:p,leave:R}};var e=r(d[0]);let t=null,n=0;const u=()=>t?t.y():0,c=()=>n,o=e=>t?.restore(e)},1040,[34]); __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,"useBackLayers",{enumerable:!0,get:function(){return f}}),_e.runBackLayer=function(){const e=f.getState().layers,t=e[e.length-1];return!!t&&(t.fn(),!0)},_e.useBackLayer=function(e,n,o=!0){const s=(0,t.useRef)(n);s.current=n,(0,t.useEffect)(()=>{if(!e)return;const t=++y,n=(0,u.currentScrollY)(),l=(0,u.screenGeneration)();return f.setState(e=>({layers:[...e.layers,{id:t,fn:()=>s.current(),own:o}]})),()=>{f.setState(e=>({layers:e.layers.filter(e=>e.id!==t)})),(0,u.screenGeneration)()===l&&(0,u.restoreScroll)(n)}},[e,o])},Object.defineProperty(_e,"useInnerBackShown",{enumerable:!0,get:function(){return w}}),Object.defineProperty(_e,"BACK_GUTTER",{enumerable:!0,get:function(){return p}}),_e.BackTitleRow=function({back:e,onBack:n,title:s}){const[l,u]=(0,t.useState)(0),[f,y]=(0,t.useState)({w:96,h:48}),[w,b]=(0,t.useState)(0),S=Array.from(new Set(String(s??'').split(/\s+/).filter(Boolean)));String(s??'').length>=20&&S.length>=3&&S.push('00000000');const v=Math.max(p,Math.ceil(f.w)+4),j=e&&l>0&&l-2*vu(Math.round(e.nativeEvent.layout.width)),style:{minHeight:44,justifyContent:'center',alignItems:'center',paddingHorizontal:e&&!j?v:0,paddingTop:j?f.h:0},children:[e?(0,h.jsx)(o.default,{style:{position:'absolute',left:0,top:0},onLayout:e=>{const t=Math.round(e.nativeEvent.layout.width),n=Math.round(e.nativeEvent.layout.height);y(e=>e.w===t&&e.h===n?e:{w:t,h:n})},children:(0,h.jsx)(g,{onPress:n})}):null,(0,h.jsx)(c.T,{size:22,weight:"bold",center:!0,accessibilityRole:"header",children:s}),e&&S.length?(0,h.jsx)(o.default,{"aria-hidden":!0,importantForAccessibility:"no-hide-descendants",pointerEvents:"none",style:{position:'absolute',left:0,top:0,opacity:0,alignItems:'flex-start'},onLayout:e=>b(Math.ceil(e.nativeEvent.layout.width)),children:S.map(e=>(0,h.jsx)(c.T,{size:22,weight:"bold",numberOfLines:1,style:{alignSelf:'flex-start'},children:e},e))}):null]})},_e.BackButton=g,_e.useWebBack=function(e){const n=(0,t.useRef)(e);n.current=e,(0,t.useEffect)(()=>{if('undefined'==typeof window||!window.history?.pushState)return;const e=()=>{try{window.history.pushState({...window.history.state??{},ccBack:Date.now()},'',window.location.href)}catch{}};e();const t=t=>{n.current()&&(t.stopImmediatePropagation?.(),e())};return window.addEventListener('popstate',t,!0),()=>window.removeEventListener('popstate',t,!0)},[])};var t=r(d[0]);r(d[1]);var n=e(r(d[2])),o=e(r(d[3])),s=r(d[4]),l=r(d[5]),c=r(d[6]),u=r(d[7]),h=r(d[8]);const f=(0,s.create)(()=>({layers:[]}));let y=0;const w=()=>f(e=>e.layers.some(e=>e.own)),p=100;function g({onPress:e,testID:t="screen-back",label:o="Back"}){return(0,h.jsx)(n.default,{testID:t,accessibilityRole:"button",accessibilityLabel:o,onPress:e,hitSlop:8,style:({pressed:e})=>({minHeight:48,minWidth:96,justifyContent:'center',paddingRight:12,opacity:e?.6:1,alignSelf:'flex-start'}),children:(0,h.jsxs)(c.T,{size:18,weight:"semibold",colour:l.colours.gold,children:["\u2039 ",o]})})}},1041,[34,236,402,102,815,840,794,1040,25]); -__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"APP_VERSION",{enumerable:!0,get:function(){return t}});const t='v0.3.12.121'},1042,[]); +__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"APP_VERSION",{enumerable:!0,get:function(){return t}});const t='v0.3.12.122'},1042,[]); __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.NotificationsSettings=function({rid:e}){(0,n.useEffect)(()=>{c.useNotifs.getState().ensure(e),(0,j.readPushLive)()},[e]);const t=(0,c.useNotifs)(e=>e.items).filter(t=>t.rid===e&&!t.removed),s=(0,h.useOwner)(e=>e.staff),o=(0,j.usePushLive)(),[l,p]=(0,n.useState)(null),[f,g]=(0,n.useState)(null),[x,b]=(0,n.useState)(!1),y=c.useNotifs.getState(),T=s.map(e=>({id:e.id,role:e.role,level:e.level,job:e.job,department:e.dept,active:e.active})),v=e=>{const t=(0,u.resolveRecipients)(e,T,[]),n=[...e.recipients.groups.map(e=>u.NOTIF_GROUP_LABEL[e]),...(e.recipients.onShiftIn??[]).map(e=>u.SHIFT_FILTER_LABEL[e])];e.recipients.fallback&&n.push(`else ${[...e.recipients.fallback.groups.map(e=>u.NOTIF_GROUP_LABEL[e]),...e.recipients.fallback.staff.map(e=>I(s.find(t=>t.id===e)?.name??e))].join(', ')}`);const o=e.recipients.staff.map(e=>I(s.find(t=>t.id===e)?.name??e));return[...n,...o].join(', ')+(t.length||(e.recipients.onShiftIn??[]).length?'':' (nobody yet)')};return(0,k.jsxs)(a.default,{style:{gap:10},testID:"notif-settings",children:[(0,k.jsx)(r.Muted,{size:13,children:"Tip: these remind people at a set time, e.g. the Mills milk order. They show in the app as a gold slider with Done and Later. Done is logged with the name and time. Times are UK time."}),(0,k.jsxs)(a.default,{testID:"push-live-status",style:{borderWidth:1,borderColor:d.colours.accentBorder,borderRadius:10,padding:8,gap:4},children:[(0,k.jsxs)(r.Row,{style:{justifyContent:'space-between'},children:[(0,k.jsx)(r.T,{weight:"semibold",children:"Send to phones"}),(0,k.jsx)(r.Badge,{kind:o.live?'gold':'neutral',label:o.live?'ON':'OFF'})]}),(0,k.jsx)(r.Muted,{size:12,children:o.live?'Phone notifications go to people who turned them on.':'Off: nothing goes to anyone\u2019s phone yet. In-app reminders still work.'}),(0,k.jsx)(r.Button,{small:!0,kind:"secondary",testID:"push-live-toggle",label:o.live?'Switch phone notifications off':'Switch phone notifications on\u2026',onPress:()=>b(!0)})]}),(0,k.jsx)(R,{}),t.map(e=>l===e.id?(0,k.jsx)(D,{init:e,onCancel:()=>p(null),onSave:t=>{y.update(e.id,t),p(null)}},e.id):(0,k.jsxs)(a.default,{testID:`notif-${e.seed??e.id}`,style:{borderWidth:1,borderColor:d.colours.hairline,borderRadius:12,padding:10,gap:4,opacity:e.paused?.6:1},children:[(0,k.jsxs)(r.Row,{style:{justifyContent:'space-between'},children:[(0,k.jsx)(r.T,{weight:"semibold",style:{flex:1},children:e.title}),e.paused?(0,k.jsx)(r.Badge,{kind:"neutral",label:"Off"}):null]}),(0,k.jsx)(r.Muted,{size:13,children:e.message}),(0,k.jsxs)(r.Muted,{size:12,children:[(0,u.scheduleText)(e)," \xb7 ",v(e)," \xb7 ",[e.sendBy.inApp?'In app':'',e.sendBy.push?'Phone':''].filter(Boolean).join(' + ')]}),(0,k.jsxs)(r.Row,{gap:6,children:[(0,k.jsx)(r.Button,{small:!0,kind:"secondary",testID:`notif-edit-${e.seed??e.id}`,label:"Edit",onPress:()=>p(e.id)}),(0,k.jsx)(r.Button,{small:!0,kind:"ghost",label:e.paused?'Switch on':'Switch off',onPress:()=>y.update(e.id,{paused:!e.paused})}),(0,k.jsx)(r.Button,{small:!0,kind:"ghost",label:"Remove",onPress:()=>g(e)})]})]},e.id)),'new'===l?(0,k.jsx)(D,{init:C,onCancel:()=>p(null),onSave:t=>{y.add(e,t),p(null)}}):(0,k.jsx)(r.Button,{small:!0,testID:"notif-add",label:"Add a notification",onPress:()=>p('new')}),(0,k.jsxs)(r.Sheet,{visible:!!f,onClose:()=>g(null),title:"Remove this notification?",children:[(0,k.jsx)(r.T,{children:f?.title}),(0,k.jsx)(r.Muted,{children:"Nobody gets it after this. Reset to default restores the configured rules."}),(0,k.jsxs)(r.Row,{gap:8,children:[(0,k.jsx)(r.Button,{label:"Remove",onPress:()=>{f&&y.remove(f.id),g(null)}}),(0,k.jsx)(r.Button,{kind:"ghost",label:"Cancel",onPress:()=>g(null)})]})]}),(0,k.jsxs)(r.Sheet,{visible:x,onClose:()=>b(!1),title:o.live?'Switch phone notifications off?':'Switch phone notifications on?',testID:"push-live-confirm",children:[(0,k.jsx)(r.T,{children:o.live?'Nothing more goes to phones. In-app reminders keep working.':'From the next scheduled time, everyone ticked on a notification with \u201cPhone notification\u201d gets it on any phone where they turned phone notifications on.'}),(0,k.jsxs)(r.Row,{gap:8,children:[(0,k.jsx)(r.Button,{testID:"push-live-yes",label:o.live?'Switch off':'Yes, switch on',onPress:()=>{(0,j.setPushLive)(!o.live).then(e=>(0,w.notify)({id:'push-live',tone:e.ok?'normal':'warn',title:e.ok?o.live?'Phone notifications are off':'Phone notifications are on':'Not changed',body:e.message??'',timeoutMs:7e3})),b(!1)}}),(0,k.jsx)(r.Button,{kind:"ghost",label:"Cancel",onPress:()=>b(!1)})]})]})]})},_e.PushButton=R,_e.OrderListsSettings=function({rid:e}){(0,n.useEffect)(()=>{p.useOrderLists.getState().ensure(e)},[e]);const s=(0,p.useOrderLists)(e=>e.lists).filter(t=>t.rid===e),o=(0,p.orderSettingsOf)(e);(0,p.useOrderLists)(t=>t.settings[e]);const l=p.useOrderLists.getState(),[c,u]=(0,n.useState)(''),[h,g]=(0,n.useState)({});return(0,k.jsxs)(a.default,{style:{gap:10},testID:"order-list-settings",children:[(0,k.jsx)(r.Muted,{size:13,children:"Tip: running lists (like Alsons drinks) collect items until you order; trip lists (like Cash and carry) are for one shopping day. Logos and phone numbers are set on each list."}),(0,k.jsx)(r.Toggle,{testID:"order-allow-staff",label:"Let all staff add items",value:o.allowStaff,onChange:t=>l.setSettings(e,{allowStaff:t})}),(0,k.jsx)(r.Muted,{size:12,children:"Staff can add items and see the lists. Only managers and the Head Chef tick, remove or finish an order."}),(0,k.jsx)(r.T,{weight:"semibold",children:"Default trip day"}),(0,k.jsx)(r.Row,{wrap:!0,gap:6,children:v.map(t=>(0,k.jsx)(r.Chip,{label:f.DAY_FULL[t].slice(0,3),selected:o.defaultTripDay===t,onPress:()=>l.setSettings(e,{defaultTripDay:t})},t))}),s.map(e=>(0,k.jsxs)(a.default,{testID:`order-list-row-${e.seed??e.id}`,style:{borderWidth:1,borderColor:d.colours.hairline,borderRadius:10,padding:8,gap:6,opacity:e.archived?.55:1},children:[(0,k.jsxs)(r.Row,{gap:6,children:[(0,k.jsx)(t.TextInput,{accessibilityLabel:`Rename ${e.name}`,value:h[e.id]??e.name,onChangeText:t=>g(s=>({...s,[e.id]:t})),onBlur:()=>{const t=(h[e.id]??'').trim();t&&t!==e.name&&l.updateList(e.id,{name:t})},style:{...T,flex:1,minWidth:0}}),(0,k.jsx)(r.Badge,{kind:"neutral",label:'trip'===e.kind?'Trip':'Running'})]}),'trip'===e.kind?(0,k.jsx)(r.Row,{wrap:!0,gap:6,children:v.map(t=>(0,k.jsx)(r.Chip,{label:f.DAY_FULL[t].slice(0,3),selected:(e.tripDay??o.defaultTripDay)===t,onPress:()=>l.updateList(e.id,{tripDay:t})},t))}):null,(0,k.jsx)(r.Row,{gap:6,children:(0,k.jsx)(r.Button,{small:!0,kind:"ghost",label:e.archived?'Bring back':'Archive',onPress:()=>l.updateList(e.id,{archived:!e.archived})})})]},e.id)),(0,k.jsxs)(r.Row,{gap:6,wrap:!0,children:[(0,k.jsx)(t.TextInput,{accessibilityLabel:"New list name",testID:"order-new-name",value:c,onChangeText:u,placeholder:"e.g. Butcher",placeholderTextColor:d.colours.muted,style:{...T,flexGrow:1,flexBasis:160,minWidth:0}}),(0,k.jsx)(r.Button,{small:!0,label:"Add running",disabled:c.trim().length<2,onPress:()=>{l.addList(e,{name:c.trim(),kind:'running'}),u('')}}),(0,k.jsx)(r.Button,{small:!0,kind:"secondary",label:"Add trip",disabled:c.trim().length<2,onPress:()=>{l.addList(e,{name:c.trim(),kind:'trip',tripDay:o.defaultTripDay}),u('')}})]})]})},Object.defineProperty(_e,"resetOrderLists",{enumerable:!0,get:function(){return B}}),_e.ClockAreaSettings=function({rid:e,me:c}){(0,g.useClockArea)(t=>t.areas[e]);const u=(0,g.areaOf)(e);const h=g.useClockArea.getState(),p=(0,s.privateClockVenue)(e),[f,j]=(0,n.useState)(null==u.lat?'':String(u.lat)),[y,w]=(0,n.useState)(null==u.lng?'':String(u.lng)),[v,S]=(0,n.useState)(!1),[I,C]=(0,n.useState)(''),[L,D]=(0,n.useState)(u.breakOptions.join(', ')),R=(t,s)=>{const n=Number(t),o=Number(s);t.trim()||s.trim()?Number.isFinite(n)&&Number.isFinite(o)&&Math.abs(n)<=90&&Math.abs(o)<=180&&h.set(e,{lat:n,lng:o},c):h.set(e,{lat:null,lng:null},c)},B=async()=>{if(p)return;S(!0),C('');const t=await(0,b.getFix)();if(S(!1),'object'!=typeof t)return void C('denied'===t?'Location is blocked for this app. Allow it in your browser or phone settings.':'Couldn\u2019t get your location. Try again outside or near a window.');const s=t.lat.toFixed(6),n=t.lng.toFixed(6);j(s),w(n),h.set(e,{lat:Number(s),lng:Number(n)},c),C(`Centre set to where you are (accurate to about ${Math.round(t.acc)} m).`)},P=(0,x.areaSet)(u);return(0,k.jsxs)(a.default,{style:{gap:10},testID:"clock-area-settings",children:[(0,k.jsx)(r.Muted,{size:13,children:p?'The address-matched pub centre is configured below. Only clock-in checks location; only pass/fail is saved. No background, clock-out or break checks. Change the radius or centre here; use a manager override for a refused check.':'Tip: stand in the middle of the venue and tap \u201cUse my current location\u201d. Clocking in, out and breaks then only work within the distance below. Rota and pay screens are never blocked.'}),P?null:(0,k.jsx)(r.Banner,{kind:"warn",title:"Clock-in area not set yet",children:"Until you set the centre, staff can clock in from anywhere."}),p?(0,k.jsx)(r.Muted,{children:"Clock-in at the pub is required. A manager can record an exception with a reason."}):(0,k.jsx)(r.Toggle,{testID:"clock-area-on",label:"Check people are at the venue",value:u.on,onChange:t=>h.set(e,{on:t},c)}),p?null:(0,k.jsx)(r.Button,{testID:"clock-area-here",label:v?'Finding you\u2026':'\ud83d\udccd Use my current location',disabled:v,onPress:()=>{B()}}),I?(0,k.jsx)(r.Muted,{size:13,children:I}):null,(0,k.jsxs)(r.Row,{wrap:!0,gap:8,children:[(0,k.jsxs)(a.default,{style:{gap:2},children:[(0,k.jsx)(r.Muted,{size:12,children:"Latitude"}),(0,k.jsx)(t.TextInput,{accessibilityLabel:"Latitude",testID:"clock-area-lat",value:f,onChangeText:j,onBlur:()=>R(f,y),placeholder:"55.40\u2026",placeholderTextColor:d.colours.muted,style:{...T,width:130}})]}),(0,k.jsxs)(a.default,{style:{gap:2},children:[(0,k.jsx)(r.Muted,{size:12,children:"Longitude"}),(0,k.jsx)(t.TextInput,{accessibilityLabel:"Longitude",testID:"clock-area-lng",value:y,onChangeText:w,onBlur:()=>R(f,y),placeholder:"-4.75\u2026",placeholderTextColor:d.colours.muted,style:{...T,width:130}})]})]}),P?(0,k.jsx)(l.default,{accessibilityRole:"link",testID:"clock-area-map",onPress:()=>{o.default.openURL(`https://www.openstreetmap.org/?mlat=${u.lat}&mlon=${u.lng}#map=18/${u.lat}/${u.lng}`)},children:(0,k.jsx)(r.T,{size:13,colour:d.colours.gold,children:"See the pin on a map \u203a"})}):null,(0,k.jsx)(r.T,{weight:"semibold",children:"How far from the centre"}),(0,k.jsxs)(r.Row,{gap:8,children:[(0,k.jsx)(r.Button,{small:!0,kind:"secondary",label:"\u2212",onPress:()=>h.set(e,{radius:(0,x.clampRadius)(u.radius-10)},c)}),(0,k.jsxs)(r.T,{weight:"semibold",style:{minWidth:70,textAlign:'center'},children:[u.radius," m"]}),(0,k.jsx)(r.Button,{small:!0,kind:"secondary",label:"+",onPress:()=>h.set(e,{radius:(0,x.clampRadius)(u.radius+10)},c)})]}),(0,k.jsxs)(r.Muted,{size:12,children:["At least ",x.MIN_RADIUS," m. Phones aren\u2019t exact, so up to 50 m of the phone\u2019s own accuracy is added on top."]}),(0,k.jsx)(r.T,{weight:"semibold",children:"Forgotten break: lengths to offer at clock-out"}),(0,k.jsx)(t.TextInput,{accessibilityLabel:"Break lengths in minutes",testID:"clock-break-options",value:L,onChangeText:D,onBlur:()=>{const t=L.split(/[ ,]+/).map(Number).filter(e=>Number.isFinite(e)&&e>0&&e<=180);t.length&&h.set(e,{breakOptions:[...new Set(t)].sort((e,t)=>e-t)},c),D((0,g.areaOf)(e).breakOptions.join(', '))},style:T}),(0,k.jsxs)(r.Muted,{size:12,children:["Minutes, e.g. 5, 10, 15, 20, 30, 45, 60. Shows as ",u.breakOptions.map(x.breakLabel).join(', ')," and \u201cNo break\u201d."]}),p?(0,k.jsx)(r.Muted,{children:"No automatic arrival checks: staff location is used only at clock-in."}):(0,k.jsxs)(k.Fragment,{children:[" ",(0,k.jsx)(r.T,{weight:"semibold",children:"Not on the rota"}),(0,k.jsx)(r.Toggle,{testID:"clock-offrota-on",label:"Ask people at the venue who aren\u2019t on the rota if they want to clock in",value:u.offRotaPrompt,onChange:t=>h.set(e,{offRotaPrompt:t},c)}),(0,k.jsx)(t.TextInput,{accessibilityLabel:"Off-rota question",testID:"clock-offrota-title",value:u.offRotaTitle,onChangeText:t=>h.set(e,{offRotaTitle:t||x.DEFAULT_CLOCK_AREA.offRotaTitle},c),style:T}),(0,k.jsx)(t.TextInput,{accessibilityLabel:"Off-rota second line",testID:"clock-offrota-body",value:u.offRotaBody,onChangeText:t=>h.set(e,{offRotaBody:t||x.DEFAULT_CLOCK_AREA.offRotaBody},c),style:T}),(0,k.jsx)(r.Muted,{size:12,children:"This only checks while the app is open (web apps can\u2019t watch location in the background; that would need a native app)."})]})]})},Object.defineProperty(_e,"resetClockArea",{enumerable:!0,get:function(){return P}}),Object.defineProperty(_e,"COOKSAFE_URL",{enumerable:!0,get:function(){return O}}),_e.FoodSafetyCard=function({children:e}){return(0,k.jsx)(r.Card,{children:(0,k.jsxs)(a.default,{testID:"food-safety",style:{gap:6},children:[(0,k.jsx)(r.T,{size:17,weight:"semibold",children:"Food safety"}),(0,k.jsxs)(r.T,{children:["Based on ",(0,k.jsx)(r.T,{weight:"bold",colour:d.colours.gold,children:"CookSafe"})," (Food Standards Scotland)"]}),(0,k.jsx)(r.Muted,{size:12,children:"CoverCharge is not endorsed by Food Standards Scotland."}),(0,k.jsx)(l.default,{accessibilityRole:"link",testID:"cooksafe-link",onPress:()=>{o.default.openURL(O)},children:(0,k.jsx)(r.T,{size:14,colour:d.colours.gold,children:"Open the CookSafe guidance \u203a"})}),(0,k.jsx)(r.Muted,{size:13,children:"Full logs coming in the next update."}),e]})})};var t=_r(_d[0]),s=_r(_d[1]),n=_r(_d[2]),o=e(_r(_d[3])),l=e(_r(_d[4])),a=e(_r(_d[5])),r=_r(_d[6]),d=_r(_d[7]),c=_r(_d[8]),u=_r(_d[9]),h=_r(_d[10]),p=_r(_d[11]),f=_r(_d[12]),g=_r(_d[13]),x=_r(_d[14]),b=_r(_d[15]),j=_r(_d[16]),y=_r(_d[17]),w=_r(_d[18]),k=_r(_d[19]);const T={minHeight:44,borderRadius:10,borderWidth:1,borderColor:d.colours.hairline,backgroundColor:d.colours.surface2,color:d.colours.text,paddingHorizontal:10,fontSize:15},v=[1,2,3,4,5,6,0],S=['on_shift','everyone','managers','head_chef','kitchen','foh'],I=e=>e.replace(' (example)',''),C={title:'',message:'',days:[3,4,5,6,0],time:'21:00',recipients:{staff:[],groups:[]},sendBy:{inApp:!0,push:!1}};function L({value:e,onChange:t}){const s=(0,h.useOwner)(e=>e.staff).filter(e=>e.active);return(0,k.jsxs)(a.default,{style:{gap:6},testID:"notif-recipients",children:[(0,k.jsx)(r.T,{weight:"semibold",children:"Who gets it"}),(0,k.jsx)(r.Muted,{size:12,children:"Tick people, or pick a group (groups follow the team as it changes)."}),(0,k.jsx)(r.Row,{wrap:!0,gap:6,children:S.map(s=>(0,k.jsx)(r.Chip,{testID:`notif-group-${s}`,label:u.NOTIF_GROUP_LABEL[s],selected:e.groups.includes(s),onPress:()=>t({...e,groups:e.groups.includes(s)?e.groups.filter(e=>e!==s):[...e.groups,s]})},s))}),(0,k.jsx)(r.Muted,{size:12,children:"Only people on shift when it goes, in:"}),(0,k.jsx)(r.Row,{wrap:!0,gap:6,children:Object.keys(u.SHIFT_FILTER_LABEL).map(s=>{const n=(e.onShiftIn??[]).includes(s);return(0,k.jsx)(r.Chip,{testID:`notif-onshift-${s}`,label:u.SHIFT_FILTER_LABEL[s],selected:n,onPress:()=>t({...e,onShiftIn:n?(e.onShiftIn??[]).filter(e=>e!==s):[...e.onShiftIn??[],s]})},s)})}),(0,k.jsx)(a.default,{style:{gap:2},children:s.map(s=>{const n=e.staff.includes(s.id);return(0,k.jsxs)(l.default,{testID:`notif-tick-${s.id}`,accessibilityRole:"checkbox",accessibilityState:{checked:n},onPress:()=>t({...e,staff:n?e.staff.filter(e=>e!==s.id):[...e.staff,s.id]}),style:{flexDirection:'row',alignItems:'center',gap:10,paddingVertical:6},children:[(0,k.jsx)(a.default,{style:{width:22,height:22,borderRadius:5,borderWidth:1.5,borderColor:d.colours.gold,alignItems:'center',justifyContent:'center',backgroundColor:n?'#2a2414':'transparent'},children:n?(0,k.jsx)(r.T,{size:14,colour:d.colours.gold,children:"\u2713"}):null}),(0,k.jsx)(r.T,{style:{flex:1},children:(0,h.staffLabel)({name:I(s.name),nickname:s.nickname})}),(0,k.jsx)(r.Muted,{size:12,children:'Head Chef'===s.level?'Head Chef':s.job})]},s.id)})}),(0,k.jsx)(r.Muted,{size:12,children:"If nobody above matches when it goes, send it to:"}),(0,k.jsxs)(r.Row,{wrap:!0,gap:6,children:[S.filter(e=>'on_shift'!==e).map(s=>{const n=e.fallback??{staff:[],groups:[]},o=n.groups.includes(s);return(0,k.jsx)(r.Chip,{testID:`notif-fallback-${s}`,label:u.NOTIF_GROUP_LABEL[s],selected:o,onPress:()=>{const l=o?n.groups.filter(e=>e!==s):[...n.groups,s];t({...e,fallback:l.length||n.staff.length?{...n,groups:l}:void 0})}},s)}),s.map(s=>{const n=e.fallback??{staff:[],groups:[]},o=n.staff.includes(s.id);return(0,k.jsx)(r.Chip,{testID:`notif-fallback-${s.id}`,label:I(s.name),selected:o,onPress:()=>{const l=o?n.staff.filter(e=>e!==s.id):[...n.staff,s.id];t({...e,fallback:l.length||n.groups.length?{...n,staff:l}:void 0})}},s.id)})]})]})}function D({init:e,onSave:s,onCancel:o}){const[l,c]=(0,n.useState)(e),[h,p]=(0,n.useState)(!!e.dayTimes&&Object.keys(e.dayTimes).length>0),f=(0,u.validateNotif)(l),g=e=>c(t=>({...t,...e}));return(0,k.jsxs)(a.default,{testID:"notif-editor",style:{gap:8,borderWidth:1,borderColor:d.colours.accentBorder,borderRadius:12,padding:10},children:[(0,k.jsx)(r.T,{weight:"semibold",children:"Title"}),(0,k.jsx)(t.TextInput,{accessibilityLabel:"Notification title",testID:"notif-title",value:l.title,onChangeText:e=>g({title:e}),maxLength:60,style:T}),(0,k.jsx)(r.T,{weight:"semibold",children:"Message"}),(0,k.jsx)(t.TextInput,{accessibilityLabel:"Notification message",testID:"notif-message",value:l.message,onChangeText:e=>g({message:e}),maxLength:160,style:T}),(0,k.jsx)(r.T,{weight:"semibold",children:"Days"}),(0,k.jsx)(r.Row,{wrap:!0,gap:6,children:v.map(e=>(0,k.jsx)(r.Chip,{testID:`notif-day-${e}`,label:u.NOTIF_DAY_NAMES[e],selected:l.days.includes(e),onPress:()=>g({days:l.days.includes(e)?l.days.filter(t=>t!==e):[...l.days,e]})},e))}),(0,k.jsxs)(r.Row,{gap:8,children:[(0,k.jsx)(r.T,{weight:"semibold",children:"Time (UK)"}),(0,k.jsx)(t.TextInput,{accessibilityLabel:"Time",testID:"notif-time",value:l.time,onChangeText:e=>g({time:e}),placeholder:"21:00",style:{...T,width:90,borderColor:(0,u.validHm)(l.time)?d.colours.hairline:d.colours.red}})]}),(0,k.jsx)(r.Toggle,{label:"A different time on some days",value:h,onChange:e=>{p(e),e||g({dayTimes:void 0})}}),h?(0,k.jsx)(r.Row,{wrap:!0,gap:8,children:v.filter(e=>l.days.includes(e)).map(e=>(0,k.jsxs)(r.Row,{gap:4,children:[(0,k.jsx)(r.T,{size:13,children:u.NOTIF_DAY_NAMES[e]}),(0,k.jsx)(t.TextInput,{accessibilityLabel:`${u.NOTIF_DAY_NAMES[e]} time`,testID:`notif-daytime-${e}`,value:l.dayTimes?.[String(e)]??'',placeholder:l.time,onChangeText:t=>{const s={...l.dayTimes??{}};t.trim()?s[String(e)]=t.trim():delete s[String(e)],g({dayTimes:s})},style:{...T,width:74}})]},e))}):null,(0,k.jsx)(L,{value:l.recipients,onChange:e=>g({recipients:e})}),(0,k.jsx)(r.T,{weight:"semibold",children:"Send by"}),(0,k.jsx)(r.Toggle,{testID:"notif-inapp",label:"In the app (gold slider, Done / Later)",value:l.sendBy.inApp,onChange:e=>g({sendBy:{...l.sendBy,inApp:e}})}),(0,k.jsx)(r.Toggle,{testID:"notif-push",label:"Phone notification (when phones are switched on)",value:l.sendBy.push,onChange:e=>g({sendBy:{...l.sendBy,push:e}})}),f?(0,k.jsx)(r.Muted,{size:13,children:f}):null,(0,k.jsxs)(r.Row,{gap:8,style:{justifyContent:'flex-end'},children:[(0,k.jsx)(r.Button,{small:!0,kind:"ghost",label:"Cancel",onPress:o}),(0,k.jsx)(r.Button,{small:!0,testID:"notif-save",label:"Save",disabled:!!f,onPress:()=>s({...l,title:l.title.trim(),message:l.message.trim(),days:[...l.days].sort()})})]})]})}function R(){const[e,t]=(0,n.useState)(null),[s,o]=(0,n.useState)('');return(0,n.useEffect)(()=>{(0,y.pushState)().then(t)},[]),e&&'unsupported'!==e?(0,k.jsxs)(a.default,{testID:"push-button",style:{gap:4},children:[(0,k.jsx)(r.Button,{small:!0,kind:'on'===e?'ghost':'secondary',testID:"push-turn-on",label:'on'===e?'Phone notifications are on for this phone \xb7 Turn off':'\ud83d\udd14 Turn on phone notifications',onPress:()=>{('on'===e?(0,y.turnOffPush)():(0,y.turnOnPush)()).then(e=>{o(e.message),(0,y.pushState)().then(t)})}}),(0,k.jsx)(r.Muted,{size:12,children:s||('ios-home-screen'===e?'iPhone: add this app to your Home Screen first (iOS 16.4 or later).':'For this phone only. Each person turns it on on their own phone.')})]}):null}const B=e=>p.useOrderLists.getState().resetSettings(e);const P=(e,t)=>g.useClockArea.getState().reset(e,t),O='https://www.foodstandards.gov.scot/publications-and-research/publications/cooksafe-manual'},1043,[796,991,34,379,402,102,794,840,1021,1022,865,1025,1026,1027,992,1044,985,1045,994,25]); __d(function(_g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.getFix=function(e=1e4){const t='undefined'!=typeof navigator?navigator.geolocation:void 0;return t?new Promise(o=>{let n=!1;const c=e=>{n||(n=!0,o(e))},u=setTimeout(()=>c('timeout'),e+1500);try{t.getCurrentPosition(e=>{clearTimeout(u),c({lat:e.coords.latitude,lng:e.coords.longitude,acc:e.coords.accuracy??999})},e=>{clearTimeout(u),c(1===e.code?'denied':3===e.code?'timeout':'unavailable')},{enableHighAccuracy:!0,timeout:e,maximumAge:0})}catch{clearTimeout(u),c('unsupported')}}):Promise.resolve('unsupported')},_e.locationAllowed=async function(){try{const e=await(navigator.permissions?.query({name:'geolocation'}));return'granted'===e?.state}catch{return!1}}},1044,[]); __d(function(g,r,_i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.pushState=f,e.turnOnPush=async function(){const u=await f();if('ios-home-screen'===u)return{ok:!1,message:'On iPhone, add this app to your Home Screen first (Share \u203a Add to Home Screen, iOS 16.4 or later), then open it from there.'};if('unsupported'===u)return{ok:!1,message:'This browser can\u2019t get phone notifications. Try Chrome on Android, or the app from your iPhone Home Screen.'};if('blocked'===u)return{ok:!1,message:'Notifications are blocked for this app. Allow them in your phone\u2019s settings, then try again.'};const c=i.useSync.getState();if('staff'!==c.kind||!c.venueId||!c.staffRef)return{ok:!1,message:'Sign in from your personal link first.'};if('granted'!==await Notification.requestPermission())return{ok:!1,message:'You didn\u2019t allow notifications, so nothing changed.'};const p=await navigator.serviceWorker.ready,h=(await p.pushManager.getSubscription()??await p.pushManager.subscribe({userVisibleOnly:!0,applicationServerKey:s(n.VAPID_PUBLIC_KEY)})).toJSON();if(!h.endpoint||!h.keys?.p256dh||!h.keys?.auth)return{ok:!1,message:'Your browser didn\u2019t give a usable subscription. Try again.'};const l=(0,t.getSupabase)(),{error:y}=await l.from('push_subscriptions').upsert({venue_id:c.venueId,staff_ref:c.staffRef,app:o.APP_VARIANT,endpoint:h.endpoint,p256dh:h.keys.p256dh,auth:h.keys.auth,user_agent:navigator.userAgent.slice(0,200)},{onConflict:'user_id,endpoint'});return y?{ok:!1,message:`Couldn\u2019t save this phone: ${y.message}`}:{ok:!0,message:'Phone notifications are on for this device.'}},e.turnOffPush=async function(){const n=await(navigator.serviceWorker?.getRegistration()),i=await(n?.pushManager.getSubscription());if(!i)return{ok:!0,message:'Phone notifications are off for this device.'};const o=i.endpoint;await i.unsubscribe();try{const n=(0,t.getSupabase)();await n.from('push_subscriptions').delete().eq('endpoint',o)}catch{}return{ok:!0,message:'Phone notifications are off for this device.'}};var n=r(d[0]),t=r(d[1]),i=r(d[2]),o=r(d[3]);const s=n=>{const t=atob(n.replace(/-/g,'+').replace(/_/g,'/')+'='.repeat((4-n.length%4)%4)),i=new Uint8Array(t.length);for(let n=0;n'undefined'!=typeof navigator&&/iPhone|iPad|iPod/.test(navigator.userAgent),c=()=>'undefined'!=typeof window&&(window.matchMedia?.('(display-mode: standalone)').matches||!0===navigator.standalone);async function f(){if('undefined'==typeof window||!('serviceWorker'in navigator))return'unsupported';if(!('PushManager'in window)||'undefined'==typeof Notification)return u()&&!c()?'ios-home-screen':'unsupported';if('denied'===Notification.permission)return'blocked';const n=await navigator.serviceWorker.getRegistration();return await(n?.pushManager.getSubscription())?'on':'off'}},1045,[1046,931,985,846]); @@ -1191,11 +1191,11 @@ __d(function(g,r,i,_a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule' __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 v}}),Object.defineProperty(_e,"fitLabel",{enumerable:!0,get:function(){return M}}),Object.defineProperty(_e,"BIG_LABEL_MIN",{enumerable:!0,get:function(){return j}}),_e.areaBounds=k,_e.minReadableScale=function(e,t){return Math.max(0,...e.tables.filter(e=>e.areaId===t).map(e=>{const t='round'===e.shape?.85:1,o=(7.4399999999999995*Math.max(1,(0,x.tableNumber)(e).length)+6)/(e.w*t),n=22/Math.min(e.w,e.h);return Math.max(o,n)}))},_e.seatSpots=S,_e.FixtureShape=R,_e.FloorCanvas=function(e){const[C,$]=(0,r.useState)({w:0,h:0}),I=e.plan.tables.filter(t=>t.areaId===e.areaId),A=e.crop&&I.length?k(e.plan,e.areaId):{x:0,y:0,w:l.PLAN_W,h:l.PLAN_H},z='live'===e.mode?[...new Map(I.flatMap(t=>{const o=e.view?.[t.name];if(!o?.group||o.group.length<2)return[];const n=[...o.group].sort().join('+');return[[n,{key:n,members:o.group,view:o}]]})).values()]:[],L=28*z.length,E={x:A.x,y:A.y,r:A.x+A.w,b:A.y+A.h},D=C.w?'width'===e.fit?Math.min(C.w/l.PLAN_W,e.maxH?e.maxH/l.PLAN_H:9):Math.min(C.w/A.w,Math.max(1,C.h-L)/A.h):0,F=e.fill&&'contain'===e.fit&&D>0&&C.h>0,_=F?(C.w/D-A.w)/2:0,O=F?((C.h-L)/D-A.h)/2:0,N={x:E.x-_,y:E.y-O,r:E.r+_,b:E.b+O},B=N.r-N.x,P=N.b-N.y,[W,H]=(0,r.useState)(null),G=(0,r.useRef)(null),[Y,X]=(0,r.useState)(null),U=(0,r.useRef)(null);U.current=Y,i.default.useEffect(()=>{if(!Y)return;const e=setTimeout(()=>X(null),n.ARM_MS);return()=>clearTimeout(e)},[Y]);const q='live'===e.mode&&!!e.onDrop,J=e=>!q||(0,n.isArmed)(U.current,e.id,Date.now()),K=t=>e.plan.sections.find(e=>e.id===t.sectionId),V=t=>e.plan.joins.find(e=>e.tables.includes(t.name)),Q=i.default.useMemo(()=>(0,x.numberClashes)(e.plan.tables).sameArea,[e.plan.tables]),Z=(t,o)=>({onStartShouldSetResponder:()=>!0,onMoveShouldSetResponder:()=>J(t),onResponderTerminationRequest:()=>!J(t),onResponderGrant:e=>{G.current={x:e.nativeEvent.pageX,y:e.nativeEvent.pageY,id:t.id,kind:o}},onResponderMove:n=>{const r=G.current;if(!r)return;const i=n.nativeEvent.pageX-r.x,s=n.nativeEvent.pageY-r.y;Math.abs(i)+Math.abs(s)<6&&!W||J(t)&&('live'!==e.mode||e.onDrop&&e.view&&['seated','mains','dessert','bill'].includes(e.view[t.name]?.status)&&e.view[t.name]?.booking)&&H({id:t.id,dx:i,dy:s,kind:o})},onResponderRelease:r=>{const i=G.current;G.current=null;const a=r.nativeEvent.pageX-(i?.x??0),u=r.nativeEvent.pageY-(i?.y??0);if(H(null),Math.abs(a)+Math.abs(u)<6||!D){if('move'===o){if(q){const e=(0,n.releaseOn)(U.current,t.id,!1,Date.now());if(X(e.arm),'select'===e.action)try{s.default.announceForAccessibility(n.SELECTED_A11Y)}catch{}}e.onTap?.(t)}return}if(q){const e=(0,n.releaseOn)(U.current,t.id,!0,Date.now());if(X(e.arm),'move'!==e.action)return}const h=a/D,c=u/D;if('edit'===e.mode&&'move'===o)e.onMove?.(t,w(v(t.x+h,e.snapOn),0,l.PLAN_W-t.w),w(v(t.y+c,e.snapOn),0,l.PLAN_H-t.h));else if('edit'===e.mode&&'resize'===o)e.onResize?.(t,w(v(t.w+h,e.snapOn),50,400),w(v(t.h+c,e.snapOn),50,300));else if('live'===e.mode&&e.onDrop){const o=t.x+t.w/2+h,n=t.y+t.h/2+c,r=I.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);r&&e.onDrop(t,r)}}}),ee=e=>e*D,te=e=>ee(e-N.x),oe=e=>ee(e-N.y),ne='width'===e.fit?l.PLAN_H*D+L||200:void 0;return(0,g.jsxs)(a.default,{testID:"floor-canvas",onLayout:e=>$({w:e.nativeEvent.layout.width,h:e.nativeEvent.layout.height}),style:[{width:'100%',borderRadius:16,overflow:'hidden'},'contain'===e.fit?{flex:1}:{height:ne}],children:[z.map(e=>{const o=I.filter(t=>e.members.includes(t.name)),n=o.length?(Math.min(...o.map(e=>e.x))+Math.max(...o.map(e=>e.x+e.w)))/2:N.x+B/2,r=e.view.booking?.time??e.view.next?.time,i=`${T(e.members)}${r?` \xb7 ${'seated'===e.view.status?'Seated':'Booked'} ${r}`:''}`,s=Math.min(Math.max(0,C.w-8),260);return(0,g.jsx)(a.default,{testID:`joined-label-${e.key}`,accessible:!0,accessibilityLabel:`Joined tables ${i}`,pointerEvents:"none",style:{height:28,width:s,marginLeft:w(ee(n-N.x)-s/2,4,Math.max(4,C.w-s-4)),alignItems:'center',justifyContent:'center',overflow:'hidden',borderRadius:8,borderWidth:1,borderColor:h.colours.gold,backgroundColor:(0,t.soutersSurface)('#0B0B0B')},children:(0,g.jsx)(c.T,{size:16,weight:"bold",colour:h.colours.goldLight,center:!0,numberOfLines:1,children:i})},e.key)}),D?(0,g.jsx)(a.default,{style:{width:ee(B),height:ee(P),alignSelf:'center',backgroundColor:(0,t.soutersSurface)('#0F0E0C'),borderRadius:16,borderWidth:1,borderColor:h.colours.border,overflow:'hidden'},children:(0,g.jsxs)(a.default,{style:{position:'absolute',left:0,top:0,width:ee(B),height:ee(P)},children:['edit'===e.mode?Array.from({length:l.PLAN_W/(2*l.GRID)},(e,o)=>(0,g.jsx)(a.default,{style:{position:'absolute',left:te(o*l.GRID*2),top:0,bottom:0,width:1,backgroundColor:(0,t.soutersSurface)('#1E1B16')}},`v${o}`)):null,'edit'===e.mode?Array.from({length:l.PLAN_H/(2*l.GRID)},(e,o)=>(0,g.jsx)(a.default,{style:{position:'absolute',top:oe(o*l.GRID*2),left:0,right:0,height:1,backgroundColor:(0,t.soutersSurface)('#1E1B16')}},`h${o}`)):null,(e.plan.fixtures??[]).filter(t=>t.areaId===e.areaId).map(t=>(0,g.jsx)(R,{f:{...t,x:t.x-N.x,y:t.y-N.y},S:ee,live:'live'===e.mode},t.id)),e.plan.joins.map(e=>{const t=I.filter(t=>e.tables.includes(t.name));if(t.length<2)return null;const[o,n]=t,r=o.x+o.w/2,i=o.y+o.h/2,s=n.x+n.w/2,l=n.y+n.h/2,u=Math.hypot(s-r,l-i),h=Math.atan2(l-i,s-r);return(0,g.jsx)(a.default,{testID:`join-${e.tables.join('+')}`,style:{position:'absolute',left:te((r+s)/2-u/2),top:oe((i+l)/2)-3,width:ee(u),height:6,borderRadius:3,backgroundColor:'rgba(207,164,95,0.55)',transform:[{rotate:`${h}rad`}]}},e.id)}),I.map(n=>{const r=e.view?.[n.name],s=r?u.STATUS[r.status]:u.STATUS.free,v=W?.id===n.id,w=v&&'resize'===W.kind?Math.max(50,n.w+W.dx/D):n.w,C=v&&'resize'===W.kind?Math.max(50,n.h+W.dy/D):n.h,k=v&&'move'===W.kind?n.x+W.dx/D:n.x,R=v&&'move'===W.kind?n.y+W.dy/D:n.y,T=e.selected===n.id||e.highlight?.includes(n.name)||Y?.id===n.id,$=K(n),I='edit'===e.mode?'#2A2419':s.colour,A='edit'===e.mode?h.colours.text:s.fg,z='round'===n.shape?ee(Math.min(w,C))/2:ee(10),L='live'===e.mode?(0,x.liveTableLabel)(n,Q):(0,l.tableLabel)(n),E=ee(Math.min(w,C))<64,F=M(e.big?Math.max(13,Math.min(34,ee(Math.min(w,C))/3)):Math.max(11,Math.min(22,ee(Math.min(w,C))/4)),L,ee(w)*('round'===n.shape?.85:1),e.big?j:9),_=Math.max(e.big?11:12,Math.round(.62*F)),O=(ee(C)-6-1.4*F)/(1.4*_),N=O>=2&&ee(w)>=5*_?2:O>=1?1:0,B=r?.booking&&void 0!==r.seatedMins?r.booking.time:void 0,P='soon'===r?.status?r.next?.time??r.dayBookings?.[0]?.time:void 0,H='edit'===e.mode?`Table ${(0,o.tableNumbers)(L)}, ${(0,l.shapeLabel)(n.shape).toLowerCase()}, ${n.minSeats}\u2013${n.maxSeats} seats${n.online?', bookable online':''}`:'soon'===r?.status?`Table ${(0,o.tableNumbers)(L)}, booked later${P?`, ${P}`:''}${r.group?`, combined with ${r.group.filter(e=>e!==n.name).map(e=>`table ${e}`).join(', ')}`:''}`:`Table ${(0,o.tableNumbers)(L)}, ${s.label}${void 0!==r?.seatedMins?`, seated ${r.seatedMins} min`:''}${r?.covers?`, ${r.covers} Covers`:''}${r?.dayBookings?.length?`, booked: ${r.dayBookings.map(e=>`${e.time}, ${e.partySize} Covers`).join('; ')}`:''}${r?.group?`, combined with ${r.group.filter(e=>e!==n.name).map(e=>`table ${e}`).join(', ')}`:''}`,G=void 0!==r?.seatedMins&&r.booking?Math.min(1.2,r.seatedMins/(r.booking.durationMins??(0,u.turnFor)(r.booking.partySize,e.turnBase))):null;return(0,g.jsxs)(i.default.Fragment,{children:[S({...n,w:w,h:C}).map((t,o)=>(0,g.jsx)(a.default,{pointerEvents:"none",style:[{position:'absolute',left:te(k+t.x)-Math.max(4,ee(8)),top:oe(R+t.y)-Math.max(4,ee(8)),width:Math.max(8,ee(16)),height:Math.max(8,ee(16)),borderRadius:99,backgroundColor:'edit'===e.mode?'#5A4C33':'rgba(255,255,255,0.16)',borderWidth:1,borderColor:'edit'===e.mode?h.colours.gold:'rgba(255,255,255,0.25)'},y()]},o)),'live'===e.mode&&(ee(w)<44||ee(C)<44)?(0,g.jsx)(a.default,{accessible:!1,importantForAccessibility:"no-hide-descendants",'aria-hidden':!0,...Z(n,'move'),style:{position:'absolute',left:te(k+w/2)-Math.max(44,ee(w))/2,top:oe(R+C/2)-Math.max(44,ee(C))/2,width:Math.max(44,ee(w)),height:Math.max(44,ee(C)),zIndex:2}}):null,(0,g.jsxs)(a.default,{testID:`table-${n.name}`,accessibilityRole:"button",accessibilityLabel:H,onAccessibilityTap:()=>e.onTap?.(n),onKeyDown:t=>{'Enter'!==t?.key&&' '!==t?.key||e.onTap?.(n)},tabIndex:0,...Z(n,'move'),style:[{position:'absolute',left:te(k),top:oe(R),width:ee(w),height:ee(C),borderRadius:z,backgroundColor:I,alignItems:'center',justifyContent:'center',padding:2,overflow:'hidden',borderWidth:T?3:e.sectionColours&&$?2.5:1.5,borderColor:T?'#FFFFFF':e.sectionColours&&$?(0,h.brandColour)($.colour):'edit'===e.mode?h.colours.gold:'rgba(0,0,0,0.35)',transform:[{scale:v?1.06:1}],zIndex:v?50:3,opacity:v&&'live'===e.mode?.85:1,shadowColor:'#000',shadowOpacity:v?.6:.3,shadowRadius:v?14:6,cursor:'edit'===e.mode?'grab':'pointer',touchAction:'none'},v?null:y()],children:[(0,g.jsxs)(a.default,{style:{alignItems:'center',justifyContent:'center',maxWidth:'100%',maxHeight:'100%',overflow:'hidden'},pointerEvents:"none",children:[(0,g.jsx)(c.T,{style:p,weight:"bold",size:F,colour:A,center:!0,numberOfLines:1,children:L}),'live'===e.mode&&'blocked'===r?.status?(0,g.jsx)(c.T,{style:f,size:Math.max(10,Math.round(.5*F)),weight:"semibold",colour:A,center:!0,numberOfLines:1,children:"Blocked"}):null,'live'===e.mode&&r?.group&&r.group.length>1?null:e.big&&'live'===e.mode&&r&&1===N?'free'!==r.status&&'soon'!==r.status&&(r.covers||B)?(0,g.jsx)(c.T,{style:f,size:_,weight:"bold",colour:A,center:!0,numberOfLines:1,children:[r.covers?`${r.covers}`:'',B??''].filter(Boolean).join(' \xb7 ')}):null:e.big&&'live'===e.mode&&r&&2===N?(0,g.jsxs)(g.Fragment,{children:['soon'!==r.status&&r.covers?(0,g.jsxs)(c.T,{style:f,size:_,weight:"semibold",colour:A,center:!0,children:[r.covers," ",1===r.covers?'Cover':'Covers']}):'free'!==r.status||E?null:(0,g.jsxs)(c.T,{style:f,size:_,colour:A,center:!0,children:[n.minSeats,"\u2013",n.maxSeats]}),'free'!==r.status&&'soon'!==r.status&&B?(0,g.jsx)(c.T,{style:f,size:_,weight:"bold",colour:A,center:!0,children:B}):'dirty'===r.status?(0,g.jsx)(c.T,{style:f,size:_,colour:A,center:!0,children:"Clear"}):null]}):e.big&&'live'===e.mode?null:'edit'===e.mode?E?null:(0,g.jsxs)(c.T,{style:f,size:11,colour:h.colours.muted,center:!0,children:[n.minSeats,"\u2013",n.maxSeats,n.online?' \xb7 online':'']}):r?(0,g.jsxs)(g.Fragment,{children:['free'!==r.status||E?null:(0,g.jsxs)(c.T,{style:f,size:11,colour:A,center:!0,children:[n.minSeats,"\u2013",n.maxSeats," seats"]}),void 0!==r.seatedMins?(0,g.jsxs)(c.T,{style:f,size:12,weight:"semibold",colour:A,center:!0,children:[r.seatedMins,"m \xb7 ",r.covers,"\ud83d\udc65"]}):r.orderOnly?(0,g.jsx)(c.T,{style:f,size:11,colour:A,center:!0,children:"Open order"}):null,'dirty'!==r.status||E?null:(0,g.jsx)(c.T,{style:f,size:11,colour:A,center:!0,children:"Clear"}),!E||r.allergy||r.vip?(0,g.jsxs)(c.T,{style:f,size:11,colour:A,center:!0,children:[r.allergy?'\u26a0':'',r.vip?'VIP'===r.vip?'\u2605':'\u2665':'',r.occasion?u.OCCASION_ICON[r.occasion]:'',r.note?'\u270e':'']}):null]}):null]}),null,'live'===e.mode&&r&&!E&&(r.booking??r.next)&&(0,b.needsIcons)(r.booking??r.next).replace('\u26a0\ufe0f','').trim()?(0,g.jsx)(a.default,{pointerEvents:"none",testID:`needs-${n.name}`,style:{position:'absolute',bottom:e.big?-Math.max(9,.55*_):2,right:e.big?-6:4,backgroundColor:(0,t.soutersSurface)('rgba(11,11,11,0.85)'),borderRadius:8,paddingHorizontal:4,borderWidth:1,borderColor:'rgba(255,255,255,0.15)'},children:(0,g.jsx)(c.T,{size:e.big?Math.max(11,.75*_):10,children:(0,b.needsIcons)(r.booking??r.next).replace('\u26a0\ufe0f','').trim()})}):null,$&&'live'===e.mode&&e.sectionColours&&!E&&!e.big?(0,g.jsx)(a.default,{pointerEvents:"none",style:{position:'absolute',top:3,right:6,backgroundColor:(0,h.brandColour)($.colour),borderRadius:6,paddingHorizontal:3},children:(0,g.jsx)(c.T,{size:9,weight:"bold",colour:"#0B0B0B",children:$.server})}):null,null===G||E?null:(0,g.jsx)(a.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,g.jsx)(a.default,{style:{width:`${Math.min(100,100*G)}%`,height:4,borderRadius:2,backgroundColor:G>=1?'#B3261E':'rgba(0,0,0,0.6)'}})}),V(n)&&'edit'===e.mode?(0,g.jsx)(a.default,{pointerEvents:"none",style:{position:'absolute',bottom:2,left:4},children:(0,g.jsx)(c.T,{size:10,colour:h.colours.gold,children:"\u26d3"})}):null]}),'edit'===e.mode&&e.selected===n.id?(0,g.jsx)(a.default,{testID:"resize-handle",accessibilityLabel:"Resize table",...Z(n,'resize'),style:{position:'absolute',left:te(k+w)-14,top:oe(R+C)-14,width:28,height:28,borderRadius:14,backgroundColor:h.colours.gold,borderWidth:2,borderColor:'#fff',zIndex:60,cursor:'nwse-resize',touchAction:'none'}}):null]},n.id)}),0===I.length?(0,g.jsx)(a.default,{style:{position:'absolute',left:0,right:0,top:'45%'},children:(0,g.jsxs)(c.T,{center:!0,colour:h.colours.muted,children:["No tables in this area yet",'edit'===e.mode?' \u2014 add some in Tables':'',"."]})}):null]})}):null]})};var t=_r(d[0]),o=_r(d[1]),n=_r(d[2]),r=_r(d[3]),i=e(r),s=e(_r(d[4]));_r(d[5]);var a=e(_r(d[6])),l=_r(d[7]),u=_r(d[8]),h=_r(d[9]),c=_r(d[10]),b=_r(d[11]),x=_r(d[12]),g=_r(d[13]);const f={flexShrink:0},p={flexShrink:0,maxWidth:'none'},y=(e=250)=>({transitionProperty:'background-color, border-color, transform, left, top, width, height',transitionDuration:`${e}ms`}),v=(e,t=!0)=>t?Math.round(e/l.GRID)*l.GRID:Math.round(e),w=(e,t,o)=>Math.max(t,Math.min(o,e)),M=(e,t,o,n=9)=>Math.max(n,Math.min(e,(o-6)/(.62*Math.max(1,t.length)))),j=12,C=46;function k(e,t){const o=e.tables.filter(e=>e.areaId===t);if(!o.length)return{x:0,y:0,w:l.PLAN_W,h:l.PLAN_H};const n=Math.max(0,Math.min(...o.map(e=>e.x))-C),r=Math.max(0,Math.min(...o.map(e=>e.y))-C);return{x:n,y:r,w:Math.min(l.PLAN_W,Math.max(...o.map(e=>e.x+e.w))+C)-n,h:Math.min(l.PLAN_H,Math.max(...o.map(e=>e.y+e.h))+C)-r}}function S(e){const t=Math.max(1,e.maxSeats),o=[];if('round'===e.shape){const n=e.w/2+9.6,r=e.h/2+9.6;for(let i=0;ie.w,r=Math.ceil(t/2),i=t-r;if(n){for(let t=0;te.w,s=n?{borderColor:'#FFFFFF',borderWidth:2}:null;return'bar'===e.kind?(0,g.jsx)(a.default,{pointerEvents:"none",style:[r,{backgroundColor:o?'#2A2216':'#3A2E1C',borderRadius:8,borderWidth:1.5,borderColor:o?'#5A4A30':h.colours.gold},s],children:(0,g.jsx)(c.T,{size:Math.max(9,Math.min(14,t(e.h)/2.4)),weight:"semibold",colour:h.colours.goldLight,children:"BAR"})}):'wall'===e.kind?(0,g.jsx)(a.default,{pointerEvents:"none",style:[r,{backgroundColor:o?'#3A3631':'#5C574F',borderRadius:2},s]}):'window'===e.kind?(0,g.jsx)(a.default,{pointerEvents:"none",style:[r,{backgroundColor:'rgba(226,196,137,0.16)',borderColor:'rgba(226,196,137,0.6)',borderWidth:1,borderRadius:2},s],children:!o&&t(i?e.h:e.w)>60?(0,g.jsx)(c.T,{size:9,colour:"#BFDDFF",style:i?{transform:[{rotate:'90deg'}]}:void 0,children:"WINDOW"}):null}):(0,g.jsx)(a.default,{pointerEvents:"none",style:[r,{borderColor:o?'#7A6440':h.colours.gold,borderWidth:1.5,borderStyle:'dashed',borderRadius:3,backgroundColor:'rgba(207,164,95,0.08)'},s],children:t(i?e.h:e.w)>40?(0,g.jsx)(c.T,{size:9,colour:h.colours.goldLight,style:i?{transform:[{rotate:'90deg'}]}:void 0,children:"DOOR"}):null})}function T(e){return(0,l.tablesLabel)(e.join('+')).replace(/^Tables? /,'').replace(/ \+ /g,'+')}},1108,[798,829,1109,34,281,236,102,1014,1079,840,794,1081,828,25]); __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"ARM_MS",{enumerable:!0,get:function(){return t}}),Object.defineProperty(e,"SELECT_HINT",{enumerable:!0,get:function(){return n}}),Object.defineProperty(e,"SELECTED_A11Y",{enumerable:!0,get:function(){return o}}),Object.defineProperty(e,"TABLE_SELECT_HINT",{enumerable:!0,get:function(){return c}}),Object.defineProperty(e,"isArmed",{enumerable:!0,get:function(){return l}}),e.releaseOn=function(n,o,c,u){const b=l(n,o,u);return c?b?{arm:null,action:'move'}:{arm:n&&u-n.at!!n&&n.id===o&&c-n.at!e.signOff),S=k.filter(e=>e.signOff),_=j.map(o.allergenLabel).join(', '),C=e=>e.map(e=>e.name).join(', ')||'none';return(0,f.jsxs)(l.default,{testID:"menu-allergy-check",style:{gap:6,borderWidth:1,borderColor:p.length?h.colours.red:h.colours.border,borderRadius:12,padding:10,backgroundColor:h.colours.surface2},children:[(0,f.jsxs)(u.T,{weight:"semibold",children:["Allergy check against the menu (",_,")"]}),(0,f.jsxs)(u.T,{size:14,colour:h.colours.red,children:["Contains: ",p.length," dish",1===p.length?'':'es']}),(0,f.jsxs)(u.T,{size:14,colour:h.colours.amber,children:["May contain: ",M.length]}),(0,f.jsxs)(u.T,{size:14,colour:h.colours.ok,children:["Free from ",1===j.length?'it':'them'," (signed off): ",S.length]}),w.length?(0,f.jsxs)(u.Muted,{children:[w.length," more awaiting the head chef's sign-off, so not shown as safe."]}):null,(0,f.jsx)(n.default,{testID:"menu-allergy-details",accessibilityRole:"button",onPress:()=>y(!x),hitSlop:6,children:(0,f.jsx)(u.T,{size:14,colour:h.colours.gold,children:x?'Hide dishes':'Show dishes'})}),x?(0,f.jsxs)(l.default,{style:{gap:4},children:[(0,f.jsxs)(u.Muted,{children:["Contains: ",C(p)]}),(0,f.jsxs)(u.Muted,{children:["May contain: ",C(M)]}),(0,f.jsxs)(u.Muted,{children:["Free from: ",C(S)]})]}):null,(0,f.jsx)(u.Muted,{children:'guest'===m?'From the kitchen\u2019s signed-off recipe cards. Specials on the board are checked by staff on the day.':'From the signed-off recipe cards. Specials on the board have their own allergens. Still check with the guest and the kitchen.'})]})};var s=r(d[0]),n=e(r(d[1])),l=e(r(d[2])),t=r(d[3]),o=r(d[4]),c=r(d[5]),h=r(d[6]),u=r(d[7]),f=r(d[8])},1110,[34,402,102,848,830,832,840,794,25]); -__d(function(g,r,i,a,m,e,_d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"NOTES_PLACEHOLDER",{enumerable:!0,get:function(){return o}}),Object.defineProperty(e,"WIX_EDIT_NOTE",{enumerable:!0,get:function(){return s}}),e.canEditBooking=function(t){return'customer'!==t.variant&&('staff'===t.variant||t.inStaffApp?!!t.shiftManager:'display'===t.variant||'chef'===t.variant||'staff'!==t.role)},Object.defineProperty(e,"isWixBooking",{enumerable:!0,get:function(){return l}}),Object.defineProperty(e,"EDIT_FIELDS",{enumerable:!0,get:function(){return d}}),Object.defineProperty(e,"FIELD_WORDS",{enumerable:!0,get:function(){return c}}),Object.defineProperty(e,"draftOf",{enumerable:!0,get:function(){return u}}),e.changedFields=p,e.editPatch=function(n,o,s,l=(new Date).toISOString()){const d=p(n,o);if(!d.length)return{};const c={};for(const n of d){const s=f(n,o[n]);c[n]='partySize'===n?(0,t.clampParty)(s):'phone'===n||'email'===n||'table'===n?s||void 0:s}d.includes('table')&&(c.tableSetHere=!0);const u=n;return c.locallyEdited=!0,c.editedFields=[...new Set([...u.editedFields??[],...d])],c.editLog=[...u.editLog??[],{at:l,by:s.by.slice(0,80),app:s.app,fields:d}].slice(-50),c},e.editWarnings=function(t,o,s,l,d=90){const c=[],u={...t,date:o.date,time:o.time,partySize:o.partySize};if(o.table){const t=(0,n.tableOverlaps)(u,o.table,s.filter(t=>t.date===o.date),d);t.length&&c.push(`The table already has a booking at about the same time: ${t.map(t=>`${t.time} ${t.walkIn?'walk-in':t.name}`).join(', ')}.`)}l&&c.push(`Bookings are paused ${l.from} to ${l.to}${l.reason?` (${l.reason})`:''}.`);return c},Object.defineProperty(e,"editedWords",{enumerable:!0,get:function(){return b}});var t=r(_d[0]),n=r(_d[1]);const o='For example: birthday, high chair, dog, window seat',s='This booking came from the website. Changes here are not sent to website bookings yet.';const l=t=>{const n=t;return'Wix'===n.importedFrom||!!n.wix||(t.tags??[]).includes('Wix')},d=['date','time','partySize','name','phone','email','notes','table'],c={date:'date',time:'time',partySize:'covers',name:'name',phone:'phone',email:'email',notes:'notes',table:'table'},u=t=>({date:t.date,time:t.time,partySize:t.partySize,name:t.name,phone:t.phone??'',email:t.email??'',notes:t.notes??'',table:t.table??''}),f=(t,n)=>'partySize'===t?Number(n):String(n??'').trim();function p(t,n){const o=u(t);return d.filter(t=>f(t,o[t])!==f(t,n[t]))}const b=t=>t.map(t=>c[t]).join(', ')},1111,[1098,1092]); +__d(function(g,r,i,_a,m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"NOTES_PLACEHOLDER",{enumerable:!0,get:function(){return a}}),Object.defineProperty(_e,"WIX_EDIT_NOTE",{enumerable:!0,get:function(){return s}}),Object.defineProperty(_e,"NOTIFY_LABEL",{enumerable:!0,get:function(){return o}}),Object.defineProperty(_e,"guestMessageFields",{enumerable:!0,get:function(){return n}}),_e.canEditBooking=function(e){return'customer'!==e.variant&&('staff'===e.variant||e.inStaffApp?!!e.shiftManager:'display'===e.variant||'chef'===e.variant||'staff'!==e.role)},Object.defineProperty(_e,"isWixBooking",{enumerable:!0,get:function(){return d}}),Object.defineProperty(_e,"EDIT_FIELDS",{enumerable:!0,get:function(){return c}}),Object.defineProperty(_e,"DEPOSIT_METHODS",{enumerable:!0,get:function(){return u}}),Object.defineProperty(_e,"EDIT_STATUSES",{enumerable:!0,get:function(){return l}}),Object.defineProperty(_e,"SOURCES",{enumerable:!0,get:function(){return h}}),Object.defineProperty(_e,"OCCASIONS",{enumerable:!0,get:function(){return p}}),Object.defineProperty(_e,"TAGS",{enumerable:!0,get:function(){return b}}),Object.defineProperty(_e,"FIELD_WORDS",{enumerable:!0,get:function(){return f}}),Object.defineProperty(_e,"draftOf",{enumerable:!0,get:function(){return y}}),_e.changedFields=N,_e.historyText=k,_e.editPatch=function(t,a,s,o=(new Date).toISOString()){const n=N(t,a);if(!n.length)return{};const d={};for(const c of n)switch(c){case'partySize':d.partySize=(0,e.clampParty)(Number(a.partySize));break;case'phone':case'email':case'table':d[c]=String(a[c]??'').trim()||void 0;break;case'date':case'time':case'name':case'notes':d[c]=String(a[c]??'').trim();break;case'area':d.area=(a.area??'').trim()||void 0;break;case'dogs':d.dogs=Math.max(0,Number(a.dogs??0)),d.dog=Number(a.dogs??0)>0;break;case'highChairs':d.highChairs=Math.max(0,Number(a.highChairs??0))||void 0;break;case'wheelchair':d.access={...t.access??{},wheelchair:Math.max(0,Number(a.wheelchair??0))||void 0};break;case'occasion':d.occasion=a.occasion||void 0;break;case'allergies':d.allergies=[...a.allergies??[]],d.allergyNone=!!a.allergyNone&&!(a.allergies??[]).length,d.allergyNote=(a.allergyNote??'').trim()||void 0,(a.allergies??[]).length||(d.allergyAck=void 0);break;case'diet':d.diet={vegan:Number(a.vegan??0)||void 0,vegetarian:Number(a.vegetarian??0)||void 0};break;case'deposit':if(!a.depositOn){Object.assign(d,{security:'none',depositDue:0,depositPaid:0,depositPaidBy:void 0,depositPaidAt:void 0,depositMethod:void 0});break}if(d.security='deposit',d.depositDue=Math.max(0,Math.round(Number(a.depositDue??0))),a.depositPaid){const e=/^\d{4}-\d{2}-\d{2}$/.test(a.depositDate??'')?a.depositDate:o.slice(0,10);Object.assign(d,{depositPaid:Math.max(0,Math.round(Number(a.depositAmount??0))),depositPaidBy:s.by.slice(0,80),depositPaidAt:e===o.slice(0,10)?o:`${e}T12:00:00.000Z`,depositMethod:a.depositMethod||void 0})}else Object.assign(d,{depositPaid:0,depositPaidBy:void 0,depositPaidAt:void 0,depositMethod:void 0});break;case'status':d.status=a.status,'seated'!==a.status||t.seatedAt||(d.seatedAt=o),'finished'!==a.status||t.finishedAt||(d.finishedAt=o),'confirmed'!==a.status&&'pending'!==a.status||(d.seatedAt=void 0,d.finishedAt=void 0);break;case'source':d.source=a.source||void 0;break;case'tags':d.tags=[...(t.tags??[]).filter(e=>!b.includes(e)),...a.tags??[]];break;case'duration':d.durationMins=Number(a.duration??0)>=15?Number(a.duration):void 0}n.includes('table')&&(d.tableSetHere=!0);const c=t;return d.locallyEdited=!0,d.editedFields=[...new Set([...c.editedFields??[],...n])],d.editLog=[...c.editLog??[],{at:o,by:s.by.slice(0,80),app:s.app,fields:n,text:k(t,a,n,s.by.slice(0,80),o),quiet:!s.notify}].slice(-50),d},_e.historyLines=function(e){return(e.editLog??[]).slice().reverse().map(e=>e.text??`${e.fields.map(e=>f[e]??e).join(', ')} changed by ${e.by} ${w(e.at)}`.replace(/^./,e=>e.toUpperCase()))},_e.editWarnings=function(e,a,s,o,n=90,d){const c=[];if(!N(e,a).some(e=>['date','time','partySize','table','duration','dogs','status'].includes(e)))return c;const u={...e,date:a.date,time:a.time,partySize:a.partySize,...Number(a.duration??0)>=15?{durationMins:Number(a.duration)}:{}};if(a.table){const e=(0,t.tableOverlaps)(u,a.table,s.filter(e=>e.date===a.date),n);if(e.length&&c.push(`The table already has a booking at about the same time: ${e.map(e=>`${e.time} ${e.walkIn?'walk-in':e.name}`).join(', ')}.`),d){const e=a.table.split('+').map(e=>e.trim()).filter(Boolean).map(e=>d.tables.find(t=>t.name===e)).filter(Boolean),t=e.reduce((e,t)=>e+t.maxSeats,0);e.length&&td.areas.find(t=>t.id===e.areaId)).filter(e=>e&&!e.dogs);Number(a.dogs??0)>0&&s.length&&c.push(`Dogs aren\u2019t allowed in ${s[0].name}. Pick a dog-friendly table.`)}}o&&c.push(`Bookings are paused ${o.from} to ${o.to}${o.reason?` (${o.reason})`:''}.`);return c},Object.defineProperty(_e,"editedWords",{enumerable:!0,get:function(){return M}}),_e.bookingExtras=function(e){const t=e,a=e.dogs??(e.dog?1:0),s=[];a&&s.push(O(a,'dog','dogs'));t.highChairs&&s.push(O(t.highChairs,'high chair','high chairs'));e.access?.wheelchair&&s.push(O(e.access.wheelchair,'wheelchair','wheelchairs'));e.diet?.vegan&&s.push(`${e.diet.vegan} vegan`);e.diet?.vegetarian&&s.push(`${e.diet.vegetarian} vegetarian`);e.occasion&&s.push(e.occasion.charAt(0).toUpperCase()+e.occasion.slice(1));t.area&&s.push(t.area);t.depositMethod&&(e.depositPaid??0)>0&&s.push(`Deposit by ${t.depositMethod}`);return s.join(' \xb7 ')};var e=r(_d[0]),t=r(_d[1]);const a='For example: birthday, high chair, dog, window seat',s='This booking came from the website. Changes here are not sent to website bookings yet.',o='Message the guest about the new date, time or status (website bookings sends it)',n=e=>e.filter(e=>'date'===e||'time'===e||'status'===e);const d=e=>{const t=e;return'Wix'===t.importedFrom||!!t.wix||(e.tags??[]).includes('Wix')},c=['date','time','partySize','name','phone','email','notes','table','area','dogs','highChairs','wheelchair','occasion','allergies','diet','deposit','status','source','tags','duration'],u=['card','cash','bank transfer','website','other'],l=[{id:'pending',label:'Needs confirming'},{id:'confirmed',label:'Confirmed'},{id:'seated',label:'Seated'},{id:'finished',label:'Finished'},{id:'noshow',label:'No-show'}],h=[{id:'phone',label:'Phone'},{id:'in-person',label:'In person'},{id:'online',label:'Online'}],p=[{id:'',label:'None'},{id:'birthday',label:'Birthday'},{id:'anniversary',label:'Anniversary'},{id:'celebration',label:'Celebration'}],b=['VIP','Regular'],f={date:'date',time:'time',partySize:'covers',name:'name',phone:'phone',email:'email',notes:'notes',table:'table',area:'area',dogs:'dogs',highChairs:'high chairs',wheelchair:'wheelchairs',occasion:'occasion',allergies:'allergies',diet:'dietary',deposit:'deposit',status:'status',source:'source',tags:'tags',duration:'table time'},y=e=>{const t=e;return{date:e.date,time:e.time,partySize:e.partySize,name:e.name,phone:e.phone??'',email:e.email??'',notes:e.notes??'',table:e.table??'',area:t.area??'',dogs:e.dogs??(e.dog?1:0),highChairs:t.highChairs??0,wheelchair:e.access?.wheelchair??0,occasion:e.occasion??'',allergies:e.allergies??[],allergyNone:!!e.allergyNone,allergyNote:e.allergyNote??'',vegan:e.diet?.vegan??0,vegetarian:e.diet?.vegetarian??0,depositOn:'deposit'===e.security||(e.depositDue??0)>0||(e.depositPaid??0)>0,depositPaid:(e.depositPaid??0)>0&&!!e.depositPaidBy,depositAmount:(e.depositPaid??0)>0?e.depositPaid:e.depositDue??0,depositMethod:t.depositMethod??'',depositDate:(a=e.depositPaidAt,a?a.slice(0,10):''),depositDue:e.depositDue??0,status:e.status,source:e.source??'',tags:[...e.tags??[]].filter(e=>b.includes(e)).sort(),duration:e.durationMins??0};var a},$=e=>JSON.stringify([[...e.allergies??[]].map(e=>`${e.allergen}:${e.severity}`).sort(),!!e.allergyNone,(e.allergyNote??'').trim()]),v=e=>JSON.stringify(e.depositOn?[!0,!!e.depositPaid,Number(e.depositAmount??0),Number(e.depositDue??0),e.depositPaid?e.depositMethod??'':'',e.depositPaid?e.depositDate??'':'']:[!1]);function P(e,t){switch(e){case'partySize':return Number(t.partySize);case'allergies':return $(t);case'diet':return`${Number(t.vegan??0)}/${Number(t.vegetarian??0)}`;case'deposit':return v(t);case'tags':return[...t.tags??[]].sort().join(',');case'dogs':case'highChairs':case'wheelchair':case'duration':return Number(t[e]??0);default:return String(t[e]??'').trim()}}function N(e,t){const a=y(e);return c.filter(e=>P(e,a)!==P(e,t))}const S=e=>`\xa3${(e/100).toFixed(e%100?2:0)}`,w=e=>{const t=new Date(e);return`${String(t.getHours()).padStart(2,'0')}:${String(t.getMinutes()).padStart(2,'0')}`},O=(e,t,a)=>`${e} ${1===e?t:a}`;function k(e,t,a,s,o){const n=y(e),d=[];for(const e of[...a].sort((e,t)=>Number('deposit'===t)-Number('deposit'===e)))'deposit'===e?t.depositOn?t.depositPaid&&!n.depositPaid?d.push(`deposit marked paid (${S(Number(t.depositAmount??0))}${t.depositMethod?`, ${t.depositMethod}`:''})`):!t.depositPaid&&n.depositPaid?d.push('deposit marked not paid'):d.push(t.depositPaid?`deposit changed (${S(Number(t.depositAmount??0))}${t.depositMethod?`, ${t.depositMethod}`:''})`:`deposit due ${S(Number(t.depositDue??0))}`):d.push('deposit taken off'):'dogs'===e?d.push(!n.dogs&&t.dogs?1===t.dogs?'dog added':`${t.dogs} dogs added`:t.dogs?O(Number(t.dogs),'dog','dogs'):'no dog now'):'highChairs'===e?d.push(t.highChairs?O(Number(t.highChairs),'high chair','high chairs'):'no high chair now'):'wheelchair'===e?d.push(t.wheelchair?O(Number(t.wheelchair),'wheelchair user','wheelchair users'):'no wheelchair now'):'partySize'===e?d.push(`covers ${n.partySize} to ${t.partySize}`):'time'===e?d.push(`time ${n.time} to ${t.time}`):'date'===e?d.push(`date ${n.date} to ${t.date}`):'table'===e?d.push(t.table?`table ${t.table}`:'table taken off'):'status'===e?d.push(`status ${l.find(e=>e.id===t.status)?.label.toLowerCase()??t.status}`):'occasion'===e?d.push(t.occasion?`occasion ${t.occasion}`:'occasion taken off'):'area'===e?d.push(t.area?`area ${t.area}`:'any area'):'duration'===e?d.push(t.duration?`table time ${t.duration} min`:'table time as usual'):d.push(`${f[e]} changed`);const c=d.join(', ');return`${c.charAt(0).toUpperCase()}${c.slice(1)} by ${s} ${w(o)}`}const M=e=>e.map(e=>f[e]).join(', ')},1111,[1098,1092]); __d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"canCancelWalkIn",{enumerable:!0,get:function(){return y}}),Object.defineProperty(_e,"canReinstateWalkIn",{enumerable:!0,get:function(){return h}}),_e.cancelWalkInWords=x,_e.reinstateWalkInWords=p,_e.cancelWalkInNow=$,_e.reinstateWalkInNow=I,_e.CancelWalkInButton=function({rid:e,b:t,onDone:l,small:s,big:o}){const[c,u]=(0,n.useState)(!1);return y(t)?(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(f.Button,{kind:"secondary",small:s,label:"Cancel walk-in",testID:`cancel-walkin-${t.id}`,accessibilityLabel:`Cancel walk-in ${t.ref}, ${t.partySize} Covers`,onPress:()=>u(!0),style:o?{minHeight:64}:s?{minHeight:44}:w}),c?(0,k.jsx)(j,{rid:e,b:t,onClose:()=>u(!1),onDone:l}):null]}):null},_e.CancelWalkInConfirm=j,_e.ReinstateWalkInButton=function({rid:e,b:t,today:l,onDone:o,small:c}){const[u,y]=(0,n.useState)(!1);if(!h(t,l))return null;const x=p(t);if(!u)return(0,k.jsx)(f.Button,{kind:"ghost",small:c,label:"Undo cancel",testID:`reinstate-walkin-${t.id}`,accessibilityLabel:`Undo cancel for walk-in ${t.ref}`,onPress:()=>y(!0),style:c?{minHeight:44}:w});return(0,k.jsxs)(f.Sheet,{visible:!0,onClose:()=>y(!1),title:"Undo cancel?",maxWidth:560,testID:"reinstate-walkin-confirm",children:[(0,k.jsx)(s.default,{accessible:!0,accessibilityLabel:x,children:(0,k.jsx)(f.T,{size:18,colour:b.colours.text,children:x})}),(0,k.jsxs)(f.Row,{gap:8,wrap:!0,children:[(0,k.jsx)(f.Button,{label:"Yes, put back to seated",testID:"reinstate-walkin-yes",accessibilityLabel:`Yes, put walk-in ${t.ref} back to seated`,style:[w,{flexGrow:1}],onPress:async()=>{await I(e,t),y(!1),o?.(`Walk-in ${t.ref} put back to seated.`)}}),(0,k.jsx)(f.Button,{kind:"secondary",label:"Keep cancelled",testID:"reinstate-walkin-no",onPress:()=>y(!1),style:w})]})]})};var e,t=r(d[0]),n=r(d[1]),l=r(d[2]),s=(e=l)&&e.__esModule?e:{default:e},o=r(d[3]),c=r(d[4]),u=r(d[5]),b=r(d[6]),f=r(d[7]),k=r(d[8]);const w={minHeight:56},y=e=>!!e.walkIn&&('seated'===e.status||'confirmed'===e.status),h=(e,t)=>!!e.walkIn&&'cancelled'===e.status&&e.date>=t;function x(e){const t=(0,c.tablesOf)(e.table),n=(0,u.tablesWords)(t);return`Cancel walk-in ${e.ref}, ${e.partySize} Covers${t.length?` at ${n}`:''}, arrived ${e.time}? It comes off the Covers${t.length?` and ${n} ${t.length>1?'go':'goes'} back to Free`:''}.`}function p(e){return`Put walk-in ${e.ref} back to seated? CoverCharge only \u2014 if it was cancelled on the website, put it back there too if needed.`}async function $(e,n){await o.repo.bookings.setStatus(n.id,'cancelled'),await o.repo.bookings.update(n.id,{cancelled:(0,t.cancelStamp)(n)}),(0,c.tablesOf)(n.table).forEach(t=>c.useFloor.getState().setLive(e,t,{stage:void 0,dirty:!1}))}async function I(e,t){await o.repo.bookings.setStatus(t.id,'seated'),(0,c.tablesOf)(t.table).forEach(t=>c.useFloor.getState().setLive(e,t,{stage:'seated',dirty:!1}))}function j({rid:e,b:t,onClose:n,onDone:l}){const o=x(t);return(0,k.jsxs)(f.Sheet,{visible:!0,onClose:n,title:"Cancel walk-in?",maxWidth:560,testID:"cancel-walkin-confirm",children:[(0,k.jsx)(s.default,{accessible:!0,accessibilityLabel:o,children:(0,k.jsx)(f.T,{size:18,colour:b.colours.text,children:o})}),(0,k.jsxs)(f.Row,{gap:8,wrap:!0,children:[(0,k.jsx)(f.Button,{label:"Yes, cancel walk-in",testID:"cancel-walkin-yes",accessibilityLabel:`Yes, cancel walk-in ${t.ref}`,style:[w,{flexGrow:1}],onPress:async()=>{await $(e,t),n(),l?.(`Walk-in ${t.ref} cancelled.${(0,c.tablesOf)(t.table).length?` ${(0,u.tablesWords)((0,c.tablesOf)(t.table))} free.`:''}`)}}),(0,k.jsx)(f.Button,{kind:"secondary",label:"Keep walk-in",testID:"cancel-walkin-no",accessibilityLabel:`Keep walk-in ${t.ref}`,onPress:n,style:w})]})]})}},1112,[1113,34,102,848,1014,1095,840,794,25]); __d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.cancelStamp=C,_e.cancelBookingNow=w,_e.reinstateBookingNow=$,_e.CancelBookingButton=function({rid:e,b:n,name:o,onDone:s,big:l,small:c}){const[u,f]=(0,t.useState)(!1);return(0,b.canCancelBooking)(n)?(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(x.Button,{kind:"secondary",small:c,label:"Cancel booking",testID:`cancel-booking-${n.id}`,accessibilityLabel:`Cancel booking for ${o}, ${n.time}, ${n.partySize} Covers`,onPress:()=>f(!0),style:l?{minHeight:64}:c?{minHeight:44}:j}),u?(0,h.jsx)(D,{rid:e,b:n,name:o,onClose:()=>f(!1),onDone:s}):null]}):null},_e.CancelBookingConfirm=D,_e.ReinstateBookingButton=function({b:e,name:n,today:s,onDone:l}){const[c,u]=(0,t.useState)(!1);if(!(0,b.canReinstateBooking)(e,s))return null;const y=(0,b.reinstateBookingWords)(e,n);if(!c)return(0,h.jsx)(x.Button,{kind:"ghost",label:"Undo cancel",testID:`reinstate-booking-${e.id}`,accessibilityLabel:`Undo cancel for ${n}`,onPress:()=>u(!0),style:j});return(0,h.jsxs)(x.Sheet,{visible:!0,onClose:()=>u(!1),title:"Undo cancel?",maxWidth:560,testID:"reinstate-booking-confirm",children:[(0,h.jsx)(o.default,{accessible:!0,accessibilityLabel:y,style:{alignItems:'center'},children:(0,h.jsx)(x.T,{size:18,colour:f.colours.text,style:{textAlign:'center'},children:y})}),(0,h.jsxs)(x.Row,{gap:8,wrap:!0,style:{justifyContent:'center'},children:[(0,h.jsx)(x.Button,{label:"Yes, put back to booked",testID:"reinstate-booking-yes",accessibilityLabel:`Yes, put ${n} back to booked`,style:[j,{flexGrow:1}],onPress:async()=>{await $(e),u(!1),l?.(`${n} put back to booked.`)}}),(0,h.jsx)(x.Button,{kind:"secondary",label:"Keep cancelled",testID:"reinstate-booking-no",onPress:()=>u(!1),style:j})]})]})};var e,t=r(d[0]),n=r(d[1]),o=(e=n)&&e.__esModule?e:{default:e},s=r(d[2]),l=r(d[3]),c=r(d[4]),b=r(d[5]),u=r(d[6]),f=r(d[7]),y=r(d[8]),k=r(d[9]),p=r(d[10]),x=r(d[11]),h=r(d[12]);const j={minHeight:56},B={display:'Display',owner:'Managers app',staff:'Staff app',chef:'Kitchen app',customer:'Customer page'};function C(e){const t=y.useSession.getState().meId,n=t?k.useOwner.getState().staff.find(e=>e.id===t):void 0,o=B[p.APP_VARIANT]??'CoverCharge';return{by:n?`${n.name.replace(' (example)','')} (${o})`:o,at:(new Date).toISOString(),app:o,...e.table?{table:e.table}:{}}}async function w(e,t){const n=(0,l.tablesOf)(t.table);await s.repo.bookings.update(t.id,{status:'cancelled',cancelled:C(t),...(0,c.tablePatch)(null)}),n.forEach(t=>l.useFloor.getState().setLive(e,t,{stage:void 0,dirty:!1}))}async function $(e){await s.repo.bookings.setStatus(e.id,'confirmed')}function D({rid:e,b:t,name:n,onClose:s,onDone:c}){const y=(0,b.cancelBookingWords)(t,n),k=(0,l.tablesOf)(t.table);return(0,h.jsxs)(x.Sheet,{visible:!0,onClose:s,title:"Cancel booking?",maxWidth:560,testID:"cancel-booking-confirm",children:[(0,h.jsx)(o.default,{accessible:!0,accessibilityLabel:y,style:{alignItems:'center',gap:8},children:(0,h.jsx)(x.T,{size:18,colour:f.colours.text,style:{textAlign:'center'},children:y})}),(0,h.jsxs)(x.Row,{gap:8,wrap:!0,style:{justifyContent:'center'},children:[(0,h.jsx)(x.Button,{label:"Yes, cancel booking",testID:"cancel-booking-yes",accessibilityLabel:`Yes, cancel booking for ${n}`,style:[j,{flexGrow:1}],onPress:async()=>{await w(e,t),s(),c?.(`${n} cancelled.${k.length?` ${(0,u.tablesWords)(k)} free.`:''}`)}}),(0,h.jsx)(x.Button,{kind:"secondary",label:"Keep booking",testID:"cancel-booking-no",accessibilityLabel:`Keep booking for ${n}`,onPress:s,style:j})]})]})}},1113,[34,102,848,1014,1092,1114,1095,840,997,865,846,794,25]); __d(function(g,r,i,_a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"canCancelBooking",{enumerable:!0,get:function(){return n}}),Object.defineProperty(e,"canReinstateBooking",{enumerable:!0,get:function(){return t}}),e.cancelBookingWords=function(n,t){const o=`${n.partySize} Cover${1===n.partySize?'':'s'}`;return`Cancel booking for ${t}, ${n.time}, ${o}? The table is freed. Website bookings will cancel it on the website and may email the guest.`},e.reinstateBookingWords=function(n,t){return`Put ${t} back to booked for ${n.time}? CoverCharge only \u2014 if it was cancelled on the website, put it back there too if needed.`},e.cancelledOnDay=o,e.cancelledDayTally=function(n,t){const a=o(n,t),l=a.filter(n=>!!n.walkIn),c=a.filter(n=>!n.walkIn);return{count:a.length,covers:a.reduce((n,t)=>n+t.partySize,0),bookings:c.length,bookingCovers:c.reduce((n,t)=>n+t.partySize,0),walkIns:l.length,walkInCovers:l.reduce((n,t)=>n+t.partySize,0),list:a}},e.cancelledTallyWords=function(n,t="today"){if(!n.count)return`No cancellations ${t}`;const o=[],a=n.bookings??0,l=n.walkIns??0;a&&o.push(`${a} booking${1===a?'':'s'} (${n.bookingCovers??0} Cover${1===(n.bookingCovers??0)?'':'s'})`);l&&o.push(`${l} walk-in${1===l?'':'s'} (${n.walkInCovers??0} Cover${1===(n.walkInCovers??0)?'':'s'})`);if(!o.length)return`Cancelled ${t}: ${n.count} \xb7 ${n.covers} Cover${1===n.covers?'':'s'}`;return`Cancelled ${t}: ${o.join(' \xb7 ')}`};const n=n=>!n.walkIn&&('confirmed'===n.status||'pending'===n.status||'seated'===n.status),t=(n,t)=>!n.walkIn&&'cancelled'===n.status&&n.date>=t;function o(n,t){return n.filter(n=>n.date===t&&'cancelled'===n.status).sort((n,t)=>n.time.localeCompare(t.time)||n.name.localeCompare(t.name))}},1114,[]); -__d(function(g,_r,i,_a,_m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.BookingEditButton=function({rid:e,booking:a,who:n,role:o,inStaffApp:l,shiftManager:s,big:d,testID:r}){const[u,b]=(0,t.useState)(!1);return a.walkIn||!(0,h.canEditBooking)({variant:c.APP_VARIANT,inStaffApp:l,role:o,shiftManager:s})?null:(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(k.Button,{kind:"secondary",small:!d,label:"Edit booking",testID:r??`edit-booking-${a.id}`,accessibilityLabel:`Edit booking, ${a.name}, ${a.time}`,onPress:()=>b(!0),style:{minHeight:d?64:44}}),u?(0,j.jsx)(C,{rid:e,id:a.id,who:n,onClose:()=>b(!1)}):null]})},_e.EditBookingPicker=function({rid:e,today:a,who:n,onClose:o,hidePrivate:s}){const[d,r]=(0,t.useState)(null),c=(0,l.useBookings)(e).filter(e=>!e.walkIn&&e.date>=a&&!['cancelled','noshow','finished'].includes(e.status)).sort((e,t)=>e.date.localeCompare(t.date)||e.time.localeCompare(t.time)).slice(0,60);return d?(0,j.jsx)(C,{rid:e,id:d,who:n,hidePrivate:s,onClose:o}):(0,j.jsxs)(k.Sheet,{visible:!0,onClose:o,title:"Edit booking \xb7 pick a booking",maxWidth:640,testID:"edit-booking-picker",children:[(0,j.jsx)(k.T,{size:16,colour:b.colours.text,children:"Tip: tap the booking you want to change."}),c.length?c.map(e=>(0,j.jsx)(k.Button,{kind:"secondary",testID:`edit-pick-${e.id}`,label:`${e.date===a?'Today':e.date} ${e.time} \xb7 ${e.name} \xb7 ${e.partySize} ${1===e.partySize?'Cover':'Covers'}`,sub:e.notes?`Notes: ${e.notes}`:void 0,accessibilityLabel:`Edit booking, ${e.name}, ${e.date===a?'today':e.date}, ${e.time}, ${e.partySize} Covers`,onPress:()=>r(e.id),style:{minHeight:56,alignItems:'flex-start'}},e.id)):(0,j.jsx)(k.Muted,{children:"No bookings to edit from today on."}),(0,j.jsx)(k.Button,{kind:"ghost",label:"Close",onPress:o,style:{minHeight:44}})]})},_e.EditBookingSheet=C;var e,t=_r(_d[0]),a=_r(_d[1]),n=_r(_d[2]),o=(e=n)&&e.__esModule?e:{default:e},l=_r(_d[3]),s=_r(_d[4]),d=_r(_d[5]),r=_r(_d[6]),c=_r(_d[7]),h=_r(_d[8]),u=_r(_d[9]),b=_r(_d[10]),m=_r(_d[11]),p=_r(_d[12]),x=_r(_d[13]),y=_r(_d[14]),k=_r(_d[15]),j=_r(_d[16]);const f=/^([01]\d|2[0-3]):[0-5]\d$/,v=e=>{const t=e.trim().replace('.',':').match(/^(\d{1,2}):?(\d{2})$/);return t?`${t[1].padStart(2,'0')}:${t[2]}`:e.trim()};function C({rid:e,id:n,who:C,onClose:T,hidePrivate:I='display'===c.APP_VARIANT}){const B=(0,l.useBookings)(e),D=B.find(e=>e.id===n),P=(0,r.useRestaurant)(e),$=(0,s.usePlan)(e),S=(0,d.useBlocks)(e=>e.blocks),[w,E]=(0,t.useState)(D?(0,h.draftOf)(D):null),[z,A]=(0,t.useState)(null),[L,_]=(0,t.useState)(null);if(!D||!w||!P)return null;const F=e=>{A(null),_(null),E({...w,...e})},N=v(w.time),W=f.test(N),R=(0,u.tableOptions)($,B.filter(e=>e.date===w.date),w.table),M=(0,h.changedFields)(D,{...w,time:N}),O=P.settings.turnMins??90,H=async()=>{const t=(0,h.editPatch)(D,{...w,time:N},{by:C||'Team member',app:c.APP_VARIANT});if(Object.keys(t).length&&await l.repo.bookings.update(D.id,t),'seated'===D.status&&'table'in t&&t.table!==D.table){const a=e=>e?e.split('+').map(e=>e.trim()).filter(Boolean):[],n=a(D.table),o=a(t.table),l=s.useFloor.getState(),d=n.map(t=>l.live[e]?.[t]?.stage).find(Boolean)??'seated';n.filter(e=>!o.includes(e)).forEach(t=>l.setLive(e,t,{stage:void 0,dirty:!0})),o.forEach(t=>l.setLive(e,t,{stage:d,dirty:!1}))}_(`Saved. Changed: ${(0,h.editedWords)(M)}.`),A(null),T()};return(0,j.jsxs)(k.Sheet,{visible:!0,onClose:T,title:`Edit booking \xb7 ${D.name} \xb7 ${D.ref}`,maxWidth:760,testID:"edit-booking-sheet",children:[(0,j.jsx)(x.DepositChip,{b:D,money:!0,big:!0,testID:"edit-deposit"}),(0,h.isWixBooking)(D)?(0,j.jsx)(o.default,{testID:"edit-wix-note",accessible:!0,accessibilityLabel:h.WIX_EDIT_NOTE,style:{padding:12,borderRadius:12,borderWidth:1,borderColor:b.colours.gold},children:(0,j.jsx)(k.T,{size:16,colour:b.colours.goldLight,children:h.WIX_EDIT_NOTE})}):null,(0,j.jsx)(k.T,{size:16,colour:b.colours.text,children:"Tip: change what you need, then press Save changes."}),(0,j.jsx)(p.BookingDatePicker,{r:P,today:new Date,value:w.date,onChange:e=>F({date:e})}),(0,j.jsx)(k.Field,{label:"Time (24-hour, for example 19:30)",value:w.time,onChangeText:e=>F({time:e}),testID:"edit-time"}),W?null:(0,j.jsx)(k.T,{size:15,colour:b.colours.amber,children:"Write the time like 19:30."}),(0,j.jsxs)(o.default,{style:{gap:6,alignItems:'center'},children:[(0,j.jsx)(k.T,{size:18,center:!0,children:"Covers"}),(0,j.jsx)(a.PartySizeInput,{value:w.partySize,onChange:e=>F({partySize:e}),label:"Covers",testID:"edit-covers"})]}),(0,j.jsx)(k.Field,{label:"Name",value:w.name,onChangeText:e=>F({name:e}),testID:"edit-name"}),I?(0,j.jsx)(k.Muted,{children:"Phone and email can be changed in the Managers app; the Display never shows them."}):(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(k.Field,{label:"Phone",value:w.phone,onChangeText:e=>F({phone:e}),keyboardType:"phone-pad",testID:"edit-phone"}),(0,j.jsx)(k.Field,{label:"Email",value:w.email,onChangeText:e=>F({email:e}),keyboardType:"email-address",autoCapitalize:"none",testID:"edit-email"})]}),(0,j.jsx)(k.Field,{label:"Notes",value:w.notes,onChangeText:e=>F({notes:e}),placeholder:h.NOTES_PLACEHOLDER,multiline:!0,numberOfLines:3,testID:"edit-notes"}),D.allergies.length||D.allergyNote?(0,j.jsx)(k.Muted,{children:"Allergies are kept separately and are not changed here."}):null,(0,j.jsx)(k.T,{size:18,weight:"semibold",children:(0,u.tableButtonLabel)(w.table)}),(0,j.jsxs)(k.Row,{gap:8,wrap:!0,children:[(0,j.jsx)(k.Button,{kind:w.table?'secondary':'primary',label:"No table",accessibilityLabel:"No table"+(w.table?'':', chosen'),onPress:()=>F({table:''}),style:{minHeight:44,minWidth:96},testID:"edit-table-none"}),R.map(e=>(0,j.jsx)(k.Button,{kind:e===w.table?'primary':'secondary',label:(0,u.tableButtonLabel)(e),accessibilityLabel:`Table ${(0,u.tableButtonLabel)(e)}${e===w.table?', chosen':''}`,onPress:()=>F({table:e}),style:{minHeight:44,minWidth:64},testID:`edit-table-${e}`},e))]}),z?(0,j.jsxs)(o.default,{testID:"edit-warn",style:{gap:8,padding:12,borderRadius:12,borderWidth:1.5,borderColor:b.colours.amber,backgroundColor:b.colours.amberBg},children:[z.map(e=>(0,j.jsx)(k.T,{size:16,colour:"#FFE2A8",children:e},e)),(0,j.jsx)(k.T,{size:16,colour:"#FFE2A8",children:"You can still save."})]}):null,L?(0,j.jsx)(k.T,{size:16,colour:b.colours.goldLight,children:L}):null,(0,j.jsxs)(k.Row,{gap:8,wrap:!0,children:[(0,j.jsx)(k.Button,{label:z?'Save anyway':'Save changes',testID:"edit-save",disabled:!W||w.name.trim().length<1||!M.length,onPress:()=>{const t=W?(0,d.blockAt)(S,e,w.date,N):void 0,a=(0,h.editWarnings)(D,{...w,time:N},B,t,O);!a.length||z?H():A(a)},style:{minHeight:56,flex:1}}),(0,j.jsx)(k.Button,{kind:"ghost",label:"Close",onPress:T,style:{minHeight:56}})]}),(0,j.jsx)(y.CancelBookingButton,{rid:e,b:D,name:D.name,big:!0,onDone:()=>T()}),(0,j.jsx)(y.ReinstateBookingButton,{b:D,name:D.name,today:(0,m.ymd)(new Date),onDone:()=>T()})]})}},1115,[34,1097,102,848,1014,1011,850,846,1111,1092,840,827,1105,1089,1113,794,25]); +__d(function(g,_r,_i,_a,_m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.BookingEditButton=function({rid:e,booking:s,who:i,role:a,inStaffApp:n,shiftManager:l,big:o,testID:d}){const[h,m]=(0,t.useState)(!1),x=(0,u.useSession)(e=>e.meId),j=(0,p.useOwner)(e=>e.staff.find(e=>e.id===x&&e.active));return s.walkIn||!(0,c.canEditBooking)({variant:r.APP_VARIANT,inStaffApp:n,role:a,shiftManager:l})||x&&!(0,b.canChangeBookings)(j)?null:(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(C.Button,{kind:"secondary",small:!o,label:"Edit booking",sub:o?void 0:"Deposit, dog, table, anything",testID:d??`edit-booking-${s.id}`,accessibilityLabel:`Edit booking, ${s.name}, ${s.time}`,onPress:()=>m(!0),style:{minHeight:o?64:44}}),h?(0,f.jsx)(B,{rid:e,id:s.id,who:i,onClose:()=>m(!1)}):null]})},_e.EditBookingPicker=function({rid:e,today:s,who:i,onClose:a,hidePrivate:l}){const[o,d]=(0,t.useState)(null),r=(0,n.useBookings)(e).filter(e=>!e.walkIn&&e.date>=s&&!['cancelled','noshow','finished'].includes(e.status)).sort((e,t)=>e.date.localeCompare(t.date)||e.time.localeCompare(t.time)).slice(0,60);return o?(0,f.jsx)(B,{rid:e,id:o,who:i,hidePrivate:l,onClose:a}):(0,f.jsxs)(C.Sheet,{visible:!0,onClose:a,title:"Edit booking \xb7 pick a booking",maxWidth:640,testID:"edit-booking-picker",children:[(0,f.jsx)(C.T,{size:16,colour:x.colours.text,children:"Tip: tap the booking you want to change."}),r.length?r.map(e=>(0,f.jsx)(C.Button,{kind:"secondary",testID:`edit-pick-${e.id}`,label:`${e.date===s?'Today':e.date} ${e.time} \xb7 ${e.name} \xb7 ${e.partySize} ${1===e.partySize?'Cover':'Covers'}`,sub:e.notes?`Notes: ${e.notes}`:void 0,accessibilityLabel:`Edit booking, ${e.name}, ${e.date===s?'today':e.date}, ${e.time}, ${e.partySize} Covers`,onPress:()=>d(e.id),style:{minHeight:56,alignItems:'flex-start'}},e.id)):(0,f.jsx)(C.Muted,{children:"No bookings to edit from today on."}),(0,f.jsx)(C.Button,{kind:"ghost",label:"Close",onPress:a,style:{minHeight:44}})]})},_e.EditBookingSheet=B;var e,t=_r(_d[0]),s=_r(_d[1]),i=_r(_d[2]),a=(e=i)&&e.__esModule?e:{default:e},n=_r(_d[3]),l=_r(_d[4]),o=_r(_d[5]),d=_r(_d[6]),r=_r(_d[7]),c=_r(_d[8]),h=_r(_d[9]),u=_r(_d[10]),p=_r(_d[11]),b=_r(_d[12]),m=_r(_d[13]),x=_r(_d[14]),j=_r(_d[15]),y=_r(_d[16]),D=_r(_d[17]),I=_r(_d[18]),C=_r(_d[19]),f=_r(_d[20]);const T=/^([01]\d|2[0-3]):[0-5]\d$/,v=e=>{const t=e.trim().replace('.',':').match(/^(\d{1,2}):?(\d{2})$/);return t?`${t[1].padStart(2,'0')}:${t[2]}`:e.trim()};const w=e=>e?(e/100).toFixed(e%100?2:0):'',k=e=>{const t=Number(e.replace(/[\xa3,\s]/g,''));return Number.isFinite(t)&&t>=0?Math.round(100*t):NaN},S=e=>e&&/^\d{4}-\d{2}-\d{2}$/.test(e)?`${e.slice(8,10)}/${e.slice(5,7)}/${e.slice(0,4)}`:'',P=e=>{const t=e.trim().match(/^(\d{1,2})\/(\d{1,2})\/(\d{4})$/);return t?`${t[3]}-${t[2].padStart(2,'0')}-${t[1].padStart(2,'0')}`:''},$=e=>e.charAt(0).toUpperCase()+e.slice(1);function N({title:e,children:t,testID:s}){return(0,f.jsxs)(a.default,{testID:s,style:{gap:8,paddingTop:10,borderTopWidth:1,borderTopColor:x.colours.hairline,alignItems:'stretch'},children:[(0,f.jsx)(C.T,{size:17,weight:"semibold",center:!0,colour:x.colours.goldLight,children:e}),t]})}const E=({label:e,value:t,onChange:s,max:i=20,testID:a})=>(0,f.jsxs)(C.Row,{style:{justifyContent:'space-between',alignItems:'center'},children:[(0,f.jsx)(C.T,{size:16,children:e}),(0,f.jsx)(C.Stepper,{testID:a,value:t,min:0,max:i,onChange:s,label:e})]});function B({rid:e,id:i,who:u,onClose:p,hidePrivate:b='display'===r.APP_VARIANT}){const B=(0,n.useBookings)(e),O=B.find(e=>e.id===i),z=(0,d.useRestaurant)(e),A=(0,l.usePlan)(e),R=(0,o.useBlocks)(e=>e.blocks),[L,F]=(0,t.useState)(O?(0,c.draftOf)(O):null),[W,M]=(0,t.useState)(null),[_,H]=(0,t.useState)(null),[V,G]=(0,t.useState)(w(O?(0,c.draftOf)(O).depositDue:0)),[U,X]=(0,t.useState)(w(O?(0,c.draftOf)(O).depositAmount:0)),[Y,q]=(0,t.useState)(S(O?(0,c.draftOf)(O).depositDate:'')),[J,K]=(0,t.useState)(!1);if(!O||!L||!z)return null;const Q=e=>{M(null),H(null),F({...L,...e})},Z=v(L.time),ee=T.test(Z),te=L.area?A.areas.filter(e=>e.name===L.area).map(e=>e.id):null,se=e=>!te||e.split('+').every(e=>te.includes(A.tables.find(t=>t.name===e)?.areaId??'')),ie=(0,m.tableOptions)(A,B.filter(e=>e.date===L.date),L.table).filter(e=>se(e)||e===L.table),ae=!(L.depositOn&&(Number.isNaN(k(V||'0'))||L.depositPaid&&(Number.isNaN(k(U||'0'))||Y.trim()&&!P(Y)))),ne={...L,time:Z,depositDue:k(V||'0')||0,depositAmount:k(U||'0')||0,depositDate:P(Y)},le=(0,c.changedFields)(O,ne),oe=z.settings.turnMins??90,de=async()=>{const t=(0,c.editPatch)(O,ne,{by:u||'Team member',app:r.APP_VARIANT,notify:J&&(0,c.isWixBooking)(O)});if(Object.keys(t).length&&await n.repo.bookings.update(O.id,t),'seated'===O.status&&'table'in t&&t.table!==O.table){const s=e=>e?e.split('+').map(e=>e.trim()).filter(Boolean):[],i=s(O.table),a=s(t.table),n=l.useFloor.getState(),o=i.map(t=>n.live[e]?.[t]?.stage).find(Boolean)??'seated';i.filter(e=>!a.includes(e)).forEach(t=>n.setLive(e,t,{stage:void 0,dirty:!0})),a.forEach(t=>n.setLive(e,t,{stage:o,dirty:!1}))}H(`Saved. Changed: ${(0,c.editedWords)(le)}.`),M(null),p()},re=L.allergies??[],ce=e=>Q({allergyNone:!1,allergies:re.some(t=>t.allergen===e)?re.filter(t=>t.allergen!==e):[...re,{allergen:e,severity:'allergy'}]}),he=(0,c.historyLines)(O);return(0,f.jsxs)(C.Sheet,{visible:!0,onClose:p,title:`Edit booking \xb7 ${O.name} \xb7 ${O.ref}`,maxWidth:760,testID:"edit-booking-sheet",children:[(0,f.jsx)(a.default,{style:{alignItems:'center'},children:(0,f.jsx)(D.DepositChip,{b:O,money:!0,big:!0,testID:"edit-deposit"})}),(0,c.isWixBooking)(O)?(0,f.jsx)(a.default,{testID:"edit-wix-note",accessible:!0,accessibilityLabel:c.WIX_EDIT_NOTE,style:{padding:12,borderRadius:12,borderWidth:1,borderColor:x.colours.gold},children:(0,f.jsx)(C.T,{size:16,center:!0,colour:x.colours.goldLight,children:c.WIX_EDIT_NOTE})}):null,(0,f.jsx)(C.T,{size:16,center:!0,colour:x.colours.text,children:"Tip: change what you need, then press Save changes. Saving doesn\u2019t message the guest."}),(0,f.jsxs)(N,{title:"Deposit",testID:"edit-section-deposit",children:[(0,f.jsxs)(C.Row,{wrap:!0,gap:6,style:{justifyContent:'center'},children:[(0,f.jsx)(C.Chip,{label:"No deposit",selected:!L.depositOn,testID:"edit-deposit-none",onPress:()=>Q({depositOn:!1,depositPaid:!1})}),(0,f.jsx)(C.Chip,{label:"Deposit due",selected:!!L.depositOn&&!L.depositPaid,testID:"edit-deposit-due",onPress:()=>Q({depositOn:!0,depositPaid:!1})}),(0,f.jsx)(C.Chip,{label:"Deposit paid",selected:!!L.depositOn&&!!L.depositPaid,testID:"edit-deposit-paid",onPress:()=>{U||X(V),Y||q(S((0,j.ymd)(new Date))),Q({depositOn:!0,depositPaid:!0})}})]}),L.depositOn?(0,f.jsx)(C.Field,{label:"Deposit due (\xa3)",value:V,onChangeText:e=>{G(e),Q({})},keyboardType:"decimal-pad",testID:"edit-deposit-due-amount"}):null,L.depositOn&&L.depositPaid?(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(C.Field,{label:"Amount paid (\xa3)",value:U,onChangeText:e=>{X(e),Q({})},keyboardType:"decimal-pad",testID:"edit-deposit-amount"}),(0,f.jsx)(C.T,{size:16,center:!0,children:"How was it paid?"}),(0,f.jsx)(C.Row,{wrap:!0,gap:6,style:{justifyContent:'center'},children:c.DEPOSIT_METHODS.map(e=>(0,f.jsx)(C.Chip,{label:$(e),selected:L.depositMethod===e,testID:`edit-deposit-method-${e.replace(' ','-')}`,onPress:()=>Q({depositMethod:e})},e))}),(0,f.jsx)(C.Field,{label:"Date paid (for example 11/11/2026)",value:Y,onChangeText:e=>{q(e),Q({})},testID:"edit-deposit-date"}),Y.trim()&&!P(Y)?(0,f.jsx)(C.T,{size:15,center:!0,colour:x.colours.amber,children:"Write the date like 11/11/2026."}):null]}):null,ae?null:(0,f.jsx)(C.T,{size:15,center:!0,colour:x.colours.amber,children:"Write amounts in pounds, for example 60 or 12.50."}),(0,f.jsx)(C.Muted,{center:!0,children:"No payment is taken in CoverCharge: this records what the guest paid."})]}),(0,f.jsxs)(N,{title:"When",testID:"edit-section-when",children:[(0,f.jsx)(y.BookingDatePicker,{r:z,today:new Date,value:L.date,onChange:e=>Q({date:e})}),(0,f.jsx)(C.Field,{label:"Time (24-hour, for example 19:30)",value:L.time,onChangeText:e=>Q({time:e}),testID:"edit-time"}),ee?null:(0,f.jsx)(C.T,{size:15,colour:x.colours.amber,children:"Write the time like 19:30."}),(0,f.jsxs)(a.default,{style:{gap:6,alignItems:'center'},children:[(0,f.jsx)(C.T,{size:18,center:!0,children:"Covers"}),(0,f.jsx)(s.PartySizeInput,{value:L.partySize,onChange:e=>Q({partySize:e}),label:"Covers",testID:"edit-covers"})]}),(0,f.jsxs)(C.Row,{style:{justifyContent:'space-between',alignItems:'center'},children:[(0,f.jsx)(C.T,{size:16,children:"Table time"}),(0,f.jsx)(C.Stepper,{testID:"edit-duration",value:L.duration||0,min:0,max:360,step:15,onChange:e=>Q({duration:e}),format:e=>e?`${Math.floor(e/60)}h ${String(e%60).padStart(2,'0')}m`:'As usual',label:"Table time"})]})]}),(0,f.jsxs)(N,{title:"Where",testID:"edit-section-where",children:[(0,f.jsxs)(C.Row,{wrap:!0,gap:6,style:{justifyContent:'center'},children:[(0,f.jsx)(C.Chip,{label:"Any area",selected:!L.area,testID:"edit-area-any",onPress:()=>Q({area:''})}),A.areas.map(e=>(0,f.jsx)(C.Chip,{label:`${e.name}${e.dogs?' \xb7 dogs ok':''}`,selected:L.area===e.name,testID:`edit-area-${e.id}`,onPress:()=>Q({area:e.name})},e.id))]}),(0,f.jsx)(C.T,{size:18,weight:"semibold",center:!0,children:(0,m.tableButtonLabel)(L.table)}),(0,f.jsxs)(C.Row,{gap:8,wrap:!0,style:{justifyContent:'center'},children:[(0,f.jsx)(C.Button,{kind:L.table?'secondary':'primary',label:"No table",accessibilityLabel:"No table"+(L.table?'':', chosen'),onPress:()=>Q({table:''}),style:{minHeight:44,minWidth:96},testID:"edit-table-none"}),ie.map(e=>(0,f.jsx)(C.Button,{kind:e===L.table?'primary':'secondary',label:(0,m.tableButtonLabel)(e),accessibilityLabel:`Table ${(0,m.tableButtonLabel)(e)}${e===L.table?', chosen':''}`,onPress:()=>Q({table:e}),style:{minHeight:44,minWidth:64},testID:`edit-table-${e}`},e))]})]}),(0,f.jsxs)(N,{title:"Guest",testID:"edit-section-guest",children:[(0,f.jsx)(C.Field,{label:"Name",value:L.name,onChangeText:e=>Q({name:e}),testID:"edit-name"}),b?(0,f.jsx)(C.Muted,{center:!0,children:"Phone and email can be changed in the Managers app; the Display never shows them."}):(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(C.Field,{label:"Phone",value:L.phone,onChangeText:e=>Q({phone:e}),keyboardType:"phone-pad",testID:"edit-phone"}),(0,f.jsx)(C.Field,{label:"Email",value:L.email,onChangeText:e=>Q({email:e}),keyboardType:"email-address",autoCapitalize:"none",testID:"edit-email"})]}),(0,f.jsx)(C.T,{size:16,center:!0,children:"Booked by"}),(0,f.jsx)(C.Row,{wrap:!0,gap:6,style:{justifyContent:'center'},children:c.SOURCES.map(e=>(0,f.jsx)(C.Chip,{label:e.label,selected:L.source===e.id,testID:`edit-source-${e.id}`,onPress:()=>Q({source:e.id})},e.id))}),(0,f.jsx)(C.Row,{wrap:!0,gap:6,style:{justifyContent:'center'},children:c.TAGS.map(e=>{const t=(L.tags??[]).includes(e);return(0,f.jsx)(C.Chip,{label:e,selected:t,testID:`edit-tag-${e}`,onPress:()=>Q({tags:t?(L.tags??[]).filter(t=>t!==e):[...L.tags??[],e].sort()})},e)})})]}),(0,f.jsxs)(N,{title:"Dogs, high chairs and access",testID:"edit-section-needs",children:[(0,f.jsx)(E,{label:"Dogs",value:L.dogs??0,max:6,onChange:e=>Q({dogs:e}),testID:"edit-dogs"}),(0,f.jsx)(E,{label:"High chairs",value:L.highChairs??0,max:10,onChange:e=>Q({highChairs:e}),testID:"edit-high-chairs"}),(0,f.jsx)(E,{label:"Wheelchair users",value:L.wheelchair??0,max:10,onChange:e=>Q({wheelchair:e}),testID:"edit-wheelchair"}),(0,f.jsx)(C.T,{size:16,center:!0,children:"Occasion"}),(0,f.jsx)(C.Row,{wrap:!0,gap:6,style:{justifyContent:'center'},children:c.OCCASIONS.map(e=>(0,f.jsx)(C.Chip,{label:e.label,selected:(L.occasion??'')===e.id,testID:`edit-occasion-${e.id||'none'}`,onPress:()=>Q({occasion:e.id})},e.id||'none'))})]}),(0,f.jsxs)(N,{title:"Allergies and dietary",testID:"edit-section-allergies",children:[(0,f.jsxs)(C.Row,{wrap:!0,gap:6,style:{justifyContent:'center'},children:[(0,f.jsx)(C.Chip,{label:"No allergies",selected:!!L.allergyNone&&!re.length,testID:"edit-allergy-none",onPress:()=>Q({allergyNone:!0,allergies:[]})}),h.ALLERGENS.map(e=>(0,f.jsx)(C.Chip,{label:e.short,selected:re.some(t=>t.allergen===e.id),testID:`edit-allergen-${e.id}`,onPress:()=>ce(e.id)},e.id))]}),re.map(e=>(0,f.jsxs)(a.default,{style:{gap:4,alignItems:'center'},children:[(0,f.jsxs)(C.T,{size:15,center:!0,children:[h.ALLERGENS.find(t=>t.id===e.allergen)?.short,": how serious?"]}),(0,f.jsx)(C.Row,{wrap:!0,gap:6,style:{justifyContent:'center'},children:h.SEVERITIES.map(t=>(0,f.jsx)(C.Chip,{label:t.label,selected:e.severity===t.id,testID:`edit-severity-${e.allergen}-${t.id}`,onPress:()=>Q({allergies:re.map(s=>s.allergen===e.allergen?{...s,severity:t.id}:s)})},t.id))})]},e.allergen)),(0,f.jsx)(C.Field,{label:"Anything else about allergies",value:L.allergyNote,onChangeText:e=>Q({allergyNote:e}),testID:"edit-allergy-note"}),le.includes('allergies')&&re.length?(0,f.jsx)(C.T,{size:15,center:!0,colour:x.colours.amber,children:"The kitchen signs off allergies again after this change."}):null,(0,f.jsx)(E,{label:"Vegan",value:L.vegan??0,max:L.partySize,onChange:e=>Q({vegan:e}),testID:"edit-vegan"}),(0,f.jsx)(E,{label:"Vegetarian",value:L.vegetarian??0,max:L.partySize,onChange:e=>Q({vegetarian:e}),testID:"edit-vegetarian"})]}),'cancelled'!==O.status?(0,f.jsxs)(N,{title:"Status",testID:"edit-section-status",children:[(0,f.jsx)(C.Row,{wrap:!0,gap:6,style:{justifyContent:'center'},children:c.EDIT_STATUSES.map(e=>(0,f.jsx)(C.Chip,{label:e.label,selected:L.status===e.id,testID:`edit-status-${e.id}`,onPress:()=>Q({status:e.id})},e.id))}),(0,f.jsx)(C.Muted,{center:!0,children:"To cancel, use Cancel booking below. Nothing is ever deleted."})]}):null,(0,f.jsx)(N,{title:"Notes",testID:"edit-section-notes",children:(0,f.jsx)(C.Field,{label:"Notes",value:L.notes,onChangeText:e=>Q({notes:e}),placeholder:c.NOTES_PLACEHOLDER,multiline:!0,numberOfLines:3,testID:"edit-notes"})}),W?(0,f.jsxs)(a.default,{testID:"edit-warn",style:{gap:8,padding:12,borderRadius:12,borderWidth:1.5,borderColor:x.colours.amber,backgroundColor:x.colours.amberBg},children:[W.map(e=>(0,f.jsx)(C.T,{size:16,center:!0,colour:"#FFE2A8",children:e},e)),(0,f.jsx)(C.T,{size:16,center:!0,colour:"#FFE2A8",children:"You can still save."})]}):null,(0,c.isWixBooking)(O)&&(0,c.guestMessageFields)(le).length?(0,f.jsxs)(a.default,{testID:"edit-notify",style:{gap:6,alignItems:'center'},children:[(0,f.jsx)(C.Toggle,{value:J,onChange:K,label:c.NOTIFY_LABEL,testID:"edit-notify-toggle"}),(0,f.jsx)(C.Muted,{center:!0,children:J?'The website sends the guest its own message about this.':'Off: the guest isn\u2019t messaged. The website keeps the old date, time or status until it\u2019s changed there.'})]}):null,_?(0,f.jsx)(C.T,{size:16,center:!0,colour:x.colours.goldLight,children:_}):null,(0,f.jsxs)(C.Row,{gap:8,wrap:!0,children:[(0,f.jsx)(C.Button,{label:W?'Save anyway':'Save changes',testID:"edit-save",disabled:!ee||!ae||L.name.trim().length<1||!le.length,onPress:()=>{const t=ee?(0,o.blockAt)(R,e,L.date,Z):void 0,s=(0,c.editWarnings)(O,ne,B,t,oe,A);!s.length||W?de():M(s)},style:{minHeight:56,flex:1}}),(0,f.jsx)(C.Button,{kind:"ghost",label:"Close",onPress:p,style:{minHeight:56}})]}),he.length?(0,f.jsx)(N,{title:"Changes",testID:"edit-history",children:he.slice(0,12).map((e,t)=>(0,f.jsx)(C.T,{size:14,center:!0,colour:x.colours.muted,children:e},t))}):null,(0,f.jsx)(I.CancelBookingButton,{rid:e,b:O,name:O.name,big:!0,onDone:()=>p()}),(0,f.jsx)(I.ReinstateBookingButton,{b:O,name:O.name,today:(0,j.ymd)(new Date),onDone:()=>p()})]})}},1115,[34,1097,102,848,1014,1011,850,846,1111,830,997,865,1012,1092,840,827,1105,1089,1113,794,25]); __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,"useVoiceSlot",{enumerable:!0,get:function(){return w}}),_e.voiceAppFor=h,_e.useVoiceTarget=p,_e.VoiceSlot=function({size:e=56,layer:t=0}){const u=p(),c=(0,n.useRef)(null),l=(0,n.useRef)(y++).current,{width:f,height:h,fontScale:v}=(0,o.default)(),A=()=>{if(t{if(c.current!==e||!s||tu+.5?w.getState().owner===l&&w.setState({rect:null,owner:0}):w.setState({rect:{x:n,y:o,size:s},owner:l})})},W=(0,n.useRef)(A);return W.current=A,(0,n.useLayoutEffect)(()=>{if(u?.on)return S.set(l,{layer:t,measure:()=>W.current()}),()=>{S.delete(l),w.getState().owner===l&&w.setState({rect:null,owner:0}),requestAnimationFrame(b)}},[u?.on,t]),(0,n.useLayoutEffect)(()=>{A();const e=requestAnimationFrame(A);return()=>cancelAnimationFrame(e)},[f,h,v,u?.on]),(0,n.useEffect)(()=>{const e=c.current;if(!u?.on||'undefined'==typeof ResizeObserver||!e?.parentElement)return;const t=new ResizeObserver(A);return t.observe(e.parentElement),e.parentElement.parentElement&&t.observe(e.parentElement.parentElement),()=>t.disconnect()},[u?.on]),(0,n.useEffect)(()=>()=>{w.getState().owner===l&&w.setState({rect:null,owner:0})},[]),(0,n.useEffect)(()=>{u?.on||w.getState().owner!==l||w.setState({rect:null,owner:0})},[u?.on]),u?.on?(0,m.jsx)(s.default,{ref:c,testID:"voice-slot",onLayout:A,style:{width:e,height:e,flexShrink:0}}):null};var t=r(d[0]),n=r(d[1]),o=e(r(d[2])),s=e(r(d[3])),u=r(d[4]),c=r(d[5]),l=r(d[6]),f=r(d[7]),m=r(d[8]);const w=(0,u.create)(()=>({rect:null,owner:0}));function h(e){return'customer'===c.APP_VARIANT||/^\/(customer|table|demo)/.test(e)?null:e.startsWith('/owner')||e.startsWith('/admin')?'owner':e.startsWith('/team')?'staff':e.startsWith('/kitchen')?'chef':e.startsWith('/display')?'display':null}function p(){const e=(0,t.usePathname)()||'/',n=(0,l.useCtx)(6e4),o=(0,f.useVoiceSettings)(e=>e.enabled),s=h(e);if(!s)return null;const u='owner'===s?'owner'===n.role?'owner':'manager'===n.role?'manager':'staff':s;return{app:s,role:u,actions:'staff'===u?'staff':s,on:(0,f.voiceOn)(o,n.rid,u)}}let y=1;const S=new Map,E=()=>{let e=-1;return S.forEach(t=>{t.layer>e&&(e=t.layer)}),e};function b(){const e=E();S.forEach(t=>{t.layer===e&&t.measure()})}},1116,[30,34,426,102,815,846,1100,1117,25]); __d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"VOICE_ROLES",{enumerable:!0,get:function(){return o}}),Object.defineProperty(_e,"VOICE_ROLE_LABEL",{enumerable:!0,get:function(){return p}}),Object.defineProperty(_e,"useVoiceSettings",{enumerable:!0,get:function(){return u}}),Object.defineProperty(_e,"voiceOn",{enumerable:!0,get:function(){return f}}),_e.micExplainedFor=function(e){try{if('1'===b()?.getItem(s(e)))return!0}catch{}return u.getState().micExplained},_e.setMicExplainedFor=function(e){try{b()?.setItem(s(e),'1')}catch{}u.getState().setMicExplained(!0)};var e,n=r(d[0]),t=(e=n)&&e.__esModule?e:{default:e},c=r(d[1]),l=r(d[2]);const o=['owner','manager','staff','chef','display'],p={owner:'Owner (Managers app)',manager:'Managers (Managers app)',staff:'Staff app (full voice assistant, no money or HR)',chef:'Head Chef app',display:'Main Display'},u=(0,c.create)()((0,l.persist)(e=>({enabled:{},micExplained:!1,setEnabled:(n,t,c)=>e(e=>({enabled:{...e.enabled,[n]:{...e.enabled[n]??{},[t]:c}}})),setMicExplained:n=>e({micExplained:n})}),{name:'covercharge-voice-v1',version:4,storage:(0,l.createJSONStorage)(()=>t.default),migrate:(e,n)=>({enabled:n<2?{}:e?.enabled??{},micExplained:!!e?.micExplained}),merge:(e,n)=>({...n,enabled:e?.enabled??n.enabled,micExplained:e?.micExplained??n.micExplained}),partialize:e=>({enabled:e.enabled,micExplained:e.micExplained})})),f=(e,n,t)=>!1!==e[n]?.[t],s=e=>`cc-voice-mic-explained-${e}`,b=()=>{try{return'undefined'!=typeof window?window.localStorage:void 0}catch{return}}},1117,[808,815,818]); __d(function(g,_r,_i,a,_m,e,_d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"VAT",{enumerable:!0,get:function(){return r}}),Object.defineProperty(e,"exVat",{enumerable:!0,get:function(){return n}}),e.dishCost=i,Object.defineProperty(e,"gpPct",{enumerable:!0,get:function(){return o}}),Object.defineProperty(e,"priceForTarget",{enumerable:!0,get:function(){return c}}),e.costings=function(r,c,s,u){const d=(0,t.dishStats)(r);return c.map(t=>{const c=r.find(r=>r.id===t.dishId);if(!c||null==c.price)return null;const p=i(t,s),l=n(c.price),f=o(p,c.price),b=d.find(t=>t.item.id===c.id)?.sold??0;return{item:c,recipe:t,cost:p,priceInc:c.price,priceEx:l,gp:f,cashGp:l-p,below:ft.prevCost&&t.prevCost!==t.cost).map(s=>{const u=(s.cost-(s.prevCost??s.cost))/(s.prevCost??1)*100,d=r.filter(t=>t.lines.some(t=>t.ing===s.id)).map(r=>{const u=t.find(t=>t.id===r.dishId);if(!u||null==u.price)return null;const d=o(i(r,n,{ing:s.id,cost:s.prevCost}),u.price),p=o(i(r,n),u.price);return{item:u,before:d,after:p,dropped:d>=c&&pt.dropped),below:d.filter(t=>t.below)}})},e.weekGp=function(t,r,n){const i=t.reduce((t,r)=>t+r.priceEx*r.soldWeek,0),o=t.reduce((t,r)=>t+r.cost*r.soldWeek,0),c=o+r+Math.max(0,n);return{sales:i,theoCost:o,actualCost:c,theo:i?(i-o)/i*100:0,actual:i?(i-c)/i*100:0}},Object.defineProperty(e,"fmtQty",{enumerable:!0,get:function(){return s}});var t=_r(_d[0]);const r=.2,n=t=>Math.round(t/1.2);function i(t,r,n){return Math.round(t.lines.reduce((t,i)=>{const o=r.find(t=>t.id===i.ing);return t+(n&&n.ing===i.ing?n.cost:o?.cost??0)*i.qty},0))}const o=(t,r)=>{const i=n(r);return i>0?(i-t)/i*100:0},c=(t,r)=>50*Math.ceil(t/(1-r/100)*1.2/50);const s=(t,r)=>`${Number.isInteger(t)?t:t.toFixed(t<1?3:2).replace(/0+$/,'').replace(/\.$/,'')} ${'each'===r?'':r}`.trim()},1118,[1119]); @@ -1421,7 +1421,7 @@ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{v __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 f}});var t=r(d[0]);r(d[1]);var n=r(d[2]),u=r(d[3]),c=r(d[4]);function f(){return'owner'!==u.APP_VARIANT?(0,c.jsx)(t.Redirect,{href:u.ENTRY[u.APP_VARIANT]}):(0,c.jsx)(n.OwnerApp,{})}},1338,[30,34,1339,846,25]); __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.OwnerApp=function(){return n.IS_CAR?(0,u.jsx)(t.CarApp,{}):(0,u.jsx)(p.OwnerApp,{})},r(d[0]);var n=r(d[1]),p=r(d[2]),t=r(d[3]),u=r(d[4])},1339,[34,846,1340,1473,25]); __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.OwnerApp=function(){return(0,ie.isDesktop)()?(0,de.jsx)(le.DesktopShell,{}):(0,de.jsx)(he,{})};var s=_r(d[0]),t=_r(d[1]),o=_r(d[2]),n=_r(d[3]),r=_r(d[4]),a=_r(d[5]),l=_r(d[6]),c=_r(d[7]),u=_r(d[8]),f=_r(d[9]),h=_r(d[10]),p=_r(d[11]),b=_r(d[12]),x=_r(d[13]),j=e(_r(d[14])),w=e(_r(d[15])),y=e(_r(d[16])),S=e(_r(d[17])),A=e(_r(d[18])),k=e(_r(d[19])),R=_r(d[20]),C=_r(d[21]),v=_r(d[22]),T=_r(d[23]),I=_r(d[24]),L=_r(d[25]),E=_r(d[26]),B=_r(d[27]),O=_r(d[28]),_=_r(d[29]),P=_r(d[30]),N=_r(d[31]);_r(d[32]);var M=_r(d[33]),H=_r(d[34]),V=_r(d[35]),D=_r(d[36]),W=_r(d[37]),$=_r(d[38]),z=_r(d[39]),U=_r(d[40]),F=_r(d[41]),G=_r(d[42]),K=_r(d[43]),Y=_r(d[44]);_r(d[45]);var q=_r(d[46]),J=_r(d[47]),Q=_r(d[48]),X=_r(d[49]),Z=_r(d[50]),ee=_r(d[51]),se=_r(d[52]),te=_r(d[53]),oe=_r(d[54]),ne=_r(d[55]),re=_r(d[56]),ae=_r(d[57]),ie=_r(d[58]),le=_r(d[59]),de=_r(d[60]);const ce=[{id:'anchorage',name:'The Anchorage',place:'Harbour View, Dunure'},{id:'saltmarsh',name:'The Venue',place:'Fictional demo venue'}],ue=[{id:'home',label:'Home',icon:'home'},{id:'orders',label:'Orders',icon:'orders'},{id:'bookings',label:'Bookings',icon:'bookings'},{id:'forecast',label:'Forecast',icon:'forecast',can:I.CAN.forecasts},{id:'chat',label:'Chat',icon:'chat'},{id:'more',label:'More',icon:'more'}],fe={home:'Today',orders:'Orders',bookings:'Bookings',forecast:'Forecasts',chat:'Staff chat',more:'More'};function he(){const{rid:e,r:ie,role:le,today:he,now:ge,meId:me,me:pe}=(0,O.useCtx)(3e4);(0,h.useTipsPosted)(e,he,'staff'!==le);const be=(0,O.useSignedIn)();(0,l.useSoldOutLink)(!0,(be?.name??pe).replace(' (example)',''));const xe=(0,T.useOrders)(e),[je,we]=(0,x.useState)('home'),[ye,Se]=(0,x.useState)(null),[Ae,ke]=(0,x.useState)(!1),Re=(0,n.useLiveVenue)(),[Ce,ve]=(0,x.useState)(!1),Te=(0,x.useRef)(null);(0,x.useEffect)(()=>{(0,O.ensureAttendance)(he,ge),(0,J.ensureChat)(ge)},[he]),globalThis.__ccNow=ge.getTime();const Ie=(0,J.useChatUnread)().total,Le=(0,x.useRef)({t:'home',s:null});Le.current={t:je,s:ye};const Ee=(0,x.useRef)([]),Be=(0,a.useScrollMemory)(Te),Oe=(0,x.useCallback)((e,s=null)=>{const t=Le.current;t.t===e&&t.s===s||(Ee.current=[...Ee.current,{...t,y:Be.leave()}].slice(-30),Be.restore(0)),we(e),Se(s)},[]),Pe=(0,x.useCallback)(()=>{if((0,c.runBackLayer)())return!0;const e=Le.current;let s=Ee.current.pop();for(;s&&s.t===e.t&&s.s===e.s;)s=Ee.current.pop();if(!s&&'home'===e.t&&!e.s)return!1;const t=s??{t:'home',s:null};return Be.leave(),we(t.t),Se(t.s),Be.restore(t.y??0),!0},[]);(0,c.useWebBack)(Pe);const Ne=(0,c.useInnerBackShown)();(0,x.useEffect)(()=>(oe.useVoiceNav.setState({go:Oe}),()=>oe.useVoiceNav.setState({go:null})),[Oe]),(0,x.useEffect)(()=>{u.PITCH&&(globalThis.__pitchGo=Oe)},[Oe]),(0,x.useEffect)(()=>{const e=j.default.addEventListener('hardwareBackPress',Pe);return()=>e.remove()},[Pe]),(0,x.useEffect)(()=>{const e=ue.find(e=>e.id===je);e?.can&&!e.can(le)&&Oe('home');const s=(0,K.pageFor)(ye);s?.can&&!s.can(le)&&Se(null)},[le]);const Me='more'===je?(0,K.pageFor)(ye):void 0,He=xe.filter(e=>(0,B.LIVE)(e)&&'new'===e.status).length,{unread:Ve,list:De,read:We}=(0,q.useNotifications)();(0,se.useAlertWatcher)(e,{nag:'staff'!==le}),(0,te.useReviewAlerts)(e),(0,ne.useScheduledNotices)({rid:e,staffId:be?.id??'',name:pe,onOpen:()=>Oe('more','orderlists')}),(0,re.useOffRotaAlerts)({enabled:'staff'!==le&&!!be});const $e=be?.role??le,ze='owner'===$e?'OWNER':'manager'===$e?'MANAGER':'STAFF',Ue=(0,se.useAlerts)(s=>s.history.filter(t=>t.rid===e&&(0,se.isUnread)(s,t)&&!(0,se.isCleared)(s,t)&&t.at>(s.seenAt[e]??0)).length),Fe=(0,se.useAlerts)(s=>s.todoSeen[e]),Ge=Math.max(0,Ve-De.filter(e=>!We[e.id]&&(Fe??[]).includes(e.id)).length)+Ue;(0,se.useAlertSeenSync)(e),(0,x.useEffect)(()=>{G.useShellBadges.setState({notifCount:Ge})},[Ge]);const Ke=(0,T.useBookings)(e).filter(e=>'pending'===e.status).length,Ye=s.IS_ISOLATED_VENUE?[{id:e,name:ie.name,place:ie.location||ie.address||''}]:ce,qe=Ye.find(s=>s.id===e)??Ye[0],Je=be?.ownerAccess&&'owner'!==be.role?'owner privileges':be?.managerAccess&&'staff'===be.role?'manager privileges':'',Qe=(0,H.ownerHomeLayout)(le,be);(0,A.default)().width;return(0,de.jsxs)(R.SafeAreaView,{style:{flex:1,backgroundColor:L.colours.bg},edges:['top','left','right','bottom'],children:[(0,de.jsxs)(k.default,{style:{position:'relative',paddingHorizontal:14,paddingTop:6,paddingBottom:8,borderBottomWidth:1,borderColor:L.colours.border,gap:6},children:[(0,de.jsxs)(k.default,{style:{position:'absolute',top:4,right:6,zIndex:5,flexDirection:'row',alignItems:'center',gap:2},children:[(0,de.jsx)(y.default,{accessibilityRole:"button",accessibilityLabel:"Search",hitSlop:8,onPress:()=>Oe('more','search'),style:{minWidth:44,minHeight:44,alignItems:'center',justifyContent:'center'},children:(0,de.jsx)(U.Icon,{name:"search",colour:L.colours.text})}),(0,de.jsx)(y.default,{testID:"bell",accessibilityRole:"button",accessibilityLabel:Ge?`Notifications, ${Ge} new`:'Notifications, nothing new',hitSlop:8,onPress:()=>Oe('more','notifications'),style:{minWidth:44,minHeight:44,alignItems:'center',justifyContent:'center'},children:(0,de.jsxs)(k.default,{children:[(0,de.jsx)(U.Icon,{name:"bell",colour:L.colours.text}),Ge?(0,de.jsx)(k.default,{style:{position:'absolute',right:-4,top:-4,backgroundColor:L.colours.red,borderRadius:8,minWidth:16,height:16,alignItems:'center',justifyContent:'center'},children:(0,de.jsx)(C.T,{size:10,weight:"bold",children:Ge})}):null]})}),(0,de.jsx)(X.VoiceSlot,{size:44})]}),(0,de.jsx)(k.default,{style:{alignItems:'flex-start',minHeight:44,justifyContent:'center',maxWidth:'70%'},children:(0,de.jsx)(k.default,{testID:"header-me-wrap",style:{alignItems:'flex-start'},children:(0,de.jsx)(y.default,{testID:"header-me",accessibilityRole:"button",accessibilityLabel:`Signed in as ${pe}. Account and role${Je?`, ${Je}`:''}`,disabled:'owner'!==V.APP_VARIANT,onPress:()=>ve(!0),hitSlop:6,style:{borderWidth:1,borderColor:L.colours.gold,borderRadius:22,paddingHorizontal:10,paddingVertical:4,maxWidth:'100%',minHeight:44,justifyContent:'center'},children:(0,de.jsxs)(C.Row,{gap:6,style:{justifyContent:'flex-start'},children:[(0,de.jsx)(_.StaffAvatar,{id:me,size:24,ring:!1}),(0,de.jsxs)(k.default,{style:{flexShrink:1},children:[(0,de.jsxs)(C.T,{size:13,weight:"semibold",colour:L.colours.gold,numberOfLines:1,style:{flexShrink:1},children:[be?`${pe} \xb7 ${be.level??I.ROLE_LABEL[be.role]}`:`${pe} \xb7 ${I.ROLE_LABEL[le]}`,'owner'===V.APP_VARIANT?' \u25be':'']}),Je?(0,de.jsx)(C.Muted,{center:!1,size:10,numberOfLines:1,children:Je}):null]})]})})})}),(0,de.jsx)(y.default,{accessibilityRole:"button",accessibilityLabel:"Switch venue",onPress:()=>ke(!0),style:{alignSelf:'center',maxWidth:420,width:'100%'},children:(0,de.jsx)(v.VenueHeaderBlock,{rid:e,name:ie.name,badge:ze,place:`${'staff'===le?'Staff preview \xb7 ':'Managers \xb7 '}${qe.place}`})}),le!==(be?.ownerAccess?'owner':be?.managerAccess?'manager':be?.role??'owner')&&'owner'===V.APP_VARIANT?(0,de.jsx)(y.default,{onPress:()=>I.useOwner.getState().setPreviewRole(be?.ownerAccess?'owner':be?.managerAccess?'manager':be?.role??'owner'),style:{backgroundColor:'#3a2f12',borderRadius:8,padding:6},children:(0,de.jsx)(C.T,{size:12,colour:L.colours.gold,children:'staff'===le?`Staff app preview: what staff see in the Staff app. Tap to return to ${I.ROLE_LABEL[be?.ownerAccess?'owner':be?.managerAccess?'manager':be?.role??'owner']}.`:`Previewing the ${I.ROLE_LABEL[le].toLowerCase()} view. Tap to return to ${I.ROLE_LABEL[be?.ownerAccess?'owner':be?.managerAccess?'manager':be?.role??'owner']}.`})}):null]}),(0,de.jsxs)(S.default,{ref:Te,...Be.props,contentContainerStyle:{padding:14,paddingBottom:16,gap:12,width:'100%',maxWidth:900,alignSelf:'center'},keyboardShouldPersistTaps:"handled",children:[(0,de.jsx)(c.BackTitleRow,{back:!('home'===je&&!ye||Ne),onBack:Pe,title:Me?Me.title:'staff'===le&&'home'===je?'Staff app preview':fe[je]}),'home'===je&&be&&'staff'===be.role&&'owner'===V.APP_VARIANT?(0,de.jsxs)(k.default,{testID:"access-off-banner",style:{borderWidth:1,borderColor:L.colours.gold,borderRadius:12,padding:10,gap:6},children:[(0,de.jsx)(C.T,{weight:"semibold",colour:L.colours.gold,children:"Your manager access is off"}),(0,de.jsx)(C.Muted,{children:"Your own shifts, clock in, rota, pay and tips are still here."}),(0,de.jsx)(C.Button,{label:"Clock in and my shifts",onPress:()=>Oe('more','clock')})]}):null,'home'!==je||Qe?null:(0,de.jsx)(r.WhoBar,{}),'home'===je&&!Qe&&be?(0,de.jsx)(ae.MyShiftCard,{go:Oe}):null,'home'===je&&!Qe&&be?(0,de.jsx)(f.MyTasksToday,{rid:e,staffId:be.id,name:be.name,onShift:(0,p.shiftNow)(be.id,Date.now()).on}):null,'home'!==je||Qe||'staff'===le?null:(0,de.jsx)(h.TodaysTipsCard,{rid:e,today:he}),'home'!==je||Qe||'staff'===le?null:(0,de.jsx)(h.TipsPotCard,{rid:e,today:he}),'home'===je?'staff'===le?(0,de.jsx)($.StaffHome,{go:Oe}):(0,de.jsx)(M.Dashboard,{go:Oe,ownerHome:Qe}):null,'orders'===je?(0,de.jsx)(Y.Orders,{}):null,'bookings'===je?(0,de.jsx)(E.Bookings,{go:Oe}):null,'forecast'===je?(0,de.jsx)(z.Forecasts,{go:Oe}):null,'chat'===je?(0,de.jsx)(J.Chat,{go:Oe}):null,'more'===je?Me?(0,de.jsx)(Me.C,{go:Oe}):(0,de.jsx)(K.MoreMenu,{go:Oe}):null]}),(0,de.jsx)(b.SeatAllergenReminder,{rid:e}),'staff'!==le?(0,de.jsx)(ee.PrintHost,{rid:e}):null,'staff'!==le?(0,de.jsx)(Z.AlertHost,{variant:"managers",rid:e,me:pe,onOpen:e=>Oe('takeaway'===e.kind?'orders':'email'===e.kind||'test'===e.kind?'more':'bookings','email'===e.kind||'test'===e.kind?'notifications':null)}):null,(0,de.jsx)(Q.AssistantSheet,{}),(0,de.jsx)(F.BottomTabs,{background:(0,t.soutersSurface)('#0d0d0d'),active:je,onPress:e=>Oe(e),tabs:ue.filter(e=>!e.can||e.can(le)).map(e=>({id:e.id,label:e.label,icon:e.icon,badge:'chat'===e.id&&Ie?{text:String(Ie),bg:L.colours.red}:'bookings'===e.id&&Ke?{text:String(Ke),bg:L.colours.amber,fg:'#0B0B0B',testID:'pending-badge'}:'orders'===e.id&&He?{text:String(He),bg:L.colours.red}:null}))}),(0,de.jsx)(w.default,{visible:Ae,transparent:!0,animationType:"fade",onRequestClose:()=>ke(!1),children:(0,de.jsx)(y.default,{style:{flex:1,backgroundColor:'#000a',justifyContent:'flex-end'},onPress:()=>ke(!1),children:(0,de.jsxs)(k.default,{style:{backgroundColor:L.colours.surface,padding:16,gap:8,borderTopLeftRadius:16,borderTopRightRadius:16},children:[(0,de.jsx)(C.T,{weight:"semibold",children:"Your venues"}),Ye.filter(e=>!Re||'saltmarsh'!==e.id).map(s=>(0,de.jsx)(y.default,{accessibilityRole:"button",onPress:()=>{I.useOwner.getState().setSite(s.id),ke(!1),Oe('home')},style:{padding:12,borderRadius:12,borderWidth:1,borderColor:s.id===e?L.colours.gold:L.colours.border},children:(0,de.jsxs)(C.Row,{style:{justifyContent:'space-between'},children:[(0,de.jsxs)(k.default,{children:[(0,de.jsx)(C.T,{weight:"medium",children:s.name}),(0,de.jsx)(C.Muted,{children:s.place})]}),s.id===e?(0,de.jsx)(C.Badge,{kind:"gold",label:"Current"}):null]})},s.id)),(0,de.jsx)(C.Muted,{children:s.IS_ISOLATED_VENUE?`This app belongs only to ${ie.name}.`:Re?'Switch venues without signing out. Other venues appear here once they are set up.':'Switch venues without signing out. The Venue is made up, for trying CoverCharge offline.'})]})})}),(0,de.jsx)(w.default,{visible:Ce,transparent:!0,animationType:"fade",onRequestClose:()=>ve(!1),children:(0,de.jsx)(y.default,{style:{flex:1,backgroundColor:'#000a',justifyContent:'flex-end'},onPress:()=>ve(!1),children:(0,de.jsxs)(k.default,{style:{backgroundColor:L.colours.surface,padding:16,gap:8,borderTopLeftRadius:16,borderTopRightRadius:16},children:[be?(0,de.jsxs)(C.Row,{gap:10,children:[(0,de.jsx)(_.StaffAvatar,{id:be.id,size:44}),(0,de.jsxs)(k.default,{style:{flex:1},children:[(0,de.jsxs)(C.T,{weight:"semibold",children:["Signed in as ",be.name]}),(0,de.jsx)(C.Muted,{children:(0,N.levelJob)(be.level??I.ROLE_LABEL[be.role],be.job)})]})]}):(0,de.jsxs)(k.default,{style:{gap:6},children:[(0,de.jsx)(C.T,{weight:"semibold",children:"Not signed in (preview)"}),(0,de.jsx)(C.Muted,{children:"Open your personal link, or paste it here, to sign in as yourself."}),(0,de.jsx)(P.SignInWithLink,{})]}),s.IS_QUEUED_VENUE||s.IS_ABBOTSFORD||s.IS_KIRKTON||s.IS_GREENSIDE||!be?null:(0,de.jsx)(C.Button,{kind:"secondary",label:"Open CoverCharge for Staff (as you)",onPress:()=>{(async()=>{const e=s.IS_WILDINGS?await(0,o.wildingsStaffAppUrl)():s.IS_KIRKMICHAEL?await(0,o.kirkmichaelStaffAppUrl)():(0,N.appUrl)('staff');e&&window.location.assign(e)})()}}),(0,de.jsx)(C.Muted,{children:"Preview what each role sees:"}),['owner','manager','staff'].filter(e=>!be||(0,O.clampRole)(e,be.ownerAccess?'owner':be.managerAccess?'manager':be.role)===e).map(e=>(0,de.jsx)(C.Button,{kind:e===le?'primary':'secondary',label:'staff'===e?'Staff app preview':`${I.ROLE_LABEL[e]} view`,onPress:()=>{I.useOwner.getState().setPreviewRole(e),ve(!1)}},e))]})})}),(0,de.jsx)(D.OnboardingHost,{go:Oe}),(0,de.jsx)(W.CoachHost,{})]})}},1340,[5,798,985,1173,1161,1040,977,1041,2,1047,1048,1070,1087,34,373,395,402,295,426,102,36,794,847,848,865,840,1341,1147,1100,899,1349,997,236,1356,13,846,1385,1391,1392,1393,1153,1192,1394,1379,1395,1396,1377,1135,1413,1116,1175,1311,1177,1190,1401,1085,1086,1160,1463,1464,25]); -__d(function(g,_r,_i,_a,m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.Bookings=function({go:e}={}){const{rid:C,r:X,now:Z,today:ee,me:se,role:te}=(0,p.useCtx)(1e4),le=(0,v.useBookings)(C),ne=(0,p.useInStaffApp)(),ie=(0,p.useShiftManager)(),ae=(0,v.useWaitlist)(C),[oe,de]=((0,v.useStore)(e=>e.alertAcks),(0,T.useState)(ee)),re=(0,R.useFrontDoor)(oe),ue=(0,k.useBookingWrite)(),[ce,he]=(0,T.useState)(''),[ge,be]=(0,T.useState)(!1),[pe,ke]=(0,T.useState)(2),me=oee.date===oe).sort((e,s)=>e.time.localeCompare(s.time)),ye=ae.filter(e=>'waiting'===e.status||'notified'===e.status).sort((e,s)=>e.number-s.number),we=xe.filter(e=>'noshow'===e.status),je=(0,V.useSync)(e=>!!e.venueId&&'guest'!==e.kind),fe=xe.filter(e=>'cancelled'!==e.status).reduce((e,s)=>e+s.partySize,0),Ie=(0,c.cancelledDayTally)(le,oe),Be=(0,c.cancelledTallyWords)(Ie,oe===ee?'today':'that day'),Se=xe.filter(e=>!e.walkIn),De=xe.filter(e=>e.walkIn),$e=le.filter(e=>'pending'===e.status&&e.date>=ee).sort((e,s)=>(e.date+e.time).localeCompare(s.date+s.time)),[Te,Ce]=(0,T.useState)(null),Le=(0,M.parseYmd)(oe);Le.setHours(12);const Ne=(0,Q.hoursFor)(X,Le),Pe=Ne?.open??new Date(`${oe}T12:00:00`),ve=Ne?.close??new Date(`${oe}T21:00:00`),Oe=Ne||xe.length?me?'No one seated that day':oe===ee?'No bookings yet today':'No bookings yet':oe===ee?'Closed today':'Closed that day';return(0,J.jsxs)(L.default,{style:{gap:12},children:[e&&!ne&&'staff'!==te?(0,J.jsx)(N.Button,{testID:"bookings-dashboard-top",label:"Bookings dashboard",accessibilityLabel:"Open Bookings dashboard: table plan, Timeline, today's guests and Covers",onPress:()=>e('more','serviceboard'),style:{width:'100%',minHeight:60}}):null,s.IS_WILDINGS||(s.IS_QUEUED_VENUE||s.IS_KIRKTON||s.IS_GREENSIDE||'abbotsford'===C)&&!ne&&'staff'!==te?(0,J.jsx)(n.VenueRequestList,{rid:C,kind:"table"}):null,!s.IS_WILDINGS&&!X.settings.hotel?.enabled||ne||'staff'===te?null:(0,J.jsx)(n.VenueRequestList,{rid:C,kind:"room",hotel:X.settings.hotel??l.WILDINGS_HOTEL}),(0,J.jsx)(G.BookingsDayNav,{today:ee,date:oe,onDate:de,count:e=>le.filter(s=>s.date===e&&'cancelled'!==s.status).length,sub:e=>{const s=le.filter(s=>s.date===e&&'cancelled'!==s.status&&!s.walkIn),t=s.reduce((e,s)=>e+s.partySize,0);return`${s.length} ${1===s.length?'table':'tables'} \xb7 ${t} ${1===t?'Cover':'Covers'}`}}),(0,J.jsx)(L.default,{testID:"bookings-day-graph",style:{overflow:'visible'},children:(0,J.jsx)(q.DayGraph,{bare:!0,fill:!0,todays:xe,open:Pe,close:ve,now:Z,turnBase:X.settings.turnMins,height:128,past:me,closed:!Ne,emptyText:Oe})}),me?(0,J.jsxs)(L.default,{testID:"bookings-past-totals",style:[N.styles.card,{gap:4}],accessible:!0,accessibilityLabel:`${(0,G.longDay)(oe)}: ${Se.length} tables, ${fe} Covers, ${xe.filter(e=>'finished'===e.status).length} finished, ${we.length} no-shows, ${xe.filter(e=>'cancelled'===e.status).length} cancelled`,children:[(0,J.jsxs)(N.T,{size:17,weight:"semibold",children:["That day: ",Se.length," table",1===Se.length?'':'s',De.length?` \xb7 ${De.length} walk-in${1===De.length?'':'s'}`:''," \xb7 ",fe," ",1===fe?'Cover':'Covers']}),(0,J.jsxs)(N.T,{size:16,colour:A.colours.text,children:[xe.filter(e=>'finished'===e.status).length," finished \xb7 ",we.length," no-show",1===we.length?'':'s'," \xb7 ",xe.filter(e=>'cancelled'===e.status).length," cancelled"]}),(0,J.jsx)(N.Muted,{children:"Looking back: read-only. Undo is still there for a mistake made today."})]}):null,(0,J.jsx)(L.default,{testID:"bookings-summary",children:(0,J.jsxs)(N.T,{weight:"semibold",children:[Se.length," table",1===Se.length?'':'s'," booked",De.length?` \xb7 ${De.length} walk-in${1===De.length?'':'s'}`:''," \xb7 ",fe," ",1===fe?'Cover':'Covers']})}),(0,J.jsx)(L.default,{testID:"cancelled-day-tally",accessible:!0,accessibilityLabel:Be,style:{alignItems:'center'},children:(0,J.jsx)(N.T,{size:15,colour:A.colours.muted,center:!0,children:Be})}),(0,J.jsxs)(L.default,{testID:"bookings-actions",style:{flexDirection:'row',flexWrap:'wrap',gap:8},children:[me?null:(0,J.jsx)(I.QuietButton,{label:"New booking",onPress:re.openBooking,testID:"add-booking",disabled:!ue.ok,accessibilityHint:ue.hint}),ne&&ie&&oe===ee?(0,J.jsx)(I.QuietButton,{label:"Walk-in",onPress:re.openWalkIn,testID:"add-walkin",disabled:!ue.ok,accessibilityHint:ue.hint}):null,oe===ee?(0,J.jsx)(B.CloseGardenButton,{quiet:!0,short:!0,rid:C,r:X,now:Z,by:se}):null]}),$e.length?(0,J.jsxs)(L.default,{testID:"pending-requests",style:[N.styles.card,{borderColor:A.colours.amber,gap:8}],children:[(0,J.jsxs)(N.T,{weight:"semibold",colour:A.colours.amber,children:["Needs confirming (",$e.length,")"]}),(0,J.jsx)(N.Muted,{children:"Online requests outside your auto-accept rules. Check the details before confirming."}),$e.map(e=>(0,J.jsxs)(L.default,{style:{gap:6,paddingTop:6,borderTopWidth:1,borderColor:A.colours.border},children:[(0,J.jsxs)(N.T,{weight:"semibold",children:[e.name," \xb7 ",e.partySize," ",1===e.partySize?'Cover':'Covers']}),(0,J.jsxs)(N.Muted,{children:[(0,M.niceDate)((0,M.parseYmd)(e.date))," at ",e.time," \xb7 ",e.ref," \xb7 ",e.phone??'no phone']}),e.notes?(0,J.jsxs)(N.T,{size:16,children:["Notes: ",e.notes]}):null,e.allergies.length?(0,J.jsx)(N.Row,{wrap:!0,gap:4,children:e.allergies.map(e=>(0,J.jsx)(N.Badge,{kind:"red",label:`${(0,O.allergenLabel)(e.allergen)} \xb7 ${(0,O.severityLabel)(e.severity)}`},e.allergen))}):null,(0,J.jsx)(S.NeedsPills,{b:e,r:X}),'staff'!==te&&((0,D.needsHoldOk)(e)||e.date===ee&&e.holdOk&&(e.holds??[]).some(e=>!e.served)&&'seated'===e.status)?(0,J.jsxs)(N.Row,{wrap:!0,gap:6,children:[(0,D.needsHoldOk)(e)?(0,J.jsx)(N.Button,{small:!0,kind:"success",label:"Platter OK",testID:`mgr-platter-ok-${e.ref}`,onPress:()=>(0,S.confirmHolds)(e.id,se)}):null,e.holdOk&&'seated'===e.status?(0,J.jsx)(N.Button,{small:!0,kind:"secondary",label:"Platter served",onPress:()=>(0,S.serveHolds)(e,se,'owner')}):null]}):null,Te===e.id?(0,J.jsxs)(L.default,{style:{gap:6},children:[(0,J.jsxs)(N.T,{size:14,children:["Are you sure? ",e.name.split(' ')[0]," will get a polite \u201csorry, we can\u2019t fit you in\u201d message."]}),(0,J.jsxs)(N.Row,{gap:6,children:[(0,J.jsx)(N.Button,{small:!0,kind:"danger",label:"Yes, decline",onPress:()=>{v.repo.bookings.decide(e.id,'declined',se),Ce(null)}}),(0,J.jsx)(N.Button,{small:!0,kind:"ghost",label:"Keep it",onPress:()=>Ce(null)})]})]}):ue.ok?(0,J.jsxs)(N.Row,{gap:6,children:[(0,J.jsx)(N.Button,{small:!0,label:"Confirm",testID:`confirm-${e.ref}`,onPress:()=>v.repo.bookings.decide(e.id,'confirmed',se)}),(0,J.jsx)(N.Button,{small:!0,kind:"secondary",label:"Decline",onPress:()=>Ce(e.id)}),(0,J.jsx)(Y.WhatsAppGuest,{b:e,rid:C,kind:"change"})]}):(0,J.jsx)(L.default,{accessible:!0,accessibilityLabel:x.BOOKING_VIEW_ONLY,children:(0,J.jsx)(N.T,{children:x.BOOKING_VIEW_ONLY})}),(0,J.jsx)(F.ConfirmTimeline,{refId:e.id})]},e.id))]}):null,0===xe.length?(0,J.jsx)(N.Muted,{children:"No bookings for this day yet."}):null,xe.map(e=>{const s='confirmed'===e.status&&oe===ee&&(0,M.minsBetween)(new Date(`${e.date}T${e.time}:00`),Z)>15,t=(0,w.depositState)(e),l=(0,w.depositBadge)(e,W.gbp);return(0,J.jsxs)(L.default,{testID:(0,$.isSeatedHighlight)((0,D.shownStatus)(e))?`booking-seated-${e.id}`:`booking-row-${e.id}`,style:[N.styles.card,(0,$.isSeatedHighlight)((0,D.shownStatus)(e))?(0,$.seatedHighlightStyle)({borderColor:(0,D.hasAllergens)(e)?A.colours.red:A.colours.goldLight}):{borderColor:(0,D.hasAllergens)(e)?A.colours.red:s?A.colours.amber:A.colours.hairline,opacity:['finished','cancelled'].includes(e.status)?.55:1}],children:[(0,J.jsx)(S.AllergenBar,{b:e}),(0,J.jsxs)(N.Row,{style:{justifyContent:'space-between'},children:[(0,J.jsxs)(N.Row,{gap:6,style:{flex:1,minWidth:0,alignItems:'center'},children:[(0,J.jsxs)(N.T,{weight:"semibold",colour:(0,$.isSeatedHighlight)((0,D.shownStatus)(e))?$.SEATED_FG:A.colours.text,style:{flexShrink:1},children:[e.time," \xb7 ",(0,R.walkInLabel)(e)]}),(0,D.hasAllergens)(e)?(0,J.jsx)(P.AllergyIcon,{text:(0,D.allergenText)(e),size:20,colour:(0,$.isSeatedHighlight)((0,D.shownStatus)(e))?'#7A4A00':A.colours.amber,ink:(0,$.isSeatedHighlight)((0,D.shownStatus)(e))?A.colours.gold:A.colours.bg,testID:`booking-allergy-${e.id}`}):null]}),(0,J.jsx)(N.Badge,{kind:'seated'===(0,D.shownStatus)(e)?'ok':'noshow'===e.status?'red':'confirmed'===e.status?'gold':'pending'===e.status?'amber':'neutral',label:'noshow'===e.status?'No-show':'pending'===e.status?'Needs confirming':(0,D.shownStatus)(e)[0].toUpperCase()+(0,D.shownStatus)(e).slice(1)})]}),l?(0,J.jsx)(y.DepositChip,{b:e,money:!0,big:!0,testID:`deposit-chip-${e.id}`}):null,(0,$.isSeatedHighlight)((0,D.shownStatus)(e))?(0,J.jsxs)(N.T,{size:14,colour:$.SEATED_MUTED,children:[e.table?(0,z.tableCardLabel)(e.table):e.walkIn?'Table to assign':'Table TBC'," \xb7 ",e.ref]}):(0,J.jsxs)(N.Muted,{children:[e.table?(0,z.tableCardLabel)(e.table):e.walkIn?'Table to assign':'Table TBC'," \xb7 ",e.ref]}),e.notes?(0,J.jsxs)(N.T,{size:16,testID:`booking-notes-${e.id}`,children:["Notes: ",e.notes]}):null,l?(0,J.jsxs)(N.Row,{wrap:!0,gap:6,style:{alignItems:'center'},children:[me||!(0,w.canTickDeposit)(e)||['cancelled','finished'].includes(e.status)?null:(0,J.jsx)(N.Button,{small:!0,kind:"secondary",label:"Mark deposit paid",testID:`deposit-paid-${e.id}`,accessibilityLabel:`Mark deposit paid for ${(0,R.walkInLabel)(e)}`,onPress:()=>v.repo.bookings.update(e.id,{depositPaid:e.depositDue??0,depositPaidBy:se,depositPaidAt:(new Date).toISOString()})}),me?null:(0,J.jsx)(j.WixDepositLink,{b:e,rid:C}),'paid'===t&&e.depositPaidBy?(0,J.jsx)(N.Muted,{size:13,children:'Wix deposit link'===e.depositPaidBy?'Paid through a website bookings deposit link':`Ticked by ${e.depositPaidBy}`}):null]}):null,e.walkIn?null:(0,J.jsxs)(N.Muted,{children:[(0,K.bookingSource)(e),e.phone?` \xb7 ${e.phone}`:'',e.email?` \xb7 ${e.email}`:'']}),e.allergies.length?(0,J.jsx)(N.Row,{wrap:!0,gap:4,children:e.allergies.map(e=>(0,J.jsx)(N.Badge,{kind:"red",label:`${(0,O.allergenLabel)(e.allergen)} \xb7 ${(0,O.severityLabel)(e.severity)}`},e.allergen))}):null,(0,D.hasAllergens)(e)&&!['cancelled','noshow'].includes(e.status)?(0,J.jsx)(U.BookingAllergyChain,{b:e,me:se}):null,e.walkIn?null:(0,J.jsx)(F.ConfirmTimeline,{refId:e.id,noPhone:!!e.source&&!e.phone}),s?(0,J.jsxs)(N.T,{size:13,colour:A.colours.amber,children:["Running ",(0,M.minsBetween)(new Date(`${e.date}T${e.time}:00`),Z)," min late. Call them, then mark no-show if needed."]}):null,(0,J.jsxs)(N.Row,{wrap:!0,gap:6,children:[(0,J.jsx)(r.BookingTableButton,{rid:C,booking:e,readOnly:me||!ue.ok,turnBase:X.settings.turnMins}),ue.ok?null:(0,J.jsx)(L.default,{accessible:!0,accessibilityLabel:x.BOOKING_VIEW_ONLY,children:(0,J.jsx)(N.T,{children:x.BOOKING_VIEW_ONLY})}),ue.ok?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(u.BookingEditButton,{rid:C,booking:e,who:se,role:te,inStaffApp:ne,shiftManager:ie}),me||e.table||!['seated','confirmed'].includes(e.status)?null:(0,J.jsx)(N.Button,{small:!e.walkIn,kind:e.walkIn?'primary':'secondary',label:"Assign table",onPress:()=>re.assignTable(e)}),!me&&['seated','confirmed'].includes(e.status)?(0,J.jsx)(N.Button,{small:!0,kind:"secondary",label:(0,z.tablesOf)(e.table).length>1?'Change tables':'Combine tables',testID:`combine-${e.id}`,accessibilityLabel:`${(0,z.tablesOf)(e.table).length>1?'Change tables':'Combine tables'} for ${(0,R.walkInLabel)(e)}`,onPress:()=>re.combineTables(e)}):null,me||'confirmed'!==e.status?null:(0,J.jsxs)(J.Fragment,{children:[e.date===ee?(0,J.jsx)(N.Button,{small:!0,label:"Seat",accessibilityLabel:`Seat ${(0,R.walkInLabel)(e)} now`,onPress:()=>(0,R.seatBookingNow)(C,e)}):null,(0,J.jsx)(N.Button,{small:!0,kind:"secondary",label:"No-show",onPress:()=>v.repo.bookings.setStatus(e.id,'noshow')})]}),me||e.walkIn?null:(0,J.jsx)(d.CancelBookingButton,{rid:C,b:e,name:(0,R.walkInLabel)(e),small:!0,onDone:()=>{}}),me||e.walkIn?null:(0,J.jsx)(d.ReinstateBookingButton,{b:e,name:(0,R.walkInLabel)(e),today:ee}),me||'seated'!==e.status?null:(0,J.jsx)(N.Button,{small:!0,kind:"secondary",label:"Finished",accessibilityLabel:`Finished: ${(0,R.walkInLabel)(e)}, table needs clearing`,onPress:()=>(0,R.finishBookingNow)(C,e)}),['confirmed','pending'].includes(e.status)&&e.date>=ee?(0,J.jsx)(Y.WhatsAppGuest,{b:e,rid:C,kind:"auto"}):null,ne?null:(0,J.jsx)(f.CopyReviewLink,{rid:C,bookingId:e.id}),!me&&e.walkIn?(0,J.jsx)(o.CancelWalkInButton,{rid:C,b:e,small:!0}):null,!me&&e.walkIn?(0,J.jsx)(o.ReinstateWalkInButton,{rid:C,b:e,today:ee,small:!0}):null,(0,J.jsx)(H.BookingUndo,{b:e,rid:C,today:ee,who:(0,R.walkInLabel)(e)})]}):null]}),'noshow'===e.status&&'paid'===t?(0,J.jsx)(N.Muted,{size:13,children:"A deposit was paid. Keep or refund it by your deposit terms (Settings \u203a Advanced \u203a Deposits). Deposits paid through website bookings are refunded in Website bookings \u203a Orders."}):null]},e.id)}),(0,J.jsx)(b.CancellationsSection,{testID:"bookings-cancellations",items:(0,h.cancellationsFor)(le,oe,e=>e.walkIn?`Walk-in ${e.ref}`:(e.name??'').replace(' (example)','')),dayWord:oe===ee?'today':'that day'}),(0,J.jsxs)(N.Card,{children:[(0,J.jsxs)(N.Row,{style:{justifyContent:'space-between'},children:[(0,J.jsx)(N.T,{weight:"semibold",children:"No-shows"}),(0,J.jsx)(N.Badge,{kind:we.length?'red':'ok',label:`${we.length} ${oe===ee?'today':(0,M.niceDate)((0,M.parseYmd)(oe)).slice(0,6)}${je||a.LIVE_VENUE_BUILD?'':' \xb7 4.1% last 28 days (example)'}`})]}),(0,J.jsx)(N.Muted,{children:we.length?`Marked no-show today: ${we.slice(0,6).map(e=>`${e.time} ${(0,R.walkInLabel)(e)}`).join(', ')}${we.length>6?` and ${we.length-6} more`:''}. If they turn up, open the booking and tap Undo no-show.`:'No no-shows today. If a party doesn\u2019t arrive, call them first, then tap No-show on their booking.'})]}),s.IS_GREENSIDE?(0,J.jsx)(t.GreensideCashOnly,{}):(0,J.jsxs)(N.Card,{children:[(0,J.jsx)(N.T,{weight:"semibold",children:"Deposits"}),(0,J.jsx)(N.Muted,{testID:"deposits-card-text",children:(()=>{const e=(0,w.depositOf)(X.settings);return e.on&&e.perPersonPence>0?`Deposits: ${(0,W.gbp)(e.perPersonPence)} per person for parties of ${e.fromParty} or more. Deposits are paid through website bookings. Website bookings show Deposit paid on website bookings by themselves once the guest has paid. For phone and walk-in bookings, tick Deposit paid once the guest has paid you${e.wixLinksOn?', or press Send deposit link':''}.`:'Deposits are off. Turn them on in Settings \u203a Advanced \u203a Deposits.'})()}),(0,J.jsx)(N.Muted,{size:13,children:"Tip: refunds are done in Website bookings \u203a Orders. Booking deposit amounts are visible in Managers, Display and Staff."})]}),ye.length>0||ge?(0,J.jsxs)(L.default,{style:{gap:10},children:[(0,J.jsx)(E.SectionHead,{title:`Waitlist (${ye.length})`,sub:`New party waits about ${(0,_.estimateWait)(ye.length+1,X.settings.turnMins,1)} min (estimate)`}),ye.map((e,s)=>(0,J.jsxs)(L.default,{style:N.styles.card,children:[(0,J.jsxs)(N.Row,{style:{justifyContent:'space-between'},children:[(0,J.jsxs)(N.T,{weight:"semibold",children:["#",e.number," ",e.name," \xb7 ",e.partySize]}),(0,J.jsxs)(N.Muted,{children:[(0,M.minsBetween)(new Date(e.joinedAt),Z)," min \xb7 est. ",(0,_.estimateWait)(s+1,X.settings.turnMins,1)," min"]})]}),'notified'===e.status?(0,J.jsx)(N.Badge,{kind:"ok",label:"Marked as told: table ready (no text is sent)"}):null,(0,J.jsxs)(N.Row,{gap:6,children:['waiting'===e.status?(0,J.jsx)(N.Button,{small:!0,kind:"secondary",label:"Notify",onPress:()=>v.repo.waitlist.setStatus(e.id,'notified')}):null,(0,J.jsx)(N.Button,{small:!0,label:"Seat",onPress:()=>v.repo.waitlist.setStatus(e.id,'seated')}),(0,J.jsx)(N.Button,{small:!0,kind:"ghost",label:"Remove",onPress:()=>v.repo.waitlist.setStatus(e.id,'removed')})]})]},e.id)),(0,J.jsxs)(N.Row,{gap:6,children:[(0,J.jsx)(i.TextInput,{accessibilityLabel:"Waitlist name",placeholder:"Name for the waitlist",placeholderTextColor:"#7D776C",value:ce,onChangeText:he,style:[N.styles.input,{flex:1}]}),(0,J.jsx)(N.Stepper,{value:pe,onChange:ke,min:1,max:12,label:"party"})]}),(0,J.jsx)(N.Button,{kind:"secondary",label:"Add to waitlist",disabled:ce.trim().length<2,onPress:()=>{v.repo.waitlist.join(C,ce.trim(),pe),he('')}})]}):(0,J.jsx)(N.Button,{kind:"ghost",label:"Open waitlist",onPress:()=>be(!0),accessibilityLabel:"Open the empty waitlist to add a waiting party"}),re.elements]})};var e,s=_r(_d[0]),t=_r(_d[1]),l=_r(_d[2]),n=_r(_d[3]),i=_r(_d[4]),a=_r(_d[5]),o=_r(_d[6]),d=_r(_d[7]),r=_r(_d[8]),u=_r(_d[9]),c=_r(_d[10]),h=_r(_d[11]),b=_r(_d[12]),p=_r(_d[13]),k=_r(_d[14]),x=_r(_d[15]),y=_r(_d[16]),w=_r(_d[17]),j=_r(_d[18]),f=_r(_d[19]),I=_r(_d[20]),B=_r(_d[21]),S=_r(_d[22]),D=_r(_d[23]),$=_r(_d[24]),T=_r(_d[25]),C=_r(_d[26]),L=(e=C)&&e.__esModule?e:{default:e},N=_r(_d[27]),P=_r(_d[28]),v=_r(_d[29]),O=_r(_d[30]),W=_r(_d[31]),M=_r(_d[32]),_=_r(_d[33]),A=_r(_d[34]),E=_r(_d[35]),R=_r(_d[36]),z=_r(_d[37]),H=_r(_d[38]),G=_r(_d[39]),U=_r(_d[40]),F=_r(_d[41]),K=_r(_d[42]),V=_r(_d[43]),Y=_r(_d[44]),q=_r(_d[45]),Q=_r(_d[46]),J=_r(_d[47])},1341,[5,1342,11,1343,796,806,1112,1113,1091,1115,1114,1328,1329,1100,1282,1012,1089,14,1344,1186,1345,1316,1081,1075,1090,34,102,794,1291,848,830,836,827,1267,840,1147,1096,1014,1346,1347,1136,1348,1177,985,1149,1324,852,25]); +__d(function(g,_r,_i,_a,m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.Bookings=function({go:e}={}){const{rid:L,r:Z,now:ee,today:se,me:te,role:le}=(0,k.useCtx)(1e4),ne=(0,O.useBookings)(L),ie=(0,k.useInStaffApp)(),ae=(0,k.useShiftManager)(),oe=(0,O.useWaitlist)(L),[de,re]=((0,O.useStore)(e=>e.alertAcks),(0,C.useState)(se)),ue=(0,z.useFrontDoor)(de),ce=(0,x.useBookingWrite)(),[he,ge]=(0,C.useState)(''),[be,pe]=(0,C.useState)(!1),[ke,me]=(0,C.useState)(2),xe=dee.date===de).sort((e,s)=>e.time.localeCompare(s.time)),we=oe.filter(e=>'waiting'===e.status||'notified'===e.status).sort((e,s)=>e.number-s.number),je=ye.filter(e=>'noshow'===e.status),fe=(0,Y.useSync)(e=>!!e.venueId&&'guest'!==e.kind),Ie=ye.filter(e=>'cancelled'!==e.status).reduce((e,s)=>e+s.partySize,0),Be=(0,h.cancelledDayTally)(ne,de),De=(0,h.cancelledTallyWords)(Be,de===se?'today':'that day'),Se=ye.filter(e=>!e.walkIn),$e=ye.filter(e=>e.walkIn),Te=ne.filter(e=>'pending'===e.status&&e.date>=se).sort((e,s)=>(e.date+e.time).localeCompare(s.date+s.time)),[Ce,Le]=(0,C.useState)(null),Ne=(0,E.parseYmd)(de);Ne.setHours(12);const Pe=(0,J.hoursFor)(Z,Ne),ve=Pe?.open??new Date(`${de}T12:00:00`),Oe=Pe?.close??new Date(`${de}T21:00:00`),We=Pe||ye.length?xe?'No one seated that day':de===se?'No bookings yet today':'No bookings yet':de===se?'Closed today':'Closed that day';return(0,X.jsxs)(N.default,{style:{gap:12},children:[e&&!ie&&'staff'!==le?(0,X.jsx)(P.Button,{testID:"bookings-dashboard-top",label:"Bookings dashboard",accessibilityLabel:"Open Bookings dashboard: table plan, Timeline, today's guests and Covers",onPress:()=>e('more','serviceboard'),style:{width:'100%',minHeight:60}}):null,s.IS_WILDINGS||(s.IS_QUEUED_VENUE||s.IS_KIRKTON||s.IS_GREENSIDE||'abbotsford'===L)&&!ie&&'staff'!==le?(0,X.jsx)(n.VenueRequestList,{rid:L,kind:"table"}):null,!s.IS_WILDINGS&&!Z.settings.hotel?.enabled||ie||'staff'===le?null:(0,X.jsx)(n.VenueRequestList,{rid:L,kind:"room",hotel:Z.settings.hotel??l.WILDINGS_HOTEL}),(0,X.jsx)(U.BookingsDayNav,{today:se,date:de,onDate:re,count:e=>ne.filter(s=>s.date===e&&'cancelled'!==s.status).length,sub:e=>{const s=ne.filter(s=>s.date===e&&'cancelled'!==s.status&&!s.walkIn),t=s.reduce((e,s)=>e+s.partySize,0);return`${s.length} ${1===s.length?'table':'tables'} \xb7 ${t} ${1===t?'Cover':'Covers'}`}}),(0,X.jsx)(N.default,{testID:"bookings-day-graph",style:{overflow:'visible'},children:(0,X.jsx)(Q.DayGraph,{bare:!0,fill:!0,todays:ye,open:ve,close:Oe,now:ee,turnBase:Z.settings.turnMins,height:128,past:xe,closed:!Pe,emptyText:We})}),xe?(0,X.jsxs)(N.default,{testID:"bookings-past-totals",style:[P.styles.card,{gap:4}],accessible:!0,accessibilityLabel:`${(0,U.longDay)(de)}: ${Se.length} tables, ${Ie} Covers, ${ye.filter(e=>'finished'===e.status).length} finished, ${je.length} no-shows, ${ye.filter(e=>'cancelled'===e.status).length} cancelled`,children:[(0,X.jsxs)(P.T,{size:17,weight:"semibold",children:["That day: ",Se.length," table",1===Se.length?'':'s',$e.length?` \xb7 ${$e.length} walk-in${1===$e.length?'':'s'}`:''," \xb7 ",Ie," ",1===Ie?'Cover':'Covers']}),(0,X.jsxs)(P.T,{size:16,colour:A.colours.text,children:[ye.filter(e=>'finished'===e.status).length," finished \xb7 ",je.length," no-show",1===je.length?'':'s'," \xb7 ",ye.filter(e=>'cancelled'===e.status).length," cancelled"]}),(0,X.jsx)(P.Muted,{children:"Looking back: read-only. Undo is still there for a mistake made today."})]}):null,(0,X.jsx)(N.default,{testID:"bookings-summary",children:(0,X.jsxs)(P.T,{weight:"semibold",children:[Se.length," table",1===Se.length?'':'s'," booked",$e.length?` \xb7 ${$e.length} walk-in${1===$e.length?'':'s'}`:''," \xb7 ",Ie," ",1===Ie?'Cover':'Covers']})}),(0,X.jsx)(N.default,{testID:"cancelled-day-tally",accessible:!0,accessibilityLabel:De,style:{alignItems:'center'},children:(0,X.jsx)(P.T,{size:15,colour:A.colours.muted,center:!0,children:De})}),(0,X.jsxs)(N.default,{testID:"bookings-actions",style:{flexDirection:'row',flexWrap:'wrap',gap:8},children:[xe?null:(0,X.jsx)(B.QuietButton,{label:"New booking",onPress:ue.openBooking,testID:"add-booking",disabled:!ce.ok,accessibilityHint:ce.hint}),ie&&ae&&de===se?(0,X.jsx)(B.QuietButton,{label:"Walk-in",onPress:ue.openWalkIn,testID:"add-walkin",disabled:!ce.ok,accessibilityHint:ce.hint}):null,de===se?(0,X.jsx)(D.CloseGardenButton,{quiet:!0,short:!0,rid:L,r:Z,now:ee,by:te}):null]}),Te.length?(0,X.jsxs)(N.default,{testID:"pending-requests",style:[P.styles.card,{borderColor:A.colours.amber,gap:8}],children:[(0,X.jsxs)(P.T,{weight:"semibold",colour:A.colours.amber,children:["Needs confirming (",Te.length,")"]}),(0,X.jsx)(P.Muted,{children:"Online requests outside your auto-accept rules. Check the details before confirming."}),Te.map(e=>(0,X.jsxs)(N.default,{style:{gap:6,paddingTop:6,borderTopWidth:1,borderColor:A.colours.border},children:[(0,X.jsxs)(P.T,{weight:"semibold",children:[e.name," \xb7 ",e.partySize," ",1===e.partySize?'Cover':'Covers']}),(0,X.jsxs)(P.Muted,{children:[(0,E.niceDate)((0,E.parseYmd)(e.date))," at ",e.time," \xb7 ",e.ref," \xb7 ",e.phone??'no phone']}),e.notes?(0,X.jsxs)(P.T,{size:16,children:["Notes: ",e.notes]}):null,e.allergies.length?(0,X.jsx)(P.Row,{wrap:!0,gap:4,children:e.allergies.map(e=>(0,X.jsx)(P.Badge,{kind:"red",label:`${(0,W.allergenLabel)(e.allergen)} \xb7 ${(0,W.severityLabel)(e.severity)}`},e.allergen))}):null,(0,X.jsx)(S.NeedsPills,{b:e,r:Z}),'staff'!==le&&((0,$.needsHoldOk)(e)||e.date===se&&e.holdOk&&(e.holds??[]).some(e=>!e.served)&&'seated'===e.status)?(0,X.jsxs)(P.Row,{wrap:!0,gap:6,children:[(0,$.needsHoldOk)(e)?(0,X.jsx)(P.Button,{small:!0,kind:"success",label:"Platter OK",testID:`mgr-platter-ok-${e.ref}`,onPress:()=>(0,S.confirmHolds)(e.id,te)}):null,e.holdOk&&'seated'===e.status?(0,X.jsx)(P.Button,{small:!0,kind:"secondary",label:"Platter served",onPress:()=>(0,S.serveHolds)(e,te,'owner')}):null]}):null,Ce===e.id?(0,X.jsxs)(N.default,{style:{gap:6},children:[(0,X.jsxs)(P.T,{size:14,children:["Are you sure? ",e.name.split(' ')[0]," will get a polite \u201csorry, we can\u2019t fit you in\u201d message."]}),(0,X.jsxs)(P.Row,{gap:6,children:[(0,X.jsx)(P.Button,{small:!0,kind:"danger",label:"Yes, decline",onPress:()=>{O.repo.bookings.decide(e.id,'declined',te),Le(null)}}),(0,X.jsx)(P.Button,{small:!0,kind:"ghost",label:"Keep it",onPress:()=>Le(null)})]})]}):ce.ok?(0,X.jsxs)(P.Row,{gap:6,children:[(0,X.jsx)(P.Button,{small:!0,label:"Confirm",testID:`confirm-${e.ref}`,onPress:()=>O.repo.bookings.decide(e.id,'confirmed',te)}),(0,X.jsx)(P.Button,{small:!0,kind:"secondary",label:"Decline",onPress:()=>Le(e.id)}),(0,X.jsx)(q.WhatsAppGuest,{b:e,rid:L,kind:"change"})]}):(0,X.jsx)(N.default,{accessible:!0,accessibilityLabel:y.BOOKING_VIEW_ONLY,children:(0,X.jsx)(P.T,{children:y.BOOKING_VIEW_ONLY})}),(0,X.jsx)(K.ConfirmTimeline,{refId:e.id})]},e.id))]}):null,0===ye.length?(0,X.jsx)(P.Muted,{children:"No bookings for this day yet."}):null,ye.map(e=>{const s='confirmed'===e.status&&de===se&&(0,E.minsBetween)(new Date(`${e.date}T${e.time}:00`),ee)>15,t=(0,j.depositState)(e),l=(0,j.depositBadge)(e,M.gbp);return(0,X.jsxs)(N.default,{testID:(0,T.isSeatedHighlight)((0,$.shownStatus)(e))?`booking-seated-${e.id}`:`booking-row-${e.id}`,style:[P.styles.card,(0,T.isSeatedHighlight)((0,$.shownStatus)(e))?(0,T.seatedHighlightStyle)({borderColor:(0,$.hasAllergens)(e)?A.colours.red:A.colours.goldLight}):{borderColor:(0,$.hasAllergens)(e)?A.colours.red:s?A.colours.amber:A.colours.hairline,opacity:['finished','cancelled'].includes(e.status)?.55:1}],children:[(0,X.jsx)(S.AllergenBar,{b:e}),(0,X.jsxs)(P.Row,{style:{justifyContent:'space-between'},children:[(0,X.jsxs)(P.Row,{gap:6,style:{flex:1,minWidth:0,alignItems:'center'},children:[(0,X.jsxs)(P.T,{weight:"semibold",colour:(0,T.isSeatedHighlight)((0,$.shownStatus)(e))?T.SEATED_FG:A.colours.text,style:{flexShrink:1},children:[e.time," \xb7 ",(0,z.walkInLabel)(e)]}),(0,$.hasAllergens)(e)?(0,X.jsx)(v.AllergyIcon,{text:(0,$.allergenText)(e),size:20,colour:(0,T.isSeatedHighlight)((0,$.shownStatus)(e))?'#7A4A00':A.colours.amber,ink:(0,T.isSeatedHighlight)((0,$.shownStatus)(e))?A.colours.gold:A.colours.bg,testID:`booking-allergy-${e.id}`}):null]}),(0,X.jsx)(P.Badge,{kind:'seated'===(0,$.shownStatus)(e)?'ok':'noshow'===e.status?'red':'confirmed'===e.status?'gold':'pending'===e.status?'amber':'neutral',label:'noshow'===e.status?'No-show':'pending'===e.status?'Needs confirming':(0,$.shownStatus)(e)[0].toUpperCase()+(0,$.shownStatus)(e).slice(1)})]}),l?(0,X.jsx)(w.DepositChip,{b:e,money:!0,big:!0,testID:`deposit-chip-${e.id}`}):null,(0,T.isSeatedHighlight)((0,$.shownStatus)(e))?(0,X.jsxs)(P.T,{size:14,colour:T.SEATED_MUTED,children:[e.table?(0,H.tableCardLabel)(e.table):e.walkIn?'Table to assign':'Table TBC'," \xb7 ",e.ref]}):(0,X.jsxs)(P.Muted,{children:[e.table?(0,H.tableCardLabel)(e.table):e.walkIn?'Table to assign':'Table TBC'," \xb7 ",e.ref]}),e.notes?(0,X.jsxs)(P.T,{size:16,testID:`booking-notes-${e.id}`,children:["Notes: ",e.notes]}):null,(0,c.bookingExtras)(e)?(0,X.jsx)(P.T,{size:15,testID:`booking-extras-${e.id}`,children:(0,c.bookingExtras)(e)}):null,(0,c.historyLines)(e)[0]?(0,X.jsxs)(P.Muted,{size:13,testID:`booking-last-change-${e.id}`,children:["Last change: ",(0,c.historyLines)(e)[0]]}):null,l?(0,X.jsxs)(P.Row,{wrap:!0,gap:6,style:{alignItems:'center'},children:[xe||!(0,j.canTickDeposit)(e)||['cancelled','finished'].includes(e.status)?null:(0,X.jsx)(P.Button,{small:!0,kind:"secondary",label:"Mark deposit paid",testID:`deposit-paid-${e.id}`,accessibilityLabel:`Mark deposit paid for ${(0,z.walkInLabel)(e)}`,onPress:()=>O.repo.bookings.update(e.id,{depositPaid:e.depositDue??0,depositPaidBy:te,depositPaidAt:(new Date).toISOString()})}),xe?null:(0,X.jsx)(f.WixDepositLink,{b:e,rid:L}),'paid'===t&&e.depositPaidBy?(0,X.jsx)(P.Muted,{size:13,children:'Wix deposit link'===e.depositPaidBy?'Paid through a website bookings deposit link':`Ticked by ${e.depositPaidBy}`}):null]}):null,e.walkIn?null:(0,X.jsxs)(P.Muted,{children:[(0,V.bookingSource)(e),e.phone?` \xb7 ${e.phone}`:'',e.email?` \xb7 ${e.email}`:'']}),e.allergies.length?(0,X.jsx)(P.Row,{wrap:!0,gap:4,children:e.allergies.map(e=>(0,X.jsx)(P.Badge,{kind:"red",label:`${(0,W.allergenLabel)(e.allergen)} \xb7 ${(0,W.severityLabel)(e.severity)}`},e.allergen))}):null,(0,$.hasAllergens)(e)&&!['cancelled','noshow'].includes(e.status)?(0,X.jsx)(F.BookingAllergyChain,{b:e,me:te}):null,e.walkIn?null:(0,X.jsx)(K.ConfirmTimeline,{refId:e.id,noPhone:!!e.source&&!e.phone}),s?(0,X.jsxs)(P.T,{size:13,colour:A.colours.amber,children:["Running ",(0,E.minsBetween)(new Date(`${e.date}T${e.time}:00`),ee)," min late. Call them, then mark no-show if needed."]}):null,ce.ok?(0,X.jsx)(u.BookingEditButton,{rid:L,booking:e,who:te,role:le,inStaffApp:ie,shiftManager:ae,big:!0,testID:`edit-booking-${e.id}`}):null,(0,X.jsxs)(P.Row,{wrap:!0,gap:6,children:[(0,X.jsx)(r.BookingTableButton,{rid:L,booking:e,readOnly:xe||!ce.ok,turnBase:Z.settings.turnMins}),ce.ok?null:(0,X.jsx)(N.default,{accessible:!0,accessibilityLabel:y.BOOKING_VIEW_ONLY,children:(0,X.jsx)(P.T,{children:y.BOOKING_VIEW_ONLY})}),ce.ok?(0,X.jsxs)(X.Fragment,{children:[xe||e.table||!['seated','confirmed'].includes(e.status)?null:(0,X.jsx)(P.Button,{small:!e.walkIn,kind:e.walkIn?'primary':'secondary',label:"Assign table",onPress:()=>ue.assignTable(e)}),!xe&&['seated','confirmed'].includes(e.status)?(0,X.jsx)(P.Button,{small:!0,kind:"secondary",label:(0,H.tablesOf)(e.table).length>1?'Change tables':'Combine tables',testID:`combine-${e.id}`,accessibilityLabel:`${(0,H.tablesOf)(e.table).length>1?'Change tables':'Combine tables'} for ${(0,z.walkInLabel)(e)}`,onPress:()=>ue.combineTables(e)}):null,xe||'confirmed'!==e.status?null:(0,X.jsxs)(X.Fragment,{children:[e.date===se?(0,X.jsx)(P.Button,{small:!0,label:"Seat",accessibilityLabel:`Seat ${(0,z.walkInLabel)(e)} now`,onPress:()=>(0,z.seatBookingNow)(L,e)}):null,(0,X.jsx)(P.Button,{small:!0,kind:"secondary",label:"No-show",onPress:()=>O.repo.bookings.setStatus(e.id,'noshow')})]}),xe||e.walkIn?null:(0,X.jsx)(d.CancelBookingButton,{rid:L,b:e,name:(0,z.walkInLabel)(e),small:!0,onDone:()=>{}}),xe||e.walkIn?null:(0,X.jsx)(d.ReinstateBookingButton,{b:e,name:(0,z.walkInLabel)(e),today:se}),xe||'seated'!==e.status?null:(0,X.jsx)(P.Button,{small:!0,kind:"secondary",label:"Finished",accessibilityLabel:`Finished: ${(0,z.walkInLabel)(e)}, table needs clearing`,onPress:()=>(0,z.finishBookingNow)(L,e)}),['confirmed','pending'].includes(e.status)&&e.date>=se?(0,X.jsx)(q.WhatsAppGuest,{b:e,rid:L,kind:"auto"}):null,ie?null:(0,X.jsx)(I.CopyReviewLink,{rid:L,bookingId:e.id}),!xe&&e.walkIn?(0,X.jsx)(o.CancelWalkInButton,{rid:L,b:e,small:!0}):null,!xe&&e.walkIn?(0,X.jsx)(o.ReinstateWalkInButton,{rid:L,b:e,today:se,small:!0}):null,(0,X.jsx)(G.BookingUndo,{b:e,rid:L,today:se,who:(0,z.walkInLabel)(e)})]}):null]}),'noshow'===e.status&&'paid'===t?(0,X.jsx)(P.Muted,{size:13,children:"A deposit was paid. Keep or refund it by your deposit terms (Settings \u203a Advanced \u203a Deposits). Deposits paid through website bookings are refunded in Website bookings \u203a Orders."}):null]},e.id)}),(0,X.jsx)(p.CancellationsSection,{testID:"bookings-cancellations",items:(0,b.cancellationsFor)(ne,de,e=>e.walkIn?`Walk-in ${e.ref}`:(e.name??'').replace(' (example)','')),dayWord:de===se?'today':'that day'}),(0,X.jsxs)(P.Card,{children:[(0,X.jsxs)(P.Row,{style:{justifyContent:'space-between'},children:[(0,X.jsx)(P.T,{weight:"semibold",children:"No-shows"}),(0,X.jsx)(P.Badge,{kind:je.length?'red':'ok',label:`${je.length} ${de===se?'today':(0,E.niceDate)((0,E.parseYmd)(de)).slice(0,6)}${fe||a.LIVE_VENUE_BUILD?'':' \xb7 4.1% last 28 days (example)'}`})]}),(0,X.jsx)(P.Muted,{children:je.length?`Marked no-show today: ${je.slice(0,6).map(e=>`${e.time} ${(0,z.walkInLabel)(e)}`).join(', ')}${je.length>6?` and ${je.length-6} more`:''}. If they turn up, open the booking and tap Undo no-show.`:'No no-shows today. If a party doesn\u2019t arrive, call them first, then tap No-show on their booking.'})]}),s.IS_GREENSIDE?(0,X.jsx)(t.GreensideCashOnly,{}):(0,X.jsxs)(P.Card,{children:[(0,X.jsx)(P.T,{weight:"semibold",children:"Deposits"}),(0,X.jsx)(P.Muted,{testID:"deposits-card-text",children:(()=>{const e=(0,j.depositOf)(Z.settings);return e.on&&e.perPersonPence>0?`Deposits: ${(0,M.gbp)(e.perPersonPence)} per person for parties of ${e.fromParty} or more. Deposits are paid through website bookings. Website bookings show Deposit paid on website bookings by themselves once the guest has paid. For phone and walk-in bookings, tick Deposit paid once the guest has paid you${e.wixLinksOn?', or press Send deposit link':''}.`:'Deposits are off. Turn them on in Settings \u203a Advanced \u203a Deposits.'})()}),(0,X.jsx)(P.Muted,{size:13,children:"Tip: refunds are done in Website bookings \u203a Orders. Booking deposit amounts are visible in Managers, Display and Staff."})]}),we.length>0||be?(0,X.jsxs)(N.default,{style:{gap:10},children:[(0,X.jsx)(R.SectionHead,{title:`Waitlist (${we.length})`,sub:`New party waits about ${(0,_.estimateWait)(we.length+1,Z.settings.turnMins,1)} min (estimate)`}),we.map((e,s)=>(0,X.jsxs)(N.default,{style:P.styles.card,children:[(0,X.jsxs)(P.Row,{style:{justifyContent:'space-between'},children:[(0,X.jsxs)(P.T,{weight:"semibold",children:["#",e.number," ",e.name," \xb7 ",e.partySize]}),(0,X.jsxs)(P.Muted,{children:[(0,E.minsBetween)(new Date(e.joinedAt),ee)," min \xb7 est. ",(0,_.estimateWait)(s+1,Z.settings.turnMins,1)," min"]})]}),'notified'===e.status?(0,X.jsx)(P.Badge,{kind:"ok",label:"Marked as told: table ready (no text is sent)"}):null,(0,X.jsxs)(P.Row,{gap:6,children:['waiting'===e.status?(0,X.jsx)(P.Button,{small:!0,kind:"secondary",label:"Notify",onPress:()=>O.repo.waitlist.setStatus(e.id,'notified')}):null,(0,X.jsx)(P.Button,{small:!0,label:"Seat",onPress:()=>O.repo.waitlist.setStatus(e.id,'seated')}),(0,X.jsx)(P.Button,{small:!0,kind:"ghost",label:"Remove",onPress:()=>O.repo.waitlist.setStatus(e.id,'removed')})]})]},e.id)),(0,X.jsxs)(P.Row,{gap:6,children:[(0,X.jsx)(i.TextInput,{accessibilityLabel:"Waitlist name",placeholder:"Name for the waitlist",placeholderTextColor:"#7D776C",value:he,onChangeText:ge,style:[P.styles.input,{flex:1}]}),(0,X.jsx)(P.Stepper,{value:ke,onChange:me,min:1,max:12,label:"party"})]}),(0,X.jsx)(P.Button,{kind:"secondary",label:"Add to waitlist",disabled:he.trim().length<2,onPress:()=>{O.repo.waitlist.join(L,he.trim(),ke),ge('')}})]}):(0,X.jsx)(P.Button,{kind:"ghost",label:"Open waitlist",onPress:()=>pe(!0),accessibilityLabel:"Open the empty waitlist to add a waiting party"}),ue.elements]})};var e,s=_r(_d[0]),t=_r(_d[1]),l=_r(_d[2]),n=_r(_d[3]),i=_r(_d[4]),a=_r(_d[5]),o=_r(_d[6]),d=_r(_d[7]),r=_r(_d[8]),u=_r(_d[9]),c=_r(_d[10]),h=_r(_d[11]),b=_r(_d[12]),p=_r(_d[13]),k=_r(_d[14]),x=_r(_d[15]),y=_r(_d[16]),w=_r(_d[17]),j=_r(_d[18]),f=_r(_d[19]),I=_r(_d[20]),B=_r(_d[21]),D=_r(_d[22]),S=_r(_d[23]),$=_r(_d[24]),T=_r(_d[25]),C=_r(_d[26]),L=_r(_d[27]),N=(e=L)&&e.__esModule?e:{default:e},P=_r(_d[28]),v=_r(_d[29]),O=_r(_d[30]),W=_r(_d[31]),M=_r(_d[32]),E=_r(_d[33]),_=_r(_d[34]),A=_r(_d[35]),R=_r(_d[36]),z=_r(_d[37]),H=_r(_d[38]),G=_r(_d[39]),U=_r(_d[40]),F=_r(_d[41]),K=_r(_d[42]),V=_r(_d[43]),Y=_r(_d[44]),q=_r(_d[45]),Q=_r(_d[46]),J=_r(_d[47]),X=_r(_d[48])},1341,[5,1342,11,1343,796,806,1112,1113,1091,1115,1111,1114,1328,1329,1100,1282,1012,1089,14,1344,1186,1345,1316,1081,1075,1090,34,102,794,1291,848,830,836,827,1267,840,1147,1096,1014,1346,1347,1136,1348,1177,985,1149,1324,852,25]); __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.GreensideCashOnly=function(){return(0,s.jsxs)(n.Card,{children:[(0,s.jsx)(n.T,{weight:"semibold",children:"Cash only"}),(0,s.jsx)(n.Muted,{children:"Card payments and online checkout are not enabled for The Greenside Restaurant. Deposits are off; the policy needs confirmation."})]})},r(d[0]);var n=r(d[1]),s=r(d[2])},1342,[34,794,25]); __d(function(g,_r,i,a,m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.VenueRequestList=function({rid:e,kind:n,hotel:c}){const y=(0,r.useSync)(),p='staff'===y.kind&&y.venueSlug===(0,s.queuedDatabaseSlug)(e)&&!!y.venueId&&(!['greenside','kirkton','abbotsford'].includes(e)&&!(0,s.isQueuedVenue)(e)||y.perms.includes('*')||y.perms.includes('venue.settings')),f=p&&(y.perms.includes('*')||y.perms.includes('room'===n||(0,s.isQueuedVenue)(e)||['greenside','kirkton','abbotsford'].includes(e)?'venue.settings':'bookings.manage')),[h,b]=(0,t.useState)([]),[j,q]=(0,t.useState)(''),[x,k]=(0,t.useState)(null),v=(0,t.useCallback)(async()=>{if(p)try{b(await(0,o.listVenueRequests)(y.venueId,n)),q('')}catch(e){q((0,o.requestMessage)(e))}},[p,n,y.venueId]);(0,t.useEffect)(()=>{const e=setTimeout(()=>{v()},0),s=setInterval(()=>{v()},15e3);return()=>{clearTimeout(e),clearInterval(s)}},[v]);const T=h.filter(e=>e.venue_id===y.venueId);if(!p)return null;const I=async(e,s)=>{if(!x){k(e);try{await(0,o.decideVenueRequest)(e,s),await v()}catch(e){q((0,o.requestMessage)(e))}finally{k(null)}}};return(0,u.jsxs)(d.default,{testID:`venue-${n}-requests`,style:{gap:12,alignItems:'stretch'},children:[(0,u.jsx)(l.H2,{children:'room'===n?'Room requests':'Table requests'}),(0,u.jsx)(l.T,{center:!0,children:"Requested bookings need a staff decision. No email or text is sent. Contact the guest to confirm arrangements."}),(0,u.jsx)(l.Button,{kind:"secondary",label:`Refresh ${n} requests`,onPress:()=>{v()}}),j?(0,u.jsx)(l.Banner,{kind:"warn",title:"Requests",children:j}):null,T.length||j?null:(0,u.jsxs)(l.T,{center:!0,children:["No ",n," requests yet."]}),T.map(e=>(0,u.jsx)(l.Card,{style:{alignItems:'stretch'},children:(0,u.jsxs)(d.default,{testID:`venue-request-${e.id}`,style:{gap:10},children:[(0,u.jsxs)(l.Row,{wrap:!0,children:[(0,u.jsx)(l.T,{weight:"semibold",children:e.payload.name}),(0,u.jsx)(l.Badge,{kind:'requested'===e.status?'amber':'confirmed'===e.status?'ok':'neutral',label:'requested'===e.status?'Requested':'confirmed'===e.status?'Confirmed':'Declined'})]}),(0,u.jsx)(l.T,{children:'table'===n?`${e.payload.date} \xb7 ${e.payload.service?e.payload.service+' \xb7 ':''}${e.payload.time} \xb7 ${e.payload.covers} Covers`:`${e.payload.checkIn} to ${e.payload.checkOut} \xb7 ${c?.roomTypes.find(s=>s.id===e.payload.roomType)?.name||e.payload.roomType} \xb7 ${e.payload.guests} guests`}),'room'===n?(0,u.jsxs)(l.T,{children:["Add dinner: ",e.payload.addDinner?'Yes \u2014 arrange with guest':'No']}):null,(0,u.jsxs)(l.T,{children:[e.payload.phone," \xb7 ",e.payload.email]}),e.payload.notes?(0,u.jsxs)(l.T,{children:["Notes: ",e.payload.notes]}):null,'requested'===e.status&&f?(0,u.jsxs)(l.Row,{wrap:!0,children:[(0,u.jsx)(l.Button,{label:x===e.id?'Saving\u2026':'Confirm',testID:`request-confirm-${e.id}`,disabled:!!x,onPress:()=>{I(e.id,'confirmed')}}),(0,u.jsx)(l.Button,{label:"Decline",kind:"secondary",testID:`request-decline-${e.id}`,disabled:!!x,onPress:()=>{I(e.id,'declined')}})]}):null,e.booking_id?(0,u.jsx)(l.T,{children:"Confirmed table booking is in the bookings list."}):null]})},e.id))]})};var e,s=_r(_d[0]),t=_r(_d[1]),n=_r(_d[2]),d=(e=n)&&e.__esModule?e:{default:e},l=_r(_d[3]),r=_r(_d[4]),o=_r(_d[5]),u=_r(_d[6])},1343,[6,34,102,794,985,1215,25]); __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,"untilWords",{enumerable:!0,get:function(){return w}}),_e.WixDepositLink=function({b:e,rid:x}){const f=(0,r.useRestaurant)(x),[S,j]=(0,s.useState)(!1),[C,D]=(0,s.useState)(!1),[L,I]=(0,s.useState)(null),[$,v]=(0,s.useState)(''),[P,T]=(0,s.useState)(''),[A,_]=(0,s.useState)(''),M=(0,c.depositOf)(f?.settings),O=e;if(n.IS_ISOLATED_VENUE||['souters','kirkmichael','wildings'].includes(x)||!f||!(0,c.canSendDepositLink)(O,M))return null;const B='open'===O.depositLink?.state,R=async()=>{j(!0),D(!0),T(''),I(null);try{const{data:t,error:n}=await(0,h.getSupabase)().functions.invoke('wix-deposit-link',{body:{booking_id:e.id}});if(n||!t)return void T(y);if(!t.ok||!t.url)return void T(t.off?y:String(t.error??y));const s={url:t.url,amountPence:t.amountPence,expiresAt:t.expiresAt};I(s),v((0,c.depositLinkMessage)({name:e.name,venue:f.name,partySize:e.partySize,date:e.date,time:e.time,amountPence:s.amountPence,url:s.url,expiresAt:s.expiresAt,terms:(0,c.depositTerms)(M)}))}catch{T(y)}finally{D(!1)}},W=async()=>{_('Checking\u2026');try{const{data:t,error:n}=await(0,h.getSupabase)().functions.invoke('wix-deposit-check',{body:{booking_id:e.id}});_(n||!t||t.off?'Website bookings deposit links are switched off, so nothing was checked.':'Checked with website bookings. If the guest has paid, the badge shows Deposit paid on website bookings.')}catch{_('Could not reach website bookings. Try again in a minute.')}},z=L?(0,k.waMeLink)(e.phone,$):null,E=L&&e.phone?(0,p.smsLink)(e.phone,$):null,U=L&&e.email?`mailto:${encodeURIComponent(e.email)}?subject=${encodeURIComponent(`${f.name} deposit`)}&body=${encodeURIComponent($)}`:null,F='undefined'!=typeof navigator&&!!navigator.clipboard,G=e=>{e&&o.default.openURL(e).catch(()=>{})};return(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(d.Button,{small:!0,kind:"secondary",label:B?'Send deposit link again':'Send deposit link',testID:`deposit-link-${e.id}`,accessibilityLabel:`${B?'Send the deposit link again to':'Send a website bookings deposit link to'} ${e.name}`,onPress:()=>{R()}}),B?(0,g.jsx)(d.Button,{small:!0,kind:"secondary",label:"Check if paid",testID:`deposit-check-${e.id}`,accessibilityLabel:`Check with website bookings if ${e.name} has paid the deposit`,onPress:()=>{W()}}):null,A?(0,g.jsx)(d.Muted,{size:13,children:A}):null,(0,g.jsx)(d.Sheet,{visible:S,onClose:()=>j(!1),title:"Send deposit link",testID:`deposit-link-sheet-${e.id}`,children:(0,g.jsxs)(l.default,{style:{gap:10},children:[C?(0,g.jsx)(d.T,{children:"Asking website bookings for the link\u2026"}):null,P?(0,g.jsx)(d.T,{colour:b.colours.amber,testID:"deposit-link-error",children:P}):null,L?(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(d.T,{weight:"semibold",children:`Deposit ${(0,u.gbp)(L.amountPence)} for ${e.partySize} guests.${L.expiresAt?` Link works until ${w(L.expiresAt)}.`:''}`}),(0,g.jsx)(d.T,{children:"Message to the guest (you can change it)"}),(0,g.jsx)(t.TextInput,{accessibilityLabel:"Message to the guest",testID:"deposit-link-message",value:$,multiline:!0,onChangeText:v,style:{minHeight:140,borderRadius:10,borderWidth:1,borderColor:b.colours.hairline,backgroundColor:b.colours.surface2,color:b.colours.text,padding:10,fontSize:15}}),(0,g.jsxs)(d.Row,{wrap:!0,gap:8,children:[E?(0,g.jsx)(d.Button,{label:"Text",testID:"deposit-link-sms",accessibilityLabel:`Open a text message to ${e.name} with the deposit link`,onPress:()=>G(E)}):null,z?(0,g.jsx)(d.Button,{kind:"secondary",label:"WhatsApp",testID:"deposit-link-wa",accessibilityLabel:`Open WhatsApp to ${e.name} with the deposit link`,onPress:()=>G(z)}):null,U?(0,g.jsx)(d.Button,{kind:"secondary",label:"Email",testID:"deposit-link-email",accessibilityLabel:`Open an email to ${e.name} with the deposit link`,onPress:()=>G(U)}):null,F?(0,g.jsx)(d.Button,{kind:"secondary",label:"Copy link",testID:"deposit-link-copy",accessibilityLabel:"Copy the deposit link",onPress:()=>{navigator.clipboard.writeText(L.url).catch(()=>{})}}):null]}),E||z||U?null:(0,g.jsx)(d.Muted,{children:"This booking has no phone number or email. Copy the link and send it another way."}),(0,g.jsx)(d.Muted,{size:13,children:"Tip: CoverCharge doesn't send anything. Each button opens your own messages app with the words filled in, and you press Send. Once the guest pays on website bookings, this booking shows Deposit paid on website bookings by itself. Refunds are done in Website bookings \u203a Orders."})]}):null,(0,g.jsx)(d.Button,{kind:"secondary",label:"Close",testID:"deposit-link-close",onPress:()=>j(!1)})]})})]})};var t=_r(_d[0]),n=_r(_d[1]),s=_r(_d[2]),o=e(_r(_d[3]));_r(_d[4]);var l=e(_r(_d[5])),d=_r(_d[6]),r=_r(_d[7]),c=_r(_d[8]),u=_r(_d[9]),p=_r(_d[10]),h=_r(_d[11]),b=_r(_d[12]),k=_r(_d[13]),g=_r(_d[14]);const y="Website bookings deposit links aren't switched on yet. Take the deposit by card or cash and tick Deposit paid.",w=e=>e?new Date(e).toLocaleString('en-GB',{timeZone:'Europe/London',weekday:'short',day:'numeric',month:'short',hour:'2-digit',minute:'2-digit',hourCycle:'h23'}):''},1344,[796,5,34,379,236,102,794,850,14,836,1017,931,840,1150,25]); diff --git a/car-app/index.html b/car-app/index.html index aad067afffc057492d28ebf120ee91b7052bbb04..f43f056d0ddcb07685ff27a1c1cb3a394f2bc48a 100644 --- a/car-app/index.html +++ b/car-app/index.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/car-app/owner.html b/car-app/owner.html index 338eb40b4fff475900ce2c5b984284a1250a1316..7021e29774652abda437f72b0dd3023c57d5e6b4 100644 --- a/car-app/owner.html +++ b/car-app/owner.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/car-app/sw.js b/car-app/sw.js index b2f419e338ef1c696cfa40a38d560dd2ae5ad61a..d2b1e83aebce5d5b570236c89d28c88b422f840e 100644 --- a/car-app/sw.js +++ b/car-app/sw.js @@ -1,7 +1,7 @@ // Anchorage car screen service worker: precache the app shell so it opens offline after the first visit. -const V = "cc-car-e8f97e3f28"; +const V = "cc-car-8c36ed9bfe"; const BASE = "/car-app/"; -const PRECACHE = ["/car-app/assets/assets/brand/3idiots-hero.e5dfd53739f05086b1956e72d585a66a.png", "/car-app/assets/assets/brand/3idiots.df4a76d2130f0e5b0042f06a8c88693a.png", "/car-app/assets/assets/brand/abbotsford-hero.78fcb8ee06ee22c4ca659c9254db7512.png", "/car-app/assets/assets/brand/abbotsford.b26602bba5ce4969733c5422a45ad053.png", "/car-app/assets/assets/brand/anchorage-hero.0450b828e4f9c1f4456240096598f6f5.png", "/car-app/assets/assets/brand/anchorage.fea5ce2f6fd18bf2950aa21c0980ed8e.png", "/car-app/assets/assets/brand/brae.8de9e89ac30966c6669de990370d8e40.png", "/car-app/assets/assets/brand/cecchinis-hero.f77780fcc94fd668cf35d66d6dc52d81.png", "/car-app/assets/assets/brand/cecchinis.ebf752fef363247848ae7c0d91938765.png", "/car-app/assets/assets/brand/drunkencoo-hero.65c21c4da9e466cf4bffc969639a1427.png", "/car-app/assets/assets/brand/drunkencoo.f6d92af3b14e4205a3deaf4434754c51.png", "/car-app/assets/assets/brand/greenside-hero.1caec5a6cb939434cccb5f3a613b50f8.png", "/car-app/assets/assets/brand/greenside.9d1556db97dcb903a3c57e2063ee2255.png", "/car-app/assets/assets/brand/kirkmichael-hero.63b13cde7fd82eb622622b39ac80c394.png", "/car-app/assets/assets/brand/kirkmichael.63b13cde7fd82eb622622b39ac80c394.png", "/car-app/assets/assets/brand/kirkton-hero.9d0837b292c2f4f30f4521d806bb28c3.png", "/car-app/assets/assets/brand/kirkton.bcf8d846df4861474d224a7a77f498fb.png", "/car-app/assets/assets/brand/mrbasrais-hero.4ce74641cfcf52d099157c84005b9d2a.png", "/car-app/assets/assets/brand/mrbasrais.7cc4086dd12ace82529795f1c9f8c900.png", "/car-app/assets/assets/brand/pizzaioli-hero.1896657c08264cefb49b401891d5448d.png", "/car-app/assets/assets/brand/pizzaioli.db8c000b62ee407121aa8b90ce45e170.png", "/car-app/assets/assets/brand/rupeeroom-hero.969fa372add526aaacf3a6c009b8ac92.png", "/car-app/assets/assets/brand/rupeeroom.689e6fb536dc0845eeb174a1ec7bd346.png", "/car-app/assets/assets/brand/saltmarsh.85a6a65732635e5148478d743d9ca884.png", "/car-app/assets/assets/brand/smokinggoat-hero.0588f17ef0eed7f757f22916cd4d37db.png", "/car-app/assets/assets/brand/smokinggoat.20a3a1970596ab43c5d6468d4ed549a7.png", "/car-app/assets/assets/brand/souters.f4c58d9349b6e1700fe5abcc9e9b665c.png", "/car-app/assets/assets/brand/wildings-hero-logo-text.4661e4b935726f2511f9c17a1567c89a.png", "/car-app/assets/assets/brand/wildings.076f4fcd06d19a0af0205c410f461b14.png", "/car-app/assets/assets/brand/williewastles-hero.b9d53d27b66f903b5618a7177b2ffad4.png", "/car-app/assets/assets/brand/williewastles.055a77893ced99bf3a6c5402ba5baac6.png", "/car-app/assets/assets/brand/yasmins-hero.a5aef62e37dfcecbe0afc056186f4ad9.png", "/car-app/assets/assets/brand/yasmins.8482602e9f0a965655924835625cb02b.png", "/car-app/assets/assets/recipes/fishsupper.1609c58319e1e8721f5c639049fb054e.jpg", "/car-app/assets/assets/recipes/lobster.2fb3485c8e372972099259017358c1b8.jpg", "/car-app/assets/assets/recipes/moules.a4f342fc7e7fb62c8a0b5c1678bbea3f.jpg", "/car-app/assets/assets/recipes/skink.4ce7b7c676f9cdcd0a060eda46f5a00e.jpg", "/car-app/assets/assets/recipes/stp.1061ced765efdcafff2554adc3fc7113.jpg", "/car-app/assets/assets/specials/sample-chalkboard.e7b4e4450a8483d4219bc6a214158d8f.jpg", "/car-app/assets/node_modules/@expo-google-fonts/poppins/400Regular/Poppins_400Regular.093ee89be9ede30383f39a899c485a82.ttf", "/car-app/assets/node_modules/@expo-google-fonts/poppins/500Medium/Poppins_500Medium.bf59c687bc6d3a70204d3944082c5cc0.ttf", "/car-app/assets/node_modules/@expo-google-fonts/poppins/600SemiBold/Poppins_600SemiBold.6f1520d107205975713ba09df778f93f.ttf", "/car-app/assets/node_modules/@expo-google-fonts/poppins/700Bold/Poppins_700Bold.08c20a487911694291bd8c5de41315ad.ttf", "/car-app/assets/node_modules/expo-router/assets/arrow_down.017bc6ba3fc25503e5eb5e53826d48a8.png", "/car-app/assets/node_modules/expo-router/assets/error.d1ea1496f9057eb392d5bbf3732a61b7.png", "/car-app/assets/node_modules/expo-router/assets/file.19eeb73b9593a38f8e9f418337fc7d10.png", "/car-app/assets/node_modules/expo-router/assets/forward.d8b800c443b8972542883e0b9de2bdc6.png", "/car-app/assets/node_modules/expo-router/assets/pkg.ab19f4cbc543357183a20571f68380a3.png", "/car-app/assets/node_modules/expo-router/assets/react-navigation/elements/back-icon-mask.0a328cd9c1afd0afe8e3b1ec5165b1b4.png", "/car-app/assets/node_modules/expo-router/assets/react-navigation/elements/back-icon.35ba0eaec5a4f5ed12ca16fabeae451d.png", "/car-app/assets/node_modules/expo-router/assets/react-navigation/elements/clear-icon.c94f6478e7ae0cdd9f15de1fcb9e5e55.png", "/car-app/assets/node_modules/expo-router/assets/react-navigation/elements/clear-icon.c94f6478e7ae0cdd9f15de1fcb9e5e55@2x.png", "/car-app/assets/node_modules/expo-router/assets/react-navigation/elements/clear-icon.c94f6478e7ae0cdd9f15de1fcb9e5e55@3x.png", "/car-app/assets/node_modules/expo-router/assets/react-navigation/elements/clear-icon.c94f6478e7ae0cdd9f15de1fcb9e5e55@4x.png", "/car-app/assets/node_modules/expo-router/assets/react-navigation/elements/close-icon.808e1b1b9b53114ec2838071a7e6daa7.png", "/car-app/assets/node_modules/expo-router/assets/react-navigation/elements/close-icon.808e1b1b9b53114ec2838071a7e6daa7@2x.png", "/car-app/assets/node_modules/expo-router/assets/react-navigation/elements/close-icon.808e1b1b9b53114ec2838071a7e6daa7@3x.png", "/car-app/assets/node_modules/expo-router/assets/react-navigation/elements/close-icon.808e1b1b9b53114ec2838071a7e6daa7@4x.png", "/car-app/assets/node_modules/expo-router/assets/react-navigation/elements/search-icon.286d67d3f74808a60a78d3ebf1a5fb57.png", "/car-app/assets/node_modules/expo-router/assets/sitemap.412dd9275b6b48ad28f5e3d81bb1f626.png", "/car-app/assets/node_modules/expo-router/assets/unmatched.20e71bdf79e3a97bf55fd9e164041578.png", "/car-app/favicon.ico", "/car-app/index.html", "/car-app/_expo/static/js/web/bundle.js?v=e8f97e3f28f7309cf679bf7e302b48a0039a662217e164f1bf839ccf71bd2b5e"]; +const PRECACHE = ["/car-app/assets/assets/brand/3idiots-hero.e5dfd53739f05086b1956e72d585a66a.png", "/car-app/assets/assets/brand/3idiots.df4a76d2130f0e5b0042f06a8c88693a.png", "/car-app/assets/assets/brand/abbotsford-hero.78fcb8ee06ee22c4ca659c9254db7512.png", "/car-app/assets/assets/brand/abbotsford.b26602bba5ce4969733c5422a45ad053.png", "/car-app/assets/assets/brand/anchorage-hero.0450b828e4f9c1f4456240096598f6f5.png", "/car-app/assets/assets/brand/anchorage.fea5ce2f6fd18bf2950aa21c0980ed8e.png", "/car-app/assets/assets/brand/brae.8de9e89ac30966c6669de990370d8e40.png", "/car-app/assets/assets/brand/cecchinis-hero.f77780fcc94fd668cf35d66d6dc52d81.png", "/car-app/assets/assets/brand/cecchinis.ebf752fef363247848ae7c0d91938765.png", "/car-app/assets/assets/brand/drunkencoo-hero.65c21c4da9e466cf4bffc969639a1427.png", "/car-app/assets/assets/brand/drunkencoo.f6d92af3b14e4205a3deaf4434754c51.png", "/car-app/assets/assets/brand/greenside-hero.1caec5a6cb939434cccb5f3a613b50f8.png", "/car-app/assets/assets/brand/greenside.9d1556db97dcb903a3c57e2063ee2255.png", "/car-app/assets/assets/brand/kirkmichael-hero.63b13cde7fd82eb622622b39ac80c394.png", "/car-app/assets/assets/brand/kirkmichael.63b13cde7fd82eb622622b39ac80c394.png", "/car-app/assets/assets/brand/kirkton-hero.9d0837b292c2f4f30f4521d806bb28c3.png", "/car-app/assets/assets/brand/kirkton.bcf8d846df4861474d224a7a77f498fb.png", "/car-app/assets/assets/brand/mrbasrais-hero.4ce74641cfcf52d099157c84005b9d2a.png", "/car-app/assets/assets/brand/mrbasrais.7cc4086dd12ace82529795f1c9f8c900.png", "/car-app/assets/assets/brand/pizzaioli-hero.1896657c08264cefb49b401891d5448d.png", "/car-app/assets/assets/brand/pizzaioli.db8c000b62ee407121aa8b90ce45e170.png", "/car-app/assets/assets/brand/rupeeroom-hero.969fa372add526aaacf3a6c009b8ac92.png", "/car-app/assets/assets/brand/rupeeroom.689e6fb536dc0845eeb174a1ec7bd346.png", "/car-app/assets/assets/brand/saltmarsh.85a6a65732635e5148478d743d9ca884.png", "/car-app/assets/assets/brand/smokinggoat-hero.0588f17ef0eed7f757f22916cd4d37db.png", "/car-app/assets/assets/brand/smokinggoat.20a3a1970596ab43c5d6468d4ed549a7.png", "/car-app/assets/assets/brand/souters.f4c58d9349b6e1700fe5abcc9e9b665c.png", "/car-app/assets/assets/brand/wildings-hero-logo-text.4661e4b935726f2511f9c17a1567c89a.png", "/car-app/assets/assets/brand/wildings.076f4fcd06d19a0af0205c410f461b14.png", "/car-app/assets/assets/brand/williewastles-hero.b9d53d27b66f903b5618a7177b2ffad4.png", "/car-app/assets/assets/brand/williewastles.055a77893ced99bf3a6c5402ba5baac6.png", "/car-app/assets/assets/brand/yasmins-hero.a5aef62e37dfcecbe0afc056186f4ad9.png", "/car-app/assets/assets/brand/yasmins.8482602e9f0a965655924835625cb02b.png", "/car-app/assets/assets/recipes/fishsupper.1609c58319e1e8721f5c639049fb054e.jpg", "/car-app/assets/assets/recipes/lobster.2fb3485c8e372972099259017358c1b8.jpg", "/car-app/assets/assets/recipes/moules.a4f342fc7e7fb62c8a0b5c1678bbea3f.jpg", "/car-app/assets/assets/recipes/skink.4ce7b7c676f9cdcd0a060eda46f5a00e.jpg", "/car-app/assets/assets/recipes/stp.1061ced765efdcafff2554adc3fc7113.jpg", "/car-app/assets/assets/specials/sample-chalkboard.e7b4e4450a8483d4219bc6a214158d8f.jpg", "/car-app/assets/node_modules/@expo-google-fonts/poppins/400Regular/Poppins_400Regular.093ee89be9ede30383f39a899c485a82.ttf", "/car-app/assets/node_modules/@expo-google-fonts/poppins/500Medium/Poppins_500Medium.bf59c687bc6d3a70204d3944082c5cc0.ttf", "/car-app/assets/node_modules/@expo-google-fonts/poppins/600SemiBold/Poppins_600SemiBold.6f1520d107205975713ba09df778f93f.ttf", "/car-app/assets/node_modules/@expo-google-fonts/poppins/700Bold/Poppins_700Bold.08c20a487911694291bd8c5de41315ad.ttf", "/car-app/assets/node_modules/expo-router/assets/arrow_down.017bc6ba3fc25503e5eb5e53826d48a8.png", "/car-app/assets/node_modules/expo-router/assets/error.d1ea1496f9057eb392d5bbf3732a61b7.png", "/car-app/assets/node_modules/expo-router/assets/file.19eeb73b9593a38f8e9f418337fc7d10.png", "/car-app/assets/node_modules/expo-router/assets/forward.d8b800c443b8972542883e0b9de2bdc6.png", "/car-app/assets/node_modules/expo-router/assets/pkg.ab19f4cbc543357183a20571f68380a3.png", "/car-app/assets/node_modules/expo-router/assets/react-navigation/elements/back-icon-mask.0a328cd9c1afd0afe8e3b1ec5165b1b4.png", "/car-app/assets/node_modules/expo-router/assets/react-navigation/elements/back-icon.35ba0eaec5a4f5ed12ca16fabeae451d.png", "/car-app/assets/node_modules/expo-router/assets/react-navigation/elements/clear-icon.c94f6478e7ae0cdd9f15de1fcb9e5e55.png", "/car-app/assets/node_modules/expo-router/assets/react-navigation/elements/clear-icon.c94f6478e7ae0cdd9f15de1fcb9e5e55@2x.png", "/car-app/assets/node_modules/expo-router/assets/react-navigation/elements/clear-icon.c94f6478e7ae0cdd9f15de1fcb9e5e55@3x.png", "/car-app/assets/node_modules/expo-router/assets/react-navigation/elements/clear-icon.c94f6478e7ae0cdd9f15de1fcb9e5e55@4x.png", "/car-app/assets/node_modules/expo-router/assets/react-navigation/elements/close-icon.808e1b1b9b53114ec2838071a7e6daa7.png", "/car-app/assets/node_modules/expo-router/assets/react-navigation/elements/close-icon.808e1b1b9b53114ec2838071a7e6daa7@2x.png", "/car-app/assets/node_modules/expo-router/assets/react-navigation/elements/close-icon.808e1b1b9b53114ec2838071a7e6daa7@3x.png", "/car-app/assets/node_modules/expo-router/assets/react-navigation/elements/close-icon.808e1b1b9b53114ec2838071a7e6daa7@4x.png", "/car-app/assets/node_modules/expo-router/assets/react-navigation/elements/search-icon.286d67d3f74808a60a78d3ebf1a5fb57.png", "/car-app/assets/node_modules/expo-router/assets/sitemap.412dd9275b6b48ad28f5e3d81bb1f626.png", "/car-app/assets/node_modules/expo-router/assets/unmatched.20e71bdf79e3a97bf55fd9e164041578.png", "/car-app/favicon.ico", "/car-app/index.html", "/car-app/_expo/static/js/web/bundle.js?v=8c36ed9bfe0f70144a76ebd0d27e3e972d161cd097cb10fd8396d944033c9270"]; // Hugging Face serves large files (fonts) through a redirect to its CDN. Browsers refuse to hand a *redirected* cached // response to a page, so store a plain copy instead (otherwise fonts, and so the app, fail to load offline). 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); diff --git a/chef-app/_expo/static/js/web/bundle.js b/chef-app/_expo/static/js/web/bundle.js index 6d77ebb87a6ab4447a46637c7e85d2b911c35b11..af4004466f22dae2c54d83da1b5de2c14ac4ba93 100644 --- a/chef-app/_expo/static/js/web/bundle.js +++ b/chef-app/_expo/static/js/web/bundle.js @@ -1122,7 +1122,7 @@ __d(function(g,r,i,a,m,e,d){m.exports=r(d[0])},1038,[1039]); __d(function(g,r,i,a,m,e,d){function n(n,t){const o=globalThis[`${__METRO_GLOBAL_PREFIX__??''}__loadBundleAsync`];if(null!=o){const s=String(n);if(null!=t){const n=t[s];if(null!=n)return o(n)}}}function t(t,o,s){const u=()=>r.importAll(t,s);{const l=o?.[String(t)];if(Array.isArray(l)){const c=globalThis[`${__METRO_GLOBAL_PREFIX__??''}__loadBundleAsync`];if(c?.isReady?.(l))return u();const f=n(t,o);if(null!=f)return f.then(u);throw new Error(`Cannot import module ${s??t}: the async bundle loader is unavailable. Load the initial Expo bundle before importing these chunks: ${l.join(', ')}`)}try{return u()}catch(s){const l=n(t,o);if(null!=l)return l.then(u);throw s}}const l=n(t,o);return null!=l?l.then(u):u()}function o(n,o,s){const u=t(n,o,s),l=Promise.resolve(u);return l._result=u,l}o.unstable_importMaybeSync=function(n,o){return t(n,o)},o.prefetch=function(t,o,s){n(t,o)?.then(()=>{},()=>{})},o.unstable_resolve=function(n,t){if(!t)throw new Error('Bundle splitting is required for Web Worker imports');const o=t[n];if(!o)throw new Error('Worker import is missing from split bundle paths: '+o);return o},o.unstable_createWorker=function(n,t){if('undefined'==typeof crossOriginIsolated||!crossOriginIsolated)return new Worker(n,t);try{const s=(o=n,`\n const ASYNC_WORKER_BASE = ${JSON.stringify(o)};\n const IMPORT_SCRIPTS = importScripts;\n const FETCH = fetch;\n const fromBaseURL = (input) => new URL(input, ASYNC_WORKER_BASE).href;\n self.fetch = function(input, init) {\n return FETCH(typeof input === 'string' ? fromBaseURL(input) : input, init);\n };\n self.importScripts = function(...urls) {\n return IMPORT_SCRIPTS.apply(self, urls.map(fromBaseURL));\n };\n importScripts(ASYNC_WORKER_BASE);\n `);return n=URL.createObjectURL(new Blob([s],{type:'text/javascript'})),new Worker(n,t)}finally{URL.revokeObjectURL(n)}var o},m.exports=o},1039,[]); __d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"currentScrollY",{enumerable:!0,get:function(){return u}}),Object.defineProperty(_e,"screenGeneration",{enumerable:!0,get:function(){return c}}),Object.defineProperty(_e,"restoreScroll",{enumerable:!0,get:function(){return o}}),_e.useScrollMemory=function(u){const c=(0,e.useRef)(0),o=(0,e.useRef)(0),l=(0,e.useRef)(0),s=(0,e.useRef)(0),f=(0,e.useRef)(0),v=(0,e.useRef)(null),y=(0,e.useRef)([]),h=()=>{y.current.forEach(clearTimeout),y.current=[]},b=()=>{const e=v.current;null!=e&&(u.current?.scrollTo({y:e,animated:!1}),f.current-s.current>=e-2&&(c.current=e,o.current=e,v.current=null,h()))},p=(0,e.useCallback)(e=>{if(h(),v.current=Math.max(0,e),e<=0)return v.current=null,u.current?.scrollTo({y:0,animated:!1}),c.current=0,void(o.current=0);for(const e of[0,30,80,160,320,600,1e3,1600,2500])y.current.push(setTimeout(b,e));y.current.push(setTimeout(()=>{v.current=null},2600))},[]);t={y:()=>o.current,restore:p};const R=(0,e.useCallback)(()=>{n++;return o.current},[]);return{props:{scrollEventThrottle:32,onScroll:e=>{const t=e.nativeEvent.contentOffset.y;c.current=t,s.current=e.nativeEvent.layoutMeasurement.height,f.current=e.nativeEvent.contentSize.height,Date.now()-l.current>250&&null==v.current&&(o.current=t)},onScrollBeginDrag:()=>{v.current=null,h()},onContentSizeChange:(e,t)=>{f.current=t,l.current=Date.now(),b()},onLayout:e=>{s.current=e.nativeEvent.layout.height}},restore:p,leave:R}};var e=r(d[0]);let t=null,n=0;const u=()=>t?t.y():0,c=()=>n,o=e=>t?.restore(e)},1040,[34]); __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,"useBackLayers",{enumerable:!0,get:function(){return f}}),_e.runBackLayer=function(){const e=f.getState().layers,t=e[e.length-1];return!!t&&(t.fn(),!0)},_e.useBackLayer=function(e,n,o=!0){const s=(0,t.useRef)(n);s.current=n,(0,t.useEffect)(()=>{if(!e)return;const t=++y,n=(0,u.currentScrollY)(),l=(0,u.screenGeneration)();return f.setState(e=>({layers:[...e.layers,{id:t,fn:()=>s.current(),own:o}]})),()=>{f.setState(e=>({layers:e.layers.filter(e=>e.id!==t)})),(0,u.screenGeneration)()===l&&(0,u.restoreScroll)(n)}},[e,o])},Object.defineProperty(_e,"useInnerBackShown",{enumerable:!0,get:function(){return w}}),Object.defineProperty(_e,"BACK_GUTTER",{enumerable:!0,get:function(){return p}}),_e.BackTitleRow=function({back:e,onBack:n,title:s}){const[l,u]=(0,t.useState)(0),[f,y]=(0,t.useState)({w:96,h:48}),[w,b]=(0,t.useState)(0),S=Array.from(new Set(String(s??'').split(/\s+/).filter(Boolean)));String(s??'').length>=20&&S.length>=3&&S.push('00000000');const v=Math.max(p,Math.ceil(f.w)+4),j=e&&l>0&&l-2*vu(Math.round(e.nativeEvent.layout.width)),style:{minHeight:44,justifyContent:'center',alignItems:'center',paddingHorizontal:e&&!j?v:0,paddingTop:j?f.h:0},children:[e?(0,h.jsx)(o.default,{style:{position:'absolute',left:0,top:0},onLayout:e=>{const t=Math.round(e.nativeEvent.layout.width),n=Math.round(e.nativeEvent.layout.height);y(e=>e.w===t&&e.h===n?e:{w:t,h:n})},children:(0,h.jsx)(g,{onPress:n})}):null,(0,h.jsx)(c.T,{size:22,weight:"bold",center:!0,accessibilityRole:"header",children:s}),e&&S.length?(0,h.jsx)(o.default,{"aria-hidden":!0,importantForAccessibility:"no-hide-descendants",pointerEvents:"none",style:{position:'absolute',left:0,top:0,opacity:0,alignItems:'flex-start'},onLayout:e=>b(Math.ceil(e.nativeEvent.layout.width)),children:S.map(e=>(0,h.jsx)(c.T,{size:22,weight:"bold",numberOfLines:1,style:{alignSelf:'flex-start'},children:e},e))}):null]})},_e.BackButton=g,_e.useWebBack=function(e){const n=(0,t.useRef)(e);n.current=e,(0,t.useEffect)(()=>{if('undefined'==typeof window||!window.history?.pushState)return;const e=()=>{try{window.history.pushState({...window.history.state??{},ccBack:Date.now()},'',window.location.href)}catch{}};e();const t=t=>{n.current()&&(t.stopImmediatePropagation?.(),e())};return window.addEventListener('popstate',t,!0),()=>window.removeEventListener('popstate',t,!0)},[])};var t=r(d[0]);r(d[1]);var n=e(r(d[2])),o=e(r(d[3])),s=r(d[4]),l=r(d[5]),c=r(d[6]),u=r(d[7]),h=r(d[8]);const f=(0,s.create)(()=>({layers:[]}));let y=0;const w=()=>f(e=>e.layers.some(e=>e.own)),p=100;function g({onPress:e,testID:t="screen-back",label:o="Back"}){return(0,h.jsx)(n.default,{testID:t,accessibilityRole:"button",accessibilityLabel:o,onPress:e,hitSlop:8,style:({pressed:e})=>({minHeight:48,minWidth:96,justifyContent:'center',paddingRight:12,opacity:e?.6:1,alignSelf:'flex-start'}),children:(0,h.jsxs)(c.T,{size:18,weight:"semibold",colour:l.colours.gold,children:["\u2039 ",o]})})}},1041,[34,236,402,102,815,840,794,1040,25]); -__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"APP_VERSION",{enumerable:!0,get:function(){return t}});const t='v0.3.12.121'},1042,[]); +__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"APP_VERSION",{enumerable:!0,get:function(){return t}});const t='v0.3.12.122'},1042,[]); __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.NotificationsSettings=function({rid:e}){(0,n.useEffect)(()=>{c.useNotifs.getState().ensure(e),(0,j.readPushLive)()},[e]);const t=(0,c.useNotifs)(e=>e.items).filter(t=>t.rid===e&&!t.removed),s=(0,h.useOwner)(e=>e.staff),o=(0,j.usePushLive)(),[l,p]=(0,n.useState)(null),[f,g]=(0,n.useState)(null),[x,b]=(0,n.useState)(!1),y=c.useNotifs.getState(),T=s.map(e=>({id:e.id,role:e.role,level:e.level,job:e.job,department:e.dept,active:e.active})),v=e=>{const t=(0,u.resolveRecipients)(e,T,[]),n=[...e.recipients.groups.map(e=>u.NOTIF_GROUP_LABEL[e]),...(e.recipients.onShiftIn??[]).map(e=>u.SHIFT_FILTER_LABEL[e])];e.recipients.fallback&&n.push(`else ${[...e.recipients.fallback.groups.map(e=>u.NOTIF_GROUP_LABEL[e]),...e.recipients.fallback.staff.map(e=>I(s.find(t=>t.id===e)?.name??e))].join(', ')}`);const o=e.recipients.staff.map(e=>I(s.find(t=>t.id===e)?.name??e));return[...n,...o].join(', ')+(t.length||(e.recipients.onShiftIn??[]).length?'':' (nobody yet)')};return(0,k.jsxs)(a.default,{style:{gap:10},testID:"notif-settings",children:[(0,k.jsx)(r.Muted,{size:13,children:"Tip: these remind people at a set time, e.g. the Mills milk order. They show in the app as a gold slider with Done and Later. Done is logged with the name and time. Times are UK time."}),(0,k.jsxs)(a.default,{testID:"push-live-status",style:{borderWidth:1,borderColor:d.colours.accentBorder,borderRadius:10,padding:8,gap:4},children:[(0,k.jsxs)(r.Row,{style:{justifyContent:'space-between'},children:[(0,k.jsx)(r.T,{weight:"semibold",children:"Send to phones"}),(0,k.jsx)(r.Badge,{kind:o.live?'gold':'neutral',label:o.live?'ON':'OFF'})]}),(0,k.jsx)(r.Muted,{size:12,children:o.live?'Phone notifications go to people who turned them on.':'Off: nothing goes to anyone\u2019s phone yet. In-app reminders still work.'}),(0,k.jsx)(r.Button,{small:!0,kind:"secondary",testID:"push-live-toggle",label:o.live?'Switch phone notifications off':'Switch phone notifications on\u2026',onPress:()=>b(!0)})]}),(0,k.jsx)(R,{}),t.map(e=>l===e.id?(0,k.jsx)(D,{init:e,onCancel:()=>p(null),onSave:t=>{y.update(e.id,t),p(null)}},e.id):(0,k.jsxs)(a.default,{testID:`notif-${e.seed??e.id}`,style:{borderWidth:1,borderColor:d.colours.hairline,borderRadius:12,padding:10,gap:4,opacity:e.paused?.6:1},children:[(0,k.jsxs)(r.Row,{style:{justifyContent:'space-between'},children:[(0,k.jsx)(r.T,{weight:"semibold",style:{flex:1},children:e.title}),e.paused?(0,k.jsx)(r.Badge,{kind:"neutral",label:"Off"}):null]}),(0,k.jsx)(r.Muted,{size:13,children:e.message}),(0,k.jsxs)(r.Muted,{size:12,children:[(0,u.scheduleText)(e)," \xb7 ",v(e)," \xb7 ",[e.sendBy.inApp?'In app':'',e.sendBy.push?'Phone':''].filter(Boolean).join(' + ')]}),(0,k.jsxs)(r.Row,{gap:6,children:[(0,k.jsx)(r.Button,{small:!0,kind:"secondary",testID:`notif-edit-${e.seed??e.id}`,label:"Edit",onPress:()=>p(e.id)}),(0,k.jsx)(r.Button,{small:!0,kind:"ghost",label:e.paused?'Switch on':'Switch off',onPress:()=>y.update(e.id,{paused:!e.paused})}),(0,k.jsx)(r.Button,{small:!0,kind:"ghost",label:"Remove",onPress:()=>g(e)})]})]},e.id)),'new'===l?(0,k.jsx)(D,{init:C,onCancel:()=>p(null),onSave:t=>{y.add(e,t),p(null)}}):(0,k.jsx)(r.Button,{small:!0,testID:"notif-add",label:"Add a notification",onPress:()=>p('new')}),(0,k.jsxs)(r.Sheet,{visible:!!f,onClose:()=>g(null),title:"Remove this notification?",children:[(0,k.jsx)(r.T,{children:f?.title}),(0,k.jsx)(r.Muted,{children:"Nobody gets it after this. Reset to default restores the configured rules."}),(0,k.jsxs)(r.Row,{gap:8,children:[(0,k.jsx)(r.Button,{label:"Remove",onPress:()=>{f&&y.remove(f.id),g(null)}}),(0,k.jsx)(r.Button,{kind:"ghost",label:"Cancel",onPress:()=>g(null)})]})]}),(0,k.jsxs)(r.Sheet,{visible:x,onClose:()=>b(!1),title:o.live?'Switch phone notifications off?':'Switch phone notifications on?',testID:"push-live-confirm",children:[(0,k.jsx)(r.T,{children:o.live?'Nothing more goes to phones. In-app reminders keep working.':'From the next scheduled time, everyone ticked on a notification with \u201cPhone notification\u201d gets it on any phone where they turned phone notifications on.'}),(0,k.jsxs)(r.Row,{gap:8,children:[(0,k.jsx)(r.Button,{testID:"push-live-yes",label:o.live?'Switch off':'Yes, switch on',onPress:()=>{(0,j.setPushLive)(!o.live).then(e=>(0,w.notify)({id:'push-live',tone:e.ok?'normal':'warn',title:e.ok?o.live?'Phone notifications are off':'Phone notifications are on':'Not changed',body:e.message??'',timeoutMs:7e3})),b(!1)}}),(0,k.jsx)(r.Button,{kind:"ghost",label:"Cancel",onPress:()=>b(!1)})]})]})]})},_e.PushButton=R,_e.OrderListsSettings=function({rid:e}){(0,n.useEffect)(()=>{p.useOrderLists.getState().ensure(e)},[e]);const s=(0,p.useOrderLists)(e=>e.lists).filter(t=>t.rid===e),o=(0,p.orderSettingsOf)(e);(0,p.useOrderLists)(t=>t.settings[e]);const l=p.useOrderLists.getState(),[c,u]=(0,n.useState)(''),[h,g]=(0,n.useState)({});return(0,k.jsxs)(a.default,{style:{gap:10},testID:"order-list-settings",children:[(0,k.jsx)(r.Muted,{size:13,children:"Tip: running lists (like Alsons drinks) collect items until you order; trip lists (like Cash and carry) are for one shopping day. Logos and phone numbers are set on each list."}),(0,k.jsx)(r.Toggle,{testID:"order-allow-staff",label:"Let all staff add items",value:o.allowStaff,onChange:t=>l.setSettings(e,{allowStaff:t})}),(0,k.jsx)(r.Muted,{size:12,children:"Staff can add items and see the lists. Only managers and the Head Chef tick, remove or finish an order."}),(0,k.jsx)(r.T,{weight:"semibold",children:"Default trip day"}),(0,k.jsx)(r.Row,{wrap:!0,gap:6,children:v.map(t=>(0,k.jsx)(r.Chip,{label:f.DAY_FULL[t].slice(0,3),selected:o.defaultTripDay===t,onPress:()=>l.setSettings(e,{defaultTripDay:t})},t))}),s.map(e=>(0,k.jsxs)(a.default,{testID:`order-list-row-${e.seed??e.id}`,style:{borderWidth:1,borderColor:d.colours.hairline,borderRadius:10,padding:8,gap:6,opacity:e.archived?.55:1},children:[(0,k.jsxs)(r.Row,{gap:6,children:[(0,k.jsx)(t.TextInput,{accessibilityLabel:`Rename ${e.name}`,value:h[e.id]??e.name,onChangeText:t=>g(s=>({...s,[e.id]:t})),onBlur:()=>{const t=(h[e.id]??'').trim();t&&t!==e.name&&l.updateList(e.id,{name:t})},style:{...T,flex:1,minWidth:0}}),(0,k.jsx)(r.Badge,{kind:"neutral",label:'trip'===e.kind?'Trip':'Running'})]}),'trip'===e.kind?(0,k.jsx)(r.Row,{wrap:!0,gap:6,children:v.map(t=>(0,k.jsx)(r.Chip,{label:f.DAY_FULL[t].slice(0,3),selected:(e.tripDay??o.defaultTripDay)===t,onPress:()=>l.updateList(e.id,{tripDay:t})},t))}):null,(0,k.jsx)(r.Row,{gap:6,children:(0,k.jsx)(r.Button,{small:!0,kind:"ghost",label:e.archived?'Bring back':'Archive',onPress:()=>l.updateList(e.id,{archived:!e.archived})})})]},e.id)),(0,k.jsxs)(r.Row,{gap:6,wrap:!0,children:[(0,k.jsx)(t.TextInput,{accessibilityLabel:"New list name",testID:"order-new-name",value:c,onChangeText:u,placeholder:"e.g. Butcher",placeholderTextColor:d.colours.muted,style:{...T,flexGrow:1,flexBasis:160,minWidth:0}}),(0,k.jsx)(r.Button,{small:!0,label:"Add running",disabled:c.trim().length<2,onPress:()=>{l.addList(e,{name:c.trim(),kind:'running'}),u('')}}),(0,k.jsx)(r.Button,{small:!0,kind:"secondary",label:"Add trip",disabled:c.trim().length<2,onPress:()=>{l.addList(e,{name:c.trim(),kind:'trip',tripDay:o.defaultTripDay}),u('')}})]})]})},Object.defineProperty(_e,"resetOrderLists",{enumerable:!0,get:function(){return B}}),_e.ClockAreaSettings=function({rid:e,me:c}){(0,g.useClockArea)(t=>t.areas[e]);const u=(0,g.areaOf)(e);const h=g.useClockArea.getState(),p=(0,s.privateClockVenue)(e),[f,j]=(0,n.useState)(null==u.lat?'':String(u.lat)),[y,w]=(0,n.useState)(null==u.lng?'':String(u.lng)),[v,S]=(0,n.useState)(!1),[I,C]=(0,n.useState)(''),[L,D]=(0,n.useState)(u.breakOptions.join(', ')),R=(t,s)=>{const n=Number(t),o=Number(s);t.trim()||s.trim()?Number.isFinite(n)&&Number.isFinite(o)&&Math.abs(n)<=90&&Math.abs(o)<=180&&h.set(e,{lat:n,lng:o},c):h.set(e,{lat:null,lng:null},c)},B=async()=>{if(p)return;S(!0),C('');const t=await(0,b.getFix)();if(S(!1),'object'!=typeof t)return void C('denied'===t?'Location is blocked for this app. Allow it in your browser or phone settings.':'Couldn\u2019t get your location. Try again outside or near a window.');const s=t.lat.toFixed(6),n=t.lng.toFixed(6);j(s),w(n),h.set(e,{lat:Number(s),lng:Number(n)},c),C(`Centre set to where you are (accurate to about ${Math.round(t.acc)} m).`)},P=(0,x.areaSet)(u);return(0,k.jsxs)(a.default,{style:{gap:10},testID:"clock-area-settings",children:[(0,k.jsx)(r.Muted,{size:13,children:p?'The address-matched pub centre is configured below. Only clock-in checks location; only pass/fail is saved. No background, clock-out or break checks. Change the radius or centre here; use a manager override for a refused check.':'Tip: stand in the middle of the venue and tap \u201cUse my current location\u201d. Clocking in, out and breaks then only work within the distance below. Rota and pay screens are never blocked.'}),P?null:(0,k.jsx)(r.Banner,{kind:"warn",title:"Clock-in area not set yet",children:"Until you set the centre, staff can clock in from anywhere."}),p?(0,k.jsx)(r.Muted,{children:"Clock-in at the pub is required. A manager can record an exception with a reason."}):(0,k.jsx)(r.Toggle,{testID:"clock-area-on",label:"Check people are at the venue",value:u.on,onChange:t=>h.set(e,{on:t},c)}),p?null:(0,k.jsx)(r.Button,{testID:"clock-area-here",label:v?'Finding you\u2026':'\ud83d\udccd Use my current location',disabled:v,onPress:()=>{B()}}),I?(0,k.jsx)(r.Muted,{size:13,children:I}):null,(0,k.jsxs)(r.Row,{wrap:!0,gap:8,children:[(0,k.jsxs)(a.default,{style:{gap:2},children:[(0,k.jsx)(r.Muted,{size:12,children:"Latitude"}),(0,k.jsx)(t.TextInput,{accessibilityLabel:"Latitude",testID:"clock-area-lat",value:f,onChangeText:j,onBlur:()=>R(f,y),placeholder:"55.40\u2026",placeholderTextColor:d.colours.muted,style:{...T,width:130}})]}),(0,k.jsxs)(a.default,{style:{gap:2},children:[(0,k.jsx)(r.Muted,{size:12,children:"Longitude"}),(0,k.jsx)(t.TextInput,{accessibilityLabel:"Longitude",testID:"clock-area-lng",value:y,onChangeText:w,onBlur:()=>R(f,y),placeholder:"-4.75\u2026",placeholderTextColor:d.colours.muted,style:{...T,width:130}})]})]}),P?(0,k.jsx)(l.default,{accessibilityRole:"link",testID:"clock-area-map",onPress:()=>{o.default.openURL(`https://www.openstreetmap.org/?mlat=${u.lat}&mlon=${u.lng}#map=18/${u.lat}/${u.lng}`)},children:(0,k.jsx)(r.T,{size:13,colour:d.colours.gold,children:"See the pin on a map \u203a"})}):null,(0,k.jsx)(r.T,{weight:"semibold",children:"How far from the centre"}),(0,k.jsxs)(r.Row,{gap:8,children:[(0,k.jsx)(r.Button,{small:!0,kind:"secondary",label:"\u2212",onPress:()=>h.set(e,{radius:(0,x.clampRadius)(u.radius-10)},c)}),(0,k.jsxs)(r.T,{weight:"semibold",style:{minWidth:70,textAlign:'center'},children:[u.radius," m"]}),(0,k.jsx)(r.Button,{small:!0,kind:"secondary",label:"+",onPress:()=>h.set(e,{radius:(0,x.clampRadius)(u.radius+10)},c)})]}),(0,k.jsxs)(r.Muted,{size:12,children:["At least ",x.MIN_RADIUS," m. Phones aren\u2019t exact, so up to 50 m of the phone\u2019s own accuracy is added on top."]}),(0,k.jsx)(r.T,{weight:"semibold",children:"Forgotten break: lengths to offer at clock-out"}),(0,k.jsx)(t.TextInput,{accessibilityLabel:"Break lengths in minutes",testID:"clock-break-options",value:L,onChangeText:D,onBlur:()=>{const t=L.split(/[ ,]+/).map(Number).filter(e=>Number.isFinite(e)&&e>0&&e<=180);t.length&&h.set(e,{breakOptions:[...new Set(t)].sort((e,t)=>e-t)},c),D((0,g.areaOf)(e).breakOptions.join(', '))},style:T}),(0,k.jsxs)(r.Muted,{size:12,children:["Minutes, e.g. 5, 10, 15, 20, 30, 45, 60. Shows as ",u.breakOptions.map(x.breakLabel).join(', ')," and \u201cNo break\u201d."]}),p?(0,k.jsx)(r.Muted,{children:"No automatic arrival checks: staff location is used only at clock-in."}):(0,k.jsxs)(k.Fragment,{children:[" ",(0,k.jsx)(r.T,{weight:"semibold",children:"Not on the rota"}),(0,k.jsx)(r.Toggle,{testID:"clock-offrota-on",label:"Ask people at the venue who aren\u2019t on the rota if they want to clock in",value:u.offRotaPrompt,onChange:t=>h.set(e,{offRotaPrompt:t},c)}),(0,k.jsx)(t.TextInput,{accessibilityLabel:"Off-rota question",testID:"clock-offrota-title",value:u.offRotaTitle,onChangeText:t=>h.set(e,{offRotaTitle:t||x.DEFAULT_CLOCK_AREA.offRotaTitle},c),style:T}),(0,k.jsx)(t.TextInput,{accessibilityLabel:"Off-rota second line",testID:"clock-offrota-body",value:u.offRotaBody,onChangeText:t=>h.set(e,{offRotaBody:t||x.DEFAULT_CLOCK_AREA.offRotaBody},c),style:T}),(0,k.jsx)(r.Muted,{size:12,children:"This only checks while the app is open (web apps can\u2019t watch location in the background; that would need a native app)."})]})]})},Object.defineProperty(_e,"resetClockArea",{enumerable:!0,get:function(){return P}}),Object.defineProperty(_e,"COOKSAFE_URL",{enumerable:!0,get:function(){return O}}),_e.FoodSafetyCard=function({children:e}){return(0,k.jsx)(r.Card,{children:(0,k.jsxs)(a.default,{testID:"food-safety",style:{gap:6},children:[(0,k.jsx)(r.T,{size:17,weight:"semibold",children:"Food safety"}),(0,k.jsxs)(r.T,{children:["Based on ",(0,k.jsx)(r.T,{weight:"bold",colour:d.colours.gold,children:"CookSafe"})," (Food Standards Scotland)"]}),(0,k.jsx)(r.Muted,{size:12,children:"CoverCharge is not endorsed by Food Standards Scotland."}),(0,k.jsx)(l.default,{accessibilityRole:"link",testID:"cooksafe-link",onPress:()=>{o.default.openURL(O)},children:(0,k.jsx)(r.T,{size:14,colour:d.colours.gold,children:"Open the CookSafe guidance \u203a"})}),(0,k.jsx)(r.Muted,{size:13,children:"Full logs coming in the next update."}),e]})})};var t=_r(_d[0]),s=_r(_d[1]),n=_r(_d[2]),o=e(_r(_d[3])),l=e(_r(_d[4])),a=e(_r(_d[5])),r=_r(_d[6]),d=_r(_d[7]),c=_r(_d[8]),u=_r(_d[9]),h=_r(_d[10]),p=_r(_d[11]),f=_r(_d[12]),g=_r(_d[13]),x=_r(_d[14]),b=_r(_d[15]),j=_r(_d[16]),y=_r(_d[17]),w=_r(_d[18]),k=_r(_d[19]);const T={minHeight:44,borderRadius:10,borderWidth:1,borderColor:d.colours.hairline,backgroundColor:d.colours.surface2,color:d.colours.text,paddingHorizontal:10,fontSize:15},v=[1,2,3,4,5,6,0],S=['on_shift','everyone','managers','head_chef','kitchen','foh'],I=e=>e.replace(' (example)',''),C={title:'',message:'',days:[3,4,5,6,0],time:'21:00',recipients:{staff:[],groups:[]},sendBy:{inApp:!0,push:!1}};function L({value:e,onChange:t}){const s=(0,h.useOwner)(e=>e.staff).filter(e=>e.active);return(0,k.jsxs)(a.default,{style:{gap:6},testID:"notif-recipients",children:[(0,k.jsx)(r.T,{weight:"semibold",children:"Who gets it"}),(0,k.jsx)(r.Muted,{size:12,children:"Tick people, or pick a group (groups follow the team as it changes)."}),(0,k.jsx)(r.Row,{wrap:!0,gap:6,children:S.map(s=>(0,k.jsx)(r.Chip,{testID:`notif-group-${s}`,label:u.NOTIF_GROUP_LABEL[s],selected:e.groups.includes(s),onPress:()=>t({...e,groups:e.groups.includes(s)?e.groups.filter(e=>e!==s):[...e.groups,s]})},s))}),(0,k.jsx)(r.Muted,{size:12,children:"Only people on shift when it goes, in:"}),(0,k.jsx)(r.Row,{wrap:!0,gap:6,children:Object.keys(u.SHIFT_FILTER_LABEL).map(s=>{const n=(e.onShiftIn??[]).includes(s);return(0,k.jsx)(r.Chip,{testID:`notif-onshift-${s}`,label:u.SHIFT_FILTER_LABEL[s],selected:n,onPress:()=>t({...e,onShiftIn:n?(e.onShiftIn??[]).filter(e=>e!==s):[...e.onShiftIn??[],s]})},s)})}),(0,k.jsx)(a.default,{style:{gap:2},children:s.map(s=>{const n=e.staff.includes(s.id);return(0,k.jsxs)(l.default,{testID:`notif-tick-${s.id}`,accessibilityRole:"checkbox",accessibilityState:{checked:n},onPress:()=>t({...e,staff:n?e.staff.filter(e=>e!==s.id):[...e.staff,s.id]}),style:{flexDirection:'row',alignItems:'center',gap:10,paddingVertical:6},children:[(0,k.jsx)(a.default,{style:{width:22,height:22,borderRadius:5,borderWidth:1.5,borderColor:d.colours.gold,alignItems:'center',justifyContent:'center',backgroundColor:n?'#2a2414':'transparent'},children:n?(0,k.jsx)(r.T,{size:14,colour:d.colours.gold,children:"\u2713"}):null}),(0,k.jsx)(r.T,{style:{flex:1},children:(0,h.staffLabel)({name:I(s.name),nickname:s.nickname})}),(0,k.jsx)(r.Muted,{size:12,children:'Head Chef'===s.level?'Head Chef':s.job})]},s.id)})}),(0,k.jsx)(r.Muted,{size:12,children:"If nobody above matches when it goes, send it to:"}),(0,k.jsxs)(r.Row,{wrap:!0,gap:6,children:[S.filter(e=>'on_shift'!==e).map(s=>{const n=e.fallback??{staff:[],groups:[]},o=n.groups.includes(s);return(0,k.jsx)(r.Chip,{testID:`notif-fallback-${s}`,label:u.NOTIF_GROUP_LABEL[s],selected:o,onPress:()=>{const l=o?n.groups.filter(e=>e!==s):[...n.groups,s];t({...e,fallback:l.length||n.staff.length?{...n,groups:l}:void 0})}},s)}),s.map(s=>{const n=e.fallback??{staff:[],groups:[]},o=n.staff.includes(s.id);return(0,k.jsx)(r.Chip,{testID:`notif-fallback-${s.id}`,label:I(s.name),selected:o,onPress:()=>{const l=o?n.staff.filter(e=>e!==s.id):[...n.staff,s.id];t({...e,fallback:l.length||n.groups.length?{...n,staff:l}:void 0})}},s.id)})]})]})}function D({init:e,onSave:s,onCancel:o}){const[l,c]=(0,n.useState)(e),[h,p]=(0,n.useState)(!!e.dayTimes&&Object.keys(e.dayTimes).length>0),f=(0,u.validateNotif)(l),g=e=>c(t=>({...t,...e}));return(0,k.jsxs)(a.default,{testID:"notif-editor",style:{gap:8,borderWidth:1,borderColor:d.colours.accentBorder,borderRadius:12,padding:10},children:[(0,k.jsx)(r.T,{weight:"semibold",children:"Title"}),(0,k.jsx)(t.TextInput,{accessibilityLabel:"Notification title",testID:"notif-title",value:l.title,onChangeText:e=>g({title:e}),maxLength:60,style:T}),(0,k.jsx)(r.T,{weight:"semibold",children:"Message"}),(0,k.jsx)(t.TextInput,{accessibilityLabel:"Notification message",testID:"notif-message",value:l.message,onChangeText:e=>g({message:e}),maxLength:160,style:T}),(0,k.jsx)(r.T,{weight:"semibold",children:"Days"}),(0,k.jsx)(r.Row,{wrap:!0,gap:6,children:v.map(e=>(0,k.jsx)(r.Chip,{testID:`notif-day-${e}`,label:u.NOTIF_DAY_NAMES[e],selected:l.days.includes(e),onPress:()=>g({days:l.days.includes(e)?l.days.filter(t=>t!==e):[...l.days,e]})},e))}),(0,k.jsxs)(r.Row,{gap:8,children:[(0,k.jsx)(r.T,{weight:"semibold",children:"Time (UK)"}),(0,k.jsx)(t.TextInput,{accessibilityLabel:"Time",testID:"notif-time",value:l.time,onChangeText:e=>g({time:e}),placeholder:"21:00",style:{...T,width:90,borderColor:(0,u.validHm)(l.time)?d.colours.hairline:d.colours.red}})]}),(0,k.jsx)(r.Toggle,{label:"A different time on some days",value:h,onChange:e=>{p(e),e||g({dayTimes:void 0})}}),h?(0,k.jsx)(r.Row,{wrap:!0,gap:8,children:v.filter(e=>l.days.includes(e)).map(e=>(0,k.jsxs)(r.Row,{gap:4,children:[(0,k.jsx)(r.T,{size:13,children:u.NOTIF_DAY_NAMES[e]}),(0,k.jsx)(t.TextInput,{accessibilityLabel:`${u.NOTIF_DAY_NAMES[e]} time`,testID:`notif-daytime-${e}`,value:l.dayTimes?.[String(e)]??'',placeholder:l.time,onChangeText:t=>{const s={...l.dayTimes??{}};t.trim()?s[String(e)]=t.trim():delete s[String(e)],g({dayTimes:s})},style:{...T,width:74}})]},e))}):null,(0,k.jsx)(L,{value:l.recipients,onChange:e=>g({recipients:e})}),(0,k.jsx)(r.T,{weight:"semibold",children:"Send by"}),(0,k.jsx)(r.Toggle,{testID:"notif-inapp",label:"In the app (gold slider, Done / Later)",value:l.sendBy.inApp,onChange:e=>g({sendBy:{...l.sendBy,inApp:e}})}),(0,k.jsx)(r.Toggle,{testID:"notif-push",label:"Phone notification (when phones are switched on)",value:l.sendBy.push,onChange:e=>g({sendBy:{...l.sendBy,push:e}})}),f?(0,k.jsx)(r.Muted,{size:13,children:f}):null,(0,k.jsxs)(r.Row,{gap:8,style:{justifyContent:'flex-end'},children:[(0,k.jsx)(r.Button,{small:!0,kind:"ghost",label:"Cancel",onPress:o}),(0,k.jsx)(r.Button,{small:!0,testID:"notif-save",label:"Save",disabled:!!f,onPress:()=>s({...l,title:l.title.trim(),message:l.message.trim(),days:[...l.days].sort()})})]})]})}function R(){const[e,t]=(0,n.useState)(null),[s,o]=(0,n.useState)('');return(0,n.useEffect)(()=>{(0,y.pushState)().then(t)},[]),e&&'unsupported'!==e?(0,k.jsxs)(a.default,{testID:"push-button",style:{gap:4},children:[(0,k.jsx)(r.Button,{small:!0,kind:'on'===e?'ghost':'secondary',testID:"push-turn-on",label:'on'===e?'Phone notifications are on for this phone \xb7 Turn off':'\ud83d\udd14 Turn on phone notifications',onPress:()=>{('on'===e?(0,y.turnOffPush)():(0,y.turnOnPush)()).then(e=>{o(e.message),(0,y.pushState)().then(t)})}}),(0,k.jsx)(r.Muted,{size:12,children:s||('ios-home-screen'===e?'iPhone: add this app to your Home Screen first (iOS 16.4 or later).':'For this phone only. Each person turns it on on their own phone.')})]}):null}const B=e=>p.useOrderLists.getState().resetSettings(e);const P=(e,t)=>g.useClockArea.getState().reset(e,t),O='https://www.foodstandards.gov.scot/publications-and-research/publications/cooksafe-manual'},1043,[796,991,34,379,402,102,794,840,1021,1022,865,1025,1026,1027,992,1044,985,1045,994,25]); __d(function(_g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.getFix=function(e=1e4){const t='undefined'!=typeof navigator?navigator.geolocation:void 0;return t?new Promise(o=>{let n=!1;const c=e=>{n||(n=!0,o(e))},u=setTimeout(()=>c('timeout'),e+1500);try{t.getCurrentPosition(e=>{clearTimeout(u),c({lat:e.coords.latitude,lng:e.coords.longitude,acc:e.coords.accuracy??999})},e=>{clearTimeout(u),c(1===e.code?'denied':3===e.code?'timeout':'unavailable')},{enableHighAccuracy:!0,timeout:e,maximumAge:0})}catch{clearTimeout(u),c('unsupported')}}):Promise.resolve('unsupported')},_e.locationAllowed=async function(){try{const e=await(navigator.permissions?.query({name:'geolocation'}));return'granted'===e?.state}catch{return!1}}},1044,[]); __d(function(g,r,_i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.pushState=f,e.turnOnPush=async function(){const u=await f();if('ios-home-screen'===u)return{ok:!1,message:'On iPhone, add this app to your Home Screen first (Share \u203a Add to Home Screen, iOS 16.4 or later), then open it from there.'};if('unsupported'===u)return{ok:!1,message:'This browser can\u2019t get phone notifications. Try Chrome on Android, or the app from your iPhone Home Screen.'};if('blocked'===u)return{ok:!1,message:'Notifications are blocked for this app. Allow them in your phone\u2019s settings, then try again.'};const c=i.useSync.getState();if('staff'!==c.kind||!c.venueId||!c.staffRef)return{ok:!1,message:'Sign in from your personal link first.'};if('granted'!==await Notification.requestPermission())return{ok:!1,message:'You didn\u2019t allow notifications, so nothing changed.'};const p=await navigator.serviceWorker.ready,h=(await p.pushManager.getSubscription()??await p.pushManager.subscribe({userVisibleOnly:!0,applicationServerKey:s(n.VAPID_PUBLIC_KEY)})).toJSON();if(!h.endpoint||!h.keys?.p256dh||!h.keys?.auth)return{ok:!1,message:'Your browser didn\u2019t give a usable subscription. Try again.'};const l=(0,t.getSupabase)(),{error:y}=await l.from('push_subscriptions').upsert({venue_id:c.venueId,staff_ref:c.staffRef,app:o.APP_VARIANT,endpoint:h.endpoint,p256dh:h.keys.p256dh,auth:h.keys.auth,user_agent:navigator.userAgent.slice(0,200)},{onConflict:'user_id,endpoint'});return y?{ok:!1,message:`Couldn\u2019t save this phone: ${y.message}`}:{ok:!0,message:'Phone notifications are on for this device.'}},e.turnOffPush=async function(){const n=await(navigator.serviceWorker?.getRegistration()),i=await(n?.pushManager.getSubscription());if(!i)return{ok:!0,message:'Phone notifications are off for this device.'};const o=i.endpoint;await i.unsubscribe();try{const n=(0,t.getSupabase)();await n.from('push_subscriptions').delete().eq('endpoint',o)}catch{}return{ok:!0,message:'Phone notifications are off for this device.'}};var n=r(d[0]),t=r(d[1]),i=r(d[2]),o=r(d[3]);const s=n=>{const t=atob(n.replace(/-/g,'+').replace(/_/g,'/')+'='.repeat((4-n.length%4)%4)),i=new Uint8Array(t.length);for(let n=0;n'undefined'!=typeof navigator&&/iPhone|iPad|iPod/.test(navigator.userAgent),c=()=>'undefined'!=typeof window&&(window.matchMedia?.('(display-mode: standalone)').matches||!0===navigator.standalone);async function f(){if('undefined'==typeof window||!('serviceWorker'in navigator))return'unsupported';if(!('PushManager'in window)||'undefined'==typeof Notification)return u()&&!c()?'ios-home-screen':'unsupported';if('denied'===Notification.permission)return'blocked';const n=await navigator.serviceWorker.getRegistration();return await(n?.pushManager.getSubscription())?'on':'off'}},1045,[1046,931,985,846]); @@ -1191,11 +1191,11 @@ __d(function(g,r,i,_a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule' __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 v}}),Object.defineProperty(_e,"fitLabel",{enumerable:!0,get:function(){return M}}),Object.defineProperty(_e,"BIG_LABEL_MIN",{enumerable:!0,get:function(){return j}}),_e.areaBounds=k,_e.minReadableScale=function(e,t){return Math.max(0,...e.tables.filter(e=>e.areaId===t).map(e=>{const t='round'===e.shape?.85:1,o=(7.4399999999999995*Math.max(1,(0,x.tableNumber)(e).length)+6)/(e.w*t),n=22/Math.min(e.w,e.h);return Math.max(o,n)}))},_e.seatSpots=S,_e.FixtureShape=R,_e.FloorCanvas=function(e){const[C,$]=(0,r.useState)({w:0,h:0}),I=e.plan.tables.filter(t=>t.areaId===e.areaId),A=e.crop&&I.length?k(e.plan,e.areaId):{x:0,y:0,w:l.PLAN_W,h:l.PLAN_H},z='live'===e.mode?[...new Map(I.flatMap(t=>{const o=e.view?.[t.name];if(!o?.group||o.group.length<2)return[];const n=[...o.group].sort().join('+');return[[n,{key:n,members:o.group,view:o}]]})).values()]:[],L=28*z.length,E={x:A.x,y:A.y,r:A.x+A.w,b:A.y+A.h},D=C.w?'width'===e.fit?Math.min(C.w/l.PLAN_W,e.maxH?e.maxH/l.PLAN_H:9):Math.min(C.w/A.w,Math.max(1,C.h-L)/A.h):0,F=e.fill&&'contain'===e.fit&&D>0&&C.h>0,_=F?(C.w/D-A.w)/2:0,O=F?((C.h-L)/D-A.h)/2:0,N={x:E.x-_,y:E.y-O,r:E.r+_,b:E.b+O},B=N.r-N.x,P=N.b-N.y,[W,H]=(0,r.useState)(null),G=(0,r.useRef)(null),[Y,X]=(0,r.useState)(null),U=(0,r.useRef)(null);U.current=Y,i.default.useEffect(()=>{if(!Y)return;const e=setTimeout(()=>X(null),n.ARM_MS);return()=>clearTimeout(e)},[Y]);const q='live'===e.mode&&!!e.onDrop,J=e=>!q||(0,n.isArmed)(U.current,e.id,Date.now()),K=t=>e.plan.sections.find(e=>e.id===t.sectionId),V=t=>e.plan.joins.find(e=>e.tables.includes(t.name)),Q=i.default.useMemo(()=>(0,x.numberClashes)(e.plan.tables).sameArea,[e.plan.tables]),Z=(t,o)=>({onStartShouldSetResponder:()=>!0,onMoveShouldSetResponder:()=>J(t),onResponderTerminationRequest:()=>!J(t),onResponderGrant:e=>{G.current={x:e.nativeEvent.pageX,y:e.nativeEvent.pageY,id:t.id,kind:o}},onResponderMove:n=>{const r=G.current;if(!r)return;const i=n.nativeEvent.pageX-r.x,s=n.nativeEvent.pageY-r.y;Math.abs(i)+Math.abs(s)<6&&!W||J(t)&&('live'!==e.mode||e.onDrop&&e.view&&['seated','mains','dessert','bill'].includes(e.view[t.name]?.status)&&e.view[t.name]?.booking)&&H({id:t.id,dx:i,dy:s,kind:o})},onResponderRelease:r=>{const i=G.current;G.current=null;const a=r.nativeEvent.pageX-(i?.x??0),u=r.nativeEvent.pageY-(i?.y??0);if(H(null),Math.abs(a)+Math.abs(u)<6||!D){if('move'===o){if(q){const e=(0,n.releaseOn)(U.current,t.id,!1,Date.now());if(X(e.arm),'select'===e.action)try{s.default.announceForAccessibility(n.SELECTED_A11Y)}catch{}}e.onTap?.(t)}return}if(q){const e=(0,n.releaseOn)(U.current,t.id,!0,Date.now());if(X(e.arm),'move'!==e.action)return}const h=a/D,c=u/D;if('edit'===e.mode&&'move'===o)e.onMove?.(t,w(v(t.x+h,e.snapOn),0,l.PLAN_W-t.w),w(v(t.y+c,e.snapOn),0,l.PLAN_H-t.h));else if('edit'===e.mode&&'resize'===o)e.onResize?.(t,w(v(t.w+h,e.snapOn),50,400),w(v(t.h+c,e.snapOn),50,300));else if('live'===e.mode&&e.onDrop){const o=t.x+t.w/2+h,n=t.y+t.h/2+c,r=I.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);r&&e.onDrop(t,r)}}}),ee=e=>e*D,te=e=>ee(e-N.x),oe=e=>ee(e-N.y),ne='width'===e.fit?l.PLAN_H*D+L||200:void 0;return(0,g.jsxs)(a.default,{testID:"floor-canvas",onLayout:e=>$({w:e.nativeEvent.layout.width,h:e.nativeEvent.layout.height}),style:[{width:'100%',borderRadius:16,overflow:'hidden'},'contain'===e.fit?{flex:1}:{height:ne}],children:[z.map(e=>{const o=I.filter(t=>e.members.includes(t.name)),n=o.length?(Math.min(...o.map(e=>e.x))+Math.max(...o.map(e=>e.x+e.w)))/2:N.x+B/2,r=e.view.booking?.time??e.view.next?.time,i=`${T(e.members)}${r?` \xb7 ${'seated'===e.view.status?'Seated':'Booked'} ${r}`:''}`,s=Math.min(Math.max(0,C.w-8),260);return(0,g.jsx)(a.default,{testID:`joined-label-${e.key}`,accessible:!0,accessibilityLabel:`Joined tables ${i}`,pointerEvents:"none",style:{height:28,width:s,marginLeft:w(ee(n-N.x)-s/2,4,Math.max(4,C.w-s-4)),alignItems:'center',justifyContent:'center',overflow:'hidden',borderRadius:8,borderWidth:1,borderColor:h.colours.gold,backgroundColor:(0,t.soutersSurface)('#0B0B0B')},children:(0,g.jsx)(c.T,{size:16,weight:"bold",colour:h.colours.goldLight,center:!0,numberOfLines:1,children:i})},e.key)}),D?(0,g.jsx)(a.default,{style:{width:ee(B),height:ee(P),alignSelf:'center',backgroundColor:(0,t.soutersSurface)('#0F0E0C'),borderRadius:16,borderWidth:1,borderColor:h.colours.border,overflow:'hidden'},children:(0,g.jsxs)(a.default,{style:{position:'absolute',left:0,top:0,width:ee(B),height:ee(P)},children:['edit'===e.mode?Array.from({length:l.PLAN_W/(2*l.GRID)},(e,o)=>(0,g.jsx)(a.default,{style:{position:'absolute',left:te(o*l.GRID*2),top:0,bottom:0,width:1,backgroundColor:(0,t.soutersSurface)('#1E1B16')}},`v${o}`)):null,'edit'===e.mode?Array.from({length:l.PLAN_H/(2*l.GRID)},(e,o)=>(0,g.jsx)(a.default,{style:{position:'absolute',top:oe(o*l.GRID*2),left:0,right:0,height:1,backgroundColor:(0,t.soutersSurface)('#1E1B16')}},`h${o}`)):null,(e.plan.fixtures??[]).filter(t=>t.areaId===e.areaId).map(t=>(0,g.jsx)(R,{f:{...t,x:t.x-N.x,y:t.y-N.y},S:ee,live:'live'===e.mode},t.id)),e.plan.joins.map(e=>{const t=I.filter(t=>e.tables.includes(t.name));if(t.length<2)return null;const[o,n]=t,r=o.x+o.w/2,i=o.y+o.h/2,s=n.x+n.w/2,l=n.y+n.h/2,u=Math.hypot(s-r,l-i),h=Math.atan2(l-i,s-r);return(0,g.jsx)(a.default,{testID:`join-${e.tables.join('+')}`,style:{position:'absolute',left:te((r+s)/2-u/2),top:oe((i+l)/2)-3,width:ee(u),height:6,borderRadius:3,backgroundColor:'rgba(207,164,95,0.55)',transform:[{rotate:`${h}rad`}]}},e.id)}),I.map(n=>{const r=e.view?.[n.name],s=r?u.STATUS[r.status]:u.STATUS.free,v=W?.id===n.id,w=v&&'resize'===W.kind?Math.max(50,n.w+W.dx/D):n.w,C=v&&'resize'===W.kind?Math.max(50,n.h+W.dy/D):n.h,k=v&&'move'===W.kind?n.x+W.dx/D:n.x,R=v&&'move'===W.kind?n.y+W.dy/D:n.y,T=e.selected===n.id||e.highlight?.includes(n.name)||Y?.id===n.id,$=K(n),I='edit'===e.mode?'#2A2419':s.colour,A='edit'===e.mode?h.colours.text:s.fg,z='round'===n.shape?ee(Math.min(w,C))/2:ee(10),L='live'===e.mode?(0,x.liveTableLabel)(n,Q):(0,l.tableLabel)(n),E=ee(Math.min(w,C))<64,F=M(e.big?Math.max(13,Math.min(34,ee(Math.min(w,C))/3)):Math.max(11,Math.min(22,ee(Math.min(w,C))/4)),L,ee(w)*('round'===n.shape?.85:1),e.big?j:9),_=Math.max(e.big?11:12,Math.round(.62*F)),O=(ee(C)-6-1.4*F)/(1.4*_),N=O>=2&&ee(w)>=5*_?2:O>=1?1:0,B=r?.booking&&void 0!==r.seatedMins?r.booking.time:void 0,P='soon'===r?.status?r.next?.time??r.dayBookings?.[0]?.time:void 0,H='edit'===e.mode?`Table ${(0,o.tableNumbers)(L)}, ${(0,l.shapeLabel)(n.shape).toLowerCase()}, ${n.minSeats}\u2013${n.maxSeats} seats${n.online?', bookable online':''}`:'soon'===r?.status?`Table ${(0,o.tableNumbers)(L)}, booked later${P?`, ${P}`:''}${r.group?`, combined with ${r.group.filter(e=>e!==n.name).map(e=>`table ${e}`).join(', ')}`:''}`:`Table ${(0,o.tableNumbers)(L)}, ${s.label}${void 0!==r?.seatedMins?`, seated ${r.seatedMins} min`:''}${r?.covers?`, ${r.covers} Covers`:''}${r?.dayBookings?.length?`, booked: ${r.dayBookings.map(e=>`${e.time}, ${e.partySize} Covers`).join('; ')}`:''}${r?.group?`, combined with ${r.group.filter(e=>e!==n.name).map(e=>`table ${e}`).join(', ')}`:''}`,G=void 0!==r?.seatedMins&&r.booking?Math.min(1.2,r.seatedMins/(r.booking.durationMins??(0,u.turnFor)(r.booking.partySize,e.turnBase))):null;return(0,g.jsxs)(i.default.Fragment,{children:[S({...n,w:w,h:C}).map((t,o)=>(0,g.jsx)(a.default,{pointerEvents:"none",style:[{position:'absolute',left:te(k+t.x)-Math.max(4,ee(8)),top:oe(R+t.y)-Math.max(4,ee(8)),width:Math.max(8,ee(16)),height:Math.max(8,ee(16)),borderRadius:99,backgroundColor:'edit'===e.mode?'#5A4C33':'rgba(255,255,255,0.16)',borderWidth:1,borderColor:'edit'===e.mode?h.colours.gold:'rgba(255,255,255,0.25)'},y()]},o)),'live'===e.mode&&(ee(w)<44||ee(C)<44)?(0,g.jsx)(a.default,{accessible:!1,importantForAccessibility:"no-hide-descendants",'aria-hidden':!0,...Z(n,'move'),style:{position:'absolute',left:te(k+w/2)-Math.max(44,ee(w))/2,top:oe(R+C/2)-Math.max(44,ee(C))/2,width:Math.max(44,ee(w)),height:Math.max(44,ee(C)),zIndex:2}}):null,(0,g.jsxs)(a.default,{testID:`table-${n.name}`,accessibilityRole:"button",accessibilityLabel:H,onAccessibilityTap:()=>e.onTap?.(n),onKeyDown:t=>{'Enter'!==t?.key&&' '!==t?.key||e.onTap?.(n)},tabIndex:0,...Z(n,'move'),style:[{position:'absolute',left:te(k),top:oe(R),width:ee(w),height:ee(C),borderRadius:z,backgroundColor:I,alignItems:'center',justifyContent:'center',padding:2,overflow:'hidden',borderWidth:T?3:e.sectionColours&&$?2.5:1.5,borderColor:T?'#FFFFFF':e.sectionColours&&$?(0,h.brandColour)($.colour):'edit'===e.mode?h.colours.gold:'rgba(0,0,0,0.35)',transform:[{scale:v?1.06:1}],zIndex:v?50:3,opacity:v&&'live'===e.mode?.85:1,shadowColor:'#000',shadowOpacity:v?.6:.3,shadowRadius:v?14:6,cursor:'edit'===e.mode?'grab':'pointer',touchAction:'none'},v?null:y()],children:[(0,g.jsxs)(a.default,{style:{alignItems:'center',justifyContent:'center',maxWidth:'100%',maxHeight:'100%',overflow:'hidden'},pointerEvents:"none",children:[(0,g.jsx)(c.T,{style:p,weight:"bold",size:F,colour:A,center:!0,numberOfLines:1,children:L}),'live'===e.mode&&'blocked'===r?.status?(0,g.jsx)(c.T,{style:f,size:Math.max(10,Math.round(.5*F)),weight:"semibold",colour:A,center:!0,numberOfLines:1,children:"Blocked"}):null,'live'===e.mode&&r?.group&&r.group.length>1?null:e.big&&'live'===e.mode&&r&&1===N?'free'!==r.status&&'soon'!==r.status&&(r.covers||B)?(0,g.jsx)(c.T,{style:f,size:_,weight:"bold",colour:A,center:!0,numberOfLines:1,children:[r.covers?`${r.covers}`:'',B??''].filter(Boolean).join(' \xb7 ')}):null:e.big&&'live'===e.mode&&r&&2===N?(0,g.jsxs)(g.Fragment,{children:['soon'!==r.status&&r.covers?(0,g.jsxs)(c.T,{style:f,size:_,weight:"semibold",colour:A,center:!0,children:[r.covers," ",1===r.covers?'Cover':'Covers']}):'free'!==r.status||E?null:(0,g.jsxs)(c.T,{style:f,size:_,colour:A,center:!0,children:[n.minSeats,"\u2013",n.maxSeats]}),'free'!==r.status&&'soon'!==r.status&&B?(0,g.jsx)(c.T,{style:f,size:_,weight:"bold",colour:A,center:!0,children:B}):'dirty'===r.status?(0,g.jsx)(c.T,{style:f,size:_,colour:A,center:!0,children:"Clear"}):null]}):e.big&&'live'===e.mode?null:'edit'===e.mode?E?null:(0,g.jsxs)(c.T,{style:f,size:11,colour:h.colours.muted,center:!0,children:[n.minSeats,"\u2013",n.maxSeats,n.online?' \xb7 online':'']}):r?(0,g.jsxs)(g.Fragment,{children:['free'!==r.status||E?null:(0,g.jsxs)(c.T,{style:f,size:11,colour:A,center:!0,children:[n.minSeats,"\u2013",n.maxSeats," seats"]}),void 0!==r.seatedMins?(0,g.jsxs)(c.T,{style:f,size:12,weight:"semibold",colour:A,center:!0,children:[r.seatedMins,"m \xb7 ",r.covers,"\ud83d\udc65"]}):r.orderOnly?(0,g.jsx)(c.T,{style:f,size:11,colour:A,center:!0,children:"Open order"}):null,'dirty'!==r.status||E?null:(0,g.jsx)(c.T,{style:f,size:11,colour:A,center:!0,children:"Clear"}),!E||r.allergy||r.vip?(0,g.jsxs)(c.T,{style:f,size:11,colour:A,center:!0,children:[r.allergy?'\u26a0':'',r.vip?'VIP'===r.vip?'\u2605':'\u2665':'',r.occasion?u.OCCASION_ICON[r.occasion]:'',r.note?'\u270e':'']}):null]}):null]}),null,'live'===e.mode&&r&&!E&&(r.booking??r.next)&&(0,b.needsIcons)(r.booking??r.next).replace('\u26a0\ufe0f','').trim()?(0,g.jsx)(a.default,{pointerEvents:"none",testID:`needs-${n.name}`,style:{position:'absolute',bottom:e.big?-Math.max(9,.55*_):2,right:e.big?-6:4,backgroundColor:(0,t.soutersSurface)('rgba(11,11,11,0.85)'),borderRadius:8,paddingHorizontal:4,borderWidth:1,borderColor:'rgba(255,255,255,0.15)'},children:(0,g.jsx)(c.T,{size:e.big?Math.max(11,.75*_):10,children:(0,b.needsIcons)(r.booking??r.next).replace('\u26a0\ufe0f','').trim()})}):null,$&&'live'===e.mode&&e.sectionColours&&!E&&!e.big?(0,g.jsx)(a.default,{pointerEvents:"none",style:{position:'absolute',top:3,right:6,backgroundColor:(0,h.brandColour)($.colour),borderRadius:6,paddingHorizontal:3},children:(0,g.jsx)(c.T,{size:9,weight:"bold",colour:"#0B0B0B",children:$.server})}):null,null===G||E?null:(0,g.jsx)(a.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,g.jsx)(a.default,{style:{width:`${Math.min(100,100*G)}%`,height:4,borderRadius:2,backgroundColor:G>=1?'#B3261E':'rgba(0,0,0,0.6)'}})}),V(n)&&'edit'===e.mode?(0,g.jsx)(a.default,{pointerEvents:"none",style:{position:'absolute',bottom:2,left:4},children:(0,g.jsx)(c.T,{size:10,colour:h.colours.gold,children:"\u26d3"})}):null]}),'edit'===e.mode&&e.selected===n.id?(0,g.jsx)(a.default,{testID:"resize-handle",accessibilityLabel:"Resize table",...Z(n,'resize'),style:{position:'absolute',left:te(k+w)-14,top:oe(R+C)-14,width:28,height:28,borderRadius:14,backgroundColor:h.colours.gold,borderWidth:2,borderColor:'#fff',zIndex:60,cursor:'nwse-resize',touchAction:'none'}}):null]},n.id)}),0===I.length?(0,g.jsx)(a.default,{style:{position:'absolute',left:0,right:0,top:'45%'},children:(0,g.jsxs)(c.T,{center:!0,colour:h.colours.muted,children:["No tables in this area yet",'edit'===e.mode?' \u2014 add some in Tables':'',"."]})}):null]})}):null]})};var t=_r(d[0]),o=_r(d[1]),n=_r(d[2]),r=_r(d[3]),i=e(r),s=e(_r(d[4]));_r(d[5]);var a=e(_r(d[6])),l=_r(d[7]),u=_r(d[8]),h=_r(d[9]),c=_r(d[10]),b=_r(d[11]),x=_r(d[12]),g=_r(d[13]);const f={flexShrink:0},p={flexShrink:0,maxWidth:'none'},y=(e=250)=>({transitionProperty:'background-color, border-color, transform, left, top, width, height',transitionDuration:`${e}ms`}),v=(e,t=!0)=>t?Math.round(e/l.GRID)*l.GRID:Math.round(e),w=(e,t,o)=>Math.max(t,Math.min(o,e)),M=(e,t,o,n=9)=>Math.max(n,Math.min(e,(o-6)/(.62*Math.max(1,t.length)))),j=12,C=46;function k(e,t){const o=e.tables.filter(e=>e.areaId===t);if(!o.length)return{x:0,y:0,w:l.PLAN_W,h:l.PLAN_H};const n=Math.max(0,Math.min(...o.map(e=>e.x))-C),r=Math.max(0,Math.min(...o.map(e=>e.y))-C);return{x:n,y:r,w:Math.min(l.PLAN_W,Math.max(...o.map(e=>e.x+e.w))+C)-n,h:Math.min(l.PLAN_H,Math.max(...o.map(e=>e.y+e.h))+C)-r}}function S(e){const t=Math.max(1,e.maxSeats),o=[];if('round'===e.shape){const n=e.w/2+9.6,r=e.h/2+9.6;for(let i=0;ie.w,r=Math.ceil(t/2),i=t-r;if(n){for(let t=0;te.w,s=n?{borderColor:'#FFFFFF',borderWidth:2}:null;return'bar'===e.kind?(0,g.jsx)(a.default,{pointerEvents:"none",style:[r,{backgroundColor:o?'#2A2216':'#3A2E1C',borderRadius:8,borderWidth:1.5,borderColor:o?'#5A4A30':h.colours.gold},s],children:(0,g.jsx)(c.T,{size:Math.max(9,Math.min(14,t(e.h)/2.4)),weight:"semibold",colour:h.colours.goldLight,children:"BAR"})}):'wall'===e.kind?(0,g.jsx)(a.default,{pointerEvents:"none",style:[r,{backgroundColor:o?'#3A3631':'#5C574F',borderRadius:2},s]}):'window'===e.kind?(0,g.jsx)(a.default,{pointerEvents:"none",style:[r,{backgroundColor:'rgba(226,196,137,0.16)',borderColor:'rgba(226,196,137,0.6)',borderWidth:1,borderRadius:2},s],children:!o&&t(i?e.h:e.w)>60?(0,g.jsx)(c.T,{size:9,colour:"#BFDDFF",style:i?{transform:[{rotate:'90deg'}]}:void 0,children:"WINDOW"}):null}):(0,g.jsx)(a.default,{pointerEvents:"none",style:[r,{borderColor:o?'#7A6440':h.colours.gold,borderWidth:1.5,borderStyle:'dashed',borderRadius:3,backgroundColor:'rgba(207,164,95,0.08)'},s],children:t(i?e.h:e.w)>40?(0,g.jsx)(c.T,{size:9,colour:h.colours.goldLight,style:i?{transform:[{rotate:'90deg'}]}:void 0,children:"DOOR"}):null})}function T(e){return(0,l.tablesLabel)(e.join('+')).replace(/^Tables? /,'').replace(/ \+ /g,'+')}},1108,[798,829,1109,34,281,236,102,1014,1079,840,794,1081,828,25]); __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"ARM_MS",{enumerable:!0,get:function(){return t}}),Object.defineProperty(e,"SELECT_HINT",{enumerable:!0,get:function(){return n}}),Object.defineProperty(e,"SELECTED_A11Y",{enumerable:!0,get:function(){return o}}),Object.defineProperty(e,"TABLE_SELECT_HINT",{enumerable:!0,get:function(){return c}}),Object.defineProperty(e,"isArmed",{enumerable:!0,get:function(){return l}}),e.releaseOn=function(n,o,c,u){const b=l(n,o,u);return c?b?{arm:null,action:'move'}:{arm:n&&u-n.at!!n&&n.id===o&&c-n.at!e.signOff),S=k.filter(e=>e.signOff),_=j.map(o.allergenLabel).join(', '),C=e=>e.map(e=>e.name).join(', ')||'none';return(0,f.jsxs)(l.default,{testID:"menu-allergy-check",style:{gap:6,borderWidth:1,borderColor:p.length?h.colours.red:h.colours.border,borderRadius:12,padding:10,backgroundColor:h.colours.surface2},children:[(0,f.jsxs)(u.T,{weight:"semibold",children:["Allergy check against the menu (",_,")"]}),(0,f.jsxs)(u.T,{size:14,colour:h.colours.red,children:["Contains: ",p.length," dish",1===p.length?'':'es']}),(0,f.jsxs)(u.T,{size:14,colour:h.colours.amber,children:["May contain: ",M.length]}),(0,f.jsxs)(u.T,{size:14,colour:h.colours.ok,children:["Free from ",1===j.length?'it':'them'," (signed off): ",S.length]}),w.length?(0,f.jsxs)(u.Muted,{children:[w.length," more awaiting the head chef's sign-off, so not shown as safe."]}):null,(0,f.jsx)(n.default,{testID:"menu-allergy-details",accessibilityRole:"button",onPress:()=>y(!x),hitSlop:6,children:(0,f.jsx)(u.T,{size:14,colour:h.colours.gold,children:x?'Hide dishes':'Show dishes'})}),x?(0,f.jsxs)(l.default,{style:{gap:4},children:[(0,f.jsxs)(u.Muted,{children:["Contains: ",C(p)]}),(0,f.jsxs)(u.Muted,{children:["May contain: ",C(M)]}),(0,f.jsxs)(u.Muted,{children:["Free from: ",C(S)]})]}):null,(0,f.jsx)(u.Muted,{children:'guest'===m?'From the kitchen\u2019s signed-off recipe cards. Specials on the board are checked by staff on the day.':'From the signed-off recipe cards. Specials on the board have their own allergens. Still check with the guest and the kitchen.'})]})};var s=r(d[0]),n=e(r(d[1])),l=e(r(d[2])),t=r(d[3]),o=r(d[4]),c=r(d[5]),h=r(d[6]),u=r(d[7]),f=r(d[8])},1110,[34,402,102,848,830,832,840,794,25]); -__d(function(g,r,i,a,m,e,_d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"NOTES_PLACEHOLDER",{enumerable:!0,get:function(){return o}}),Object.defineProperty(e,"WIX_EDIT_NOTE",{enumerable:!0,get:function(){return s}}),e.canEditBooking=function(t){return'customer'!==t.variant&&('staff'===t.variant||t.inStaffApp?!!t.shiftManager:'display'===t.variant||'chef'===t.variant||'staff'!==t.role)},Object.defineProperty(e,"isWixBooking",{enumerable:!0,get:function(){return l}}),Object.defineProperty(e,"EDIT_FIELDS",{enumerable:!0,get:function(){return d}}),Object.defineProperty(e,"FIELD_WORDS",{enumerable:!0,get:function(){return c}}),Object.defineProperty(e,"draftOf",{enumerable:!0,get:function(){return u}}),e.changedFields=p,e.editPatch=function(n,o,s,l=(new Date).toISOString()){const d=p(n,o);if(!d.length)return{};const c={};for(const n of d){const s=f(n,o[n]);c[n]='partySize'===n?(0,t.clampParty)(s):'phone'===n||'email'===n||'table'===n?s||void 0:s}d.includes('table')&&(c.tableSetHere=!0);const u=n;return c.locallyEdited=!0,c.editedFields=[...new Set([...u.editedFields??[],...d])],c.editLog=[...u.editLog??[],{at:l,by:s.by.slice(0,80),app:s.app,fields:d}].slice(-50),c},e.editWarnings=function(t,o,s,l,d=90){const c=[],u={...t,date:o.date,time:o.time,partySize:o.partySize};if(o.table){const t=(0,n.tableOverlaps)(u,o.table,s.filter(t=>t.date===o.date),d);t.length&&c.push(`The table already has a booking at about the same time: ${t.map(t=>`${t.time} ${t.walkIn?'walk-in':t.name}`).join(', ')}.`)}l&&c.push(`Bookings are paused ${l.from} to ${l.to}${l.reason?` (${l.reason})`:''}.`);return c},Object.defineProperty(e,"editedWords",{enumerable:!0,get:function(){return b}});var t=r(_d[0]),n=r(_d[1]);const o='For example: birthday, high chair, dog, window seat',s='This booking came from the website. Changes here are not sent to website bookings yet.';const l=t=>{const n=t;return'Wix'===n.importedFrom||!!n.wix||(t.tags??[]).includes('Wix')},d=['date','time','partySize','name','phone','email','notes','table'],c={date:'date',time:'time',partySize:'covers',name:'name',phone:'phone',email:'email',notes:'notes',table:'table'},u=t=>({date:t.date,time:t.time,partySize:t.partySize,name:t.name,phone:t.phone??'',email:t.email??'',notes:t.notes??'',table:t.table??''}),f=(t,n)=>'partySize'===t?Number(n):String(n??'').trim();function p(t,n){const o=u(t);return d.filter(t=>f(t,o[t])!==f(t,n[t]))}const b=t=>t.map(t=>c[t]).join(', ')},1111,[1098,1092]); +__d(function(g,r,i,_a,m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"NOTES_PLACEHOLDER",{enumerable:!0,get:function(){return a}}),Object.defineProperty(_e,"WIX_EDIT_NOTE",{enumerable:!0,get:function(){return s}}),Object.defineProperty(_e,"NOTIFY_LABEL",{enumerable:!0,get:function(){return o}}),Object.defineProperty(_e,"guestMessageFields",{enumerable:!0,get:function(){return n}}),_e.canEditBooking=function(e){return'customer'!==e.variant&&('staff'===e.variant||e.inStaffApp?!!e.shiftManager:'display'===e.variant||'chef'===e.variant||'staff'!==e.role)},Object.defineProperty(_e,"isWixBooking",{enumerable:!0,get:function(){return d}}),Object.defineProperty(_e,"EDIT_FIELDS",{enumerable:!0,get:function(){return c}}),Object.defineProperty(_e,"DEPOSIT_METHODS",{enumerable:!0,get:function(){return u}}),Object.defineProperty(_e,"EDIT_STATUSES",{enumerable:!0,get:function(){return l}}),Object.defineProperty(_e,"SOURCES",{enumerable:!0,get:function(){return h}}),Object.defineProperty(_e,"OCCASIONS",{enumerable:!0,get:function(){return p}}),Object.defineProperty(_e,"TAGS",{enumerable:!0,get:function(){return b}}),Object.defineProperty(_e,"FIELD_WORDS",{enumerable:!0,get:function(){return f}}),Object.defineProperty(_e,"draftOf",{enumerable:!0,get:function(){return y}}),_e.changedFields=N,_e.historyText=k,_e.editPatch=function(t,a,s,o=(new Date).toISOString()){const n=N(t,a);if(!n.length)return{};const d={};for(const c of n)switch(c){case'partySize':d.partySize=(0,e.clampParty)(Number(a.partySize));break;case'phone':case'email':case'table':d[c]=String(a[c]??'').trim()||void 0;break;case'date':case'time':case'name':case'notes':d[c]=String(a[c]??'').trim();break;case'area':d.area=(a.area??'').trim()||void 0;break;case'dogs':d.dogs=Math.max(0,Number(a.dogs??0)),d.dog=Number(a.dogs??0)>0;break;case'highChairs':d.highChairs=Math.max(0,Number(a.highChairs??0))||void 0;break;case'wheelchair':d.access={...t.access??{},wheelchair:Math.max(0,Number(a.wheelchair??0))||void 0};break;case'occasion':d.occasion=a.occasion||void 0;break;case'allergies':d.allergies=[...a.allergies??[]],d.allergyNone=!!a.allergyNone&&!(a.allergies??[]).length,d.allergyNote=(a.allergyNote??'').trim()||void 0,(a.allergies??[]).length||(d.allergyAck=void 0);break;case'diet':d.diet={vegan:Number(a.vegan??0)||void 0,vegetarian:Number(a.vegetarian??0)||void 0};break;case'deposit':if(!a.depositOn){Object.assign(d,{security:'none',depositDue:0,depositPaid:0,depositPaidBy:void 0,depositPaidAt:void 0,depositMethod:void 0});break}if(d.security='deposit',d.depositDue=Math.max(0,Math.round(Number(a.depositDue??0))),a.depositPaid){const e=/^\d{4}-\d{2}-\d{2}$/.test(a.depositDate??'')?a.depositDate:o.slice(0,10);Object.assign(d,{depositPaid:Math.max(0,Math.round(Number(a.depositAmount??0))),depositPaidBy:s.by.slice(0,80),depositPaidAt:e===o.slice(0,10)?o:`${e}T12:00:00.000Z`,depositMethod:a.depositMethod||void 0})}else Object.assign(d,{depositPaid:0,depositPaidBy:void 0,depositPaidAt:void 0,depositMethod:void 0});break;case'status':d.status=a.status,'seated'!==a.status||t.seatedAt||(d.seatedAt=o),'finished'!==a.status||t.finishedAt||(d.finishedAt=o),'confirmed'!==a.status&&'pending'!==a.status||(d.seatedAt=void 0,d.finishedAt=void 0);break;case'source':d.source=a.source||void 0;break;case'tags':d.tags=[...(t.tags??[]).filter(e=>!b.includes(e)),...a.tags??[]];break;case'duration':d.durationMins=Number(a.duration??0)>=15?Number(a.duration):void 0}n.includes('table')&&(d.tableSetHere=!0);const c=t;return d.locallyEdited=!0,d.editedFields=[...new Set([...c.editedFields??[],...n])],d.editLog=[...c.editLog??[],{at:o,by:s.by.slice(0,80),app:s.app,fields:n,text:k(t,a,n,s.by.slice(0,80),o),quiet:!s.notify}].slice(-50),d},_e.historyLines=function(e){return(e.editLog??[]).slice().reverse().map(e=>e.text??`${e.fields.map(e=>f[e]??e).join(', ')} changed by ${e.by} ${w(e.at)}`.replace(/^./,e=>e.toUpperCase()))},_e.editWarnings=function(e,a,s,o,n=90,d){const c=[];if(!N(e,a).some(e=>['date','time','partySize','table','duration','dogs','status'].includes(e)))return c;const u={...e,date:a.date,time:a.time,partySize:a.partySize,...Number(a.duration??0)>=15?{durationMins:Number(a.duration)}:{}};if(a.table){const e=(0,t.tableOverlaps)(u,a.table,s.filter(e=>e.date===a.date),n);if(e.length&&c.push(`The table already has a booking at about the same time: ${e.map(e=>`${e.time} ${e.walkIn?'walk-in':e.name}`).join(', ')}.`),d){const e=a.table.split('+').map(e=>e.trim()).filter(Boolean).map(e=>d.tables.find(t=>t.name===e)).filter(Boolean),t=e.reduce((e,t)=>e+t.maxSeats,0);e.length&&td.areas.find(t=>t.id===e.areaId)).filter(e=>e&&!e.dogs);Number(a.dogs??0)>0&&s.length&&c.push(`Dogs aren\u2019t allowed in ${s[0].name}. Pick a dog-friendly table.`)}}o&&c.push(`Bookings are paused ${o.from} to ${o.to}${o.reason?` (${o.reason})`:''}.`);return c},Object.defineProperty(_e,"editedWords",{enumerable:!0,get:function(){return M}}),_e.bookingExtras=function(e){const t=e,a=e.dogs??(e.dog?1:0),s=[];a&&s.push(O(a,'dog','dogs'));t.highChairs&&s.push(O(t.highChairs,'high chair','high chairs'));e.access?.wheelchair&&s.push(O(e.access.wheelchair,'wheelchair','wheelchairs'));e.diet?.vegan&&s.push(`${e.diet.vegan} vegan`);e.diet?.vegetarian&&s.push(`${e.diet.vegetarian} vegetarian`);e.occasion&&s.push(e.occasion.charAt(0).toUpperCase()+e.occasion.slice(1));t.area&&s.push(t.area);t.depositMethod&&(e.depositPaid??0)>0&&s.push(`Deposit by ${t.depositMethod}`);return s.join(' \xb7 ')};var e=r(_d[0]),t=r(_d[1]);const a='For example: birthday, high chair, dog, window seat',s='This booking came from the website. Changes here are not sent to website bookings yet.',o='Message the guest about the new date, time or status (website bookings sends it)',n=e=>e.filter(e=>'date'===e||'time'===e||'status'===e);const d=e=>{const t=e;return'Wix'===t.importedFrom||!!t.wix||(e.tags??[]).includes('Wix')},c=['date','time','partySize','name','phone','email','notes','table','area','dogs','highChairs','wheelchair','occasion','allergies','diet','deposit','status','source','tags','duration'],u=['card','cash','bank transfer','website','other'],l=[{id:'pending',label:'Needs confirming'},{id:'confirmed',label:'Confirmed'},{id:'seated',label:'Seated'},{id:'finished',label:'Finished'},{id:'noshow',label:'No-show'}],h=[{id:'phone',label:'Phone'},{id:'in-person',label:'In person'},{id:'online',label:'Online'}],p=[{id:'',label:'None'},{id:'birthday',label:'Birthday'},{id:'anniversary',label:'Anniversary'},{id:'celebration',label:'Celebration'}],b=['VIP','Regular'],f={date:'date',time:'time',partySize:'covers',name:'name',phone:'phone',email:'email',notes:'notes',table:'table',area:'area',dogs:'dogs',highChairs:'high chairs',wheelchair:'wheelchairs',occasion:'occasion',allergies:'allergies',diet:'dietary',deposit:'deposit',status:'status',source:'source',tags:'tags',duration:'table time'},y=e=>{const t=e;return{date:e.date,time:e.time,partySize:e.partySize,name:e.name,phone:e.phone??'',email:e.email??'',notes:e.notes??'',table:e.table??'',area:t.area??'',dogs:e.dogs??(e.dog?1:0),highChairs:t.highChairs??0,wheelchair:e.access?.wheelchair??0,occasion:e.occasion??'',allergies:e.allergies??[],allergyNone:!!e.allergyNone,allergyNote:e.allergyNote??'',vegan:e.diet?.vegan??0,vegetarian:e.diet?.vegetarian??0,depositOn:'deposit'===e.security||(e.depositDue??0)>0||(e.depositPaid??0)>0,depositPaid:(e.depositPaid??0)>0&&!!e.depositPaidBy,depositAmount:(e.depositPaid??0)>0?e.depositPaid:e.depositDue??0,depositMethod:t.depositMethod??'',depositDate:(a=e.depositPaidAt,a?a.slice(0,10):''),depositDue:e.depositDue??0,status:e.status,source:e.source??'',tags:[...e.tags??[]].filter(e=>b.includes(e)).sort(),duration:e.durationMins??0};var a},$=e=>JSON.stringify([[...e.allergies??[]].map(e=>`${e.allergen}:${e.severity}`).sort(),!!e.allergyNone,(e.allergyNote??'').trim()]),v=e=>JSON.stringify(e.depositOn?[!0,!!e.depositPaid,Number(e.depositAmount??0),Number(e.depositDue??0),e.depositPaid?e.depositMethod??'':'',e.depositPaid?e.depositDate??'':'']:[!1]);function P(e,t){switch(e){case'partySize':return Number(t.partySize);case'allergies':return $(t);case'diet':return`${Number(t.vegan??0)}/${Number(t.vegetarian??0)}`;case'deposit':return v(t);case'tags':return[...t.tags??[]].sort().join(',');case'dogs':case'highChairs':case'wheelchair':case'duration':return Number(t[e]??0);default:return String(t[e]??'').trim()}}function N(e,t){const a=y(e);return c.filter(e=>P(e,a)!==P(e,t))}const S=e=>`\xa3${(e/100).toFixed(e%100?2:0)}`,w=e=>{const t=new Date(e);return`${String(t.getHours()).padStart(2,'0')}:${String(t.getMinutes()).padStart(2,'0')}`},O=(e,t,a)=>`${e} ${1===e?t:a}`;function k(e,t,a,s,o){const n=y(e),d=[];for(const e of[...a].sort((e,t)=>Number('deposit'===t)-Number('deposit'===e)))'deposit'===e?t.depositOn?t.depositPaid&&!n.depositPaid?d.push(`deposit marked paid (${S(Number(t.depositAmount??0))}${t.depositMethod?`, ${t.depositMethod}`:''})`):!t.depositPaid&&n.depositPaid?d.push('deposit marked not paid'):d.push(t.depositPaid?`deposit changed (${S(Number(t.depositAmount??0))}${t.depositMethod?`, ${t.depositMethod}`:''})`:`deposit due ${S(Number(t.depositDue??0))}`):d.push('deposit taken off'):'dogs'===e?d.push(!n.dogs&&t.dogs?1===t.dogs?'dog added':`${t.dogs} dogs added`:t.dogs?O(Number(t.dogs),'dog','dogs'):'no dog now'):'highChairs'===e?d.push(t.highChairs?O(Number(t.highChairs),'high chair','high chairs'):'no high chair now'):'wheelchair'===e?d.push(t.wheelchair?O(Number(t.wheelchair),'wheelchair user','wheelchair users'):'no wheelchair now'):'partySize'===e?d.push(`covers ${n.partySize} to ${t.partySize}`):'time'===e?d.push(`time ${n.time} to ${t.time}`):'date'===e?d.push(`date ${n.date} to ${t.date}`):'table'===e?d.push(t.table?`table ${t.table}`:'table taken off'):'status'===e?d.push(`status ${l.find(e=>e.id===t.status)?.label.toLowerCase()??t.status}`):'occasion'===e?d.push(t.occasion?`occasion ${t.occasion}`:'occasion taken off'):'area'===e?d.push(t.area?`area ${t.area}`:'any area'):'duration'===e?d.push(t.duration?`table time ${t.duration} min`:'table time as usual'):d.push(`${f[e]} changed`);const c=d.join(', ');return`${c.charAt(0).toUpperCase()}${c.slice(1)} by ${s} ${w(o)}`}const M=e=>e.map(e=>f[e]).join(', ')},1111,[1098,1092]); __d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"canCancelWalkIn",{enumerable:!0,get:function(){return y}}),Object.defineProperty(_e,"canReinstateWalkIn",{enumerable:!0,get:function(){return h}}),_e.cancelWalkInWords=x,_e.reinstateWalkInWords=p,_e.cancelWalkInNow=$,_e.reinstateWalkInNow=I,_e.CancelWalkInButton=function({rid:e,b:t,onDone:l,small:s,big:o}){const[c,u]=(0,n.useState)(!1);return y(t)?(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(f.Button,{kind:"secondary",small:s,label:"Cancel walk-in",testID:`cancel-walkin-${t.id}`,accessibilityLabel:`Cancel walk-in ${t.ref}, ${t.partySize} Covers`,onPress:()=>u(!0),style:o?{minHeight:64}:s?{minHeight:44}:w}),c?(0,k.jsx)(j,{rid:e,b:t,onClose:()=>u(!1),onDone:l}):null]}):null},_e.CancelWalkInConfirm=j,_e.ReinstateWalkInButton=function({rid:e,b:t,today:l,onDone:o,small:c}){const[u,y]=(0,n.useState)(!1);if(!h(t,l))return null;const x=p(t);if(!u)return(0,k.jsx)(f.Button,{kind:"ghost",small:c,label:"Undo cancel",testID:`reinstate-walkin-${t.id}`,accessibilityLabel:`Undo cancel for walk-in ${t.ref}`,onPress:()=>y(!0),style:c?{minHeight:44}:w});return(0,k.jsxs)(f.Sheet,{visible:!0,onClose:()=>y(!1),title:"Undo cancel?",maxWidth:560,testID:"reinstate-walkin-confirm",children:[(0,k.jsx)(s.default,{accessible:!0,accessibilityLabel:x,children:(0,k.jsx)(f.T,{size:18,colour:b.colours.text,children:x})}),(0,k.jsxs)(f.Row,{gap:8,wrap:!0,children:[(0,k.jsx)(f.Button,{label:"Yes, put back to seated",testID:"reinstate-walkin-yes",accessibilityLabel:`Yes, put walk-in ${t.ref} back to seated`,style:[w,{flexGrow:1}],onPress:async()=>{await I(e,t),y(!1),o?.(`Walk-in ${t.ref} put back to seated.`)}}),(0,k.jsx)(f.Button,{kind:"secondary",label:"Keep cancelled",testID:"reinstate-walkin-no",onPress:()=>y(!1),style:w})]})]})};var e,t=r(d[0]),n=r(d[1]),l=r(d[2]),s=(e=l)&&e.__esModule?e:{default:e},o=r(d[3]),c=r(d[4]),u=r(d[5]),b=r(d[6]),f=r(d[7]),k=r(d[8]);const w={minHeight:56},y=e=>!!e.walkIn&&('seated'===e.status||'confirmed'===e.status),h=(e,t)=>!!e.walkIn&&'cancelled'===e.status&&e.date>=t;function x(e){const t=(0,c.tablesOf)(e.table),n=(0,u.tablesWords)(t);return`Cancel walk-in ${e.ref}, ${e.partySize} Covers${t.length?` at ${n}`:''}, arrived ${e.time}? It comes off the Covers${t.length?` and ${n} ${t.length>1?'go':'goes'} back to Free`:''}.`}function p(e){return`Put walk-in ${e.ref} back to seated? CoverCharge only \u2014 if it was cancelled on the website, put it back there too if needed.`}async function $(e,n){await o.repo.bookings.setStatus(n.id,'cancelled'),await o.repo.bookings.update(n.id,{cancelled:(0,t.cancelStamp)(n)}),(0,c.tablesOf)(n.table).forEach(t=>c.useFloor.getState().setLive(e,t,{stage:void 0,dirty:!1}))}async function I(e,t){await o.repo.bookings.setStatus(t.id,'seated'),(0,c.tablesOf)(t.table).forEach(t=>c.useFloor.getState().setLive(e,t,{stage:'seated',dirty:!1}))}function j({rid:e,b:t,onClose:n,onDone:l}){const o=x(t);return(0,k.jsxs)(f.Sheet,{visible:!0,onClose:n,title:"Cancel walk-in?",maxWidth:560,testID:"cancel-walkin-confirm",children:[(0,k.jsx)(s.default,{accessible:!0,accessibilityLabel:o,children:(0,k.jsx)(f.T,{size:18,colour:b.colours.text,children:o})}),(0,k.jsxs)(f.Row,{gap:8,wrap:!0,children:[(0,k.jsx)(f.Button,{label:"Yes, cancel walk-in",testID:"cancel-walkin-yes",accessibilityLabel:`Yes, cancel walk-in ${t.ref}`,style:[w,{flexGrow:1}],onPress:async()=>{await $(e,t),n(),l?.(`Walk-in ${t.ref} cancelled.${(0,c.tablesOf)(t.table).length?` ${(0,u.tablesWords)((0,c.tablesOf)(t.table))} free.`:''}`)}}),(0,k.jsx)(f.Button,{kind:"secondary",label:"Keep walk-in",testID:"cancel-walkin-no",accessibilityLabel:`Keep walk-in ${t.ref}`,onPress:n,style:w})]})]})}},1112,[1113,34,102,848,1014,1095,840,794,25]); __d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.cancelStamp=C,_e.cancelBookingNow=w,_e.reinstateBookingNow=$,_e.CancelBookingButton=function({rid:e,b:n,name:o,onDone:s,big:l,small:c}){const[u,f]=(0,t.useState)(!1);return(0,b.canCancelBooking)(n)?(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(x.Button,{kind:"secondary",small:c,label:"Cancel booking",testID:`cancel-booking-${n.id}`,accessibilityLabel:`Cancel booking for ${o}, ${n.time}, ${n.partySize} Covers`,onPress:()=>f(!0),style:l?{minHeight:64}:c?{minHeight:44}:j}),u?(0,h.jsx)(D,{rid:e,b:n,name:o,onClose:()=>f(!1),onDone:s}):null]}):null},_e.CancelBookingConfirm=D,_e.ReinstateBookingButton=function({b:e,name:n,today:s,onDone:l}){const[c,u]=(0,t.useState)(!1);if(!(0,b.canReinstateBooking)(e,s))return null;const y=(0,b.reinstateBookingWords)(e,n);if(!c)return(0,h.jsx)(x.Button,{kind:"ghost",label:"Undo cancel",testID:`reinstate-booking-${e.id}`,accessibilityLabel:`Undo cancel for ${n}`,onPress:()=>u(!0),style:j});return(0,h.jsxs)(x.Sheet,{visible:!0,onClose:()=>u(!1),title:"Undo cancel?",maxWidth:560,testID:"reinstate-booking-confirm",children:[(0,h.jsx)(o.default,{accessible:!0,accessibilityLabel:y,style:{alignItems:'center'},children:(0,h.jsx)(x.T,{size:18,colour:f.colours.text,style:{textAlign:'center'},children:y})}),(0,h.jsxs)(x.Row,{gap:8,wrap:!0,style:{justifyContent:'center'},children:[(0,h.jsx)(x.Button,{label:"Yes, put back to booked",testID:"reinstate-booking-yes",accessibilityLabel:`Yes, put ${n} back to booked`,style:[j,{flexGrow:1}],onPress:async()=>{await $(e),u(!1),l?.(`${n} put back to booked.`)}}),(0,h.jsx)(x.Button,{kind:"secondary",label:"Keep cancelled",testID:"reinstate-booking-no",onPress:()=>u(!1),style:j})]})]})};var e,t=r(d[0]),n=r(d[1]),o=(e=n)&&e.__esModule?e:{default:e},s=r(d[2]),l=r(d[3]),c=r(d[4]),b=r(d[5]),u=r(d[6]),f=r(d[7]),y=r(d[8]),k=r(d[9]),p=r(d[10]),x=r(d[11]),h=r(d[12]);const j={minHeight:56},B={display:'Display',owner:'Managers app',staff:'Staff app',chef:'Kitchen app',customer:'Customer page'};function C(e){const t=y.useSession.getState().meId,n=t?k.useOwner.getState().staff.find(e=>e.id===t):void 0,o=B[p.APP_VARIANT]??'CoverCharge';return{by:n?`${n.name.replace(' (example)','')} (${o})`:o,at:(new Date).toISOString(),app:o,...e.table?{table:e.table}:{}}}async function w(e,t){const n=(0,l.tablesOf)(t.table);await s.repo.bookings.update(t.id,{status:'cancelled',cancelled:C(t),...(0,c.tablePatch)(null)}),n.forEach(t=>l.useFloor.getState().setLive(e,t,{stage:void 0,dirty:!1}))}async function $(e){await s.repo.bookings.setStatus(e.id,'confirmed')}function D({rid:e,b:t,name:n,onClose:s,onDone:c}){const y=(0,b.cancelBookingWords)(t,n),k=(0,l.tablesOf)(t.table);return(0,h.jsxs)(x.Sheet,{visible:!0,onClose:s,title:"Cancel booking?",maxWidth:560,testID:"cancel-booking-confirm",children:[(0,h.jsx)(o.default,{accessible:!0,accessibilityLabel:y,style:{alignItems:'center',gap:8},children:(0,h.jsx)(x.T,{size:18,colour:f.colours.text,style:{textAlign:'center'},children:y})}),(0,h.jsxs)(x.Row,{gap:8,wrap:!0,style:{justifyContent:'center'},children:[(0,h.jsx)(x.Button,{label:"Yes, cancel booking",testID:"cancel-booking-yes",accessibilityLabel:`Yes, cancel booking for ${n}`,style:[j,{flexGrow:1}],onPress:async()=>{await w(e,t),s(),c?.(`${n} cancelled.${k.length?` ${(0,u.tablesWords)(k)} free.`:''}`)}}),(0,h.jsx)(x.Button,{kind:"secondary",label:"Keep booking",testID:"cancel-booking-no",accessibilityLabel:`Keep booking for ${n}`,onPress:s,style:j})]})]})}},1113,[34,102,848,1014,1092,1114,1095,840,997,865,846,794,25]); __d(function(g,r,i,_a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"canCancelBooking",{enumerable:!0,get:function(){return n}}),Object.defineProperty(e,"canReinstateBooking",{enumerable:!0,get:function(){return t}}),e.cancelBookingWords=function(n,t){const o=`${n.partySize} Cover${1===n.partySize?'':'s'}`;return`Cancel booking for ${t}, ${n.time}, ${o}? The table is freed. Website bookings will cancel it on the website and may email the guest.`},e.reinstateBookingWords=function(n,t){return`Put ${t} back to booked for ${n.time}? CoverCharge only \u2014 if it was cancelled on the website, put it back there too if needed.`},e.cancelledOnDay=o,e.cancelledDayTally=function(n,t){const a=o(n,t),l=a.filter(n=>!!n.walkIn),c=a.filter(n=>!n.walkIn);return{count:a.length,covers:a.reduce((n,t)=>n+t.partySize,0),bookings:c.length,bookingCovers:c.reduce((n,t)=>n+t.partySize,0),walkIns:l.length,walkInCovers:l.reduce((n,t)=>n+t.partySize,0),list:a}},e.cancelledTallyWords=function(n,t="today"){if(!n.count)return`No cancellations ${t}`;const o=[],a=n.bookings??0,l=n.walkIns??0;a&&o.push(`${a} booking${1===a?'':'s'} (${n.bookingCovers??0} Cover${1===(n.bookingCovers??0)?'':'s'})`);l&&o.push(`${l} walk-in${1===l?'':'s'} (${n.walkInCovers??0} Cover${1===(n.walkInCovers??0)?'':'s'})`);if(!o.length)return`Cancelled ${t}: ${n.count} \xb7 ${n.covers} Cover${1===n.covers?'':'s'}`;return`Cancelled ${t}: ${o.join(' \xb7 ')}`};const n=n=>!n.walkIn&&('confirmed'===n.status||'pending'===n.status||'seated'===n.status),t=(n,t)=>!n.walkIn&&'cancelled'===n.status&&n.date>=t;function o(n,t){return n.filter(n=>n.date===t&&'cancelled'===n.status).sort((n,t)=>n.time.localeCompare(t.time)||n.name.localeCompare(t.name))}},1114,[]); -__d(function(g,_r,i,_a,_m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.BookingEditButton=function({rid:e,booking:a,who:n,role:o,inStaffApp:l,shiftManager:s,big:d,testID:r}){const[u,b]=(0,t.useState)(!1);return a.walkIn||!(0,h.canEditBooking)({variant:c.APP_VARIANT,inStaffApp:l,role:o,shiftManager:s})?null:(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(k.Button,{kind:"secondary",small:!d,label:"Edit booking",testID:r??`edit-booking-${a.id}`,accessibilityLabel:`Edit booking, ${a.name}, ${a.time}`,onPress:()=>b(!0),style:{minHeight:d?64:44}}),u?(0,j.jsx)(C,{rid:e,id:a.id,who:n,onClose:()=>b(!1)}):null]})},_e.EditBookingPicker=function({rid:e,today:a,who:n,onClose:o,hidePrivate:s}){const[d,r]=(0,t.useState)(null),c=(0,l.useBookings)(e).filter(e=>!e.walkIn&&e.date>=a&&!['cancelled','noshow','finished'].includes(e.status)).sort((e,t)=>e.date.localeCompare(t.date)||e.time.localeCompare(t.time)).slice(0,60);return d?(0,j.jsx)(C,{rid:e,id:d,who:n,hidePrivate:s,onClose:o}):(0,j.jsxs)(k.Sheet,{visible:!0,onClose:o,title:"Edit booking \xb7 pick a booking",maxWidth:640,testID:"edit-booking-picker",children:[(0,j.jsx)(k.T,{size:16,colour:b.colours.text,children:"Tip: tap the booking you want to change."}),c.length?c.map(e=>(0,j.jsx)(k.Button,{kind:"secondary",testID:`edit-pick-${e.id}`,label:`${e.date===a?'Today':e.date} ${e.time} \xb7 ${e.name} \xb7 ${e.partySize} ${1===e.partySize?'Cover':'Covers'}`,sub:e.notes?`Notes: ${e.notes}`:void 0,accessibilityLabel:`Edit booking, ${e.name}, ${e.date===a?'today':e.date}, ${e.time}, ${e.partySize} Covers`,onPress:()=>r(e.id),style:{minHeight:56,alignItems:'flex-start'}},e.id)):(0,j.jsx)(k.Muted,{children:"No bookings to edit from today on."}),(0,j.jsx)(k.Button,{kind:"ghost",label:"Close",onPress:o,style:{minHeight:44}})]})},_e.EditBookingSheet=C;var e,t=_r(_d[0]),a=_r(_d[1]),n=_r(_d[2]),o=(e=n)&&e.__esModule?e:{default:e},l=_r(_d[3]),s=_r(_d[4]),d=_r(_d[5]),r=_r(_d[6]),c=_r(_d[7]),h=_r(_d[8]),u=_r(_d[9]),b=_r(_d[10]),m=_r(_d[11]),p=_r(_d[12]),x=_r(_d[13]),y=_r(_d[14]),k=_r(_d[15]),j=_r(_d[16]);const f=/^([01]\d|2[0-3]):[0-5]\d$/,v=e=>{const t=e.trim().replace('.',':').match(/^(\d{1,2}):?(\d{2})$/);return t?`${t[1].padStart(2,'0')}:${t[2]}`:e.trim()};function C({rid:e,id:n,who:C,onClose:T,hidePrivate:I='display'===c.APP_VARIANT}){const B=(0,l.useBookings)(e),D=B.find(e=>e.id===n),P=(0,r.useRestaurant)(e),$=(0,s.usePlan)(e),S=(0,d.useBlocks)(e=>e.blocks),[w,E]=(0,t.useState)(D?(0,h.draftOf)(D):null),[z,A]=(0,t.useState)(null),[L,_]=(0,t.useState)(null);if(!D||!w||!P)return null;const F=e=>{A(null),_(null),E({...w,...e})},N=v(w.time),W=f.test(N),R=(0,u.tableOptions)($,B.filter(e=>e.date===w.date),w.table),M=(0,h.changedFields)(D,{...w,time:N}),O=P.settings.turnMins??90,H=async()=>{const t=(0,h.editPatch)(D,{...w,time:N},{by:C||'Team member',app:c.APP_VARIANT});if(Object.keys(t).length&&await l.repo.bookings.update(D.id,t),'seated'===D.status&&'table'in t&&t.table!==D.table){const a=e=>e?e.split('+').map(e=>e.trim()).filter(Boolean):[],n=a(D.table),o=a(t.table),l=s.useFloor.getState(),d=n.map(t=>l.live[e]?.[t]?.stage).find(Boolean)??'seated';n.filter(e=>!o.includes(e)).forEach(t=>l.setLive(e,t,{stage:void 0,dirty:!0})),o.forEach(t=>l.setLive(e,t,{stage:d,dirty:!1}))}_(`Saved. Changed: ${(0,h.editedWords)(M)}.`),A(null),T()};return(0,j.jsxs)(k.Sheet,{visible:!0,onClose:T,title:`Edit booking \xb7 ${D.name} \xb7 ${D.ref}`,maxWidth:760,testID:"edit-booking-sheet",children:[(0,j.jsx)(x.DepositChip,{b:D,money:!0,big:!0,testID:"edit-deposit"}),(0,h.isWixBooking)(D)?(0,j.jsx)(o.default,{testID:"edit-wix-note",accessible:!0,accessibilityLabel:h.WIX_EDIT_NOTE,style:{padding:12,borderRadius:12,borderWidth:1,borderColor:b.colours.gold},children:(0,j.jsx)(k.T,{size:16,colour:b.colours.goldLight,children:h.WIX_EDIT_NOTE})}):null,(0,j.jsx)(k.T,{size:16,colour:b.colours.text,children:"Tip: change what you need, then press Save changes."}),(0,j.jsx)(p.BookingDatePicker,{r:P,today:new Date,value:w.date,onChange:e=>F({date:e})}),(0,j.jsx)(k.Field,{label:"Time (24-hour, for example 19:30)",value:w.time,onChangeText:e=>F({time:e}),testID:"edit-time"}),W?null:(0,j.jsx)(k.T,{size:15,colour:b.colours.amber,children:"Write the time like 19:30."}),(0,j.jsxs)(o.default,{style:{gap:6,alignItems:'center'},children:[(0,j.jsx)(k.T,{size:18,center:!0,children:"Covers"}),(0,j.jsx)(a.PartySizeInput,{value:w.partySize,onChange:e=>F({partySize:e}),label:"Covers",testID:"edit-covers"})]}),(0,j.jsx)(k.Field,{label:"Name",value:w.name,onChangeText:e=>F({name:e}),testID:"edit-name"}),I?(0,j.jsx)(k.Muted,{children:"Phone and email can be changed in the Managers app; the Display never shows them."}):(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(k.Field,{label:"Phone",value:w.phone,onChangeText:e=>F({phone:e}),keyboardType:"phone-pad",testID:"edit-phone"}),(0,j.jsx)(k.Field,{label:"Email",value:w.email,onChangeText:e=>F({email:e}),keyboardType:"email-address",autoCapitalize:"none",testID:"edit-email"})]}),(0,j.jsx)(k.Field,{label:"Notes",value:w.notes,onChangeText:e=>F({notes:e}),placeholder:h.NOTES_PLACEHOLDER,multiline:!0,numberOfLines:3,testID:"edit-notes"}),D.allergies.length||D.allergyNote?(0,j.jsx)(k.Muted,{children:"Allergies are kept separately and are not changed here."}):null,(0,j.jsx)(k.T,{size:18,weight:"semibold",children:(0,u.tableButtonLabel)(w.table)}),(0,j.jsxs)(k.Row,{gap:8,wrap:!0,children:[(0,j.jsx)(k.Button,{kind:w.table?'secondary':'primary',label:"No table",accessibilityLabel:"No table"+(w.table?'':', chosen'),onPress:()=>F({table:''}),style:{minHeight:44,minWidth:96},testID:"edit-table-none"}),R.map(e=>(0,j.jsx)(k.Button,{kind:e===w.table?'primary':'secondary',label:(0,u.tableButtonLabel)(e),accessibilityLabel:`Table ${(0,u.tableButtonLabel)(e)}${e===w.table?', chosen':''}`,onPress:()=>F({table:e}),style:{minHeight:44,minWidth:64},testID:`edit-table-${e}`},e))]}),z?(0,j.jsxs)(o.default,{testID:"edit-warn",style:{gap:8,padding:12,borderRadius:12,borderWidth:1.5,borderColor:b.colours.amber,backgroundColor:b.colours.amberBg},children:[z.map(e=>(0,j.jsx)(k.T,{size:16,colour:"#FFE2A8",children:e},e)),(0,j.jsx)(k.T,{size:16,colour:"#FFE2A8",children:"You can still save."})]}):null,L?(0,j.jsx)(k.T,{size:16,colour:b.colours.goldLight,children:L}):null,(0,j.jsxs)(k.Row,{gap:8,wrap:!0,children:[(0,j.jsx)(k.Button,{label:z?'Save anyway':'Save changes',testID:"edit-save",disabled:!W||w.name.trim().length<1||!M.length,onPress:()=>{const t=W?(0,d.blockAt)(S,e,w.date,N):void 0,a=(0,h.editWarnings)(D,{...w,time:N},B,t,O);!a.length||z?H():A(a)},style:{minHeight:56,flex:1}}),(0,j.jsx)(k.Button,{kind:"ghost",label:"Close",onPress:T,style:{minHeight:56}})]}),(0,j.jsx)(y.CancelBookingButton,{rid:e,b:D,name:D.name,big:!0,onDone:()=>T()}),(0,j.jsx)(y.ReinstateBookingButton,{b:D,name:D.name,today:(0,m.ymd)(new Date),onDone:()=>T()})]})}},1115,[34,1097,102,848,1014,1011,850,846,1111,1092,840,827,1105,1089,1113,794,25]); +__d(function(g,_r,_i,_a,_m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.BookingEditButton=function({rid:e,booking:s,who:i,role:a,inStaffApp:n,shiftManager:l,big:o,testID:d}){const[h,m]=(0,t.useState)(!1),x=(0,u.useSession)(e=>e.meId),j=(0,p.useOwner)(e=>e.staff.find(e=>e.id===x&&e.active));return s.walkIn||!(0,c.canEditBooking)({variant:r.APP_VARIANT,inStaffApp:n,role:a,shiftManager:l})||x&&!(0,b.canChangeBookings)(j)?null:(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(C.Button,{kind:"secondary",small:!o,label:"Edit booking",sub:o?void 0:"Deposit, dog, table, anything",testID:d??`edit-booking-${s.id}`,accessibilityLabel:`Edit booking, ${s.name}, ${s.time}`,onPress:()=>m(!0),style:{minHeight:o?64:44}}),h?(0,f.jsx)(B,{rid:e,id:s.id,who:i,onClose:()=>m(!1)}):null]})},_e.EditBookingPicker=function({rid:e,today:s,who:i,onClose:a,hidePrivate:l}){const[o,d]=(0,t.useState)(null),r=(0,n.useBookings)(e).filter(e=>!e.walkIn&&e.date>=s&&!['cancelled','noshow','finished'].includes(e.status)).sort((e,t)=>e.date.localeCompare(t.date)||e.time.localeCompare(t.time)).slice(0,60);return o?(0,f.jsx)(B,{rid:e,id:o,who:i,hidePrivate:l,onClose:a}):(0,f.jsxs)(C.Sheet,{visible:!0,onClose:a,title:"Edit booking \xb7 pick a booking",maxWidth:640,testID:"edit-booking-picker",children:[(0,f.jsx)(C.T,{size:16,colour:x.colours.text,children:"Tip: tap the booking you want to change."}),r.length?r.map(e=>(0,f.jsx)(C.Button,{kind:"secondary",testID:`edit-pick-${e.id}`,label:`${e.date===s?'Today':e.date} ${e.time} \xb7 ${e.name} \xb7 ${e.partySize} ${1===e.partySize?'Cover':'Covers'}`,sub:e.notes?`Notes: ${e.notes}`:void 0,accessibilityLabel:`Edit booking, ${e.name}, ${e.date===s?'today':e.date}, ${e.time}, ${e.partySize} Covers`,onPress:()=>d(e.id),style:{minHeight:56,alignItems:'flex-start'}},e.id)):(0,f.jsx)(C.Muted,{children:"No bookings to edit from today on."}),(0,f.jsx)(C.Button,{kind:"ghost",label:"Close",onPress:a,style:{minHeight:44}})]})},_e.EditBookingSheet=B;var e,t=_r(_d[0]),s=_r(_d[1]),i=_r(_d[2]),a=(e=i)&&e.__esModule?e:{default:e},n=_r(_d[3]),l=_r(_d[4]),o=_r(_d[5]),d=_r(_d[6]),r=_r(_d[7]),c=_r(_d[8]),h=_r(_d[9]),u=_r(_d[10]),p=_r(_d[11]),b=_r(_d[12]),m=_r(_d[13]),x=_r(_d[14]),j=_r(_d[15]),y=_r(_d[16]),D=_r(_d[17]),I=_r(_d[18]),C=_r(_d[19]),f=_r(_d[20]);const T=/^([01]\d|2[0-3]):[0-5]\d$/,v=e=>{const t=e.trim().replace('.',':').match(/^(\d{1,2}):?(\d{2})$/);return t?`${t[1].padStart(2,'0')}:${t[2]}`:e.trim()};const w=e=>e?(e/100).toFixed(e%100?2:0):'',k=e=>{const t=Number(e.replace(/[\xa3,\s]/g,''));return Number.isFinite(t)&&t>=0?Math.round(100*t):NaN},S=e=>e&&/^\d{4}-\d{2}-\d{2}$/.test(e)?`${e.slice(8,10)}/${e.slice(5,7)}/${e.slice(0,4)}`:'',P=e=>{const t=e.trim().match(/^(\d{1,2})\/(\d{1,2})\/(\d{4})$/);return t?`${t[3]}-${t[2].padStart(2,'0')}-${t[1].padStart(2,'0')}`:''},$=e=>e.charAt(0).toUpperCase()+e.slice(1);function N({title:e,children:t,testID:s}){return(0,f.jsxs)(a.default,{testID:s,style:{gap:8,paddingTop:10,borderTopWidth:1,borderTopColor:x.colours.hairline,alignItems:'stretch'},children:[(0,f.jsx)(C.T,{size:17,weight:"semibold",center:!0,colour:x.colours.goldLight,children:e}),t]})}const E=({label:e,value:t,onChange:s,max:i=20,testID:a})=>(0,f.jsxs)(C.Row,{style:{justifyContent:'space-between',alignItems:'center'},children:[(0,f.jsx)(C.T,{size:16,children:e}),(0,f.jsx)(C.Stepper,{testID:a,value:t,min:0,max:i,onChange:s,label:e})]});function B({rid:e,id:i,who:u,onClose:p,hidePrivate:b='display'===r.APP_VARIANT}){const B=(0,n.useBookings)(e),O=B.find(e=>e.id===i),z=(0,d.useRestaurant)(e),A=(0,l.usePlan)(e),R=(0,o.useBlocks)(e=>e.blocks),[L,F]=(0,t.useState)(O?(0,c.draftOf)(O):null),[W,M]=(0,t.useState)(null),[_,H]=(0,t.useState)(null),[V,G]=(0,t.useState)(w(O?(0,c.draftOf)(O).depositDue:0)),[U,X]=(0,t.useState)(w(O?(0,c.draftOf)(O).depositAmount:0)),[Y,q]=(0,t.useState)(S(O?(0,c.draftOf)(O).depositDate:'')),[J,K]=(0,t.useState)(!1);if(!O||!L||!z)return null;const Q=e=>{M(null),H(null),F({...L,...e})},Z=v(L.time),ee=T.test(Z),te=L.area?A.areas.filter(e=>e.name===L.area).map(e=>e.id):null,se=e=>!te||e.split('+').every(e=>te.includes(A.tables.find(t=>t.name===e)?.areaId??'')),ie=(0,m.tableOptions)(A,B.filter(e=>e.date===L.date),L.table).filter(e=>se(e)||e===L.table),ae=!(L.depositOn&&(Number.isNaN(k(V||'0'))||L.depositPaid&&(Number.isNaN(k(U||'0'))||Y.trim()&&!P(Y)))),ne={...L,time:Z,depositDue:k(V||'0')||0,depositAmount:k(U||'0')||0,depositDate:P(Y)},le=(0,c.changedFields)(O,ne),oe=z.settings.turnMins??90,de=async()=>{const t=(0,c.editPatch)(O,ne,{by:u||'Team member',app:r.APP_VARIANT,notify:J&&(0,c.isWixBooking)(O)});if(Object.keys(t).length&&await n.repo.bookings.update(O.id,t),'seated'===O.status&&'table'in t&&t.table!==O.table){const s=e=>e?e.split('+').map(e=>e.trim()).filter(Boolean):[],i=s(O.table),a=s(t.table),n=l.useFloor.getState(),o=i.map(t=>n.live[e]?.[t]?.stage).find(Boolean)??'seated';i.filter(e=>!a.includes(e)).forEach(t=>n.setLive(e,t,{stage:void 0,dirty:!0})),a.forEach(t=>n.setLive(e,t,{stage:o,dirty:!1}))}H(`Saved. Changed: ${(0,c.editedWords)(le)}.`),M(null),p()},re=L.allergies??[],ce=e=>Q({allergyNone:!1,allergies:re.some(t=>t.allergen===e)?re.filter(t=>t.allergen!==e):[...re,{allergen:e,severity:'allergy'}]}),he=(0,c.historyLines)(O);return(0,f.jsxs)(C.Sheet,{visible:!0,onClose:p,title:`Edit booking \xb7 ${O.name} \xb7 ${O.ref}`,maxWidth:760,testID:"edit-booking-sheet",children:[(0,f.jsx)(a.default,{style:{alignItems:'center'},children:(0,f.jsx)(D.DepositChip,{b:O,money:!0,big:!0,testID:"edit-deposit"})}),(0,c.isWixBooking)(O)?(0,f.jsx)(a.default,{testID:"edit-wix-note",accessible:!0,accessibilityLabel:c.WIX_EDIT_NOTE,style:{padding:12,borderRadius:12,borderWidth:1,borderColor:x.colours.gold},children:(0,f.jsx)(C.T,{size:16,center:!0,colour:x.colours.goldLight,children:c.WIX_EDIT_NOTE})}):null,(0,f.jsx)(C.T,{size:16,center:!0,colour:x.colours.text,children:"Tip: change what you need, then press Save changes. Saving doesn\u2019t message the guest."}),(0,f.jsxs)(N,{title:"Deposit",testID:"edit-section-deposit",children:[(0,f.jsxs)(C.Row,{wrap:!0,gap:6,style:{justifyContent:'center'},children:[(0,f.jsx)(C.Chip,{label:"No deposit",selected:!L.depositOn,testID:"edit-deposit-none",onPress:()=>Q({depositOn:!1,depositPaid:!1})}),(0,f.jsx)(C.Chip,{label:"Deposit due",selected:!!L.depositOn&&!L.depositPaid,testID:"edit-deposit-due",onPress:()=>Q({depositOn:!0,depositPaid:!1})}),(0,f.jsx)(C.Chip,{label:"Deposit paid",selected:!!L.depositOn&&!!L.depositPaid,testID:"edit-deposit-paid",onPress:()=>{U||X(V),Y||q(S((0,j.ymd)(new Date))),Q({depositOn:!0,depositPaid:!0})}})]}),L.depositOn?(0,f.jsx)(C.Field,{label:"Deposit due (\xa3)",value:V,onChangeText:e=>{G(e),Q({})},keyboardType:"decimal-pad",testID:"edit-deposit-due-amount"}):null,L.depositOn&&L.depositPaid?(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(C.Field,{label:"Amount paid (\xa3)",value:U,onChangeText:e=>{X(e),Q({})},keyboardType:"decimal-pad",testID:"edit-deposit-amount"}),(0,f.jsx)(C.T,{size:16,center:!0,children:"How was it paid?"}),(0,f.jsx)(C.Row,{wrap:!0,gap:6,style:{justifyContent:'center'},children:c.DEPOSIT_METHODS.map(e=>(0,f.jsx)(C.Chip,{label:$(e),selected:L.depositMethod===e,testID:`edit-deposit-method-${e.replace(' ','-')}`,onPress:()=>Q({depositMethod:e})},e))}),(0,f.jsx)(C.Field,{label:"Date paid (for example 11/11/2026)",value:Y,onChangeText:e=>{q(e),Q({})},testID:"edit-deposit-date"}),Y.trim()&&!P(Y)?(0,f.jsx)(C.T,{size:15,center:!0,colour:x.colours.amber,children:"Write the date like 11/11/2026."}):null]}):null,ae?null:(0,f.jsx)(C.T,{size:15,center:!0,colour:x.colours.amber,children:"Write amounts in pounds, for example 60 or 12.50."}),(0,f.jsx)(C.Muted,{center:!0,children:"No payment is taken in CoverCharge: this records what the guest paid."})]}),(0,f.jsxs)(N,{title:"When",testID:"edit-section-when",children:[(0,f.jsx)(y.BookingDatePicker,{r:z,today:new Date,value:L.date,onChange:e=>Q({date:e})}),(0,f.jsx)(C.Field,{label:"Time (24-hour, for example 19:30)",value:L.time,onChangeText:e=>Q({time:e}),testID:"edit-time"}),ee?null:(0,f.jsx)(C.T,{size:15,colour:x.colours.amber,children:"Write the time like 19:30."}),(0,f.jsxs)(a.default,{style:{gap:6,alignItems:'center'},children:[(0,f.jsx)(C.T,{size:18,center:!0,children:"Covers"}),(0,f.jsx)(s.PartySizeInput,{value:L.partySize,onChange:e=>Q({partySize:e}),label:"Covers",testID:"edit-covers"})]}),(0,f.jsxs)(C.Row,{style:{justifyContent:'space-between',alignItems:'center'},children:[(0,f.jsx)(C.T,{size:16,children:"Table time"}),(0,f.jsx)(C.Stepper,{testID:"edit-duration",value:L.duration||0,min:0,max:360,step:15,onChange:e=>Q({duration:e}),format:e=>e?`${Math.floor(e/60)}h ${String(e%60).padStart(2,'0')}m`:'As usual',label:"Table time"})]})]}),(0,f.jsxs)(N,{title:"Where",testID:"edit-section-where",children:[(0,f.jsxs)(C.Row,{wrap:!0,gap:6,style:{justifyContent:'center'},children:[(0,f.jsx)(C.Chip,{label:"Any area",selected:!L.area,testID:"edit-area-any",onPress:()=>Q({area:''})}),A.areas.map(e=>(0,f.jsx)(C.Chip,{label:`${e.name}${e.dogs?' \xb7 dogs ok':''}`,selected:L.area===e.name,testID:`edit-area-${e.id}`,onPress:()=>Q({area:e.name})},e.id))]}),(0,f.jsx)(C.T,{size:18,weight:"semibold",center:!0,children:(0,m.tableButtonLabel)(L.table)}),(0,f.jsxs)(C.Row,{gap:8,wrap:!0,style:{justifyContent:'center'},children:[(0,f.jsx)(C.Button,{kind:L.table?'secondary':'primary',label:"No table",accessibilityLabel:"No table"+(L.table?'':', chosen'),onPress:()=>Q({table:''}),style:{minHeight:44,minWidth:96},testID:"edit-table-none"}),ie.map(e=>(0,f.jsx)(C.Button,{kind:e===L.table?'primary':'secondary',label:(0,m.tableButtonLabel)(e),accessibilityLabel:`Table ${(0,m.tableButtonLabel)(e)}${e===L.table?', chosen':''}`,onPress:()=>Q({table:e}),style:{minHeight:44,minWidth:64},testID:`edit-table-${e}`},e))]})]}),(0,f.jsxs)(N,{title:"Guest",testID:"edit-section-guest",children:[(0,f.jsx)(C.Field,{label:"Name",value:L.name,onChangeText:e=>Q({name:e}),testID:"edit-name"}),b?(0,f.jsx)(C.Muted,{center:!0,children:"Phone and email can be changed in the Managers app; the Display never shows them."}):(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(C.Field,{label:"Phone",value:L.phone,onChangeText:e=>Q({phone:e}),keyboardType:"phone-pad",testID:"edit-phone"}),(0,f.jsx)(C.Field,{label:"Email",value:L.email,onChangeText:e=>Q({email:e}),keyboardType:"email-address",autoCapitalize:"none",testID:"edit-email"})]}),(0,f.jsx)(C.T,{size:16,center:!0,children:"Booked by"}),(0,f.jsx)(C.Row,{wrap:!0,gap:6,style:{justifyContent:'center'},children:c.SOURCES.map(e=>(0,f.jsx)(C.Chip,{label:e.label,selected:L.source===e.id,testID:`edit-source-${e.id}`,onPress:()=>Q({source:e.id})},e.id))}),(0,f.jsx)(C.Row,{wrap:!0,gap:6,style:{justifyContent:'center'},children:c.TAGS.map(e=>{const t=(L.tags??[]).includes(e);return(0,f.jsx)(C.Chip,{label:e,selected:t,testID:`edit-tag-${e}`,onPress:()=>Q({tags:t?(L.tags??[]).filter(t=>t!==e):[...L.tags??[],e].sort()})},e)})})]}),(0,f.jsxs)(N,{title:"Dogs, high chairs and access",testID:"edit-section-needs",children:[(0,f.jsx)(E,{label:"Dogs",value:L.dogs??0,max:6,onChange:e=>Q({dogs:e}),testID:"edit-dogs"}),(0,f.jsx)(E,{label:"High chairs",value:L.highChairs??0,max:10,onChange:e=>Q({highChairs:e}),testID:"edit-high-chairs"}),(0,f.jsx)(E,{label:"Wheelchair users",value:L.wheelchair??0,max:10,onChange:e=>Q({wheelchair:e}),testID:"edit-wheelchair"}),(0,f.jsx)(C.T,{size:16,center:!0,children:"Occasion"}),(0,f.jsx)(C.Row,{wrap:!0,gap:6,style:{justifyContent:'center'},children:c.OCCASIONS.map(e=>(0,f.jsx)(C.Chip,{label:e.label,selected:(L.occasion??'')===e.id,testID:`edit-occasion-${e.id||'none'}`,onPress:()=>Q({occasion:e.id})},e.id||'none'))})]}),(0,f.jsxs)(N,{title:"Allergies and dietary",testID:"edit-section-allergies",children:[(0,f.jsxs)(C.Row,{wrap:!0,gap:6,style:{justifyContent:'center'},children:[(0,f.jsx)(C.Chip,{label:"No allergies",selected:!!L.allergyNone&&!re.length,testID:"edit-allergy-none",onPress:()=>Q({allergyNone:!0,allergies:[]})}),h.ALLERGENS.map(e=>(0,f.jsx)(C.Chip,{label:e.short,selected:re.some(t=>t.allergen===e.id),testID:`edit-allergen-${e.id}`,onPress:()=>ce(e.id)},e.id))]}),re.map(e=>(0,f.jsxs)(a.default,{style:{gap:4,alignItems:'center'},children:[(0,f.jsxs)(C.T,{size:15,center:!0,children:[h.ALLERGENS.find(t=>t.id===e.allergen)?.short,": how serious?"]}),(0,f.jsx)(C.Row,{wrap:!0,gap:6,style:{justifyContent:'center'},children:h.SEVERITIES.map(t=>(0,f.jsx)(C.Chip,{label:t.label,selected:e.severity===t.id,testID:`edit-severity-${e.allergen}-${t.id}`,onPress:()=>Q({allergies:re.map(s=>s.allergen===e.allergen?{...s,severity:t.id}:s)})},t.id))})]},e.allergen)),(0,f.jsx)(C.Field,{label:"Anything else about allergies",value:L.allergyNote,onChangeText:e=>Q({allergyNote:e}),testID:"edit-allergy-note"}),le.includes('allergies')&&re.length?(0,f.jsx)(C.T,{size:15,center:!0,colour:x.colours.amber,children:"The kitchen signs off allergies again after this change."}):null,(0,f.jsx)(E,{label:"Vegan",value:L.vegan??0,max:L.partySize,onChange:e=>Q({vegan:e}),testID:"edit-vegan"}),(0,f.jsx)(E,{label:"Vegetarian",value:L.vegetarian??0,max:L.partySize,onChange:e=>Q({vegetarian:e}),testID:"edit-vegetarian"})]}),'cancelled'!==O.status?(0,f.jsxs)(N,{title:"Status",testID:"edit-section-status",children:[(0,f.jsx)(C.Row,{wrap:!0,gap:6,style:{justifyContent:'center'},children:c.EDIT_STATUSES.map(e=>(0,f.jsx)(C.Chip,{label:e.label,selected:L.status===e.id,testID:`edit-status-${e.id}`,onPress:()=>Q({status:e.id})},e.id))}),(0,f.jsx)(C.Muted,{center:!0,children:"To cancel, use Cancel booking below. Nothing is ever deleted."})]}):null,(0,f.jsx)(N,{title:"Notes",testID:"edit-section-notes",children:(0,f.jsx)(C.Field,{label:"Notes",value:L.notes,onChangeText:e=>Q({notes:e}),placeholder:c.NOTES_PLACEHOLDER,multiline:!0,numberOfLines:3,testID:"edit-notes"})}),W?(0,f.jsxs)(a.default,{testID:"edit-warn",style:{gap:8,padding:12,borderRadius:12,borderWidth:1.5,borderColor:x.colours.amber,backgroundColor:x.colours.amberBg},children:[W.map(e=>(0,f.jsx)(C.T,{size:16,center:!0,colour:"#FFE2A8",children:e},e)),(0,f.jsx)(C.T,{size:16,center:!0,colour:"#FFE2A8",children:"You can still save."})]}):null,(0,c.isWixBooking)(O)&&(0,c.guestMessageFields)(le).length?(0,f.jsxs)(a.default,{testID:"edit-notify",style:{gap:6,alignItems:'center'},children:[(0,f.jsx)(C.Toggle,{value:J,onChange:K,label:c.NOTIFY_LABEL,testID:"edit-notify-toggle"}),(0,f.jsx)(C.Muted,{center:!0,children:J?'The website sends the guest its own message about this.':'Off: the guest isn\u2019t messaged. The website keeps the old date, time or status until it\u2019s changed there.'})]}):null,_?(0,f.jsx)(C.T,{size:16,center:!0,colour:x.colours.goldLight,children:_}):null,(0,f.jsxs)(C.Row,{gap:8,wrap:!0,children:[(0,f.jsx)(C.Button,{label:W?'Save anyway':'Save changes',testID:"edit-save",disabled:!ee||!ae||L.name.trim().length<1||!le.length,onPress:()=>{const t=ee?(0,o.blockAt)(R,e,L.date,Z):void 0,s=(0,c.editWarnings)(O,ne,B,t,oe,A);!s.length||W?de():M(s)},style:{minHeight:56,flex:1}}),(0,f.jsx)(C.Button,{kind:"ghost",label:"Close",onPress:p,style:{minHeight:56}})]}),he.length?(0,f.jsx)(N,{title:"Changes",testID:"edit-history",children:he.slice(0,12).map((e,t)=>(0,f.jsx)(C.T,{size:14,center:!0,colour:x.colours.muted,children:e},t))}):null,(0,f.jsx)(I.CancelBookingButton,{rid:e,b:O,name:O.name,big:!0,onDone:()=>p()}),(0,f.jsx)(I.ReinstateBookingButton,{b:O,name:O.name,today:(0,j.ymd)(new Date),onDone:()=>p()})]})}},1115,[34,1097,102,848,1014,1011,850,846,1111,830,997,865,1012,1092,840,827,1105,1089,1113,794,25]); __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,"useVoiceSlot",{enumerable:!0,get:function(){return w}}),_e.voiceAppFor=h,_e.useVoiceTarget=p,_e.VoiceSlot=function({size:e=56,layer:t=0}){const u=p(),c=(0,n.useRef)(null),l=(0,n.useRef)(y++).current,{width:f,height:h,fontScale:v}=(0,o.default)(),A=()=>{if(t{if(c.current!==e||!s||tu+.5?w.getState().owner===l&&w.setState({rect:null,owner:0}):w.setState({rect:{x:n,y:o,size:s},owner:l})})},W=(0,n.useRef)(A);return W.current=A,(0,n.useLayoutEffect)(()=>{if(u?.on)return S.set(l,{layer:t,measure:()=>W.current()}),()=>{S.delete(l),w.getState().owner===l&&w.setState({rect:null,owner:0}),requestAnimationFrame(b)}},[u?.on,t]),(0,n.useLayoutEffect)(()=>{A();const e=requestAnimationFrame(A);return()=>cancelAnimationFrame(e)},[f,h,v,u?.on]),(0,n.useEffect)(()=>{const e=c.current;if(!u?.on||'undefined'==typeof ResizeObserver||!e?.parentElement)return;const t=new ResizeObserver(A);return t.observe(e.parentElement),e.parentElement.parentElement&&t.observe(e.parentElement.parentElement),()=>t.disconnect()},[u?.on]),(0,n.useEffect)(()=>()=>{w.getState().owner===l&&w.setState({rect:null,owner:0})},[]),(0,n.useEffect)(()=>{u?.on||w.getState().owner!==l||w.setState({rect:null,owner:0})},[u?.on]),u?.on?(0,m.jsx)(s.default,{ref:c,testID:"voice-slot",onLayout:A,style:{width:e,height:e,flexShrink:0}}):null};var t=r(d[0]),n=r(d[1]),o=e(r(d[2])),s=e(r(d[3])),u=r(d[4]),c=r(d[5]),l=r(d[6]),f=r(d[7]),m=r(d[8]);const w=(0,u.create)(()=>({rect:null,owner:0}));function h(e){return'customer'===c.APP_VARIANT||/^\/(customer|table|demo)/.test(e)?null:e.startsWith('/owner')||e.startsWith('/admin')?'owner':e.startsWith('/team')?'staff':e.startsWith('/kitchen')?'chef':e.startsWith('/display')?'display':null}function p(){const e=(0,t.usePathname)()||'/',n=(0,l.useCtx)(6e4),o=(0,f.useVoiceSettings)(e=>e.enabled),s=h(e);if(!s)return null;const u='owner'===s?'owner'===n.role?'owner':'manager'===n.role?'manager':'staff':s;return{app:s,role:u,actions:'staff'===u?'staff':s,on:(0,f.voiceOn)(o,n.rid,u)}}let y=1;const S=new Map,E=()=>{let e=-1;return S.forEach(t=>{t.layer>e&&(e=t.layer)}),e};function b(){const e=E();S.forEach(t=>{t.layer===e&&t.measure()})}},1116,[30,34,426,102,815,846,1100,1117,25]); __d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"VOICE_ROLES",{enumerable:!0,get:function(){return o}}),Object.defineProperty(_e,"VOICE_ROLE_LABEL",{enumerable:!0,get:function(){return p}}),Object.defineProperty(_e,"useVoiceSettings",{enumerable:!0,get:function(){return u}}),Object.defineProperty(_e,"voiceOn",{enumerable:!0,get:function(){return f}}),_e.micExplainedFor=function(e){try{if('1'===b()?.getItem(s(e)))return!0}catch{}return u.getState().micExplained},_e.setMicExplainedFor=function(e){try{b()?.setItem(s(e),'1')}catch{}u.getState().setMicExplained(!0)};var e,n=r(d[0]),t=(e=n)&&e.__esModule?e:{default:e},c=r(d[1]),l=r(d[2]);const o=['owner','manager','staff','chef','display'],p={owner:'Owner (Managers app)',manager:'Managers (Managers app)',staff:'Staff app (full voice assistant, no money or HR)',chef:'Head Chef app',display:'Main Display'},u=(0,c.create)()((0,l.persist)(e=>({enabled:{},micExplained:!1,setEnabled:(n,t,c)=>e(e=>({enabled:{...e.enabled,[n]:{...e.enabled[n]??{},[t]:c}}})),setMicExplained:n=>e({micExplained:n})}),{name:'covercharge-voice-v1',version:4,storage:(0,l.createJSONStorage)(()=>t.default),migrate:(e,n)=>({enabled:n<2?{}:e?.enabled??{},micExplained:!!e?.micExplained}),merge:(e,n)=>({...n,enabled:e?.enabled??n.enabled,micExplained:e?.micExplained??n.micExplained}),partialize:e=>({enabled:e.enabled,micExplained:e.micExplained})})),f=(e,n,t)=>!1!==e[n]?.[t],s=e=>`cc-voice-mic-explained-${e}`,b=()=>{try{return'undefined'!=typeof window?window.localStorage:void 0}catch{return}}},1117,[808,815,818]); __d(function(g,_r,_i,a,_m,e,_d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"VAT",{enumerable:!0,get:function(){return r}}),Object.defineProperty(e,"exVat",{enumerable:!0,get:function(){return n}}),e.dishCost=i,Object.defineProperty(e,"gpPct",{enumerable:!0,get:function(){return o}}),Object.defineProperty(e,"priceForTarget",{enumerable:!0,get:function(){return c}}),e.costings=function(r,c,s,u){const d=(0,t.dishStats)(r);return c.map(t=>{const c=r.find(r=>r.id===t.dishId);if(!c||null==c.price)return null;const p=i(t,s),l=n(c.price),f=o(p,c.price),b=d.find(t=>t.item.id===c.id)?.sold??0;return{item:c,recipe:t,cost:p,priceInc:c.price,priceEx:l,gp:f,cashGp:l-p,below:ft.prevCost&&t.prevCost!==t.cost).map(s=>{const u=(s.cost-(s.prevCost??s.cost))/(s.prevCost??1)*100,d=r.filter(t=>t.lines.some(t=>t.ing===s.id)).map(r=>{const u=t.find(t=>t.id===r.dishId);if(!u||null==u.price)return null;const d=o(i(r,n,{ing:s.id,cost:s.prevCost}),u.price),p=o(i(r,n),u.price);return{item:u,before:d,after:p,dropped:d>=c&&pt.dropped),below:d.filter(t=>t.below)}})},e.weekGp=function(t,r,n){const i=t.reduce((t,r)=>t+r.priceEx*r.soldWeek,0),o=t.reduce((t,r)=>t+r.cost*r.soldWeek,0),c=o+r+Math.max(0,n);return{sales:i,theoCost:o,actualCost:c,theo:i?(i-o)/i*100:0,actual:i?(i-c)/i*100:0}},Object.defineProperty(e,"fmtQty",{enumerable:!0,get:function(){return s}});var t=_r(_d[0]);const r=.2,n=t=>Math.round(t/1.2);function i(t,r,n){return Math.round(t.lines.reduce((t,i)=>{const o=r.find(t=>t.id===i.ing);return t+(n&&n.ing===i.ing?n.cost:o?.cost??0)*i.qty},0))}const o=(t,r)=>{const i=n(r);return i>0?(i-t)/i*100:0},c=(t,r)=>50*Math.ceil(t/(1-r/100)*1.2/50);const s=(t,r)=>`${Number.isInteger(t)?t:t.toFixed(t<1?3:2).replace(/0+$/,'').replace(/\.$/,'')} ${'each'===r?'':r}`.trim()},1118,[1119]); @@ -1436,7 +1436,7 @@ __d(function(g,r,i,_a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{ __d(function(_g,_r,i,_a,_m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.GiftTill=b,_e.GiftTillManager=y,_e.GiftShopManager=w,_e.PaymentsTestMode=S,_e.GiftCardsPage=function({me:e}){return(0,p.staffServer)()?(0,j.jsxs)(l.default,{style:{gap:10},children:[(0,j.jsx)(b,{me:e}),(0,x.can)('orders.manage')?(0,j.jsx)(y,{me:e}):null,(0,x.can)('venue.settings')?(0,j.jsx)(w,{me:e}):null,(0,x.can)('venue.settings')?(0,j.jsx)(S,{me:e}):null]}):(0,j.jsx)(r.Banner,{kind:"demo",title:"Gift cards are saved on the server",children:"Sign this device in to your venue to check and take gift cards. There are no example cards here."})};var e,t=_r(d[0]),s=_r(d[1]),n=_r(d[2]),a=_r(d[3]),l=(e=a)&&e.__esModule?e:{default:e},r=_r(d[4]),o=_r(d[5]),c=_r(d[6]),u=_r(d[7]),h=_r(d[8]),x=_r(d[9]),p=_r(d[10]),g=_r(d[11]),j=_r(d[12]);const f=e=>{if(!e)return'';try{return new Date(e).toLocaleDateString('en-GB',{day:'numeric',month:'short',year:'numeric',timeZone:'Europe/London'})}catch{return e.slice(0,10)}},m=({m:e})=>e?(0,j.jsx)(r.Banner,{kind:e.kind,title:e.text}):null;function b({me:e}){const[t,s]=(0,n.useState)(''),[a,x]=(0,n.useState)(null),[p,b]=(0,n.useState)(''),[y,w]=(0,n.useState)((0,u.redeemKey)()),[k,S]=(0,n.useState)(null),[T,C]=(0,n.useState)(!1),v=(0,u.poundsToPence)(p);return(0,j.jsx)(l.default,{testID:"gift-till",children:(0,j.jsx)(r.Card,{children:(0,j.jsxs)(l.default,{style:{gap:8},children:[(0,j.jsx)(r.T,{weight:"semibold",children:"Check a gift card or take it off the bill"}),(0,j.jsx)(r.Field,{label:"Gift card code",value:t,autoCapitalize:"characters",onChangeText:e=>{s(e),x(null),w((0,u.redeemKey)())},placeholder:"XXXX-XXXX-XXXX-XXXX",testID:"gift-code"}),(0,j.jsx)(r.Button,{label:T?'Checking\u2026':'Check balance',kind:"ghost",small:!0,disabled:T||t.replace(/\W/g,'').length<6,testID:"gift-check",onPress:async()=>{C(!0),S(null);try{const e=await(0,h.giftCheck)(t);x(e),e.found||S({kind:'warn',text:'No gift card with that code here.'})}catch(e){S({kind:'warn',text:(0,c.plainError)(e)})}finally{C(!1)}}}),a?.found?(0,j.jsxs)(l.default,{style:{gap:4},testID:"gift-card-found",children:[(0,j.jsxs)(r.Row,{style:{justifyContent:'space-between'},children:[(0,j.jsx)(r.T,{weight:"medium",children:(0,u.prettyGiftCode)(t)}),(0,j.jsx)(r.T,{size:20,weight:"bold",colour:g.colours.gold,children:(0,o.gbp)(a.balancePence)})]}),(0,j.jsxs)(r.Muted,{size:12,children:[u.STATUS_WORDS[a.status]??a.status," \xb7 of ",(0,o.gbp)(a.initialPence),a.expiresAt?` \xb7 use by ${f(a.expiresAt)}`:'','wix'===a.source?' \xb7 old website bookings card':'']}),'active'===a.status?(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(r.Field,{label:"Amount to take off \xa3",value:p,onChangeText:b,keyboardType:"decimal-pad",testID:"gift-amount"}),(0,j.jsx)(r.Button,{label:T?'Taking it off\u2026':v?`Take ${(0,o.gbp)(v)} off the card`:'Take it off the card',disabled:T||!v||v>a.balancePence,testID:"gift-redeem",onPress:async()=>{C(!0),S(null);try{const s=await(0,h.giftRedeem)(t,v,y,e);x({...a,...s,found:!0}),b(''),w((0,u.redeemKey)()),S({kind:'success',text:`${s.already?'Already taken: ':'Taken '}${(0,o.gbp)(s.redeemedPence)}. ${(0,o.gbp)(s.balancePence)} left on the card.`})}catch(e){S({kind:'warn',text:(0,c.plainError)(e)})}finally{C(!1)}}})]}):null]}):null,(0,j.jsx)(m,{m:k})]})})})}function y({me:e}){const[t,s]=(0,n.useState)([]),[a,x]=(0,n.useState)([]),[p,b]=(0,n.useState)(null),[y,w]=(0,n.useState)(''),[k,S]=(0,n.useState)(''),[T,C]=(0,n.useState)(null),[v,P]=(0,n.useState)(null),I=(0,n.useCallback)(()=>{(0,h.waitingCards)().then(s).catch(()=>{}),(0,h.shopOrders)().then(x).catch(()=>{})},[]);(0,n.useEffect)(()=>{I()},[I]);const D=async(e,t)=>{b(null);try{await e(),b({kind:'success',text:t}),I()}catch(e){b({kind:'warn',text:(0,c.plainError)(e)})}},M=t.filter(e=>'waiting-payment'===e.status),_=a.filter(e=>!['collected','cancelled'].includes(e.status)),B=(0,u.poundsToPence)(y);return(0,j.jsxs)(l.default,{style:{gap:10},children:[(0,j.jsx)(l.default,{testID:"gift-waiting",children:(0,j.jsx)(r.Card,{children:(0,j.jsxs)(l.default,{style:{gap:6},children:[(0,j.jsxs)(r.T,{weight:"semibold",children:["Waiting for payment at the till (",M.length+_.filter(e=>'waiting-payment'===e.status).length,")"]}),(0,j.jsx)(r.Muted,{size:12,children:"Card payment in the app isn\u2019t on yet. Take the money at the till, then mark it paid here."}),M.map(t=>(0,j.jsxs)(r.Row,{style:{justifyContent:'space-between'},children:[(0,j.jsxs)(l.default,{style:{flex:1},children:[(0,j.jsxs)(r.T,{children:["Gift card ",t.ref," \xb7 ",(0,o.gbp)(t.initial_pence)]}),(0,j.jsxs)(r.Muted,{size:12,children:["for ",t.recipient_name||'no name'," \xb7 ends ",t.last4]})]}),(0,j.jsx)(r.Button,{label:"Paid at the till",small:!0,testID:`gift-paid-${t.ref}`,onPress:()=>D(()=>(0,h.giftActivate)(t.id,e),`${t.ref} is ready to use`)})]},t.id)),_.map(t=>(0,j.jsxs)(l.default,{style:{gap:4},children:[(0,j.jsxs)(r.Row,{style:{justifyContent:'space-between'},children:[(0,j.jsxs)(l.default,{style:{flex:1},children:[(0,j.jsxs)(r.T,{children:["Shop ",t.ref," \xb7 ",t.guest_name," \xb7 ",(0,o.gbp)(t.total_pence)]}),(0,j.jsxs)(r.Muted,{size:12,children:[t.lines.map(e=>`${e.qty}\xd7 ${e.name}`).join(', ')," \xb7 ",u.STATUS_WORDS[t.status]]})]}),'waiting-payment'===t.status?(0,j.jsx)(r.Button,{label:"Paid at the till",small:!0,onPress:()=>D(()=>(0,h.shopStatus)(t.id,'paid','',e),`${t.ref} paid`)}):'paid'===t.status?(0,j.jsx)(r.Button,{label:"Ready",small:!0,onPress:()=>D(()=>(0,h.shopStatus)(t.id,'ready','',e),`${t.ref} ready`)}):(0,j.jsx)(r.Button,{label:"Collected",small:!0,onPress:()=>D(()=>(0,h.shopStatus)(t.id,'collected','',e),`${t.ref} collected`)})]}),v&&v.id===t.id?(0,j.jsxs)(r.Row,{style:{gap:6,alignItems:'flex-end'},children:[(0,j.jsx)(l.default,{style:{flex:1},children:(0,j.jsx)(r.Field,{label:"Reason",value:v.reason,onChangeText:e=>P({id:t.id,reason:e})})}),(0,j.jsx)(r.Button,{label:"Cancel order",kind:"danger",small:!0,disabled:v.reason.trim().length<3,onPress:()=>D(()=>(0,h.shopStatus)(t.id,'cancelled',v.reason,e),`${t.ref} cancelled, stock put back`).then(()=>P(null))})]}):(0,j.jsx)(r.Button,{label:"Cancel with a reason",kind:"ghost",small:!0,onPress:()=>P({id:t.id,reason:''})})]},t.id)),M.length||_.length?null:(0,j.jsx)(r.Muted,{children:"Nothing waiting."})]})})}),(0,j.jsx)(l.default,{testID:"gift-sell",children:(0,j.jsx)(r.Card,{children:(0,j.jsxs)(l.default,{style:{gap:6},children:[(0,j.jsx)(r.T,{weight:"semibold",children:"Sell a gift card at the till"}),(0,j.jsx)(r.Field,{label:"Amount \xa3",value:y,onChangeText:w,keyboardType:"decimal-pad",testID:"gift-sell-amount"}),(0,j.jsx)(r.Field,{label:"Who it\u2019s for (optional)",value:k,onChangeText:S}),(0,j.jsx)(r.Button,{label:B?`Paid ${(0,o.gbp)(B)} at the till: make the card`:'Make the card',small:!0,disabled:!B,testID:"gift-sell-btn",onPress:()=>D(async()=>{const t=await(0,h.giftIssue)(B,k,e);C(t),w(''),S('')},'Card made')}),T?.code?(0,j.jsxs)(l.default,{style:{gap:2},children:[(0,j.jsx)(r.T,{size:22,weight:"bold",colour:g.colours.gold,center:!0,children:T.code}),(0,j.jsxs)(r.Muted,{center:!0,size:12,children:["Shown once: write it on the card or receipt now. ",(0,o.gbp)(T.initialPence),", use by ",f(T.expiresAt),"."]})]}):null]})})}),(0,j.jsx)(m,{m:p})]})}function w({me:e}){const[t,s]=(0,n.useState)(null),[a,x]=(0,n.useState)(''),[p,b]=(0,n.useState)(null),[y,w]=(0,n.useState)([]),[k,S]=(0,n.useState)({name:'',price:'',details:''}),[T,C]=(0,n.useState)(null),[v,P]=(0,n.useState)({code:'',bal:''}),[I,D]=(0,n.useState)([]),[M,_]=(0,n.useState)(null),B=(0,n.useCallback)(()=>{(0,h.readShopSettings)().then(e=>{s(e),x(e.amounts.map(e=>String(e/100)).join(', '))}).catch(e=>C({kind:'warn',text:(0,c.plainError)(e)})),(0,h.readProducts)().then(w).catch(()=>{}),(0,h.giftSummary)().then(b).catch(()=>{}),(0,h.waitingCards)().then(D).catch(()=>{})},[]);(0,n.useEffect)(()=>{B()},[B]);const R=async(e,t)=>{C(null);try{await e(),C({kind:'success',text:t}),B()}catch(e){C({kind:'warn',text:(0,c.plainError)(e)})}};if(!t)return(0,j.jsx)(r.Card,{children:(0,j.jsx)(r.Muted,{children:T?.text??'Loading\u2026'})});const z=(0,u.amountsFromText)(a);return(0,j.jsxs)(l.default,{style:{gap:10},children:[p?(0,j.jsx)(l.default,{testID:"gift-summary",children:(0,j.jsxs)(r.Row,{style:{gap:8},children:[(0,j.jsxs)(r.Card,{style:{flex:1},children:[(0,j.jsx)(r.Muted,{children:"Sold (paid)"}),(0,j.jsx)(r.T,{size:20,weight:"bold",children:(0,o.gbp)(p.soldPence)})]}),(0,j.jsxs)(r.Card,{style:{flex:1},children:[(0,j.jsx)(r.Muted,{children:"Still to spend"}),(0,j.jsx)(r.T,{size:20,weight:"bold",children:(0,o.gbp)(p.outstandingPence)})]}),(0,j.jsxs)(r.Card,{style:{flex:1},children:[(0,j.jsx)(r.Muted,{children:"Waiting"}),(0,j.jsx)(r.T,{size:20,weight:"bold",children:p.waiting})]})]})}):null,(0,j.jsx)(l.default,{testID:"gift-settings",children:(0,j.jsx)(r.Card,{children:(0,j.jsxs)(l.default,{style:{gap:8},children:[(0,j.jsx)(r.T,{weight:"semibold",children:"Gift cards and shop settings"}),(0,j.jsx)(r.Toggle,{label:"Sell gift cards in the customer app",value:t.giftsOn,onChange:e=>s({...t,giftsOn:e}),testID:"gift-on"}),(0,j.jsx)(r.Toggle,{label:"Open the shop in the customer app",value:t.shopOn,onChange:e=>s({...t,shopOn:e}),testID:"shop-on"}),(0,j.jsxs)(r.T,{children:["Cards last ",(0,u.expiryWords)(t.expiryMonths)," from when they\u2019re paid"]}),(0,j.jsx)(r.Stepper,{value:t.expiryMonths,min:1,max:60,label:"Gift card expiry in months",onChange:e=>s({...t,expiryMonths:e})}),(0,j.jsx)(r.Field,{label:"Amounts guests can pick (\xa3, comma between)",value:a,onChangeText:x,testID:"gift-amounts"}),(0,j.jsx)(r.Field,{label:"Terms shown to guests (optional)",value:t.terms,onChangeText:e=>s({...t,terms:e}),multiline:!0}),(0,j.jsx)(r.Muted,{size:12,children:"Gift cards are sold through your website. Guests can also pay at the bar or till."}),(0,j.jsx)(r.Button,{label:"Save",disabled:!z,testID:"gift-settings-save",onPress:()=>R(()=>(0,h.saveShopSettings)({...t,amounts:z}),'Saved. The customer app shows it next time it opens.')})]})})}),(0,j.jsx)(l.default,{testID:"shop-products",children:(0,j.jsx)(r.Card,{children:(0,j.jsxs)(l.default,{style:{gap:8},children:[(0,j.jsx)(r.T,{weight:"semibold",children:"Shop products"}),y.map(e=>(0,j.jsxs)(l.default,{style:{gap:4,borderTopWidth:1,borderColor:g.colours.border,paddingTop:6},children:[(0,j.jsxs)(r.Row,{style:{justifyContent:'space-between'},children:[(0,j.jsx)(r.T,{weight:"medium",style:{flex:1},children:e.name}),(0,j.jsx)(r.T,{children:(0,o.gbp)(e.price_pence)})]}),(0,j.jsxs)(r.Row,{style:{justifyContent:'space-between',alignItems:'center'},children:[(0,j.jsx)(l.default,{style:{flex:1},children:(0,j.jsx)(r.Toggle,{label:e.is_live?'In the shop':'Hidden',a11y:`${e.name} in the shop`,value:e.is_live,onChange:t=>R(()=>(0,h.saveProduct)({id:e.id,name:e.name,details:e.details,pricePence:e.price_pence,stock:e.stock,live:t}),'Saved')})}),(0,j.jsxs)(l.default,{style:{alignItems:'flex-end'},children:[(0,j.jsx)(r.Muted,{size:12,children:"Stock"}),(0,j.jsx)(r.Stepper,{value:e.stock,min:0,max:500,label:`${e.name} stock`,onChange:t=>R(()=>(0,h.saveProduct)({id:e.id,name:e.name,details:e.details,pricePence:e.price_pence,stock:t,live:e.is_live}),'Stock saved')})]})]}),0===e.stock?(0,j.jsx)(r.Badge,{kind:"amber",label:"Sold out"}):null]},e.id)),y.length?null:(0,j.jsx)(r.Muted,{children:"No products yet."}),(0,j.jsx)(r.Field,{label:"New product name",value:k.name,onChangeText:e=>S({...k,name:e}),testID:"shop-new-name"}),(0,j.jsx)(r.Field,{label:"Price \xa3",value:k.price,onChangeText:e=>S({...k,price:e}),keyboardType:"decimal-pad",testID:"shop-new-price"}),(0,j.jsx)(r.Field,{label:"Details (optional)",value:k.details,onChangeText:e=>S({...k,details:e})}),(0,j.jsx)(r.Button,{label:"Add product (hidden until you switch it on)",kind:"ghost",small:!0,disabled:k.name.trim().length<2||!(0,u.poundsToPence)(k.price),onPress:()=>R(async()=>{await(0,h.saveProduct)({name:k.name,details:k.details,pricePence:(0,u.poundsToPence)(k.price),stock:0,live:!1}),S({name:'',price:'',details:''})},'Product added')})]})})}),(0,j.jsx)(l.default,{testID:"gift-wix",children:(0,j.jsx)(r.Card,{children:(0,j.jsxs)(l.default,{style:{gap:6},children:[(0,j.jsx)(r.T,{weight:"semibold",children:"Honour an old website bookings gift card"}),(0,j.jsx)(r.Muted,{size:12,children:"Check the balance in your website bookings dashboard first. Each website bookings code can be added once."}),(0,j.jsx)(r.Field,{label:"Website bookings code",value:v.code,autoCapitalize:"characters",onChangeText:e=>P({...v,code:e})}),(0,j.jsx)(r.Field,{label:"Balance you checked in website bookings \xa3",value:v.bal,keyboardType:"decimal-pad",onChangeText:e=>P({...v,bal:e})}),(0,j.jsx)(r.Button,{label:"Add to CoverCharge",kind:"ghost",small:!0,disabled:v.code.replace(/\W/g,'').length<6||!(0,u.poundsToPence)(v.bal),onPress:()=>R(async()=>{await(0,h.giftHonourWix)(v.code,(0,u.poundsToPence)(v.bal),e),P({code:'',bal:''})},'Website bookings card added')})]})})}),(0,j.jsx)(l.default,{testID:"gift-list",children:(0,j.jsx)(r.Card,{children:(0,j.jsxs)(l.default,{style:{gap:4},children:[(0,j.jsx)(r.T,{weight:"semibold",children:"Recent cards"}),I.map(t=>(0,j.jsxs)(l.default,{style:{gap:2},children:[(0,j.jsxs)(r.Row,{style:{justifyContent:'space-between'},children:[(0,j.jsxs)(r.T,{style:{flex:1},children:[t.ref," \xb7 ends ",t.last4," \xb7 ",'wix'===t.source?'Website bookings':'till'===t.source?'Till':'App']}),(0,j.jsxs)(r.T,{children:[(0,o.gbp)(t.balance_pence)," / ",(0,o.gbp)(t.initial_pence)]})]}),(0,j.jsxs)(r.Row,{style:{justifyContent:'space-between'},children:[(0,j.jsxs)(r.Muted,{size:12,children:[u.STATUS_WORDS[t.status]??t.status,t.expires_at?` \xb7 use by ${f(t.expires_at)}`:'']}),'void'!==t.status&&M?.id!==t.id?(0,j.jsx)(r.Button,{label:"Cancel card",kind:"ghost",small:!0,onPress:()=>_({id:t.id,reason:''})}):null]}),M&&M.id===t.id?(0,j.jsxs)(r.Row,{style:{gap:6,alignItems:'flex-end'},children:[(0,j.jsx)(l.default,{style:{flex:1},children:(0,j.jsx)(r.Field,{label:"Reason",value:M.reason,onChangeText:e=>_({id:t.id,reason:e})})}),(0,j.jsx)(r.Button,{label:"Cancel it",kind:"danger",small:!0,disabled:M.reason.trim().length<3,onPress:()=>R(()=>(0,h.giftVoid)(t.id,M.reason,e),'Card cancelled (kept on record)').then(()=>_(null))})]}):null]},t.id)),I.length?null:(0,j.jsx)(r.Muted,{children:"No cards yet."})]})})}),(0,j.jsx)(m,{m:T})]})}const k={none:'Pay at the till only',stripe:'Stripe (test mode)',wix:'Website bookings payments (coming)'};function S({me:e}){if(t.IS_GREENSIDE)return(0,j.jsx)(s.GreensideCashOnly,{});const[a,u]=(0,n.useState)(null),[x,p]=(0,n.useState)([]),[g,b]=(0,n.useState)(null),y=(0,n.useCallback)(()=>{(0,h.readPaySettings)().then(u).catch(e=>b({kind:'warn',text:(0,c.plainError)(e)})),(0,h.recentPayments)().then(p).catch(()=>{})},[]);return(0,n.useEffect)(()=>{y()},[y]),a?(0,j.jsx)(l.default,{testID:"pay-settings",children:(0,j.jsx)(r.Card,{children:(0,j.jsxs)(l.default,{style:{gap:8},children:[(0,j.jsxs)(r.Row,{style:{justifyContent:'space-between',alignItems:'center'},children:[(0,j.jsx)(r.T,{weight:"semibold",children:"Card payments"}),(0,j.jsx)(r.Badge,{kind:"amber",label:"TEST MODE"})]}),(0,j.jsx)(r.Banner,{kind:"demo",title:"Test mode only: no real money",children:"This build can\u2019t take live payments. Guests pay at the bar or till unless you switch on Stripe test mode below."}),(0,j.jsx)(r.Row,{wrap:!0,children:['none','stripe','wix'].map(e=>(0,j.jsx)(r.Chip,{label:k[e],selected:a.provider===e,onPress:()=>u({...a,provider:e,cardOn:'stripe'===e&&a.cardOn})},e))}),'stripe'===a.provider?(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(r.Field,{label:"Venue\u2019s Stripe account id (starts acct_)",value:a.account,autoCapitalize:"none",onChangeText:e=>u({...a,account:e.trim()}),placeholder:"acct_\u2026",testID:"pay-account"}),(0,j.jsx)(r.Muted,{size:12,children:"Money goes straight to the venue\u2019s own Stripe account. Never paste a key here."}),(0,j.jsx)(r.Toggle,{label:"Offer \u201cPay by card (test mode)\u201d in the customer app",value:a.cardOn,onChange:e=>u({...a,cardOn:e}),testID:"pay-card-on"}),(0,j.jsx)(r.Muted,{size:12,children:"Needs CoverCharge\u2019s Stripe sandbox to be set up first (Gordon\u2019s step). Until then guests see pay at the till."})]}):null,'wix'===a.provider?(0,j.jsx)(r.Banner,{kind:"demo",title:"Website bookings payments aren\u2019t linked yet",children:"Website bookings venues keep taking payments on their website. In the app, guests pay at the bar or till."}):null,(0,j.jsx)(r.Button,{label:"Save",testID:"pay-save",onPress:async()=>{b(null);try{await(0,h.savePaySettings)(a),b({kind:'success',text:'Saved'}),y()}catch(e){b({kind:'warn',text:(0,c.plainError)(e)})}}}),x.length?(0,j.jsxs)(l.default,{style:{gap:2},children:[(0,j.jsx)(r.T,{weight:"medium",children:"Recent test payments"}),x.map(e=>(0,j.jsxs)(r.Row,{style:{justifyContent:'space-between'},children:[(0,j.jsxs)(r.Muted,{children:['gift'===e.kind?'Gift card':'Shop'," \xb7 ",f(e.created_at)]}),(0,j.jsxs)(r.T,{children:[(0,o.gbp)(e.amount_pence)," \xb7 ",e.status]})]},e.id))]}):null,(0,j.jsx)(m,{m:g})]})})}):(0,j.jsx)(r.Card,{children:(0,j.jsx)(r.Muted,{children:g?.text??'Loading\u2026'})})}},1353,[5,1354,34,102,794,836,1203,1204,1205,985,1206,840,25]); __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.GreensideCashOnly=function(){return(0,s.jsxs)(n.Card,{children:[(0,s.jsx)(n.T,{weight:"semibold",children:"Cash only"}),(0,s.jsx)(n.Muted,{children:"Card payments and online checkout are not enabled for The Greenside Restaurant. Deposits are off; the policy needs confirmation."})]})},r(d[0]);var n=r(d[1]),s=r(d[2])},1354,[34,794,25]); __d(function(g,_r,i,a,_m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.CashUpAccessToggle=function({m:e}){const c=(0,o.useCashAccess)(s=>!0===s.byRef[e.id]),l=(0,o.useCashAccess)(e=>e.loaded),b=(0,r.useSync)(e=>'staff'===e.kind&&!!e.venueId),[y,C]=(0,s.useState)(!1),[m,x]=(0,s.useState)(null);if((0,s.useEffect)(()=>{b&&!l&&(0,u.refreshCashAccess)()},[b,l]),p(e))return(0,h.jsxs)(t.default,{testID:`cashup-access-${e.id}`,style:{gap:2},accessible:!0,accessibilityLabel:`${f(e)} can use cash up: always, as ${'owner'===e.role?'an owner':'a manager'}`,children:[(0,h.jsx)(n.T,{size:14,children:"Can use cash up"}),(0,h.jsxs)(n.Muted,{size:12,children:["Always on for ",'owner'===e.role?'owners':'managers',"."]})]});const j=async s=>{C(!0),x(null);const c=await(0,u.setStaffCashUp)(e.id,s);C(!1),x(c.ok?s?`${f(e)} can now open the cash up. The change is in the cash-up log.`:`${f(e)} can no longer open the cash up. The change is in the cash-up log.`:c.error??'Could not save.')};return(0,h.jsxs)(t.default,{testID:`cashup-access-${e.id}`,style:{gap:2},children:[(0,h.jsx)(n.Toggle,{testID:`cashup-toggle-${e.id}`,label:"Can use cash up",value:c,disabled:y||!b,onChange:e=>{j(e)}}),(0,h.jsx)(n.Muted,{size:12,children:b?c?'Can open the cash up, take a picture of the taking sheet and upload a spreadsheet.':'Off: the cash up is hidden from them and the server refuses it.':'Connect to the shared team to change this.'}),m?(0,h.jsx)(t.default,{accessibilityLiveRegion:"polite",children:(0,h.jsx)(n.Muted,{size:12,testID:`cashup-msg-${e.id}`,children:m})}):null]})},_e.CashUpAccessBadge=function({m:e}){const s=(0,o.useCashAccess)(s=>!0===s.byRef[e.id]);return p(e)||s?(0,h.jsx)(t.default,{accessible:!0,accessibilityLabel:`${f(e)} can use cash up`,testID:`cashup-badge-${e.id}`,children:(0,h.jsx)(n.Badge,{kind:"gold",label:"Cash up"})}):null},_e.NoCashUpAccess=function(){return(0,h.jsxs)(t.default,{testID:"cashup-no-access",accessible:!0,accessibilityRole:"text",accessibilityLabel:"You can't use the cash up yet. A manager can switch it on for you in Staff and roles.",style:{borderWidth:1,borderColor:l.colours.border,borderRadius:14,padding:16,gap:6,backgroundColor:l.colours.surface},children:[(0,h.jsx)(n.T,{size:18,weight:"semibold",children:"You can\u2019t use the cash up yet"}),(0,h.jsx)(n.T,{children:"A manager can switch it on for you in Staff & roles (\u201cCan use cash up\u201d)."})]})};var e,s=_r(d[0]),c=_r(d[1]),t=(e=c)&&e.__esModule?e:{default:e},n=_r(d[2]),l=_r(d[3]),o=_r(d[4]),u=_r(d[5]),r=_r(d[6]),h=_r(d[7]);const p=e=>'owner'===e.role||'manager'===e.role&&!e.managerAccess,f=e=>e.name.replace(' (example)','').split(' ')[0]},1355,[34,102,794,840,993,1037,985,25]); -__d(function(g,_r,_i,_a,m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.Bookings=function({go:e}={}){const{rid:C,r:X,now:Z,today:ee,me:se,role:te}=(0,p.useCtx)(1e4),le=(0,v.useBookings)(C),ne=(0,p.useInStaffApp)(),ie=(0,p.useShiftManager)(),ae=(0,v.useWaitlist)(C),[oe,de]=((0,v.useStore)(e=>e.alertAcks),(0,T.useState)(ee)),re=(0,R.useFrontDoor)(oe),ue=(0,k.useBookingWrite)(),[ce,he]=(0,T.useState)(''),[ge,be]=(0,T.useState)(!1),[pe,ke]=(0,T.useState)(2),me=oee.date===oe).sort((e,s)=>e.time.localeCompare(s.time)),ye=ae.filter(e=>'waiting'===e.status||'notified'===e.status).sort((e,s)=>e.number-s.number),we=xe.filter(e=>'noshow'===e.status),je=(0,V.useSync)(e=>!!e.venueId&&'guest'!==e.kind),fe=xe.filter(e=>'cancelled'!==e.status).reduce((e,s)=>e+s.partySize,0),Ie=(0,c.cancelledDayTally)(le,oe),Be=(0,c.cancelledTallyWords)(Ie,oe===ee?'today':'that day'),Se=xe.filter(e=>!e.walkIn),De=xe.filter(e=>e.walkIn),$e=le.filter(e=>'pending'===e.status&&e.date>=ee).sort((e,s)=>(e.date+e.time).localeCompare(s.date+s.time)),[Te,Ce]=(0,T.useState)(null),Le=(0,M.parseYmd)(oe);Le.setHours(12);const Ne=(0,Q.hoursFor)(X,Le),Pe=Ne?.open??new Date(`${oe}T12:00:00`),ve=Ne?.close??new Date(`${oe}T21:00:00`),Oe=Ne||xe.length?me?'No one seated that day':oe===ee?'No bookings yet today':'No bookings yet':oe===ee?'Closed today':'Closed that day';return(0,J.jsxs)(L.default,{style:{gap:12},children:[e&&!ne&&'staff'!==te?(0,J.jsx)(N.Button,{testID:"bookings-dashboard-top",label:"Bookings dashboard",accessibilityLabel:"Open Bookings dashboard: table plan, Timeline, today's guests and Covers",onPress:()=>e('more','serviceboard'),style:{width:'100%',minHeight:60}}):null,s.IS_WILDINGS||(s.IS_QUEUED_VENUE||s.IS_KIRKTON||s.IS_GREENSIDE||'abbotsford'===C)&&!ne&&'staff'!==te?(0,J.jsx)(n.VenueRequestList,{rid:C,kind:"table"}):null,!s.IS_WILDINGS&&!X.settings.hotel?.enabled||ne||'staff'===te?null:(0,J.jsx)(n.VenueRequestList,{rid:C,kind:"room",hotel:X.settings.hotel??l.WILDINGS_HOTEL}),(0,J.jsx)(G.BookingsDayNav,{today:ee,date:oe,onDate:de,count:e=>le.filter(s=>s.date===e&&'cancelled'!==s.status).length,sub:e=>{const s=le.filter(s=>s.date===e&&'cancelled'!==s.status&&!s.walkIn),t=s.reduce((e,s)=>e+s.partySize,0);return`${s.length} ${1===s.length?'table':'tables'} \xb7 ${t} ${1===t?'Cover':'Covers'}`}}),(0,J.jsx)(L.default,{testID:"bookings-day-graph",style:{overflow:'visible'},children:(0,J.jsx)(q.DayGraph,{bare:!0,fill:!0,todays:xe,open:Pe,close:ve,now:Z,turnBase:X.settings.turnMins,height:128,past:me,closed:!Ne,emptyText:Oe})}),me?(0,J.jsxs)(L.default,{testID:"bookings-past-totals",style:[N.styles.card,{gap:4}],accessible:!0,accessibilityLabel:`${(0,G.longDay)(oe)}: ${Se.length} tables, ${fe} Covers, ${xe.filter(e=>'finished'===e.status).length} finished, ${we.length} no-shows, ${xe.filter(e=>'cancelled'===e.status).length} cancelled`,children:[(0,J.jsxs)(N.T,{size:17,weight:"semibold",children:["That day: ",Se.length," table",1===Se.length?'':'s',De.length?` \xb7 ${De.length} walk-in${1===De.length?'':'s'}`:''," \xb7 ",fe," ",1===fe?'Cover':'Covers']}),(0,J.jsxs)(N.T,{size:16,colour:A.colours.text,children:[xe.filter(e=>'finished'===e.status).length," finished \xb7 ",we.length," no-show",1===we.length?'':'s'," \xb7 ",xe.filter(e=>'cancelled'===e.status).length," cancelled"]}),(0,J.jsx)(N.Muted,{children:"Looking back: read-only. Undo is still there for a mistake made today."})]}):null,(0,J.jsx)(L.default,{testID:"bookings-summary",children:(0,J.jsxs)(N.T,{weight:"semibold",children:[Se.length," table",1===Se.length?'':'s'," booked",De.length?` \xb7 ${De.length} walk-in${1===De.length?'':'s'}`:''," \xb7 ",fe," ",1===fe?'Cover':'Covers']})}),(0,J.jsx)(L.default,{testID:"cancelled-day-tally",accessible:!0,accessibilityLabel:Be,style:{alignItems:'center'},children:(0,J.jsx)(N.T,{size:15,colour:A.colours.muted,center:!0,children:Be})}),(0,J.jsxs)(L.default,{testID:"bookings-actions",style:{flexDirection:'row',flexWrap:'wrap',gap:8},children:[me?null:(0,J.jsx)(I.QuietButton,{label:"New booking",onPress:re.openBooking,testID:"add-booking",disabled:!ue.ok,accessibilityHint:ue.hint}),ne&&ie&&oe===ee?(0,J.jsx)(I.QuietButton,{label:"Walk-in",onPress:re.openWalkIn,testID:"add-walkin",disabled:!ue.ok,accessibilityHint:ue.hint}):null,oe===ee?(0,J.jsx)(B.CloseGardenButton,{quiet:!0,short:!0,rid:C,r:X,now:Z,by:se}):null]}),$e.length?(0,J.jsxs)(L.default,{testID:"pending-requests",style:[N.styles.card,{borderColor:A.colours.amber,gap:8}],children:[(0,J.jsxs)(N.T,{weight:"semibold",colour:A.colours.amber,children:["Needs confirming (",$e.length,")"]}),(0,J.jsx)(N.Muted,{children:"Online requests outside your auto-accept rules. Check the details before confirming."}),$e.map(e=>(0,J.jsxs)(L.default,{style:{gap:6,paddingTop:6,borderTopWidth:1,borderColor:A.colours.border},children:[(0,J.jsxs)(N.T,{weight:"semibold",children:[e.name," \xb7 ",e.partySize," ",1===e.partySize?'Cover':'Covers']}),(0,J.jsxs)(N.Muted,{children:[(0,M.niceDate)((0,M.parseYmd)(e.date))," at ",e.time," \xb7 ",e.ref," \xb7 ",e.phone??'no phone']}),e.notes?(0,J.jsxs)(N.T,{size:16,children:["Notes: ",e.notes]}):null,e.allergies.length?(0,J.jsx)(N.Row,{wrap:!0,gap:4,children:e.allergies.map(e=>(0,J.jsx)(N.Badge,{kind:"red",label:`${(0,O.allergenLabel)(e.allergen)} \xb7 ${(0,O.severityLabel)(e.severity)}`},e.allergen))}):null,(0,J.jsx)(S.NeedsPills,{b:e,r:X}),'staff'!==te&&((0,D.needsHoldOk)(e)||e.date===ee&&e.holdOk&&(e.holds??[]).some(e=>!e.served)&&'seated'===e.status)?(0,J.jsxs)(N.Row,{wrap:!0,gap:6,children:[(0,D.needsHoldOk)(e)?(0,J.jsx)(N.Button,{small:!0,kind:"success",label:"Platter OK",testID:`mgr-platter-ok-${e.ref}`,onPress:()=>(0,S.confirmHolds)(e.id,se)}):null,e.holdOk&&'seated'===e.status?(0,J.jsx)(N.Button,{small:!0,kind:"secondary",label:"Platter served",onPress:()=>(0,S.serveHolds)(e,se,'owner')}):null]}):null,Te===e.id?(0,J.jsxs)(L.default,{style:{gap:6},children:[(0,J.jsxs)(N.T,{size:14,children:["Are you sure? ",e.name.split(' ')[0]," will get a polite \u201csorry, we can\u2019t fit you in\u201d message."]}),(0,J.jsxs)(N.Row,{gap:6,children:[(0,J.jsx)(N.Button,{small:!0,kind:"danger",label:"Yes, decline",onPress:()=>{v.repo.bookings.decide(e.id,'declined',se),Ce(null)}}),(0,J.jsx)(N.Button,{small:!0,kind:"ghost",label:"Keep it",onPress:()=>Ce(null)})]})]}):ue.ok?(0,J.jsxs)(N.Row,{gap:6,children:[(0,J.jsx)(N.Button,{small:!0,label:"Confirm",testID:`confirm-${e.ref}`,onPress:()=>v.repo.bookings.decide(e.id,'confirmed',se)}),(0,J.jsx)(N.Button,{small:!0,kind:"secondary",label:"Decline",onPress:()=>Ce(e.id)}),(0,J.jsx)(Y.WhatsAppGuest,{b:e,rid:C,kind:"change"})]}):(0,J.jsx)(L.default,{accessible:!0,accessibilityLabel:x.BOOKING_VIEW_ONLY,children:(0,J.jsx)(N.T,{children:x.BOOKING_VIEW_ONLY})}),(0,J.jsx)(F.ConfirmTimeline,{refId:e.id})]},e.id))]}):null,0===xe.length?(0,J.jsx)(N.Muted,{children:"No bookings for this day yet."}):null,xe.map(e=>{const s='confirmed'===e.status&&oe===ee&&(0,M.minsBetween)(new Date(`${e.date}T${e.time}:00`),Z)>15,t=(0,w.depositState)(e),l=(0,w.depositBadge)(e,W.gbp);return(0,J.jsxs)(L.default,{testID:(0,$.isSeatedHighlight)((0,D.shownStatus)(e))?`booking-seated-${e.id}`:`booking-row-${e.id}`,style:[N.styles.card,(0,$.isSeatedHighlight)((0,D.shownStatus)(e))?(0,$.seatedHighlightStyle)({borderColor:(0,D.hasAllergens)(e)?A.colours.red:A.colours.goldLight}):{borderColor:(0,D.hasAllergens)(e)?A.colours.red:s?A.colours.amber:A.colours.hairline,opacity:['finished','cancelled'].includes(e.status)?.55:1}],children:[(0,J.jsx)(S.AllergenBar,{b:e}),(0,J.jsxs)(N.Row,{style:{justifyContent:'space-between'},children:[(0,J.jsxs)(N.Row,{gap:6,style:{flex:1,minWidth:0,alignItems:'center'},children:[(0,J.jsxs)(N.T,{weight:"semibold",colour:(0,$.isSeatedHighlight)((0,D.shownStatus)(e))?$.SEATED_FG:A.colours.text,style:{flexShrink:1},children:[e.time," \xb7 ",(0,R.walkInLabel)(e)]}),(0,D.hasAllergens)(e)?(0,J.jsx)(P.AllergyIcon,{text:(0,D.allergenText)(e),size:20,colour:(0,$.isSeatedHighlight)((0,D.shownStatus)(e))?'#7A4A00':A.colours.amber,ink:(0,$.isSeatedHighlight)((0,D.shownStatus)(e))?A.colours.gold:A.colours.bg,testID:`booking-allergy-${e.id}`}):null]}),(0,J.jsx)(N.Badge,{kind:'seated'===(0,D.shownStatus)(e)?'ok':'noshow'===e.status?'red':'confirmed'===e.status?'gold':'pending'===e.status?'amber':'neutral',label:'noshow'===e.status?'No-show':'pending'===e.status?'Needs confirming':(0,D.shownStatus)(e)[0].toUpperCase()+(0,D.shownStatus)(e).slice(1)})]}),l?(0,J.jsx)(y.DepositChip,{b:e,money:!0,big:!0,testID:`deposit-chip-${e.id}`}):null,(0,$.isSeatedHighlight)((0,D.shownStatus)(e))?(0,J.jsxs)(N.T,{size:14,colour:$.SEATED_MUTED,children:[e.table?(0,z.tableCardLabel)(e.table):e.walkIn?'Table to assign':'Table TBC'," \xb7 ",e.ref]}):(0,J.jsxs)(N.Muted,{children:[e.table?(0,z.tableCardLabel)(e.table):e.walkIn?'Table to assign':'Table TBC'," \xb7 ",e.ref]}),e.notes?(0,J.jsxs)(N.T,{size:16,testID:`booking-notes-${e.id}`,children:["Notes: ",e.notes]}):null,l?(0,J.jsxs)(N.Row,{wrap:!0,gap:6,style:{alignItems:'center'},children:[me||!(0,w.canTickDeposit)(e)||['cancelled','finished'].includes(e.status)?null:(0,J.jsx)(N.Button,{small:!0,kind:"secondary",label:"Mark deposit paid",testID:`deposit-paid-${e.id}`,accessibilityLabel:`Mark deposit paid for ${(0,R.walkInLabel)(e)}`,onPress:()=>v.repo.bookings.update(e.id,{depositPaid:e.depositDue??0,depositPaidBy:se,depositPaidAt:(new Date).toISOString()})}),me?null:(0,J.jsx)(j.WixDepositLink,{b:e,rid:C}),'paid'===t&&e.depositPaidBy?(0,J.jsx)(N.Muted,{size:13,children:'Wix deposit link'===e.depositPaidBy?'Paid through a website bookings deposit link':`Ticked by ${e.depositPaidBy}`}):null]}):null,e.walkIn?null:(0,J.jsxs)(N.Muted,{children:[(0,K.bookingSource)(e),e.phone?` \xb7 ${e.phone}`:'',e.email?` \xb7 ${e.email}`:'']}),e.allergies.length?(0,J.jsx)(N.Row,{wrap:!0,gap:4,children:e.allergies.map(e=>(0,J.jsx)(N.Badge,{kind:"red",label:`${(0,O.allergenLabel)(e.allergen)} \xb7 ${(0,O.severityLabel)(e.severity)}`},e.allergen))}):null,(0,D.hasAllergens)(e)&&!['cancelled','noshow'].includes(e.status)?(0,J.jsx)(U.BookingAllergyChain,{b:e,me:se}):null,e.walkIn?null:(0,J.jsx)(F.ConfirmTimeline,{refId:e.id,noPhone:!!e.source&&!e.phone}),s?(0,J.jsxs)(N.T,{size:13,colour:A.colours.amber,children:["Running ",(0,M.minsBetween)(new Date(`${e.date}T${e.time}:00`),Z)," min late. Call them, then mark no-show if needed."]}):null,(0,J.jsxs)(N.Row,{wrap:!0,gap:6,children:[(0,J.jsx)(r.BookingTableButton,{rid:C,booking:e,readOnly:me||!ue.ok,turnBase:X.settings.turnMins}),ue.ok?null:(0,J.jsx)(L.default,{accessible:!0,accessibilityLabel:x.BOOKING_VIEW_ONLY,children:(0,J.jsx)(N.T,{children:x.BOOKING_VIEW_ONLY})}),ue.ok?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(u.BookingEditButton,{rid:C,booking:e,who:se,role:te,inStaffApp:ne,shiftManager:ie}),me||e.table||!['seated','confirmed'].includes(e.status)?null:(0,J.jsx)(N.Button,{small:!e.walkIn,kind:e.walkIn?'primary':'secondary',label:"Assign table",onPress:()=>re.assignTable(e)}),!me&&['seated','confirmed'].includes(e.status)?(0,J.jsx)(N.Button,{small:!0,kind:"secondary",label:(0,z.tablesOf)(e.table).length>1?'Change tables':'Combine tables',testID:`combine-${e.id}`,accessibilityLabel:`${(0,z.tablesOf)(e.table).length>1?'Change tables':'Combine tables'} for ${(0,R.walkInLabel)(e)}`,onPress:()=>re.combineTables(e)}):null,me||'confirmed'!==e.status?null:(0,J.jsxs)(J.Fragment,{children:[e.date===ee?(0,J.jsx)(N.Button,{small:!0,label:"Seat",accessibilityLabel:`Seat ${(0,R.walkInLabel)(e)} now`,onPress:()=>(0,R.seatBookingNow)(C,e)}):null,(0,J.jsx)(N.Button,{small:!0,kind:"secondary",label:"No-show",onPress:()=>v.repo.bookings.setStatus(e.id,'noshow')})]}),me||e.walkIn?null:(0,J.jsx)(d.CancelBookingButton,{rid:C,b:e,name:(0,R.walkInLabel)(e),small:!0,onDone:()=>{}}),me||e.walkIn?null:(0,J.jsx)(d.ReinstateBookingButton,{b:e,name:(0,R.walkInLabel)(e),today:ee}),me||'seated'!==e.status?null:(0,J.jsx)(N.Button,{small:!0,kind:"secondary",label:"Finished",accessibilityLabel:`Finished: ${(0,R.walkInLabel)(e)}, table needs clearing`,onPress:()=>(0,R.finishBookingNow)(C,e)}),['confirmed','pending'].includes(e.status)&&e.date>=ee?(0,J.jsx)(Y.WhatsAppGuest,{b:e,rid:C,kind:"auto"}):null,ne?null:(0,J.jsx)(f.CopyReviewLink,{rid:C,bookingId:e.id}),!me&&e.walkIn?(0,J.jsx)(o.CancelWalkInButton,{rid:C,b:e,small:!0}):null,!me&&e.walkIn?(0,J.jsx)(o.ReinstateWalkInButton,{rid:C,b:e,today:ee,small:!0}):null,(0,J.jsx)(H.BookingUndo,{b:e,rid:C,today:ee,who:(0,R.walkInLabel)(e)})]}):null]}),'noshow'===e.status&&'paid'===t?(0,J.jsx)(N.Muted,{size:13,children:"A deposit was paid. Keep or refund it by your deposit terms (Settings \u203a Advanced \u203a Deposits). Deposits paid through website bookings are refunded in Website bookings \u203a Orders."}):null]},e.id)}),(0,J.jsx)(b.CancellationsSection,{testID:"bookings-cancellations",items:(0,h.cancellationsFor)(le,oe,e=>e.walkIn?`Walk-in ${e.ref}`:(e.name??'').replace(' (example)','')),dayWord:oe===ee?'today':'that day'}),(0,J.jsxs)(N.Card,{children:[(0,J.jsxs)(N.Row,{style:{justifyContent:'space-between'},children:[(0,J.jsx)(N.T,{weight:"semibold",children:"No-shows"}),(0,J.jsx)(N.Badge,{kind:we.length?'red':'ok',label:`${we.length} ${oe===ee?'today':(0,M.niceDate)((0,M.parseYmd)(oe)).slice(0,6)}${je||a.LIVE_VENUE_BUILD?'':' \xb7 4.1% last 28 days (example)'}`})]}),(0,J.jsx)(N.Muted,{children:we.length?`Marked no-show today: ${we.slice(0,6).map(e=>`${e.time} ${(0,R.walkInLabel)(e)}`).join(', ')}${we.length>6?` and ${we.length-6} more`:''}. If they turn up, open the booking and tap Undo no-show.`:'No no-shows today. If a party doesn\u2019t arrive, call them first, then tap No-show on their booking.'})]}),s.IS_GREENSIDE?(0,J.jsx)(t.GreensideCashOnly,{}):(0,J.jsxs)(N.Card,{children:[(0,J.jsx)(N.T,{weight:"semibold",children:"Deposits"}),(0,J.jsx)(N.Muted,{testID:"deposits-card-text",children:(()=>{const e=(0,w.depositOf)(X.settings);return e.on&&e.perPersonPence>0?`Deposits: ${(0,W.gbp)(e.perPersonPence)} per person for parties of ${e.fromParty} or more. Deposits are paid through website bookings. Website bookings show Deposit paid on website bookings by themselves once the guest has paid. For phone and walk-in bookings, tick Deposit paid once the guest has paid you${e.wixLinksOn?', or press Send deposit link':''}.`:'Deposits are off. Turn them on in Settings \u203a Advanced \u203a Deposits.'})()}),(0,J.jsx)(N.Muted,{size:13,children:"Tip: refunds are done in Website bookings \u203a Orders. Booking deposit amounts are visible in Managers, Display and Staff."})]}),ye.length>0||ge?(0,J.jsxs)(L.default,{style:{gap:10},children:[(0,J.jsx)(E.SectionHead,{title:`Waitlist (${ye.length})`,sub:`New party waits about ${(0,_.estimateWait)(ye.length+1,X.settings.turnMins,1)} min (estimate)`}),ye.map((e,s)=>(0,J.jsxs)(L.default,{style:N.styles.card,children:[(0,J.jsxs)(N.Row,{style:{justifyContent:'space-between'},children:[(0,J.jsxs)(N.T,{weight:"semibold",children:["#",e.number," ",e.name," \xb7 ",e.partySize]}),(0,J.jsxs)(N.Muted,{children:[(0,M.minsBetween)(new Date(e.joinedAt),Z)," min \xb7 est. ",(0,_.estimateWait)(s+1,X.settings.turnMins,1)," min"]})]}),'notified'===e.status?(0,J.jsx)(N.Badge,{kind:"ok",label:"Marked as told: table ready (no text is sent)"}):null,(0,J.jsxs)(N.Row,{gap:6,children:['waiting'===e.status?(0,J.jsx)(N.Button,{small:!0,kind:"secondary",label:"Notify",onPress:()=>v.repo.waitlist.setStatus(e.id,'notified')}):null,(0,J.jsx)(N.Button,{small:!0,label:"Seat",onPress:()=>v.repo.waitlist.setStatus(e.id,'seated')}),(0,J.jsx)(N.Button,{small:!0,kind:"ghost",label:"Remove",onPress:()=>v.repo.waitlist.setStatus(e.id,'removed')})]})]},e.id)),(0,J.jsxs)(N.Row,{gap:6,children:[(0,J.jsx)(i.TextInput,{accessibilityLabel:"Waitlist name",placeholder:"Name for the waitlist",placeholderTextColor:"#7D776C",value:ce,onChangeText:he,style:[N.styles.input,{flex:1}]}),(0,J.jsx)(N.Stepper,{value:pe,onChange:ke,min:1,max:12,label:"party"})]}),(0,J.jsx)(N.Button,{kind:"secondary",label:"Add to waitlist",disabled:ce.trim().length<2,onPress:()=>{v.repo.waitlist.join(C,ce.trim(),pe),he('')}})]}):(0,J.jsx)(N.Button,{kind:"ghost",label:"Open waitlist",onPress:()=>be(!0),accessibilityLabel:"Open the empty waitlist to add a waiting party"}),re.elements]})};var e,s=_r(_d[0]),t=_r(_d[1]),l=_r(_d[2]),n=_r(_d[3]),i=_r(_d[4]),a=_r(_d[5]),o=_r(_d[6]),d=_r(_d[7]),r=_r(_d[8]),u=_r(_d[9]),c=_r(_d[10]),h=_r(_d[11]),b=_r(_d[12]),p=_r(_d[13]),k=_r(_d[14]),x=_r(_d[15]),y=_r(_d[16]),w=_r(_d[17]),j=_r(_d[18]),f=_r(_d[19]),I=_r(_d[20]),B=_r(_d[21]),S=_r(_d[22]),D=_r(_d[23]),$=_r(_d[24]),T=_r(_d[25]),C=_r(_d[26]),L=(e=C)&&e.__esModule?e:{default:e},N=_r(_d[27]),P=_r(_d[28]),v=_r(_d[29]),O=_r(_d[30]),W=_r(_d[31]),M=_r(_d[32]),_=_r(_d[33]),A=_r(_d[34]),E=_r(_d[35]),R=_r(_d[36]),z=_r(_d[37]),H=_r(_d[38]),G=_r(_d[39]),U=_r(_d[40]),F=_r(_d[41]),K=_r(_d[42]),V=_r(_d[43]),Y=_r(_d[44]),q=_r(_d[45]),Q=_r(_d[46]),J=_r(_d[47])},1356,[5,1354,11,1357,796,806,1112,1113,1091,1115,1114,1328,1329,1100,1282,1012,1089,14,1358,1186,1359,1316,1081,1075,1090,34,102,794,1291,848,830,836,827,1267,840,1147,1096,1014,1360,1361,1136,1362,1177,985,1149,1324,852,25]); +__d(function(g,_r,_i,_a,m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.Bookings=function({go:e}={}){const{rid:L,r:Z,now:ee,today:se,me:te,role:le}=(0,k.useCtx)(1e4),ne=(0,O.useBookings)(L),ie=(0,k.useInStaffApp)(),ae=(0,k.useShiftManager)(),oe=(0,O.useWaitlist)(L),[de,re]=((0,O.useStore)(e=>e.alertAcks),(0,C.useState)(se)),ue=(0,z.useFrontDoor)(de),ce=(0,x.useBookingWrite)(),[he,ge]=(0,C.useState)(''),[be,pe]=(0,C.useState)(!1),[ke,me]=(0,C.useState)(2),xe=dee.date===de).sort((e,s)=>e.time.localeCompare(s.time)),we=oe.filter(e=>'waiting'===e.status||'notified'===e.status).sort((e,s)=>e.number-s.number),je=ye.filter(e=>'noshow'===e.status),fe=(0,Y.useSync)(e=>!!e.venueId&&'guest'!==e.kind),Ie=ye.filter(e=>'cancelled'!==e.status).reduce((e,s)=>e+s.partySize,0),Be=(0,h.cancelledDayTally)(ne,de),De=(0,h.cancelledTallyWords)(Be,de===se?'today':'that day'),Se=ye.filter(e=>!e.walkIn),$e=ye.filter(e=>e.walkIn),Te=ne.filter(e=>'pending'===e.status&&e.date>=se).sort((e,s)=>(e.date+e.time).localeCompare(s.date+s.time)),[Ce,Le]=(0,C.useState)(null),Ne=(0,E.parseYmd)(de);Ne.setHours(12);const Pe=(0,J.hoursFor)(Z,Ne),ve=Pe?.open??new Date(`${de}T12:00:00`),Oe=Pe?.close??new Date(`${de}T21:00:00`),We=Pe||ye.length?xe?'No one seated that day':de===se?'No bookings yet today':'No bookings yet':de===se?'Closed today':'Closed that day';return(0,X.jsxs)(N.default,{style:{gap:12},children:[e&&!ie&&'staff'!==le?(0,X.jsx)(P.Button,{testID:"bookings-dashboard-top",label:"Bookings dashboard",accessibilityLabel:"Open Bookings dashboard: table plan, Timeline, today's guests and Covers",onPress:()=>e('more','serviceboard'),style:{width:'100%',minHeight:60}}):null,s.IS_WILDINGS||(s.IS_QUEUED_VENUE||s.IS_KIRKTON||s.IS_GREENSIDE||'abbotsford'===L)&&!ie&&'staff'!==le?(0,X.jsx)(n.VenueRequestList,{rid:L,kind:"table"}):null,!s.IS_WILDINGS&&!Z.settings.hotel?.enabled||ie||'staff'===le?null:(0,X.jsx)(n.VenueRequestList,{rid:L,kind:"room",hotel:Z.settings.hotel??l.WILDINGS_HOTEL}),(0,X.jsx)(U.BookingsDayNav,{today:se,date:de,onDate:re,count:e=>ne.filter(s=>s.date===e&&'cancelled'!==s.status).length,sub:e=>{const s=ne.filter(s=>s.date===e&&'cancelled'!==s.status&&!s.walkIn),t=s.reduce((e,s)=>e+s.partySize,0);return`${s.length} ${1===s.length?'table':'tables'} \xb7 ${t} ${1===t?'Cover':'Covers'}`}}),(0,X.jsx)(N.default,{testID:"bookings-day-graph",style:{overflow:'visible'},children:(0,X.jsx)(Q.DayGraph,{bare:!0,fill:!0,todays:ye,open:ve,close:Oe,now:ee,turnBase:Z.settings.turnMins,height:128,past:xe,closed:!Pe,emptyText:We})}),xe?(0,X.jsxs)(N.default,{testID:"bookings-past-totals",style:[P.styles.card,{gap:4}],accessible:!0,accessibilityLabel:`${(0,U.longDay)(de)}: ${Se.length} tables, ${Ie} Covers, ${ye.filter(e=>'finished'===e.status).length} finished, ${je.length} no-shows, ${ye.filter(e=>'cancelled'===e.status).length} cancelled`,children:[(0,X.jsxs)(P.T,{size:17,weight:"semibold",children:["That day: ",Se.length," table",1===Se.length?'':'s',$e.length?` \xb7 ${$e.length} walk-in${1===$e.length?'':'s'}`:''," \xb7 ",Ie," ",1===Ie?'Cover':'Covers']}),(0,X.jsxs)(P.T,{size:16,colour:A.colours.text,children:[ye.filter(e=>'finished'===e.status).length," finished \xb7 ",je.length," no-show",1===je.length?'':'s'," \xb7 ",ye.filter(e=>'cancelled'===e.status).length," cancelled"]}),(0,X.jsx)(P.Muted,{children:"Looking back: read-only. Undo is still there for a mistake made today."})]}):null,(0,X.jsx)(N.default,{testID:"bookings-summary",children:(0,X.jsxs)(P.T,{weight:"semibold",children:[Se.length," table",1===Se.length?'':'s'," booked",$e.length?` \xb7 ${$e.length} walk-in${1===$e.length?'':'s'}`:''," \xb7 ",Ie," ",1===Ie?'Cover':'Covers']})}),(0,X.jsx)(N.default,{testID:"cancelled-day-tally",accessible:!0,accessibilityLabel:De,style:{alignItems:'center'},children:(0,X.jsx)(P.T,{size:15,colour:A.colours.muted,center:!0,children:De})}),(0,X.jsxs)(N.default,{testID:"bookings-actions",style:{flexDirection:'row',flexWrap:'wrap',gap:8},children:[xe?null:(0,X.jsx)(B.QuietButton,{label:"New booking",onPress:ue.openBooking,testID:"add-booking",disabled:!ce.ok,accessibilityHint:ce.hint}),ie&&ae&&de===se?(0,X.jsx)(B.QuietButton,{label:"Walk-in",onPress:ue.openWalkIn,testID:"add-walkin",disabled:!ce.ok,accessibilityHint:ce.hint}):null,de===se?(0,X.jsx)(D.CloseGardenButton,{quiet:!0,short:!0,rid:L,r:Z,now:ee,by:te}):null]}),Te.length?(0,X.jsxs)(N.default,{testID:"pending-requests",style:[P.styles.card,{borderColor:A.colours.amber,gap:8}],children:[(0,X.jsxs)(P.T,{weight:"semibold",colour:A.colours.amber,children:["Needs confirming (",Te.length,")"]}),(0,X.jsx)(P.Muted,{children:"Online requests outside your auto-accept rules. Check the details before confirming."}),Te.map(e=>(0,X.jsxs)(N.default,{style:{gap:6,paddingTop:6,borderTopWidth:1,borderColor:A.colours.border},children:[(0,X.jsxs)(P.T,{weight:"semibold",children:[e.name," \xb7 ",e.partySize," ",1===e.partySize?'Cover':'Covers']}),(0,X.jsxs)(P.Muted,{children:[(0,E.niceDate)((0,E.parseYmd)(e.date))," at ",e.time," \xb7 ",e.ref," \xb7 ",e.phone??'no phone']}),e.notes?(0,X.jsxs)(P.T,{size:16,children:["Notes: ",e.notes]}):null,e.allergies.length?(0,X.jsx)(P.Row,{wrap:!0,gap:4,children:e.allergies.map(e=>(0,X.jsx)(P.Badge,{kind:"red",label:`${(0,W.allergenLabel)(e.allergen)} \xb7 ${(0,W.severityLabel)(e.severity)}`},e.allergen))}):null,(0,X.jsx)(S.NeedsPills,{b:e,r:Z}),'staff'!==le&&((0,$.needsHoldOk)(e)||e.date===se&&e.holdOk&&(e.holds??[]).some(e=>!e.served)&&'seated'===e.status)?(0,X.jsxs)(P.Row,{wrap:!0,gap:6,children:[(0,$.needsHoldOk)(e)?(0,X.jsx)(P.Button,{small:!0,kind:"success",label:"Platter OK",testID:`mgr-platter-ok-${e.ref}`,onPress:()=>(0,S.confirmHolds)(e.id,te)}):null,e.holdOk&&'seated'===e.status?(0,X.jsx)(P.Button,{small:!0,kind:"secondary",label:"Platter served",onPress:()=>(0,S.serveHolds)(e,te,'owner')}):null]}):null,Ce===e.id?(0,X.jsxs)(N.default,{style:{gap:6},children:[(0,X.jsxs)(P.T,{size:14,children:["Are you sure? ",e.name.split(' ')[0]," will get a polite \u201csorry, we can\u2019t fit you in\u201d message."]}),(0,X.jsxs)(P.Row,{gap:6,children:[(0,X.jsx)(P.Button,{small:!0,kind:"danger",label:"Yes, decline",onPress:()=>{O.repo.bookings.decide(e.id,'declined',te),Le(null)}}),(0,X.jsx)(P.Button,{small:!0,kind:"ghost",label:"Keep it",onPress:()=>Le(null)})]})]}):ce.ok?(0,X.jsxs)(P.Row,{gap:6,children:[(0,X.jsx)(P.Button,{small:!0,label:"Confirm",testID:`confirm-${e.ref}`,onPress:()=>O.repo.bookings.decide(e.id,'confirmed',te)}),(0,X.jsx)(P.Button,{small:!0,kind:"secondary",label:"Decline",onPress:()=>Le(e.id)}),(0,X.jsx)(q.WhatsAppGuest,{b:e,rid:L,kind:"change"})]}):(0,X.jsx)(N.default,{accessible:!0,accessibilityLabel:y.BOOKING_VIEW_ONLY,children:(0,X.jsx)(P.T,{children:y.BOOKING_VIEW_ONLY})}),(0,X.jsx)(K.ConfirmTimeline,{refId:e.id})]},e.id))]}):null,0===ye.length?(0,X.jsx)(P.Muted,{children:"No bookings for this day yet."}):null,ye.map(e=>{const s='confirmed'===e.status&&de===se&&(0,E.minsBetween)(new Date(`${e.date}T${e.time}:00`),ee)>15,t=(0,j.depositState)(e),l=(0,j.depositBadge)(e,M.gbp);return(0,X.jsxs)(N.default,{testID:(0,T.isSeatedHighlight)((0,$.shownStatus)(e))?`booking-seated-${e.id}`:`booking-row-${e.id}`,style:[P.styles.card,(0,T.isSeatedHighlight)((0,$.shownStatus)(e))?(0,T.seatedHighlightStyle)({borderColor:(0,$.hasAllergens)(e)?A.colours.red:A.colours.goldLight}):{borderColor:(0,$.hasAllergens)(e)?A.colours.red:s?A.colours.amber:A.colours.hairline,opacity:['finished','cancelled'].includes(e.status)?.55:1}],children:[(0,X.jsx)(S.AllergenBar,{b:e}),(0,X.jsxs)(P.Row,{style:{justifyContent:'space-between'},children:[(0,X.jsxs)(P.Row,{gap:6,style:{flex:1,minWidth:0,alignItems:'center'},children:[(0,X.jsxs)(P.T,{weight:"semibold",colour:(0,T.isSeatedHighlight)((0,$.shownStatus)(e))?T.SEATED_FG:A.colours.text,style:{flexShrink:1},children:[e.time," \xb7 ",(0,z.walkInLabel)(e)]}),(0,$.hasAllergens)(e)?(0,X.jsx)(v.AllergyIcon,{text:(0,$.allergenText)(e),size:20,colour:(0,T.isSeatedHighlight)((0,$.shownStatus)(e))?'#7A4A00':A.colours.amber,ink:(0,T.isSeatedHighlight)((0,$.shownStatus)(e))?A.colours.gold:A.colours.bg,testID:`booking-allergy-${e.id}`}):null]}),(0,X.jsx)(P.Badge,{kind:'seated'===(0,$.shownStatus)(e)?'ok':'noshow'===e.status?'red':'confirmed'===e.status?'gold':'pending'===e.status?'amber':'neutral',label:'noshow'===e.status?'No-show':'pending'===e.status?'Needs confirming':(0,$.shownStatus)(e)[0].toUpperCase()+(0,$.shownStatus)(e).slice(1)})]}),l?(0,X.jsx)(w.DepositChip,{b:e,money:!0,big:!0,testID:`deposit-chip-${e.id}`}):null,(0,T.isSeatedHighlight)((0,$.shownStatus)(e))?(0,X.jsxs)(P.T,{size:14,colour:T.SEATED_MUTED,children:[e.table?(0,H.tableCardLabel)(e.table):e.walkIn?'Table to assign':'Table TBC'," \xb7 ",e.ref]}):(0,X.jsxs)(P.Muted,{children:[e.table?(0,H.tableCardLabel)(e.table):e.walkIn?'Table to assign':'Table TBC'," \xb7 ",e.ref]}),e.notes?(0,X.jsxs)(P.T,{size:16,testID:`booking-notes-${e.id}`,children:["Notes: ",e.notes]}):null,(0,c.bookingExtras)(e)?(0,X.jsx)(P.T,{size:15,testID:`booking-extras-${e.id}`,children:(0,c.bookingExtras)(e)}):null,(0,c.historyLines)(e)[0]?(0,X.jsxs)(P.Muted,{size:13,testID:`booking-last-change-${e.id}`,children:["Last change: ",(0,c.historyLines)(e)[0]]}):null,l?(0,X.jsxs)(P.Row,{wrap:!0,gap:6,style:{alignItems:'center'},children:[xe||!(0,j.canTickDeposit)(e)||['cancelled','finished'].includes(e.status)?null:(0,X.jsx)(P.Button,{small:!0,kind:"secondary",label:"Mark deposit paid",testID:`deposit-paid-${e.id}`,accessibilityLabel:`Mark deposit paid for ${(0,z.walkInLabel)(e)}`,onPress:()=>O.repo.bookings.update(e.id,{depositPaid:e.depositDue??0,depositPaidBy:te,depositPaidAt:(new Date).toISOString()})}),xe?null:(0,X.jsx)(f.WixDepositLink,{b:e,rid:L}),'paid'===t&&e.depositPaidBy?(0,X.jsx)(P.Muted,{size:13,children:'Wix deposit link'===e.depositPaidBy?'Paid through a website bookings deposit link':`Ticked by ${e.depositPaidBy}`}):null]}):null,e.walkIn?null:(0,X.jsxs)(P.Muted,{children:[(0,V.bookingSource)(e),e.phone?` \xb7 ${e.phone}`:'',e.email?` \xb7 ${e.email}`:'']}),e.allergies.length?(0,X.jsx)(P.Row,{wrap:!0,gap:4,children:e.allergies.map(e=>(0,X.jsx)(P.Badge,{kind:"red",label:`${(0,W.allergenLabel)(e.allergen)} \xb7 ${(0,W.severityLabel)(e.severity)}`},e.allergen))}):null,(0,$.hasAllergens)(e)&&!['cancelled','noshow'].includes(e.status)?(0,X.jsx)(F.BookingAllergyChain,{b:e,me:te}):null,e.walkIn?null:(0,X.jsx)(K.ConfirmTimeline,{refId:e.id,noPhone:!!e.source&&!e.phone}),s?(0,X.jsxs)(P.T,{size:13,colour:A.colours.amber,children:["Running ",(0,E.minsBetween)(new Date(`${e.date}T${e.time}:00`),ee)," min late. Call them, then mark no-show if needed."]}):null,ce.ok?(0,X.jsx)(u.BookingEditButton,{rid:L,booking:e,who:te,role:le,inStaffApp:ie,shiftManager:ae,big:!0,testID:`edit-booking-${e.id}`}):null,(0,X.jsxs)(P.Row,{wrap:!0,gap:6,children:[(0,X.jsx)(r.BookingTableButton,{rid:L,booking:e,readOnly:xe||!ce.ok,turnBase:Z.settings.turnMins}),ce.ok?null:(0,X.jsx)(N.default,{accessible:!0,accessibilityLabel:y.BOOKING_VIEW_ONLY,children:(0,X.jsx)(P.T,{children:y.BOOKING_VIEW_ONLY})}),ce.ok?(0,X.jsxs)(X.Fragment,{children:[xe||e.table||!['seated','confirmed'].includes(e.status)?null:(0,X.jsx)(P.Button,{small:!e.walkIn,kind:e.walkIn?'primary':'secondary',label:"Assign table",onPress:()=>ue.assignTable(e)}),!xe&&['seated','confirmed'].includes(e.status)?(0,X.jsx)(P.Button,{small:!0,kind:"secondary",label:(0,H.tablesOf)(e.table).length>1?'Change tables':'Combine tables',testID:`combine-${e.id}`,accessibilityLabel:`${(0,H.tablesOf)(e.table).length>1?'Change tables':'Combine tables'} for ${(0,z.walkInLabel)(e)}`,onPress:()=>ue.combineTables(e)}):null,xe||'confirmed'!==e.status?null:(0,X.jsxs)(X.Fragment,{children:[e.date===se?(0,X.jsx)(P.Button,{small:!0,label:"Seat",accessibilityLabel:`Seat ${(0,z.walkInLabel)(e)} now`,onPress:()=>(0,z.seatBookingNow)(L,e)}):null,(0,X.jsx)(P.Button,{small:!0,kind:"secondary",label:"No-show",onPress:()=>O.repo.bookings.setStatus(e.id,'noshow')})]}),xe||e.walkIn?null:(0,X.jsx)(d.CancelBookingButton,{rid:L,b:e,name:(0,z.walkInLabel)(e),small:!0,onDone:()=>{}}),xe||e.walkIn?null:(0,X.jsx)(d.ReinstateBookingButton,{b:e,name:(0,z.walkInLabel)(e),today:se}),xe||'seated'!==e.status?null:(0,X.jsx)(P.Button,{small:!0,kind:"secondary",label:"Finished",accessibilityLabel:`Finished: ${(0,z.walkInLabel)(e)}, table needs clearing`,onPress:()=>(0,z.finishBookingNow)(L,e)}),['confirmed','pending'].includes(e.status)&&e.date>=se?(0,X.jsx)(q.WhatsAppGuest,{b:e,rid:L,kind:"auto"}):null,ie?null:(0,X.jsx)(I.CopyReviewLink,{rid:L,bookingId:e.id}),!xe&&e.walkIn?(0,X.jsx)(o.CancelWalkInButton,{rid:L,b:e,small:!0}):null,!xe&&e.walkIn?(0,X.jsx)(o.ReinstateWalkInButton,{rid:L,b:e,today:se,small:!0}):null,(0,X.jsx)(G.BookingUndo,{b:e,rid:L,today:se,who:(0,z.walkInLabel)(e)})]}):null]}),'noshow'===e.status&&'paid'===t?(0,X.jsx)(P.Muted,{size:13,children:"A deposit was paid. Keep or refund it by your deposit terms (Settings \u203a Advanced \u203a Deposits). Deposits paid through website bookings are refunded in Website bookings \u203a Orders."}):null]},e.id)}),(0,X.jsx)(p.CancellationsSection,{testID:"bookings-cancellations",items:(0,b.cancellationsFor)(ne,de,e=>e.walkIn?`Walk-in ${e.ref}`:(e.name??'').replace(' (example)','')),dayWord:de===se?'today':'that day'}),(0,X.jsxs)(P.Card,{children:[(0,X.jsxs)(P.Row,{style:{justifyContent:'space-between'},children:[(0,X.jsx)(P.T,{weight:"semibold",children:"No-shows"}),(0,X.jsx)(P.Badge,{kind:je.length?'red':'ok',label:`${je.length} ${de===se?'today':(0,E.niceDate)((0,E.parseYmd)(de)).slice(0,6)}${fe||a.LIVE_VENUE_BUILD?'':' \xb7 4.1% last 28 days (example)'}`})]}),(0,X.jsx)(P.Muted,{children:je.length?`Marked no-show today: ${je.slice(0,6).map(e=>`${e.time} ${(0,z.walkInLabel)(e)}`).join(', ')}${je.length>6?` and ${je.length-6} more`:''}. If they turn up, open the booking and tap Undo no-show.`:'No no-shows today. If a party doesn\u2019t arrive, call them first, then tap No-show on their booking.'})]}),s.IS_GREENSIDE?(0,X.jsx)(t.GreensideCashOnly,{}):(0,X.jsxs)(P.Card,{children:[(0,X.jsx)(P.T,{weight:"semibold",children:"Deposits"}),(0,X.jsx)(P.Muted,{testID:"deposits-card-text",children:(()=>{const e=(0,j.depositOf)(Z.settings);return e.on&&e.perPersonPence>0?`Deposits: ${(0,M.gbp)(e.perPersonPence)} per person for parties of ${e.fromParty} or more. Deposits are paid through website bookings. Website bookings show Deposit paid on website bookings by themselves once the guest has paid. For phone and walk-in bookings, tick Deposit paid once the guest has paid you${e.wixLinksOn?', or press Send deposit link':''}.`:'Deposits are off. Turn them on in Settings \u203a Advanced \u203a Deposits.'})()}),(0,X.jsx)(P.Muted,{size:13,children:"Tip: refunds are done in Website bookings \u203a Orders. Booking deposit amounts are visible in Managers, Display and Staff."})]}),we.length>0||be?(0,X.jsxs)(N.default,{style:{gap:10},children:[(0,X.jsx)(R.SectionHead,{title:`Waitlist (${we.length})`,sub:`New party waits about ${(0,_.estimateWait)(we.length+1,Z.settings.turnMins,1)} min (estimate)`}),we.map((e,s)=>(0,X.jsxs)(N.default,{style:P.styles.card,children:[(0,X.jsxs)(P.Row,{style:{justifyContent:'space-between'},children:[(0,X.jsxs)(P.T,{weight:"semibold",children:["#",e.number," ",e.name," \xb7 ",e.partySize]}),(0,X.jsxs)(P.Muted,{children:[(0,E.minsBetween)(new Date(e.joinedAt),ee)," min \xb7 est. ",(0,_.estimateWait)(s+1,Z.settings.turnMins,1)," min"]})]}),'notified'===e.status?(0,X.jsx)(P.Badge,{kind:"ok",label:"Marked as told: table ready (no text is sent)"}):null,(0,X.jsxs)(P.Row,{gap:6,children:['waiting'===e.status?(0,X.jsx)(P.Button,{small:!0,kind:"secondary",label:"Notify",onPress:()=>O.repo.waitlist.setStatus(e.id,'notified')}):null,(0,X.jsx)(P.Button,{small:!0,label:"Seat",onPress:()=>O.repo.waitlist.setStatus(e.id,'seated')}),(0,X.jsx)(P.Button,{small:!0,kind:"ghost",label:"Remove",onPress:()=>O.repo.waitlist.setStatus(e.id,'removed')})]})]},e.id)),(0,X.jsxs)(P.Row,{gap:6,children:[(0,X.jsx)(i.TextInput,{accessibilityLabel:"Waitlist name",placeholder:"Name for the waitlist",placeholderTextColor:"#7D776C",value:he,onChangeText:ge,style:[P.styles.input,{flex:1}]}),(0,X.jsx)(P.Stepper,{value:ke,onChange:me,min:1,max:12,label:"party"})]}),(0,X.jsx)(P.Button,{kind:"secondary",label:"Add to waitlist",disabled:he.trim().length<2,onPress:()=>{O.repo.waitlist.join(L,he.trim(),ke),ge('')}})]}):(0,X.jsx)(P.Button,{kind:"ghost",label:"Open waitlist",onPress:()=>pe(!0),accessibilityLabel:"Open the empty waitlist to add a waiting party"}),ue.elements]})};var e,s=_r(_d[0]),t=_r(_d[1]),l=_r(_d[2]),n=_r(_d[3]),i=_r(_d[4]),a=_r(_d[5]),o=_r(_d[6]),d=_r(_d[7]),r=_r(_d[8]),u=_r(_d[9]),c=_r(_d[10]),h=_r(_d[11]),b=_r(_d[12]),p=_r(_d[13]),k=_r(_d[14]),x=_r(_d[15]),y=_r(_d[16]),w=_r(_d[17]),j=_r(_d[18]),f=_r(_d[19]),I=_r(_d[20]),B=_r(_d[21]),D=_r(_d[22]),S=_r(_d[23]),$=_r(_d[24]),T=_r(_d[25]),C=_r(_d[26]),L=_r(_d[27]),N=(e=L)&&e.__esModule?e:{default:e},P=_r(_d[28]),v=_r(_d[29]),O=_r(_d[30]),W=_r(_d[31]),M=_r(_d[32]),E=_r(_d[33]),_=_r(_d[34]),A=_r(_d[35]),R=_r(_d[36]),z=_r(_d[37]),H=_r(_d[38]),G=_r(_d[39]),U=_r(_d[40]),F=_r(_d[41]),K=_r(_d[42]),V=_r(_d[43]),Y=_r(_d[44]),q=_r(_d[45]),Q=_r(_d[46]),J=_r(_d[47]),X=_r(_d[48])},1356,[5,1354,11,1357,796,806,1112,1113,1091,1115,1111,1114,1328,1329,1100,1282,1012,1089,14,1358,1186,1359,1316,1081,1075,1090,34,102,794,1291,848,830,836,827,1267,840,1147,1096,1014,1360,1361,1136,1362,1177,985,1149,1324,852,25]); __d(function(g,_r,i,a,m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.VenueRequestList=function({rid:e,kind:n,hotel:c}){const y=(0,r.useSync)(),p='staff'===y.kind&&y.venueSlug===(0,s.queuedDatabaseSlug)(e)&&!!y.venueId&&(!['greenside','kirkton','abbotsford'].includes(e)&&!(0,s.isQueuedVenue)(e)||y.perms.includes('*')||y.perms.includes('venue.settings')),f=p&&(y.perms.includes('*')||y.perms.includes('room'===n||(0,s.isQueuedVenue)(e)||['greenside','kirkton','abbotsford'].includes(e)?'venue.settings':'bookings.manage')),[h,b]=(0,t.useState)([]),[j,q]=(0,t.useState)(''),[x,k]=(0,t.useState)(null),v=(0,t.useCallback)(async()=>{if(p)try{b(await(0,o.listVenueRequests)(y.venueId,n)),q('')}catch(e){q((0,o.requestMessage)(e))}},[p,n,y.venueId]);(0,t.useEffect)(()=>{const e=setTimeout(()=>{v()},0),s=setInterval(()=>{v()},15e3);return()=>{clearTimeout(e),clearInterval(s)}},[v]);const T=h.filter(e=>e.venue_id===y.venueId);if(!p)return null;const I=async(e,s)=>{if(!x){k(e);try{await(0,o.decideVenueRequest)(e,s),await v()}catch(e){q((0,o.requestMessage)(e))}finally{k(null)}}};return(0,u.jsxs)(d.default,{testID:`venue-${n}-requests`,style:{gap:12,alignItems:'stretch'},children:[(0,u.jsx)(l.H2,{children:'room'===n?'Room requests':'Table requests'}),(0,u.jsx)(l.T,{center:!0,children:"Requested bookings need a staff decision. No email or text is sent. Contact the guest to confirm arrangements."}),(0,u.jsx)(l.Button,{kind:"secondary",label:`Refresh ${n} requests`,onPress:()=>{v()}}),j?(0,u.jsx)(l.Banner,{kind:"warn",title:"Requests",children:j}):null,T.length||j?null:(0,u.jsxs)(l.T,{center:!0,children:["No ",n," requests yet."]}),T.map(e=>(0,u.jsx)(l.Card,{style:{alignItems:'stretch'},children:(0,u.jsxs)(d.default,{testID:`venue-request-${e.id}`,style:{gap:10},children:[(0,u.jsxs)(l.Row,{wrap:!0,children:[(0,u.jsx)(l.T,{weight:"semibold",children:e.payload.name}),(0,u.jsx)(l.Badge,{kind:'requested'===e.status?'amber':'confirmed'===e.status?'ok':'neutral',label:'requested'===e.status?'Requested':'confirmed'===e.status?'Confirmed':'Declined'})]}),(0,u.jsx)(l.T,{children:'table'===n?`${e.payload.date} \xb7 ${e.payload.service?e.payload.service+' \xb7 ':''}${e.payload.time} \xb7 ${e.payload.covers} Covers`:`${e.payload.checkIn} to ${e.payload.checkOut} \xb7 ${c?.roomTypes.find(s=>s.id===e.payload.roomType)?.name||e.payload.roomType} \xb7 ${e.payload.guests} guests`}),'room'===n?(0,u.jsxs)(l.T,{children:["Add dinner: ",e.payload.addDinner?'Yes \u2014 arrange with guest':'No']}):null,(0,u.jsxs)(l.T,{children:[e.payload.phone," \xb7 ",e.payload.email]}),e.payload.notes?(0,u.jsxs)(l.T,{children:["Notes: ",e.payload.notes]}):null,'requested'===e.status&&f?(0,u.jsxs)(l.Row,{wrap:!0,children:[(0,u.jsx)(l.Button,{label:x===e.id?'Saving\u2026':'Confirm',testID:`request-confirm-${e.id}`,disabled:!!x,onPress:()=>{I(e.id,'confirmed')}}),(0,u.jsx)(l.Button,{label:"Decline",kind:"secondary",testID:`request-decline-${e.id}`,disabled:!!x,onPress:()=>{I(e.id,'declined')}})]}):null,e.booking_id?(0,u.jsx)(l.T,{children:"Confirmed table booking is in the bookings list."}):null]})},e.id))]})};var e,s=_r(_d[0]),t=_r(_d[1]),n=_r(_d[2]),d=(e=n)&&e.__esModule?e:{default:e},l=_r(_d[3]),r=_r(_d[4]),o=_r(_d[5]),u=_r(_d[6])},1357,[6,34,102,794,985,1215,25]); __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,"untilWords",{enumerable:!0,get:function(){return w}}),_e.WixDepositLink=function({b:e,rid:x}){const f=(0,r.useRestaurant)(x),[S,j]=(0,s.useState)(!1),[C,D]=(0,s.useState)(!1),[L,I]=(0,s.useState)(null),[$,v]=(0,s.useState)(''),[P,T]=(0,s.useState)(''),[A,_]=(0,s.useState)(''),M=(0,c.depositOf)(f?.settings),O=e;if(n.IS_ISOLATED_VENUE||['souters','kirkmichael','wildings'].includes(x)||!f||!(0,c.canSendDepositLink)(O,M))return null;const B='open'===O.depositLink?.state,R=async()=>{j(!0),D(!0),T(''),I(null);try{const{data:t,error:n}=await(0,h.getSupabase)().functions.invoke('wix-deposit-link',{body:{booking_id:e.id}});if(n||!t)return void T(y);if(!t.ok||!t.url)return void T(t.off?y:String(t.error??y));const s={url:t.url,amountPence:t.amountPence,expiresAt:t.expiresAt};I(s),v((0,c.depositLinkMessage)({name:e.name,venue:f.name,partySize:e.partySize,date:e.date,time:e.time,amountPence:s.amountPence,url:s.url,expiresAt:s.expiresAt,terms:(0,c.depositTerms)(M)}))}catch{T(y)}finally{D(!1)}},W=async()=>{_('Checking\u2026');try{const{data:t,error:n}=await(0,h.getSupabase)().functions.invoke('wix-deposit-check',{body:{booking_id:e.id}});_(n||!t||t.off?'Website bookings deposit links are switched off, so nothing was checked.':'Checked with website bookings. If the guest has paid, the badge shows Deposit paid on website bookings.')}catch{_('Could not reach website bookings. Try again in a minute.')}},z=L?(0,k.waMeLink)(e.phone,$):null,E=L&&e.phone?(0,p.smsLink)(e.phone,$):null,U=L&&e.email?`mailto:${encodeURIComponent(e.email)}?subject=${encodeURIComponent(`${f.name} deposit`)}&body=${encodeURIComponent($)}`:null,F='undefined'!=typeof navigator&&!!navigator.clipboard,G=e=>{e&&o.default.openURL(e).catch(()=>{})};return(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(d.Button,{small:!0,kind:"secondary",label:B?'Send deposit link again':'Send deposit link',testID:`deposit-link-${e.id}`,accessibilityLabel:`${B?'Send the deposit link again to':'Send a website bookings deposit link to'} ${e.name}`,onPress:()=>{R()}}),B?(0,g.jsx)(d.Button,{small:!0,kind:"secondary",label:"Check if paid",testID:`deposit-check-${e.id}`,accessibilityLabel:`Check with website bookings if ${e.name} has paid the deposit`,onPress:()=>{W()}}):null,A?(0,g.jsx)(d.Muted,{size:13,children:A}):null,(0,g.jsx)(d.Sheet,{visible:S,onClose:()=>j(!1),title:"Send deposit link",testID:`deposit-link-sheet-${e.id}`,children:(0,g.jsxs)(l.default,{style:{gap:10},children:[C?(0,g.jsx)(d.T,{children:"Asking website bookings for the link\u2026"}):null,P?(0,g.jsx)(d.T,{colour:b.colours.amber,testID:"deposit-link-error",children:P}):null,L?(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(d.T,{weight:"semibold",children:`Deposit ${(0,u.gbp)(L.amountPence)} for ${e.partySize} guests.${L.expiresAt?` Link works until ${w(L.expiresAt)}.`:''}`}),(0,g.jsx)(d.T,{children:"Message to the guest (you can change it)"}),(0,g.jsx)(t.TextInput,{accessibilityLabel:"Message to the guest",testID:"deposit-link-message",value:$,multiline:!0,onChangeText:v,style:{minHeight:140,borderRadius:10,borderWidth:1,borderColor:b.colours.hairline,backgroundColor:b.colours.surface2,color:b.colours.text,padding:10,fontSize:15}}),(0,g.jsxs)(d.Row,{wrap:!0,gap:8,children:[E?(0,g.jsx)(d.Button,{label:"Text",testID:"deposit-link-sms",accessibilityLabel:`Open a text message to ${e.name} with the deposit link`,onPress:()=>G(E)}):null,z?(0,g.jsx)(d.Button,{kind:"secondary",label:"WhatsApp",testID:"deposit-link-wa",accessibilityLabel:`Open WhatsApp to ${e.name} with the deposit link`,onPress:()=>G(z)}):null,U?(0,g.jsx)(d.Button,{kind:"secondary",label:"Email",testID:"deposit-link-email",accessibilityLabel:`Open an email to ${e.name} with the deposit link`,onPress:()=>G(U)}):null,F?(0,g.jsx)(d.Button,{kind:"secondary",label:"Copy link",testID:"deposit-link-copy",accessibilityLabel:"Copy the deposit link",onPress:()=>{navigator.clipboard.writeText(L.url).catch(()=>{})}}):null]}),E||z||U?null:(0,g.jsx)(d.Muted,{children:"This booking has no phone number or email. Copy the link and send it another way."}),(0,g.jsx)(d.Muted,{size:13,children:"Tip: CoverCharge doesn't send anything. Each button opens your own messages app with the words filled in, and you press Send. Once the guest pays on website bookings, this booking shows Deposit paid on website bookings by itself. Refunds are done in Website bookings \u203a Orders."})]}):null,(0,g.jsx)(d.Button,{kind:"secondary",label:"Close",testID:"deposit-link-close",onPress:()=>j(!1)})]})})]})};var t=_r(_d[0]),n=_r(_d[1]),s=_r(_d[2]),o=e(_r(_d[3]));_r(_d[4]);var l=e(_r(_d[5])),d=_r(_d[6]),r=_r(_d[7]),c=_r(_d[8]),u=_r(_d[9]),p=_r(_d[10]),h=_r(_d[11]),b=_r(_d[12]),k=_r(_d[13]),g=_r(_d[14]);const y="Website bookings deposit links aren't switched on yet. Take the deposit by card or cash and tick Deposit paid.",w=e=>e?new Date(e).toLocaleString('en-GB',{timeZone:'Europe/London',weekday:'short',day:'numeric',month:'short',hour:'2-digit',minute:'2-digit',hourCycle:'h23'}):''},1358,[796,5,34,379,236,102,794,850,14,836,1017,931,840,1150,25]); __d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.QuietButton=function({icon:e,label:s,onPress:n,testID:b,a11y:y,disabled:f,accessibilityHint:h}){return(0,u.jsxs)(t.default,{accessibilityRole:"button",accessibilityLabel:y??s,accessibilityHint:h,accessibilityState:{disabled:!!f},disabled:f,testID:b,onPress:n,style:({pressed:e})=>({...l.look.quiet(e),flexGrow:1,opacity:f?.4:1}),children:[e?(0,u.jsx)(o.T,{size:15,colour:c.colours.goldLight,children:e}):null,(0,u.jsx)(o.T,{size:15,weight:"semibold",colour:c.colours.goldLight,children:s})]})},r(d[0]);var e,s=r(d[1]),t=(e=s)&&e.__esModule?e:{default:e},l=r(d[2]),o=r(d[3]),c=r(d[4]),u=r(d[5])},1359,[34,402,1143,794,840,25]); diff --git a/chef-app/admin.html b/chef-app/admin.html index a3aa44e0dbdc491d4596b71fa12014a16668aac7..e6e4cc599d3c43d162a30a1d96831e31cc129811 100644 --- a/chef-app/admin.html +++ b/chef-app/admin.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/chef-app/customer.html b/chef-app/customer.html index a3aa44e0dbdc491d4596b71fa12014a16668aac7..e6e4cc599d3c43d162a30a1d96831e31cc129811 100644 --- a/chef-app/customer.html +++ b/chef-app/customer.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/chef-app/customer/anchorage.html b/chef-app/customer/anchorage.html index a3aa44e0dbdc491d4596b71fa12014a16668aac7..e6e4cc599d3c43d162a30a1d96831e31cc129811 100644 --- a/chef-app/customer/anchorage.html +++ b/chef-app/customer/anchorage.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/chef-app/customer/anchorage/book.html b/chef-app/customer/anchorage/book.html index a3aa44e0dbdc491d4596b71fa12014a16668aac7..e6e4cc599d3c43d162a30a1d96831e31cc129811 100644 --- a/chef-app/customer/anchorage/book.html +++ b/chef-app/customer/anchorage/book.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/chef-app/customer/anchorage/feedback.html b/chef-app/customer/anchorage/feedback.html index a3aa44e0dbdc491d4596b71fa12014a16668aac7..e6e4cc599d3c43d162a30a1d96831e31cc129811 100644 --- a/chef-app/customer/anchorage/feedback.html +++ b/chef-app/customer/anchorage/feedback.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/chef-app/customer/anchorage/gift.html b/chef-app/customer/anchorage/gift.html index a3aa44e0dbdc491d4596b71fa12014a16668aac7..e6e4cc599d3c43d162a30a1d96831e31cc129811 100644 --- a/chef-app/customer/anchorage/gift.html +++ b/chef-app/customer/anchorage/gift.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/chef-app/customer/anchorage/lost.html b/chef-app/customer/anchorage/lost.html index a3aa44e0dbdc491d4596b71fa12014a16668aac7..e6e4cc599d3c43d162a30a1d96831e31cc129811 100644 --- a/chef-app/customer/anchorage/lost.html +++ b/chef-app/customer/anchorage/lost.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/chef-app/customer/anchorage/loyalty.html b/chef-app/customer/anchorage/loyalty.html index a3aa44e0dbdc491d4596b71fa12014a16668aac7..e6e4cc599d3c43d162a30a1d96831e31cc129811 100644 --- a/chef-app/customer/anchorage/loyalty.html +++ b/chef-app/customer/anchorage/loyalty.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/chef-app/customer/anchorage/merch.html b/chef-app/customer/anchorage/merch.html index a3aa44e0dbdc491d4596b71fa12014a16668aac7..e6e4cc599d3c43d162a30a1d96831e31cc129811 100644 --- a/chef-app/customer/anchorage/merch.html +++ b/chef-app/customer/anchorage/merch.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/chef-app/customer/anchorage/offers.html b/chef-app/customer/anchorage/offers.html index a3aa44e0dbdc491d4596b71fa12014a16668aac7..e6e4cc599d3c43d162a30a1d96831e31cc129811 100644 --- a/chef-app/customer/anchorage/offers.html +++ b/chef-app/customer/anchorage/offers.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/chef-app/customer/anchorage/refer.html b/chef-app/customer/anchorage/refer.html index a3aa44e0dbdc491d4596b71fa12014a16668aac7..e6e4cc599d3c43d162a30a1d96831e31cc129811 100644 --- a/chef-app/customer/anchorage/refer.html +++ b/chef-app/customer/anchorage/refer.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/chef-app/customer/anchorage/waitlist.html b/chef-app/customer/anchorage/waitlist.html index a3aa44e0dbdc491d4596b71fa12014a16668aac7..e6e4cc599d3c43d162a30a1d96831e31cc129811 100644 --- a/chef-app/customer/anchorage/waitlist.html +++ b/chef-app/customer/anchorage/waitlist.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/chef-app/customer/anchorage/whatson.html b/chef-app/customer/anchorage/whatson.html index a3aa44e0dbdc491d4596b71fa12014a16668aac7..e6e4cc599d3c43d162a30a1d96831e31cc129811 100644 --- a/chef-app/customer/anchorage/whatson.html +++ b/chef-app/customer/anchorage/whatson.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/chef-app/customer/basket.html b/chef-app/customer/basket.html index a3aa44e0dbdc491d4596b71fa12014a16668aac7..e6e4cc599d3c43d162a30a1d96831e31cc129811 100644 --- a/chef-app/customer/basket.html +++ b/chef-app/customer/basket.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/chef-app/customer/profile.html b/chef-app/customer/profile.html index a3aa44e0dbdc491d4596b71fa12014a16668aac7..e6e4cc599d3c43d162a30a1d96831e31cc129811 100644 --- a/chef-app/customer/profile.html +++ b/chef-app/customer/profile.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/chef-app/demo.html b/chef-app/demo.html index a3aa44e0dbdc491d4596b71fa12014a16668aac7..e6e4cc599d3c43d162a30a1d96831e31cc129811 100644 --- a/chef-app/demo.html +++ b/chef-app/demo.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/chef-app/display.html b/chef-app/display.html index a3aa44e0dbdc491d4596b71fa12014a16668aac7..e6e4cc599d3c43d162a30a1d96831e31cc129811 100644 --- a/chef-app/display.html +++ b/chef-app/display.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/chef-app/index.html b/chef-app/index.html index 0ea2cbcc5d6b6b7cb3131602c9c5e97c7c86ba7b..0d05403fb235142432f376f20612ca9e03cefcda 100644 --- a/chef-app/index.html +++ b/chef-app/index.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/chef-app/kitchen.html b/chef-app/kitchen.html index a3aa44e0dbdc491d4596b71fa12014a16668aac7..e6e4cc599d3c43d162a30a1d96831e31cc129811 100644 --- a/chef-app/kitchen.html +++ b/chef-app/kitchen.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/chef-app/owner.html b/chef-app/owner.html index a3aa44e0dbdc491d4596b71fa12014a16668aac7..e6e4cc599d3c43d162a30a1d96831e31cc129811 100644 --- a/chef-app/owner.html +++ b/chef-app/owner.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/chef-app/staff.html b/chef-app/staff.html index a3aa44e0dbdc491d4596b71fa12014a16668aac7..e6e4cc599d3c43d162a30a1d96831e31cc129811 100644 --- a/chef-app/staff.html +++ b/chef-app/staff.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/chef-app/sw.js b/chef-app/sw.js index 4be08b23b23a14693c4d1be5710c984c7e9d3597..d01c217c5a47dea49431a0658b8f7ec9c80055ed 100644 --- a/chef-app/sw.js +++ b/chef-app/sw.js @@ -1,7 +1,7 @@ // Anchorage Head Chef service worker: precache the app shell so it opens offline after the first visit. -const V = "cc-chef-37f427335f"; +const V = "cc-chef-133c625c49"; const BASE = "/chef-app/"; -const PRECACHE = ["/chef-app/apple-touch-icon.png", "/chef-app/assets/assets/brand/3idiots-hero.e5dfd53739f05086b1956e72d585a66a.png", "/chef-app/assets/assets/brand/3idiots.df4a76d2130f0e5b0042f06a8c88693a.png", "/chef-app/assets/assets/brand/abbotsford-hero.78fcb8ee06ee22c4ca659c9254db7512.png", "/chef-app/assets/assets/brand/abbotsford.b26602bba5ce4969733c5422a45ad053.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/cecchinis-hero.f77780fcc94fd668cf35d66d6dc52d81.png", "/chef-app/assets/assets/brand/cecchinis.ebf752fef363247848ae7c0d91938765.png", "/chef-app/assets/assets/brand/drunkencoo-hero.65c21c4da9e466cf4bffc969639a1427.png", "/chef-app/assets/assets/brand/drunkencoo.f6d92af3b14e4205a3deaf4434754c51.png", "/chef-app/assets/assets/brand/greenside-hero.1caec5a6cb939434cccb5f3a613b50f8.png", "/chef-app/assets/assets/brand/greenside.9d1556db97dcb903a3c57e2063ee2255.png", "/chef-app/assets/assets/brand/kirkmichael-hero.63b13cde7fd82eb622622b39ac80c394.png", "/chef-app/assets/assets/brand/kirkmichael.63b13cde7fd82eb622622b39ac80c394.png", "/chef-app/assets/assets/brand/kirkton-hero.9d0837b292c2f4f30f4521d806bb28c3.png", "/chef-app/assets/assets/brand/kirkton.bcf8d846df4861474d224a7a77f498fb.png", "/chef-app/assets/assets/brand/mrbasrais-hero.4ce74641cfcf52d099157c84005b9d2a.png", "/chef-app/assets/assets/brand/mrbasrais.7cc4086dd12ace82529795f1c9f8c900.png", "/chef-app/assets/assets/brand/pizzaioli-hero.1896657c08264cefb49b401891d5448d.png", "/chef-app/assets/assets/brand/pizzaioli.db8c000b62ee407121aa8b90ce45e170.png", "/chef-app/assets/assets/brand/rupeeroom-hero.969fa372add526aaacf3a6c009b8ac92.png", "/chef-app/assets/assets/brand/rupeeroom.689e6fb536dc0845eeb174a1ec7bd346.png", "/chef-app/assets/assets/brand/saltmarsh.85a6a65732635e5148478d743d9ca884.png", "/chef-app/assets/assets/brand/smokinggoat-hero.0588f17ef0eed7f757f22916cd4d37db.png", "/chef-app/assets/assets/brand/smokinggoat.20a3a1970596ab43c5d6468d4ed549a7.png", "/chef-app/assets/assets/brand/souters.f4c58d9349b6e1700fe5abcc9e9b665c.png", "/chef-app/assets/assets/brand/wildings-hero-logo-text.4661e4b935726f2511f9c17a1567c89a.png", "/chef-app/assets/assets/brand/wildings.076f4fcd06d19a0af0205c410f461b14.png", "/chef-app/assets/assets/brand/williewastles-hero.b9d53d27b66f903b5618a7177b2ffad4.png", "/chef-app/assets/assets/brand/williewastles.055a77893ced99bf3a6c5402ba5baac6.png", "/chef-app/assets/assets/brand/yasmins-hero.a5aef62e37dfcecbe0afc056186f4ad9.png", "/chef-app/assets/assets/brand/yasmins.8482602e9f0a965655924835625cb02b.png", "/chef-app/assets/assets/recipes/fishsupper.1609c58319e1e8721f5c639049fb054e.jpg", "/chef-app/assets/assets/recipes/lobster.2fb3485c8e372972099259017358c1b8.jpg", "/chef-app/assets/assets/recipes/moules.a4f342fc7e7fb62c8a0b5c1678bbea3f.jpg", "/chef-app/assets/assets/recipes/skink.4ce7b7c676f9cdcd0a060eda46f5a00e.jpg", "/chef-app/assets/assets/recipes/stp.1061ced765efdcafff2554adc3fc7113.jpg", "/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-192.png", "/chef-app/icon-maskable-512.png", "/chef-app/manifest.webmanifest", "/chef-app/index.html", "/chef-app/_expo/static/js/web/bundle.js?v=37f427335fe81e73a36a24a5f4e3081821a7fc2d25e9e4bdefb2ee1cdc6e2715"]; +const PRECACHE = ["/chef-app/apple-touch-icon.png", "/chef-app/assets/assets/brand/3idiots-hero.e5dfd53739f05086b1956e72d585a66a.png", "/chef-app/assets/assets/brand/3idiots.df4a76d2130f0e5b0042f06a8c88693a.png", "/chef-app/assets/assets/brand/abbotsford-hero.78fcb8ee06ee22c4ca659c9254db7512.png", "/chef-app/assets/assets/brand/abbotsford.b26602bba5ce4969733c5422a45ad053.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/cecchinis-hero.f77780fcc94fd668cf35d66d6dc52d81.png", "/chef-app/assets/assets/brand/cecchinis.ebf752fef363247848ae7c0d91938765.png", "/chef-app/assets/assets/brand/drunkencoo-hero.65c21c4da9e466cf4bffc969639a1427.png", "/chef-app/assets/assets/brand/drunkencoo.f6d92af3b14e4205a3deaf4434754c51.png", "/chef-app/assets/assets/brand/greenside-hero.1caec5a6cb939434cccb5f3a613b50f8.png", "/chef-app/assets/assets/brand/greenside.9d1556db97dcb903a3c57e2063ee2255.png", "/chef-app/assets/assets/brand/kirkmichael-hero.63b13cde7fd82eb622622b39ac80c394.png", "/chef-app/assets/assets/brand/kirkmichael.63b13cde7fd82eb622622b39ac80c394.png", "/chef-app/assets/assets/brand/kirkton-hero.9d0837b292c2f4f30f4521d806bb28c3.png", "/chef-app/assets/assets/brand/kirkton.bcf8d846df4861474d224a7a77f498fb.png", "/chef-app/assets/assets/brand/mrbasrais-hero.4ce74641cfcf52d099157c84005b9d2a.png", "/chef-app/assets/assets/brand/mrbasrais.7cc4086dd12ace82529795f1c9f8c900.png", "/chef-app/assets/assets/brand/pizzaioli-hero.1896657c08264cefb49b401891d5448d.png", "/chef-app/assets/assets/brand/pizzaioli.db8c000b62ee407121aa8b90ce45e170.png", "/chef-app/assets/assets/brand/rupeeroom-hero.969fa372add526aaacf3a6c009b8ac92.png", "/chef-app/assets/assets/brand/rupeeroom.689e6fb536dc0845eeb174a1ec7bd346.png", "/chef-app/assets/assets/brand/saltmarsh.85a6a65732635e5148478d743d9ca884.png", "/chef-app/assets/assets/brand/smokinggoat-hero.0588f17ef0eed7f757f22916cd4d37db.png", "/chef-app/assets/assets/brand/smokinggoat.20a3a1970596ab43c5d6468d4ed549a7.png", "/chef-app/assets/assets/brand/souters.f4c58d9349b6e1700fe5abcc9e9b665c.png", "/chef-app/assets/assets/brand/wildings-hero-logo-text.4661e4b935726f2511f9c17a1567c89a.png", "/chef-app/assets/assets/brand/wildings.076f4fcd06d19a0af0205c410f461b14.png", "/chef-app/assets/assets/brand/williewastles-hero.b9d53d27b66f903b5618a7177b2ffad4.png", "/chef-app/assets/assets/brand/williewastles.055a77893ced99bf3a6c5402ba5baac6.png", "/chef-app/assets/assets/brand/yasmins-hero.a5aef62e37dfcecbe0afc056186f4ad9.png", "/chef-app/assets/assets/brand/yasmins.8482602e9f0a965655924835625cb02b.png", "/chef-app/assets/assets/recipes/fishsupper.1609c58319e1e8721f5c639049fb054e.jpg", "/chef-app/assets/assets/recipes/lobster.2fb3485c8e372972099259017358c1b8.jpg", "/chef-app/assets/assets/recipes/moules.a4f342fc7e7fb62c8a0b5c1678bbea3f.jpg", "/chef-app/assets/assets/recipes/skink.4ce7b7c676f9cdcd0a060eda46f5a00e.jpg", "/chef-app/assets/assets/recipes/stp.1061ced765efdcafff2554adc3fc7113.jpg", "/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-192.png", "/chef-app/icon-maskable-512.png", "/chef-app/manifest.webmanifest", "/chef-app/index.html", "/chef-app/_expo/static/js/web/bundle.js?v=133c625c496fcf452b17ee6ba7ce385e9b72530bcbc04ef42e2094d9fb4b48f2"]; // Hugging Face serves large files (fonts) through a redirect to its CDN. Browsers refuse to hand a *redirected* cached // response to a page, so store a plain copy instead (otherwise fonts, and so the app, fail to load offline). 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); diff --git a/chef-app/team.html b/chef-app/team.html index a3aa44e0dbdc491d4596b71fa12014a16668aac7..e6e4cc599d3c43d162a30a1d96831e31cc129811 100644 --- a/chef-app/team.html +++ b/chef-app/team.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/customer-app/_expo/static/js/web/bundle.js b/customer-app/_expo/static/js/web/bundle.js index 55be8a015a37f42703ae8e1f153f860bccaa54a2..011b897f68debdb11bb5300a33f21f7cb705bb6b 100644 --- a/customer-app/_expo/static/js/web/bundle.js +++ b/customer-app/_expo/static/js/web/bundle.js @@ -1122,7 +1122,7 @@ __d(function(g,r,i,a,m,e,d){m.exports=r(d[0])},1038,[1039]); __d(function(g,r,i,a,m,e,d){function n(n,t){const o=globalThis[`${__METRO_GLOBAL_PREFIX__??''}__loadBundleAsync`];if(null!=o){const s=String(n);if(null!=t){const n=t[s];if(null!=n)return o(n)}}}function t(t,o,s){const u=()=>r.importAll(t,s);{const l=o?.[String(t)];if(Array.isArray(l)){const c=globalThis[`${__METRO_GLOBAL_PREFIX__??''}__loadBundleAsync`];if(c?.isReady?.(l))return u();const f=n(t,o);if(null!=f)return f.then(u);throw new Error(`Cannot import module ${s??t}: the async bundle loader is unavailable. Load the initial Expo bundle before importing these chunks: ${l.join(', ')}`)}try{return u()}catch(s){const l=n(t,o);if(null!=l)return l.then(u);throw s}}const l=n(t,o);return null!=l?l.then(u):u()}function o(n,o,s){const u=t(n,o,s),l=Promise.resolve(u);return l._result=u,l}o.unstable_importMaybeSync=function(n,o){return t(n,o)},o.prefetch=function(t,o,s){n(t,o)?.then(()=>{},()=>{})},o.unstable_resolve=function(n,t){if(!t)throw new Error('Bundle splitting is required for Web Worker imports');const o=t[n];if(!o)throw new Error('Worker import is missing from split bundle paths: '+o);return o},o.unstable_createWorker=function(n,t){if('undefined'==typeof crossOriginIsolated||!crossOriginIsolated)return new Worker(n,t);try{const s=(o=n,`\n const ASYNC_WORKER_BASE = ${JSON.stringify(o)};\n const IMPORT_SCRIPTS = importScripts;\n const FETCH = fetch;\n const fromBaseURL = (input) => new URL(input, ASYNC_WORKER_BASE).href;\n self.fetch = function(input, init) {\n return FETCH(typeof input === 'string' ? fromBaseURL(input) : input, init);\n };\n self.importScripts = function(...urls) {\n return IMPORT_SCRIPTS.apply(self, urls.map(fromBaseURL));\n };\n importScripts(ASYNC_WORKER_BASE);\n `);return n=URL.createObjectURL(new Blob([s],{type:'text/javascript'})),new Worker(n,t)}finally{URL.revokeObjectURL(n)}var o},m.exports=o},1039,[]); __d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"currentScrollY",{enumerable:!0,get:function(){return u}}),Object.defineProperty(_e,"screenGeneration",{enumerable:!0,get:function(){return c}}),Object.defineProperty(_e,"restoreScroll",{enumerable:!0,get:function(){return o}}),_e.useScrollMemory=function(u){const c=(0,e.useRef)(0),o=(0,e.useRef)(0),l=(0,e.useRef)(0),s=(0,e.useRef)(0),f=(0,e.useRef)(0),v=(0,e.useRef)(null),y=(0,e.useRef)([]),h=()=>{y.current.forEach(clearTimeout),y.current=[]},b=()=>{const e=v.current;null!=e&&(u.current?.scrollTo({y:e,animated:!1}),f.current-s.current>=e-2&&(c.current=e,o.current=e,v.current=null,h()))},p=(0,e.useCallback)(e=>{if(h(),v.current=Math.max(0,e),e<=0)return v.current=null,u.current?.scrollTo({y:0,animated:!1}),c.current=0,void(o.current=0);for(const e of[0,30,80,160,320,600,1e3,1600,2500])y.current.push(setTimeout(b,e));y.current.push(setTimeout(()=>{v.current=null},2600))},[]);t={y:()=>o.current,restore:p};const R=(0,e.useCallback)(()=>{n++;return o.current},[]);return{props:{scrollEventThrottle:32,onScroll:e=>{const t=e.nativeEvent.contentOffset.y;c.current=t,s.current=e.nativeEvent.layoutMeasurement.height,f.current=e.nativeEvent.contentSize.height,Date.now()-l.current>250&&null==v.current&&(o.current=t)},onScrollBeginDrag:()=>{v.current=null,h()},onContentSizeChange:(e,t)=>{f.current=t,l.current=Date.now(),b()},onLayout:e=>{s.current=e.nativeEvent.layout.height}},restore:p,leave:R}};var e=r(d[0]);let t=null,n=0;const u=()=>t?t.y():0,c=()=>n,o=e=>t?.restore(e)},1040,[34]); __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,"useBackLayers",{enumerable:!0,get:function(){return f}}),_e.runBackLayer=function(){const e=f.getState().layers,t=e[e.length-1];return!!t&&(t.fn(),!0)},_e.useBackLayer=function(e,n,o=!0){const s=(0,t.useRef)(n);s.current=n,(0,t.useEffect)(()=>{if(!e)return;const t=++y,n=(0,u.currentScrollY)(),l=(0,u.screenGeneration)();return f.setState(e=>({layers:[...e.layers,{id:t,fn:()=>s.current(),own:o}]})),()=>{f.setState(e=>({layers:e.layers.filter(e=>e.id!==t)})),(0,u.screenGeneration)()===l&&(0,u.restoreScroll)(n)}},[e,o])},Object.defineProperty(_e,"useInnerBackShown",{enumerable:!0,get:function(){return w}}),Object.defineProperty(_e,"BACK_GUTTER",{enumerable:!0,get:function(){return p}}),_e.BackTitleRow=function({back:e,onBack:n,title:s}){const[l,u]=(0,t.useState)(0),[f,y]=(0,t.useState)({w:96,h:48}),[w,b]=(0,t.useState)(0),S=Array.from(new Set(String(s??'').split(/\s+/).filter(Boolean)));String(s??'').length>=20&&S.length>=3&&S.push('00000000');const v=Math.max(p,Math.ceil(f.w)+4),j=e&&l>0&&l-2*vu(Math.round(e.nativeEvent.layout.width)),style:{minHeight:44,justifyContent:'center',alignItems:'center',paddingHorizontal:e&&!j?v:0,paddingTop:j?f.h:0},children:[e?(0,h.jsx)(o.default,{style:{position:'absolute',left:0,top:0},onLayout:e=>{const t=Math.round(e.nativeEvent.layout.width),n=Math.round(e.nativeEvent.layout.height);y(e=>e.w===t&&e.h===n?e:{w:t,h:n})},children:(0,h.jsx)(g,{onPress:n})}):null,(0,h.jsx)(c.T,{size:22,weight:"bold",center:!0,accessibilityRole:"header",children:s}),e&&S.length?(0,h.jsx)(o.default,{"aria-hidden":!0,importantForAccessibility:"no-hide-descendants",pointerEvents:"none",style:{position:'absolute',left:0,top:0,opacity:0,alignItems:'flex-start'},onLayout:e=>b(Math.ceil(e.nativeEvent.layout.width)),children:S.map(e=>(0,h.jsx)(c.T,{size:22,weight:"bold",numberOfLines:1,style:{alignSelf:'flex-start'},children:e},e))}):null]})},_e.BackButton=g,_e.useWebBack=function(e){const n=(0,t.useRef)(e);n.current=e,(0,t.useEffect)(()=>{if('undefined'==typeof window||!window.history?.pushState)return;const e=()=>{try{window.history.pushState({...window.history.state??{},ccBack:Date.now()},'',window.location.href)}catch{}};e();const t=t=>{n.current()&&(t.stopImmediatePropagation?.(),e())};return window.addEventListener('popstate',t,!0),()=>window.removeEventListener('popstate',t,!0)},[])};var t=r(d[0]);r(d[1]);var n=e(r(d[2])),o=e(r(d[3])),s=r(d[4]),l=r(d[5]),c=r(d[6]),u=r(d[7]),h=r(d[8]);const f=(0,s.create)(()=>({layers:[]}));let y=0;const w=()=>f(e=>e.layers.some(e=>e.own)),p=100;function g({onPress:e,testID:t="screen-back",label:o="Back"}){return(0,h.jsx)(n.default,{testID:t,accessibilityRole:"button",accessibilityLabel:o,onPress:e,hitSlop:8,style:({pressed:e})=>({minHeight:48,minWidth:96,justifyContent:'center',paddingRight:12,opacity:e?.6:1,alignSelf:'flex-start'}),children:(0,h.jsxs)(c.T,{size:18,weight:"semibold",colour:l.colours.gold,children:["\u2039 ",o]})})}},1041,[34,236,402,102,815,840,794,1040,25]); -__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"APP_VERSION",{enumerable:!0,get:function(){return t}});const t='v0.3.12.121'},1042,[]); +__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"APP_VERSION",{enumerable:!0,get:function(){return t}});const t='v0.3.12.122'},1042,[]); __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.NotificationsSettings=function({rid:e}){(0,n.useEffect)(()=>{c.useNotifs.getState().ensure(e),(0,j.readPushLive)()},[e]);const t=(0,c.useNotifs)(e=>e.items).filter(t=>t.rid===e&&!t.removed),s=(0,h.useOwner)(e=>e.staff),o=(0,j.usePushLive)(),[l,p]=(0,n.useState)(null),[f,g]=(0,n.useState)(null),[x,b]=(0,n.useState)(!1),y=c.useNotifs.getState(),T=s.map(e=>({id:e.id,role:e.role,level:e.level,job:e.job,department:e.dept,active:e.active})),v=e=>{const t=(0,u.resolveRecipients)(e,T,[]),n=[...e.recipients.groups.map(e=>u.NOTIF_GROUP_LABEL[e]),...(e.recipients.onShiftIn??[]).map(e=>u.SHIFT_FILTER_LABEL[e])];e.recipients.fallback&&n.push(`else ${[...e.recipients.fallback.groups.map(e=>u.NOTIF_GROUP_LABEL[e]),...e.recipients.fallback.staff.map(e=>I(s.find(t=>t.id===e)?.name??e))].join(', ')}`);const o=e.recipients.staff.map(e=>I(s.find(t=>t.id===e)?.name??e));return[...n,...o].join(', ')+(t.length||(e.recipients.onShiftIn??[]).length?'':' (nobody yet)')};return(0,k.jsxs)(a.default,{style:{gap:10},testID:"notif-settings",children:[(0,k.jsx)(r.Muted,{size:13,children:"Tip: these remind people at a set time, e.g. the Mills milk order. They show in the app as a gold slider with Done and Later. Done is logged with the name and time. Times are UK time."}),(0,k.jsxs)(a.default,{testID:"push-live-status",style:{borderWidth:1,borderColor:d.colours.accentBorder,borderRadius:10,padding:8,gap:4},children:[(0,k.jsxs)(r.Row,{style:{justifyContent:'space-between'},children:[(0,k.jsx)(r.T,{weight:"semibold",children:"Send to phones"}),(0,k.jsx)(r.Badge,{kind:o.live?'gold':'neutral',label:o.live?'ON':'OFF'})]}),(0,k.jsx)(r.Muted,{size:12,children:o.live?'Phone notifications go to people who turned them on.':'Off: nothing goes to anyone\u2019s phone yet. In-app reminders still work.'}),(0,k.jsx)(r.Button,{small:!0,kind:"secondary",testID:"push-live-toggle",label:o.live?'Switch phone notifications off':'Switch phone notifications on\u2026',onPress:()=>b(!0)})]}),(0,k.jsx)(R,{}),t.map(e=>l===e.id?(0,k.jsx)(D,{init:e,onCancel:()=>p(null),onSave:t=>{y.update(e.id,t),p(null)}},e.id):(0,k.jsxs)(a.default,{testID:`notif-${e.seed??e.id}`,style:{borderWidth:1,borderColor:d.colours.hairline,borderRadius:12,padding:10,gap:4,opacity:e.paused?.6:1},children:[(0,k.jsxs)(r.Row,{style:{justifyContent:'space-between'},children:[(0,k.jsx)(r.T,{weight:"semibold",style:{flex:1},children:e.title}),e.paused?(0,k.jsx)(r.Badge,{kind:"neutral",label:"Off"}):null]}),(0,k.jsx)(r.Muted,{size:13,children:e.message}),(0,k.jsxs)(r.Muted,{size:12,children:[(0,u.scheduleText)(e)," \xb7 ",v(e)," \xb7 ",[e.sendBy.inApp?'In app':'',e.sendBy.push?'Phone':''].filter(Boolean).join(' + ')]}),(0,k.jsxs)(r.Row,{gap:6,children:[(0,k.jsx)(r.Button,{small:!0,kind:"secondary",testID:`notif-edit-${e.seed??e.id}`,label:"Edit",onPress:()=>p(e.id)}),(0,k.jsx)(r.Button,{small:!0,kind:"ghost",label:e.paused?'Switch on':'Switch off',onPress:()=>y.update(e.id,{paused:!e.paused})}),(0,k.jsx)(r.Button,{small:!0,kind:"ghost",label:"Remove",onPress:()=>g(e)})]})]},e.id)),'new'===l?(0,k.jsx)(D,{init:C,onCancel:()=>p(null),onSave:t=>{y.add(e,t),p(null)}}):(0,k.jsx)(r.Button,{small:!0,testID:"notif-add",label:"Add a notification",onPress:()=>p('new')}),(0,k.jsxs)(r.Sheet,{visible:!!f,onClose:()=>g(null),title:"Remove this notification?",children:[(0,k.jsx)(r.T,{children:f?.title}),(0,k.jsx)(r.Muted,{children:"Nobody gets it after this. Reset to default restores the configured rules."}),(0,k.jsxs)(r.Row,{gap:8,children:[(0,k.jsx)(r.Button,{label:"Remove",onPress:()=>{f&&y.remove(f.id),g(null)}}),(0,k.jsx)(r.Button,{kind:"ghost",label:"Cancel",onPress:()=>g(null)})]})]}),(0,k.jsxs)(r.Sheet,{visible:x,onClose:()=>b(!1),title:o.live?'Switch phone notifications off?':'Switch phone notifications on?',testID:"push-live-confirm",children:[(0,k.jsx)(r.T,{children:o.live?'Nothing more goes to phones. In-app reminders keep working.':'From the next scheduled time, everyone ticked on a notification with \u201cPhone notification\u201d gets it on any phone where they turned phone notifications on.'}),(0,k.jsxs)(r.Row,{gap:8,children:[(0,k.jsx)(r.Button,{testID:"push-live-yes",label:o.live?'Switch off':'Yes, switch on',onPress:()=>{(0,j.setPushLive)(!o.live).then(e=>(0,w.notify)({id:'push-live',tone:e.ok?'normal':'warn',title:e.ok?o.live?'Phone notifications are off':'Phone notifications are on':'Not changed',body:e.message??'',timeoutMs:7e3})),b(!1)}}),(0,k.jsx)(r.Button,{kind:"ghost",label:"Cancel",onPress:()=>b(!1)})]})]})]})},_e.PushButton=R,_e.OrderListsSettings=function({rid:e}){(0,n.useEffect)(()=>{p.useOrderLists.getState().ensure(e)},[e]);const s=(0,p.useOrderLists)(e=>e.lists).filter(t=>t.rid===e),o=(0,p.orderSettingsOf)(e);(0,p.useOrderLists)(t=>t.settings[e]);const l=p.useOrderLists.getState(),[c,u]=(0,n.useState)(''),[h,g]=(0,n.useState)({});return(0,k.jsxs)(a.default,{style:{gap:10},testID:"order-list-settings",children:[(0,k.jsx)(r.Muted,{size:13,children:"Tip: running lists (like Alsons drinks) collect items until you order; trip lists (like Cash and carry) are for one shopping day. Logos and phone numbers are set on each list."}),(0,k.jsx)(r.Toggle,{testID:"order-allow-staff",label:"Let all staff add items",value:o.allowStaff,onChange:t=>l.setSettings(e,{allowStaff:t})}),(0,k.jsx)(r.Muted,{size:12,children:"Staff can add items and see the lists. Only managers and the Head Chef tick, remove or finish an order."}),(0,k.jsx)(r.T,{weight:"semibold",children:"Default trip day"}),(0,k.jsx)(r.Row,{wrap:!0,gap:6,children:v.map(t=>(0,k.jsx)(r.Chip,{label:f.DAY_FULL[t].slice(0,3),selected:o.defaultTripDay===t,onPress:()=>l.setSettings(e,{defaultTripDay:t})},t))}),s.map(e=>(0,k.jsxs)(a.default,{testID:`order-list-row-${e.seed??e.id}`,style:{borderWidth:1,borderColor:d.colours.hairline,borderRadius:10,padding:8,gap:6,opacity:e.archived?.55:1},children:[(0,k.jsxs)(r.Row,{gap:6,children:[(0,k.jsx)(t.TextInput,{accessibilityLabel:`Rename ${e.name}`,value:h[e.id]??e.name,onChangeText:t=>g(s=>({...s,[e.id]:t})),onBlur:()=>{const t=(h[e.id]??'').trim();t&&t!==e.name&&l.updateList(e.id,{name:t})},style:{...T,flex:1,minWidth:0}}),(0,k.jsx)(r.Badge,{kind:"neutral",label:'trip'===e.kind?'Trip':'Running'})]}),'trip'===e.kind?(0,k.jsx)(r.Row,{wrap:!0,gap:6,children:v.map(t=>(0,k.jsx)(r.Chip,{label:f.DAY_FULL[t].slice(0,3),selected:(e.tripDay??o.defaultTripDay)===t,onPress:()=>l.updateList(e.id,{tripDay:t})},t))}):null,(0,k.jsx)(r.Row,{gap:6,children:(0,k.jsx)(r.Button,{small:!0,kind:"ghost",label:e.archived?'Bring back':'Archive',onPress:()=>l.updateList(e.id,{archived:!e.archived})})})]},e.id)),(0,k.jsxs)(r.Row,{gap:6,wrap:!0,children:[(0,k.jsx)(t.TextInput,{accessibilityLabel:"New list name",testID:"order-new-name",value:c,onChangeText:u,placeholder:"e.g. Butcher",placeholderTextColor:d.colours.muted,style:{...T,flexGrow:1,flexBasis:160,minWidth:0}}),(0,k.jsx)(r.Button,{small:!0,label:"Add running",disabled:c.trim().length<2,onPress:()=>{l.addList(e,{name:c.trim(),kind:'running'}),u('')}}),(0,k.jsx)(r.Button,{small:!0,kind:"secondary",label:"Add trip",disabled:c.trim().length<2,onPress:()=>{l.addList(e,{name:c.trim(),kind:'trip',tripDay:o.defaultTripDay}),u('')}})]})]})},Object.defineProperty(_e,"resetOrderLists",{enumerable:!0,get:function(){return B}}),_e.ClockAreaSettings=function({rid:e,me:c}){(0,g.useClockArea)(t=>t.areas[e]);const u=(0,g.areaOf)(e);const h=g.useClockArea.getState(),p=(0,s.privateClockVenue)(e),[f,j]=(0,n.useState)(null==u.lat?'':String(u.lat)),[y,w]=(0,n.useState)(null==u.lng?'':String(u.lng)),[v,S]=(0,n.useState)(!1),[I,C]=(0,n.useState)(''),[L,D]=(0,n.useState)(u.breakOptions.join(', ')),R=(t,s)=>{const n=Number(t),o=Number(s);t.trim()||s.trim()?Number.isFinite(n)&&Number.isFinite(o)&&Math.abs(n)<=90&&Math.abs(o)<=180&&h.set(e,{lat:n,lng:o},c):h.set(e,{lat:null,lng:null},c)},B=async()=>{if(p)return;S(!0),C('');const t=await(0,b.getFix)();if(S(!1),'object'!=typeof t)return void C('denied'===t?'Location is blocked for this app. Allow it in your browser or phone settings.':'Couldn\u2019t get your location. Try again outside or near a window.');const s=t.lat.toFixed(6),n=t.lng.toFixed(6);j(s),w(n),h.set(e,{lat:Number(s),lng:Number(n)},c),C(`Centre set to where you are (accurate to about ${Math.round(t.acc)} m).`)},P=(0,x.areaSet)(u);return(0,k.jsxs)(a.default,{style:{gap:10},testID:"clock-area-settings",children:[(0,k.jsx)(r.Muted,{size:13,children:p?'The address-matched pub centre is configured below. Only clock-in checks location; only pass/fail is saved. No background, clock-out or break checks. Change the radius or centre here; use a manager override for a refused check.':'Tip: stand in the middle of the venue and tap \u201cUse my current location\u201d. Clocking in, out and breaks then only work within the distance below. Rota and pay screens are never blocked.'}),P?null:(0,k.jsx)(r.Banner,{kind:"warn",title:"Clock-in area not set yet",children:"Until you set the centre, staff can clock in from anywhere."}),p?(0,k.jsx)(r.Muted,{children:"Clock-in at the pub is required. A manager can record an exception with a reason."}):(0,k.jsx)(r.Toggle,{testID:"clock-area-on",label:"Check people are at the venue",value:u.on,onChange:t=>h.set(e,{on:t},c)}),p?null:(0,k.jsx)(r.Button,{testID:"clock-area-here",label:v?'Finding you\u2026':'\ud83d\udccd Use my current location',disabled:v,onPress:()=>{B()}}),I?(0,k.jsx)(r.Muted,{size:13,children:I}):null,(0,k.jsxs)(r.Row,{wrap:!0,gap:8,children:[(0,k.jsxs)(a.default,{style:{gap:2},children:[(0,k.jsx)(r.Muted,{size:12,children:"Latitude"}),(0,k.jsx)(t.TextInput,{accessibilityLabel:"Latitude",testID:"clock-area-lat",value:f,onChangeText:j,onBlur:()=>R(f,y),placeholder:"55.40\u2026",placeholderTextColor:d.colours.muted,style:{...T,width:130}})]}),(0,k.jsxs)(a.default,{style:{gap:2},children:[(0,k.jsx)(r.Muted,{size:12,children:"Longitude"}),(0,k.jsx)(t.TextInput,{accessibilityLabel:"Longitude",testID:"clock-area-lng",value:y,onChangeText:w,onBlur:()=>R(f,y),placeholder:"-4.75\u2026",placeholderTextColor:d.colours.muted,style:{...T,width:130}})]})]}),P?(0,k.jsx)(l.default,{accessibilityRole:"link",testID:"clock-area-map",onPress:()=>{o.default.openURL(`https://www.openstreetmap.org/?mlat=${u.lat}&mlon=${u.lng}#map=18/${u.lat}/${u.lng}`)},children:(0,k.jsx)(r.T,{size:13,colour:d.colours.gold,children:"See the pin on a map \u203a"})}):null,(0,k.jsx)(r.T,{weight:"semibold",children:"How far from the centre"}),(0,k.jsxs)(r.Row,{gap:8,children:[(0,k.jsx)(r.Button,{small:!0,kind:"secondary",label:"\u2212",onPress:()=>h.set(e,{radius:(0,x.clampRadius)(u.radius-10)},c)}),(0,k.jsxs)(r.T,{weight:"semibold",style:{minWidth:70,textAlign:'center'},children:[u.radius," m"]}),(0,k.jsx)(r.Button,{small:!0,kind:"secondary",label:"+",onPress:()=>h.set(e,{radius:(0,x.clampRadius)(u.radius+10)},c)})]}),(0,k.jsxs)(r.Muted,{size:12,children:["At least ",x.MIN_RADIUS," m. Phones aren\u2019t exact, so up to 50 m of the phone\u2019s own accuracy is added on top."]}),(0,k.jsx)(r.T,{weight:"semibold",children:"Forgotten break: lengths to offer at clock-out"}),(0,k.jsx)(t.TextInput,{accessibilityLabel:"Break lengths in minutes",testID:"clock-break-options",value:L,onChangeText:D,onBlur:()=>{const t=L.split(/[ ,]+/).map(Number).filter(e=>Number.isFinite(e)&&e>0&&e<=180);t.length&&h.set(e,{breakOptions:[...new Set(t)].sort((e,t)=>e-t)},c),D((0,g.areaOf)(e).breakOptions.join(', '))},style:T}),(0,k.jsxs)(r.Muted,{size:12,children:["Minutes, e.g. 5, 10, 15, 20, 30, 45, 60. Shows as ",u.breakOptions.map(x.breakLabel).join(', ')," and \u201cNo break\u201d."]}),p?(0,k.jsx)(r.Muted,{children:"No automatic arrival checks: staff location is used only at clock-in."}):(0,k.jsxs)(k.Fragment,{children:[" ",(0,k.jsx)(r.T,{weight:"semibold",children:"Not on the rota"}),(0,k.jsx)(r.Toggle,{testID:"clock-offrota-on",label:"Ask people at the venue who aren\u2019t on the rota if they want to clock in",value:u.offRotaPrompt,onChange:t=>h.set(e,{offRotaPrompt:t},c)}),(0,k.jsx)(t.TextInput,{accessibilityLabel:"Off-rota question",testID:"clock-offrota-title",value:u.offRotaTitle,onChangeText:t=>h.set(e,{offRotaTitle:t||x.DEFAULT_CLOCK_AREA.offRotaTitle},c),style:T}),(0,k.jsx)(t.TextInput,{accessibilityLabel:"Off-rota second line",testID:"clock-offrota-body",value:u.offRotaBody,onChangeText:t=>h.set(e,{offRotaBody:t||x.DEFAULT_CLOCK_AREA.offRotaBody},c),style:T}),(0,k.jsx)(r.Muted,{size:12,children:"This only checks while the app is open (web apps can\u2019t watch location in the background; that would need a native app)."})]})]})},Object.defineProperty(_e,"resetClockArea",{enumerable:!0,get:function(){return P}}),Object.defineProperty(_e,"COOKSAFE_URL",{enumerable:!0,get:function(){return O}}),_e.FoodSafetyCard=function({children:e}){return(0,k.jsx)(r.Card,{children:(0,k.jsxs)(a.default,{testID:"food-safety",style:{gap:6},children:[(0,k.jsx)(r.T,{size:17,weight:"semibold",children:"Food safety"}),(0,k.jsxs)(r.T,{children:["Based on ",(0,k.jsx)(r.T,{weight:"bold",colour:d.colours.gold,children:"CookSafe"})," (Food Standards Scotland)"]}),(0,k.jsx)(r.Muted,{size:12,children:"CoverCharge is not endorsed by Food Standards Scotland."}),(0,k.jsx)(l.default,{accessibilityRole:"link",testID:"cooksafe-link",onPress:()=>{o.default.openURL(O)},children:(0,k.jsx)(r.T,{size:14,colour:d.colours.gold,children:"Open the CookSafe guidance \u203a"})}),(0,k.jsx)(r.Muted,{size:13,children:"Full logs coming in the next update."}),e]})})};var t=_r(_d[0]),s=_r(_d[1]),n=_r(_d[2]),o=e(_r(_d[3])),l=e(_r(_d[4])),a=e(_r(_d[5])),r=_r(_d[6]),d=_r(_d[7]),c=_r(_d[8]),u=_r(_d[9]),h=_r(_d[10]),p=_r(_d[11]),f=_r(_d[12]),g=_r(_d[13]),x=_r(_d[14]),b=_r(_d[15]),j=_r(_d[16]),y=_r(_d[17]),w=_r(_d[18]),k=_r(_d[19]);const T={minHeight:44,borderRadius:10,borderWidth:1,borderColor:d.colours.hairline,backgroundColor:d.colours.surface2,color:d.colours.text,paddingHorizontal:10,fontSize:15},v=[1,2,3,4,5,6,0],S=['on_shift','everyone','managers','head_chef','kitchen','foh'],I=e=>e.replace(' (example)',''),C={title:'',message:'',days:[3,4,5,6,0],time:'21:00',recipients:{staff:[],groups:[]},sendBy:{inApp:!0,push:!1}};function L({value:e,onChange:t}){const s=(0,h.useOwner)(e=>e.staff).filter(e=>e.active);return(0,k.jsxs)(a.default,{style:{gap:6},testID:"notif-recipients",children:[(0,k.jsx)(r.T,{weight:"semibold",children:"Who gets it"}),(0,k.jsx)(r.Muted,{size:12,children:"Tick people, or pick a group (groups follow the team as it changes)."}),(0,k.jsx)(r.Row,{wrap:!0,gap:6,children:S.map(s=>(0,k.jsx)(r.Chip,{testID:`notif-group-${s}`,label:u.NOTIF_GROUP_LABEL[s],selected:e.groups.includes(s),onPress:()=>t({...e,groups:e.groups.includes(s)?e.groups.filter(e=>e!==s):[...e.groups,s]})},s))}),(0,k.jsx)(r.Muted,{size:12,children:"Only people on shift when it goes, in:"}),(0,k.jsx)(r.Row,{wrap:!0,gap:6,children:Object.keys(u.SHIFT_FILTER_LABEL).map(s=>{const n=(e.onShiftIn??[]).includes(s);return(0,k.jsx)(r.Chip,{testID:`notif-onshift-${s}`,label:u.SHIFT_FILTER_LABEL[s],selected:n,onPress:()=>t({...e,onShiftIn:n?(e.onShiftIn??[]).filter(e=>e!==s):[...e.onShiftIn??[],s]})},s)})}),(0,k.jsx)(a.default,{style:{gap:2},children:s.map(s=>{const n=e.staff.includes(s.id);return(0,k.jsxs)(l.default,{testID:`notif-tick-${s.id}`,accessibilityRole:"checkbox",accessibilityState:{checked:n},onPress:()=>t({...e,staff:n?e.staff.filter(e=>e!==s.id):[...e.staff,s.id]}),style:{flexDirection:'row',alignItems:'center',gap:10,paddingVertical:6},children:[(0,k.jsx)(a.default,{style:{width:22,height:22,borderRadius:5,borderWidth:1.5,borderColor:d.colours.gold,alignItems:'center',justifyContent:'center',backgroundColor:n?'#2a2414':'transparent'},children:n?(0,k.jsx)(r.T,{size:14,colour:d.colours.gold,children:"\u2713"}):null}),(0,k.jsx)(r.T,{style:{flex:1},children:(0,h.staffLabel)({name:I(s.name),nickname:s.nickname})}),(0,k.jsx)(r.Muted,{size:12,children:'Head Chef'===s.level?'Head Chef':s.job})]},s.id)})}),(0,k.jsx)(r.Muted,{size:12,children:"If nobody above matches when it goes, send it to:"}),(0,k.jsxs)(r.Row,{wrap:!0,gap:6,children:[S.filter(e=>'on_shift'!==e).map(s=>{const n=e.fallback??{staff:[],groups:[]},o=n.groups.includes(s);return(0,k.jsx)(r.Chip,{testID:`notif-fallback-${s}`,label:u.NOTIF_GROUP_LABEL[s],selected:o,onPress:()=>{const l=o?n.groups.filter(e=>e!==s):[...n.groups,s];t({...e,fallback:l.length||n.staff.length?{...n,groups:l}:void 0})}},s)}),s.map(s=>{const n=e.fallback??{staff:[],groups:[]},o=n.staff.includes(s.id);return(0,k.jsx)(r.Chip,{testID:`notif-fallback-${s.id}`,label:I(s.name),selected:o,onPress:()=>{const l=o?n.staff.filter(e=>e!==s.id):[...n.staff,s.id];t({...e,fallback:l.length||n.groups.length?{...n,staff:l}:void 0})}},s.id)})]})]})}function D({init:e,onSave:s,onCancel:o}){const[l,c]=(0,n.useState)(e),[h,p]=(0,n.useState)(!!e.dayTimes&&Object.keys(e.dayTimes).length>0),f=(0,u.validateNotif)(l),g=e=>c(t=>({...t,...e}));return(0,k.jsxs)(a.default,{testID:"notif-editor",style:{gap:8,borderWidth:1,borderColor:d.colours.accentBorder,borderRadius:12,padding:10},children:[(0,k.jsx)(r.T,{weight:"semibold",children:"Title"}),(0,k.jsx)(t.TextInput,{accessibilityLabel:"Notification title",testID:"notif-title",value:l.title,onChangeText:e=>g({title:e}),maxLength:60,style:T}),(0,k.jsx)(r.T,{weight:"semibold",children:"Message"}),(0,k.jsx)(t.TextInput,{accessibilityLabel:"Notification message",testID:"notif-message",value:l.message,onChangeText:e=>g({message:e}),maxLength:160,style:T}),(0,k.jsx)(r.T,{weight:"semibold",children:"Days"}),(0,k.jsx)(r.Row,{wrap:!0,gap:6,children:v.map(e=>(0,k.jsx)(r.Chip,{testID:`notif-day-${e}`,label:u.NOTIF_DAY_NAMES[e],selected:l.days.includes(e),onPress:()=>g({days:l.days.includes(e)?l.days.filter(t=>t!==e):[...l.days,e]})},e))}),(0,k.jsxs)(r.Row,{gap:8,children:[(0,k.jsx)(r.T,{weight:"semibold",children:"Time (UK)"}),(0,k.jsx)(t.TextInput,{accessibilityLabel:"Time",testID:"notif-time",value:l.time,onChangeText:e=>g({time:e}),placeholder:"21:00",style:{...T,width:90,borderColor:(0,u.validHm)(l.time)?d.colours.hairline:d.colours.red}})]}),(0,k.jsx)(r.Toggle,{label:"A different time on some days",value:h,onChange:e=>{p(e),e||g({dayTimes:void 0})}}),h?(0,k.jsx)(r.Row,{wrap:!0,gap:8,children:v.filter(e=>l.days.includes(e)).map(e=>(0,k.jsxs)(r.Row,{gap:4,children:[(0,k.jsx)(r.T,{size:13,children:u.NOTIF_DAY_NAMES[e]}),(0,k.jsx)(t.TextInput,{accessibilityLabel:`${u.NOTIF_DAY_NAMES[e]} time`,testID:`notif-daytime-${e}`,value:l.dayTimes?.[String(e)]??'',placeholder:l.time,onChangeText:t=>{const s={...l.dayTimes??{}};t.trim()?s[String(e)]=t.trim():delete s[String(e)],g({dayTimes:s})},style:{...T,width:74}})]},e))}):null,(0,k.jsx)(L,{value:l.recipients,onChange:e=>g({recipients:e})}),(0,k.jsx)(r.T,{weight:"semibold",children:"Send by"}),(0,k.jsx)(r.Toggle,{testID:"notif-inapp",label:"In the app (gold slider, Done / Later)",value:l.sendBy.inApp,onChange:e=>g({sendBy:{...l.sendBy,inApp:e}})}),(0,k.jsx)(r.Toggle,{testID:"notif-push",label:"Phone notification (when phones are switched on)",value:l.sendBy.push,onChange:e=>g({sendBy:{...l.sendBy,push:e}})}),f?(0,k.jsx)(r.Muted,{size:13,children:f}):null,(0,k.jsxs)(r.Row,{gap:8,style:{justifyContent:'flex-end'},children:[(0,k.jsx)(r.Button,{small:!0,kind:"ghost",label:"Cancel",onPress:o}),(0,k.jsx)(r.Button,{small:!0,testID:"notif-save",label:"Save",disabled:!!f,onPress:()=>s({...l,title:l.title.trim(),message:l.message.trim(),days:[...l.days].sort()})})]})]})}function R(){const[e,t]=(0,n.useState)(null),[s,o]=(0,n.useState)('');return(0,n.useEffect)(()=>{(0,y.pushState)().then(t)},[]),e&&'unsupported'!==e?(0,k.jsxs)(a.default,{testID:"push-button",style:{gap:4},children:[(0,k.jsx)(r.Button,{small:!0,kind:'on'===e?'ghost':'secondary',testID:"push-turn-on",label:'on'===e?'Phone notifications are on for this phone \xb7 Turn off':'\ud83d\udd14 Turn on phone notifications',onPress:()=>{('on'===e?(0,y.turnOffPush)():(0,y.turnOnPush)()).then(e=>{o(e.message),(0,y.pushState)().then(t)})}}),(0,k.jsx)(r.Muted,{size:12,children:s||('ios-home-screen'===e?'iPhone: add this app to your Home Screen first (iOS 16.4 or later).':'For this phone only. Each person turns it on on their own phone.')})]}):null}const B=e=>p.useOrderLists.getState().resetSettings(e);const P=(e,t)=>g.useClockArea.getState().reset(e,t),O='https://www.foodstandards.gov.scot/publications-and-research/publications/cooksafe-manual'},1043,[796,991,34,379,402,102,794,840,1021,1022,865,1025,1026,1027,992,1044,985,1045,994,25]); __d(function(_g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.getFix=function(e=1e4){const t='undefined'!=typeof navigator?navigator.geolocation:void 0;return t?new Promise(o=>{let n=!1;const c=e=>{n||(n=!0,o(e))},u=setTimeout(()=>c('timeout'),e+1500);try{t.getCurrentPosition(e=>{clearTimeout(u),c({lat:e.coords.latitude,lng:e.coords.longitude,acc:e.coords.accuracy??999})},e=>{clearTimeout(u),c(1===e.code?'denied':3===e.code?'timeout':'unavailable')},{enableHighAccuracy:!0,timeout:e,maximumAge:0})}catch{clearTimeout(u),c('unsupported')}}):Promise.resolve('unsupported')},_e.locationAllowed=async function(){try{const e=await(navigator.permissions?.query({name:'geolocation'}));return'granted'===e?.state}catch{return!1}}},1044,[]); __d(function(g,r,_i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.pushState=f,e.turnOnPush=async function(){const u=await f();if('ios-home-screen'===u)return{ok:!1,message:'On iPhone, add this app to your Home Screen first (Share \u203a Add to Home Screen, iOS 16.4 or later), then open it from there.'};if('unsupported'===u)return{ok:!1,message:'This browser can\u2019t get phone notifications. Try Chrome on Android, or the app from your iPhone Home Screen.'};if('blocked'===u)return{ok:!1,message:'Notifications are blocked for this app. Allow them in your phone\u2019s settings, then try again.'};const c=i.useSync.getState();if('staff'!==c.kind||!c.venueId||!c.staffRef)return{ok:!1,message:'Sign in from your personal link first.'};if('granted'!==await Notification.requestPermission())return{ok:!1,message:'You didn\u2019t allow notifications, so nothing changed.'};const p=await navigator.serviceWorker.ready,h=(await p.pushManager.getSubscription()??await p.pushManager.subscribe({userVisibleOnly:!0,applicationServerKey:s(n.VAPID_PUBLIC_KEY)})).toJSON();if(!h.endpoint||!h.keys?.p256dh||!h.keys?.auth)return{ok:!1,message:'Your browser didn\u2019t give a usable subscription. Try again.'};const l=(0,t.getSupabase)(),{error:y}=await l.from('push_subscriptions').upsert({venue_id:c.venueId,staff_ref:c.staffRef,app:o.APP_VARIANT,endpoint:h.endpoint,p256dh:h.keys.p256dh,auth:h.keys.auth,user_agent:navigator.userAgent.slice(0,200)},{onConflict:'user_id,endpoint'});return y?{ok:!1,message:`Couldn\u2019t save this phone: ${y.message}`}:{ok:!0,message:'Phone notifications are on for this device.'}},e.turnOffPush=async function(){const n=await(navigator.serviceWorker?.getRegistration()),i=await(n?.pushManager.getSubscription());if(!i)return{ok:!0,message:'Phone notifications are off for this device.'};const o=i.endpoint;await i.unsubscribe();try{const n=(0,t.getSupabase)();await n.from('push_subscriptions').delete().eq('endpoint',o)}catch{}return{ok:!0,message:'Phone notifications are off for this device.'}};var n=r(d[0]),t=r(d[1]),i=r(d[2]),o=r(d[3]);const s=n=>{const t=atob(n.replace(/-/g,'+').replace(/_/g,'/')+'='.repeat((4-n.length%4)%4)),i=new Uint8Array(t.length);for(let n=0;n'undefined'!=typeof navigator&&/iPhone|iPad|iPod/.test(navigator.userAgent),c=()=>'undefined'!=typeof window&&(window.matchMedia?.('(display-mode: standalone)').matches||!0===navigator.standalone);async function f(){if('undefined'==typeof window||!('serviceWorker'in navigator))return'unsupported';if(!('PushManager'in window)||'undefined'==typeof Notification)return u()&&!c()?'ios-home-screen':'unsupported';if('denied'===Notification.permission)return'blocked';const n=await navigator.serviceWorker.getRegistration();return await(n?.pushManager.getSubscription())?'on':'off'}},1045,[1046,931,985,846]); @@ -1191,11 +1191,11 @@ __d(function(g,r,i,_a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule' __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 v}}),Object.defineProperty(_e,"fitLabel",{enumerable:!0,get:function(){return M}}),Object.defineProperty(_e,"BIG_LABEL_MIN",{enumerable:!0,get:function(){return j}}),_e.areaBounds=k,_e.minReadableScale=function(e,t){return Math.max(0,...e.tables.filter(e=>e.areaId===t).map(e=>{const t='round'===e.shape?.85:1,o=(7.4399999999999995*Math.max(1,(0,x.tableNumber)(e).length)+6)/(e.w*t),n=22/Math.min(e.w,e.h);return Math.max(o,n)}))},_e.seatSpots=S,_e.FixtureShape=R,_e.FloorCanvas=function(e){const[C,$]=(0,r.useState)({w:0,h:0}),I=e.plan.tables.filter(t=>t.areaId===e.areaId),A=e.crop&&I.length?k(e.plan,e.areaId):{x:0,y:0,w:l.PLAN_W,h:l.PLAN_H},z='live'===e.mode?[...new Map(I.flatMap(t=>{const o=e.view?.[t.name];if(!o?.group||o.group.length<2)return[];const n=[...o.group].sort().join('+');return[[n,{key:n,members:o.group,view:o}]]})).values()]:[],L=28*z.length,E={x:A.x,y:A.y,r:A.x+A.w,b:A.y+A.h},D=C.w?'width'===e.fit?Math.min(C.w/l.PLAN_W,e.maxH?e.maxH/l.PLAN_H:9):Math.min(C.w/A.w,Math.max(1,C.h-L)/A.h):0,F=e.fill&&'contain'===e.fit&&D>0&&C.h>0,_=F?(C.w/D-A.w)/2:0,O=F?((C.h-L)/D-A.h)/2:0,N={x:E.x-_,y:E.y-O,r:E.r+_,b:E.b+O},B=N.r-N.x,P=N.b-N.y,[W,H]=(0,r.useState)(null),G=(0,r.useRef)(null),[Y,X]=(0,r.useState)(null),U=(0,r.useRef)(null);U.current=Y,i.default.useEffect(()=>{if(!Y)return;const e=setTimeout(()=>X(null),n.ARM_MS);return()=>clearTimeout(e)},[Y]);const q='live'===e.mode&&!!e.onDrop,J=e=>!q||(0,n.isArmed)(U.current,e.id,Date.now()),K=t=>e.plan.sections.find(e=>e.id===t.sectionId),V=t=>e.plan.joins.find(e=>e.tables.includes(t.name)),Q=i.default.useMemo(()=>(0,x.numberClashes)(e.plan.tables).sameArea,[e.plan.tables]),Z=(t,o)=>({onStartShouldSetResponder:()=>!0,onMoveShouldSetResponder:()=>J(t),onResponderTerminationRequest:()=>!J(t),onResponderGrant:e=>{G.current={x:e.nativeEvent.pageX,y:e.nativeEvent.pageY,id:t.id,kind:o}},onResponderMove:n=>{const r=G.current;if(!r)return;const i=n.nativeEvent.pageX-r.x,s=n.nativeEvent.pageY-r.y;Math.abs(i)+Math.abs(s)<6&&!W||J(t)&&('live'!==e.mode||e.onDrop&&e.view&&['seated','mains','dessert','bill'].includes(e.view[t.name]?.status)&&e.view[t.name]?.booking)&&H({id:t.id,dx:i,dy:s,kind:o})},onResponderRelease:r=>{const i=G.current;G.current=null;const a=r.nativeEvent.pageX-(i?.x??0),u=r.nativeEvent.pageY-(i?.y??0);if(H(null),Math.abs(a)+Math.abs(u)<6||!D){if('move'===o){if(q){const e=(0,n.releaseOn)(U.current,t.id,!1,Date.now());if(X(e.arm),'select'===e.action)try{s.default.announceForAccessibility(n.SELECTED_A11Y)}catch{}}e.onTap?.(t)}return}if(q){const e=(0,n.releaseOn)(U.current,t.id,!0,Date.now());if(X(e.arm),'move'!==e.action)return}const h=a/D,c=u/D;if('edit'===e.mode&&'move'===o)e.onMove?.(t,w(v(t.x+h,e.snapOn),0,l.PLAN_W-t.w),w(v(t.y+c,e.snapOn),0,l.PLAN_H-t.h));else if('edit'===e.mode&&'resize'===o)e.onResize?.(t,w(v(t.w+h,e.snapOn),50,400),w(v(t.h+c,e.snapOn),50,300));else if('live'===e.mode&&e.onDrop){const o=t.x+t.w/2+h,n=t.y+t.h/2+c,r=I.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);r&&e.onDrop(t,r)}}}),ee=e=>e*D,te=e=>ee(e-N.x),oe=e=>ee(e-N.y),ne='width'===e.fit?l.PLAN_H*D+L||200:void 0;return(0,g.jsxs)(a.default,{testID:"floor-canvas",onLayout:e=>$({w:e.nativeEvent.layout.width,h:e.nativeEvent.layout.height}),style:[{width:'100%',borderRadius:16,overflow:'hidden'},'contain'===e.fit?{flex:1}:{height:ne}],children:[z.map(e=>{const o=I.filter(t=>e.members.includes(t.name)),n=o.length?(Math.min(...o.map(e=>e.x))+Math.max(...o.map(e=>e.x+e.w)))/2:N.x+B/2,r=e.view.booking?.time??e.view.next?.time,i=`${T(e.members)}${r?` \xb7 ${'seated'===e.view.status?'Seated':'Booked'} ${r}`:''}`,s=Math.min(Math.max(0,C.w-8),260);return(0,g.jsx)(a.default,{testID:`joined-label-${e.key}`,accessible:!0,accessibilityLabel:`Joined tables ${i}`,pointerEvents:"none",style:{height:28,width:s,marginLeft:w(ee(n-N.x)-s/2,4,Math.max(4,C.w-s-4)),alignItems:'center',justifyContent:'center',overflow:'hidden',borderRadius:8,borderWidth:1,borderColor:h.colours.gold,backgroundColor:(0,t.soutersSurface)('#0B0B0B')},children:(0,g.jsx)(c.T,{size:16,weight:"bold",colour:h.colours.goldLight,center:!0,numberOfLines:1,children:i})},e.key)}),D?(0,g.jsx)(a.default,{style:{width:ee(B),height:ee(P),alignSelf:'center',backgroundColor:(0,t.soutersSurface)('#0F0E0C'),borderRadius:16,borderWidth:1,borderColor:h.colours.border,overflow:'hidden'},children:(0,g.jsxs)(a.default,{style:{position:'absolute',left:0,top:0,width:ee(B),height:ee(P)},children:['edit'===e.mode?Array.from({length:l.PLAN_W/(2*l.GRID)},(e,o)=>(0,g.jsx)(a.default,{style:{position:'absolute',left:te(o*l.GRID*2),top:0,bottom:0,width:1,backgroundColor:(0,t.soutersSurface)('#1E1B16')}},`v${o}`)):null,'edit'===e.mode?Array.from({length:l.PLAN_H/(2*l.GRID)},(e,o)=>(0,g.jsx)(a.default,{style:{position:'absolute',top:oe(o*l.GRID*2),left:0,right:0,height:1,backgroundColor:(0,t.soutersSurface)('#1E1B16')}},`h${o}`)):null,(e.plan.fixtures??[]).filter(t=>t.areaId===e.areaId).map(t=>(0,g.jsx)(R,{f:{...t,x:t.x-N.x,y:t.y-N.y},S:ee,live:'live'===e.mode},t.id)),e.plan.joins.map(e=>{const t=I.filter(t=>e.tables.includes(t.name));if(t.length<2)return null;const[o,n]=t,r=o.x+o.w/2,i=o.y+o.h/2,s=n.x+n.w/2,l=n.y+n.h/2,u=Math.hypot(s-r,l-i),h=Math.atan2(l-i,s-r);return(0,g.jsx)(a.default,{testID:`join-${e.tables.join('+')}`,style:{position:'absolute',left:te((r+s)/2-u/2),top:oe((i+l)/2)-3,width:ee(u),height:6,borderRadius:3,backgroundColor:'rgba(207,164,95,0.55)',transform:[{rotate:`${h}rad`}]}},e.id)}),I.map(n=>{const r=e.view?.[n.name],s=r?u.STATUS[r.status]:u.STATUS.free,v=W?.id===n.id,w=v&&'resize'===W.kind?Math.max(50,n.w+W.dx/D):n.w,C=v&&'resize'===W.kind?Math.max(50,n.h+W.dy/D):n.h,k=v&&'move'===W.kind?n.x+W.dx/D:n.x,R=v&&'move'===W.kind?n.y+W.dy/D:n.y,T=e.selected===n.id||e.highlight?.includes(n.name)||Y?.id===n.id,$=K(n),I='edit'===e.mode?'#2A2419':s.colour,A='edit'===e.mode?h.colours.text:s.fg,z='round'===n.shape?ee(Math.min(w,C))/2:ee(10),L='live'===e.mode?(0,x.liveTableLabel)(n,Q):(0,l.tableLabel)(n),E=ee(Math.min(w,C))<64,F=M(e.big?Math.max(13,Math.min(34,ee(Math.min(w,C))/3)):Math.max(11,Math.min(22,ee(Math.min(w,C))/4)),L,ee(w)*('round'===n.shape?.85:1),e.big?j:9),_=Math.max(e.big?11:12,Math.round(.62*F)),O=(ee(C)-6-1.4*F)/(1.4*_),N=O>=2&&ee(w)>=5*_?2:O>=1?1:0,B=r?.booking&&void 0!==r.seatedMins?r.booking.time:void 0,P='soon'===r?.status?r.next?.time??r.dayBookings?.[0]?.time:void 0,H='edit'===e.mode?`Table ${(0,o.tableNumbers)(L)}, ${(0,l.shapeLabel)(n.shape).toLowerCase()}, ${n.minSeats}\u2013${n.maxSeats} seats${n.online?', bookable online':''}`:'soon'===r?.status?`Table ${(0,o.tableNumbers)(L)}, booked later${P?`, ${P}`:''}${r.group?`, combined with ${r.group.filter(e=>e!==n.name).map(e=>`table ${e}`).join(', ')}`:''}`:`Table ${(0,o.tableNumbers)(L)}, ${s.label}${void 0!==r?.seatedMins?`, seated ${r.seatedMins} min`:''}${r?.covers?`, ${r.covers} Covers`:''}${r?.dayBookings?.length?`, booked: ${r.dayBookings.map(e=>`${e.time}, ${e.partySize} Covers`).join('; ')}`:''}${r?.group?`, combined with ${r.group.filter(e=>e!==n.name).map(e=>`table ${e}`).join(', ')}`:''}`,G=void 0!==r?.seatedMins&&r.booking?Math.min(1.2,r.seatedMins/(r.booking.durationMins??(0,u.turnFor)(r.booking.partySize,e.turnBase))):null;return(0,g.jsxs)(i.default.Fragment,{children:[S({...n,w:w,h:C}).map((t,o)=>(0,g.jsx)(a.default,{pointerEvents:"none",style:[{position:'absolute',left:te(k+t.x)-Math.max(4,ee(8)),top:oe(R+t.y)-Math.max(4,ee(8)),width:Math.max(8,ee(16)),height:Math.max(8,ee(16)),borderRadius:99,backgroundColor:'edit'===e.mode?'#5A4C33':'rgba(255,255,255,0.16)',borderWidth:1,borderColor:'edit'===e.mode?h.colours.gold:'rgba(255,255,255,0.25)'},y()]},o)),'live'===e.mode&&(ee(w)<44||ee(C)<44)?(0,g.jsx)(a.default,{accessible:!1,importantForAccessibility:"no-hide-descendants",'aria-hidden':!0,...Z(n,'move'),style:{position:'absolute',left:te(k+w/2)-Math.max(44,ee(w))/2,top:oe(R+C/2)-Math.max(44,ee(C))/2,width:Math.max(44,ee(w)),height:Math.max(44,ee(C)),zIndex:2}}):null,(0,g.jsxs)(a.default,{testID:`table-${n.name}`,accessibilityRole:"button",accessibilityLabel:H,onAccessibilityTap:()=>e.onTap?.(n),onKeyDown:t=>{'Enter'!==t?.key&&' '!==t?.key||e.onTap?.(n)},tabIndex:0,...Z(n,'move'),style:[{position:'absolute',left:te(k),top:oe(R),width:ee(w),height:ee(C),borderRadius:z,backgroundColor:I,alignItems:'center',justifyContent:'center',padding:2,overflow:'hidden',borderWidth:T?3:e.sectionColours&&$?2.5:1.5,borderColor:T?'#FFFFFF':e.sectionColours&&$?(0,h.brandColour)($.colour):'edit'===e.mode?h.colours.gold:'rgba(0,0,0,0.35)',transform:[{scale:v?1.06:1}],zIndex:v?50:3,opacity:v&&'live'===e.mode?.85:1,shadowColor:'#000',shadowOpacity:v?.6:.3,shadowRadius:v?14:6,cursor:'edit'===e.mode?'grab':'pointer',touchAction:'none'},v?null:y()],children:[(0,g.jsxs)(a.default,{style:{alignItems:'center',justifyContent:'center',maxWidth:'100%',maxHeight:'100%',overflow:'hidden'},pointerEvents:"none",children:[(0,g.jsx)(c.T,{style:p,weight:"bold",size:F,colour:A,center:!0,numberOfLines:1,children:L}),'live'===e.mode&&'blocked'===r?.status?(0,g.jsx)(c.T,{style:f,size:Math.max(10,Math.round(.5*F)),weight:"semibold",colour:A,center:!0,numberOfLines:1,children:"Blocked"}):null,'live'===e.mode&&r?.group&&r.group.length>1?null:e.big&&'live'===e.mode&&r&&1===N?'free'!==r.status&&'soon'!==r.status&&(r.covers||B)?(0,g.jsx)(c.T,{style:f,size:_,weight:"bold",colour:A,center:!0,numberOfLines:1,children:[r.covers?`${r.covers}`:'',B??''].filter(Boolean).join(' \xb7 ')}):null:e.big&&'live'===e.mode&&r&&2===N?(0,g.jsxs)(g.Fragment,{children:['soon'!==r.status&&r.covers?(0,g.jsxs)(c.T,{style:f,size:_,weight:"semibold",colour:A,center:!0,children:[r.covers," ",1===r.covers?'Cover':'Covers']}):'free'!==r.status||E?null:(0,g.jsxs)(c.T,{style:f,size:_,colour:A,center:!0,children:[n.minSeats,"\u2013",n.maxSeats]}),'free'!==r.status&&'soon'!==r.status&&B?(0,g.jsx)(c.T,{style:f,size:_,weight:"bold",colour:A,center:!0,children:B}):'dirty'===r.status?(0,g.jsx)(c.T,{style:f,size:_,colour:A,center:!0,children:"Clear"}):null]}):e.big&&'live'===e.mode?null:'edit'===e.mode?E?null:(0,g.jsxs)(c.T,{style:f,size:11,colour:h.colours.muted,center:!0,children:[n.minSeats,"\u2013",n.maxSeats,n.online?' \xb7 online':'']}):r?(0,g.jsxs)(g.Fragment,{children:['free'!==r.status||E?null:(0,g.jsxs)(c.T,{style:f,size:11,colour:A,center:!0,children:[n.minSeats,"\u2013",n.maxSeats," seats"]}),void 0!==r.seatedMins?(0,g.jsxs)(c.T,{style:f,size:12,weight:"semibold",colour:A,center:!0,children:[r.seatedMins,"m \xb7 ",r.covers,"\ud83d\udc65"]}):r.orderOnly?(0,g.jsx)(c.T,{style:f,size:11,colour:A,center:!0,children:"Open order"}):null,'dirty'!==r.status||E?null:(0,g.jsx)(c.T,{style:f,size:11,colour:A,center:!0,children:"Clear"}),!E||r.allergy||r.vip?(0,g.jsxs)(c.T,{style:f,size:11,colour:A,center:!0,children:[r.allergy?'\u26a0':'',r.vip?'VIP'===r.vip?'\u2605':'\u2665':'',r.occasion?u.OCCASION_ICON[r.occasion]:'',r.note?'\u270e':'']}):null]}):null]}),null,'live'===e.mode&&r&&!E&&(r.booking??r.next)&&(0,b.needsIcons)(r.booking??r.next).replace('\u26a0\ufe0f','').trim()?(0,g.jsx)(a.default,{pointerEvents:"none",testID:`needs-${n.name}`,style:{position:'absolute',bottom:e.big?-Math.max(9,.55*_):2,right:e.big?-6:4,backgroundColor:(0,t.soutersSurface)('rgba(11,11,11,0.85)'),borderRadius:8,paddingHorizontal:4,borderWidth:1,borderColor:'rgba(255,255,255,0.15)'},children:(0,g.jsx)(c.T,{size:e.big?Math.max(11,.75*_):10,children:(0,b.needsIcons)(r.booking??r.next).replace('\u26a0\ufe0f','').trim()})}):null,$&&'live'===e.mode&&e.sectionColours&&!E&&!e.big?(0,g.jsx)(a.default,{pointerEvents:"none",style:{position:'absolute',top:3,right:6,backgroundColor:(0,h.brandColour)($.colour),borderRadius:6,paddingHorizontal:3},children:(0,g.jsx)(c.T,{size:9,weight:"bold",colour:"#0B0B0B",children:$.server})}):null,null===G||E?null:(0,g.jsx)(a.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,g.jsx)(a.default,{style:{width:`${Math.min(100,100*G)}%`,height:4,borderRadius:2,backgroundColor:G>=1?'#B3261E':'rgba(0,0,0,0.6)'}})}),V(n)&&'edit'===e.mode?(0,g.jsx)(a.default,{pointerEvents:"none",style:{position:'absolute',bottom:2,left:4},children:(0,g.jsx)(c.T,{size:10,colour:h.colours.gold,children:"\u26d3"})}):null]}),'edit'===e.mode&&e.selected===n.id?(0,g.jsx)(a.default,{testID:"resize-handle",accessibilityLabel:"Resize table",...Z(n,'resize'),style:{position:'absolute',left:te(k+w)-14,top:oe(R+C)-14,width:28,height:28,borderRadius:14,backgroundColor:h.colours.gold,borderWidth:2,borderColor:'#fff',zIndex:60,cursor:'nwse-resize',touchAction:'none'}}):null]},n.id)}),0===I.length?(0,g.jsx)(a.default,{style:{position:'absolute',left:0,right:0,top:'45%'},children:(0,g.jsxs)(c.T,{center:!0,colour:h.colours.muted,children:["No tables in this area yet",'edit'===e.mode?' \u2014 add some in Tables':'',"."]})}):null]})}):null]})};var t=_r(d[0]),o=_r(d[1]),n=_r(d[2]),r=_r(d[3]),i=e(r),s=e(_r(d[4]));_r(d[5]);var a=e(_r(d[6])),l=_r(d[7]),u=_r(d[8]),h=_r(d[9]),c=_r(d[10]),b=_r(d[11]),x=_r(d[12]),g=_r(d[13]);const f={flexShrink:0},p={flexShrink:0,maxWidth:'none'},y=(e=250)=>({transitionProperty:'background-color, border-color, transform, left, top, width, height',transitionDuration:`${e}ms`}),v=(e,t=!0)=>t?Math.round(e/l.GRID)*l.GRID:Math.round(e),w=(e,t,o)=>Math.max(t,Math.min(o,e)),M=(e,t,o,n=9)=>Math.max(n,Math.min(e,(o-6)/(.62*Math.max(1,t.length)))),j=12,C=46;function k(e,t){const o=e.tables.filter(e=>e.areaId===t);if(!o.length)return{x:0,y:0,w:l.PLAN_W,h:l.PLAN_H};const n=Math.max(0,Math.min(...o.map(e=>e.x))-C),r=Math.max(0,Math.min(...o.map(e=>e.y))-C);return{x:n,y:r,w:Math.min(l.PLAN_W,Math.max(...o.map(e=>e.x+e.w))+C)-n,h:Math.min(l.PLAN_H,Math.max(...o.map(e=>e.y+e.h))+C)-r}}function S(e){const t=Math.max(1,e.maxSeats),o=[];if('round'===e.shape){const n=e.w/2+9.6,r=e.h/2+9.6;for(let i=0;ie.w,r=Math.ceil(t/2),i=t-r;if(n){for(let t=0;te.w,s=n?{borderColor:'#FFFFFF',borderWidth:2}:null;return'bar'===e.kind?(0,g.jsx)(a.default,{pointerEvents:"none",style:[r,{backgroundColor:o?'#2A2216':'#3A2E1C',borderRadius:8,borderWidth:1.5,borderColor:o?'#5A4A30':h.colours.gold},s],children:(0,g.jsx)(c.T,{size:Math.max(9,Math.min(14,t(e.h)/2.4)),weight:"semibold",colour:h.colours.goldLight,children:"BAR"})}):'wall'===e.kind?(0,g.jsx)(a.default,{pointerEvents:"none",style:[r,{backgroundColor:o?'#3A3631':'#5C574F',borderRadius:2},s]}):'window'===e.kind?(0,g.jsx)(a.default,{pointerEvents:"none",style:[r,{backgroundColor:'rgba(226,196,137,0.16)',borderColor:'rgba(226,196,137,0.6)',borderWidth:1,borderRadius:2},s],children:!o&&t(i?e.h:e.w)>60?(0,g.jsx)(c.T,{size:9,colour:"#BFDDFF",style:i?{transform:[{rotate:'90deg'}]}:void 0,children:"WINDOW"}):null}):(0,g.jsx)(a.default,{pointerEvents:"none",style:[r,{borderColor:o?'#7A6440':h.colours.gold,borderWidth:1.5,borderStyle:'dashed',borderRadius:3,backgroundColor:'rgba(207,164,95,0.08)'},s],children:t(i?e.h:e.w)>40?(0,g.jsx)(c.T,{size:9,colour:h.colours.goldLight,style:i?{transform:[{rotate:'90deg'}]}:void 0,children:"DOOR"}):null})}function T(e){return(0,l.tablesLabel)(e.join('+')).replace(/^Tables? /,'').replace(/ \+ /g,'+')}},1108,[798,829,1109,34,281,236,102,1014,1079,840,794,1081,828,25]); __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"ARM_MS",{enumerable:!0,get:function(){return t}}),Object.defineProperty(e,"SELECT_HINT",{enumerable:!0,get:function(){return n}}),Object.defineProperty(e,"SELECTED_A11Y",{enumerable:!0,get:function(){return o}}),Object.defineProperty(e,"TABLE_SELECT_HINT",{enumerable:!0,get:function(){return c}}),Object.defineProperty(e,"isArmed",{enumerable:!0,get:function(){return l}}),e.releaseOn=function(n,o,c,u){const b=l(n,o,u);return c?b?{arm:null,action:'move'}:{arm:n&&u-n.at!!n&&n.id===o&&c-n.at!e.signOff),S=k.filter(e=>e.signOff),_=j.map(o.allergenLabel).join(', '),C=e=>e.map(e=>e.name).join(', ')||'none';return(0,f.jsxs)(l.default,{testID:"menu-allergy-check",style:{gap:6,borderWidth:1,borderColor:p.length?h.colours.red:h.colours.border,borderRadius:12,padding:10,backgroundColor:h.colours.surface2},children:[(0,f.jsxs)(u.T,{weight:"semibold",children:["Allergy check against the menu (",_,")"]}),(0,f.jsxs)(u.T,{size:14,colour:h.colours.red,children:["Contains: ",p.length," dish",1===p.length?'':'es']}),(0,f.jsxs)(u.T,{size:14,colour:h.colours.amber,children:["May contain: ",M.length]}),(0,f.jsxs)(u.T,{size:14,colour:h.colours.ok,children:["Free from ",1===j.length?'it':'them'," (signed off): ",S.length]}),w.length?(0,f.jsxs)(u.Muted,{children:[w.length," more awaiting the head chef's sign-off, so not shown as safe."]}):null,(0,f.jsx)(n.default,{testID:"menu-allergy-details",accessibilityRole:"button",onPress:()=>y(!x),hitSlop:6,children:(0,f.jsx)(u.T,{size:14,colour:h.colours.gold,children:x?'Hide dishes':'Show dishes'})}),x?(0,f.jsxs)(l.default,{style:{gap:4},children:[(0,f.jsxs)(u.Muted,{children:["Contains: ",C(p)]}),(0,f.jsxs)(u.Muted,{children:["May contain: ",C(M)]}),(0,f.jsxs)(u.Muted,{children:["Free from: ",C(S)]})]}):null,(0,f.jsx)(u.Muted,{children:'guest'===m?'From the kitchen\u2019s signed-off recipe cards. Specials on the board are checked by staff on the day.':'From the signed-off recipe cards. Specials on the board have their own allergens. Still check with the guest and the kitchen.'})]})};var s=r(d[0]),n=e(r(d[1])),l=e(r(d[2])),t=r(d[3]),o=r(d[4]),c=r(d[5]),h=r(d[6]),u=r(d[7]),f=r(d[8])},1110,[34,402,102,848,830,832,840,794,25]); -__d(function(g,r,i,a,m,e,_d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"NOTES_PLACEHOLDER",{enumerable:!0,get:function(){return o}}),Object.defineProperty(e,"WIX_EDIT_NOTE",{enumerable:!0,get:function(){return s}}),e.canEditBooking=function(t){return'customer'!==t.variant&&('staff'===t.variant||t.inStaffApp?!!t.shiftManager:'display'===t.variant||'chef'===t.variant||'staff'!==t.role)},Object.defineProperty(e,"isWixBooking",{enumerable:!0,get:function(){return l}}),Object.defineProperty(e,"EDIT_FIELDS",{enumerable:!0,get:function(){return d}}),Object.defineProperty(e,"FIELD_WORDS",{enumerable:!0,get:function(){return c}}),Object.defineProperty(e,"draftOf",{enumerable:!0,get:function(){return u}}),e.changedFields=p,e.editPatch=function(n,o,s,l=(new Date).toISOString()){const d=p(n,o);if(!d.length)return{};const c={};for(const n of d){const s=f(n,o[n]);c[n]='partySize'===n?(0,t.clampParty)(s):'phone'===n||'email'===n||'table'===n?s||void 0:s}d.includes('table')&&(c.tableSetHere=!0);const u=n;return c.locallyEdited=!0,c.editedFields=[...new Set([...u.editedFields??[],...d])],c.editLog=[...u.editLog??[],{at:l,by:s.by.slice(0,80),app:s.app,fields:d}].slice(-50),c},e.editWarnings=function(t,o,s,l,d=90){const c=[],u={...t,date:o.date,time:o.time,partySize:o.partySize};if(o.table){const t=(0,n.tableOverlaps)(u,o.table,s.filter(t=>t.date===o.date),d);t.length&&c.push(`The table already has a booking at about the same time: ${t.map(t=>`${t.time} ${t.walkIn?'walk-in':t.name}`).join(', ')}.`)}l&&c.push(`Bookings are paused ${l.from} to ${l.to}${l.reason?` (${l.reason})`:''}.`);return c},Object.defineProperty(e,"editedWords",{enumerable:!0,get:function(){return b}});var t=r(_d[0]),n=r(_d[1]);const o='For example: birthday, high chair, dog, window seat',s='This booking came from the website. Changes here are not sent to website bookings yet.';const l=t=>{const n=t;return'Wix'===n.importedFrom||!!n.wix||(t.tags??[]).includes('Wix')},d=['date','time','partySize','name','phone','email','notes','table'],c={date:'date',time:'time',partySize:'covers',name:'name',phone:'phone',email:'email',notes:'notes',table:'table'},u=t=>({date:t.date,time:t.time,partySize:t.partySize,name:t.name,phone:t.phone??'',email:t.email??'',notes:t.notes??'',table:t.table??''}),f=(t,n)=>'partySize'===t?Number(n):String(n??'').trim();function p(t,n){const o=u(t);return d.filter(t=>f(t,o[t])!==f(t,n[t]))}const b=t=>t.map(t=>c[t]).join(', ')},1111,[1098,1092]); +__d(function(g,r,i,_a,m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"NOTES_PLACEHOLDER",{enumerable:!0,get:function(){return a}}),Object.defineProperty(_e,"WIX_EDIT_NOTE",{enumerable:!0,get:function(){return s}}),Object.defineProperty(_e,"NOTIFY_LABEL",{enumerable:!0,get:function(){return o}}),Object.defineProperty(_e,"guestMessageFields",{enumerable:!0,get:function(){return n}}),_e.canEditBooking=function(e){return'customer'!==e.variant&&('staff'===e.variant||e.inStaffApp?!!e.shiftManager:'display'===e.variant||'chef'===e.variant||'staff'!==e.role)},Object.defineProperty(_e,"isWixBooking",{enumerable:!0,get:function(){return d}}),Object.defineProperty(_e,"EDIT_FIELDS",{enumerable:!0,get:function(){return c}}),Object.defineProperty(_e,"DEPOSIT_METHODS",{enumerable:!0,get:function(){return u}}),Object.defineProperty(_e,"EDIT_STATUSES",{enumerable:!0,get:function(){return l}}),Object.defineProperty(_e,"SOURCES",{enumerable:!0,get:function(){return h}}),Object.defineProperty(_e,"OCCASIONS",{enumerable:!0,get:function(){return p}}),Object.defineProperty(_e,"TAGS",{enumerable:!0,get:function(){return b}}),Object.defineProperty(_e,"FIELD_WORDS",{enumerable:!0,get:function(){return f}}),Object.defineProperty(_e,"draftOf",{enumerable:!0,get:function(){return y}}),_e.changedFields=N,_e.historyText=k,_e.editPatch=function(t,a,s,o=(new Date).toISOString()){const n=N(t,a);if(!n.length)return{};const d={};for(const c of n)switch(c){case'partySize':d.partySize=(0,e.clampParty)(Number(a.partySize));break;case'phone':case'email':case'table':d[c]=String(a[c]??'').trim()||void 0;break;case'date':case'time':case'name':case'notes':d[c]=String(a[c]??'').trim();break;case'area':d.area=(a.area??'').trim()||void 0;break;case'dogs':d.dogs=Math.max(0,Number(a.dogs??0)),d.dog=Number(a.dogs??0)>0;break;case'highChairs':d.highChairs=Math.max(0,Number(a.highChairs??0))||void 0;break;case'wheelchair':d.access={...t.access??{},wheelchair:Math.max(0,Number(a.wheelchair??0))||void 0};break;case'occasion':d.occasion=a.occasion||void 0;break;case'allergies':d.allergies=[...a.allergies??[]],d.allergyNone=!!a.allergyNone&&!(a.allergies??[]).length,d.allergyNote=(a.allergyNote??'').trim()||void 0,(a.allergies??[]).length||(d.allergyAck=void 0);break;case'diet':d.diet={vegan:Number(a.vegan??0)||void 0,vegetarian:Number(a.vegetarian??0)||void 0};break;case'deposit':if(!a.depositOn){Object.assign(d,{security:'none',depositDue:0,depositPaid:0,depositPaidBy:void 0,depositPaidAt:void 0,depositMethod:void 0});break}if(d.security='deposit',d.depositDue=Math.max(0,Math.round(Number(a.depositDue??0))),a.depositPaid){const e=/^\d{4}-\d{2}-\d{2}$/.test(a.depositDate??'')?a.depositDate:o.slice(0,10);Object.assign(d,{depositPaid:Math.max(0,Math.round(Number(a.depositAmount??0))),depositPaidBy:s.by.slice(0,80),depositPaidAt:e===o.slice(0,10)?o:`${e}T12:00:00.000Z`,depositMethod:a.depositMethod||void 0})}else Object.assign(d,{depositPaid:0,depositPaidBy:void 0,depositPaidAt:void 0,depositMethod:void 0});break;case'status':d.status=a.status,'seated'!==a.status||t.seatedAt||(d.seatedAt=o),'finished'!==a.status||t.finishedAt||(d.finishedAt=o),'confirmed'!==a.status&&'pending'!==a.status||(d.seatedAt=void 0,d.finishedAt=void 0);break;case'source':d.source=a.source||void 0;break;case'tags':d.tags=[...(t.tags??[]).filter(e=>!b.includes(e)),...a.tags??[]];break;case'duration':d.durationMins=Number(a.duration??0)>=15?Number(a.duration):void 0}n.includes('table')&&(d.tableSetHere=!0);const c=t;return d.locallyEdited=!0,d.editedFields=[...new Set([...c.editedFields??[],...n])],d.editLog=[...c.editLog??[],{at:o,by:s.by.slice(0,80),app:s.app,fields:n,text:k(t,a,n,s.by.slice(0,80),o),quiet:!s.notify}].slice(-50),d},_e.historyLines=function(e){return(e.editLog??[]).slice().reverse().map(e=>e.text??`${e.fields.map(e=>f[e]??e).join(', ')} changed by ${e.by} ${w(e.at)}`.replace(/^./,e=>e.toUpperCase()))},_e.editWarnings=function(e,a,s,o,n=90,d){const c=[];if(!N(e,a).some(e=>['date','time','partySize','table','duration','dogs','status'].includes(e)))return c;const u={...e,date:a.date,time:a.time,partySize:a.partySize,...Number(a.duration??0)>=15?{durationMins:Number(a.duration)}:{}};if(a.table){const e=(0,t.tableOverlaps)(u,a.table,s.filter(e=>e.date===a.date),n);if(e.length&&c.push(`The table already has a booking at about the same time: ${e.map(e=>`${e.time} ${e.walkIn?'walk-in':e.name}`).join(', ')}.`),d){const e=a.table.split('+').map(e=>e.trim()).filter(Boolean).map(e=>d.tables.find(t=>t.name===e)).filter(Boolean),t=e.reduce((e,t)=>e+t.maxSeats,0);e.length&&td.areas.find(t=>t.id===e.areaId)).filter(e=>e&&!e.dogs);Number(a.dogs??0)>0&&s.length&&c.push(`Dogs aren\u2019t allowed in ${s[0].name}. Pick a dog-friendly table.`)}}o&&c.push(`Bookings are paused ${o.from} to ${o.to}${o.reason?` (${o.reason})`:''}.`);return c},Object.defineProperty(_e,"editedWords",{enumerable:!0,get:function(){return M}}),_e.bookingExtras=function(e){const t=e,a=e.dogs??(e.dog?1:0),s=[];a&&s.push(O(a,'dog','dogs'));t.highChairs&&s.push(O(t.highChairs,'high chair','high chairs'));e.access?.wheelchair&&s.push(O(e.access.wheelchair,'wheelchair','wheelchairs'));e.diet?.vegan&&s.push(`${e.diet.vegan} vegan`);e.diet?.vegetarian&&s.push(`${e.diet.vegetarian} vegetarian`);e.occasion&&s.push(e.occasion.charAt(0).toUpperCase()+e.occasion.slice(1));t.area&&s.push(t.area);t.depositMethod&&(e.depositPaid??0)>0&&s.push(`Deposit by ${t.depositMethod}`);return s.join(' \xb7 ')};var e=r(_d[0]),t=r(_d[1]);const a='For example: birthday, high chair, dog, window seat',s='This booking came from the website. Changes here are not sent to website bookings yet.',o='Message the guest about the new date, time or status (website bookings sends it)',n=e=>e.filter(e=>'date'===e||'time'===e||'status'===e);const d=e=>{const t=e;return'Wix'===t.importedFrom||!!t.wix||(e.tags??[]).includes('Wix')},c=['date','time','partySize','name','phone','email','notes','table','area','dogs','highChairs','wheelchair','occasion','allergies','diet','deposit','status','source','tags','duration'],u=['card','cash','bank transfer','website','other'],l=[{id:'pending',label:'Needs confirming'},{id:'confirmed',label:'Confirmed'},{id:'seated',label:'Seated'},{id:'finished',label:'Finished'},{id:'noshow',label:'No-show'}],h=[{id:'phone',label:'Phone'},{id:'in-person',label:'In person'},{id:'online',label:'Online'}],p=[{id:'',label:'None'},{id:'birthday',label:'Birthday'},{id:'anniversary',label:'Anniversary'},{id:'celebration',label:'Celebration'}],b=['VIP','Regular'],f={date:'date',time:'time',partySize:'covers',name:'name',phone:'phone',email:'email',notes:'notes',table:'table',area:'area',dogs:'dogs',highChairs:'high chairs',wheelchair:'wheelchairs',occasion:'occasion',allergies:'allergies',diet:'dietary',deposit:'deposit',status:'status',source:'source',tags:'tags',duration:'table time'},y=e=>{const t=e;return{date:e.date,time:e.time,partySize:e.partySize,name:e.name,phone:e.phone??'',email:e.email??'',notes:e.notes??'',table:e.table??'',area:t.area??'',dogs:e.dogs??(e.dog?1:0),highChairs:t.highChairs??0,wheelchair:e.access?.wheelchair??0,occasion:e.occasion??'',allergies:e.allergies??[],allergyNone:!!e.allergyNone,allergyNote:e.allergyNote??'',vegan:e.diet?.vegan??0,vegetarian:e.diet?.vegetarian??0,depositOn:'deposit'===e.security||(e.depositDue??0)>0||(e.depositPaid??0)>0,depositPaid:(e.depositPaid??0)>0&&!!e.depositPaidBy,depositAmount:(e.depositPaid??0)>0?e.depositPaid:e.depositDue??0,depositMethod:t.depositMethod??'',depositDate:(a=e.depositPaidAt,a?a.slice(0,10):''),depositDue:e.depositDue??0,status:e.status,source:e.source??'',tags:[...e.tags??[]].filter(e=>b.includes(e)).sort(),duration:e.durationMins??0};var a},$=e=>JSON.stringify([[...e.allergies??[]].map(e=>`${e.allergen}:${e.severity}`).sort(),!!e.allergyNone,(e.allergyNote??'').trim()]),v=e=>JSON.stringify(e.depositOn?[!0,!!e.depositPaid,Number(e.depositAmount??0),Number(e.depositDue??0),e.depositPaid?e.depositMethod??'':'',e.depositPaid?e.depositDate??'':'']:[!1]);function P(e,t){switch(e){case'partySize':return Number(t.partySize);case'allergies':return $(t);case'diet':return`${Number(t.vegan??0)}/${Number(t.vegetarian??0)}`;case'deposit':return v(t);case'tags':return[...t.tags??[]].sort().join(',');case'dogs':case'highChairs':case'wheelchair':case'duration':return Number(t[e]??0);default:return String(t[e]??'').trim()}}function N(e,t){const a=y(e);return c.filter(e=>P(e,a)!==P(e,t))}const S=e=>`\xa3${(e/100).toFixed(e%100?2:0)}`,w=e=>{const t=new Date(e);return`${String(t.getHours()).padStart(2,'0')}:${String(t.getMinutes()).padStart(2,'0')}`},O=(e,t,a)=>`${e} ${1===e?t:a}`;function k(e,t,a,s,o){const n=y(e),d=[];for(const e of[...a].sort((e,t)=>Number('deposit'===t)-Number('deposit'===e)))'deposit'===e?t.depositOn?t.depositPaid&&!n.depositPaid?d.push(`deposit marked paid (${S(Number(t.depositAmount??0))}${t.depositMethod?`, ${t.depositMethod}`:''})`):!t.depositPaid&&n.depositPaid?d.push('deposit marked not paid'):d.push(t.depositPaid?`deposit changed (${S(Number(t.depositAmount??0))}${t.depositMethod?`, ${t.depositMethod}`:''})`:`deposit due ${S(Number(t.depositDue??0))}`):d.push('deposit taken off'):'dogs'===e?d.push(!n.dogs&&t.dogs?1===t.dogs?'dog added':`${t.dogs} dogs added`:t.dogs?O(Number(t.dogs),'dog','dogs'):'no dog now'):'highChairs'===e?d.push(t.highChairs?O(Number(t.highChairs),'high chair','high chairs'):'no high chair now'):'wheelchair'===e?d.push(t.wheelchair?O(Number(t.wheelchair),'wheelchair user','wheelchair users'):'no wheelchair now'):'partySize'===e?d.push(`covers ${n.partySize} to ${t.partySize}`):'time'===e?d.push(`time ${n.time} to ${t.time}`):'date'===e?d.push(`date ${n.date} to ${t.date}`):'table'===e?d.push(t.table?`table ${t.table}`:'table taken off'):'status'===e?d.push(`status ${l.find(e=>e.id===t.status)?.label.toLowerCase()??t.status}`):'occasion'===e?d.push(t.occasion?`occasion ${t.occasion}`:'occasion taken off'):'area'===e?d.push(t.area?`area ${t.area}`:'any area'):'duration'===e?d.push(t.duration?`table time ${t.duration} min`:'table time as usual'):d.push(`${f[e]} changed`);const c=d.join(', ');return`${c.charAt(0).toUpperCase()}${c.slice(1)} by ${s} ${w(o)}`}const M=e=>e.map(e=>f[e]).join(', ')},1111,[1098,1092]); __d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"canCancelWalkIn",{enumerable:!0,get:function(){return y}}),Object.defineProperty(_e,"canReinstateWalkIn",{enumerable:!0,get:function(){return h}}),_e.cancelWalkInWords=x,_e.reinstateWalkInWords=p,_e.cancelWalkInNow=$,_e.reinstateWalkInNow=I,_e.CancelWalkInButton=function({rid:e,b:t,onDone:l,small:s,big:o}){const[c,u]=(0,n.useState)(!1);return y(t)?(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(f.Button,{kind:"secondary",small:s,label:"Cancel walk-in",testID:`cancel-walkin-${t.id}`,accessibilityLabel:`Cancel walk-in ${t.ref}, ${t.partySize} Covers`,onPress:()=>u(!0),style:o?{minHeight:64}:s?{minHeight:44}:w}),c?(0,k.jsx)(j,{rid:e,b:t,onClose:()=>u(!1),onDone:l}):null]}):null},_e.CancelWalkInConfirm=j,_e.ReinstateWalkInButton=function({rid:e,b:t,today:l,onDone:o,small:c}){const[u,y]=(0,n.useState)(!1);if(!h(t,l))return null;const x=p(t);if(!u)return(0,k.jsx)(f.Button,{kind:"ghost",small:c,label:"Undo cancel",testID:`reinstate-walkin-${t.id}`,accessibilityLabel:`Undo cancel for walk-in ${t.ref}`,onPress:()=>y(!0),style:c?{minHeight:44}:w});return(0,k.jsxs)(f.Sheet,{visible:!0,onClose:()=>y(!1),title:"Undo cancel?",maxWidth:560,testID:"reinstate-walkin-confirm",children:[(0,k.jsx)(s.default,{accessible:!0,accessibilityLabel:x,children:(0,k.jsx)(f.T,{size:18,colour:b.colours.text,children:x})}),(0,k.jsxs)(f.Row,{gap:8,wrap:!0,children:[(0,k.jsx)(f.Button,{label:"Yes, put back to seated",testID:"reinstate-walkin-yes",accessibilityLabel:`Yes, put walk-in ${t.ref} back to seated`,style:[w,{flexGrow:1}],onPress:async()=>{await I(e,t),y(!1),o?.(`Walk-in ${t.ref} put back to seated.`)}}),(0,k.jsx)(f.Button,{kind:"secondary",label:"Keep cancelled",testID:"reinstate-walkin-no",onPress:()=>y(!1),style:w})]})]})};var e,t=r(d[0]),n=r(d[1]),l=r(d[2]),s=(e=l)&&e.__esModule?e:{default:e},o=r(d[3]),c=r(d[4]),u=r(d[5]),b=r(d[6]),f=r(d[7]),k=r(d[8]);const w={minHeight:56},y=e=>!!e.walkIn&&('seated'===e.status||'confirmed'===e.status),h=(e,t)=>!!e.walkIn&&'cancelled'===e.status&&e.date>=t;function x(e){const t=(0,c.tablesOf)(e.table),n=(0,u.tablesWords)(t);return`Cancel walk-in ${e.ref}, ${e.partySize} Covers${t.length?` at ${n}`:''}, arrived ${e.time}? It comes off the Covers${t.length?` and ${n} ${t.length>1?'go':'goes'} back to Free`:''}.`}function p(e){return`Put walk-in ${e.ref} back to seated? CoverCharge only \u2014 if it was cancelled on the website, put it back there too if needed.`}async function $(e,n){await o.repo.bookings.setStatus(n.id,'cancelled'),await o.repo.bookings.update(n.id,{cancelled:(0,t.cancelStamp)(n)}),(0,c.tablesOf)(n.table).forEach(t=>c.useFloor.getState().setLive(e,t,{stage:void 0,dirty:!1}))}async function I(e,t){await o.repo.bookings.setStatus(t.id,'seated'),(0,c.tablesOf)(t.table).forEach(t=>c.useFloor.getState().setLive(e,t,{stage:'seated',dirty:!1}))}function j({rid:e,b:t,onClose:n,onDone:l}){const o=x(t);return(0,k.jsxs)(f.Sheet,{visible:!0,onClose:n,title:"Cancel walk-in?",maxWidth:560,testID:"cancel-walkin-confirm",children:[(0,k.jsx)(s.default,{accessible:!0,accessibilityLabel:o,children:(0,k.jsx)(f.T,{size:18,colour:b.colours.text,children:o})}),(0,k.jsxs)(f.Row,{gap:8,wrap:!0,children:[(0,k.jsx)(f.Button,{label:"Yes, cancel walk-in",testID:"cancel-walkin-yes",accessibilityLabel:`Yes, cancel walk-in ${t.ref}`,style:[w,{flexGrow:1}],onPress:async()=>{await $(e,t),n(),l?.(`Walk-in ${t.ref} cancelled.${(0,c.tablesOf)(t.table).length?` ${(0,u.tablesWords)((0,c.tablesOf)(t.table))} free.`:''}`)}}),(0,k.jsx)(f.Button,{kind:"secondary",label:"Keep walk-in",testID:"cancel-walkin-no",accessibilityLabel:`Keep walk-in ${t.ref}`,onPress:n,style:w})]})]})}},1112,[1113,34,102,848,1014,1095,840,794,25]); __d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.cancelStamp=C,_e.cancelBookingNow=w,_e.reinstateBookingNow=$,_e.CancelBookingButton=function({rid:e,b:n,name:o,onDone:s,big:l,small:c}){const[u,f]=(0,t.useState)(!1);return(0,b.canCancelBooking)(n)?(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(x.Button,{kind:"secondary",small:c,label:"Cancel booking",testID:`cancel-booking-${n.id}`,accessibilityLabel:`Cancel booking for ${o}, ${n.time}, ${n.partySize} Covers`,onPress:()=>f(!0),style:l?{minHeight:64}:c?{minHeight:44}:j}),u?(0,h.jsx)(D,{rid:e,b:n,name:o,onClose:()=>f(!1),onDone:s}):null]}):null},_e.CancelBookingConfirm=D,_e.ReinstateBookingButton=function({b:e,name:n,today:s,onDone:l}){const[c,u]=(0,t.useState)(!1);if(!(0,b.canReinstateBooking)(e,s))return null;const y=(0,b.reinstateBookingWords)(e,n);if(!c)return(0,h.jsx)(x.Button,{kind:"ghost",label:"Undo cancel",testID:`reinstate-booking-${e.id}`,accessibilityLabel:`Undo cancel for ${n}`,onPress:()=>u(!0),style:j});return(0,h.jsxs)(x.Sheet,{visible:!0,onClose:()=>u(!1),title:"Undo cancel?",maxWidth:560,testID:"reinstate-booking-confirm",children:[(0,h.jsx)(o.default,{accessible:!0,accessibilityLabel:y,style:{alignItems:'center'},children:(0,h.jsx)(x.T,{size:18,colour:f.colours.text,style:{textAlign:'center'},children:y})}),(0,h.jsxs)(x.Row,{gap:8,wrap:!0,style:{justifyContent:'center'},children:[(0,h.jsx)(x.Button,{label:"Yes, put back to booked",testID:"reinstate-booking-yes",accessibilityLabel:`Yes, put ${n} back to booked`,style:[j,{flexGrow:1}],onPress:async()=>{await $(e),u(!1),l?.(`${n} put back to booked.`)}}),(0,h.jsx)(x.Button,{kind:"secondary",label:"Keep cancelled",testID:"reinstate-booking-no",onPress:()=>u(!1),style:j})]})]})};var e,t=r(d[0]),n=r(d[1]),o=(e=n)&&e.__esModule?e:{default:e},s=r(d[2]),l=r(d[3]),c=r(d[4]),b=r(d[5]),u=r(d[6]),f=r(d[7]),y=r(d[8]),k=r(d[9]),p=r(d[10]),x=r(d[11]),h=r(d[12]);const j={minHeight:56},B={display:'Display',owner:'Managers app',staff:'Staff app',chef:'Kitchen app',customer:'Customer page'};function C(e){const t=y.useSession.getState().meId,n=t?k.useOwner.getState().staff.find(e=>e.id===t):void 0,o=B[p.APP_VARIANT]??'CoverCharge';return{by:n?`${n.name.replace(' (example)','')} (${o})`:o,at:(new Date).toISOString(),app:o,...e.table?{table:e.table}:{}}}async function w(e,t){const n=(0,l.tablesOf)(t.table);await s.repo.bookings.update(t.id,{status:'cancelled',cancelled:C(t),...(0,c.tablePatch)(null)}),n.forEach(t=>l.useFloor.getState().setLive(e,t,{stage:void 0,dirty:!1}))}async function $(e){await s.repo.bookings.setStatus(e.id,'confirmed')}function D({rid:e,b:t,name:n,onClose:s,onDone:c}){const y=(0,b.cancelBookingWords)(t,n),k=(0,l.tablesOf)(t.table);return(0,h.jsxs)(x.Sheet,{visible:!0,onClose:s,title:"Cancel booking?",maxWidth:560,testID:"cancel-booking-confirm",children:[(0,h.jsx)(o.default,{accessible:!0,accessibilityLabel:y,style:{alignItems:'center',gap:8},children:(0,h.jsx)(x.T,{size:18,colour:f.colours.text,style:{textAlign:'center'},children:y})}),(0,h.jsxs)(x.Row,{gap:8,wrap:!0,style:{justifyContent:'center'},children:[(0,h.jsx)(x.Button,{label:"Yes, cancel booking",testID:"cancel-booking-yes",accessibilityLabel:`Yes, cancel booking for ${n}`,style:[j,{flexGrow:1}],onPress:async()=>{await w(e,t),s(),c?.(`${n} cancelled.${k.length?` ${(0,u.tablesWords)(k)} free.`:''}`)}}),(0,h.jsx)(x.Button,{kind:"secondary",label:"Keep booking",testID:"cancel-booking-no",accessibilityLabel:`Keep booking for ${n}`,onPress:s,style:j})]})]})}},1113,[34,102,848,1014,1092,1114,1095,840,997,865,846,794,25]); __d(function(g,r,i,_a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"canCancelBooking",{enumerable:!0,get:function(){return n}}),Object.defineProperty(e,"canReinstateBooking",{enumerable:!0,get:function(){return t}}),e.cancelBookingWords=function(n,t){const o=`${n.partySize} Cover${1===n.partySize?'':'s'}`;return`Cancel booking for ${t}, ${n.time}, ${o}? The table is freed. Website bookings will cancel it on the website and may email the guest.`},e.reinstateBookingWords=function(n,t){return`Put ${t} back to booked for ${n.time}? CoverCharge only \u2014 if it was cancelled on the website, put it back there too if needed.`},e.cancelledOnDay=o,e.cancelledDayTally=function(n,t){const a=o(n,t),l=a.filter(n=>!!n.walkIn),c=a.filter(n=>!n.walkIn);return{count:a.length,covers:a.reduce((n,t)=>n+t.partySize,0),bookings:c.length,bookingCovers:c.reduce((n,t)=>n+t.partySize,0),walkIns:l.length,walkInCovers:l.reduce((n,t)=>n+t.partySize,0),list:a}},e.cancelledTallyWords=function(n,t="today"){if(!n.count)return`No cancellations ${t}`;const o=[],a=n.bookings??0,l=n.walkIns??0;a&&o.push(`${a} booking${1===a?'':'s'} (${n.bookingCovers??0} Cover${1===(n.bookingCovers??0)?'':'s'})`);l&&o.push(`${l} walk-in${1===l?'':'s'} (${n.walkInCovers??0} Cover${1===(n.walkInCovers??0)?'':'s'})`);if(!o.length)return`Cancelled ${t}: ${n.count} \xb7 ${n.covers} Cover${1===n.covers?'':'s'}`;return`Cancelled ${t}: ${o.join(' \xb7 ')}`};const n=n=>!n.walkIn&&('confirmed'===n.status||'pending'===n.status||'seated'===n.status),t=(n,t)=>!n.walkIn&&'cancelled'===n.status&&n.date>=t;function o(n,t){return n.filter(n=>n.date===t&&'cancelled'===n.status).sort((n,t)=>n.time.localeCompare(t.time)||n.name.localeCompare(t.name))}},1114,[]); -__d(function(g,_r,i,_a,_m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.BookingEditButton=function({rid:e,booking:a,who:n,role:o,inStaffApp:l,shiftManager:s,big:d,testID:r}){const[u,b]=(0,t.useState)(!1);return a.walkIn||!(0,h.canEditBooking)({variant:c.APP_VARIANT,inStaffApp:l,role:o,shiftManager:s})?null:(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(k.Button,{kind:"secondary",small:!d,label:"Edit booking",testID:r??`edit-booking-${a.id}`,accessibilityLabel:`Edit booking, ${a.name}, ${a.time}`,onPress:()=>b(!0),style:{minHeight:d?64:44}}),u?(0,j.jsx)(C,{rid:e,id:a.id,who:n,onClose:()=>b(!1)}):null]})},_e.EditBookingPicker=function({rid:e,today:a,who:n,onClose:o,hidePrivate:s}){const[d,r]=(0,t.useState)(null),c=(0,l.useBookings)(e).filter(e=>!e.walkIn&&e.date>=a&&!['cancelled','noshow','finished'].includes(e.status)).sort((e,t)=>e.date.localeCompare(t.date)||e.time.localeCompare(t.time)).slice(0,60);return d?(0,j.jsx)(C,{rid:e,id:d,who:n,hidePrivate:s,onClose:o}):(0,j.jsxs)(k.Sheet,{visible:!0,onClose:o,title:"Edit booking \xb7 pick a booking",maxWidth:640,testID:"edit-booking-picker",children:[(0,j.jsx)(k.T,{size:16,colour:b.colours.text,children:"Tip: tap the booking you want to change."}),c.length?c.map(e=>(0,j.jsx)(k.Button,{kind:"secondary",testID:`edit-pick-${e.id}`,label:`${e.date===a?'Today':e.date} ${e.time} \xb7 ${e.name} \xb7 ${e.partySize} ${1===e.partySize?'Cover':'Covers'}`,sub:e.notes?`Notes: ${e.notes}`:void 0,accessibilityLabel:`Edit booking, ${e.name}, ${e.date===a?'today':e.date}, ${e.time}, ${e.partySize} Covers`,onPress:()=>r(e.id),style:{minHeight:56,alignItems:'flex-start'}},e.id)):(0,j.jsx)(k.Muted,{children:"No bookings to edit from today on."}),(0,j.jsx)(k.Button,{kind:"ghost",label:"Close",onPress:o,style:{minHeight:44}})]})},_e.EditBookingSheet=C;var e,t=_r(_d[0]),a=_r(_d[1]),n=_r(_d[2]),o=(e=n)&&e.__esModule?e:{default:e},l=_r(_d[3]),s=_r(_d[4]),d=_r(_d[5]),r=_r(_d[6]),c=_r(_d[7]),h=_r(_d[8]),u=_r(_d[9]),b=_r(_d[10]),m=_r(_d[11]),p=_r(_d[12]),x=_r(_d[13]),y=_r(_d[14]),k=_r(_d[15]),j=_r(_d[16]);const f=/^([01]\d|2[0-3]):[0-5]\d$/,v=e=>{const t=e.trim().replace('.',':').match(/^(\d{1,2}):?(\d{2})$/);return t?`${t[1].padStart(2,'0')}:${t[2]}`:e.trim()};function C({rid:e,id:n,who:C,onClose:T,hidePrivate:I='display'===c.APP_VARIANT}){const B=(0,l.useBookings)(e),D=B.find(e=>e.id===n),P=(0,r.useRestaurant)(e),$=(0,s.usePlan)(e),S=(0,d.useBlocks)(e=>e.blocks),[w,E]=(0,t.useState)(D?(0,h.draftOf)(D):null),[z,A]=(0,t.useState)(null),[L,_]=(0,t.useState)(null);if(!D||!w||!P)return null;const F=e=>{A(null),_(null),E({...w,...e})},N=v(w.time),W=f.test(N),R=(0,u.tableOptions)($,B.filter(e=>e.date===w.date),w.table),M=(0,h.changedFields)(D,{...w,time:N}),O=P.settings.turnMins??90,H=async()=>{const t=(0,h.editPatch)(D,{...w,time:N},{by:C||'Team member',app:c.APP_VARIANT});if(Object.keys(t).length&&await l.repo.bookings.update(D.id,t),'seated'===D.status&&'table'in t&&t.table!==D.table){const a=e=>e?e.split('+').map(e=>e.trim()).filter(Boolean):[],n=a(D.table),o=a(t.table),l=s.useFloor.getState(),d=n.map(t=>l.live[e]?.[t]?.stage).find(Boolean)??'seated';n.filter(e=>!o.includes(e)).forEach(t=>l.setLive(e,t,{stage:void 0,dirty:!0})),o.forEach(t=>l.setLive(e,t,{stage:d,dirty:!1}))}_(`Saved. Changed: ${(0,h.editedWords)(M)}.`),A(null),T()};return(0,j.jsxs)(k.Sheet,{visible:!0,onClose:T,title:`Edit booking \xb7 ${D.name} \xb7 ${D.ref}`,maxWidth:760,testID:"edit-booking-sheet",children:[(0,j.jsx)(x.DepositChip,{b:D,money:!0,big:!0,testID:"edit-deposit"}),(0,h.isWixBooking)(D)?(0,j.jsx)(o.default,{testID:"edit-wix-note",accessible:!0,accessibilityLabel:h.WIX_EDIT_NOTE,style:{padding:12,borderRadius:12,borderWidth:1,borderColor:b.colours.gold},children:(0,j.jsx)(k.T,{size:16,colour:b.colours.goldLight,children:h.WIX_EDIT_NOTE})}):null,(0,j.jsx)(k.T,{size:16,colour:b.colours.text,children:"Tip: change what you need, then press Save changes."}),(0,j.jsx)(p.BookingDatePicker,{r:P,today:new Date,value:w.date,onChange:e=>F({date:e})}),(0,j.jsx)(k.Field,{label:"Time (24-hour, for example 19:30)",value:w.time,onChangeText:e=>F({time:e}),testID:"edit-time"}),W?null:(0,j.jsx)(k.T,{size:15,colour:b.colours.amber,children:"Write the time like 19:30."}),(0,j.jsxs)(o.default,{style:{gap:6,alignItems:'center'},children:[(0,j.jsx)(k.T,{size:18,center:!0,children:"Covers"}),(0,j.jsx)(a.PartySizeInput,{value:w.partySize,onChange:e=>F({partySize:e}),label:"Covers",testID:"edit-covers"})]}),(0,j.jsx)(k.Field,{label:"Name",value:w.name,onChangeText:e=>F({name:e}),testID:"edit-name"}),I?(0,j.jsx)(k.Muted,{children:"Phone and email can be changed in the Managers app; the Display never shows them."}):(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(k.Field,{label:"Phone",value:w.phone,onChangeText:e=>F({phone:e}),keyboardType:"phone-pad",testID:"edit-phone"}),(0,j.jsx)(k.Field,{label:"Email",value:w.email,onChangeText:e=>F({email:e}),keyboardType:"email-address",autoCapitalize:"none",testID:"edit-email"})]}),(0,j.jsx)(k.Field,{label:"Notes",value:w.notes,onChangeText:e=>F({notes:e}),placeholder:h.NOTES_PLACEHOLDER,multiline:!0,numberOfLines:3,testID:"edit-notes"}),D.allergies.length||D.allergyNote?(0,j.jsx)(k.Muted,{children:"Allergies are kept separately and are not changed here."}):null,(0,j.jsx)(k.T,{size:18,weight:"semibold",children:(0,u.tableButtonLabel)(w.table)}),(0,j.jsxs)(k.Row,{gap:8,wrap:!0,children:[(0,j.jsx)(k.Button,{kind:w.table?'secondary':'primary',label:"No table",accessibilityLabel:"No table"+(w.table?'':', chosen'),onPress:()=>F({table:''}),style:{minHeight:44,minWidth:96},testID:"edit-table-none"}),R.map(e=>(0,j.jsx)(k.Button,{kind:e===w.table?'primary':'secondary',label:(0,u.tableButtonLabel)(e),accessibilityLabel:`Table ${(0,u.tableButtonLabel)(e)}${e===w.table?', chosen':''}`,onPress:()=>F({table:e}),style:{minHeight:44,minWidth:64},testID:`edit-table-${e}`},e))]}),z?(0,j.jsxs)(o.default,{testID:"edit-warn",style:{gap:8,padding:12,borderRadius:12,borderWidth:1.5,borderColor:b.colours.amber,backgroundColor:b.colours.amberBg},children:[z.map(e=>(0,j.jsx)(k.T,{size:16,colour:"#FFE2A8",children:e},e)),(0,j.jsx)(k.T,{size:16,colour:"#FFE2A8",children:"You can still save."})]}):null,L?(0,j.jsx)(k.T,{size:16,colour:b.colours.goldLight,children:L}):null,(0,j.jsxs)(k.Row,{gap:8,wrap:!0,children:[(0,j.jsx)(k.Button,{label:z?'Save anyway':'Save changes',testID:"edit-save",disabled:!W||w.name.trim().length<1||!M.length,onPress:()=>{const t=W?(0,d.blockAt)(S,e,w.date,N):void 0,a=(0,h.editWarnings)(D,{...w,time:N},B,t,O);!a.length||z?H():A(a)},style:{minHeight:56,flex:1}}),(0,j.jsx)(k.Button,{kind:"ghost",label:"Close",onPress:T,style:{minHeight:56}})]}),(0,j.jsx)(y.CancelBookingButton,{rid:e,b:D,name:D.name,big:!0,onDone:()=>T()}),(0,j.jsx)(y.ReinstateBookingButton,{b:D,name:D.name,today:(0,m.ymd)(new Date),onDone:()=>T()})]})}},1115,[34,1097,102,848,1014,1011,850,846,1111,1092,840,827,1105,1089,1113,794,25]); +__d(function(g,_r,_i,_a,_m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.BookingEditButton=function({rid:e,booking:s,who:i,role:a,inStaffApp:n,shiftManager:l,big:o,testID:d}){const[h,m]=(0,t.useState)(!1),x=(0,u.useSession)(e=>e.meId),j=(0,p.useOwner)(e=>e.staff.find(e=>e.id===x&&e.active));return s.walkIn||!(0,c.canEditBooking)({variant:r.APP_VARIANT,inStaffApp:n,role:a,shiftManager:l})||x&&!(0,b.canChangeBookings)(j)?null:(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(C.Button,{kind:"secondary",small:!o,label:"Edit booking",sub:o?void 0:"Deposit, dog, table, anything",testID:d??`edit-booking-${s.id}`,accessibilityLabel:`Edit booking, ${s.name}, ${s.time}`,onPress:()=>m(!0),style:{minHeight:o?64:44}}),h?(0,f.jsx)(B,{rid:e,id:s.id,who:i,onClose:()=>m(!1)}):null]})},_e.EditBookingPicker=function({rid:e,today:s,who:i,onClose:a,hidePrivate:l}){const[o,d]=(0,t.useState)(null),r=(0,n.useBookings)(e).filter(e=>!e.walkIn&&e.date>=s&&!['cancelled','noshow','finished'].includes(e.status)).sort((e,t)=>e.date.localeCompare(t.date)||e.time.localeCompare(t.time)).slice(0,60);return o?(0,f.jsx)(B,{rid:e,id:o,who:i,hidePrivate:l,onClose:a}):(0,f.jsxs)(C.Sheet,{visible:!0,onClose:a,title:"Edit booking \xb7 pick a booking",maxWidth:640,testID:"edit-booking-picker",children:[(0,f.jsx)(C.T,{size:16,colour:x.colours.text,children:"Tip: tap the booking you want to change."}),r.length?r.map(e=>(0,f.jsx)(C.Button,{kind:"secondary",testID:`edit-pick-${e.id}`,label:`${e.date===s?'Today':e.date} ${e.time} \xb7 ${e.name} \xb7 ${e.partySize} ${1===e.partySize?'Cover':'Covers'}`,sub:e.notes?`Notes: ${e.notes}`:void 0,accessibilityLabel:`Edit booking, ${e.name}, ${e.date===s?'today':e.date}, ${e.time}, ${e.partySize} Covers`,onPress:()=>d(e.id),style:{minHeight:56,alignItems:'flex-start'}},e.id)):(0,f.jsx)(C.Muted,{children:"No bookings to edit from today on."}),(0,f.jsx)(C.Button,{kind:"ghost",label:"Close",onPress:a,style:{minHeight:44}})]})},_e.EditBookingSheet=B;var e,t=_r(_d[0]),s=_r(_d[1]),i=_r(_d[2]),a=(e=i)&&e.__esModule?e:{default:e},n=_r(_d[3]),l=_r(_d[4]),o=_r(_d[5]),d=_r(_d[6]),r=_r(_d[7]),c=_r(_d[8]),h=_r(_d[9]),u=_r(_d[10]),p=_r(_d[11]),b=_r(_d[12]),m=_r(_d[13]),x=_r(_d[14]),j=_r(_d[15]),y=_r(_d[16]),D=_r(_d[17]),I=_r(_d[18]),C=_r(_d[19]),f=_r(_d[20]);const T=/^([01]\d|2[0-3]):[0-5]\d$/,v=e=>{const t=e.trim().replace('.',':').match(/^(\d{1,2}):?(\d{2})$/);return t?`${t[1].padStart(2,'0')}:${t[2]}`:e.trim()};const w=e=>e?(e/100).toFixed(e%100?2:0):'',k=e=>{const t=Number(e.replace(/[\xa3,\s]/g,''));return Number.isFinite(t)&&t>=0?Math.round(100*t):NaN},S=e=>e&&/^\d{4}-\d{2}-\d{2}$/.test(e)?`${e.slice(8,10)}/${e.slice(5,7)}/${e.slice(0,4)}`:'',P=e=>{const t=e.trim().match(/^(\d{1,2})\/(\d{1,2})\/(\d{4})$/);return t?`${t[3]}-${t[2].padStart(2,'0')}-${t[1].padStart(2,'0')}`:''},$=e=>e.charAt(0).toUpperCase()+e.slice(1);function N({title:e,children:t,testID:s}){return(0,f.jsxs)(a.default,{testID:s,style:{gap:8,paddingTop:10,borderTopWidth:1,borderTopColor:x.colours.hairline,alignItems:'stretch'},children:[(0,f.jsx)(C.T,{size:17,weight:"semibold",center:!0,colour:x.colours.goldLight,children:e}),t]})}const E=({label:e,value:t,onChange:s,max:i=20,testID:a})=>(0,f.jsxs)(C.Row,{style:{justifyContent:'space-between',alignItems:'center'},children:[(0,f.jsx)(C.T,{size:16,children:e}),(0,f.jsx)(C.Stepper,{testID:a,value:t,min:0,max:i,onChange:s,label:e})]});function B({rid:e,id:i,who:u,onClose:p,hidePrivate:b='display'===r.APP_VARIANT}){const B=(0,n.useBookings)(e),O=B.find(e=>e.id===i),z=(0,d.useRestaurant)(e),A=(0,l.usePlan)(e),R=(0,o.useBlocks)(e=>e.blocks),[L,F]=(0,t.useState)(O?(0,c.draftOf)(O):null),[W,M]=(0,t.useState)(null),[_,H]=(0,t.useState)(null),[V,G]=(0,t.useState)(w(O?(0,c.draftOf)(O).depositDue:0)),[U,X]=(0,t.useState)(w(O?(0,c.draftOf)(O).depositAmount:0)),[Y,q]=(0,t.useState)(S(O?(0,c.draftOf)(O).depositDate:'')),[J,K]=(0,t.useState)(!1);if(!O||!L||!z)return null;const Q=e=>{M(null),H(null),F({...L,...e})},Z=v(L.time),ee=T.test(Z),te=L.area?A.areas.filter(e=>e.name===L.area).map(e=>e.id):null,se=e=>!te||e.split('+').every(e=>te.includes(A.tables.find(t=>t.name===e)?.areaId??'')),ie=(0,m.tableOptions)(A,B.filter(e=>e.date===L.date),L.table).filter(e=>se(e)||e===L.table),ae=!(L.depositOn&&(Number.isNaN(k(V||'0'))||L.depositPaid&&(Number.isNaN(k(U||'0'))||Y.trim()&&!P(Y)))),ne={...L,time:Z,depositDue:k(V||'0')||0,depositAmount:k(U||'0')||0,depositDate:P(Y)},le=(0,c.changedFields)(O,ne),oe=z.settings.turnMins??90,de=async()=>{const t=(0,c.editPatch)(O,ne,{by:u||'Team member',app:r.APP_VARIANT,notify:J&&(0,c.isWixBooking)(O)});if(Object.keys(t).length&&await n.repo.bookings.update(O.id,t),'seated'===O.status&&'table'in t&&t.table!==O.table){const s=e=>e?e.split('+').map(e=>e.trim()).filter(Boolean):[],i=s(O.table),a=s(t.table),n=l.useFloor.getState(),o=i.map(t=>n.live[e]?.[t]?.stage).find(Boolean)??'seated';i.filter(e=>!a.includes(e)).forEach(t=>n.setLive(e,t,{stage:void 0,dirty:!0})),a.forEach(t=>n.setLive(e,t,{stage:o,dirty:!1}))}H(`Saved. Changed: ${(0,c.editedWords)(le)}.`),M(null),p()},re=L.allergies??[],ce=e=>Q({allergyNone:!1,allergies:re.some(t=>t.allergen===e)?re.filter(t=>t.allergen!==e):[...re,{allergen:e,severity:'allergy'}]}),he=(0,c.historyLines)(O);return(0,f.jsxs)(C.Sheet,{visible:!0,onClose:p,title:`Edit booking \xb7 ${O.name} \xb7 ${O.ref}`,maxWidth:760,testID:"edit-booking-sheet",children:[(0,f.jsx)(a.default,{style:{alignItems:'center'},children:(0,f.jsx)(D.DepositChip,{b:O,money:!0,big:!0,testID:"edit-deposit"})}),(0,c.isWixBooking)(O)?(0,f.jsx)(a.default,{testID:"edit-wix-note",accessible:!0,accessibilityLabel:c.WIX_EDIT_NOTE,style:{padding:12,borderRadius:12,borderWidth:1,borderColor:x.colours.gold},children:(0,f.jsx)(C.T,{size:16,center:!0,colour:x.colours.goldLight,children:c.WIX_EDIT_NOTE})}):null,(0,f.jsx)(C.T,{size:16,center:!0,colour:x.colours.text,children:"Tip: change what you need, then press Save changes. Saving doesn\u2019t message the guest."}),(0,f.jsxs)(N,{title:"Deposit",testID:"edit-section-deposit",children:[(0,f.jsxs)(C.Row,{wrap:!0,gap:6,style:{justifyContent:'center'},children:[(0,f.jsx)(C.Chip,{label:"No deposit",selected:!L.depositOn,testID:"edit-deposit-none",onPress:()=>Q({depositOn:!1,depositPaid:!1})}),(0,f.jsx)(C.Chip,{label:"Deposit due",selected:!!L.depositOn&&!L.depositPaid,testID:"edit-deposit-due",onPress:()=>Q({depositOn:!0,depositPaid:!1})}),(0,f.jsx)(C.Chip,{label:"Deposit paid",selected:!!L.depositOn&&!!L.depositPaid,testID:"edit-deposit-paid",onPress:()=>{U||X(V),Y||q(S((0,j.ymd)(new Date))),Q({depositOn:!0,depositPaid:!0})}})]}),L.depositOn?(0,f.jsx)(C.Field,{label:"Deposit due (\xa3)",value:V,onChangeText:e=>{G(e),Q({})},keyboardType:"decimal-pad",testID:"edit-deposit-due-amount"}):null,L.depositOn&&L.depositPaid?(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(C.Field,{label:"Amount paid (\xa3)",value:U,onChangeText:e=>{X(e),Q({})},keyboardType:"decimal-pad",testID:"edit-deposit-amount"}),(0,f.jsx)(C.T,{size:16,center:!0,children:"How was it paid?"}),(0,f.jsx)(C.Row,{wrap:!0,gap:6,style:{justifyContent:'center'},children:c.DEPOSIT_METHODS.map(e=>(0,f.jsx)(C.Chip,{label:$(e),selected:L.depositMethod===e,testID:`edit-deposit-method-${e.replace(' ','-')}`,onPress:()=>Q({depositMethod:e})},e))}),(0,f.jsx)(C.Field,{label:"Date paid (for example 11/11/2026)",value:Y,onChangeText:e=>{q(e),Q({})},testID:"edit-deposit-date"}),Y.trim()&&!P(Y)?(0,f.jsx)(C.T,{size:15,center:!0,colour:x.colours.amber,children:"Write the date like 11/11/2026."}):null]}):null,ae?null:(0,f.jsx)(C.T,{size:15,center:!0,colour:x.colours.amber,children:"Write amounts in pounds, for example 60 or 12.50."}),(0,f.jsx)(C.Muted,{center:!0,children:"No payment is taken in CoverCharge: this records what the guest paid."})]}),(0,f.jsxs)(N,{title:"When",testID:"edit-section-when",children:[(0,f.jsx)(y.BookingDatePicker,{r:z,today:new Date,value:L.date,onChange:e=>Q({date:e})}),(0,f.jsx)(C.Field,{label:"Time (24-hour, for example 19:30)",value:L.time,onChangeText:e=>Q({time:e}),testID:"edit-time"}),ee?null:(0,f.jsx)(C.T,{size:15,colour:x.colours.amber,children:"Write the time like 19:30."}),(0,f.jsxs)(a.default,{style:{gap:6,alignItems:'center'},children:[(0,f.jsx)(C.T,{size:18,center:!0,children:"Covers"}),(0,f.jsx)(s.PartySizeInput,{value:L.partySize,onChange:e=>Q({partySize:e}),label:"Covers",testID:"edit-covers"})]}),(0,f.jsxs)(C.Row,{style:{justifyContent:'space-between',alignItems:'center'},children:[(0,f.jsx)(C.T,{size:16,children:"Table time"}),(0,f.jsx)(C.Stepper,{testID:"edit-duration",value:L.duration||0,min:0,max:360,step:15,onChange:e=>Q({duration:e}),format:e=>e?`${Math.floor(e/60)}h ${String(e%60).padStart(2,'0')}m`:'As usual',label:"Table time"})]})]}),(0,f.jsxs)(N,{title:"Where",testID:"edit-section-where",children:[(0,f.jsxs)(C.Row,{wrap:!0,gap:6,style:{justifyContent:'center'},children:[(0,f.jsx)(C.Chip,{label:"Any area",selected:!L.area,testID:"edit-area-any",onPress:()=>Q({area:''})}),A.areas.map(e=>(0,f.jsx)(C.Chip,{label:`${e.name}${e.dogs?' \xb7 dogs ok':''}`,selected:L.area===e.name,testID:`edit-area-${e.id}`,onPress:()=>Q({area:e.name})},e.id))]}),(0,f.jsx)(C.T,{size:18,weight:"semibold",center:!0,children:(0,m.tableButtonLabel)(L.table)}),(0,f.jsxs)(C.Row,{gap:8,wrap:!0,style:{justifyContent:'center'},children:[(0,f.jsx)(C.Button,{kind:L.table?'secondary':'primary',label:"No table",accessibilityLabel:"No table"+(L.table?'':', chosen'),onPress:()=>Q({table:''}),style:{minHeight:44,minWidth:96},testID:"edit-table-none"}),ie.map(e=>(0,f.jsx)(C.Button,{kind:e===L.table?'primary':'secondary',label:(0,m.tableButtonLabel)(e),accessibilityLabel:`Table ${(0,m.tableButtonLabel)(e)}${e===L.table?', chosen':''}`,onPress:()=>Q({table:e}),style:{minHeight:44,minWidth:64},testID:`edit-table-${e}`},e))]})]}),(0,f.jsxs)(N,{title:"Guest",testID:"edit-section-guest",children:[(0,f.jsx)(C.Field,{label:"Name",value:L.name,onChangeText:e=>Q({name:e}),testID:"edit-name"}),b?(0,f.jsx)(C.Muted,{center:!0,children:"Phone and email can be changed in the Managers app; the Display never shows them."}):(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(C.Field,{label:"Phone",value:L.phone,onChangeText:e=>Q({phone:e}),keyboardType:"phone-pad",testID:"edit-phone"}),(0,f.jsx)(C.Field,{label:"Email",value:L.email,onChangeText:e=>Q({email:e}),keyboardType:"email-address",autoCapitalize:"none",testID:"edit-email"})]}),(0,f.jsx)(C.T,{size:16,center:!0,children:"Booked by"}),(0,f.jsx)(C.Row,{wrap:!0,gap:6,style:{justifyContent:'center'},children:c.SOURCES.map(e=>(0,f.jsx)(C.Chip,{label:e.label,selected:L.source===e.id,testID:`edit-source-${e.id}`,onPress:()=>Q({source:e.id})},e.id))}),(0,f.jsx)(C.Row,{wrap:!0,gap:6,style:{justifyContent:'center'},children:c.TAGS.map(e=>{const t=(L.tags??[]).includes(e);return(0,f.jsx)(C.Chip,{label:e,selected:t,testID:`edit-tag-${e}`,onPress:()=>Q({tags:t?(L.tags??[]).filter(t=>t!==e):[...L.tags??[],e].sort()})},e)})})]}),(0,f.jsxs)(N,{title:"Dogs, high chairs and access",testID:"edit-section-needs",children:[(0,f.jsx)(E,{label:"Dogs",value:L.dogs??0,max:6,onChange:e=>Q({dogs:e}),testID:"edit-dogs"}),(0,f.jsx)(E,{label:"High chairs",value:L.highChairs??0,max:10,onChange:e=>Q({highChairs:e}),testID:"edit-high-chairs"}),(0,f.jsx)(E,{label:"Wheelchair users",value:L.wheelchair??0,max:10,onChange:e=>Q({wheelchair:e}),testID:"edit-wheelchair"}),(0,f.jsx)(C.T,{size:16,center:!0,children:"Occasion"}),(0,f.jsx)(C.Row,{wrap:!0,gap:6,style:{justifyContent:'center'},children:c.OCCASIONS.map(e=>(0,f.jsx)(C.Chip,{label:e.label,selected:(L.occasion??'')===e.id,testID:`edit-occasion-${e.id||'none'}`,onPress:()=>Q({occasion:e.id})},e.id||'none'))})]}),(0,f.jsxs)(N,{title:"Allergies and dietary",testID:"edit-section-allergies",children:[(0,f.jsxs)(C.Row,{wrap:!0,gap:6,style:{justifyContent:'center'},children:[(0,f.jsx)(C.Chip,{label:"No allergies",selected:!!L.allergyNone&&!re.length,testID:"edit-allergy-none",onPress:()=>Q({allergyNone:!0,allergies:[]})}),h.ALLERGENS.map(e=>(0,f.jsx)(C.Chip,{label:e.short,selected:re.some(t=>t.allergen===e.id),testID:`edit-allergen-${e.id}`,onPress:()=>ce(e.id)},e.id))]}),re.map(e=>(0,f.jsxs)(a.default,{style:{gap:4,alignItems:'center'},children:[(0,f.jsxs)(C.T,{size:15,center:!0,children:[h.ALLERGENS.find(t=>t.id===e.allergen)?.short,": how serious?"]}),(0,f.jsx)(C.Row,{wrap:!0,gap:6,style:{justifyContent:'center'},children:h.SEVERITIES.map(t=>(0,f.jsx)(C.Chip,{label:t.label,selected:e.severity===t.id,testID:`edit-severity-${e.allergen}-${t.id}`,onPress:()=>Q({allergies:re.map(s=>s.allergen===e.allergen?{...s,severity:t.id}:s)})},t.id))})]},e.allergen)),(0,f.jsx)(C.Field,{label:"Anything else about allergies",value:L.allergyNote,onChangeText:e=>Q({allergyNote:e}),testID:"edit-allergy-note"}),le.includes('allergies')&&re.length?(0,f.jsx)(C.T,{size:15,center:!0,colour:x.colours.amber,children:"The kitchen signs off allergies again after this change."}):null,(0,f.jsx)(E,{label:"Vegan",value:L.vegan??0,max:L.partySize,onChange:e=>Q({vegan:e}),testID:"edit-vegan"}),(0,f.jsx)(E,{label:"Vegetarian",value:L.vegetarian??0,max:L.partySize,onChange:e=>Q({vegetarian:e}),testID:"edit-vegetarian"})]}),'cancelled'!==O.status?(0,f.jsxs)(N,{title:"Status",testID:"edit-section-status",children:[(0,f.jsx)(C.Row,{wrap:!0,gap:6,style:{justifyContent:'center'},children:c.EDIT_STATUSES.map(e=>(0,f.jsx)(C.Chip,{label:e.label,selected:L.status===e.id,testID:`edit-status-${e.id}`,onPress:()=>Q({status:e.id})},e.id))}),(0,f.jsx)(C.Muted,{center:!0,children:"To cancel, use Cancel booking below. Nothing is ever deleted."})]}):null,(0,f.jsx)(N,{title:"Notes",testID:"edit-section-notes",children:(0,f.jsx)(C.Field,{label:"Notes",value:L.notes,onChangeText:e=>Q({notes:e}),placeholder:c.NOTES_PLACEHOLDER,multiline:!0,numberOfLines:3,testID:"edit-notes"})}),W?(0,f.jsxs)(a.default,{testID:"edit-warn",style:{gap:8,padding:12,borderRadius:12,borderWidth:1.5,borderColor:x.colours.amber,backgroundColor:x.colours.amberBg},children:[W.map(e=>(0,f.jsx)(C.T,{size:16,center:!0,colour:"#FFE2A8",children:e},e)),(0,f.jsx)(C.T,{size:16,center:!0,colour:"#FFE2A8",children:"You can still save."})]}):null,(0,c.isWixBooking)(O)&&(0,c.guestMessageFields)(le).length?(0,f.jsxs)(a.default,{testID:"edit-notify",style:{gap:6,alignItems:'center'},children:[(0,f.jsx)(C.Toggle,{value:J,onChange:K,label:c.NOTIFY_LABEL,testID:"edit-notify-toggle"}),(0,f.jsx)(C.Muted,{center:!0,children:J?'The website sends the guest its own message about this.':'Off: the guest isn\u2019t messaged. The website keeps the old date, time or status until it\u2019s changed there.'})]}):null,_?(0,f.jsx)(C.T,{size:16,center:!0,colour:x.colours.goldLight,children:_}):null,(0,f.jsxs)(C.Row,{gap:8,wrap:!0,children:[(0,f.jsx)(C.Button,{label:W?'Save anyway':'Save changes',testID:"edit-save",disabled:!ee||!ae||L.name.trim().length<1||!le.length,onPress:()=>{const t=ee?(0,o.blockAt)(R,e,L.date,Z):void 0,s=(0,c.editWarnings)(O,ne,B,t,oe,A);!s.length||W?de():M(s)},style:{minHeight:56,flex:1}}),(0,f.jsx)(C.Button,{kind:"ghost",label:"Close",onPress:p,style:{minHeight:56}})]}),he.length?(0,f.jsx)(N,{title:"Changes",testID:"edit-history",children:he.slice(0,12).map((e,t)=>(0,f.jsx)(C.T,{size:14,center:!0,colour:x.colours.muted,children:e},t))}):null,(0,f.jsx)(I.CancelBookingButton,{rid:e,b:O,name:O.name,big:!0,onDone:()=>p()}),(0,f.jsx)(I.ReinstateBookingButton,{b:O,name:O.name,today:(0,j.ymd)(new Date),onDone:()=>p()})]})}},1115,[34,1097,102,848,1014,1011,850,846,1111,830,997,865,1012,1092,840,827,1105,1089,1113,794,25]); __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,"useVoiceSlot",{enumerable:!0,get:function(){return w}}),_e.voiceAppFor=h,_e.useVoiceTarget=p,_e.VoiceSlot=function({size:e=56,layer:t=0}){const u=p(),c=(0,n.useRef)(null),l=(0,n.useRef)(y++).current,{width:f,height:h,fontScale:v}=(0,o.default)(),A=()=>{if(t{if(c.current!==e||!s||tu+.5?w.getState().owner===l&&w.setState({rect:null,owner:0}):w.setState({rect:{x:n,y:o,size:s},owner:l})})},W=(0,n.useRef)(A);return W.current=A,(0,n.useLayoutEffect)(()=>{if(u?.on)return S.set(l,{layer:t,measure:()=>W.current()}),()=>{S.delete(l),w.getState().owner===l&&w.setState({rect:null,owner:0}),requestAnimationFrame(b)}},[u?.on,t]),(0,n.useLayoutEffect)(()=>{A();const e=requestAnimationFrame(A);return()=>cancelAnimationFrame(e)},[f,h,v,u?.on]),(0,n.useEffect)(()=>{const e=c.current;if(!u?.on||'undefined'==typeof ResizeObserver||!e?.parentElement)return;const t=new ResizeObserver(A);return t.observe(e.parentElement),e.parentElement.parentElement&&t.observe(e.parentElement.parentElement),()=>t.disconnect()},[u?.on]),(0,n.useEffect)(()=>()=>{w.getState().owner===l&&w.setState({rect:null,owner:0})},[]),(0,n.useEffect)(()=>{u?.on||w.getState().owner!==l||w.setState({rect:null,owner:0})},[u?.on]),u?.on?(0,m.jsx)(s.default,{ref:c,testID:"voice-slot",onLayout:A,style:{width:e,height:e,flexShrink:0}}):null};var t=r(d[0]),n=r(d[1]),o=e(r(d[2])),s=e(r(d[3])),u=r(d[4]),c=r(d[5]),l=r(d[6]),f=r(d[7]),m=r(d[8]);const w=(0,u.create)(()=>({rect:null,owner:0}));function h(e){return'customer'===c.APP_VARIANT||/^\/(customer|table|demo)/.test(e)?null:e.startsWith('/owner')||e.startsWith('/admin')?'owner':e.startsWith('/team')?'staff':e.startsWith('/kitchen')?'chef':e.startsWith('/display')?'display':null}function p(){const e=(0,t.usePathname)()||'/',n=(0,l.useCtx)(6e4),o=(0,f.useVoiceSettings)(e=>e.enabled),s=h(e);if(!s)return null;const u='owner'===s?'owner'===n.role?'owner':'manager'===n.role?'manager':'staff':s;return{app:s,role:u,actions:'staff'===u?'staff':s,on:(0,f.voiceOn)(o,n.rid,u)}}let y=1;const S=new Map,E=()=>{let e=-1;return S.forEach(t=>{t.layer>e&&(e=t.layer)}),e};function b(){const e=E();S.forEach(t=>{t.layer===e&&t.measure()})}},1116,[30,34,426,102,815,846,1100,1117,25]); __d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"VOICE_ROLES",{enumerable:!0,get:function(){return o}}),Object.defineProperty(_e,"VOICE_ROLE_LABEL",{enumerable:!0,get:function(){return p}}),Object.defineProperty(_e,"useVoiceSettings",{enumerable:!0,get:function(){return u}}),Object.defineProperty(_e,"voiceOn",{enumerable:!0,get:function(){return f}}),_e.micExplainedFor=function(e){try{if('1'===b()?.getItem(s(e)))return!0}catch{}return u.getState().micExplained},_e.setMicExplainedFor=function(e){try{b()?.setItem(s(e),'1')}catch{}u.getState().setMicExplained(!0)};var e,n=r(d[0]),t=(e=n)&&e.__esModule?e:{default:e},c=r(d[1]),l=r(d[2]);const o=['owner','manager','staff','chef','display'],p={owner:'Owner (Managers app)',manager:'Managers (Managers app)',staff:'Staff app (full voice assistant, no money or HR)',chef:'Head Chef app',display:'Main Display'},u=(0,c.create)()((0,l.persist)(e=>({enabled:{},micExplained:!1,setEnabled:(n,t,c)=>e(e=>({enabled:{...e.enabled,[n]:{...e.enabled[n]??{},[t]:c}}})),setMicExplained:n=>e({micExplained:n})}),{name:'covercharge-voice-v1',version:4,storage:(0,l.createJSONStorage)(()=>t.default),migrate:(e,n)=>({enabled:n<2?{}:e?.enabled??{},micExplained:!!e?.micExplained}),merge:(e,n)=>({...n,enabled:e?.enabled??n.enabled,micExplained:e?.micExplained??n.micExplained}),partialize:e=>({enabled:e.enabled,micExplained:e.micExplained})})),f=(e,n,t)=>!1!==e[n]?.[t],s=e=>`cc-voice-mic-explained-${e}`,b=()=>{try{return'undefined'!=typeof window?window.localStorage:void 0}catch{return}}},1117,[808,815,818]); __d(function(g,_r,_i,a,_m,e,_d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"VAT",{enumerable:!0,get:function(){return r}}),Object.defineProperty(e,"exVat",{enumerable:!0,get:function(){return n}}),e.dishCost=i,Object.defineProperty(e,"gpPct",{enumerable:!0,get:function(){return o}}),Object.defineProperty(e,"priceForTarget",{enumerable:!0,get:function(){return c}}),e.costings=function(r,c,s,u){const d=(0,t.dishStats)(r);return c.map(t=>{const c=r.find(r=>r.id===t.dishId);if(!c||null==c.price)return null;const p=i(t,s),l=n(c.price),f=o(p,c.price),b=d.find(t=>t.item.id===c.id)?.sold??0;return{item:c,recipe:t,cost:p,priceInc:c.price,priceEx:l,gp:f,cashGp:l-p,below:ft.prevCost&&t.prevCost!==t.cost).map(s=>{const u=(s.cost-(s.prevCost??s.cost))/(s.prevCost??1)*100,d=r.filter(t=>t.lines.some(t=>t.ing===s.id)).map(r=>{const u=t.find(t=>t.id===r.dishId);if(!u||null==u.price)return null;const d=o(i(r,n,{ing:s.id,cost:s.prevCost}),u.price),p=o(i(r,n),u.price);return{item:u,before:d,after:p,dropped:d>=c&&pt.dropped),below:d.filter(t=>t.below)}})},e.weekGp=function(t,r,n){const i=t.reduce((t,r)=>t+r.priceEx*r.soldWeek,0),o=t.reduce((t,r)=>t+r.cost*r.soldWeek,0),c=o+r+Math.max(0,n);return{sales:i,theoCost:o,actualCost:c,theo:i?(i-o)/i*100:0,actual:i?(i-c)/i*100:0}},Object.defineProperty(e,"fmtQty",{enumerable:!0,get:function(){return s}});var t=_r(_d[0]);const r=.2,n=t=>Math.round(t/1.2);function i(t,r,n){return Math.round(t.lines.reduce((t,i)=>{const o=r.find(t=>t.id===i.ing);return t+(n&&n.ing===i.ing?n.cost:o?.cost??0)*i.qty},0))}const o=(t,r)=>{const i=n(r);return i>0?(i-t)/i*100:0},c=(t,r)=>50*Math.ceil(t/(1-r/100)*1.2/50);const s=(t,r)=>`${Number.isInteger(t)?t:t.toFixed(t<1?3:2).replace(/0+$/,'').replace(/\.$/,'')} ${'each'===r?'':r}`.trim()},1118,[1119]); @@ -1431,7 +1431,7 @@ __d(function(g,r,i,_a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{ __d(function(_g,_r,i,_a,_m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.GiftTill=b,_e.GiftTillManager=y,_e.GiftShopManager=w,_e.PaymentsTestMode=S,_e.GiftCardsPage=function({me:e}){return(0,p.staffServer)()?(0,j.jsxs)(l.default,{style:{gap:10},children:[(0,j.jsx)(b,{me:e}),(0,x.can)('orders.manage')?(0,j.jsx)(y,{me:e}):null,(0,x.can)('venue.settings')?(0,j.jsx)(w,{me:e}):null,(0,x.can)('venue.settings')?(0,j.jsx)(S,{me:e}):null]}):(0,j.jsx)(r.Banner,{kind:"demo",title:"Gift cards are saved on the server",children:"Sign this device in to your venue to check and take gift cards. There are no example cards here."})};var e,t=_r(d[0]),s=_r(d[1]),n=_r(d[2]),a=_r(d[3]),l=(e=a)&&e.__esModule?e:{default:e},r=_r(d[4]),o=_r(d[5]),c=_r(d[6]),u=_r(d[7]),h=_r(d[8]),x=_r(d[9]),p=_r(d[10]),g=_r(d[11]),j=_r(d[12]);const f=e=>{if(!e)return'';try{return new Date(e).toLocaleDateString('en-GB',{day:'numeric',month:'short',year:'numeric',timeZone:'Europe/London'})}catch{return e.slice(0,10)}},m=({m:e})=>e?(0,j.jsx)(r.Banner,{kind:e.kind,title:e.text}):null;function b({me:e}){const[t,s]=(0,n.useState)(''),[a,x]=(0,n.useState)(null),[p,b]=(0,n.useState)(''),[y,w]=(0,n.useState)((0,u.redeemKey)()),[k,S]=(0,n.useState)(null),[T,C]=(0,n.useState)(!1),v=(0,u.poundsToPence)(p);return(0,j.jsx)(l.default,{testID:"gift-till",children:(0,j.jsx)(r.Card,{children:(0,j.jsxs)(l.default,{style:{gap:8},children:[(0,j.jsx)(r.T,{weight:"semibold",children:"Check a gift card or take it off the bill"}),(0,j.jsx)(r.Field,{label:"Gift card code",value:t,autoCapitalize:"characters",onChangeText:e=>{s(e),x(null),w((0,u.redeemKey)())},placeholder:"XXXX-XXXX-XXXX-XXXX",testID:"gift-code"}),(0,j.jsx)(r.Button,{label:T?'Checking\u2026':'Check balance',kind:"ghost",small:!0,disabled:T||t.replace(/\W/g,'').length<6,testID:"gift-check",onPress:async()=>{C(!0),S(null);try{const e=await(0,h.giftCheck)(t);x(e),e.found||S({kind:'warn',text:'No gift card with that code here.'})}catch(e){S({kind:'warn',text:(0,c.plainError)(e)})}finally{C(!1)}}}),a?.found?(0,j.jsxs)(l.default,{style:{gap:4},testID:"gift-card-found",children:[(0,j.jsxs)(r.Row,{style:{justifyContent:'space-between'},children:[(0,j.jsx)(r.T,{weight:"medium",children:(0,u.prettyGiftCode)(t)}),(0,j.jsx)(r.T,{size:20,weight:"bold",colour:g.colours.gold,children:(0,o.gbp)(a.balancePence)})]}),(0,j.jsxs)(r.Muted,{size:12,children:[u.STATUS_WORDS[a.status]??a.status," \xb7 of ",(0,o.gbp)(a.initialPence),a.expiresAt?` \xb7 use by ${f(a.expiresAt)}`:'','wix'===a.source?' \xb7 old website bookings card':'']}),'active'===a.status?(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(r.Field,{label:"Amount to take off \xa3",value:p,onChangeText:b,keyboardType:"decimal-pad",testID:"gift-amount"}),(0,j.jsx)(r.Button,{label:T?'Taking it off\u2026':v?`Take ${(0,o.gbp)(v)} off the card`:'Take it off the card',disabled:T||!v||v>a.balancePence,testID:"gift-redeem",onPress:async()=>{C(!0),S(null);try{const s=await(0,h.giftRedeem)(t,v,y,e);x({...a,...s,found:!0}),b(''),w((0,u.redeemKey)()),S({kind:'success',text:`${s.already?'Already taken: ':'Taken '}${(0,o.gbp)(s.redeemedPence)}. ${(0,o.gbp)(s.balancePence)} left on the card.`})}catch(e){S({kind:'warn',text:(0,c.plainError)(e)})}finally{C(!1)}}})]}):null]}):null,(0,j.jsx)(m,{m:k})]})})})}function y({me:e}){const[t,s]=(0,n.useState)([]),[a,x]=(0,n.useState)([]),[p,b]=(0,n.useState)(null),[y,w]=(0,n.useState)(''),[k,S]=(0,n.useState)(''),[T,C]=(0,n.useState)(null),[v,P]=(0,n.useState)(null),I=(0,n.useCallback)(()=>{(0,h.waitingCards)().then(s).catch(()=>{}),(0,h.shopOrders)().then(x).catch(()=>{})},[]);(0,n.useEffect)(()=>{I()},[I]);const D=async(e,t)=>{b(null);try{await e(),b({kind:'success',text:t}),I()}catch(e){b({kind:'warn',text:(0,c.plainError)(e)})}},M=t.filter(e=>'waiting-payment'===e.status),_=a.filter(e=>!['collected','cancelled'].includes(e.status)),B=(0,u.poundsToPence)(y);return(0,j.jsxs)(l.default,{style:{gap:10},children:[(0,j.jsx)(l.default,{testID:"gift-waiting",children:(0,j.jsx)(r.Card,{children:(0,j.jsxs)(l.default,{style:{gap:6},children:[(0,j.jsxs)(r.T,{weight:"semibold",children:["Waiting for payment at the till (",M.length+_.filter(e=>'waiting-payment'===e.status).length,")"]}),(0,j.jsx)(r.Muted,{size:12,children:"Card payment in the app isn\u2019t on yet. Take the money at the till, then mark it paid here."}),M.map(t=>(0,j.jsxs)(r.Row,{style:{justifyContent:'space-between'},children:[(0,j.jsxs)(l.default,{style:{flex:1},children:[(0,j.jsxs)(r.T,{children:["Gift card ",t.ref," \xb7 ",(0,o.gbp)(t.initial_pence)]}),(0,j.jsxs)(r.Muted,{size:12,children:["for ",t.recipient_name||'no name'," \xb7 ends ",t.last4]})]}),(0,j.jsx)(r.Button,{label:"Paid at the till",small:!0,testID:`gift-paid-${t.ref}`,onPress:()=>D(()=>(0,h.giftActivate)(t.id,e),`${t.ref} is ready to use`)})]},t.id)),_.map(t=>(0,j.jsxs)(l.default,{style:{gap:4},children:[(0,j.jsxs)(r.Row,{style:{justifyContent:'space-between'},children:[(0,j.jsxs)(l.default,{style:{flex:1},children:[(0,j.jsxs)(r.T,{children:["Shop ",t.ref," \xb7 ",t.guest_name," \xb7 ",(0,o.gbp)(t.total_pence)]}),(0,j.jsxs)(r.Muted,{size:12,children:[t.lines.map(e=>`${e.qty}\xd7 ${e.name}`).join(', ')," \xb7 ",u.STATUS_WORDS[t.status]]})]}),'waiting-payment'===t.status?(0,j.jsx)(r.Button,{label:"Paid at the till",small:!0,onPress:()=>D(()=>(0,h.shopStatus)(t.id,'paid','',e),`${t.ref} paid`)}):'paid'===t.status?(0,j.jsx)(r.Button,{label:"Ready",small:!0,onPress:()=>D(()=>(0,h.shopStatus)(t.id,'ready','',e),`${t.ref} ready`)}):(0,j.jsx)(r.Button,{label:"Collected",small:!0,onPress:()=>D(()=>(0,h.shopStatus)(t.id,'collected','',e),`${t.ref} collected`)})]}),v&&v.id===t.id?(0,j.jsxs)(r.Row,{style:{gap:6,alignItems:'flex-end'},children:[(0,j.jsx)(l.default,{style:{flex:1},children:(0,j.jsx)(r.Field,{label:"Reason",value:v.reason,onChangeText:e=>P({id:t.id,reason:e})})}),(0,j.jsx)(r.Button,{label:"Cancel order",kind:"danger",small:!0,disabled:v.reason.trim().length<3,onPress:()=>D(()=>(0,h.shopStatus)(t.id,'cancelled',v.reason,e),`${t.ref} cancelled, stock put back`).then(()=>P(null))})]}):(0,j.jsx)(r.Button,{label:"Cancel with a reason",kind:"ghost",small:!0,onPress:()=>P({id:t.id,reason:''})})]},t.id)),M.length||_.length?null:(0,j.jsx)(r.Muted,{children:"Nothing waiting."})]})})}),(0,j.jsx)(l.default,{testID:"gift-sell",children:(0,j.jsx)(r.Card,{children:(0,j.jsxs)(l.default,{style:{gap:6},children:[(0,j.jsx)(r.T,{weight:"semibold",children:"Sell a gift card at the till"}),(0,j.jsx)(r.Field,{label:"Amount \xa3",value:y,onChangeText:w,keyboardType:"decimal-pad",testID:"gift-sell-amount"}),(0,j.jsx)(r.Field,{label:"Who it\u2019s for (optional)",value:k,onChangeText:S}),(0,j.jsx)(r.Button,{label:B?`Paid ${(0,o.gbp)(B)} at the till: make the card`:'Make the card',small:!0,disabled:!B,testID:"gift-sell-btn",onPress:()=>D(async()=>{const t=await(0,h.giftIssue)(B,k,e);C(t),w(''),S('')},'Card made')}),T?.code?(0,j.jsxs)(l.default,{style:{gap:2},children:[(0,j.jsx)(r.T,{size:22,weight:"bold",colour:g.colours.gold,center:!0,children:T.code}),(0,j.jsxs)(r.Muted,{center:!0,size:12,children:["Shown once: write it on the card or receipt now. ",(0,o.gbp)(T.initialPence),", use by ",f(T.expiresAt),"."]})]}):null]})})}),(0,j.jsx)(m,{m:p})]})}function w({me:e}){const[t,s]=(0,n.useState)(null),[a,x]=(0,n.useState)(''),[p,b]=(0,n.useState)(null),[y,w]=(0,n.useState)([]),[k,S]=(0,n.useState)({name:'',price:'',details:''}),[T,C]=(0,n.useState)(null),[v,P]=(0,n.useState)({code:'',bal:''}),[I,D]=(0,n.useState)([]),[M,_]=(0,n.useState)(null),B=(0,n.useCallback)(()=>{(0,h.readShopSettings)().then(e=>{s(e),x(e.amounts.map(e=>String(e/100)).join(', '))}).catch(e=>C({kind:'warn',text:(0,c.plainError)(e)})),(0,h.readProducts)().then(w).catch(()=>{}),(0,h.giftSummary)().then(b).catch(()=>{}),(0,h.waitingCards)().then(D).catch(()=>{})},[]);(0,n.useEffect)(()=>{B()},[B]);const R=async(e,t)=>{C(null);try{await e(),C({kind:'success',text:t}),B()}catch(e){C({kind:'warn',text:(0,c.plainError)(e)})}};if(!t)return(0,j.jsx)(r.Card,{children:(0,j.jsx)(r.Muted,{children:T?.text??'Loading\u2026'})});const z=(0,u.amountsFromText)(a);return(0,j.jsxs)(l.default,{style:{gap:10},children:[p?(0,j.jsx)(l.default,{testID:"gift-summary",children:(0,j.jsxs)(r.Row,{style:{gap:8},children:[(0,j.jsxs)(r.Card,{style:{flex:1},children:[(0,j.jsx)(r.Muted,{children:"Sold (paid)"}),(0,j.jsx)(r.T,{size:20,weight:"bold",children:(0,o.gbp)(p.soldPence)})]}),(0,j.jsxs)(r.Card,{style:{flex:1},children:[(0,j.jsx)(r.Muted,{children:"Still to spend"}),(0,j.jsx)(r.T,{size:20,weight:"bold",children:(0,o.gbp)(p.outstandingPence)})]}),(0,j.jsxs)(r.Card,{style:{flex:1},children:[(0,j.jsx)(r.Muted,{children:"Waiting"}),(0,j.jsx)(r.T,{size:20,weight:"bold",children:p.waiting})]})]})}):null,(0,j.jsx)(l.default,{testID:"gift-settings",children:(0,j.jsx)(r.Card,{children:(0,j.jsxs)(l.default,{style:{gap:8},children:[(0,j.jsx)(r.T,{weight:"semibold",children:"Gift cards and shop settings"}),(0,j.jsx)(r.Toggle,{label:"Sell gift cards in the customer app",value:t.giftsOn,onChange:e=>s({...t,giftsOn:e}),testID:"gift-on"}),(0,j.jsx)(r.Toggle,{label:"Open the shop in the customer app",value:t.shopOn,onChange:e=>s({...t,shopOn:e}),testID:"shop-on"}),(0,j.jsxs)(r.T,{children:["Cards last ",(0,u.expiryWords)(t.expiryMonths)," from when they\u2019re paid"]}),(0,j.jsx)(r.Stepper,{value:t.expiryMonths,min:1,max:60,label:"Gift card expiry in months",onChange:e=>s({...t,expiryMonths:e})}),(0,j.jsx)(r.Field,{label:"Amounts guests can pick (\xa3, comma between)",value:a,onChangeText:x,testID:"gift-amounts"}),(0,j.jsx)(r.Field,{label:"Terms shown to guests (optional)",value:t.terms,onChangeText:e=>s({...t,terms:e}),multiline:!0}),(0,j.jsx)(r.Muted,{size:12,children:"Gift cards are sold through your website. Guests can also pay at the bar or till."}),(0,j.jsx)(r.Button,{label:"Save",disabled:!z,testID:"gift-settings-save",onPress:()=>R(()=>(0,h.saveShopSettings)({...t,amounts:z}),'Saved. The customer app shows it next time it opens.')})]})})}),(0,j.jsx)(l.default,{testID:"shop-products",children:(0,j.jsx)(r.Card,{children:(0,j.jsxs)(l.default,{style:{gap:8},children:[(0,j.jsx)(r.T,{weight:"semibold",children:"Shop products"}),y.map(e=>(0,j.jsxs)(l.default,{style:{gap:4,borderTopWidth:1,borderColor:g.colours.border,paddingTop:6},children:[(0,j.jsxs)(r.Row,{style:{justifyContent:'space-between'},children:[(0,j.jsx)(r.T,{weight:"medium",style:{flex:1},children:e.name}),(0,j.jsx)(r.T,{children:(0,o.gbp)(e.price_pence)})]}),(0,j.jsxs)(r.Row,{style:{justifyContent:'space-between',alignItems:'center'},children:[(0,j.jsx)(l.default,{style:{flex:1},children:(0,j.jsx)(r.Toggle,{label:e.is_live?'In the shop':'Hidden',a11y:`${e.name} in the shop`,value:e.is_live,onChange:t=>R(()=>(0,h.saveProduct)({id:e.id,name:e.name,details:e.details,pricePence:e.price_pence,stock:e.stock,live:t}),'Saved')})}),(0,j.jsxs)(l.default,{style:{alignItems:'flex-end'},children:[(0,j.jsx)(r.Muted,{size:12,children:"Stock"}),(0,j.jsx)(r.Stepper,{value:e.stock,min:0,max:500,label:`${e.name} stock`,onChange:t=>R(()=>(0,h.saveProduct)({id:e.id,name:e.name,details:e.details,pricePence:e.price_pence,stock:t,live:e.is_live}),'Stock saved')})]})]}),0===e.stock?(0,j.jsx)(r.Badge,{kind:"amber",label:"Sold out"}):null]},e.id)),y.length?null:(0,j.jsx)(r.Muted,{children:"No products yet."}),(0,j.jsx)(r.Field,{label:"New product name",value:k.name,onChangeText:e=>S({...k,name:e}),testID:"shop-new-name"}),(0,j.jsx)(r.Field,{label:"Price \xa3",value:k.price,onChangeText:e=>S({...k,price:e}),keyboardType:"decimal-pad",testID:"shop-new-price"}),(0,j.jsx)(r.Field,{label:"Details (optional)",value:k.details,onChangeText:e=>S({...k,details:e})}),(0,j.jsx)(r.Button,{label:"Add product (hidden until you switch it on)",kind:"ghost",small:!0,disabled:k.name.trim().length<2||!(0,u.poundsToPence)(k.price),onPress:()=>R(async()=>{await(0,h.saveProduct)({name:k.name,details:k.details,pricePence:(0,u.poundsToPence)(k.price),stock:0,live:!1}),S({name:'',price:'',details:''})},'Product added')})]})})}),(0,j.jsx)(l.default,{testID:"gift-wix",children:(0,j.jsx)(r.Card,{children:(0,j.jsxs)(l.default,{style:{gap:6},children:[(0,j.jsx)(r.T,{weight:"semibold",children:"Honour an old website bookings gift card"}),(0,j.jsx)(r.Muted,{size:12,children:"Check the balance in your website bookings dashboard first. Each website bookings code can be added once."}),(0,j.jsx)(r.Field,{label:"Website bookings code",value:v.code,autoCapitalize:"characters",onChangeText:e=>P({...v,code:e})}),(0,j.jsx)(r.Field,{label:"Balance you checked in website bookings \xa3",value:v.bal,keyboardType:"decimal-pad",onChangeText:e=>P({...v,bal:e})}),(0,j.jsx)(r.Button,{label:"Add to CoverCharge",kind:"ghost",small:!0,disabled:v.code.replace(/\W/g,'').length<6||!(0,u.poundsToPence)(v.bal),onPress:()=>R(async()=>{await(0,h.giftHonourWix)(v.code,(0,u.poundsToPence)(v.bal),e),P({code:'',bal:''})},'Website bookings card added')})]})})}),(0,j.jsx)(l.default,{testID:"gift-list",children:(0,j.jsx)(r.Card,{children:(0,j.jsxs)(l.default,{style:{gap:4},children:[(0,j.jsx)(r.T,{weight:"semibold",children:"Recent cards"}),I.map(t=>(0,j.jsxs)(l.default,{style:{gap:2},children:[(0,j.jsxs)(r.Row,{style:{justifyContent:'space-between'},children:[(0,j.jsxs)(r.T,{style:{flex:1},children:[t.ref," \xb7 ends ",t.last4," \xb7 ",'wix'===t.source?'Website bookings':'till'===t.source?'Till':'App']}),(0,j.jsxs)(r.T,{children:[(0,o.gbp)(t.balance_pence)," / ",(0,o.gbp)(t.initial_pence)]})]}),(0,j.jsxs)(r.Row,{style:{justifyContent:'space-between'},children:[(0,j.jsxs)(r.Muted,{size:12,children:[u.STATUS_WORDS[t.status]??t.status,t.expires_at?` \xb7 use by ${f(t.expires_at)}`:'']}),'void'!==t.status&&M?.id!==t.id?(0,j.jsx)(r.Button,{label:"Cancel card",kind:"ghost",small:!0,onPress:()=>_({id:t.id,reason:''})}):null]}),M&&M.id===t.id?(0,j.jsxs)(r.Row,{style:{gap:6,alignItems:'flex-end'},children:[(0,j.jsx)(l.default,{style:{flex:1},children:(0,j.jsx)(r.Field,{label:"Reason",value:M.reason,onChangeText:e=>_({id:t.id,reason:e})})}),(0,j.jsx)(r.Button,{label:"Cancel it",kind:"danger",small:!0,disabled:M.reason.trim().length<3,onPress:()=>R(()=>(0,h.giftVoid)(t.id,M.reason,e),'Card cancelled (kept on record)').then(()=>_(null))})]}):null]},t.id)),I.length?null:(0,j.jsx)(r.Muted,{children:"No cards yet."})]})})}),(0,j.jsx)(m,{m:T})]})}const k={none:'Pay at the till only',stripe:'Stripe (test mode)',wix:'Website bookings payments (coming)'};function S({me:e}){if(t.IS_GREENSIDE)return(0,j.jsx)(s.GreensideCashOnly,{});const[a,u]=(0,n.useState)(null),[x,p]=(0,n.useState)([]),[g,b]=(0,n.useState)(null),y=(0,n.useCallback)(()=>{(0,h.readPaySettings)().then(u).catch(e=>b({kind:'warn',text:(0,c.plainError)(e)})),(0,h.recentPayments)().then(p).catch(()=>{})},[]);return(0,n.useEffect)(()=>{y()},[y]),a?(0,j.jsx)(l.default,{testID:"pay-settings",children:(0,j.jsx)(r.Card,{children:(0,j.jsxs)(l.default,{style:{gap:8},children:[(0,j.jsxs)(r.Row,{style:{justifyContent:'space-between',alignItems:'center'},children:[(0,j.jsx)(r.T,{weight:"semibold",children:"Card payments"}),(0,j.jsx)(r.Badge,{kind:"amber",label:"TEST MODE"})]}),(0,j.jsx)(r.Banner,{kind:"demo",title:"Test mode only: no real money",children:"This build can\u2019t take live payments. Guests pay at the bar or till unless you switch on Stripe test mode below."}),(0,j.jsx)(r.Row,{wrap:!0,children:['none','stripe','wix'].map(e=>(0,j.jsx)(r.Chip,{label:k[e],selected:a.provider===e,onPress:()=>u({...a,provider:e,cardOn:'stripe'===e&&a.cardOn})},e))}),'stripe'===a.provider?(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(r.Field,{label:"Venue\u2019s Stripe account id (starts acct_)",value:a.account,autoCapitalize:"none",onChangeText:e=>u({...a,account:e.trim()}),placeholder:"acct_\u2026",testID:"pay-account"}),(0,j.jsx)(r.Muted,{size:12,children:"Money goes straight to the venue\u2019s own Stripe account. Never paste a key here."}),(0,j.jsx)(r.Toggle,{label:"Offer \u201cPay by card (test mode)\u201d in the customer app",value:a.cardOn,onChange:e=>u({...a,cardOn:e}),testID:"pay-card-on"}),(0,j.jsx)(r.Muted,{size:12,children:"Needs CoverCharge\u2019s Stripe sandbox to be set up first (Gordon\u2019s step). Until then guests see pay at the till."})]}):null,'wix'===a.provider?(0,j.jsx)(r.Banner,{kind:"demo",title:"Website bookings payments aren\u2019t linked yet",children:"Website bookings venues keep taking payments on their website. In the app, guests pay at the bar or till."}):null,(0,j.jsx)(r.Button,{label:"Save",testID:"pay-save",onPress:async()=>{b(null);try{await(0,h.savePaySettings)(a),b({kind:'success',text:'Saved'}),y()}catch(e){b({kind:'warn',text:(0,c.plainError)(e)})}}}),x.length?(0,j.jsxs)(l.default,{style:{gap:2},children:[(0,j.jsx)(r.T,{weight:"medium",children:"Recent test payments"}),x.map(e=>(0,j.jsxs)(r.Row,{style:{justifyContent:'space-between'},children:[(0,j.jsxs)(r.Muted,{children:['gift'===e.kind?'Gift card':'Shop'," \xb7 ",f(e.created_at)]}),(0,j.jsxs)(r.T,{children:[(0,o.gbp)(e.amount_pence)," \xb7 ",e.status]})]},e.id))]}):null,(0,j.jsx)(m,{m:g})]})})}):(0,j.jsx)(r.Card,{children:(0,j.jsx)(r.Muted,{children:g?.text??'Loading\u2026'})})}},1348,[5,1349,34,102,794,836,1196,1197,1198,985,1199,840,25]); __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.GreensideCashOnly=function(){return(0,s.jsxs)(n.Card,{children:[(0,s.jsx)(n.T,{weight:"semibold",children:"Cash only"}),(0,s.jsx)(n.Muted,{children:"Card payments and online checkout are not enabled for The Greenside Restaurant. Deposits are off; the policy needs confirmation."})]})},r(d[0]);var n=r(d[1]),s=r(d[2])},1349,[34,794,25]); __d(function(g,_r,i,a,_m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.CashUpAccessToggle=function({m:e}){const c=(0,o.useCashAccess)(s=>!0===s.byRef[e.id]),l=(0,o.useCashAccess)(e=>e.loaded),b=(0,r.useSync)(e=>'staff'===e.kind&&!!e.venueId),[y,C]=(0,s.useState)(!1),[m,x]=(0,s.useState)(null);if((0,s.useEffect)(()=>{b&&!l&&(0,u.refreshCashAccess)()},[b,l]),p(e))return(0,h.jsxs)(t.default,{testID:`cashup-access-${e.id}`,style:{gap:2},accessible:!0,accessibilityLabel:`${f(e)} can use cash up: always, as ${'owner'===e.role?'an owner':'a manager'}`,children:[(0,h.jsx)(n.T,{size:14,children:"Can use cash up"}),(0,h.jsxs)(n.Muted,{size:12,children:["Always on for ",'owner'===e.role?'owners':'managers',"."]})]});const j=async s=>{C(!0),x(null);const c=await(0,u.setStaffCashUp)(e.id,s);C(!1),x(c.ok?s?`${f(e)} can now open the cash up. The change is in the cash-up log.`:`${f(e)} can no longer open the cash up. The change is in the cash-up log.`:c.error??'Could not save.')};return(0,h.jsxs)(t.default,{testID:`cashup-access-${e.id}`,style:{gap:2},children:[(0,h.jsx)(n.Toggle,{testID:`cashup-toggle-${e.id}`,label:"Can use cash up",value:c,disabled:y||!b,onChange:e=>{j(e)}}),(0,h.jsx)(n.Muted,{size:12,children:b?c?'Can open the cash up, take a picture of the taking sheet and upload a spreadsheet.':'Off: the cash up is hidden from them and the server refuses it.':'Connect to the shared team to change this.'}),m?(0,h.jsx)(t.default,{accessibilityLiveRegion:"polite",children:(0,h.jsx)(n.Muted,{size:12,testID:`cashup-msg-${e.id}`,children:m})}):null]})},_e.CashUpAccessBadge=function({m:e}){const s=(0,o.useCashAccess)(s=>!0===s.byRef[e.id]);return p(e)||s?(0,h.jsx)(t.default,{accessible:!0,accessibilityLabel:`${f(e)} can use cash up`,testID:`cashup-badge-${e.id}`,children:(0,h.jsx)(n.Badge,{kind:"gold",label:"Cash up"})}):null},_e.NoCashUpAccess=function(){return(0,h.jsxs)(t.default,{testID:"cashup-no-access",accessible:!0,accessibilityRole:"text",accessibilityLabel:"You can't use the cash up yet. A manager can switch it on for you in Staff and roles.",style:{borderWidth:1,borderColor:l.colours.border,borderRadius:14,padding:16,gap:6,backgroundColor:l.colours.surface},children:[(0,h.jsx)(n.T,{size:18,weight:"semibold",children:"You can\u2019t use the cash up yet"}),(0,h.jsx)(n.T,{children:"A manager can switch it on for you in Staff & roles (\u201cCan use cash up\u201d)."})]})};var e,s=_r(d[0]),c=_r(d[1]),t=(e=c)&&e.__esModule?e:{default:e},n=_r(d[2]),l=_r(d[3]),o=_r(d[4]),u=_r(d[5]),r=_r(d[6]),h=_r(d[7]);const p=e=>'owner'===e.role||'manager'===e.role&&!e.managerAccess,f=e=>e.name.replace(' (example)','').split(' ')[0]},1350,[34,102,794,840,993,1037,985,25]); -__d(function(g,_r,_i,_a,m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.Bookings=function({go:e}={}){const{rid:C,r:X,now:Z,today:ee,me:se,role:te}=(0,p.useCtx)(1e4),le=(0,v.useBookings)(C),ne=(0,p.useInStaffApp)(),ie=(0,p.useShiftManager)(),ae=(0,v.useWaitlist)(C),[oe,de]=((0,v.useStore)(e=>e.alertAcks),(0,T.useState)(ee)),re=(0,R.useFrontDoor)(oe),ue=(0,k.useBookingWrite)(),[ce,he]=(0,T.useState)(''),[ge,be]=(0,T.useState)(!1),[pe,ke]=(0,T.useState)(2),me=oee.date===oe).sort((e,s)=>e.time.localeCompare(s.time)),ye=ae.filter(e=>'waiting'===e.status||'notified'===e.status).sort((e,s)=>e.number-s.number),we=xe.filter(e=>'noshow'===e.status),je=(0,V.useSync)(e=>!!e.venueId&&'guest'!==e.kind),fe=xe.filter(e=>'cancelled'!==e.status).reduce((e,s)=>e+s.partySize,0),Ie=(0,c.cancelledDayTally)(le,oe),Be=(0,c.cancelledTallyWords)(Ie,oe===ee?'today':'that day'),Se=xe.filter(e=>!e.walkIn),De=xe.filter(e=>e.walkIn),$e=le.filter(e=>'pending'===e.status&&e.date>=ee).sort((e,s)=>(e.date+e.time).localeCompare(s.date+s.time)),[Te,Ce]=(0,T.useState)(null),Le=(0,M.parseYmd)(oe);Le.setHours(12);const Ne=(0,Q.hoursFor)(X,Le),Pe=Ne?.open??new Date(`${oe}T12:00:00`),ve=Ne?.close??new Date(`${oe}T21:00:00`),Oe=Ne||xe.length?me?'No one seated that day':oe===ee?'No bookings yet today':'No bookings yet':oe===ee?'Closed today':'Closed that day';return(0,J.jsxs)(L.default,{style:{gap:12},children:[e&&!ne&&'staff'!==te?(0,J.jsx)(N.Button,{testID:"bookings-dashboard-top",label:"Bookings dashboard",accessibilityLabel:"Open Bookings dashboard: table plan, Timeline, today's guests and Covers",onPress:()=>e('more','serviceboard'),style:{width:'100%',minHeight:60}}):null,s.IS_WILDINGS||(s.IS_QUEUED_VENUE||s.IS_KIRKTON||s.IS_GREENSIDE||'abbotsford'===C)&&!ne&&'staff'!==te?(0,J.jsx)(n.VenueRequestList,{rid:C,kind:"table"}):null,!s.IS_WILDINGS&&!X.settings.hotel?.enabled||ne||'staff'===te?null:(0,J.jsx)(n.VenueRequestList,{rid:C,kind:"room",hotel:X.settings.hotel??l.WILDINGS_HOTEL}),(0,J.jsx)(G.BookingsDayNav,{today:ee,date:oe,onDate:de,count:e=>le.filter(s=>s.date===e&&'cancelled'!==s.status).length,sub:e=>{const s=le.filter(s=>s.date===e&&'cancelled'!==s.status&&!s.walkIn),t=s.reduce((e,s)=>e+s.partySize,0);return`${s.length} ${1===s.length?'table':'tables'} \xb7 ${t} ${1===t?'Cover':'Covers'}`}}),(0,J.jsx)(L.default,{testID:"bookings-day-graph",style:{overflow:'visible'},children:(0,J.jsx)(q.DayGraph,{bare:!0,fill:!0,todays:xe,open:Pe,close:ve,now:Z,turnBase:X.settings.turnMins,height:128,past:me,closed:!Ne,emptyText:Oe})}),me?(0,J.jsxs)(L.default,{testID:"bookings-past-totals",style:[N.styles.card,{gap:4}],accessible:!0,accessibilityLabel:`${(0,G.longDay)(oe)}: ${Se.length} tables, ${fe} Covers, ${xe.filter(e=>'finished'===e.status).length} finished, ${we.length} no-shows, ${xe.filter(e=>'cancelled'===e.status).length} cancelled`,children:[(0,J.jsxs)(N.T,{size:17,weight:"semibold",children:["That day: ",Se.length," table",1===Se.length?'':'s',De.length?` \xb7 ${De.length} walk-in${1===De.length?'':'s'}`:''," \xb7 ",fe," ",1===fe?'Cover':'Covers']}),(0,J.jsxs)(N.T,{size:16,colour:A.colours.text,children:[xe.filter(e=>'finished'===e.status).length," finished \xb7 ",we.length," no-show",1===we.length?'':'s'," \xb7 ",xe.filter(e=>'cancelled'===e.status).length," cancelled"]}),(0,J.jsx)(N.Muted,{children:"Looking back: read-only. Undo is still there for a mistake made today."})]}):null,(0,J.jsx)(L.default,{testID:"bookings-summary",children:(0,J.jsxs)(N.T,{weight:"semibold",children:[Se.length," table",1===Se.length?'':'s'," booked",De.length?` \xb7 ${De.length} walk-in${1===De.length?'':'s'}`:''," \xb7 ",fe," ",1===fe?'Cover':'Covers']})}),(0,J.jsx)(L.default,{testID:"cancelled-day-tally",accessible:!0,accessibilityLabel:Be,style:{alignItems:'center'},children:(0,J.jsx)(N.T,{size:15,colour:A.colours.muted,center:!0,children:Be})}),(0,J.jsxs)(L.default,{testID:"bookings-actions",style:{flexDirection:'row',flexWrap:'wrap',gap:8},children:[me?null:(0,J.jsx)(I.QuietButton,{label:"New booking",onPress:re.openBooking,testID:"add-booking",disabled:!ue.ok,accessibilityHint:ue.hint}),ne&&ie&&oe===ee?(0,J.jsx)(I.QuietButton,{label:"Walk-in",onPress:re.openWalkIn,testID:"add-walkin",disabled:!ue.ok,accessibilityHint:ue.hint}):null,oe===ee?(0,J.jsx)(B.CloseGardenButton,{quiet:!0,short:!0,rid:C,r:X,now:Z,by:se}):null]}),$e.length?(0,J.jsxs)(L.default,{testID:"pending-requests",style:[N.styles.card,{borderColor:A.colours.amber,gap:8}],children:[(0,J.jsxs)(N.T,{weight:"semibold",colour:A.colours.amber,children:["Needs confirming (",$e.length,")"]}),(0,J.jsx)(N.Muted,{children:"Online requests outside your auto-accept rules. Check the details before confirming."}),$e.map(e=>(0,J.jsxs)(L.default,{style:{gap:6,paddingTop:6,borderTopWidth:1,borderColor:A.colours.border},children:[(0,J.jsxs)(N.T,{weight:"semibold",children:[e.name," \xb7 ",e.partySize," ",1===e.partySize?'Cover':'Covers']}),(0,J.jsxs)(N.Muted,{children:[(0,M.niceDate)((0,M.parseYmd)(e.date))," at ",e.time," \xb7 ",e.ref," \xb7 ",e.phone??'no phone']}),e.notes?(0,J.jsxs)(N.T,{size:16,children:["Notes: ",e.notes]}):null,e.allergies.length?(0,J.jsx)(N.Row,{wrap:!0,gap:4,children:e.allergies.map(e=>(0,J.jsx)(N.Badge,{kind:"red",label:`${(0,O.allergenLabel)(e.allergen)} \xb7 ${(0,O.severityLabel)(e.severity)}`},e.allergen))}):null,(0,J.jsx)(S.NeedsPills,{b:e,r:X}),'staff'!==te&&((0,D.needsHoldOk)(e)||e.date===ee&&e.holdOk&&(e.holds??[]).some(e=>!e.served)&&'seated'===e.status)?(0,J.jsxs)(N.Row,{wrap:!0,gap:6,children:[(0,D.needsHoldOk)(e)?(0,J.jsx)(N.Button,{small:!0,kind:"success",label:"Platter OK",testID:`mgr-platter-ok-${e.ref}`,onPress:()=>(0,S.confirmHolds)(e.id,se)}):null,e.holdOk&&'seated'===e.status?(0,J.jsx)(N.Button,{small:!0,kind:"secondary",label:"Platter served",onPress:()=>(0,S.serveHolds)(e,se,'owner')}):null]}):null,Te===e.id?(0,J.jsxs)(L.default,{style:{gap:6},children:[(0,J.jsxs)(N.T,{size:14,children:["Are you sure? ",e.name.split(' ')[0]," will get a polite \u201csorry, we can\u2019t fit you in\u201d message."]}),(0,J.jsxs)(N.Row,{gap:6,children:[(0,J.jsx)(N.Button,{small:!0,kind:"danger",label:"Yes, decline",onPress:()=>{v.repo.bookings.decide(e.id,'declined',se),Ce(null)}}),(0,J.jsx)(N.Button,{small:!0,kind:"ghost",label:"Keep it",onPress:()=>Ce(null)})]})]}):ue.ok?(0,J.jsxs)(N.Row,{gap:6,children:[(0,J.jsx)(N.Button,{small:!0,label:"Confirm",testID:`confirm-${e.ref}`,onPress:()=>v.repo.bookings.decide(e.id,'confirmed',se)}),(0,J.jsx)(N.Button,{small:!0,kind:"secondary",label:"Decline",onPress:()=>Ce(e.id)}),(0,J.jsx)(Y.WhatsAppGuest,{b:e,rid:C,kind:"change"})]}):(0,J.jsx)(L.default,{accessible:!0,accessibilityLabel:x.BOOKING_VIEW_ONLY,children:(0,J.jsx)(N.T,{children:x.BOOKING_VIEW_ONLY})}),(0,J.jsx)(F.ConfirmTimeline,{refId:e.id})]},e.id))]}):null,0===xe.length?(0,J.jsx)(N.Muted,{children:"No bookings for this day yet."}):null,xe.map(e=>{const s='confirmed'===e.status&&oe===ee&&(0,M.minsBetween)(new Date(`${e.date}T${e.time}:00`),Z)>15,t=(0,w.depositState)(e),l=(0,w.depositBadge)(e,W.gbp);return(0,J.jsxs)(L.default,{testID:(0,$.isSeatedHighlight)((0,D.shownStatus)(e))?`booking-seated-${e.id}`:`booking-row-${e.id}`,style:[N.styles.card,(0,$.isSeatedHighlight)((0,D.shownStatus)(e))?(0,$.seatedHighlightStyle)({borderColor:(0,D.hasAllergens)(e)?A.colours.red:A.colours.goldLight}):{borderColor:(0,D.hasAllergens)(e)?A.colours.red:s?A.colours.amber:A.colours.hairline,opacity:['finished','cancelled'].includes(e.status)?.55:1}],children:[(0,J.jsx)(S.AllergenBar,{b:e}),(0,J.jsxs)(N.Row,{style:{justifyContent:'space-between'},children:[(0,J.jsxs)(N.Row,{gap:6,style:{flex:1,minWidth:0,alignItems:'center'},children:[(0,J.jsxs)(N.T,{weight:"semibold",colour:(0,$.isSeatedHighlight)((0,D.shownStatus)(e))?$.SEATED_FG:A.colours.text,style:{flexShrink:1},children:[e.time," \xb7 ",(0,R.walkInLabel)(e)]}),(0,D.hasAllergens)(e)?(0,J.jsx)(P.AllergyIcon,{text:(0,D.allergenText)(e),size:20,colour:(0,$.isSeatedHighlight)((0,D.shownStatus)(e))?'#7A4A00':A.colours.amber,ink:(0,$.isSeatedHighlight)((0,D.shownStatus)(e))?A.colours.gold:A.colours.bg,testID:`booking-allergy-${e.id}`}):null]}),(0,J.jsx)(N.Badge,{kind:'seated'===(0,D.shownStatus)(e)?'ok':'noshow'===e.status?'red':'confirmed'===e.status?'gold':'pending'===e.status?'amber':'neutral',label:'noshow'===e.status?'No-show':'pending'===e.status?'Needs confirming':(0,D.shownStatus)(e)[0].toUpperCase()+(0,D.shownStatus)(e).slice(1)})]}),l?(0,J.jsx)(y.DepositChip,{b:e,money:!0,big:!0,testID:`deposit-chip-${e.id}`}):null,(0,$.isSeatedHighlight)((0,D.shownStatus)(e))?(0,J.jsxs)(N.T,{size:14,colour:$.SEATED_MUTED,children:[e.table?(0,z.tableCardLabel)(e.table):e.walkIn?'Table to assign':'Table TBC'," \xb7 ",e.ref]}):(0,J.jsxs)(N.Muted,{children:[e.table?(0,z.tableCardLabel)(e.table):e.walkIn?'Table to assign':'Table TBC'," \xb7 ",e.ref]}),e.notes?(0,J.jsxs)(N.T,{size:16,testID:`booking-notes-${e.id}`,children:["Notes: ",e.notes]}):null,l?(0,J.jsxs)(N.Row,{wrap:!0,gap:6,style:{alignItems:'center'},children:[me||!(0,w.canTickDeposit)(e)||['cancelled','finished'].includes(e.status)?null:(0,J.jsx)(N.Button,{small:!0,kind:"secondary",label:"Mark deposit paid",testID:`deposit-paid-${e.id}`,accessibilityLabel:`Mark deposit paid for ${(0,R.walkInLabel)(e)}`,onPress:()=>v.repo.bookings.update(e.id,{depositPaid:e.depositDue??0,depositPaidBy:se,depositPaidAt:(new Date).toISOString()})}),me?null:(0,J.jsx)(j.WixDepositLink,{b:e,rid:C}),'paid'===t&&e.depositPaidBy?(0,J.jsx)(N.Muted,{size:13,children:'Wix deposit link'===e.depositPaidBy?'Paid through a website bookings deposit link':`Ticked by ${e.depositPaidBy}`}):null]}):null,e.walkIn?null:(0,J.jsxs)(N.Muted,{children:[(0,K.bookingSource)(e),e.phone?` \xb7 ${e.phone}`:'',e.email?` \xb7 ${e.email}`:'']}),e.allergies.length?(0,J.jsx)(N.Row,{wrap:!0,gap:4,children:e.allergies.map(e=>(0,J.jsx)(N.Badge,{kind:"red",label:`${(0,O.allergenLabel)(e.allergen)} \xb7 ${(0,O.severityLabel)(e.severity)}`},e.allergen))}):null,(0,D.hasAllergens)(e)&&!['cancelled','noshow'].includes(e.status)?(0,J.jsx)(U.BookingAllergyChain,{b:e,me:se}):null,e.walkIn?null:(0,J.jsx)(F.ConfirmTimeline,{refId:e.id,noPhone:!!e.source&&!e.phone}),s?(0,J.jsxs)(N.T,{size:13,colour:A.colours.amber,children:["Running ",(0,M.minsBetween)(new Date(`${e.date}T${e.time}:00`),Z)," min late. Call them, then mark no-show if needed."]}):null,(0,J.jsxs)(N.Row,{wrap:!0,gap:6,children:[(0,J.jsx)(r.BookingTableButton,{rid:C,booking:e,readOnly:me||!ue.ok,turnBase:X.settings.turnMins}),ue.ok?null:(0,J.jsx)(L.default,{accessible:!0,accessibilityLabel:x.BOOKING_VIEW_ONLY,children:(0,J.jsx)(N.T,{children:x.BOOKING_VIEW_ONLY})}),ue.ok?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(u.BookingEditButton,{rid:C,booking:e,who:se,role:te,inStaffApp:ne,shiftManager:ie}),me||e.table||!['seated','confirmed'].includes(e.status)?null:(0,J.jsx)(N.Button,{small:!e.walkIn,kind:e.walkIn?'primary':'secondary',label:"Assign table",onPress:()=>re.assignTable(e)}),!me&&['seated','confirmed'].includes(e.status)?(0,J.jsx)(N.Button,{small:!0,kind:"secondary",label:(0,z.tablesOf)(e.table).length>1?'Change tables':'Combine tables',testID:`combine-${e.id}`,accessibilityLabel:`${(0,z.tablesOf)(e.table).length>1?'Change tables':'Combine tables'} for ${(0,R.walkInLabel)(e)}`,onPress:()=>re.combineTables(e)}):null,me||'confirmed'!==e.status?null:(0,J.jsxs)(J.Fragment,{children:[e.date===ee?(0,J.jsx)(N.Button,{small:!0,label:"Seat",accessibilityLabel:`Seat ${(0,R.walkInLabel)(e)} now`,onPress:()=>(0,R.seatBookingNow)(C,e)}):null,(0,J.jsx)(N.Button,{small:!0,kind:"secondary",label:"No-show",onPress:()=>v.repo.bookings.setStatus(e.id,'noshow')})]}),me||e.walkIn?null:(0,J.jsx)(d.CancelBookingButton,{rid:C,b:e,name:(0,R.walkInLabel)(e),small:!0,onDone:()=>{}}),me||e.walkIn?null:(0,J.jsx)(d.ReinstateBookingButton,{b:e,name:(0,R.walkInLabel)(e),today:ee}),me||'seated'!==e.status?null:(0,J.jsx)(N.Button,{small:!0,kind:"secondary",label:"Finished",accessibilityLabel:`Finished: ${(0,R.walkInLabel)(e)}, table needs clearing`,onPress:()=>(0,R.finishBookingNow)(C,e)}),['confirmed','pending'].includes(e.status)&&e.date>=ee?(0,J.jsx)(Y.WhatsAppGuest,{b:e,rid:C,kind:"auto"}):null,ne?null:(0,J.jsx)(f.CopyReviewLink,{rid:C,bookingId:e.id}),!me&&e.walkIn?(0,J.jsx)(o.CancelWalkInButton,{rid:C,b:e,small:!0}):null,!me&&e.walkIn?(0,J.jsx)(o.ReinstateWalkInButton,{rid:C,b:e,today:ee,small:!0}):null,(0,J.jsx)(H.BookingUndo,{b:e,rid:C,today:ee,who:(0,R.walkInLabel)(e)})]}):null]}),'noshow'===e.status&&'paid'===t?(0,J.jsx)(N.Muted,{size:13,children:"A deposit was paid. Keep or refund it by your deposit terms (Settings \u203a Advanced \u203a Deposits). Deposits paid through website bookings are refunded in Website bookings \u203a Orders."}):null]},e.id)}),(0,J.jsx)(b.CancellationsSection,{testID:"bookings-cancellations",items:(0,h.cancellationsFor)(le,oe,e=>e.walkIn?`Walk-in ${e.ref}`:(e.name??'').replace(' (example)','')),dayWord:oe===ee?'today':'that day'}),(0,J.jsxs)(N.Card,{children:[(0,J.jsxs)(N.Row,{style:{justifyContent:'space-between'},children:[(0,J.jsx)(N.T,{weight:"semibold",children:"No-shows"}),(0,J.jsx)(N.Badge,{kind:we.length?'red':'ok',label:`${we.length} ${oe===ee?'today':(0,M.niceDate)((0,M.parseYmd)(oe)).slice(0,6)}${je||a.LIVE_VENUE_BUILD?'':' \xb7 4.1% last 28 days (example)'}`})]}),(0,J.jsx)(N.Muted,{children:we.length?`Marked no-show today: ${we.slice(0,6).map(e=>`${e.time} ${(0,R.walkInLabel)(e)}`).join(', ')}${we.length>6?` and ${we.length-6} more`:''}. If they turn up, open the booking and tap Undo no-show.`:'No no-shows today. If a party doesn\u2019t arrive, call them first, then tap No-show on their booking.'})]}),s.IS_GREENSIDE?(0,J.jsx)(t.GreensideCashOnly,{}):(0,J.jsxs)(N.Card,{children:[(0,J.jsx)(N.T,{weight:"semibold",children:"Deposits"}),(0,J.jsx)(N.Muted,{testID:"deposits-card-text",children:(()=>{const e=(0,w.depositOf)(X.settings);return e.on&&e.perPersonPence>0?`Deposits: ${(0,W.gbp)(e.perPersonPence)} per person for parties of ${e.fromParty} or more. Deposits are paid through website bookings. Website bookings show Deposit paid on website bookings by themselves once the guest has paid. For phone and walk-in bookings, tick Deposit paid once the guest has paid you${e.wixLinksOn?', or press Send deposit link':''}.`:'Deposits are off. Turn them on in Settings \u203a Advanced \u203a Deposits.'})()}),(0,J.jsx)(N.Muted,{size:13,children:"Tip: refunds are done in Website bookings \u203a Orders. Booking deposit amounts are visible in Managers, Display and Staff."})]}),ye.length>0||ge?(0,J.jsxs)(L.default,{style:{gap:10},children:[(0,J.jsx)(E.SectionHead,{title:`Waitlist (${ye.length})`,sub:`New party waits about ${(0,_.estimateWait)(ye.length+1,X.settings.turnMins,1)} min (estimate)`}),ye.map((e,s)=>(0,J.jsxs)(L.default,{style:N.styles.card,children:[(0,J.jsxs)(N.Row,{style:{justifyContent:'space-between'},children:[(0,J.jsxs)(N.T,{weight:"semibold",children:["#",e.number," ",e.name," \xb7 ",e.partySize]}),(0,J.jsxs)(N.Muted,{children:[(0,M.minsBetween)(new Date(e.joinedAt),Z)," min \xb7 est. ",(0,_.estimateWait)(s+1,X.settings.turnMins,1)," min"]})]}),'notified'===e.status?(0,J.jsx)(N.Badge,{kind:"ok",label:"Marked as told: table ready (no text is sent)"}):null,(0,J.jsxs)(N.Row,{gap:6,children:['waiting'===e.status?(0,J.jsx)(N.Button,{small:!0,kind:"secondary",label:"Notify",onPress:()=>v.repo.waitlist.setStatus(e.id,'notified')}):null,(0,J.jsx)(N.Button,{small:!0,label:"Seat",onPress:()=>v.repo.waitlist.setStatus(e.id,'seated')}),(0,J.jsx)(N.Button,{small:!0,kind:"ghost",label:"Remove",onPress:()=>v.repo.waitlist.setStatus(e.id,'removed')})]})]},e.id)),(0,J.jsxs)(N.Row,{gap:6,children:[(0,J.jsx)(i.TextInput,{accessibilityLabel:"Waitlist name",placeholder:"Name for the waitlist",placeholderTextColor:"#7D776C",value:ce,onChangeText:he,style:[N.styles.input,{flex:1}]}),(0,J.jsx)(N.Stepper,{value:pe,onChange:ke,min:1,max:12,label:"party"})]}),(0,J.jsx)(N.Button,{kind:"secondary",label:"Add to waitlist",disabled:ce.trim().length<2,onPress:()=>{v.repo.waitlist.join(C,ce.trim(),pe),he('')}})]}):(0,J.jsx)(N.Button,{kind:"ghost",label:"Open waitlist",onPress:()=>be(!0),accessibilityLabel:"Open the empty waitlist to add a waiting party"}),re.elements]})};var e,s=_r(_d[0]),t=_r(_d[1]),l=_r(_d[2]),n=_r(_d[3]),i=_r(_d[4]),a=_r(_d[5]),o=_r(_d[6]),d=_r(_d[7]),r=_r(_d[8]),u=_r(_d[9]),c=_r(_d[10]),h=_r(_d[11]),b=_r(_d[12]),p=_r(_d[13]),k=_r(_d[14]),x=_r(_d[15]),y=_r(_d[16]),w=_r(_d[17]),j=_r(_d[18]),f=_r(_d[19]),I=_r(_d[20]),B=_r(_d[21]),S=_r(_d[22]),D=_r(_d[23]),$=_r(_d[24]),T=_r(_d[25]),C=_r(_d[26]),L=(e=C)&&e.__esModule?e:{default:e},N=_r(_d[27]),P=_r(_d[28]),v=_r(_d[29]),O=_r(_d[30]),W=_r(_d[31]),M=_r(_d[32]),_=_r(_d[33]),A=_r(_d[34]),E=_r(_d[35]),R=_r(_d[36]),z=_r(_d[37]),H=_r(_d[38]),G=_r(_d[39]),U=_r(_d[40]),F=_r(_d[41]),K=_r(_d[42]),V=_r(_d[43]),Y=_r(_d[44]),q=_r(_d[45]),Q=_r(_d[46]),J=_r(_d[47])},1351,[5,1349,11,1352,796,806,1112,1113,1091,1115,1114,1323,1324,1100,1277,1012,1089,14,1353,1176,1354,1311,1081,1075,1090,34,102,794,1286,848,830,836,827,1262,840,1147,1096,1014,1355,1356,1136,1357,1167,985,1149,1319,852,25]); +__d(function(g,_r,_i,_a,m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.Bookings=function({go:e}={}){const{rid:L,r:Z,now:ee,today:se,me:te,role:le}=(0,k.useCtx)(1e4),ne=(0,O.useBookings)(L),ie=(0,k.useInStaffApp)(),ae=(0,k.useShiftManager)(),oe=(0,O.useWaitlist)(L),[de,re]=((0,O.useStore)(e=>e.alertAcks),(0,C.useState)(se)),ue=(0,z.useFrontDoor)(de),ce=(0,x.useBookingWrite)(),[he,ge]=(0,C.useState)(''),[be,pe]=(0,C.useState)(!1),[ke,me]=(0,C.useState)(2),xe=dee.date===de).sort((e,s)=>e.time.localeCompare(s.time)),we=oe.filter(e=>'waiting'===e.status||'notified'===e.status).sort((e,s)=>e.number-s.number),je=ye.filter(e=>'noshow'===e.status),fe=(0,Y.useSync)(e=>!!e.venueId&&'guest'!==e.kind),Ie=ye.filter(e=>'cancelled'!==e.status).reduce((e,s)=>e+s.partySize,0),Be=(0,h.cancelledDayTally)(ne,de),De=(0,h.cancelledTallyWords)(Be,de===se?'today':'that day'),Se=ye.filter(e=>!e.walkIn),$e=ye.filter(e=>e.walkIn),Te=ne.filter(e=>'pending'===e.status&&e.date>=se).sort((e,s)=>(e.date+e.time).localeCompare(s.date+s.time)),[Ce,Le]=(0,C.useState)(null),Ne=(0,E.parseYmd)(de);Ne.setHours(12);const Pe=(0,J.hoursFor)(Z,Ne),ve=Pe?.open??new Date(`${de}T12:00:00`),Oe=Pe?.close??new Date(`${de}T21:00:00`),We=Pe||ye.length?xe?'No one seated that day':de===se?'No bookings yet today':'No bookings yet':de===se?'Closed today':'Closed that day';return(0,X.jsxs)(N.default,{style:{gap:12},children:[e&&!ie&&'staff'!==le?(0,X.jsx)(P.Button,{testID:"bookings-dashboard-top",label:"Bookings dashboard",accessibilityLabel:"Open Bookings dashboard: table plan, Timeline, today's guests and Covers",onPress:()=>e('more','serviceboard'),style:{width:'100%',minHeight:60}}):null,s.IS_WILDINGS||(s.IS_QUEUED_VENUE||s.IS_KIRKTON||s.IS_GREENSIDE||'abbotsford'===L)&&!ie&&'staff'!==le?(0,X.jsx)(n.VenueRequestList,{rid:L,kind:"table"}):null,!s.IS_WILDINGS&&!Z.settings.hotel?.enabled||ie||'staff'===le?null:(0,X.jsx)(n.VenueRequestList,{rid:L,kind:"room",hotel:Z.settings.hotel??l.WILDINGS_HOTEL}),(0,X.jsx)(U.BookingsDayNav,{today:se,date:de,onDate:re,count:e=>ne.filter(s=>s.date===e&&'cancelled'!==s.status).length,sub:e=>{const s=ne.filter(s=>s.date===e&&'cancelled'!==s.status&&!s.walkIn),t=s.reduce((e,s)=>e+s.partySize,0);return`${s.length} ${1===s.length?'table':'tables'} \xb7 ${t} ${1===t?'Cover':'Covers'}`}}),(0,X.jsx)(N.default,{testID:"bookings-day-graph",style:{overflow:'visible'},children:(0,X.jsx)(Q.DayGraph,{bare:!0,fill:!0,todays:ye,open:ve,close:Oe,now:ee,turnBase:Z.settings.turnMins,height:128,past:xe,closed:!Pe,emptyText:We})}),xe?(0,X.jsxs)(N.default,{testID:"bookings-past-totals",style:[P.styles.card,{gap:4}],accessible:!0,accessibilityLabel:`${(0,U.longDay)(de)}: ${Se.length} tables, ${Ie} Covers, ${ye.filter(e=>'finished'===e.status).length} finished, ${je.length} no-shows, ${ye.filter(e=>'cancelled'===e.status).length} cancelled`,children:[(0,X.jsxs)(P.T,{size:17,weight:"semibold",children:["That day: ",Se.length," table",1===Se.length?'':'s',$e.length?` \xb7 ${$e.length} walk-in${1===$e.length?'':'s'}`:''," \xb7 ",Ie," ",1===Ie?'Cover':'Covers']}),(0,X.jsxs)(P.T,{size:16,colour:A.colours.text,children:[ye.filter(e=>'finished'===e.status).length," finished \xb7 ",je.length," no-show",1===je.length?'':'s'," \xb7 ",ye.filter(e=>'cancelled'===e.status).length," cancelled"]}),(0,X.jsx)(P.Muted,{children:"Looking back: read-only. Undo is still there for a mistake made today."})]}):null,(0,X.jsx)(N.default,{testID:"bookings-summary",children:(0,X.jsxs)(P.T,{weight:"semibold",children:[Se.length," table",1===Se.length?'':'s'," booked",$e.length?` \xb7 ${$e.length} walk-in${1===$e.length?'':'s'}`:''," \xb7 ",Ie," ",1===Ie?'Cover':'Covers']})}),(0,X.jsx)(N.default,{testID:"cancelled-day-tally",accessible:!0,accessibilityLabel:De,style:{alignItems:'center'},children:(0,X.jsx)(P.T,{size:15,colour:A.colours.muted,center:!0,children:De})}),(0,X.jsxs)(N.default,{testID:"bookings-actions",style:{flexDirection:'row',flexWrap:'wrap',gap:8},children:[xe?null:(0,X.jsx)(B.QuietButton,{label:"New booking",onPress:ue.openBooking,testID:"add-booking",disabled:!ce.ok,accessibilityHint:ce.hint}),ie&&ae&&de===se?(0,X.jsx)(B.QuietButton,{label:"Walk-in",onPress:ue.openWalkIn,testID:"add-walkin",disabled:!ce.ok,accessibilityHint:ce.hint}):null,de===se?(0,X.jsx)(D.CloseGardenButton,{quiet:!0,short:!0,rid:L,r:Z,now:ee,by:te}):null]}),Te.length?(0,X.jsxs)(N.default,{testID:"pending-requests",style:[P.styles.card,{borderColor:A.colours.amber,gap:8}],children:[(0,X.jsxs)(P.T,{weight:"semibold",colour:A.colours.amber,children:["Needs confirming (",Te.length,")"]}),(0,X.jsx)(P.Muted,{children:"Online requests outside your auto-accept rules. Check the details before confirming."}),Te.map(e=>(0,X.jsxs)(N.default,{style:{gap:6,paddingTop:6,borderTopWidth:1,borderColor:A.colours.border},children:[(0,X.jsxs)(P.T,{weight:"semibold",children:[e.name," \xb7 ",e.partySize," ",1===e.partySize?'Cover':'Covers']}),(0,X.jsxs)(P.Muted,{children:[(0,E.niceDate)((0,E.parseYmd)(e.date))," at ",e.time," \xb7 ",e.ref," \xb7 ",e.phone??'no phone']}),e.notes?(0,X.jsxs)(P.T,{size:16,children:["Notes: ",e.notes]}):null,e.allergies.length?(0,X.jsx)(P.Row,{wrap:!0,gap:4,children:e.allergies.map(e=>(0,X.jsx)(P.Badge,{kind:"red",label:`${(0,W.allergenLabel)(e.allergen)} \xb7 ${(0,W.severityLabel)(e.severity)}`},e.allergen))}):null,(0,X.jsx)(S.NeedsPills,{b:e,r:Z}),'staff'!==le&&((0,$.needsHoldOk)(e)||e.date===se&&e.holdOk&&(e.holds??[]).some(e=>!e.served)&&'seated'===e.status)?(0,X.jsxs)(P.Row,{wrap:!0,gap:6,children:[(0,$.needsHoldOk)(e)?(0,X.jsx)(P.Button,{small:!0,kind:"success",label:"Platter OK",testID:`mgr-platter-ok-${e.ref}`,onPress:()=>(0,S.confirmHolds)(e.id,te)}):null,e.holdOk&&'seated'===e.status?(0,X.jsx)(P.Button,{small:!0,kind:"secondary",label:"Platter served",onPress:()=>(0,S.serveHolds)(e,te,'owner')}):null]}):null,Ce===e.id?(0,X.jsxs)(N.default,{style:{gap:6},children:[(0,X.jsxs)(P.T,{size:14,children:["Are you sure? ",e.name.split(' ')[0]," will get a polite \u201csorry, we can\u2019t fit you in\u201d message."]}),(0,X.jsxs)(P.Row,{gap:6,children:[(0,X.jsx)(P.Button,{small:!0,kind:"danger",label:"Yes, decline",onPress:()=>{O.repo.bookings.decide(e.id,'declined',te),Le(null)}}),(0,X.jsx)(P.Button,{small:!0,kind:"ghost",label:"Keep it",onPress:()=>Le(null)})]})]}):ce.ok?(0,X.jsxs)(P.Row,{gap:6,children:[(0,X.jsx)(P.Button,{small:!0,label:"Confirm",testID:`confirm-${e.ref}`,onPress:()=>O.repo.bookings.decide(e.id,'confirmed',te)}),(0,X.jsx)(P.Button,{small:!0,kind:"secondary",label:"Decline",onPress:()=>Le(e.id)}),(0,X.jsx)(q.WhatsAppGuest,{b:e,rid:L,kind:"change"})]}):(0,X.jsx)(N.default,{accessible:!0,accessibilityLabel:y.BOOKING_VIEW_ONLY,children:(0,X.jsx)(P.T,{children:y.BOOKING_VIEW_ONLY})}),(0,X.jsx)(K.ConfirmTimeline,{refId:e.id})]},e.id))]}):null,0===ye.length?(0,X.jsx)(P.Muted,{children:"No bookings for this day yet."}):null,ye.map(e=>{const s='confirmed'===e.status&&de===se&&(0,E.minsBetween)(new Date(`${e.date}T${e.time}:00`),ee)>15,t=(0,j.depositState)(e),l=(0,j.depositBadge)(e,M.gbp);return(0,X.jsxs)(N.default,{testID:(0,T.isSeatedHighlight)((0,$.shownStatus)(e))?`booking-seated-${e.id}`:`booking-row-${e.id}`,style:[P.styles.card,(0,T.isSeatedHighlight)((0,$.shownStatus)(e))?(0,T.seatedHighlightStyle)({borderColor:(0,$.hasAllergens)(e)?A.colours.red:A.colours.goldLight}):{borderColor:(0,$.hasAllergens)(e)?A.colours.red:s?A.colours.amber:A.colours.hairline,opacity:['finished','cancelled'].includes(e.status)?.55:1}],children:[(0,X.jsx)(S.AllergenBar,{b:e}),(0,X.jsxs)(P.Row,{style:{justifyContent:'space-between'},children:[(0,X.jsxs)(P.Row,{gap:6,style:{flex:1,minWidth:0,alignItems:'center'},children:[(0,X.jsxs)(P.T,{weight:"semibold",colour:(0,T.isSeatedHighlight)((0,$.shownStatus)(e))?T.SEATED_FG:A.colours.text,style:{flexShrink:1},children:[e.time," \xb7 ",(0,z.walkInLabel)(e)]}),(0,$.hasAllergens)(e)?(0,X.jsx)(v.AllergyIcon,{text:(0,$.allergenText)(e),size:20,colour:(0,T.isSeatedHighlight)((0,$.shownStatus)(e))?'#7A4A00':A.colours.amber,ink:(0,T.isSeatedHighlight)((0,$.shownStatus)(e))?A.colours.gold:A.colours.bg,testID:`booking-allergy-${e.id}`}):null]}),(0,X.jsx)(P.Badge,{kind:'seated'===(0,$.shownStatus)(e)?'ok':'noshow'===e.status?'red':'confirmed'===e.status?'gold':'pending'===e.status?'amber':'neutral',label:'noshow'===e.status?'No-show':'pending'===e.status?'Needs confirming':(0,$.shownStatus)(e)[0].toUpperCase()+(0,$.shownStatus)(e).slice(1)})]}),l?(0,X.jsx)(w.DepositChip,{b:e,money:!0,big:!0,testID:`deposit-chip-${e.id}`}):null,(0,T.isSeatedHighlight)((0,$.shownStatus)(e))?(0,X.jsxs)(P.T,{size:14,colour:T.SEATED_MUTED,children:[e.table?(0,H.tableCardLabel)(e.table):e.walkIn?'Table to assign':'Table TBC'," \xb7 ",e.ref]}):(0,X.jsxs)(P.Muted,{children:[e.table?(0,H.tableCardLabel)(e.table):e.walkIn?'Table to assign':'Table TBC'," \xb7 ",e.ref]}),e.notes?(0,X.jsxs)(P.T,{size:16,testID:`booking-notes-${e.id}`,children:["Notes: ",e.notes]}):null,(0,c.bookingExtras)(e)?(0,X.jsx)(P.T,{size:15,testID:`booking-extras-${e.id}`,children:(0,c.bookingExtras)(e)}):null,(0,c.historyLines)(e)[0]?(0,X.jsxs)(P.Muted,{size:13,testID:`booking-last-change-${e.id}`,children:["Last change: ",(0,c.historyLines)(e)[0]]}):null,l?(0,X.jsxs)(P.Row,{wrap:!0,gap:6,style:{alignItems:'center'},children:[xe||!(0,j.canTickDeposit)(e)||['cancelled','finished'].includes(e.status)?null:(0,X.jsx)(P.Button,{small:!0,kind:"secondary",label:"Mark deposit paid",testID:`deposit-paid-${e.id}`,accessibilityLabel:`Mark deposit paid for ${(0,z.walkInLabel)(e)}`,onPress:()=>O.repo.bookings.update(e.id,{depositPaid:e.depositDue??0,depositPaidBy:te,depositPaidAt:(new Date).toISOString()})}),xe?null:(0,X.jsx)(f.WixDepositLink,{b:e,rid:L}),'paid'===t&&e.depositPaidBy?(0,X.jsx)(P.Muted,{size:13,children:'Wix deposit link'===e.depositPaidBy?'Paid through a website bookings deposit link':`Ticked by ${e.depositPaidBy}`}):null]}):null,e.walkIn?null:(0,X.jsxs)(P.Muted,{children:[(0,V.bookingSource)(e),e.phone?` \xb7 ${e.phone}`:'',e.email?` \xb7 ${e.email}`:'']}),e.allergies.length?(0,X.jsx)(P.Row,{wrap:!0,gap:4,children:e.allergies.map(e=>(0,X.jsx)(P.Badge,{kind:"red",label:`${(0,W.allergenLabel)(e.allergen)} \xb7 ${(0,W.severityLabel)(e.severity)}`},e.allergen))}):null,(0,$.hasAllergens)(e)&&!['cancelled','noshow'].includes(e.status)?(0,X.jsx)(F.BookingAllergyChain,{b:e,me:te}):null,e.walkIn?null:(0,X.jsx)(K.ConfirmTimeline,{refId:e.id,noPhone:!!e.source&&!e.phone}),s?(0,X.jsxs)(P.T,{size:13,colour:A.colours.amber,children:["Running ",(0,E.minsBetween)(new Date(`${e.date}T${e.time}:00`),ee)," min late. Call them, then mark no-show if needed."]}):null,ce.ok?(0,X.jsx)(u.BookingEditButton,{rid:L,booking:e,who:te,role:le,inStaffApp:ie,shiftManager:ae,big:!0,testID:`edit-booking-${e.id}`}):null,(0,X.jsxs)(P.Row,{wrap:!0,gap:6,children:[(0,X.jsx)(r.BookingTableButton,{rid:L,booking:e,readOnly:xe||!ce.ok,turnBase:Z.settings.turnMins}),ce.ok?null:(0,X.jsx)(N.default,{accessible:!0,accessibilityLabel:y.BOOKING_VIEW_ONLY,children:(0,X.jsx)(P.T,{children:y.BOOKING_VIEW_ONLY})}),ce.ok?(0,X.jsxs)(X.Fragment,{children:[xe||e.table||!['seated','confirmed'].includes(e.status)?null:(0,X.jsx)(P.Button,{small:!e.walkIn,kind:e.walkIn?'primary':'secondary',label:"Assign table",onPress:()=>ue.assignTable(e)}),!xe&&['seated','confirmed'].includes(e.status)?(0,X.jsx)(P.Button,{small:!0,kind:"secondary",label:(0,H.tablesOf)(e.table).length>1?'Change tables':'Combine tables',testID:`combine-${e.id}`,accessibilityLabel:`${(0,H.tablesOf)(e.table).length>1?'Change tables':'Combine tables'} for ${(0,z.walkInLabel)(e)}`,onPress:()=>ue.combineTables(e)}):null,xe||'confirmed'!==e.status?null:(0,X.jsxs)(X.Fragment,{children:[e.date===se?(0,X.jsx)(P.Button,{small:!0,label:"Seat",accessibilityLabel:`Seat ${(0,z.walkInLabel)(e)} now`,onPress:()=>(0,z.seatBookingNow)(L,e)}):null,(0,X.jsx)(P.Button,{small:!0,kind:"secondary",label:"No-show",onPress:()=>O.repo.bookings.setStatus(e.id,'noshow')})]}),xe||e.walkIn?null:(0,X.jsx)(d.CancelBookingButton,{rid:L,b:e,name:(0,z.walkInLabel)(e),small:!0,onDone:()=>{}}),xe||e.walkIn?null:(0,X.jsx)(d.ReinstateBookingButton,{b:e,name:(0,z.walkInLabel)(e),today:se}),xe||'seated'!==e.status?null:(0,X.jsx)(P.Button,{small:!0,kind:"secondary",label:"Finished",accessibilityLabel:`Finished: ${(0,z.walkInLabel)(e)}, table needs clearing`,onPress:()=>(0,z.finishBookingNow)(L,e)}),['confirmed','pending'].includes(e.status)&&e.date>=se?(0,X.jsx)(q.WhatsAppGuest,{b:e,rid:L,kind:"auto"}):null,ie?null:(0,X.jsx)(I.CopyReviewLink,{rid:L,bookingId:e.id}),!xe&&e.walkIn?(0,X.jsx)(o.CancelWalkInButton,{rid:L,b:e,small:!0}):null,!xe&&e.walkIn?(0,X.jsx)(o.ReinstateWalkInButton,{rid:L,b:e,today:se,small:!0}):null,(0,X.jsx)(G.BookingUndo,{b:e,rid:L,today:se,who:(0,z.walkInLabel)(e)})]}):null]}),'noshow'===e.status&&'paid'===t?(0,X.jsx)(P.Muted,{size:13,children:"A deposit was paid. Keep or refund it by your deposit terms (Settings \u203a Advanced \u203a Deposits). Deposits paid through website bookings are refunded in Website bookings \u203a Orders."}):null]},e.id)}),(0,X.jsx)(p.CancellationsSection,{testID:"bookings-cancellations",items:(0,b.cancellationsFor)(ne,de,e=>e.walkIn?`Walk-in ${e.ref}`:(e.name??'').replace(' (example)','')),dayWord:de===se?'today':'that day'}),(0,X.jsxs)(P.Card,{children:[(0,X.jsxs)(P.Row,{style:{justifyContent:'space-between'},children:[(0,X.jsx)(P.T,{weight:"semibold",children:"No-shows"}),(0,X.jsx)(P.Badge,{kind:je.length?'red':'ok',label:`${je.length} ${de===se?'today':(0,E.niceDate)((0,E.parseYmd)(de)).slice(0,6)}${fe||a.LIVE_VENUE_BUILD?'':' \xb7 4.1% last 28 days (example)'}`})]}),(0,X.jsx)(P.Muted,{children:je.length?`Marked no-show today: ${je.slice(0,6).map(e=>`${e.time} ${(0,z.walkInLabel)(e)}`).join(', ')}${je.length>6?` and ${je.length-6} more`:''}. If they turn up, open the booking and tap Undo no-show.`:'No no-shows today. If a party doesn\u2019t arrive, call them first, then tap No-show on their booking.'})]}),s.IS_GREENSIDE?(0,X.jsx)(t.GreensideCashOnly,{}):(0,X.jsxs)(P.Card,{children:[(0,X.jsx)(P.T,{weight:"semibold",children:"Deposits"}),(0,X.jsx)(P.Muted,{testID:"deposits-card-text",children:(()=>{const e=(0,j.depositOf)(Z.settings);return e.on&&e.perPersonPence>0?`Deposits: ${(0,M.gbp)(e.perPersonPence)} per person for parties of ${e.fromParty} or more. Deposits are paid through website bookings. Website bookings show Deposit paid on website bookings by themselves once the guest has paid. For phone and walk-in bookings, tick Deposit paid once the guest has paid you${e.wixLinksOn?', or press Send deposit link':''}.`:'Deposits are off. Turn them on in Settings \u203a Advanced \u203a Deposits.'})()}),(0,X.jsx)(P.Muted,{size:13,children:"Tip: refunds are done in Website bookings \u203a Orders. Booking deposit amounts are visible in Managers, Display and Staff."})]}),we.length>0||be?(0,X.jsxs)(N.default,{style:{gap:10},children:[(0,X.jsx)(R.SectionHead,{title:`Waitlist (${we.length})`,sub:`New party waits about ${(0,_.estimateWait)(we.length+1,Z.settings.turnMins,1)} min (estimate)`}),we.map((e,s)=>(0,X.jsxs)(N.default,{style:P.styles.card,children:[(0,X.jsxs)(P.Row,{style:{justifyContent:'space-between'},children:[(0,X.jsxs)(P.T,{weight:"semibold",children:["#",e.number," ",e.name," \xb7 ",e.partySize]}),(0,X.jsxs)(P.Muted,{children:[(0,E.minsBetween)(new Date(e.joinedAt),ee)," min \xb7 est. ",(0,_.estimateWait)(s+1,Z.settings.turnMins,1)," min"]})]}),'notified'===e.status?(0,X.jsx)(P.Badge,{kind:"ok",label:"Marked as told: table ready (no text is sent)"}):null,(0,X.jsxs)(P.Row,{gap:6,children:['waiting'===e.status?(0,X.jsx)(P.Button,{small:!0,kind:"secondary",label:"Notify",onPress:()=>O.repo.waitlist.setStatus(e.id,'notified')}):null,(0,X.jsx)(P.Button,{small:!0,label:"Seat",onPress:()=>O.repo.waitlist.setStatus(e.id,'seated')}),(0,X.jsx)(P.Button,{small:!0,kind:"ghost",label:"Remove",onPress:()=>O.repo.waitlist.setStatus(e.id,'removed')})]})]},e.id)),(0,X.jsxs)(P.Row,{gap:6,children:[(0,X.jsx)(i.TextInput,{accessibilityLabel:"Waitlist name",placeholder:"Name for the waitlist",placeholderTextColor:"#7D776C",value:he,onChangeText:ge,style:[P.styles.input,{flex:1}]}),(0,X.jsx)(P.Stepper,{value:ke,onChange:me,min:1,max:12,label:"party"})]}),(0,X.jsx)(P.Button,{kind:"secondary",label:"Add to waitlist",disabled:he.trim().length<2,onPress:()=>{O.repo.waitlist.join(L,he.trim(),ke),ge('')}})]}):(0,X.jsx)(P.Button,{kind:"ghost",label:"Open waitlist",onPress:()=>pe(!0),accessibilityLabel:"Open the empty waitlist to add a waiting party"}),ue.elements]})};var e,s=_r(_d[0]),t=_r(_d[1]),l=_r(_d[2]),n=_r(_d[3]),i=_r(_d[4]),a=_r(_d[5]),o=_r(_d[6]),d=_r(_d[7]),r=_r(_d[8]),u=_r(_d[9]),c=_r(_d[10]),h=_r(_d[11]),b=_r(_d[12]),p=_r(_d[13]),k=_r(_d[14]),x=_r(_d[15]),y=_r(_d[16]),w=_r(_d[17]),j=_r(_d[18]),f=_r(_d[19]),I=_r(_d[20]),B=_r(_d[21]),D=_r(_d[22]),S=_r(_d[23]),$=_r(_d[24]),T=_r(_d[25]),C=_r(_d[26]),L=_r(_d[27]),N=(e=L)&&e.__esModule?e:{default:e},P=_r(_d[28]),v=_r(_d[29]),O=_r(_d[30]),W=_r(_d[31]),M=_r(_d[32]),E=_r(_d[33]),_=_r(_d[34]),A=_r(_d[35]),R=_r(_d[36]),z=_r(_d[37]),H=_r(_d[38]),G=_r(_d[39]),U=_r(_d[40]),F=_r(_d[41]),K=_r(_d[42]),V=_r(_d[43]),Y=_r(_d[44]),q=_r(_d[45]),Q=_r(_d[46]),J=_r(_d[47]),X=_r(_d[48])},1351,[5,1349,11,1352,796,806,1112,1113,1091,1115,1111,1114,1323,1324,1100,1277,1012,1089,14,1353,1176,1354,1311,1081,1075,1090,34,102,794,1286,848,830,836,827,1262,840,1147,1096,1014,1355,1356,1136,1357,1167,985,1149,1319,852,25]); __d(function(g,_r,i,a,m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.VenueRequestList=function({rid:e,kind:n,hotel:c}){const y=(0,r.useSync)(),p='staff'===y.kind&&y.venueSlug===(0,s.queuedDatabaseSlug)(e)&&!!y.venueId&&(!['greenside','kirkton','abbotsford'].includes(e)&&!(0,s.isQueuedVenue)(e)||y.perms.includes('*')||y.perms.includes('venue.settings')),f=p&&(y.perms.includes('*')||y.perms.includes('room'===n||(0,s.isQueuedVenue)(e)||['greenside','kirkton','abbotsford'].includes(e)?'venue.settings':'bookings.manage')),[h,b]=(0,t.useState)([]),[j,q]=(0,t.useState)(''),[x,k]=(0,t.useState)(null),v=(0,t.useCallback)(async()=>{if(p)try{b(await(0,o.listVenueRequests)(y.venueId,n)),q('')}catch(e){q((0,o.requestMessage)(e))}},[p,n,y.venueId]);(0,t.useEffect)(()=>{const e=setTimeout(()=>{v()},0),s=setInterval(()=>{v()},15e3);return()=>{clearTimeout(e),clearInterval(s)}},[v]);const T=h.filter(e=>e.venue_id===y.venueId);if(!p)return null;const I=async(e,s)=>{if(!x){k(e);try{await(0,o.decideVenueRequest)(e,s),await v()}catch(e){q((0,o.requestMessage)(e))}finally{k(null)}}};return(0,u.jsxs)(d.default,{testID:`venue-${n}-requests`,style:{gap:12,alignItems:'stretch'},children:[(0,u.jsx)(l.H2,{children:'room'===n?'Room requests':'Table requests'}),(0,u.jsx)(l.T,{center:!0,children:"Requested bookings need a staff decision. No email or text is sent. Contact the guest to confirm arrangements."}),(0,u.jsx)(l.Button,{kind:"secondary",label:`Refresh ${n} requests`,onPress:()=>{v()}}),j?(0,u.jsx)(l.Banner,{kind:"warn",title:"Requests",children:j}):null,T.length||j?null:(0,u.jsxs)(l.T,{center:!0,children:["No ",n," requests yet."]}),T.map(e=>(0,u.jsx)(l.Card,{style:{alignItems:'stretch'},children:(0,u.jsxs)(d.default,{testID:`venue-request-${e.id}`,style:{gap:10},children:[(0,u.jsxs)(l.Row,{wrap:!0,children:[(0,u.jsx)(l.T,{weight:"semibold",children:e.payload.name}),(0,u.jsx)(l.Badge,{kind:'requested'===e.status?'amber':'confirmed'===e.status?'ok':'neutral',label:'requested'===e.status?'Requested':'confirmed'===e.status?'Confirmed':'Declined'})]}),(0,u.jsx)(l.T,{children:'table'===n?`${e.payload.date} \xb7 ${e.payload.service?e.payload.service+' \xb7 ':''}${e.payload.time} \xb7 ${e.payload.covers} Covers`:`${e.payload.checkIn} to ${e.payload.checkOut} \xb7 ${c?.roomTypes.find(s=>s.id===e.payload.roomType)?.name||e.payload.roomType} \xb7 ${e.payload.guests} guests`}),'room'===n?(0,u.jsxs)(l.T,{children:["Add dinner: ",e.payload.addDinner?'Yes \u2014 arrange with guest':'No']}):null,(0,u.jsxs)(l.T,{children:[e.payload.phone," \xb7 ",e.payload.email]}),e.payload.notes?(0,u.jsxs)(l.T,{children:["Notes: ",e.payload.notes]}):null,'requested'===e.status&&f?(0,u.jsxs)(l.Row,{wrap:!0,children:[(0,u.jsx)(l.Button,{label:x===e.id?'Saving\u2026':'Confirm',testID:`request-confirm-${e.id}`,disabled:!!x,onPress:()=>{I(e.id,'confirmed')}}),(0,u.jsx)(l.Button,{label:"Decline",kind:"secondary",testID:`request-decline-${e.id}`,disabled:!!x,onPress:()=>{I(e.id,'declined')}})]}):null,e.booking_id?(0,u.jsx)(l.T,{children:"Confirmed table booking is in the bookings list."}):null]})},e.id))]})};var e,s=_r(_d[0]),t=_r(_d[1]),n=_r(_d[2]),d=(e=n)&&e.__esModule?e:{default:e},l=_r(_d[3]),r=_r(_d[4]),o=_r(_d[5]),u=_r(_d[6])},1352,[6,34,102,794,985,1208,25]); __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,"untilWords",{enumerable:!0,get:function(){return w}}),_e.WixDepositLink=function({b:e,rid:x}){const f=(0,r.useRestaurant)(x),[S,j]=(0,s.useState)(!1),[C,D]=(0,s.useState)(!1),[L,I]=(0,s.useState)(null),[$,v]=(0,s.useState)(''),[P,T]=(0,s.useState)(''),[A,_]=(0,s.useState)(''),M=(0,c.depositOf)(f?.settings),O=e;if(n.IS_ISOLATED_VENUE||['souters','kirkmichael','wildings'].includes(x)||!f||!(0,c.canSendDepositLink)(O,M))return null;const B='open'===O.depositLink?.state,R=async()=>{j(!0),D(!0),T(''),I(null);try{const{data:t,error:n}=await(0,h.getSupabase)().functions.invoke('wix-deposit-link',{body:{booking_id:e.id}});if(n||!t)return void T(y);if(!t.ok||!t.url)return void T(t.off?y:String(t.error??y));const s={url:t.url,amountPence:t.amountPence,expiresAt:t.expiresAt};I(s),v((0,c.depositLinkMessage)({name:e.name,venue:f.name,partySize:e.partySize,date:e.date,time:e.time,amountPence:s.amountPence,url:s.url,expiresAt:s.expiresAt,terms:(0,c.depositTerms)(M)}))}catch{T(y)}finally{D(!1)}},W=async()=>{_('Checking\u2026');try{const{data:t,error:n}=await(0,h.getSupabase)().functions.invoke('wix-deposit-check',{body:{booking_id:e.id}});_(n||!t||t.off?'Website bookings deposit links are switched off, so nothing was checked.':'Checked with website bookings. If the guest has paid, the badge shows Deposit paid on website bookings.')}catch{_('Could not reach website bookings. Try again in a minute.')}},z=L?(0,k.waMeLink)(e.phone,$):null,E=L&&e.phone?(0,p.smsLink)(e.phone,$):null,U=L&&e.email?`mailto:${encodeURIComponent(e.email)}?subject=${encodeURIComponent(`${f.name} deposit`)}&body=${encodeURIComponent($)}`:null,F='undefined'!=typeof navigator&&!!navigator.clipboard,G=e=>{e&&o.default.openURL(e).catch(()=>{})};return(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(d.Button,{small:!0,kind:"secondary",label:B?'Send deposit link again':'Send deposit link',testID:`deposit-link-${e.id}`,accessibilityLabel:`${B?'Send the deposit link again to':'Send a website bookings deposit link to'} ${e.name}`,onPress:()=>{R()}}),B?(0,g.jsx)(d.Button,{small:!0,kind:"secondary",label:"Check if paid",testID:`deposit-check-${e.id}`,accessibilityLabel:`Check with website bookings if ${e.name} has paid the deposit`,onPress:()=>{W()}}):null,A?(0,g.jsx)(d.Muted,{size:13,children:A}):null,(0,g.jsx)(d.Sheet,{visible:S,onClose:()=>j(!1),title:"Send deposit link",testID:`deposit-link-sheet-${e.id}`,children:(0,g.jsxs)(l.default,{style:{gap:10},children:[C?(0,g.jsx)(d.T,{children:"Asking website bookings for the link\u2026"}):null,P?(0,g.jsx)(d.T,{colour:b.colours.amber,testID:"deposit-link-error",children:P}):null,L?(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(d.T,{weight:"semibold",children:`Deposit ${(0,u.gbp)(L.amountPence)} for ${e.partySize} guests.${L.expiresAt?` Link works until ${w(L.expiresAt)}.`:''}`}),(0,g.jsx)(d.T,{children:"Message to the guest (you can change it)"}),(0,g.jsx)(t.TextInput,{accessibilityLabel:"Message to the guest",testID:"deposit-link-message",value:$,multiline:!0,onChangeText:v,style:{minHeight:140,borderRadius:10,borderWidth:1,borderColor:b.colours.hairline,backgroundColor:b.colours.surface2,color:b.colours.text,padding:10,fontSize:15}}),(0,g.jsxs)(d.Row,{wrap:!0,gap:8,children:[E?(0,g.jsx)(d.Button,{label:"Text",testID:"deposit-link-sms",accessibilityLabel:`Open a text message to ${e.name} with the deposit link`,onPress:()=>G(E)}):null,z?(0,g.jsx)(d.Button,{kind:"secondary",label:"WhatsApp",testID:"deposit-link-wa",accessibilityLabel:`Open WhatsApp to ${e.name} with the deposit link`,onPress:()=>G(z)}):null,U?(0,g.jsx)(d.Button,{kind:"secondary",label:"Email",testID:"deposit-link-email",accessibilityLabel:`Open an email to ${e.name} with the deposit link`,onPress:()=>G(U)}):null,F?(0,g.jsx)(d.Button,{kind:"secondary",label:"Copy link",testID:"deposit-link-copy",accessibilityLabel:"Copy the deposit link",onPress:()=>{navigator.clipboard.writeText(L.url).catch(()=>{})}}):null]}),E||z||U?null:(0,g.jsx)(d.Muted,{children:"This booking has no phone number or email. Copy the link and send it another way."}),(0,g.jsx)(d.Muted,{size:13,children:"Tip: CoverCharge doesn't send anything. Each button opens your own messages app with the words filled in, and you press Send. Once the guest pays on website bookings, this booking shows Deposit paid on website bookings by itself. Refunds are done in Website bookings \u203a Orders."})]}):null,(0,g.jsx)(d.Button,{kind:"secondary",label:"Close",testID:"deposit-link-close",onPress:()=>j(!1)})]})})]})};var t=_r(_d[0]),n=_r(_d[1]),s=_r(_d[2]),o=e(_r(_d[3]));_r(_d[4]);var l=e(_r(_d[5])),d=_r(_d[6]),r=_r(_d[7]),c=_r(_d[8]),u=_r(_d[9]),p=_r(_d[10]),h=_r(_d[11]),b=_r(_d[12]),k=_r(_d[13]),g=_r(_d[14]);const y="Website bookings deposit links aren't switched on yet. Take the deposit by card or cash and tick Deposit paid.",w=e=>e?new Date(e).toLocaleString('en-GB',{timeZone:'Europe/London',weekday:'short',day:'numeric',month:'short',hour:'2-digit',minute:'2-digit',hourCycle:'h23'}):''},1353,[796,5,34,379,236,102,794,850,14,836,1017,931,840,1150,25]); __d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.QuietButton=function({icon:e,label:s,onPress:n,testID:b,a11y:y,disabled:f,accessibilityHint:h}){return(0,u.jsxs)(t.default,{accessibilityRole:"button",accessibilityLabel:y??s,accessibilityHint:h,accessibilityState:{disabled:!!f},disabled:f,testID:b,onPress:n,style:({pressed:e})=>({...l.look.quiet(e),flexGrow:1,opacity:f?.4:1}),children:[e?(0,u.jsx)(o.T,{size:15,colour:c.colours.goldLight,children:e}):null,(0,u.jsx)(o.T,{size:15,weight:"semibold",colour:c.colours.goldLight,children:s})]})},r(d[0]);var e,s=r(d[1]),t=(e=s)&&e.__esModule?e:{default:e},l=r(d[2]),o=r(d[3]),c=r(d[4]),u=r(d[5])},1354,[34,402,1143,794,840,25]); diff --git a/customer-app/admin.html b/customer-app/admin.html index 4c103ad96209bc51bfb5c07375ccda51216669bc..3c03f8cfd77f56db182ea6c2099e61e4a8bed37f 100644 --- a/customer-app/admin.html +++ b/customer-app/admin.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/customer-app/customer.html b/customer-app/customer.html index 4c103ad96209bc51bfb5c07375ccda51216669bc..3c03f8cfd77f56db182ea6c2099e61e4a8bed37f 100644 --- a/customer-app/customer.html +++ b/customer-app/customer.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/customer-app/customer/anchorage.html b/customer-app/customer/anchorage.html index 4c103ad96209bc51bfb5c07375ccda51216669bc..3c03f8cfd77f56db182ea6c2099e61e4a8bed37f 100644 --- a/customer-app/customer/anchorage.html +++ b/customer-app/customer/anchorage.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/customer-app/customer/anchorage/book.html b/customer-app/customer/anchorage/book.html index 4c103ad96209bc51bfb5c07375ccda51216669bc..3c03f8cfd77f56db182ea6c2099e61e4a8bed37f 100644 --- a/customer-app/customer/anchorage/book.html +++ b/customer-app/customer/anchorage/book.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/customer-app/customer/anchorage/feedback.html b/customer-app/customer/anchorage/feedback.html index 4c103ad96209bc51bfb5c07375ccda51216669bc..3c03f8cfd77f56db182ea6c2099e61e4a8bed37f 100644 --- a/customer-app/customer/anchorage/feedback.html +++ b/customer-app/customer/anchorage/feedback.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/customer-app/customer/anchorage/gift.html b/customer-app/customer/anchorage/gift.html index 4c103ad96209bc51bfb5c07375ccda51216669bc..3c03f8cfd77f56db182ea6c2099e61e4a8bed37f 100644 --- a/customer-app/customer/anchorage/gift.html +++ b/customer-app/customer/anchorage/gift.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/customer-app/customer/anchorage/lost.html b/customer-app/customer/anchorage/lost.html index 4c103ad96209bc51bfb5c07375ccda51216669bc..3c03f8cfd77f56db182ea6c2099e61e4a8bed37f 100644 --- a/customer-app/customer/anchorage/lost.html +++ b/customer-app/customer/anchorage/lost.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/customer-app/customer/anchorage/loyalty.html b/customer-app/customer/anchorage/loyalty.html index 4c103ad96209bc51bfb5c07375ccda51216669bc..3c03f8cfd77f56db182ea6c2099e61e4a8bed37f 100644 --- a/customer-app/customer/anchorage/loyalty.html +++ b/customer-app/customer/anchorage/loyalty.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/customer-app/customer/anchorage/merch.html b/customer-app/customer/anchorage/merch.html index 4c103ad96209bc51bfb5c07375ccda51216669bc..3c03f8cfd77f56db182ea6c2099e61e4a8bed37f 100644 --- a/customer-app/customer/anchorage/merch.html +++ b/customer-app/customer/anchorage/merch.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/customer-app/customer/anchorage/offers.html b/customer-app/customer/anchorage/offers.html index 4c103ad96209bc51bfb5c07375ccda51216669bc..3c03f8cfd77f56db182ea6c2099e61e4a8bed37f 100644 --- a/customer-app/customer/anchorage/offers.html +++ b/customer-app/customer/anchorage/offers.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/customer-app/customer/anchorage/refer.html b/customer-app/customer/anchorage/refer.html index 4c103ad96209bc51bfb5c07375ccda51216669bc..3c03f8cfd77f56db182ea6c2099e61e4a8bed37f 100644 --- a/customer-app/customer/anchorage/refer.html +++ b/customer-app/customer/anchorage/refer.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/customer-app/customer/anchorage/waitlist.html b/customer-app/customer/anchorage/waitlist.html index 4c103ad96209bc51bfb5c07375ccda51216669bc..3c03f8cfd77f56db182ea6c2099e61e4a8bed37f 100644 --- a/customer-app/customer/anchorage/waitlist.html +++ b/customer-app/customer/anchorage/waitlist.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/customer-app/customer/anchorage/whatson.html b/customer-app/customer/anchorage/whatson.html index 4c103ad96209bc51bfb5c07375ccda51216669bc..3c03f8cfd77f56db182ea6c2099e61e4a8bed37f 100644 --- a/customer-app/customer/anchorage/whatson.html +++ b/customer-app/customer/anchorage/whatson.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/customer-app/customer/basket.html b/customer-app/customer/basket.html index 4c103ad96209bc51bfb5c07375ccda51216669bc..3c03f8cfd77f56db182ea6c2099e61e4a8bed37f 100644 --- a/customer-app/customer/basket.html +++ b/customer-app/customer/basket.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/customer-app/customer/profile.html b/customer-app/customer/profile.html index 4c103ad96209bc51bfb5c07375ccda51216669bc..3c03f8cfd77f56db182ea6c2099e61e4a8bed37f 100644 --- a/customer-app/customer/profile.html +++ b/customer-app/customer/profile.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/customer-app/demo.html b/customer-app/demo.html index 4c103ad96209bc51bfb5c07375ccda51216669bc..3c03f8cfd77f56db182ea6c2099e61e4a8bed37f 100644 --- a/customer-app/demo.html +++ b/customer-app/demo.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/customer-app/display.html b/customer-app/display.html index 4c103ad96209bc51bfb5c07375ccda51216669bc..3c03f8cfd77f56db182ea6c2099e61e4a8bed37f 100644 --- a/customer-app/display.html +++ b/customer-app/display.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/customer-app/index.html b/customer-app/index.html index 21db53aa3a9bc631dd0aa23ca813c72a13a5549d..48fe47b50abf091b927137bbb0d88fb48ee8e054 100644 --- a/customer-app/index.html +++ b/customer-app/index.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/customer-app/kitchen.html b/customer-app/kitchen.html index 4c103ad96209bc51bfb5c07375ccda51216669bc..3c03f8cfd77f56db182ea6c2099e61e4a8bed37f 100644 --- a/customer-app/kitchen.html +++ b/customer-app/kitchen.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/customer-app/owner.html b/customer-app/owner.html index 4c103ad96209bc51bfb5c07375ccda51216669bc..3c03f8cfd77f56db182ea6c2099e61e4a8bed37f 100644 --- a/customer-app/owner.html +++ b/customer-app/owner.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/customer-app/staff.html b/customer-app/staff.html index 4c103ad96209bc51bfb5c07375ccda51216669bc..3c03f8cfd77f56db182ea6c2099e61e4a8bed37f 100644 --- a/customer-app/staff.html +++ b/customer-app/staff.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/customer-app/sw.js b/customer-app/sw.js index a3c81f315b3b9b82ca5c92490fafb5a10a238e85..be50c5ad9f76c620d2046482baddb2fcda31a7f7 100644 --- a/customer-app/sw.js +++ b/customer-app/sw.js @@ -1,7 +1,7 @@ // Anchorage service worker: precache the app shell so it opens offline after the first visit. -const V = "cc-customer-3291357212"; +const V = "cc-customer-8a64fb69ab"; const BASE = "/customer-app/"; -const PRECACHE = ["/customer-app/apple-touch-icon.png", "/customer-app/assets/assets/brand/3idiots-hero.e5dfd53739f05086b1956e72d585a66a.png", "/customer-app/assets/assets/brand/3idiots.df4a76d2130f0e5b0042f06a8c88693a.png", "/customer-app/assets/assets/brand/abbotsford-hero.78fcb8ee06ee22c4ca659c9254db7512.png", "/customer-app/assets/assets/brand/abbotsford.b26602bba5ce4969733c5422a45ad053.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/cecchinis-hero.f77780fcc94fd668cf35d66d6dc52d81.png", "/customer-app/assets/assets/brand/cecchinis.ebf752fef363247848ae7c0d91938765.png", "/customer-app/assets/assets/brand/drunkencoo-hero.65c21c4da9e466cf4bffc969639a1427.png", "/customer-app/assets/assets/brand/drunkencoo.f6d92af3b14e4205a3deaf4434754c51.png", "/customer-app/assets/assets/brand/greenside-hero.1caec5a6cb939434cccb5f3a613b50f8.png", "/customer-app/assets/assets/brand/greenside.9d1556db97dcb903a3c57e2063ee2255.png", "/customer-app/assets/assets/brand/kirkmichael-hero.63b13cde7fd82eb622622b39ac80c394.png", "/customer-app/assets/assets/brand/kirkmichael.63b13cde7fd82eb622622b39ac80c394.png", "/customer-app/assets/assets/brand/kirkton-hero.9d0837b292c2f4f30f4521d806bb28c3.png", "/customer-app/assets/assets/brand/kirkton.bcf8d846df4861474d224a7a77f498fb.png", "/customer-app/assets/assets/brand/mrbasrais-hero.4ce74641cfcf52d099157c84005b9d2a.png", "/customer-app/assets/assets/brand/mrbasrais.7cc4086dd12ace82529795f1c9f8c900.png", "/customer-app/assets/assets/brand/pizzaioli-hero.1896657c08264cefb49b401891d5448d.png", "/customer-app/assets/assets/brand/pizzaioli.db8c000b62ee407121aa8b90ce45e170.png", "/customer-app/assets/assets/brand/rupeeroom-hero.969fa372add526aaacf3a6c009b8ac92.png", "/customer-app/assets/assets/brand/rupeeroom.689e6fb536dc0845eeb174a1ec7bd346.png", "/customer-app/assets/assets/brand/saltmarsh.85a6a65732635e5148478d743d9ca884.png", "/customer-app/assets/assets/brand/smokinggoat-hero.0588f17ef0eed7f757f22916cd4d37db.png", "/customer-app/assets/assets/brand/smokinggoat.20a3a1970596ab43c5d6468d4ed549a7.png", "/customer-app/assets/assets/brand/souters.f4c58d9349b6e1700fe5abcc9e9b665c.png", "/customer-app/assets/assets/brand/wildings-hero-logo-text.4661e4b935726f2511f9c17a1567c89a.png", "/customer-app/assets/assets/brand/wildings.076f4fcd06d19a0af0205c410f461b14.png", "/customer-app/assets/assets/brand/williewastles-hero.b9d53d27b66f903b5618a7177b2ffad4.png", "/customer-app/assets/assets/brand/williewastles.055a77893ced99bf3a6c5402ba5baac6.png", "/customer-app/assets/assets/brand/yasmins-hero.a5aef62e37dfcecbe0afc056186f4ad9.png", "/customer-app/assets/assets/brand/yasmins.8482602e9f0a965655924835625cb02b.png", "/customer-app/assets/assets/recipes/fishsupper.1609c58319e1e8721f5c639049fb054e.jpg", "/customer-app/assets/assets/recipes/lobster.2fb3485c8e372972099259017358c1b8.jpg", "/customer-app/assets/assets/recipes/moules.a4f342fc7e7fb62c8a0b5c1678bbea3f.jpg", "/customer-app/assets/assets/recipes/skink.4ce7b7c676f9cdcd0a060eda46f5a00e.jpg", "/customer-app/assets/assets/recipes/stp.1061ced765efdcafff2554adc3fc7113.jpg", "/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-192.png", "/customer-app/icon-maskable-512.png", "/customer-app/manifest.webmanifest", "/customer-app/index.html", "/customer-app/_expo/static/js/web/bundle.js?v=329135721208ae36a7b11f98c518ac0b709bcbb9ff7b9099cc45bd852f749756"]; +const PRECACHE = ["/customer-app/apple-touch-icon.png", "/customer-app/assets/assets/brand/3idiots-hero.e5dfd53739f05086b1956e72d585a66a.png", "/customer-app/assets/assets/brand/3idiots.df4a76d2130f0e5b0042f06a8c88693a.png", "/customer-app/assets/assets/brand/abbotsford-hero.78fcb8ee06ee22c4ca659c9254db7512.png", "/customer-app/assets/assets/brand/abbotsford.b26602bba5ce4969733c5422a45ad053.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/cecchinis-hero.f77780fcc94fd668cf35d66d6dc52d81.png", "/customer-app/assets/assets/brand/cecchinis.ebf752fef363247848ae7c0d91938765.png", "/customer-app/assets/assets/brand/drunkencoo-hero.65c21c4da9e466cf4bffc969639a1427.png", "/customer-app/assets/assets/brand/drunkencoo.f6d92af3b14e4205a3deaf4434754c51.png", "/customer-app/assets/assets/brand/greenside-hero.1caec5a6cb939434cccb5f3a613b50f8.png", "/customer-app/assets/assets/brand/greenside.9d1556db97dcb903a3c57e2063ee2255.png", "/customer-app/assets/assets/brand/kirkmichael-hero.63b13cde7fd82eb622622b39ac80c394.png", "/customer-app/assets/assets/brand/kirkmichael.63b13cde7fd82eb622622b39ac80c394.png", "/customer-app/assets/assets/brand/kirkton-hero.9d0837b292c2f4f30f4521d806bb28c3.png", "/customer-app/assets/assets/brand/kirkton.bcf8d846df4861474d224a7a77f498fb.png", "/customer-app/assets/assets/brand/mrbasrais-hero.4ce74641cfcf52d099157c84005b9d2a.png", "/customer-app/assets/assets/brand/mrbasrais.7cc4086dd12ace82529795f1c9f8c900.png", "/customer-app/assets/assets/brand/pizzaioli-hero.1896657c08264cefb49b401891d5448d.png", "/customer-app/assets/assets/brand/pizzaioli.db8c000b62ee407121aa8b90ce45e170.png", "/customer-app/assets/assets/brand/rupeeroom-hero.969fa372add526aaacf3a6c009b8ac92.png", "/customer-app/assets/assets/brand/rupeeroom.689e6fb536dc0845eeb174a1ec7bd346.png", "/customer-app/assets/assets/brand/saltmarsh.85a6a65732635e5148478d743d9ca884.png", "/customer-app/assets/assets/brand/smokinggoat-hero.0588f17ef0eed7f757f22916cd4d37db.png", "/customer-app/assets/assets/brand/smokinggoat.20a3a1970596ab43c5d6468d4ed549a7.png", "/customer-app/assets/assets/brand/souters.f4c58d9349b6e1700fe5abcc9e9b665c.png", "/customer-app/assets/assets/brand/wildings-hero-logo-text.4661e4b935726f2511f9c17a1567c89a.png", "/customer-app/assets/assets/brand/wildings.076f4fcd06d19a0af0205c410f461b14.png", "/customer-app/assets/assets/brand/williewastles-hero.b9d53d27b66f903b5618a7177b2ffad4.png", "/customer-app/assets/assets/brand/williewastles.055a77893ced99bf3a6c5402ba5baac6.png", "/customer-app/assets/assets/brand/yasmins-hero.a5aef62e37dfcecbe0afc056186f4ad9.png", "/customer-app/assets/assets/brand/yasmins.8482602e9f0a965655924835625cb02b.png", "/customer-app/assets/assets/recipes/fishsupper.1609c58319e1e8721f5c639049fb054e.jpg", "/customer-app/assets/assets/recipes/lobster.2fb3485c8e372972099259017358c1b8.jpg", "/customer-app/assets/assets/recipes/moules.a4f342fc7e7fb62c8a0b5c1678bbea3f.jpg", "/customer-app/assets/assets/recipes/skink.4ce7b7c676f9cdcd0a060eda46f5a00e.jpg", "/customer-app/assets/assets/recipes/stp.1061ced765efdcafff2554adc3fc7113.jpg", "/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-192.png", "/customer-app/icon-maskable-512.png", "/customer-app/manifest.webmanifest", "/customer-app/index.html", "/customer-app/_expo/static/js/web/bundle.js?v=8a64fb69abc5b81b9900107cc965b44e83aa2b4bd7c2a9474eff5fc3cd57c4e3"]; // Hugging Face serves large files (fonts) through a redirect to its CDN. Browsers refuse to hand a *redirected* cached // response to a page, so store a plain copy instead (otherwise fonts, and so the app, fail to load offline). 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); diff --git a/customer-app/team.html b/customer-app/team.html index 4c103ad96209bc51bfb5c07375ccda51216669bc..3c03f8cfd77f56db182ea6c2099e61e4a8bed37f 100644 --- a/customer-app/team.html +++ b/customer-app/team.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/display-app/_expo/static/js/web/bundle.js b/display-app/_expo/static/js/web/bundle.js index b225ba0f6c68a05bd89f404c8700180a63e9f3a8..42e933ad2ccf62a716516227c31115fea145b639 100644 --- a/display-app/_expo/static/js/web/bundle.js +++ b/display-app/_expo/static/js/web/bundle.js @@ -1122,7 +1122,7 @@ __d(function(g,r,i,a,m,e,d){m.exports=r(d[0])},1038,[1039]); __d(function(g,r,i,a,m,e,d){function n(n,t){const o=globalThis[`${__METRO_GLOBAL_PREFIX__??''}__loadBundleAsync`];if(null!=o){const s=String(n);if(null!=t){const n=t[s];if(null!=n)return o(n)}}}function t(t,o,s){const u=()=>r.importAll(t,s);{const l=o?.[String(t)];if(Array.isArray(l)){const c=globalThis[`${__METRO_GLOBAL_PREFIX__??''}__loadBundleAsync`];if(c?.isReady?.(l))return u();const f=n(t,o);if(null!=f)return f.then(u);throw new Error(`Cannot import module ${s??t}: the async bundle loader is unavailable. Load the initial Expo bundle before importing these chunks: ${l.join(', ')}`)}try{return u()}catch(s){const l=n(t,o);if(null!=l)return l.then(u);throw s}}const l=n(t,o);return null!=l?l.then(u):u()}function o(n,o,s){const u=t(n,o,s),l=Promise.resolve(u);return l._result=u,l}o.unstable_importMaybeSync=function(n,o){return t(n,o)},o.prefetch=function(t,o,s){n(t,o)?.then(()=>{},()=>{})},o.unstable_resolve=function(n,t){if(!t)throw new Error('Bundle splitting is required for Web Worker imports');const o=t[n];if(!o)throw new Error('Worker import is missing from split bundle paths: '+o);return o},o.unstable_createWorker=function(n,t){if('undefined'==typeof crossOriginIsolated||!crossOriginIsolated)return new Worker(n,t);try{const s=(o=n,`\n const ASYNC_WORKER_BASE = ${JSON.stringify(o)};\n const IMPORT_SCRIPTS = importScripts;\n const FETCH = fetch;\n const fromBaseURL = (input) => new URL(input, ASYNC_WORKER_BASE).href;\n self.fetch = function(input, init) {\n return FETCH(typeof input === 'string' ? fromBaseURL(input) : input, init);\n };\n self.importScripts = function(...urls) {\n return IMPORT_SCRIPTS.apply(self, urls.map(fromBaseURL));\n };\n importScripts(ASYNC_WORKER_BASE);\n `);return n=URL.createObjectURL(new Blob([s],{type:'text/javascript'})),new Worker(n,t)}finally{URL.revokeObjectURL(n)}var o},m.exports=o},1039,[]); __d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"currentScrollY",{enumerable:!0,get:function(){return u}}),Object.defineProperty(_e,"screenGeneration",{enumerable:!0,get:function(){return c}}),Object.defineProperty(_e,"restoreScroll",{enumerable:!0,get:function(){return o}}),_e.useScrollMemory=function(u){const c=(0,e.useRef)(0),o=(0,e.useRef)(0),l=(0,e.useRef)(0),s=(0,e.useRef)(0),f=(0,e.useRef)(0),v=(0,e.useRef)(null),y=(0,e.useRef)([]),h=()=>{y.current.forEach(clearTimeout),y.current=[]},b=()=>{const e=v.current;null!=e&&(u.current?.scrollTo({y:e,animated:!1}),f.current-s.current>=e-2&&(c.current=e,o.current=e,v.current=null,h()))},p=(0,e.useCallback)(e=>{if(h(),v.current=Math.max(0,e),e<=0)return v.current=null,u.current?.scrollTo({y:0,animated:!1}),c.current=0,void(o.current=0);for(const e of[0,30,80,160,320,600,1e3,1600,2500])y.current.push(setTimeout(b,e));y.current.push(setTimeout(()=>{v.current=null},2600))},[]);t={y:()=>o.current,restore:p};const R=(0,e.useCallback)(()=>{n++;return o.current},[]);return{props:{scrollEventThrottle:32,onScroll:e=>{const t=e.nativeEvent.contentOffset.y;c.current=t,s.current=e.nativeEvent.layoutMeasurement.height,f.current=e.nativeEvent.contentSize.height,Date.now()-l.current>250&&null==v.current&&(o.current=t)},onScrollBeginDrag:()=>{v.current=null,h()},onContentSizeChange:(e,t)=>{f.current=t,l.current=Date.now(),b()},onLayout:e=>{s.current=e.nativeEvent.layout.height}},restore:p,leave:R}};var e=r(d[0]);let t=null,n=0;const u=()=>t?t.y():0,c=()=>n,o=e=>t?.restore(e)},1040,[34]); __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,"useBackLayers",{enumerable:!0,get:function(){return f}}),_e.runBackLayer=function(){const e=f.getState().layers,t=e[e.length-1];return!!t&&(t.fn(),!0)},_e.useBackLayer=function(e,n,o=!0){const s=(0,t.useRef)(n);s.current=n,(0,t.useEffect)(()=>{if(!e)return;const t=++y,n=(0,u.currentScrollY)(),l=(0,u.screenGeneration)();return f.setState(e=>({layers:[...e.layers,{id:t,fn:()=>s.current(),own:o}]})),()=>{f.setState(e=>({layers:e.layers.filter(e=>e.id!==t)})),(0,u.screenGeneration)()===l&&(0,u.restoreScroll)(n)}},[e,o])},Object.defineProperty(_e,"useInnerBackShown",{enumerable:!0,get:function(){return w}}),Object.defineProperty(_e,"BACK_GUTTER",{enumerable:!0,get:function(){return p}}),_e.BackTitleRow=function({back:e,onBack:n,title:s}){const[l,u]=(0,t.useState)(0),[f,y]=(0,t.useState)({w:96,h:48}),[w,b]=(0,t.useState)(0),S=Array.from(new Set(String(s??'').split(/\s+/).filter(Boolean)));String(s??'').length>=20&&S.length>=3&&S.push('00000000');const v=Math.max(p,Math.ceil(f.w)+4),j=e&&l>0&&l-2*vu(Math.round(e.nativeEvent.layout.width)),style:{minHeight:44,justifyContent:'center',alignItems:'center',paddingHorizontal:e&&!j?v:0,paddingTop:j?f.h:0},children:[e?(0,h.jsx)(o.default,{style:{position:'absolute',left:0,top:0},onLayout:e=>{const t=Math.round(e.nativeEvent.layout.width),n=Math.round(e.nativeEvent.layout.height);y(e=>e.w===t&&e.h===n?e:{w:t,h:n})},children:(0,h.jsx)(g,{onPress:n})}):null,(0,h.jsx)(c.T,{size:22,weight:"bold",center:!0,accessibilityRole:"header",children:s}),e&&S.length?(0,h.jsx)(o.default,{"aria-hidden":!0,importantForAccessibility:"no-hide-descendants",pointerEvents:"none",style:{position:'absolute',left:0,top:0,opacity:0,alignItems:'flex-start'},onLayout:e=>b(Math.ceil(e.nativeEvent.layout.width)),children:S.map(e=>(0,h.jsx)(c.T,{size:22,weight:"bold",numberOfLines:1,style:{alignSelf:'flex-start'},children:e},e))}):null]})},_e.BackButton=g,_e.useWebBack=function(e){const n=(0,t.useRef)(e);n.current=e,(0,t.useEffect)(()=>{if('undefined'==typeof window||!window.history?.pushState)return;const e=()=>{try{window.history.pushState({...window.history.state??{},ccBack:Date.now()},'',window.location.href)}catch{}};e();const t=t=>{n.current()&&(t.stopImmediatePropagation?.(),e())};return window.addEventListener('popstate',t,!0),()=>window.removeEventListener('popstate',t,!0)},[])};var t=r(d[0]);r(d[1]);var n=e(r(d[2])),o=e(r(d[3])),s=r(d[4]),l=r(d[5]),c=r(d[6]),u=r(d[7]),h=r(d[8]);const f=(0,s.create)(()=>({layers:[]}));let y=0;const w=()=>f(e=>e.layers.some(e=>e.own)),p=100;function g({onPress:e,testID:t="screen-back",label:o="Back"}){return(0,h.jsx)(n.default,{testID:t,accessibilityRole:"button",accessibilityLabel:o,onPress:e,hitSlop:8,style:({pressed:e})=>({minHeight:48,minWidth:96,justifyContent:'center',paddingRight:12,opacity:e?.6:1,alignSelf:'flex-start'}),children:(0,h.jsxs)(c.T,{size:18,weight:"semibold",colour:l.colours.gold,children:["\u2039 ",o]})})}},1041,[34,236,402,102,815,840,794,1040,25]); -__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"APP_VERSION",{enumerable:!0,get:function(){return t}});const t='v0.3.12.121'},1042,[]); +__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"APP_VERSION",{enumerable:!0,get:function(){return t}});const t='v0.3.12.122'},1042,[]); __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.NotificationsSettings=function({rid:e}){(0,n.useEffect)(()=>{c.useNotifs.getState().ensure(e),(0,j.readPushLive)()},[e]);const t=(0,c.useNotifs)(e=>e.items).filter(t=>t.rid===e&&!t.removed),s=(0,h.useOwner)(e=>e.staff),o=(0,j.usePushLive)(),[l,p]=(0,n.useState)(null),[f,g]=(0,n.useState)(null),[x,b]=(0,n.useState)(!1),y=c.useNotifs.getState(),T=s.map(e=>({id:e.id,role:e.role,level:e.level,job:e.job,department:e.dept,active:e.active})),v=e=>{const t=(0,u.resolveRecipients)(e,T,[]),n=[...e.recipients.groups.map(e=>u.NOTIF_GROUP_LABEL[e]),...(e.recipients.onShiftIn??[]).map(e=>u.SHIFT_FILTER_LABEL[e])];e.recipients.fallback&&n.push(`else ${[...e.recipients.fallback.groups.map(e=>u.NOTIF_GROUP_LABEL[e]),...e.recipients.fallback.staff.map(e=>I(s.find(t=>t.id===e)?.name??e))].join(', ')}`);const o=e.recipients.staff.map(e=>I(s.find(t=>t.id===e)?.name??e));return[...n,...o].join(', ')+(t.length||(e.recipients.onShiftIn??[]).length?'':' (nobody yet)')};return(0,k.jsxs)(a.default,{style:{gap:10},testID:"notif-settings",children:[(0,k.jsx)(r.Muted,{size:13,children:"Tip: these remind people at a set time, e.g. the Mills milk order. They show in the app as a gold slider with Done and Later. Done is logged with the name and time. Times are UK time."}),(0,k.jsxs)(a.default,{testID:"push-live-status",style:{borderWidth:1,borderColor:d.colours.accentBorder,borderRadius:10,padding:8,gap:4},children:[(0,k.jsxs)(r.Row,{style:{justifyContent:'space-between'},children:[(0,k.jsx)(r.T,{weight:"semibold",children:"Send to phones"}),(0,k.jsx)(r.Badge,{kind:o.live?'gold':'neutral',label:o.live?'ON':'OFF'})]}),(0,k.jsx)(r.Muted,{size:12,children:o.live?'Phone notifications go to people who turned them on.':'Off: nothing goes to anyone\u2019s phone yet. In-app reminders still work.'}),(0,k.jsx)(r.Button,{small:!0,kind:"secondary",testID:"push-live-toggle",label:o.live?'Switch phone notifications off':'Switch phone notifications on\u2026',onPress:()=>b(!0)})]}),(0,k.jsx)(R,{}),t.map(e=>l===e.id?(0,k.jsx)(D,{init:e,onCancel:()=>p(null),onSave:t=>{y.update(e.id,t),p(null)}},e.id):(0,k.jsxs)(a.default,{testID:`notif-${e.seed??e.id}`,style:{borderWidth:1,borderColor:d.colours.hairline,borderRadius:12,padding:10,gap:4,opacity:e.paused?.6:1},children:[(0,k.jsxs)(r.Row,{style:{justifyContent:'space-between'},children:[(0,k.jsx)(r.T,{weight:"semibold",style:{flex:1},children:e.title}),e.paused?(0,k.jsx)(r.Badge,{kind:"neutral",label:"Off"}):null]}),(0,k.jsx)(r.Muted,{size:13,children:e.message}),(0,k.jsxs)(r.Muted,{size:12,children:[(0,u.scheduleText)(e)," \xb7 ",v(e)," \xb7 ",[e.sendBy.inApp?'In app':'',e.sendBy.push?'Phone':''].filter(Boolean).join(' + ')]}),(0,k.jsxs)(r.Row,{gap:6,children:[(0,k.jsx)(r.Button,{small:!0,kind:"secondary",testID:`notif-edit-${e.seed??e.id}`,label:"Edit",onPress:()=>p(e.id)}),(0,k.jsx)(r.Button,{small:!0,kind:"ghost",label:e.paused?'Switch on':'Switch off',onPress:()=>y.update(e.id,{paused:!e.paused})}),(0,k.jsx)(r.Button,{small:!0,kind:"ghost",label:"Remove",onPress:()=>g(e)})]})]},e.id)),'new'===l?(0,k.jsx)(D,{init:C,onCancel:()=>p(null),onSave:t=>{y.add(e,t),p(null)}}):(0,k.jsx)(r.Button,{small:!0,testID:"notif-add",label:"Add a notification",onPress:()=>p('new')}),(0,k.jsxs)(r.Sheet,{visible:!!f,onClose:()=>g(null),title:"Remove this notification?",children:[(0,k.jsx)(r.T,{children:f?.title}),(0,k.jsx)(r.Muted,{children:"Nobody gets it after this. Reset to default restores the configured rules."}),(0,k.jsxs)(r.Row,{gap:8,children:[(0,k.jsx)(r.Button,{label:"Remove",onPress:()=>{f&&y.remove(f.id),g(null)}}),(0,k.jsx)(r.Button,{kind:"ghost",label:"Cancel",onPress:()=>g(null)})]})]}),(0,k.jsxs)(r.Sheet,{visible:x,onClose:()=>b(!1),title:o.live?'Switch phone notifications off?':'Switch phone notifications on?',testID:"push-live-confirm",children:[(0,k.jsx)(r.T,{children:o.live?'Nothing more goes to phones. In-app reminders keep working.':'From the next scheduled time, everyone ticked on a notification with \u201cPhone notification\u201d gets it on any phone where they turned phone notifications on.'}),(0,k.jsxs)(r.Row,{gap:8,children:[(0,k.jsx)(r.Button,{testID:"push-live-yes",label:o.live?'Switch off':'Yes, switch on',onPress:()=>{(0,j.setPushLive)(!o.live).then(e=>(0,w.notify)({id:'push-live',tone:e.ok?'normal':'warn',title:e.ok?o.live?'Phone notifications are off':'Phone notifications are on':'Not changed',body:e.message??'',timeoutMs:7e3})),b(!1)}}),(0,k.jsx)(r.Button,{kind:"ghost",label:"Cancel",onPress:()=>b(!1)})]})]})]})},_e.PushButton=R,_e.OrderListsSettings=function({rid:e}){(0,n.useEffect)(()=>{p.useOrderLists.getState().ensure(e)},[e]);const s=(0,p.useOrderLists)(e=>e.lists).filter(t=>t.rid===e),o=(0,p.orderSettingsOf)(e);(0,p.useOrderLists)(t=>t.settings[e]);const l=p.useOrderLists.getState(),[c,u]=(0,n.useState)(''),[h,g]=(0,n.useState)({});return(0,k.jsxs)(a.default,{style:{gap:10},testID:"order-list-settings",children:[(0,k.jsx)(r.Muted,{size:13,children:"Tip: running lists (like Alsons drinks) collect items until you order; trip lists (like Cash and carry) are for one shopping day. Logos and phone numbers are set on each list."}),(0,k.jsx)(r.Toggle,{testID:"order-allow-staff",label:"Let all staff add items",value:o.allowStaff,onChange:t=>l.setSettings(e,{allowStaff:t})}),(0,k.jsx)(r.Muted,{size:12,children:"Staff can add items and see the lists. Only managers and the Head Chef tick, remove or finish an order."}),(0,k.jsx)(r.T,{weight:"semibold",children:"Default trip day"}),(0,k.jsx)(r.Row,{wrap:!0,gap:6,children:v.map(t=>(0,k.jsx)(r.Chip,{label:f.DAY_FULL[t].slice(0,3),selected:o.defaultTripDay===t,onPress:()=>l.setSettings(e,{defaultTripDay:t})},t))}),s.map(e=>(0,k.jsxs)(a.default,{testID:`order-list-row-${e.seed??e.id}`,style:{borderWidth:1,borderColor:d.colours.hairline,borderRadius:10,padding:8,gap:6,opacity:e.archived?.55:1},children:[(0,k.jsxs)(r.Row,{gap:6,children:[(0,k.jsx)(t.TextInput,{accessibilityLabel:`Rename ${e.name}`,value:h[e.id]??e.name,onChangeText:t=>g(s=>({...s,[e.id]:t})),onBlur:()=>{const t=(h[e.id]??'').trim();t&&t!==e.name&&l.updateList(e.id,{name:t})},style:{...T,flex:1,minWidth:0}}),(0,k.jsx)(r.Badge,{kind:"neutral",label:'trip'===e.kind?'Trip':'Running'})]}),'trip'===e.kind?(0,k.jsx)(r.Row,{wrap:!0,gap:6,children:v.map(t=>(0,k.jsx)(r.Chip,{label:f.DAY_FULL[t].slice(0,3),selected:(e.tripDay??o.defaultTripDay)===t,onPress:()=>l.updateList(e.id,{tripDay:t})},t))}):null,(0,k.jsx)(r.Row,{gap:6,children:(0,k.jsx)(r.Button,{small:!0,kind:"ghost",label:e.archived?'Bring back':'Archive',onPress:()=>l.updateList(e.id,{archived:!e.archived})})})]},e.id)),(0,k.jsxs)(r.Row,{gap:6,wrap:!0,children:[(0,k.jsx)(t.TextInput,{accessibilityLabel:"New list name",testID:"order-new-name",value:c,onChangeText:u,placeholder:"e.g. Butcher",placeholderTextColor:d.colours.muted,style:{...T,flexGrow:1,flexBasis:160,minWidth:0}}),(0,k.jsx)(r.Button,{small:!0,label:"Add running",disabled:c.trim().length<2,onPress:()=>{l.addList(e,{name:c.trim(),kind:'running'}),u('')}}),(0,k.jsx)(r.Button,{small:!0,kind:"secondary",label:"Add trip",disabled:c.trim().length<2,onPress:()=>{l.addList(e,{name:c.trim(),kind:'trip',tripDay:o.defaultTripDay}),u('')}})]})]})},Object.defineProperty(_e,"resetOrderLists",{enumerable:!0,get:function(){return B}}),_e.ClockAreaSettings=function({rid:e,me:c}){(0,g.useClockArea)(t=>t.areas[e]);const u=(0,g.areaOf)(e);const h=g.useClockArea.getState(),p=(0,s.privateClockVenue)(e),[f,j]=(0,n.useState)(null==u.lat?'':String(u.lat)),[y,w]=(0,n.useState)(null==u.lng?'':String(u.lng)),[v,S]=(0,n.useState)(!1),[I,C]=(0,n.useState)(''),[L,D]=(0,n.useState)(u.breakOptions.join(', ')),R=(t,s)=>{const n=Number(t),o=Number(s);t.trim()||s.trim()?Number.isFinite(n)&&Number.isFinite(o)&&Math.abs(n)<=90&&Math.abs(o)<=180&&h.set(e,{lat:n,lng:o},c):h.set(e,{lat:null,lng:null},c)},B=async()=>{if(p)return;S(!0),C('');const t=await(0,b.getFix)();if(S(!1),'object'!=typeof t)return void C('denied'===t?'Location is blocked for this app. Allow it in your browser or phone settings.':'Couldn\u2019t get your location. Try again outside or near a window.');const s=t.lat.toFixed(6),n=t.lng.toFixed(6);j(s),w(n),h.set(e,{lat:Number(s),lng:Number(n)},c),C(`Centre set to where you are (accurate to about ${Math.round(t.acc)} m).`)},P=(0,x.areaSet)(u);return(0,k.jsxs)(a.default,{style:{gap:10},testID:"clock-area-settings",children:[(0,k.jsx)(r.Muted,{size:13,children:p?'The address-matched pub centre is configured below. Only clock-in checks location; only pass/fail is saved. No background, clock-out or break checks. Change the radius or centre here; use a manager override for a refused check.':'Tip: stand in the middle of the venue and tap \u201cUse my current location\u201d. Clocking in, out and breaks then only work within the distance below. Rota and pay screens are never blocked.'}),P?null:(0,k.jsx)(r.Banner,{kind:"warn",title:"Clock-in area not set yet",children:"Until you set the centre, staff can clock in from anywhere."}),p?(0,k.jsx)(r.Muted,{children:"Clock-in at the pub is required. A manager can record an exception with a reason."}):(0,k.jsx)(r.Toggle,{testID:"clock-area-on",label:"Check people are at the venue",value:u.on,onChange:t=>h.set(e,{on:t},c)}),p?null:(0,k.jsx)(r.Button,{testID:"clock-area-here",label:v?'Finding you\u2026':'\ud83d\udccd Use my current location',disabled:v,onPress:()=>{B()}}),I?(0,k.jsx)(r.Muted,{size:13,children:I}):null,(0,k.jsxs)(r.Row,{wrap:!0,gap:8,children:[(0,k.jsxs)(a.default,{style:{gap:2},children:[(0,k.jsx)(r.Muted,{size:12,children:"Latitude"}),(0,k.jsx)(t.TextInput,{accessibilityLabel:"Latitude",testID:"clock-area-lat",value:f,onChangeText:j,onBlur:()=>R(f,y),placeholder:"55.40\u2026",placeholderTextColor:d.colours.muted,style:{...T,width:130}})]}),(0,k.jsxs)(a.default,{style:{gap:2},children:[(0,k.jsx)(r.Muted,{size:12,children:"Longitude"}),(0,k.jsx)(t.TextInput,{accessibilityLabel:"Longitude",testID:"clock-area-lng",value:y,onChangeText:w,onBlur:()=>R(f,y),placeholder:"-4.75\u2026",placeholderTextColor:d.colours.muted,style:{...T,width:130}})]})]}),P?(0,k.jsx)(l.default,{accessibilityRole:"link",testID:"clock-area-map",onPress:()=>{o.default.openURL(`https://www.openstreetmap.org/?mlat=${u.lat}&mlon=${u.lng}#map=18/${u.lat}/${u.lng}`)},children:(0,k.jsx)(r.T,{size:13,colour:d.colours.gold,children:"See the pin on a map \u203a"})}):null,(0,k.jsx)(r.T,{weight:"semibold",children:"How far from the centre"}),(0,k.jsxs)(r.Row,{gap:8,children:[(0,k.jsx)(r.Button,{small:!0,kind:"secondary",label:"\u2212",onPress:()=>h.set(e,{radius:(0,x.clampRadius)(u.radius-10)},c)}),(0,k.jsxs)(r.T,{weight:"semibold",style:{minWidth:70,textAlign:'center'},children:[u.radius," m"]}),(0,k.jsx)(r.Button,{small:!0,kind:"secondary",label:"+",onPress:()=>h.set(e,{radius:(0,x.clampRadius)(u.radius+10)},c)})]}),(0,k.jsxs)(r.Muted,{size:12,children:["At least ",x.MIN_RADIUS," m. Phones aren\u2019t exact, so up to 50 m of the phone\u2019s own accuracy is added on top."]}),(0,k.jsx)(r.T,{weight:"semibold",children:"Forgotten break: lengths to offer at clock-out"}),(0,k.jsx)(t.TextInput,{accessibilityLabel:"Break lengths in minutes",testID:"clock-break-options",value:L,onChangeText:D,onBlur:()=>{const t=L.split(/[ ,]+/).map(Number).filter(e=>Number.isFinite(e)&&e>0&&e<=180);t.length&&h.set(e,{breakOptions:[...new Set(t)].sort((e,t)=>e-t)},c),D((0,g.areaOf)(e).breakOptions.join(', '))},style:T}),(0,k.jsxs)(r.Muted,{size:12,children:["Minutes, e.g. 5, 10, 15, 20, 30, 45, 60. Shows as ",u.breakOptions.map(x.breakLabel).join(', ')," and \u201cNo break\u201d."]}),p?(0,k.jsx)(r.Muted,{children:"No automatic arrival checks: staff location is used only at clock-in."}):(0,k.jsxs)(k.Fragment,{children:[" ",(0,k.jsx)(r.T,{weight:"semibold",children:"Not on the rota"}),(0,k.jsx)(r.Toggle,{testID:"clock-offrota-on",label:"Ask people at the venue who aren\u2019t on the rota if they want to clock in",value:u.offRotaPrompt,onChange:t=>h.set(e,{offRotaPrompt:t},c)}),(0,k.jsx)(t.TextInput,{accessibilityLabel:"Off-rota question",testID:"clock-offrota-title",value:u.offRotaTitle,onChangeText:t=>h.set(e,{offRotaTitle:t||x.DEFAULT_CLOCK_AREA.offRotaTitle},c),style:T}),(0,k.jsx)(t.TextInput,{accessibilityLabel:"Off-rota second line",testID:"clock-offrota-body",value:u.offRotaBody,onChangeText:t=>h.set(e,{offRotaBody:t||x.DEFAULT_CLOCK_AREA.offRotaBody},c),style:T}),(0,k.jsx)(r.Muted,{size:12,children:"This only checks while the app is open (web apps can\u2019t watch location in the background; that would need a native app)."})]})]})},Object.defineProperty(_e,"resetClockArea",{enumerable:!0,get:function(){return P}}),Object.defineProperty(_e,"COOKSAFE_URL",{enumerable:!0,get:function(){return O}}),_e.FoodSafetyCard=function({children:e}){return(0,k.jsx)(r.Card,{children:(0,k.jsxs)(a.default,{testID:"food-safety",style:{gap:6},children:[(0,k.jsx)(r.T,{size:17,weight:"semibold",children:"Food safety"}),(0,k.jsxs)(r.T,{children:["Based on ",(0,k.jsx)(r.T,{weight:"bold",colour:d.colours.gold,children:"CookSafe"})," (Food Standards Scotland)"]}),(0,k.jsx)(r.Muted,{size:12,children:"CoverCharge is not endorsed by Food Standards Scotland."}),(0,k.jsx)(l.default,{accessibilityRole:"link",testID:"cooksafe-link",onPress:()=>{o.default.openURL(O)},children:(0,k.jsx)(r.T,{size:14,colour:d.colours.gold,children:"Open the CookSafe guidance \u203a"})}),(0,k.jsx)(r.Muted,{size:13,children:"Full logs coming in the next update."}),e]})})};var t=_r(_d[0]),s=_r(_d[1]),n=_r(_d[2]),o=e(_r(_d[3])),l=e(_r(_d[4])),a=e(_r(_d[5])),r=_r(_d[6]),d=_r(_d[7]),c=_r(_d[8]),u=_r(_d[9]),h=_r(_d[10]),p=_r(_d[11]),f=_r(_d[12]),g=_r(_d[13]),x=_r(_d[14]),b=_r(_d[15]),j=_r(_d[16]),y=_r(_d[17]),w=_r(_d[18]),k=_r(_d[19]);const T={minHeight:44,borderRadius:10,borderWidth:1,borderColor:d.colours.hairline,backgroundColor:d.colours.surface2,color:d.colours.text,paddingHorizontal:10,fontSize:15},v=[1,2,3,4,5,6,0],S=['on_shift','everyone','managers','head_chef','kitchen','foh'],I=e=>e.replace(' (example)',''),C={title:'',message:'',days:[3,4,5,6,0],time:'21:00',recipients:{staff:[],groups:[]},sendBy:{inApp:!0,push:!1}};function L({value:e,onChange:t}){const s=(0,h.useOwner)(e=>e.staff).filter(e=>e.active);return(0,k.jsxs)(a.default,{style:{gap:6},testID:"notif-recipients",children:[(0,k.jsx)(r.T,{weight:"semibold",children:"Who gets it"}),(0,k.jsx)(r.Muted,{size:12,children:"Tick people, or pick a group (groups follow the team as it changes)."}),(0,k.jsx)(r.Row,{wrap:!0,gap:6,children:S.map(s=>(0,k.jsx)(r.Chip,{testID:`notif-group-${s}`,label:u.NOTIF_GROUP_LABEL[s],selected:e.groups.includes(s),onPress:()=>t({...e,groups:e.groups.includes(s)?e.groups.filter(e=>e!==s):[...e.groups,s]})},s))}),(0,k.jsx)(r.Muted,{size:12,children:"Only people on shift when it goes, in:"}),(0,k.jsx)(r.Row,{wrap:!0,gap:6,children:Object.keys(u.SHIFT_FILTER_LABEL).map(s=>{const n=(e.onShiftIn??[]).includes(s);return(0,k.jsx)(r.Chip,{testID:`notif-onshift-${s}`,label:u.SHIFT_FILTER_LABEL[s],selected:n,onPress:()=>t({...e,onShiftIn:n?(e.onShiftIn??[]).filter(e=>e!==s):[...e.onShiftIn??[],s]})},s)})}),(0,k.jsx)(a.default,{style:{gap:2},children:s.map(s=>{const n=e.staff.includes(s.id);return(0,k.jsxs)(l.default,{testID:`notif-tick-${s.id}`,accessibilityRole:"checkbox",accessibilityState:{checked:n},onPress:()=>t({...e,staff:n?e.staff.filter(e=>e!==s.id):[...e.staff,s.id]}),style:{flexDirection:'row',alignItems:'center',gap:10,paddingVertical:6},children:[(0,k.jsx)(a.default,{style:{width:22,height:22,borderRadius:5,borderWidth:1.5,borderColor:d.colours.gold,alignItems:'center',justifyContent:'center',backgroundColor:n?'#2a2414':'transparent'},children:n?(0,k.jsx)(r.T,{size:14,colour:d.colours.gold,children:"\u2713"}):null}),(0,k.jsx)(r.T,{style:{flex:1},children:(0,h.staffLabel)({name:I(s.name),nickname:s.nickname})}),(0,k.jsx)(r.Muted,{size:12,children:'Head Chef'===s.level?'Head Chef':s.job})]},s.id)})}),(0,k.jsx)(r.Muted,{size:12,children:"If nobody above matches when it goes, send it to:"}),(0,k.jsxs)(r.Row,{wrap:!0,gap:6,children:[S.filter(e=>'on_shift'!==e).map(s=>{const n=e.fallback??{staff:[],groups:[]},o=n.groups.includes(s);return(0,k.jsx)(r.Chip,{testID:`notif-fallback-${s}`,label:u.NOTIF_GROUP_LABEL[s],selected:o,onPress:()=>{const l=o?n.groups.filter(e=>e!==s):[...n.groups,s];t({...e,fallback:l.length||n.staff.length?{...n,groups:l}:void 0})}},s)}),s.map(s=>{const n=e.fallback??{staff:[],groups:[]},o=n.staff.includes(s.id);return(0,k.jsx)(r.Chip,{testID:`notif-fallback-${s.id}`,label:I(s.name),selected:o,onPress:()=>{const l=o?n.staff.filter(e=>e!==s.id):[...n.staff,s.id];t({...e,fallback:l.length||n.groups.length?{...n,staff:l}:void 0})}},s.id)})]})]})}function D({init:e,onSave:s,onCancel:o}){const[l,c]=(0,n.useState)(e),[h,p]=(0,n.useState)(!!e.dayTimes&&Object.keys(e.dayTimes).length>0),f=(0,u.validateNotif)(l),g=e=>c(t=>({...t,...e}));return(0,k.jsxs)(a.default,{testID:"notif-editor",style:{gap:8,borderWidth:1,borderColor:d.colours.accentBorder,borderRadius:12,padding:10},children:[(0,k.jsx)(r.T,{weight:"semibold",children:"Title"}),(0,k.jsx)(t.TextInput,{accessibilityLabel:"Notification title",testID:"notif-title",value:l.title,onChangeText:e=>g({title:e}),maxLength:60,style:T}),(0,k.jsx)(r.T,{weight:"semibold",children:"Message"}),(0,k.jsx)(t.TextInput,{accessibilityLabel:"Notification message",testID:"notif-message",value:l.message,onChangeText:e=>g({message:e}),maxLength:160,style:T}),(0,k.jsx)(r.T,{weight:"semibold",children:"Days"}),(0,k.jsx)(r.Row,{wrap:!0,gap:6,children:v.map(e=>(0,k.jsx)(r.Chip,{testID:`notif-day-${e}`,label:u.NOTIF_DAY_NAMES[e],selected:l.days.includes(e),onPress:()=>g({days:l.days.includes(e)?l.days.filter(t=>t!==e):[...l.days,e]})},e))}),(0,k.jsxs)(r.Row,{gap:8,children:[(0,k.jsx)(r.T,{weight:"semibold",children:"Time (UK)"}),(0,k.jsx)(t.TextInput,{accessibilityLabel:"Time",testID:"notif-time",value:l.time,onChangeText:e=>g({time:e}),placeholder:"21:00",style:{...T,width:90,borderColor:(0,u.validHm)(l.time)?d.colours.hairline:d.colours.red}})]}),(0,k.jsx)(r.Toggle,{label:"A different time on some days",value:h,onChange:e=>{p(e),e||g({dayTimes:void 0})}}),h?(0,k.jsx)(r.Row,{wrap:!0,gap:8,children:v.filter(e=>l.days.includes(e)).map(e=>(0,k.jsxs)(r.Row,{gap:4,children:[(0,k.jsx)(r.T,{size:13,children:u.NOTIF_DAY_NAMES[e]}),(0,k.jsx)(t.TextInput,{accessibilityLabel:`${u.NOTIF_DAY_NAMES[e]} time`,testID:`notif-daytime-${e}`,value:l.dayTimes?.[String(e)]??'',placeholder:l.time,onChangeText:t=>{const s={...l.dayTimes??{}};t.trim()?s[String(e)]=t.trim():delete s[String(e)],g({dayTimes:s})},style:{...T,width:74}})]},e))}):null,(0,k.jsx)(L,{value:l.recipients,onChange:e=>g({recipients:e})}),(0,k.jsx)(r.T,{weight:"semibold",children:"Send by"}),(0,k.jsx)(r.Toggle,{testID:"notif-inapp",label:"In the app (gold slider, Done / Later)",value:l.sendBy.inApp,onChange:e=>g({sendBy:{...l.sendBy,inApp:e}})}),(0,k.jsx)(r.Toggle,{testID:"notif-push",label:"Phone notification (when phones are switched on)",value:l.sendBy.push,onChange:e=>g({sendBy:{...l.sendBy,push:e}})}),f?(0,k.jsx)(r.Muted,{size:13,children:f}):null,(0,k.jsxs)(r.Row,{gap:8,style:{justifyContent:'flex-end'},children:[(0,k.jsx)(r.Button,{small:!0,kind:"ghost",label:"Cancel",onPress:o}),(0,k.jsx)(r.Button,{small:!0,testID:"notif-save",label:"Save",disabled:!!f,onPress:()=>s({...l,title:l.title.trim(),message:l.message.trim(),days:[...l.days].sort()})})]})]})}function R(){const[e,t]=(0,n.useState)(null),[s,o]=(0,n.useState)('');return(0,n.useEffect)(()=>{(0,y.pushState)().then(t)},[]),e&&'unsupported'!==e?(0,k.jsxs)(a.default,{testID:"push-button",style:{gap:4},children:[(0,k.jsx)(r.Button,{small:!0,kind:'on'===e?'ghost':'secondary',testID:"push-turn-on",label:'on'===e?'Phone notifications are on for this phone \xb7 Turn off':'\ud83d\udd14 Turn on phone notifications',onPress:()=>{('on'===e?(0,y.turnOffPush)():(0,y.turnOnPush)()).then(e=>{o(e.message),(0,y.pushState)().then(t)})}}),(0,k.jsx)(r.Muted,{size:12,children:s||('ios-home-screen'===e?'iPhone: add this app to your Home Screen first (iOS 16.4 or later).':'For this phone only. Each person turns it on on their own phone.')})]}):null}const B=e=>p.useOrderLists.getState().resetSettings(e);const P=(e,t)=>g.useClockArea.getState().reset(e,t),O='https://www.foodstandards.gov.scot/publications-and-research/publications/cooksafe-manual'},1043,[796,991,34,379,402,102,794,840,1021,1022,865,1025,1026,1027,992,1044,985,1045,994,25]); __d(function(_g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.getFix=function(e=1e4){const t='undefined'!=typeof navigator?navigator.geolocation:void 0;return t?new Promise(o=>{let n=!1;const c=e=>{n||(n=!0,o(e))},u=setTimeout(()=>c('timeout'),e+1500);try{t.getCurrentPosition(e=>{clearTimeout(u),c({lat:e.coords.latitude,lng:e.coords.longitude,acc:e.coords.accuracy??999})},e=>{clearTimeout(u),c(1===e.code?'denied':3===e.code?'timeout':'unavailable')},{enableHighAccuracy:!0,timeout:e,maximumAge:0})}catch{clearTimeout(u),c('unsupported')}}):Promise.resolve('unsupported')},_e.locationAllowed=async function(){try{const e=await(navigator.permissions?.query({name:'geolocation'}));return'granted'===e?.state}catch{return!1}}},1044,[]); __d(function(g,r,_i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.pushState=f,e.turnOnPush=async function(){const u=await f();if('ios-home-screen'===u)return{ok:!1,message:'On iPhone, add this app to your Home Screen first (Share \u203a Add to Home Screen, iOS 16.4 or later), then open it from there.'};if('unsupported'===u)return{ok:!1,message:'This browser can\u2019t get phone notifications. Try Chrome on Android, or the app from your iPhone Home Screen.'};if('blocked'===u)return{ok:!1,message:'Notifications are blocked for this app. Allow them in your phone\u2019s settings, then try again.'};const c=i.useSync.getState();if('staff'!==c.kind||!c.venueId||!c.staffRef)return{ok:!1,message:'Sign in from your personal link first.'};if('granted'!==await Notification.requestPermission())return{ok:!1,message:'You didn\u2019t allow notifications, so nothing changed.'};const p=await navigator.serviceWorker.ready,h=(await p.pushManager.getSubscription()??await p.pushManager.subscribe({userVisibleOnly:!0,applicationServerKey:s(n.VAPID_PUBLIC_KEY)})).toJSON();if(!h.endpoint||!h.keys?.p256dh||!h.keys?.auth)return{ok:!1,message:'Your browser didn\u2019t give a usable subscription. Try again.'};const l=(0,t.getSupabase)(),{error:y}=await l.from('push_subscriptions').upsert({venue_id:c.venueId,staff_ref:c.staffRef,app:o.APP_VARIANT,endpoint:h.endpoint,p256dh:h.keys.p256dh,auth:h.keys.auth,user_agent:navigator.userAgent.slice(0,200)},{onConflict:'user_id,endpoint'});return y?{ok:!1,message:`Couldn\u2019t save this phone: ${y.message}`}:{ok:!0,message:'Phone notifications are on for this device.'}},e.turnOffPush=async function(){const n=await(navigator.serviceWorker?.getRegistration()),i=await(n?.pushManager.getSubscription());if(!i)return{ok:!0,message:'Phone notifications are off for this device.'};const o=i.endpoint;await i.unsubscribe();try{const n=(0,t.getSupabase)();await n.from('push_subscriptions').delete().eq('endpoint',o)}catch{}return{ok:!0,message:'Phone notifications are off for this device.'}};var n=r(d[0]),t=r(d[1]),i=r(d[2]),o=r(d[3]);const s=n=>{const t=atob(n.replace(/-/g,'+').replace(/_/g,'/')+'='.repeat((4-n.length%4)%4)),i=new Uint8Array(t.length);for(let n=0;n'undefined'!=typeof navigator&&/iPhone|iPad|iPod/.test(navigator.userAgent),c=()=>'undefined'!=typeof window&&(window.matchMedia?.('(display-mode: standalone)').matches||!0===navigator.standalone);async function f(){if('undefined'==typeof window||!('serviceWorker'in navigator))return'unsupported';if(!('PushManager'in window)||'undefined'==typeof Notification)return u()&&!c()?'ios-home-screen':'unsupported';if('denied'===Notification.permission)return'blocked';const n=await navigator.serviceWorker.getRegistration();return await(n?.pushManager.getSubscription())?'on':'off'}},1045,[1046,931,985,846]); @@ -1191,11 +1191,11 @@ __d(function(g,r,i,_a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule' __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 v}}),Object.defineProperty(_e,"fitLabel",{enumerable:!0,get:function(){return M}}),Object.defineProperty(_e,"BIG_LABEL_MIN",{enumerable:!0,get:function(){return j}}),_e.areaBounds=k,_e.minReadableScale=function(e,t){return Math.max(0,...e.tables.filter(e=>e.areaId===t).map(e=>{const t='round'===e.shape?.85:1,o=(7.4399999999999995*Math.max(1,(0,x.tableNumber)(e).length)+6)/(e.w*t),n=22/Math.min(e.w,e.h);return Math.max(o,n)}))},_e.seatSpots=S,_e.FixtureShape=R,_e.FloorCanvas=function(e){const[C,$]=(0,r.useState)({w:0,h:0}),I=e.plan.tables.filter(t=>t.areaId===e.areaId),A=e.crop&&I.length?k(e.plan,e.areaId):{x:0,y:0,w:l.PLAN_W,h:l.PLAN_H},z='live'===e.mode?[...new Map(I.flatMap(t=>{const o=e.view?.[t.name];if(!o?.group||o.group.length<2)return[];const n=[...o.group].sort().join('+');return[[n,{key:n,members:o.group,view:o}]]})).values()]:[],L=28*z.length,E={x:A.x,y:A.y,r:A.x+A.w,b:A.y+A.h},D=C.w?'width'===e.fit?Math.min(C.w/l.PLAN_W,e.maxH?e.maxH/l.PLAN_H:9):Math.min(C.w/A.w,Math.max(1,C.h-L)/A.h):0,F=e.fill&&'contain'===e.fit&&D>0&&C.h>0,_=F?(C.w/D-A.w)/2:0,O=F?((C.h-L)/D-A.h)/2:0,N={x:E.x-_,y:E.y-O,r:E.r+_,b:E.b+O},B=N.r-N.x,P=N.b-N.y,[W,H]=(0,r.useState)(null),G=(0,r.useRef)(null),[Y,X]=(0,r.useState)(null),U=(0,r.useRef)(null);U.current=Y,i.default.useEffect(()=>{if(!Y)return;const e=setTimeout(()=>X(null),n.ARM_MS);return()=>clearTimeout(e)},[Y]);const q='live'===e.mode&&!!e.onDrop,J=e=>!q||(0,n.isArmed)(U.current,e.id,Date.now()),K=t=>e.plan.sections.find(e=>e.id===t.sectionId),V=t=>e.plan.joins.find(e=>e.tables.includes(t.name)),Q=i.default.useMemo(()=>(0,x.numberClashes)(e.plan.tables).sameArea,[e.plan.tables]),Z=(t,o)=>({onStartShouldSetResponder:()=>!0,onMoveShouldSetResponder:()=>J(t),onResponderTerminationRequest:()=>!J(t),onResponderGrant:e=>{G.current={x:e.nativeEvent.pageX,y:e.nativeEvent.pageY,id:t.id,kind:o}},onResponderMove:n=>{const r=G.current;if(!r)return;const i=n.nativeEvent.pageX-r.x,s=n.nativeEvent.pageY-r.y;Math.abs(i)+Math.abs(s)<6&&!W||J(t)&&('live'!==e.mode||e.onDrop&&e.view&&['seated','mains','dessert','bill'].includes(e.view[t.name]?.status)&&e.view[t.name]?.booking)&&H({id:t.id,dx:i,dy:s,kind:o})},onResponderRelease:r=>{const i=G.current;G.current=null;const a=r.nativeEvent.pageX-(i?.x??0),u=r.nativeEvent.pageY-(i?.y??0);if(H(null),Math.abs(a)+Math.abs(u)<6||!D){if('move'===o){if(q){const e=(0,n.releaseOn)(U.current,t.id,!1,Date.now());if(X(e.arm),'select'===e.action)try{s.default.announceForAccessibility(n.SELECTED_A11Y)}catch{}}e.onTap?.(t)}return}if(q){const e=(0,n.releaseOn)(U.current,t.id,!0,Date.now());if(X(e.arm),'move'!==e.action)return}const h=a/D,c=u/D;if('edit'===e.mode&&'move'===o)e.onMove?.(t,w(v(t.x+h,e.snapOn),0,l.PLAN_W-t.w),w(v(t.y+c,e.snapOn),0,l.PLAN_H-t.h));else if('edit'===e.mode&&'resize'===o)e.onResize?.(t,w(v(t.w+h,e.snapOn),50,400),w(v(t.h+c,e.snapOn),50,300));else if('live'===e.mode&&e.onDrop){const o=t.x+t.w/2+h,n=t.y+t.h/2+c,r=I.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);r&&e.onDrop(t,r)}}}),ee=e=>e*D,te=e=>ee(e-N.x),oe=e=>ee(e-N.y),ne='width'===e.fit?l.PLAN_H*D+L||200:void 0;return(0,g.jsxs)(a.default,{testID:"floor-canvas",onLayout:e=>$({w:e.nativeEvent.layout.width,h:e.nativeEvent.layout.height}),style:[{width:'100%',borderRadius:16,overflow:'hidden'},'contain'===e.fit?{flex:1}:{height:ne}],children:[z.map(e=>{const o=I.filter(t=>e.members.includes(t.name)),n=o.length?(Math.min(...o.map(e=>e.x))+Math.max(...o.map(e=>e.x+e.w)))/2:N.x+B/2,r=e.view.booking?.time??e.view.next?.time,i=`${T(e.members)}${r?` \xb7 ${'seated'===e.view.status?'Seated':'Booked'} ${r}`:''}`,s=Math.min(Math.max(0,C.w-8),260);return(0,g.jsx)(a.default,{testID:`joined-label-${e.key}`,accessible:!0,accessibilityLabel:`Joined tables ${i}`,pointerEvents:"none",style:{height:28,width:s,marginLeft:w(ee(n-N.x)-s/2,4,Math.max(4,C.w-s-4)),alignItems:'center',justifyContent:'center',overflow:'hidden',borderRadius:8,borderWidth:1,borderColor:h.colours.gold,backgroundColor:(0,t.soutersSurface)('#0B0B0B')},children:(0,g.jsx)(c.T,{size:16,weight:"bold",colour:h.colours.goldLight,center:!0,numberOfLines:1,children:i})},e.key)}),D?(0,g.jsx)(a.default,{style:{width:ee(B),height:ee(P),alignSelf:'center',backgroundColor:(0,t.soutersSurface)('#0F0E0C'),borderRadius:16,borderWidth:1,borderColor:h.colours.border,overflow:'hidden'},children:(0,g.jsxs)(a.default,{style:{position:'absolute',left:0,top:0,width:ee(B),height:ee(P)},children:['edit'===e.mode?Array.from({length:l.PLAN_W/(2*l.GRID)},(e,o)=>(0,g.jsx)(a.default,{style:{position:'absolute',left:te(o*l.GRID*2),top:0,bottom:0,width:1,backgroundColor:(0,t.soutersSurface)('#1E1B16')}},`v${o}`)):null,'edit'===e.mode?Array.from({length:l.PLAN_H/(2*l.GRID)},(e,o)=>(0,g.jsx)(a.default,{style:{position:'absolute',top:oe(o*l.GRID*2),left:0,right:0,height:1,backgroundColor:(0,t.soutersSurface)('#1E1B16')}},`h${o}`)):null,(e.plan.fixtures??[]).filter(t=>t.areaId===e.areaId).map(t=>(0,g.jsx)(R,{f:{...t,x:t.x-N.x,y:t.y-N.y},S:ee,live:'live'===e.mode},t.id)),e.plan.joins.map(e=>{const t=I.filter(t=>e.tables.includes(t.name));if(t.length<2)return null;const[o,n]=t,r=o.x+o.w/2,i=o.y+o.h/2,s=n.x+n.w/2,l=n.y+n.h/2,u=Math.hypot(s-r,l-i),h=Math.atan2(l-i,s-r);return(0,g.jsx)(a.default,{testID:`join-${e.tables.join('+')}`,style:{position:'absolute',left:te((r+s)/2-u/2),top:oe((i+l)/2)-3,width:ee(u),height:6,borderRadius:3,backgroundColor:'rgba(207,164,95,0.55)',transform:[{rotate:`${h}rad`}]}},e.id)}),I.map(n=>{const r=e.view?.[n.name],s=r?u.STATUS[r.status]:u.STATUS.free,v=W?.id===n.id,w=v&&'resize'===W.kind?Math.max(50,n.w+W.dx/D):n.w,C=v&&'resize'===W.kind?Math.max(50,n.h+W.dy/D):n.h,k=v&&'move'===W.kind?n.x+W.dx/D:n.x,R=v&&'move'===W.kind?n.y+W.dy/D:n.y,T=e.selected===n.id||e.highlight?.includes(n.name)||Y?.id===n.id,$=K(n),I='edit'===e.mode?'#2A2419':s.colour,A='edit'===e.mode?h.colours.text:s.fg,z='round'===n.shape?ee(Math.min(w,C))/2:ee(10),L='live'===e.mode?(0,x.liveTableLabel)(n,Q):(0,l.tableLabel)(n),E=ee(Math.min(w,C))<64,F=M(e.big?Math.max(13,Math.min(34,ee(Math.min(w,C))/3)):Math.max(11,Math.min(22,ee(Math.min(w,C))/4)),L,ee(w)*('round'===n.shape?.85:1),e.big?j:9),_=Math.max(e.big?11:12,Math.round(.62*F)),O=(ee(C)-6-1.4*F)/(1.4*_),N=O>=2&&ee(w)>=5*_?2:O>=1?1:0,B=r?.booking&&void 0!==r.seatedMins?r.booking.time:void 0,P='soon'===r?.status?r.next?.time??r.dayBookings?.[0]?.time:void 0,H='edit'===e.mode?`Table ${(0,o.tableNumbers)(L)}, ${(0,l.shapeLabel)(n.shape).toLowerCase()}, ${n.minSeats}\u2013${n.maxSeats} seats${n.online?', bookable online':''}`:'soon'===r?.status?`Table ${(0,o.tableNumbers)(L)}, booked later${P?`, ${P}`:''}${r.group?`, combined with ${r.group.filter(e=>e!==n.name).map(e=>`table ${e}`).join(', ')}`:''}`:`Table ${(0,o.tableNumbers)(L)}, ${s.label}${void 0!==r?.seatedMins?`, seated ${r.seatedMins} min`:''}${r?.covers?`, ${r.covers} Covers`:''}${r?.dayBookings?.length?`, booked: ${r.dayBookings.map(e=>`${e.time}, ${e.partySize} Covers`).join('; ')}`:''}${r?.group?`, combined with ${r.group.filter(e=>e!==n.name).map(e=>`table ${e}`).join(', ')}`:''}`,G=void 0!==r?.seatedMins&&r.booking?Math.min(1.2,r.seatedMins/(r.booking.durationMins??(0,u.turnFor)(r.booking.partySize,e.turnBase))):null;return(0,g.jsxs)(i.default.Fragment,{children:[S({...n,w:w,h:C}).map((t,o)=>(0,g.jsx)(a.default,{pointerEvents:"none",style:[{position:'absolute',left:te(k+t.x)-Math.max(4,ee(8)),top:oe(R+t.y)-Math.max(4,ee(8)),width:Math.max(8,ee(16)),height:Math.max(8,ee(16)),borderRadius:99,backgroundColor:'edit'===e.mode?'#5A4C33':'rgba(255,255,255,0.16)',borderWidth:1,borderColor:'edit'===e.mode?h.colours.gold:'rgba(255,255,255,0.25)'},y()]},o)),'live'===e.mode&&(ee(w)<44||ee(C)<44)?(0,g.jsx)(a.default,{accessible:!1,importantForAccessibility:"no-hide-descendants",'aria-hidden':!0,...Z(n,'move'),style:{position:'absolute',left:te(k+w/2)-Math.max(44,ee(w))/2,top:oe(R+C/2)-Math.max(44,ee(C))/2,width:Math.max(44,ee(w)),height:Math.max(44,ee(C)),zIndex:2}}):null,(0,g.jsxs)(a.default,{testID:`table-${n.name}`,accessibilityRole:"button",accessibilityLabel:H,onAccessibilityTap:()=>e.onTap?.(n),onKeyDown:t=>{'Enter'!==t?.key&&' '!==t?.key||e.onTap?.(n)},tabIndex:0,...Z(n,'move'),style:[{position:'absolute',left:te(k),top:oe(R),width:ee(w),height:ee(C),borderRadius:z,backgroundColor:I,alignItems:'center',justifyContent:'center',padding:2,overflow:'hidden',borderWidth:T?3:e.sectionColours&&$?2.5:1.5,borderColor:T?'#FFFFFF':e.sectionColours&&$?(0,h.brandColour)($.colour):'edit'===e.mode?h.colours.gold:'rgba(0,0,0,0.35)',transform:[{scale:v?1.06:1}],zIndex:v?50:3,opacity:v&&'live'===e.mode?.85:1,shadowColor:'#000',shadowOpacity:v?.6:.3,shadowRadius:v?14:6,cursor:'edit'===e.mode?'grab':'pointer',touchAction:'none'},v?null:y()],children:[(0,g.jsxs)(a.default,{style:{alignItems:'center',justifyContent:'center',maxWidth:'100%',maxHeight:'100%',overflow:'hidden'},pointerEvents:"none",children:[(0,g.jsx)(c.T,{style:p,weight:"bold",size:F,colour:A,center:!0,numberOfLines:1,children:L}),'live'===e.mode&&'blocked'===r?.status?(0,g.jsx)(c.T,{style:f,size:Math.max(10,Math.round(.5*F)),weight:"semibold",colour:A,center:!0,numberOfLines:1,children:"Blocked"}):null,'live'===e.mode&&r?.group&&r.group.length>1?null:e.big&&'live'===e.mode&&r&&1===N?'free'!==r.status&&'soon'!==r.status&&(r.covers||B)?(0,g.jsx)(c.T,{style:f,size:_,weight:"bold",colour:A,center:!0,numberOfLines:1,children:[r.covers?`${r.covers}`:'',B??''].filter(Boolean).join(' \xb7 ')}):null:e.big&&'live'===e.mode&&r&&2===N?(0,g.jsxs)(g.Fragment,{children:['soon'!==r.status&&r.covers?(0,g.jsxs)(c.T,{style:f,size:_,weight:"semibold",colour:A,center:!0,children:[r.covers," ",1===r.covers?'Cover':'Covers']}):'free'!==r.status||E?null:(0,g.jsxs)(c.T,{style:f,size:_,colour:A,center:!0,children:[n.minSeats,"\u2013",n.maxSeats]}),'free'!==r.status&&'soon'!==r.status&&B?(0,g.jsx)(c.T,{style:f,size:_,weight:"bold",colour:A,center:!0,children:B}):'dirty'===r.status?(0,g.jsx)(c.T,{style:f,size:_,colour:A,center:!0,children:"Clear"}):null]}):e.big&&'live'===e.mode?null:'edit'===e.mode?E?null:(0,g.jsxs)(c.T,{style:f,size:11,colour:h.colours.muted,center:!0,children:[n.minSeats,"\u2013",n.maxSeats,n.online?' \xb7 online':'']}):r?(0,g.jsxs)(g.Fragment,{children:['free'!==r.status||E?null:(0,g.jsxs)(c.T,{style:f,size:11,colour:A,center:!0,children:[n.minSeats,"\u2013",n.maxSeats," seats"]}),void 0!==r.seatedMins?(0,g.jsxs)(c.T,{style:f,size:12,weight:"semibold",colour:A,center:!0,children:[r.seatedMins,"m \xb7 ",r.covers,"\ud83d\udc65"]}):r.orderOnly?(0,g.jsx)(c.T,{style:f,size:11,colour:A,center:!0,children:"Open order"}):null,'dirty'!==r.status||E?null:(0,g.jsx)(c.T,{style:f,size:11,colour:A,center:!0,children:"Clear"}),!E||r.allergy||r.vip?(0,g.jsxs)(c.T,{style:f,size:11,colour:A,center:!0,children:[r.allergy?'\u26a0':'',r.vip?'VIP'===r.vip?'\u2605':'\u2665':'',r.occasion?u.OCCASION_ICON[r.occasion]:'',r.note?'\u270e':'']}):null]}):null]}),null,'live'===e.mode&&r&&!E&&(r.booking??r.next)&&(0,b.needsIcons)(r.booking??r.next).replace('\u26a0\ufe0f','').trim()?(0,g.jsx)(a.default,{pointerEvents:"none",testID:`needs-${n.name}`,style:{position:'absolute',bottom:e.big?-Math.max(9,.55*_):2,right:e.big?-6:4,backgroundColor:(0,t.soutersSurface)('rgba(11,11,11,0.85)'),borderRadius:8,paddingHorizontal:4,borderWidth:1,borderColor:'rgba(255,255,255,0.15)'},children:(0,g.jsx)(c.T,{size:e.big?Math.max(11,.75*_):10,children:(0,b.needsIcons)(r.booking??r.next).replace('\u26a0\ufe0f','').trim()})}):null,$&&'live'===e.mode&&e.sectionColours&&!E&&!e.big?(0,g.jsx)(a.default,{pointerEvents:"none",style:{position:'absolute',top:3,right:6,backgroundColor:(0,h.brandColour)($.colour),borderRadius:6,paddingHorizontal:3},children:(0,g.jsx)(c.T,{size:9,weight:"bold",colour:"#0B0B0B",children:$.server})}):null,null===G||E?null:(0,g.jsx)(a.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,g.jsx)(a.default,{style:{width:`${Math.min(100,100*G)}%`,height:4,borderRadius:2,backgroundColor:G>=1?'#B3261E':'rgba(0,0,0,0.6)'}})}),V(n)&&'edit'===e.mode?(0,g.jsx)(a.default,{pointerEvents:"none",style:{position:'absolute',bottom:2,left:4},children:(0,g.jsx)(c.T,{size:10,colour:h.colours.gold,children:"\u26d3"})}):null]}),'edit'===e.mode&&e.selected===n.id?(0,g.jsx)(a.default,{testID:"resize-handle",accessibilityLabel:"Resize table",...Z(n,'resize'),style:{position:'absolute',left:te(k+w)-14,top:oe(R+C)-14,width:28,height:28,borderRadius:14,backgroundColor:h.colours.gold,borderWidth:2,borderColor:'#fff',zIndex:60,cursor:'nwse-resize',touchAction:'none'}}):null]},n.id)}),0===I.length?(0,g.jsx)(a.default,{style:{position:'absolute',left:0,right:0,top:'45%'},children:(0,g.jsxs)(c.T,{center:!0,colour:h.colours.muted,children:["No tables in this area yet",'edit'===e.mode?' \u2014 add some in Tables':'',"."]})}):null]})}):null]})};var t=_r(d[0]),o=_r(d[1]),n=_r(d[2]),r=_r(d[3]),i=e(r),s=e(_r(d[4]));_r(d[5]);var a=e(_r(d[6])),l=_r(d[7]),u=_r(d[8]),h=_r(d[9]),c=_r(d[10]),b=_r(d[11]),x=_r(d[12]),g=_r(d[13]);const f={flexShrink:0},p={flexShrink:0,maxWidth:'none'},y=(e=250)=>({transitionProperty:'background-color, border-color, transform, left, top, width, height',transitionDuration:`${e}ms`}),v=(e,t=!0)=>t?Math.round(e/l.GRID)*l.GRID:Math.round(e),w=(e,t,o)=>Math.max(t,Math.min(o,e)),M=(e,t,o,n=9)=>Math.max(n,Math.min(e,(o-6)/(.62*Math.max(1,t.length)))),j=12,C=46;function k(e,t){const o=e.tables.filter(e=>e.areaId===t);if(!o.length)return{x:0,y:0,w:l.PLAN_W,h:l.PLAN_H};const n=Math.max(0,Math.min(...o.map(e=>e.x))-C),r=Math.max(0,Math.min(...o.map(e=>e.y))-C);return{x:n,y:r,w:Math.min(l.PLAN_W,Math.max(...o.map(e=>e.x+e.w))+C)-n,h:Math.min(l.PLAN_H,Math.max(...o.map(e=>e.y+e.h))+C)-r}}function S(e){const t=Math.max(1,e.maxSeats),o=[];if('round'===e.shape){const n=e.w/2+9.6,r=e.h/2+9.6;for(let i=0;ie.w,r=Math.ceil(t/2),i=t-r;if(n){for(let t=0;te.w,s=n?{borderColor:'#FFFFFF',borderWidth:2}:null;return'bar'===e.kind?(0,g.jsx)(a.default,{pointerEvents:"none",style:[r,{backgroundColor:o?'#2A2216':'#3A2E1C',borderRadius:8,borderWidth:1.5,borderColor:o?'#5A4A30':h.colours.gold},s],children:(0,g.jsx)(c.T,{size:Math.max(9,Math.min(14,t(e.h)/2.4)),weight:"semibold",colour:h.colours.goldLight,children:"BAR"})}):'wall'===e.kind?(0,g.jsx)(a.default,{pointerEvents:"none",style:[r,{backgroundColor:o?'#3A3631':'#5C574F',borderRadius:2},s]}):'window'===e.kind?(0,g.jsx)(a.default,{pointerEvents:"none",style:[r,{backgroundColor:'rgba(226,196,137,0.16)',borderColor:'rgba(226,196,137,0.6)',borderWidth:1,borderRadius:2},s],children:!o&&t(i?e.h:e.w)>60?(0,g.jsx)(c.T,{size:9,colour:"#BFDDFF",style:i?{transform:[{rotate:'90deg'}]}:void 0,children:"WINDOW"}):null}):(0,g.jsx)(a.default,{pointerEvents:"none",style:[r,{borderColor:o?'#7A6440':h.colours.gold,borderWidth:1.5,borderStyle:'dashed',borderRadius:3,backgroundColor:'rgba(207,164,95,0.08)'},s],children:t(i?e.h:e.w)>40?(0,g.jsx)(c.T,{size:9,colour:h.colours.goldLight,style:i?{transform:[{rotate:'90deg'}]}:void 0,children:"DOOR"}):null})}function T(e){return(0,l.tablesLabel)(e.join('+')).replace(/^Tables? /,'').replace(/ \+ /g,'+')}},1108,[798,829,1109,34,281,236,102,1014,1079,840,794,1081,828,25]); __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"ARM_MS",{enumerable:!0,get:function(){return t}}),Object.defineProperty(e,"SELECT_HINT",{enumerable:!0,get:function(){return n}}),Object.defineProperty(e,"SELECTED_A11Y",{enumerable:!0,get:function(){return o}}),Object.defineProperty(e,"TABLE_SELECT_HINT",{enumerable:!0,get:function(){return c}}),Object.defineProperty(e,"isArmed",{enumerable:!0,get:function(){return l}}),e.releaseOn=function(n,o,c,u){const b=l(n,o,u);return c?b?{arm:null,action:'move'}:{arm:n&&u-n.at!!n&&n.id===o&&c-n.at!e.signOff),S=k.filter(e=>e.signOff),_=j.map(o.allergenLabel).join(', '),C=e=>e.map(e=>e.name).join(', ')||'none';return(0,f.jsxs)(l.default,{testID:"menu-allergy-check",style:{gap:6,borderWidth:1,borderColor:p.length?h.colours.red:h.colours.border,borderRadius:12,padding:10,backgroundColor:h.colours.surface2},children:[(0,f.jsxs)(u.T,{weight:"semibold",children:["Allergy check against the menu (",_,")"]}),(0,f.jsxs)(u.T,{size:14,colour:h.colours.red,children:["Contains: ",p.length," dish",1===p.length?'':'es']}),(0,f.jsxs)(u.T,{size:14,colour:h.colours.amber,children:["May contain: ",M.length]}),(0,f.jsxs)(u.T,{size:14,colour:h.colours.ok,children:["Free from ",1===j.length?'it':'them'," (signed off): ",S.length]}),w.length?(0,f.jsxs)(u.Muted,{children:[w.length," more awaiting the head chef's sign-off, so not shown as safe."]}):null,(0,f.jsx)(n.default,{testID:"menu-allergy-details",accessibilityRole:"button",onPress:()=>y(!x),hitSlop:6,children:(0,f.jsx)(u.T,{size:14,colour:h.colours.gold,children:x?'Hide dishes':'Show dishes'})}),x?(0,f.jsxs)(l.default,{style:{gap:4},children:[(0,f.jsxs)(u.Muted,{children:["Contains: ",C(p)]}),(0,f.jsxs)(u.Muted,{children:["May contain: ",C(M)]}),(0,f.jsxs)(u.Muted,{children:["Free from: ",C(S)]})]}):null,(0,f.jsx)(u.Muted,{children:'guest'===m?'From the kitchen\u2019s signed-off recipe cards. Specials on the board are checked by staff on the day.':'From the signed-off recipe cards. Specials on the board have their own allergens. Still check with the guest and the kitchen.'})]})};var s=r(d[0]),n=e(r(d[1])),l=e(r(d[2])),t=r(d[3]),o=r(d[4]),c=r(d[5]),h=r(d[6]),u=r(d[7]),f=r(d[8])},1110,[34,402,102,848,830,832,840,794,25]); -__d(function(g,r,i,a,m,e,_d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"NOTES_PLACEHOLDER",{enumerable:!0,get:function(){return o}}),Object.defineProperty(e,"WIX_EDIT_NOTE",{enumerable:!0,get:function(){return s}}),e.canEditBooking=function(t){return'customer'!==t.variant&&('staff'===t.variant||t.inStaffApp?!!t.shiftManager:'display'===t.variant||'chef'===t.variant||'staff'!==t.role)},Object.defineProperty(e,"isWixBooking",{enumerable:!0,get:function(){return l}}),Object.defineProperty(e,"EDIT_FIELDS",{enumerable:!0,get:function(){return d}}),Object.defineProperty(e,"FIELD_WORDS",{enumerable:!0,get:function(){return c}}),Object.defineProperty(e,"draftOf",{enumerable:!0,get:function(){return u}}),e.changedFields=p,e.editPatch=function(n,o,s,l=(new Date).toISOString()){const d=p(n,o);if(!d.length)return{};const c={};for(const n of d){const s=f(n,o[n]);c[n]='partySize'===n?(0,t.clampParty)(s):'phone'===n||'email'===n||'table'===n?s||void 0:s}d.includes('table')&&(c.tableSetHere=!0);const u=n;return c.locallyEdited=!0,c.editedFields=[...new Set([...u.editedFields??[],...d])],c.editLog=[...u.editLog??[],{at:l,by:s.by.slice(0,80),app:s.app,fields:d}].slice(-50),c},e.editWarnings=function(t,o,s,l,d=90){const c=[],u={...t,date:o.date,time:o.time,partySize:o.partySize};if(o.table){const t=(0,n.tableOverlaps)(u,o.table,s.filter(t=>t.date===o.date),d);t.length&&c.push(`The table already has a booking at about the same time: ${t.map(t=>`${t.time} ${t.walkIn?'walk-in':t.name}`).join(', ')}.`)}l&&c.push(`Bookings are paused ${l.from} to ${l.to}${l.reason?` (${l.reason})`:''}.`);return c},Object.defineProperty(e,"editedWords",{enumerable:!0,get:function(){return b}});var t=r(_d[0]),n=r(_d[1]);const o='For example: birthday, high chair, dog, window seat',s='This booking came from the website. Changes here are not sent to website bookings yet.';const l=t=>{const n=t;return'Wix'===n.importedFrom||!!n.wix||(t.tags??[]).includes('Wix')},d=['date','time','partySize','name','phone','email','notes','table'],c={date:'date',time:'time',partySize:'covers',name:'name',phone:'phone',email:'email',notes:'notes',table:'table'},u=t=>({date:t.date,time:t.time,partySize:t.partySize,name:t.name,phone:t.phone??'',email:t.email??'',notes:t.notes??'',table:t.table??''}),f=(t,n)=>'partySize'===t?Number(n):String(n??'').trim();function p(t,n){const o=u(t);return d.filter(t=>f(t,o[t])!==f(t,n[t]))}const b=t=>t.map(t=>c[t]).join(', ')},1111,[1098,1092]); +__d(function(g,r,i,_a,m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"NOTES_PLACEHOLDER",{enumerable:!0,get:function(){return a}}),Object.defineProperty(_e,"WIX_EDIT_NOTE",{enumerable:!0,get:function(){return s}}),Object.defineProperty(_e,"NOTIFY_LABEL",{enumerable:!0,get:function(){return o}}),Object.defineProperty(_e,"guestMessageFields",{enumerable:!0,get:function(){return n}}),_e.canEditBooking=function(e){return'customer'!==e.variant&&('staff'===e.variant||e.inStaffApp?!!e.shiftManager:'display'===e.variant||'chef'===e.variant||'staff'!==e.role)},Object.defineProperty(_e,"isWixBooking",{enumerable:!0,get:function(){return d}}),Object.defineProperty(_e,"EDIT_FIELDS",{enumerable:!0,get:function(){return c}}),Object.defineProperty(_e,"DEPOSIT_METHODS",{enumerable:!0,get:function(){return u}}),Object.defineProperty(_e,"EDIT_STATUSES",{enumerable:!0,get:function(){return l}}),Object.defineProperty(_e,"SOURCES",{enumerable:!0,get:function(){return h}}),Object.defineProperty(_e,"OCCASIONS",{enumerable:!0,get:function(){return p}}),Object.defineProperty(_e,"TAGS",{enumerable:!0,get:function(){return b}}),Object.defineProperty(_e,"FIELD_WORDS",{enumerable:!0,get:function(){return f}}),Object.defineProperty(_e,"draftOf",{enumerable:!0,get:function(){return y}}),_e.changedFields=N,_e.historyText=k,_e.editPatch=function(t,a,s,o=(new Date).toISOString()){const n=N(t,a);if(!n.length)return{};const d={};for(const c of n)switch(c){case'partySize':d.partySize=(0,e.clampParty)(Number(a.partySize));break;case'phone':case'email':case'table':d[c]=String(a[c]??'').trim()||void 0;break;case'date':case'time':case'name':case'notes':d[c]=String(a[c]??'').trim();break;case'area':d.area=(a.area??'').trim()||void 0;break;case'dogs':d.dogs=Math.max(0,Number(a.dogs??0)),d.dog=Number(a.dogs??0)>0;break;case'highChairs':d.highChairs=Math.max(0,Number(a.highChairs??0))||void 0;break;case'wheelchair':d.access={...t.access??{},wheelchair:Math.max(0,Number(a.wheelchair??0))||void 0};break;case'occasion':d.occasion=a.occasion||void 0;break;case'allergies':d.allergies=[...a.allergies??[]],d.allergyNone=!!a.allergyNone&&!(a.allergies??[]).length,d.allergyNote=(a.allergyNote??'').trim()||void 0,(a.allergies??[]).length||(d.allergyAck=void 0);break;case'diet':d.diet={vegan:Number(a.vegan??0)||void 0,vegetarian:Number(a.vegetarian??0)||void 0};break;case'deposit':if(!a.depositOn){Object.assign(d,{security:'none',depositDue:0,depositPaid:0,depositPaidBy:void 0,depositPaidAt:void 0,depositMethod:void 0});break}if(d.security='deposit',d.depositDue=Math.max(0,Math.round(Number(a.depositDue??0))),a.depositPaid){const e=/^\d{4}-\d{2}-\d{2}$/.test(a.depositDate??'')?a.depositDate:o.slice(0,10);Object.assign(d,{depositPaid:Math.max(0,Math.round(Number(a.depositAmount??0))),depositPaidBy:s.by.slice(0,80),depositPaidAt:e===o.slice(0,10)?o:`${e}T12:00:00.000Z`,depositMethod:a.depositMethod||void 0})}else Object.assign(d,{depositPaid:0,depositPaidBy:void 0,depositPaidAt:void 0,depositMethod:void 0});break;case'status':d.status=a.status,'seated'!==a.status||t.seatedAt||(d.seatedAt=o),'finished'!==a.status||t.finishedAt||(d.finishedAt=o),'confirmed'!==a.status&&'pending'!==a.status||(d.seatedAt=void 0,d.finishedAt=void 0);break;case'source':d.source=a.source||void 0;break;case'tags':d.tags=[...(t.tags??[]).filter(e=>!b.includes(e)),...a.tags??[]];break;case'duration':d.durationMins=Number(a.duration??0)>=15?Number(a.duration):void 0}n.includes('table')&&(d.tableSetHere=!0);const c=t;return d.locallyEdited=!0,d.editedFields=[...new Set([...c.editedFields??[],...n])],d.editLog=[...c.editLog??[],{at:o,by:s.by.slice(0,80),app:s.app,fields:n,text:k(t,a,n,s.by.slice(0,80),o),quiet:!s.notify}].slice(-50),d},_e.historyLines=function(e){return(e.editLog??[]).slice().reverse().map(e=>e.text??`${e.fields.map(e=>f[e]??e).join(', ')} changed by ${e.by} ${w(e.at)}`.replace(/^./,e=>e.toUpperCase()))},_e.editWarnings=function(e,a,s,o,n=90,d){const c=[];if(!N(e,a).some(e=>['date','time','partySize','table','duration','dogs','status'].includes(e)))return c;const u={...e,date:a.date,time:a.time,partySize:a.partySize,...Number(a.duration??0)>=15?{durationMins:Number(a.duration)}:{}};if(a.table){const e=(0,t.tableOverlaps)(u,a.table,s.filter(e=>e.date===a.date),n);if(e.length&&c.push(`The table already has a booking at about the same time: ${e.map(e=>`${e.time} ${e.walkIn?'walk-in':e.name}`).join(', ')}.`),d){const e=a.table.split('+').map(e=>e.trim()).filter(Boolean).map(e=>d.tables.find(t=>t.name===e)).filter(Boolean),t=e.reduce((e,t)=>e+t.maxSeats,0);e.length&&td.areas.find(t=>t.id===e.areaId)).filter(e=>e&&!e.dogs);Number(a.dogs??0)>0&&s.length&&c.push(`Dogs aren\u2019t allowed in ${s[0].name}. Pick a dog-friendly table.`)}}o&&c.push(`Bookings are paused ${o.from} to ${o.to}${o.reason?` (${o.reason})`:''}.`);return c},Object.defineProperty(_e,"editedWords",{enumerable:!0,get:function(){return M}}),_e.bookingExtras=function(e){const t=e,a=e.dogs??(e.dog?1:0),s=[];a&&s.push(O(a,'dog','dogs'));t.highChairs&&s.push(O(t.highChairs,'high chair','high chairs'));e.access?.wheelchair&&s.push(O(e.access.wheelchair,'wheelchair','wheelchairs'));e.diet?.vegan&&s.push(`${e.diet.vegan} vegan`);e.diet?.vegetarian&&s.push(`${e.diet.vegetarian} vegetarian`);e.occasion&&s.push(e.occasion.charAt(0).toUpperCase()+e.occasion.slice(1));t.area&&s.push(t.area);t.depositMethod&&(e.depositPaid??0)>0&&s.push(`Deposit by ${t.depositMethod}`);return s.join(' \xb7 ')};var e=r(_d[0]),t=r(_d[1]);const a='For example: birthday, high chair, dog, window seat',s='This booking came from the website. Changes here are not sent to website bookings yet.',o='Message the guest about the new date, time or status (website bookings sends it)',n=e=>e.filter(e=>'date'===e||'time'===e||'status'===e);const d=e=>{const t=e;return'Wix'===t.importedFrom||!!t.wix||(e.tags??[]).includes('Wix')},c=['date','time','partySize','name','phone','email','notes','table','area','dogs','highChairs','wheelchair','occasion','allergies','diet','deposit','status','source','tags','duration'],u=['card','cash','bank transfer','website','other'],l=[{id:'pending',label:'Needs confirming'},{id:'confirmed',label:'Confirmed'},{id:'seated',label:'Seated'},{id:'finished',label:'Finished'},{id:'noshow',label:'No-show'}],h=[{id:'phone',label:'Phone'},{id:'in-person',label:'In person'},{id:'online',label:'Online'}],p=[{id:'',label:'None'},{id:'birthday',label:'Birthday'},{id:'anniversary',label:'Anniversary'},{id:'celebration',label:'Celebration'}],b=['VIP','Regular'],f={date:'date',time:'time',partySize:'covers',name:'name',phone:'phone',email:'email',notes:'notes',table:'table',area:'area',dogs:'dogs',highChairs:'high chairs',wheelchair:'wheelchairs',occasion:'occasion',allergies:'allergies',diet:'dietary',deposit:'deposit',status:'status',source:'source',tags:'tags',duration:'table time'},y=e=>{const t=e;return{date:e.date,time:e.time,partySize:e.partySize,name:e.name,phone:e.phone??'',email:e.email??'',notes:e.notes??'',table:e.table??'',area:t.area??'',dogs:e.dogs??(e.dog?1:0),highChairs:t.highChairs??0,wheelchair:e.access?.wheelchair??0,occasion:e.occasion??'',allergies:e.allergies??[],allergyNone:!!e.allergyNone,allergyNote:e.allergyNote??'',vegan:e.diet?.vegan??0,vegetarian:e.diet?.vegetarian??0,depositOn:'deposit'===e.security||(e.depositDue??0)>0||(e.depositPaid??0)>0,depositPaid:(e.depositPaid??0)>0&&!!e.depositPaidBy,depositAmount:(e.depositPaid??0)>0?e.depositPaid:e.depositDue??0,depositMethod:t.depositMethod??'',depositDate:(a=e.depositPaidAt,a?a.slice(0,10):''),depositDue:e.depositDue??0,status:e.status,source:e.source??'',tags:[...e.tags??[]].filter(e=>b.includes(e)).sort(),duration:e.durationMins??0};var a},$=e=>JSON.stringify([[...e.allergies??[]].map(e=>`${e.allergen}:${e.severity}`).sort(),!!e.allergyNone,(e.allergyNote??'').trim()]),v=e=>JSON.stringify(e.depositOn?[!0,!!e.depositPaid,Number(e.depositAmount??0),Number(e.depositDue??0),e.depositPaid?e.depositMethod??'':'',e.depositPaid?e.depositDate??'':'']:[!1]);function P(e,t){switch(e){case'partySize':return Number(t.partySize);case'allergies':return $(t);case'diet':return`${Number(t.vegan??0)}/${Number(t.vegetarian??0)}`;case'deposit':return v(t);case'tags':return[...t.tags??[]].sort().join(',');case'dogs':case'highChairs':case'wheelchair':case'duration':return Number(t[e]??0);default:return String(t[e]??'').trim()}}function N(e,t){const a=y(e);return c.filter(e=>P(e,a)!==P(e,t))}const S=e=>`\xa3${(e/100).toFixed(e%100?2:0)}`,w=e=>{const t=new Date(e);return`${String(t.getHours()).padStart(2,'0')}:${String(t.getMinutes()).padStart(2,'0')}`},O=(e,t,a)=>`${e} ${1===e?t:a}`;function k(e,t,a,s,o){const n=y(e),d=[];for(const e of[...a].sort((e,t)=>Number('deposit'===t)-Number('deposit'===e)))'deposit'===e?t.depositOn?t.depositPaid&&!n.depositPaid?d.push(`deposit marked paid (${S(Number(t.depositAmount??0))}${t.depositMethod?`, ${t.depositMethod}`:''})`):!t.depositPaid&&n.depositPaid?d.push('deposit marked not paid'):d.push(t.depositPaid?`deposit changed (${S(Number(t.depositAmount??0))}${t.depositMethod?`, ${t.depositMethod}`:''})`:`deposit due ${S(Number(t.depositDue??0))}`):d.push('deposit taken off'):'dogs'===e?d.push(!n.dogs&&t.dogs?1===t.dogs?'dog added':`${t.dogs} dogs added`:t.dogs?O(Number(t.dogs),'dog','dogs'):'no dog now'):'highChairs'===e?d.push(t.highChairs?O(Number(t.highChairs),'high chair','high chairs'):'no high chair now'):'wheelchair'===e?d.push(t.wheelchair?O(Number(t.wheelchair),'wheelchair user','wheelchair users'):'no wheelchair now'):'partySize'===e?d.push(`covers ${n.partySize} to ${t.partySize}`):'time'===e?d.push(`time ${n.time} to ${t.time}`):'date'===e?d.push(`date ${n.date} to ${t.date}`):'table'===e?d.push(t.table?`table ${t.table}`:'table taken off'):'status'===e?d.push(`status ${l.find(e=>e.id===t.status)?.label.toLowerCase()??t.status}`):'occasion'===e?d.push(t.occasion?`occasion ${t.occasion}`:'occasion taken off'):'area'===e?d.push(t.area?`area ${t.area}`:'any area'):'duration'===e?d.push(t.duration?`table time ${t.duration} min`:'table time as usual'):d.push(`${f[e]} changed`);const c=d.join(', ');return`${c.charAt(0).toUpperCase()}${c.slice(1)} by ${s} ${w(o)}`}const M=e=>e.map(e=>f[e]).join(', ')},1111,[1098,1092]); __d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"canCancelWalkIn",{enumerable:!0,get:function(){return y}}),Object.defineProperty(_e,"canReinstateWalkIn",{enumerable:!0,get:function(){return h}}),_e.cancelWalkInWords=x,_e.reinstateWalkInWords=p,_e.cancelWalkInNow=$,_e.reinstateWalkInNow=I,_e.CancelWalkInButton=function({rid:e,b:t,onDone:l,small:s,big:o}){const[c,u]=(0,n.useState)(!1);return y(t)?(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(f.Button,{kind:"secondary",small:s,label:"Cancel walk-in",testID:`cancel-walkin-${t.id}`,accessibilityLabel:`Cancel walk-in ${t.ref}, ${t.partySize} Covers`,onPress:()=>u(!0),style:o?{minHeight:64}:s?{minHeight:44}:w}),c?(0,k.jsx)(j,{rid:e,b:t,onClose:()=>u(!1),onDone:l}):null]}):null},_e.CancelWalkInConfirm=j,_e.ReinstateWalkInButton=function({rid:e,b:t,today:l,onDone:o,small:c}){const[u,y]=(0,n.useState)(!1);if(!h(t,l))return null;const x=p(t);if(!u)return(0,k.jsx)(f.Button,{kind:"ghost",small:c,label:"Undo cancel",testID:`reinstate-walkin-${t.id}`,accessibilityLabel:`Undo cancel for walk-in ${t.ref}`,onPress:()=>y(!0),style:c?{minHeight:44}:w});return(0,k.jsxs)(f.Sheet,{visible:!0,onClose:()=>y(!1),title:"Undo cancel?",maxWidth:560,testID:"reinstate-walkin-confirm",children:[(0,k.jsx)(s.default,{accessible:!0,accessibilityLabel:x,children:(0,k.jsx)(f.T,{size:18,colour:b.colours.text,children:x})}),(0,k.jsxs)(f.Row,{gap:8,wrap:!0,children:[(0,k.jsx)(f.Button,{label:"Yes, put back to seated",testID:"reinstate-walkin-yes",accessibilityLabel:`Yes, put walk-in ${t.ref} back to seated`,style:[w,{flexGrow:1}],onPress:async()=>{await I(e,t),y(!1),o?.(`Walk-in ${t.ref} put back to seated.`)}}),(0,k.jsx)(f.Button,{kind:"secondary",label:"Keep cancelled",testID:"reinstate-walkin-no",onPress:()=>y(!1),style:w})]})]})};var e,t=r(d[0]),n=r(d[1]),l=r(d[2]),s=(e=l)&&e.__esModule?e:{default:e},o=r(d[3]),c=r(d[4]),u=r(d[5]),b=r(d[6]),f=r(d[7]),k=r(d[8]);const w={minHeight:56},y=e=>!!e.walkIn&&('seated'===e.status||'confirmed'===e.status),h=(e,t)=>!!e.walkIn&&'cancelled'===e.status&&e.date>=t;function x(e){const t=(0,c.tablesOf)(e.table),n=(0,u.tablesWords)(t);return`Cancel walk-in ${e.ref}, ${e.partySize} Covers${t.length?` at ${n}`:''}, arrived ${e.time}? It comes off the Covers${t.length?` and ${n} ${t.length>1?'go':'goes'} back to Free`:''}.`}function p(e){return`Put walk-in ${e.ref} back to seated? CoverCharge only \u2014 if it was cancelled on the website, put it back there too if needed.`}async function $(e,n){await o.repo.bookings.setStatus(n.id,'cancelled'),await o.repo.bookings.update(n.id,{cancelled:(0,t.cancelStamp)(n)}),(0,c.tablesOf)(n.table).forEach(t=>c.useFloor.getState().setLive(e,t,{stage:void 0,dirty:!1}))}async function I(e,t){await o.repo.bookings.setStatus(t.id,'seated'),(0,c.tablesOf)(t.table).forEach(t=>c.useFloor.getState().setLive(e,t,{stage:'seated',dirty:!1}))}function j({rid:e,b:t,onClose:n,onDone:l}){const o=x(t);return(0,k.jsxs)(f.Sheet,{visible:!0,onClose:n,title:"Cancel walk-in?",maxWidth:560,testID:"cancel-walkin-confirm",children:[(0,k.jsx)(s.default,{accessible:!0,accessibilityLabel:o,children:(0,k.jsx)(f.T,{size:18,colour:b.colours.text,children:o})}),(0,k.jsxs)(f.Row,{gap:8,wrap:!0,children:[(0,k.jsx)(f.Button,{label:"Yes, cancel walk-in",testID:"cancel-walkin-yes",accessibilityLabel:`Yes, cancel walk-in ${t.ref}`,style:[w,{flexGrow:1}],onPress:async()=>{await $(e,t),n(),l?.(`Walk-in ${t.ref} cancelled.${(0,c.tablesOf)(t.table).length?` ${(0,u.tablesWords)((0,c.tablesOf)(t.table))} free.`:''}`)}}),(0,k.jsx)(f.Button,{kind:"secondary",label:"Keep walk-in",testID:"cancel-walkin-no",accessibilityLabel:`Keep walk-in ${t.ref}`,onPress:n,style:w})]})]})}},1112,[1113,34,102,848,1014,1095,840,794,25]); __d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.cancelStamp=C,_e.cancelBookingNow=w,_e.reinstateBookingNow=$,_e.CancelBookingButton=function({rid:e,b:n,name:o,onDone:s,big:l,small:c}){const[u,f]=(0,t.useState)(!1);return(0,b.canCancelBooking)(n)?(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(x.Button,{kind:"secondary",small:c,label:"Cancel booking",testID:`cancel-booking-${n.id}`,accessibilityLabel:`Cancel booking for ${o}, ${n.time}, ${n.partySize} Covers`,onPress:()=>f(!0),style:l?{minHeight:64}:c?{minHeight:44}:j}),u?(0,h.jsx)(D,{rid:e,b:n,name:o,onClose:()=>f(!1),onDone:s}):null]}):null},_e.CancelBookingConfirm=D,_e.ReinstateBookingButton=function({b:e,name:n,today:s,onDone:l}){const[c,u]=(0,t.useState)(!1);if(!(0,b.canReinstateBooking)(e,s))return null;const y=(0,b.reinstateBookingWords)(e,n);if(!c)return(0,h.jsx)(x.Button,{kind:"ghost",label:"Undo cancel",testID:`reinstate-booking-${e.id}`,accessibilityLabel:`Undo cancel for ${n}`,onPress:()=>u(!0),style:j});return(0,h.jsxs)(x.Sheet,{visible:!0,onClose:()=>u(!1),title:"Undo cancel?",maxWidth:560,testID:"reinstate-booking-confirm",children:[(0,h.jsx)(o.default,{accessible:!0,accessibilityLabel:y,style:{alignItems:'center'},children:(0,h.jsx)(x.T,{size:18,colour:f.colours.text,style:{textAlign:'center'},children:y})}),(0,h.jsxs)(x.Row,{gap:8,wrap:!0,style:{justifyContent:'center'},children:[(0,h.jsx)(x.Button,{label:"Yes, put back to booked",testID:"reinstate-booking-yes",accessibilityLabel:`Yes, put ${n} back to booked`,style:[j,{flexGrow:1}],onPress:async()=>{await $(e),u(!1),l?.(`${n} put back to booked.`)}}),(0,h.jsx)(x.Button,{kind:"secondary",label:"Keep cancelled",testID:"reinstate-booking-no",onPress:()=>u(!1),style:j})]})]})};var e,t=r(d[0]),n=r(d[1]),o=(e=n)&&e.__esModule?e:{default:e},s=r(d[2]),l=r(d[3]),c=r(d[4]),b=r(d[5]),u=r(d[6]),f=r(d[7]),y=r(d[8]),k=r(d[9]),p=r(d[10]),x=r(d[11]),h=r(d[12]);const j={minHeight:56},B={display:'Display',owner:'Managers app',staff:'Staff app',chef:'Kitchen app',customer:'Customer page'};function C(e){const t=y.useSession.getState().meId,n=t?k.useOwner.getState().staff.find(e=>e.id===t):void 0,o=B[p.APP_VARIANT]??'CoverCharge';return{by:n?`${n.name.replace(' (example)','')} (${o})`:o,at:(new Date).toISOString(),app:o,...e.table?{table:e.table}:{}}}async function w(e,t){const n=(0,l.tablesOf)(t.table);await s.repo.bookings.update(t.id,{status:'cancelled',cancelled:C(t),...(0,c.tablePatch)(null)}),n.forEach(t=>l.useFloor.getState().setLive(e,t,{stage:void 0,dirty:!1}))}async function $(e){await s.repo.bookings.setStatus(e.id,'confirmed')}function D({rid:e,b:t,name:n,onClose:s,onDone:c}){const y=(0,b.cancelBookingWords)(t,n),k=(0,l.tablesOf)(t.table);return(0,h.jsxs)(x.Sheet,{visible:!0,onClose:s,title:"Cancel booking?",maxWidth:560,testID:"cancel-booking-confirm",children:[(0,h.jsx)(o.default,{accessible:!0,accessibilityLabel:y,style:{alignItems:'center',gap:8},children:(0,h.jsx)(x.T,{size:18,colour:f.colours.text,style:{textAlign:'center'},children:y})}),(0,h.jsxs)(x.Row,{gap:8,wrap:!0,style:{justifyContent:'center'},children:[(0,h.jsx)(x.Button,{label:"Yes, cancel booking",testID:"cancel-booking-yes",accessibilityLabel:`Yes, cancel booking for ${n}`,style:[j,{flexGrow:1}],onPress:async()=>{await w(e,t),s(),c?.(`${n} cancelled.${k.length?` ${(0,u.tablesWords)(k)} free.`:''}`)}}),(0,h.jsx)(x.Button,{kind:"secondary",label:"Keep booking",testID:"cancel-booking-no",accessibilityLabel:`Keep booking for ${n}`,onPress:s,style:j})]})]})}},1113,[34,102,848,1014,1092,1114,1095,840,997,865,846,794,25]); __d(function(g,r,i,_a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"canCancelBooking",{enumerable:!0,get:function(){return n}}),Object.defineProperty(e,"canReinstateBooking",{enumerable:!0,get:function(){return t}}),e.cancelBookingWords=function(n,t){const o=`${n.partySize} Cover${1===n.partySize?'':'s'}`;return`Cancel booking for ${t}, ${n.time}, ${o}? The table is freed. Website bookings will cancel it on the website and may email the guest.`},e.reinstateBookingWords=function(n,t){return`Put ${t} back to booked for ${n.time}? CoverCharge only \u2014 if it was cancelled on the website, put it back there too if needed.`},e.cancelledOnDay=o,e.cancelledDayTally=function(n,t){const a=o(n,t),l=a.filter(n=>!!n.walkIn),c=a.filter(n=>!n.walkIn);return{count:a.length,covers:a.reduce((n,t)=>n+t.partySize,0),bookings:c.length,bookingCovers:c.reduce((n,t)=>n+t.partySize,0),walkIns:l.length,walkInCovers:l.reduce((n,t)=>n+t.partySize,0),list:a}},e.cancelledTallyWords=function(n,t="today"){if(!n.count)return`No cancellations ${t}`;const o=[],a=n.bookings??0,l=n.walkIns??0;a&&o.push(`${a} booking${1===a?'':'s'} (${n.bookingCovers??0} Cover${1===(n.bookingCovers??0)?'':'s'})`);l&&o.push(`${l} walk-in${1===l?'':'s'} (${n.walkInCovers??0} Cover${1===(n.walkInCovers??0)?'':'s'})`);if(!o.length)return`Cancelled ${t}: ${n.count} \xb7 ${n.covers} Cover${1===n.covers?'':'s'}`;return`Cancelled ${t}: ${o.join(' \xb7 ')}`};const n=n=>!n.walkIn&&('confirmed'===n.status||'pending'===n.status||'seated'===n.status),t=(n,t)=>!n.walkIn&&'cancelled'===n.status&&n.date>=t;function o(n,t){return n.filter(n=>n.date===t&&'cancelled'===n.status).sort((n,t)=>n.time.localeCompare(t.time)||n.name.localeCompare(t.name))}},1114,[]); -__d(function(g,_r,i,_a,_m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.BookingEditButton=function({rid:e,booking:a,who:n,role:o,inStaffApp:l,shiftManager:s,big:d,testID:r}){const[u,b]=(0,t.useState)(!1);return a.walkIn||!(0,h.canEditBooking)({variant:c.APP_VARIANT,inStaffApp:l,role:o,shiftManager:s})?null:(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(k.Button,{kind:"secondary",small:!d,label:"Edit booking",testID:r??`edit-booking-${a.id}`,accessibilityLabel:`Edit booking, ${a.name}, ${a.time}`,onPress:()=>b(!0),style:{minHeight:d?64:44}}),u?(0,j.jsx)(C,{rid:e,id:a.id,who:n,onClose:()=>b(!1)}):null]})},_e.EditBookingPicker=function({rid:e,today:a,who:n,onClose:o,hidePrivate:s}){const[d,r]=(0,t.useState)(null),c=(0,l.useBookings)(e).filter(e=>!e.walkIn&&e.date>=a&&!['cancelled','noshow','finished'].includes(e.status)).sort((e,t)=>e.date.localeCompare(t.date)||e.time.localeCompare(t.time)).slice(0,60);return d?(0,j.jsx)(C,{rid:e,id:d,who:n,hidePrivate:s,onClose:o}):(0,j.jsxs)(k.Sheet,{visible:!0,onClose:o,title:"Edit booking \xb7 pick a booking",maxWidth:640,testID:"edit-booking-picker",children:[(0,j.jsx)(k.T,{size:16,colour:b.colours.text,children:"Tip: tap the booking you want to change."}),c.length?c.map(e=>(0,j.jsx)(k.Button,{kind:"secondary",testID:`edit-pick-${e.id}`,label:`${e.date===a?'Today':e.date} ${e.time} \xb7 ${e.name} \xb7 ${e.partySize} ${1===e.partySize?'Cover':'Covers'}`,sub:e.notes?`Notes: ${e.notes}`:void 0,accessibilityLabel:`Edit booking, ${e.name}, ${e.date===a?'today':e.date}, ${e.time}, ${e.partySize} Covers`,onPress:()=>r(e.id),style:{minHeight:56,alignItems:'flex-start'}},e.id)):(0,j.jsx)(k.Muted,{children:"No bookings to edit from today on."}),(0,j.jsx)(k.Button,{kind:"ghost",label:"Close",onPress:o,style:{minHeight:44}})]})},_e.EditBookingSheet=C;var e,t=_r(_d[0]),a=_r(_d[1]),n=_r(_d[2]),o=(e=n)&&e.__esModule?e:{default:e},l=_r(_d[3]),s=_r(_d[4]),d=_r(_d[5]),r=_r(_d[6]),c=_r(_d[7]),h=_r(_d[8]),u=_r(_d[9]),b=_r(_d[10]),m=_r(_d[11]),p=_r(_d[12]),x=_r(_d[13]),y=_r(_d[14]),k=_r(_d[15]),j=_r(_d[16]);const f=/^([01]\d|2[0-3]):[0-5]\d$/,v=e=>{const t=e.trim().replace('.',':').match(/^(\d{1,2}):?(\d{2})$/);return t?`${t[1].padStart(2,'0')}:${t[2]}`:e.trim()};function C({rid:e,id:n,who:C,onClose:T,hidePrivate:I='display'===c.APP_VARIANT}){const B=(0,l.useBookings)(e),D=B.find(e=>e.id===n),P=(0,r.useRestaurant)(e),$=(0,s.usePlan)(e),S=(0,d.useBlocks)(e=>e.blocks),[w,E]=(0,t.useState)(D?(0,h.draftOf)(D):null),[z,A]=(0,t.useState)(null),[L,_]=(0,t.useState)(null);if(!D||!w||!P)return null;const F=e=>{A(null),_(null),E({...w,...e})},N=v(w.time),W=f.test(N),R=(0,u.tableOptions)($,B.filter(e=>e.date===w.date),w.table),M=(0,h.changedFields)(D,{...w,time:N}),O=P.settings.turnMins??90,H=async()=>{const t=(0,h.editPatch)(D,{...w,time:N},{by:C||'Team member',app:c.APP_VARIANT});if(Object.keys(t).length&&await l.repo.bookings.update(D.id,t),'seated'===D.status&&'table'in t&&t.table!==D.table){const a=e=>e?e.split('+').map(e=>e.trim()).filter(Boolean):[],n=a(D.table),o=a(t.table),l=s.useFloor.getState(),d=n.map(t=>l.live[e]?.[t]?.stage).find(Boolean)??'seated';n.filter(e=>!o.includes(e)).forEach(t=>l.setLive(e,t,{stage:void 0,dirty:!0})),o.forEach(t=>l.setLive(e,t,{stage:d,dirty:!1}))}_(`Saved. Changed: ${(0,h.editedWords)(M)}.`),A(null),T()};return(0,j.jsxs)(k.Sheet,{visible:!0,onClose:T,title:`Edit booking \xb7 ${D.name} \xb7 ${D.ref}`,maxWidth:760,testID:"edit-booking-sheet",children:[(0,j.jsx)(x.DepositChip,{b:D,money:!0,big:!0,testID:"edit-deposit"}),(0,h.isWixBooking)(D)?(0,j.jsx)(o.default,{testID:"edit-wix-note",accessible:!0,accessibilityLabel:h.WIX_EDIT_NOTE,style:{padding:12,borderRadius:12,borderWidth:1,borderColor:b.colours.gold},children:(0,j.jsx)(k.T,{size:16,colour:b.colours.goldLight,children:h.WIX_EDIT_NOTE})}):null,(0,j.jsx)(k.T,{size:16,colour:b.colours.text,children:"Tip: change what you need, then press Save changes."}),(0,j.jsx)(p.BookingDatePicker,{r:P,today:new Date,value:w.date,onChange:e=>F({date:e})}),(0,j.jsx)(k.Field,{label:"Time (24-hour, for example 19:30)",value:w.time,onChangeText:e=>F({time:e}),testID:"edit-time"}),W?null:(0,j.jsx)(k.T,{size:15,colour:b.colours.amber,children:"Write the time like 19:30."}),(0,j.jsxs)(o.default,{style:{gap:6,alignItems:'center'},children:[(0,j.jsx)(k.T,{size:18,center:!0,children:"Covers"}),(0,j.jsx)(a.PartySizeInput,{value:w.partySize,onChange:e=>F({partySize:e}),label:"Covers",testID:"edit-covers"})]}),(0,j.jsx)(k.Field,{label:"Name",value:w.name,onChangeText:e=>F({name:e}),testID:"edit-name"}),I?(0,j.jsx)(k.Muted,{children:"Phone and email can be changed in the Managers app; the Display never shows them."}):(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(k.Field,{label:"Phone",value:w.phone,onChangeText:e=>F({phone:e}),keyboardType:"phone-pad",testID:"edit-phone"}),(0,j.jsx)(k.Field,{label:"Email",value:w.email,onChangeText:e=>F({email:e}),keyboardType:"email-address",autoCapitalize:"none",testID:"edit-email"})]}),(0,j.jsx)(k.Field,{label:"Notes",value:w.notes,onChangeText:e=>F({notes:e}),placeholder:h.NOTES_PLACEHOLDER,multiline:!0,numberOfLines:3,testID:"edit-notes"}),D.allergies.length||D.allergyNote?(0,j.jsx)(k.Muted,{children:"Allergies are kept separately and are not changed here."}):null,(0,j.jsx)(k.T,{size:18,weight:"semibold",children:(0,u.tableButtonLabel)(w.table)}),(0,j.jsxs)(k.Row,{gap:8,wrap:!0,children:[(0,j.jsx)(k.Button,{kind:w.table?'secondary':'primary',label:"No table",accessibilityLabel:"No table"+(w.table?'':', chosen'),onPress:()=>F({table:''}),style:{minHeight:44,minWidth:96},testID:"edit-table-none"}),R.map(e=>(0,j.jsx)(k.Button,{kind:e===w.table?'primary':'secondary',label:(0,u.tableButtonLabel)(e),accessibilityLabel:`Table ${(0,u.tableButtonLabel)(e)}${e===w.table?', chosen':''}`,onPress:()=>F({table:e}),style:{minHeight:44,minWidth:64},testID:`edit-table-${e}`},e))]}),z?(0,j.jsxs)(o.default,{testID:"edit-warn",style:{gap:8,padding:12,borderRadius:12,borderWidth:1.5,borderColor:b.colours.amber,backgroundColor:b.colours.amberBg},children:[z.map(e=>(0,j.jsx)(k.T,{size:16,colour:"#FFE2A8",children:e},e)),(0,j.jsx)(k.T,{size:16,colour:"#FFE2A8",children:"You can still save."})]}):null,L?(0,j.jsx)(k.T,{size:16,colour:b.colours.goldLight,children:L}):null,(0,j.jsxs)(k.Row,{gap:8,wrap:!0,children:[(0,j.jsx)(k.Button,{label:z?'Save anyway':'Save changes',testID:"edit-save",disabled:!W||w.name.trim().length<1||!M.length,onPress:()=>{const t=W?(0,d.blockAt)(S,e,w.date,N):void 0,a=(0,h.editWarnings)(D,{...w,time:N},B,t,O);!a.length||z?H():A(a)},style:{minHeight:56,flex:1}}),(0,j.jsx)(k.Button,{kind:"ghost",label:"Close",onPress:T,style:{minHeight:56}})]}),(0,j.jsx)(y.CancelBookingButton,{rid:e,b:D,name:D.name,big:!0,onDone:()=>T()}),(0,j.jsx)(y.ReinstateBookingButton,{b:D,name:D.name,today:(0,m.ymd)(new Date),onDone:()=>T()})]})}},1115,[34,1097,102,848,1014,1011,850,846,1111,1092,840,827,1105,1089,1113,794,25]); +__d(function(g,_r,_i,_a,_m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.BookingEditButton=function({rid:e,booking:s,who:i,role:a,inStaffApp:n,shiftManager:l,big:o,testID:d}){const[h,m]=(0,t.useState)(!1),x=(0,u.useSession)(e=>e.meId),j=(0,p.useOwner)(e=>e.staff.find(e=>e.id===x&&e.active));return s.walkIn||!(0,c.canEditBooking)({variant:r.APP_VARIANT,inStaffApp:n,role:a,shiftManager:l})||x&&!(0,b.canChangeBookings)(j)?null:(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(C.Button,{kind:"secondary",small:!o,label:"Edit booking",sub:o?void 0:"Deposit, dog, table, anything",testID:d??`edit-booking-${s.id}`,accessibilityLabel:`Edit booking, ${s.name}, ${s.time}`,onPress:()=>m(!0),style:{minHeight:o?64:44}}),h?(0,f.jsx)(B,{rid:e,id:s.id,who:i,onClose:()=>m(!1)}):null]})},_e.EditBookingPicker=function({rid:e,today:s,who:i,onClose:a,hidePrivate:l}){const[o,d]=(0,t.useState)(null),r=(0,n.useBookings)(e).filter(e=>!e.walkIn&&e.date>=s&&!['cancelled','noshow','finished'].includes(e.status)).sort((e,t)=>e.date.localeCompare(t.date)||e.time.localeCompare(t.time)).slice(0,60);return o?(0,f.jsx)(B,{rid:e,id:o,who:i,hidePrivate:l,onClose:a}):(0,f.jsxs)(C.Sheet,{visible:!0,onClose:a,title:"Edit booking \xb7 pick a booking",maxWidth:640,testID:"edit-booking-picker",children:[(0,f.jsx)(C.T,{size:16,colour:x.colours.text,children:"Tip: tap the booking you want to change."}),r.length?r.map(e=>(0,f.jsx)(C.Button,{kind:"secondary",testID:`edit-pick-${e.id}`,label:`${e.date===s?'Today':e.date} ${e.time} \xb7 ${e.name} \xb7 ${e.partySize} ${1===e.partySize?'Cover':'Covers'}`,sub:e.notes?`Notes: ${e.notes}`:void 0,accessibilityLabel:`Edit booking, ${e.name}, ${e.date===s?'today':e.date}, ${e.time}, ${e.partySize} Covers`,onPress:()=>d(e.id),style:{minHeight:56,alignItems:'flex-start'}},e.id)):(0,f.jsx)(C.Muted,{children:"No bookings to edit from today on."}),(0,f.jsx)(C.Button,{kind:"ghost",label:"Close",onPress:a,style:{minHeight:44}})]})},_e.EditBookingSheet=B;var e,t=_r(_d[0]),s=_r(_d[1]),i=_r(_d[2]),a=(e=i)&&e.__esModule?e:{default:e},n=_r(_d[3]),l=_r(_d[4]),o=_r(_d[5]),d=_r(_d[6]),r=_r(_d[7]),c=_r(_d[8]),h=_r(_d[9]),u=_r(_d[10]),p=_r(_d[11]),b=_r(_d[12]),m=_r(_d[13]),x=_r(_d[14]),j=_r(_d[15]),y=_r(_d[16]),D=_r(_d[17]),I=_r(_d[18]),C=_r(_d[19]),f=_r(_d[20]);const T=/^([01]\d|2[0-3]):[0-5]\d$/,v=e=>{const t=e.trim().replace('.',':').match(/^(\d{1,2}):?(\d{2})$/);return t?`${t[1].padStart(2,'0')}:${t[2]}`:e.trim()};const w=e=>e?(e/100).toFixed(e%100?2:0):'',k=e=>{const t=Number(e.replace(/[\xa3,\s]/g,''));return Number.isFinite(t)&&t>=0?Math.round(100*t):NaN},S=e=>e&&/^\d{4}-\d{2}-\d{2}$/.test(e)?`${e.slice(8,10)}/${e.slice(5,7)}/${e.slice(0,4)}`:'',P=e=>{const t=e.trim().match(/^(\d{1,2})\/(\d{1,2})\/(\d{4})$/);return t?`${t[3]}-${t[2].padStart(2,'0')}-${t[1].padStart(2,'0')}`:''},$=e=>e.charAt(0).toUpperCase()+e.slice(1);function N({title:e,children:t,testID:s}){return(0,f.jsxs)(a.default,{testID:s,style:{gap:8,paddingTop:10,borderTopWidth:1,borderTopColor:x.colours.hairline,alignItems:'stretch'},children:[(0,f.jsx)(C.T,{size:17,weight:"semibold",center:!0,colour:x.colours.goldLight,children:e}),t]})}const E=({label:e,value:t,onChange:s,max:i=20,testID:a})=>(0,f.jsxs)(C.Row,{style:{justifyContent:'space-between',alignItems:'center'},children:[(0,f.jsx)(C.T,{size:16,children:e}),(0,f.jsx)(C.Stepper,{testID:a,value:t,min:0,max:i,onChange:s,label:e})]});function B({rid:e,id:i,who:u,onClose:p,hidePrivate:b='display'===r.APP_VARIANT}){const B=(0,n.useBookings)(e),O=B.find(e=>e.id===i),z=(0,d.useRestaurant)(e),A=(0,l.usePlan)(e),R=(0,o.useBlocks)(e=>e.blocks),[L,F]=(0,t.useState)(O?(0,c.draftOf)(O):null),[W,M]=(0,t.useState)(null),[_,H]=(0,t.useState)(null),[V,G]=(0,t.useState)(w(O?(0,c.draftOf)(O).depositDue:0)),[U,X]=(0,t.useState)(w(O?(0,c.draftOf)(O).depositAmount:0)),[Y,q]=(0,t.useState)(S(O?(0,c.draftOf)(O).depositDate:'')),[J,K]=(0,t.useState)(!1);if(!O||!L||!z)return null;const Q=e=>{M(null),H(null),F({...L,...e})},Z=v(L.time),ee=T.test(Z),te=L.area?A.areas.filter(e=>e.name===L.area).map(e=>e.id):null,se=e=>!te||e.split('+').every(e=>te.includes(A.tables.find(t=>t.name===e)?.areaId??'')),ie=(0,m.tableOptions)(A,B.filter(e=>e.date===L.date),L.table).filter(e=>se(e)||e===L.table),ae=!(L.depositOn&&(Number.isNaN(k(V||'0'))||L.depositPaid&&(Number.isNaN(k(U||'0'))||Y.trim()&&!P(Y)))),ne={...L,time:Z,depositDue:k(V||'0')||0,depositAmount:k(U||'0')||0,depositDate:P(Y)},le=(0,c.changedFields)(O,ne),oe=z.settings.turnMins??90,de=async()=>{const t=(0,c.editPatch)(O,ne,{by:u||'Team member',app:r.APP_VARIANT,notify:J&&(0,c.isWixBooking)(O)});if(Object.keys(t).length&&await n.repo.bookings.update(O.id,t),'seated'===O.status&&'table'in t&&t.table!==O.table){const s=e=>e?e.split('+').map(e=>e.trim()).filter(Boolean):[],i=s(O.table),a=s(t.table),n=l.useFloor.getState(),o=i.map(t=>n.live[e]?.[t]?.stage).find(Boolean)??'seated';i.filter(e=>!a.includes(e)).forEach(t=>n.setLive(e,t,{stage:void 0,dirty:!0})),a.forEach(t=>n.setLive(e,t,{stage:o,dirty:!1}))}H(`Saved. Changed: ${(0,c.editedWords)(le)}.`),M(null),p()},re=L.allergies??[],ce=e=>Q({allergyNone:!1,allergies:re.some(t=>t.allergen===e)?re.filter(t=>t.allergen!==e):[...re,{allergen:e,severity:'allergy'}]}),he=(0,c.historyLines)(O);return(0,f.jsxs)(C.Sheet,{visible:!0,onClose:p,title:`Edit booking \xb7 ${O.name} \xb7 ${O.ref}`,maxWidth:760,testID:"edit-booking-sheet",children:[(0,f.jsx)(a.default,{style:{alignItems:'center'},children:(0,f.jsx)(D.DepositChip,{b:O,money:!0,big:!0,testID:"edit-deposit"})}),(0,c.isWixBooking)(O)?(0,f.jsx)(a.default,{testID:"edit-wix-note",accessible:!0,accessibilityLabel:c.WIX_EDIT_NOTE,style:{padding:12,borderRadius:12,borderWidth:1,borderColor:x.colours.gold},children:(0,f.jsx)(C.T,{size:16,center:!0,colour:x.colours.goldLight,children:c.WIX_EDIT_NOTE})}):null,(0,f.jsx)(C.T,{size:16,center:!0,colour:x.colours.text,children:"Tip: change what you need, then press Save changes. Saving doesn\u2019t message the guest."}),(0,f.jsxs)(N,{title:"Deposit",testID:"edit-section-deposit",children:[(0,f.jsxs)(C.Row,{wrap:!0,gap:6,style:{justifyContent:'center'},children:[(0,f.jsx)(C.Chip,{label:"No deposit",selected:!L.depositOn,testID:"edit-deposit-none",onPress:()=>Q({depositOn:!1,depositPaid:!1})}),(0,f.jsx)(C.Chip,{label:"Deposit due",selected:!!L.depositOn&&!L.depositPaid,testID:"edit-deposit-due",onPress:()=>Q({depositOn:!0,depositPaid:!1})}),(0,f.jsx)(C.Chip,{label:"Deposit paid",selected:!!L.depositOn&&!!L.depositPaid,testID:"edit-deposit-paid",onPress:()=>{U||X(V),Y||q(S((0,j.ymd)(new Date))),Q({depositOn:!0,depositPaid:!0})}})]}),L.depositOn?(0,f.jsx)(C.Field,{label:"Deposit due (\xa3)",value:V,onChangeText:e=>{G(e),Q({})},keyboardType:"decimal-pad",testID:"edit-deposit-due-amount"}):null,L.depositOn&&L.depositPaid?(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(C.Field,{label:"Amount paid (\xa3)",value:U,onChangeText:e=>{X(e),Q({})},keyboardType:"decimal-pad",testID:"edit-deposit-amount"}),(0,f.jsx)(C.T,{size:16,center:!0,children:"How was it paid?"}),(0,f.jsx)(C.Row,{wrap:!0,gap:6,style:{justifyContent:'center'},children:c.DEPOSIT_METHODS.map(e=>(0,f.jsx)(C.Chip,{label:$(e),selected:L.depositMethod===e,testID:`edit-deposit-method-${e.replace(' ','-')}`,onPress:()=>Q({depositMethod:e})},e))}),(0,f.jsx)(C.Field,{label:"Date paid (for example 11/11/2026)",value:Y,onChangeText:e=>{q(e),Q({})},testID:"edit-deposit-date"}),Y.trim()&&!P(Y)?(0,f.jsx)(C.T,{size:15,center:!0,colour:x.colours.amber,children:"Write the date like 11/11/2026."}):null]}):null,ae?null:(0,f.jsx)(C.T,{size:15,center:!0,colour:x.colours.amber,children:"Write amounts in pounds, for example 60 or 12.50."}),(0,f.jsx)(C.Muted,{center:!0,children:"No payment is taken in CoverCharge: this records what the guest paid."})]}),(0,f.jsxs)(N,{title:"When",testID:"edit-section-when",children:[(0,f.jsx)(y.BookingDatePicker,{r:z,today:new Date,value:L.date,onChange:e=>Q({date:e})}),(0,f.jsx)(C.Field,{label:"Time (24-hour, for example 19:30)",value:L.time,onChangeText:e=>Q({time:e}),testID:"edit-time"}),ee?null:(0,f.jsx)(C.T,{size:15,colour:x.colours.amber,children:"Write the time like 19:30."}),(0,f.jsxs)(a.default,{style:{gap:6,alignItems:'center'},children:[(0,f.jsx)(C.T,{size:18,center:!0,children:"Covers"}),(0,f.jsx)(s.PartySizeInput,{value:L.partySize,onChange:e=>Q({partySize:e}),label:"Covers",testID:"edit-covers"})]}),(0,f.jsxs)(C.Row,{style:{justifyContent:'space-between',alignItems:'center'},children:[(0,f.jsx)(C.T,{size:16,children:"Table time"}),(0,f.jsx)(C.Stepper,{testID:"edit-duration",value:L.duration||0,min:0,max:360,step:15,onChange:e=>Q({duration:e}),format:e=>e?`${Math.floor(e/60)}h ${String(e%60).padStart(2,'0')}m`:'As usual',label:"Table time"})]})]}),(0,f.jsxs)(N,{title:"Where",testID:"edit-section-where",children:[(0,f.jsxs)(C.Row,{wrap:!0,gap:6,style:{justifyContent:'center'},children:[(0,f.jsx)(C.Chip,{label:"Any area",selected:!L.area,testID:"edit-area-any",onPress:()=>Q({area:''})}),A.areas.map(e=>(0,f.jsx)(C.Chip,{label:`${e.name}${e.dogs?' \xb7 dogs ok':''}`,selected:L.area===e.name,testID:`edit-area-${e.id}`,onPress:()=>Q({area:e.name})},e.id))]}),(0,f.jsx)(C.T,{size:18,weight:"semibold",center:!0,children:(0,m.tableButtonLabel)(L.table)}),(0,f.jsxs)(C.Row,{gap:8,wrap:!0,style:{justifyContent:'center'},children:[(0,f.jsx)(C.Button,{kind:L.table?'secondary':'primary',label:"No table",accessibilityLabel:"No table"+(L.table?'':', chosen'),onPress:()=>Q({table:''}),style:{minHeight:44,minWidth:96},testID:"edit-table-none"}),ie.map(e=>(0,f.jsx)(C.Button,{kind:e===L.table?'primary':'secondary',label:(0,m.tableButtonLabel)(e),accessibilityLabel:`Table ${(0,m.tableButtonLabel)(e)}${e===L.table?', chosen':''}`,onPress:()=>Q({table:e}),style:{minHeight:44,minWidth:64},testID:`edit-table-${e}`},e))]})]}),(0,f.jsxs)(N,{title:"Guest",testID:"edit-section-guest",children:[(0,f.jsx)(C.Field,{label:"Name",value:L.name,onChangeText:e=>Q({name:e}),testID:"edit-name"}),b?(0,f.jsx)(C.Muted,{center:!0,children:"Phone and email can be changed in the Managers app; the Display never shows them."}):(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(C.Field,{label:"Phone",value:L.phone,onChangeText:e=>Q({phone:e}),keyboardType:"phone-pad",testID:"edit-phone"}),(0,f.jsx)(C.Field,{label:"Email",value:L.email,onChangeText:e=>Q({email:e}),keyboardType:"email-address",autoCapitalize:"none",testID:"edit-email"})]}),(0,f.jsx)(C.T,{size:16,center:!0,children:"Booked by"}),(0,f.jsx)(C.Row,{wrap:!0,gap:6,style:{justifyContent:'center'},children:c.SOURCES.map(e=>(0,f.jsx)(C.Chip,{label:e.label,selected:L.source===e.id,testID:`edit-source-${e.id}`,onPress:()=>Q({source:e.id})},e.id))}),(0,f.jsx)(C.Row,{wrap:!0,gap:6,style:{justifyContent:'center'},children:c.TAGS.map(e=>{const t=(L.tags??[]).includes(e);return(0,f.jsx)(C.Chip,{label:e,selected:t,testID:`edit-tag-${e}`,onPress:()=>Q({tags:t?(L.tags??[]).filter(t=>t!==e):[...L.tags??[],e].sort()})},e)})})]}),(0,f.jsxs)(N,{title:"Dogs, high chairs and access",testID:"edit-section-needs",children:[(0,f.jsx)(E,{label:"Dogs",value:L.dogs??0,max:6,onChange:e=>Q({dogs:e}),testID:"edit-dogs"}),(0,f.jsx)(E,{label:"High chairs",value:L.highChairs??0,max:10,onChange:e=>Q({highChairs:e}),testID:"edit-high-chairs"}),(0,f.jsx)(E,{label:"Wheelchair users",value:L.wheelchair??0,max:10,onChange:e=>Q({wheelchair:e}),testID:"edit-wheelchair"}),(0,f.jsx)(C.T,{size:16,center:!0,children:"Occasion"}),(0,f.jsx)(C.Row,{wrap:!0,gap:6,style:{justifyContent:'center'},children:c.OCCASIONS.map(e=>(0,f.jsx)(C.Chip,{label:e.label,selected:(L.occasion??'')===e.id,testID:`edit-occasion-${e.id||'none'}`,onPress:()=>Q({occasion:e.id})},e.id||'none'))})]}),(0,f.jsxs)(N,{title:"Allergies and dietary",testID:"edit-section-allergies",children:[(0,f.jsxs)(C.Row,{wrap:!0,gap:6,style:{justifyContent:'center'},children:[(0,f.jsx)(C.Chip,{label:"No allergies",selected:!!L.allergyNone&&!re.length,testID:"edit-allergy-none",onPress:()=>Q({allergyNone:!0,allergies:[]})}),h.ALLERGENS.map(e=>(0,f.jsx)(C.Chip,{label:e.short,selected:re.some(t=>t.allergen===e.id),testID:`edit-allergen-${e.id}`,onPress:()=>ce(e.id)},e.id))]}),re.map(e=>(0,f.jsxs)(a.default,{style:{gap:4,alignItems:'center'},children:[(0,f.jsxs)(C.T,{size:15,center:!0,children:[h.ALLERGENS.find(t=>t.id===e.allergen)?.short,": how serious?"]}),(0,f.jsx)(C.Row,{wrap:!0,gap:6,style:{justifyContent:'center'},children:h.SEVERITIES.map(t=>(0,f.jsx)(C.Chip,{label:t.label,selected:e.severity===t.id,testID:`edit-severity-${e.allergen}-${t.id}`,onPress:()=>Q({allergies:re.map(s=>s.allergen===e.allergen?{...s,severity:t.id}:s)})},t.id))})]},e.allergen)),(0,f.jsx)(C.Field,{label:"Anything else about allergies",value:L.allergyNote,onChangeText:e=>Q({allergyNote:e}),testID:"edit-allergy-note"}),le.includes('allergies')&&re.length?(0,f.jsx)(C.T,{size:15,center:!0,colour:x.colours.amber,children:"The kitchen signs off allergies again after this change."}):null,(0,f.jsx)(E,{label:"Vegan",value:L.vegan??0,max:L.partySize,onChange:e=>Q({vegan:e}),testID:"edit-vegan"}),(0,f.jsx)(E,{label:"Vegetarian",value:L.vegetarian??0,max:L.partySize,onChange:e=>Q({vegetarian:e}),testID:"edit-vegetarian"})]}),'cancelled'!==O.status?(0,f.jsxs)(N,{title:"Status",testID:"edit-section-status",children:[(0,f.jsx)(C.Row,{wrap:!0,gap:6,style:{justifyContent:'center'},children:c.EDIT_STATUSES.map(e=>(0,f.jsx)(C.Chip,{label:e.label,selected:L.status===e.id,testID:`edit-status-${e.id}`,onPress:()=>Q({status:e.id})},e.id))}),(0,f.jsx)(C.Muted,{center:!0,children:"To cancel, use Cancel booking below. Nothing is ever deleted."})]}):null,(0,f.jsx)(N,{title:"Notes",testID:"edit-section-notes",children:(0,f.jsx)(C.Field,{label:"Notes",value:L.notes,onChangeText:e=>Q({notes:e}),placeholder:c.NOTES_PLACEHOLDER,multiline:!0,numberOfLines:3,testID:"edit-notes"})}),W?(0,f.jsxs)(a.default,{testID:"edit-warn",style:{gap:8,padding:12,borderRadius:12,borderWidth:1.5,borderColor:x.colours.amber,backgroundColor:x.colours.amberBg},children:[W.map(e=>(0,f.jsx)(C.T,{size:16,center:!0,colour:"#FFE2A8",children:e},e)),(0,f.jsx)(C.T,{size:16,center:!0,colour:"#FFE2A8",children:"You can still save."})]}):null,(0,c.isWixBooking)(O)&&(0,c.guestMessageFields)(le).length?(0,f.jsxs)(a.default,{testID:"edit-notify",style:{gap:6,alignItems:'center'},children:[(0,f.jsx)(C.Toggle,{value:J,onChange:K,label:c.NOTIFY_LABEL,testID:"edit-notify-toggle"}),(0,f.jsx)(C.Muted,{center:!0,children:J?'The website sends the guest its own message about this.':'Off: the guest isn\u2019t messaged. The website keeps the old date, time or status until it\u2019s changed there.'})]}):null,_?(0,f.jsx)(C.T,{size:16,center:!0,colour:x.colours.goldLight,children:_}):null,(0,f.jsxs)(C.Row,{gap:8,wrap:!0,children:[(0,f.jsx)(C.Button,{label:W?'Save anyway':'Save changes',testID:"edit-save",disabled:!ee||!ae||L.name.trim().length<1||!le.length,onPress:()=>{const t=ee?(0,o.blockAt)(R,e,L.date,Z):void 0,s=(0,c.editWarnings)(O,ne,B,t,oe,A);!s.length||W?de():M(s)},style:{minHeight:56,flex:1}}),(0,f.jsx)(C.Button,{kind:"ghost",label:"Close",onPress:p,style:{minHeight:56}})]}),he.length?(0,f.jsx)(N,{title:"Changes",testID:"edit-history",children:he.slice(0,12).map((e,t)=>(0,f.jsx)(C.T,{size:14,center:!0,colour:x.colours.muted,children:e},t))}):null,(0,f.jsx)(I.CancelBookingButton,{rid:e,b:O,name:O.name,big:!0,onDone:()=>p()}),(0,f.jsx)(I.ReinstateBookingButton,{b:O,name:O.name,today:(0,j.ymd)(new Date),onDone:()=>p()})]})}},1115,[34,1097,102,848,1014,1011,850,846,1111,830,997,865,1012,1092,840,827,1105,1089,1113,794,25]); __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,"useVoiceSlot",{enumerable:!0,get:function(){return w}}),_e.voiceAppFor=h,_e.useVoiceTarget=p,_e.VoiceSlot=function({size:e=56,layer:t=0}){const u=p(),c=(0,n.useRef)(null),l=(0,n.useRef)(y++).current,{width:f,height:h,fontScale:v}=(0,o.default)(),A=()=>{if(t{if(c.current!==e||!s||tu+.5?w.getState().owner===l&&w.setState({rect:null,owner:0}):w.setState({rect:{x:n,y:o,size:s},owner:l})})},W=(0,n.useRef)(A);return W.current=A,(0,n.useLayoutEffect)(()=>{if(u?.on)return S.set(l,{layer:t,measure:()=>W.current()}),()=>{S.delete(l),w.getState().owner===l&&w.setState({rect:null,owner:0}),requestAnimationFrame(b)}},[u?.on,t]),(0,n.useLayoutEffect)(()=>{A();const e=requestAnimationFrame(A);return()=>cancelAnimationFrame(e)},[f,h,v,u?.on]),(0,n.useEffect)(()=>{const e=c.current;if(!u?.on||'undefined'==typeof ResizeObserver||!e?.parentElement)return;const t=new ResizeObserver(A);return t.observe(e.parentElement),e.parentElement.parentElement&&t.observe(e.parentElement.parentElement),()=>t.disconnect()},[u?.on]),(0,n.useEffect)(()=>()=>{w.getState().owner===l&&w.setState({rect:null,owner:0})},[]),(0,n.useEffect)(()=>{u?.on||w.getState().owner!==l||w.setState({rect:null,owner:0})},[u?.on]),u?.on?(0,m.jsx)(s.default,{ref:c,testID:"voice-slot",onLayout:A,style:{width:e,height:e,flexShrink:0}}):null};var t=r(d[0]),n=r(d[1]),o=e(r(d[2])),s=e(r(d[3])),u=r(d[4]),c=r(d[5]),l=r(d[6]),f=r(d[7]),m=r(d[8]);const w=(0,u.create)(()=>({rect:null,owner:0}));function h(e){return'customer'===c.APP_VARIANT||/^\/(customer|table|demo)/.test(e)?null:e.startsWith('/owner')||e.startsWith('/admin')?'owner':e.startsWith('/team')?'staff':e.startsWith('/kitchen')?'chef':e.startsWith('/display')?'display':null}function p(){const e=(0,t.usePathname)()||'/',n=(0,l.useCtx)(6e4),o=(0,f.useVoiceSettings)(e=>e.enabled),s=h(e);if(!s)return null;const u='owner'===s?'owner'===n.role?'owner':'manager'===n.role?'manager':'staff':s;return{app:s,role:u,actions:'staff'===u?'staff':s,on:(0,f.voiceOn)(o,n.rid,u)}}let y=1;const S=new Map,E=()=>{let e=-1;return S.forEach(t=>{t.layer>e&&(e=t.layer)}),e};function b(){const e=E();S.forEach(t=>{t.layer===e&&t.measure()})}},1116,[30,34,426,102,815,846,1100,1117,25]); __d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"VOICE_ROLES",{enumerable:!0,get:function(){return o}}),Object.defineProperty(_e,"VOICE_ROLE_LABEL",{enumerable:!0,get:function(){return p}}),Object.defineProperty(_e,"useVoiceSettings",{enumerable:!0,get:function(){return u}}),Object.defineProperty(_e,"voiceOn",{enumerable:!0,get:function(){return f}}),_e.micExplainedFor=function(e){try{if('1'===b()?.getItem(s(e)))return!0}catch{}return u.getState().micExplained},_e.setMicExplainedFor=function(e){try{b()?.setItem(s(e),'1')}catch{}u.getState().setMicExplained(!0)};var e,n=r(d[0]),t=(e=n)&&e.__esModule?e:{default:e},c=r(d[1]),l=r(d[2]);const o=['owner','manager','staff','chef','display'],p={owner:'Owner (Managers app)',manager:'Managers (Managers app)',staff:'Staff app (full voice assistant, no money or HR)',chef:'Head Chef app',display:'Main Display'},u=(0,c.create)()((0,l.persist)(e=>({enabled:{},micExplained:!1,setEnabled:(n,t,c)=>e(e=>({enabled:{...e.enabled,[n]:{...e.enabled[n]??{},[t]:c}}})),setMicExplained:n=>e({micExplained:n})}),{name:'covercharge-voice-v1',version:4,storage:(0,l.createJSONStorage)(()=>t.default),migrate:(e,n)=>({enabled:n<2?{}:e?.enabled??{},micExplained:!!e?.micExplained}),merge:(e,n)=>({...n,enabled:e?.enabled??n.enabled,micExplained:e?.micExplained??n.micExplained}),partialize:e=>({enabled:e.enabled,micExplained:e.micExplained})})),f=(e,n,t)=>!1!==e[n]?.[t],s=e=>`cc-voice-mic-explained-${e}`,b=()=>{try{return'undefined'!=typeof window?window.localStorage:void 0}catch{return}}},1117,[808,815,818]); __d(function(g,_r,_i,a,_m,e,_d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"VAT",{enumerable:!0,get:function(){return r}}),Object.defineProperty(e,"exVat",{enumerable:!0,get:function(){return n}}),e.dishCost=i,Object.defineProperty(e,"gpPct",{enumerable:!0,get:function(){return o}}),Object.defineProperty(e,"priceForTarget",{enumerable:!0,get:function(){return c}}),e.costings=function(r,c,s,u){const d=(0,t.dishStats)(r);return c.map(t=>{const c=r.find(r=>r.id===t.dishId);if(!c||null==c.price)return null;const p=i(t,s),l=n(c.price),f=o(p,c.price),b=d.find(t=>t.item.id===c.id)?.sold??0;return{item:c,recipe:t,cost:p,priceInc:c.price,priceEx:l,gp:f,cashGp:l-p,below:ft.prevCost&&t.prevCost!==t.cost).map(s=>{const u=(s.cost-(s.prevCost??s.cost))/(s.prevCost??1)*100,d=r.filter(t=>t.lines.some(t=>t.ing===s.id)).map(r=>{const u=t.find(t=>t.id===r.dishId);if(!u||null==u.price)return null;const d=o(i(r,n,{ing:s.id,cost:s.prevCost}),u.price),p=o(i(r,n),u.price);return{item:u,before:d,after:p,dropped:d>=c&&pt.dropped),below:d.filter(t=>t.below)}})},e.weekGp=function(t,r,n){const i=t.reduce((t,r)=>t+r.priceEx*r.soldWeek,0),o=t.reduce((t,r)=>t+r.cost*r.soldWeek,0),c=o+r+Math.max(0,n);return{sales:i,theoCost:o,actualCost:c,theo:i?(i-o)/i*100:0,actual:i?(i-c)/i*100:0}},Object.defineProperty(e,"fmtQty",{enumerable:!0,get:function(){return s}});var t=_r(_d[0]);const r=.2,n=t=>Math.round(t/1.2);function i(t,r,n){return Math.round(t.lines.reduce((t,i)=>{const o=r.find(t=>t.id===i.ing);return t+(n&&n.ing===i.ing?n.cost:o?.cost??0)*i.qty},0))}const o=(t,r)=>{const i=n(r);return i>0?(i-t)/i*100:0},c=(t,r)=>50*Math.ceil(t/(1-r/100)*1.2/50);const s=(t,r)=>`${Number.isInteger(t)?t:t.toFixed(t<1?3:2).replace(/0+$/,'').replace(/\.$/,'')} ${'each'===r?'':r}`.trim()},1118,[1119]); @@ -1431,7 +1431,7 @@ __d(function(g,r,i,_a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{ __d(function(_g,_r,i,_a,_m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.GiftTill=b,_e.GiftTillManager=y,_e.GiftShopManager=w,_e.PaymentsTestMode=S,_e.GiftCardsPage=function({me:e}){return(0,p.staffServer)()?(0,j.jsxs)(l.default,{style:{gap:10},children:[(0,j.jsx)(b,{me:e}),(0,x.can)('orders.manage')?(0,j.jsx)(y,{me:e}):null,(0,x.can)('venue.settings')?(0,j.jsx)(w,{me:e}):null,(0,x.can)('venue.settings')?(0,j.jsx)(S,{me:e}):null]}):(0,j.jsx)(r.Banner,{kind:"demo",title:"Gift cards are saved on the server",children:"Sign this device in to your venue to check and take gift cards. There are no example cards here."})};var e,t=_r(d[0]),s=_r(d[1]),n=_r(d[2]),a=_r(d[3]),l=(e=a)&&e.__esModule?e:{default:e},r=_r(d[4]),o=_r(d[5]),c=_r(d[6]),u=_r(d[7]),h=_r(d[8]),x=_r(d[9]),p=_r(d[10]),g=_r(d[11]),j=_r(d[12]);const f=e=>{if(!e)return'';try{return new Date(e).toLocaleDateString('en-GB',{day:'numeric',month:'short',year:'numeric',timeZone:'Europe/London'})}catch{return e.slice(0,10)}},m=({m:e})=>e?(0,j.jsx)(r.Banner,{kind:e.kind,title:e.text}):null;function b({me:e}){const[t,s]=(0,n.useState)(''),[a,x]=(0,n.useState)(null),[p,b]=(0,n.useState)(''),[y,w]=(0,n.useState)((0,u.redeemKey)()),[k,S]=(0,n.useState)(null),[T,C]=(0,n.useState)(!1),v=(0,u.poundsToPence)(p);return(0,j.jsx)(l.default,{testID:"gift-till",children:(0,j.jsx)(r.Card,{children:(0,j.jsxs)(l.default,{style:{gap:8},children:[(0,j.jsx)(r.T,{weight:"semibold",children:"Check a gift card or take it off the bill"}),(0,j.jsx)(r.Field,{label:"Gift card code",value:t,autoCapitalize:"characters",onChangeText:e=>{s(e),x(null),w((0,u.redeemKey)())},placeholder:"XXXX-XXXX-XXXX-XXXX",testID:"gift-code"}),(0,j.jsx)(r.Button,{label:T?'Checking\u2026':'Check balance',kind:"ghost",small:!0,disabled:T||t.replace(/\W/g,'').length<6,testID:"gift-check",onPress:async()=>{C(!0),S(null);try{const e=await(0,h.giftCheck)(t);x(e),e.found||S({kind:'warn',text:'No gift card with that code here.'})}catch(e){S({kind:'warn',text:(0,c.plainError)(e)})}finally{C(!1)}}}),a?.found?(0,j.jsxs)(l.default,{style:{gap:4},testID:"gift-card-found",children:[(0,j.jsxs)(r.Row,{style:{justifyContent:'space-between'},children:[(0,j.jsx)(r.T,{weight:"medium",children:(0,u.prettyGiftCode)(t)}),(0,j.jsx)(r.T,{size:20,weight:"bold",colour:g.colours.gold,children:(0,o.gbp)(a.balancePence)})]}),(0,j.jsxs)(r.Muted,{size:12,children:[u.STATUS_WORDS[a.status]??a.status," \xb7 of ",(0,o.gbp)(a.initialPence),a.expiresAt?` \xb7 use by ${f(a.expiresAt)}`:'','wix'===a.source?' \xb7 old website bookings card':'']}),'active'===a.status?(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(r.Field,{label:"Amount to take off \xa3",value:p,onChangeText:b,keyboardType:"decimal-pad",testID:"gift-amount"}),(0,j.jsx)(r.Button,{label:T?'Taking it off\u2026':v?`Take ${(0,o.gbp)(v)} off the card`:'Take it off the card',disabled:T||!v||v>a.balancePence,testID:"gift-redeem",onPress:async()=>{C(!0),S(null);try{const s=await(0,h.giftRedeem)(t,v,y,e);x({...a,...s,found:!0}),b(''),w((0,u.redeemKey)()),S({kind:'success',text:`${s.already?'Already taken: ':'Taken '}${(0,o.gbp)(s.redeemedPence)}. ${(0,o.gbp)(s.balancePence)} left on the card.`})}catch(e){S({kind:'warn',text:(0,c.plainError)(e)})}finally{C(!1)}}})]}):null]}):null,(0,j.jsx)(m,{m:k})]})})})}function y({me:e}){const[t,s]=(0,n.useState)([]),[a,x]=(0,n.useState)([]),[p,b]=(0,n.useState)(null),[y,w]=(0,n.useState)(''),[k,S]=(0,n.useState)(''),[T,C]=(0,n.useState)(null),[v,P]=(0,n.useState)(null),I=(0,n.useCallback)(()=>{(0,h.waitingCards)().then(s).catch(()=>{}),(0,h.shopOrders)().then(x).catch(()=>{})},[]);(0,n.useEffect)(()=>{I()},[I]);const D=async(e,t)=>{b(null);try{await e(),b({kind:'success',text:t}),I()}catch(e){b({kind:'warn',text:(0,c.plainError)(e)})}},M=t.filter(e=>'waiting-payment'===e.status),_=a.filter(e=>!['collected','cancelled'].includes(e.status)),B=(0,u.poundsToPence)(y);return(0,j.jsxs)(l.default,{style:{gap:10},children:[(0,j.jsx)(l.default,{testID:"gift-waiting",children:(0,j.jsx)(r.Card,{children:(0,j.jsxs)(l.default,{style:{gap:6},children:[(0,j.jsxs)(r.T,{weight:"semibold",children:["Waiting for payment at the till (",M.length+_.filter(e=>'waiting-payment'===e.status).length,")"]}),(0,j.jsx)(r.Muted,{size:12,children:"Card payment in the app isn\u2019t on yet. Take the money at the till, then mark it paid here."}),M.map(t=>(0,j.jsxs)(r.Row,{style:{justifyContent:'space-between'},children:[(0,j.jsxs)(l.default,{style:{flex:1},children:[(0,j.jsxs)(r.T,{children:["Gift card ",t.ref," \xb7 ",(0,o.gbp)(t.initial_pence)]}),(0,j.jsxs)(r.Muted,{size:12,children:["for ",t.recipient_name||'no name'," \xb7 ends ",t.last4]})]}),(0,j.jsx)(r.Button,{label:"Paid at the till",small:!0,testID:`gift-paid-${t.ref}`,onPress:()=>D(()=>(0,h.giftActivate)(t.id,e),`${t.ref} is ready to use`)})]},t.id)),_.map(t=>(0,j.jsxs)(l.default,{style:{gap:4},children:[(0,j.jsxs)(r.Row,{style:{justifyContent:'space-between'},children:[(0,j.jsxs)(l.default,{style:{flex:1},children:[(0,j.jsxs)(r.T,{children:["Shop ",t.ref," \xb7 ",t.guest_name," \xb7 ",(0,o.gbp)(t.total_pence)]}),(0,j.jsxs)(r.Muted,{size:12,children:[t.lines.map(e=>`${e.qty}\xd7 ${e.name}`).join(', ')," \xb7 ",u.STATUS_WORDS[t.status]]})]}),'waiting-payment'===t.status?(0,j.jsx)(r.Button,{label:"Paid at the till",small:!0,onPress:()=>D(()=>(0,h.shopStatus)(t.id,'paid','',e),`${t.ref} paid`)}):'paid'===t.status?(0,j.jsx)(r.Button,{label:"Ready",small:!0,onPress:()=>D(()=>(0,h.shopStatus)(t.id,'ready','',e),`${t.ref} ready`)}):(0,j.jsx)(r.Button,{label:"Collected",small:!0,onPress:()=>D(()=>(0,h.shopStatus)(t.id,'collected','',e),`${t.ref} collected`)})]}),v&&v.id===t.id?(0,j.jsxs)(r.Row,{style:{gap:6,alignItems:'flex-end'},children:[(0,j.jsx)(l.default,{style:{flex:1},children:(0,j.jsx)(r.Field,{label:"Reason",value:v.reason,onChangeText:e=>P({id:t.id,reason:e})})}),(0,j.jsx)(r.Button,{label:"Cancel order",kind:"danger",small:!0,disabled:v.reason.trim().length<3,onPress:()=>D(()=>(0,h.shopStatus)(t.id,'cancelled',v.reason,e),`${t.ref} cancelled, stock put back`).then(()=>P(null))})]}):(0,j.jsx)(r.Button,{label:"Cancel with a reason",kind:"ghost",small:!0,onPress:()=>P({id:t.id,reason:''})})]},t.id)),M.length||_.length?null:(0,j.jsx)(r.Muted,{children:"Nothing waiting."})]})})}),(0,j.jsx)(l.default,{testID:"gift-sell",children:(0,j.jsx)(r.Card,{children:(0,j.jsxs)(l.default,{style:{gap:6},children:[(0,j.jsx)(r.T,{weight:"semibold",children:"Sell a gift card at the till"}),(0,j.jsx)(r.Field,{label:"Amount \xa3",value:y,onChangeText:w,keyboardType:"decimal-pad",testID:"gift-sell-amount"}),(0,j.jsx)(r.Field,{label:"Who it\u2019s for (optional)",value:k,onChangeText:S}),(0,j.jsx)(r.Button,{label:B?`Paid ${(0,o.gbp)(B)} at the till: make the card`:'Make the card',small:!0,disabled:!B,testID:"gift-sell-btn",onPress:()=>D(async()=>{const t=await(0,h.giftIssue)(B,k,e);C(t),w(''),S('')},'Card made')}),T?.code?(0,j.jsxs)(l.default,{style:{gap:2},children:[(0,j.jsx)(r.T,{size:22,weight:"bold",colour:g.colours.gold,center:!0,children:T.code}),(0,j.jsxs)(r.Muted,{center:!0,size:12,children:["Shown once: write it on the card or receipt now. ",(0,o.gbp)(T.initialPence),", use by ",f(T.expiresAt),"."]})]}):null]})})}),(0,j.jsx)(m,{m:p})]})}function w({me:e}){const[t,s]=(0,n.useState)(null),[a,x]=(0,n.useState)(''),[p,b]=(0,n.useState)(null),[y,w]=(0,n.useState)([]),[k,S]=(0,n.useState)({name:'',price:'',details:''}),[T,C]=(0,n.useState)(null),[v,P]=(0,n.useState)({code:'',bal:''}),[I,D]=(0,n.useState)([]),[M,_]=(0,n.useState)(null),B=(0,n.useCallback)(()=>{(0,h.readShopSettings)().then(e=>{s(e),x(e.amounts.map(e=>String(e/100)).join(', '))}).catch(e=>C({kind:'warn',text:(0,c.plainError)(e)})),(0,h.readProducts)().then(w).catch(()=>{}),(0,h.giftSummary)().then(b).catch(()=>{}),(0,h.waitingCards)().then(D).catch(()=>{})},[]);(0,n.useEffect)(()=>{B()},[B]);const R=async(e,t)=>{C(null);try{await e(),C({kind:'success',text:t}),B()}catch(e){C({kind:'warn',text:(0,c.plainError)(e)})}};if(!t)return(0,j.jsx)(r.Card,{children:(0,j.jsx)(r.Muted,{children:T?.text??'Loading\u2026'})});const z=(0,u.amountsFromText)(a);return(0,j.jsxs)(l.default,{style:{gap:10},children:[p?(0,j.jsx)(l.default,{testID:"gift-summary",children:(0,j.jsxs)(r.Row,{style:{gap:8},children:[(0,j.jsxs)(r.Card,{style:{flex:1},children:[(0,j.jsx)(r.Muted,{children:"Sold (paid)"}),(0,j.jsx)(r.T,{size:20,weight:"bold",children:(0,o.gbp)(p.soldPence)})]}),(0,j.jsxs)(r.Card,{style:{flex:1},children:[(0,j.jsx)(r.Muted,{children:"Still to spend"}),(0,j.jsx)(r.T,{size:20,weight:"bold",children:(0,o.gbp)(p.outstandingPence)})]}),(0,j.jsxs)(r.Card,{style:{flex:1},children:[(0,j.jsx)(r.Muted,{children:"Waiting"}),(0,j.jsx)(r.T,{size:20,weight:"bold",children:p.waiting})]})]})}):null,(0,j.jsx)(l.default,{testID:"gift-settings",children:(0,j.jsx)(r.Card,{children:(0,j.jsxs)(l.default,{style:{gap:8},children:[(0,j.jsx)(r.T,{weight:"semibold",children:"Gift cards and shop settings"}),(0,j.jsx)(r.Toggle,{label:"Sell gift cards in the customer app",value:t.giftsOn,onChange:e=>s({...t,giftsOn:e}),testID:"gift-on"}),(0,j.jsx)(r.Toggle,{label:"Open the shop in the customer app",value:t.shopOn,onChange:e=>s({...t,shopOn:e}),testID:"shop-on"}),(0,j.jsxs)(r.T,{children:["Cards last ",(0,u.expiryWords)(t.expiryMonths)," from when they\u2019re paid"]}),(0,j.jsx)(r.Stepper,{value:t.expiryMonths,min:1,max:60,label:"Gift card expiry in months",onChange:e=>s({...t,expiryMonths:e})}),(0,j.jsx)(r.Field,{label:"Amounts guests can pick (\xa3, comma between)",value:a,onChangeText:x,testID:"gift-amounts"}),(0,j.jsx)(r.Field,{label:"Terms shown to guests (optional)",value:t.terms,onChangeText:e=>s({...t,terms:e}),multiline:!0}),(0,j.jsx)(r.Muted,{size:12,children:"Gift cards are sold through your website. Guests can also pay at the bar or till."}),(0,j.jsx)(r.Button,{label:"Save",disabled:!z,testID:"gift-settings-save",onPress:()=>R(()=>(0,h.saveShopSettings)({...t,amounts:z}),'Saved. The customer app shows it next time it opens.')})]})})}),(0,j.jsx)(l.default,{testID:"shop-products",children:(0,j.jsx)(r.Card,{children:(0,j.jsxs)(l.default,{style:{gap:8},children:[(0,j.jsx)(r.T,{weight:"semibold",children:"Shop products"}),y.map(e=>(0,j.jsxs)(l.default,{style:{gap:4,borderTopWidth:1,borderColor:g.colours.border,paddingTop:6},children:[(0,j.jsxs)(r.Row,{style:{justifyContent:'space-between'},children:[(0,j.jsx)(r.T,{weight:"medium",style:{flex:1},children:e.name}),(0,j.jsx)(r.T,{children:(0,o.gbp)(e.price_pence)})]}),(0,j.jsxs)(r.Row,{style:{justifyContent:'space-between',alignItems:'center'},children:[(0,j.jsx)(l.default,{style:{flex:1},children:(0,j.jsx)(r.Toggle,{label:e.is_live?'In the shop':'Hidden',a11y:`${e.name} in the shop`,value:e.is_live,onChange:t=>R(()=>(0,h.saveProduct)({id:e.id,name:e.name,details:e.details,pricePence:e.price_pence,stock:e.stock,live:t}),'Saved')})}),(0,j.jsxs)(l.default,{style:{alignItems:'flex-end'},children:[(0,j.jsx)(r.Muted,{size:12,children:"Stock"}),(0,j.jsx)(r.Stepper,{value:e.stock,min:0,max:500,label:`${e.name} stock`,onChange:t=>R(()=>(0,h.saveProduct)({id:e.id,name:e.name,details:e.details,pricePence:e.price_pence,stock:t,live:e.is_live}),'Stock saved')})]})]}),0===e.stock?(0,j.jsx)(r.Badge,{kind:"amber",label:"Sold out"}):null]},e.id)),y.length?null:(0,j.jsx)(r.Muted,{children:"No products yet."}),(0,j.jsx)(r.Field,{label:"New product name",value:k.name,onChangeText:e=>S({...k,name:e}),testID:"shop-new-name"}),(0,j.jsx)(r.Field,{label:"Price \xa3",value:k.price,onChangeText:e=>S({...k,price:e}),keyboardType:"decimal-pad",testID:"shop-new-price"}),(0,j.jsx)(r.Field,{label:"Details (optional)",value:k.details,onChangeText:e=>S({...k,details:e})}),(0,j.jsx)(r.Button,{label:"Add product (hidden until you switch it on)",kind:"ghost",small:!0,disabled:k.name.trim().length<2||!(0,u.poundsToPence)(k.price),onPress:()=>R(async()=>{await(0,h.saveProduct)({name:k.name,details:k.details,pricePence:(0,u.poundsToPence)(k.price),stock:0,live:!1}),S({name:'',price:'',details:''})},'Product added')})]})})}),(0,j.jsx)(l.default,{testID:"gift-wix",children:(0,j.jsx)(r.Card,{children:(0,j.jsxs)(l.default,{style:{gap:6},children:[(0,j.jsx)(r.T,{weight:"semibold",children:"Honour an old website bookings gift card"}),(0,j.jsx)(r.Muted,{size:12,children:"Check the balance in your website bookings dashboard first. Each website bookings code can be added once."}),(0,j.jsx)(r.Field,{label:"Website bookings code",value:v.code,autoCapitalize:"characters",onChangeText:e=>P({...v,code:e})}),(0,j.jsx)(r.Field,{label:"Balance you checked in website bookings \xa3",value:v.bal,keyboardType:"decimal-pad",onChangeText:e=>P({...v,bal:e})}),(0,j.jsx)(r.Button,{label:"Add to CoverCharge",kind:"ghost",small:!0,disabled:v.code.replace(/\W/g,'').length<6||!(0,u.poundsToPence)(v.bal),onPress:()=>R(async()=>{await(0,h.giftHonourWix)(v.code,(0,u.poundsToPence)(v.bal),e),P({code:'',bal:''})},'Website bookings card added')})]})})}),(0,j.jsx)(l.default,{testID:"gift-list",children:(0,j.jsx)(r.Card,{children:(0,j.jsxs)(l.default,{style:{gap:4},children:[(0,j.jsx)(r.T,{weight:"semibold",children:"Recent cards"}),I.map(t=>(0,j.jsxs)(l.default,{style:{gap:2},children:[(0,j.jsxs)(r.Row,{style:{justifyContent:'space-between'},children:[(0,j.jsxs)(r.T,{style:{flex:1},children:[t.ref," \xb7 ends ",t.last4," \xb7 ",'wix'===t.source?'Website bookings':'till'===t.source?'Till':'App']}),(0,j.jsxs)(r.T,{children:[(0,o.gbp)(t.balance_pence)," / ",(0,o.gbp)(t.initial_pence)]})]}),(0,j.jsxs)(r.Row,{style:{justifyContent:'space-between'},children:[(0,j.jsxs)(r.Muted,{size:12,children:[u.STATUS_WORDS[t.status]??t.status,t.expires_at?` \xb7 use by ${f(t.expires_at)}`:'']}),'void'!==t.status&&M?.id!==t.id?(0,j.jsx)(r.Button,{label:"Cancel card",kind:"ghost",small:!0,onPress:()=>_({id:t.id,reason:''})}):null]}),M&&M.id===t.id?(0,j.jsxs)(r.Row,{style:{gap:6,alignItems:'flex-end'},children:[(0,j.jsx)(l.default,{style:{flex:1},children:(0,j.jsx)(r.Field,{label:"Reason",value:M.reason,onChangeText:e=>_({id:t.id,reason:e})})}),(0,j.jsx)(r.Button,{label:"Cancel it",kind:"danger",small:!0,disabled:M.reason.trim().length<3,onPress:()=>R(()=>(0,h.giftVoid)(t.id,M.reason,e),'Card cancelled (kept on record)').then(()=>_(null))})]}):null]},t.id)),I.length?null:(0,j.jsx)(r.Muted,{children:"No cards yet."})]})})}),(0,j.jsx)(m,{m:T})]})}const k={none:'Pay at the till only',stripe:'Stripe (test mode)',wix:'Website bookings payments (coming)'};function S({me:e}){if(t.IS_GREENSIDE)return(0,j.jsx)(s.GreensideCashOnly,{});const[a,u]=(0,n.useState)(null),[x,p]=(0,n.useState)([]),[g,b]=(0,n.useState)(null),y=(0,n.useCallback)(()=>{(0,h.readPaySettings)().then(u).catch(e=>b({kind:'warn',text:(0,c.plainError)(e)})),(0,h.recentPayments)().then(p).catch(()=>{})},[]);return(0,n.useEffect)(()=>{y()},[y]),a?(0,j.jsx)(l.default,{testID:"pay-settings",children:(0,j.jsx)(r.Card,{children:(0,j.jsxs)(l.default,{style:{gap:8},children:[(0,j.jsxs)(r.Row,{style:{justifyContent:'space-between',alignItems:'center'},children:[(0,j.jsx)(r.T,{weight:"semibold",children:"Card payments"}),(0,j.jsx)(r.Badge,{kind:"amber",label:"TEST MODE"})]}),(0,j.jsx)(r.Banner,{kind:"demo",title:"Test mode only: no real money",children:"This build can\u2019t take live payments. Guests pay at the bar or till unless you switch on Stripe test mode below."}),(0,j.jsx)(r.Row,{wrap:!0,children:['none','stripe','wix'].map(e=>(0,j.jsx)(r.Chip,{label:k[e],selected:a.provider===e,onPress:()=>u({...a,provider:e,cardOn:'stripe'===e&&a.cardOn})},e))}),'stripe'===a.provider?(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(r.Field,{label:"Venue\u2019s Stripe account id (starts acct_)",value:a.account,autoCapitalize:"none",onChangeText:e=>u({...a,account:e.trim()}),placeholder:"acct_\u2026",testID:"pay-account"}),(0,j.jsx)(r.Muted,{size:12,children:"Money goes straight to the venue\u2019s own Stripe account. Never paste a key here."}),(0,j.jsx)(r.Toggle,{label:"Offer \u201cPay by card (test mode)\u201d in the customer app",value:a.cardOn,onChange:e=>u({...a,cardOn:e}),testID:"pay-card-on"}),(0,j.jsx)(r.Muted,{size:12,children:"Needs CoverCharge\u2019s Stripe sandbox to be set up first (Gordon\u2019s step). Until then guests see pay at the till."})]}):null,'wix'===a.provider?(0,j.jsx)(r.Banner,{kind:"demo",title:"Website bookings payments aren\u2019t linked yet",children:"Website bookings venues keep taking payments on their website. In the app, guests pay at the bar or till."}):null,(0,j.jsx)(r.Button,{label:"Save",testID:"pay-save",onPress:async()=>{b(null);try{await(0,h.savePaySettings)(a),b({kind:'success',text:'Saved'}),y()}catch(e){b({kind:'warn',text:(0,c.plainError)(e)})}}}),x.length?(0,j.jsxs)(l.default,{style:{gap:2},children:[(0,j.jsx)(r.T,{weight:"medium",children:"Recent test payments"}),x.map(e=>(0,j.jsxs)(r.Row,{style:{justifyContent:'space-between'},children:[(0,j.jsxs)(r.Muted,{children:['gift'===e.kind?'Gift card':'Shop'," \xb7 ",f(e.created_at)]}),(0,j.jsxs)(r.T,{children:[(0,o.gbp)(e.amount_pence)," \xb7 ",e.status]})]},e.id))]}):null,(0,j.jsx)(m,{m:g})]})})}):(0,j.jsx)(r.Card,{children:(0,j.jsx)(r.Muted,{children:g?.text??'Loading\u2026'})})}},1348,[5,1349,34,102,794,836,1196,1197,1198,985,1199,840,25]); __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.GreensideCashOnly=function(){return(0,s.jsxs)(n.Card,{children:[(0,s.jsx)(n.T,{weight:"semibold",children:"Cash only"}),(0,s.jsx)(n.Muted,{children:"Card payments and online checkout are not enabled for The Greenside Restaurant. Deposits are off; the policy needs confirmation."})]})},r(d[0]);var n=r(d[1]),s=r(d[2])},1349,[34,794,25]); __d(function(g,_r,i,a,_m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.CashUpAccessToggle=function({m:e}){const c=(0,o.useCashAccess)(s=>!0===s.byRef[e.id]),l=(0,o.useCashAccess)(e=>e.loaded),b=(0,r.useSync)(e=>'staff'===e.kind&&!!e.venueId),[y,C]=(0,s.useState)(!1),[m,x]=(0,s.useState)(null);if((0,s.useEffect)(()=>{b&&!l&&(0,u.refreshCashAccess)()},[b,l]),p(e))return(0,h.jsxs)(t.default,{testID:`cashup-access-${e.id}`,style:{gap:2},accessible:!0,accessibilityLabel:`${f(e)} can use cash up: always, as ${'owner'===e.role?'an owner':'a manager'}`,children:[(0,h.jsx)(n.T,{size:14,children:"Can use cash up"}),(0,h.jsxs)(n.Muted,{size:12,children:["Always on for ",'owner'===e.role?'owners':'managers',"."]})]});const j=async s=>{C(!0),x(null);const c=await(0,u.setStaffCashUp)(e.id,s);C(!1),x(c.ok?s?`${f(e)} can now open the cash up. The change is in the cash-up log.`:`${f(e)} can no longer open the cash up. The change is in the cash-up log.`:c.error??'Could not save.')};return(0,h.jsxs)(t.default,{testID:`cashup-access-${e.id}`,style:{gap:2},children:[(0,h.jsx)(n.Toggle,{testID:`cashup-toggle-${e.id}`,label:"Can use cash up",value:c,disabled:y||!b,onChange:e=>{j(e)}}),(0,h.jsx)(n.Muted,{size:12,children:b?c?'Can open the cash up, take a picture of the taking sheet and upload a spreadsheet.':'Off: the cash up is hidden from them and the server refuses it.':'Connect to the shared team to change this.'}),m?(0,h.jsx)(t.default,{accessibilityLiveRegion:"polite",children:(0,h.jsx)(n.Muted,{size:12,testID:`cashup-msg-${e.id}`,children:m})}):null]})},_e.CashUpAccessBadge=function({m:e}){const s=(0,o.useCashAccess)(s=>!0===s.byRef[e.id]);return p(e)||s?(0,h.jsx)(t.default,{accessible:!0,accessibilityLabel:`${f(e)} can use cash up`,testID:`cashup-badge-${e.id}`,children:(0,h.jsx)(n.Badge,{kind:"gold",label:"Cash up"})}):null},_e.NoCashUpAccess=function(){return(0,h.jsxs)(t.default,{testID:"cashup-no-access",accessible:!0,accessibilityRole:"text",accessibilityLabel:"You can't use the cash up yet. A manager can switch it on for you in Staff and roles.",style:{borderWidth:1,borderColor:l.colours.border,borderRadius:14,padding:16,gap:6,backgroundColor:l.colours.surface},children:[(0,h.jsx)(n.T,{size:18,weight:"semibold",children:"You can\u2019t use the cash up yet"}),(0,h.jsx)(n.T,{children:"A manager can switch it on for you in Staff & roles (\u201cCan use cash up\u201d)."})]})};var e,s=_r(d[0]),c=_r(d[1]),t=(e=c)&&e.__esModule?e:{default:e},n=_r(d[2]),l=_r(d[3]),o=_r(d[4]),u=_r(d[5]),r=_r(d[6]),h=_r(d[7]);const p=e=>'owner'===e.role||'manager'===e.role&&!e.managerAccess,f=e=>e.name.replace(' (example)','').split(' ')[0]},1350,[34,102,794,840,993,1037,985,25]); -__d(function(g,_r,_i,_a,m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.Bookings=function({go:e}={}){const{rid:C,r:X,now:Z,today:ee,me:se,role:te}=(0,p.useCtx)(1e4),le=(0,v.useBookings)(C),ne=(0,p.useInStaffApp)(),ie=(0,p.useShiftManager)(),ae=(0,v.useWaitlist)(C),[oe,de]=((0,v.useStore)(e=>e.alertAcks),(0,T.useState)(ee)),re=(0,R.useFrontDoor)(oe),ue=(0,k.useBookingWrite)(),[ce,he]=(0,T.useState)(''),[ge,be]=(0,T.useState)(!1),[pe,ke]=(0,T.useState)(2),me=oee.date===oe).sort((e,s)=>e.time.localeCompare(s.time)),ye=ae.filter(e=>'waiting'===e.status||'notified'===e.status).sort((e,s)=>e.number-s.number),we=xe.filter(e=>'noshow'===e.status),je=(0,V.useSync)(e=>!!e.venueId&&'guest'!==e.kind),fe=xe.filter(e=>'cancelled'!==e.status).reduce((e,s)=>e+s.partySize,0),Ie=(0,c.cancelledDayTally)(le,oe),Be=(0,c.cancelledTallyWords)(Ie,oe===ee?'today':'that day'),Se=xe.filter(e=>!e.walkIn),De=xe.filter(e=>e.walkIn),$e=le.filter(e=>'pending'===e.status&&e.date>=ee).sort((e,s)=>(e.date+e.time).localeCompare(s.date+s.time)),[Te,Ce]=(0,T.useState)(null),Le=(0,M.parseYmd)(oe);Le.setHours(12);const Ne=(0,Q.hoursFor)(X,Le),Pe=Ne?.open??new Date(`${oe}T12:00:00`),ve=Ne?.close??new Date(`${oe}T21:00:00`),Oe=Ne||xe.length?me?'No one seated that day':oe===ee?'No bookings yet today':'No bookings yet':oe===ee?'Closed today':'Closed that day';return(0,J.jsxs)(L.default,{style:{gap:12},children:[e&&!ne&&'staff'!==te?(0,J.jsx)(N.Button,{testID:"bookings-dashboard-top",label:"Bookings dashboard",accessibilityLabel:"Open Bookings dashboard: table plan, Timeline, today's guests and Covers",onPress:()=>e('more','serviceboard'),style:{width:'100%',minHeight:60}}):null,s.IS_WILDINGS||(s.IS_QUEUED_VENUE||s.IS_KIRKTON||s.IS_GREENSIDE||'abbotsford'===C)&&!ne&&'staff'!==te?(0,J.jsx)(n.VenueRequestList,{rid:C,kind:"table"}):null,!s.IS_WILDINGS&&!X.settings.hotel?.enabled||ne||'staff'===te?null:(0,J.jsx)(n.VenueRequestList,{rid:C,kind:"room",hotel:X.settings.hotel??l.WILDINGS_HOTEL}),(0,J.jsx)(G.BookingsDayNav,{today:ee,date:oe,onDate:de,count:e=>le.filter(s=>s.date===e&&'cancelled'!==s.status).length,sub:e=>{const s=le.filter(s=>s.date===e&&'cancelled'!==s.status&&!s.walkIn),t=s.reduce((e,s)=>e+s.partySize,0);return`${s.length} ${1===s.length?'table':'tables'} \xb7 ${t} ${1===t?'Cover':'Covers'}`}}),(0,J.jsx)(L.default,{testID:"bookings-day-graph",style:{overflow:'visible'},children:(0,J.jsx)(q.DayGraph,{bare:!0,fill:!0,todays:xe,open:Pe,close:ve,now:Z,turnBase:X.settings.turnMins,height:128,past:me,closed:!Ne,emptyText:Oe})}),me?(0,J.jsxs)(L.default,{testID:"bookings-past-totals",style:[N.styles.card,{gap:4}],accessible:!0,accessibilityLabel:`${(0,G.longDay)(oe)}: ${Se.length} tables, ${fe} Covers, ${xe.filter(e=>'finished'===e.status).length} finished, ${we.length} no-shows, ${xe.filter(e=>'cancelled'===e.status).length} cancelled`,children:[(0,J.jsxs)(N.T,{size:17,weight:"semibold",children:["That day: ",Se.length," table",1===Se.length?'':'s',De.length?` \xb7 ${De.length} walk-in${1===De.length?'':'s'}`:''," \xb7 ",fe," ",1===fe?'Cover':'Covers']}),(0,J.jsxs)(N.T,{size:16,colour:A.colours.text,children:[xe.filter(e=>'finished'===e.status).length," finished \xb7 ",we.length," no-show",1===we.length?'':'s'," \xb7 ",xe.filter(e=>'cancelled'===e.status).length," cancelled"]}),(0,J.jsx)(N.Muted,{children:"Looking back: read-only. Undo is still there for a mistake made today."})]}):null,(0,J.jsx)(L.default,{testID:"bookings-summary",children:(0,J.jsxs)(N.T,{weight:"semibold",children:[Se.length," table",1===Se.length?'':'s'," booked",De.length?` \xb7 ${De.length} walk-in${1===De.length?'':'s'}`:''," \xb7 ",fe," ",1===fe?'Cover':'Covers']})}),(0,J.jsx)(L.default,{testID:"cancelled-day-tally",accessible:!0,accessibilityLabel:Be,style:{alignItems:'center'},children:(0,J.jsx)(N.T,{size:15,colour:A.colours.muted,center:!0,children:Be})}),(0,J.jsxs)(L.default,{testID:"bookings-actions",style:{flexDirection:'row',flexWrap:'wrap',gap:8},children:[me?null:(0,J.jsx)(I.QuietButton,{label:"New booking",onPress:re.openBooking,testID:"add-booking",disabled:!ue.ok,accessibilityHint:ue.hint}),ne&&ie&&oe===ee?(0,J.jsx)(I.QuietButton,{label:"Walk-in",onPress:re.openWalkIn,testID:"add-walkin",disabled:!ue.ok,accessibilityHint:ue.hint}):null,oe===ee?(0,J.jsx)(B.CloseGardenButton,{quiet:!0,short:!0,rid:C,r:X,now:Z,by:se}):null]}),$e.length?(0,J.jsxs)(L.default,{testID:"pending-requests",style:[N.styles.card,{borderColor:A.colours.amber,gap:8}],children:[(0,J.jsxs)(N.T,{weight:"semibold",colour:A.colours.amber,children:["Needs confirming (",$e.length,")"]}),(0,J.jsx)(N.Muted,{children:"Online requests outside your auto-accept rules. Check the details before confirming."}),$e.map(e=>(0,J.jsxs)(L.default,{style:{gap:6,paddingTop:6,borderTopWidth:1,borderColor:A.colours.border},children:[(0,J.jsxs)(N.T,{weight:"semibold",children:[e.name," \xb7 ",e.partySize," ",1===e.partySize?'Cover':'Covers']}),(0,J.jsxs)(N.Muted,{children:[(0,M.niceDate)((0,M.parseYmd)(e.date))," at ",e.time," \xb7 ",e.ref," \xb7 ",e.phone??'no phone']}),e.notes?(0,J.jsxs)(N.T,{size:16,children:["Notes: ",e.notes]}):null,e.allergies.length?(0,J.jsx)(N.Row,{wrap:!0,gap:4,children:e.allergies.map(e=>(0,J.jsx)(N.Badge,{kind:"red",label:`${(0,O.allergenLabel)(e.allergen)} \xb7 ${(0,O.severityLabel)(e.severity)}`},e.allergen))}):null,(0,J.jsx)(S.NeedsPills,{b:e,r:X}),'staff'!==te&&((0,D.needsHoldOk)(e)||e.date===ee&&e.holdOk&&(e.holds??[]).some(e=>!e.served)&&'seated'===e.status)?(0,J.jsxs)(N.Row,{wrap:!0,gap:6,children:[(0,D.needsHoldOk)(e)?(0,J.jsx)(N.Button,{small:!0,kind:"success",label:"Platter OK",testID:`mgr-platter-ok-${e.ref}`,onPress:()=>(0,S.confirmHolds)(e.id,se)}):null,e.holdOk&&'seated'===e.status?(0,J.jsx)(N.Button,{small:!0,kind:"secondary",label:"Platter served",onPress:()=>(0,S.serveHolds)(e,se,'owner')}):null]}):null,Te===e.id?(0,J.jsxs)(L.default,{style:{gap:6},children:[(0,J.jsxs)(N.T,{size:14,children:["Are you sure? ",e.name.split(' ')[0]," will get a polite \u201csorry, we can\u2019t fit you in\u201d message."]}),(0,J.jsxs)(N.Row,{gap:6,children:[(0,J.jsx)(N.Button,{small:!0,kind:"danger",label:"Yes, decline",onPress:()=>{v.repo.bookings.decide(e.id,'declined',se),Ce(null)}}),(0,J.jsx)(N.Button,{small:!0,kind:"ghost",label:"Keep it",onPress:()=>Ce(null)})]})]}):ue.ok?(0,J.jsxs)(N.Row,{gap:6,children:[(0,J.jsx)(N.Button,{small:!0,label:"Confirm",testID:`confirm-${e.ref}`,onPress:()=>v.repo.bookings.decide(e.id,'confirmed',se)}),(0,J.jsx)(N.Button,{small:!0,kind:"secondary",label:"Decline",onPress:()=>Ce(e.id)}),(0,J.jsx)(Y.WhatsAppGuest,{b:e,rid:C,kind:"change"})]}):(0,J.jsx)(L.default,{accessible:!0,accessibilityLabel:x.BOOKING_VIEW_ONLY,children:(0,J.jsx)(N.T,{children:x.BOOKING_VIEW_ONLY})}),(0,J.jsx)(F.ConfirmTimeline,{refId:e.id})]},e.id))]}):null,0===xe.length?(0,J.jsx)(N.Muted,{children:"No bookings for this day yet."}):null,xe.map(e=>{const s='confirmed'===e.status&&oe===ee&&(0,M.minsBetween)(new Date(`${e.date}T${e.time}:00`),Z)>15,t=(0,w.depositState)(e),l=(0,w.depositBadge)(e,W.gbp);return(0,J.jsxs)(L.default,{testID:(0,$.isSeatedHighlight)((0,D.shownStatus)(e))?`booking-seated-${e.id}`:`booking-row-${e.id}`,style:[N.styles.card,(0,$.isSeatedHighlight)((0,D.shownStatus)(e))?(0,$.seatedHighlightStyle)({borderColor:(0,D.hasAllergens)(e)?A.colours.red:A.colours.goldLight}):{borderColor:(0,D.hasAllergens)(e)?A.colours.red:s?A.colours.amber:A.colours.hairline,opacity:['finished','cancelled'].includes(e.status)?.55:1}],children:[(0,J.jsx)(S.AllergenBar,{b:e}),(0,J.jsxs)(N.Row,{style:{justifyContent:'space-between'},children:[(0,J.jsxs)(N.Row,{gap:6,style:{flex:1,minWidth:0,alignItems:'center'},children:[(0,J.jsxs)(N.T,{weight:"semibold",colour:(0,$.isSeatedHighlight)((0,D.shownStatus)(e))?$.SEATED_FG:A.colours.text,style:{flexShrink:1},children:[e.time," \xb7 ",(0,R.walkInLabel)(e)]}),(0,D.hasAllergens)(e)?(0,J.jsx)(P.AllergyIcon,{text:(0,D.allergenText)(e),size:20,colour:(0,$.isSeatedHighlight)((0,D.shownStatus)(e))?'#7A4A00':A.colours.amber,ink:(0,$.isSeatedHighlight)((0,D.shownStatus)(e))?A.colours.gold:A.colours.bg,testID:`booking-allergy-${e.id}`}):null]}),(0,J.jsx)(N.Badge,{kind:'seated'===(0,D.shownStatus)(e)?'ok':'noshow'===e.status?'red':'confirmed'===e.status?'gold':'pending'===e.status?'amber':'neutral',label:'noshow'===e.status?'No-show':'pending'===e.status?'Needs confirming':(0,D.shownStatus)(e)[0].toUpperCase()+(0,D.shownStatus)(e).slice(1)})]}),l?(0,J.jsx)(y.DepositChip,{b:e,money:!0,big:!0,testID:`deposit-chip-${e.id}`}):null,(0,$.isSeatedHighlight)((0,D.shownStatus)(e))?(0,J.jsxs)(N.T,{size:14,colour:$.SEATED_MUTED,children:[e.table?(0,z.tableCardLabel)(e.table):e.walkIn?'Table to assign':'Table TBC'," \xb7 ",e.ref]}):(0,J.jsxs)(N.Muted,{children:[e.table?(0,z.tableCardLabel)(e.table):e.walkIn?'Table to assign':'Table TBC'," \xb7 ",e.ref]}),e.notes?(0,J.jsxs)(N.T,{size:16,testID:`booking-notes-${e.id}`,children:["Notes: ",e.notes]}):null,l?(0,J.jsxs)(N.Row,{wrap:!0,gap:6,style:{alignItems:'center'},children:[me||!(0,w.canTickDeposit)(e)||['cancelled','finished'].includes(e.status)?null:(0,J.jsx)(N.Button,{small:!0,kind:"secondary",label:"Mark deposit paid",testID:`deposit-paid-${e.id}`,accessibilityLabel:`Mark deposit paid for ${(0,R.walkInLabel)(e)}`,onPress:()=>v.repo.bookings.update(e.id,{depositPaid:e.depositDue??0,depositPaidBy:se,depositPaidAt:(new Date).toISOString()})}),me?null:(0,J.jsx)(j.WixDepositLink,{b:e,rid:C}),'paid'===t&&e.depositPaidBy?(0,J.jsx)(N.Muted,{size:13,children:'Wix deposit link'===e.depositPaidBy?'Paid through a website bookings deposit link':`Ticked by ${e.depositPaidBy}`}):null]}):null,e.walkIn?null:(0,J.jsxs)(N.Muted,{children:[(0,K.bookingSource)(e),e.phone?` \xb7 ${e.phone}`:'',e.email?` \xb7 ${e.email}`:'']}),e.allergies.length?(0,J.jsx)(N.Row,{wrap:!0,gap:4,children:e.allergies.map(e=>(0,J.jsx)(N.Badge,{kind:"red",label:`${(0,O.allergenLabel)(e.allergen)} \xb7 ${(0,O.severityLabel)(e.severity)}`},e.allergen))}):null,(0,D.hasAllergens)(e)&&!['cancelled','noshow'].includes(e.status)?(0,J.jsx)(U.BookingAllergyChain,{b:e,me:se}):null,e.walkIn?null:(0,J.jsx)(F.ConfirmTimeline,{refId:e.id,noPhone:!!e.source&&!e.phone}),s?(0,J.jsxs)(N.T,{size:13,colour:A.colours.amber,children:["Running ",(0,M.minsBetween)(new Date(`${e.date}T${e.time}:00`),Z)," min late. Call them, then mark no-show if needed."]}):null,(0,J.jsxs)(N.Row,{wrap:!0,gap:6,children:[(0,J.jsx)(r.BookingTableButton,{rid:C,booking:e,readOnly:me||!ue.ok,turnBase:X.settings.turnMins}),ue.ok?null:(0,J.jsx)(L.default,{accessible:!0,accessibilityLabel:x.BOOKING_VIEW_ONLY,children:(0,J.jsx)(N.T,{children:x.BOOKING_VIEW_ONLY})}),ue.ok?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(u.BookingEditButton,{rid:C,booking:e,who:se,role:te,inStaffApp:ne,shiftManager:ie}),me||e.table||!['seated','confirmed'].includes(e.status)?null:(0,J.jsx)(N.Button,{small:!e.walkIn,kind:e.walkIn?'primary':'secondary',label:"Assign table",onPress:()=>re.assignTable(e)}),!me&&['seated','confirmed'].includes(e.status)?(0,J.jsx)(N.Button,{small:!0,kind:"secondary",label:(0,z.tablesOf)(e.table).length>1?'Change tables':'Combine tables',testID:`combine-${e.id}`,accessibilityLabel:`${(0,z.tablesOf)(e.table).length>1?'Change tables':'Combine tables'} for ${(0,R.walkInLabel)(e)}`,onPress:()=>re.combineTables(e)}):null,me||'confirmed'!==e.status?null:(0,J.jsxs)(J.Fragment,{children:[e.date===ee?(0,J.jsx)(N.Button,{small:!0,label:"Seat",accessibilityLabel:`Seat ${(0,R.walkInLabel)(e)} now`,onPress:()=>(0,R.seatBookingNow)(C,e)}):null,(0,J.jsx)(N.Button,{small:!0,kind:"secondary",label:"No-show",onPress:()=>v.repo.bookings.setStatus(e.id,'noshow')})]}),me||e.walkIn?null:(0,J.jsx)(d.CancelBookingButton,{rid:C,b:e,name:(0,R.walkInLabel)(e),small:!0,onDone:()=>{}}),me||e.walkIn?null:(0,J.jsx)(d.ReinstateBookingButton,{b:e,name:(0,R.walkInLabel)(e),today:ee}),me||'seated'!==e.status?null:(0,J.jsx)(N.Button,{small:!0,kind:"secondary",label:"Finished",accessibilityLabel:`Finished: ${(0,R.walkInLabel)(e)}, table needs clearing`,onPress:()=>(0,R.finishBookingNow)(C,e)}),['confirmed','pending'].includes(e.status)&&e.date>=ee?(0,J.jsx)(Y.WhatsAppGuest,{b:e,rid:C,kind:"auto"}):null,ne?null:(0,J.jsx)(f.CopyReviewLink,{rid:C,bookingId:e.id}),!me&&e.walkIn?(0,J.jsx)(o.CancelWalkInButton,{rid:C,b:e,small:!0}):null,!me&&e.walkIn?(0,J.jsx)(o.ReinstateWalkInButton,{rid:C,b:e,today:ee,small:!0}):null,(0,J.jsx)(H.BookingUndo,{b:e,rid:C,today:ee,who:(0,R.walkInLabel)(e)})]}):null]}),'noshow'===e.status&&'paid'===t?(0,J.jsx)(N.Muted,{size:13,children:"A deposit was paid. Keep or refund it by your deposit terms (Settings \u203a Advanced \u203a Deposits). Deposits paid through website bookings are refunded in Website bookings \u203a Orders."}):null]},e.id)}),(0,J.jsx)(b.CancellationsSection,{testID:"bookings-cancellations",items:(0,h.cancellationsFor)(le,oe,e=>e.walkIn?`Walk-in ${e.ref}`:(e.name??'').replace(' (example)','')),dayWord:oe===ee?'today':'that day'}),(0,J.jsxs)(N.Card,{children:[(0,J.jsxs)(N.Row,{style:{justifyContent:'space-between'},children:[(0,J.jsx)(N.T,{weight:"semibold",children:"No-shows"}),(0,J.jsx)(N.Badge,{kind:we.length?'red':'ok',label:`${we.length} ${oe===ee?'today':(0,M.niceDate)((0,M.parseYmd)(oe)).slice(0,6)}${je||a.LIVE_VENUE_BUILD?'':' \xb7 4.1% last 28 days (example)'}`})]}),(0,J.jsx)(N.Muted,{children:we.length?`Marked no-show today: ${we.slice(0,6).map(e=>`${e.time} ${(0,R.walkInLabel)(e)}`).join(', ')}${we.length>6?` and ${we.length-6} more`:''}. If they turn up, open the booking and tap Undo no-show.`:'No no-shows today. If a party doesn\u2019t arrive, call them first, then tap No-show on their booking.'})]}),s.IS_GREENSIDE?(0,J.jsx)(t.GreensideCashOnly,{}):(0,J.jsxs)(N.Card,{children:[(0,J.jsx)(N.T,{weight:"semibold",children:"Deposits"}),(0,J.jsx)(N.Muted,{testID:"deposits-card-text",children:(()=>{const e=(0,w.depositOf)(X.settings);return e.on&&e.perPersonPence>0?`Deposits: ${(0,W.gbp)(e.perPersonPence)} per person for parties of ${e.fromParty} or more. Deposits are paid through website bookings. Website bookings show Deposit paid on website bookings by themselves once the guest has paid. For phone and walk-in bookings, tick Deposit paid once the guest has paid you${e.wixLinksOn?', or press Send deposit link':''}.`:'Deposits are off. Turn them on in Settings \u203a Advanced \u203a Deposits.'})()}),(0,J.jsx)(N.Muted,{size:13,children:"Tip: refunds are done in Website bookings \u203a Orders. Booking deposit amounts are visible in Managers, Display and Staff."})]}),ye.length>0||ge?(0,J.jsxs)(L.default,{style:{gap:10},children:[(0,J.jsx)(E.SectionHead,{title:`Waitlist (${ye.length})`,sub:`New party waits about ${(0,_.estimateWait)(ye.length+1,X.settings.turnMins,1)} min (estimate)`}),ye.map((e,s)=>(0,J.jsxs)(L.default,{style:N.styles.card,children:[(0,J.jsxs)(N.Row,{style:{justifyContent:'space-between'},children:[(0,J.jsxs)(N.T,{weight:"semibold",children:["#",e.number," ",e.name," \xb7 ",e.partySize]}),(0,J.jsxs)(N.Muted,{children:[(0,M.minsBetween)(new Date(e.joinedAt),Z)," min \xb7 est. ",(0,_.estimateWait)(s+1,X.settings.turnMins,1)," min"]})]}),'notified'===e.status?(0,J.jsx)(N.Badge,{kind:"ok",label:"Marked as told: table ready (no text is sent)"}):null,(0,J.jsxs)(N.Row,{gap:6,children:['waiting'===e.status?(0,J.jsx)(N.Button,{small:!0,kind:"secondary",label:"Notify",onPress:()=>v.repo.waitlist.setStatus(e.id,'notified')}):null,(0,J.jsx)(N.Button,{small:!0,label:"Seat",onPress:()=>v.repo.waitlist.setStatus(e.id,'seated')}),(0,J.jsx)(N.Button,{small:!0,kind:"ghost",label:"Remove",onPress:()=>v.repo.waitlist.setStatus(e.id,'removed')})]})]},e.id)),(0,J.jsxs)(N.Row,{gap:6,children:[(0,J.jsx)(i.TextInput,{accessibilityLabel:"Waitlist name",placeholder:"Name for the waitlist",placeholderTextColor:"#7D776C",value:ce,onChangeText:he,style:[N.styles.input,{flex:1}]}),(0,J.jsx)(N.Stepper,{value:pe,onChange:ke,min:1,max:12,label:"party"})]}),(0,J.jsx)(N.Button,{kind:"secondary",label:"Add to waitlist",disabled:ce.trim().length<2,onPress:()=>{v.repo.waitlist.join(C,ce.trim(),pe),he('')}})]}):(0,J.jsx)(N.Button,{kind:"ghost",label:"Open waitlist",onPress:()=>be(!0),accessibilityLabel:"Open the empty waitlist to add a waiting party"}),re.elements]})};var e,s=_r(_d[0]),t=_r(_d[1]),l=_r(_d[2]),n=_r(_d[3]),i=_r(_d[4]),a=_r(_d[5]),o=_r(_d[6]),d=_r(_d[7]),r=_r(_d[8]),u=_r(_d[9]),c=_r(_d[10]),h=_r(_d[11]),b=_r(_d[12]),p=_r(_d[13]),k=_r(_d[14]),x=_r(_d[15]),y=_r(_d[16]),w=_r(_d[17]),j=_r(_d[18]),f=_r(_d[19]),I=_r(_d[20]),B=_r(_d[21]),S=_r(_d[22]),D=_r(_d[23]),$=_r(_d[24]),T=_r(_d[25]),C=_r(_d[26]),L=(e=C)&&e.__esModule?e:{default:e},N=_r(_d[27]),P=_r(_d[28]),v=_r(_d[29]),O=_r(_d[30]),W=_r(_d[31]),M=_r(_d[32]),_=_r(_d[33]),A=_r(_d[34]),E=_r(_d[35]),R=_r(_d[36]),z=_r(_d[37]),H=_r(_d[38]),G=_r(_d[39]),U=_r(_d[40]),F=_r(_d[41]),K=_r(_d[42]),V=_r(_d[43]),Y=_r(_d[44]),q=_r(_d[45]),Q=_r(_d[46]),J=_r(_d[47])},1351,[5,1349,11,1352,796,806,1112,1113,1091,1115,1114,1323,1324,1100,1277,1012,1089,14,1353,1176,1354,1311,1081,1075,1090,34,102,794,1286,848,830,836,827,1262,840,1147,1096,1014,1355,1356,1136,1357,1167,985,1149,1319,852,25]); +__d(function(g,_r,_i,_a,m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.Bookings=function({go:e}={}){const{rid:L,r:Z,now:ee,today:se,me:te,role:le}=(0,k.useCtx)(1e4),ne=(0,O.useBookings)(L),ie=(0,k.useInStaffApp)(),ae=(0,k.useShiftManager)(),oe=(0,O.useWaitlist)(L),[de,re]=((0,O.useStore)(e=>e.alertAcks),(0,C.useState)(se)),ue=(0,z.useFrontDoor)(de),ce=(0,x.useBookingWrite)(),[he,ge]=(0,C.useState)(''),[be,pe]=(0,C.useState)(!1),[ke,me]=(0,C.useState)(2),xe=dee.date===de).sort((e,s)=>e.time.localeCompare(s.time)),we=oe.filter(e=>'waiting'===e.status||'notified'===e.status).sort((e,s)=>e.number-s.number),je=ye.filter(e=>'noshow'===e.status),fe=(0,Y.useSync)(e=>!!e.venueId&&'guest'!==e.kind),Ie=ye.filter(e=>'cancelled'!==e.status).reduce((e,s)=>e+s.partySize,0),Be=(0,h.cancelledDayTally)(ne,de),De=(0,h.cancelledTallyWords)(Be,de===se?'today':'that day'),Se=ye.filter(e=>!e.walkIn),$e=ye.filter(e=>e.walkIn),Te=ne.filter(e=>'pending'===e.status&&e.date>=se).sort((e,s)=>(e.date+e.time).localeCompare(s.date+s.time)),[Ce,Le]=(0,C.useState)(null),Ne=(0,E.parseYmd)(de);Ne.setHours(12);const Pe=(0,J.hoursFor)(Z,Ne),ve=Pe?.open??new Date(`${de}T12:00:00`),Oe=Pe?.close??new Date(`${de}T21:00:00`),We=Pe||ye.length?xe?'No one seated that day':de===se?'No bookings yet today':'No bookings yet':de===se?'Closed today':'Closed that day';return(0,X.jsxs)(N.default,{style:{gap:12},children:[e&&!ie&&'staff'!==le?(0,X.jsx)(P.Button,{testID:"bookings-dashboard-top",label:"Bookings dashboard",accessibilityLabel:"Open Bookings dashboard: table plan, Timeline, today's guests and Covers",onPress:()=>e('more','serviceboard'),style:{width:'100%',minHeight:60}}):null,s.IS_WILDINGS||(s.IS_QUEUED_VENUE||s.IS_KIRKTON||s.IS_GREENSIDE||'abbotsford'===L)&&!ie&&'staff'!==le?(0,X.jsx)(n.VenueRequestList,{rid:L,kind:"table"}):null,!s.IS_WILDINGS&&!Z.settings.hotel?.enabled||ie||'staff'===le?null:(0,X.jsx)(n.VenueRequestList,{rid:L,kind:"room",hotel:Z.settings.hotel??l.WILDINGS_HOTEL}),(0,X.jsx)(U.BookingsDayNav,{today:se,date:de,onDate:re,count:e=>ne.filter(s=>s.date===e&&'cancelled'!==s.status).length,sub:e=>{const s=ne.filter(s=>s.date===e&&'cancelled'!==s.status&&!s.walkIn),t=s.reduce((e,s)=>e+s.partySize,0);return`${s.length} ${1===s.length?'table':'tables'} \xb7 ${t} ${1===t?'Cover':'Covers'}`}}),(0,X.jsx)(N.default,{testID:"bookings-day-graph",style:{overflow:'visible'},children:(0,X.jsx)(Q.DayGraph,{bare:!0,fill:!0,todays:ye,open:ve,close:Oe,now:ee,turnBase:Z.settings.turnMins,height:128,past:xe,closed:!Pe,emptyText:We})}),xe?(0,X.jsxs)(N.default,{testID:"bookings-past-totals",style:[P.styles.card,{gap:4}],accessible:!0,accessibilityLabel:`${(0,U.longDay)(de)}: ${Se.length} tables, ${Ie} Covers, ${ye.filter(e=>'finished'===e.status).length} finished, ${je.length} no-shows, ${ye.filter(e=>'cancelled'===e.status).length} cancelled`,children:[(0,X.jsxs)(P.T,{size:17,weight:"semibold",children:["That day: ",Se.length," table",1===Se.length?'':'s',$e.length?` \xb7 ${$e.length} walk-in${1===$e.length?'':'s'}`:''," \xb7 ",Ie," ",1===Ie?'Cover':'Covers']}),(0,X.jsxs)(P.T,{size:16,colour:A.colours.text,children:[ye.filter(e=>'finished'===e.status).length," finished \xb7 ",je.length," no-show",1===je.length?'':'s'," \xb7 ",ye.filter(e=>'cancelled'===e.status).length," cancelled"]}),(0,X.jsx)(P.Muted,{children:"Looking back: read-only. Undo is still there for a mistake made today."})]}):null,(0,X.jsx)(N.default,{testID:"bookings-summary",children:(0,X.jsxs)(P.T,{weight:"semibold",children:[Se.length," table",1===Se.length?'':'s'," booked",$e.length?` \xb7 ${$e.length} walk-in${1===$e.length?'':'s'}`:''," \xb7 ",Ie," ",1===Ie?'Cover':'Covers']})}),(0,X.jsx)(N.default,{testID:"cancelled-day-tally",accessible:!0,accessibilityLabel:De,style:{alignItems:'center'},children:(0,X.jsx)(P.T,{size:15,colour:A.colours.muted,center:!0,children:De})}),(0,X.jsxs)(N.default,{testID:"bookings-actions",style:{flexDirection:'row',flexWrap:'wrap',gap:8},children:[xe?null:(0,X.jsx)(B.QuietButton,{label:"New booking",onPress:ue.openBooking,testID:"add-booking",disabled:!ce.ok,accessibilityHint:ce.hint}),ie&&ae&&de===se?(0,X.jsx)(B.QuietButton,{label:"Walk-in",onPress:ue.openWalkIn,testID:"add-walkin",disabled:!ce.ok,accessibilityHint:ce.hint}):null,de===se?(0,X.jsx)(D.CloseGardenButton,{quiet:!0,short:!0,rid:L,r:Z,now:ee,by:te}):null]}),Te.length?(0,X.jsxs)(N.default,{testID:"pending-requests",style:[P.styles.card,{borderColor:A.colours.amber,gap:8}],children:[(0,X.jsxs)(P.T,{weight:"semibold",colour:A.colours.amber,children:["Needs confirming (",Te.length,")"]}),(0,X.jsx)(P.Muted,{children:"Online requests outside your auto-accept rules. Check the details before confirming."}),Te.map(e=>(0,X.jsxs)(N.default,{style:{gap:6,paddingTop:6,borderTopWidth:1,borderColor:A.colours.border},children:[(0,X.jsxs)(P.T,{weight:"semibold",children:[e.name," \xb7 ",e.partySize," ",1===e.partySize?'Cover':'Covers']}),(0,X.jsxs)(P.Muted,{children:[(0,E.niceDate)((0,E.parseYmd)(e.date))," at ",e.time," \xb7 ",e.ref," \xb7 ",e.phone??'no phone']}),e.notes?(0,X.jsxs)(P.T,{size:16,children:["Notes: ",e.notes]}):null,e.allergies.length?(0,X.jsx)(P.Row,{wrap:!0,gap:4,children:e.allergies.map(e=>(0,X.jsx)(P.Badge,{kind:"red",label:`${(0,W.allergenLabel)(e.allergen)} \xb7 ${(0,W.severityLabel)(e.severity)}`},e.allergen))}):null,(0,X.jsx)(S.NeedsPills,{b:e,r:Z}),'staff'!==le&&((0,$.needsHoldOk)(e)||e.date===se&&e.holdOk&&(e.holds??[]).some(e=>!e.served)&&'seated'===e.status)?(0,X.jsxs)(P.Row,{wrap:!0,gap:6,children:[(0,$.needsHoldOk)(e)?(0,X.jsx)(P.Button,{small:!0,kind:"success",label:"Platter OK",testID:`mgr-platter-ok-${e.ref}`,onPress:()=>(0,S.confirmHolds)(e.id,te)}):null,e.holdOk&&'seated'===e.status?(0,X.jsx)(P.Button,{small:!0,kind:"secondary",label:"Platter served",onPress:()=>(0,S.serveHolds)(e,te,'owner')}):null]}):null,Ce===e.id?(0,X.jsxs)(N.default,{style:{gap:6},children:[(0,X.jsxs)(P.T,{size:14,children:["Are you sure? ",e.name.split(' ')[0]," will get a polite \u201csorry, we can\u2019t fit you in\u201d message."]}),(0,X.jsxs)(P.Row,{gap:6,children:[(0,X.jsx)(P.Button,{small:!0,kind:"danger",label:"Yes, decline",onPress:()=>{O.repo.bookings.decide(e.id,'declined',te),Le(null)}}),(0,X.jsx)(P.Button,{small:!0,kind:"ghost",label:"Keep it",onPress:()=>Le(null)})]})]}):ce.ok?(0,X.jsxs)(P.Row,{gap:6,children:[(0,X.jsx)(P.Button,{small:!0,label:"Confirm",testID:`confirm-${e.ref}`,onPress:()=>O.repo.bookings.decide(e.id,'confirmed',te)}),(0,X.jsx)(P.Button,{small:!0,kind:"secondary",label:"Decline",onPress:()=>Le(e.id)}),(0,X.jsx)(q.WhatsAppGuest,{b:e,rid:L,kind:"change"})]}):(0,X.jsx)(N.default,{accessible:!0,accessibilityLabel:y.BOOKING_VIEW_ONLY,children:(0,X.jsx)(P.T,{children:y.BOOKING_VIEW_ONLY})}),(0,X.jsx)(K.ConfirmTimeline,{refId:e.id})]},e.id))]}):null,0===ye.length?(0,X.jsx)(P.Muted,{children:"No bookings for this day yet."}):null,ye.map(e=>{const s='confirmed'===e.status&&de===se&&(0,E.minsBetween)(new Date(`${e.date}T${e.time}:00`),ee)>15,t=(0,j.depositState)(e),l=(0,j.depositBadge)(e,M.gbp);return(0,X.jsxs)(N.default,{testID:(0,T.isSeatedHighlight)((0,$.shownStatus)(e))?`booking-seated-${e.id}`:`booking-row-${e.id}`,style:[P.styles.card,(0,T.isSeatedHighlight)((0,$.shownStatus)(e))?(0,T.seatedHighlightStyle)({borderColor:(0,$.hasAllergens)(e)?A.colours.red:A.colours.goldLight}):{borderColor:(0,$.hasAllergens)(e)?A.colours.red:s?A.colours.amber:A.colours.hairline,opacity:['finished','cancelled'].includes(e.status)?.55:1}],children:[(0,X.jsx)(S.AllergenBar,{b:e}),(0,X.jsxs)(P.Row,{style:{justifyContent:'space-between'},children:[(0,X.jsxs)(P.Row,{gap:6,style:{flex:1,minWidth:0,alignItems:'center'},children:[(0,X.jsxs)(P.T,{weight:"semibold",colour:(0,T.isSeatedHighlight)((0,$.shownStatus)(e))?T.SEATED_FG:A.colours.text,style:{flexShrink:1},children:[e.time," \xb7 ",(0,z.walkInLabel)(e)]}),(0,$.hasAllergens)(e)?(0,X.jsx)(v.AllergyIcon,{text:(0,$.allergenText)(e),size:20,colour:(0,T.isSeatedHighlight)((0,$.shownStatus)(e))?'#7A4A00':A.colours.amber,ink:(0,T.isSeatedHighlight)((0,$.shownStatus)(e))?A.colours.gold:A.colours.bg,testID:`booking-allergy-${e.id}`}):null]}),(0,X.jsx)(P.Badge,{kind:'seated'===(0,$.shownStatus)(e)?'ok':'noshow'===e.status?'red':'confirmed'===e.status?'gold':'pending'===e.status?'amber':'neutral',label:'noshow'===e.status?'No-show':'pending'===e.status?'Needs confirming':(0,$.shownStatus)(e)[0].toUpperCase()+(0,$.shownStatus)(e).slice(1)})]}),l?(0,X.jsx)(w.DepositChip,{b:e,money:!0,big:!0,testID:`deposit-chip-${e.id}`}):null,(0,T.isSeatedHighlight)((0,$.shownStatus)(e))?(0,X.jsxs)(P.T,{size:14,colour:T.SEATED_MUTED,children:[e.table?(0,H.tableCardLabel)(e.table):e.walkIn?'Table to assign':'Table TBC'," \xb7 ",e.ref]}):(0,X.jsxs)(P.Muted,{children:[e.table?(0,H.tableCardLabel)(e.table):e.walkIn?'Table to assign':'Table TBC'," \xb7 ",e.ref]}),e.notes?(0,X.jsxs)(P.T,{size:16,testID:`booking-notes-${e.id}`,children:["Notes: ",e.notes]}):null,(0,c.bookingExtras)(e)?(0,X.jsx)(P.T,{size:15,testID:`booking-extras-${e.id}`,children:(0,c.bookingExtras)(e)}):null,(0,c.historyLines)(e)[0]?(0,X.jsxs)(P.Muted,{size:13,testID:`booking-last-change-${e.id}`,children:["Last change: ",(0,c.historyLines)(e)[0]]}):null,l?(0,X.jsxs)(P.Row,{wrap:!0,gap:6,style:{alignItems:'center'},children:[xe||!(0,j.canTickDeposit)(e)||['cancelled','finished'].includes(e.status)?null:(0,X.jsx)(P.Button,{small:!0,kind:"secondary",label:"Mark deposit paid",testID:`deposit-paid-${e.id}`,accessibilityLabel:`Mark deposit paid for ${(0,z.walkInLabel)(e)}`,onPress:()=>O.repo.bookings.update(e.id,{depositPaid:e.depositDue??0,depositPaidBy:te,depositPaidAt:(new Date).toISOString()})}),xe?null:(0,X.jsx)(f.WixDepositLink,{b:e,rid:L}),'paid'===t&&e.depositPaidBy?(0,X.jsx)(P.Muted,{size:13,children:'Wix deposit link'===e.depositPaidBy?'Paid through a website bookings deposit link':`Ticked by ${e.depositPaidBy}`}):null]}):null,e.walkIn?null:(0,X.jsxs)(P.Muted,{children:[(0,V.bookingSource)(e),e.phone?` \xb7 ${e.phone}`:'',e.email?` \xb7 ${e.email}`:'']}),e.allergies.length?(0,X.jsx)(P.Row,{wrap:!0,gap:4,children:e.allergies.map(e=>(0,X.jsx)(P.Badge,{kind:"red",label:`${(0,W.allergenLabel)(e.allergen)} \xb7 ${(0,W.severityLabel)(e.severity)}`},e.allergen))}):null,(0,$.hasAllergens)(e)&&!['cancelled','noshow'].includes(e.status)?(0,X.jsx)(F.BookingAllergyChain,{b:e,me:te}):null,e.walkIn?null:(0,X.jsx)(K.ConfirmTimeline,{refId:e.id,noPhone:!!e.source&&!e.phone}),s?(0,X.jsxs)(P.T,{size:13,colour:A.colours.amber,children:["Running ",(0,E.minsBetween)(new Date(`${e.date}T${e.time}:00`),ee)," min late. Call them, then mark no-show if needed."]}):null,ce.ok?(0,X.jsx)(u.BookingEditButton,{rid:L,booking:e,who:te,role:le,inStaffApp:ie,shiftManager:ae,big:!0,testID:`edit-booking-${e.id}`}):null,(0,X.jsxs)(P.Row,{wrap:!0,gap:6,children:[(0,X.jsx)(r.BookingTableButton,{rid:L,booking:e,readOnly:xe||!ce.ok,turnBase:Z.settings.turnMins}),ce.ok?null:(0,X.jsx)(N.default,{accessible:!0,accessibilityLabel:y.BOOKING_VIEW_ONLY,children:(0,X.jsx)(P.T,{children:y.BOOKING_VIEW_ONLY})}),ce.ok?(0,X.jsxs)(X.Fragment,{children:[xe||e.table||!['seated','confirmed'].includes(e.status)?null:(0,X.jsx)(P.Button,{small:!e.walkIn,kind:e.walkIn?'primary':'secondary',label:"Assign table",onPress:()=>ue.assignTable(e)}),!xe&&['seated','confirmed'].includes(e.status)?(0,X.jsx)(P.Button,{small:!0,kind:"secondary",label:(0,H.tablesOf)(e.table).length>1?'Change tables':'Combine tables',testID:`combine-${e.id}`,accessibilityLabel:`${(0,H.tablesOf)(e.table).length>1?'Change tables':'Combine tables'} for ${(0,z.walkInLabel)(e)}`,onPress:()=>ue.combineTables(e)}):null,xe||'confirmed'!==e.status?null:(0,X.jsxs)(X.Fragment,{children:[e.date===se?(0,X.jsx)(P.Button,{small:!0,label:"Seat",accessibilityLabel:`Seat ${(0,z.walkInLabel)(e)} now`,onPress:()=>(0,z.seatBookingNow)(L,e)}):null,(0,X.jsx)(P.Button,{small:!0,kind:"secondary",label:"No-show",onPress:()=>O.repo.bookings.setStatus(e.id,'noshow')})]}),xe||e.walkIn?null:(0,X.jsx)(d.CancelBookingButton,{rid:L,b:e,name:(0,z.walkInLabel)(e),small:!0,onDone:()=>{}}),xe||e.walkIn?null:(0,X.jsx)(d.ReinstateBookingButton,{b:e,name:(0,z.walkInLabel)(e),today:se}),xe||'seated'!==e.status?null:(0,X.jsx)(P.Button,{small:!0,kind:"secondary",label:"Finished",accessibilityLabel:`Finished: ${(0,z.walkInLabel)(e)}, table needs clearing`,onPress:()=>(0,z.finishBookingNow)(L,e)}),['confirmed','pending'].includes(e.status)&&e.date>=se?(0,X.jsx)(q.WhatsAppGuest,{b:e,rid:L,kind:"auto"}):null,ie?null:(0,X.jsx)(I.CopyReviewLink,{rid:L,bookingId:e.id}),!xe&&e.walkIn?(0,X.jsx)(o.CancelWalkInButton,{rid:L,b:e,small:!0}):null,!xe&&e.walkIn?(0,X.jsx)(o.ReinstateWalkInButton,{rid:L,b:e,today:se,small:!0}):null,(0,X.jsx)(G.BookingUndo,{b:e,rid:L,today:se,who:(0,z.walkInLabel)(e)})]}):null]}),'noshow'===e.status&&'paid'===t?(0,X.jsx)(P.Muted,{size:13,children:"A deposit was paid. Keep or refund it by your deposit terms (Settings \u203a Advanced \u203a Deposits). Deposits paid through website bookings are refunded in Website bookings \u203a Orders."}):null]},e.id)}),(0,X.jsx)(p.CancellationsSection,{testID:"bookings-cancellations",items:(0,b.cancellationsFor)(ne,de,e=>e.walkIn?`Walk-in ${e.ref}`:(e.name??'').replace(' (example)','')),dayWord:de===se?'today':'that day'}),(0,X.jsxs)(P.Card,{children:[(0,X.jsxs)(P.Row,{style:{justifyContent:'space-between'},children:[(0,X.jsx)(P.T,{weight:"semibold",children:"No-shows"}),(0,X.jsx)(P.Badge,{kind:je.length?'red':'ok',label:`${je.length} ${de===se?'today':(0,E.niceDate)((0,E.parseYmd)(de)).slice(0,6)}${fe||a.LIVE_VENUE_BUILD?'':' \xb7 4.1% last 28 days (example)'}`})]}),(0,X.jsx)(P.Muted,{children:je.length?`Marked no-show today: ${je.slice(0,6).map(e=>`${e.time} ${(0,z.walkInLabel)(e)}`).join(', ')}${je.length>6?` and ${je.length-6} more`:''}. If they turn up, open the booking and tap Undo no-show.`:'No no-shows today. If a party doesn\u2019t arrive, call them first, then tap No-show on their booking.'})]}),s.IS_GREENSIDE?(0,X.jsx)(t.GreensideCashOnly,{}):(0,X.jsxs)(P.Card,{children:[(0,X.jsx)(P.T,{weight:"semibold",children:"Deposits"}),(0,X.jsx)(P.Muted,{testID:"deposits-card-text",children:(()=>{const e=(0,j.depositOf)(Z.settings);return e.on&&e.perPersonPence>0?`Deposits: ${(0,M.gbp)(e.perPersonPence)} per person for parties of ${e.fromParty} or more. Deposits are paid through website bookings. Website bookings show Deposit paid on website bookings by themselves once the guest has paid. For phone and walk-in bookings, tick Deposit paid once the guest has paid you${e.wixLinksOn?', or press Send deposit link':''}.`:'Deposits are off. Turn them on in Settings \u203a Advanced \u203a Deposits.'})()}),(0,X.jsx)(P.Muted,{size:13,children:"Tip: refunds are done in Website bookings \u203a Orders. Booking deposit amounts are visible in Managers, Display and Staff."})]}),we.length>0||be?(0,X.jsxs)(N.default,{style:{gap:10},children:[(0,X.jsx)(R.SectionHead,{title:`Waitlist (${we.length})`,sub:`New party waits about ${(0,_.estimateWait)(we.length+1,Z.settings.turnMins,1)} min (estimate)`}),we.map((e,s)=>(0,X.jsxs)(N.default,{style:P.styles.card,children:[(0,X.jsxs)(P.Row,{style:{justifyContent:'space-between'},children:[(0,X.jsxs)(P.T,{weight:"semibold",children:["#",e.number," ",e.name," \xb7 ",e.partySize]}),(0,X.jsxs)(P.Muted,{children:[(0,E.minsBetween)(new Date(e.joinedAt),ee)," min \xb7 est. ",(0,_.estimateWait)(s+1,Z.settings.turnMins,1)," min"]})]}),'notified'===e.status?(0,X.jsx)(P.Badge,{kind:"ok",label:"Marked as told: table ready (no text is sent)"}):null,(0,X.jsxs)(P.Row,{gap:6,children:['waiting'===e.status?(0,X.jsx)(P.Button,{small:!0,kind:"secondary",label:"Notify",onPress:()=>O.repo.waitlist.setStatus(e.id,'notified')}):null,(0,X.jsx)(P.Button,{small:!0,label:"Seat",onPress:()=>O.repo.waitlist.setStatus(e.id,'seated')}),(0,X.jsx)(P.Button,{small:!0,kind:"ghost",label:"Remove",onPress:()=>O.repo.waitlist.setStatus(e.id,'removed')})]})]},e.id)),(0,X.jsxs)(P.Row,{gap:6,children:[(0,X.jsx)(i.TextInput,{accessibilityLabel:"Waitlist name",placeholder:"Name for the waitlist",placeholderTextColor:"#7D776C",value:he,onChangeText:ge,style:[P.styles.input,{flex:1}]}),(0,X.jsx)(P.Stepper,{value:ke,onChange:me,min:1,max:12,label:"party"})]}),(0,X.jsx)(P.Button,{kind:"secondary",label:"Add to waitlist",disabled:he.trim().length<2,onPress:()=>{O.repo.waitlist.join(L,he.trim(),ke),ge('')}})]}):(0,X.jsx)(P.Button,{kind:"ghost",label:"Open waitlist",onPress:()=>pe(!0),accessibilityLabel:"Open the empty waitlist to add a waiting party"}),ue.elements]})};var e,s=_r(_d[0]),t=_r(_d[1]),l=_r(_d[2]),n=_r(_d[3]),i=_r(_d[4]),a=_r(_d[5]),o=_r(_d[6]),d=_r(_d[7]),r=_r(_d[8]),u=_r(_d[9]),c=_r(_d[10]),h=_r(_d[11]),b=_r(_d[12]),p=_r(_d[13]),k=_r(_d[14]),x=_r(_d[15]),y=_r(_d[16]),w=_r(_d[17]),j=_r(_d[18]),f=_r(_d[19]),I=_r(_d[20]),B=_r(_d[21]),D=_r(_d[22]),S=_r(_d[23]),$=_r(_d[24]),T=_r(_d[25]),C=_r(_d[26]),L=_r(_d[27]),N=(e=L)&&e.__esModule?e:{default:e},P=_r(_d[28]),v=_r(_d[29]),O=_r(_d[30]),W=_r(_d[31]),M=_r(_d[32]),E=_r(_d[33]),_=_r(_d[34]),A=_r(_d[35]),R=_r(_d[36]),z=_r(_d[37]),H=_r(_d[38]),G=_r(_d[39]),U=_r(_d[40]),F=_r(_d[41]),K=_r(_d[42]),V=_r(_d[43]),Y=_r(_d[44]),q=_r(_d[45]),Q=_r(_d[46]),J=_r(_d[47]),X=_r(_d[48])},1351,[5,1349,11,1352,796,806,1112,1113,1091,1115,1111,1114,1323,1324,1100,1277,1012,1089,14,1353,1176,1354,1311,1081,1075,1090,34,102,794,1286,848,830,836,827,1262,840,1147,1096,1014,1355,1356,1136,1357,1167,985,1149,1319,852,25]); __d(function(g,_r,i,a,m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.VenueRequestList=function({rid:e,kind:n,hotel:c}){const y=(0,r.useSync)(),p='staff'===y.kind&&y.venueSlug===(0,s.queuedDatabaseSlug)(e)&&!!y.venueId&&(!['greenside','kirkton','abbotsford'].includes(e)&&!(0,s.isQueuedVenue)(e)||y.perms.includes('*')||y.perms.includes('venue.settings')),f=p&&(y.perms.includes('*')||y.perms.includes('room'===n||(0,s.isQueuedVenue)(e)||['greenside','kirkton','abbotsford'].includes(e)?'venue.settings':'bookings.manage')),[h,b]=(0,t.useState)([]),[j,q]=(0,t.useState)(''),[x,k]=(0,t.useState)(null),v=(0,t.useCallback)(async()=>{if(p)try{b(await(0,o.listVenueRequests)(y.venueId,n)),q('')}catch(e){q((0,o.requestMessage)(e))}},[p,n,y.venueId]);(0,t.useEffect)(()=>{const e=setTimeout(()=>{v()},0),s=setInterval(()=>{v()},15e3);return()=>{clearTimeout(e),clearInterval(s)}},[v]);const T=h.filter(e=>e.venue_id===y.venueId);if(!p)return null;const I=async(e,s)=>{if(!x){k(e);try{await(0,o.decideVenueRequest)(e,s),await v()}catch(e){q((0,o.requestMessage)(e))}finally{k(null)}}};return(0,u.jsxs)(d.default,{testID:`venue-${n}-requests`,style:{gap:12,alignItems:'stretch'},children:[(0,u.jsx)(l.H2,{children:'room'===n?'Room requests':'Table requests'}),(0,u.jsx)(l.T,{center:!0,children:"Requested bookings need a staff decision. No email or text is sent. Contact the guest to confirm arrangements."}),(0,u.jsx)(l.Button,{kind:"secondary",label:`Refresh ${n} requests`,onPress:()=>{v()}}),j?(0,u.jsx)(l.Banner,{kind:"warn",title:"Requests",children:j}):null,T.length||j?null:(0,u.jsxs)(l.T,{center:!0,children:["No ",n," requests yet."]}),T.map(e=>(0,u.jsx)(l.Card,{style:{alignItems:'stretch'},children:(0,u.jsxs)(d.default,{testID:`venue-request-${e.id}`,style:{gap:10},children:[(0,u.jsxs)(l.Row,{wrap:!0,children:[(0,u.jsx)(l.T,{weight:"semibold",children:e.payload.name}),(0,u.jsx)(l.Badge,{kind:'requested'===e.status?'amber':'confirmed'===e.status?'ok':'neutral',label:'requested'===e.status?'Requested':'confirmed'===e.status?'Confirmed':'Declined'})]}),(0,u.jsx)(l.T,{children:'table'===n?`${e.payload.date} \xb7 ${e.payload.service?e.payload.service+' \xb7 ':''}${e.payload.time} \xb7 ${e.payload.covers} Covers`:`${e.payload.checkIn} to ${e.payload.checkOut} \xb7 ${c?.roomTypes.find(s=>s.id===e.payload.roomType)?.name||e.payload.roomType} \xb7 ${e.payload.guests} guests`}),'room'===n?(0,u.jsxs)(l.T,{children:["Add dinner: ",e.payload.addDinner?'Yes \u2014 arrange with guest':'No']}):null,(0,u.jsxs)(l.T,{children:[e.payload.phone," \xb7 ",e.payload.email]}),e.payload.notes?(0,u.jsxs)(l.T,{children:["Notes: ",e.payload.notes]}):null,'requested'===e.status&&f?(0,u.jsxs)(l.Row,{wrap:!0,children:[(0,u.jsx)(l.Button,{label:x===e.id?'Saving\u2026':'Confirm',testID:`request-confirm-${e.id}`,disabled:!!x,onPress:()=>{I(e.id,'confirmed')}}),(0,u.jsx)(l.Button,{label:"Decline",kind:"secondary",testID:`request-decline-${e.id}`,disabled:!!x,onPress:()=>{I(e.id,'declined')}})]}):null,e.booking_id?(0,u.jsx)(l.T,{children:"Confirmed table booking is in the bookings list."}):null]})},e.id))]})};var e,s=_r(_d[0]),t=_r(_d[1]),n=_r(_d[2]),d=(e=n)&&e.__esModule?e:{default:e},l=_r(_d[3]),r=_r(_d[4]),o=_r(_d[5]),u=_r(_d[6])},1352,[6,34,102,794,985,1208,25]); __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,"untilWords",{enumerable:!0,get:function(){return w}}),_e.WixDepositLink=function({b:e,rid:x}){const f=(0,r.useRestaurant)(x),[S,j]=(0,s.useState)(!1),[C,D]=(0,s.useState)(!1),[L,I]=(0,s.useState)(null),[$,v]=(0,s.useState)(''),[P,T]=(0,s.useState)(''),[A,_]=(0,s.useState)(''),M=(0,c.depositOf)(f?.settings),O=e;if(n.IS_ISOLATED_VENUE||['souters','kirkmichael','wildings'].includes(x)||!f||!(0,c.canSendDepositLink)(O,M))return null;const B='open'===O.depositLink?.state,R=async()=>{j(!0),D(!0),T(''),I(null);try{const{data:t,error:n}=await(0,h.getSupabase)().functions.invoke('wix-deposit-link',{body:{booking_id:e.id}});if(n||!t)return void T(y);if(!t.ok||!t.url)return void T(t.off?y:String(t.error??y));const s={url:t.url,amountPence:t.amountPence,expiresAt:t.expiresAt};I(s),v((0,c.depositLinkMessage)({name:e.name,venue:f.name,partySize:e.partySize,date:e.date,time:e.time,amountPence:s.amountPence,url:s.url,expiresAt:s.expiresAt,terms:(0,c.depositTerms)(M)}))}catch{T(y)}finally{D(!1)}},W=async()=>{_('Checking\u2026');try{const{data:t,error:n}=await(0,h.getSupabase)().functions.invoke('wix-deposit-check',{body:{booking_id:e.id}});_(n||!t||t.off?'Website bookings deposit links are switched off, so nothing was checked.':'Checked with website bookings. If the guest has paid, the badge shows Deposit paid on website bookings.')}catch{_('Could not reach website bookings. Try again in a minute.')}},z=L?(0,k.waMeLink)(e.phone,$):null,E=L&&e.phone?(0,p.smsLink)(e.phone,$):null,U=L&&e.email?`mailto:${encodeURIComponent(e.email)}?subject=${encodeURIComponent(`${f.name} deposit`)}&body=${encodeURIComponent($)}`:null,F='undefined'!=typeof navigator&&!!navigator.clipboard,G=e=>{e&&o.default.openURL(e).catch(()=>{})};return(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(d.Button,{small:!0,kind:"secondary",label:B?'Send deposit link again':'Send deposit link',testID:`deposit-link-${e.id}`,accessibilityLabel:`${B?'Send the deposit link again to':'Send a website bookings deposit link to'} ${e.name}`,onPress:()=>{R()}}),B?(0,g.jsx)(d.Button,{small:!0,kind:"secondary",label:"Check if paid",testID:`deposit-check-${e.id}`,accessibilityLabel:`Check with website bookings if ${e.name} has paid the deposit`,onPress:()=>{W()}}):null,A?(0,g.jsx)(d.Muted,{size:13,children:A}):null,(0,g.jsx)(d.Sheet,{visible:S,onClose:()=>j(!1),title:"Send deposit link",testID:`deposit-link-sheet-${e.id}`,children:(0,g.jsxs)(l.default,{style:{gap:10},children:[C?(0,g.jsx)(d.T,{children:"Asking website bookings for the link\u2026"}):null,P?(0,g.jsx)(d.T,{colour:b.colours.amber,testID:"deposit-link-error",children:P}):null,L?(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(d.T,{weight:"semibold",children:`Deposit ${(0,u.gbp)(L.amountPence)} for ${e.partySize} guests.${L.expiresAt?` Link works until ${w(L.expiresAt)}.`:''}`}),(0,g.jsx)(d.T,{children:"Message to the guest (you can change it)"}),(0,g.jsx)(t.TextInput,{accessibilityLabel:"Message to the guest",testID:"deposit-link-message",value:$,multiline:!0,onChangeText:v,style:{minHeight:140,borderRadius:10,borderWidth:1,borderColor:b.colours.hairline,backgroundColor:b.colours.surface2,color:b.colours.text,padding:10,fontSize:15}}),(0,g.jsxs)(d.Row,{wrap:!0,gap:8,children:[E?(0,g.jsx)(d.Button,{label:"Text",testID:"deposit-link-sms",accessibilityLabel:`Open a text message to ${e.name} with the deposit link`,onPress:()=>G(E)}):null,z?(0,g.jsx)(d.Button,{kind:"secondary",label:"WhatsApp",testID:"deposit-link-wa",accessibilityLabel:`Open WhatsApp to ${e.name} with the deposit link`,onPress:()=>G(z)}):null,U?(0,g.jsx)(d.Button,{kind:"secondary",label:"Email",testID:"deposit-link-email",accessibilityLabel:`Open an email to ${e.name} with the deposit link`,onPress:()=>G(U)}):null,F?(0,g.jsx)(d.Button,{kind:"secondary",label:"Copy link",testID:"deposit-link-copy",accessibilityLabel:"Copy the deposit link",onPress:()=>{navigator.clipboard.writeText(L.url).catch(()=>{})}}):null]}),E||z||U?null:(0,g.jsx)(d.Muted,{children:"This booking has no phone number or email. Copy the link and send it another way."}),(0,g.jsx)(d.Muted,{size:13,children:"Tip: CoverCharge doesn't send anything. Each button opens your own messages app with the words filled in, and you press Send. Once the guest pays on website bookings, this booking shows Deposit paid on website bookings by itself. Refunds are done in Website bookings \u203a Orders."})]}):null,(0,g.jsx)(d.Button,{kind:"secondary",label:"Close",testID:"deposit-link-close",onPress:()=>j(!1)})]})})]})};var t=_r(_d[0]),n=_r(_d[1]),s=_r(_d[2]),o=e(_r(_d[3]));_r(_d[4]);var l=e(_r(_d[5])),d=_r(_d[6]),r=_r(_d[7]),c=_r(_d[8]),u=_r(_d[9]),p=_r(_d[10]),h=_r(_d[11]),b=_r(_d[12]),k=_r(_d[13]),g=_r(_d[14]);const y="Website bookings deposit links aren't switched on yet. Take the deposit by card or cash and tick Deposit paid.",w=e=>e?new Date(e).toLocaleString('en-GB',{timeZone:'Europe/London',weekday:'short',day:'numeric',month:'short',hour:'2-digit',minute:'2-digit',hourCycle:'h23'}):''},1353,[796,5,34,379,236,102,794,850,14,836,1017,931,840,1150,25]); __d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.QuietButton=function({icon:e,label:s,onPress:n,testID:b,a11y:y,disabled:f,accessibilityHint:h}){return(0,u.jsxs)(t.default,{accessibilityRole:"button",accessibilityLabel:y??s,accessibilityHint:h,accessibilityState:{disabled:!!f},disabled:f,testID:b,onPress:n,style:({pressed:e})=>({...l.look.quiet(e),flexGrow:1,opacity:f?.4:1}),children:[e?(0,u.jsx)(o.T,{size:15,colour:c.colours.goldLight,children:e}):null,(0,u.jsx)(o.T,{size:15,weight:"semibold",colour:c.colours.goldLight,children:s})]})},r(d[0]);var e,s=r(d[1]),t=(e=s)&&e.__esModule?e:{default:e},l=r(d[2]),o=r(d[3]),c=r(d[4]),u=r(d[5])},1354,[34,402,1143,794,840,25]); diff --git a/display-app/admin.html b/display-app/admin.html index 77752ade8fa2a10b72b9b9782ce00d0fc0c27582..52aadc0d1fcc75ed2fc97b1c81a61169cfe1beeb 100644 --- a/display-app/admin.html +++ b/display-app/admin.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/display-app/customer.html b/display-app/customer.html index 77752ade8fa2a10b72b9b9782ce00d0fc0c27582..52aadc0d1fcc75ed2fc97b1c81a61169cfe1beeb 100644 --- a/display-app/customer.html +++ b/display-app/customer.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/display-app/customer/anchorage.html b/display-app/customer/anchorage.html index 77752ade8fa2a10b72b9b9782ce00d0fc0c27582..52aadc0d1fcc75ed2fc97b1c81a61169cfe1beeb 100644 --- a/display-app/customer/anchorage.html +++ b/display-app/customer/anchorage.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/display-app/customer/anchorage/book.html b/display-app/customer/anchorage/book.html index 77752ade8fa2a10b72b9b9782ce00d0fc0c27582..52aadc0d1fcc75ed2fc97b1c81a61169cfe1beeb 100644 --- a/display-app/customer/anchorage/book.html +++ b/display-app/customer/anchorage/book.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/display-app/customer/anchorage/feedback.html b/display-app/customer/anchorage/feedback.html index 77752ade8fa2a10b72b9b9782ce00d0fc0c27582..52aadc0d1fcc75ed2fc97b1c81a61169cfe1beeb 100644 --- a/display-app/customer/anchorage/feedback.html +++ b/display-app/customer/anchorage/feedback.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/display-app/customer/anchorage/gift.html b/display-app/customer/anchorage/gift.html index 77752ade8fa2a10b72b9b9782ce00d0fc0c27582..52aadc0d1fcc75ed2fc97b1c81a61169cfe1beeb 100644 --- a/display-app/customer/anchorage/gift.html +++ b/display-app/customer/anchorage/gift.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/display-app/customer/anchorage/lost.html b/display-app/customer/anchorage/lost.html index 77752ade8fa2a10b72b9b9782ce00d0fc0c27582..52aadc0d1fcc75ed2fc97b1c81a61169cfe1beeb 100644 --- a/display-app/customer/anchorage/lost.html +++ b/display-app/customer/anchorage/lost.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/display-app/customer/anchorage/loyalty.html b/display-app/customer/anchorage/loyalty.html index 77752ade8fa2a10b72b9b9782ce00d0fc0c27582..52aadc0d1fcc75ed2fc97b1c81a61169cfe1beeb 100644 --- a/display-app/customer/anchorage/loyalty.html +++ b/display-app/customer/anchorage/loyalty.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/display-app/customer/anchorage/merch.html b/display-app/customer/anchorage/merch.html index 77752ade8fa2a10b72b9b9782ce00d0fc0c27582..52aadc0d1fcc75ed2fc97b1c81a61169cfe1beeb 100644 --- a/display-app/customer/anchorage/merch.html +++ b/display-app/customer/anchorage/merch.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/display-app/customer/anchorage/offers.html b/display-app/customer/anchorage/offers.html index 77752ade8fa2a10b72b9b9782ce00d0fc0c27582..52aadc0d1fcc75ed2fc97b1c81a61169cfe1beeb 100644 --- a/display-app/customer/anchorage/offers.html +++ b/display-app/customer/anchorage/offers.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/display-app/customer/anchorage/refer.html b/display-app/customer/anchorage/refer.html index 77752ade8fa2a10b72b9b9782ce00d0fc0c27582..52aadc0d1fcc75ed2fc97b1c81a61169cfe1beeb 100644 --- a/display-app/customer/anchorage/refer.html +++ b/display-app/customer/anchorage/refer.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/display-app/customer/anchorage/waitlist.html b/display-app/customer/anchorage/waitlist.html index 77752ade8fa2a10b72b9b9782ce00d0fc0c27582..52aadc0d1fcc75ed2fc97b1c81a61169cfe1beeb 100644 --- a/display-app/customer/anchorage/waitlist.html +++ b/display-app/customer/anchorage/waitlist.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/display-app/customer/anchorage/whatson.html b/display-app/customer/anchorage/whatson.html index 77752ade8fa2a10b72b9b9782ce00d0fc0c27582..52aadc0d1fcc75ed2fc97b1c81a61169cfe1beeb 100644 --- a/display-app/customer/anchorage/whatson.html +++ b/display-app/customer/anchorage/whatson.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/display-app/customer/basket.html b/display-app/customer/basket.html index 77752ade8fa2a10b72b9b9782ce00d0fc0c27582..52aadc0d1fcc75ed2fc97b1c81a61169cfe1beeb 100644 --- a/display-app/customer/basket.html +++ b/display-app/customer/basket.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/display-app/customer/profile.html b/display-app/customer/profile.html index 77752ade8fa2a10b72b9b9782ce00d0fc0c27582..52aadc0d1fcc75ed2fc97b1c81a61169cfe1beeb 100644 --- a/display-app/customer/profile.html +++ b/display-app/customer/profile.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/display-app/demo.html b/display-app/demo.html index 77752ade8fa2a10b72b9b9782ce00d0fc0c27582..52aadc0d1fcc75ed2fc97b1c81a61169cfe1beeb 100644 --- a/display-app/demo.html +++ b/display-app/demo.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/display-app/display.html b/display-app/display.html index 77752ade8fa2a10b72b9b9782ce00d0fc0c27582..52aadc0d1fcc75ed2fc97b1c81a61169cfe1beeb 100644 --- a/display-app/display.html +++ b/display-app/display.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/display-app/index.html b/display-app/index.html index 451ea431bb034f04eb229406f1b9fb590e37cae3..178a1783348e257cab73bce1bb6e4d251d3cf40e 100644 --- a/display-app/index.html +++ b/display-app/index.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/display-app/kitchen.html b/display-app/kitchen.html index 77752ade8fa2a10b72b9b9782ce00d0fc0c27582..52aadc0d1fcc75ed2fc97b1c81a61169cfe1beeb 100644 --- a/display-app/kitchen.html +++ b/display-app/kitchen.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/display-app/owner.html b/display-app/owner.html index 77752ade8fa2a10b72b9b9782ce00d0fc0c27582..52aadc0d1fcc75ed2fc97b1c81a61169cfe1beeb 100644 --- a/display-app/owner.html +++ b/display-app/owner.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/display-app/staff.html b/display-app/staff.html index 77752ade8fa2a10b72b9b9782ce00d0fc0c27582..52aadc0d1fcc75ed2fc97b1c81a61169cfe1beeb 100644 --- a/display-app/staff.html +++ b/display-app/staff.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/display-app/sw.js b/display-app/sw.js index b033c76f1550bd08768b11593058a055b72e1033..7c8a76c2126375379597b0c1aa1c06845b1fd2a6 100644 --- a/display-app/sw.js +++ b/display-app/sw.js @@ -1,7 +1,7 @@ // Anchorage Display service worker: precache the app shell so it opens offline after the first visit. -const V = "cc-display-6a3ad788e3"; +const V = "cc-display-1979ddd168"; const BASE = "/display-app/"; -const PRECACHE = ["/display-app/apple-touch-icon.png", "/display-app/assets/assets/brand/3idiots-hero.e5dfd53739f05086b1956e72d585a66a.png", "/display-app/assets/assets/brand/3idiots.df4a76d2130f0e5b0042f06a8c88693a.png", "/display-app/assets/assets/brand/abbotsford-hero.78fcb8ee06ee22c4ca659c9254db7512.png", "/display-app/assets/assets/brand/abbotsford.b26602bba5ce4969733c5422a45ad053.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/cecchinis-hero.f77780fcc94fd668cf35d66d6dc52d81.png", "/display-app/assets/assets/brand/cecchinis.ebf752fef363247848ae7c0d91938765.png", "/display-app/assets/assets/brand/drunkencoo-hero.65c21c4da9e466cf4bffc969639a1427.png", "/display-app/assets/assets/brand/drunkencoo.f6d92af3b14e4205a3deaf4434754c51.png", "/display-app/assets/assets/brand/greenside-hero.1caec5a6cb939434cccb5f3a613b50f8.png", "/display-app/assets/assets/brand/greenside.9d1556db97dcb903a3c57e2063ee2255.png", "/display-app/assets/assets/brand/kirkmichael-hero.63b13cde7fd82eb622622b39ac80c394.png", "/display-app/assets/assets/brand/kirkmichael.63b13cde7fd82eb622622b39ac80c394.png", "/display-app/assets/assets/brand/kirkton-hero.9d0837b292c2f4f30f4521d806bb28c3.png", "/display-app/assets/assets/brand/kirkton.bcf8d846df4861474d224a7a77f498fb.png", "/display-app/assets/assets/brand/mrbasrais-hero.4ce74641cfcf52d099157c84005b9d2a.png", "/display-app/assets/assets/brand/mrbasrais.7cc4086dd12ace82529795f1c9f8c900.png", "/display-app/assets/assets/brand/pizzaioli-hero.1896657c08264cefb49b401891d5448d.png", "/display-app/assets/assets/brand/pizzaioli.db8c000b62ee407121aa8b90ce45e170.png", "/display-app/assets/assets/brand/rupeeroom-hero.969fa372add526aaacf3a6c009b8ac92.png", "/display-app/assets/assets/brand/rupeeroom.689e6fb536dc0845eeb174a1ec7bd346.png", "/display-app/assets/assets/brand/saltmarsh.85a6a65732635e5148478d743d9ca884.png", "/display-app/assets/assets/brand/smokinggoat-hero.0588f17ef0eed7f757f22916cd4d37db.png", "/display-app/assets/assets/brand/smokinggoat.20a3a1970596ab43c5d6468d4ed549a7.png", "/display-app/assets/assets/brand/souters.f4c58d9349b6e1700fe5abcc9e9b665c.png", "/display-app/assets/assets/brand/wildings-hero-logo-text.4661e4b935726f2511f9c17a1567c89a.png", "/display-app/assets/assets/brand/wildings.076f4fcd06d19a0af0205c410f461b14.png", "/display-app/assets/assets/brand/williewastles-hero.b9d53d27b66f903b5618a7177b2ffad4.png", "/display-app/assets/assets/brand/williewastles.055a77893ced99bf3a6c5402ba5baac6.png", "/display-app/assets/assets/brand/yasmins-hero.a5aef62e37dfcecbe0afc056186f4ad9.png", "/display-app/assets/assets/brand/yasmins.8482602e9f0a965655924835625cb02b.png", "/display-app/assets/assets/recipes/fishsupper.1609c58319e1e8721f5c639049fb054e.jpg", "/display-app/assets/assets/recipes/lobster.2fb3485c8e372972099259017358c1b8.jpg", "/display-app/assets/assets/recipes/moules.a4f342fc7e7fb62c8a0b5c1678bbea3f.jpg", "/display-app/assets/assets/recipes/skink.4ce7b7c676f9cdcd0a060eda46f5a00e.jpg", "/display-app/assets/assets/recipes/stp.1061ced765efdcafff2554adc3fc7113.jpg", "/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-192.png", "/display-app/icon-maskable-512.png", "/display-app/manifest.webmanifest", "/display-app/index.html", "/display-app/_expo/static/js/web/bundle.js?v=6a3ad788e300b7efc6d07a7c6465abb32f8032794eae0c52e1d9e55a03863194"]; +const PRECACHE = ["/display-app/apple-touch-icon.png", "/display-app/assets/assets/brand/3idiots-hero.e5dfd53739f05086b1956e72d585a66a.png", "/display-app/assets/assets/brand/3idiots.df4a76d2130f0e5b0042f06a8c88693a.png", "/display-app/assets/assets/brand/abbotsford-hero.78fcb8ee06ee22c4ca659c9254db7512.png", "/display-app/assets/assets/brand/abbotsford.b26602bba5ce4969733c5422a45ad053.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/cecchinis-hero.f77780fcc94fd668cf35d66d6dc52d81.png", "/display-app/assets/assets/brand/cecchinis.ebf752fef363247848ae7c0d91938765.png", "/display-app/assets/assets/brand/drunkencoo-hero.65c21c4da9e466cf4bffc969639a1427.png", "/display-app/assets/assets/brand/drunkencoo.f6d92af3b14e4205a3deaf4434754c51.png", "/display-app/assets/assets/brand/greenside-hero.1caec5a6cb939434cccb5f3a613b50f8.png", "/display-app/assets/assets/brand/greenside.9d1556db97dcb903a3c57e2063ee2255.png", "/display-app/assets/assets/brand/kirkmichael-hero.63b13cde7fd82eb622622b39ac80c394.png", "/display-app/assets/assets/brand/kirkmichael.63b13cde7fd82eb622622b39ac80c394.png", "/display-app/assets/assets/brand/kirkton-hero.9d0837b292c2f4f30f4521d806bb28c3.png", "/display-app/assets/assets/brand/kirkton.bcf8d846df4861474d224a7a77f498fb.png", "/display-app/assets/assets/brand/mrbasrais-hero.4ce74641cfcf52d099157c84005b9d2a.png", "/display-app/assets/assets/brand/mrbasrais.7cc4086dd12ace82529795f1c9f8c900.png", "/display-app/assets/assets/brand/pizzaioli-hero.1896657c08264cefb49b401891d5448d.png", "/display-app/assets/assets/brand/pizzaioli.db8c000b62ee407121aa8b90ce45e170.png", "/display-app/assets/assets/brand/rupeeroom-hero.969fa372add526aaacf3a6c009b8ac92.png", "/display-app/assets/assets/brand/rupeeroom.689e6fb536dc0845eeb174a1ec7bd346.png", "/display-app/assets/assets/brand/saltmarsh.85a6a65732635e5148478d743d9ca884.png", "/display-app/assets/assets/brand/smokinggoat-hero.0588f17ef0eed7f757f22916cd4d37db.png", "/display-app/assets/assets/brand/smokinggoat.20a3a1970596ab43c5d6468d4ed549a7.png", "/display-app/assets/assets/brand/souters.f4c58d9349b6e1700fe5abcc9e9b665c.png", "/display-app/assets/assets/brand/wildings-hero-logo-text.4661e4b935726f2511f9c17a1567c89a.png", "/display-app/assets/assets/brand/wildings.076f4fcd06d19a0af0205c410f461b14.png", "/display-app/assets/assets/brand/williewastles-hero.b9d53d27b66f903b5618a7177b2ffad4.png", "/display-app/assets/assets/brand/williewastles.055a77893ced99bf3a6c5402ba5baac6.png", "/display-app/assets/assets/brand/yasmins-hero.a5aef62e37dfcecbe0afc056186f4ad9.png", "/display-app/assets/assets/brand/yasmins.8482602e9f0a965655924835625cb02b.png", "/display-app/assets/assets/recipes/fishsupper.1609c58319e1e8721f5c639049fb054e.jpg", "/display-app/assets/assets/recipes/lobster.2fb3485c8e372972099259017358c1b8.jpg", "/display-app/assets/assets/recipes/moules.a4f342fc7e7fb62c8a0b5c1678bbea3f.jpg", "/display-app/assets/assets/recipes/skink.4ce7b7c676f9cdcd0a060eda46f5a00e.jpg", "/display-app/assets/assets/recipes/stp.1061ced765efdcafff2554adc3fc7113.jpg", "/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-192.png", "/display-app/icon-maskable-512.png", "/display-app/manifest.webmanifest", "/display-app/index.html", "/display-app/_expo/static/js/web/bundle.js?v=1979ddd16813c81821860e8eaafd5a5bb998a4ab41c042b851d7fda4dd7bd396"]; // Hugging Face serves large files (fonts) through a redirect to its CDN. Browsers refuse to hand a *redirected* cached // response to a page, so store a plain copy instead (otherwise fonts, and so the app, fail to load offline). 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); diff --git a/display-app/team.html b/display-app/team.html index 77752ade8fa2a10b72b9b9782ce00d0fc0c27582..52aadc0d1fcc75ed2fc97b1c81a61169cfe1beeb 100644 --- a/display-app/team.html +++ b/display-app/team.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/index.html b/index.html index 6d43a265c131fffbfefe033dcb6b3da0855e5a02..46838ba0258899d1dfb77921eaa2db80e2594f93 100644 --- a/index.html +++ b/index.html @@ -3,7 +3,7 @@ -Cover Charge: try the apps (v0.3.12.121) +Cover Charge: try the apps (v0.3.12.122) @@ -63,7 +63,7 @@ footer{margin-top:28px;color:var(--muted);font-size:.8rem;text-align:center} Cover Charge logo

covercharge

All in one restaurant booking app

-

Cover Charge: try the apps (v0.3.12.121)

+

Cover Charge: try the apps (v0.3.12.122)

The Anchorage, Harbour View, Dunure

@@ -129,7 +129,7 @@ footer{margin-top:28px;color:var(--muted);font-size:.8rem;text-align:center}
-

Cover Charge v0.3.12.121

+

Cover Charge v0.3.12.122

diff --git a/owner-app/_expo/static/js/web/bundle.js b/owner-app/_expo/static/js/web/bundle.js index 47dab507fa3f0c6accb2f669b0e81fc02739a245..9b02153b1679809e799bad0ee58f0ba7400b437b 100644 --- a/owner-app/_expo/static/js/web/bundle.js +++ b/owner-app/_expo/static/js/web/bundle.js @@ -1122,7 +1122,7 @@ __d(function(g,r,i,a,m,e,d){m.exports=r(d[0])},1038,[1039]); __d(function(g,r,i,a,m,e,d){function n(n,t){const o=globalThis[`${__METRO_GLOBAL_PREFIX__??''}__loadBundleAsync`];if(null!=o){const s=String(n);if(null!=t){const n=t[s];if(null!=n)return o(n)}}}function t(t,o,s){const u=()=>r.importAll(t,s);{const l=o?.[String(t)];if(Array.isArray(l)){const c=globalThis[`${__METRO_GLOBAL_PREFIX__??''}__loadBundleAsync`];if(c?.isReady?.(l))return u();const f=n(t,o);if(null!=f)return f.then(u);throw new Error(`Cannot import module ${s??t}: the async bundle loader is unavailable. Load the initial Expo bundle before importing these chunks: ${l.join(', ')}`)}try{return u()}catch(s){const l=n(t,o);if(null!=l)return l.then(u);throw s}}const l=n(t,o);return null!=l?l.then(u):u()}function o(n,o,s){const u=t(n,o,s),l=Promise.resolve(u);return l._result=u,l}o.unstable_importMaybeSync=function(n,o){return t(n,o)},o.prefetch=function(t,o,s){n(t,o)?.then(()=>{},()=>{})},o.unstable_resolve=function(n,t){if(!t)throw new Error('Bundle splitting is required for Web Worker imports');const o=t[n];if(!o)throw new Error('Worker import is missing from split bundle paths: '+o);return o},o.unstable_createWorker=function(n,t){if('undefined'==typeof crossOriginIsolated||!crossOriginIsolated)return new Worker(n,t);try{const s=(o=n,`\n const ASYNC_WORKER_BASE = ${JSON.stringify(o)};\n const IMPORT_SCRIPTS = importScripts;\n const FETCH = fetch;\n const fromBaseURL = (input) => new URL(input, ASYNC_WORKER_BASE).href;\n self.fetch = function(input, init) {\n return FETCH(typeof input === 'string' ? fromBaseURL(input) : input, init);\n };\n self.importScripts = function(...urls) {\n return IMPORT_SCRIPTS.apply(self, urls.map(fromBaseURL));\n };\n importScripts(ASYNC_WORKER_BASE);\n `);return n=URL.createObjectURL(new Blob([s],{type:'text/javascript'})),new Worker(n,t)}finally{URL.revokeObjectURL(n)}var o},m.exports=o},1039,[]); __d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"currentScrollY",{enumerable:!0,get:function(){return u}}),Object.defineProperty(_e,"screenGeneration",{enumerable:!0,get:function(){return c}}),Object.defineProperty(_e,"restoreScroll",{enumerable:!0,get:function(){return o}}),_e.useScrollMemory=function(u){const c=(0,e.useRef)(0),o=(0,e.useRef)(0),l=(0,e.useRef)(0),s=(0,e.useRef)(0),f=(0,e.useRef)(0),v=(0,e.useRef)(null),y=(0,e.useRef)([]),h=()=>{y.current.forEach(clearTimeout),y.current=[]},b=()=>{const e=v.current;null!=e&&(u.current?.scrollTo({y:e,animated:!1}),f.current-s.current>=e-2&&(c.current=e,o.current=e,v.current=null,h()))},p=(0,e.useCallback)(e=>{if(h(),v.current=Math.max(0,e),e<=0)return v.current=null,u.current?.scrollTo({y:0,animated:!1}),c.current=0,void(o.current=0);for(const e of[0,30,80,160,320,600,1e3,1600,2500])y.current.push(setTimeout(b,e));y.current.push(setTimeout(()=>{v.current=null},2600))},[]);t={y:()=>o.current,restore:p};const R=(0,e.useCallback)(()=>{n++;return o.current},[]);return{props:{scrollEventThrottle:32,onScroll:e=>{const t=e.nativeEvent.contentOffset.y;c.current=t,s.current=e.nativeEvent.layoutMeasurement.height,f.current=e.nativeEvent.contentSize.height,Date.now()-l.current>250&&null==v.current&&(o.current=t)},onScrollBeginDrag:()=>{v.current=null,h()},onContentSizeChange:(e,t)=>{f.current=t,l.current=Date.now(),b()},onLayout:e=>{s.current=e.nativeEvent.layout.height}},restore:p,leave:R}};var e=r(d[0]);let t=null,n=0;const u=()=>t?t.y():0,c=()=>n,o=e=>t?.restore(e)},1040,[34]); __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,"useBackLayers",{enumerable:!0,get:function(){return f}}),_e.runBackLayer=function(){const e=f.getState().layers,t=e[e.length-1];return!!t&&(t.fn(),!0)},_e.useBackLayer=function(e,n,o=!0){const s=(0,t.useRef)(n);s.current=n,(0,t.useEffect)(()=>{if(!e)return;const t=++y,n=(0,u.currentScrollY)(),l=(0,u.screenGeneration)();return f.setState(e=>({layers:[...e.layers,{id:t,fn:()=>s.current(),own:o}]})),()=>{f.setState(e=>({layers:e.layers.filter(e=>e.id!==t)})),(0,u.screenGeneration)()===l&&(0,u.restoreScroll)(n)}},[e,o])},Object.defineProperty(_e,"useInnerBackShown",{enumerable:!0,get:function(){return w}}),Object.defineProperty(_e,"BACK_GUTTER",{enumerable:!0,get:function(){return p}}),_e.BackTitleRow=function({back:e,onBack:n,title:s}){const[l,u]=(0,t.useState)(0),[f,y]=(0,t.useState)({w:96,h:48}),[w,b]=(0,t.useState)(0),S=Array.from(new Set(String(s??'').split(/\s+/).filter(Boolean)));String(s??'').length>=20&&S.length>=3&&S.push('00000000');const v=Math.max(p,Math.ceil(f.w)+4),j=e&&l>0&&l-2*vu(Math.round(e.nativeEvent.layout.width)),style:{minHeight:44,justifyContent:'center',alignItems:'center',paddingHorizontal:e&&!j?v:0,paddingTop:j?f.h:0},children:[e?(0,h.jsx)(o.default,{style:{position:'absolute',left:0,top:0},onLayout:e=>{const t=Math.round(e.nativeEvent.layout.width),n=Math.round(e.nativeEvent.layout.height);y(e=>e.w===t&&e.h===n?e:{w:t,h:n})},children:(0,h.jsx)(g,{onPress:n})}):null,(0,h.jsx)(c.T,{size:22,weight:"bold",center:!0,accessibilityRole:"header",children:s}),e&&S.length?(0,h.jsx)(o.default,{"aria-hidden":!0,importantForAccessibility:"no-hide-descendants",pointerEvents:"none",style:{position:'absolute',left:0,top:0,opacity:0,alignItems:'flex-start'},onLayout:e=>b(Math.ceil(e.nativeEvent.layout.width)),children:S.map(e=>(0,h.jsx)(c.T,{size:22,weight:"bold",numberOfLines:1,style:{alignSelf:'flex-start'},children:e},e))}):null]})},_e.BackButton=g,_e.useWebBack=function(e){const n=(0,t.useRef)(e);n.current=e,(0,t.useEffect)(()=>{if('undefined'==typeof window||!window.history?.pushState)return;const e=()=>{try{window.history.pushState({...window.history.state??{},ccBack:Date.now()},'',window.location.href)}catch{}};e();const t=t=>{n.current()&&(t.stopImmediatePropagation?.(),e())};return window.addEventListener('popstate',t,!0),()=>window.removeEventListener('popstate',t,!0)},[])};var t=r(d[0]);r(d[1]);var n=e(r(d[2])),o=e(r(d[3])),s=r(d[4]),l=r(d[5]),c=r(d[6]),u=r(d[7]),h=r(d[8]);const f=(0,s.create)(()=>({layers:[]}));let y=0;const w=()=>f(e=>e.layers.some(e=>e.own)),p=100;function g({onPress:e,testID:t="screen-back",label:o="Back"}){return(0,h.jsx)(n.default,{testID:t,accessibilityRole:"button",accessibilityLabel:o,onPress:e,hitSlop:8,style:({pressed:e})=>({minHeight:48,minWidth:96,justifyContent:'center',paddingRight:12,opacity:e?.6:1,alignSelf:'flex-start'}),children:(0,h.jsxs)(c.T,{size:18,weight:"semibold",colour:l.colours.gold,children:["\u2039 ",o]})})}},1041,[34,236,402,102,815,840,794,1040,25]); -__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"APP_VERSION",{enumerable:!0,get:function(){return t}});const t='v0.3.12.121'},1042,[]); +__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"APP_VERSION",{enumerable:!0,get:function(){return t}});const t='v0.3.12.122'},1042,[]); __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.NotificationsSettings=function({rid:e}){(0,n.useEffect)(()=>{c.useNotifs.getState().ensure(e),(0,j.readPushLive)()},[e]);const t=(0,c.useNotifs)(e=>e.items).filter(t=>t.rid===e&&!t.removed),s=(0,h.useOwner)(e=>e.staff),o=(0,j.usePushLive)(),[l,p]=(0,n.useState)(null),[f,g]=(0,n.useState)(null),[x,b]=(0,n.useState)(!1),y=c.useNotifs.getState(),T=s.map(e=>({id:e.id,role:e.role,level:e.level,job:e.job,department:e.dept,active:e.active})),v=e=>{const t=(0,u.resolveRecipients)(e,T,[]),n=[...e.recipients.groups.map(e=>u.NOTIF_GROUP_LABEL[e]),...(e.recipients.onShiftIn??[]).map(e=>u.SHIFT_FILTER_LABEL[e])];e.recipients.fallback&&n.push(`else ${[...e.recipients.fallback.groups.map(e=>u.NOTIF_GROUP_LABEL[e]),...e.recipients.fallback.staff.map(e=>I(s.find(t=>t.id===e)?.name??e))].join(', ')}`);const o=e.recipients.staff.map(e=>I(s.find(t=>t.id===e)?.name??e));return[...n,...o].join(', ')+(t.length||(e.recipients.onShiftIn??[]).length?'':' (nobody yet)')};return(0,k.jsxs)(a.default,{style:{gap:10},testID:"notif-settings",children:[(0,k.jsx)(r.Muted,{size:13,children:"Tip: these remind people at a set time, e.g. the Mills milk order. They show in the app as a gold slider with Done and Later. Done is logged with the name and time. Times are UK time."}),(0,k.jsxs)(a.default,{testID:"push-live-status",style:{borderWidth:1,borderColor:d.colours.accentBorder,borderRadius:10,padding:8,gap:4},children:[(0,k.jsxs)(r.Row,{style:{justifyContent:'space-between'},children:[(0,k.jsx)(r.T,{weight:"semibold",children:"Send to phones"}),(0,k.jsx)(r.Badge,{kind:o.live?'gold':'neutral',label:o.live?'ON':'OFF'})]}),(0,k.jsx)(r.Muted,{size:12,children:o.live?'Phone notifications go to people who turned them on.':'Off: nothing goes to anyone\u2019s phone yet. In-app reminders still work.'}),(0,k.jsx)(r.Button,{small:!0,kind:"secondary",testID:"push-live-toggle",label:o.live?'Switch phone notifications off':'Switch phone notifications on\u2026',onPress:()=>b(!0)})]}),(0,k.jsx)(R,{}),t.map(e=>l===e.id?(0,k.jsx)(D,{init:e,onCancel:()=>p(null),onSave:t=>{y.update(e.id,t),p(null)}},e.id):(0,k.jsxs)(a.default,{testID:`notif-${e.seed??e.id}`,style:{borderWidth:1,borderColor:d.colours.hairline,borderRadius:12,padding:10,gap:4,opacity:e.paused?.6:1},children:[(0,k.jsxs)(r.Row,{style:{justifyContent:'space-between'},children:[(0,k.jsx)(r.T,{weight:"semibold",style:{flex:1},children:e.title}),e.paused?(0,k.jsx)(r.Badge,{kind:"neutral",label:"Off"}):null]}),(0,k.jsx)(r.Muted,{size:13,children:e.message}),(0,k.jsxs)(r.Muted,{size:12,children:[(0,u.scheduleText)(e)," \xb7 ",v(e)," \xb7 ",[e.sendBy.inApp?'In app':'',e.sendBy.push?'Phone':''].filter(Boolean).join(' + ')]}),(0,k.jsxs)(r.Row,{gap:6,children:[(0,k.jsx)(r.Button,{small:!0,kind:"secondary",testID:`notif-edit-${e.seed??e.id}`,label:"Edit",onPress:()=>p(e.id)}),(0,k.jsx)(r.Button,{small:!0,kind:"ghost",label:e.paused?'Switch on':'Switch off',onPress:()=>y.update(e.id,{paused:!e.paused})}),(0,k.jsx)(r.Button,{small:!0,kind:"ghost",label:"Remove",onPress:()=>g(e)})]})]},e.id)),'new'===l?(0,k.jsx)(D,{init:C,onCancel:()=>p(null),onSave:t=>{y.add(e,t),p(null)}}):(0,k.jsx)(r.Button,{small:!0,testID:"notif-add",label:"Add a notification",onPress:()=>p('new')}),(0,k.jsxs)(r.Sheet,{visible:!!f,onClose:()=>g(null),title:"Remove this notification?",children:[(0,k.jsx)(r.T,{children:f?.title}),(0,k.jsx)(r.Muted,{children:"Nobody gets it after this. Reset to default restores the configured rules."}),(0,k.jsxs)(r.Row,{gap:8,children:[(0,k.jsx)(r.Button,{label:"Remove",onPress:()=>{f&&y.remove(f.id),g(null)}}),(0,k.jsx)(r.Button,{kind:"ghost",label:"Cancel",onPress:()=>g(null)})]})]}),(0,k.jsxs)(r.Sheet,{visible:x,onClose:()=>b(!1),title:o.live?'Switch phone notifications off?':'Switch phone notifications on?',testID:"push-live-confirm",children:[(0,k.jsx)(r.T,{children:o.live?'Nothing more goes to phones. In-app reminders keep working.':'From the next scheduled time, everyone ticked on a notification with \u201cPhone notification\u201d gets it on any phone where they turned phone notifications on.'}),(0,k.jsxs)(r.Row,{gap:8,children:[(0,k.jsx)(r.Button,{testID:"push-live-yes",label:o.live?'Switch off':'Yes, switch on',onPress:()=>{(0,j.setPushLive)(!o.live).then(e=>(0,w.notify)({id:'push-live',tone:e.ok?'normal':'warn',title:e.ok?o.live?'Phone notifications are off':'Phone notifications are on':'Not changed',body:e.message??'',timeoutMs:7e3})),b(!1)}}),(0,k.jsx)(r.Button,{kind:"ghost",label:"Cancel",onPress:()=>b(!1)})]})]})]})},_e.PushButton=R,_e.OrderListsSettings=function({rid:e}){(0,n.useEffect)(()=>{p.useOrderLists.getState().ensure(e)},[e]);const s=(0,p.useOrderLists)(e=>e.lists).filter(t=>t.rid===e),o=(0,p.orderSettingsOf)(e);(0,p.useOrderLists)(t=>t.settings[e]);const l=p.useOrderLists.getState(),[c,u]=(0,n.useState)(''),[h,g]=(0,n.useState)({});return(0,k.jsxs)(a.default,{style:{gap:10},testID:"order-list-settings",children:[(0,k.jsx)(r.Muted,{size:13,children:"Tip: running lists (like Alsons drinks) collect items until you order; trip lists (like Cash and carry) are for one shopping day. Logos and phone numbers are set on each list."}),(0,k.jsx)(r.Toggle,{testID:"order-allow-staff",label:"Let all staff add items",value:o.allowStaff,onChange:t=>l.setSettings(e,{allowStaff:t})}),(0,k.jsx)(r.Muted,{size:12,children:"Staff can add items and see the lists. Only managers and the Head Chef tick, remove or finish an order."}),(0,k.jsx)(r.T,{weight:"semibold",children:"Default trip day"}),(0,k.jsx)(r.Row,{wrap:!0,gap:6,children:v.map(t=>(0,k.jsx)(r.Chip,{label:f.DAY_FULL[t].slice(0,3),selected:o.defaultTripDay===t,onPress:()=>l.setSettings(e,{defaultTripDay:t})},t))}),s.map(e=>(0,k.jsxs)(a.default,{testID:`order-list-row-${e.seed??e.id}`,style:{borderWidth:1,borderColor:d.colours.hairline,borderRadius:10,padding:8,gap:6,opacity:e.archived?.55:1},children:[(0,k.jsxs)(r.Row,{gap:6,children:[(0,k.jsx)(t.TextInput,{accessibilityLabel:`Rename ${e.name}`,value:h[e.id]??e.name,onChangeText:t=>g(s=>({...s,[e.id]:t})),onBlur:()=>{const t=(h[e.id]??'').trim();t&&t!==e.name&&l.updateList(e.id,{name:t})},style:{...T,flex:1,minWidth:0}}),(0,k.jsx)(r.Badge,{kind:"neutral",label:'trip'===e.kind?'Trip':'Running'})]}),'trip'===e.kind?(0,k.jsx)(r.Row,{wrap:!0,gap:6,children:v.map(t=>(0,k.jsx)(r.Chip,{label:f.DAY_FULL[t].slice(0,3),selected:(e.tripDay??o.defaultTripDay)===t,onPress:()=>l.updateList(e.id,{tripDay:t})},t))}):null,(0,k.jsx)(r.Row,{gap:6,children:(0,k.jsx)(r.Button,{small:!0,kind:"ghost",label:e.archived?'Bring back':'Archive',onPress:()=>l.updateList(e.id,{archived:!e.archived})})})]},e.id)),(0,k.jsxs)(r.Row,{gap:6,wrap:!0,children:[(0,k.jsx)(t.TextInput,{accessibilityLabel:"New list name",testID:"order-new-name",value:c,onChangeText:u,placeholder:"e.g. Butcher",placeholderTextColor:d.colours.muted,style:{...T,flexGrow:1,flexBasis:160,minWidth:0}}),(0,k.jsx)(r.Button,{small:!0,label:"Add running",disabled:c.trim().length<2,onPress:()=>{l.addList(e,{name:c.trim(),kind:'running'}),u('')}}),(0,k.jsx)(r.Button,{small:!0,kind:"secondary",label:"Add trip",disabled:c.trim().length<2,onPress:()=>{l.addList(e,{name:c.trim(),kind:'trip',tripDay:o.defaultTripDay}),u('')}})]})]})},Object.defineProperty(_e,"resetOrderLists",{enumerable:!0,get:function(){return B}}),_e.ClockAreaSettings=function({rid:e,me:c}){(0,g.useClockArea)(t=>t.areas[e]);const u=(0,g.areaOf)(e);const h=g.useClockArea.getState(),p=(0,s.privateClockVenue)(e),[f,j]=(0,n.useState)(null==u.lat?'':String(u.lat)),[y,w]=(0,n.useState)(null==u.lng?'':String(u.lng)),[v,S]=(0,n.useState)(!1),[I,C]=(0,n.useState)(''),[L,D]=(0,n.useState)(u.breakOptions.join(', ')),R=(t,s)=>{const n=Number(t),o=Number(s);t.trim()||s.trim()?Number.isFinite(n)&&Number.isFinite(o)&&Math.abs(n)<=90&&Math.abs(o)<=180&&h.set(e,{lat:n,lng:o},c):h.set(e,{lat:null,lng:null},c)},B=async()=>{if(p)return;S(!0),C('');const t=await(0,b.getFix)();if(S(!1),'object'!=typeof t)return void C('denied'===t?'Location is blocked for this app. Allow it in your browser or phone settings.':'Couldn\u2019t get your location. Try again outside or near a window.');const s=t.lat.toFixed(6),n=t.lng.toFixed(6);j(s),w(n),h.set(e,{lat:Number(s),lng:Number(n)},c),C(`Centre set to where you are (accurate to about ${Math.round(t.acc)} m).`)},P=(0,x.areaSet)(u);return(0,k.jsxs)(a.default,{style:{gap:10},testID:"clock-area-settings",children:[(0,k.jsx)(r.Muted,{size:13,children:p?'The address-matched pub centre is configured below. Only clock-in checks location; only pass/fail is saved. No background, clock-out or break checks. Change the radius or centre here; use a manager override for a refused check.':'Tip: stand in the middle of the venue and tap \u201cUse my current location\u201d. Clocking in, out and breaks then only work within the distance below. Rota and pay screens are never blocked.'}),P?null:(0,k.jsx)(r.Banner,{kind:"warn",title:"Clock-in area not set yet",children:"Until you set the centre, staff can clock in from anywhere."}),p?(0,k.jsx)(r.Muted,{children:"Clock-in at the pub is required. A manager can record an exception with a reason."}):(0,k.jsx)(r.Toggle,{testID:"clock-area-on",label:"Check people are at the venue",value:u.on,onChange:t=>h.set(e,{on:t},c)}),p?null:(0,k.jsx)(r.Button,{testID:"clock-area-here",label:v?'Finding you\u2026':'\ud83d\udccd Use my current location',disabled:v,onPress:()=>{B()}}),I?(0,k.jsx)(r.Muted,{size:13,children:I}):null,(0,k.jsxs)(r.Row,{wrap:!0,gap:8,children:[(0,k.jsxs)(a.default,{style:{gap:2},children:[(0,k.jsx)(r.Muted,{size:12,children:"Latitude"}),(0,k.jsx)(t.TextInput,{accessibilityLabel:"Latitude",testID:"clock-area-lat",value:f,onChangeText:j,onBlur:()=>R(f,y),placeholder:"55.40\u2026",placeholderTextColor:d.colours.muted,style:{...T,width:130}})]}),(0,k.jsxs)(a.default,{style:{gap:2},children:[(0,k.jsx)(r.Muted,{size:12,children:"Longitude"}),(0,k.jsx)(t.TextInput,{accessibilityLabel:"Longitude",testID:"clock-area-lng",value:y,onChangeText:w,onBlur:()=>R(f,y),placeholder:"-4.75\u2026",placeholderTextColor:d.colours.muted,style:{...T,width:130}})]})]}),P?(0,k.jsx)(l.default,{accessibilityRole:"link",testID:"clock-area-map",onPress:()=>{o.default.openURL(`https://www.openstreetmap.org/?mlat=${u.lat}&mlon=${u.lng}#map=18/${u.lat}/${u.lng}`)},children:(0,k.jsx)(r.T,{size:13,colour:d.colours.gold,children:"See the pin on a map \u203a"})}):null,(0,k.jsx)(r.T,{weight:"semibold",children:"How far from the centre"}),(0,k.jsxs)(r.Row,{gap:8,children:[(0,k.jsx)(r.Button,{small:!0,kind:"secondary",label:"\u2212",onPress:()=>h.set(e,{radius:(0,x.clampRadius)(u.radius-10)},c)}),(0,k.jsxs)(r.T,{weight:"semibold",style:{minWidth:70,textAlign:'center'},children:[u.radius," m"]}),(0,k.jsx)(r.Button,{small:!0,kind:"secondary",label:"+",onPress:()=>h.set(e,{radius:(0,x.clampRadius)(u.radius+10)},c)})]}),(0,k.jsxs)(r.Muted,{size:12,children:["At least ",x.MIN_RADIUS," m. Phones aren\u2019t exact, so up to 50 m of the phone\u2019s own accuracy is added on top."]}),(0,k.jsx)(r.T,{weight:"semibold",children:"Forgotten break: lengths to offer at clock-out"}),(0,k.jsx)(t.TextInput,{accessibilityLabel:"Break lengths in minutes",testID:"clock-break-options",value:L,onChangeText:D,onBlur:()=>{const t=L.split(/[ ,]+/).map(Number).filter(e=>Number.isFinite(e)&&e>0&&e<=180);t.length&&h.set(e,{breakOptions:[...new Set(t)].sort((e,t)=>e-t)},c),D((0,g.areaOf)(e).breakOptions.join(', '))},style:T}),(0,k.jsxs)(r.Muted,{size:12,children:["Minutes, e.g. 5, 10, 15, 20, 30, 45, 60. Shows as ",u.breakOptions.map(x.breakLabel).join(', ')," and \u201cNo break\u201d."]}),p?(0,k.jsx)(r.Muted,{children:"No automatic arrival checks: staff location is used only at clock-in."}):(0,k.jsxs)(k.Fragment,{children:[" ",(0,k.jsx)(r.T,{weight:"semibold",children:"Not on the rota"}),(0,k.jsx)(r.Toggle,{testID:"clock-offrota-on",label:"Ask people at the venue who aren\u2019t on the rota if they want to clock in",value:u.offRotaPrompt,onChange:t=>h.set(e,{offRotaPrompt:t},c)}),(0,k.jsx)(t.TextInput,{accessibilityLabel:"Off-rota question",testID:"clock-offrota-title",value:u.offRotaTitle,onChangeText:t=>h.set(e,{offRotaTitle:t||x.DEFAULT_CLOCK_AREA.offRotaTitle},c),style:T}),(0,k.jsx)(t.TextInput,{accessibilityLabel:"Off-rota second line",testID:"clock-offrota-body",value:u.offRotaBody,onChangeText:t=>h.set(e,{offRotaBody:t||x.DEFAULT_CLOCK_AREA.offRotaBody},c),style:T}),(0,k.jsx)(r.Muted,{size:12,children:"This only checks while the app is open (web apps can\u2019t watch location in the background; that would need a native app)."})]})]})},Object.defineProperty(_e,"resetClockArea",{enumerable:!0,get:function(){return P}}),Object.defineProperty(_e,"COOKSAFE_URL",{enumerable:!0,get:function(){return O}}),_e.FoodSafetyCard=function({children:e}){return(0,k.jsx)(r.Card,{children:(0,k.jsxs)(a.default,{testID:"food-safety",style:{gap:6},children:[(0,k.jsx)(r.T,{size:17,weight:"semibold",children:"Food safety"}),(0,k.jsxs)(r.T,{children:["Based on ",(0,k.jsx)(r.T,{weight:"bold",colour:d.colours.gold,children:"CookSafe"})," (Food Standards Scotland)"]}),(0,k.jsx)(r.Muted,{size:12,children:"CoverCharge is not endorsed by Food Standards Scotland."}),(0,k.jsx)(l.default,{accessibilityRole:"link",testID:"cooksafe-link",onPress:()=>{o.default.openURL(O)},children:(0,k.jsx)(r.T,{size:14,colour:d.colours.gold,children:"Open the CookSafe guidance \u203a"})}),(0,k.jsx)(r.Muted,{size:13,children:"Full logs coming in the next update."}),e]})})};var t=_r(_d[0]),s=_r(_d[1]),n=_r(_d[2]),o=e(_r(_d[3])),l=e(_r(_d[4])),a=e(_r(_d[5])),r=_r(_d[6]),d=_r(_d[7]),c=_r(_d[8]),u=_r(_d[9]),h=_r(_d[10]),p=_r(_d[11]),f=_r(_d[12]),g=_r(_d[13]),x=_r(_d[14]),b=_r(_d[15]),j=_r(_d[16]),y=_r(_d[17]),w=_r(_d[18]),k=_r(_d[19]);const T={minHeight:44,borderRadius:10,borderWidth:1,borderColor:d.colours.hairline,backgroundColor:d.colours.surface2,color:d.colours.text,paddingHorizontal:10,fontSize:15},v=[1,2,3,4,5,6,0],S=['on_shift','everyone','managers','head_chef','kitchen','foh'],I=e=>e.replace(' (example)',''),C={title:'',message:'',days:[3,4,5,6,0],time:'21:00',recipients:{staff:[],groups:[]},sendBy:{inApp:!0,push:!1}};function L({value:e,onChange:t}){const s=(0,h.useOwner)(e=>e.staff).filter(e=>e.active);return(0,k.jsxs)(a.default,{style:{gap:6},testID:"notif-recipients",children:[(0,k.jsx)(r.T,{weight:"semibold",children:"Who gets it"}),(0,k.jsx)(r.Muted,{size:12,children:"Tick people, or pick a group (groups follow the team as it changes)."}),(0,k.jsx)(r.Row,{wrap:!0,gap:6,children:S.map(s=>(0,k.jsx)(r.Chip,{testID:`notif-group-${s}`,label:u.NOTIF_GROUP_LABEL[s],selected:e.groups.includes(s),onPress:()=>t({...e,groups:e.groups.includes(s)?e.groups.filter(e=>e!==s):[...e.groups,s]})},s))}),(0,k.jsx)(r.Muted,{size:12,children:"Only people on shift when it goes, in:"}),(0,k.jsx)(r.Row,{wrap:!0,gap:6,children:Object.keys(u.SHIFT_FILTER_LABEL).map(s=>{const n=(e.onShiftIn??[]).includes(s);return(0,k.jsx)(r.Chip,{testID:`notif-onshift-${s}`,label:u.SHIFT_FILTER_LABEL[s],selected:n,onPress:()=>t({...e,onShiftIn:n?(e.onShiftIn??[]).filter(e=>e!==s):[...e.onShiftIn??[],s]})},s)})}),(0,k.jsx)(a.default,{style:{gap:2},children:s.map(s=>{const n=e.staff.includes(s.id);return(0,k.jsxs)(l.default,{testID:`notif-tick-${s.id}`,accessibilityRole:"checkbox",accessibilityState:{checked:n},onPress:()=>t({...e,staff:n?e.staff.filter(e=>e!==s.id):[...e.staff,s.id]}),style:{flexDirection:'row',alignItems:'center',gap:10,paddingVertical:6},children:[(0,k.jsx)(a.default,{style:{width:22,height:22,borderRadius:5,borderWidth:1.5,borderColor:d.colours.gold,alignItems:'center',justifyContent:'center',backgroundColor:n?'#2a2414':'transparent'},children:n?(0,k.jsx)(r.T,{size:14,colour:d.colours.gold,children:"\u2713"}):null}),(0,k.jsx)(r.T,{style:{flex:1},children:(0,h.staffLabel)({name:I(s.name),nickname:s.nickname})}),(0,k.jsx)(r.Muted,{size:12,children:'Head Chef'===s.level?'Head Chef':s.job})]},s.id)})}),(0,k.jsx)(r.Muted,{size:12,children:"If nobody above matches when it goes, send it to:"}),(0,k.jsxs)(r.Row,{wrap:!0,gap:6,children:[S.filter(e=>'on_shift'!==e).map(s=>{const n=e.fallback??{staff:[],groups:[]},o=n.groups.includes(s);return(0,k.jsx)(r.Chip,{testID:`notif-fallback-${s}`,label:u.NOTIF_GROUP_LABEL[s],selected:o,onPress:()=>{const l=o?n.groups.filter(e=>e!==s):[...n.groups,s];t({...e,fallback:l.length||n.staff.length?{...n,groups:l}:void 0})}},s)}),s.map(s=>{const n=e.fallback??{staff:[],groups:[]},o=n.staff.includes(s.id);return(0,k.jsx)(r.Chip,{testID:`notif-fallback-${s.id}`,label:I(s.name),selected:o,onPress:()=>{const l=o?n.staff.filter(e=>e!==s.id):[...n.staff,s.id];t({...e,fallback:l.length||n.groups.length?{...n,staff:l}:void 0})}},s.id)})]})]})}function D({init:e,onSave:s,onCancel:o}){const[l,c]=(0,n.useState)(e),[h,p]=(0,n.useState)(!!e.dayTimes&&Object.keys(e.dayTimes).length>0),f=(0,u.validateNotif)(l),g=e=>c(t=>({...t,...e}));return(0,k.jsxs)(a.default,{testID:"notif-editor",style:{gap:8,borderWidth:1,borderColor:d.colours.accentBorder,borderRadius:12,padding:10},children:[(0,k.jsx)(r.T,{weight:"semibold",children:"Title"}),(0,k.jsx)(t.TextInput,{accessibilityLabel:"Notification title",testID:"notif-title",value:l.title,onChangeText:e=>g({title:e}),maxLength:60,style:T}),(0,k.jsx)(r.T,{weight:"semibold",children:"Message"}),(0,k.jsx)(t.TextInput,{accessibilityLabel:"Notification message",testID:"notif-message",value:l.message,onChangeText:e=>g({message:e}),maxLength:160,style:T}),(0,k.jsx)(r.T,{weight:"semibold",children:"Days"}),(0,k.jsx)(r.Row,{wrap:!0,gap:6,children:v.map(e=>(0,k.jsx)(r.Chip,{testID:`notif-day-${e}`,label:u.NOTIF_DAY_NAMES[e],selected:l.days.includes(e),onPress:()=>g({days:l.days.includes(e)?l.days.filter(t=>t!==e):[...l.days,e]})},e))}),(0,k.jsxs)(r.Row,{gap:8,children:[(0,k.jsx)(r.T,{weight:"semibold",children:"Time (UK)"}),(0,k.jsx)(t.TextInput,{accessibilityLabel:"Time",testID:"notif-time",value:l.time,onChangeText:e=>g({time:e}),placeholder:"21:00",style:{...T,width:90,borderColor:(0,u.validHm)(l.time)?d.colours.hairline:d.colours.red}})]}),(0,k.jsx)(r.Toggle,{label:"A different time on some days",value:h,onChange:e=>{p(e),e||g({dayTimes:void 0})}}),h?(0,k.jsx)(r.Row,{wrap:!0,gap:8,children:v.filter(e=>l.days.includes(e)).map(e=>(0,k.jsxs)(r.Row,{gap:4,children:[(0,k.jsx)(r.T,{size:13,children:u.NOTIF_DAY_NAMES[e]}),(0,k.jsx)(t.TextInput,{accessibilityLabel:`${u.NOTIF_DAY_NAMES[e]} time`,testID:`notif-daytime-${e}`,value:l.dayTimes?.[String(e)]??'',placeholder:l.time,onChangeText:t=>{const s={...l.dayTimes??{}};t.trim()?s[String(e)]=t.trim():delete s[String(e)],g({dayTimes:s})},style:{...T,width:74}})]},e))}):null,(0,k.jsx)(L,{value:l.recipients,onChange:e=>g({recipients:e})}),(0,k.jsx)(r.T,{weight:"semibold",children:"Send by"}),(0,k.jsx)(r.Toggle,{testID:"notif-inapp",label:"In the app (gold slider, Done / Later)",value:l.sendBy.inApp,onChange:e=>g({sendBy:{...l.sendBy,inApp:e}})}),(0,k.jsx)(r.Toggle,{testID:"notif-push",label:"Phone notification (when phones are switched on)",value:l.sendBy.push,onChange:e=>g({sendBy:{...l.sendBy,push:e}})}),f?(0,k.jsx)(r.Muted,{size:13,children:f}):null,(0,k.jsxs)(r.Row,{gap:8,style:{justifyContent:'flex-end'},children:[(0,k.jsx)(r.Button,{small:!0,kind:"ghost",label:"Cancel",onPress:o}),(0,k.jsx)(r.Button,{small:!0,testID:"notif-save",label:"Save",disabled:!!f,onPress:()=>s({...l,title:l.title.trim(),message:l.message.trim(),days:[...l.days].sort()})})]})]})}function R(){const[e,t]=(0,n.useState)(null),[s,o]=(0,n.useState)('');return(0,n.useEffect)(()=>{(0,y.pushState)().then(t)},[]),e&&'unsupported'!==e?(0,k.jsxs)(a.default,{testID:"push-button",style:{gap:4},children:[(0,k.jsx)(r.Button,{small:!0,kind:'on'===e?'ghost':'secondary',testID:"push-turn-on",label:'on'===e?'Phone notifications are on for this phone \xb7 Turn off':'\ud83d\udd14 Turn on phone notifications',onPress:()=>{('on'===e?(0,y.turnOffPush)():(0,y.turnOnPush)()).then(e=>{o(e.message),(0,y.pushState)().then(t)})}}),(0,k.jsx)(r.Muted,{size:12,children:s||('ios-home-screen'===e?'iPhone: add this app to your Home Screen first (iOS 16.4 or later).':'For this phone only. Each person turns it on on their own phone.')})]}):null}const B=e=>p.useOrderLists.getState().resetSettings(e);const P=(e,t)=>g.useClockArea.getState().reset(e,t),O='https://www.foodstandards.gov.scot/publications-and-research/publications/cooksafe-manual'},1043,[796,991,34,379,402,102,794,840,1021,1022,865,1025,1026,1027,992,1044,985,1045,994,25]); __d(function(_g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.getFix=function(e=1e4){const t='undefined'!=typeof navigator?navigator.geolocation:void 0;return t?new Promise(o=>{let n=!1;const c=e=>{n||(n=!0,o(e))},u=setTimeout(()=>c('timeout'),e+1500);try{t.getCurrentPosition(e=>{clearTimeout(u),c({lat:e.coords.latitude,lng:e.coords.longitude,acc:e.coords.accuracy??999})},e=>{clearTimeout(u),c(1===e.code?'denied':3===e.code?'timeout':'unavailable')},{enableHighAccuracy:!0,timeout:e,maximumAge:0})}catch{clearTimeout(u),c('unsupported')}}):Promise.resolve('unsupported')},_e.locationAllowed=async function(){try{const e=await(navigator.permissions?.query({name:'geolocation'}));return'granted'===e?.state}catch{return!1}}},1044,[]); __d(function(g,r,_i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.pushState=f,e.turnOnPush=async function(){const u=await f();if('ios-home-screen'===u)return{ok:!1,message:'On iPhone, add this app to your Home Screen first (Share \u203a Add to Home Screen, iOS 16.4 or later), then open it from there.'};if('unsupported'===u)return{ok:!1,message:'This browser can\u2019t get phone notifications. Try Chrome on Android, or the app from your iPhone Home Screen.'};if('blocked'===u)return{ok:!1,message:'Notifications are blocked for this app. Allow them in your phone\u2019s settings, then try again.'};const c=i.useSync.getState();if('staff'!==c.kind||!c.venueId||!c.staffRef)return{ok:!1,message:'Sign in from your personal link first.'};if('granted'!==await Notification.requestPermission())return{ok:!1,message:'You didn\u2019t allow notifications, so nothing changed.'};const p=await navigator.serviceWorker.ready,h=(await p.pushManager.getSubscription()??await p.pushManager.subscribe({userVisibleOnly:!0,applicationServerKey:s(n.VAPID_PUBLIC_KEY)})).toJSON();if(!h.endpoint||!h.keys?.p256dh||!h.keys?.auth)return{ok:!1,message:'Your browser didn\u2019t give a usable subscription. Try again.'};const l=(0,t.getSupabase)(),{error:y}=await l.from('push_subscriptions').upsert({venue_id:c.venueId,staff_ref:c.staffRef,app:o.APP_VARIANT,endpoint:h.endpoint,p256dh:h.keys.p256dh,auth:h.keys.auth,user_agent:navigator.userAgent.slice(0,200)},{onConflict:'user_id,endpoint'});return y?{ok:!1,message:`Couldn\u2019t save this phone: ${y.message}`}:{ok:!0,message:'Phone notifications are on for this device.'}},e.turnOffPush=async function(){const n=await(navigator.serviceWorker?.getRegistration()),i=await(n?.pushManager.getSubscription());if(!i)return{ok:!0,message:'Phone notifications are off for this device.'};const o=i.endpoint;await i.unsubscribe();try{const n=(0,t.getSupabase)();await n.from('push_subscriptions').delete().eq('endpoint',o)}catch{}return{ok:!0,message:'Phone notifications are off for this device.'}};var n=r(d[0]),t=r(d[1]),i=r(d[2]),o=r(d[3]);const s=n=>{const t=atob(n.replace(/-/g,'+').replace(/_/g,'/')+'='.repeat((4-n.length%4)%4)),i=new Uint8Array(t.length);for(let n=0;n'undefined'!=typeof navigator&&/iPhone|iPad|iPod/.test(navigator.userAgent),c=()=>'undefined'!=typeof window&&(window.matchMedia?.('(display-mode: standalone)').matches||!0===navigator.standalone);async function f(){if('undefined'==typeof window||!('serviceWorker'in navigator))return'unsupported';if(!('PushManager'in window)||'undefined'==typeof Notification)return u()&&!c()?'ios-home-screen':'unsupported';if('denied'===Notification.permission)return'blocked';const n=await navigator.serviceWorker.getRegistration();return await(n?.pushManager.getSubscription())?'on':'off'}},1045,[1046,931,985,846]); @@ -1191,11 +1191,11 @@ __d(function(g,r,i,_a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule' __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 v}}),Object.defineProperty(_e,"fitLabel",{enumerable:!0,get:function(){return M}}),Object.defineProperty(_e,"BIG_LABEL_MIN",{enumerable:!0,get:function(){return j}}),_e.areaBounds=k,_e.minReadableScale=function(e,t){return Math.max(0,...e.tables.filter(e=>e.areaId===t).map(e=>{const t='round'===e.shape?.85:1,o=(7.4399999999999995*Math.max(1,(0,x.tableNumber)(e).length)+6)/(e.w*t),n=22/Math.min(e.w,e.h);return Math.max(o,n)}))},_e.seatSpots=S,_e.FixtureShape=R,_e.FloorCanvas=function(e){const[C,$]=(0,r.useState)({w:0,h:0}),I=e.plan.tables.filter(t=>t.areaId===e.areaId),A=e.crop&&I.length?k(e.plan,e.areaId):{x:0,y:0,w:l.PLAN_W,h:l.PLAN_H},z='live'===e.mode?[...new Map(I.flatMap(t=>{const o=e.view?.[t.name];if(!o?.group||o.group.length<2)return[];const n=[...o.group].sort().join('+');return[[n,{key:n,members:o.group,view:o}]]})).values()]:[],L=28*z.length,E={x:A.x,y:A.y,r:A.x+A.w,b:A.y+A.h},D=C.w?'width'===e.fit?Math.min(C.w/l.PLAN_W,e.maxH?e.maxH/l.PLAN_H:9):Math.min(C.w/A.w,Math.max(1,C.h-L)/A.h):0,F=e.fill&&'contain'===e.fit&&D>0&&C.h>0,_=F?(C.w/D-A.w)/2:0,O=F?((C.h-L)/D-A.h)/2:0,N={x:E.x-_,y:E.y-O,r:E.r+_,b:E.b+O},B=N.r-N.x,P=N.b-N.y,[W,H]=(0,r.useState)(null),G=(0,r.useRef)(null),[Y,X]=(0,r.useState)(null),U=(0,r.useRef)(null);U.current=Y,i.default.useEffect(()=>{if(!Y)return;const e=setTimeout(()=>X(null),n.ARM_MS);return()=>clearTimeout(e)},[Y]);const q='live'===e.mode&&!!e.onDrop,J=e=>!q||(0,n.isArmed)(U.current,e.id,Date.now()),K=t=>e.plan.sections.find(e=>e.id===t.sectionId),V=t=>e.plan.joins.find(e=>e.tables.includes(t.name)),Q=i.default.useMemo(()=>(0,x.numberClashes)(e.plan.tables).sameArea,[e.plan.tables]),Z=(t,o)=>({onStartShouldSetResponder:()=>!0,onMoveShouldSetResponder:()=>J(t),onResponderTerminationRequest:()=>!J(t),onResponderGrant:e=>{G.current={x:e.nativeEvent.pageX,y:e.nativeEvent.pageY,id:t.id,kind:o}},onResponderMove:n=>{const r=G.current;if(!r)return;const i=n.nativeEvent.pageX-r.x,s=n.nativeEvent.pageY-r.y;Math.abs(i)+Math.abs(s)<6&&!W||J(t)&&('live'!==e.mode||e.onDrop&&e.view&&['seated','mains','dessert','bill'].includes(e.view[t.name]?.status)&&e.view[t.name]?.booking)&&H({id:t.id,dx:i,dy:s,kind:o})},onResponderRelease:r=>{const i=G.current;G.current=null;const a=r.nativeEvent.pageX-(i?.x??0),u=r.nativeEvent.pageY-(i?.y??0);if(H(null),Math.abs(a)+Math.abs(u)<6||!D){if('move'===o){if(q){const e=(0,n.releaseOn)(U.current,t.id,!1,Date.now());if(X(e.arm),'select'===e.action)try{s.default.announceForAccessibility(n.SELECTED_A11Y)}catch{}}e.onTap?.(t)}return}if(q){const e=(0,n.releaseOn)(U.current,t.id,!0,Date.now());if(X(e.arm),'move'!==e.action)return}const h=a/D,c=u/D;if('edit'===e.mode&&'move'===o)e.onMove?.(t,w(v(t.x+h,e.snapOn),0,l.PLAN_W-t.w),w(v(t.y+c,e.snapOn),0,l.PLAN_H-t.h));else if('edit'===e.mode&&'resize'===o)e.onResize?.(t,w(v(t.w+h,e.snapOn),50,400),w(v(t.h+c,e.snapOn),50,300));else if('live'===e.mode&&e.onDrop){const o=t.x+t.w/2+h,n=t.y+t.h/2+c,r=I.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);r&&e.onDrop(t,r)}}}),ee=e=>e*D,te=e=>ee(e-N.x),oe=e=>ee(e-N.y),ne='width'===e.fit?l.PLAN_H*D+L||200:void 0;return(0,g.jsxs)(a.default,{testID:"floor-canvas",onLayout:e=>$({w:e.nativeEvent.layout.width,h:e.nativeEvent.layout.height}),style:[{width:'100%',borderRadius:16,overflow:'hidden'},'contain'===e.fit?{flex:1}:{height:ne}],children:[z.map(e=>{const o=I.filter(t=>e.members.includes(t.name)),n=o.length?(Math.min(...o.map(e=>e.x))+Math.max(...o.map(e=>e.x+e.w)))/2:N.x+B/2,r=e.view.booking?.time??e.view.next?.time,i=`${T(e.members)}${r?` \xb7 ${'seated'===e.view.status?'Seated':'Booked'} ${r}`:''}`,s=Math.min(Math.max(0,C.w-8),260);return(0,g.jsx)(a.default,{testID:`joined-label-${e.key}`,accessible:!0,accessibilityLabel:`Joined tables ${i}`,pointerEvents:"none",style:{height:28,width:s,marginLeft:w(ee(n-N.x)-s/2,4,Math.max(4,C.w-s-4)),alignItems:'center',justifyContent:'center',overflow:'hidden',borderRadius:8,borderWidth:1,borderColor:h.colours.gold,backgroundColor:(0,t.soutersSurface)('#0B0B0B')},children:(0,g.jsx)(c.T,{size:16,weight:"bold",colour:h.colours.goldLight,center:!0,numberOfLines:1,children:i})},e.key)}),D?(0,g.jsx)(a.default,{style:{width:ee(B),height:ee(P),alignSelf:'center',backgroundColor:(0,t.soutersSurface)('#0F0E0C'),borderRadius:16,borderWidth:1,borderColor:h.colours.border,overflow:'hidden'},children:(0,g.jsxs)(a.default,{style:{position:'absolute',left:0,top:0,width:ee(B),height:ee(P)},children:['edit'===e.mode?Array.from({length:l.PLAN_W/(2*l.GRID)},(e,o)=>(0,g.jsx)(a.default,{style:{position:'absolute',left:te(o*l.GRID*2),top:0,bottom:0,width:1,backgroundColor:(0,t.soutersSurface)('#1E1B16')}},`v${o}`)):null,'edit'===e.mode?Array.from({length:l.PLAN_H/(2*l.GRID)},(e,o)=>(0,g.jsx)(a.default,{style:{position:'absolute',top:oe(o*l.GRID*2),left:0,right:0,height:1,backgroundColor:(0,t.soutersSurface)('#1E1B16')}},`h${o}`)):null,(e.plan.fixtures??[]).filter(t=>t.areaId===e.areaId).map(t=>(0,g.jsx)(R,{f:{...t,x:t.x-N.x,y:t.y-N.y},S:ee,live:'live'===e.mode},t.id)),e.plan.joins.map(e=>{const t=I.filter(t=>e.tables.includes(t.name));if(t.length<2)return null;const[o,n]=t,r=o.x+o.w/2,i=o.y+o.h/2,s=n.x+n.w/2,l=n.y+n.h/2,u=Math.hypot(s-r,l-i),h=Math.atan2(l-i,s-r);return(0,g.jsx)(a.default,{testID:`join-${e.tables.join('+')}`,style:{position:'absolute',left:te((r+s)/2-u/2),top:oe((i+l)/2)-3,width:ee(u),height:6,borderRadius:3,backgroundColor:'rgba(207,164,95,0.55)',transform:[{rotate:`${h}rad`}]}},e.id)}),I.map(n=>{const r=e.view?.[n.name],s=r?u.STATUS[r.status]:u.STATUS.free,v=W?.id===n.id,w=v&&'resize'===W.kind?Math.max(50,n.w+W.dx/D):n.w,C=v&&'resize'===W.kind?Math.max(50,n.h+W.dy/D):n.h,k=v&&'move'===W.kind?n.x+W.dx/D:n.x,R=v&&'move'===W.kind?n.y+W.dy/D:n.y,T=e.selected===n.id||e.highlight?.includes(n.name)||Y?.id===n.id,$=K(n),I='edit'===e.mode?'#2A2419':s.colour,A='edit'===e.mode?h.colours.text:s.fg,z='round'===n.shape?ee(Math.min(w,C))/2:ee(10),L='live'===e.mode?(0,x.liveTableLabel)(n,Q):(0,l.tableLabel)(n),E=ee(Math.min(w,C))<64,F=M(e.big?Math.max(13,Math.min(34,ee(Math.min(w,C))/3)):Math.max(11,Math.min(22,ee(Math.min(w,C))/4)),L,ee(w)*('round'===n.shape?.85:1),e.big?j:9),_=Math.max(e.big?11:12,Math.round(.62*F)),O=(ee(C)-6-1.4*F)/(1.4*_),N=O>=2&&ee(w)>=5*_?2:O>=1?1:0,B=r?.booking&&void 0!==r.seatedMins?r.booking.time:void 0,P='soon'===r?.status?r.next?.time??r.dayBookings?.[0]?.time:void 0,H='edit'===e.mode?`Table ${(0,o.tableNumbers)(L)}, ${(0,l.shapeLabel)(n.shape).toLowerCase()}, ${n.minSeats}\u2013${n.maxSeats} seats${n.online?', bookable online':''}`:'soon'===r?.status?`Table ${(0,o.tableNumbers)(L)}, booked later${P?`, ${P}`:''}${r.group?`, combined with ${r.group.filter(e=>e!==n.name).map(e=>`table ${e}`).join(', ')}`:''}`:`Table ${(0,o.tableNumbers)(L)}, ${s.label}${void 0!==r?.seatedMins?`, seated ${r.seatedMins} min`:''}${r?.covers?`, ${r.covers} Covers`:''}${r?.dayBookings?.length?`, booked: ${r.dayBookings.map(e=>`${e.time}, ${e.partySize} Covers`).join('; ')}`:''}${r?.group?`, combined with ${r.group.filter(e=>e!==n.name).map(e=>`table ${e}`).join(', ')}`:''}`,G=void 0!==r?.seatedMins&&r.booking?Math.min(1.2,r.seatedMins/(r.booking.durationMins??(0,u.turnFor)(r.booking.partySize,e.turnBase))):null;return(0,g.jsxs)(i.default.Fragment,{children:[S({...n,w:w,h:C}).map((t,o)=>(0,g.jsx)(a.default,{pointerEvents:"none",style:[{position:'absolute',left:te(k+t.x)-Math.max(4,ee(8)),top:oe(R+t.y)-Math.max(4,ee(8)),width:Math.max(8,ee(16)),height:Math.max(8,ee(16)),borderRadius:99,backgroundColor:'edit'===e.mode?'#5A4C33':'rgba(255,255,255,0.16)',borderWidth:1,borderColor:'edit'===e.mode?h.colours.gold:'rgba(255,255,255,0.25)'},y()]},o)),'live'===e.mode&&(ee(w)<44||ee(C)<44)?(0,g.jsx)(a.default,{accessible:!1,importantForAccessibility:"no-hide-descendants",'aria-hidden':!0,...Z(n,'move'),style:{position:'absolute',left:te(k+w/2)-Math.max(44,ee(w))/2,top:oe(R+C/2)-Math.max(44,ee(C))/2,width:Math.max(44,ee(w)),height:Math.max(44,ee(C)),zIndex:2}}):null,(0,g.jsxs)(a.default,{testID:`table-${n.name}`,accessibilityRole:"button",accessibilityLabel:H,onAccessibilityTap:()=>e.onTap?.(n),onKeyDown:t=>{'Enter'!==t?.key&&' '!==t?.key||e.onTap?.(n)},tabIndex:0,...Z(n,'move'),style:[{position:'absolute',left:te(k),top:oe(R),width:ee(w),height:ee(C),borderRadius:z,backgroundColor:I,alignItems:'center',justifyContent:'center',padding:2,overflow:'hidden',borderWidth:T?3:e.sectionColours&&$?2.5:1.5,borderColor:T?'#FFFFFF':e.sectionColours&&$?(0,h.brandColour)($.colour):'edit'===e.mode?h.colours.gold:'rgba(0,0,0,0.35)',transform:[{scale:v?1.06:1}],zIndex:v?50:3,opacity:v&&'live'===e.mode?.85:1,shadowColor:'#000',shadowOpacity:v?.6:.3,shadowRadius:v?14:6,cursor:'edit'===e.mode?'grab':'pointer',touchAction:'none'},v?null:y()],children:[(0,g.jsxs)(a.default,{style:{alignItems:'center',justifyContent:'center',maxWidth:'100%',maxHeight:'100%',overflow:'hidden'},pointerEvents:"none",children:[(0,g.jsx)(c.T,{style:p,weight:"bold",size:F,colour:A,center:!0,numberOfLines:1,children:L}),'live'===e.mode&&'blocked'===r?.status?(0,g.jsx)(c.T,{style:f,size:Math.max(10,Math.round(.5*F)),weight:"semibold",colour:A,center:!0,numberOfLines:1,children:"Blocked"}):null,'live'===e.mode&&r?.group&&r.group.length>1?null:e.big&&'live'===e.mode&&r&&1===N?'free'!==r.status&&'soon'!==r.status&&(r.covers||B)?(0,g.jsx)(c.T,{style:f,size:_,weight:"bold",colour:A,center:!0,numberOfLines:1,children:[r.covers?`${r.covers}`:'',B??''].filter(Boolean).join(' \xb7 ')}):null:e.big&&'live'===e.mode&&r&&2===N?(0,g.jsxs)(g.Fragment,{children:['soon'!==r.status&&r.covers?(0,g.jsxs)(c.T,{style:f,size:_,weight:"semibold",colour:A,center:!0,children:[r.covers," ",1===r.covers?'Cover':'Covers']}):'free'!==r.status||E?null:(0,g.jsxs)(c.T,{style:f,size:_,colour:A,center:!0,children:[n.minSeats,"\u2013",n.maxSeats]}),'free'!==r.status&&'soon'!==r.status&&B?(0,g.jsx)(c.T,{style:f,size:_,weight:"bold",colour:A,center:!0,children:B}):'dirty'===r.status?(0,g.jsx)(c.T,{style:f,size:_,colour:A,center:!0,children:"Clear"}):null]}):e.big&&'live'===e.mode?null:'edit'===e.mode?E?null:(0,g.jsxs)(c.T,{style:f,size:11,colour:h.colours.muted,center:!0,children:[n.minSeats,"\u2013",n.maxSeats,n.online?' \xb7 online':'']}):r?(0,g.jsxs)(g.Fragment,{children:['free'!==r.status||E?null:(0,g.jsxs)(c.T,{style:f,size:11,colour:A,center:!0,children:[n.minSeats,"\u2013",n.maxSeats," seats"]}),void 0!==r.seatedMins?(0,g.jsxs)(c.T,{style:f,size:12,weight:"semibold",colour:A,center:!0,children:[r.seatedMins,"m \xb7 ",r.covers,"\ud83d\udc65"]}):r.orderOnly?(0,g.jsx)(c.T,{style:f,size:11,colour:A,center:!0,children:"Open order"}):null,'dirty'!==r.status||E?null:(0,g.jsx)(c.T,{style:f,size:11,colour:A,center:!0,children:"Clear"}),!E||r.allergy||r.vip?(0,g.jsxs)(c.T,{style:f,size:11,colour:A,center:!0,children:[r.allergy?'\u26a0':'',r.vip?'VIP'===r.vip?'\u2605':'\u2665':'',r.occasion?u.OCCASION_ICON[r.occasion]:'',r.note?'\u270e':'']}):null]}):null]}),null,'live'===e.mode&&r&&!E&&(r.booking??r.next)&&(0,b.needsIcons)(r.booking??r.next).replace('\u26a0\ufe0f','').trim()?(0,g.jsx)(a.default,{pointerEvents:"none",testID:`needs-${n.name}`,style:{position:'absolute',bottom:e.big?-Math.max(9,.55*_):2,right:e.big?-6:4,backgroundColor:(0,t.soutersSurface)('rgba(11,11,11,0.85)'),borderRadius:8,paddingHorizontal:4,borderWidth:1,borderColor:'rgba(255,255,255,0.15)'},children:(0,g.jsx)(c.T,{size:e.big?Math.max(11,.75*_):10,children:(0,b.needsIcons)(r.booking??r.next).replace('\u26a0\ufe0f','').trim()})}):null,$&&'live'===e.mode&&e.sectionColours&&!E&&!e.big?(0,g.jsx)(a.default,{pointerEvents:"none",style:{position:'absolute',top:3,right:6,backgroundColor:(0,h.brandColour)($.colour),borderRadius:6,paddingHorizontal:3},children:(0,g.jsx)(c.T,{size:9,weight:"bold",colour:"#0B0B0B",children:$.server})}):null,null===G||E?null:(0,g.jsx)(a.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,g.jsx)(a.default,{style:{width:`${Math.min(100,100*G)}%`,height:4,borderRadius:2,backgroundColor:G>=1?'#B3261E':'rgba(0,0,0,0.6)'}})}),V(n)&&'edit'===e.mode?(0,g.jsx)(a.default,{pointerEvents:"none",style:{position:'absolute',bottom:2,left:4},children:(0,g.jsx)(c.T,{size:10,colour:h.colours.gold,children:"\u26d3"})}):null]}),'edit'===e.mode&&e.selected===n.id?(0,g.jsx)(a.default,{testID:"resize-handle",accessibilityLabel:"Resize table",...Z(n,'resize'),style:{position:'absolute',left:te(k+w)-14,top:oe(R+C)-14,width:28,height:28,borderRadius:14,backgroundColor:h.colours.gold,borderWidth:2,borderColor:'#fff',zIndex:60,cursor:'nwse-resize',touchAction:'none'}}):null]},n.id)}),0===I.length?(0,g.jsx)(a.default,{style:{position:'absolute',left:0,right:0,top:'45%'},children:(0,g.jsxs)(c.T,{center:!0,colour:h.colours.muted,children:["No tables in this area yet",'edit'===e.mode?' \u2014 add some in Tables':'',"."]})}):null]})}):null]})};var t=_r(d[0]),o=_r(d[1]),n=_r(d[2]),r=_r(d[3]),i=e(r),s=e(_r(d[4]));_r(d[5]);var a=e(_r(d[6])),l=_r(d[7]),u=_r(d[8]),h=_r(d[9]),c=_r(d[10]),b=_r(d[11]),x=_r(d[12]),g=_r(d[13]);const f={flexShrink:0},p={flexShrink:0,maxWidth:'none'},y=(e=250)=>({transitionProperty:'background-color, border-color, transform, left, top, width, height',transitionDuration:`${e}ms`}),v=(e,t=!0)=>t?Math.round(e/l.GRID)*l.GRID:Math.round(e),w=(e,t,o)=>Math.max(t,Math.min(o,e)),M=(e,t,o,n=9)=>Math.max(n,Math.min(e,(o-6)/(.62*Math.max(1,t.length)))),j=12,C=46;function k(e,t){const o=e.tables.filter(e=>e.areaId===t);if(!o.length)return{x:0,y:0,w:l.PLAN_W,h:l.PLAN_H};const n=Math.max(0,Math.min(...o.map(e=>e.x))-C),r=Math.max(0,Math.min(...o.map(e=>e.y))-C);return{x:n,y:r,w:Math.min(l.PLAN_W,Math.max(...o.map(e=>e.x+e.w))+C)-n,h:Math.min(l.PLAN_H,Math.max(...o.map(e=>e.y+e.h))+C)-r}}function S(e){const t=Math.max(1,e.maxSeats),o=[];if('round'===e.shape){const n=e.w/2+9.6,r=e.h/2+9.6;for(let i=0;ie.w,r=Math.ceil(t/2),i=t-r;if(n){for(let t=0;te.w,s=n?{borderColor:'#FFFFFF',borderWidth:2}:null;return'bar'===e.kind?(0,g.jsx)(a.default,{pointerEvents:"none",style:[r,{backgroundColor:o?'#2A2216':'#3A2E1C',borderRadius:8,borderWidth:1.5,borderColor:o?'#5A4A30':h.colours.gold},s],children:(0,g.jsx)(c.T,{size:Math.max(9,Math.min(14,t(e.h)/2.4)),weight:"semibold",colour:h.colours.goldLight,children:"BAR"})}):'wall'===e.kind?(0,g.jsx)(a.default,{pointerEvents:"none",style:[r,{backgroundColor:o?'#3A3631':'#5C574F',borderRadius:2},s]}):'window'===e.kind?(0,g.jsx)(a.default,{pointerEvents:"none",style:[r,{backgroundColor:'rgba(226,196,137,0.16)',borderColor:'rgba(226,196,137,0.6)',borderWidth:1,borderRadius:2},s],children:!o&&t(i?e.h:e.w)>60?(0,g.jsx)(c.T,{size:9,colour:"#BFDDFF",style:i?{transform:[{rotate:'90deg'}]}:void 0,children:"WINDOW"}):null}):(0,g.jsx)(a.default,{pointerEvents:"none",style:[r,{borderColor:o?'#7A6440':h.colours.gold,borderWidth:1.5,borderStyle:'dashed',borderRadius:3,backgroundColor:'rgba(207,164,95,0.08)'},s],children:t(i?e.h:e.w)>40?(0,g.jsx)(c.T,{size:9,colour:h.colours.goldLight,style:i?{transform:[{rotate:'90deg'}]}:void 0,children:"DOOR"}):null})}function T(e){return(0,l.tablesLabel)(e.join('+')).replace(/^Tables? /,'').replace(/ \+ /g,'+')}},1108,[798,829,1109,34,281,236,102,1014,1079,840,794,1081,828,25]); __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"ARM_MS",{enumerable:!0,get:function(){return t}}),Object.defineProperty(e,"SELECT_HINT",{enumerable:!0,get:function(){return n}}),Object.defineProperty(e,"SELECTED_A11Y",{enumerable:!0,get:function(){return o}}),Object.defineProperty(e,"TABLE_SELECT_HINT",{enumerable:!0,get:function(){return c}}),Object.defineProperty(e,"isArmed",{enumerable:!0,get:function(){return l}}),e.releaseOn=function(n,o,c,u){const b=l(n,o,u);return c?b?{arm:null,action:'move'}:{arm:n&&u-n.at!!n&&n.id===o&&c-n.at!e.signOff),S=k.filter(e=>e.signOff),_=j.map(o.allergenLabel).join(', '),C=e=>e.map(e=>e.name).join(', ')||'none';return(0,f.jsxs)(l.default,{testID:"menu-allergy-check",style:{gap:6,borderWidth:1,borderColor:p.length?h.colours.red:h.colours.border,borderRadius:12,padding:10,backgroundColor:h.colours.surface2},children:[(0,f.jsxs)(u.T,{weight:"semibold",children:["Allergy check against the menu (",_,")"]}),(0,f.jsxs)(u.T,{size:14,colour:h.colours.red,children:["Contains: ",p.length," dish",1===p.length?'':'es']}),(0,f.jsxs)(u.T,{size:14,colour:h.colours.amber,children:["May contain: ",M.length]}),(0,f.jsxs)(u.T,{size:14,colour:h.colours.ok,children:["Free from ",1===j.length?'it':'them'," (signed off): ",S.length]}),w.length?(0,f.jsxs)(u.Muted,{children:[w.length," more awaiting the head chef's sign-off, so not shown as safe."]}):null,(0,f.jsx)(n.default,{testID:"menu-allergy-details",accessibilityRole:"button",onPress:()=>y(!x),hitSlop:6,children:(0,f.jsx)(u.T,{size:14,colour:h.colours.gold,children:x?'Hide dishes':'Show dishes'})}),x?(0,f.jsxs)(l.default,{style:{gap:4},children:[(0,f.jsxs)(u.Muted,{children:["Contains: ",C(p)]}),(0,f.jsxs)(u.Muted,{children:["May contain: ",C(M)]}),(0,f.jsxs)(u.Muted,{children:["Free from: ",C(S)]})]}):null,(0,f.jsx)(u.Muted,{children:'guest'===m?'From the kitchen\u2019s signed-off recipe cards. Specials on the board are checked by staff on the day.':'From the signed-off recipe cards. Specials on the board have their own allergens. Still check with the guest and the kitchen.'})]})};var s=r(d[0]),n=e(r(d[1])),l=e(r(d[2])),t=r(d[3]),o=r(d[4]),c=r(d[5]),h=r(d[6]),u=r(d[7]),f=r(d[8])},1110,[34,402,102,848,830,832,840,794,25]); -__d(function(g,r,i,a,m,e,_d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"NOTES_PLACEHOLDER",{enumerable:!0,get:function(){return o}}),Object.defineProperty(e,"WIX_EDIT_NOTE",{enumerable:!0,get:function(){return s}}),e.canEditBooking=function(t){return'customer'!==t.variant&&('staff'===t.variant||t.inStaffApp?!!t.shiftManager:'display'===t.variant||'chef'===t.variant||'staff'!==t.role)},Object.defineProperty(e,"isWixBooking",{enumerable:!0,get:function(){return l}}),Object.defineProperty(e,"EDIT_FIELDS",{enumerable:!0,get:function(){return d}}),Object.defineProperty(e,"FIELD_WORDS",{enumerable:!0,get:function(){return c}}),Object.defineProperty(e,"draftOf",{enumerable:!0,get:function(){return u}}),e.changedFields=p,e.editPatch=function(n,o,s,l=(new Date).toISOString()){const d=p(n,o);if(!d.length)return{};const c={};for(const n of d){const s=f(n,o[n]);c[n]='partySize'===n?(0,t.clampParty)(s):'phone'===n||'email'===n||'table'===n?s||void 0:s}d.includes('table')&&(c.tableSetHere=!0);const u=n;return c.locallyEdited=!0,c.editedFields=[...new Set([...u.editedFields??[],...d])],c.editLog=[...u.editLog??[],{at:l,by:s.by.slice(0,80),app:s.app,fields:d}].slice(-50),c},e.editWarnings=function(t,o,s,l,d=90){const c=[],u={...t,date:o.date,time:o.time,partySize:o.partySize};if(o.table){const t=(0,n.tableOverlaps)(u,o.table,s.filter(t=>t.date===o.date),d);t.length&&c.push(`The table already has a booking at about the same time: ${t.map(t=>`${t.time} ${t.walkIn?'walk-in':t.name}`).join(', ')}.`)}l&&c.push(`Bookings are paused ${l.from} to ${l.to}${l.reason?` (${l.reason})`:''}.`);return c},Object.defineProperty(e,"editedWords",{enumerable:!0,get:function(){return b}});var t=r(_d[0]),n=r(_d[1]);const o='For example: birthday, high chair, dog, window seat',s='This booking came from the website. Changes here are not sent to website bookings yet.';const l=t=>{const n=t;return'Wix'===n.importedFrom||!!n.wix||(t.tags??[]).includes('Wix')},d=['date','time','partySize','name','phone','email','notes','table'],c={date:'date',time:'time',partySize:'covers',name:'name',phone:'phone',email:'email',notes:'notes',table:'table'},u=t=>({date:t.date,time:t.time,partySize:t.partySize,name:t.name,phone:t.phone??'',email:t.email??'',notes:t.notes??'',table:t.table??''}),f=(t,n)=>'partySize'===t?Number(n):String(n??'').trim();function p(t,n){const o=u(t);return d.filter(t=>f(t,o[t])!==f(t,n[t]))}const b=t=>t.map(t=>c[t]).join(', ')},1111,[1098,1092]); +__d(function(g,r,i,_a,m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"NOTES_PLACEHOLDER",{enumerable:!0,get:function(){return a}}),Object.defineProperty(_e,"WIX_EDIT_NOTE",{enumerable:!0,get:function(){return s}}),Object.defineProperty(_e,"NOTIFY_LABEL",{enumerable:!0,get:function(){return o}}),Object.defineProperty(_e,"guestMessageFields",{enumerable:!0,get:function(){return n}}),_e.canEditBooking=function(e){return'customer'!==e.variant&&('staff'===e.variant||e.inStaffApp?!!e.shiftManager:'display'===e.variant||'chef'===e.variant||'staff'!==e.role)},Object.defineProperty(_e,"isWixBooking",{enumerable:!0,get:function(){return d}}),Object.defineProperty(_e,"EDIT_FIELDS",{enumerable:!0,get:function(){return c}}),Object.defineProperty(_e,"DEPOSIT_METHODS",{enumerable:!0,get:function(){return u}}),Object.defineProperty(_e,"EDIT_STATUSES",{enumerable:!0,get:function(){return l}}),Object.defineProperty(_e,"SOURCES",{enumerable:!0,get:function(){return h}}),Object.defineProperty(_e,"OCCASIONS",{enumerable:!0,get:function(){return p}}),Object.defineProperty(_e,"TAGS",{enumerable:!0,get:function(){return b}}),Object.defineProperty(_e,"FIELD_WORDS",{enumerable:!0,get:function(){return f}}),Object.defineProperty(_e,"draftOf",{enumerable:!0,get:function(){return y}}),_e.changedFields=N,_e.historyText=k,_e.editPatch=function(t,a,s,o=(new Date).toISOString()){const n=N(t,a);if(!n.length)return{};const d={};for(const c of n)switch(c){case'partySize':d.partySize=(0,e.clampParty)(Number(a.partySize));break;case'phone':case'email':case'table':d[c]=String(a[c]??'').trim()||void 0;break;case'date':case'time':case'name':case'notes':d[c]=String(a[c]??'').trim();break;case'area':d.area=(a.area??'').trim()||void 0;break;case'dogs':d.dogs=Math.max(0,Number(a.dogs??0)),d.dog=Number(a.dogs??0)>0;break;case'highChairs':d.highChairs=Math.max(0,Number(a.highChairs??0))||void 0;break;case'wheelchair':d.access={...t.access??{},wheelchair:Math.max(0,Number(a.wheelchair??0))||void 0};break;case'occasion':d.occasion=a.occasion||void 0;break;case'allergies':d.allergies=[...a.allergies??[]],d.allergyNone=!!a.allergyNone&&!(a.allergies??[]).length,d.allergyNote=(a.allergyNote??'').trim()||void 0,(a.allergies??[]).length||(d.allergyAck=void 0);break;case'diet':d.diet={vegan:Number(a.vegan??0)||void 0,vegetarian:Number(a.vegetarian??0)||void 0};break;case'deposit':if(!a.depositOn){Object.assign(d,{security:'none',depositDue:0,depositPaid:0,depositPaidBy:void 0,depositPaidAt:void 0,depositMethod:void 0});break}if(d.security='deposit',d.depositDue=Math.max(0,Math.round(Number(a.depositDue??0))),a.depositPaid){const e=/^\d{4}-\d{2}-\d{2}$/.test(a.depositDate??'')?a.depositDate:o.slice(0,10);Object.assign(d,{depositPaid:Math.max(0,Math.round(Number(a.depositAmount??0))),depositPaidBy:s.by.slice(0,80),depositPaidAt:e===o.slice(0,10)?o:`${e}T12:00:00.000Z`,depositMethod:a.depositMethod||void 0})}else Object.assign(d,{depositPaid:0,depositPaidBy:void 0,depositPaidAt:void 0,depositMethod:void 0});break;case'status':d.status=a.status,'seated'!==a.status||t.seatedAt||(d.seatedAt=o),'finished'!==a.status||t.finishedAt||(d.finishedAt=o),'confirmed'!==a.status&&'pending'!==a.status||(d.seatedAt=void 0,d.finishedAt=void 0);break;case'source':d.source=a.source||void 0;break;case'tags':d.tags=[...(t.tags??[]).filter(e=>!b.includes(e)),...a.tags??[]];break;case'duration':d.durationMins=Number(a.duration??0)>=15?Number(a.duration):void 0}n.includes('table')&&(d.tableSetHere=!0);const c=t;return d.locallyEdited=!0,d.editedFields=[...new Set([...c.editedFields??[],...n])],d.editLog=[...c.editLog??[],{at:o,by:s.by.slice(0,80),app:s.app,fields:n,text:k(t,a,n,s.by.slice(0,80),o),quiet:!s.notify}].slice(-50),d},_e.historyLines=function(e){return(e.editLog??[]).slice().reverse().map(e=>e.text??`${e.fields.map(e=>f[e]??e).join(', ')} changed by ${e.by} ${w(e.at)}`.replace(/^./,e=>e.toUpperCase()))},_e.editWarnings=function(e,a,s,o,n=90,d){const c=[];if(!N(e,a).some(e=>['date','time','partySize','table','duration','dogs','status'].includes(e)))return c;const u={...e,date:a.date,time:a.time,partySize:a.partySize,...Number(a.duration??0)>=15?{durationMins:Number(a.duration)}:{}};if(a.table){const e=(0,t.tableOverlaps)(u,a.table,s.filter(e=>e.date===a.date),n);if(e.length&&c.push(`The table already has a booking at about the same time: ${e.map(e=>`${e.time} ${e.walkIn?'walk-in':e.name}`).join(', ')}.`),d){const e=a.table.split('+').map(e=>e.trim()).filter(Boolean).map(e=>d.tables.find(t=>t.name===e)).filter(Boolean),t=e.reduce((e,t)=>e+t.maxSeats,0);e.length&&td.areas.find(t=>t.id===e.areaId)).filter(e=>e&&!e.dogs);Number(a.dogs??0)>0&&s.length&&c.push(`Dogs aren\u2019t allowed in ${s[0].name}. Pick a dog-friendly table.`)}}o&&c.push(`Bookings are paused ${o.from} to ${o.to}${o.reason?` (${o.reason})`:''}.`);return c},Object.defineProperty(_e,"editedWords",{enumerable:!0,get:function(){return M}}),_e.bookingExtras=function(e){const t=e,a=e.dogs??(e.dog?1:0),s=[];a&&s.push(O(a,'dog','dogs'));t.highChairs&&s.push(O(t.highChairs,'high chair','high chairs'));e.access?.wheelchair&&s.push(O(e.access.wheelchair,'wheelchair','wheelchairs'));e.diet?.vegan&&s.push(`${e.diet.vegan} vegan`);e.diet?.vegetarian&&s.push(`${e.diet.vegetarian} vegetarian`);e.occasion&&s.push(e.occasion.charAt(0).toUpperCase()+e.occasion.slice(1));t.area&&s.push(t.area);t.depositMethod&&(e.depositPaid??0)>0&&s.push(`Deposit by ${t.depositMethod}`);return s.join(' \xb7 ')};var e=r(_d[0]),t=r(_d[1]);const a='For example: birthday, high chair, dog, window seat',s='This booking came from the website. Changes here are not sent to website bookings yet.',o='Message the guest about the new date, time or status (website bookings sends it)',n=e=>e.filter(e=>'date'===e||'time'===e||'status'===e);const d=e=>{const t=e;return'Wix'===t.importedFrom||!!t.wix||(e.tags??[]).includes('Wix')},c=['date','time','partySize','name','phone','email','notes','table','area','dogs','highChairs','wheelchair','occasion','allergies','diet','deposit','status','source','tags','duration'],u=['card','cash','bank transfer','website','other'],l=[{id:'pending',label:'Needs confirming'},{id:'confirmed',label:'Confirmed'},{id:'seated',label:'Seated'},{id:'finished',label:'Finished'},{id:'noshow',label:'No-show'}],h=[{id:'phone',label:'Phone'},{id:'in-person',label:'In person'},{id:'online',label:'Online'}],p=[{id:'',label:'None'},{id:'birthday',label:'Birthday'},{id:'anniversary',label:'Anniversary'},{id:'celebration',label:'Celebration'}],b=['VIP','Regular'],f={date:'date',time:'time',partySize:'covers',name:'name',phone:'phone',email:'email',notes:'notes',table:'table',area:'area',dogs:'dogs',highChairs:'high chairs',wheelchair:'wheelchairs',occasion:'occasion',allergies:'allergies',diet:'dietary',deposit:'deposit',status:'status',source:'source',tags:'tags',duration:'table time'},y=e=>{const t=e;return{date:e.date,time:e.time,partySize:e.partySize,name:e.name,phone:e.phone??'',email:e.email??'',notes:e.notes??'',table:e.table??'',area:t.area??'',dogs:e.dogs??(e.dog?1:0),highChairs:t.highChairs??0,wheelchair:e.access?.wheelchair??0,occasion:e.occasion??'',allergies:e.allergies??[],allergyNone:!!e.allergyNone,allergyNote:e.allergyNote??'',vegan:e.diet?.vegan??0,vegetarian:e.diet?.vegetarian??0,depositOn:'deposit'===e.security||(e.depositDue??0)>0||(e.depositPaid??0)>0,depositPaid:(e.depositPaid??0)>0&&!!e.depositPaidBy,depositAmount:(e.depositPaid??0)>0?e.depositPaid:e.depositDue??0,depositMethod:t.depositMethod??'',depositDate:(a=e.depositPaidAt,a?a.slice(0,10):''),depositDue:e.depositDue??0,status:e.status,source:e.source??'',tags:[...e.tags??[]].filter(e=>b.includes(e)).sort(),duration:e.durationMins??0};var a},$=e=>JSON.stringify([[...e.allergies??[]].map(e=>`${e.allergen}:${e.severity}`).sort(),!!e.allergyNone,(e.allergyNote??'').trim()]),v=e=>JSON.stringify(e.depositOn?[!0,!!e.depositPaid,Number(e.depositAmount??0),Number(e.depositDue??0),e.depositPaid?e.depositMethod??'':'',e.depositPaid?e.depositDate??'':'']:[!1]);function P(e,t){switch(e){case'partySize':return Number(t.partySize);case'allergies':return $(t);case'diet':return`${Number(t.vegan??0)}/${Number(t.vegetarian??0)}`;case'deposit':return v(t);case'tags':return[...t.tags??[]].sort().join(',');case'dogs':case'highChairs':case'wheelchair':case'duration':return Number(t[e]??0);default:return String(t[e]??'').trim()}}function N(e,t){const a=y(e);return c.filter(e=>P(e,a)!==P(e,t))}const S=e=>`\xa3${(e/100).toFixed(e%100?2:0)}`,w=e=>{const t=new Date(e);return`${String(t.getHours()).padStart(2,'0')}:${String(t.getMinutes()).padStart(2,'0')}`},O=(e,t,a)=>`${e} ${1===e?t:a}`;function k(e,t,a,s,o){const n=y(e),d=[];for(const e of[...a].sort((e,t)=>Number('deposit'===t)-Number('deposit'===e)))'deposit'===e?t.depositOn?t.depositPaid&&!n.depositPaid?d.push(`deposit marked paid (${S(Number(t.depositAmount??0))}${t.depositMethod?`, ${t.depositMethod}`:''})`):!t.depositPaid&&n.depositPaid?d.push('deposit marked not paid'):d.push(t.depositPaid?`deposit changed (${S(Number(t.depositAmount??0))}${t.depositMethod?`, ${t.depositMethod}`:''})`:`deposit due ${S(Number(t.depositDue??0))}`):d.push('deposit taken off'):'dogs'===e?d.push(!n.dogs&&t.dogs?1===t.dogs?'dog added':`${t.dogs} dogs added`:t.dogs?O(Number(t.dogs),'dog','dogs'):'no dog now'):'highChairs'===e?d.push(t.highChairs?O(Number(t.highChairs),'high chair','high chairs'):'no high chair now'):'wheelchair'===e?d.push(t.wheelchair?O(Number(t.wheelchair),'wheelchair user','wheelchair users'):'no wheelchair now'):'partySize'===e?d.push(`covers ${n.partySize} to ${t.partySize}`):'time'===e?d.push(`time ${n.time} to ${t.time}`):'date'===e?d.push(`date ${n.date} to ${t.date}`):'table'===e?d.push(t.table?`table ${t.table}`:'table taken off'):'status'===e?d.push(`status ${l.find(e=>e.id===t.status)?.label.toLowerCase()??t.status}`):'occasion'===e?d.push(t.occasion?`occasion ${t.occasion}`:'occasion taken off'):'area'===e?d.push(t.area?`area ${t.area}`:'any area'):'duration'===e?d.push(t.duration?`table time ${t.duration} min`:'table time as usual'):d.push(`${f[e]} changed`);const c=d.join(', ');return`${c.charAt(0).toUpperCase()}${c.slice(1)} by ${s} ${w(o)}`}const M=e=>e.map(e=>f[e]).join(', ')},1111,[1098,1092]); __d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"canCancelWalkIn",{enumerable:!0,get:function(){return y}}),Object.defineProperty(_e,"canReinstateWalkIn",{enumerable:!0,get:function(){return h}}),_e.cancelWalkInWords=x,_e.reinstateWalkInWords=p,_e.cancelWalkInNow=$,_e.reinstateWalkInNow=I,_e.CancelWalkInButton=function({rid:e,b:t,onDone:l,small:s,big:o}){const[c,u]=(0,n.useState)(!1);return y(t)?(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(f.Button,{kind:"secondary",small:s,label:"Cancel walk-in",testID:`cancel-walkin-${t.id}`,accessibilityLabel:`Cancel walk-in ${t.ref}, ${t.partySize} Covers`,onPress:()=>u(!0),style:o?{minHeight:64}:s?{minHeight:44}:w}),c?(0,k.jsx)(j,{rid:e,b:t,onClose:()=>u(!1),onDone:l}):null]}):null},_e.CancelWalkInConfirm=j,_e.ReinstateWalkInButton=function({rid:e,b:t,today:l,onDone:o,small:c}){const[u,y]=(0,n.useState)(!1);if(!h(t,l))return null;const x=p(t);if(!u)return(0,k.jsx)(f.Button,{kind:"ghost",small:c,label:"Undo cancel",testID:`reinstate-walkin-${t.id}`,accessibilityLabel:`Undo cancel for walk-in ${t.ref}`,onPress:()=>y(!0),style:c?{minHeight:44}:w});return(0,k.jsxs)(f.Sheet,{visible:!0,onClose:()=>y(!1),title:"Undo cancel?",maxWidth:560,testID:"reinstate-walkin-confirm",children:[(0,k.jsx)(s.default,{accessible:!0,accessibilityLabel:x,children:(0,k.jsx)(f.T,{size:18,colour:b.colours.text,children:x})}),(0,k.jsxs)(f.Row,{gap:8,wrap:!0,children:[(0,k.jsx)(f.Button,{label:"Yes, put back to seated",testID:"reinstate-walkin-yes",accessibilityLabel:`Yes, put walk-in ${t.ref} back to seated`,style:[w,{flexGrow:1}],onPress:async()=>{await I(e,t),y(!1),o?.(`Walk-in ${t.ref} put back to seated.`)}}),(0,k.jsx)(f.Button,{kind:"secondary",label:"Keep cancelled",testID:"reinstate-walkin-no",onPress:()=>y(!1),style:w})]})]})};var e,t=r(d[0]),n=r(d[1]),l=r(d[2]),s=(e=l)&&e.__esModule?e:{default:e},o=r(d[3]),c=r(d[4]),u=r(d[5]),b=r(d[6]),f=r(d[7]),k=r(d[8]);const w={minHeight:56},y=e=>!!e.walkIn&&('seated'===e.status||'confirmed'===e.status),h=(e,t)=>!!e.walkIn&&'cancelled'===e.status&&e.date>=t;function x(e){const t=(0,c.tablesOf)(e.table),n=(0,u.tablesWords)(t);return`Cancel walk-in ${e.ref}, ${e.partySize} Covers${t.length?` at ${n}`:''}, arrived ${e.time}? It comes off the Covers${t.length?` and ${n} ${t.length>1?'go':'goes'} back to Free`:''}.`}function p(e){return`Put walk-in ${e.ref} back to seated? CoverCharge only \u2014 if it was cancelled on the website, put it back there too if needed.`}async function $(e,n){await o.repo.bookings.setStatus(n.id,'cancelled'),await o.repo.bookings.update(n.id,{cancelled:(0,t.cancelStamp)(n)}),(0,c.tablesOf)(n.table).forEach(t=>c.useFloor.getState().setLive(e,t,{stage:void 0,dirty:!1}))}async function I(e,t){await o.repo.bookings.setStatus(t.id,'seated'),(0,c.tablesOf)(t.table).forEach(t=>c.useFloor.getState().setLive(e,t,{stage:'seated',dirty:!1}))}function j({rid:e,b:t,onClose:n,onDone:l}){const o=x(t);return(0,k.jsxs)(f.Sheet,{visible:!0,onClose:n,title:"Cancel walk-in?",maxWidth:560,testID:"cancel-walkin-confirm",children:[(0,k.jsx)(s.default,{accessible:!0,accessibilityLabel:o,children:(0,k.jsx)(f.T,{size:18,colour:b.colours.text,children:o})}),(0,k.jsxs)(f.Row,{gap:8,wrap:!0,children:[(0,k.jsx)(f.Button,{label:"Yes, cancel walk-in",testID:"cancel-walkin-yes",accessibilityLabel:`Yes, cancel walk-in ${t.ref}`,style:[w,{flexGrow:1}],onPress:async()=>{await $(e,t),n(),l?.(`Walk-in ${t.ref} cancelled.${(0,c.tablesOf)(t.table).length?` ${(0,u.tablesWords)((0,c.tablesOf)(t.table))} free.`:''}`)}}),(0,k.jsx)(f.Button,{kind:"secondary",label:"Keep walk-in",testID:"cancel-walkin-no",accessibilityLabel:`Keep walk-in ${t.ref}`,onPress:n,style:w})]})]})}},1112,[1113,34,102,848,1014,1095,840,794,25]); __d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.cancelStamp=C,_e.cancelBookingNow=w,_e.reinstateBookingNow=$,_e.CancelBookingButton=function({rid:e,b:n,name:o,onDone:s,big:l,small:c}){const[u,f]=(0,t.useState)(!1);return(0,b.canCancelBooking)(n)?(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(x.Button,{kind:"secondary",small:c,label:"Cancel booking",testID:`cancel-booking-${n.id}`,accessibilityLabel:`Cancel booking for ${o}, ${n.time}, ${n.partySize} Covers`,onPress:()=>f(!0),style:l?{minHeight:64}:c?{minHeight:44}:j}),u?(0,h.jsx)(D,{rid:e,b:n,name:o,onClose:()=>f(!1),onDone:s}):null]}):null},_e.CancelBookingConfirm=D,_e.ReinstateBookingButton=function({b:e,name:n,today:s,onDone:l}){const[c,u]=(0,t.useState)(!1);if(!(0,b.canReinstateBooking)(e,s))return null;const y=(0,b.reinstateBookingWords)(e,n);if(!c)return(0,h.jsx)(x.Button,{kind:"ghost",label:"Undo cancel",testID:`reinstate-booking-${e.id}`,accessibilityLabel:`Undo cancel for ${n}`,onPress:()=>u(!0),style:j});return(0,h.jsxs)(x.Sheet,{visible:!0,onClose:()=>u(!1),title:"Undo cancel?",maxWidth:560,testID:"reinstate-booking-confirm",children:[(0,h.jsx)(o.default,{accessible:!0,accessibilityLabel:y,style:{alignItems:'center'},children:(0,h.jsx)(x.T,{size:18,colour:f.colours.text,style:{textAlign:'center'},children:y})}),(0,h.jsxs)(x.Row,{gap:8,wrap:!0,style:{justifyContent:'center'},children:[(0,h.jsx)(x.Button,{label:"Yes, put back to booked",testID:"reinstate-booking-yes",accessibilityLabel:`Yes, put ${n} back to booked`,style:[j,{flexGrow:1}],onPress:async()=>{await $(e),u(!1),l?.(`${n} put back to booked.`)}}),(0,h.jsx)(x.Button,{kind:"secondary",label:"Keep cancelled",testID:"reinstate-booking-no",onPress:()=>u(!1),style:j})]})]})};var e,t=r(d[0]),n=r(d[1]),o=(e=n)&&e.__esModule?e:{default:e},s=r(d[2]),l=r(d[3]),c=r(d[4]),b=r(d[5]),u=r(d[6]),f=r(d[7]),y=r(d[8]),k=r(d[9]),p=r(d[10]),x=r(d[11]),h=r(d[12]);const j={minHeight:56},B={display:'Display',owner:'Managers app',staff:'Staff app',chef:'Kitchen app',customer:'Customer page'};function C(e){const t=y.useSession.getState().meId,n=t?k.useOwner.getState().staff.find(e=>e.id===t):void 0,o=B[p.APP_VARIANT]??'CoverCharge';return{by:n?`${n.name.replace(' (example)','')} (${o})`:o,at:(new Date).toISOString(),app:o,...e.table?{table:e.table}:{}}}async function w(e,t){const n=(0,l.tablesOf)(t.table);await s.repo.bookings.update(t.id,{status:'cancelled',cancelled:C(t),...(0,c.tablePatch)(null)}),n.forEach(t=>l.useFloor.getState().setLive(e,t,{stage:void 0,dirty:!1}))}async function $(e){await s.repo.bookings.setStatus(e.id,'confirmed')}function D({rid:e,b:t,name:n,onClose:s,onDone:c}){const y=(0,b.cancelBookingWords)(t,n),k=(0,l.tablesOf)(t.table);return(0,h.jsxs)(x.Sheet,{visible:!0,onClose:s,title:"Cancel booking?",maxWidth:560,testID:"cancel-booking-confirm",children:[(0,h.jsx)(o.default,{accessible:!0,accessibilityLabel:y,style:{alignItems:'center',gap:8},children:(0,h.jsx)(x.T,{size:18,colour:f.colours.text,style:{textAlign:'center'},children:y})}),(0,h.jsxs)(x.Row,{gap:8,wrap:!0,style:{justifyContent:'center'},children:[(0,h.jsx)(x.Button,{label:"Yes, cancel booking",testID:"cancel-booking-yes",accessibilityLabel:`Yes, cancel booking for ${n}`,style:[j,{flexGrow:1}],onPress:async()=>{await w(e,t),s(),c?.(`${n} cancelled.${k.length?` ${(0,u.tablesWords)(k)} free.`:''}`)}}),(0,h.jsx)(x.Button,{kind:"secondary",label:"Keep booking",testID:"cancel-booking-no",accessibilityLabel:`Keep booking for ${n}`,onPress:s,style:j})]})]})}},1113,[34,102,848,1014,1092,1114,1095,840,997,865,846,794,25]); __d(function(g,r,i,_a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"canCancelBooking",{enumerable:!0,get:function(){return n}}),Object.defineProperty(e,"canReinstateBooking",{enumerable:!0,get:function(){return t}}),e.cancelBookingWords=function(n,t){const o=`${n.partySize} Cover${1===n.partySize?'':'s'}`;return`Cancel booking for ${t}, ${n.time}, ${o}? The table is freed. Website bookings will cancel it on the website and may email the guest.`},e.reinstateBookingWords=function(n,t){return`Put ${t} back to booked for ${n.time}? CoverCharge only \u2014 if it was cancelled on the website, put it back there too if needed.`},e.cancelledOnDay=o,e.cancelledDayTally=function(n,t){const a=o(n,t),l=a.filter(n=>!!n.walkIn),c=a.filter(n=>!n.walkIn);return{count:a.length,covers:a.reduce((n,t)=>n+t.partySize,0),bookings:c.length,bookingCovers:c.reduce((n,t)=>n+t.partySize,0),walkIns:l.length,walkInCovers:l.reduce((n,t)=>n+t.partySize,0),list:a}},e.cancelledTallyWords=function(n,t="today"){if(!n.count)return`No cancellations ${t}`;const o=[],a=n.bookings??0,l=n.walkIns??0;a&&o.push(`${a} booking${1===a?'':'s'} (${n.bookingCovers??0} Cover${1===(n.bookingCovers??0)?'':'s'})`);l&&o.push(`${l} walk-in${1===l?'':'s'} (${n.walkInCovers??0} Cover${1===(n.walkInCovers??0)?'':'s'})`);if(!o.length)return`Cancelled ${t}: ${n.count} \xb7 ${n.covers} Cover${1===n.covers?'':'s'}`;return`Cancelled ${t}: ${o.join(' \xb7 ')}`};const n=n=>!n.walkIn&&('confirmed'===n.status||'pending'===n.status||'seated'===n.status),t=(n,t)=>!n.walkIn&&'cancelled'===n.status&&n.date>=t;function o(n,t){return n.filter(n=>n.date===t&&'cancelled'===n.status).sort((n,t)=>n.time.localeCompare(t.time)||n.name.localeCompare(t.name))}},1114,[]); -__d(function(g,_r,i,_a,_m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.BookingEditButton=function({rid:e,booking:a,who:n,role:o,inStaffApp:l,shiftManager:s,big:d,testID:r}){const[u,b]=(0,t.useState)(!1);return a.walkIn||!(0,h.canEditBooking)({variant:c.APP_VARIANT,inStaffApp:l,role:o,shiftManager:s})?null:(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(k.Button,{kind:"secondary",small:!d,label:"Edit booking",testID:r??`edit-booking-${a.id}`,accessibilityLabel:`Edit booking, ${a.name}, ${a.time}`,onPress:()=>b(!0),style:{minHeight:d?64:44}}),u?(0,j.jsx)(C,{rid:e,id:a.id,who:n,onClose:()=>b(!1)}):null]})},_e.EditBookingPicker=function({rid:e,today:a,who:n,onClose:o,hidePrivate:s}){const[d,r]=(0,t.useState)(null),c=(0,l.useBookings)(e).filter(e=>!e.walkIn&&e.date>=a&&!['cancelled','noshow','finished'].includes(e.status)).sort((e,t)=>e.date.localeCompare(t.date)||e.time.localeCompare(t.time)).slice(0,60);return d?(0,j.jsx)(C,{rid:e,id:d,who:n,hidePrivate:s,onClose:o}):(0,j.jsxs)(k.Sheet,{visible:!0,onClose:o,title:"Edit booking \xb7 pick a booking",maxWidth:640,testID:"edit-booking-picker",children:[(0,j.jsx)(k.T,{size:16,colour:b.colours.text,children:"Tip: tap the booking you want to change."}),c.length?c.map(e=>(0,j.jsx)(k.Button,{kind:"secondary",testID:`edit-pick-${e.id}`,label:`${e.date===a?'Today':e.date} ${e.time} \xb7 ${e.name} \xb7 ${e.partySize} ${1===e.partySize?'Cover':'Covers'}`,sub:e.notes?`Notes: ${e.notes}`:void 0,accessibilityLabel:`Edit booking, ${e.name}, ${e.date===a?'today':e.date}, ${e.time}, ${e.partySize} Covers`,onPress:()=>r(e.id),style:{minHeight:56,alignItems:'flex-start'}},e.id)):(0,j.jsx)(k.Muted,{children:"No bookings to edit from today on."}),(0,j.jsx)(k.Button,{kind:"ghost",label:"Close",onPress:o,style:{minHeight:44}})]})},_e.EditBookingSheet=C;var e,t=_r(_d[0]),a=_r(_d[1]),n=_r(_d[2]),o=(e=n)&&e.__esModule?e:{default:e},l=_r(_d[3]),s=_r(_d[4]),d=_r(_d[5]),r=_r(_d[6]),c=_r(_d[7]),h=_r(_d[8]),u=_r(_d[9]),b=_r(_d[10]),m=_r(_d[11]),p=_r(_d[12]),x=_r(_d[13]),y=_r(_d[14]),k=_r(_d[15]),j=_r(_d[16]);const f=/^([01]\d|2[0-3]):[0-5]\d$/,v=e=>{const t=e.trim().replace('.',':').match(/^(\d{1,2}):?(\d{2})$/);return t?`${t[1].padStart(2,'0')}:${t[2]}`:e.trim()};function C({rid:e,id:n,who:C,onClose:T,hidePrivate:I='display'===c.APP_VARIANT}){const B=(0,l.useBookings)(e),D=B.find(e=>e.id===n),P=(0,r.useRestaurant)(e),$=(0,s.usePlan)(e),S=(0,d.useBlocks)(e=>e.blocks),[w,E]=(0,t.useState)(D?(0,h.draftOf)(D):null),[z,A]=(0,t.useState)(null),[L,_]=(0,t.useState)(null);if(!D||!w||!P)return null;const F=e=>{A(null),_(null),E({...w,...e})},N=v(w.time),W=f.test(N),R=(0,u.tableOptions)($,B.filter(e=>e.date===w.date),w.table),M=(0,h.changedFields)(D,{...w,time:N}),O=P.settings.turnMins??90,H=async()=>{const t=(0,h.editPatch)(D,{...w,time:N},{by:C||'Team member',app:c.APP_VARIANT});if(Object.keys(t).length&&await l.repo.bookings.update(D.id,t),'seated'===D.status&&'table'in t&&t.table!==D.table){const a=e=>e?e.split('+').map(e=>e.trim()).filter(Boolean):[],n=a(D.table),o=a(t.table),l=s.useFloor.getState(),d=n.map(t=>l.live[e]?.[t]?.stage).find(Boolean)??'seated';n.filter(e=>!o.includes(e)).forEach(t=>l.setLive(e,t,{stage:void 0,dirty:!0})),o.forEach(t=>l.setLive(e,t,{stage:d,dirty:!1}))}_(`Saved. Changed: ${(0,h.editedWords)(M)}.`),A(null),T()};return(0,j.jsxs)(k.Sheet,{visible:!0,onClose:T,title:`Edit booking \xb7 ${D.name} \xb7 ${D.ref}`,maxWidth:760,testID:"edit-booking-sheet",children:[(0,j.jsx)(x.DepositChip,{b:D,money:!0,big:!0,testID:"edit-deposit"}),(0,h.isWixBooking)(D)?(0,j.jsx)(o.default,{testID:"edit-wix-note",accessible:!0,accessibilityLabel:h.WIX_EDIT_NOTE,style:{padding:12,borderRadius:12,borderWidth:1,borderColor:b.colours.gold},children:(0,j.jsx)(k.T,{size:16,colour:b.colours.goldLight,children:h.WIX_EDIT_NOTE})}):null,(0,j.jsx)(k.T,{size:16,colour:b.colours.text,children:"Tip: change what you need, then press Save changes."}),(0,j.jsx)(p.BookingDatePicker,{r:P,today:new Date,value:w.date,onChange:e=>F({date:e})}),(0,j.jsx)(k.Field,{label:"Time (24-hour, for example 19:30)",value:w.time,onChangeText:e=>F({time:e}),testID:"edit-time"}),W?null:(0,j.jsx)(k.T,{size:15,colour:b.colours.amber,children:"Write the time like 19:30."}),(0,j.jsxs)(o.default,{style:{gap:6,alignItems:'center'},children:[(0,j.jsx)(k.T,{size:18,center:!0,children:"Covers"}),(0,j.jsx)(a.PartySizeInput,{value:w.partySize,onChange:e=>F({partySize:e}),label:"Covers",testID:"edit-covers"})]}),(0,j.jsx)(k.Field,{label:"Name",value:w.name,onChangeText:e=>F({name:e}),testID:"edit-name"}),I?(0,j.jsx)(k.Muted,{children:"Phone and email can be changed in the Managers app; the Display never shows them."}):(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(k.Field,{label:"Phone",value:w.phone,onChangeText:e=>F({phone:e}),keyboardType:"phone-pad",testID:"edit-phone"}),(0,j.jsx)(k.Field,{label:"Email",value:w.email,onChangeText:e=>F({email:e}),keyboardType:"email-address",autoCapitalize:"none",testID:"edit-email"})]}),(0,j.jsx)(k.Field,{label:"Notes",value:w.notes,onChangeText:e=>F({notes:e}),placeholder:h.NOTES_PLACEHOLDER,multiline:!0,numberOfLines:3,testID:"edit-notes"}),D.allergies.length||D.allergyNote?(0,j.jsx)(k.Muted,{children:"Allergies are kept separately and are not changed here."}):null,(0,j.jsx)(k.T,{size:18,weight:"semibold",children:(0,u.tableButtonLabel)(w.table)}),(0,j.jsxs)(k.Row,{gap:8,wrap:!0,children:[(0,j.jsx)(k.Button,{kind:w.table?'secondary':'primary',label:"No table",accessibilityLabel:"No table"+(w.table?'':', chosen'),onPress:()=>F({table:''}),style:{minHeight:44,minWidth:96},testID:"edit-table-none"}),R.map(e=>(0,j.jsx)(k.Button,{kind:e===w.table?'primary':'secondary',label:(0,u.tableButtonLabel)(e),accessibilityLabel:`Table ${(0,u.tableButtonLabel)(e)}${e===w.table?', chosen':''}`,onPress:()=>F({table:e}),style:{minHeight:44,minWidth:64},testID:`edit-table-${e}`},e))]}),z?(0,j.jsxs)(o.default,{testID:"edit-warn",style:{gap:8,padding:12,borderRadius:12,borderWidth:1.5,borderColor:b.colours.amber,backgroundColor:b.colours.amberBg},children:[z.map(e=>(0,j.jsx)(k.T,{size:16,colour:"#FFE2A8",children:e},e)),(0,j.jsx)(k.T,{size:16,colour:"#FFE2A8",children:"You can still save."})]}):null,L?(0,j.jsx)(k.T,{size:16,colour:b.colours.goldLight,children:L}):null,(0,j.jsxs)(k.Row,{gap:8,wrap:!0,children:[(0,j.jsx)(k.Button,{label:z?'Save anyway':'Save changes',testID:"edit-save",disabled:!W||w.name.trim().length<1||!M.length,onPress:()=>{const t=W?(0,d.blockAt)(S,e,w.date,N):void 0,a=(0,h.editWarnings)(D,{...w,time:N},B,t,O);!a.length||z?H():A(a)},style:{minHeight:56,flex:1}}),(0,j.jsx)(k.Button,{kind:"ghost",label:"Close",onPress:T,style:{minHeight:56}})]}),(0,j.jsx)(y.CancelBookingButton,{rid:e,b:D,name:D.name,big:!0,onDone:()=>T()}),(0,j.jsx)(y.ReinstateBookingButton,{b:D,name:D.name,today:(0,m.ymd)(new Date),onDone:()=>T()})]})}},1115,[34,1097,102,848,1014,1011,850,846,1111,1092,840,827,1105,1089,1113,794,25]); +__d(function(g,_r,_i,_a,_m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.BookingEditButton=function({rid:e,booking:s,who:i,role:a,inStaffApp:n,shiftManager:l,big:o,testID:d}){const[h,m]=(0,t.useState)(!1),x=(0,u.useSession)(e=>e.meId),j=(0,p.useOwner)(e=>e.staff.find(e=>e.id===x&&e.active));return s.walkIn||!(0,c.canEditBooking)({variant:r.APP_VARIANT,inStaffApp:n,role:a,shiftManager:l})||x&&!(0,b.canChangeBookings)(j)?null:(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(C.Button,{kind:"secondary",small:!o,label:"Edit booking",sub:o?void 0:"Deposit, dog, table, anything",testID:d??`edit-booking-${s.id}`,accessibilityLabel:`Edit booking, ${s.name}, ${s.time}`,onPress:()=>m(!0),style:{minHeight:o?64:44}}),h?(0,f.jsx)(B,{rid:e,id:s.id,who:i,onClose:()=>m(!1)}):null]})},_e.EditBookingPicker=function({rid:e,today:s,who:i,onClose:a,hidePrivate:l}){const[o,d]=(0,t.useState)(null),r=(0,n.useBookings)(e).filter(e=>!e.walkIn&&e.date>=s&&!['cancelled','noshow','finished'].includes(e.status)).sort((e,t)=>e.date.localeCompare(t.date)||e.time.localeCompare(t.time)).slice(0,60);return o?(0,f.jsx)(B,{rid:e,id:o,who:i,hidePrivate:l,onClose:a}):(0,f.jsxs)(C.Sheet,{visible:!0,onClose:a,title:"Edit booking \xb7 pick a booking",maxWidth:640,testID:"edit-booking-picker",children:[(0,f.jsx)(C.T,{size:16,colour:x.colours.text,children:"Tip: tap the booking you want to change."}),r.length?r.map(e=>(0,f.jsx)(C.Button,{kind:"secondary",testID:`edit-pick-${e.id}`,label:`${e.date===s?'Today':e.date} ${e.time} \xb7 ${e.name} \xb7 ${e.partySize} ${1===e.partySize?'Cover':'Covers'}`,sub:e.notes?`Notes: ${e.notes}`:void 0,accessibilityLabel:`Edit booking, ${e.name}, ${e.date===s?'today':e.date}, ${e.time}, ${e.partySize} Covers`,onPress:()=>d(e.id),style:{minHeight:56,alignItems:'flex-start'}},e.id)):(0,f.jsx)(C.Muted,{children:"No bookings to edit from today on."}),(0,f.jsx)(C.Button,{kind:"ghost",label:"Close",onPress:a,style:{minHeight:44}})]})},_e.EditBookingSheet=B;var e,t=_r(_d[0]),s=_r(_d[1]),i=_r(_d[2]),a=(e=i)&&e.__esModule?e:{default:e},n=_r(_d[3]),l=_r(_d[4]),o=_r(_d[5]),d=_r(_d[6]),r=_r(_d[7]),c=_r(_d[8]),h=_r(_d[9]),u=_r(_d[10]),p=_r(_d[11]),b=_r(_d[12]),m=_r(_d[13]),x=_r(_d[14]),j=_r(_d[15]),y=_r(_d[16]),D=_r(_d[17]),I=_r(_d[18]),C=_r(_d[19]),f=_r(_d[20]);const T=/^([01]\d|2[0-3]):[0-5]\d$/,v=e=>{const t=e.trim().replace('.',':').match(/^(\d{1,2}):?(\d{2})$/);return t?`${t[1].padStart(2,'0')}:${t[2]}`:e.trim()};const w=e=>e?(e/100).toFixed(e%100?2:0):'',k=e=>{const t=Number(e.replace(/[\xa3,\s]/g,''));return Number.isFinite(t)&&t>=0?Math.round(100*t):NaN},S=e=>e&&/^\d{4}-\d{2}-\d{2}$/.test(e)?`${e.slice(8,10)}/${e.slice(5,7)}/${e.slice(0,4)}`:'',P=e=>{const t=e.trim().match(/^(\d{1,2})\/(\d{1,2})\/(\d{4})$/);return t?`${t[3]}-${t[2].padStart(2,'0')}-${t[1].padStart(2,'0')}`:''},$=e=>e.charAt(0).toUpperCase()+e.slice(1);function N({title:e,children:t,testID:s}){return(0,f.jsxs)(a.default,{testID:s,style:{gap:8,paddingTop:10,borderTopWidth:1,borderTopColor:x.colours.hairline,alignItems:'stretch'},children:[(0,f.jsx)(C.T,{size:17,weight:"semibold",center:!0,colour:x.colours.goldLight,children:e}),t]})}const E=({label:e,value:t,onChange:s,max:i=20,testID:a})=>(0,f.jsxs)(C.Row,{style:{justifyContent:'space-between',alignItems:'center'},children:[(0,f.jsx)(C.T,{size:16,children:e}),(0,f.jsx)(C.Stepper,{testID:a,value:t,min:0,max:i,onChange:s,label:e})]});function B({rid:e,id:i,who:u,onClose:p,hidePrivate:b='display'===r.APP_VARIANT}){const B=(0,n.useBookings)(e),O=B.find(e=>e.id===i),z=(0,d.useRestaurant)(e),A=(0,l.usePlan)(e),R=(0,o.useBlocks)(e=>e.blocks),[L,F]=(0,t.useState)(O?(0,c.draftOf)(O):null),[W,M]=(0,t.useState)(null),[_,H]=(0,t.useState)(null),[V,G]=(0,t.useState)(w(O?(0,c.draftOf)(O).depositDue:0)),[U,X]=(0,t.useState)(w(O?(0,c.draftOf)(O).depositAmount:0)),[Y,q]=(0,t.useState)(S(O?(0,c.draftOf)(O).depositDate:'')),[J,K]=(0,t.useState)(!1);if(!O||!L||!z)return null;const Q=e=>{M(null),H(null),F({...L,...e})},Z=v(L.time),ee=T.test(Z),te=L.area?A.areas.filter(e=>e.name===L.area).map(e=>e.id):null,se=e=>!te||e.split('+').every(e=>te.includes(A.tables.find(t=>t.name===e)?.areaId??'')),ie=(0,m.tableOptions)(A,B.filter(e=>e.date===L.date),L.table).filter(e=>se(e)||e===L.table),ae=!(L.depositOn&&(Number.isNaN(k(V||'0'))||L.depositPaid&&(Number.isNaN(k(U||'0'))||Y.trim()&&!P(Y)))),ne={...L,time:Z,depositDue:k(V||'0')||0,depositAmount:k(U||'0')||0,depositDate:P(Y)},le=(0,c.changedFields)(O,ne),oe=z.settings.turnMins??90,de=async()=>{const t=(0,c.editPatch)(O,ne,{by:u||'Team member',app:r.APP_VARIANT,notify:J&&(0,c.isWixBooking)(O)});if(Object.keys(t).length&&await n.repo.bookings.update(O.id,t),'seated'===O.status&&'table'in t&&t.table!==O.table){const s=e=>e?e.split('+').map(e=>e.trim()).filter(Boolean):[],i=s(O.table),a=s(t.table),n=l.useFloor.getState(),o=i.map(t=>n.live[e]?.[t]?.stage).find(Boolean)??'seated';i.filter(e=>!a.includes(e)).forEach(t=>n.setLive(e,t,{stage:void 0,dirty:!0})),a.forEach(t=>n.setLive(e,t,{stage:o,dirty:!1}))}H(`Saved. Changed: ${(0,c.editedWords)(le)}.`),M(null),p()},re=L.allergies??[],ce=e=>Q({allergyNone:!1,allergies:re.some(t=>t.allergen===e)?re.filter(t=>t.allergen!==e):[...re,{allergen:e,severity:'allergy'}]}),he=(0,c.historyLines)(O);return(0,f.jsxs)(C.Sheet,{visible:!0,onClose:p,title:`Edit booking \xb7 ${O.name} \xb7 ${O.ref}`,maxWidth:760,testID:"edit-booking-sheet",children:[(0,f.jsx)(a.default,{style:{alignItems:'center'},children:(0,f.jsx)(D.DepositChip,{b:O,money:!0,big:!0,testID:"edit-deposit"})}),(0,c.isWixBooking)(O)?(0,f.jsx)(a.default,{testID:"edit-wix-note",accessible:!0,accessibilityLabel:c.WIX_EDIT_NOTE,style:{padding:12,borderRadius:12,borderWidth:1,borderColor:x.colours.gold},children:(0,f.jsx)(C.T,{size:16,center:!0,colour:x.colours.goldLight,children:c.WIX_EDIT_NOTE})}):null,(0,f.jsx)(C.T,{size:16,center:!0,colour:x.colours.text,children:"Tip: change what you need, then press Save changes. Saving doesn\u2019t message the guest."}),(0,f.jsxs)(N,{title:"Deposit",testID:"edit-section-deposit",children:[(0,f.jsxs)(C.Row,{wrap:!0,gap:6,style:{justifyContent:'center'},children:[(0,f.jsx)(C.Chip,{label:"No deposit",selected:!L.depositOn,testID:"edit-deposit-none",onPress:()=>Q({depositOn:!1,depositPaid:!1})}),(0,f.jsx)(C.Chip,{label:"Deposit due",selected:!!L.depositOn&&!L.depositPaid,testID:"edit-deposit-due",onPress:()=>Q({depositOn:!0,depositPaid:!1})}),(0,f.jsx)(C.Chip,{label:"Deposit paid",selected:!!L.depositOn&&!!L.depositPaid,testID:"edit-deposit-paid",onPress:()=>{U||X(V),Y||q(S((0,j.ymd)(new Date))),Q({depositOn:!0,depositPaid:!0})}})]}),L.depositOn?(0,f.jsx)(C.Field,{label:"Deposit due (\xa3)",value:V,onChangeText:e=>{G(e),Q({})},keyboardType:"decimal-pad",testID:"edit-deposit-due-amount"}):null,L.depositOn&&L.depositPaid?(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(C.Field,{label:"Amount paid (\xa3)",value:U,onChangeText:e=>{X(e),Q({})},keyboardType:"decimal-pad",testID:"edit-deposit-amount"}),(0,f.jsx)(C.T,{size:16,center:!0,children:"How was it paid?"}),(0,f.jsx)(C.Row,{wrap:!0,gap:6,style:{justifyContent:'center'},children:c.DEPOSIT_METHODS.map(e=>(0,f.jsx)(C.Chip,{label:$(e),selected:L.depositMethod===e,testID:`edit-deposit-method-${e.replace(' ','-')}`,onPress:()=>Q({depositMethod:e})},e))}),(0,f.jsx)(C.Field,{label:"Date paid (for example 11/11/2026)",value:Y,onChangeText:e=>{q(e),Q({})},testID:"edit-deposit-date"}),Y.trim()&&!P(Y)?(0,f.jsx)(C.T,{size:15,center:!0,colour:x.colours.amber,children:"Write the date like 11/11/2026."}):null]}):null,ae?null:(0,f.jsx)(C.T,{size:15,center:!0,colour:x.colours.amber,children:"Write amounts in pounds, for example 60 or 12.50."}),(0,f.jsx)(C.Muted,{center:!0,children:"No payment is taken in CoverCharge: this records what the guest paid."})]}),(0,f.jsxs)(N,{title:"When",testID:"edit-section-when",children:[(0,f.jsx)(y.BookingDatePicker,{r:z,today:new Date,value:L.date,onChange:e=>Q({date:e})}),(0,f.jsx)(C.Field,{label:"Time (24-hour, for example 19:30)",value:L.time,onChangeText:e=>Q({time:e}),testID:"edit-time"}),ee?null:(0,f.jsx)(C.T,{size:15,colour:x.colours.amber,children:"Write the time like 19:30."}),(0,f.jsxs)(a.default,{style:{gap:6,alignItems:'center'},children:[(0,f.jsx)(C.T,{size:18,center:!0,children:"Covers"}),(0,f.jsx)(s.PartySizeInput,{value:L.partySize,onChange:e=>Q({partySize:e}),label:"Covers",testID:"edit-covers"})]}),(0,f.jsxs)(C.Row,{style:{justifyContent:'space-between',alignItems:'center'},children:[(0,f.jsx)(C.T,{size:16,children:"Table time"}),(0,f.jsx)(C.Stepper,{testID:"edit-duration",value:L.duration||0,min:0,max:360,step:15,onChange:e=>Q({duration:e}),format:e=>e?`${Math.floor(e/60)}h ${String(e%60).padStart(2,'0')}m`:'As usual',label:"Table time"})]})]}),(0,f.jsxs)(N,{title:"Where",testID:"edit-section-where",children:[(0,f.jsxs)(C.Row,{wrap:!0,gap:6,style:{justifyContent:'center'},children:[(0,f.jsx)(C.Chip,{label:"Any area",selected:!L.area,testID:"edit-area-any",onPress:()=>Q({area:''})}),A.areas.map(e=>(0,f.jsx)(C.Chip,{label:`${e.name}${e.dogs?' \xb7 dogs ok':''}`,selected:L.area===e.name,testID:`edit-area-${e.id}`,onPress:()=>Q({area:e.name})},e.id))]}),(0,f.jsx)(C.T,{size:18,weight:"semibold",center:!0,children:(0,m.tableButtonLabel)(L.table)}),(0,f.jsxs)(C.Row,{gap:8,wrap:!0,style:{justifyContent:'center'},children:[(0,f.jsx)(C.Button,{kind:L.table?'secondary':'primary',label:"No table",accessibilityLabel:"No table"+(L.table?'':', chosen'),onPress:()=>Q({table:''}),style:{minHeight:44,minWidth:96},testID:"edit-table-none"}),ie.map(e=>(0,f.jsx)(C.Button,{kind:e===L.table?'primary':'secondary',label:(0,m.tableButtonLabel)(e),accessibilityLabel:`Table ${(0,m.tableButtonLabel)(e)}${e===L.table?', chosen':''}`,onPress:()=>Q({table:e}),style:{minHeight:44,minWidth:64},testID:`edit-table-${e}`},e))]})]}),(0,f.jsxs)(N,{title:"Guest",testID:"edit-section-guest",children:[(0,f.jsx)(C.Field,{label:"Name",value:L.name,onChangeText:e=>Q({name:e}),testID:"edit-name"}),b?(0,f.jsx)(C.Muted,{center:!0,children:"Phone and email can be changed in the Managers app; the Display never shows them."}):(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(C.Field,{label:"Phone",value:L.phone,onChangeText:e=>Q({phone:e}),keyboardType:"phone-pad",testID:"edit-phone"}),(0,f.jsx)(C.Field,{label:"Email",value:L.email,onChangeText:e=>Q({email:e}),keyboardType:"email-address",autoCapitalize:"none",testID:"edit-email"})]}),(0,f.jsx)(C.T,{size:16,center:!0,children:"Booked by"}),(0,f.jsx)(C.Row,{wrap:!0,gap:6,style:{justifyContent:'center'},children:c.SOURCES.map(e=>(0,f.jsx)(C.Chip,{label:e.label,selected:L.source===e.id,testID:`edit-source-${e.id}`,onPress:()=>Q({source:e.id})},e.id))}),(0,f.jsx)(C.Row,{wrap:!0,gap:6,style:{justifyContent:'center'},children:c.TAGS.map(e=>{const t=(L.tags??[]).includes(e);return(0,f.jsx)(C.Chip,{label:e,selected:t,testID:`edit-tag-${e}`,onPress:()=>Q({tags:t?(L.tags??[]).filter(t=>t!==e):[...L.tags??[],e].sort()})},e)})})]}),(0,f.jsxs)(N,{title:"Dogs, high chairs and access",testID:"edit-section-needs",children:[(0,f.jsx)(E,{label:"Dogs",value:L.dogs??0,max:6,onChange:e=>Q({dogs:e}),testID:"edit-dogs"}),(0,f.jsx)(E,{label:"High chairs",value:L.highChairs??0,max:10,onChange:e=>Q({highChairs:e}),testID:"edit-high-chairs"}),(0,f.jsx)(E,{label:"Wheelchair users",value:L.wheelchair??0,max:10,onChange:e=>Q({wheelchair:e}),testID:"edit-wheelchair"}),(0,f.jsx)(C.T,{size:16,center:!0,children:"Occasion"}),(0,f.jsx)(C.Row,{wrap:!0,gap:6,style:{justifyContent:'center'},children:c.OCCASIONS.map(e=>(0,f.jsx)(C.Chip,{label:e.label,selected:(L.occasion??'')===e.id,testID:`edit-occasion-${e.id||'none'}`,onPress:()=>Q({occasion:e.id})},e.id||'none'))})]}),(0,f.jsxs)(N,{title:"Allergies and dietary",testID:"edit-section-allergies",children:[(0,f.jsxs)(C.Row,{wrap:!0,gap:6,style:{justifyContent:'center'},children:[(0,f.jsx)(C.Chip,{label:"No allergies",selected:!!L.allergyNone&&!re.length,testID:"edit-allergy-none",onPress:()=>Q({allergyNone:!0,allergies:[]})}),h.ALLERGENS.map(e=>(0,f.jsx)(C.Chip,{label:e.short,selected:re.some(t=>t.allergen===e.id),testID:`edit-allergen-${e.id}`,onPress:()=>ce(e.id)},e.id))]}),re.map(e=>(0,f.jsxs)(a.default,{style:{gap:4,alignItems:'center'},children:[(0,f.jsxs)(C.T,{size:15,center:!0,children:[h.ALLERGENS.find(t=>t.id===e.allergen)?.short,": how serious?"]}),(0,f.jsx)(C.Row,{wrap:!0,gap:6,style:{justifyContent:'center'},children:h.SEVERITIES.map(t=>(0,f.jsx)(C.Chip,{label:t.label,selected:e.severity===t.id,testID:`edit-severity-${e.allergen}-${t.id}`,onPress:()=>Q({allergies:re.map(s=>s.allergen===e.allergen?{...s,severity:t.id}:s)})},t.id))})]},e.allergen)),(0,f.jsx)(C.Field,{label:"Anything else about allergies",value:L.allergyNote,onChangeText:e=>Q({allergyNote:e}),testID:"edit-allergy-note"}),le.includes('allergies')&&re.length?(0,f.jsx)(C.T,{size:15,center:!0,colour:x.colours.amber,children:"The kitchen signs off allergies again after this change."}):null,(0,f.jsx)(E,{label:"Vegan",value:L.vegan??0,max:L.partySize,onChange:e=>Q({vegan:e}),testID:"edit-vegan"}),(0,f.jsx)(E,{label:"Vegetarian",value:L.vegetarian??0,max:L.partySize,onChange:e=>Q({vegetarian:e}),testID:"edit-vegetarian"})]}),'cancelled'!==O.status?(0,f.jsxs)(N,{title:"Status",testID:"edit-section-status",children:[(0,f.jsx)(C.Row,{wrap:!0,gap:6,style:{justifyContent:'center'},children:c.EDIT_STATUSES.map(e=>(0,f.jsx)(C.Chip,{label:e.label,selected:L.status===e.id,testID:`edit-status-${e.id}`,onPress:()=>Q({status:e.id})},e.id))}),(0,f.jsx)(C.Muted,{center:!0,children:"To cancel, use Cancel booking below. Nothing is ever deleted."})]}):null,(0,f.jsx)(N,{title:"Notes",testID:"edit-section-notes",children:(0,f.jsx)(C.Field,{label:"Notes",value:L.notes,onChangeText:e=>Q({notes:e}),placeholder:c.NOTES_PLACEHOLDER,multiline:!0,numberOfLines:3,testID:"edit-notes"})}),W?(0,f.jsxs)(a.default,{testID:"edit-warn",style:{gap:8,padding:12,borderRadius:12,borderWidth:1.5,borderColor:x.colours.amber,backgroundColor:x.colours.amberBg},children:[W.map(e=>(0,f.jsx)(C.T,{size:16,center:!0,colour:"#FFE2A8",children:e},e)),(0,f.jsx)(C.T,{size:16,center:!0,colour:"#FFE2A8",children:"You can still save."})]}):null,(0,c.isWixBooking)(O)&&(0,c.guestMessageFields)(le).length?(0,f.jsxs)(a.default,{testID:"edit-notify",style:{gap:6,alignItems:'center'},children:[(0,f.jsx)(C.Toggle,{value:J,onChange:K,label:c.NOTIFY_LABEL,testID:"edit-notify-toggle"}),(0,f.jsx)(C.Muted,{center:!0,children:J?'The website sends the guest its own message about this.':'Off: the guest isn\u2019t messaged. The website keeps the old date, time or status until it\u2019s changed there.'})]}):null,_?(0,f.jsx)(C.T,{size:16,center:!0,colour:x.colours.goldLight,children:_}):null,(0,f.jsxs)(C.Row,{gap:8,wrap:!0,children:[(0,f.jsx)(C.Button,{label:W?'Save anyway':'Save changes',testID:"edit-save",disabled:!ee||!ae||L.name.trim().length<1||!le.length,onPress:()=>{const t=ee?(0,o.blockAt)(R,e,L.date,Z):void 0,s=(0,c.editWarnings)(O,ne,B,t,oe,A);!s.length||W?de():M(s)},style:{minHeight:56,flex:1}}),(0,f.jsx)(C.Button,{kind:"ghost",label:"Close",onPress:p,style:{minHeight:56}})]}),he.length?(0,f.jsx)(N,{title:"Changes",testID:"edit-history",children:he.slice(0,12).map((e,t)=>(0,f.jsx)(C.T,{size:14,center:!0,colour:x.colours.muted,children:e},t))}):null,(0,f.jsx)(I.CancelBookingButton,{rid:e,b:O,name:O.name,big:!0,onDone:()=>p()}),(0,f.jsx)(I.ReinstateBookingButton,{b:O,name:O.name,today:(0,j.ymd)(new Date),onDone:()=>p()})]})}},1115,[34,1097,102,848,1014,1011,850,846,1111,830,997,865,1012,1092,840,827,1105,1089,1113,794,25]); __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,"useVoiceSlot",{enumerable:!0,get:function(){return w}}),_e.voiceAppFor=h,_e.useVoiceTarget=p,_e.VoiceSlot=function({size:e=56,layer:t=0}){const u=p(),c=(0,n.useRef)(null),l=(0,n.useRef)(y++).current,{width:f,height:h,fontScale:v}=(0,o.default)(),A=()=>{if(t{if(c.current!==e||!s||tu+.5?w.getState().owner===l&&w.setState({rect:null,owner:0}):w.setState({rect:{x:n,y:o,size:s},owner:l})})},W=(0,n.useRef)(A);return W.current=A,(0,n.useLayoutEffect)(()=>{if(u?.on)return S.set(l,{layer:t,measure:()=>W.current()}),()=>{S.delete(l),w.getState().owner===l&&w.setState({rect:null,owner:0}),requestAnimationFrame(b)}},[u?.on,t]),(0,n.useLayoutEffect)(()=>{A();const e=requestAnimationFrame(A);return()=>cancelAnimationFrame(e)},[f,h,v,u?.on]),(0,n.useEffect)(()=>{const e=c.current;if(!u?.on||'undefined'==typeof ResizeObserver||!e?.parentElement)return;const t=new ResizeObserver(A);return t.observe(e.parentElement),e.parentElement.parentElement&&t.observe(e.parentElement.parentElement),()=>t.disconnect()},[u?.on]),(0,n.useEffect)(()=>()=>{w.getState().owner===l&&w.setState({rect:null,owner:0})},[]),(0,n.useEffect)(()=>{u?.on||w.getState().owner!==l||w.setState({rect:null,owner:0})},[u?.on]),u?.on?(0,m.jsx)(s.default,{ref:c,testID:"voice-slot",onLayout:A,style:{width:e,height:e,flexShrink:0}}):null};var t=r(d[0]),n=r(d[1]),o=e(r(d[2])),s=e(r(d[3])),u=r(d[4]),c=r(d[5]),l=r(d[6]),f=r(d[7]),m=r(d[8]);const w=(0,u.create)(()=>({rect:null,owner:0}));function h(e){return'customer'===c.APP_VARIANT||/^\/(customer|table|demo)/.test(e)?null:e.startsWith('/owner')||e.startsWith('/admin')?'owner':e.startsWith('/team')?'staff':e.startsWith('/kitchen')?'chef':e.startsWith('/display')?'display':null}function p(){const e=(0,t.usePathname)()||'/',n=(0,l.useCtx)(6e4),o=(0,f.useVoiceSettings)(e=>e.enabled),s=h(e);if(!s)return null;const u='owner'===s?'owner'===n.role?'owner':'manager'===n.role?'manager':'staff':s;return{app:s,role:u,actions:'staff'===u?'staff':s,on:(0,f.voiceOn)(o,n.rid,u)}}let y=1;const S=new Map,E=()=>{let e=-1;return S.forEach(t=>{t.layer>e&&(e=t.layer)}),e};function b(){const e=E();S.forEach(t=>{t.layer===e&&t.measure()})}},1116,[30,34,426,102,815,846,1100,1117,25]); __d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"VOICE_ROLES",{enumerable:!0,get:function(){return o}}),Object.defineProperty(_e,"VOICE_ROLE_LABEL",{enumerable:!0,get:function(){return p}}),Object.defineProperty(_e,"useVoiceSettings",{enumerable:!0,get:function(){return u}}),Object.defineProperty(_e,"voiceOn",{enumerable:!0,get:function(){return f}}),_e.micExplainedFor=function(e){try{if('1'===b()?.getItem(s(e)))return!0}catch{}return u.getState().micExplained},_e.setMicExplainedFor=function(e){try{b()?.setItem(s(e),'1')}catch{}u.getState().setMicExplained(!0)};var e,n=r(d[0]),t=(e=n)&&e.__esModule?e:{default:e},c=r(d[1]),l=r(d[2]);const o=['owner','manager','staff','chef','display'],p={owner:'Owner (Managers app)',manager:'Managers (Managers app)',staff:'Staff app (full voice assistant, no money or HR)',chef:'Head Chef app',display:'Main Display'},u=(0,c.create)()((0,l.persist)(e=>({enabled:{},micExplained:!1,setEnabled:(n,t,c)=>e(e=>({enabled:{...e.enabled,[n]:{...e.enabled[n]??{},[t]:c}}})),setMicExplained:n=>e({micExplained:n})}),{name:'covercharge-voice-v1',version:4,storage:(0,l.createJSONStorage)(()=>t.default),migrate:(e,n)=>({enabled:n<2?{}:e?.enabled??{},micExplained:!!e?.micExplained}),merge:(e,n)=>({...n,enabled:e?.enabled??n.enabled,micExplained:e?.micExplained??n.micExplained}),partialize:e=>({enabled:e.enabled,micExplained:e.micExplained})})),f=(e,n,t)=>!1!==e[n]?.[t],s=e=>`cc-voice-mic-explained-${e}`,b=()=>{try{return'undefined'!=typeof window?window.localStorage:void 0}catch{return}}},1117,[808,815,818]); __d(function(g,_r,_i,a,_m,e,_d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"VAT",{enumerable:!0,get:function(){return r}}),Object.defineProperty(e,"exVat",{enumerable:!0,get:function(){return n}}),e.dishCost=i,Object.defineProperty(e,"gpPct",{enumerable:!0,get:function(){return o}}),Object.defineProperty(e,"priceForTarget",{enumerable:!0,get:function(){return c}}),e.costings=function(r,c,s,u){const d=(0,t.dishStats)(r);return c.map(t=>{const c=r.find(r=>r.id===t.dishId);if(!c||null==c.price)return null;const p=i(t,s),l=n(c.price),f=o(p,c.price),b=d.find(t=>t.item.id===c.id)?.sold??0;return{item:c,recipe:t,cost:p,priceInc:c.price,priceEx:l,gp:f,cashGp:l-p,below:ft.prevCost&&t.prevCost!==t.cost).map(s=>{const u=(s.cost-(s.prevCost??s.cost))/(s.prevCost??1)*100,d=r.filter(t=>t.lines.some(t=>t.ing===s.id)).map(r=>{const u=t.find(t=>t.id===r.dishId);if(!u||null==u.price)return null;const d=o(i(r,n,{ing:s.id,cost:s.prevCost}),u.price),p=o(i(r,n),u.price);return{item:u,before:d,after:p,dropped:d>=c&&pt.dropped),below:d.filter(t=>t.below)}})},e.weekGp=function(t,r,n){const i=t.reduce((t,r)=>t+r.priceEx*r.soldWeek,0),o=t.reduce((t,r)=>t+r.cost*r.soldWeek,0),c=o+r+Math.max(0,n);return{sales:i,theoCost:o,actualCost:c,theo:i?(i-o)/i*100:0,actual:i?(i-c)/i*100:0}},Object.defineProperty(e,"fmtQty",{enumerable:!0,get:function(){return s}});var t=_r(_d[0]);const r=.2,n=t=>Math.round(t/1.2);function i(t,r,n){return Math.round(t.lines.reduce((t,i)=>{const o=r.find(t=>t.id===i.ing);return t+(n&&n.ing===i.ing?n.cost:o?.cost??0)*i.qty},0))}const o=(t,r)=>{const i=n(r);return i>0?(i-t)/i*100:0},c=(t,r)=>50*Math.ceil(t/(1-r/100)*1.2/50);const s=(t,r)=>`${Number.isInteger(t)?t:t.toFixed(t<1?3:2).replace(/0+$/,'').replace(/\.$/,'')} ${'each'===r?'':r}`.trim()},1118,[1119]); @@ -1421,7 +1421,7 @@ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{v __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 f}});var t=r(d[0]);r(d[1]);var n=r(d[2]),u=r(d[3]),c=r(d[4]);function f(){return'owner'!==u.APP_VARIANT?(0,c.jsx)(t.Redirect,{href:u.ENTRY[u.APP_VARIANT]}):(0,c.jsx)(n.OwnerApp,{})}},1338,[30,34,1339,846,25]); __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.OwnerApp=function(){return n.IS_CAR?(0,u.jsx)(t.CarApp,{}):(0,u.jsx)(p.OwnerApp,{})},r(d[0]);var n=r(d[1]),p=r(d[2]),t=r(d[3]),u=r(d[4])},1339,[34,846,1340,1473,25]); __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.OwnerApp=function(){return(0,ie.isDesktop)()?(0,de.jsx)(le.DesktopShell,{}):(0,de.jsx)(he,{})};var s=_r(d[0]),t=_r(d[1]),o=_r(d[2]),n=_r(d[3]),r=_r(d[4]),a=_r(d[5]),l=_r(d[6]),c=_r(d[7]),u=_r(d[8]),f=_r(d[9]),h=_r(d[10]),p=_r(d[11]),b=_r(d[12]),x=_r(d[13]),j=e(_r(d[14])),w=e(_r(d[15])),y=e(_r(d[16])),S=e(_r(d[17])),A=e(_r(d[18])),k=e(_r(d[19])),R=_r(d[20]),C=_r(d[21]),v=_r(d[22]),T=_r(d[23]),I=_r(d[24]),L=_r(d[25]),E=_r(d[26]),B=_r(d[27]),O=_r(d[28]),_=_r(d[29]),P=_r(d[30]),N=_r(d[31]);_r(d[32]);var M=_r(d[33]),H=_r(d[34]),V=_r(d[35]),D=_r(d[36]),W=_r(d[37]),$=_r(d[38]),z=_r(d[39]),U=_r(d[40]),F=_r(d[41]),G=_r(d[42]),K=_r(d[43]),Y=_r(d[44]);_r(d[45]);var q=_r(d[46]),J=_r(d[47]),Q=_r(d[48]),X=_r(d[49]),Z=_r(d[50]),ee=_r(d[51]),se=_r(d[52]),te=_r(d[53]),oe=_r(d[54]),ne=_r(d[55]),re=_r(d[56]),ae=_r(d[57]),ie=_r(d[58]),le=_r(d[59]),de=_r(d[60]);const ce=[{id:'anchorage',name:'The Anchorage',place:'Harbour View, Dunure'},{id:'saltmarsh',name:'The Venue',place:'Fictional demo venue'}],ue=[{id:'home',label:'Home',icon:'home'},{id:'orders',label:'Orders',icon:'orders'},{id:'bookings',label:'Bookings',icon:'bookings'},{id:'forecast',label:'Forecast',icon:'forecast',can:I.CAN.forecasts},{id:'chat',label:'Chat',icon:'chat'},{id:'more',label:'More',icon:'more'}],fe={home:'Today',orders:'Orders',bookings:'Bookings',forecast:'Forecasts',chat:'Staff chat',more:'More'};function he(){const{rid:e,r:ie,role:le,today:he,now:ge,meId:me,me:pe}=(0,O.useCtx)(3e4);(0,h.useTipsPosted)(e,he,'staff'!==le);const be=(0,O.useSignedIn)();(0,l.useSoldOutLink)(!0,(be?.name??pe).replace(' (example)',''));const xe=(0,T.useOrders)(e),[je,we]=(0,x.useState)('home'),[ye,Se]=(0,x.useState)(null),[Ae,ke]=(0,x.useState)(!1),Re=(0,n.useLiveVenue)(),[Ce,ve]=(0,x.useState)(!1),Te=(0,x.useRef)(null);(0,x.useEffect)(()=>{(0,O.ensureAttendance)(he,ge),(0,J.ensureChat)(ge)},[he]),globalThis.__ccNow=ge.getTime();const Ie=(0,J.useChatUnread)().total,Le=(0,x.useRef)({t:'home',s:null});Le.current={t:je,s:ye};const Ee=(0,x.useRef)([]),Be=(0,a.useScrollMemory)(Te),Oe=(0,x.useCallback)((e,s=null)=>{const t=Le.current;t.t===e&&t.s===s||(Ee.current=[...Ee.current,{...t,y:Be.leave()}].slice(-30),Be.restore(0)),we(e),Se(s)},[]),Pe=(0,x.useCallback)(()=>{if((0,c.runBackLayer)())return!0;const e=Le.current;let s=Ee.current.pop();for(;s&&s.t===e.t&&s.s===e.s;)s=Ee.current.pop();if(!s&&'home'===e.t&&!e.s)return!1;const t=s??{t:'home',s:null};return Be.leave(),we(t.t),Se(t.s),Be.restore(t.y??0),!0},[]);(0,c.useWebBack)(Pe);const Ne=(0,c.useInnerBackShown)();(0,x.useEffect)(()=>(oe.useVoiceNav.setState({go:Oe}),()=>oe.useVoiceNav.setState({go:null})),[Oe]),(0,x.useEffect)(()=>{u.PITCH&&(globalThis.__pitchGo=Oe)},[Oe]),(0,x.useEffect)(()=>{const e=j.default.addEventListener('hardwareBackPress',Pe);return()=>e.remove()},[Pe]),(0,x.useEffect)(()=>{const e=ue.find(e=>e.id===je);e?.can&&!e.can(le)&&Oe('home');const s=(0,K.pageFor)(ye);s?.can&&!s.can(le)&&Se(null)},[le]);const Me='more'===je?(0,K.pageFor)(ye):void 0,He=xe.filter(e=>(0,B.LIVE)(e)&&'new'===e.status).length,{unread:Ve,list:De,read:We}=(0,q.useNotifications)();(0,se.useAlertWatcher)(e,{nag:'staff'!==le}),(0,te.useReviewAlerts)(e),(0,ne.useScheduledNotices)({rid:e,staffId:be?.id??'',name:pe,onOpen:()=>Oe('more','orderlists')}),(0,re.useOffRotaAlerts)({enabled:'staff'!==le&&!!be});const $e=be?.role??le,ze='owner'===$e?'OWNER':'manager'===$e?'MANAGER':'STAFF',Ue=(0,se.useAlerts)(s=>s.history.filter(t=>t.rid===e&&(0,se.isUnread)(s,t)&&!(0,se.isCleared)(s,t)&&t.at>(s.seenAt[e]??0)).length),Fe=(0,se.useAlerts)(s=>s.todoSeen[e]),Ge=Math.max(0,Ve-De.filter(e=>!We[e.id]&&(Fe??[]).includes(e.id)).length)+Ue;(0,se.useAlertSeenSync)(e),(0,x.useEffect)(()=>{G.useShellBadges.setState({notifCount:Ge})},[Ge]);const Ke=(0,T.useBookings)(e).filter(e=>'pending'===e.status).length,Ye=s.IS_ISOLATED_VENUE?[{id:e,name:ie.name,place:ie.location||ie.address||''}]:ce,qe=Ye.find(s=>s.id===e)??Ye[0],Je=be?.ownerAccess&&'owner'!==be.role?'owner privileges':be?.managerAccess&&'staff'===be.role?'manager privileges':'',Qe=(0,H.ownerHomeLayout)(le,be);(0,A.default)().width;return(0,de.jsxs)(R.SafeAreaView,{style:{flex:1,backgroundColor:L.colours.bg},edges:['top','left','right','bottom'],children:[(0,de.jsxs)(k.default,{style:{position:'relative',paddingHorizontal:14,paddingTop:6,paddingBottom:8,borderBottomWidth:1,borderColor:L.colours.border,gap:6},children:[(0,de.jsxs)(k.default,{style:{position:'absolute',top:4,right:6,zIndex:5,flexDirection:'row',alignItems:'center',gap:2},children:[(0,de.jsx)(y.default,{accessibilityRole:"button",accessibilityLabel:"Search",hitSlop:8,onPress:()=>Oe('more','search'),style:{minWidth:44,minHeight:44,alignItems:'center',justifyContent:'center'},children:(0,de.jsx)(U.Icon,{name:"search",colour:L.colours.text})}),(0,de.jsx)(y.default,{testID:"bell",accessibilityRole:"button",accessibilityLabel:Ge?`Notifications, ${Ge} new`:'Notifications, nothing new',hitSlop:8,onPress:()=>Oe('more','notifications'),style:{minWidth:44,minHeight:44,alignItems:'center',justifyContent:'center'},children:(0,de.jsxs)(k.default,{children:[(0,de.jsx)(U.Icon,{name:"bell",colour:L.colours.text}),Ge?(0,de.jsx)(k.default,{style:{position:'absolute',right:-4,top:-4,backgroundColor:L.colours.red,borderRadius:8,minWidth:16,height:16,alignItems:'center',justifyContent:'center'},children:(0,de.jsx)(C.T,{size:10,weight:"bold",children:Ge})}):null]})}),(0,de.jsx)(X.VoiceSlot,{size:44})]}),(0,de.jsx)(k.default,{style:{alignItems:'flex-start',minHeight:44,justifyContent:'center',maxWidth:'70%'},children:(0,de.jsx)(k.default,{testID:"header-me-wrap",style:{alignItems:'flex-start'},children:(0,de.jsx)(y.default,{testID:"header-me",accessibilityRole:"button",accessibilityLabel:`Signed in as ${pe}. Account and role${Je?`, ${Je}`:''}`,disabled:'owner'!==V.APP_VARIANT,onPress:()=>ve(!0),hitSlop:6,style:{borderWidth:1,borderColor:L.colours.gold,borderRadius:22,paddingHorizontal:10,paddingVertical:4,maxWidth:'100%',minHeight:44,justifyContent:'center'},children:(0,de.jsxs)(C.Row,{gap:6,style:{justifyContent:'flex-start'},children:[(0,de.jsx)(_.StaffAvatar,{id:me,size:24,ring:!1}),(0,de.jsxs)(k.default,{style:{flexShrink:1},children:[(0,de.jsxs)(C.T,{size:13,weight:"semibold",colour:L.colours.gold,numberOfLines:1,style:{flexShrink:1},children:[be?`${pe} \xb7 ${be.level??I.ROLE_LABEL[be.role]}`:`${pe} \xb7 ${I.ROLE_LABEL[le]}`,'owner'===V.APP_VARIANT?' \u25be':'']}),Je?(0,de.jsx)(C.Muted,{center:!1,size:10,numberOfLines:1,children:Je}):null]})]})})})}),(0,de.jsx)(y.default,{accessibilityRole:"button",accessibilityLabel:"Switch venue",onPress:()=>ke(!0),style:{alignSelf:'center',maxWidth:420,width:'100%'},children:(0,de.jsx)(v.VenueHeaderBlock,{rid:e,name:ie.name,badge:ze,place:`${'staff'===le?'Staff preview \xb7 ':'Managers \xb7 '}${qe.place}`})}),le!==(be?.ownerAccess?'owner':be?.managerAccess?'manager':be?.role??'owner')&&'owner'===V.APP_VARIANT?(0,de.jsx)(y.default,{onPress:()=>I.useOwner.getState().setPreviewRole(be?.ownerAccess?'owner':be?.managerAccess?'manager':be?.role??'owner'),style:{backgroundColor:'#3a2f12',borderRadius:8,padding:6},children:(0,de.jsx)(C.T,{size:12,colour:L.colours.gold,children:'staff'===le?`Staff app preview: what staff see in the Staff app. Tap to return to ${I.ROLE_LABEL[be?.ownerAccess?'owner':be?.managerAccess?'manager':be?.role??'owner']}.`:`Previewing the ${I.ROLE_LABEL[le].toLowerCase()} view. Tap to return to ${I.ROLE_LABEL[be?.ownerAccess?'owner':be?.managerAccess?'manager':be?.role??'owner']}.`})}):null]}),(0,de.jsxs)(S.default,{ref:Te,...Be.props,contentContainerStyle:{padding:14,paddingBottom:16,gap:12,width:'100%',maxWidth:900,alignSelf:'center'},keyboardShouldPersistTaps:"handled",children:[(0,de.jsx)(c.BackTitleRow,{back:!('home'===je&&!ye||Ne),onBack:Pe,title:Me?Me.title:'staff'===le&&'home'===je?'Staff app preview':fe[je]}),'home'===je&&be&&'staff'===be.role&&'owner'===V.APP_VARIANT?(0,de.jsxs)(k.default,{testID:"access-off-banner",style:{borderWidth:1,borderColor:L.colours.gold,borderRadius:12,padding:10,gap:6},children:[(0,de.jsx)(C.T,{weight:"semibold",colour:L.colours.gold,children:"Your manager access is off"}),(0,de.jsx)(C.Muted,{children:"Your own shifts, clock in, rota, pay and tips are still here."}),(0,de.jsx)(C.Button,{label:"Clock in and my shifts",onPress:()=>Oe('more','clock')})]}):null,'home'!==je||Qe?null:(0,de.jsx)(r.WhoBar,{}),'home'===je&&!Qe&&be?(0,de.jsx)(ae.MyShiftCard,{go:Oe}):null,'home'===je&&!Qe&&be?(0,de.jsx)(f.MyTasksToday,{rid:e,staffId:be.id,name:be.name,onShift:(0,p.shiftNow)(be.id,Date.now()).on}):null,'home'!==je||Qe||'staff'===le?null:(0,de.jsx)(h.TodaysTipsCard,{rid:e,today:he}),'home'!==je||Qe||'staff'===le?null:(0,de.jsx)(h.TipsPotCard,{rid:e,today:he}),'home'===je?'staff'===le?(0,de.jsx)($.StaffHome,{go:Oe}):(0,de.jsx)(M.Dashboard,{go:Oe,ownerHome:Qe}):null,'orders'===je?(0,de.jsx)(Y.Orders,{}):null,'bookings'===je?(0,de.jsx)(E.Bookings,{go:Oe}):null,'forecast'===je?(0,de.jsx)(z.Forecasts,{go:Oe}):null,'chat'===je?(0,de.jsx)(J.Chat,{go:Oe}):null,'more'===je?Me?(0,de.jsx)(Me.C,{go:Oe}):(0,de.jsx)(K.MoreMenu,{go:Oe}):null]}),(0,de.jsx)(b.SeatAllergenReminder,{rid:e}),'staff'!==le?(0,de.jsx)(ee.PrintHost,{rid:e}):null,'staff'!==le?(0,de.jsx)(Z.AlertHost,{variant:"managers",rid:e,me:pe,onOpen:e=>Oe('takeaway'===e.kind?'orders':'email'===e.kind||'test'===e.kind?'more':'bookings','email'===e.kind||'test'===e.kind?'notifications':null)}):null,(0,de.jsx)(Q.AssistantSheet,{}),(0,de.jsx)(F.BottomTabs,{background:(0,t.soutersSurface)('#0d0d0d'),active:je,onPress:e=>Oe(e),tabs:ue.filter(e=>!e.can||e.can(le)).map(e=>({id:e.id,label:e.label,icon:e.icon,badge:'chat'===e.id&&Ie?{text:String(Ie),bg:L.colours.red}:'bookings'===e.id&&Ke?{text:String(Ke),bg:L.colours.amber,fg:'#0B0B0B',testID:'pending-badge'}:'orders'===e.id&&He?{text:String(He),bg:L.colours.red}:null}))}),(0,de.jsx)(w.default,{visible:Ae,transparent:!0,animationType:"fade",onRequestClose:()=>ke(!1),children:(0,de.jsx)(y.default,{style:{flex:1,backgroundColor:'#000a',justifyContent:'flex-end'},onPress:()=>ke(!1),children:(0,de.jsxs)(k.default,{style:{backgroundColor:L.colours.surface,padding:16,gap:8,borderTopLeftRadius:16,borderTopRightRadius:16},children:[(0,de.jsx)(C.T,{weight:"semibold",children:"Your venues"}),Ye.filter(e=>!Re||'saltmarsh'!==e.id).map(s=>(0,de.jsx)(y.default,{accessibilityRole:"button",onPress:()=>{I.useOwner.getState().setSite(s.id),ke(!1),Oe('home')},style:{padding:12,borderRadius:12,borderWidth:1,borderColor:s.id===e?L.colours.gold:L.colours.border},children:(0,de.jsxs)(C.Row,{style:{justifyContent:'space-between'},children:[(0,de.jsxs)(k.default,{children:[(0,de.jsx)(C.T,{weight:"medium",children:s.name}),(0,de.jsx)(C.Muted,{children:s.place})]}),s.id===e?(0,de.jsx)(C.Badge,{kind:"gold",label:"Current"}):null]})},s.id)),(0,de.jsx)(C.Muted,{children:s.IS_ISOLATED_VENUE?`This app belongs only to ${ie.name}.`:Re?'Switch venues without signing out. Other venues appear here once they are set up.':'Switch venues without signing out. The Venue is made up, for trying CoverCharge offline.'})]})})}),(0,de.jsx)(w.default,{visible:Ce,transparent:!0,animationType:"fade",onRequestClose:()=>ve(!1),children:(0,de.jsx)(y.default,{style:{flex:1,backgroundColor:'#000a',justifyContent:'flex-end'},onPress:()=>ve(!1),children:(0,de.jsxs)(k.default,{style:{backgroundColor:L.colours.surface,padding:16,gap:8,borderTopLeftRadius:16,borderTopRightRadius:16},children:[be?(0,de.jsxs)(C.Row,{gap:10,children:[(0,de.jsx)(_.StaffAvatar,{id:be.id,size:44}),(0,de.jsxs)(k.default,{style:{flex:1},children:[(0,de.jsxs)(C.T,{weight:"semibold",children:["Signed in as ",be.name]}),(0,de.jsx)(C.Muted,{children:(0,N.levelJob)(be.level??I.ROLE_LABEL[be.role],be.job)})]})]}):(0,de.jsxs)(k.default,{style:{gap:6},children:[(0,de.jsx)(C.T,{weight:"semibold",children:"Not signed in (preview)"}),(0,de.jsx)(C.Muted,{children:"Open your personal link, or paste it here, to sign in as yourself."}),(0,de.jsx)(P.SignInWithLink,{})]}),s.IS_QUEUED_VENUE||s.IS_ABBOTSFORD||s.IS_KIRKTON||s.IS_GREENSIDE||!be?null:(0,de.jsx)(C.Button,{kind:"secondary",label:"Open CoverCharge for Staff (as you)",onPress:()=>{(async()=>{const e=s.IS_WILDINGS?await(0,o.wildingsStaffAppUrl)():s.IS_KIRKMICHAEL?await(0,o.kirkmichaelStaffAppUrl)():(0,N.appUrl)('staff');e&&window.location.assign(e)})()}}),(0,de.jsx)(C.Muted,{children:"Preview what each role sees:"}),['owner','manager','staff'].filter(e=>!be||(0,O.clampRole)(e,be.ownerAccess?'owner':be.managerAccess?'manager':be.role)===e).map(e=>(0,de.jsx)(C.Button,{kind:e===le?'primary':'secondary',label:'staff'===e?'Staff app preview':`${I.ROLE_LABEL[e]} view`,onPress:()=>{I.useOwner.getState().setPreviewRole(e),ve(!1)}},e))]})})}),(0,de.jsx)(D.OnboardingHost,{go:Oe}),(0,de.jsx)(W.CoachHost,{})]})}},1340,[5,798,985,1173,1161,1040,977,1041,2,1047,1048,1070,1087,34,373,395,402,295,426,102,36,794,847,848,865,840,1341,1147,1100,899,1349,997,236,1356,13,846,1385,1391,1392,1393,1153,1192,1394,1379,1395,1396,1377,1135,1413,1116,1175,1311,1177,1190,1401,1085,1086,1160,1463,1464,25]); -__d(function(g,_r,_i,_a,m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.Bookings=function({go:e}={}){const{rid:C,r:X,now:Z,today:ee,me:se,role:te}=(0,p.useCtx)(1e4),le=(0,v.useBookings)(C),ne=(0,p.useInStaffApp)(),ie=(0,p.useShiftManager)(),ae=(0,v.useWaitlist)(C),[oe,de]=((0,v.useStore)(e=>e.alertAcks),(0,T.useState)(ee)),re=(0,R.useFrontDoor)(oe),ue=(0,k.useBookingWrite)(),[ce,he]=(0,T.useState)(''),[ge,be]=(0,T.useState)(!1),[pe,ke]=(0,T.useState)(2),me=oee.date===oe).sort((e,s)=>e.time.localeCompare(s.time)),ye=ae.filter(e=>'waiting'===e.status||'notified'===e.status).sort((e,s)=>e.number-s.number),we=xe.filter(e=>'noshow'===e.status),je=(0,V.useSync)(e=>!!e.venueId&&'guest'!==e.kind),fe=xe.filter(e=>'cancelled'!==e.status).reduce((e,s)=>e+s.partySize,0),Ie=(0,c.cancelledDayTally)(le,oe),Be=(0,c.cancelledTallyWords)(Ie,oe===ee?'today':'that day'),Se=xe.filter(e=>!e.walkIn),De=xe.filter(e=>e.walkIn),$e=le.filter(e=>'pending'===e.status&&e.date>=ee).sort((e,s)=>(e.date+e.time).localeCompare(s.date+s.time)),[Te,Ce]=(0,T.useState)(null),Le=(0,M.parseYmd)(oe);Le.setHours(12);const Ne=(0,Q.hoursFor)(X,Le),Pe=Ne?.open??new Date(`${oe}T12:00:00`),ve=Ne?.close??new Date(`${oe}T21:00:00`),Oe=Ne||xe.length?me?'No one seated that day':oe===ee?'No bookings yet today':'No bookings yet':oe===ee?'Closed today':'Closed that day';return(0,J.jsxs)(L.default,{style:{gap:12},children:[e&&!ne&&'staff'!==te?(0,J.jsx)(N.Button,{testID:"bookings-dashboard-top",label:"Bookings dashboard",accessibilityLabel:"Open Bookings dashboard: table plan, Timeline, today's guests and Covers",onPress:()=>e('more','serviceboard'),style:{width:'100%',minHeight:60}}):null,s.IS_WILDINGS||(s.IS_QUEUED_VENUE||s.IS_KIRKTON||s.IS_GREENSIDE||'abbotsford'===C)&&!ne&&'staff'!==te?(0,J.jsx)(n.VenueRequestList,{rid:C,kind:"table"}):null,!s.IS_WILDINGS&&!X.settings.hotel?.enabled||ne||'staff'===te?null:(0,J.jsx)(n.VenueRequestList,{rid:C,kind:"room",hotel:X.settings.hotel??l.WILDINGS_HOTEL}),(0,J.jsx)(G.BookingsDayNav,{today:ee,date:oe,onDate:de,count:e=>le.filter(s=>s.date===e&&'cancelled'!==s.status).length,sub:e=>{const s=le.filter(s=>s.date===e&&'cancelled'!==s.status&&!s.walkIn),t=s.reduce((e,s)=>e+s.partySize,0);return`${s.length} ${1===s.length?'table':'tables'} \xb7 ${t} ${1===t?'Cover':'Covers'}`}}),(0,J.jsx)(L.default,{testID:"bookings-day-graph",style:{overflow:'visible'},children:(0,J.jsx)(q.DayGraph,{bare:!0,fill:!0,todays:xe,open:Pe,close:ve,now:Z,turnBase:X.settings.turnMins,height:128,past:me,closed:!Ne,emptyText:Oe})}),me?(0,J.jsxs)(L.default,{testID:"bookings-past-totals",style:[N.styles.card,{gap:4}],accessible:!0,accessibilityLabel:`${(0,G.longDay)(oe)}: ${Se.length} tables, ${fe} Covers, ${xe.filter(e=>'finished'===e.status).length} finished, ${we.length} no-shows, ${xe.filter(e=>'cancelled'===e.status).length} cancelled`,children:[(0,J.jsxs)(N.T,{size:17,weight:"semibold",children:["That day: ",Se.length," table",1===Se.length?'':'s',De.length?` \xb7 ${De.length} walk-in${1===De.length?'':'s'}`:''," \xb7 ",fe," ",1===fe?'Cover':'Covers']}),(0,J.jsxs)(N.T,{size:16,colour:A.colours.text,children:[xe.filter(e=>'finished'===e.status).length," finished \xb7 ",we.length," no-show",1===we.length?'':'s'," \xb7 ",xe.filter(e=>'cancelled'===e.status).length," cancelled"]}),(0,J.jsx)(N.Muted,{children:"Looking back: read-only. Undo is still there for a mistake made today."})]}):null,(0,J.jsx)(L.default,{testID:"bookings-summary",children:(0,J.jsxs)(N.T,{weight:"semibold",children:[Se.length," table",1===Se.length?'':'s'," booked",De.length?` \xb7 ${De.length} walk-in${1===De.length?'':'s'}`:''," \xb7 ",fe," ",1===fe?'Cover':'Covers']})}),(0,J.jsx)(L.default,{testID:"cancelled-day-tally",accessible:!0,accessibilityLabel:Be,style:{alignItems:'center'},children:(0,J.jsx)(N.T,{size:15,colour:A.colours.muted,center:!0,children:Be})}),(0,J.jsxs)(L.default,{testID:"bookings-actions",style:{flexDirection:'row',flexWrap:'wrap',gap:8},children:[me?null:(0,J.jsx)(I.QuietButton,{label:"New booking",onPress:re.openBooking,testID:"add-booking",disabled:!ue.ok,accessibilityHint:ue.hint}),ne&&ie&&oe===ee?(0,J.jsx)(I.QuietButton,{label:"Walk-in",onPress:re.openWalkIn,testID:"add-walkin",disabled:!ue.ok,accessibilityHint:ue.hint}):null,oe===ee?(0,J.jsx)(B.CloseGardenButton,{quiet:!0,short:!0,rid:C,r:X,now:Z,by:se}):null]}),$e.length?(0,J.jsxs)(L.default,{testID:"pending-requests",style:[N.styles.card,{borderColor:A.colours.amber,gap:8}],children:[(0,J.jsxs)(N.T,{weight:"semibold",colour:A.colours.amber,children:["Needs confirming (",$e.length,")"]}),(0,J.jsx)(N.Muted,{children:"Online requests outside your auto-accept rules. Check the details before confirming."}),$e.map(e=>(0,J.jsxs)(L.default,{style:{gap:6,paddingTop:6,borderTopWidth:1,borderColor:A.colours.border},children:[(0,J.jsxs)(N.T,{weight:"semibold",children:[e.name," \xb7 ",e.partySize," ",1===e.partySize?'Cover':'Covers']}),(0,J.jsxs)(N.Muted,{children:[(0,M.niceDate)((0,M.parseYmd)(e.date))," at ",e.time," \xb7 ",e.ref," \xb7 ",e.phone??'no phone']}),e.notes?(0,J.jsxs)(N.T,{size:16,children:["Notes: ",e.notes]}):null,e.allergies.length?(0,J.jsx)(N.Row,{wrap:!0,gap:4,children:e.allergies.map(e=>(0,J.jsx)(N.Badge,{kind:"red",label:`${(0,O.allergenLabel)(e.allergen)} \xb7 ${(0,O.severityLabel)(e.severity)}`},e.allergen))}):null,(0,J.jsx)(S.NeedsPills,{b:e,r:X}),'staff'!==te&&((0,D.needsHoldOk)(e)||e.date===ee&&e.holdOk&&(e.holds??[]).some(e=>!e.served)&&'seated'===e.status)?(0,J.jsxs)(N.Row,{wrap:!0,gap:6,children:[(0,D.needsHoldOk)(e)?(0,J.jsx)(N.Button,{small:!0,kind:"success",label:"Platter OK",testID:`mgr-platter-ok-${e.ref}`,onPress:()=>(0,S.confirmHolds)(e.id,se)}):null,e.holdOk&&'seated'===e.status?(0,J.jsx)(N.Button,{small:!0,kind:"secondary",label:"Platter served",onPress:()=>(0,S.serveHolds)(e,se,'owner')}):null]}):null,Te===e.id?(0,J.jsxs)(L.default,{style:{gap:6},children:[(0,J.jsxs)(N.T,{size:14,children:["Are you sure? ",e.name.split(' ')[0]," will get a polite \u201csorry, we can\u2019t fit you in\u201d message."]}),(0,J.jsxs)(N.Row,{gap:6,children:[(0,J.jsx)(N.Button,{small:!0,kind:"danger",label:"Yes, decline",onPress:()=>{v.repo.bookings.decide(e.id,'declined',se),Ce(null)}}),(0,J.jsx)(N.Button,{small:!0,kind:"ghost",label:"Keep it",onPress:()=>Ce(null)})]})]}):ue.ok?(0,J.jsxs)(N.Row,{gap:6,children:[(0,J.jsx)(N.Button,{small:!0,label:"Confirm",testID:`confirm-${e.ref}`,onPress:()=>v.repo.bookings.decide(e.id,'confirmed',se)}),(0,J.jsx)(N.Button,{small:!0,kind:"secondary",label:"Decline",onPress:()=>Ce(e.id)}),(0,J.jsx)(Y.WhatsAppGuest,{b:e,rid:C,kind:"change"})]}):(0,J.jsx)(L.default,{accessible:!0,accessibilityLabel:x.BOOKING_VIEW_ONLY,children:(0,J.jsx)(N.T,{children:x.BOOKING_VIEW_ONLY})}),(0,J.jsx)(F.ConfirmTimeline,{refId:e.id})]},e.id))]}):null,0===xe.length?(0,J.jsx)(N.Muted,{children:"No bookings for this day yet."}):null,xe.map(e=>{const s='confirmed'===e.status&&oe===ee&&(0,M.minsBetween)(new Date(`${e.date}T${e.time}:00`),Z)>15,t=(0,w.depositState)(e),l=(0,w.depositBadge)(e,W.gbp);return(0,J.jsxs)(L.default,{testID:(0,$.isSeatedHighlight)((0,D.shownStatus)(e))?`booking-seated-${e.id}`:`booking-row-${e.id}`,style:[N.styles.card,(0,$.isSeatedHighlight)((0,D.shownStatus)(e))?(0,$.seatedHighlightStyle)({borderColor:(0,D.hasAllergens)(e)?A.colours.red:A.colours.goldLight}):{borderColor:(0,D.hasAllergens)(e)?A.colours.red:s?A.colours.amber:A.colours.hairline,opacity:['finished','cancelled'].includes(e.status)?.55:1}],children:[(0,J.jsx)(S.AllergenBar,{b:e}),(0,J.jsxs)(N.Row,{style:{justifyContent:'space-between'},children:[(0,J.jsxs)(N.Row,{gap:6,style:{flex:1,minWidth:0,alignItems:'center'},children:[(0,J.jsxs)(N.T,{weight:"semibold",colour:(0,$.isSeatedHighlight)((0,D.shownStatus)(e))?$.SEATED_FG:A.colours.text,style:{flexShrink:1},children:[e.time," \xb7 ",(0,R.walkInLabel)(e)]}),(0,D.hasAllergens)(e)?(0,J.jsx)(P.AllergyIcon,{text:(0,D.allergenText)(e),size:20,colour:(0,$.isSeatedHighlight)((0,D.shownStatus)(e))?'#7A4A00':A.colours.amber,ink:(0,$.isSeatedHighlight)((0,D.shownStatus)(e))?A.colours.gold:A.colours.bg,testID:`booking-allergy-${e.id}`}):null]}),(0,J.jsx)(N.Badge,{kind:'seated'===(0,D.shownStatus)(e)?'ok':'noshow'===e.status?'red':'confirmed'===e.status?'gold':'pending'===e.status?'amber':'neutral',label:'noshow'===e.status?'No-show':'pending'===e.status?'Needs confirming':(0,D.shownStatus)(e)[0].toUpperCase()+(0,D.shownStatus)(e).slice(1)})]}),l?(0,J.jsx)(y.DepositChip,{b:e,money:!0,big:!0,testID:`deposit-chip-${e.id}`}):null,(0,$.isSeatedHighlight)((0,D.shownStatus)(e))?(0,J.jsxs)(N.T,{size:14,colour:$.SEATED_MUTED,children:[e.table?(0,z.tableCardLabel)(e.table):e.walkIn?'Table to assign':'Table TBC'," \xb7 ",e.ref]}):(0,J.jsxs)(N.Muted,{children:[e.table?(0,z.tableCardLabel)(e.table):e.walkIn?'Table to assign':'Table TBC'," \xb7 ",e.ref]}),e.notes?(0,J.jsxs)(N.T,{size:16,testID:`booking-notes-${e.id}`,children:["Notes: ",e.notes]}):null,l?(0,J.jsxs)(N.Row,{wrap:!0,gap:6,style:{alignItems:'center'},children:[me||!(0,w.canTickDeposit)(e)||['cancelled','finished'].includes(e.status)?null:(0,J.jsx)(N.Button,{small:!0,kind:"secondary",label:"Mark deposit paid",testID:`deposit-paid-${e.id}`,accessibilityLabel:`Mark deposit paid for ${(0,R.walkInLabel)(e)}`,onPress:()=>v.repo.bookings.update(e.id,{depositPaid:e.depositDue??0,depositPaidBy:se,depositPaidAt:(new Date).toISOString()})}),me?null:(0,J.jsx)(j.WixDepositLink,{b:e,rid:C}),'paid'===t&&e.depositPaidBy?(0,J.jsx)(N.Muted,{size:13,children:'Wix deposit link'===e.depositPaidBy?'Paid through a website bookings deposit link':`Ticked by ${e.depositPaidBy}`}):null]}):null,e.walkIn?null:(0,J.jsxs)(N.Muted,{children:[(0,K.bookingSource)(e),e.phone?` \xb7 ${e.phone}`:'',e.email?` \xb7 ${e.email}`:'']}),e.allergies.length?(0,J.jsx)(N.Row,{wrap:!0,gap:4,children:e.allergies.map(e=>(0,J.jsx)(N.Badge,{kind:"red",label:`${(0,O.allergenLabel)(e.allergen)} \xb7 ${(0,O.severityLabel)(e.severity)}`},e.allergen))}):null,(0,D.hasAllergens)(e)&&!['cancelled','noshow'].includes(e.status)?(0,J.jsx)(U.BookingAllergyChain,{b:e,me:se}):null,e.walkIn?null:(0,J.jsx)(F.ConfirmTimeline,{refId:e.id,noPhone:!!e.source&&!e.phone}),s?(0,J.jsxs)(N.T,{size:13,colour:A.colours.amber,children:["Running ",(0,M.minsBetween)(new Date(`${e.date}T${e.time}:00`),Z)," min late. Call them, then mark no-show if needed."]}):null,(0,J.jsxs)(N.Row,{wrap:!0,gap:6,children:[(0,J.jsx)(r.BookingTableButton,{rid:C,booking:e,readOnly:me||!ue.ok,turnBase:X.settings.turnMins}),ue.ok?null:(0,J.jsx)(L.default,{accessible:!0,accessibilityLabel:x.BOOKING_VIEW_ONLY,children:(0,J.jsx)(N.T,{children:x.BOOKING_VIEW_ONLY})}),ue.ok?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(u.BookingEditButton,{rid:C,booking:e,who:se,role:te,inStaffApp:ne,shiftManager:ie}),me||e.table||!['seated','confirmed'].includes(e.status)?null:(0,J.jsx)(N.Button,{small:!e.walkIn,kind:e.walkIn?'primary':'secondary',label:"Assign table",onPress:()=>re.assignTable(e)}),!me&&['seated','confirmed'].includes(e.status)?(0,J.jsx)(N.Button,{small:!0,kind:"secondary",label:(0,z.tablesOf)(e.table).length>1?'Change tables':'Combine tables',testID:`combine-${e.id}`,accessibilityLabel:`${(0,z.tablesOf)(e.table).length>1?'Change tables':'Combine tables'} for ${(0,R.walkInLabel)(e)}`,onPress:()=>re.combineTables(e)}):null,me||'confirmed'!==e.status?null:(0,J.jsxs)(J.Fragment,{children:[e.date===ee?(0,J.jsx)(N.Button,{small:!0,label:"Seat",accessibilityLabel:`Seat ${(0,R.walkInLabel)(e)} now`,onPress:()=>(0,R.seatBookingNow)(C,e)}):null,(0,J.jsx)(N.Button,{small:!0,kind:"secondary",label:"No-show",onPress:()=>v.repo.bookings.setStatus(e.id,'noshow')})]}),me||e.walkIn?null:(0,J.jsx)(d.CancelBookingButton,{rid:C,b:e,name:(0,R.walkInLabel)(e),small:!0,onDone:()=>{}}),me||e.walkIn?null:(0,J.jsx)(d.ReinstateBookingButton,{b:e,name:(0,R.walkInLabel)(e),today:ee}),me||'seated'!==e.status?null:(0,J.jsx)(N.Button,{small:!0,kind:"secondary",label:"Finished",accessibilityLabel:`Finished: ${(0,R.walkInLabel)(e)}, table needs clearing`,onPress:()=>(0,R.finishBookingNow)(C,e)}),['confirmed','pending'].includes(e.status)&&e.date>=ee?(0,J.jsx)(Y.WhatsAppGuest,{b:e,rid:C,kind:"auto"}):null,ne?null:(0,J.jsx)(f.CopyReviewLink,{rid:C,bookingId:e.id}),!me&&e.walkIn?(0,J.jsx)(o.CancelWalkInButton,{rid:C,b:e,small:!0}):null,!me&&e.walkIn?(0,J.jsx)(o.ReinstateWalkInButton,{rid:C,b:e,today:ee,small:!0}):null,(0,J.jsx)(H.BookingUndo,{b:e,rid:C,today:ee,who:(0,R.walkInLabel)(e)})]}):null]}),'noshow'===e.status&&'paid'===t?(0,J.jsx)(N.Muted,{size:13,children:"A deposit was paid. Keep or refund it by your deposit terms (Settings \u203a Advanced \u203a Deposits). Deposits paid through website bookings are refunded in Website bookings \u203a Orders."}):null]},e.id)}),(0,J.jsx)(b.CancellationsSection,{testID:"bookings-cancellations",items:(0,h.cancellationsFor)(le,oe,e=>e.walkIn?`Walk-in ${e.ref}`:(e.name??'').replace(' (example)','')),dayWord:oe===ee?'today':'that day'}),(0,J.jsxs)(N.Card,{children:[(0,J.jsxs)(N.Row,{style:{justifyContent:'space-between'},children:[(0,J.jsx)(N.T,{weight:"semibold",children:"No-shows"}),(0,J.jsx)(N.Badge,{kind:we.length?'red':'ok',label:`${we.length} ${oe===ee?'today':(0,M.niceDate)((0,M.parseYmd)(oe)).slice(0,6)}${je||a.LIVE_VENUE_BUILD?'':' \xb7 4.1% last 28 days (example)'}`})]}),(0,J.jsx)(N.Muted,{children:we.length?`Marked no-show today: ${we.slice(0,6).map(e=>`${e.time} ${(0,R.walkInLabel)(e)}`).join(', ')}${we.length>6?` and ${we.length-6} more`:''}. If they turn up, open the booking and tap Undo no-show.`:'No no-shows today. If a party doesn\u2019t arrive, call them first, then tap No-show on their booking.'})]}),s.IS_GREENSIDE?(0,J.jsx)(t.GreensideCashOnly,{}):(0,J.jsxs)(N.Card,{children:[(0,J.jsx)(N.T,{weight:"semibold",children:"Deposits"}),(0,J.jsx)(N.Muted,{testID:"deposits-card-text",children:(()=>{const e=(0,w.depositOf)(X.settings);return e.on&&e.perPersonPence>0?`Deposits: ${(0,W.gbp)(e.perPersonPence)} per person for parties of ${e.fromParty} or more. Deposits are paid through website bookings. Website bookings show Deposit paid on website bookings by themselves once the guest has paid. For phone and walk-in bookings, tick Deposit paid once the guest has paid you${e.wixLinksOn?', or press Send deposit link':''}.`:'Deposits are off. Turn them on in Settings \u203a Advanced \u203a Deposits.'})()}),(0,J.jsx)(N.Muted,{size:13,children:"Tip: refunds are done in Website bookings \u203a Orders. Booking deposit amounts are visible in Managers, Display and Staff."})]}),ye.length>0||ge?(0,J.jsxs)(L.default,{style:{gap:10},children:[(0,J.jsx)(E.SectionHead,{title:`Waitlist (${ye.length})`,sub:`New party waits about ${(0,_.estimateWait)(ye.length+1,X.settings.turnMins,1)} min (estimate)`}),ye.map((e,s)=>(0,J.jsxs)(L.default,{style:N.styles.card,children:[(0,J.jsxs)(N.Row,{style:{justifyContent:'space-between'},children:[(0,J.jsxs)(N.T,{weight:"semibold",children:["#",e.number," ",e.name," \xb7 ",e.partySize]}),(0,J.jsxs)(N.Muted,{children:[(0,M.minsBetween)(new Date(e.joinedAt),Z)," min \xb7 est. ",(0,_.estimateWait)(s+1,X.settings.turnMins,1)," min"]})]}),'notified'===e.status?(0,J.jsx)(N.Badge,{kind:"ok",label:"Marked as told: table ready (no text is sent)"}):null,(0,J.jsxs)(N.Row,{gap:6,children:['waiting'===e.status?(0,J.jsx)(N.Button,{small:!0,kind:"secondary",label:"Notify",onPress:()=>v.repo.waitlist.setStatus(e.id,'notified')}):null,(0,J.jsx)(N.Button,{small:!0,label:"Seat",onPress:()=>v.repo.waitlist.setStatus(e.id,'seated')}),(0,J.jsx)(N.Button,{small:!0,kind:"ghost",label:"Remove",onPress:()=>v.repo.waitlist.setStatus(e.id,'removed')})]})]},e.id)),(0,J.jsxs)(N.Row,{gap:6,children:[(0,J.jsx)(i.TextInput,{accessibilityLabel:"Waitlist name",placeholder:"Name for the waitlist",placeholderTextColor:"#7D776C",value:ce,onChangeText:he,style:[N.styles.input,{flex:1}]}),(0,J.jsx)(N.Stepper,{value:pe,onChange:ke,min:1,max:12,label:"party"})]}),(0,J.jsx)(N.Button,{kind:"secondary",label:"Add to waitlist",disabled:ce.trim().length<2,onPress:()=>{v.repo.waitlist.join(C,ce.trim(),pe),he('')}})]}):(0,J.jsx)(N.Button,{kind:"ghost",label:"Open waitlist",onPress:()=>be(!0),accessibilityLabel:"Open the empty waitlist to add a waiting party"}),re.elements]})};var e,s=_r(_d[0]),t=_r(_d[1]),l=_r(_d[2]),n=_r(_d[3]),i=_r(_d[4]),a=_r(_d[5]),o=_r(_d[6]),d=_r(_d[7]),r=_r(_d[8]),u=_r(_d[9]),c=_r(_d[10]),h=_r(_d[11]),b=_r(_d[12]),p=_r(_d[13]),k=_r(_d[14]),x=_r(_d[15]),y=_r(_d[16]),w=_r(_d[17]),j=_r(_d[18]),f=_r(_d[19]),I=_r(_d[20]),B=_r(_d[21]),S=_r(_d[22]),D=_r(_d[23]),$=_r(_d[24]),T=_r(_d[25]),C=_r(_d[26]),L=(e=C)&&e.__esModule?e:{default:e},N=_r(_d[27]),P=_r(_d[28]),v=_r(_d[29]),O=_r(_d[30]),W=_r(_d[31]),M=_r(_d[32]),_=_r(_d[33]),A=_r(_d[34]),E=_r(_d[35]),R=_r(_d[36]),z=_r(_d[37]),H=_r(_d[38]),G=_r(_d[39]),U=_r(_d[40]),F=_r(_d[41]),K=_r(_d[42]),V=_r(_d[43]),Y=_r(_d[44]),q=_r(_d[45]),Q=_r(_d[46]),J=_r(_d[47])},1341,[5,1342,11,1343,796,806,1112,1113,1091,1115,1114,1328,1329,1100,1282,1012,1089,14,1344,1186,1345,1316,1081,1075,1090,34,102,794,1291,848,830,836,827,1267,840,1147,1096,1014,1346,1347,1136,1348,1177,985,1149,1324,852,25]); +__d(function(g,_r,_i,_a,m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.Bookings=function({go:e}={}){const{rid:L,r:Z,now:ee,today:se,me:te,role:le}=(0,k.useCtx)(1e4),ne=(0,O.useBookings)(L),ie=(0,k.useInStaffApp)(),ae=(0,k.useShiftManager)(),oe=(0,O.useWaitlist)(L),[de,re]=((0,O.useStore)(e=>e.alertAcks),(0,C.useState)(se)),ue=(0,z.useFrontDoor)(de),ce=(0,x.useBookingWrite)(),[he,ge]=(0,C.useState)(''),[be,pe]=(0,C.useState)(!1),[ke,me]=(0,C.useState)(2),xe=dee.date===de).sort((e,s)=>e.time.localeCompare(s.time)),we=oe.filter(e=>'waiting'===e.status||'notified'===e.status).sort((e,s)=>e.number-s.number),je=ye.filter(e=>'noshow'===e.status),fe=(0,Y.useSync)(e=>!!e.venueId&&'guest'!==e.kind),Ie=ye.filter(e=>'cancelled'!==e.status).reduce((e,s)=>e+s.partySize,0),Be=(0,h.cancelledDayTally)(ne,de),De=(0,h.cancelledTallyWords)(Be,de===se?'today':'that day'),Se=ye.filter(e=>!e.walkIn),$e=ye.filter(e=>e.walkIn),Te=ne.filter(e=>'pending'===e.status&&e.date>=se).sort((e,s)=>(e.date+e.time).localeCompare(s.date+s.time)),[Ce,Le]=(0,C.useState)(null),Ne=(0,E.parseYmd)(de);Ne.setHours(12);const Pe=(0,J.hoursFor)(Z,Ne),ve=Pe?.open??new Date(`${de}T12:00:00`),Oe=Pe?.close??new Date(`${de}T21:00:00`),We=Pe||ye.length?xe?'No one seated that day':de===se?'No bookings yet today':'No bookings yet':de===se?'Closed today':'Closed that day';return(0,X.jsxs)(N.default,{style:{gap:12},children:[e&&!ie&&'staff'!==le?(0,X.jsx)(P.Button,{testID:"bookings-dashboard-top",label:"Bookings dashboard",accessibilityLabel:"Open Bookings dashboard: table plan, Timeline, today's guests and Covers",onPress:()=>e('more','serviceboard'),style:{width:'100%',minHeight:60}}):null,s.IS_WILDINGS||(s.IS_QUEUED_VENUE||s.IS_KIRKTON||s.IS_GREENSIDE||'abbotsford'===L)&&!ie&&'staff'!==le?(0,X.jsx)(n.VenueRequestList,{rid:L,kind:"table"}):null,!s.IS_WILDINGS&&!Z.settings.hotel?.enabled||ie||'staff'===le?null:(0,X.jsx)(n.VenueRequestList,{rid:L,kind:"room",hotel:Z.settings.hotel??l.WILDINGS_HOTEL}),(0,X.jsx)(U.BookingsDayNav,{today:se,date:de,onDate:re,count:e=>ne.filter(s=>s.date===e&&'cancelled'!==s.status).length,sub:e=>{const s=ne.filter(s=>s.date===e&&'cancelled'!==s.status&&!s.walkIn),t=s.reduce((e,s)=>e+s.partySize,0);return`${s.length} ${1===s.length?'table':'tables'} \xb7 ${t} ${1===t?'Cover':'Covers'}`}}),(0,X.jsx)(N.default,{testID:"bookings-day-graph",style:{overflow:'visible'},children:(0,X.jsx)(Q.DayGraph,{bare:!0,fill:!0,todays:ye,open:ve,close:Oe,now:ee,turnBase:Z.settings.turnMins,height:128,past:xe,closed:!Pe,emptyText:We})}),xe?(0,X.jsxs)(N.default,{testID:"bookings-past-totals",style:[P.styles.card,{gap:4}],accessible:!0,accessibilityLabel:`${(0,U.longDay)(de)}: ${Se.length} tables, ${Ie} Covers, ${ye.filter(e=>'finished'===e.status).length} finished, ${je.length} no-shows, ${ye.filter(e=>'cancelled'===e.status).length} cancelled`,children:[(0,X.jsxs)(P.T,{size:17,weight:"semibold",children:["That day: ",Se.length," table",1===Se.length?'':'s',$e.length?` \xb7 ${$e.length} walk-in${1===$e.length?'':'s'}`:''," \xb7 ",Ie," ",1===Ie?'Cover':'Covers']}),(0,X.jsxs)(P.T,{size:16,colour:A.colours.text,children:[ye.filter(e=>'finished'===e.status).length," finished \xb7 ",je.length," no-show",1===je.length?'':'s'," \xb7 ",ye.filter(e=>'cancelled'===e.status).length," cancelled"]}),(0,X.jsx)(P.Muted,{children:"Looking back: read-only. Undo is still there for a mistake made today."})]}):null,(0,X.jsx)(N.default,{testID:"bookings-summary",children:(0,X.jsxs)(P.T,{weight:"semibold",children:[Se.length," table",1===Se.length?'':'s'," booked",$e.length?` \xb7 ${$e.length} walk-in${1===$e.length?'':'s'}`:''," \xb7 ",Ie," ",1===Ie?'Cover':'Covers']})}),(0,X.jsx)(N.default,{testID:"cancelled-day-tally",accessible:!0,accessibilityLabel:De,style:{alignItems:'center'},children:(0,X.jsx)(P.T,{size:15,colour:A.colours.muted,center:!0,children:De})}),(0,X.jsxs)(N.default,{testID:"bookings-actions",style:{flexDirection:'row',flexWrap:'wrap',gap:8},children:[xe?null:(0,X.jsx)(B.QuietButton,{label:"New booking",onPress:ue.openBooking,testID:"add-booking",disabled:!ce.ok,accessibilityHint:ce.hint}),ie&&ae&&de===se?(0,X.jsx)(B.QuietButton,{label:"Walk-in",onPress:ue.openWalkIn,testID:"add-walkin",disabled:!ce.ok,accessibilityHint:ce.hint}):null,de===se?(0,X.jsx)(D.CloseGardenButton,{quiet:!0,short:!0,rid:L,r:Z,now:ee,by:te}):null]}),Te.length?(0,X.jsxs)(N.default,{testID:"pending-requests",style:[P.styles.card,{borderColor:A.colours.amber,gap:8}],children:[(0,X.jsxs)(P.T,{weight:"semibold",colour:A.colours.amber,children:["Needs confirming (",Te.length,")"]}),(0,X.jsx)(P.Muted,{children:"Online requests outside your auto-accept rules. Check the details before confirming."}),Te.map(e=>(0,X.jsxs)(N.default,{style:{gap:6,paddingTop:6,borderTopWidth:1,borderColor:A.colours.border},children:[(0,X.jsxs)(P.T,{weight:"semibold",children:[e.name," \xb7 ",e.partySize," ",1===e.partySize?'Cover':'Covers']}),(0,X.jsxs)(P.Muted,{children:[(0,E.niceDate)((0,E.parseYmd)(e.date))," at ",e.time," \xb7 ",e.ref," \xb7 ",e.phone??'no phone']}),e.notes?(0,X.jsxs)(P.T,{size:16,children:["Notes: ",e.notes]}):null,e.allergies.length?(0,X.jsx)(P.Row,{wrap:!0,gap:4,children:e.allergies.map(e=>(0,X.jsx)(P.Badge,{kind:"red",label:`${(0,W.allergenLabel)(e.allergen)} \xb7 ${(0,W.severityLabel)(e.severity)}`},e.allergen))}):null,(0,X.jsx)(S.NeedsPills,{b:e,r:Z}),'staff'!==le&&((0,$.needsHoldOk)(e)||e.date===se&&e.holdOk&&(e.holds??[]).some(e=>!e.served)&&'seated'===e.status)?(0,X.jsxs)(P.Row,{wrap:!0,gap:6,children:[(0,$.needsHoldOk)(e)?(0,X.jsx)(P.Button,{small:!0,kind:"success",label:"Platter OK",testID:`mgr-platter-ok-${e.ref}`,onPress:()=>(0,S.confirmHolds)(e.id,te)}):null,e.holdOk&&'seated'===e.status?(0,X.jsx)(P.Button,{small:!0,kind:"secondary",label:"Platter served",onPress:()=>(0,S.serveHolds)(e,te,'owner')}):null]}):null,Ce===e.id?(0,X.jsxs)(N.default,{style:{gap:6},children:[(0,X.jsxs)(P.T,{size:14,children:["Are you sure? ",e.name.split(' ')[0]," will get a polite \u201csorry, we can\u2019t fit you in\u201d message."]}),(0,X.jsxs)(P.Row,{gap:6,children:[(0,X.jsx)(P.Button,{small:!0,kind:"danger",label:"Yes, decline",onPress:()=>{O.repo.bookings.decide(e.id,'declined',te),Le(null)}}),(0,X.jsx)(P.Button,{small:!0,kind:"ghost",label:"Keep it",onPress:()=>Le(null)})]})]}):ce.ok?(0,X.jsxs)(P.Row,{gap:6,children:[(0,X.jsx)(P.Button,{small:!0,label:"Confirm",testID:`confirm-${e.ref}`,onPress:()=>O.repo.bookings.decide(e.id,'confirmed',te)}),(0,X.jsx)(P.Button,{small:!0,kind:"secondary",label:"Decline",onPress:()=>Le(e.id)}),(0,X.jsx)(q.WhatsAppGuest,{b:e,rid:L,kind:"change"})]}):(0,X.jsx)(N.default,{accessible:!0,accessibilityLabel:y.BOOKING_VIEW_ONLY,children:(0,X.jsx)(P.T,{children:y.BOOKING_VIEW_ONLY})}),(0,X.jsx)(K.ConfirmTimeline,{refId:e.id})]},e.id))]}):null,0===ye.length?(0,X.jsx)(P.Muted,{children:"No bookings for this day yet."}):null,ye.map(e=>{const s='confirmed'===e.status&&de===se&&(0,E.minsBetween)(new Date(`${e.date}T${e.time}:00`),ee)>15,t=(0,j.depositState)(e),l=(0,j.depositBadge)(e,M.gbp);return(0,X.jsxs)(N.default,{testID:(0,T.isSeatedHighlight)((0,$.shownStatus)(e))?`booking-seated-${e.id}`:`booking-row-${e.id}`,style:[P.styles.card,(0,T.isSeatedHighlight)((0,$.shownStatus)(e))?(0,T.seatedHighlightStyle)({borderColor:(0,$.hasAllergens)(e)?A.colours.red:A.colours.goldLight}):{borderColor:(0,$.hasAllergens)(e)?A.colours.red:s?A.colours.amber:A.colours.hairline,opacity:['finished','cancelled'].includes(e.status)?.55:1}],children:[(0,X.jsx)(S.AllergenBar,{b:e}),(0,X.jsxs)(P.Row,{style:{justifyContent:'space-between'},children:[(0,X.jsxs)(P.Row,{gap:6,style:{flex:1,minWidth:0,alignItems:'center'},children:[(0,X.jsxs)(P.T,{weight:"semibold",colour:(0,T.isSeatedHighlight)((0,$.shownStatus)(e))?T.SEATED_FG:A.colours.text,style:{flexShrink:1},children:[e.time," \xb7 ",(0,z.walkInLabel)(e)]}),(0,$.hasAllergens)(e)?(0,X.jsx)(v.AllergyIcon,{text:(0,$.allergenText)(e),size:20,colour:(0,T.isSeatedHighlight)((0,$.shownStatus)(e))?'#7A4A00':A.colours.amber,ink:(0,T.isSeatedHighlight)((0,$.shownStatus)(e))?A.colours.gold:A.colours.bg,testID:`booking-allergy-${e.id}`}):null]}),(0,X.jsx)(P.Badge,{kind:'seated'===(0,$.shownStatus)(e)?'ok':'noshow'===e.status?'red':'confirmed'===e.status?'gold':'pending'===e.status?'amber':'neutral',label:'noshow'===e.status?'No-show':'pending'===e.status?'Needs confirming':(0,$.shownStatus)(e)[0].toUpperCase()+(0,$.shownStatus)(e).slice(1)})]}),l?(0,X.jsx)(w.DepositChip,{b:e,money:!0,big:!0,testID:`deposit-chip-${e.id}`}):null,(0,T.isSeatedHighlight)((0,$.shownStatus)(e))?(0,X.jsxs)(P.T,{size:14,colour:T.SEATED_MUTED,children:[e.table?(0,H.tableCardLabel)(e.table):e.walkIn?'Table to assign':'Table TBC'," \xb7 ",e.ref]}):(0,X.jsxs)(P.Muted,{children:[e.table?(0,H.tableCardLabel)(e.table):e.walkIn?'Table to assign':'Table TBC'," \xb7 ",e.ref]}),e.notes?(0,X.jsxs)(P.T,{size:16,testID:`booking-notes-${e.id}`,children:["Notes: ",e.notes]}):null,(0,c.bookingExtras)(e)?(0,X.jsx)(P.T,{size:15,testID:`booking-extras-${e.id}`,children:(0,c.bookingExtras)(e)}):null,(0,c.historyLines)(e)[0]?(0,X.jsxs)(P.Muted,{size:13,testID:`booking-last-change-${e.id}`,children:["Last change: ",(0,c.historyLines)(e)[0]]}):null,l?(0,X.jsxs)(P.Row,{wrap:!0,gap:6,style:{alignItems:'center'},children:[xe||!(0,j.canTickDeposit)(e)||['cancelled','finished'].includes(e.status)?null:(0,X.jsx)(P.Button,{small:!0,kind:"secondary",label:"Mark deposit paid",testID:`deposit-paid-${e.id}`,accessibilityLabel:`Mark deposit paid for ${(0,z.walkInLabel)(e)}`,onPress:()=>O.repo.bookings.update(e.id,{depositPaid:e.depositDue??0,depositPaidBy:te,depositPaidAt:(new Date).toISOString()})}),xe?null:(0,X.jsx)(f.WixDepositLink,{b:e,rid:L}),'paid'===t&&e.depositPaidBy?(0,X.jsx)(P.Muted,{size:13,children:'Wix deposit link'===e.depositPaidBy?'Paid through a website bookings deposit link':`Ticked by ${e.depositPaidBy}`}):null]}):null,e.walkIn?null:(0,X.jsxs)(P.Muted,{children:[(0,V.bookingSource)(e),e.phone?` \xb7 ${e.phone}`:'',e.email?` \xb7 ${e.email}`:'']}),e.allergies.length?(0,X.jsx)(P.Row,{wrap:!0,gap:4,children:e.allergies.map(e=>(0,X.jsx)(P.Badge,{kind:"red",label:`${(0,W.allergenLabel)(e.allergen)} \xb7 ${(0,W.severityLabel)(e.severity)}`},e.allergen))}):null,(0,$.hasAllergens)(e)&&!['cancelled','noshow'].includes(e.status)?(0,X.jsx)(F.BookingAllergyChain,{b:e,me:te}):null,e.walkIn?null:(0,X.jsx)(K.ConfirmTimeline,{refId:e.id,noPhone:!!e.source&&!e.phone}),s?(0,X.jsxs)(P.T,{size:13,colour:A.colours.amber,children:["Running ",(0,E.minsBetween)(new Date(`${e.date}T${e.time}:00`),ee)," min late. Call them, then mark no-show if needed."]}):null,ce.ok?(0,X.jsx)(u.BookingEditButton,{rid:L,booking:e,who:te,role:le,inStaffApp:ie,shiftManager:ae,big:!0,testID:`edit-booking-${e.id}`}):null,(0,X.jsxs)(P.Row,{wrap:!0,gap:6,children:[(0,X.jsx)(r.BookingTableButton,{rid:L,booking:e,readOnly:xe||!ce.ok,turnBase:Z.settings.turnMins}),ce.ok?null:(0,X.jsx)(N.default,{accessible:!0,accessibilityLabel:y.BOOKING_VIEW_ONLY,children:(0,X.jsx)(P.T,{children:y.BOOKING_VIEW_ONLY})}),ce.ok?(0,X.jsxs)(X.Fragment,{children:[xe||e.table||!['seated','confirmed'].includes(e.status)?null:(0,X.jsx)(P.Button,{small:!e.walkIn,kind:e.walkIn?'primary':'secondary',label:"Assign table",onPress:()=>ue.assignTable(e)}),!xe&&['seated','confirmed'].includes(e.status)?(0,X.jsx)(P.Button,{small:!0,kind:"secondary",label:(0,H.tablesOf)(e.table).length>1?'Change tables':'Combine tables',testID:`combine-${e.id}`,accessibilityLabel:`${(0,H.tablesOf)(e.table).length>1?'Change tables':'Combine tables'} for ${(0,z.walkInLabel)(e)}`,onPress:()=>ue.combineTables(e)}):null,xe||'confirmed'!==e.status?null:(0,X.jsxs)(X.Fragment,{children:[e.date===se?(0,X.jsx)(P.Button,{small:!0,label:"Seat",accessibilityLabel:`Seat ${(0,z.walkInLabel)(e)} now`,onPress:()=>(0,z.seatBookingNow)(L,e)}):null,(0,X.jsx)(P.Button,{small:!0,kind:"secondary",label:"No-show",onPress:()=>O.repo.bookings.setStatus(e.id,'noshow')})]}),xe||e.walkIn?null:(0,X.jsx)(d.CancelBookingButton,{rid:L,b:e,name:(0,z.walkInLabel)(e),small:!0,onDone:()=>{}}),xe||e.walkIn?null:(0,X.jsx)(d.ReinstateBookingButton,{b:e,name:(0,z.walkInLabel)(e),today:se}),xe||'seated'!==e.status?null:(0,X.jsx)(P.Button,{small:!0,kind:"secondary",label:"Finished",accessibilityLabel:`Finished: ${(0,z.walkInLabel)(e)}, table needs clearing`,onPress:()=>(0,z.finishBookingNow)(L,e)}),['confirmed','pending'].includes(e.status)&&e.date>=se?(0,X.jsx)(q.WhatsAppGuest,{b:e,rid:L,kind:"auto"}):null,ie?null:(0,X.jsx)(I.CopyReviewLink,{rid:L,bookingId:e.id}),!xe&&e.walkIn?(0,X.jsx)(o.CancelWalkInButton,{rid:L,b:e,small:!0}):null,!xe&&e.walkIn?(0,X.jsx)(o.ReinstateWalkInButton,{rid:L,b:e,today:se,small:!0}):null,(0,X.jsx)(G.BookingUndo,{b:e,rid:L,today:se,who:(0,z.walkInLabel)(e)})]}):null]}),'noshow'===e.status&&'paid'===t?(0,X.jsx)(P.Muted,{size:13,children:"A deposit was paid. Keep or refund it by your deposit terms (Settings \u203a Advanced \u203a Deposits). Deposits paid through website bookings are refunded in Website bookings \u203a Orders."}):null]},e.id)}),(0,X.jsx)(p.CancellationsSection,{testID:"bookings-cancellations",items:(0,b.cancellationsFor)(ne,de,e=>e.walkIn?`Walk-in ${e.ref}`:(e.name??'').replace(' (example)','')),dayWord:de===se?'today':'that day'}),(0,X.jsxs)(P.Card,{children:[(0,X.jsxs)(P.Row,{style:{justifyContent:'space-between'},children:[(0,X.jsx)(P.T,{weight:"semibold",children:"No-shows"}),(0,X.jsx)(P.Badge,{kind:je.length?'red':'ok',label:`${je.length} ${de===se?'today':(0,E.niceDate)((0,E.parseYmd)(de)).slice(0,6)}${fe||a.LIVE_VENUE_BUILD?'':' \xb7 4.1% last 28 days (example)'}`})]}),(0,X.jsx)(P.Muted,{children:je.length?`Marked no-show today: ${je.slice(0,6).map(e=>`${e.time} ${(0,z.walkInLabel)(e)}`).join(', ')}${je.length>6?` and ${je.length-6} more`:''}. If they turn up, open the booking and tap Undo no-show.`:'No no-shows today. If a party doesn\u2019t arrive, call them first, then tap No-show on their booking.'})]}),s.IS_GREENSIDE?(0,X.jsx)(t.GreensideCashOnly,{}):(0,X.jsxs)(P.Card,{children:[(0,X.jsx)(P.T,{weight:"semibold",children:"Deposits"}),(0,X.jsx)(P.Muted,{testID:"deposits-card-text",children:(()=>{const e=(0,j.depositOf)(Z.settings);return e.on&&e.perPersonPence>0?`Deposits: ${(0,M.gbp)(e.perPersonPence)} per person for parties of ${e.fromParty} or more. Deposits are paid through website bookings. Website bookings show Deposit paid on website bookings by themselves once the guest has paid. For phone and walk-in bookings, tick Deposit paid once the guest has paid you${e.wixLinksOn?', or press Send deposit link':''}.`:'Deposits are off. Turn them on in Settings \u203a Advanced \u203a Deposits.'})()}),(0,X.jsx)(P.Muted,{size:13,children:"Tip: refunds are done in Website bookings \u203a Orders. Booking deposit amounts are visible in Managers, Display and Staff."})]}),we.length>0||be?(0,X.jsxs)(N.default,{style:{gap:10},children:[(0,X.jsx)(R.SectionHead,{title:`Waitlist (${we.length})`,sub:`New party waits about ${(0,_.estimateWait)(we.length+1,Z.settings.turnMins,1)} min (estimate)`}),we.map((e,s)=>(0,X.jsxs)(N.default,{style:P.styles.card,children:[(0,X.jsxs)(P.Row,{style:{justifyContent:'space-between'},children:[(0,X.jsxs)(P.T,{weight:"semibold",children:["#",e.number," ",e.name," \xb7 ",e.partySize]}),(0,X.jsxs)(P.Muted,{children:[(0,E.minsBetween)(new Date(e.joinedAt),ee)," min \xb7 est. ",(0,_.estimateWait)(s+1,Z.settings.turnMins,1)," min"]})]}),'notified'===e.status?(0,X.jsx)(P.Badge,{kind:"ok",label:"Marked as told: table ready (no text is sent)"}):null,(0,X.jsxs)(P.Row,{gap:6,children:['waiting'===e.status?(0,X.jsx)(P.Button,{small:!0,kind:"secondary",label:"Notify",onPress:()=>O.repo.waitlist.setStatus(e.id,'notified')}):null,(0,X.jsx)(P.Button,{small:!0,label:"Seat",onPress:()=>O.repo.waitlist.setStatus(e.id,'seated')}),(0,X.jsx)(P.Button,{small:!0,kind:"ghost",label:"Remove",onPress:()=>O.repo.waitlist.setStatus(e.id,'removed')})]})]},e.id)),(0,X.jsxs)(P.Row,{gap:6,children:[(0,X.jsx)(i.TextInput,{accessibilityLabel:"Waitlist name",placeholder:"Name for the waitlist",placeholderTextColor:"#7D776C",value:he,onChangeText:ge,style:[P.styles.input,{flex:1}]}),(0,X.jsx)(P.Stepper,{value:ke,onChange:me,min:1,max:12,label:"party"})]}),(0,X.jsx)(P.Button,{kind:"secondary",label:"Add to waitlist",disabled:he.trim().length<2,onPress:()=>{O.repo.waitlist.join(L,he.trim(),ke),ge('')}})]}):(0,X.jsx)(P.Button,{kind:"ghost",label:"Open waitlist",onPress:()=>pe(!0),accessibilityLabel:"Open the empty waitlist to add a waiting party"}),ue.elements]})};var e,s=_r(_d[0]),t=_r(_d[1]),l=_r(_d[2]),n=_r(_d[3]),i=_r(_d[4]),a=_r(_d[5]),o=_r(_d[6]),d=_r(_d[7]),r=_r(_d[8]),u=_r(_d[9]),c=_r(_d[10]),h=_r(_d[11]),b=_r(_d[12]),p=_r(_d[13]),k=_r(_d[14]),x=_r(_d[15]),y=_r(_d[16]),w=_r(_d[17]),j=_r(_d[18]),f=_r(_d[19]),I=_r(_d[20]),B=_r(_d[21]),D=_r(_d[22]),S=_r(_d[23]),$=_r(_d[24]),T=_r(_d[25]),C=_r(_d[26]),L=_r(_d[27]),N=(e=L)&&e.__esModule?e:{default:e},P=_r(_d[28]),v=_r(_d[29]),O=_r(_d[30]),W=_r(_d[31]),M=_r(_d[32]),E=_r(_d[33]),_=_r(_d[34]),A=_r(_d[35]),R=_r(_d[36]),z=_r(_d[37]),H=_r(_d[38]),G=_r(_d[39]),U=_r(_d[40]),F=_r(_d[41]),K=_r(_d[42]),V=_r(_d[43]),Y=_r(_d[44]),q=_r(_d[45]),Q=_r(_d[46]),J=_r(_d[47]),X=_r(_d[48])},1341,[5,1342,11,1343,796,806,1112,1113,1091,1115,1111,1114,1328,1329,1100,1282,1012,1089,14,1344,1186,1345,1316,1081,1075,1090,34,102,794,1291,848,830,836,827,1267,840,1147,1096,1014,1346,1347,1136,1348,1177,985,1149,1324,852,25]); __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.GreensideCashOnly=function(){return(0,s.jsxs)(n.Card,{children:[(0,s.jsx)(n.T,{weight:"semibold",children:"Cash only"}),(0,s.jsx)(n.Muted,{children:"Card payments and online checkout are not enabled for The Greenside Restaurant. Deposits are off; the policy needs confirmation."})]})},r(d[0]);var n=r(d[1]),s=r(d[2])},1342,[34,794,25]); __d(function(g,_r,i,a,m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.VenueRequestList=function({rid:e,kind:n,hotel:c}){const y=(0,r.useSync)(),p='staff'===y.kind&&y.venueSlug===(0,s.queuedDatabaseSlug)(e)&&!!y.venueId&&(!['greenside','kirkton','abbotsford'].includes(e)&&!(0,s.isQueuedVenue)(e)||y.perms.includes('*')||y.perms.includes('venue.settings')),f=p&&(y.perms.includes('*')||y.perms.includes('room'===n||(0,s.isQueuedVenue)(e)||['greenside','kirkton','abbotsford'].includes(e)?'venue.settings':'bookings.manage')),[h,b]=(0,t.useState)([]),[j,q]=(0,t.useState)(''),[x,k]=(0,t.useState)(null),v=(0,t.useCallback)(async()=>{if(p)try{b(await(0,o.listVenueRequests)(y.venueId,n)),q('')}catch(e){q((0,o.requestMessage)(e))}},[p,n,y.venueId]);(0,t.useEffect)(()=>{const e=setTimeout(()=>{v()},0),s=setInterval(()=>{v()},15e3);return()=>{clearTimeout(e),clearInterval(s)}},[v]);const T=h.filter(e=>e.venue_id===y.venueId);if(!p)return null;const I=async(e,s)=>{if(!x){k(e);try{await(0,o.decideVenueRequest)(e,s),await v()}catch(e){q((0,o.requestMessage)(e))}finally{k(null)}}};return(0,u.jsxs)(d.default,{testID:`venue-${n}-requests`,style:{gap:12,alignItems:'stretch'},children:[(0,u.jsx)(l.H2,{children:'room'===n?'Room requests':'Table requests'}),(0,u.jsx)(l.T,{center:!0,children:"Requested bookings need a staff decision. No email or text is sent. Contact the guest to confirm arrangements."}),(0,u.jsx)(l.Button,{kind:"secondary",label:`Refresh ${n} requests`,onPress:()=>{v()}}),j?(0,u.jsx)(l.Banner,{kind:"warn",title:"Requests",children:j}):null,T.length||j?null:(0,u.jsxs)(l.T,{center:!0,children:["No ",n," requests yet."]}),T.map(e=>(0,u.jsx)(l.Card,{style:{alignItems:'stretch'},children:(0,u.jsxs)(d.default,{testID:`venue-request-${e.id}`,style:{gap:10},children:[(0,u.jsxs)(l.Row,{wrap:!0,children:[(0,u.jsx)(l.T,{weight:"semibold",children:e.payload.name}),(0,u.jsx)(l.Badge,{kind:'requested'===e.status?'amber':'confirmed'===e.status?'ok':'neutral',label:'requested'===e.status?'Requested':'confirmed'===e.status?'Confirmed':'Declined'})]}),(0,u.jsx)(l.T,{children:'table'===n?`${e.payload.date} \xb7 ${e.payload.service?e.payload.service+' \xb7 ':''}${e.payload.time} \xb7 ${e.payload.covers} Covers`:`${e.payload.checkIn} to ${e.payload.checkOut} \xb7 ${c?.roomTypes.find(s=>s.id===e.payload.roomType)?.name||e.payload.roomType} \xb7 ${e.payload.guests} guests`}),'room'===n?(0,u.jsxs)(l.T,{children:["Add dinner: ",e.payload.addDinner?'Yes \u2014 arrange with guest':'No']}):null,(0,u.jsxs)(l.T,{children:[e.payload.phone," \xb7 ",e.payload.email]}),e.payload.notes?(0,u.jsxs)(l.T,{children:["Notes: ",e.payload.notes]}):null,'requested'===e.status&&f?(0,u.jsxs)(l.Row,{wrap:!0,children:[(0,u.jsx)(l.Button,{label:x===e.id?'Saving\u2026':'Confirm',testID:`request-confirm-${e.id}`,disabled:!!x,onPress:()=>{I(e.id,'confirmed')}}),(0,u.jsx)(l.Button,{label:"Decline",kind:"secondary",testID:`request-decline-${e.id}`,disabled:!!x,onPress:()=>{I(e.id,'declined')}})]}):null,e.booking_id?(0,u.jsx)(l.T,{children:"Confirmed table booking is in the bookings list."}):null]})},e.id))]})};var e,s=_r(_d[0]),t=_r(_d[1]),n=_r(_d[2]),d=(e=n)&&e.__esModule?e:{default:e},l=_r(_d[3]),r=_r(_d[4]),o=_r(_d[5]),u=_r(_d[6])},1343,[6,34,102,794,985,1215,25]); __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,"untilWords",{enumerable:!0,get:function(){return w}}),_e.WixDepositLink=function({b:e,rid:x}){const f=(0,r.useRestaurant)(x),[S,j]=(0,s.useState)(!1),[C,D]=(0,s.useState)(!1),[L,I]=(0,s.useState)(null),[$,v]=(0,s.useState)(''),[P,T]=(0,s.useState)(''),[A,_]=(0,s.useState)(''),M=(0,c.depositOf)(f?.settings),O=e;if(n.IS_ISOLATED_VENUE||['souters','kirkmichael','wildings'].includes(x)||!f||!(0,c.canSendDepositLink)(O,M))return null;const B='open'===O.depositLink?.state,R=async()=>{j(!0),D(!0),T(''),I(null);try{const{data:t,error:n}=await(0,h.getSupabase)().functions.invoke('wix-deposit-link',{body:{booking_id:e.id}});if(n||!t)return void T(y);if(!t.ok||!t.url)return void T(t.off?y:String(t.error??y));const s={url:t.url,amountPence:t.amountPence,expiresAt:t.expiresAt};I(s),v((0,c.depositLinkMessage)({name:e.name,venue:f.name,partySize:e.partySize,date:e.date,time:e.time,amountPence:s.amountPence,url:s.url,expiresAt:s.expiresAt,terms:(0,c.depositTerms)(M)}))}catch{T(y)}finally{D(!1)}},W=async()=>{_('Checking\u2026');try{const{data:t,error:n}=await(0,h.getSupabase)().functions.invoke('wix-deposit-check',{body:{booking_id:e.id}});_(n||!t||t.off?'Website bookings deposit links are switched off, so nothing was checked.':'Checked with website bookings. If the guest has paid, the badge shows Deposit paid on website bookings.')}catch{_('Could not reach website bookings. Try again in a minute.')}},z=L?(0,k.waMeLink)(e.phone,$):null,E=L&&e.phone?(0,p.smsLink)(e.phone,$):null,U=L&&e.email?`mailto:${encodeURIComponent(e.email)}?subject=${encodeURIComponent(`${f.name} deposit`)}&body=${encodeURIComponent($)}`:null,F='undefined'!=typeof navigator&&!!navigator.clipboard,G=e=>{e&&o.default.openURL(e).catch(()=>{})};return(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(d.Button,{small:!0,kind:"secondary",label:B?'Send deposit link again':'Send deposit link',testID:`deposit-link-${e.id}`,accessibilityLabel:`${B?'Send the deposit link again to':'Send a website bookings deposit link to'} ${e.name}`,onPress:()=>{R()}}),B?(0,g.jsx)(d.Button,{small:!0,kind:"secondary",label:"Check if paid",testID:`deposit-check-${e.id}`,accessibilityLabel:`Check with website bookings if ${e.name} has paid the deposit`,onPress:()=>{W()}}):null,A?(0,g.jsx)(d.Muted,{size:13,children:A}):null,(0,g.jsx)(d.Sheet,{visible:S,onClose:()=>j(!1),title:"Send deposit link",testID:`deposit-link-sheet-${e.id}`,children:(0,g.jsxs)(l.default,{style:{gap:10},children:[C?(0,g.jsx)(d.T,{children:"Asking website bookings for the link\u2026"}):null,P?(0,g.jsx)(d.T,{colour:b.colours.amber,testID:"deposit-link-error",children:P}):null,L?(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(d.T,{weight:"semibold",children:`Deposit ${(0,u.gbp)(L.amountPence)} for ${e.partySize} guests.${L.expiresAt?` Link works until ${w(L.expiresAt)}.`:''}`}),(0,g.jsx)(d.T,{children:"Message to the guest (you can change it)"}),(0,g.jsx)(t.TextInput,{accessibilityLabel:"Message to the guest",testID:"deposit-link-message",value:$,multiline:!0,onChangeText:v,style:{minHeight:140,borderRadius:10,borderWidth:1,borderColor:b.colours.hairline,backgroundColor:b.colours.surface2,color:b.colours.text,padding:10,fontSize:15}}),(0,g.jsxs)(d.Row,{wrap:!0,gap:8,children:[E?(0,g.jsx)(d.Button,{label:"Text",testID:"deposit-link-sms",accessibilityLabel:`Open a text message to ${e.name} with the deposit link`,onPress:()=>G(E)}):null,z?(0,g.jsx)(d.Button,{kind:"secondary",label:"WhatsApp",testID:"deposit-link-wa",accessibilityLabel:`Open WhatsApp to ${e.name} with the deposit link`,onPress:()=>G(z)}):null,U?(0,g.jsx)(d.Button,{kind:"secondary",label:"Email",testID:"deposit-link-email",accessibilityLabel:`Open an email to ${e.name} with the deposit link`,onPress:()=>G(U)}):null,F?(0,g.jsx)(d.Button,{kind:"secondary",label:"Copy link",testID:"deposit-link-copy",accessibilityLabel:"Copy the deposit link",onPress:()=>{navigator.clipboard.writeText(L.url).catch(()=>{})}}):null]}),E||z||U?null:(0,g.jsx)(d.Muted,{children:"This booking has no phone number or email. Copy the link and send it another way."}),(0,g.jsx)(d.Muted,{size:13,children:"Tip: CoverCharge doesn't send anything. Each button opens your own messages app with the words filled in, and you press Send. Once the guest pays on website bookings, this booking shows Deposit paid on website bookings by itself. Refunds are done in Website bookings \u203a Orders."})]}):null,(0,g.jsx)(d.Button,{kind:"secondary",label:"Close",testID:"deposit-link-close",onPress:()=>j(!1)})]})})]})};var t=_r(_d[0]),n=_r(_d[1]),s=_r(_d[2]),o=e(_r(_d[3]));_r(_d[4]);var l=e(_r(_d[5])),d=_r(_d[6]),r=_r(_d[7]),c=_r(_d[8]),u=_r(_d[9]),p=_r(_d[10]),h=_r(_d[11]),b=_r(_d[12]),k=_r(_d[13]),g=_r(_d[14]);const y="Website bookings deposit links aren't switched on yet. Take the deposit by card or cash and tick Deposit paid.",w=e=>e?new Date(e).toLocaleString('en-GB',{timeZone:'Europe/London',weekday:'short',day:'numeric',month:'short',hour:'2-digit',minute:'2-digit',hourCycle:'h23'}):''},1344,[796,5,34,379,236,102,794,850,14,836,1017,931,840,1150,25]); diff --git a/owner-app/admin.html b/owner-app/admin.html index a106423e168fd2cad08e9a4f157130d8ee844a07..2162fcfda836a6ded4c66598f568eed6a514b797 100644 --- a/owner-app/admin.html +++ b/owner-app/admin.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/owner-app/customer.html b/owner-app/customer.html index a106423e168fd2cad08e9a4f157130d8ee844a07..2162fcfda836a6ded4c66598f568eed6a514b797 100644 --- a/owner-app/customer.html +++ b/owner-app/customer.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/owner-app/customer/anchorage.html b/owner-app/customer/anchorage.html index a106423e168fd2cad08e9a4f157130d8ee844a07..2162fcfda836a6ded4c66598f568eed6a514b797 100644 --- a/owner-app/customer/anchorage.html +++ b/owner-app/customer/anchorage.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/owner-app/customer/anchorage/book.html b/owner-app/customer/anchorage/book.html index a106423e168fd2cad08e9a4f157130d8ee844a07..2162fcfda836a6ded4c66598f568eed6a514b797 100644 --- a/owner-app/customer/anchorage/book.html +++ b/owner-app/customer/anchorage/book.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/owner-app/customer/anchorage/feedback.html b/owner-app/customer/anchorage/feedback.html index a106423e168fd2cad08e9a4f157130d8ee844a07..2162fcfda836a6ded4c66598f568eed6a514b797 100644 --- a/owner-app/customer/anchorage/feedback.html +++ b/owner-app/customer/anchorage/feedback.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/owner-app/customer/anchorage/gift.html b/owner-app/customer/anchorage/gift.html index a106423e168fd2cad08e9a4f157130d8ee844a07..2162fcfda836a6ded4c66598f568eed6a514b797 100644 --- a/owner-app/customer/anchorage/gift.html +++ b/owner-app/customer/anchorage/gift.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/owner-app/customer/anchorage/lost.html b/owner-app/customer/anchorage/lost.html index a106423e168fd2cad08e9a4f157130d8ee844a07..2162fcfda836a6ded4c66598f568eed6a514b797 100644 --- a/owner-app/customer/anchorage/lost.html +++ b/owner-app/customer/anchorage/lost.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/owner-app/customer/anchorage/loyalty.html b/owner-app/customer/anchorage/loyalty.html index a106423e168fd2cad08e9a4f157130d8ee844a07..2162fcfda836a6ded4c66598f568eed6a514b797 100644 --- a/owner-app/customer/anchorage/loyalty.html +++ b/owner-app/customer/anchorage/loyalty.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/owner-app/customer/anchorage/merch.html b/owner-app/customer/anchorage/merch.html index a106423e168fd2cad08e9a4f157130d8ee844a07..2162fcfda836a6ded4c66598f568eed6a514b797 100644 --- a/owner-app/customer/anchorage/merch.html +++ b/owner-app/customer/anchorage/merch.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/owner-app/customer/anchorage/offers.html b/owner-app/customer/anchorage/offers.html index a106423e168fd2cad08e9a4f157130d8ee844a07..2162fcfda836a6ded4c66598f568eed6a514b797 100644 --- a/owner-app/customer/anchorage/offers.html +++ b/owner-app/customer/anchorage/offers.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/owner-app/customer/anchorage/refer.html b/owner-app/customer/anchorage/refer.html index a106423e168fd2cad08e9a4f157130d8ee844a07..2162fcfda836a6ded4c66598f568eed6a514b797 100644 --- a/owner-app/customer/anchorage/refer.html +++ b/owner-app/customer/anchorage/refer.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/owner-app/customer/anchorage/waitlist.html b/owner-app/customer/anchorage/waitlist.html index a106423e168fd2cad08e9a4f157130d8ee844a07..2162fcfda836a6ded4c66598f568eed6a514b797 100644 --- a/owner-app/customer/anchorage/waitlist.html +++ b/owner-app/customer/anchorage/waitlist.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/owner-app/customer/anchorage/whatson.html b/owner-app/customer/anchorage/whatson.html index a106423e168fd2cad08e9a4f157130d8ee844a07..2162fcfda836a6ded4c66598f568eed6a514b797 100644 --- a/owner-app/customer/anchorage/whatson.html +++ b/owner-app/customer/anchorage/whatson.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/owner-app/customer/basket.html b/owner-app/customer/basket.html index a106423e168fd2cad08e9a4f157130d8ee844a07..2162fcfda836a6ded4c66598f568eed6a514b797 100644 --- a/owner-app/customer/basket.html +++ b/owner-app/customer/basket.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/owner-app/customer/profile.html b/owner-app/customer/profile.html index a106423e168fd2cad08e9a4f157130d8ee844a07..2162fcfda836a6ded4c66598f568eed6a514b797 100644 --- a/owner-app/customer/profile.html +++ b/owner-app/customer/profile.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/owner-app/demo.html b/owner-app/demo.html index a106423e168fd2cad08e9a4f157130d8ee844a07..2162fcfda836a6ded4c66598f568eed6a514b797 100644 --- a/owner-app/demo.html +++ b/owner-app/demo.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/owner-app/display.html b/owner-app/display.html index a106423e168fd2cad08e9a4f157130d8ee844a07..2162fcfda836a6ded4c66598f568eed6a514b797 100644 --- a/owner-app/display.html +++ b/owner-app/display.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/owner-app/index.html b/owner-app/index.html index 6c5e9d250d78391b8a5aac34d7863313ab864b68..77a1df008dad9b076ef55375bedcb1dd672430d0 100644 --- a/owner-app/index.html +++ b/owner-app/index.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/owner-app/kitchen.html b/owner-app/kitchen.html index a106423e168fd2cad08e9a4f157130d8ee844a07..2162fcfda836a6ded4c66598f568eed6a514b797 100644 --- a/owner-app/kitchen.html +++ b/owner-app/kitchen.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/owner-app/owner.html b/owner-app/owner.html index a106423e168fd2cad08e9a4f157130d8ee844a07..2162fcfda836a6ded4c66598f568eed6a514b797 100644 --- a/owner-app/owner.html +++ b/owner-app/owner.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/owner-app/staff.html b/owner-app/staff.html index a106423e168fd2cad08e9a4f157130d8ee844a07..2162fcfda836a6ded4c66598f568eed6a514b797 100644 --- a/owner-app/staff.html +++ b/owner-app/staff.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/owner-app/sw.js b/owner-app/sw.js index 2f02a9a47b539e53913ccf0969ce2760d9cf583b..951130b7abe79f8d2d59f80eb7c5c4b70e63f4cf 100644 --- a/owner-app/sw.js +++ b/owner-app/sw.js @@ -1,7 +1,7 @@ // Anchorage Manager service worker: precache the app shell so it opens offline after the first visit. -const V = "cc-owner-52b2df90a8"; +const V = "cc-owner-f0b8800611"; const BASE = "/owner-app/"; -const PRECACHE = ["/owner-app/apple-touch-icon.png", "/owner-app/assets/assets/brand/3idiots-hero.e5dfd53739f05086b1956e72d585a66a.png", "/owner-app/assets/assets/brand/3idiots.df4a76d2130f0e5b0042f06a8c88693a.png", "/owner-app/assets/assets/brand/abbotsford-hero.78fcb8ee06ee22c4ca659c9254db7512.png", "/owner-app/assets/assets/brand/abbotsford.b26602bba5ce4969733c5422a45ad053.png", "/owner-app/assets/assets/brand/anchorage-hero.0450b828e4f9c1f4456240096598f6f5.png", "/owner-app/assets/assets/brand/anchorage.fea5ce2f6fd18bf2950aa21c0980ed8e.png", "/owner-app/assets/assets/brand/brae.8de9e89ac30966c6669de990370d8e40.png", "/owner-app/assets/assets/brand/cecchinis-hero.f77780fcc94fd668cf35d66d6dc52d81.png", "/owner-app/assets/assets/brand/cecchinis.ebf752fef363247848ae7c0d91938765.png", "/owner-app/assets/assets/brand/drunkencoo-hero.65c21c4da9e466cf4bffc969639a1427.png", "/owner-app/assets/assets/brand/drunkencoo.f6d92af3b14e4205a3deaf4434754c51.png", "/owner-app/assets/assets/brand/greenside-hero.1caec5a6cb939434cccb5f3a613b50f8.png", "/owner-app/assets/assets/brand/greenside.9d1556db97dcb903a3c57e2063ee2255.png", "/owner-app/assets/assets/brand/kirkmichael-hero.63b13cde7fd82eb622622b39ac80c394.png", "/owner-app/assets/assets/brand/kirkmichael.63b13cde7fd82eb622622b39ac80c394.png", "/owner-app/assets/assets/brand/kirkton-hero.9d0837b292c2f4f30f4521d806bb28c3.png", "/owner-app/assets/assets/brand/kirkton.bcf8d846df4861474d224a7a77f498fb.png", "/owner-app/assets/assets/brand/mrbasrais-hero.4ce74641cfcf52d099157c84005b9d2a.png", "/owner-app/assets/assets/brand/mrbasrais.7cc4086dd12ace82529795f1c9f8c900.png", "/owner-app/assets/assets/brand/pizzaioli-hero.1896657c08264cefb49b401891d5448d.png", "/owner-app/assets/assets/brand/pizzaioli.db8c000b62ee407121aa8b90ce45e170.png", "/owner-app/assets/assets/brand/rupeeroom-hero.969fa372add526aaacf3a6c009b8ac92.png", "/owner-app/assets/assets/brand/rupeeroom.689e6fb536dc0845eeb174a1ec7bd346.png", "/owner-app/assets/assets/brand/saltmarsh.85a6a65732635e5148478d743d9ca884.png", "/owner-app/assets/assets/brand/smokinggoat-hero.0588f17ef0eed7f757f22916cd4d37db.png", "/owner-app/assets/assets/brand/smokinggoat.20a3a1970596ab43c5d6468d4ed549a7.png", "/owner-app/assets/assets/brand/souters.f4c58d9349b6e1700fe5abcc9e9b665c.png", "/owner-app/assets/assets/brand/wildings-hero-logo-text.4661e4b935726f2511f9c17a1567c89a.png", "/owner-app/assets/assets/brand/wildings.076f4fcd06d19a0af0205c410f461b14.png", "/owner-app/assets/assets/brand/williewastles-hero.b9d53d27b66f903b5618a7177b2ffad4.png", "/owner-app/assets/assets/brand/williewastles.055a77893ced99bf3a6c5402ba5baac6.png", "/owner-app/assets/assets/brand/yasmins-hero.a5aef62e37dfcecbe0afc056186f4ad9.png", "/owner-app/assets/assets/brand/yasmins.8482602e9f0a965655924835625cb02b.png", "/owner-app/assets/assets/recipes/fishsupper.1609c58319e1e8721f5c639049fb054e.jpg", "/owner-app/assets/assets/recipes/lobster.2fb3485c8e372972099259017358c1b8.jpg", "/owner-app/assets/assets/recipes/moules.a4f342fc7e7fb62c8a0b5c1678bbea3f.jpg", "/owner-app/assets/assets/recipes/skink.4ce7b7c676f9cdcd0a060eda46f5a00e.jpg", "/owner-app/assets/assets/recipes/stp.1061ced765efdcafff2554adc3fc7113.jpg", "/owner-app/assets/assets/specials/sample-chalkboard.e7b4e4450a8483d4219bc6a214158d8f.jpg", "/owner-app/assets/node_modules/@expo-google-fonts/poppins/400Regular/Poppins_400Regular.093ee89be9ede30383f39a899c485a82.ttf", "/owner-app/assets/node_modules/@expo-google-fonts/poppins/500Medium/Poppins_500Medium.bf59c687bc6d3a70204d3944082c5cc0.ttf", "/owner-app/assets/node_modules/@expo-google-fonts/poppins/600SemiBold/Poppins_600SemiBold.6f1520d107205975713ba09df778f93f.ttf", "/owner-app/assets/node_modules/@expo-google-fonts/poppins/700Bold/Poppins_700Bold.08c20a487911694291bd8c5de41315ad.ttf", "/owner-app/assets/node_modules/expo-router/assets/arrow_down.017bc6ba3fc25503e5eb5e53826d48a8.png", "/owner-app/assets/node_modules/expo-router/assets/error.d1ea1496f9057eb392d5bbf3732a61b7.png", "/owner-app/assets/node_modules/expo-router/assets/file.19eeb73b9593a38f8e9f418337fc7d10.png", "/owner-app/assets/node_modules/expo-router/assets/forward.d8b800c443b8972542883e0b9de2bdc6.png", "/owner-app/assets/node_modules/expo-router/assets/pkg.ab19f4cbc543357183a20571f68380a3.png", "/owner-app/assets/node_modules/expo-router/assets/react-navigation/elements/back-icon-mask.0a328cd9c1afd0afe8e3b1ec5165b1b4.png", "/owner-app/assets/node_modules/expo-router/assets/react-navigation/elements/back-icon.35ba0eaec5a4f5ed12ca16fabeae451d.png", "/owner-app/assets/node_modules/expo-router/assets/react-navigation/elements/clear-icon.c94f6478e7ae0cdd9f15de1fcb9e5e55.png", "/owner-app/assets/node_modules/expo-router/assets/react-navigation/elements/clear-icon.c94f6478e7ae0cdd9f15de1fcb9e5e55@2x.png", "/owner-app/assets/node_modules/expo-router/assets/react-navigation/elements/clear-icon.c94f6478e7ae0cdd9f15de1fcb9e5e55@3x.png", "/owner-app/assets/node_modules/expo-router/assets/react-navigation/elements/clear-icon.c94f6478e7ae0cdd9f15de1fcb9e5e55@4x.png", "/owner-app/assets/node_modules/expo-router/assets/react-navigation/elements/close-icon.808e1b1b9b53114ec2838071a7e6daa7.png", "/owner-app/assets/node_modules/expo-router/assets/react-navigation/elements/close-icon.808e1b1b9b53114ec2838071a7e6daa7@2x.png", "/owner-app/assets/node_modules/expo-router/assets/react-navigation/elements/close-icon.808e1b1b9b53114ec2838071a7e6daa7@3x.png", "/owner-app/assets/node_modules/expo-router/assets/react-navigation/elements/close-icon.808e1b1b9b53114ec2838071a7e6daa7@4x.png", "/owner-app/assets/node_modules/expo-router/assets/react-navigation/elements/search-icon.286d67d3f74808a60a78d3ebf1a5fb57.png", "/owner-app/assets/node_modules/expo-router/assets/sitemap.412dd9275b6b48ad28f5e3d81bb1f626.png", "/owner-app/assets/node_modules/expo-router/assets/unmatched.20e71bdf79e3a97bf55fd9e164041578.png", "/owner-app/brand-logo.png", "/owner-app/favicon.ico", "/owner-app/icon-192.png", "/owner-app/icon-512.png", "/owner-app/icon-maskable-192.png", "/owner-app/icon-maskable-512.png", "/owner-app/manifest.webmanifest", "/owner-app/index.html", "/owner-app/_expo/static/js/web/bundle.js?v=52b2df90a81b86ae4c9de2959a8b626d69f92d17b8823906aeeeba3fb99a96d6"]; +const PRECACHE = ["/owner-app/apple-touch-icon.png", "/owner-app/assets/assets/brand/3idiots-hero.e5dfd53739f05086b1956e72d585a66a.png", "/owner-app/assets/assets/brand/3idiots.df4a76d2130f0e5b0042f06a8c88693a.png", "/owner-app/assets/assets/brand/abbotsford-hero.78fcb8ee06ee22c4ca659c9254db7512.png", "/owner-app/assets/assets/brand/abbotsford.b26602bba5ce4969733c5422a45ad053.png", "/owner-app/assets/assets/brand/anchorage-hero.0450b828e4f9c1f4456240096598f6f5.png", "/owner-app/assets/assets/brand/anchorage.fea5ce2f6fd18bf2950aa21c0980ed8e.png", "/owner-app/assets/assets/brand/brae.8de9e89ac30966c6669de990370d8e40.png", "/owner-app/assets/assets/brand/cecchinis-hero.f77780fcc94fd668cf35d66d6dc52d81.png", "/owner-app/assets/assets/brand/cecchinis.ebf752fef363247848ae7c0d91938765.png", "/owner-app/assets/assets/brand/drunkencoo-hero.65c21c4da9e466cf4bffc969639a1427.png", "/owner-app/assets/assets/brand/drunkencoo.f6d92af3b14e4205a3deaf4434754c51.png", "/owner-app/assets/assets/brand/greenside-hero.1caec5a6cb939434cccb5f3a613b50f8.png", "/owner-app/assets/assets/brand/greenside.9d1556db97dcb903a3c57e2063ee2255.png", "/owner-app/assets/assets/brand/kirkmichael-hero.63b13cde7fd82eb622622b39ac80c394.png", "/owner-app/assets/assets/brand/kirkmichael.63b13cde7fd82eb622622b39ac80c394.png", "/owner-app/assets/assets/brand/kirkton-hero.9d0837b292c2f4f30f4521d806bb28c3.png", "/owner-app/assets/assets/brand/kirkton.bcf8d846df4861474d224a7a77f498fb.png", "/owner-app/assets/assets/brand/mrbasrais-hero.4ce74641cfcf52d099157c84005b9d2a.png", "/owner-app/assets/assets/brand/mrbasrais.7cc4086dd12ace82529795f1c9f8c900.png", "/owner-app/assets/assets/brand/pizzaioli-hero.1896657c08264cefb49b401891d5448d.png", "/owner-app/assets/assets/brand/pizzaioli.db8c000b62ee407121aa8b90ce45e170.png", "/owner-app/assets/assets/brand/rupeeroom-hero.969fa372add526aaacf3a6c009b8ac92.png", "/owner-app/assets/assets/brand/rupeeroom.689e6fb536dc0845eeb174a1ec7bd346.png", "/owner-app/assets/assets/brand/saltmarsh.85a6a65732635e5148478d743d9ca884.png", "/owner-app/assets/assets/brand/smokinggoat-hero.0588f17ef0eed7f757f22916cd4d37db.png", "/owner-app/assets/assets/brand/smokinggoat.20a3a1970596ab43c5d6468d4ed549a7.png", "/owner-app/assets/assets/brand/souters.f4c58d9349b6e1700fe5abcc9e9b665c.png", "/owner-app/assets/assets/brand/wildings-hero-logo-text.4661e4b935726f2511f9c17a1567c89a.png", "/owner-app/assets/assets/brand/wildings.076f4fcd06d19a0af0205c410f461b14.png", "/owner-app/assets/assets/brand/williewastles-hero.b9d53d27b66f903b5618a7177b2ffad4.png", "/owner-app/assets/assets/brand/williewastles.055a77893ced99bf3a6c5402ba5baac6.png", "/owner-app/assets/assets/brand/yasmins-hero.a5aef62e37dfcecbe0afc056186f4ad9.png", "/owner-app/assets/assets/brand/yasmins.8482602e9f0a965655924835625cb02b.png", "/owner-app/assets/assets/recipes/fishsupper.1609c58319e1e8721f5c639049fb054e.jpg", "/owner-app/assets/assets/recipes/lobster.2fb3485c8e372972099259017358c1b8.jpg", "/owner-app/assets/assets/recipes/moules.a4f342fc7e7fb62c8a0b5c1678bbea3f.jpg", "/owner-app/assets/assets/recipes/skink.4ce7b7c676f9cdcd0a060eda46f5a00e.jpg", "/owner-app/assets/assets/recipes/stp.1061ced765efdcafff2554adc3fc7113.jpg", "/owner-app/assets/assets/specials/sample-chalkboard.e7b4e4450a8483d4219bc6a214158d8f.jpg", "/owner-app/assets/node_modules/@expo-google-fonts/poppins/400Regular/Poppins_400Regular.093ee89be9ede30383f39a899c485a82.ttf", "/owner-app/assets/node_modules/@expo-google-fonts/poppins/500Medium/Poppins_500Medium.bf59c687bc6d3a70204d3944082c5cc0.ttf", "/owner-app/assets/node_modules/@expo-google-fonts/poppins/600SemiBold/Poppins_600SemiBold.6f1520d107205975713ba09df778f93f.ttf", "/owner-app/assets/node_modules/@expo-google-fonts/poppins/700Bold/Poppins_700Bold.08c20a487911694291bd8c5de41315ad.ttf", "/owner-app/assets/node_modules/expo-router/assets/arrow_down.017bc6ba3fc25503e5eb5e53826d48a8.png", "/owner-app/assets/node_modules/expo-router/assets/error.d1ea1496f9057eb392d5bbf3732a61b7.png", "/owner-app/assets/node_modules/expo-router/assets/file.19eeb73b9593a38f8e9f418337fc7d10.png", "/owner-app/assets/node_modules/expo-router/assets/forward.d8b800c443b8972542883e0b9de2bdc6.png", "/owner-app/assets/node_modules/expo-router/assets/pkg.ab19f4cbc543357183a20571f68380a3.png", "/owner-app/assets/node_modules/expo-router/assets/react-navigation/elements/back-icon-mask.0a328cd9c1afd0afe8e3b1ec5165b1b4.png", "/owner-app/assets/node_modules/expo-router/assets/react-navigation/elements/back-icon.35ba0eaec5a4f5ed12ca16fabeae451d.png", "/owner-app/assets/node_modules/expo-router/assets/react-navigation/elements/clear-icon.c94f6478e7ae0cdd9f15de1fcb9e5e55.png", "/owner-app/assets/node_modules/expo-router/assets/react-navigation/elements/clear-icon.c94f6478e7ae0cdd9f15de1fcb9e5e55@2x.png", "/owner-app/assets/node_modules/expo-router/assets/react-navigation/elements/clear-icon.c94f6478e7ae0cdd9f15de1fcb9e5e55@3x.png", "/owner-app/assets/node_modules/expo-router/assets/react-navigation/elements/clear-icon.c94f6478e7ae0cdd9f15de1fcb9e5e55@4x.png", "/owner-app/assets/node_modules/expo-router/assets/react-navigation/elements/close-icon.808e1b1b9b53114ec2838071a7e6daa7.png", "/owner-app/assets/node_modules/expo-router/assets/react-navigation/elements/close-icon.808e1b1b9b53114ec2838071a7e6daa7@2x.png", "/owner-app/assets/node_modules/expo-router/assets/react-navigation/elements/close-icon.808e1b1b9b53114ec2838071a7e6daa7@3x.png", "/owner-app/assets/node_modules/expo-router/assets/react-navigation/elements/close-icon.808e1b1b9b53114ec2838071a7e6daa7@4x.png", "/owner-app/assets/node_modules/expo-router/assets/react-navigation/elements/search-icon.286d67d3f74808a60a78d3ebf1a5fb57.png", "/owner-app/assets/node_modules/expo-router/assets/sitemap.412dd9275b6b48ad28f5e3d81bb1f626.png", "/owner-app/assets/node_modules/expo-router/assets/unmatched.20e71bdf79e3a97bf55fd9e164041578.png", "/owner-app/brand-logo.png", "/owner-app/favicon.ico", "/owner-app/icon-192.png", "/owner-app/icon-512.png", "/owner-app/icon-maskable-192.png", "/owner-app/icon-maskable-512.png", "/owner-app/manifest.webmanifest", "/owner-app/index.html", "/owner-app/_expo/static/js/web/bundle.js?v=f0b8800611a81f13214e6ec76361f3c2e60f682ffdb4184f7dc6ed3153f1c968"]; // Hugging Face serves large files (fonts) through a redirect to its CDN. Browsers refuse to hand a *redirected* cached // response to a page, so store a plain copy instead (otherwise fonts, and so the app, fail to load offline). 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); diff --git a/owner-app/team.html b/owner-app/team.html index a106423e168fd2cad08e9a4f157130d8ee844a07..2162fcfda836a6ded4c66598f568eed6a514b797 100644 --- a/owner-app/team.html +++ b/owner-app/team.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/staff-app/_expo/static/js/web/bundle.js b/staff-app/_expo/static/js/web/bundle.js index 0dd023a7f31fad6bde236ebd4f272e4d297b8b6d..cd07a2fcf982a432f7d26d9b1dbe03597a03e55a 100644 --- a/staff-app/_expo/static/js/web/bundle.js +++ b/staff-app/_expo/static/js/web/bundle.js @@ -1122,7 +1122,7 @@ __d(function(g,r,i,a,m,e,d){m.exports=r(d[0])},1038,[1039]); __d(function(g,r,i,a,m,e,d){function n(n,t){const o=globalThis[`${__METRO_GLOBAL_PREFIX__??''}__loadBundleAsync`];if(null!=o){const s=String(n);if(null!=t){const n=t[s];if(null!=n)return o(n)}}}function t(t,o,s){const u=()=>r.importAll(t,s);{const l=o?.[String(t)];if(Array.isArray(l)){const c=globalThis[`${__METRO_GLOBAL_PREFIX__??''}__loadBundleAsync`];if(c?.isReady?.(l))return u();const f=n(t,o);if(null!=f)return f.then(u);throw new Error(`Cannot import module ${s??t}: the async bundle loader is unavailable. Load the initial Expo bundle before importing these chunks: ${l.join(', ')}`)}try{return u()}catch(s){const l=n(t,o);if(null!=l)return l.then(u);throw s}}const l=n(t,o);return null!=l?l.then(u):u()}function o(n,o,s){const u=t(n,o,s),l=Promise.resolve(u);return l._result=u,l}o.unstable_importMaybeSync=function(n,o){return t(n,o)},o.prefetch=function(t,o,s){n(t,o)?.then(()=>{},()=>{})},o.unstable_resolve=function(n,t){if(!t)throw new Error('Bundle splitting is required for Web Worker imports');const o=t[n];if(!o)throw new Error('Worker import is missing from split bundle paths: '+o);return o},o.unstable_createWorker=function(n,t){if('undefined'==typeof crossOriginIsolated||!crossOriginIsolated)return new Worker(n,t);try{const s=(o=n,`\n const ASYNC_WORKER_BASE = ${JSON.stringify(o)};\n const IMPORT_SCRIPTS = importScripts;\n const FETCH = fetch;\n const fromBaseURL = (input) => new URL(input, ASYNC_WORKER_BASE).href;\n self.fetch = function(input, init) {\n return FETCH(typeof input === 'string' ? fromBaseURL(input) : input, init);\n };\n self.importScripts = function(...urls) {\n return IMPORT_SCRIPTS.apply(self, urls.map(fromBaseURL));\n };\n importScripts(ASYNC_WORKER_BASE);\n `);return n=URL.createObjectURL(new Blob([s],{type:'text/javascript'})),new Worker(n,t)}finally{URL.revokeObjectURL(n)}var o},m.exports=o},1039,[]); __d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"currentScrollY",{enumerable:!0,get:function(){return u}}),Object.defineProperty(_e,"screenGeneration",{enumerable:!0,get:function(){return c}}),Object.defineProperty(_e,"restoreScroll",{enumerable:!0,get:function(){return o}}),_e.useScrollMemory=function(u){const c=(0,e.useRef)(0),o=(0,e.useRef)(0),l=(0,e.useRef)(0),s=(0,e.useRef)(0),f=(0,e.useRef)(0),v=(0,e.useRef)(null),y=(0,e.useRef)([]),h=()=>{y.current.forEach(clearTimeout),y.current=[]},b=()=>{const e=v.current;null!=e&&(u.current?.scrollTo({y:e,animated:!1}),f.current-s.current>=e-2&&(c.current=e,o.current=e,v.current=null,h()))},p=(0,e.useCallback)(e=>{if(h(),v.current=Math.max(0,e),e<=0)return v.current=null,u.current?.scrollTo({y:0,animated:!1}),c.current=0,void(o.current=0);for(const e of[0,30,80,160,320,600,1e3,1600,2500])y.current.push(setTimeout(b,e));y.current.push(setTimeout(()=>{v.current=null},2600))},[]);t={y:()=>o.current,restore:p};const R=(0,e.useCallback)(()=>{n++;return o.current},[]);return{props:{scrollEventThrottle:32,onScroll:e=>{const t=e.nativeEvent.contentOffset.y;c.current=t,s.current=e.nativeEvent.layoutMeasurement.height,f.current=e.nativeEvent.contentSize.height,Date.now()-l.current>250&&null==v.current&&(o.current=t)},onScrollBeginDrag:()=>{v.current=null,h()},onContentSizeChange:(e,t)=>{f.current=t,l.current=Date.now(),b()},onLayout:e=>{s.current=e.nativeEvent.layout.height}},restore:p,leave:R}};var e=r(d[0]);let t=null,n=0;const u=()=>t?t.y():0,c=()=>n,o=e=>t?.restore(e)},1040,[34]); __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,"useBackLayers",{enumerable:!0,get:function(){return f}}),_e.runBackLayer=function(){const e=f.getState().layers,t=e[e.length-1];return!!t&&(t.fn(),!0)},_e.useBackLayer=function(e,n,o=!0){const s=(0,t.useRef)(n);s.current=n,(0,t.useEffect)(()=>{if(!e)return;const t=++y,n=(0,u.currentScrollY)(),l=(0,u.screenGeneration)();return f.setState(e=>({layers:[...e.layers,{id:t,fn:()=>s.current(),own:o}]})),()=>{f.setState(e=>({layers:e.layers.filter(e=>e.id!==t)})),(0,u.screenGeneration)()===l&&(0,u.restoreScroll)(n)}},[e,o])},Object.defineProperty(_e,"useInnerBackShown",{enumerable:!0,get:function(){return w}}),Object.defineProperty(_e,"BACK_GUTTER",{enumerable:!0,get:function(){return p}}),_e.BackTitleRow=function({back:e,onBack:n,title:s}){const[l,u]=(0,t.useState)(0),[f,y]=(0,t.useState)({w:96,h:48}),[w,b]=(0,t.useState)(0),S=Array.from(new Set(String(s??'').split(/\s+/).filter(Boolean)));String(s??'').length>=20&&S.length>=3&&S.push('00000000');const v=Math.max(p,Math.ceil(f.w)+4),j=e&&l>0&&l-2*vu(Math.round(e.nativeEvent.layout.width)),style:{minHeight:44,justifyContent:'center',alignItems:'center',paddingHorizontal:e&&!j?v:0,paddingTop:j?f.h:0},children:[e?(0,h.jsx)(o.default,{style:{position:'absolute',left:0,top:0},onLayout:e=>{const t=Math.round(e.nativeEvent.layout.width),n=Math.round(e.nativeEvent.layout.height);y(e=>e.w===t&&e.h===n?e:{w:t,h:n})},children:(0,h.jsx)(g,{onPress:n})}):null,(0,h.jsx)(c.T,{size:22,weight:"bold",center:!0,accessibilityRole:"header",children:s}),e&&S.length?(0,h.jsx)(o.default,{"aria-hidden":!0,importantForAccessibility:"no-hide-descendants",pointerEvents:"none",style:{position:'absolute',left:0,top:0,opacity:0,alignItems:'flex-start'},onLayout:e=>b(Math.ceil(e.nativeEvent.layout.width)),children:S.map(e=>(0,h.jsx)(c.T,{size:22,weight:"bold",numberOfLines:1,style:{alignSelf:'flex-start'},children:e},e))}):null]})},_e.BackButton=g,_e.useWebBack=function(e){const n=(0,t.useRef)(e);n.current=e,(0,t.useEffect)(()=>{if('undefined'==typeof window||!window.history?.pushState)return;const e=()=>{try{window.history.pushState({...window.history.state??{},ccBack:Date.now()},'',window.location.href)}catch{}};e();const t=t=>{n.current()&&(t.stopImmediatePropagation?.(),e())};return window.addEventListener('popstate',t,!0),()=>window.removeEventListener('popstate',t,!0)},[])};var t=r(d[0]);r(d[1]);var n=e(r(d[2])),o=e(r(d[3])),s=r(d[4]),l=r(d[5]),c=r(d[6]),u=r(d[7]),h=r(d[8]);const f=(0,s.create)(()=>({layers:[]}));let y=0;const w=()=>f(e=>e.layers.some(e=>e.own)),p=100;function g({onPress:e,testID:t="screen-back",label:o="Back"}){return(0,h.jsx)(n.default,{testID:t,accessibilityRole:"button",accessibilityLabel:o,onPress:e,hitSlop:8,style:({pressed:e})=>({minHeight:48,minWidth:96,justifyContent:'center',paddingRight:12,opacity:e?.6:1,alignSelf:'flex-start'}),children:(0,h.jsxs)(c.T,{size:18,weight:"semibold",colour:l.colours.gold,children:["\u2039 ",o]})})}},1041,[34,236,402,102,815,840,794,1040,25]); -__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"APP_VERSION",{enumerable:!0,get:function(){return t}});const t='v0.3.12.121'},1042,[]); +__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"APP_VERSION",{enumerable:!0,get:function(){return t}});const t='v0.3.12.122'},1042,[]); __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.NotificationsSettings=function({rid:e}){(0,n.useEffect)(()=>{c.useNotifs.getState().ensure(e),(0,j.readPushLive)()},[e]);const t=(0,c.useNotifs)(e=>e.items).filter(t=>t.rid===e&&!t.removed),s=(0,h.useOwner)(e=>e.staff),o=(0,j.usePushLive)(),[l,p]=(0,n.useState)(null),[f,g]=(0,n.useState)(null),[x,b]=(0,n.useState)(!1),y=c.useNotifs.getState(),T=s.map(e=>({id:e.id,role:e.role,level:e.level,job:e.job,department:e.dept,active:e.active})),v=e=>{const t=(0,u.resolveRecipients)(e,T,[]),n=[...e.recipients.groups.map(e=>u.NOTIF_GROUP_LABEL[e]),...(e.recipients.onShiftIn??[]).map(e=>u.SHIFT_FILTER_LABEL[e])];e.recipients.fallback&&n.push(`else ${[...e.recipients.fallback.groups.map(e=>u.NOTIF_GROUP_LABEL[e]),...e.recipients.fallback.staff.map(e=>I(s.find(t=>t.id===e)?.name??e))].join(', ')}`);const o=e.recipients.staff.map(e=>I(s.find(t=>t.id===e)?.name??e));return[...n,...o].join(', ')+(t.length||(e.recipients.onShiftIn??[]).length?'':' (nobody yet)')};return(0,k.jsxs)(a.default,{style:{gap:10},testID:"notif-settings",children:[(0,k.jsx)(r.Muted,{size:13,children:"Tip: these remind people at a set time, e.g. the Mills milk order. They show in the app as a gold slider with Done and Later. Done is logged with the name and time. Times are UK time."}),(0,k.jsxs)(a.default,{testID:"push-live-status",style:{borderWidth:1,borderColor:d.colours.accentBorder,borderRadius:10,padding:8,gap:4},children:[(0,k.jsxs)(r.Row,{style:{justifyContent:'space-between'},children:[(0,k.jsx)(r.T,{weight:"semibold",children:"Send to phones"}),(0,k.jsx)(r.Badge,{kind:o.live?'gold':'neutral',label:o.live?'ON':'OFF'})]}),(0,k.jsx)(r.Muted,{size:12,children:o.live?'Phone notifications go to people who turned them on.':'Off: nothing goes to anyone\u2019s phone yet. In-app reminders still work.'}),(0,k.jsx)(r.Button,{small:!0,kind:"secondary",testID:"push-live-toggle",label:o.live?'Switch phone notifications off':'Switch phone notifications on\u2026',onPress:()=>b(!0)})]}),(0,k.jsx)(R,{}),t.map(e=>l===e.id?(0,k.jsx)(D,{init:e,onCancel:()=>p(null),onSave:t=>{y.update(e.id,t),p(null)}},e.id):(0,k.jsxs)(a.default,{testID:`notif-${e.seed??e.id}`,style:{borderWidth:1,borderColor:d.colours.hairline,borderRadius:12,padding:10,gap:4,opacity:e.paused?.6:1},children:[(0,k.jsxs)(r.Row,{style:{justifyContent:'space-between'},children:[(0,k.jsx)(r.T,{weight:"semibold",style:{flex:1},children:e.title}),e.paused?(0,k.jsx)(r.Badge,{kind:"neutral",label:"Off"}):null]}),(0,k.jsx)(r.Muted,{size:13,children:e.message}),(0,k.jsxs)(r.Muted,{size:12,children:[(0,u.scheduleText)(e)," \xb7 ",v(e)," \xb7 ",[e.sendBy.inApp?'In app':'',e.sendBy.push?'Phone':''].filter(Boolean).join(' + ')]}),(0,k.jsxs)(r.Row,{gap:6,children:[(0,k.jsx)(r.Button,{small:!0,kind:"secondary",testID:`notif-edit-${e.seed??e.id}`,label:"Edit",onPress:()=>p(e.id)}),(0,k.jsx)(r.Button,{small:!0,kind:"ghost",label:e.paused?'Switch on':'Switch off',onPress:()=>y.update(e.id,{paused:!e.paused})}),(0,k.jsx)(r.Button,{small:!0,kind:"ghost",label:"Remove",onPress:()=>g(e)})]})]},e.id)),'new'===l?(0,k.jsx)(D,{init:C,onCancel:()=>p(null),onSave:t=>{y.add(e,t),p(null)}}):(0,k.jsx)(r.Button,{small:!0,testID:"notif-add",label:"Add a notification",onPress:()=>p('new')}),(0,k.jsxs)(r.Sheet,{visible:!!f,onClose:()=>g(null),title:"Remove this notification?",children:[(0,k.jsx)(r.T,{children:f?.title}),(0,k.jsx)(r.Muted,{children:"Nobody gets it after this. Reset to default restores the configured rules."}),(0,k.jsxs)(r.Row,{gap:8,children:[(0,k.jsx)(r.Button,{label:"Remove",onPress:()=>{f&&y.remove(f.id),g(null)}}),(0,k.jsx)(r.Button,{kind:"ghost",label:"Cancel",onPress:()=>g(null)})]})]}),(0,k.jsxs)(r.Sheet,{visible:x,onClose:()=>b(!1),title:o.live?'Switch phone notifications off?':'Switch phone notifications on?',testID:"push-live-confirm",children:[(0,k.jsx)(r.T,{children:o.live?'Nothing more goes to phones. In-app reminders keep working.':'From the next scheduled time, everyone ticked on a notification with \u201cPhone notification\u201d gets it on any phone where they turned phone notifications on.'}),(0,k.jsxs)(r.Row,{gap:8,children:[(0,k.jsx)(r.Button,{testID:"push-live-yes",label:o.live?'Switch off':'Yes, switch on',onPress:()=>{(0,j.setPushLive)(!o.live).then(e=>(0,w.notify)({id:'push-live',tone:e.ok?'normal':'warn',title:e.ok?o.live?'Phone notifications are off':'Phone notifications are on':'Not changed',body:e.message??'',timeoutMs:7e3})),b(!1)}}),(0,k.jsx)(r.Button,{kind:"ghost",label:"Cancel",onPress:()=>b(!1)})]})]})]})},_e.PushButton=R,_e.OrderListsSettings=function({rid:e}){(0,n.useEffect)(()=>{p.useOrderLists.getState().ensure(e)},[e]);const s=(0,p.useOrderLists)(e=>e.lists).filter(t=>t.rid===e),o=(0,p.orderSettingsOf)(e);(0,p.useOrderLists)(t=>t.settings[e]);const l=p.useOrderLists.getState(),[c,u]=(0,n.useState)(''),[h,g]=(0,n.useState)({});return(0,k.jsxs)(a.default,{style:{gap:10},testID:"order-list-settings",children:[(0,k.jsx)(r.Muted,{size:13,children:"Tip: running lists (like Alsons drinks) collect items until you order; trip lists (like Cash and carry) are for one shopping day. Logos and phone numbers are set on each list."}),(0,k.jsx)(r.Toggle,{testID:"order-allow-staff",label:"Let all staff add items",value:o.allowStaff,onChange:t=>l.setSettings(e,{allowStaff:t})}),(0,k.jsx)(r.Muted,{size:12,children:"Staff can add items and see the lists. Only managers and the Head Chef tick, remove or finish an order."}),(0,k.jsx)(r.T,{weight:"semibold",children:"Default trip day"}),(0,k.jsx)(r.Row,{wrap:!0,gap:6,children:v.map(t=>(0,k.jsx)(r.Chip,{label:f.DAY_FULL[t].slice(0,3),selected:o.defaultTripDay===t,onPress:()=>l.setSettings(e,{defaultTripDay:t})},t))}),s.map(e=>(0,k.jsxs)(a.default,{testID:`order-list-row-${e.seed??e.id}`,style:{borderWidth:1,borderColor:d.colours.hairline,borderRadius:10,padding:8,gap:6,opacity:e.archived?.55:1},children:[(0,k.jsxs)(r.Row,{gap:6,children:[(0,k.jsx)(t.TextInput,{accessibilityLabel:`Rename ${e.name}`,value:h[e.id]??e.name,onChangeText:t=>g(s=>({...s,[e.id]:t})),onBlur:()=>{const t=(h[e.id]??'').trim();t&&t!==e.name&&l.updateList(e.id,{name:t})},style:{...T,flex:1,minWidth:0}}),(0,k.jsx)(r.Badge,{kind:"neutral",label:'trip'===e.kind?'Trip':'Running'})]}),'trip'===e.kind?(0,k.jsx)(r.Row,{wrap:!0,gap:6,children:v.map(t=>(0,k.jsx)(r.Chip,{label:f.DAY_FULL[t].slice(0,3),selected:(e.tripDay??o.defaultTripDay)===t,onPress:()=>l.updateList(e.id,{tripDay:t})},t))}):null,(0,k.jsx)(r.Row,{gap:6,children:(0,k.jsx)(r.Button,{small:!0,kind:"ghost",label:e.archived?'Bring back':'Archive',onPress:()=>l.updateList(e.id,{archived:!e.archived})})})]},e.id)),(0,k.jsxs)(r.Row,{gap:6,wrap:!0,children:[(0,k.jsx)(t.TextInput,{accessibilityLabel:"New list name",testID:"order-new-name",value:c,onChangeText:u,placeholder:"e.g. Butcher",placeholderTextColor:d.colours.muted,style:{...T,flexGrow:1,flexBasis:160,minWidth:0}}),(0,k.jsx)(r.Button,{small:!0,label:"Add running",disabled:c.trim().length<2,onPress:()=>{l.addList(e,{name:c.trim(),kind:'running'}),u('')}}),(0,k.jsx)(r.Button,{small:!0,kind:"secondary",label:"Add trip",disabled:c.trim().length<2,onPress:()=>{l.addList(e,{name:c.trim(),kind:'trip',tripDay:o.defaultTripDay}),u('')}})]})]})},Object.defineProperty(_e,"resetOrderLists",{enumerable:!0,get:function(){return B}}),_e.ClockAreaSettings=function({rid:e,me:c}){(0,g.useClockArea)(t=>t.areas[e]);const u=(0,g.areaOf)(e);const h=g.useClockArea.getState(),p=(0,s.privateClockVenue)(e),[f,j]=(0,n.useState)(null==u.lat?'':String(u.lat)),[y,w]=(0,n.useState)(null==u.lng?'':String(u.lng)),[v,S]=(0,n.useState)(!1),[I,C]=(0,n.useState)(''),[L,D]=(0,n.useState)(u.breakOptions.join(', ')),R=(t,s)=>{const n=Number(t),o=Number(s);t.trim()||s.trim()?Number.isFinite(n)&&Number.isFinite(o)&&Math.abs(n)<=90&&Math.abs(o)<=180&&h.set(e,{lat:n,lng:o},c):h.set(e,{lat:null,lng:null},c)},B=async()=>{if(p)return;S(!0),C('');const t=await(0,b.getFix)();if(S(!1),'object'!=typeof t)return void C('denied'===t?'Location is blocked for this app. Allow it in your browser or phone settings.':'Couldn\u2019t get your location. Try again outside or near a window.');const s=t.lat.toFixed(6),n=t.lng.toFixed(6);j(s),w(n),h.set(e,{lat:Number(s),lng:Number(n)},c),C(`Centre set to where you are (accurate to about ${Math.round(t.acc)} m).`)},P=(0,x.areaSet)(u);return(0,k.jsxs)(a.default,{style:{gap:10},testID:"clock-area-settings",children:[(0,k.jsx)(r.Muted,{size:13,children:p?'The address-matched pub centre is configured below. Only clock-in checks location; only pass/fail is saved. No background, clock-out or break checks. Change the radius or centre here; use a manager override for a refused check.':'Tip: stand in the middle of the venue and tap \u201cUse my current location\u201d. Clocking in, out and breaks then only work within the distance below. Rota and pay screens are never blocked.'}),P?null:(0,k.jsx)(r.Banner,{kind:"warn",title:"Clock-in area not set yet",children:"Until you set the centre, staff can clock in from anywhere."}),p?(0,k.jsx)(r.Muted,{children:"Clock-in at the pub is required. A manager can record an exception with a reason."}):(0,k.jsx)(r.Toggle,{testID:"clock-area-on",label:"Check people are at the venue",value:u.on,onChange:t=>h.set(e,{on:t},c)}),p?null:(0,k.jsx)(r.Button,{testID:"clock-area-here",label:v?'Finding you\u2026':'\ud83d\udccd Use my current location',disabled:v,onPress:()=>{B()}}),I?(0,k.jsx)(r.Muted,{size:13,children:I}):null,(0,k.jsxs)(r.Row,{wrap:!0,gap:8,children:[(0,k.jsxs)(a.default,{style:{gap:2},children:[(0,k.jsx)(r.Muted,{size:12,children:"Latitude"}),(0,k.jsx)(t.TextInput,{accessibilityLabel:"Latitude",testID:"clock-area-lat",value:f,onChangeText:j,onBlur:()=>R(f,y),placeholder:"55.40\u2026",placeholderTextColor:d.colours.muted,style:{...T,width:130}})]}),(0,k.jsxs)(a.default,{style:{gap:2},children:[(0,k.jsx)(r.Muted,{size:12,children:"Longitude"}),(0,k.jsx)(t.TextInput,{accessibilityLabel:"Longitude",testID:"clock-area-lng",value:y,onChangeText:w,onBlur:()=>R(f,y),placeholder:"-4.75\u2026",placeholderTextColor:d.colours.muted,style:{...T,width:130}})]})]}),P?(0,k.jsx)(l.default,{accessibilityRole:"link",testID:"clock-area-map",onPress:()=>{o.default.openURL(`https://www.openstreetmap.org/?mlat=${u.lat}&mlon=${u.lng}#map=18/${u.lat}/${u.lng}`)},children:(0,k.jsx)(r.T,{size:13,colour:d.colours.gold,children:"See the pin on a map \u203a"})}):null,(0,k.jsx)(r.T,{weight:"semibold",children:"How far from the centre"}),(0,k.jsxs)(r.Row,{gap:8,children:[(0,k.jsx)(r.Button,{small:!0,kind:"secondary",label:"\u2212",onPress:()=>h.set(e,{radius:(0,x.clampRadius)(u.radius-10)},c)}),(0,k.jsxs)(r.T,{weight:"semibold",style:{minWidth:70,textAlign:'center'},children:[u.radius," m"]}),(0,k.jsx)(r.Button,{small:!0,kind:"secondary",label:"+",onPress:()=>h.set(e,{radius:(0,x.clampRadius)(u.radius+10)},c)})]}),(0,k.jsxs)(r.Muted,{size:12,children:["At least ",x.MIN_RADIUS," m. Phones aren\u2019t exact, so up to 50 m of the phone\u2019s own accuracy is added on top."]}),(0,k.jsx)(r.T,{weight:"semibold",children:"Forgotten break: lengths to offer at clock-out"}),(0,k.jsx)(t.TextInput,{accessibilityLabel:"Break lengths in minutes",testID:"clock-break-options",value:L,onChangeText:D,onBlur:()=>{const t=L.split(/[ ,]+/).map(Number).filter(e=>Number.isFinite(e)&&e>0&&e<=180);t.length&&h.set(e,{breakOptions:[...new Set(t)].sort((e,t)=>e-t)},c),D((0,g.areaOf)(e).breakOptions.join(', '))},style:T}),(0,k.jsxs)(r.Muted,{size:12,children:["Minutes, e.g. 5, 10, 15, 20, 30, 45, 60. Shows as ",u.breakOptions.map(x.breakLabel).join(', ')," and \u201cNo break\u201d."]}),p?(0,k.jsx)(r.Muted,{children:"No automatic arrival checks: staff location is used only at clock-in."}):(0,k.jsxs)(k.Fragment,{children:[" ",(0,k.jsx)(r.T,{weight:"semibold",children:"Not on the rota"}),(0,k.jsx)(r.Toggle,{testID:"clock-offrota-on",label:"Ask people at the venue who aren\u2019t on the rota if they want to clock in",value:u.offRotaPrompt,onChange:t=>h.set(e,{offRotaPrompt:t},c)}),(0,k.jsx)(t.TextInput,{accessibilityLabel:"Off-rota question",testID:"clock-offrota-title",value:u.offRotaTitle,onChangeText:t=>h.set(e,{offRotaTitle:t||x.DEFAULT_CLOCK_AREA.offRotaTitle},c),style:T}),(0,k.jsx)(t.TextInput,{accessibilityLabel:"Off-rota second line",testID:"clock-offrota-body",value:u.offRotaBody,onChangeText:t=>h.set(e,{offRotaBody:t||x.DEFAULT_CLOCK_AREA.offRotaBody},c),style:T}),(0,k.jsx)(r.Muted,{size:12,children:"This only checks while the app is open (web apps can\u2019t watch location in the background; that would need a native app)."})]})]})},Object.defineProperty(_e,"resetClockArea",{enumerable:!0,get:function(){return P}}),Object.defineProperty(_e,"COOKSAFE_URL",{enumerable:!0,get:function(){return O}}),_e.FoodSafetyCard=function({children:e}){return(0,k.jsx)(r.Card,{children:(0,k.jsxs)(a.default,{testID:"food-safety",style:{gap:6},children:[(0,k.jsx)(r.T,{size:17,weight:"semibold",children:"Food safety"}),(0,k.jsxs)(r.T,{children:["Based on ",(0,k.jsx)(r.T,{weight:"bold",colour:d.colours.gold,children:"CookSafe"})," (Food Standards Scotland)"]}),(0,k.jsx)(r.Muted,{size:12,children:"CoverCharge is not endorsed by Food Standards Scotland."}),(0,k.jsx)(l.default,{accessibilityRole:"link",testID:"cooksafe-link",onPress:()=>{o.default.openURL(O)},children:(0,k.jsx)(r.T,{size:14,colour:d.colours.gold,children:"Open the CookSafe guidance \u203a"})}),(0,k.jsx)(r.Muted,{size:13,children:"Full logs coming in the next update."}),e]})})};var t=_r(_d[0]),s=_r(_d[1]),n=_r(_d[2]),o=e(_r(_d[3])),l=e(_r(_d[4])),a=e(_r(_d[5])),r=_r(_d[6]),d=_r(_d[7]),c=_r(_d[8]),u=_r(_d[9]),h=_r(_d[10]),p=_r(_d[11]),f=_r(_d[12]),g=_r(_d[13]),x=_r(_d[14]),b=_r(_d[15]),j=_r(_d[16]),y=_r(_d[17]),w=_r(_d[18]),k=_r(_d[19]);const T={minHeight:44,borderRadius:10,borderWidth:1,borderColor:d.colours.hairline,backgroundColor:d.colours.surface2,color:d.colours.text,paddingHorizontal:10,fontSize:15},v=[1,2,3,4,5,6,0],S=['on_shift','everyone','managers','head_chef','kitchen','foh'],I=e=>e.replace(' (example)',''),C={title:'',message:'',days:[3,4,5,6,0],time:'21:00',recipients:{staff:[],groups:[]},sendBy:{inApp:!0,push:!1}};function L({value:e,onChange:t}){const s=(0,h.useOwner)(e=>e.staff).filter(e=>e.active);return(0,k.jsxs)(a.default,{style:{gap:6},testID:"notif-recipients",children:[(0,k.jsx)(r.T,{weight:"semibold",children:"Who gets it"}),(0,k.jsx)(r.Muted,{size:12,children:"Tick people, or pick a group (groups follow the team as it changes)."}),(0,k.jsx)(r.Row,{wrap:!0,gap:6,children:S.map(s=>(0,k.jsx)(r.Chip,{testID:`notif-group-${s}`,label:u.NOTIF_GROUP_LABEL[s],selected:e.groups.includes(s),onPress:()=>t({...e,groups:e.groups.includes(s)?e.groups.filter(e=>e!==s):[...e.groups,s]})},s))}),(0,k.jsx)(r.Muted,{size:12,children:"Only people on shift when it goes, in:"}),(0,k.jsx)(r.Row,{wrap:!0,gap:6,children:Object.keys(u.SHIFT_FILTER_LABEL).map(s=>{const n=(e.onShiftIn??[]).includes(s);return(0,k.jsx)(r.Chip,{testID:`notif-onshift-${s}`,label:u.SHIFT_FILTER_LABEL[s],selected:n,onPress:()=>t({...e,onShiftIn:n?(e.onShiftIn??[]).filter(e=>e!==s):[...e.onShiftIn??[],s]})},s)})}),(0,k.jsx)(a.default,{style:{gap:2},children:s.map(s=>{const n=e.staff.includes(s.id);return(0,k.jsxs)(l.default,{testID:`notif-tick-${s.id}`,accessibilityRole:"checkbox",accessibilityState:{checked:n},onPress:()=>t({...e,staff:n?e.staff.filter(e=>e!==s.id):[...e.staff,s.id]}),style:{flexDirection:'row',alignItems:'center',gap:10,paddingVertical:6},children:[(0,k.jsx)(a.default,{style:{width:22,height:22,borderRadius:5,borderWidth:1.5,borderColor:d.colours.gold,alignItems:'center',justifyContent:'center',backgroundColor:n?'#2a2414':'transparent'},children:n?(0,k.jsx)(r.T,{size:14,colour:d.colours.gold,children:"\u2713"}):null}),(0,k.jsx)(r.T,{style:{flex:1},children:(0,h.staffLabel)({name:I(s.name),nickname:s.nickname})}),(0,k.jsx)(r.Muted,{size:12,children:'Head Chef'===s.level?'Head Chef':s.job})]},s.id)})}),(0,k.jsx)(r.Muted,{size:12,children:"If nobody above matches when it goes, send it to:"}),(0,k.jsxs)(r.Row,{wrap:!0,gap:6,children:[S.filter(e=>'on_shift'!==e).map(s=>{const n=e.fallback??{staff:[],groups:[]},o=n.groups.includes(s);return(0,k.jsx)(r.Chip,{testID:`notif-fallback-${s}`,label:u.NOTIF_GROUP_LABEL[s],selected:o,onPress:()=>{const l=o?n.groups.filter(e=>e!==s):[...n.groups,s];t({...e,fallback:l.length||n.staff.length?{...n,groups:l}:void 0})}},s)}),s.map(s=>{const n=e.fallback??{staff:[],groups:[]},o=n.staff.includes(s.id);return(0,k.jsx)(r.Chip,{testID:`notif-fallback-${s.id}`,label:I(s.name),selected:o,onPress:()=>{const l=o?n.staff.filter(e=>e!==s.id):[...n.staff,s.id];t({...e,fallback:l.length||n.groups.length?{...n,staff:l}:void 0})}},s.id)})]})]})}function D({init:e,onSave:s,onCancel:o}){const[l,c]=(0,n.useState)(e),[h,p]=(0,n.useState)(!!e.dayTimes&&Object.keys(e.dayTimes).length>0),f=(0,u.validateNotif)(l),g=e=>c(t=>({...t,...e}));return(0,k.jsxs)(a.default,{testID:"notif-editor",style:{gap:8,borderWidth:1,borderColor:d.colours.accentBorder,borderRadius:12,padding:10},children:[(0,k.jsx)(r.T,{weight:"semibold",children:"Title"}),(0,k.jsx)(t.TextInput,{accessibilityLabel:"Notification title",testID:"notif-title",value:l.title,onChangeText:e=>g({title:e}),maxLength:60,style:T}),(0,k.jsx)(r.T,{weight:"semibold",children:"Message"}),(0,k.jsx)(t.TextInput,{accessibilityLabel:"Notification message",testID:"notif-message",value:l.message,onChangeText:e=>g({message:e}),maxLength:160,style:T}),(0,k.jsx)(r.T,{weight:"semibold",children:"Days"}),(0,k.jsx)(r.Row,{wrap:!0,gap:6,children:v.map(e=>(0,k.jsx)(r.Chip,{testID:`notif-day-${e}`,label:u.NOTIF_DAY_NAMES[e],selected:l.days.includes(e),onPress:()=>g({days:l.days.includes(e)?l.days.filter(t=>t!==e):[...l.days,e]})},e))}),(0,k.jsxs)(r.Row,{gap:8,children:[(0,k.jsx)(r.T,{weight:"semibold",children:"Time (UK)"}),(0,k.jsx)(t.TextInput,{accessibilityLabel:"Time",testID:"notif-time",value:l.time,onChangeText:e=>g({time:e}),placeholder:"21:00",style:{...T,width:90,borderColor:(0,u.validHm)(l.time)?d.colours.hairline:d.colours.red}})]}),(0,k.jsx)(r.Toggle,{label:"A different time on some days",value:h,onChange:e=>{p(e),e||g({dayTimes:void 0})}}),h?(0,k.jsx)(r.Row,{wrap:!0,gap:8,children:v.filter(e=>l.days.includes(e)).map(e=>(0,k.jsxs)(r.Row,{gap:4,children:[(0,k.jsx)(r.T,{size:13,children:u.NOTIF_DAY_NAMES[e]}),(0,k.jsx)(t.TextInput,{accessibilityLabel:`${u.NOTIF_DAY_NAMES[e]} time`,testID:`notif-daytime-${e}`,value:l.dayTimes?.[String(e)]??'',placeholder:l.time,onChangeText:t=>{const s={...l.dayTimes??{}};t.trim()?s[String(e)]=t.trim():delete s[String(e)],g({dayTimes:s})},style:{...T,width:74}})]},e))}):null,(0,k.jsx)(L,{value:l.recipients,onChange:e=>g({recipients:e})}),(0,k.jsx)(r.T,{weight:"semibold",children:"Send by"}),(0,k.jsx)(r.Toggle,{testID:"notif-inapp",label:"In the app (gold slider, Done / Later)",value:l.sendBy.inApp,onChange:e=>g({sendBy:{...l.sendBy,inApp:e}})}),(0,k.jsx)(r.Toggle,{testID:"notif-push",label:"Phone notification (when phones are switched on)",value:l.sendBy.push,onChange:e=>g({sendBy:{...l.sendBy,push:e}})}),f?(0,k.jsx)(r.Muted,{size:13,children:f}):null,(0,k.jsxs)(r.Row,{gap:8,style:{justifyContent:'flex-end'},children:[(0,k.jsx)(r.Button,{small:!0,kind:"ghost",label:"Cancel",onPress:o}),(0,k.jsx)(r.Button,{small:!0,testID:"notif-save",label:"Save",disabled:!!f,onPress:()=>s({...l,title:l.title.trim(),message:l.message.trim(),days:[...l.days].sort()})})]})]})}function R(){const[e,t]=(0,n.useState)(null),[s,o]=(0,n.useState)('');return(0,n.useEffect)(()=>{(0,y.pushState)().then(t)},[]),e&&'unsupported'!==e?(0,k.jsxs)(a.default,{testID:"push-button",style:{gap:4},children:[(0,k.jsx)(r.Button,{small:!0,kind:'on'===e?'ghost':'secondary',testID:"push-turn-on",label:'on'===e?'Phone notifications are on for this phone \xb7 Turn off':'\ud83d\udd14 Turn on phone notifications',onPress:()=>{('on'===e?(0,y.turnOffPush)():(0,y.turnOnPush)()).then(e=>{o(e.message),(0,y.pushState)().then(t)})}}),(0,k.jsx)(r.Muted,{size:12,children:s||('ios-home-screen'===e?'iPhone: add this app to your Home Screen first (iOS 16.4 or later).':'For this phone only. Each person turns it on on their own phone.')})]}):null}const B=e=>p.useOrderLists.getState().resetSettings(e);const P=(e,t)=>g.useClockArea.getState().reset(e,t),O='https://www.foodstandards.gov.scot/publications-and-research/publications/cooksafe-manual'},1043,[796,991,34,379,402,102,794,840,1021,1022,865,1025,1026,1027,992,1044,985,1045,994,25]); __d(function(_g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.getFix=function(e=1e4){const t='undefined'!=typeof navigator?navigator.geolocation:void 0;return t?new Promise(o=>{let n=!1;const c=e=>{n||(n=!0,o(e))},u=setTimeout(()=>c('timeout'),e+1500);try{t.getCurrentPosition(e=>{clearTimeout(u),c({lat:e.coords.latitude,lng:e.coords.longitude,acc:e.coords.accuracy??999})},e=>{clearTimeout(u),c(1===e.code?'denied':3===e.code?'timeout':'unavailable')},{enableHighAccuracy:!0,timeout:e,maximumAge:0})}catch{clearTimeout(u),c('unsupported')}}):Promise.resolve('unsupported')},_e.locationAllowed=async function(){try{const e=await(navigator.permissions?.query({name:'geolocation'}));return'granted'===e?.state}catch{return!1}}},1044,[]); __d(function(g,r,_i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.pushState=f,e.turnOnPush=async function(){const u=await f();if('ios-home-screen'===u)return{ok:!1,message:'On iPhone, add this app to your Home Screen first (Share \u203a Add to Home Screen, iOS 16.4 or later), then open it from there.'};if('unsupported'===u)return{ok:!1,message:'This browser can\u2019t get phone notifications. Try Chrome on Android, or the app from your iPhone Home Screen.'};if('blocked'===u)return{ok:!1,message:'Notifications are blocked for this app. Allow them in your phone\u2019s settings, then try again.'};const c=i.useSync.getState();if('staff'!==c.kind||!c.venueId||!c.staffRef)return{ok:!1,message:'Sign in from your personal link first.'};if('granted'!==await Notification.requestPermission())return{ok:!1,message:'You didn\u2019t allow notifications, so nothing changed.'};const p=await navigator.serviceWorker.ready,h=(await p.pushManager.getSubscription()??await p.pushManager.subscribe({userVisibleOnly:!0,applicationServerKey:s(n.VAPID_PUBLIC_KEY)})).toJSON();if(!h.endpoint||!h.keys?.p256dh||!h.keys?.auth)return{ok:!1,message:'Your browser didn\u2019t give a usable subscription. Try again.'};const l=(0,t.getSupabase)(),{error:y}=await l.from('push_subscriptions').upsert({venue_id:c.venueId,staff_ref:c.staffRef,app:o.APP_VARIANT,endpoint:h.endpoint,p256dh:h.keys.p256dh,auth:h.keys.auth,user_agent:navigator.userAgent.slice(0,200)},{onConflict:'user_id,endpoint'});return y?{ok:!1,message:`Couldn\u2019t save this phone: ${y.message}`}:{ok:!0,message:'Phone notifications are on for this device.'}},e.turnOffPush=async function(){const n=await(navigator.serviceWorker?.getRegistration()),i=await(n?.pushManager.getSubscription());if(!i)return{ok:!0,message:'Phone notifications are off for this device.'};const o=i.endpoint;await i.unsubscribe();try{const n=(0,t.getSupabase)();await n.from('push_subscriptions').delete().eq('endpoint',o)}catch{}return{ok:!0,message:'Phone notifications are off for this device.'}};var n=r(d[0]),t=r(d[1]),i=r(d[2]),o=r(d[3]);const s=n=>{const t=atob(n.replace(/-/g,'+').replace(/_/g,'/')+'='.repeat((4-n.length%4)%4)),i=new Uint8Array(t.length);for(let n=0;n'undefined'!=typeof navigator&&/iPhone|iPad|iPod/.test(navigator.userAgent),c=()=>'undefined'!=typeof window&&(window.matchMedia?.('(display-mode: standalone)').matches||!0===navigator.standalone);async function f(){if('undefined'==typeof window||!('serviceWorker'in navigator))return'unsupported';if(!('PushManager'in window)||'undefined'==typeof Notification)return u()&&!c()?'ios-home-screen':'unsupported';if('denied'===Notification.permission)return'blocked';const n=await navigator.serviceWorker.getRegistration();return await(n?.pushManager.getSubscription())?'on':'off'}},1045,[1046,931,985,846]); @@ -1191,11 +1191,11 @@ __d(function(g,r,i,_a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule' __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 v}}),Object.defineProperty(_e,"fitLabel",{enumerable:!0,get:function(){return M}}),Object.defineProperty(_e,"BIG_LABEL_MIN",{enumerable:!0,get:function(){return j}}),_e.areaBounds=k,_e.minReadableScale=function(e,t){return Math.max(0,...e.tables.filter(e=>e.areaId===t).map(e=>{const t='round'===e.shape?.85:1,o=(7.4399999999999995*Math.max(1,(0,x.tableNumber)(e).length)+6)/(e.w*t),n=22/Math.min(e.w,e.h);return Math.max(o,n)}))},_e.seatSpots=S,_e.FixtureShape=R,_e.FloorCanvas=function(e){const[C,$]=(0,r.useState)({w:0,h:0}),I=e.plan.tables.filter(t=>t.areaId===e.areaId),A=e.crop&&I.length?k(e.plan,e.areaId):{x:0,y:0,w:l.PLAN_W,h:l.PLAN_H},z='live'===e.mode?[...new Map(I.flatMap(t=>{const o=e.view?.[t.name];if(!o?.group||o.group.length<2)return[];const n=[...o.group].sort().join('+');return[[n,{key:n,members:o.group,view:o}]]})).values()]:[],L=28*z.length,E={x:A.x,y:A.y,r:A.x+A.w,b:A.y+A.h},D=C.w?'width'===e.fit?Math.min(C.w/l.PLAN_W,e.maxH?e.maxH/l.PLAN_H:9):Math.min(C.w/A.w,Math.max(1,C.h-L)/A.h):0,F=e.fill&&'contain'===e.fit&&D>0&&C.h>0,_=F?(C.w/D-A.w)/2:0,O=F?((C.h-L)/D-A.h)/2:0,N={x:E.x-_,y:E.y-O,r:E.r+_,b:E.b+O},B=N.r-N.x,P=N.b-N.y,[W,H]=(0,r.useState)(null),G=(0,r.useRef)(null),[Y,X]=(0,r.useState)(null),U=(0,r.useRef)(null);U.current=Y,i.default.useEffect(()=>{if(!Y)return;const e=setTimeout(()=>X(null),n.ARM_MS);return()=>clearTimeout(e)},[Y]);const q='live'===e.mode&&!!e.onDrop,J=e=>!q||(0,n.isArmed)(U.current,e.id,Date.now()),K=t=>e.plan.sections.find(e=>e.id===t.sectionId),V=t=>e.plan.joins.find(e=>e.tables.includes(t.name)),Q=i.default.useMemo(()=>(0,x.numberClashes)(e.plan.tables).sameArea,[e.plan.tables]),Z=(t,o)=>({onStartShouldSetResponder:()=>!0,onMoveShouldSetResponder:()=>J(t),onResponderTerminationRequest:()=>!J(t),onResponderGrant:e=>{G.current={x:e.nativeEvent.pageX,y:e.nativeEvent.pageY,id:t.id,kind:o}},onResponderMove:n=>{const r=G.current;if(!r)return;const i=n.nativeEvent.pageX-r.x,s=n.nativeEvent.pageY-r.y;Math.abs(i)+Math.abs(s)<6&&!W||J(t)&&('live'!==e.mode||e.onDrop&&e.view&&['seated','mains','dessert','bill'].includes(e.view[t.name]?.status)&&e.view[t.name]?.booking)&&H({id:t.id,dx:i,dy:s,kind:o})},onResponderRelease:r=>{const i=G.current;G.current=null;const a=r.nativeEvent.pageX-(i?.x??0),u=r.nativeEvent.pageY-(i?.y??0);if(H(null),Math.abs(a)+Math.abs(u)<6||!D){if('move'===o){if(q){const e=(0,n.releaseOn)(U.current,t.id,!1,Date.now());if(X(e.arm),'select'===e.action)try{s.default.announceForAccessibility(n.SELECTED_A11Y)}catch{}}e.onTap?.(t)}return}if(q){const e=(0,n.releaseOn)(U.current,t.id,!0,Date.now());if(X(e.arm),'move'!==e.action)return}const h=a/D,c=u/D;if('edit'===e.mode&&'move'===o)e.onMove?.(t,w(v(t.x+h,e.snapOn),0,l.PLAN_W-t.w),w(v(t.y+c,e.snapOn),0,l.PLAN_H-t.h));else if('edit'===e.mode&&'resize'===o)e.onResize?.(t,w(v(t.w+h,e.snapOn),50,400),w(v(t.h+c,e.snapOn),50,300));else if('live'===e.mode&&e.onDrop){const o=t.x+t.w/2+h,n=t.y+t.h/2+c,r=I.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);r&&e.onDrop(t,r)}}}),ee=e=>e*D,te=e=>ee(e-N.x),oe=e=>ee(e-N.y),ne='width'===e.fit?l.PLAN_H*D+L||200:void 0;return(0,g.jsxs)(a.default,{testID:"floor-canvas",onLayout:e=>$({w:e.nativeEvent.layout.width,h:e.nativeEvent.layout.height}),style:[{width:'100%',borderRadius:16,overflow:'hidden'},'contain'===e.fit?{flex:1}:{height:ne}],children:[z.map(e=>{const o=I.filter(t=>e.members.includes(t.name)),n=o.length?(Math.min(...o.map(e=>e.x))+Math.max(...o.map(e=>e.x+e.w)))/2:N.x+B/2,r=e.view.booking?.time??e.view.next?.time,i=`${T(e.members)}${r?` \xb7 ${'seated'===e.view.status?'Seated':'Booked'} ${r}`:''}`,s=Math.min(Math.max(0,C.w-8),260);return(0,g.jsx)(a.default,{testID:`joined-label-${e.key}`,accessible:!0,accessibilityLabel:`Joined tables ${i}`,pointerEvents:"none",style:{height:28,width:s,marginLeft:w(ee(n-N.x)-s/2,4,Math.max(4,C.w-s-4)),alignItems:'center',justifyContent:'center',overflow:'hidden',borderRadius:8,borderWidth:1,borderColor:h.colours.gold,backgroundColor:(0,t.soutersSurface)('#0B0B0B')},children:(0,g.jsx)(c.T,{size:16,weight:"bold",colour:h.colours.goldLight,center:!0,numberOfLines:1,children:i})},e.key)}),D?(0,g.jsx)(a.default,{style:{width:ee(B),height:ee(P),alignSelf:'center',backgroundColor:(0,t.soutersSurface)('#0F0E0C'),borderRadius:16,borderWidth:1,borderColor:h.colours.border,overflow:'hidden'},children:(0,g.jsxs)(a.default,{style:{position:'absolute',left:0,top:0,width:ee(B),height:ee(P)},children:['edit'===e.mode?Array.from({length:l.PLAN_W/(2*l.GRID)},(e,o)=>(0,g.jsx)(a.default,{style:{position:'absolute',left:te(o*l.GRID*2),top:0,bottom:0,width:1,backgroundColor:(0,t.soutersSurface)('#1E1B16')}},`v${o}`)):null,'edit'===e.mode?Array.from({length:l.PLAN_H/(2*l.GRID)},(e,o)=>(0,g.jsx)(a.default,{style:{position:'absolute',top:oe(o*l.GRID*2),left:0,right:0,height:1,backgroundColor:(0,t.soutersSurface)('#1E1B16')}},`h${o}`)):null,(e.plan.fixtures??[]).filter(t=>t.areaId===e.areaId).map(t=>(0,g.jsx)(R,{f:{...t,x:t.x-N.x,y:t.y-N.y},S:ee,live:'live'===e.mode},t.id)),e.plan.joins.map(e=>{const t=I.filter(t=>e.tables.includes(t.name));if(t.length<2)return null;const[o,n]=t,r=o.x+o.w/2,i=o.y+o.h/2,s=n.x+n.w/2,l=n.y+n.h/2,u=Math.hypot(s-r,l-i),h=Math.atan2(l-i,s-r);return(0,g.jsx)(a.default,{testID:`join-${e.tables.join('+')}`,style:{position:'absolute',left:te((r+s)/2-u/2),top:oe((i+l)/2)-3,width:ee(u),height:6,borderRadius:3,backgroundColor:'rgba(207,164,95,0.55)',transform:[{rotate:`${h}rad`}]}},e.id)}),I.map(n=>{const r=e.view?.[n.name],s=r?u.STATUS[r.status]:u.STATUS.free,v=W?.id===n.id,w=v&&'resize'===W.kind?Math.max(50,n.w+W.dx/D):n.w,C=v&&'resize'===W.kind?Math.max(50,n.h+W.dy/D):n.h,k=v&&'move'===W.kind?n.x+W.dx/D:n.x,R=v&&'move'===W.kind?n.y+W.dy/D:n.y,T=e.selected===n.id||e.highlight?.includes(n.name)||Y?.id===n.id,$=K(n),I='edit'===e.mode?'#2A2419':s.colour,A='edit'===e.mode?h.colours.text:s.fg,z='round'===n.shape?ee(Math.min(w,C))/2:ee(10),L='live'===e.mode?(0,x.liveTableLabel)(n,Q):(0,l.tableLabel)(n),E=ee(Math.min(w,C))<64,F=M(e.big?Math.max(13,Math.min(34,ee(Math.min(w,C))/3)):Math.max(11,Math.min(22,ee(Math.min(w,C))/4)),L,ee(w)*('round'===n.shape?.85:1),e.big?j:9),_=Math.max(e.big?11:12,Math.round(.62*F)),O=(ee(C)-6-1.4*F)/(1.4*_),N=O>=2&&ee(w)>=5*_?2:O>=1?1:0,B=r?.booking&&void 0!==r.seatedMins?r.booking.time:void 0,P='soon'===r?.status?r.next?.time??r.dayBookings?.[0]?.time:void 0,H='edit'===e.mode?`Table ${(0,o.tableNumbers)(L)}, ${(0,l.shapeLabel)(n.shape).toLowerCase()}, ${n.minSeats}\u2013${n.maxSeats} seats${n.online?', bookable online':''}`:'soon'===r?.status?`Table ${(0,o.tableNumbers)(L)}, booked later${P?`, ${P}`:''}${r.group?`, combined with ${r.group.filter(e=>e!==n.name).map(e=>`table ${e}`).join(', ')}`:''}`:`Table ${(0,o.tableNumbers)(L)}, ${s.label}${void 0!==r?.seatedMins?`, seated ${r.seatedMins} min`:''}${r?.covers?`, ${r.covers} Covers`:''}${r?.dayBookings?.length?`, booked: ${r.dayBookings.map(e=>`${e.time}, ${e.partySize} Covers`).join('; ')}`:''}${r?.group?`, combined with ${r.group.filter(e=>e!==n.name).map(e=>`table ${e}`).join(', ')}`:''}`,G=void 0!==r?.seatedMins&&r.booking?Math.min(1.2,r.seatedMins/(r.booking.durationMins??(0,u.turnFor)(r.booking.partySize,e.turnBase))):null;return(0,g.jsxs)(i.default.Fragment,{children:[S({...n,w:w,h:C}).map((t,o)=>(0,g.jsx)(a.default,{pointerEvents:"none",style:[{position:'absolute',left:te(k+t.x)-Math.max(4,ee(8)),top:oe(R+t.y)-Math.max(4,ee(8)),width:Math.max(8,ee(16)),height:Math.max(8,ee(16)),borderRadius:99,backgroundColor:'edit'===e.mode?'#5A4C33':'rgba(255,255,255,0.16)',borderWidth:1,borderColor:'edit'===e.mode?h.colours.gold:'rgba(255,255,255,0.25)'},y()]},o)),'live'===e.mode&&(ee(w)<44||ee(C)<44)?(0,g.jsx)(a.default,{accessible:!1,importantForAccessibility:"no-hide-descendants",'aria-hidden':!0,...Z(n,'move'),style:{position:'absolute',left:te(k+w/2)-Math.max(44,ee(w))/2,top:oe(R+C/2)-Math.max(44,ee(C))/2,width:Math.max(44,ee(w)),height:Math.max(44,ee(C)),zIndex:2}}):null,(0,g.jsxs)(a.default,{testID:`table-${n.name}`,accessibilityRole:"button",accessibilityLabel:H,onAccessibilityTap:()=>e.onTap?.(n),onKeyDown:t=>{'Enter'!==t?.key&&' '!==t?.key||e.onTap?.(n)},tabIndex:0,...Z(n,'move'),style:[{position:'absolute',left:te(k),top:oe(R),width:ee(w),height:ee(C),borderRadius:z,backgroundColor:I,alignItems:'center',justifyContent:'center',padding:2,overflow:'hidden',borderWidth:T?3:e.sectionColours&&$?2.5:1.5,borderColor:T?'#FFFFFF':e.sectionColours&&$?(0,h.brandColour)($.colour):'edit'===e.mode?h.colours.gold:'rgba(0,0,0,0.35)',transform:[{scale:v?1.06:1}],zIndex:v?50:3,opacity:v&&'live'===e.mode?.85:1,shadowColor:'#000',shadowOpacity:v?.6:.3,shadowRadius:v?14:6,cursor:'edit'===e.mode?'grab':'pointer',touchAction:'none'},v?null:y()],children:[(0,g.jsxs)(a.default,{style:{alignItems:'center',justifyContent:'center',maxWidth:'100%',maxHeight:'100%',overflow:'hidden'},pointerEvents:"none",children:[(0,g.jsx)(c.T,{style:p,weight:"bold",size:F,colour:A,center:!0,numberOfLines:1,children:L}),'live'===e.mode&&'blocked'===r?.status?(0,g.jsx)(c.T,{style:f,size:Math.max(10,Math.round(.5*F)),weight:"semibold",colour:A,center:!0,numberOfLines:1,children:"Blocked"}):null,'live'===e.mode&&r?.group&&r.group.length>1?null:e.big&&'live'===e.mode&&r&&1===N?'free'!==r.status&&'soon'!==r.status&&(r.covers||B)?(0,g.jsx)(c.T,{style:f,size:_,weight:"bold",colour:A,center:!0,numberOfLines:1,children:[r.covers?`${r.covers}`:'',B??''].filter(Boolean).join(' \xb7 ')}):null:e.big&&'live'===e.mode&&r&&2===N?(0,g.jsxs)(g.Fragment,{children:['soon'!==r.status&&r.covers?(0,g.jsxs)(c.T,{style:f,size:_,weight:"semibold",colour:A,center:!0,children:[r.covers," ",1===r.covers?'Cover':'Covers']}):'free'!==r.status||E?null:(0,g.jsxs)(c.T,{style:f,size:_,colour:A,center:!0,children:[n.minSeats,"\u2013",n.maxSeats]}),'free'!==r.status&&'soon'!==r.status&&B?(0,g.jsx)(c.T,{style:f,size:_,weight:"bold",colour:A,center:!0,children:B}):'dirty'===r.status?(0,g.jsx)(c.T,{style:f,size:_,colour:A,center:!0,children:"Clear"}):null]}):e.big&&'live'===e.mode?null:'edit'===e.mode?E?null:(0,g.jsxs)(c.T,{style:f,size:11,colour:h.colours.muted,center:!0,children:[n.minSeats,"\u2013",n.maxSeats,n.online?' \xb7 online':'']}):r?(0,g.jsxs)(g.Fragment,{children:['free'!==r.status||E?null:(0,g.jsxs)(c.T,{style:f,size:11,colour:A,center:!0,children:[n.minSeats,"\u2013",n.maxSeats," seats"]}),void 0!==r.seatedMins?(0,g.jsxs)(c.T,{style:f,size:12,weight:"semibold",colour:A,center:!0,children:[r.seatedMins,"m \xb7 ",r.covers,"\ud83d\udc65"]}):r.orderOnly?(0,g.jsx)(c.T,{style:f,size:11,colour:A,center:!0,children:"Open order"}):null,'dirty'!==r.status||E?null:(0,g.jsx)(c.T,{style:f,size:11,colour:A,center:!0,children:"Clear"}),!E||r.allergy||r.vip?(0,g.jsxs)(c.T,{style:f,size:11,colour:A,center:!0,children:[r.allergy?'\u26a0':'',r.vip?'VIP'===r.vip?'\u2605':'\u2665':'',r.occasion?u.OCCASION_ICON[r.occasion]:'',r.note?'\u270e':'']}):null]}):null]}),null,'live'===e.mode&&r&&!E&&(r.booking??r.next)&&(0,b.needsIcons)(r.booking??r.next).replace('\u26a0\ufe0f','').trim()?(0,g.jsx)(a.default,{pointerEvents:"none",testID:`needs-${n.name}`,style:{position:'absolute',bottom:e.big?-Math.max(9,.55*_):2,right:e.big?-6:4,backgroundColor:(0,t.soutersSurface)('rgba(11,11,11,0.85)'),borderRadius:8,paddingHorizontal:4,borderWidth:1,borderColor:'rgba(255,255,255,0.15)'},children:(0,g.jsx)(c.T,{size:e.big?Math.max(11,.75*_):10,children:(0,b.needsIcons)(r.booking??r.next).replace('\u26a0\ufe0f','').trim()})}):null,$&&'live'===e.mode&&e.sectionColours&&!E&&!e.big?(0,g.jsx)(a.default,{pointerEvents:"none",style:{position:'absolute',top:3,right:6,backgroundColor:(0,h.brandColour)($.colour),borderRadius:6,paddingHorizontal:3},children:(0,g.jsx)(c.T,{size:9,weight:"bold",colour:"#0B0B0B",children:$.server})}):null,null===G||E?null:(0,g.jsx)(a.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,g.jsx)(a.default,{style:{width:`${Math.min(100,100*G)}%`,height:4,borderRadius:2,backgroundColor:G>=1?'#B3261E':'rgba(0,0,0,0.6)'}})}),V(n)&&'edit'===e.mode?(0,g.jsx)(a.default,{pointerEvents:"none",style:{position:'absolute',bottom:2,left:4},children:(0,g.jsx)(c.T,{size:10,colour:h.colours.gold,children:"\u26d3"})}):null]}),'edit'===e.mode&&e.selected===n.id?(0,g.jsx)(a.default,{testID:"resize-handle",accessibilityLabel:"Resize table",...Z(n,'resize'),style:{position:'absolute',left:te(k+w)-14,top:oe(R+C)-14,width:28,height:28,borderRadius:14,backgroundColor:h.colours.gold,borderWidth:2,borderColor:'#fff',zIndex:60,cursor:'nwse-resize',touchAction:'none'}}):null]},n.id)}),0===I.length?(0,g.jsx)(a.default,{style:{position:'absolute',left:0,right:0,top:'45%'},children:(0,g.jsxs)(c.T,{center:!0,colour:h.colours.muted,children:["No tables in this area yet",'edit'===e.mode?' \u2014 add some in Tables':'',"."]})}):null]})}):null]})};var t=_r(d[0]),o=_r(d[1]),n=_r(d[2]),r=_r(d[3]),i=e(r),s=e(_r(d[4]));_r(d[5]);var a=e(_r(d[6])),l=_r(d[7]),u=_r(d[8]),h=_r(d[9]),c=_r(d[10]),b=_r(d[11]),x=_r(d[12]),g=_r(d[13]);const f={flexShrink:0},p={flexShrink:0,maxWidth:'none'},y=(e=250)=>({transitionProperty:'background-color, border-color, transform, left, top, width, height',transitionDuration:`${e}ms`}),v=(e,t=!0)=>t?Math.round(e/l.GRID)*l.GRID:Math.round(e),w=(e,t,o)=>Math.max(t,Math.min(o,e)),M=(e,t,o,n=9)=>Math.max(n,Math.min(e,(o-6)/(.62*Math.max(1,t.length)))),j=12,C=46;function k(e,t){const o=e.tables.filter(e=>e.areaId===t);if(!o.length)return{x:0,y:0,w:l.PLAN_W,h:l.PLAN_H};const n=Math.max(0,Math.min(...o.map(e=>e.x))-C),r=Math.max(0,Math.min(...o.map(e=>e.y))-C);return{x:n,y:r,w:Math.min(l.PLAN_W,Math.max(...o.map(e=>e.x+e.w))+C)-n,h:Math.min(l.PLAN_H,Math.max(...o.map(e=>e.y+e.h))+C)-r}}function S(e){const t=Math.max(1,e.maxSeats),o=[];if('round'===e.shape){const n=e.w/2+9.6,r=e.h/2+9.6;for(let i=0;ie.w,r=Math.ceil(t/2),i=t-r;if(n){for(let t=0;te.w,s=n?{borderColor:'#FFFFFF',borderWidth:2}:null;return'bar'===e.kind?(0,g.jsx)(a.default,{pointerEvents:"none",style:[r,{backgroundColor:o?'#2A2216':'#3A2E1C',borderRadius:8,borderWidth:1.5,borderColor:o?'#5A4A30':h.colours.gold},s],children:(0,g.jsx)(c.T,{size:Math.max(9,Math.min(14,t(e.h)/2.4)),weight:"semibold",colour:h.colours.goldLight,children:"BAR"})}):'wall'===e.kind?(0,g.jsx)(a.default,{pointerEvents:"none",style:[r,{backgroundColor:o?'#3A3631':'#5C574F',borderRadius:2},s]}):'window'===e.kind?(0,g.jsx)(a.default,{pointerEvents:"none",style:[r,{backgroundColor:'rgba(226,196,137,0.16)',borderColor:'rgba(226,196,137,0.6)',borderWidth:1,borderRadius:2},s],children:!o&&t(i?e.h:e.w)>60?(0,g.jsx)(c.T,{size:9,colour:"#BFDDFF",style:i?{transform:[{rotate:'90deg'}]}:void 0,children:"WINDOW"}):null}):(0,g.jsx)(a.default,{pointerEvents:"none",style:[r,{borderColor:o?'#7A6440':h.colours.gold,borderWidth:1.5,borderStyle:'dashed',borderRadius:3,backgroundColor:'rgba(207,164,95,0.08)'},s],children:t(i?e.h:e.w)>40?(0,g.jsx)(c.T,{size:9,colour:h.colours.goldLight,style:i?{transform:[{rotate:'90deg'}]}:void 0,children:"DOOR"}):null})}function T(e){return(0,l.tablesLabel)(e.join('+')).replace(/^Tables? /,'').replace(/ \+ /g,'+')}},1108,[798,829,1109,34,281,236,102,1014,1079,840,794,1081,828,25]); __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"ARM_MS",{enumerable:!0,get:function(){return t}}),Object.defineProperty(e,"SELECT_HINT",{enumerable:!0,get:function(){return n}}),Object.defineProperty(e,"SELECTED_A11Y",{enumerable:!0,get:function(){return o}}),Object.defineProperty(e,"TABLE_SELECT_HINT",{enumerable:!0,get:function(){return c}}),Object.defineProperty(e,"isArmed",{enumerable:!0,get:function(){return l}}),e.releaseOn=function(n,o,c,u){const b=l(n,o,u);return c?b?{arm:null,action:'move'}:{arm:n&&u-n.at!!n&&n.id===o&&c-n.at!e.signOff),S=k.filter(e=>e.signOff),_=j.map(o.allergenLabel).join(', '),C=e=>e.map(e=>e.name).join(', ')||'none';return(0,f.jsxs)(l.default,{testID:"menu-allergy-check",style:{gap:6,borderWidth:1,borderColor:p.length?h.colours.red:h.colours.border,borderRadius:12,padding:10,backgroundColor:h.colours.surface2},children:[(0,f.jsxs)(u.T,{weight:"semibold",children:["Allergy check against the menu (",_,")"]}),(0,f.jsxs)(u.T,{size:14,colour:h.colours.red,children:["Contains: ",p.length," dish",1===p.length?'':'es']}),(0,f.jsxs)(u.T,{size:14,colour:h.colours.amber,children:["May contain: ",M.length]}),(0,f.jsxs)(u.T,{size:14,colour:h.colours.ok,children:["Free from ",1===j.length?'it':'them'," (signed off): ",S.length]}),w.length?(0,f.jsxs)(u.Muted,{children:[w.length," more awaiting the head chef's sign-off, so not shown as safe."]}):null,(0,f.jsx)(n.default,{testID:"menu-allergy-details",accessibilityRole:"button",onPress:()=>y(!x),hitSlop:6,children:(0,f.jsx)(u.T,{size:14,colour:h.colours.gold,children:x?'Hide dishes':'Show dishes'})}),x?(0,f.jsxs)(l.default,{style:{gap:4},children:[(0,f.jsxs)(u.Muted,{children:["Contains: ",C(p)]}),(0,f.jsxs)(u.Muted,{children:["May contain: ",C(M)]}),(0,f.jsxs)(u.Muted,{children:["Free from: ",C(S)]})]}):null,(0,f.jsx)(u.Muted,{children:'guest'===m?'From the kitchen\u2019s signed-off recipe cards. Specials on the board are checked by staff on the day.':'From the signed-off recipe cards. Specials on the board have their own allergens. Still check with the guest and the kitchen.'})]})};var s=r(d[0]),n=e(r(d[1])),l=e(r(d[2])),t=r(d[3]),o=r(d[4]),c=r(d[5]),h=r(d[6]),u=r(d[7]),f=r(d[8])},1110,[34,402,102,848,830,832,840,794,25]); -__d(function(g,r,i,a,m,e,_d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"NOTES_PLACEHOLDER",{enumerable:!0,get:function(){return o}}),Object.defineProperty(e,"WIX_EDIT_NOTE",{enumerable:!0,get:function(){return s}}),e.canEditBooking=function(t){return'customer'!==t.variant&&('staff'===t.variant||t.inStaffApp?!!t.shiftManager:'display'===t.variant||'chef'===t.variant||'staff'!==t.role)},Object.defineProperty(e,"isWixBooking",{enumerable:!0,get:function(){return l}}),Object.defineProperty(e,"EDIT_FIELDS",{enumerable:!0,get:function(){return d}}),Object.defineProperty(e,"FIELD_WORDS",{enumerable:!0,get:function(){return c}}),Object.defineProperty(e,"draftOf",{enumerable:!0,get:function(){return u}}),e.changedFields=p,e.editPatch=function(n,o,s,l=(new Date).toISOString()){const d=p(n,o);if(!d.length)return{};const c={};for(const n of d){const s=f(n,o[n]);c[n]='partySize'===n?(0,t.clampParty)(s):'phone'===n||'email'===n||'table'===n?s||void 0:s}d.includes('table')&&(c.tableSetHere=!0);const u=n;return c.locallyEdited=!0,c.editedFields=[...new Set([...u.editedFields??[],...d])],c.editLog=[...u.editLog??[],{at:l,by:s.by.slice(0,80),app:s.app,fields:d}].slice(-50),c},e.editWarnings=function(t,o,s,l,d=90){const c=[],u={...t,date:o.date,time:o.time,partySize:o.partySize};if(o.table){const t=(0,n.tableOverlaps)(u,o.table,s.filter(t=>t.date===o.date),d);t.length&&c.push(`The table already has a booking at about the same time: ${t.map(t=>`${t.time} ${t.walkIn?'walk-in':t.name}`).join(', ')}.`)}l&&c.push(`Bookings are paused ${l.from} to ${l.to}${l.reason?` (${l.reason})`:''}.`);return c},Object.defineProperty(e,"editedWords",{enumerable:!0,get:function(){return b}});var t=r(_d[0]),n=r(_d[1]);const o='For example: birthday, high chair, dog, window seat',s='This booking came from the website. Changes here are not sent to website bookings yet.';const l=t=>{const n=t;return'Wix'===n.importedFrom||!!n.wix||(t.tags??[]).includes('Wix')},d=['date','time','partySize','name','phone','email','notes','table'],c={date:'date',time:'time',partySize:'covers',name:'name',phone:'phone',email:'email',notes:'notes',table:'table'},u=t=>({date:t.date,time:t.time,partySize:t.partySize,name:t.name,phone:t.phone??'',email:t.email??'',notes:t.notes??'',table:t.table??''}),f=(t,n)=>'partySize'===t?Number(n):String(n??'').trim();function p(t,n){const o=u(t);return d.filter(t=>f(t,o[t])!==f(t,n[t]))}const b=t=>t.map(t=>c[t]).join(', ')},1111,[1098,1092]); +__d(function(g,r,i,_a,m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"NOTES_PLACEHOLDER",{enumerable:!0,get:function(){return a}}),Object.defineProperty(_e,"WIX_EDIT_NOTE",{enumerable:!0,get:function(){return s}}),Object.defineProperty(_e,"NOTIFY_LABEL",{enumerable:!0,get:function(){return o}}),Object.defineProperty(_e,"guestMessageFields",{enumerable:!0,get:function(){return n}}),_e.canEditBooking=function(e){return'customer'!==e.variant&&('staff'===e.variant||e.inStaffApp?!!e.shiftManager:'display'===e.variant||'chef'===e.variant||'staff'!==e.role)},Object.defineProperty(_e,"isWixBooking",{enumerable:!0,get:function(){return d}}),Object.defineProperty(_e,"EDIT_FIELDS",{enumerable:!0,get:function(){return c}}),Object.defineProperty(_e,"DEPOSIT_METHODS",{enumerable:!0,get:function(){return u}}),Object.defineProperty(_e,"EDIT_STATUSES",{enumerable:!0,get:function(){return l}}),Object.defineProperty(_e,"SOURCES",{enumerable:!0,get:function(){return h}}),Object.defineProperty(_e,"OCCASIONS",{enumerable:!0,get:function(){return p}}),Object.defineProperty(_e,"TAGS",{enumerable:!0,get:function(){return b}}),Object.defineProperty(_e,"FIELD_WORDS",{enumerable:!0,get:function(){return f}}),Object.defineProperty(_e,"draftOf",{enumerable:!0,get:function(){return y}}),_e.changedFields=N,_e.historyText=k,_e.editPatch=function(t,a,s,o=(new Date).toISOString()){const n=N(t,a);if(!n.length)return{};const d={};for(const c of n)switch(c){case'partySize':d.partySize=(0,e.clampParty)(Number(a.partySize));break;case'phone':case'email':case'table':d[c]=String(a[c]??'').trim()||void 0;break;case'date':case'time':case'name':case'notes':d[c]=String(a[c]??'').trim();break;case'area':d.area=(a.area??'').trim()||void 0;break;case'dogs':d.dogs=Math.max(0,Number(a.dogs??0)),d.dog=Number(a.dogs??0)>0;break;case'highChairs':d.highChairs=Math.max(0,Number(a.highChairs??0))||void 0;break;case'wheelchair':d.access={...t.access??{},wheelchair:Math.max(0,Number(a.wheelchair??0))||void 0};break;case'occasion':d.occasion=a.occasion||void 0;break;case'allergies':d.allergies=[...a.allergies??[]],d.allergyNone=!!a.allergyNone&&!(a.allergies??[]).length,d.allergyNote=(a.allergyNote??'').trim()||void 0,(a.allergies??[]).length||(d.allergyAck=void 0);break;case'diet':d.diet={vegan:Number(a.vegan??0)||void 0,vegetarian:Number(a.vegetarian??0)||void 0};break;case'deposit':if(!a.depositOn){Object.assign(d,{security:'none',depositDue:0,depositPaid:0,depositPaidBy:void 0,depositPaidAt:void 0,depositMethod:void 0});break}if(d.security='deposit',d.depositDue=Math.max(0,Math.round(Number(a.depositDue??0))),a.depositPaid){const e=/^\d{4}-\d{2}-\d{2}$/.test(a.depositDate??'')?a.depositDate:o.slice(0,10);Object.assign(d,{depositPaid:Math.max(0,Math.round(Number(a.depositAmount??0))),depositPaidBy:s.by.slice(0,80),depositPaidAt:e===o.slice(0,10)?o:`${e}T12:00:00.000Z`,depositMethod:a.depositMethod||void 0})}else Object.assign(d,{depositPaid:0,depositPaidBy:void 0,depositPaidAt:void 0,depositMethod:void 0});break;case'status':d.status=a.status,'seated'!==a.status||t.seatedAt||(d.seatedAt=o),'finished'!==a.status||t.finishedAt||(d.finishedAt=o),'confirmed'!==a.status&&'pending'!==a.status||(d.seatedAt=void 0,d.finishedAt=void 0);break;case'source':d.source=a.source||void 0;break;case'tags':d.tags=[...(t.tags??[]).filter(e=>!b.includes(e)),...a.tags??[]];break;case'duration':d.durationMins=Number(a.duration??0)>=15?Number(a.duration):void 0}n.includes('table')&&(d.tableSetHere=!0);const c=t;return d.locallyEdited=!0,d.editedFields=[...new Set([...c.editedFields??[],...n])],d.editLog=[...c.editLog??[],{at:o,by:s.by.slice(0,80),app:s.app,fields:n,text:k(t,a,n,s.by.slice(0,80),o),quiet:!s.notify}].slice(-50),d},_e.historyLines=function(e){return(e.editLog??[]).slice().reverse().map(e=>e.text??`${e.fields.map(e=>f[e]??e).join(', ')} changed by ${e.by} ${w(e.at)}`.replace(/^./,e=>e.toUpperCase()))},_e.editWarnings=function(e,a,s,o,n=90,d){const c=[];if(!N(e,a).some(e=>['date','time','partySize','table','duration','dogs','status'].includes(e)))return c;const u={...e,date:a.date,time:a.time,partySize:a.partySize,...Number(a.duration??0)>=15?{durationMins:Number(a.duration)}:{}};if(a.table){const e=(0,t.tableOverlaps)(u,a.table,s.filter(e=>e.date===a.date),n);if(e.length&&c.push(`The table already has a booking at about the same time: ${e.map(e=>`${e.time} ${e.walkIn?'walk-in':e.name}`).join(', ')}.`),d){const e=a.table.split('+').map(e=>e.trim()).filter(Boolean).map(e=>d.tables.find(t=>t.name===e)).filter(Boolean),t=e.reduce((e,t)=>e+t.maxSeats,0);e.length&&td.areas.find(t=>t.id===e.areaId)).filter(e=>e&&!e.dogs);Number(a.dogs??0)>0&&s.length&&c.push(`Dogs aren\u2019t allowed in ${s[0].name}. Pick a dog-friendly table.`)}}o&&c.push(`Bookings are paused ${o.from} to ${o.to}${o.reason?` (${o.reason})`:''}.`);return c},Object.defineProperty(_e,"editedWords",{enumerable:!0,get:function(){return M}}),_e.bookingExtras=function(e){const t=e,a=e.dogs??(e.dog?1:0),s=[];a&&s.push(O(a,'dog','dogs'));t.highChairs&&s.push(O(t.highChairs,'high chair','high chairs'));e.access?.wheelchair&&s.push(O(e.access.wheelchair,'wheelchair','wheelchairs'));e.diet?.vegan&&s.push(`${e.diet.vegan} vegan`);e.diet?.vegetarian&&s.push(`${e.diet.vegetarian} vegetarian`);e.occasion&&s.push(e.occasion.charAt(0).toUpperCase()+e.occasion.slice(1));t.area&&s.push(t.area);t.depositMethod&&(e.depositPaid??0)>0&&s.push(`Deposit by ${t.depositMethod}`);return s.join(' \xb7 ')};var e=r(_d[0]),t=r(_d[1]);const a='For example: birthday, high chair, dog, window seat',s='This booking came from the website. Changes here are not sent to website bookings yet.',o='Message the guest about the new date, time or status (website bookings sends it)',n=e=>e.filter(e=>'date'===e||'time'===e||'status'===e);const d=e=>{const t=e;return'Wix'===t.importedFrom||!!t.wix||(e.tags??[]).includes('Wix')},c=['date','time','partySize','name','phone','email','notes','table','area','dogs','highChairs','wheelchair','occasion','allergies','diet','deposit','status','source','tags','duration'],u=['card','cash','bank transfer','website','other'],l=[{id:'pending',label:'Needs confirming'},{id:'confirmed',label:'Confirmed'},{id:'seated',label:'Seated'},{id:'finished',label:'Finished'},{id:'noshow',label:'No-show'}],h=[{id:'phone',label:'Phone'},{id:'in-person',label:'In person'},{id:'online',label:'Online'}],p=[{id:'',label:'None'},{id:'birthday',label:'Birthday'},{id:'anniversary',label:'Anniversary'},{id:'celebration',label:'Celebration'}],b=['VIP','Regular'],f={date:'date',time:'time',partySize:'covers',name:'name',phone:'phone',email:'email',notes:'notes',table:'table',area:'area',dogs:'dogs',highChairs:'high chairs',wheelchair:'wheelchairs',occasion:'occasion',allergies:'allergies',diet:'dietary',deposit:'deposit',status:'status',source:'source',tags:'tags',duration:'table time'},y=e=>{const t=e;return{date:e.date,time:e.time,partySize:e.partySize,name:e.name,phone:e.phone??'',email:e.email??'',notes:e.notes??'',table:e.table??'',area:t.area??'',dogs:e.dogs??(e.dog?1:0),highChairs:t.highChairs??0,wheelchair:e.access?.wheelchair??0,occasion:e.occasion??'',allergies:e.allergies??[],allergyNone:!!e.allergyNone,allergyNote:e.allergyNote??'',vegan:e.diet?.vegan??0,vegetarian:e.diet?.vegetarian??0,depositOn:'deposit'===e.security||(e.depositDue??0)>0||(e.depositPaid??0)>0,depositPaid:(e.depositPaid??0)>0&&!!e.depositPaidBy,depositAmount:(e.depositPaid??0)>0?e.depositPaid:e.depositDue??0,depositMethod:t.depositMethod??'',depositDate:(a=e.depositPaidAt,a?a.slice(0,10):''),depositDue:e.depositDue??0,status:e.status,source:e.source??'',tags:[...e.tags??[]].filter(e=>b.includes(e)).sort(),duration:e.durationMins??0};var a},$=e=>JSON.stringify([[...e.allergies??[]].map(e=>`${e.allergen}:${e.severity}`).sort(),!!e.allergyNone,(e.allergyNote??'').trim()]),v=e=>JSON.stringify(e.depositOn?[!0,!!e.depositPaid,Number(e.depositAmount??0),Number(e.depositDue??0),e.depositPaid?e.depositMethod??'':'',e.depositPaid?e.depositDate??'':'']:[!1]);function P(e,t){switch(e){case'partySize':return Number(t.partySize);case'allergies':return $(t);case'diet':return`${Number(t.vegan??0)}/${Number(t.vegetarian??0)}`;case'deposit':return v(t);case'tags':return[...t.tags??[]].sort().join(',');case'dogs':case'highChairs':case'wheelchair':case'duration':return Number(t[e]??0);default:return String(t[e]??'').trim()}}function N(e,t){const a=y(e);return c.filter(e=>P(e,a)!==P(e,t))}const S=e=>`\xa3${(e/100).toFixed(e%100?2:0)}`,w=e=>{const t=new Date(e);return`${String(t.getHours()).padStart(2,'0')}:${String(t.getMinutes()).padStart(2,'0')}`},O=(e,t,a)=>`${e} ${1===e?t:a}`;function k(e,t,a,s,o){const n=y(e),d=[];for(const e of[...a].sort((e,t)=>Number('deposit'===t)-Number('deposit'===e)))'deposit'===e?t.depositOn?t.depositPaid&&!n.depositPaid?d.push(`deposit marked paid (${S(Number(t.depositAmount??0))}${t.depositMethod?`, ${t.depositMethod}`:''})`):!t.depositPaid&&n.depositPaid?d.push('deposit marked not paid'):d.push(t.depositPaid?`deposit changed (${S(Number(t.depositAmount??0))}${t.depositMethod?`, ${t.depositMethod}`:''})`:`deposit due ${S(Number(t.depositDue??0))}`):d.push('deposit taken off'):'dogs'===e?d.push(!n.dogs&&t.dogs?1===t.dogs?'dog added':`${t.dogs} dogs added`:t.dogs?O(Number(t.dogs),'dog','dogs'):'no dog now'):'highChairs'===e?d.push(t.highChairs?O(Number(t.highChairs),'high chair','high chairs'):'no high chair now'):'wheelchair'===e?d.push(t.wheelchair?O(Number(t.wheelchair),'wheelchair user','wheelchair users'):'no wheelchair now'):'partySize'===e?d.push(`covers ${n.partySize} to ${t.partySize}`):'time'===e?d.push(`time ${n.time} to ${t.time}`):'date'===e?d.push(`date ${n.date} to ${t.date}`):'table'===e?d.push(t.table?`table ${t.table}`:'table taken off'):'status'===e?d.push(`status ${l.find(e=>e.id===t.status)?.label.toLowerCase()??t.status}`):'occasion'===e?d.push(t.occasion?`occasion ${t.occasion}`:'occasion taken off'):'area'===e?d.push(t.area?`area ${t.area}`:'any area'):'duration'===e?d.push(t.duration?`table time ${t.duration} min`:'table time as usual'):d.push(`${f[e]} changed`);const c=d.join(', ');return`${c.charAt(0).toUpperCase()}${c.slice(1)} by ${s} ${w(o)}`}const M=e=>e.map(e=>f[e]).join(', ')},1111,[1098,1092]); __d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"canCancelWalkIn",{enumerable:!0,get:function(){return y}}),Object.defineProperty(_e,"canReinstateWalkIn",{enumerable:!0,get:function(){return h}}),_e.cancelWalkInWords=x,_e.reinstateWalkInWords=p,_e.cancelWalkInNow=$,_e.reinstateWalkInNow=I,_e.CancelWalkInButton=function({rid:e,b:t,onDone:l,small:s,big:o}){const[c,u]=(0,n.useState)(!1);return y(t)?(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(f.Button,{kind:"secondary",small:s,label:"Cancel walk-in",testID:`cancel-walkin-${t.id}`,accessibilityLabel:`Cancel walk-in ${t.ref}, ${t.partySize} Covers`,onPress:()=>u(!0),style:o?{minHeight:64}:s?{minHeight:44}:w}),c?(0,k.jsx)(j,{rid:e,b:t,onClose:()=>u(!1),onDone:l}):null]}):null},_e.CancelWalkInConfirm=j,_e.ReinstateWalkInButton=function({rid:e,b:t,today:l,onDone:o,small:c}){const[u,y]=(0,n.useState)(!1);if(!h(t,l))return null;const x=p(t);if(!u)return(0,k.jsx)(f.Button,{kind:"ghost",small:c,label:"Undo cancel",testID:`reinstate-walkin-${t.id}`,accessibilityLabel:`Undo cancel for walk-in ${t.ref}`,onPress:()=>y(!0),style:c?{minHeight:44}:w});return(0,k.jsxs)(f.Sheet,{visible:!0,onClose:()=>y(!1),title:"Undo cancel?",maxWidth:560,testID:"reinstate-walkin-confirm",children:[(0,k.jsx)(s.default,{accessible:!0,accessibilityLabel:x,children:(0,k.jsx)(f.T,{size:18,colour:b.colours.text,children:x})}),(0,k.jsxs)(f.Row,{gap:8,wrap:!0,children:[(0,k.jsx)(f.Button,{label:"Yes, put back to seated",testID:"reinstate-walkin-yes",accessibilityLabel:`Yes, put walk-in ${t.ref} back to seated`,style:[w,{flexGrow:1}],onPress:async()=>{await I(e,t),y(!1),o?.(`Walk-in ${t.ref} put back to seated.`)}}),(0,k.jsx)(f.Button,{kind:"secondary",label:"Keep cancelled",testID:"reinstate-walkin-no",onPress:()=>y(!1),style:w})]})]})};var e,t=r(d[0]),n=r(d[1]),l=r(d[2]),s=(e=l)&&e.__esModule?e:{default:e},o=r(d[3]),c=r(d[4]),u=r(d[5]),b=r(d[6]),f=r(d[7]),k=r(d[8]);const w={minHeight:56},y=e=>!!e.walkIn&&('seated'===e.status||'confirmed'===e.status),h=(e,t)=>!!e.walkIn&&'cancelled'===e.status&&e.date>=t;function x(e){const t=(0,c.tablesOf)(e.table),n=(0,u.tablesWords)(t);return`Cancel walk-in ${e.ref}, ${e.partySize} Covers${t.length?` at ${n}`:''}, arrived ${e.time}? It comes off the Covers${t.length?` and ${n} ${t.length>1?'go':'goes'} back to Free`:''}.`}function p(e){return`Put walk-in ${e.ref} back to seated? CoverCharge only \u2014 if it was cancelled on the website, put it back there too if needed.`}async function $(e,n){await o.repo.bookings.setStatus(n.id,'cancelled'),await o.repo.bookings.update(n.id,{cancelled:(0,t.cancelStamp)(n)}),(0,c.tablesOf)(n.table).forEach(t=>c.useFloor.getState().setLive(e,t,{stage:void 0,dirty:!1}))}async function I(e,t){await o.repo.bookings.setStatus(t.id,'seated'),(0,c.tablesOf)(t.table).forEach(t=>c.useFloor.getState().setLive(e,t,{stage:'seated',dirty:!1}))}function j({rid:e,b:t,onClose:n,onDone:l}){const o=x(t);return(0,k.jsxs)(f.Sheet,{visible:!0,onClose:n,title:"Cancel walk-in?",maxWidth:560,testID:"cancel-walkin-confirm",children:[(0,k.jsx)(s.default,{accessible:!0,accessibilityLabel:o,children:(0,k.jsx)(f.T,{size:18,colour:b.colours.text,children:o})}),(0,k.jsxs)(f.Row,{gap:8,wrap:!0,children:[(0,k.jsx)(f.Button,{label:"Yes, cancel walk-in",testID:"cancel-walkin-yes",accessibilityLabel:`Yes, cancel walk-in ${t.ref}`,style:[w,{flexGrow:1}],onPress:async()=>{await $(e,t),n(),l?.(`Walk-in ${t.ref} cancelled.${(0,c.tablesOf)(t.table).length?` ${(0,u.tablesWords)((0,c.tablesOf)(t.table))} free.`:''}`)}}),(0,k.jsx)(f.Button,{kind:"secondary",label:"Keep walk-in",testID:"cancel-walkin-no",accessibilityLabel:`Keep walk-in ${t.ref}`,onPress:n,style:w})]})]})}},1112,[1113,34,102,848,1014,1095,840,794,25]); __d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.cancelStamp=C,_e.cancelBookingNow=w,_e.reinstateBookingNow=$,_e.CancelBookingButton=function({rid:e,b:n,name:o,onDone:s,big:l,small:c}){const[u,f]=(0,t.useState)(!1);return(0,b.canCancelBooking)(n)?(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(x.Button,{kind:"secondary",small:c,label:"Cancel booking",testID:`cancel-booking-${n.id}`,accessibilityLabel:`Cancel booking for ${o}, ${n.time}, ${n.partySize} Covers`,onPress:()=>f(!0),style:l?{minHeight:64}:c?{minHeight:44}:j}),u?(0,h.jsx)(D,{rid:e,b:n,name:o,onClose:()=>f(!1),onDone:s}):null]}):null},_e.CancelBookingConfirm=D,_e.ReinstateBookingButton=function({b:e,name:n,today:s,onDone:l}){const[c,u]=(0,t.useState)(!1);if(!(0,b.canReinstateBooking)(e,s))return null;const y=(0,b.reinstateBookingWords)(e,n);if(!c)return(0,h.jsx)(x.Button,{kind:"ghost",label:"Undo cancel",testID:`reinstate-booking-${e.id}`,accessibilityLabel:`Undo cancel for ${n}`,onPress:()=>u(!0),style:j});return(0,h.jsxs)(x.Sheet,{visible:!0,onClose:()=>u(!1),title:"Undo cancel?",maxWidth:560,testID:"reinstate-booking-confirm",children:[(0,h.jsx)(o.default,{accessible:!0,accessibilityLabel:y,style:{alignItems:'center'},children:(0,h.jsx)(x.T,{size:18,colour:f.colours.text,style:{textAlign:'center'},children:y})}),(0,h.jsxs)(x.Row,{gap:8,wrap:!0,style:{justifyContent:'center'},children:[(0,h.jsx)(x.Button,{label:"Yes, put back to booked",testID:"reinstate-booking-yes",accessibilityLabel:`Yes, put ${n} back to booked`,style:[j,{flexGrow:1}],onPress:async()=>{await $(e),u(!1),l?.(`${n} put back to booked.`)}}),(0,h.jsx)(x.Button,{kind:"secondary",label:"Keep cancelled",testID:"reinstate-booking-no",onPress:()=>u(!1),style:j})]})]})};var e,t=r(d[0]),n=r(d[1]),o=(e=n)&&e.__esModule?e:{default:e},s=r(d[2]),l=r(d[3]),c=r(d[4]),b=r(d[5]),u=r(d[6]),f=r(d[7]),y=r(d[8]),k=r(d[9]),p=r(d[10]),x=r(d[11]),h=r(d[12]);const j={minHeight:56},B={display:'Display',owner:'Managers app',staff:'Staff app',chef:'Kitchen app',customer:'Customer page'};function C(e){const t=y.useSession.getState().meId,n=t?k.useOwner.getState().staff.find(e=>e.id===t):void 0,o=B[p.APP_VARIANT]??'CoverCharge';return{by:n?`${n.name.replace(' (example)','')} (${o})`:o,at:(new Date).toISOString(),app:o,...e.table?{table:e.table}:{}}}async function w(e,t){const n=(0,l.tablesOf)(t.table);await s.repo.bookings.update(t.id,{status:'cancelled',cancelled:C(t),...(0,c.tablePatch)(null)}),n.forEach(t=>l.useFloor.getState().setLive(e,t,{stage:void 0,dirty:!1}))}async function $(e){await s.repo.bookings.setStatus(e.id,'confirmed')}function D({rid:e,b:t,name:n,onClose:s,onDone:c}){const y=(0,b.cancelBookingWords)(t,n),k=(0,l.tablesOf)(t.table);return(0,h.jsxs)(x.Sheet,{visible:!0,onClose:s,title:"Cancel booking?",maxWidth:560,testID:"cancel-booking-confirm",children:[(0,h.jsx)(o.default,{accessible:!0,accessibilityLabel:y,style:{alignItems:'center',gap:8},children:(0,h.jsx)(x.T,{size:18,colour:f.colours.text,style:{textAlign:'center'},children:y})}),(0,h.jsxs)(x.Row,{gap:8,wrap:!0,style:{justifyContent:'center'},children:[(0,h.jsx)(x.Button,{label:"Yes, cancel booking",testID:"cancel-booking-yes",accessibilityLabel:`Yes, cancel booking for ${n}`,style:[j,{flexGrow:1}],onPress:async()=>{await w(e,t),s(),c?.(`${n} cancelled.${k.length?` ${(0,u.tablesWords)(k)} free.`:''}`)}}),(0,h.jsx)(x.Button,{kind:"secondary",label:"Keep booking",testID:"cancel-booking-no",accessibilityLabel:`Keep booking for ${n}`,onPress:s,style:j})]})]})}},1113,[34,102,848,1014,1092,1114,1095,840,997,865,846,794,25]); __d(function(g,r,i,_a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"canCancelBooking",{enumerable:!0,get:function(){return n}}),Object.defineProperty(e,"canReinstateBooking",{enumerable:!0,get:function(){return t}}),e.cancelBookingWords=function(n,t){const o=`${n.partySize} Cover${1===n.partySize?'':'s'}`;return`Cancel booking for ${t}, ${n.time}, ${o}? The table is freed. Website bookings will cancel it on the website and may email the guest.`},e.reinstateBookingWords=function(n,t){return`Put ${t} back to booked for ${n.time}? CoverCharge only \u2014 if it was cancelled on the website, put it back there too if needed.`},e.cancelledOnDay=o,e.cancelledDayTally=function(n,t){const a=o(n,t),l=a.filter(n=>!!n.walkIn),c=a.filter(n=>!n.walkIn);return{count:a.length,covers:a.reduce((n,t)=>n+t.partySize,0),bookings:c.length,bookingCovers:c.reduce((n,t)=>n+t.partySize,0),walkIns:l.length,walkInCovers:l.reduce((n,t)=>n+t.partySize,0),list:a}},e.cancelledTallyWords=function(n,t="today"){if(!n.count)return`No cancellations ${t}`;const o=[],a=n.bookings??0,l=n.walkIns??0;a&&o.push(`${a} booking${1===a?'':'s'} (${n.bookingCovers??0} Cover${1===(n.bookingCovers??0)?'':'s'})`);l&&o.push(`${l} walk-in${1===l?'':'s'} (${n.walkInCovers??0} Cover${1===(n.walkInCovers??0)?'':'s'})`);if(!o.length)return`Cancelled ${t}: ${n.count} \xb7 ${n.covers} Cover${1===n.covers?'':'s'}`;return`Cancelled ${t}: ${o.join(' \xb7 ')}`};const n=n=>!n.walkIn&&('confirmed'===n.status||'pending'===n.status||'seated'===n.status),t=(n,t)=>!n.walkIn&&'cancelled'===n.status&&n.date>=t;function o(n,t){return n.filter(n=>n.date===t&&'cancelled'===n.status).sort((n,t)=>n.time.localeCompare(t.time)||n.name.localeCompare(t.name))}},1114,[]); -__d(function(g,_r,i,_a,_m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.BookingEditButton=function({rid:e,booking:a,who:n,role:o,inStaffApp:l,shiftManager:s,big:d,testID:r}){const[u,b]=(0,t.useState)(!1);return a.walkIn||!(0,h.canEditBooking)({variant:c.APP_VARIANT,inStaffApp:l,role:o,shiftManager:s})?null:(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(k.Button,{kind:"secondary",small:!d,label:"Edit booking",testID:r??`edit-booking-${a.id}`,accessibilityLabel:`Edit booking, ${a.name}, ${a.time}`,onPress:()=>b(!0),style:{minHeight:d?64:44}}),u?(0,j.jsx)(C,{rid:e,id:a.id,who:n,onClose:()=>b(!1)}):null]})},_e.EditBookingPicker=function({rid:e,today:a,who:n,onClose:o,hidePrivate:s}){const[d,r]=(0,t.useState)(null),c=(0,l.useBookings)(e).filter(e=>!e.walkIn&&e.date>=a&&!['cancelled','noshow','finished'].includes(e.status)).sort((e,t)=>e.date.localeCompare(t.date)||e.time.localeCompare(t.time)).slice(0,60);return d?(0,j.jsx)(C,{rid:e,id:d,who:n,hidePrivate:s,onClose:o}):(0,j.jsxs)(k.Sheet,{visible:!0,onClose:o,title:"Edit booking \xb7 pick a booking",maxWidth:640,testID:"edit-booking-picker",children:[(0,j.jsx)(k.T,{size:16,colour:b.colours.text,children:"Tip: tap the booking you want to change."}),c.length?c.map(e=>(0,j.jsx)(k.Button,{kind:"secondary",testID:`edit-pick-${e.id}`,label:`${e.date===a?'Today':e.date} ${e.time} \xb7 ${e.name} \xb7 ${e.partySize} ${1===e.partySize?'Cover':'Covers'}`,sub:e.notes?`Notes: ${e.notes}`:void 0,accessibilityLabel:`Edit booking, ${e.name}, ${e.date===a?'today':e.date}, ${e.time}, ${e.partySize} Covers`,onPress:()=>r(e.id),style:{minHeight:56,alignItems:'flex-start'}},e.id)):(0,j.jsx)(k.Muted,{children:"No bookings to edit from today on."}),(0,j.jsx)(k.Button,{kind:"ghost",label:"Close",onPress:o,style:{minHeight:44}})]})},_e.EditBookingSheet=C;var e,t=_r(_d[0]),a=_r(_d[1]),n=_r(_d[2]),o=(e=n)&&e.__esModule?e:{default:e},l=_r(_d[3]),s=_r(_d[4]),d=_r(_d[5]),r=_r(_d[6]),c=_r(_d[7]),h=_r(_d[8]),u=_r(_d[9]),b=_r(_d[10]),m=_r(_d[11]),p=_r(_d[12]),x=_r(_d[13]),y=_r(_d[14]),k=_r(_d[15]),j=_r(_d[16]);const f=/^([01]\d|2[0-3]):[0-5]\d$/,v=e=>{const t=e.trim().replace('.',':').match(/^(\d{1,2}):?(\d{2})$/);return t?`${t[1].padStart(2,'0')}:${t[2]}`:e.trim()};function C({rid:e,id:n,who:C,onClose:T,hidePrivate:I='display'===c.APP_VARIANT}){const B=(0,l.useBookings)(e),D=B.find(e=>e.id===n),P=(0,r.useRestaurant)(e),$=(0,s.usePlan)(e),S=(0,d.useBlocks)(e=>e.blocks),[w,E]=(0,t.useState)(D?(0,h.draftOf)(D):null),[z,A]=(0,t.useState)(null),[L,_]=(0,t.useState)(null);if(!D||!w||!P)return null;const F=e=>{A(null),_(null),E({...w,...e})},N=v(w.time),W=f.test(N),R=(0,u.tableOptions)($,B.filter(e=>e.date===w.date),w.table),M=(0,h.changedFields)(D,{...w,time:N}),O=P.settings.turnMins??90,H=async()=>{const t=(0,h.editPatch)(D,{...w,time:N},{by:C||'Team member',app:c.APP_VARIANT});if(Object.keys(t).length&&await l.repo.bookings.update(D.id,t),'seated'===D.status&&'table'in t&&t.table!==D.table){const a=e=>e?e.split('+').map(e=>e.trim()).filter(Boolean):[],n=a(D.table),o=a(t.table),l=s.useFloor.getState(),d=n.map(t=>l.live[e]?.[t]?.stage).find(Boolean)??'seated';n.filter(e=>!o.includes(e)).forEach(t=>l.setLive(e,t,{stage:void 0,dirty:!0})),o.forEach(t=>l.setLive(e,t,{stage:d,dirty:!1}))}_(`Saved. Changed: ${(0,h.editedWords)(M)}.`),A(null),T()};return(0,j.jsxs)(k.Sheet,{visible:!0,onClose:T,title:`Edit booking \xb7 ${D.name} \xb7 ${D.ref}`,maxWidth:760,testID:"edit-booking-sheet",children:[(0,j.jsx)(x.DepositChip,{b:D,money:!0,big:!0,testID:"edit-deposit"}),(0,h.isWixBooking)(D)?(0,j.jsx)(o.default,{testID:"edit-wix-note",accessible:!0,accessibilityLabel:h.WIX_EDIT_NOTE,style:{padding:12,borderRadius:12,borderWidth:1,borderColor:b.colours.gold},children:(0,j.jsx)(k.T,{size:16,colour:b.colours.goldLight,children:h.WIX_EDIT_NOTE})}):null,(0,j.jsx)(k.T,{size:16,colour:b.colours.text,children:"Tip: change what you need, then press Save changes."}),(0,j.jsx)(p.BookingDatePicker,{r:P,today:new Date,value:w.date,onChange:e=>F({date:e})}),(0,j.jsx)(k.Field,{label:"Time (24-hour, for example 19:30)",value:w.time,onChangeText:e=>F({time:e}),testID:"edit-time"}),W?null:(0,j.jsx)(k.T,{size:15,colour:b.colours.amber,children:"Write the time like 19:30."}),(0,j.jsxs)(o.default,{style:{gap:6,alignItems:'center'},children:[(0,j.jsx)(k.T,{size:18,center:!0,children:"Covers"}),(0,j.jsx)(a.PartySizeInput,{value:w.partySize,onChange:e=>F({partySize:e}),label:"Covers",testID:"edit-covers"})]}),(0,j.jsx)(k.Field,{label:"Name",value:w.name,onChangeText:e=>F({name:e}),testID:"edit-name"}),I?(0,j.jsx)(k.Muted,{children:"Phone and email can be changed in the Managers app; the Display never shows them."}):(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(k.Field,{label:"Phone",value:w.phone,onChangeText:e=>F({phone:e}),keyboardType:"phone-pad",testID:"edit-phone"}),(0,j.jsx)(k.Field,{label:"Email",value:w.email,onChangeText:e=>F({email:e}),keyboardType:"email-address",autoCapitalize:"none",testID:"edit-email"})]}),(0,j.jsx)(k.Field,{label:"Notes",value:w.notes,onChangeText:e=>F({notes:e}),placeholder:h.NOTES_PLACEHOLDER,multiline:!0,numberOfLines:3,testID:"edit-notes"}),D.allergies.length||D.allergyNote?(0,j.jsx)(k.Muted,{children:"Allergies are kept separately and are not changed here."}):null,(0,j.jsx)(k.T,{size:18,weight:"semibold",children:(0,u.tableButtonLabel)(w.table)}),(0,j.jsxs)(k.Row,{gap:8,wrap:!0,children:[(0,j.jsx)(k.Button,{kind:w.table?'secondary':'primary',label:"No table",accessibilityLabel:"No table"+(w.table?'':', chosen'),onPress:()=>F({table:''}),style:{minHeight:44,minWidth:96},testID:"edit-table-none"}),R.map(e=>(0,j.jsx)(k.Button,{kind:e===w.table?'primary':'secondary',label:(0,u.tableButtonLabel)(e),accessibilityLabel:`Table ${(0,u.tableButtonLabel)(e)}${e===w.table?', chosen':''}`,onPress:()=>F({table:e}),style:{minHeight:44,minWidth:64},testID:`edit-table-${e}`},e))]}),z?(0,j.jsxs)(o.default,{testID:"edit-warn",style:{gap:8,padding:12,borderRadius:12,borderWidth:1.5,borderColor:b.colours.amber,backgroundColor:b.colours.amberBg},children:[z.map(e=>(0,j.jsx)(k.T,{size:16,colour:"#FFE2A8",children:e},e)),(0,j.jsx)(k.T,{size:16,colour:"#FFE2A8",children:"You can still save."})]}):null,L?(0,j.jsx)(k.T,{size:16,colour:b.colours.goldLight,children:L}):null,(0,j.jsxs)(k.Row,{gap:8,wrap:!0,children:[(0,j.jsx)(k.Button,{label:z?'Save anyway':'Save changes',testID:"edit-save",disabled:!W||w.name.trim().length<1||!M.length,onPress:()=>{const t=W?(0,d.blockAt)(S,e,w.date,N):void 0,a=(0,h.editWarnings)(D,{...w,time:N},B,t,O);!a.length||z?H():A(a)},style:{minHeight:56,flex:1}}),(0,j.jsx)(k.Button,{kind:"ghost",label:"Close",onPress:T,style:{minHeight:56}})]}),(0,j.jsx)(y.CancelBookingButton,{rid:e,b:D,name:D.name,big:!0,onDone:()=>T()}),(0,j.jsx)(y.ReinstateBookingButton,{b:D,name:D.name,today:(0,m.ymd)(new Date),onDone:()=>T()})]})}},1115,[34,1097,102,848,1014,1011,850,846,1111,1092,840,827,1105,1089,1113,794,25]); +__d(function(g,_r,_i,_a,_m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.BookingEditButton=function({rid:e,booking:s,who:i,role:a,inStaffApp:n,shiftManager:l,big:o,testID:d}){const[h,m]=(0,t.useState)(!1),x=(0,u.useSession)(e=>e.meId),j=(0,p.useOwner)(e=>e.staff.find(e=>e.id===x&&e.active));return s.walkIn||!(0,c.canEditBooking)({variant:r.APP_VARIANT,inStaffApp:n,role:a,shiftManager:l})||x&&!(0,b.canChangeBookings)(j)?null:(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(C.Button,{kind:"secondary",small:!o,label:"Edit booking",sub:o?void 0:"Deposit, dog, table, anything",testID:d??`edit-booking-${s.id}`,accessibilityLabel:`Edit booking, ${s.name}, ${s.time}`,onPress:()=>m(!0),style:{minHeight:o?64:44}}),h?(0,f.jsx)(B,{rid:e,id:s.id,who:i,onClose:()=>m(!1)}):null]})},_e.EditBookingPicker=function({rid:e,today:s,who:i,onClose:a,hidePrivate:l}){const[o,d]=(0,t.useState)(null),r=(0,n.useBookings)(e).filter(e=>!e.walkIn&&e.date>=s&&!['cancelled','noshow','finished'].includes(e.status)).sort((e,t)=>e.date.localeCompare(t.date)||e.time.localeCompare(t.time)).slice(0,60);return o?(0,f.jsx)(B,{rid:e,id:o,who:i,hidePrivate:l,onClose:a}):(0,f.jsxs)(C.Sheet,{visible:!0,onClose:a,title:"Edit booking \xb7 pick a booking",maxWidth:640,testID:"edit-booking-picker",children:[(0,f.jsx)(C.T,{size:16,colour:x.colours.text,children:"Tip: tap the booking you want to change."}),r.length?r.map(e=>(0,f.jsx)(C.Button,{kind:"secondary",testID:`edit-pick-${e.id}`,label:`${e.date===s?'Today':e.date} ${e.time} \xb7 ${e.name} \xb7 ${e.partySize} ${1===e.partySize?'Cover':'Covers'}`,sub:e.notes?`Notes: ${e.notes}`:void 0,accessibilityLabel:`Edit booking, ${e.name}, ${e.date===s?'today':e.date}, ${e.time}, ${e.partySize} Covers`,onPress:()=>d(e.id),style:{minHeight:56,alignItems:'flex-start'}},e.id)):(0,f.jsx)(C.Muted,{children:"No bookings to edit from today on."}),(0,f.jsx)(C.Button,{kind:"ghost",label:"Close",onPress:a,style:{minHeight:44}})]})},_e.EditBookingSheet=B;var e,t=_r(_d[0]),s=_r(_d[1]),i=_r(_d[2]),a=(e=i)&&e.__esModule?e:{default:e},n=_r(_d[3]),l=_r(_d[4]),o=_r(_d[5]),d=_r(_d[6]),r=_r(_d[7]),c=_r(_d[8]),h=_r(_d[9]),u=_r(_d[10]),p=_r(_d[11]),b=_r(_d[12]),m=_r(_d[13]),x=_r(_d[14]),j=_r(_d[15]),y=_r(_d[16]),D=_r(_d[17]),I=_r(_d[18]),C=_r(_d[19]),f=_r(_d[20]);const T=/^([01]\d|2[0-3]):[0-5]\d$/,v=e=>{const t=e.trim().replace('.',':').match(/^(\d{1,2}):?(\d{2})$/);return t?`${t[1].padStart(2,'0')}:${t[2]}`:e.trim()};const w=e=>e?(e/100).toFixed(e%100?2:0):'',k=e=>{const t=Number(e.replace(/[\xa3,\s]/g,''));return Number.isFinite(t)&&t>=0?Math.round(100*t):NaN},S=e=>e&&/^\d{4}-\d{2}-\d{2}$/.test(e)?`${e.slice(8,10)}/${e.slice(5,7)}/${e.slice(0,4)}`:'',P=e=>{const t=e.trim().match(/^(\d{1,2})\/(\d{1,2})\/(\d{4})$/);return t?`${t[3]}-${t[2].padStart(2,'0')}-${t[1].padStart(2,'0')}`:''},$=e=>e.charAt(0).toUpperCase()+e.slice(1);function N({title:e,children:t,testID:s}){return(0,f.jsxs)(a.default,{testID:s,style:{gap:8,paddingTop:10,borderTopWidth:1,borderTopColor:x.colours.hairline,alignItems:'stretch'},children:[(0,f.jsx)(C.T,{size:17,weight:"semibold",center:!0,colour:x.colours.goldLight,children:e}),t]})}const E=({label:e,value:t,onChange:s,max:i=20,testID:a})=>(0,f.jsxs)(C.Row,{style:{justifyContent:'space-between',alignItems:'center'},children:[(0,f.jsx)(C.T,{size:16,children:e}),(0,f.jsx)(C.Stepper,{testID:a,value:t,min:0,max:i,onChange:s,label:e})]});function B({rid:e,id:i,who:u,onClose:p,hidePrivate:b='display'===r.APP_VARIANT}){const B=(0,n.useBookings)(e),O=B.find(e=>e.id===i),z=(0,d.useRestaurant)(e),A=(0,l.usePlan)(e),R=(0,o.useBlocks)(e=>e.blocks),[L,F]=(0,t.useState)(O?(0,c.draftOf)(O):null),[W,M]=(0,t.useState)(null),[_,H]=(0,t.useState)(null),[V,G]=(0,t.useState)(w(O?(0,c.draftOf)(O).depositDue:0)),[U,X]=(0,t.useState)(w(O?(0,c.draftOf)(O).depositAmount:0)),[Y,q]=(0,t.useState)(S(O?(0,c.draftOf)(O).depositDate:'')),[J,K]=(0,t.useState)(!1);if(!O||!L||!z)return null;const Q=e=>{M(null),H(null),F({...L,...e})},Z=v(L.time),ee=T.test(Z),te=L.area?A.areas.filter(e=>e.name===L.area).map(e=>e.id):null,se=e=>!te||e.split('+').every(e=>te.includes(A.tables.find(t=>t.name===e)?.areaId??'')),ie=(0,m.tableOptions)(A,B.filter(e=>e.date===L.date),L.table).filter(e=>se(e)||e===L.table),ae=!(L.depositOn&&(Number.isNaN(k(V||'0'))||L.depositPaid&&(Number.isNaN(k(U||'0'))||Y.trim()&&!P(Y)))),ne={...L,time:Z,depositDue:k(V||'0')||0,depositAmount:k(U||'0')||0,depositDate:P(Y)},le=(0,c.changedFields)(O,ne),oe=z.settings.turnMins??90,de=async()=>{const t=(0,c.editPatch)(O,ne,{by:u||'Team member',app:r.APP_VARIANT,notify:J&&(0,c.isWixBooking)(O)});if(Object.keys(t).length&&await n.repo.bookings.update(O.id,t),'seated'===O.status&&'table'in t&&t.table!==O.table){const s=e=>e?e.split('+').map(e=>e.trim()).filter(Boolean):[],i=s(O.table),a=s(t.table),n=l.useFloor.getState(),o=i.map(t=>n.live[e]?.[t]?.stage).find(Boolean)??'seated';i.filter(e=>!a.includes(e)).forEach(t=>n.setLive(e,t,{stage:void 0,dirty:!0})),a.forEach(t=>n.setLive(e,t,{stage:o,dirty:!1}))}H(`Saved. Changed: ${(0,c.editedWords)(le)}.`),M(null),p()},re=L.allergies??[],ce=e=>Q({allergyNone:!1,allergies:re.some(t=>t.allergen===e)?re.filter(t=>t.allergen!==e):[...re,{allergen:e,severity:'allergy'}]}),he=(0,c.historyLines)(O);return(0,f.jsxs)(C.Sheet,{visible:!0,onClose:p,title:`Edit booking \xb7 ${O.name} \xb7 ${O.ref}`,maxWidth:760,testID:"edit-booking-sheet",children:[(0,f.jsx)(a.default,{style:{alignItems:'center'},children:(0,f.jsx)(D.DepositChip,{b:O,money:!0,big:!0,testID:"edit-deposit"})}),(0,c.isWixBooking)(O)?(0,f.jsx)(a.default,{testID:"edit-wix-note",accessible:!0,accessibilityLabel:c.WIX_EDIT_NOTE,style:{padding:12,borderRadius:12,borderWidth:1,borderColor:x.colours.gold},children:(0,f.jsx)(C.T,{size:16,center:!0,colour:x.colours.goldLight,children:c.WIX_EDIT_NOTE})}):null,(0,f.jsx)(C.T,{size:16,center:!0,colour:x.colours.text,children:"Tip: change what you need, then press Save changes. Saving doesn\u2019t message the guest."}),(0,f.jsxs)(N,{title:"Deposit",testID:"edit-section-deposit",children:[(0,f.jsxs)(C.Row,{wrap:!0,gap:6,style:{justifyContent:'center'},children:[(0,f.jsx)(C.Chip,{label:"No deposit",selected:!L.depositOn,testID:"edit-deposit-none",onPress:()=>Q({depositOn:!1,depositPaid:!1})}),(0,f.jsx)(C.Chip,{label:"Deposit due",selected:!!L.depositOn&&!L.depositPaid,testID:"edit-deposit-due",onPress:()=>Q({depositOn:!0,depositPaid:!1})}),(0,f.jsx)(C.Chip,{label:"Deposit paid",selected:!!L.depositOn&&!!L.depositPaid,testID:"edit-deposit-paid",onPress:()=>{U||X(V),Y||q(S((0,j.ymd)(new Date))),Q({depositOn:!0,depositPaid:!0})}})]}),L.depositOn?(0,f.jsx)(C.Field,{label:"Deposit due (\xa3)",value:V,onChangeText:e=>{G(e),Q({})},keyboardType:"decimal-pad",testID:"edit-deposit-due-amount"}):null,L.depositOn&&L.depositPaid?(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(C.Field,{label:"Amount paid (\xa3)",value:U,onChangeText:e=>{X(e),Q({})},keyboardType:"decimal-pad",testID:"edit-deposit-amount"}),(0,f.jsx)(C.T,{size:16,center:!0,children:"How was it paid?"}),(0,f.jsx)(C.Row,{wrap:!0,gap:6,style:{justifyContent:'center'},children:c.DEPOSIT_METHODS.map(e=>(0,f.jsx)(C.Chip,{label:$(e),selected:L.depositMethod===e,testID:`edit-deposit-method-${e.replace(' ','-')}`,onPress:()=>Q({depositMethod:e})},e))}),(0,f.jsx)(C.Field,{label:"Date paid (for example 11/11/2026)",value:Y,onChangeText:e=>{q(e),Q({})},testID:"edit-deposit-date"}),Y.trim()&&!P(Y)?(0,f.jsx)(C.T,{size:15,center:!0,colour:x.colours.amber,children:"Write the date like 11/11/2026."}):null]}):null,ae?null:(0,f.jsx)(C.T,{size:15,center:!0,colour:x.colours.amber,children:"Write amounts in pounds, for example 60 or 12.50."}),(0,f.jsx)(C.Muted,{center:!0,children:"No payment is taken in CoverCharge: this records what the guest paid."})]}),(0,f.jsxs)(N,{title:"When",testID:"edit-section-when",children:[(0,f.jsx)(y.BookingDatePicker,{r:z,today:new Date,value:L.date,onChange:e=>Q({date:e})}),(0,f.jsx)(C.Field,{label:"Time (24-hour, for example 19:30)",value:L.time,onChangeText:e=>Q({time:e}),testID:"edit-time"}),ee?null:(0,f.jsx)(C.T,{size:15,colour:x.colours.amber,children:"Write the time like 19:30."}),(0,f.jsxs)(a.default,{style:{gap:6,alignItems:'center'},children:[(0,f.jsx)(C.T,{size:18,center:!0,children:"Covers"}),(0,f.jsx)(s.PartySizeInput,{value:L.partySize,onChange:e=>Q({partySize:e}),label:"Covers",testID:"edit-covers"})]}),(0,f.jsxs)(C.Row,{style:{justifyContent:'space-between',alignItems:'center'},children:[(0,f.jsx)(C.T,{size:16,children:"Table time"}),(0,f.jsx)(C.Stepper,{testID:"edit-duration",value:L.duration||0,min:0,max:360,step:15,onChange:e=>Q({duration:e}),format:e=>e?`${Math.floor(e/60)}h ${String(e%60).padStart(2,'0')}m`:'As usual',label:"Table time"})]})]}),(0,f.jsxs)(N,{title:"Where",testID:"edit-section-where",children:[(0,f.jsxs)(C.Row,{wrap:!0,gap:6,style:{justifyContent:'center'},children:[(0,f.jsx)(C.Chip,{label:"Any area",selected:!L.area,testID:"edit-area-any",onPress:()=>Q({area:''})}),A.areas.map(e=>(0,f.jsx)(C.Chip,{label:`${e.name}${e.dogs?' \xb7 dogs ok':''}`,selected:L.area===e.name,testID:`edit-area-${e.id}`,onPress:()=>Q({area:e.name})},e.id))]}),(0,f.jsx)(C.T,{size:18,weight:"semibold",center:!0,children:(0,m.tableButtonLabel)(L.table)}),(0,f.jsxs)(C.Row,{gap:8,wrap:!0,style:{justifyContent:'center'},children:[(0,f.jsx)(C.Button,{kind:L.table?'secondary':'primary',label:"No table",accessibilityLabel:"No table"+(L.table?'':', chosen'),onPress:()=>Q({table:''}),style:{minHeight:44,minWidth:96},testID:"edit-table-none"}),ie.map(e=>(0,f.jsx)(C.Button,{kind:e===L.table?'primary':'secondary',label:(0,m.tableButtonLabel)(e),accessibilityLabel:`Table ${(0,m.tableButtonLabel)(e)}${e===L.table?', chosen':''}`,onPress:()=>Q({table:e}),style:{minHeight:44,minWidth:64},testID:`edit-table-${e}`},e))]})]}),(0,f.jsxs)(N,{title:"Guest",testID:"edit-section-guest",children:[(0,f.jsx)(C.Field,{label:"Name",value:L.name,onChangeText:e=>Q({name:e}),testID:"edit-name"}),b?(0,f.jsx)(C.Muted,{center:!0,children:"Phone and email can be changed in the Managers app; the Display never shows them."}):(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(C.Field,{label:"Phone",value:L.phone,onChangeText:e=>Q({phone:e}),keyboardType:"phone-pad",testID:"edit-phone"}),(0,f.jsx)(C.Field,{label:"Email",value:L.email,onChangeText:e=>Q({email:e}),keyboardType:"email-address",autoCapitalize:"none",testID:"edit-email"})]}),(0,f.jsx)(C.T,{size:16,center:!0,children:"Booked by"}),(0,f.jsx)(C.Row,{wrap:!0,gap:6,style:{justifyContent:'center'},children:c.SOURCES.map(e=>(0,f.jsx)(C.Chip,{label:e.label,selected:L.source===e.id,testID:`edit-source-${e.id}`,onPress:()=>Q({source:e.id})},e.id))}),(0,f.jsx)(C.Row,{wrap:!0,gap:6,style:{justifyContent:'center'},children:c.TAGS.map(e=>{const t=(L.tags??[]).includes(e);return(0,f.jsx)(C.Chip,{label:e,selected:t,testID:`edit-tag-${e}`,onPress:()=>Q({tags:t?(L.tags??[]).filter(t=>t!==e):[...L.tags??[],e].sort()})},e)})})]}),(0,f.jsxs)(N,{title:"Dogs, high chairs and access",testID:"edit-section-needs",children:[(0,f.jsx)(E,{label:"Dogs",value:L.dogs??0,max:6,onChange:e=>Q({dogs:e}),testID:"edit-dogs"}),(0,f.jsx)(E,{label:"High chairs",value:L.highChairs??0,max:10,onChange:e=>Q({highChairs:e}),testID:"edit-high-chairs"}),(0,f.jsx)(E,{label:"Wheelchair users",value:L.wheelchair??0,max:10,onChange:e=>Q({wheelchair:e}),testID:"edit-wheelchair"}),(0,f.jsx)(C.T,{size:16,center:!0,children:"Occasion"}),(0,f.jsx)(C.Row,{wrap:!0,gap:6,style:{justifyContent:'center'},children:c.OCCASIONS.map(e=>(0,f.jsx)(C.Chip,{label:e.label,selected:(L.occasion??'')===e.id,testID:`edit-occasion-${e.id||'none'}`,onPress:()=>Q({occasion:e.id})},e.id||'none'))})]}),(0,f.jsxs)(N,{title:"Allergies and dietary",testID:"edit-section-allergies",children:[(0,f.jsxs)(C.Row,{wrap:!0,gap:6,style:{justifyContent:'center'},children:[(0,f.jsx)(C.Chip,{label:"No allergies",selected:!!L.allergyNone&&!re.length,testID:"edit-allergy-none",onPress:()=>Q({allergyNone:!0,allergies:[]})}),h.ALLERGENS.map(e=>(0,f.jsx)(C.Chip,{label:e.short,selected:re.some(t=>t.allergen===e.id),testID:`edit-allergen-${e.id}`,onPress:()=>ce(e.id)},e.id))]}),re.map(e=>(0,f.jsxs)(a.default,{style:{gap:4,alignItems:'center'},children:[(0,f.jsxs)(C.T,{size:15,center:!0,children:[h.ALLERGENS.find(t=>t.id===e.allergen)?.short,": how serious?"]}),(0,f.jsx)(C.Row,{wrap:!0,gap:6,style:{justifyContent:'center'},children:h.SEVERITIES.map(t=>(0,f.jsx)(C.Chip,{label:t.label,selected:e.severity===t.id,testID:`edit-severity-${e.allergen}-${t.id}`,onPress:()=>Q({allergies:re.map(s=>s.allergen===e.allergen?{...s,severity:t.id}:s)})},t.id))})]},e.allergen)),(0,f.jsx)(C.Field,{label:"Anything else about allergies",value:L.allergyNote,onChangeText:e=>Q({allergyNote:e}),testID:"edit-allergy-note"}),le.includes('allergies')&&re.length?(0,f.jsx)(C.T,{size:15,center:!0,colour:x.colours.amber,children:"The kitchen signs off allergies again after this change."}):null,(0,f.jsx)(E,{label:"Vegan",value:L.vegan??0,max:L.partySize,onChange:e=>Q({vegan:e}),testID:"edit-vegan"}),(0,f.jsx)(E,{label:"Vegetarian",value:L.vegetarian??0,max:L.partySize,onChange:e=>Q({vegetarian:e}),testID:"edit-vegetarian"})]}),'cancelled'!==O.status?(0,f.jsxs)(N,{title:"Status",testID:"edit-section-status",children:[(0,f.jsx)(C.Row,{wrap:!0,gap:6,style:{justifyContent:'center'},children:c.EDIT_STATUSES.map(e=>(0,f.jsx)(C.Chip,{label:e.label,selected:L.status===e.id,testID:`edit-status-${e.id}`,onPress:()=>Q({status:e.id})},e.id))}),(0,f.jsx)(C.Muted,{center:!0,children:"To cancel, use Cancel booking below. Nothing is ever deleted."})]}):null,(0,f.jsx)(N,{title:"Notes",testID:"edit-section-notes",children:(0,f.jsx)(C.Field,{label:"Notes",value:L.notes,onChangeText:e=>Q({notes:e}),placeholder:c.NOTES_PLACEHOLDER,multiline:!0,numberOfLines:3,testID:"edit-notes"})}),W?(0,f.jsxs)(a.default,{testID:"edit-warn",style:{gap:8,padding:12,borderRadius:12,borderWidth:1.5,borderColor:x.colours.amber,backgroundColor:x.colours.amberBg},children:[W.map(e=>(0,f.jsx)(C.T,{size:16,center:!0,colour:"#FFE2A8",children:e},e)),(0,f.jsx)(C.T,{size:16,center:!0,colour:"#FFE2A8",children:"You can still save."})]}):null,(0,c.isWixBooking)(O)&&(0,c.guestMessageFields)(le).length?(0,f.jsxs)(a.default,{testID:"edit-notify",style:{gap:6,alignItems:'center'},children:[(0,f.jsx)(C.Toggle,{value:J,onChange:K,label:c.NOTIFY_LABEL,testID:"edit-notify-toggle"}),(0,f.jsx)(C.Muted,{center:!0,children:J?'The website sends the guest its own message about this.':'Off: the guest isn\u2019t messaged. The website keeps the old date, time or status until it\u2019s changed there.'})]}):null,_?(0,f.jsx)(C.T,{size:16,center:!0,colour:x.colours.goldLight,children:_}):null,(0,f.jsxs)(C.Row,{gap:8,wrap:!0,children:[(0,f.jsx)(C.Button,{label:W?'Save anyway':'Save changes',testID:"edit-save",disabled:!ee||!ae||L.name.trim().length<1||!le.length,onPress:()=>{const t=ee?(0,o.blockAt)(R,e,L.date,Z):void 0,s=(0,c.editWarnings)(O,ne,B,t,oe,A);!s.length||W?de():M(s)},style:{minHeight:56,flex:1}}),(0,f.jsx)(C.Button,{kind:"ghost",label:"Close",onPress:p,style:{minHeight:56}})]}),he.length?(0,f.jsx)(N,{title:"Changes",testID:"edit-history",children:he.slice(0,12).map((e,t)=>(0,f.jsx)(C.T,{size:14,center:!0,colour:x.colours.muted,children:e},t))}):null,(0,f.jsx)(I.CancelBookingButton,{rid:e,b:O,name:O.name,big:!0,onDone:()=>p()}),(0,f.jsx)(I.ReinstateBookingButton,{b:O,name:O.name,today:(0,j.ymd)(new Date),onDone:()=>p()})]})}},1115,[34,1097,102,848,1014,1011,850,846,1111,830,997,865,1012,1092,840,827,1105,1089,1113,794,25]); __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,"useVoiceSlot",{enumerable:!0,get:function(){return w}}),_e.voiceAppFor=h,_e.useVoiceTarget=p,_e.VoiceSlot=function({size:e=56,layer:t=0}){const u=p(),c=(0,n.useRef)(null),l=(0,n.useRef)(y++).current,{width:f,height:h,fontScale:v}=(0,o.default)(),A=()=>{if(t{if(c.current!==e||!s||tu+.5?w.getState().owner===l&&w.setState({rect:null,owner:0}):w.setState({rect:{x:n,y:o,size:s},owner:l})})},W=(0,n.useRef)(A);return W.current=A,(0,n.useLayoutEffect)(()=>{if(u?.on)return S.set(l,{layer:t,measure:()=>W.current()}),()=>{S.delete(l),w.getState().owner===l&&w.setState({rect:null,owner:0}),requestAnimationFrame(b)}},[u?.on,t]),(0,n.useLayoutEffect)(()=>{A();const e=requestAnimationFrame(A);return()=>cancelAnimationFrame(e)},[f,h,v,u?.on]),(0,n.useEffect)(()=>{const e=c.current;if(!u?.on||'undefined'==typeof ResizeObserver||!e?.parentElement)return;const t=new ResizeObserver(A);return t.observe(e.parentElement),e.parentElement.parentElement&&t.observe(e.parentElement.parentElement),()=>t.disconnect()},[u?.on]),(0,n.useEffect)(()=>()=>{w.getState().owner===l&&w.setState({rect:null,owner:0})},[]),(0,n.useEffect)(()=>{u?.on||w.getState().owner!==l||w.setState({rect:null,owner:0})},[u?.on]),u?.on?(0,m.jsx)(s.default,{ref:c,testID:"voice-slot",onLayout:A,style:{width:e,height:e,flexShrink:0}}):null};var t=r(d[0]),n=r(d[1]),o=e(r(d[2])),s=e(r(d[3])),u=r(d[4]),c=r(d[5]),l=r(d[6]),f=r(d[7]),m=r(d[8]);const w=(0,u.create)(()=>({rect:null,owner:0}));function h(e){return'customer'===c.APP_VARIANT||/^\/(customer|table|demo)/.test(e)?null:e.startsWith('/owner')||e.startsWith('/admin')?'owner':e.startsWith('/team')?'staff':e.startsWith('/kitchen')?'chef':e.startsWith('/display')?'display':null}function p(){const e=(0,t.usePathname)()||'/',n=(0,l.useCtx)(6e4),o=(0,f.useVoiceSettings)(e=>e.enabled),s=h(e);if(!s)return null;const u='owner'===s?'owner'===n.role?'owner':'manager'===n.role?'manager':'staff':s;return{app:s,role:u,actions:'staff'===u?'staff':s,on:(0,f.voiceOn)(o,n.rid,u)}}let y=1;const S=new Map,E=()=>{let e=-1;return S.forEach(t=>{t.layer>e&&(e=t.layer)}),e};function b(){const e=E();S.forEach(t=>{t.layer===e&&t.measure()})}},1116,[30,34,426,102,815,846,1100,1117,25]); __d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"VOICE_ROLES",{enumerable:!0,get:function(){return o}}),Object.defineProperty(_e,"VOICE_ROLE_LABEL",{enumerable:!0,get:function(){return p}}),Object.defineProperty(_e,"useVoiceSettings",{enumerable:!0,get:function(){return u}}),Object.defineProperty(_e,"voiceOn",{enumerable:!0,get:function(){return f}}),_e.micExplainedFor=function(e){try{if('1'===b()?.getItem(s(e)))return!0}catch{}return u.getState().micExplained},_e.setMicExplainedFor=function(e){try{b()?.setItem(s(e),'1')}catch{}u.getState().setMicExplained(!0)};var e,n=r(d[0]),t=(e=n)&&e.__esModule?e:{default:e},c=r(d[1]),l=r(d[2]);const o=['owner','manager','staff','chef','display'],p={owner:'Owner (Managers app)',manager:'Managers (Managers app)',staff:'Staff app (full voice assistant, no money or HR)',chef:'Head Chef app',display:'Main Display'},u=(0,c.create)()((0,l.persist)(e=>({enabled:{},micExplained:!1,setEnabled:(n,t,c)=>e(e=>({enabled:{...e.enabled,[n]:{...e.enabled[n]??{},[t]:c}}})),setMicExplained:n=>e({micExplained:n})}),{name:'covercharge-voice-v1',version:4,storage:(0,l.createJSONStorage)(()=>t.default),migrate:(e,n)=>({enabled:n<2?{}:e?.enabled??{},micExplained:!!e?.micExplained}),merge:(e,n)=>({...n,enabled:e?.enabled??n.enabled,micExplained:e?.micExplained??n.micExplained}),partialize:e=>({enabled:e.enabled,micExplained:e.micExplained})})),f=(e,n,t)=>!1!==e[n]?.[t],s=e=>`cc-voice-mic-explained-${e}`,b=()=>{try{return'undefined'!=typeof window?window.localStorage:void 0}catch{return}}},1117,[808,815,818]); __d(function(g,_r,_i,a,_m,e,_d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"VAT",{enumerable:!0,get:function(){return r}}),Object.defineProperty(e,"exVat",{enumerable:!0,get:function(){return n}}),e.dishCost=i,Object.defineProperty(e,"gpPct",{enumerable:!0,get:function(){return o}}),Object.defineProperty(e,"priceForTarget",{enumerable:!0,get:function(){return c}}),e.costings=function(r,c,s,u){const d=(0,t.dishStats)(r);return c.map(t=>{const c=r.find(r=>r.id===t.dishId);if(!c||null==c.price)return null;const p=i(t,s),l=n(c.price),f=o(p,c.price),b=d.find(t=>t.item.id===c.id)?.sold??0;return{item:c,recipe:t,cost:p,priceInc:c.price,priceEx:l,gp:f,cashGp:l-p,below:ft.prevCost&&t.prevCost!==t.cost).map(s=>{const u=(s.cost-(s.prevCost??s.cost))/(s.prevCost??1)*100,d=r.filter(t=>t.lines.some(t=>t.ing===s.id)).map(r=>{const u=t.find(t=>t.id===r.dishId);if(!u||null==u.price)return null;const d=o(i(r,n,{ing:s.id,cost:s.prevCost}),u.price),p=o(i(r,n),u.price);return{item:u,before:d,after:p,dropped:d>=c&&pt.dropped),below:d.filter(t=>t.below)}})},e.weekGp=function(t,r,n){const i=t.reduce((t,r)=>t+r.priceEx*r.soldWeek,0),o=t.reduce((t,r)=>t+r.cost*r.soldWeek,0),c=o+r+Math.max(0,n);return{sales:i,theoCost:o,actualCost:c,theo:i?(i-o)/i*100:0,actual:i?(i-c)/i*100:0}},Object.defineProperty(e,"fmtQty",{enumerable:!0,get:function(){return s}});var t=_r(_d[0]);const r=.2,n=t=>Math.round(t/1.2);function i(t,r,n){return Math.round(t.lines.reduce((t,i)=>{const o=r.find(t=>t.id===i.ing);return t+(n&&n.ing===i.ing?n.cost:o?.cost??0)*i.qty},0))}const o=(t,r)=>{const i=n(r);return i>0?(i-t)/i*100:0},c=(t,r)=>50*Math.ceil(t/(1-r/100)*1.2/50);const s=(t,r)=>`${Number.isInteger(t)?t:t.toFixed(t<1?3:2).replace(/0+$/,'').replace(/\.$/,'')} ${'each'===r?'':r}`.trim()},1118,[1119]); @@ -1436,7 +1436,7 @@ __d(function(g,r,i,_a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{ __d(function(_g,_r,i,_a,_m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.GiftTill=b,_e.GiftTillManager=y,_e.GiftShopManager=w,_e.PaymentsTestMode=S,_e.GiftCardsPage=function({me:e}){return(0,p.staffServer)()?(0,j.jsxs)(l.default,{style:{gap:10},children:[(0,j.jsx)(b,{me:e}),(0,x.can)('orders.manage')?(0,j.jsx)(y,{me:e}):null,(0,x.can)('venue.settings')?(0,j.jsx)(w,{me:e}):null,(0,x.can)('venue.settings')?(0,j.jsx)(S,{me:e}):null]}):(0,j.jsx)(r.Banner,{kind:"demo",title:"Gift cards are saved on the server",children:"Sign this device in to your venue to check and take gift cards. There are no example cards here."})};var e,t=_r(d[0]),s=_r(d[1]),n=_r(d[2]),a=_r(d[3]),l=(e=a)&&e.__esModule?e:{default:e},r=_r(d[4]),o=_r(d[5]),c=_r(d[6]),u=_r(d[7]),h=_r(d[8]),x=_r(d[9]),p=_r(d[10]),g=_r(d[11]),j=_r(d[12]);const f=e=>{if(!e)return'';try{return new Date(e).toLocaleDateString('en-GB',{day:'numeric',month:'short',year:'numeric',timeZone:'Europe/London'})}catch{return e.slice(0,10)}},m=({m:e})=>e?(0,j.jsx)(r.Banner,{kind:e.kind,title:e.text}):null;function b({me:e}){const[t,s]=(0,n.useState)(''),[a,x]=(0,n.useState)(null),[p,b]=(0,n.useState)(''),[y,w]=(0,n.useState)((0,u.redeemKey)()),[k,S]=(0,n.useState)(null),[T,C]=(0,n.useState)(!1),v=(0,u.poundsToPence)(p);return(0,j.jsx)(l.default,{testID:"gift-till",children:(0,j.jsx)(r.Card,{children:(0,j.jsxs)(l.default,{style:{gap:8},children:[(0,j.jsx)(r.T,{weight:"semibold",children:"Check a gift card or take it off the bill"}),(0,j.jsx)(r.Field,{label:"Gift card code",value:t,autoCapitalize:"characters",onChangeText:e=>{s(e),x(null),w((0,u.redeemKey)())},placeholder:"XXXX-XXXX-XXXX-XXXX",testID:"gift-code"}),(0,j.jsx)(r.Button,{label:T?'Checking\u2026':'Check balance',kind:"ghost",small:!0,disabled:T||t.replace(/\W/g,'').length<6,testID:"gift-check",onPress:async()=>{C(!0),S(null);try{const e=await(0,h.giftCheck)(t);x(e),e.found||S({kind:'warn',text:'No gift card with that code here.'})}catch(e){S({kind:'warn',text:(0,c.plainError)(e)})}finally{C(!1)}}}),a?.found?(0,j.jsxs)(l.default,{style:{gap:4},testID:"gift-card-found",children:[(0,j.jsxs)(r.Row,{style:{justifyContent:'space-between'},children:[(0,j.jsx)(r.T,{weight:"medium",children:(0,u.prettyGiftCode)(t)}),(0,j.jsx)(r.T,{size:20,weight:"bold",colour:g.colours.gold,children:(0,o.gbp)(a.balancePence)})]}),(0,j.jsxs)(r.Muted,{size:12,children:[u.STATUS_WORDS[a.status]??a.status," \xb7 of ",(0,o.gbp)(a.initialPence),a.expiresAt?` \xb7 use by ${f(a.expiresAt)}`:'','wix'===a.source?' \xb7 old website bookings card':'']}),'active'===a.status?(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(r.Field,{label:"Amount to take off \xa3",value:p,onChangeText:b,keyboardType:"decimal-pad",testID:"gift-amount"}),(0,j.jsx)(r.Button,{label:T?'Taking it off\u2026':v?`Take ${(0,o.gbp)(v)} off the card`:'Take it off the card',disabled:T||!v||v>a.balancePence,testID:"gift-redeem",onPress:async()=>{C(!0),S(null);try{const s=await(0,h.giftRedeem)(t,v,y,e);x({...a,...s,found:!0}),b(''),w((0,u.redeemKey)()),S({kind:'success',text:`${s.already?'Already taken: ':'Taken '}${(0,o.gbp)(s.redeemedPence)}. ${(0,o.gbp)(s.balancePence)} left on the card.`})}catch(e){S({kind:'warn',text:(0,c.plainError)(e)})}finally{C(!1)}}})]}):null]}):null,(0,j.jsx)(m,{m:k})]})})})}function y({me:e}){const[t,s]=(0,n.useState)([]),[a,x]=(0,n.useState)([]),[p,b]=(0,n.useState)(null),[y,w]=(0,n.useState)(''),[k,S]=(0,n.useState)(''),[T,C]=(0,n.useState)(null),[v,P]=(0,n.useState)(null),I=(0,n.useCallback)(()=>{(0,h.waitingCards)().then(s).catch(()=>{}),(0,h.shopOrders)().then(x).catch(()=>{})},[]);(0,n.useEffect)(()=>{I()},[I]);const D=async(e,t)=>{b(null);try{await e(),b({kind:'success',text:t}),I()}catch(e){b({kind:'warn',text:(0,c.plainError)(e)})}},M=t.filter(e=>'waiting-payment'===e.status),_=a.filter(e=>!['collected','cancelled'].includes(e.status)),B=(0,u.poundsToPence)(y);return(0,j.jsxs)(l.default,{style:{gap:10},children:[(0,j.jsx)(l.default,{testID:"gift-waiting",children:(0,j.jsx)(r.Card,{children:(0,j.jsxs)(l.default,{style:{gap:6},children:[(0,j.jsxs)(r.T,{weight:"semibold",children:["Waiting for payment at the till (",M.length+_.filter(e=>'waiting-payment'===e.status).length,")"]}),(0,j.jsx)(r.Muted,{size:12,children:"Card payment in the app isn\u2019t on yet. Take the money at the till, then mark it paid here."}),M.map(t=>(0,j.jsxs)(r.Row,{style:{justifyContent:'space-between'},children:[(0,j.jsxs)(l.default,{style:{flex:1},children:[(0,j.jsxs)(r.T,{children:["Gift card ",t.ref," \xb7 ",(0,o.gbp)(t.initial_pence)]}),(0,j.jsxs)(r.Muted,{size:12,children:["for ",t.recipient_name||'no name'," \xb7 ends ",t.last4]})]}),(0,j.jsx)(r.Button,{label:"Paid at the till",small:!0,testID:`gift-paid-${t.ref}`,onPress:()=>D(()=>(0,h.giftActivate)(t.id,e),`${t.ref} is ready to use`)})]},t.id)),_.map(t=>(0,j.jsxs)(l.default,{style:{gap:4},children:[(0,j.jsxs)(r.Row,{style:{justifyContent:'space-between'},children:[(0,j.jsxs)(l.default,{style:{flex:1},children:[(0,j.jsxs)(r.T,{children:["Shop ",t.ref," \xb7 ",t.guest_name," \xb7 ",(0,o.gbp)(t.total_pence)]}),(0,j.jsxs)(r.Muted,{size:12,children:[t.lines.map(e=>`${e.qty}\xd7 ${e.name}`).join(', ')," \xb7 ",u.STATUS_WORDS[t.status]]})]}),'waiting-payment'===t.status?(0,j.jsx)(r.Button,{label:"Paid at the till",small:!0,onPress:()=>D(()=>(0,h.shopStatus)(t.id,'paid','',e),`${t.ref} paid`)}):'paid'===t.status?(0,j.jsx)(r.Button,{label:"Ready",small:!0,onPress:()=>D(()=>(0,h.shopStatus)(t.id,'ready','',e),`${t.ref} ready`)}):(0,j.jsx)(r.Button,{label:"Collected",small:!0,onPress:()=>D(()=>(0,h.shopStatus)(t.id,'collected','',e),`${t.ref} collected`)})]}),v&&v.id===t.id?(0,j.jsxs)(r.Row,{style:{gap:6,alignItems:'flex-end'},children:[(0,j.jsx)(l.default,{style:{flex:1},children:(0,j.jsx)(r.Field,{label:"Reason",value:v.reason,onChangeText:e=>P({id:t.id,reason:e})})}),(0,j.jsx)(r.Button,{label:"Cancel order",kind:"danger",small:!0,disabled:v.reason.trim().length<3,onPress:()=>D(()=>(0,h.shopStatus)(t.id,'cancelled',v.reason,e),`${t.ref} cancelled, stock put back`).then(()=>P(null))})]}):(0,j.jsx)(r.Button,{label:"Cancel with a reason",kind:"ghost",small:!0,onPress:()=>P({id:t.id,reason:''})})]},t.id)),M.length||_.length?null:(0,j.jsx)(r.Muted,{children:"Nothing waiting."})]})})}),(0,j.jsx)(l.default,{testID:"gift-sell",children:(0,j.jsx)(r.Card,{children:(0,j.jsxs)(l.default,{style:{gap:6},children:[(0,j.jsx)(r.T,{weight:"semibold",children:"Sell a gift card at the till"}),(0,j.jsx)(r.Field,{label:"Amount \xa3",value:y,onChangeText:w,keyboardType:"decimal-pad",testID:"gift-sell-amount"}),(0,j.jsx)(r.Field,{label:"Who it\u2019s for (optional)",value:k,onChangeText:S}),(0,j.jsx)(r.Button,{label:B?`Paid ${(0,o.gbp)(B)} at the till: make the card`:'Make the card',small:!0,disabled:!B,testID:"gift-sell-btn",onPress:()=>D(async()=>{const t=await(0,h.giftIssue)(B,k,e);C(t),w(''),S('')},'Card made')}),T?.code?(0,j.jsxs)(l.default,{style:{gap:2},children:[(0,j.jsx)(r.T,{size:22,weight:"bold",colour:g.colours.gold,center:!0,children:T.code}),(0,j.jsxs)(r.Muted,{center:!0,size:12,children:["Shown once: write it on the card or receipt now. ",(0,o.gbp)(T.initialPence),", use by ",f(T.expiresAt),"."]})]}):null]})})}),(0,j.jsx)(m,{m:p})]})}function w({me:e}){const[t,s]=(0,n.useState)(null),[a,x]=(0,n.useState)(''),[p,b]=(0,n.useState)(null),[y,w]=(0,n.useState)([]),[k,S]=(0,n.useState)({name:'',price:'',details:''}),[T,C]=(0,n.useState)(null),[v,P]=(0,n.useState)({code:'',bal:''}),[I,D]=(0,n.useState)([]),[M,_]=(0,n.useState)(null),B=(0,n.useCallback)(()=>{(0,h.readShopSettings)().then(e=>{s(e),x(e.amounts.map(e=>String(e/100)).join(', '))}).catch(e=>C({kind:'warn',text:(0,c.plainError)(e)})),(0,h.readProducts)().then(w).catch(()=>{}),(0,h.giftSummary)().then(b).catch(()=>{}),(0,h.waitingCards)().then(D).catch(()=>{})},[]);(0,n.useEffect)(()=>{B()},[B]);const R=async(e,t)=>{C(null);try{await e(),C({kind:'success',text:t}),B()}catch(e){C({kind:'warn',text:(0,c.plainError)(e)})}};if(!t)return(0,j.jsx)(r.Card,{children:(0,j.jsx)(r.Muted,{children:T?.text??'Loading\u2026'})});const z=(0,u.amountsFromText)(a);return(0,j.jsxs)(l.default,{style:{gap:10},children:[p?(0,j.jsx)(l.default,{testID:"gift-summary",children:(0,j.jsxs)(r.Row,{style:{gap:8},children:[(0,j.jsxs)(r.Card,{style:{flex:1},children:[(0,j.jsx)(r.Muted,{children:"Sold (paid)"}),(0,j.jsx)(r.T,{size:20,weight:"bold",children:(0,o.gbp)(p.soldPence)})]}),(0,j.jsxs)(r.Card,{style:{flex:1},children:[(0,j.jsx)(r.Muted,{children:"Still to spend"}),(0,j.jsx)(r.T,{size:20,weight:"bold",children:(0,o.gbp)(p.outstandingPence)})]}),(0,j.jsxs)(r.Card,{style:{flex:1},children:[(0,j.jsx)(r.Muted,{children:"Waiting"}),(0,j.jsx)(r.T,{size:20,weight:"bold",children:p.waiting})]})]})}):null,(0,j.jsx)(l.default,{testID:"gift-settings",children:(0,j.jsx)(r.Card,{children:(0,j.jsxs)(l.default,{style:{gap:8},children:[(0,j.jsx)(r.T,{weight:"semibold",children:"Gift cards and shop settings"}),(0,j.jsx)(r.Toggle,{label:"Sell gift cards in the customer app",value:t.giftsOn,onChange:e=>s({...t,giftsOn:e}),testID:"gift-on"}),(0,j.jsx)(r.Toggle,{label:"Open the shop in the customer app",value:t.shopOn,onChange:e=>s({...t,shopOn:e}),testID:"shop-on"}),(0,j.jsxs)(r.T,{children:["Cards last ",(0,u.expiryWords)(t.expiryMonths)," from when they\u2019re paid"]}),(0,j.jsx)(r.Stepper,{value:t.expiryMonths,min:1,max:60,label:"Gift card expiry in months",onChange:e=>s({...t,expiryMonths:e})}),(0,j.jsx)(r.Field,{label:"Amounts guests can pick (\xa3, comma between)",value:a,onChangeText:x,testID:"gift-amounts"}),(0,j.jsx)(r.Field,{label:"Terms shown to guests (optional)",value:t.terms,onChangeText:e=>s({...t,terms:e}),multiline:!0}),(0,j.jsx)(r.Muted,{size:12,children:"Gift cards are sold through your website. Guests can also pay at the bar or till."}),(0,j.jsx)(r.Button,{label:"Save",disabled:!z,testID:"gift-settings-save",onPress:()=>R(()=>(0,h.saveShopSettings)({...t,amounts:z}),'Saved. The customer app shows it next time it opens.')})]})})}),(0,j.jsx)(l.default,{testID:"shop-products",children:(0,j.jsx)(r.Card,{children:(0,j.jsxs)(l.default,{style:{gap:8},children:[(0,j.jsx)(r.T,{weight:"semibold",children:"Shop products"}),y.map(e=>(0,j.jsxs)(l.default,{style:{gap:4,borderTopWidth:1,borderColor:g.colours.border,paddingTop:6},children:[(0,j.jsxs)(r.Row,{style:{justifyContent:'space-between'},children:[(0,j.jsx)(r.T,{weight:"medium",style:{flex:1},children:e.name}),(0,j.jsx)(r.T,{children:(0,o.gbp)(e.price_pence)})]}),(0,j.jsxs)(r.Row,{style:{justifyContent:'space-between',alignItems:'center'},children:[(0,j.jsx)(l.default,{style:{flex:1},children:(0,j.jsx)(r.Toggle,{label:e.is_live?'In the shop':'Hidden',a11y:`${e.name} in the shop`,value:e.is_live,onChange:t=>R(()=>(0,h.saveProduct)({id:e.id,name:e.name,details:e.details,pricePence:e.price_pence,stock:e.stock,live:t}),'Saved')})}),(0,j.jsxs)(l.default,{style:{alignItems:'flex-end'},children:[(0,j.jsx)(r.Muted,{size:12,children:"Stock"}),(0,j.jsx)(r.Stepper,{value:e.stock,min:0,max:500,label:`${e.name} stock`,onChange:t=>R(()=>(0,h.saveProduct)({id:e.id,name:e.name,details:e.details,pricePence:e.price_pence,stock:t,live:e.is_live}),'Stock saved')})]})]}),0===e.stock?(0,j.jsx)(r.Badge,{kind:"amber",label:"Sold out"}):null]},e.id)),y.length?null:(0,j.jsx)(r.Muted,{children:"No products yet."}),(0,j.jsx)(r.Field,{label:"New product name",value:k.name,onChangeText:e=>S({...k,name:e}),testID:"shop-new-name"}),(0,j.jsx)(r.Field,{label:"Price \xa3",value:k.price,onChangeText:e=>S({...k,price:e}),keyboardType:"decimal-pad",testID:"shop-new-price"}),(0,j.jsx)(r.Field,{label:"Details (optional)",value:k.details,onChangeText:e=>S({...k,details:e})}),(0,j.jsx)(r.Button,{label:"Add product (hidden until you switch it on)",kind:"ghost",small:!0,disabled:k.name.trim().length<2||!(0,u.poundsToPence)(k.price),onPress:()=>R(async()=>{await(0,h.saveProduct)({name:k.name,details:k.details,pricePence:(0,u.poundsToPence)(k.price),stock:0,live:!1}),S({name:'',price:'',details:''})},'Product added')})]})})}),(0,j.jsx)(l.default,{testID:"gift-wix",children:(0,j.jsx)(r.Card,{children:(0,j.jsxs)(l.default,{style:{gap:6},children:[(0,j.jsx)(r.T,{weight:"semibold",children:"Honour an old website bookings gift card"}),(0,j.jsx)(r.Muted,{size:12,children:"Check the balance in your website bookings dashboard first. Each website bookings code can be added once."}),(0,j.jsx)(r.Field,{label:"Website bookings code",value:v.code,autoCapitalize:"characters",onChangeText:e=>P({...v,code:e})}),(0,j.jsx)(r.Field,{label:"Balance you checked in website bookings \xa3",value:v.bal,keyboardType:"decimal-pad",onChangeText:e=>P({...v,bal:e})}),(0,j.jsx)(r.Button,{label:"Add to CoverCharge",kind:"ghost",small:!0,disabled:v.code.replace(/\W/g,'').length<6||!(0,u.poundsToPence)(v.bal),onPress:()=>R(async()=>{await(0,h.giftHonourWix)(v.code,(0,u.poundsToPence)(v.bal),e),P({code:'',bal:''})},'Website bookings card added')})]})})}),(0,j.jsx)(l.default,{testID:"gift-list",children:(0,j.jsx)(r.Card,{children:(0,j.jsxs)(l.default,{style:{gap:4},children:[(0,j.jsx)(r.T,{weight:"semibold",children:"Recent cards"}),I.map(t=>(0,j.jsxs)(l.default,{style:{gap:2},children:[(0,j.jsxs)(r.Row,{style:{justifyContent:'space-between'},children:[(0,j.jsxs)(r.T,{style:{flex:1},children:[t.ref," \xb7 ends ",t.last4," \xb7 ",'wix'===t.source?'Website bookings':'till'===t.source?'Till':'App']}),(0,j.jsxs)(r.T,{children:[(0,o.gbp)(t.balance_pence)," / ",(0,o.gbp)(t.initial_pence)]})]}),(0,j.jsxs)(r.Row,{style:{justifyContent:'space-between'},children:[(0,j.jsxs)(r.Muted,{size:12,children:[u.STATUS_WORDS[t.status]??t.status,t.expires_at?` \xb7 use by ${f(t.expires_at)}`:'']}),'void'!==t.status&&M?.id!==t.id?(0,j.jsx)(r.Button,{label:"Cancel card",kind:"ghost",small:!0,onPress:()=>_({id:t.id,reason:''})}):null]}),M&&M.id===t.id?(0,j.jsxs)(r.Row,{style:{gap:6,alignItems:'flex-end'},children:[(0,j.jsx)(l.default,{style:{flex:1},children:(0,j.jsx)(r.Field,{label:"Reason",value:M.reason,onChangeText:e=>_({id:t.id,reason:e})})}),(0,j.jsx)(r.Button,{label:"Cancel it",kind:"danger",small:!0,disabled:M.reason.trim().length<3,onPress:()=>R(()=>(0,h.giftVoid)(t.id,M.reason,e),'Card cancelled (kept on record)').then(()=>_(null))})]}):null]},t.id)),I.length?null:(0,j.jsx)(r.Muted,{children:"No cards yet."})]})})}),(0,j.jsx)(m,{m:T})]})}const k={none:'Pay at the till only',stripe:'Stripe (test mode)',wix:'Website bookings payments (coming)'};function S({me:e}){if(t.IS_GREENSIDE)return(0,j.jsx)(s.GreensideCashOnly,{});const[a,u]=(0,n.useState)(null),[x,p]=(0,n.useState)([]),[g,b]=(0,n.useState)(null),y=(0,n.useCallback)(()=>{(0,h.readPaySettings)().then(u).catch(e=>b({kind:'warn',text:(0,c.plainError)(e)})),(0,h.recentPayments)().then(p).catch(()=>{})},[]);return(0,n.useEffect)(()=>{y()},[y]),a?(0,j.jsx)(l.default,{testID:"pay-settings",children:(0,j.jsx)(r.Card,{children:(0,j.jsxs)(l.default,{style:{gap:8},children:[(0,j.jsxs)(r.Row,{style:{justifyContent:'space-between',alignItems:'center'},children:[(0,j.jsx)(r.T,{weight:"semibold",children:"Card payments"}),(0,j.jsx)(r.Badge,{kind:"amber",label:"TEST MODE"})]}),(0,j.jsx)(r.Banner,{kind:"demo",title:"Test mode only: no real money",children:"This build can\u2019t take live payments. Guests pay at the bar or till unless you switch on Stripe test mode below."}),(0,j.jsx)(r.Row,{wrap:!0,children:['none','stripe','wix'].map(e=>(0,j.jsx)(r.Chip,{label:k[e],selected:a.provider===e,onPress:()=>u({...a,provider:e,cardOn:'stripe'===e&&a.cardOn})},e))}),'stripe'===a.provider?(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(r.Field,{label:"Venue\u2019s Stripe account id (starts acct_)",value:a.account,autoCapitalize:"none",onChangeText:e=>u({...a,account:e.trim()}),placeholder:"acct_\u2026",testID:"pay-account"}),(0,j.jsx)(r.Muted,{size:12,children:"Money goes straight to the venue\u2019s own Stripe account. Never paste a key here."}),(0,j.jsx)(r.Toggle,{label:"Offer \u201cPay by card (test mode)\u201d in the customer app",value:a.cardOn,onChange:e=>u({...a,cardOn:e}),testID:"pay-card-on"}),(0,j.jsx)(r.Muted,{size:12,children:"Needs CoverCharge\u2019s Stripe sandbox to be set up first (Gordon\u2019s step). Until then guests see pay at the till."})]}):null,'wix'===a.provider?(0,j.jsx)(r.Banner,{kind:"demo",title:"Website bookings payments aren\u2019t linked yet",children:"Website bookings venues keep taking payments on their website. In the app, guests pay at the bar or till."}):null,(0,j.jsx)(r.Button,{label:"Save",testID:"pay-save",onPress:async()=>{b(null);try{await(0,h.savePaySettings)(a),b({kind:'success',text:'Saved'}),y()}catch(e){b({kind:'warn',text:(0,c.plainError)(e)})}}}),x.length?(0,j.jsxs)(l.default,{style:{gap:2},children:[(0,j.jsx)(r.T,{weight:"medium",children:"Recent test payments"}),x.map(e=>(0,j.jsxs)(r.Row,{style:{justifyContent:'space-between'},children:[(0,j.jsxs)(r.Muted,{children:['gift'===e.kind?'Gift card':'Shop'," \xb7 ",f(e.created_at)]}),(0,j.jsxs)(r.T,{children:[(0,o.gbp)(e.amount_pence)," \xb7 ",e.status]})]},e.id))]}):null,(0,j.jsx)(m,{m:g})]})})}):(0,j.jsx)(r.Card,{children:(0,j.jsx)(r.Muted,{children:g?.text??'Loading\u2026'})})}},1353,[5,1354,34,102,794,836,1201,1202,1203,985,1204,840,25]); __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.GreensideCashOnly=function(){return(0,s.jsxs)(n.Card,{children:[(0,s.jsx)(n.T,{weight:"semibold",children:"Cash only"}),(0,s.jsx)(n.Muted,{children:"Card payments and online checkout are not enabled for The Greenside Restaurant. Deposits are off; the policy needs confirmation."})]})},r(d[0]);var n=r(d[1]),s=r(d[2])},1354,[34,794,25]); __d(function(g,_r,i,a,_m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.CashUpAccessToggle=function({m:e}){const c=(0,o.useCashAccess)(s=>!0===s.byRef[e.id]),l=(0,o.useCashAccess)(e=>e.loaded),b=(0,r.useSync)(e=>'staff'===e.kind&&!!e.venueId),[y,C]=(0,s.useState)(!1),[m,x]=(0,s.useState)(null);if((0,s.useEffect)(()=>{b&&!l&&(0,u.refreshCashAccess)()},[b,l]),p(e))return(0,h.jsxs)(t.default,{testID:`cashup-access-${e.id}`,style:{gap:2},accessible:!0,accessibilityLabel:`${f(e)} can use cash up: always, as ${'owner'===e.role?'an owner':'a manager'}`,children:[(0,h.jsx)(n.T,{size:14,children:"Can use cash up"}),(0,h.jsxs)(n.Muted,{size:12,children:["Always on for ",'owner'===e.role?'owners':'managers',"."]})]});const j=async s=>{C(!0),x(null);const c=await(0,u.setStaffCashUp)(e.id,s);C(!1),x(c.ok?s?`${f(e)} can now open the cash up. The change is in the cash-up log.`:`${f(e)} can no longer open the cash up. The change is in the cash-up log.`:c.error??'Could not save.')};return(0,h.jsxs)(t.default,{testID:`cashup-access-${e.id}`,style:{gap:2},children:[(0,h.jsx)(n.Toggle,{testID:`cashup-toggle-${e.id}`,label:"Can use cash up",value:c,disabled:y||!b,onChange:e=>{j(e)}}),(0,h.jsx)(n.Muted,{size:12,children:b?c?'Can open the cash up, take a picture of the taking sheet and upload a spreadsheet.':'Off: the cash up is hidden from them and the server refuses it.':'Connect to the shared team to change this.'}),m?(0,h.jsx)(t.default,{accessibilityLiveRegion:"polite",children:(0,h.jsx)(n.Muted,{size:12,testID:`cashup-msg-${e.id}`,children:m})}):null]})},_e.CashUpAccessBadge=function({m:e}){const s=(0,o.useCashAccess)(s=>!0===s.byRef[e.id]);return p(e)||s?(0,h.jsx)(t.default,{accessible:!0,accessibilityLabel:`${f(e)} can use cash up`,testID:`cashup-badge-${e.id}`,children:(0,h.jsx)(n.Badge,{kind:"gold",label:"Cash up"})}):null},_e.NoCashUpAccess=function(){return(0,h.jsxs)(t.default,{testID:"cashup-no-access",accessible:!0,accessibilityRole:"text",accessibilityLabel:"You can't use the cash up yet. A manager can switch it on for you in Staff and roles.",style:{borderWidth:1,borderColor:l.colours.border,borderRadius:14,padding:16,gap:6,backgroundColor:l.colours.surface},children:[(0,h.jsx)(n.T,{size:18,weight:"semibold",children:"You can\u2019t use the cash up yet"}),(0,h.jsx)(n.T,{children:"A manager can switch it on for you in Staff & roles (\u201cCan use cash up\u201d)."})]})};var e,s=_r(d[0]),c=_r(d[1]),t=(e=c)&&e.__esModule?e:{default:e},n=_r(d[2]),l=_r(d[3]),o=_r(d[4]),u=_r(d[5]),r=_r(d[6]),h=_r(d[7]);const p=e=>'owner'===e.role||'manager'===e.role&&!e.managerAccess,f=e=>e.name.replace(' (example)','').split(' ')[0]},1355,[34,102,794,840,993,1037,985,25]); -__d(function(g,_r,_i,_a,m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.Bookings=function({go:e}={}){const{rid:C,r:X,now:Z,today:ee,me:se,role:te}=(0,p.useCtx)(1e4),le=(0,v.useBookings)(C),ne=(0,p.useInStaffApp)(),ie=(0,p.useShiftManager)(),ae=(0,v.useWaitlist)(C),[oe,de]=((0,v.useStore)(e=>e.alertAcks),(0,T.useState)(ee)),re=(0,R.useFrontDoor)(oe),ue=(0,k.useBookingWrite)(),[ce,he]=(0,T.useState)(''),[ge,be]=(0,T.useState)(!1),[pe,ke]=(0,T.useState)(2),me=oee.date===oe).sort((e,s)=>e.time.localeCompare(s.time)),ye=ae.filter(e=>'waiting'===e.status||'notified'===e.status).sort((e,s)=>e.number-s.number),we=xe.filter(e=>'noshow'===e.status),je=(0,V.useSync)(e=>!!e.venueId&&'guest'!==e.kind),fe=xe.filter(e=>'cancelled'!==e.status).reduce((e,s)=>e+s.partySize,0),Ie=(0,c.cancelledDayTally)(le,oe),Be=(0,c.cancelledTallyWords)(Ie,oe===ee?'today':'that day'),Se=xe.filter(e=>!e.walkIn),De=xe.filter(e=>e.walkIn),$e=le.filter(e=>'pending'===e.status&&e.date>=ee).sort((e,s)=>(e.date+e.time).localeCompare(s.date+s.time)),[Te,Ce]=(0,T.useState)(null),Le=(0,M.parseYmd)(oe);Le.setHours(12);const Ne=(0,Q.hoursFor)(X,Le),Pe=Ne?.open??new Date(`${oe}T12:00:00`),ve=Ne?.close??new Date(`${oe}T21:00:00`),Oe=Ne||xe.length?me?'No one seated that day':oe===ee?'No bookings yet today':'No bookings yet':oe===ee?'Closed today':'Closed that day';return(0,J.jsxs)(L.default,{style:{gap:12},children:[e&&!ne&&'staff'!==te?(0,J.jsx)(N.Button,{testID:"bookings-dashboard-top",label:"Bookings dashboard",accessibilityLabel:"Open Bookings dashboard: table plan, Timeline, today's guests and Covers",onPress:()=>e('more','serviceboard'),style:{width:'100%',minHeight:60}}):null,s.IS_WILDINGS||(s.IS_QUEUED_VENUE||s.IS_KIRKTON||s.IS_GREENSIDE||'abbotsford'===C)&&!ne&&'staff'!==te?(0,J.jsx)(n.VenueRequestList,{rid:C,kind:"table"}):null,!s.IS_WILDINGS&&!X.settings.hotel?.enabled||ne||'staff'===te?null:(0,J.jsx)(n.VenueRequestList,{rid:C,kind:"room",hotel:X.settings.hotel??l.WILDINGS_HOTEL}),(0,J.jsx)(G.BookingsDayNav,{today:ee,date:oe,onDate:de,count:e=>le.filter(s=>s.date===e&&'cancelled'!==s.status).length,sub:e=>{const s=le.filter(s=>s.date===e&&'cancelled'!==s.status&&!s.walkIn),t=s.reduce((e,s)=>e+s.partySize,0);return`${s.length} ${1===s.length?'table':'tables'} \xb7 ${t} ${1===t?'Cover':'Covers'}`}}),(0,J.jsx)(L.default,{testID:"bookings-day-graph",style:{overflow:'visible'},children:(0,J.jsx)(q.DayGraph,{bare:!0,fill:!0,todays:xe,open:Pe,close:ve,now:Z,turnBase:X.settings.turnMins,height:128,past:me,closed:!Ne,emptyText:Oe})}),me?(0,J.jsxs)(L.default,{testID:"bookings-past-totals",style:[N.styles.card,{gap:4}],accessible:!0,accessibilityLabel:`${(0,G.longDay)(oe)}: ${Se.length} tables, ${fe} Covers, ${xe.filter(e=>'finished'===e.status).length} finished, ${we.length} no-shows, ${xe.filter(e=>'cancelled'===e.status).length} cancelled`,children:[(0,J.jsxs)(N.T,{size:17,weight:"semibold",children:["That day: ",Se.length," table",1===Se.length?'':'s',De.length?` \xb7 ${De.length} walk-in${1===De.length?'':'s'}`:''," \xb7 ",fe," ",1===fe?'Cover':'Covers']}),(0,J.jsxs)(N.T,{size:16,colour:A.colours.text,children:[xe.filter(e=>'finished'===e.status).length," finished \xb7 ",we.length," no-show",1===we.length?'':'s'," \xb7 ",xe.filter(e=>'cancelled'===e.status).length," cancelled"]}),(0,J.jsx)(N.Muted,{children:"Looking back: read-only. Undo is still there for a mistake made today."})]}):null,(0,J.jsx)(L.default,{testID:"bookings-summary",children:(0,J.jsxs)(N.T,{weight:"semibold",children:[Se.length," table",1===Se.length?'':'s'," booked",De.length?` \xb7 ${De.length} walk-in${1===De.length?'':'s'}`:''," \xb7 ",fe," ",1===fe?'Cover':'Covers']})}),(0,J.jsx)(L.default,{testID:"cancelled-day-tally",accessible:!0,accessibilityLabel:Be,style:{alignItems:'center'},children:(0,J.jsx)(N.T,{size:15,colour:A.colours.muted,center:!0,children:Be})}),(0,J.jsxs)(L.default,{testID:"bookings-actions",style:{flexDirection:'row',flexWrap:'wrap',gap:8},children:[me?null:(0,J.jsx)(I.QuietButton,{label:"New booking",onPress:re.openBooking,testID:"add-booking",disabled:!ue.ok,accessibilityHint:ue.hint}),ne&&ie&&oe===ee?(0,J.jsx)(I.QuietButton,{label:"Walk-in",onPress:re.openWalkIn,testID:"add-walkin",disabled:!ue.ok,accessibilityHint:ue.hint}):null,oe===ee?(0,J.jsx)(B.CloseGardenButton,{quiet:!0,short:!0,rid:C,r:X,now:Z,by:se}):null]}),$e.length?(0,J.jsxs)(L.default,{testID:"pending-requests",style:[N.styles.card,{borderColor:A.colours.amber,gap:8}],children:[(0,J.jsxs)(N.T,{weight:"semibold",colour:A.colours.amber,children:["Needs confirming (",$e.length,")"]}),(0,J.jsx)(N.Muted,{children:"Online requests outside your auto-accept rules. Check the details before confirming."}),$e.map(e=>(0,J.jsxs)(L.default,{style:{gap:6,paddingTop:6,borderTopWidth:1,borderColor:A.colours.border},children:[(0,J.jsxs)(N.T,{weight:"semibold",children:[e.name," \xb7 ",e.partySize," ",1===e.partySize?'Cover':'Covers']}),(0,J.jsxs)(N.Muted,{children:[(0,M.niceDate)((0,M.parseYmd)(e.date))," at ",e.time," \xb7 ",e.ref," \xb7 ",e.phone??'no phone']}),e.notes?(0,J.jsxs)(N.T,{size:16,children:["Notes: ",e.notes]}):null,e.allergies.length?(0,J.jsx)(N.Row,{wrap:!0,gap:4,children:e.allergies.map(e=>(0,J.jsx)(N.Badge,{kind:"red",label:`${(0,O.allergenLabel)(e.allergen)} \xb7 ${(0,O.severityLabel)(e.severity)}`},e.allergen))}):null,(0,J.jsx)(S.NeedsPills,{b:e,r:X}),'staff'!==te&&((0,D.needsHoldOk)(e)||e.date===ee&&e.holdOk&&(e.holds??[]).some(e=>!e.served)&&'seated'===e.status)?(0,J.jsxs)(N.Row,{wrap:!0,gap:6,children:[(0,D.needsHoldOk)(e)?(0,J.jsx)(N.Button,{small:!0,kind:"success",label:"Platter OK",testID:`mgr-platter-ok-${e.ref}`,onPress:()=>(0,S.confirmHolds)(e.id,se)}):null,e.holdOk&&'seated'===e.status?(0,J.jsx)(N.Button,{small:!0,kind:"secondary",label:"Platter served",onPress:()=>(0,S.serveHolds)(e,se,'owner')}):null]}):null,Te===e.id?(0,J.jsxs)(L.default,{style:{gap:6},children:[(0,J.jsxs)(N.T,{size:14,children:["Are you sure? ",e.name.split(' ')[0]," will get a polite \u201csorry, we can\u2019t fit you in\u201d message."]}),(0,J.jsxs)(N.Row,{gap:6,children:[(0,J.jsx)(N.Button,{small:!0,kind:"danger",label:"Yes, decline",onPress:()=>{v.repo.bookings.decide(e.id,'declined',se),Ce(null)}}),(0,J.jsx)(N.Button,{small:!0,kind:"ghost",label:"Keep it",onPress:()=>Ce(null)})]})]}):ue.ok?(0,J.jsxs)(N.Row,{gap:6,children:[(0,J.jsx)(N.Button,{small:!0,label:"Confirm",testID:`confirm-${e.ref}`,onPress:()=>v.repo.bookings.decide(e.id,'confirmed',se)}),(0,J.jsx)(N.Button,{small:!0,kind:"secondary",label:"Decline",onPress:()=>Ce(e.id)}),(0,J.jsx)(Y.WhatsAppGuest,{b:e,rid:C,kind:"change"})]}):(0,J.jsx)(L.default,{accessible:!0,accessibilityLabel:x.BOOKING_VIEW_ONLY,children:(0,J.jsx)(N.T,{children:x.BOOKING_VIEW_ONLY})}),(0,J.jsx)(F.ConfirmTimeline,{refId:e.id})]},e.id))]}):null,0===xe.length?(0,J.jsx)(N.Muted,{children:"No bookings for this day yet."}):null,xe.map(e=>{const s='confirmed'===e.status&&oe===ee&&(0,M.minsBetween)(new Date(`${e.date}T${e.time}:00`),Z)>15,t=(0,w.depositState)(e),l=(0,w.depositBadge)(e,W.gbp);return(0,J.jsxs)(L.default,{testID:(0,$.isSeatedHighlight)((0,D.shownStatus)(e))?`booking-seated-${e.id}`:`booking-row-${e.id}`,style:[N.styles.card,(0,$.isSeatedHighlight)((0,D.shownStatus)(e))?(0,$.seatedHighlightStyle)({borderColor:(0,D.hasAllergens)(e)?A.colours.red:A.colours.goldLight}):{borderColor:(0,D.hasAllergens)(e)?A.colours.red:s?A.colours.amber:A.colours.hairline,opacity:['finished','cancelled'].includes(e.status)?.55:1}],children:[(0,J.jsx)(S.AllergenBar,{b:e}),(0,J.jsxs)(N.Row,{style:{justifyContent:'space-between'},children:[(0,J.jsxs)(N.Row,{gap:6,style:{flex:1,minWidth:0,alignItems:'center'},children:[(0,J.jsxs)(N.T,{weight:"semibold",colour:(0,$.isSeatedHighlight)((0,D.shownStatus)(e))?$.SEATED_FG:A.colours.text,style:{flexShrink:1},children:[e.time," \xb7 ",(0,R.walkInLabel)(e)]}),(0,D.hasAllergens)(e)?(0,J.jsx)(P.AllergyIcon,{text:(0,D.allergenText)(e),size:20,colour:(0,$.isSeatedHighlight)((0,D.shownStatus)(e))?'#7A4A00':A.colours.amber,ink:(0,$.isSeatedHighlight)((0,D.shownStatus)(e))?A.colours.gold:A.colours.bg,testID:`booking-allergy-${e.id}`}):null]}),(0,J.jsx)(N.Badge,{kind:'seated'===(0,D.shownStatus)(e)?'ok':'noshow'===e.status?'red':'confirmed'===e.status?'gold':'pending'===e.status?'amber':'neutral',label:'noshow'===e.status?'No-show':'pending'===e.status?'Needs confirming':(0,D.shownStatus)(e)[0].toUpperCase()+(0,D.shownStatus)(e).slice(1)})]}),l?(0,J.jsx)(y.DepositChip,{b:e,money:!0,big:!0,testID:`deposit-chip-${e.id}`}):null,(0,$.isSeatedHighlight)((0,D.shownStatus)(e))?(0,J.jsxs)(N.T,{size:14,colour:$.SEATED_MUTED,children:[e.table?(0,z.tableCardLabel)(e.table):e.walkIn?'Table to assign':'Table TBC'," \xb7 ",e.ref]}):(0,J.jsxs)(N.Muted,{children:[e.table?(0,z.tableCardLabel)(e.table):e.walkIn?'Table to assign':'Table TBC'," \xb7 ",e.ref]}),e.notes?(0,J.jsxs)(N.T,{size:16,testID:`booking-notes-${e.id}`,children:["Notes: ",e.notes]}):null,l?(0,J.jsxs)(N.Row,{wrap:!0,gap:6,style:{alignItems:'center'},children:[me||!(0,w.canTickDeposit)(e)||['cancelled','finished'].includes(e.status)?null:(0,J.jsx)(N.Button,{small:!0,kind:"secondary",label:"Mark deposit paid",testID:`deposit-paid-${e.id}`,accessibilityLabel:`Mark deposit paid for ${(0,R.walkInLabel)(e)}`,onPress:()=>v.repo.bookings.update(e.id,{depositPaid:e.depositDue??0,depositPaidBy:se,depositPaidAt:(new Date).toISOString()})}),me?null:(0,J.jsx)(j.WixDepositLink,{b:e,rid:C}),'paid'===t&&e.depositPaidBy?(0,J.jsx)(N.Muted,{size:13,children:'Wix deposit link'===e.depositPaidBy?'Paid through a website bookings deposit link':`Ticked by ${e.depositPaidBy}`}):null]}):null,e.walkIn?null:(0,J.jsxs)(N.Muted,{children:[(0,K.bookingSource)(e),e.phone?` \xb7 ${e.phone}`:'',e.email?` \xb7 ${e.email}`:'']}),e.allergies.length?(0,J.jsx)(N.Row,{wrap:!0,gap:4,children:e.allergies.map(e=>(0,J.jsx)(N.Badge,{kind:"red",label:`${(0,O.allergenLabel)(e.allergen)} \xb7 ${(0,O.severityLabel)(e.severity)}`},e.allergen))}):null,(0,D.hasAllergens)(e)&&!['cancelled','noshow'].includes(e.status)?(0,J.jsx)(U.BookingAllergyChain,{b:e,me:se}):null,e.walkIn?null:(0,J.jsx)(F.ConfirmTimeline,{refId:e.id,noPhone:!!e.source&&!e.phone}),s?(0,J.jsxs)(N.T,{size:13,colour:A.colours.amber,children:["Running ",(0,M.minsBetween)(new Date(`${e.date}T${e.time}:00`),Z)," min late. Call them, then mark no-show if needed."]}):null,(0,J.jsxs)(N.Row,{wrap:!0,gap:6,children:[(0,J.jsx)(r.BookingTableButton,{rid:C,booking:e,readOnly:me||!ue.ok,turnBase:X.settings.turnMins}),ue.ok?null:(0,J.jsx)(L.default,{accessible:!0,accessibilityLabel:x.BOOKING_VIEW_ONLY,children:(0,J.jsx)(N.T,{children:x.BOOKING_VIEW_ONLY})}),ue.ok?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(u.BookingEditButton,{rid:C,booking:e,who:se,role:te,inStaffApp:ne,shiftManager:ie}),me||e.table||!['seated','confirmed'].includes(e.status)?null:(0,J.jsx)(N.Button,{small:!e.walkIn,kind:e.walkIn?'primary':'secondary',label:"Assign table",onPress:()=>re.assignTable(e)}),!me&&['seated','confirmed'].includes(e.status)?(0,J.jsx)(N.Button,{small:!0,kind:"secondary",label:(0,z.tablesOf)(e.table).length>1?'Change tables':'Combine tables',testID:`combine-${e.id}`,accessibilityLabel:`${(0,z.tablesOf)(e.table).length>1?'Change tables':'Combine tables'} for ${(0,R.walkInLabel)(e)}`,onPress:()=>re.combineTables(e)}):null,me||'confirmed'!==e.status?null:(0,J.jsxs)(J.Fragment,{children:[e.date===ee?(0,J.jsx)(N.Button,{small:!0,label:"Seat",accessibilityLabel:`Seat ${(0,R.walkInLabel)(e)} now`,onPress:()=>(0,R.seatBookingNow)(C,e)}):null,(0,J.jsx)(N.Button,{small:!0,kind:"secondary",label:"No-show",onPress:()=>v.repo.bookings.setStatus(e.id,'noshow')})]}),me||e.walkIn?null:(0,J.jsx)(d.CancelBookingButton,{rid:C,b:e,name:(0,R.walkInLabel)(e),small:!0,onDone:()=>{}}),me||e.walkIn?null:(0,J.jsx)(d.ReinstateBookingButton,{b:e,name:(0,R.walkInLabel)(e),today:ee}),me||'seated'!==e.status?null:(0,J.jsx)(N.Button,{small:!0,kind:"secondary",label:"Finished",accessibilityLabel:`Finished: ${(0,R.walkInLabel)(e)}, table needs clearing`,onPress:()=>(0,R.finishBookingNow)(C,e)}),['confirmed','pending'].includes(e.status)&&e.date>=ee?(0,J.jsx)(Y.WhatsAppGuest,{b:e,rid:C,kind:"auto"}):null,ne?null:(0,J.jsx)(f.CopyReviewLink,{rid:C,bookingId:e.id}),!me&&e.walkIn?(0,J.jsx)(o.CancelWalkInButton,{rid:C,b:e,small:!0}):null,!me&&e.walkIn?(0,J.jsx)(o.ReinstateWalkInButton,{rid:C,b:e,today:ee,small:!0}):null,(0,J.jsx)(H.BookingUndo,{b:e,rid:C,today:ee,who:(0,R.walkInLabel)(e)})]}):null]}),'noshow'===e.status&&'paid'===t?(0,J.jsx)(N.Muted,{size:13,children:"A deposit was paid. Keep or refund it by your deposit terms (Settings \u203a Advanced \u203a Deposits). Deposits paid through website bookings are refunded in Website bookings \u203a Orders."}):null]},e.id)}),(0,J.jsx)(b.CancellationsSection,{testID:"bookings-cancellations",items:(0,h.cancellationsFor)(le,oe,e=>e.walkIn?`Walk-in ${e.ref}`:(e.name??'').replace(' (example)','')),dayWord:oe===ee?'today':'that day'}),(0,J.jsxs)(N.Card,{children:[(0,J.jsxs)(N.Row,{style:{justifyContent:'space-between'},children:[(0,J.jsx)(N.T,{weight:"semibold",children:"No-shows"}),(0,J.jsx)(N.Badge,{kind:we.length?'red':'ok',label:`${we.length} ${oe===ee?'today':(0,M.niceDate)((0,M.parseYmd)(oe)).slice(0,6)}${je||a.LIVE_VENUE_BUILD?'':' \xb7 4.1% last 28 days (example)'}`})]}),(0,J.jsx)(N.Muted,{children:we.length?`Marked no-show today: ${we.slice(0,6).map(e=>`${e.time} ${(0,R.walkInLabel)(e)}`).join(', ')}${we.length>6?` and ${we.length-6} more`:''}. If they turn up, open the booking and tap Undo no-show.`:'No no-shows today. If a party doesn\u2019t arrive, call them first, then tap No-show on their booking.'})]}),s.IS_GREENSIDE?(0,J.jsx)(t.GreensideCashOnly,{}):(0,J.jsxs)(N.Card,{children:[(0,J.jsx)(N.T,{weight:"semibold",children:"Deposits"}),(0,J.jsx)(N.Muted,{testID:"deposits-card-text",children:(()=>{const e=(0,w.depositOf)(X.settings);return e.on&&e.perPersonPence>0?`Deposits: ${(0,W.gbp)(e.perPersonPence)} per person for parties of ${e.fromParty} or more. Deposits are paid through website bookings. Website bookings show Deposit paid on website bookings by themselves once the guest has paid. For phone and walk-in bookings, tick Deposit paid once the guest has paid you${e.wixLinksOn?', or press Send deposit link':''}.`:'Deposits are off. Turn them on in Settings \u203a Advanced \u203a Deposits.'})()}),(0,J.jsx)(N.Muted,{size:13,children:"Tip: refunds are done in Website bookings \u203a Orders. Booking deposit amounts are visible in Managers, Display and Staff."})]}),ye.length>0||ge?(0,J.jsxs)(L.default,{style:{gap:10},children:[(0,J.jsx)(E.SectionHead,{title:`Waitlist (${ye.length})`,sub:`New party waits about ${(0,_.estimateWait)(ye.length+1,X.settings.turnMins,1)} min (estimate)`}),ye.map((e,s)=>(0,J.jsxs)(L.default,{style:N.styles.card,children:[(0,J.jsxs)(N.Row,{style:{justifyContent:'space-between'},children:[(0,J.jsxs)(N.T,{weight:"semibold",children:["#",e.number," ",e.name," \xb7 ",e.partySize]}),(0,J.jsxs)(N.Muted,{children:[(0,M.minsBetween)(new Date(e.joinedAt),Z)," min \xb7 est. ",(0,_.estimateWait)(s+1,X.settings.turnMins,1)," min"]})]}),'notified'===e.status?(0,J.jsx)(N.Badge,{kind:"ok",label:"Marked as told: table ready (no text is sent)"}):null,(0,J.jsxs)(N.Row,{gap:6,children:['waiting'===e.status?(0,J.jsx)(N.Button,{small:!0,kind:"secondary",label:"Notify",onPress:()=>v.repo.waitlist.setStatus(e.id,'notified')}):null,(0,J.jsx)(N.Button,{small:!0,label:"Seat",onPress:()=>v.repo.waitlist.setStatus(e.id,'seated')}),(0,J.jsx)(N.Button,{small:!0,kind:"ghost",label:"Remove",onPress:()=>v.repo.waitlist.setStatus(e.id,'removed')})]})]},e.id)),(0,J.jsxs)(N.Row,{gap:6,children:[(0,J.jsx)(i.TextInput,{accessibilityLabel:"Waitlist name",placeholder:"Name for the waitlist",placeholderTextColor:"#7D776C",value:ce,onChangeText:he,style:[N.styles.input,{flex:1}]}),(0,J.jsx)(N.Stepper,{value:pe,onChange:ke,min:1,max:12,label:"party"})]}),(0,J.jsx)(N.Button,{kind:"secondary",label:"Add to waitlist",disabled:ce.trim().length<2,onPress:()=>{v.repo.waitlist.join(C,ce.trim(),pe),he('')}})]}):(0,J.jsx)(N.Button,{kind:"ghost",label:"Open waitlist",onPress:()=>be(!0),accessibilityLabel:"Open the empty waitlist to add a waiting party"}),re.elements]})};var e,s=_r(_d[0]),t=_r(_d[1]),l=_r(_d[2]),n=_r(_d[3]),i=_r(_d[4]),a=_r(_d[5]),o=_r(_d[6]),d=_r(_d[7]),r=_r(_d[8]),u=_r(_d[9]),c=_r(_d[10]),h=_r(_d[11]),b=_r(_d[12]),p=_r(_d[13]),k=_r(_d[14]),x=_r(_d[15]),y=_r(_d[16]),w=_r(_d[17]),j=_r(_d[18]),f=_r(_d[19]),I=_r(_d[20]),B=_r(_d[21]),S=_r(_d[22]),D=_r(_d[23]),$=_r(_d[24]),T=_r(_d[25]),C=_r(_d[26]),L=(e=C)&&e.__esModule?e:{default:e},N=_r(_d[27]),P=_r(_d[28]),v=_r(_d[29]),O=_r(_d[30]),W=_r(_d[31]),M=_r(_d[32]),_=_r(_d[33]),A=_r(_d[34]),E=_r(_d[35]),R=_r(_d[36]),z=_r(_d[37]),H=_r(_d[38]),G=_r(_d[39]),U=_r(_d[40]),F=_r(_d[41]),K=_r(_d[42]),V=_r(_d[43]),Y=_r(_d[44]),q=_r(_d[45]),Q=_r(_d[46]),J=_r(_d[47])},1356,[5,1354,11,1357,796,806,1112,1113,1091,1115,1114,1328,1329,1100,1282,1012,1089,14,1358,1182,1359,1316,1081,1075,1090,34,102,794,1291,848,830,836,827,1267,840,1147,1096,1014,1360,1361,1136,1362,1173,985,1149,1324,852,25]); +__d(function(g,_r,_i,_a,m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.Bookings=function({go:e}={}){const{rid:L,r:Z,now:ee,today:se,me:te,role:le}=(0,k.useCtx)(1e4),ne=(0,O.useBookings)(L),ie=(0,k.useInStaffApp)(),ae=(0,k.useShiftManager)(),oe=(0,O.useWaitlist)(L),[de,re]=((0,O.useStore)(e=>e.alertAcks),(0,C.useState)(se)),ue=(0,z.useFrontDoor)(de),ce=(0,x.useBookingWrite)(),[he,ge]=(0,C.useState)(''),[be,pe]=(0,C.useState)(!1),[ke,me]=(0,C.useState)(2),xe=dee.date===de).sort((e,s)=>e.time.localeCompare(s.time)),we=oe.filter(e=>'waiting'===e.status||'notified'===e.status).sort((e,s)=>e.number-s.number),je=ye.filter(e=>'noshow'===e.status),fe=(0,Y.useSync)(e=>!!e.venueId&&'guest'!==e.kind),Ie=ye.filter(e=>'cancelled'!==e.status).reduce((e,s)=>e+s.partySize,0),Be=(0,h.cancelledDayTally)(ne,de),De=(0,h.cancelledTallyWords)(Be,de===se?'today':'that day'),Se=ye.filter(e=>!e.walkIn),$e=ye.filter(e=>e.walkIn),Te=ne.filter(e=>'pending'===e.status&&e.date>=se).sort((e,s)=>(e.date+e.time).localeCompare(s.date+s.time)),[Ce,Le]=(0,C.useState)(null),Ne=(0,E.parseYmd)(de);Ne.setHours(12);const Pe=(0,J.hoursFor)(Z,Ne),ve=Pe?.open??new Date(`${de}T12:00:00`),Oe=Pe?.close??new Date(`${de}T21:00:00`),We=Pe||ye.length?xe?'No one seated that day':de===se?'No bookings yet today':'No bookings yet':de===se?'Closed today':'Closed that day';return(0,X.jsxs)(N.default,{style:{gap:12},children:[e&&!ie&&'staff'!==le?(0,X.jsx)(P.Button,{testID:"bookings-dashboard-top",label:"Bookings dashboard",accessibilityLabel:"Open Bookings dashboard: table plan, Timeline, today's guests and Covers",onPress:()=>e('more','serviceboard'),style:{width:'100%',minHeight:60}}):null,s.IS_WILDINGS||(s.IS_QUEUED_VENUE||s.IS_KIRKTON||s.IS_GREENSIDE||'abbotsford'===L)&&!ie&&'staff'!==le?(0,X.jsx)(n.VenueRequestList,{rid:L,kind:"table"}):null,!s.IS_WILDINGS&&!Z.settings.hotel?.enabled||ie||'staff'===le?null:(0,X.jsx)(n.VenueRequestList,{rid:L,kind:"room",hotel:Z.settings.hotel??l.WILDINGS_HOTEL}),(0,X.jsx)(U.BookingsDayNav,{today:se,date:de,onDate:re,count:e=>ne.filter(s=>s.date===e&&'cancelled'!==s.status).length,sub:e=>{const s=ne.filter(s=>s.date===e&&'cancelled'!==s.status&&!s.walkIn),t=s.reduce((e,s)=>e+s.partySize,0);return`${s.length} ${1===s.length?'table':'tables'} \xb7 ${t} ${1===t?'Cover':'Covers'}`}}),(0,X.jsx)(N.default,{testID:"bookings-day-graph",style:{overflow:'visible'},children:(0,X.jsx)(Q.DayGraph,{bare:!0,fill:!0,todays:ye,open:ve,close:Oe,now:ee,turnBase:Z.settings.turnMins,height:128,past:xe,closed:!Pe,emptyText:We})}),xe?(0,X.jsxs)(N.default,{testID:"bookings-past-totals",style:[P.styles.card,{gap:4}],accessible:!0,accessibilityLabel:`${(0,U.longDay)(de)}: ${Se.length} tables, ${Ie} Covers, ${ye.filter(e=>'finished'===e.status).length} finished, ${je.length} no-shows, ${ye.filter(e=>'cancelled'===e.status).length} cancelled`,children:[(0,X.jsxs)(P.T,{size:17,weight:"semibold",children:["That day: ",Se.length," table",1===Se.length?'':'s',$e.length?` \xb7 ${$e.length} walk-in${1===$e.length?'':'s'}`:''," \xb7 ",Ie," ",1===Ie?'Cover':'Covers']}),(0,X.jsxs)(P.T,{size:16,colour:A.colours.text,children:[ye.filter(e=>'finished'===e.status).length," finished \xb7 ",je.length," no-show",1===je.length?'':'s'," \xb7 ",ye.filter(e=>'cancelled'===e.status).length," cancelled"]}),(0,X.jsx)(P.Muted,{children:"Looking back: read-only. Undo is still there for a mistake made today."})]}):null,(0,X.jsx)(N.default,{testID:"bookings-summary",children:(0,X.jsxs)(P.T,{weight:"semibold",children:[Se.length," table",1===Se.length?'':'s'," booked",$e.length?` \xb7 ${$e.length} walk-in${1===$e.length?'':'s'}`:''," \xb7 ",Ie," ",1===Ie?'Cover':'Covers']})}),(0,X.jsx)(N.default,{testID:"cancelled-day-tally",accessible:!0,accessibilityLabel:De,style:{alignItems:'center'},children:(0,X.jsx)(P.T,{size:15,colour:A.colours.muted,center:!0,children:De})}),(0,X.jsxs)(N.default,{testID:"bookings-actions",style:{flexDirection:'row',flexWrap:'wrap',gap:8},children:[xe?null:(0,X.jsx)(B.QuietButton,{label:"New booking",onPress:ue.openBooking,testID:"add-booking",disabled:!ce.ok,accessibilityHint:ce.hint}),ie&&ae&&de===se?(0,X.jsx)(B.QuietButton,{label:"Walk-in",onPress:ue.openWalkIn,testID:"add-walkin",disabled:!ce.ok,accessibilityHint:ce.hint}):null,de===se?(0,X.jsx)(D.CloseGardenButton,{quiet:!0,short:!0,rid:L,r:Z,now:ee,by:te}):null]}),Te.length?(0,X.jsxs)(N.default,{testID:"pending-requests",style:[P.styles.card,{borderColor:A.colours.amber,gap:8}],children:[(0,X.jsxs)(P.T,{weight:"semibold",colour:A.colours.amber,children:["Needs confirming (",Te.length,")"]}),(0,X.jsx)(P.Muted,{children:"Online requests outside your auto-accept rules. Check the details before confirming."}),Te.map(e=>(0,X.jsxs)(N.default,{style:{gap:6,paddingTop:6,borderTopWidth:1,borderColor:A.colours.border},children:[(0,X.jsxs)(P.T,{weight:"semibold",children:[e.name," \xb7 ",e.partySize," ",1===e.partySize?'Cover':'Covers']}),(0,X.jsxs)(P.Muted,{children:[(0,E.niceDate)((0,E.parseYmd)(e.date))," at ",e.time," \xb7 ",e.ref," \xb7 ",e.phone??'no phone']}),e.notes?(0,X.jsxs)(P.T,{size:16,children:["Notes: ",e.notes]}):null,e.allergies.length?(0,X.jsx)(P.Row,{wrap:!0,gap:4,children:e.allergies.map(e=>(0,X.jsx)(P.Badge,{kind:"red",label:`${(0,W.allergenLabel)(e.allergen)} \xb7 ${(0,W.severityLabel)(e.severity)}`},e.allergen))}):null,(0,X.jsx)(S.NeedsPills,{b:e,r:Z}),'staff'!==le&&((0,$.needsHoldOk)(e)||e.date===se&&e.holdOk&&(e.holds??[]).some(e=>!e.served)&&'seated'===e.status)?(0,X.jsxs)(P.Row,{wrap:!0,gap:6,children:[(0,$.needsHoldOk)(e)?(0,X.jsx)(P.Button,{small:!0,kind:"success",label:"Platter OK",testID:`mgr-platter-ok-${e.ref}`,onPress:()=>(0,S.confirmHolds)(e.id,te)}):null,e.holdOk&&'seated'===e.status?(0,X.jsx)(P.Button,{small:!0,kind:"secondary",label:"Platter served",onPress:()=>(0,S.serveHolds)(e,te,'owner')}):null]}):null,Ce===e.id?(0,X.jsxs)(N.default,{style:{gap:6},children:[(0,X.jsxs)(P.T,{size:14,children:["Are you sure? ",e.name.split(' ')[0]," will get a polite \u201csorry, we can\u2019t fit you in\u201d message."]}),(0,X.jsxs)(P.Row,{gap:6,children:[(0,X.jsx)(P.Button,{small:!0,kind:"danger",label:"Yes, decline",onPress:()=>{O.repo.bookings.decide(e.id,'declined',te),Le(null)}}),(0,X.jsx)(P.Button,{small:!0,kind:"ghost",label:"Keep it",onPress:()=>Le(null)})]})]}):ce.ok?(0,X.jsxs)(P.Row,{gap:6,children:[(0,X.jsx)(P.Button,{small:!0,label:"Confirm",testID:`confirm-${e.ref}`,onPress:()=>O.repo.bookings.decide(e.id,'confirmed',te)}),(0,X.jsx)(P.Button,{small:!0,kind:"secondary",label:"Decline",onPress:()=>Le(e.id)}),(0,X.jsx)(q.WhatsAppGuest,{b:e,rid:L,kind:"change"})]}):(0,X.jsx)(N.default,{accessible:!0,accessibilityLabel:y.BOOKING_VIEW_ONLY,children:(0,X.jsx)(P.T,{children:y.BOOKING_VIEW_ONLY})}),(0,X.jsx)(K.ConfirmTimeline,{refId:e.id})]},e.id))]}):null,0===ye.length?(0,X.jsx)(P.Muted,{children:"No bookings for this day yet."}):null,ye.map(e=>{const s='confirmed'===e.status&&de===se&&(0,E.minsBetween)(new Date(`${e.date}T${e.time}:00`),ee)>15,t=(0,j.depositState)(e),l=(0,j.depositBadge)(e,M.gbp);return(0,X.jsxs)(N.default,{testID:(0,T.isSeatedHighlight)((0,$.shownStatus)(e))?`booking-seated-${e.id}`:`booking-row-${e.id}`,style:[P.styles.card,(0,T.isSeatedHighlight)((0,$.shownStatus)(e))?(0,T.seatedHighlightStyle)({borderColor:(0,$.hasAllergens)(e)?A.colours.red:A.colours.goldLight}):{borderColor:(0,$.hasAllergens)(e)?A.colours.red:s?A.colours.amber:A.colours.hairline,opacity:['finished','cancelled'].includes(e.status)?.55:1}],children:[(0,X.jsx)(S.AllergenBar,{b:e}),(0,X.jsxs)(P.Row,{style:{justifyContent:'space-between'},children:[(0,X.jsxs)(P.Row,{gap:6,style:{flex:1,minWidth:0,alignItems:'center'},children:[(0,X.jsxs)(P.T,{weight:"semibold",colour:(0,T.isSeatedHighlight)((0,$.shownStatus)(e))?T.SEATED_FG:A.colours.text,style:{flexShrink:1},children:[e.time," \xb7 ",(0,z.walkInLabel)(e)]}),(0,$.hasAllergens)(e)?(0,X.jsx)(v.AllergyIcon,{text:(0,$.allergenText)(e),size:20,colour:(0,T.isSeatedHighlight)((0,$.shownStatus)(e))?'#7A4A00':A.colours.amber,ink:(0,T.isSeatedHighlight)((0,$.shownStatus)(e))?A.colours.gold:A.colours.bg,testID:`booking-allergy-${e.id}`}):null]}),(0,X.jsx)(P.Badge,{kind:'seated'===(0,$.shownStatus)(e)?'ok':'noshow'===e.status?'red':'confirmed'===e.status?'gold':'pending'===e.status?'amber':'neutral',label:'noshow'===e.status?'No-show':'pending'===e.status?'Needs confirming':(0,$.shownStatus)(e)[0].toUpperCase()+(0,$.shownStatus)(e).slice(1)})]}),l?(0,X.jsx)(w.DepositChip,{b:e,money:!0,big:!0,testID:`deposit-chip-${e.id}`}):null,(0,T.isSeatedHighlight)((0,$.shownStatus)(e))?(0,X.jsxs)(P.T,{size:14,colour:T.SEATED_MUTED,children:[e.table?(0,H.tableCardLabel)(e.table):e.walkIn?'Table to assign':'Table TBC'," \xb7 ",e.ref]}):(0,X.jsxs)(P.Muted,{children:[e.table?(0,H.tableCardLabel)(e.table):e.walkIn?'Table to assign':'Table TBC'," \xb7 ",e.ref]}),e.notes?(0,X.jsxs)(P.T,{size:16,testID:`booking-notes-${e.id}`,children:["Notes: ",e.notes]}):null,(0,c.bookingExtras)(e)?(0,X.jsx)(P.T,{size:15,testID:`booking-extras-${e.id}`,children:(0,c.bookingExtras)(e)}):null,(0,c.historyLines)(e)[0]?(0,X.jsxs)(P.Muted,{size:13,testID:`booking-last-change-${e.id}`,children:["Last change: ",(0,c.historyLines)(e)[0]]}):null,l?(0,X.jsxs)(P.Row,{wrap:!0,gap:6,style:{alignItems:'center'},children:[xe||!(0,j.canTickDeposit)(e)||['cancelled','finished'].includes(e.status)?null:(0,X.jsx)(P.Button,{small:!0,kind:"secondary",label:"Mark deposit paid",testID:`deposit-paid-${e.id}`,accessibilityLabel:`Mark deposit paid for ${(0,z.walkInLabel)(e)}`,onPress:()=>O.repo.bookings.update(e.id,{depositPaid:e.depositDue??0,depositPaidBy:te,depositPaidAt:(new Date).toISOString()})}),xe?null:(0,X.jsx)(f.WixDepositLink,{b:e,rid:L}),'paid'===t&&e.depositPaidBy?(0,X.jsx)(P.Muted,{size:13,children:'Wix deposit link'===e.depositPaidBy?'Paid through a website bookings deposit link':`Ticked by ${e.depositPaidBy}`}):null]}):null,e.walkIn?null:(0,X.jsxs)(P.Muted,{children:[(0,V.bookingSource)(e),e.phone?` \xb7 ${e.phone}`:'',e.email?` \xb7 ${e.email}`:'']}),e.allergies.length?(0,X.jsx)(P.Row,{wrap:!0,gap:4,children:e.allergies.map(e=>(0,X.jsx)(P.Badge,{kind:"red",label:`${(0,W.allergenLabel)(e.allergen)} \xb7 ${(0,W.severityLabel)(e.severity)}`},e.allergen))}):null,(0,$.hasAllergens)(e)&&!['cancelled','noshow'].includes(e.status)?(0,X.jsx)(F.BookingAllergyChain,{b:e,me:te}):null,e.walkIn?null:(0,X.jsx)(K.ConfirmTimeline,{refId:e.id,noPhone:!!e.source&&!e.phone}),s?(0,X.jsxs)(P.T,{size:13,colour:A.colours.amber,children:["Running ",(0,E.minsBetween)(new Date(`${e.date}T${e.time}:00`),ee)," min late. Call them, then mark no-show if needed."]}):null,ce.ok?(0,X.jsx)(u.BookingEditButton,{rid:L,booking:e,who:te,role:le,inStaffApp:ie,shiftManager:ae,big:!0,testID:`edit-booking-${e.id}`}):null,(0,X.jsxs)(P.Row,{wrap:!0,gap:6,children:[(0,X.jsx)(r.BookingTableButton,{rid:L,booking:e,readOnly:xe||!ce.ok,turnBase:Z.settings.turnMins}),ce.ok?null:(0,X.jsx)(N.default,{accessible:!0,accessibilityLabel:y.BOOKING_VIEW_ONLY,children:(0,X.jsx)(P.T,{children:y.BOOKING_VIEW_ONLY})}),ce.ok?(0,X.jsxs)(X.Fragment,{children:[xe||e.table||!['seated','confirmed'].includes(e.status)?null:(0,X.jsx)(P.Button,{small:!e.walkIn,kind:e.walkIn?'primary':'secondary',label:"Assign table",onPress:()=>ue.assignTable(e)}),!xe&&['seated','confirmed'].includes(e.status)?(0,X.jsx)(P.Button,{small:!0,kind:"secondary",label:(0,H.tablesOf)(e.table).length>1?'Change tables':'Combine tables',testID:`combine-${e.id}`,accessibilityLabel:`${(0,H.tablesOf)(e.table).length>1?'Change tables':'Combine tables'} for ${(0,z.walkInLabel)(e)}`,onPress:()=>ue.combineTables(e)}):null,xe||'confirmed'!==e.status?null:(0,X.jsxs)(X.Fragment,{children:[e.date===se?(0,X.jsx)(P.Button,{small:!0,label:"Seat",accessibilityLabel:`Seat ${(0,z.walkInLabel)(e)} now`,onPress:()=>(0,z.seatBookingNow)(L,e)}):null,(0,X.jsx)(P.Button,{small:!0,kind:"secondary",label:"No-show",onPress:()=>O.repo.bookings.setStatus(e.id,'noshow')})]}),xe||e.walkIn?null:(0,X.jsx)(d.CancelBookingButton,{rid:L,b:e,name:(0,z.walkInLabel)(e),small:!0,onDone:()=>{}}),xe||e.walkIn?null:(0,X.jsx)(d.ReinstateBookingButton,{b:e,name:(0,z.walkInLabel)(e),today:se}),xe||'seated'!==e.status?null:(0,X.jsx)(P.Button,{small:!0,kind:"secondary",label:"Finished",accessibilityLabel:`Finished: ${(0,z.walkInLabel)(e)}, table needs clearing`,onPress:()=>(0,z.finishBookingNow)(L,e)}),['confirmed','pending'].includes(e.status)&&e.date>=se?(0,X.jsx)(q.WhatsAppGuest,{b:e,rid:L,kind:"auto"}):null,ie?null:(0,X.jsx)(I.CopyReviewLink,{rid:L,bookingId:e.id}),!xe&&e.walkIn?(0,X.jsx)(o.CancelWalkInButton,{rid:L,b:e,small:!0}):null,!xe&&e.walkIn?(0,X.jsx)(o.ReinstateWalkInButton,{rid:L,b:e,today:se,small:!0}):null,(0,X.jsx)(G.BookingUndo,{b:e,rid:L,today:se,who:(0,z.walkInLabel)(e)})]}):null]}),'noshow'===e.status&&'paid'===t?(0,X.jsx)(P.Muted,{size:13,children:"A deposit was paid. Keep or refund it by your deposit terms (Settings \u203a Advanced \u203a Deposits). Deposits paid through website bookings are refunded in Website bookings \u203a Orders."}):null]},e.id)}),(0,X.jsx)(p.CancellationsSection,{testID:"bookings-cancellations",items:(0,b.cancellationsFor)(ne,de,e=>e.walkIn?`Walk-in ${e.ref}`:(e.name??'').replace(' (example)','')),dayWord:de===se?'today':'that day'}),(0,X.jsxs)(P.Card,{children:[(0,X.jsxs)(P.Row,{style:{justifyContent:'space-between'},children:[(0,X.jsx)(P.T,{weight:"semibold",children:"No-shows"}),(0,X.jsx)(P.Badge,{kind:je.length?'red':'ok',label:`${je.length} ${de===se?'today':(0,E.niceDate)((0,E.parseYmd)(de)).slice(0,6)}${fe||a.LIVE_VENUE_BUILD?'':' \xb7 4.1% last 28 days (example)'}`})]}),(0,X.jsx)(P.Muted,{children:je.length?`Marked no-show today: ${je.slice(0,6).map(e=>`${e.time} ${(0,z.walkInLabel)(e)}`).join(', ')}${je.length>6?` and ${je.length-6} more`:''}. If they turn up, open the booking and tap Undo no-show.`:'No no-shows today. If a party doesn\u2019t arrive, call them first, then tap No-show on their booking.'})]}),s.IS_GREENSIDE?(0,X.jsx)(t.GreensideCashOnly,{}):(0,X.jsxs)(P.Card,{children:[(0,X.jsx)(P.T,{weight:"semibold",children:"Deposits"}),(0,X.jsx)(P.Muted,{testID:"deposits-card-text",children:(()=>{const e=(0,j.depositOf)(Z.settings);return e.on&&e.perPersonPence>0?`Deposits: ${(0,M.gbp)(e.perPersonPence)} per person for parties of ${e.fromParty} or more. Deposits are paid through website bookings. Website bookings show Deposit paid on website bookings by themselves once the guest has paid. For phone and walk-in bookings, tick Deposit paid once the guest has paid you${e.wixLinksOn?', or press Send deposit link':''}.`:'Deposits are off. Turn them on in Settings \u203a Advanced \u203a Deposits.'})()}),(0,X.jsx)(P.Muted,{size:13,children:"Tip: refunds are done in Website bookings \u203a Orders. Booking deposit amounts are visible in Managers, Display and Staff."})]}),we.length>0||be?(0,X.jsxs)(N.default,{style:{gap:10},children:[(0,X.jsx)(R.SectionHead,{title:`Waitlist (${we.length})`,sub:`New party waits about ${(0,_.estimateWait)(we.length+1,Z.settings.turnMins,1)} min (estimate)`}),we.map((e,s)=>(0,X.jsxs)(N.default,{style:P.styles.card,children:[(0,X.jsxs)(P.Row,{style:{justifyContent:'space-between'},children:[(0,X.jsxs)(P.T,{weight:"semibold",children:["#",e.number," ",e.name," \xb7 ",e.partySize]}),(0,X.jsxs)(P.Muted,{children:[(0,E.minsBetween)(new Date(e.joinedAt),ee)," min \xb7 est. ",(0,_.estimateWait)(s+1,Z.settings.turnMins,1)," min"]})]}),'notified'===e.status?(0,X.jsx)(P.Badge,{kind:"ok",label:"Marked as told: table ready (no text is sent)"}):null,(0,X.jsxs)(P.Row,{gap:6,children:['waiting'===e.status?(0,X.jsx)(P.Button,{small:!0,kind:"secondary",label:"Notify",onPress:()=>O.repo.waitlist.setStatus(e.id,'notified')}):null,(0,X.jsx)(P.Button,{small:!0,label:"Seat",onPress:()=>O.repo.waitlist.setStatus(e.id,'seated')}),(0,X.jsx)(P.Button,{small:!0,kind:"ghost",label:"Remove",onPress:()=>O.repo.waitlist.setStatus(e.id,'removed')})]})]},e.id)),(0,X.jsxs)(P.Row,{gap:6,children:[(0,X.jsx)(i.TextInput,{accessibilityLabel:"Waitlist name",placeholder:"Name for the waitlist",placeholderTextColor:"#7D776C",value:he,onChangeText:ge,style:[P.styles.input,{flex:1}]}),(0,X.jsx)(P.Stepper,{value:ke,onChange:me,min:1,max:12,label:"party"})]}),(0,X.jsx)(P.Button,{kind:"secondary",label:"Add to waitlist",disabled:he.trim().length<2,onPress:()=>{O.repo.waitlist.join(L,he.trim(),ke),ge('')}})]}):(0,X.jsx)(P.Button,{kind:"ghost",label:"Open waitlist",onPress:()=>pe(!0),accessibilityLabel:"Open the empty waitlist to add a waiting party"}),ue.elements]})};var e,s=_r(_d[0]),t=_r(_d[1]),l=_r(_d[2]),n=_r(_d[3]),i=_r(_d[4]),a=_r(_d[5]),o=_r(_d[6]),d=_r(_d[7]),r=_r(_d[8]),u=_r(_d[9]),c=_r(_d[10]),h=_r(_d[11]),b=_r(_d[12]),p=_r(_d[13]),k=_r(_d[14]),x=_r(_d[15]),y=_r(_d[16]),w=_r(_d[17]),j=_r(_d[18]),f=_r(_d[19]),I=_r(_d[20]),B=_r(_d[21]),D=_r(_d[22]),S=_r(_d[23]),$=_r(_d[24]),T=_r(_d[25]),C=_r(_d[26]),L=_r(_d[27]),N=(e=L)&&e.__esModule?e:{default:e},P=_r(_d[28]),v=_r(_d[29]),O=_r(_d[30]),W=_r(_d[31]),M=_r(_d[32]),E=_r(_d[33]),_=_r(_d[34]),A=_r(_d[35]),R=_r(_d[36]),z=_r(_d[37]),H=_r(_d[38]),G=_r(_d[39]),U=_r(_d[40]),F=_r(_d[41]),K=_r(_d[42]),V=_r(_d[43]),Y=_r(_d[44]),q=_r(_d[45]),Q=_r(_d[46]),J=_r(_d[47]),X=_r(_d[48])},1356,[5,1354,11,1357,796,806,1112,1113,1091,1115,1111,1114,1328,1329,1100,1282,1012,1089,14,1358,1182,1359,1316,1081,1075,1090,34,102,794,1291,848,830,836,827,1267,840,1147,1096,1014,1360,1361,1136,1362,1173,985,1149,1324,852,25]); __d(function(g,_r,i,a,m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.VenueRequestList=function({rid:e,kind:n,hotel:c}){const y=(0,r.useSync)(),p='staff'===y.kind&&y.venueSlug===(0,s.queuedDatabaseSlug)(e)&&!!y.venueId&&(!['greenside','kirkton','abbotsford'].includes(e)&&!(0,s.isQueuedVenue)(e)||y.perms.includes('*')||y.perms.includes('venue.settings')),f=p&&(y.perms.includes('*')||y.perms.includes('room'===n||(0,s.isQueuedVenue)(e)||['greenside','kirkton','abbotsford'].includes(e)?'venue.settings':'bookings.manage')),[h,b]=(0,t.useState)([]),[j,q]=(0,t.useState)(''),[x,k]=(0,t.useState)(null),v=(0,t.useCallback)(async()=>{if(p)try{b(await(0,o.listVenueRequests)(y.venueId,n)),q('')}catch(e){q((0,o.requestMessage)(e))}},[p,n,y.venueId]);(0,t.useEffect)(()=>{const e=setTimeout(()=>{v()},0),s=setInterval(()=>{v()},15e3);return()=>{clearTimeout(e),clearInterval(s)}},[v]);const T=h.filter(e=>e.venue_id===y.venueId);if(!p)return null;const I=async(e,s)=>{if(!x){k(e);try{await(0,o.decideVenueRequest)(e,s),await v()}catch(e){q((0,o.requestMessage)(e))}finally{k(null)}}};return(0,u.jsxs)(d.default,{testID:`venue-${n}-requests`,style:{gap:12,alignItems:'stretch'},children:[(0,u.jsx)(l.H2,{children:'room'===n?'Room requests':'Table requests'}),(0,u.jsx)(l.T,{center:!0,children:"Requested bookings need a staff decision. No email or text is sent. Contact the guest to confirm arrangements."}),(0,u.jsx)(l.Button,{kind:"secondary",label:`Refresh ${n} requests`,onPress:()=>{v()}}),j?(0,u.jsx)(l.Banner,{kind:"warn",title:"Requests",children:j}):null,T.length||j?null:(0,u.jsxs)(l.T,{center:!0,children:["No ",n," requests yet."]}),T.map(e=>(0,u.jsx)(l.Card,{style:{alignItems:'stretch'},children:(0,u.jsxs)(d.default,{testID:`venue-request-${e.id}`,style:{gap:10},children:[(0,u.jsxs)(l.Row,{wrap:!0,children:[(0,u.jsx)(l.T,{weight:"semibold",children:e.payload.name}),(0,u.jsx)(l.Badge,{kind:'requested'===e.status?'amber':'confirmed'===e.status?'ok':'neutral',label:'requested'===e.status?'Requested':'confirmed'===e.status?'Confirmed':'Declined'})]}),(0,u.jsx)(l.T,{children:'table'===n?`${e.payload.date} \xb7 ${e.payload.service?e.payload.service+' \xb7 ':''}${e.payload.time} \xb7 ${e.payload.covers} Covers`:`${e.payload.checkIn} to ${e.payload.checkOut} \xb7 ${c?.roomTypes.find(s=>s.id===e.payload.roomType)?.name||e.payload.roomType} \xb7 ${e.payload.guests} guests`}),'room'===n?(0,u.jsxs)(l.T,{children:["Add dinner: ",e.payload.addDinner?'Yes \u2014 arrange with guest':'No']}):null,(0,u.jsxs)(l.T,{children:[e.payload.phone," \xb7 ",e.payload.email]}),e.payload.notes?(0,u.jsxs)(l.T,{children:["Notes: ",e.payload.notes]}):null,'requested'===e.status&&f?(0,u.jsxs)(l.Row,{wrap:!0,children:[(0,u.jsx)(l.Button,{label:x===e.id?'Saving\u2026':'Confirm',testID:`request-confirm-${e.id}`,disabled:!!x,onPress:()=>{I(e.id,'confirmed')}}),(0,u.jsx)(l.Button,{label:"Decline",kind:"secondary",testID:`request-decline-${e.id}`,disabled:!!x,onPress:()=>{I(e.id,'declined')}})]}):null,e.booking_id?(0,u.jsx)(l.T,{children:"Confirmed table booking is in the bookings list."}):null]})},e.id))]})};var e,s=_r(_d[0]),t=_r(_d[1]),n=_r(_d[2]),d=(e=n)&&e.__esModule?e:{default:e},l=_r(_d[3]),r=_r(_d[4]),o=_r(_d[5]),u=_r(_d[6])},1357,[6,34,102,794,985,1213,25]); __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,"untilWords",{enumerable:!0,get:function(){return w}}),_e.WixDepositLink=function({b:e,rid:x}){const f=(0,r.useRestaurant)(x),[S,j]=(0,s.useState)(!1),[C,D]=(0,s.useState)(!1),[L,I]=(0,s.useState)(null),[$,v]=(0,s.useState)(''),[P,T]=(0,s.useState)(''),[A,_]=(0,s.useState)(''),M=(0,c.depositOf)(f?.settings),O=e;if(n.IS_ISOLATED_VENUE||['souters','kirkmichael','wildings'].includes(x)||!f||!(0,c.canSendDepositLink)(O,M))return null;const B='open'===O.depositLink?.state,R=async()=>{j(!0),D(!0),T(''),I(null);try{const{data:t,error:n}=await(0,h.getSupabase)().functions.invoke('wix-deposit-link',{body:{booking_id:e.id}});if(n||!t)return void T(y);if(!t.ok||!t.url)return void T(t.off?y:String(t.error??y));const s={url:t.url,amountPence:t.amountPence,expiresAt:t.expiresAt};I(s),v((0,c.depositLinkMessage)({name:e.name,venue:f.name,partySize:e.partySize,date:e.date,time:e.time,amountPence:s.amountPence,url:s.url,expiresAt:s.expiresAt,terms:(0,c.depositTerms)(M)}))}catch{T(y)}finally{D(!1)}},W=async()=>{_('Checking\u2026');try{const{data:t,error:n}=await(0,h.getSupabase)().functions.invoke('wix-deposit-check',{body:{booking_id:e.id}});_(n||!t||t.off?'Website bookings deposit links are switched off, so nothing was checked.':'Checked with website bookings. If the guest has paid, the badge shows Deposit paid on website bookings.')}catch{_('Could not reach website bookings. Try again in a minute.')}},z=L?(0,k.waMeLink)(e.phone,$):null,E=L&&e.phone?(0,p.smsLink)(e.phone,$):null,U=L&&e.email?`mailto:${encodeURIComponent(e.email)}?subject=${encodeURIComponent(`${f.name} deposit`)}&body=${encodeURIComponent($)}`:null,F='undefined'!=typeof navigator&&!!navigator.clipboard,G=e=>{e&&o.default.openURL(e).catch(()=>{})};return(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(d.Button,{small:!0,kind:"secondary",label:B?'Send deposit link again':'Send deposit link',testID:`deposit-link-${e.id}`,accessibilityLabel:`${B?'Send the deposit link again to':'Send a website bookings deposit link to'} ${e.name}`,onPress:()=>{R()}}),B?(0,g.jsx)(d.Button,{small:!0,kind:"secondary",label:"Check if paid",testID:`deposit-check-${e.id}`,accessibilityLabel:`Check with website bookings if ${e.name} has paid the deposit`,onPress:()=>{W()}}):null,A?(0,g.jsx)(d.Muted,{size:13,children:A}):null,(0,g.jsx)(d.Sheet,{visible:S,onClose:()=>j(!1),title:"Send deposit link",testID:`deposit-link-sheet-${e.id}`,children:(0,g.jsxs)(l.default,{style:{gap:10},children:[C?(0,g.jsx)(d.T,{children:"Asking website bookings for the link\u2026"}):null,P?(0,g.jsx)(d.T,{colour:b.colours.amber,testID:"deposit-link-error",children:P}):null,L?(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(d.T,{weight:"semibold",children:`Deposit ${(0,u.gbp)(L.amountPence)} for ${e.partySize} guests.${L.expiresAt?` Link works until ${w(L.expiresAt)}.`:''}`}),(0,g.jsx)(d.T,{children:"Message to the guest (you can change it)"}),(0,g.jsx)(t.TextInput,{accessibilityLabel:"Message to the guest",testID:"deposit-link-message",value:$,multiline:!0,onChangeText:v,style:{minHeight:140,borderRadius:10,borderWidth:1,borderColor:b.colours.hairline,backgroundColor:b.colours.surface2,color:b.colours.text,padding:10,fontSize:15}}),(0,g.jsxs)(d.Row,{wrap:!0,gap:8,children:[E?(0,g.jsx)(d.Button,{label:"Text",testID:"deposit-link-sms",accessibilityLabel:`Open a text message to ${e.name} with the deposit link`,onPress:()=>G(E)}):null,z?(0,g.jsx)(d.Button,{kind:"secondary",label:"WhatsApp",testID:"deposit-link-wa",accessibilityLabel:`Open WhatsApp to ${e.name} with the deposit link`,onPress:()=>G(z)}):null,U?(0,g.jsx)(d.Button,{kind:"secondary",label:"Email",testID:"deposit-link-email",accessibilityLabel:`Open an email to ${e.name} with the deposit link`,onPress:()=>G(U)}):null,F?(0,g.jsx)(d.Button,{kind:"secondary",label:"Copy link",testID:"deposit-link-copy",accessibilityLabel:"Copy the deposit link",onPress:()=>{navigator.clipboard.writeText(L.url).catch(()=>{})}}):null]}),E||z||U?null:(0,g.jsx)(d.Muted,{children:"This booking has no phone number or email. Copy the link and send it another way."}),(0,g.jsx)(d.Muted,{size:13,children:"Tip: CoverCharge doesn't send anything. Each button opens your own messages app with the words filled in, and you press Send. Once the guest pays on website bookings, this booking shows Deposit paid on website bookings by itself. Refunds are done in Website bookings \u203a Orders."})]}):null,(0,g.jsx)(d.Button,{kind:"secondary",label:"Close",testID:"deposit-link-close",onPress:()=>j(!1)})]})})]})};var t=_r(_d[0]),n=_r(_d[1]),s=_r(_d[2]),o=e(_r(_d[3]));_r(_d[4]);var l=e(_r(_d[5])),d=_r(_d[6]),r=_r(_d[7]),c=_r(_d[8]),u=_r(_d[9]),p=_r(_d[10]),h=_r(_d[11]),b=_r(_d[12]),k=_r(_d[13]),g=_r(_d[14]);const y="Website bookings deposit links aren't switched on yet. Take the deposit by card or cash and tick Deposit paid.",w=e=>e?new Date(e).toLocaleString('en-GB',{timeZone:'Europe/London',weekday:'short',day:'numeric',month:'short',hour:'2-digit',minute:'2-digit',hourCycle:'h23'}):''},1358,[796,5,34,379,236,102,794,850,14,836,1017,931,840,1150,25]); __d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.QuietButton=function({icon:e,label:s,onPress:n,testID:b,a11y:y,disabled:f,accessibilityHint:h}){return(0,u.jsxs)(t.default,{accessibilityRole:"button",accessibilityLabel:y??s,accessibilityHint:h,accessibilityState:{disabled:!!f},disabled:f,testID:b,onPress:n,style:({pressed:e})=>({...l.look.quiet(e),flexGrow:1,opacity:f?.4:1}),children:[e?(0,u.jsx)(o.T,{size:15,colour:c.colours.goldLight,children:e}):null,(0,u.jsx)(o.T,{size:15,weight:"semibold",colour:c.colours.goldLight,children:s})]})},r(d[0]);var e,s=r(d[1]),t=(e=s)&&e.__esModule?e:{default:e},l=r(d[2]),o=r(d[3]),c=r(d[4]),u=r(d[5])},1359,[34,402,1143,794,840,25]); diff --git a/staff-app/admin.html b/staff-app/admin.html index 7df0fb791c5436872d6631a1834759df08449b02..5320139fd3672cb42e554aa1451206f7ad67444c 100644 --- a/staff-app/admin.html +++ b/staff-app/admin.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/staff-app/customer.html b/staff-app/customer.html index 7df0fb791c5436872d6631a1834759df08449b02..5320139fd3672cb42e554aa1451206f7ad67444c 100644 --- a/staff-app/customer.html +++ b/staff-app/customer.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/staff-app/customer/anchorage.html b/staff-app/customer/anchorage.html index 7df0fb791c5436872d6631a1834759df08449b02..5320139fd3672cb42e554aa1451206f7ad67444c 100644 --- a/staff-app/customer/anchorage.html +++ b/staff-app/customer/anchorage.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/staff-app/customer/anchorage/book.html b/staff-app/customer/anchorage/book.html index 7df0fb791c5436872d6631a1834759df08449b02..5320139fd3672cb42e554aa1451206f7ad67444c 100644 --- a/staff-app/customer/anchorage/book.html +++ b/staff-app/customer/anchorage/book.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/staff-app/customer/anchorage/feedback.html b/staff-app/customer/anchorage/feedback.html index 7df0fb791c5436872d6631a1834759df08449b02..5320139fd3672cb42e554aa1451206f7ad67444c 100644 --- a/staff-app/customer/anchorage/feedback.html +++ b/staff-app/customer/anchorage/feedback.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/staff-app/customer/anchorage/gift.html b/staff-app/customer/anchorage/gift.html index 7df0fb791c5436872d6631a1834759df08449b02..5320139fd3672cb42e554aa1451206f7ad67444c 100644 --- a/staff-app/customer/anchorage/gift.html +++ b/staff-app/customer/anchorage/gift.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/staff-app/customer/anchorage/lost.html b/staff-app/customer/anchorage/lost.html index 7df0fb791c5436872d6631a1834759df08449b02..5320139fd3672cb42e554aa1451206f7ad67444c 100644 --- a/staff-app/customer/anchorage/lost.html +++ b/staff-app/customer/anchorage/lost.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/staff-app/customer/anchorage/loyalty.html b/staff-app/customer/anchorage/loyalty.html index 7df0fb791c5436872d6631a1834759df08449b02..5320139fd3672cb42e554aa1451206f7ad67444c 100644 --- a/staff-app/customer/anchorage/loyalty.html +++ b/staff-app/customer/anchorage/loyalty.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/staff-app/customer/anchorage/merch.html b/staff-app/customer/anchorage/merch.html index 7df0fb791c5436872d6631a1834759df08449b02..5320139fd3672cb42e554aa1451206f7ad67444c 100644 --- a/staff-app/customer/anchorage/merch.html +++ b/staff-app/customer/anchorage/merch.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/staff-app/customer/anchorage/offers.html b/staff-app/customer/anchorage/offers.html index 7df0fb791c5436872d6631a1834759df08449b02..5320139fd3672cb42e554aa1451206f7ad67444c 100644 --- a/staff-app/customer/anchorage/offers.html +++ b/staff-app/customer/anchorage/offers.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/staff-app/customer/anchorage/refer.html b/staff-app/customer/anchorage/refer.html index 7df0fb791c5436872d6631a1834759df08449b02..5320139fd3672cb42e554aa1451206f7ad67444c 100644 --- a/staff-app/customer/anchorage/refer.html +++ b/staff-app/customer/anchorage/refer.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/staff-app/customer/anchorage/waitlist.html b/staff-app/customer/anchorage/waitlist.html index 7df0fb791c5436872d6631a1834759df08449b02..5320139fd3672cb42e554aa1451206f7ad67444c 100644 --- a/staff-app/customer/anchorage/waitlist.html +++ b/staff-app/customer/anchorage/waitlist.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/staff-app/customer/anchorage/whatson.html b/staff-app/customer/anchorage/whatson.html index 7df0fb791c5436872d6631a1834759df08449b02..5320139fd3672cb42e554aa1451206f7ad67444c 100644 --- a/staff-app/customer/anchorage/whatson.html +++ b/staff-app/customer/anchorage/whatson.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/staff-app/customer/basket.html b/staff-app/customer/basket.html index 7df0fb791c5436872d6631a1834759df08449b02..5320139fd3672cb42e554aa1451206f7ad67444c 100644 --- a/staff-app/customer/basket.html +++ b/staff-app/customer/basket.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/staff-app/customer/profile.html b/staff-app/customer/profile.html index 7df0fb791c5436872d6631a1834759df08449b02..5320139fd3672cb42e554aa1451206f7ad67444c 100644 --- a/staff-app/customer/profile.html +++ b/staff-app/customer/profile.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/staff-app/demo.html b/staff-app/demo.html index 7df0fb791c5436872d6631a1834759df08449b02..5320139fd3672cb42e554aa1451206f7ad67444c 100644 --- a/staff-app/demo.html +++ b/staff-app/demo.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/staff-app/display.html b/staff-app/display.html index 7df0fb791c5436872d6631a1834759df08449b02..5320139fd3672cb42e554aa1451206f7ad67444c 100644 --- a/staff-app/display.html +++ b/staff-app/display.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/staff-app/index.html b/staff-app/index.html index 29ee68b4dd4d5fe163284f76c255f2c1769bea51..bcc3c0956c6a51ed9915b18171363037c9a5b2b0 100644 --- a/staff-app/index.html +++ b/staff-app/index.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/staff-app/kitchen.html b/staff-app/kitchen.html index 7df0fb791c5436872d6631a1834759df08449b02..5320139fd3672cb42e554aa1451206f7ad67444c 100644 --- a/staff-app/kitchen.html +++ b/staff-app/kitchen.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/staff-app/owner.html b/staff-app/owner.html index 7df0fb791c5436872d6631a1834759df08449b02..5320139fd3672cb42e554aa1451206f7ad67444c 100644 --- a/staff-app/owner.html +++ b/staff-app/owner.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/staff-app/staff.html b/staff-app/staff.html index 7df0fb791c5436872d6631a1834759df08449b02..5320139fd3672cb42e554aa1451206f7ad67444c 100644 --- a/staff-app/staff.html +++ b/staff-app/staff.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/staff-app/sw.js b/staff-app/sw.js index 9f473aaf739bfd7b27be25b5b5cbe4f05995a7d1..78cad0604bf4c8ba94852282393efa9b54cb3b39 100644 --- a/staff-app/sw.js +++ b/staff-app/sw.js @@ -1,7 +1,7 @@ // Anchorage Staff service worker: precache the app shell so it opens offline after the first visit. -const V = "cc-staff-79c8c87c15"; +const V = "cc-staff-8a8ba96019"; const BASE = "/staff-app/"; -const PRECACHE = ["/staff-app/apple-touch-icon.png", "/staff-app/assets/assets/brand/3idiots-hero.e5dfd53739f05086b1956e72d585a66a.png", "/staff-app/assets/assets/brand/3idiots.df4a76d2130f0e5b0042f06a8c88693a.png", "/staff-app/assets/assets/brand/abbotsford-hero.78fcb8ee06ee22c4ca659c9254db7512.png", "/staff-app/assets/assets/brand/abbotsford.b26602bba5ce4969733c5422a45ad053.png", "/staff-app/assets/assets/brand/anchorage-hero.0450b828e4f9c1f4456240096598f6f5.png", "/staff-app/assets/assets/brand/anchorage.fea5ce2f6fd18bf2950aa21c0980ed8e.png", "/staff-app/assets/assets/brand/brae.8de9e89ac30966c6669de990370d8e40.png", "/staff-app/assets/assets/brand/cecchinis-hero.f77780fcc94fd668cf35d66d6dc52d81.png", "/staff-app/assets/assets/brand/cecchinis.ebf752fef363247848ae7c0d91938765.png", "/staff-app/assets/assets/brand/drunkencoo-hero.65c21c4da9e466cf4bffc969639a1427.png", "/staff-app/assets/assets/brand/drunkencoo.f6d92af3b14e4205a3deaf4434754c51.png", "/staff-app/assets/assets/brand/greenside-hero.1caec5a6cb939434cccb5f3a613b50f8.png", "/staff-app/assets/assets/brand/greenside.9d1556db97dcb903a3c57e2063ee2255.png", "/staff-app/assets/assets/brand/kirkmichael-hero.63b13cde7fd82eb622622b39ac80c394.png", "/staff-app/assets/assets/brand/kirkmichael.63b13cde7fd82eb622622b39ac80c394.png", "/staff-app/assets/assets/brand/kirkton-hero.9d0837b292c2f4f30f4521d806bb28c3.png", "/staff-app/assets/assets/brand/kirkton.bcf8d846df4861474d224a7a77f498fb.png", "/staff-app/assets/assets/brand/mrbasrais-hero.4ce74641cfcf52d099157c84005b9d2a.png", "/staff-app/assets/assets/brand/mrbasrais.7cc4086dd12ace82529795f1c9f8c900.png", "/staff-app/assets/assets/brand/pizzaioli-hero.1896657c08264cefb49b401891d5448d.png", "/staff-app/assets/assets/brand/pizzaioli.db8c000b62ee407121aa8b90ce45e170.png", "/staff-app/assets/assets/brand/rupeeroom-hero.969fa372add526aaacf3a6c009b8ac92.png", "/staff-app/assets/assets/brand/rupeeroom.689e6fb536dc0845eeb174a1ec7bd346.png", "/staff-app/assets/assets/brand/saltmarsh.85a6a65732635e5148478d743d9ca884.png", "/staff-app/assets/assets/brand/smokinggoat-hero.0588f17ef0eed7f757f22916cd4d37db.png", "/staff-app/assets/assets/brand/smokinggoat.20a3a1970596ab43c5d6468d4ed549a7.png", "/staff-app/assets/assets/brand/souters.f4c58d9349b6e1700fe5abcc9e9b665c.png", "/staff-app/assets/assets/brand/wildings-hero-logo-text.4661e4b935726f2511f9c17a1567c89a.png", "/staff-app/assets/assets/brand/wildings.076f4fcd06d19a0af0205c410f461b14.png", "/staff-app/assets/assets/brand/williewastles-hero.b9d53d27b66f903b5618a7177b2ffad4.png", "/staff-app/assets/assets/brand/williewastles.055a77893ced99bf3a6c5402ba5baac6.png", "/staff-app/assets/assets/brand/yasmins-hero.a5aef62e37dfcecbe0afc056186f4ad9.png", "/staff-app/assets/assets/brand/yasmins.8482602e9f0a965655924835625cb02b.png", "/staff-app/assets/assets/recipes/fishsupper.1609c58319e1e8721f5c639049fb054e.jpg", "/staff-app/assets/assets/recipes/lobster.2fb3485c8e372972099259017358c1b8.jpg", "/staff-app/assets/assets/recipes/moules.a4f342fc7e7fb62c8a0b5c1678bbea3f.jpg", "/staff-app/assets/assets/recipes/skink.4ce7b7c676f9cdcd0a060eda46f5a00e.jpg", "/staff-app/assets/assets/recipes/stp.1061ced765efdcafff2554adc3fc7113.jpg", "/staff-app/assets/assets/specials/sample-chalkboard.e7b4e4450a8483d4219bc6a214158d8f.jpg", "/staff-app/assets/node_modules/@expo-google-fonts/poppins/400Regular/Poppins_400Regular.093ee89be9ede30383f39a899c485a82.ttf", "/staff-app/assets/node_modules/@expo-google-fonts/poppins/500Medium/Poppins_500Medium.bf59c687bc6d3a70204d3944082c5cc0.ttf", "/staff-app/assets/node_modules/@expo-google-fonts/poppins/600SemiBold/Poppins_600SemiBold.6f1520d107205975713ba09df778f93f.ttf", "/staff-app/assets/node_modules/@expo-google-fonts/poppins/700Bold/Poppins_700Bold.08c20a487911694291bd8c5de41315ad.ttf", "/staff-app/assets/node_modules/expo-router/assets/arrow_down.017bc6ba3fc25503e5eb5e53826d48a8.png", "/staff-app/assets/node_modules/expo-router/assets/error.d1ea1496f9057eb392d5bbf3732a61b7.png", "/staff-app/assets/node_modules/expo-router/assets/file.19eeb73b9593a38f8e9f418337fc7d10.png", "/staff-app/assets/node_modules/expo-router/assets/forward.d8b800c443b8972542883e0b9de2bdc6.png", "/staff-app/assets/node_modules/expo-router/assets/pkg.ab19f4cbc543357183a20571f68380a3.png", "/staff-app/assets/node_modules/expo-router/assets/react-navigation/elements/back-icon-mask.0a328cd9c1afd0afe8e3b1ec5165b1b4.png", "/staff-app/assets/node_modules/expo-router/assets/react-navigation/elements/back-icon.35ba0eaec5a4f5ed12ca16fabeae451d.png", "/staff-app/assets/node_modules/expo-router/assets/react-navigation/elements/clear-icon.c94f6478e7ae0cdd9f15de1fcb9e5e55.png", "/staff-app/assets/node_modules/expo-router/assets/react-navigation/elements/clear-icon.c94f6478e7ae0cdd9f15de1fcb9e5e55@2x.png", "/staff-app/assets/node_modules/expo-router/assets/react-navigation/elements/clear-icon.c94f6478e7ae0cdd9f15de1fcb9e5e55@3x.png", "/staff-app/assets/node_modules/expo-router/assets/react-navigation/elements/clear-icon.c94f6478e7ae0cdd9f15de1fcb9e5e55@4x.png", "/staff-app/assets/node_modules/expo-router/assets/react-navigation/elements/close-icon.808e1b1b9b53114ec2838071a7e6daa7.png", "/staff-app/assets/node_modules/expo-router/assets/react-navigation/elements/close-icon.808e1b1b9b53114ec2838071a7e6daa7@2x.png", "/staff-app/assets/node_modules/expo-router/assets/react-navigation/elements/close-icon.808e1b1b9b53114ec2838071a7e6daa7@3x.png", "/staff-app/assets/node_modules/expo-router/assets/react-navigation/elements/close-icon.808e1b1b9b53114ec2838071a7e6daa7@4x.png", "/staff-app/assets/node_modules/expo-router/assets/react-navigation/elements/search-icon.286d67d3f74808a60a78d3ebf1a5fb57.png", "/staff-app/assets/node_modules/expo-router/assets/sitemap.412dd9275b6b48ad28f5e3d81bb1f626.png", "/staff-app/assets/node_modules/expo-router/assets/unmatched.20e71bdf79e3a97bf55fd9e164041578.png", "/staff-app/brand-logo.png", "/staff-app/favicon.ico", "/staff-app/icon-192.png", "/staff-app/icon-512.png", "/staff-app/icon-maskable-192.png", "/staff-app/icon-maskable-512.png", "/staff-app/manifest.webmanifest", "/staff-app/index.html", "/staff-app/_expo/static/js/web/bundle.js?v=79c8c87c159e314dc5dc1094c0ef4c0bc81619682d901f0a51dfe27486693fc1"]; +const PRECACHE = ["/staff-app/apple-touch-icon.png", "/staff-app/assets/assets/brand/3idiots-hero.e5dfd53739f05086b1956e72d585a66a.png", "/staff-app/assets/assets/brand/3idiots.df4a76d2130f0e5b0042f06a8c88693a.png", "/staff-app/assets/assets/brand/abbotsford-hero.78fcb8ee06ee22c4ca659c9254db7512.png", "/staff-app/assets/assets/brand/abbotsford.b26602bba5ce4969733c5422a45ad053.png", "/staff-app/assets/assets/brand/anchorage-hero.0450b828e4f9c1f4456240096598f6f5.png", "/staff-app/assets/assets/brand/anchorage.fea5ce2f6fd18bf2950aa21c0980ed8e.png", "/staff-app/assets/assets/brand/brae.8de9e89ac30966c6669de990370d8e40.png", "/staff-app/assets/assets/brand/cecchinis-hero.f77780fcc94fd668cf35d66d6dc52d81.png", "/staff-app/assets/assets/brand/cecchinis.ebf752fef363247848ae7c0d91938765.png", "/staff-app/assets/assets/brand/drunkencoo-hero.65c21c4da9e466cf4bffc969639a1427.png", "/staff-app/assets/assets/brand/drunkencoo.f6d92af3b14e4205a3deaf4434754c51.png", "/staff-app/assets/assets/brand/greenside-hero.1caec5a6cb939434cccb5f3a613b50f8.png", "/staff-app/assets/assets/brand/greenside.9d1556db97dcb903a3c57e2063ee2255.png", "/staff-app/assets/assets/brand/kirkmichael-hero.63b13cde7fd82eb622622b39ac80c394.png", "/staff-app/assets/assets/brand/kirkmichael.63b13cde7fd82eb622622b39ac80c394.png", "/staff-app/assets/assets/brand/kirkton-hero.9d0837b292c2f4f30f4521d806bb28c3.png", "/staff-app/assets/assets/brand/kirkton.bcf8d846df4861474d224a7a77f498fb.png", "/staff-app/assets/assets/brand/mrbasrais-hero.4ce74641cfcf52d099157c84005b9d2a.png", "/staff-app/assets/assets/brand/mrbasrais.7cc4086dd12ace82529795f1c9f8c900.png", "/staff-app/assets/assets/brand/pizzaioli-hero.1896657c08264cefb49b401891d5448d.png", "/staff-app/assets/assets/brand/pizzaioli.db8c000b62ee407121aa8b90ce45e170.png", "/staff-app/assets/assets/brand/rupeeroom-hero.969fa372add526aaacf3a6c009b8ac92.png", "/staff-app/assets/assets/brand/rupeeroom.689e6fb536dc0845eeb174a1ec7bd346.png", "/staff-app/assets/assets/brand/saltmarsh.85a6a65732635e5148478d743d9ca884.png", "/staff-app/assets/assets/brand/smokinggoat-hero.0588f17ef0eed7f757f22916cd4d37db.png", "/staff-app/assets/assets/brand/smokinggoat.20a3a1970596ab43c5d6468d4ed549a7.png", "/staff-app/assets/assets/brand/souters.f4c58d9349b6e1700fe5abcc9e9b665c.png", "/staff-app/assets/assets/brand/wildings-hero-logo-text.4661e4b935726f2511f9c17a1567c89a.png", "/staff-app/assets/assets/brand/wildings.076f4fcd06d19a0af0205c410f461b14.png", "/staff-app/assets/assets/brand/williewastles-hero.b9d53d27b66f903b5618a7177b2ffad4.png", "/staff-app/assets/assets/brand/williewastles.055a77893ced99bf3a6c5402ba5baac6.png", "/staff-app/assets/assets/brand/yasmins-hero.a5aef62e37dfcecbe0afc056186f4ad9.png", "/staff-app/assets/assets/brand/yasmins.8482602e9f0a965655924835625cb02b.png", "/staff-app/assets/assets/recipes/fishsupper.1609c58319e1e8721f5c639049fb054e.jpg", "/staff-app/assets/assets/recipes/lobster.2fb3485c8e372972099259017358c1b8.jpg", "/staff-app/assets/assets/recipes/moules.a4f342fc7e7fb62c8a0b5c1678bbea3f.jpg", "/staff-app/assets/assets/recipes/skink.4ce7b7c676f9cdcd0a060eda46f5a00e.jpg", "/staff-app/assets/assets/recipes/stp.1061ced765efdcafff2554adc3fc7113.jpg", "/staff-app/assets/assets/specials/sample-chalkboard.e7b4e4450a8483d4219bc6a214158d8f.jpg", "/staff-app/assets/node_modules/@expo-google-fonts/poppins/400Regular/Poppins_400Regular.093ee89be9ede30383f39a899c485a82.ttf", "/staff-app/assets/node_modules/@expo-google-fonts/poppins/500Medium/Poppins_500Medium.bf59c687bc6d3a70204d3944082c5cc0.ttf", "/staff-app/assets/node_modules/@expo-google-fonts/poppins/600SemiBold/Poppins_600SemiBold.6f1520d107205975713ba09df778f93f.ttf", "/staff-app/assets/node_modules/@expo-google-fonts/poppins/700Bold/Poppins_700Bold.08c20a487911694291bd8c5de41315ad.ttf", "/staff-app/assets/node_modules/expo-router/assets/arrow_down.017bc6ba3fc25503e5eb5e53826d48a8.png", "/staff-app/assets/node_modules/expo-router/assets/error.d1ea1496f9057eb392d5bbf3732a61b7.png", "/staff-app/assets/node_modules/expo-router/assets/file.19eeb73b9593a38f8e9f418337fc7d10.png", "/staff-app/assets/node_modules/expo-router/assets/forward.d8b800c443b8972542883e0b9de2bdc6.png", "/staff-app/assets/node_modules/expo-router/assets/pkg.ab19f4cbc543357183a20571f68380a3.png", "/staff-app/assets/node_modules/expo-router/assets/react-navigation/elements/back-icon-mask.0a328cd9c1afd0afe8e3b1ec5165b1b4.png", "/staff-app/assets/node_modules/expo-router/assets/react-navigation/elements/back-icon.35ba0eaec5a4f5ed12ca16fabeae451d.png", "/staff-app/assets/node_modules/expo-router/assets/react-navigation/elements/clear-icon.c94f6478e7ae0cdd9f15de1fcb9e5e55.png", "/staff-app/assets/node_modules/expo-router/assets/react-navigation/elements/clear-icon.c94f6478e7ae0cdd9f15de1fcb9e5e55@2x.png", "/staff-app/assets/node_modules/expo-router/assets/react-navigation/elements/clear-icon.c94f6478e7ae0cdd9f15de1fcb9e5e55@3x.png", "/staff-app/assets/node_modules/expo-router/assets/react-navigation/elements/clear-icon.c94f6478e7ae0cdd9f15de1fcb9e5e55@4x.png", "/staff-app/assets/node_modules/expo-router/assets/react-navigation/elements/close-icon.808e1b1b9b53114ec2838071a7e6daa7.png", "/staff-app/assets/node_modules/expo-router/assets/react-navigation/elements/close-icon.808e1b1b9b53114ec2838071a7e6daa7@2x.png", "/staff-app/assets/node_modules/expo-router/assets/react-navigation/elements/close-icon.808e1b1b9b53114ec2838071a7e6daa7@3x.png", "/staff-app/assets/node_modules/expo-router/assets/react-navigation/elements/close-icon.808e1b1b9b53114ec2838071a7e6daa7@4x.png", "/staff-app/assets/node_modules/expo-router/assets/react-navigation/elements/search-icon.286d67d3f74808a60a78d3ebf1a5fb57.png", "/staff-app/assets/node_modules/expo-router/assets/sitemap.412dd9275b6b48ad28f5e3d81bb1f626.png", "/staff-app/assets/node_modules/expo-router/assets/unmatched.20e71bdf79e3a97bf55fd9e164041578.png", "/staff-app/brand-logo.png", "/staff-app/favicon.ico", "/staff-app/icon-192.png", "/staff-app/icon-512.png", "/staff-app/icon-maskable-192.png", "/staff-app/icon-maskable-512.png", "/staff-app/manifest.webmanifest", "/staff-app/index.html", "/staff-app/_expo/static/js/web/bundle.js?v=8a8ba96019c9b4a7863583657df8e24fb5ecd1a58b26f035f087132262fe9b9e"]; // Hugging Face serves large files (fonts) through a redirect to its CDN. Browsers refuse to hand a *redirected* cached // response to a page, so store a plain copy instead (otherwise fonts, and so the app, fail to load offline). 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); diff --git a/staff-app/team.html b/staff-app/team.html index 7df0fb791c5436872d6631a1834759df08449b02..5320139fd3672cb42e554aa1451206f7ad67444c 100644 --- a/staff-app/team.html +++ b/staff-app/team.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - +